From 04e730b4b035a9cc5a457c2d7e222713ffc414b3 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Tue, 28 Nov 2023 20:15:52 -0500 Subject: [PATCH 01/11] LEAF IFTHEN initial testing w greater, less --- LEAF_Nexus/js/employeeSelector.js | 2 +- LEAF_Nexus/js/nationalEmployeeSelector.js | 4 +- LEAF_Request_Portal/js/form.js | 193 ++++++++---------- .../LEAF_conditions_editor.js | 8 + 4 files changed, 92 insertions(+), 115 deletions(-) diff --git a/LEAF_Nexus/js/employeeSelector.js b/LEAF_Nexus/js/employeeSelector.js index 69cc14d38..ca6f29425 100644 --- a/LEAF_Nexus/js/employeeSelector.js +++ b/LEAF_Nexus/js/employeeSelector.js @@ -246,7 +246,7 @@ employeeSelector.prototype.search = function () { if ( response[i].serviceData != undefined && response[i].serviceData[0] != undefined && - response[i].serviceData[0].groupTitle != null + response[i].serviceData[0]?.groupTitle != null ) { var counter = 0; var divide = ""; diff --git a/LEAF_Nexus/js/nationalEmployeeSelector.js b/LEAF_Nexus/js/nationalEmployeeSelector.js index 0b757caed..c6fda42c8 100644 --- a/LEAF_Nexus/js/nationalEmployeeSelector.js +++ b/LEAF_Nexus/js/nationalEmployeeSelector.js @@ -301,7 +301,7 @@ nationalEmployeeSelector.prototype.runSearchQuery = function (query, domain) { if ( response[i].serviceData != undefined && - response[i].serviceData[0].groupTitle != null + response[i].serviceData[0]?.groupTitle != null ) { var counter = 0; var divide = ""; @@ -583,7 +583,7 @@ nationalEmployeeSelector.prototype.search = function () { if ( response[i].serviceData != undefined && - response[i].serviceData[0].groupTitle != null + response[i].serviceData[0]?.groupTitle != null ) { var counter = 0; var divide = ""; diff --git a/LEAF_Request_Portal/js/form.js b/LEAF_Request_Portal/js/form.js index 9dc6981ff..ff3b8ab7a 100644 --- a/LEAF_Request_Portal/js/form.js +++ b/LEAF_Request_Portal/js/form.js @@ -304,29 +304,43 @@ var LeafForm = function (containerID) { } }); }; - + const mathCompValues = (arrSelections, arrCompareValues, op) => { + const arrComp = arrCompareValues.map(v => +v); + let result = false; + for (let i = 0; i < arrSelections.length; i++) { + const currVal = +arrSelections[i]; + switch(op) { + case '<=': + case '<': + result = op.includes('=') ? + currVal <= Math.min(arrComp) : currVal < Math.min(...arrComp) //unlikely to be set up with more than one, just in case + break; + case '>=': + case '>': + result = op.includes('=') ? + currVal >= Math.max(arrComp) : currVal > Math.max(...arrComp) + break; + default: + break; + } + if(result === true) { + break + } + } + return result; + } /** * returns true if any of the selected values are in the comparisonValues - * @param {array} multiChoiceElements array of option elements or checkboxes + * @param {array} multiChoiceSelections array of option values * @param {array} comparisonValues array of values to compare against * @returns */ const valIncludesMultiselOption = ( - multiChoiceElements = [], + multiChoiceSelections = [], comparisonValues = [] ) => { let result = false; - //get the values associated with the selection elements - let vals = multiChoiceElements.map((sel) => { - if (sel?.label) { - //multiselect option - return sanitize(sel.label.replaceAll("\r", "").trim()); - } else { - //checkboxes - return sanitize(sel.value.replaceAll("\r", "").trim()); - } - }); - vals.forEach((v) => { + multiChoiceSelections.forEach((v) => { if (comparisonValues.includes(v)) { result = true; } @@ -431,111 +445,66 @@ var LeafForm = function (containerID) { const parentComparisonValues = cond.selectedParentValue.trim(); const outcome = cond.selectedOutcome.toLowerCase(); - switch (cond.selectedOp) { + //multioption formats options will be a string of values separated with \n + const arrCompareValues = parentComparisonValues + .split("\n") + .map((option) => option.replaceAll("\r", "").trim()); + //actual selected elements for multiselect and checkboxes (option or input elements) + const selectionElements = parentFormat === "multiselect" ? + Array.from( + document.getElementById(parent_id)?.selectedOptions || [] + ) : + Array.from( + document.querySelectorAll( + `input[type="checkbox"][id^="${parent_id}"]:checked` + ) || [] + ); + const multiSelValues = selectionElements.map((sel) => { + return sel?.label ? //multiselect : checkboxes + sanitize(sel.label.replaceAll("\r", "").trim()) : + sanitize(sel.value.replaceAll("\r", "").trim()) + }); + //selected value for a radio or single select dropdown + const parent_val = getParentValue(parentFormat, parent_id); + + let comparison = null; + const op = cond.selectedOp; + switch (op) { case "==": - //these are repetitive, but potentially more confusing in a method because of their alteration of variables and comparison differences between operators - if (multiOptionFormats.includes(parentFormat)) { - //values from the condition to compare against. For multioption formats this will be a string of values separated with \n - const arrCompareValues = parentComparisonValues - .split("\n") - .map((option) => option.replaceAll("\r", "").trim()); - //actual selected elements for multiselect and checkboxes (option or input elements) - const selectionElements = - parentFormat === "multiselect" - ? Array.from( - document.getElementById(parent_id)?.selectedOptions || [] - ) - : Array.from( - document.querySelectorAll( - `input[type="checkbox"][id^="${parent_id}"]:checked` - ) || [] - ); - //hide and show should be mutually exclusive and only matter once, so don't continue if it has already become true - if ( - ["hide", "show"].includes(outcome) && - !hideShowConditionMet && - valIncludesMultiselOption(selectionElements, arrCompareValues) - ) { - hideShowConditionMet = true; - } - //likewise if there are mult controllers for a prefill then they should have the same prefill value - if ( - outcome === "pre-fill" && - childPrefillValue === "" && - valIncludesMultiselOption(selectionElements, arrCompareValues) - ) { - childPrefillValue = cond.selectedChildValue.trim(); - } - } else { - const parent_val = getParentValue(parentFormat, parent_id); - if ( - ["hide", "show"].includes(outcome) && - !hideShowConditionMet && - parentComparisonValues === parent_val - ) { - hideShowConditionMet = true; - } - if ( - outcome === "pre-fill" && - childPrefillValue === "" && - parentComparisonValues === parent_val - ) { - childPrefillValue = cond.selectedChildValue.trim(); - } - } - break; case "!=": - if (multiOptionFormats.includes(parentFormat)) { - const arrCompareValues = parentComparisonValues - .split("\n") - .map((option) => option.replaceAll("\r", "").trim()); - const selectionElements = - parentFormat === "multiselect" - ? Array.from( - document.getElementById(parent_id)?.selectedOptions || [] - ) - : Array.from( - document.querySelectorAll( - `input[type="checkbox"][id^="${parent_id}"]:checked` - ) || [] - ); - - if ( - ["hide", "show"].includes(outcome) && - !hideShowConditionMet && - !valIncludesMultiselOption(selectionElements, arrCompareValues) - ) { - hideShowConditionMet = true; - } - if ( - outcome === "pre-fill" && - childPrefillValue === "" && - !valIncludesMultiselOption(selectionElements, arrCompareValues) - ) { - childPrefillValue = cond.selectedChildValue.trim(); - } - } else { - const parent_val = getParentValue(parentFormat, parent_id); - if ( - ["hide", "show"].includes(outcome) && - !hideShowConditionMet && - parentComparisonValues !== parent_val - ) { - hideShowConditionMet = true; - } - if ( - outcome === "pre-fill" && - childPrefillValue === "" && - parentComparisonValues !== parent_val - ) { - childPrefillValue = cond.selectedChildValue.trim(); - } + //define comparison for value equality checking + comparison = multiOptionFormats.includes(parentFormat) ? + valIncludesMultiselOption(multiSelValues, arrCompareValues) : + arrCompareValues[0] === parent_val; + if(op.includes('!')) { + comparison = !comparison; } break; + case '<': + case '<=': + case '>': + case '>=': + comparison = multiOptionFormats.includes(parentFormat) ? + mathCompValues(multiSelValues, arrCompareValues, op) : + mathCompValues([parent_val], arrCompareValues, op) + break; default: - console.log(cond.selectedOp); + console.log(op); break; } + if ( + ["hide", "show"].includes(outcome) && + comparison === true + ) { + hideShowConditionMet = true; + } + if ( + outcome === "pre-fill" && + childPrefillValue === "" && + comparison === true + ) { + childPrefillValue = cond.selectedChildValue.trim(); + } }); /*There should only be hide OR show, and prefills should have only one valid comparison entry, so diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index 5aadc8101..d79559f01 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -601,6 +601,14 @@ const ConditionsEditor = Vue.createApp({ ]; break; } + if (this.selectedParentValueOptions.every(opt => Number.isFinite(+opt))) { + operators = operators.concat([ + {val:">", text: "is greater than"}, + {val:">=", text: "is greater or equal to"}, + {val:"<", text: "is less than"}, + {val:"<=", text: "is less or equal to"}, + ]); + } return operators; }, /** From 89351af376b4decf618f8e46692865b0dd3f79c5 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 29 Nov 2023 13:27:32 -0500 Subject: [PATCH 02/11] LEAF 4169 change op values to avoid problem chars, add gthan lthan logic to server, printform --- LEAF_Request_Portal/js/form.js | 60 ++++++++----------- .../LEAF_conditions_editor.js | 22 +++++-- LEAF_Request_Portal/sources/Form.php | 37 +++++++++++- LEAF_Request_Portal/templates/print_form.tpl | 49 +++++++++++---- 4 files changed, 116 insertions(+), 52 deletions(-) diff --git a/LEAF_Request_Portal/js/form.js b/LEAF_Request_Portal/js/form.js index ff3b8ab7a..af5d2a24a 100644 --- a/LEAF_Request_Portal/js/form.js +++ b/LEAF_Request_Portal/js/form.js @@ -304,31 +304,7 @@ var LeafForm = function (containerID) { } }); }; - const mathCompValues = (arrSelections, arrCompareValues, op) => { - const arrComp = arrCompareValues.map(v => +v); - let result = false; - for (let i = 0; i < arrSelections.length; i++) { - const currVal = +arrSelections[i]; - switch(op) { - case '<=': - case '<': - result = op.includes('=') ? - currVal <= Math.min(arrComp) : currVal < Math.min(...arrComp) //unlikely to be set up with more than one, just in case - break; - case '>=': - case '>': - result = op.includes('=') ? - currVal >= Math.max(arrComp) : currVal > Math.max(...arrComp) - break; - default: - break; - } - if(result === true) { - break - } - } - return result; - } + /** * returns true if any of the selected values are in the comparisonValues * @param {array} multiChoiceSelections array of option values @@ -466,6 +442,9 @@ var LeafForm = function (containerID) { }); //selected value for a radio or single select dropdown const parent_val = getParentValue(parentFormat, parent_id); + //make both arrays for consistency and filter out any empties + let val = multiOptionFormats.includes(parentFormat) ? multiSelValues : [parent_val]; + val = val.filter(v => v !== ''); let comparison = null; const op = cond.selectedOp; @@ -474,19 +453,32 @@ var LeafForm = function (containerID) { case "!=": //define comparison for value equality checking comparison = multiOptionFormats.includes(parentFormat) ? - valIncludesMultiselOption(multiSelValues, arrCompareValues) : - arrCompareValues[0] === parent_val; + valIncludesMultiselOption(val, arrCompareValues) : + val[0] !== undefined && val[0] === arrCompareValues[0]; if(op.includes('!')) { comparison = !comparison; } break; - case '<': - case '<=': - case '>': - case '>=': - comparison = multiOptionFormats.includes(parentFormat) ? - mathCompValues(multiSelValues, arrCompareValues, op) : - mathCompValues([parent_val], arrCompareValues, op) + case 'lt': + case 'lte': + case 'gt': + case 'gte': + const arrNumVals = val.map(v => +v); + const arrNumComp = arrCompareValues.map(v => +v); + const orEq = op.includes('e'); + const gtr = op.includes('g'); + for (let i = 0; i < arrNumVals.length; i++) { + const currVal = arrNumVals[i]; + if(gtr === true) { + //unlikely to be set up with more than one comp val, but checking just in case + comparison = orEq === true ? currVal >= Math.max(...arrNumComp) : currVal > Math.max(...arrNumComp); + } else { + comparison = orEq === true ? currVal <= Math.min(...arrNumComp) : currVal < Math.min(...arrNumComp); + } + if(comparison === true) { + break; + } + } break; default: console.log(op); diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index d79559f01..b6495a7b9 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -356,15 +356,25 @@ const ConditionsEditor = Vue.createApp({ getOperatorText(condition = {}) { const parFormat = condition.parentFormat.toLowerCase(); let text = condition.selectedOp; - switch(text) { + + const op = condition.selectedOp; + switch(op) { case '==': text = this.multiOptionFormats.includes(parFormat) ? 'includes' : 'is'; break; case '!=': text = this.multiOptionFormats.includes(parFormat) ? 'does not include' : 'is not'; break; + case 'gt': + case 'gte': + case 'lt': + case 'lte': + const glText = op.includes('g') ? 'greater than' : 'less than'; + const orEq = op.includes('e') ? ' or equal to' : ''; + text = `is ${glText}${orEq}`; + break; default: - break; + break; } return text; }, @@ -603,10 +613,10 @@ const ConditionsEditor = Vue.createApp({ } if (this.selectedParentValueOptions.every(opt => Number.isFinite(+opt))) { operators = operators.concat([ - {val:">", text: "is greater than"}, - {val:">=", text: "is greater or equal to"}, - {val:"<", text: "is less than"}, - {val:"<=", text: "is less or equal to"}, + {val:"gt", text: "is greater than"}, + {val:"gte", text: "is greater or equal to"}, + {val:"lt", text: "is less than"}, + {val:"lte", text: "is less or equal to"}, ]); } return operators; diff --git a/LEAF_Request_Portal/sources/Form.php b/LEAF_Request_Portal/sources/Form.php index b592ae7b8..d9a6b0bb2 100644 --- a/LEAF_Request_Portal/sources/Form.php +++ b/LEAF_Request_Portal/sources/Form.php @@ -1610,13 +1610,48 @@ public function getProgress($recordID) $conditionMet = true; } break; + case 'gt': + case 'gte': + case 'lt': + case 'lte': + //conv numbers. don't allow empties + $arrNumVals = array(); + $arrNumComp = array(); + foreach($currentParentDataValue as $v) { + $val = $v ?? ''; + if($val !== '') { + $arrNumVals[] = (float) $val; + } + } + foreach($conditionParentValue as $cval) { + $val = $cval ?? ''; + if($val !== '') { + $arrNumComp[] = (float) $cval; + } + } + $orEq = str_contains($operator, 'e'); + $gtr = str_contains($operator, 'g'); + $len = count(array_values($arrNumVals)); + for ($i = 0; $i < $len; $i++) { + $currVal = $arrNumVals[$i]; + if($gtr === true) { + $conditionMet = $orEq === true ? $currVal >= max($arrNumComp) : $currVal > max($arrNumComp); + } else { + $conditionMet = $orEq === true ? $currVal <= min($arrNumComp) : $currVal < min($arrNumComp); + } + if($conditionMet === true) { + break; + } + } + break; default: break; } } //if the question is not being shown due to its conditions, do not count it as a required question - if (($conditionMet === false && strtolower($c->selectedOutcome) === 'show') || ($conditionMet === true && strtolower($c->selectedOutcome) === 'hide')) { + if (($conditionMet === false && strtolower($c->selectedOutcome) === 'show') || + ($conditionMet === true && strtolower($c->selectedOutcome) === 'hide')) { $countRequestRequired--; break; } diff --git a/LEAF_Request_Portal/templates/print_form.tpl b/LEAF_Request_Portal/templates/print_form.tpl index e84b6b8ec..49b99f473 100644 --- a/LEAF_Request_Portal/templates/print_form.tpl +++ b/LEAF_Request_Portal/templates/print_form.tpl @@ -531,25 +531,52 @@ function doSubmit(recordID) { selectedParentOptionsLI !== null)) { if (comparison !== true) { //no need to re-assess if it has already become true - const val = multiChoiceFormats.includes(parentFormat) ? arrParVals : elParentInd?.innerText - .trim(); - - let compVal = ''; + let val = multiChoiceFormats.includes(parentFormat) ? + arrParVals : + [ + (elParentInd?.innerText || '').trim() + ]; + val = val.filter(v => v !== ''); + + let compVal = []; if (multiChoiceFormats.includes(parentFormat)) { compVal = $('
').html(conditions[i].selectedParentValue).text().trim().split('\n'); compVal = compVal.map(v => v.trim()); } else { - compVal = $('
').html(conditions[i].selectedParentValue).text().trim(); + compVal = [ + $('
').html(conditions[i].selectedParentValue).text().trim() + ]; } - - switch (conditions[i].selectedOp) { + const op = conditions[i].selectedOp; + switch (op) { case '==': - comparison = multiChoiceFormats.includes(parentFormat) ? valIncludesMultiselOption(val, - compVal) : val === compVal; + comparison = multiChoiceFormats.includes(parentFormat) ? + valIncludesMultiselOption(val, compVal) : val[0] !== undefined && val[0] === compVal[0]; break; case '!=': - comparison = multiChoiceFormats.includes(parentFormat) ? !valIncludesMultiselOption(val, - compVal) : val !== compVal; + comparison = multiChoiceFormats.includes(parentFormat) ? + !valIncludesMultiselOption(val, compVal) : val[0] !== undefined && val[0] !== compVal[0]; + break; + case 'lt': + case 'lte': + case 'gt': + case 'gte': + const arrNumVals = val.map(v => +v); + const arrNumComp = compVal.map(v => +v); + const orEq = op.includes('e'); + const gtr = op.includes('g'); + for (let i = 0; i < arrNumVals.length; i++) { + const currVal = arrNumVals[i]; + if(gtr === true) { + //unlikely to be set up with more than one comp val, but checking just in case + comparison = orEq === true ? currVal >= Math.max(...arrNumComp) : currVal > Math.max(...arrNumComp); + } else { + comparison = orEq === true ? currVal <= Math.min(...arrNumComp) : currVal < Math.min(...arrNumComp); + } + if(comparison === true) { + break; + } + } break; default: console.log(conditions[i].selectedOp); From 9e2d8677a54ec3ecbbf7d68088aa994d6737117c Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 29 Nov 2023 16:47:53 -0500 Subject: [PATCH 03/11] LEAF 4169 greater than less than ifthen Use some instead of every for operator trigger. Filter out NaN values and handle some edge cases. Add vue side code and rebuild --- LEAF_Request_Portal/js/form.js | 30 +++++++++++------- .../LEAF_conditions_editor.js | 2 +- LEAF_Request_Portal/sources/Form.php | 31 ++++++++++--------- LEAF_Request_Portal/templates/print_form.tpl | 30 +++++++++++------- .../form_editor/form-editor-view.chunk.js | 2 +- .../dialog_content/ConditionsEditorDialog.js | 20 +++++++++++- 6 files changed, 73 insertions(+), 42 deletions(-) diff --git a/LEAF_Request_Portal/js/form.js b/LEAF_Request_Portal/js/form.js index af5d2a24a..6bb52f87c 100644 --- a/LEAF_Request_Portal/js/form.js +++ b/LEAF_Request_Portal/js/form.js @@ -463,20 +463,26 @@ var LeafForm = function (containerID) { case 'lte': case 'gt': case 'gte': - const arrNumVals = val.map(v => +v); - const arrNumComp = arrCompareValues.map(v => +v); + const arrNumVals = val + .filter(v => !isNaN(v)) + .map(v => +v); + const arrNumComp = arrCompareValues + .filter(v => !isNaN(v)) + .map(v => +v); const orEq = op.includes('e'); const gtr = op.includes('g'); - for (let i = 0; i < arrNumVals.length; i++) { - const currVal = arrNumVals[i]; - if(gtr === true) { - //unlikely to be set up with more than one comp val, but checking just in case - comparison = orEq === true ? currVal >= Math.max(...arrNumComp) : currVal > Math.max(...arrNumComp); - } else { - comparison = orEq === true ? currVal <= Math.min(...arrNumComp) : currVal < Math.min(...arrNumComp); - } - if(comparison === true) { - break; + if(arrNumComp.length > 0) { + for (let i = 0; i < arrNumVals.length; i++) { + const currVal = arrNumVals[i]; + if(gtr === true) { + //unlikely to be set up with more than one comp val, but checking just in case + comparison = orEq === true ? currVal >= Math.max(...arrNumComp) : currVal > Math.max(...arrNumComp); + } else { + comparison = orEq === true ? currVal <= Math.min(...arrNumComp) : currVal < Math.min(...arrNumComp); + } + if(comparison === true) { + break; + } } } break; diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index b6495a7b9..59d630d0c 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -611,7 +611,7 @@ const ConditionsEditor = Vue.createApp({ ]; break; } - if (this.selectedParentValueOptions.every(opt => Number.isFinite(+opt))) { + if (this.selectedParentValueOptions.some(opt => Number.isFinite(+opt))) { operators = operators.concat([ {val:"gt", text: "is greater than"}, {val:"gte", text: "is greater or equal to"}, diff --git a/LEAF_Request_Portal/sources/Form.php b/LEAF_Request_Portal/sources/Form.php index d9a6b0bb2..7302105ba 100644 --- a/LEAF_Request_Portal/sources/Form.php +++ b/LEAF_Request_Portal/sources/Form.php @@ -1618,29 +1618,30 @@ public function getProgress($recordID) $arrNumVals = array(); $arrNumComp = array(); foreach($currentParentDataValue as $v) { - $val = $v ?? ''; - if($val !== '') { - $arrNumVals[] = (float) $val; + if(is_numeric($v)) { + $arrNumVals[] = (float) $v; } } foreach($conditionParentValue as $cval) { - $val = $cval ?? ''; - if($val !== '') { + if(is_numeric($cval)) { $arrNumComp[] = (float) $cval; } } $orEq = str_contains($operator, 'e'); $gtr = str_contains($operator, 'g'); - $len = count(array_values($arrNumVals)); - for ($i = 0; $i < $len; $i++) { - $currVal = $arrNumVals[$i]; - if($gtr === true) { - $conditionMet = $orEq === true ? $currVal >= max($arrNumComp) : $currVal > max($arrNumComp); - } else { - $conditionMet = $orEq === true ? $currVal <= min($arrNumComp) : $currVal < min($arrNumComp); - } - if($conditionMet === true) { - break; + $lenv = count(array_values($arrNumVals)); + $lenc = count(array_values($arrNumComp)); + if($lenc > 0) { + for ($i = 0; $i < $lenv; $i++) { + $currVal = $arrNumVals[$i]; + if($gtr === true) { + $conditionMet = $orEq === true ? $currVal >= max($arrNumComp) : $currVal > max($arrNumComp); + } else { + $conditionMet = $orEq === true ? $currVal <= min($arrNumComp) : $currVal < min($arrNumComp); + } + if($conditionMet === true) { + break; + } } } break; diff --git a/LEAF_Request_Portal/templates/print_form.tpl b/LEAF_Request_Portal/templates/print_form.tpl index 49b99f473..8ad2b091d 100644 --- a/LEAF_Request_Portal/templates/print_form.tpl +++ b/LEAF_Request_Portal/templates/print_form.tpl @@ -561,20 +561,26 @@ function doSubmit(recordID) { case 'lte': case 'gt': case 'gte': - const arrNumVals = val.map(v => +v); - const arrNumComp = compVal.map(v => +v); + const arrNumVals = val + .filter(v => !isNaN(v)) + .map(v => +v); + const arrNumComp = compVal + .filter(v => !isNaN(v)) + .map(v => +v); const orEq = op.includes('e'); const gtr = op.includes('g'); - for (let i = 0; i < arrNumVals.length; i++) { - const currVal = arrNumVals[i]; - if(gtr === true) { - //unlikely to be set up with more than one comp val, but checking just in case - comparison = orEq === true ? currVal >= Math.max(...arrNumComp) : currVal > Math.max(...arrNumComp); - } else { - comparison = orEq === true ? currVal <= Math.min(...arrNumComp) : currVal < Math.min(...arrNumComp); - } - if(comparison === true) { - break; + if(arrNumComp.length > 0) { + for (let i = 0; i < arrNumVals.length; i++) { + const currVal = arrNumVals[i]; + if(gtr === true) { + //unlikely to be set up with more than one comp val, but checking just in case + comparison = orEq === true ? currVal >= Math.max(...arrNumComp) : currVal > Math.max(...arrNumComp); + } else { + comparison = orEq === true ? currVal <= Math.min(...arrNumComp) : currVal < Math.min(...arrNumComp); + } + if(comparison === true) { + break; + } } } break; diff --git a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js index e88722a9a..22ad24084 100644 --- a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js +++ b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js @@ -1 +1 @@ -"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes)},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
\n \n
\n
'}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
\n
\n
Form Name (up to 50 characters)
\n
{{nameCharsRemaining}}
\n
\n \n
\n
Form Description (up to 255 characters)
\n
{{descrCharsRemaining}}
\n
\n \n
'}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
\n
\n Loading...\n loading...\n
\n
\n
\n \n \n
\n
'},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:(null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
\n Move column left\n Move column right
\n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
\n \n \n
\n
\n \n \n \n \n
\n
'},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
\n Special access restrictions\n
\n Restrictions will limit view access to the request initiator and members of specific groups.
\n They will also only allow the specified groups to apply search filters for this field.
\n All others will see "[protected data]".\n
\n \n
{{ statusMessageError }}
\n \n
\n \n
\n
'}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
    ","
  1. ","
    ","

    ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

    \n
    \n \n \n
    \n \n \n
    \n
    \n
    \n
    \n \n
    {{shortlabelCharsRemaining}}
    \n
    \n \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n

    Format Information

    \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
    \n
    \n
    \n \n \n
    \n
    \n \n \n
    \n
    \n \n
    \n
    \n  Columns ({{gridJSON.length}}):\n
    \n
    \n \n \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n Attributes\n
    \n \n \n
    \n \n \n \n This field will be archived.  It can be
    re-enabled by using Restore Fields.\n
    \n \n Deleted items can only be re-enabled
    within 30 days by using Restore Fields.\n
    \n
    \n
    '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
    \n
    Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
    {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
    {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

    \n
    \n html (for pages where the user can edit data): \n \n
    \n
    \n
    \n htmlPrint (for pages where the user can only read data): \n \n
    \n \n
    \n
    \n
    \n Notice:
    \n

    Please go to LEAF Programmer\n to ensure continued access to this area.

    \n
    '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
    \n

    Stapled forms will show up on the same page as the primary form.

    \n

    The order of the forms will be determined by the forms\' assigned sort values.

    \n
    \n
      \n
    • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
    • \n
    \n

    \n
    \n \n
    There are no available forms to merge
    \n
    \n
    '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
    \n

    {{formNameStripped()}}

    \n

    Collaborators have access to fill out data fields at any time in the workflow.

    \n

    This is typically used to give groups access to fill out internal-use fields.

    \n
    \n \n

    \n
    \n \n
    There are no available groups to add
    \n
    \n
    '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
    \n
    Are you sure you want to delete this form?
    \n
    {{formName}}
    \n
    {{formDescription}}
    \n
    ⚠️ This form still has stapled forms attached
    \n
    '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&0===parseInt(t.isDisabled)&&t.categoryID===e.formID}));e.indicators=o,e.indicators.forEach((function(t){null!==t.parentIndicatorID?e.addHeaderIDs(parseInt(t.parentIndicatorID),t):t.headerIndicatorID=parseInt(t.indicatorID)})),e.appIsLoadingIndicators=!1},error:function(e){return console.log(e)}})},updateSelectedParentIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue=""),this.updateChoicesJS()},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&(this.updateChoicesJS(),this.addOrgSelector())},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="parent"===(t=t.toLowerCase())?this.parentFormat:this.childFormat,n="";this.multiOptionFormats.includes(o)?(Array.from(e.selectedOptions).forEach((function(e){n+=e.label.trim()+"\n"})),n=n.trim()):n=e.value,"parent"===t?this.selectedParentValue=XSSHelpers.stripAllTags(n):"child"===t&&(this.selectedChildValue=XSSHelpers.stripAllTags(n))},addHeaderIDs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.indicators.find((function(t){return parseInt(t.indicatorID)===e}));void 0!==o&&(null===(null==o?void 0:o.parentIndicatorID)?t.headerIndicatorID=e:this.addHeaderIDs(parseInt(o.parentIndicatorID),t))},newCondition:function(){this.selectedConditionJSON="",this.showConditionEditor=!0,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n.length>0?JSON.stringify(n):"",CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.closeFormDialog()):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.updateChoicesJS(),this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp;switch(o){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not"}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return parseInt(e.indicatorID)===n})),r=((null==i?void 0:i.format)||"").toLowerCase().split("\n")[0].trim();return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return parseInt(t.indicatorID)===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return parseInt(t.indicatorID)===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?t.slice(1):[];return(o=o.map((function(e){return e.trim()}))).filter((function(e){return""!==e}))},selectedChildValueOptions:function(){var e=this.childIndicator.format.split("\n"),t=e.length>1?e.slice(1):[];return(t=t.map((function(e){return e.trim()}))).filter((function(e){return""!==e}))},canAddCrosswalk:function(){return"dropdown"===this.childFormat||"multiselect"===this.childFormat},childPrefillDisplay:function(){var e,t,o,n,i="";switch(this.childFormat){case"orgchart_employee":i=" '".concat((null===(e=this.orgchartSelectData)||void 0===e?void 0:e.firstName)||""," ").concat((null===(t=this.orgchartSelectData)||void 0===t?void 0:t.lastName)||"","'");break;case"orgchart_group":i=" '".concat((null===(o=this.orgchartSelectData)||void 0===o?void 0:o.groupTitle)||"","'");break;case"orgchart_position":i=" '".concat((null===(n=this.orgchartSelectData)||void 0===n?void 0:n.positionTitle)||"","'");break;case"multiselect":case"checkboxes":var r=this.selectedChildValue.split("\n").length>1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")}},template:'
    \n \x3c!-- LOADING SPINNER --\x3e\n
    \n Loading... loading...\n
    \n
    \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
    \n
    Choose Delete to confirm removal, or cancel to return
    \n
    \n \n \n
    \n
    \n \n
    \n
    '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
    \n

    This is a Nationally Standardized Subordinate Site

    \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
'},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
\n \n \n\n \n\n \n\n \n\n \n\n \n \n
File Attachment(s)\n

Select File to attach:

\n \n
\n\n \n\n \n \n \n \n \n\n \n
'}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
'.concat(this.formPage+1,"
"):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
\n
\n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
\n
\n\n \x3c!-- TOOLBAR --\x3e\n
\n\n
\n \n \n \n \n
\n \n
\n
\n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
'},T={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},_={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function P(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function O(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(O({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(O({},t.categories[i]));o.push(O(O({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(O(O({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=O({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file +"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes)},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
    \n \n
    \n
    '}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
    \n
    \n
    Form Name (up to 50 characters)
    \n
    {{nameCharsRemaining}}
    \n
    \n \n
    \n
    Form Description (up to 255 characters)
    \n
    {{descrCharsRemaining}}
    \n
    \n \n
    '}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
    \n
    \n Loading...\n loading...\n
    \n
    \n
    \n \n \n
    \n
    '},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:(null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
    \n Move column left\n Move column right
    \n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
    \n \n \n
    \n
    \n \n \n \n \n
    \n
    '},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
    \n Special access restrictions\n
    \n Restrictions will limit view access to the request initiator and members of specific groups.
    \n They will also only allow the specified groups to apply search filters for this field.
    \n All others will see "[protected data]".\n
    \n \n
    {{ statusMessageError }}
    \n \n
    \n \n
    \n
    '}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
      ","
    1. ","
      ","

      ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

      \n
      \n \n \n
      \n \n \n
      \n
      \n
      \n
      \n \n
      {{shortlabelCharsRemaining}}
      \n
      \n \n
      \n
      \n
      \n \n
      \n \n \n
      \n
      \n

      Format Information

      \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
      \n
      \n
      \n \n \n
      \n
      \n \n \n
      \n
      \n \n
      \n
      \n  Columns ({{gridJSON.length}}):\n
      \n
      \n \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n Attributes\n
      \n \n \n
      \n \n \n \n This field will be archived.  It can be
      re-enabled by using Restore Fields.\n
      \n \n Deleted items can only be re-enabled
      within 30 days by using Restore Fields.\n
      \n
      \n
      '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
      \n
      Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
      {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
      {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

      \n
      \n html (for pages where the user can edit data): \n \n
      \n
      \n
      \n htmlPrint (for pages where the user can only read data): \n \n
      \n \n
      \n
      \n
      \n Notice:
      \n

      Please go to LEAF Programmer\n to ensure continued access to this area.

      \n
      '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      Stapled forms will show up on the same page as the primary form.

      \n

      The order of the forms will be determined by the forms\' assigned sort values.

      \n
      \n
        \n
      • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
      • \n
      \n

      \n
      \n \n
      There are no available forms to merge
      \n
      \n
      '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      {{formNameStripped()}}

      \n

      Collaborators have access to fill out data fields at any time in the workflow.

      \n

      This is typically used to give groups access to fill out internal-use fields.

      \n
      \n \n

      \n
      \n \n
      There are no available groups to add
      \n
      \n
      '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
      \n
      Are you sure you want to delete this form?
      \n
      {{formName}}
      \n
      {{formDescription}}
      \n
      ⚠️ This form still has stapled forms attached
      \n
      '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&0===parseInt(t.isDisabled)&&t.categoryID===e.formID}));e.indicators=o,e.indicators.forEach((function(t){null!==t.parentIndicatorID?e.addHeaderIDs(parseInt(t.parentIndicatorID),t):t.headerIndicatorID=parseInt(t.indicatorID)})),e.appIsLoadingIndicators=!1},error:function(e){return console.log(e)}})},updateSelectedParentIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue=""),this.updateChoicesJS()},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&(this.updateChoicesJS(),this.addOrgSelector())},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="parent"===(t=t.toLowerCase())?this.parentFormat:this.childFormat,n="";this.multiOptionFormats.includes(o)?(Array.from(e.selectedOptions).forEach((function(e){n+=e.label.trim()+"\n"})),n=n.trim()):n=e.value,"parent"===t?this.selectedParentValue=XSSHelpers.stripAllTags(n):"child"===t&&(this.selectedChildValue=XSSHelpers.stripAllTags(n))},addHeaderIDs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.indicators.find((function(t){return parseInt(t.indicatorID)===e}));void 0!==o&&(null===(null==o?void 0:o.parentIndicatorID)?t.headerIndicatorID=e:this.addHeaderIDs(parseInt(o.parentIndicatorID),t))},newCondition:function(){this.selectedConditionJSON="",this.showConditionEditor=!0,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n.length>0?JSON.stringify(n):"",CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.closeFormDialog()):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.updateChoicesJS(),this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp,n=e.selectedOp;switch(n){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not";break;case"gt":case"gte":case"lt":case"lte":var i=n.includes("g")?"greater than":"less than",r=n.includes("e")?" or equal to":"";o="is ".concat(i).concat(r)}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return parseInt(e.indicatorID)===n})),r=((null==i?void 0:i.format)||"").toLowerCase().split("\n")[0].trim();return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return parseInt(t.indicatorID)===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return parseInt(t.indicatorID)===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?t.slice(1):[];return(o=o.map((function(e){return e.trim()}))).filter((function(e){return""!==e}))},selectedChildValueOptions:function(){var e=this.childIndicator.format.split("\n"),t=e.length>1?e.slice(1):[];return(t=t.map((function(e){return e.trim()}))).filter((function(e){return""!==e}))},canAddCrosswalk:function(){return"dropdown"===this.childFormat||"multiselect"===this.childFormat},childPrefillDisplay:function(){var e,t,o,n,i="";switch(this.childFormat){case"orgchart_employee":i=" '".concat((null===(e=this.orgchartSelectData)||void 0===e?void 0:e.firstName)||""," ").concat((null===(t=this.orgchartSelectData)||void 0===t?void 0:t.lastName)||"","'");break;case"orgchart_group":i=" '".concat((null===(o=this.orgchartSelectData)||void 0===o?void 0:o.groupTitle)||"","'");break;case"orgchart_position":i=" '".concat((null===(n=this.orgchartSelectData)||void 0===n?void 0:n.positionTitle)||"","'");break;case"multiselect":case"checkboxes":var r=this.selectedChildValue.split("\n").length>1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")}},template:'
      \n \x3c!-- LOADING SPINNER --\x3e\n
      \n Loading... loading...\n
      \n
      \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
      \n
      Choose Delete to confirm removal, or cancel to return
      \n
      \n \n \n
      \n
      \n \n
      \n
      '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
      \n

      This is a Nationally Standardized Subordinate Site

      \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},T={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},_={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function P(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function O(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(O({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(O({},t.categories[i]));o.push(O(O({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(O(O({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=O({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file diff --git a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js index ed9723ed2..994a30abd 100644 --- a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js +++ b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js @@ -224,13 +224,23 @@ export default { getOperatorText(condition = {}) { const parFormat = condition.parentFormat.toLowerCase(); let text = condition.selectedOp; - switch(text) { + + const op = condition.selectedOp; + switch(op) { case '==': text = this.multiOptionFormats.includes(parFormat) ? 'includes' : 'is'; break; case '!=': text = this.multiOptionFormats.includes(parFormat) ? 'does not include' : 'is not'; break; + case 'gt': + case 'gte': + case 'lt': + case 'lte': + const glText = op.includes('g') ? 'greater than' : 'less than'; + const orEq = op.includes('e') ? ' or equal to' : ''; + text = `is ${glText}${orEq}`; + break; default: break; } @@ -435,6 +445,14 @@ export default { ]; break; } + if (this.selectedParentValueOptions.some(opt => Number.isFinite(+opt))) { + operators = operators.concat([ + {val:"gt", text: "is greater than"}, + {val:"gte", text: "is greater or equal to"}, + {val:"lt", text: "is less than"}, + {val:"lte", text: "is less or equal to"}, + ]); + } return operators; }, crosswalkLevelTwo() { From 63be649af5fdf4ea77f60991d9240a65b8a61fc4 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Thu, 30 Nov 2023 11:03:09 -0500 Subject: [PATCH 04/11] LEAF 4169 rm selector changes pending further investigation --- LEAF_Nexus/js/employeeSelector.js | 2 +- LEAF_Nexus/js/nationalEmployeeSelector.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LEAF_Nexus/js/employeeSelector.js b/LEAF_Nexus/js/employeeSelector.js index ca6f29425..69cc14d38 100644 --- a/LEAF_Nexus/js/employeeSelector.js +++ b/LEAF_Nexus/js/employeeSelector.js @@ -246,7 +246,7 @@ employeeSelector.prototype.search = function () { if ( response[i].serviceData != undefined && response[i].serviceData[0] != undefined && - response[i].serviceData[0]?.groupTitle != null + response[i].serviceData[0].groupTitle != null ) { var counter = 0; var divide = ""; diff --git a/LEAF_Nexus/js/nationalEmployeeSelector.js b/LEAF_Nexus/js/nationalEmployeeSelector.js index c6fda42c8..0b757caed 100644 --- a/LEAF_Nexus/js/nationalEmployeeSelector.js +++ b/LEAF_Nexus/js/nationalEmployeeSelector.js @@ -301,7 +301,7 @@ nationalEmployeeSelector.prototype.runSearchQuery = function (query, domain) { if ( response[i].serviceData != undefined && - response[i].serviceData[0]?.groupTitle != null + response[i].serviceData[0].groupTitle != null ) { var counter = 0; var divide = ""; @@ -583,7 +583,7 @@ nationalEmployeeSelector.prototype.search = function () { if ( response[i].serviceData != undefined && - response[i].serviceData[0]?.groupTitle != null + response[i].serviceData[0].groupTitle != null ) { var counter = 0; var divide = ""; From d5ff57f8b42e20c31827c99f98c19bf0e698f9fe Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Mon, 11 Dec 2023 10:55:50 -0500 Subject: [PATCH 05/11] LEAF 4169 greater less and numeric controllers Adjust close and toolip behavior, simplify some logic. Update operator selection. Improve choicesJS triggers. Initial add number and currency parent controls. --- LEAF_Request_Portal/js/form.js | 15 +- .../LEAF_conditions_editor.css | 1 - .../LEAF_conditions_editor.js | 141 ++++++++++------- LEAF_Request_Portal/sources/Form.php | 21 ++- .../vue-dest/form_editor/LEAF_FormEditor.css | 2 +- .../vue-dest/form_editor/LEAF_FormEditor.js | 2 +- .../form_editor/form-editor-view.chunk.js | 2 +- .../src/form_editor/LEAF_FormEditor.scss | 2 +- .../form_editor/LEAF_FormEditor_App_vue.js | 1 + .../dialog_content/ConditionsEditorDialog.js | 142 ++++++++++++------ 10 files changed, 201 insertions(+), 128 deletions(-) diff --git a/LEAF_Request_Portal/js/form.js b/LEAF_Request_Portal/js/form.js index 6bb52f87c..1f72b306f 100644 --- a/LEAF_Request_Portal/js/form.js +++ b/LEAF_Request_Portal/js/form.js @@ -337,7 +337,7 @@ var LeafForm = function (containerID) { elEmptyOption.selected = true; }; /** - * used to get the sanitized input value for radio and dropdown parents + * used to get the sanitized input value for single option parent controllers * @param {*} pFormat format of the parent according to conditions object * @param {*} pIndID id of the parent according to the conditions object * @returns string. @@ -345,17 +345,12 @@ var LeafForm = function (containerID) { const getParentValue = (pFormat = "", pIndID = 0) => { let val = ""; if (pFormat === "radio") { - val = - sanitize( - document - .querySelector(`input[id^="${pIndID}_radio"]:checked`) - ?.value.trim() - ) || ""; + val = document.querySelector(`input[id^="${pIndID}_radio"]:checked`)?.value || ""; } - if (pFormat === "dropdown") { - val = sanitize(document.getElementById(pIndID)?.value.trim()) || ""; + if (["dropdown", "currency", "number"].includes(pFormat)) { + val = document.getElementById(pIndID)?.value || ""; } - return val; + return sanitize(val).trim(); }; /* clear out potential entries and set validator for hidden questions */ diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.css b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.css index d49885f56..98221f1f5 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.css +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.css @@ -82,7 +82,6 @@ body { } #condition_editor_content div.if-then-setup { display: flex; - justify-content: space-between; gap: 0.5rem; align-items: center; } diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index 59d630d0c..cc2d80764 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -15,7 +15,14 @@ const ConditionsEditor = Vue.createApp({ showRemoveModal: false, showConditionEditor: false, selectedConditionJSON: "", - enabledParentFormats: ["dropdown", "multiselect", "radio", "checkboxes"], + enabledParentFormats: { + "dropdown": 1, + "multiselect": 1, + "radio": 1, + "checkboxes": 1, + "number": 1, + "currency": 1 + }, multiOptionFormats: ["multiselect", "checkboxes"], orgchartFormats: ["orgchart_employee","orgchart_group","orgchart_position"], orgchartSelectData: {}, @@ -23,7 +30,20 @@ const ConditionsEditor = Vue.createApp({ crosswalkFile: '', crosswalkHasHeader: false, level2IndID: null, - noPrefillFormats: ['', 'fileupload', 'image', 'grid', 'date', 'number', 'checkbox', 'currency'] + canPrefillChild: { + "text": 1, + "textarea": 1, + "dropdown": 1, + "multiselect": 1, + "radio": 1, + "checkboxes": 1, + "orgchart_employee": 1, + "orgchart_group": 1, + "orgchart_position": 1, + //"number": 1, + //"currency": 1 + }, + numericOperators: ['gt', 'gte', 'lt', 'lte'], }; }, created() { @@ -49,6 +69,7 @@ const ConditionsEditor = Vue.createApp({ success: (res) => { this.indicators = res.filter(ele => parseInt(ele.indicatorID) > 0 && parseInt(ele.isDisabled) === 0); this.updateCurrFormIndicators(); + this.updateTooltips(); }, error: (err) => { console.log(err); @@ -71,10 +92,11 @@ const ConditionsEditor = Vue.createApp({ cache: false }); }, - updateTooltips(formID = '') { - const formIndicators = this.indicators.filter(i => i.categoryID === formID); - formIndicators.map(i => { - const tooltip = typeof i.conditions === 'string' && i.conditions.startsWith('[') ? 'Edit conditions (conditions present)' : 'Edit conditions'; + updateTooltips() { + this.currFormIndicators.forEach(i => { + const tooltip = typeof i.conditions === 'string' && i.conditions.startsWith('[') ? + 'Edit conditions (conditions present)' : 'Edit conditions'; + let elIcon = document.getElementById(`edit_conditions_${i.indicatorID}`); if(elIcon !== null) { elIcon.title = tooltip; @@ -106,7 +128,6 @@ const ConditionsEditor = Vue.createApp({ if(!this.selectedParentValueOptions.includes(this.selectedParentValue)) { this.selectedParentValue = ""; } - this.updateChoicesJS(); }, /** * @param {string} outcome (condition outcome options: Hide, Show, Pre-Fill, crosswalk) @@ -118,7 +139,6 @@ const ConditionsEditor = Vue.createApp({ this.crosswalkHasHeader = false; this.level2IndID = null; if(this.selectedOutcome === 'pre-fill') { - this.updateChoicesJS(); this.addOrgSelector(); } }, @@ -127,11 +147,8 @@ const ConditionsEditor = Vue.createApp({ * @param {string} type parent or child */ updateSelectedOptionValue(target = {}, type = 'parent') { - type = type.toLowerCase(); - const format = type === 'parent' ? this.parentFormat : this.childFormat; - let value = ''; - if (this.multiOptionFormats.includes(format)) { + if (target?.multiple === true) { const arrSelections = Array.from(target.selectedOptions); arrSelections.forEach(sel => { value += sel.label.trim() + '\n'; @@ -140,9 +157,9 @@ const ConditionsEditor = Vue.createApp({ } else { value = target.value.trim(); } - if (type === 'parent') { + if (type.toLowerCase() === 'parent') { this.selectedParentValue = XSSHelpers.stripAllTags(value); - } else if (type === 'child') { + } else if (type.toLowerCase() === 'child') { this.selectedChildValue = XSSHelpers.stripAllTags(value); } }, @@ -216,7 +233,8 @@ const ConditionsEditor = Vue.createApp({ if (res !== 'Invalid Token.') { indToUpdate.conditions = newJSON; this.showRemoveModal = false; - this.clearSelections(true); + this.clearSelections(); + this.updateTooltips(); } else { console.log('error adding condition', res) } }, error:(err) => console.log(err) @@ -248,7 +266,6 @@ const ConditionsEditor = Vue.createApp({ this.crosswalkFile = conditionObj?.crosswalkFile; this.crosswalkHasHeader = conditionObj?.crosswalkHasHeader; this.level2IndID = conditionObj?.level2IndID; - this.updateChoicesJS(); this.addOrgSelector(); }, /** @@ -301,14 +318,6 @@ const ConditionsEditor = Vue.createApp({ const formID = currCategoryID || ''; this.currFormIndicators = this.indicators.filter(i => i.categoryID === formID); this.currFormIndicators.forEach(i => { - //update tooltips for current form - const tooltip = typeof i.conditions === 'string' && i.conditions.startsWith('[') ? - 'Edit conditions (conditions present)' : 'Edit conditions'; - - let elIcon = document.getElementById(`edit_conditions_${i.indicatorID}`); - if(elIcon !== null) { - elIcon.title = tooltip; - } //add header info to assist filtering if (i.parentIndicatorID !== null) { this.addHeaderIDs(parseInt(i.parentIndicatorID), i); @@ -584,7 +593,7 @@ const ConditionsEditor = Vue.createApp({ const parFormat = i.format?.split('\n')[0].trim().toLowerCase(); return i.headerIndicatorID === headerIndicatorID && parseInt(i.indicatorID) !== this.childIndID && - this.enabledParentFormats.includes(parFormat); + this.enabledParentFormats[parFormat] === 1; }); } return selectable; @@ -597,27 +606,37 @@ const ConditionsEditor = Vue.createApp({ switch(this.parentFormat) { case 'multiselect': case 'checkboxes': - operators = [ - {val:"==", text: "includes"}, - {val:"!=", text: "does not include"} - ]; - break; case 'dropdown': case 'radio': - default: - operators = [ + operators = this.multiOptionFormats.includes(this.parentFormat) ? + [ + {val:"==", text: "includes"}, + {val:"!=", text: "does not include"} + ] : + [ {val:"==", text: "is"}, {val:"!=", text: "is not"} + ]; + if (this.selectedParentValueOptions.some(opt => Number.isFinite(+opt))) { + operators = operators.concat([ + {val:"gt", text: "is greater than"}, + {val:"gte", text: "is greater or equal to"}, + {val:"lt", text: "is less than"}, + {val:"lte", text: "is less or equal to"}, + ]); + } + break; + case 'number': + case 'currency': + operators = [ + {val:"gt", text: "is greater than"}, + {val:"gte", text: "is greater or equal to"}, + {val:"lt", text: "is less than"}, + {val:"lte", text: "is less or equal to"}, ]; break; - } - if (this.selectedParentValueOptions.some(opt => Number.isFinite(+opt))) { - operators = operators.concat([ - {val:"gt", text: "is greater than"}, - {val:"gte", text: "is greater or equal to"}, - {val:"lt", text: "is less than"}, - {val:"lte", text: "is less or equal to"}, - ]); + default: + break; } return operators; }, @@ -683,7 +702,13 @@ const ConditionsEditor = Vue.createApp({ break; } return returnVal; - }, + }, + childChoicesKey() { //key for choicesJS box for child prefill. update on list selection, outcome change + return this.selectedConditionJSON + this.selectedOutcome; + }, + parentChoicesKey() {//key for choicesJS box for parent value selection. update on list selection, parID change, op change + return this.selectedConditionJSON + String(this.parentIndID) + this.selectedOperator; + }, /** * @returns {Object} current conditions object */ @@ -771,6 +796,16 @@ const ConditionsEditor = Vue.createApp({ elNew.focus(); } }); + }, + childChoicesKey(newVal, oldVal) { + if(this.selectedOutcome.toLowerCase() == 'pre-fill' && this.multiOptionFormats.includes(this.childFormat)) { + this.updateChoicesJS() + } + }, + parentChoicesKey(newVal, oldVal) { + if(this.multiOptionFormats.includes(this.parentFormat)) { + this.updateChoicesJS() + } } }, template: `
    @@ -836,7 +871,7 @@ const ConditionsEditor = Vue.createApp({ -
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},_={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},T={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function O(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function P(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(P({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(P({},t.categories[i]));o.push(P(P({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(P(P({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=P({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file diff --git a/docker/vue-app/src/form_editor/LEAF_FormEditor.scss b/docker/vue-app/src/form_editor/LEAF_FormEditor.scss index fe0362361..71d5afcdd 100644 --- a/docker/vue-app/src/form_editor/LEAF_FormEditor.scss +++ b/docker/vue-app/src/form_editor/LEAF_FormEditor.scss @@ -762,7 +762,7 @@ table[class$="SelectorTable"] th { align-items: center; min-height: 60px; padding-bottom: 0; - > select, #parent_choices_wrapper { + > select, #parent_choices_wrapper, input { width: 35%; margin: 0; } diff --git a/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js b/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js index 77ad123c6..60c88218e 100644 --- a/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js +++ b/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js @@ -422,6 +422,7 @@ export default { this.dialogData = { indicatorID, } + this.dialogButtonText = {confirm: 'Save', cancel: 'Close'}; this.setCustomDialogTitle(`

    Conditions For ${name} (${indicatorID})

    `); this.setFormDialogComponent('conditions-editor-dialog'); this.showFormDialog = true; diff --git a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js index 994a30abd..21f818244 100644 --- a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js +++ b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js @@ -13,13 +13,33 @@ export default { showRemoveModal: false, showConditionEditor: false, selectedConditionJSON: '', - enabledParentFormats: ['dropdown', 'multiselect', 'radio', 'checkboxes'], + enabledParentFormats: { + "dropdown": 1, + "multiselect": 1, + "radio": 1, + "checkboxes": 1, + "number": 1, + "currency": 1, + }, multiOptionFormats: ['multiselect', 'checkboxes'], orgchartSelectData: {}, crosswalkFile: '', crosswalkHasHeader: false, level2IndID: null, - noPrefillFormats: ['', 'fileupload', 'image', 'grid', 'date', 'number', 'checkbox', 'currency'] + canPrefillChild: { + "text": 1, + "textarea": 1, + "dropdown": 1, + "multiselect": 1, + "radio": 1, + "checkboxes": 1, + "orgchart_employee": 1, + "orgchart_group": 1, + "orgchart_position": 1, + //"number": 1, + //"currency": 1 + }, + numericOperators: ['gt', 'gte', 'lt', 'lte'], } }, inject: [ @@ -77,7 +97,6 @@ export default { if(!this.selectedParentValueOptions.includes(this.selectedParentValue)) { this.selectedParentValue = ""; } - this.updateChoicesJS(); }, /** * @param {string} outcome (condition outcome options: Hide, Show, Pre-Fill) @@ -89,7 +108,6 @@ export default { this.crosswalkHasHeader = false; this.level2IndID = null; if(this.selectedOutcome === 'pre-fill') { - this.updateChoicesJS(); this.addOrgSelector(); } }, @@ -98,22 +116,19 @@ export default { * @param {string} type parent or child */ updateSelectedOptionValue(target = {}, type = 'parent') { - type = type.toLowerCase(); - const format = type === 'parent' ? this.parentFormat : this.childFormat; - let value = ''; - if (this.multiOptionFormats.includes(format)) { + if (target?.multiple === true) { const arrSelections = Array.from(target.selectedOptions); arrSelections.forEach(sel => { value += sel.label.trim() + '\n'; }); value = value.trim(); } else { - value = target.value; + value = target.value.trim(); } - if (type === 'parent') { + if (type.toLowerCase() === 'parent') { this.selectedParentValue = XSSHelpers.stripAllTags(value); - } else if (type === 'child') { + } else if (type.toLowerCase() === 'child') { this.selectedChildValue = XSSHelpers.stripAllTags(value); } }, @@ -133,9 +148,9 @@ export default { this.addHeaderIDs(parseInt(parent.parentIndicatorID), initialIndicator); } }, - newCondition() { + newCondition(showEditor = true) { this.selectedConditionJSON = ''; - this.showConditionEditor = true; + this.showConditionEditor = showEditor; this.selectedOperator = ''; this.parentIndID = 0; this.selectedParentValue = ''; @@ -161,18 +176,21 @@ export default { if (addSelected === true && newConditionIsUnique) { newConditions.push(this.conditions); } - + newConditions = newConditions.length > 0 ? JSON.stringify(newConditions) : ''; $.ajax({ type: 'POST', url: `${this.APIroot}formEditor/${this.childIndID}/conditions`, data: { - conditions: newConditions.length > 0 ? JSON.stringify(newConditions) : '', + conditions: newConditions, CSRFToken: this.CSRFToken }, success: (res)=> { if (res !== 'Invalid Token.') { this.getFormByCategoryID(this.formID); - this.closeFormDialog(); + let refIndicator = this.indicators.find(ind => ind.indicatorID === this.childIndID); + refIndicator.conditions = newConditions; + this.showRemoveModal = false; + this.newCondition(false); } else { console.log('error adding condition', res) } }, error:(err) => console.log(err) @@ -205,7 +223,6 @@ export default { this.crosswalkHasHeader = conditionObj?.crosswalkHasHeader || false; this.level2IndID = conditionObj?.level2IndID || null; this.showConditionEditor = true; - this.updateChoicesJS(); this.addOrgSelector(); }, /** @@ -420,7 +437,7 @@ export default { const parFormat = i.format?.split('\n')[0].trim().toLowerCase(); return i.headerIndicatorID === headerIndicatorID && parseInt(i.indicatorID) !== parseInt(this.childIndicator.indicatorID) && - this.enabledParentFormats.includes(parFormat); + this.enabledParentFormats[parFormat] === 1; }); }, /** @@ -429,29 +446,39 @@ export default { selectedParentOperators() { let operators = []; switch(this.parentFormat) { - case 'multiselect': - case 'checkboxes': - operators = [ - {val:"==", text: "includes"}, - {val:"!=", text: "does not include"} - ]; - break; - case 'dropdown': - case 'radio': - default: - operators = [ - {val:"==", text: "is"}, - {val:"!=", text: "is not"} - ]; - break; - } - if (this.selectedParentValueOptions.some(opt => Number.isFinite(+opt))) { - operators = operators.concat([ + case 'multiselect': + case 'checkboxes': + case 'dropdown': + case 'radio': + operators = this.multiOptionFormats.includes(this.parentFormat) ? + [ + {val:"==", text: "includes"}, + {val:"!=", text: "does not include"} + ] : + [ + {val:"==", text: "is"}, + {val:"!=", text: "is not"} + ]; + if (this.selectedParentValueOptions.some(opt => Number.isFinite(+opt))) { + operators = operators.concat([ + {val:"gt", text: "is greater than"}, + {val:"gte", text: "is greater or equal to"}, + {val:"lt", text: "is less than"}, + {val:"lte", text: "is less or equal to"}, + ]); + } + break; + case 'number': + case 'currency': + operators = [ {val:"gt", text: "is greater than"}, {val:"gte", text: "is greater or equal to"}, {val:"lt", text: "is less than"}, {val:"lte", text: "is less or equal to"}, - ]); + ]; + break; + default: + break; } return operators; }, @@ -510,6 +537,12 @@ export default { } return returnVal; }, + childChoicesKey() { //key for choicesJS box for child prefill. update on list selection, outcome change + return this.selectedConditionJSON + this.selectedOutcome; + }, + parentChoicesKey() {//key for choicesJS box for parent value selection. update on list selection, parID change, op change + return this.selectedConditionJSON + String(this.parentIndID) + this.selectedOperator; + }, /** * @returns {Object} current conditions object, properties to lower and tags removed as needed */ @@ -594,6 +627,16 @@ export default { if (elSaveDiv !== null) { elSaveDiv.style.display = newVal === true ? 'none' : 'flex'; } + }, + childChoicesKey(newVal, oldVal) { + if(this.selectedOutcome.toLowerCase() == 'pre-fill' && this.multiOptionFormats.includes(this.childFormat)) { + this.updateChoicesJS() + } + }, + parentChoicesKey(newVal, oldVal) { + if(this.multiOptionFormats.includes(this.parentFormat)) { + this.updateChoicesJS() + } } }, template: `
    @@ -654,7 +697,7 @@ export default { -
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},_={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},T={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function O(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function P(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(P({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(P({},t.categories[i]));o.push(P(P({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(P(P({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=P({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file diff --git a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js index 21f818244..efb8a28b0 100644 --- a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js +++ b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js @@ -36,8 +36,6 @@ export default { "orgchart_employee": 1, "orgchart_group": 1, "orgchart_position": 1, - //"number": 1, - //"currency": 1 }, numericOperators: ['gt', 'gte', 'lt', 'lte'], } @@ -637,6 +635,11 @@ export default { if(this.multiOptionFormats.includes(this.parentFormat)) { this.updateChoicesJS() } + }, + selectedOperator(newVal, oldVal) { + if (oldVal !== "" && this.numericOperators.includes(newVal) && !this.numericOperators.includes(oldVal)) { + this.selectedParentValue = "" + } } }, template: `
    From a1e17d23aba52d418eb255699756b886e47f2956 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 13 Dec 2023 11:52:48 -0500 Subject: [PATCH 07/11] LEAF 4169 ifthen greater and less Update endpoint for form indicators get and simplify condition setup logic. Fix issue with modal scrolling --- .../LEAF_conditions_editor.js | 194 +++++++----------- 1 file changed, 76 insertions(+), 118 deletions(-) diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index 16d80a30f..405b277a0 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -2,11 +2,11 @@ const ConditionsEditor = Vue.createApp({ data() { return { orgchartPath: orgchartPath, + formID: '', childIndID: 0, parentIndID: 0, windowTop: 0, - indicators: [], currFormIndicators: [], selectedOperator: "", selectedParentValue: "", @@ -45,34 +45,49 @@ const ConditionsEditor = Vue.createApp({ }; }, created() { - this.getAllIndicators(); this.getFileManagerFiles(); }, - mounted() { - document.addEventListener("scroll", this.onScroll); - }, - beforeUnmount() { - document.removeEventListener("scroll", this.onScroll); - }, methods: { - onScroll() { - if (this.childIndID !== 0) return; - this.windowTop = window.top.scrollY; - }, - getAllIndicators() { - //get all enabled indicators + headings - $.ajax({ - type: "GET", - url: "../api/form/indicator/list/unabridged", - success: (res) => { - this.indicators = res.filter(ele => parseInt(ele.indicatorID) > 0 && parseInt(ele.isDisabled) === 0); - this.updateCurrFormIndicators(); + /** + * Get indicators for currCategoryID(MODFORM global) and create flat array for currFormIndicators. + * Ensure ind IDs are numbers, format is trimmed lower, options are trimmed and in array without empty strings. + */ + getFormIndicators() { + let formIndicators = []; + const addIndicator = (index, parentID, node) => { + let options = Array.isArray(node?.options) ? node.options.map(o => o.trim()) : []; + options = options.filter(o => o !== ""); + + formIndicators.push({ + formPage: index, + parentID: +parentID, //null will become 0 + indicatorID: +node.indicatorID, + name: node.name || "", + format: node.format.toLowerCase().trim(), + options: options, + conditions: node.conditions + }); + if(node.child !== null) { + for(let c in node.child) { + addIndicator(index, node.indicatorID, node.child[c]) + } + } + } + + try { + fetch(`../api/form/_${currCategoryID}`) + .then(res => res.json().then(data => { + const formPages = data || []; + formPages.forEach((page, index) => { + addIndicator(index, null, page); + }); + this.currFormIndicators = formIndicators; this.updateTooltips(); - }, - error: (err) => { - console.log(err); - }, - }); + }) + .catch(err => console.log(err))) + } catch (err) { + console.log(err) + } }, getFileManagerFiles() { $.ajax({ @@ -161,30 +176,6 @@ const ConditionsEditor = Vue.createApp({ this.selectedChildValue = XSSHelpers.stripAllTags(value); } }, - selectNewChildIndicator() { - this.clearSelections(); - if (this.childIndID !== 0) { - this.dragElement( - document.getElementById("condition_editor_center_panel") - ); - } - }, - /** - * Recursively searches indicators to add headerIndicatorID to the indicators list. - * The headerIndicatorID is used to track which indicators are on the same page. - * @param {Number} indID parent ID of indicator at the current depth - * @param {Object} initialIndicator reference to the indicator to update - */ - addHeaderIDs(indID = 0, initialIndicator = {}) { - const parent = this.currFormIndicators.find(i => parseInt(i.indicatorID) === indID); - if(parent === undefined) return; - //if the parent has a null parentID, then this is the header, update the passed reference - if (parent?.parentIndicatorID === null) { - initialIndicator.headerIndicatorID = indID; - } else { - this.addHeaderIDs(parseInt(parent.parentIndicatorID), initialIndicator); - } - }, newCondition() { this.selectedConditionJSON = ""; this.showConditionEditor = true; @@ -201,7 +192,7 @@ const ConditionsEditor = Vue.createApp({ postConditions(addSelected = true) { if (this.conditionComplete || addSelected === false) { const childID = this.childIndID; - let indToUpdate = this.currFormIndicators.find(i => parseInt(i.indicatorID) === childID); + let indToUpdate = this.currFormIndicators.find(i => i.indicatorID === childID); //copy of all conditions on child, and filter using stored JSON val let currConditions = [...this.savedConditions]; let newConditions = currConditions.filter(c => JSON.stringify(c) !== this.selectedConditionJSON); @@ -271,6 +262,7 @@ const ConditionsEditor = Vue.createApp({ * @param {Object} el (DOM element) */ dragElement(el = {}) { + el.style.top = window.top.scrollY + 15 + 'px' let pos1 = 0, pos2 = 0, pos3 = 0, @@ -279,7 +271,6 @@ const ConditionsEditor = Vue.createApp({ if (document.getElementById(el.id + "_header")) { document.getElementById(el.id + "_header").onmousedown = dragMouseDown; } - function dragMouseDown(e) { e = e || window.event; e.preventDefault(); @@ -288,7 +279,6 @@ const ConditionsEditor = Vue.createApp({ document.onmouseup = closeDragElement; document.onmousemove = elementDrag; } - function elementDrag(e) { e = e || window.event; e.preventDefault(); @@ -299,7 +289,6 @@ const ConditionsEditor = Vue.createApp({ el.style.top = el.offsetTop - pos2 + "px"; el.style.left = el.offsetLeft - pos1 + "px"; } - function closeDragElement() { if (el.offsetTop - window.top.scrollY < 0) { el.style.top = window.top.scrollY + 15 + "px"; @@ -311,26 +300,11 @@ const ConditionsEditor = Vue.createApp({ document.onmousemove = null; } }, - /** uses variable from mod_form.tpl */ - updateCurrFormIndicators() { - const formID = currCategoryID || ''; - this.currFormIndicators = this.indicators.filter(i => i.categoryID === formID); - this.currFormIndicators.forEach(i => { - //add header info to assist filtering - if (i.parentIndicatorID !== null) { - this.addHeaderIDs(parseInt(i.parentIndicatorID), i); - } else { - i.headerIndicatorID = parseInt(i.indicatorID); - } - }); - }, + //called by event dispatch when indicator chosen forceUpdate() { + this.clearSelections(); + this.formID = currCategoryID || ''; this.childIndID = ifThenIndicatorID; - if (this.childIndID === 0) { - this.getAllIndicators(); - } else { - this.selectNewChildIndicator(); - } }, truncateText(text = "", maxTextLength = 40) { return text?.length > maxTextLength @@ -427,12 +401,8 @@ const ConditionsEditor = Vue.createApp({ const savedChildFormat = (condition?.childFormat || '').toLowerCase().trim(); const savedParentFormat = (condition?.parentFormat || '').toLowerCase().trim(); const savedParIndID = parseInt(condition?.parentIndID || 0); - const parentInd = this.selectableParents.find( - p => parseInt(p.indicatorID) === savedParIndID - ); - const parentIndFormat = (parentInd?.format || '') - .toLowerCase() - .split('\n')[0].trim(); + const parentInd = this.selectableParents.find(p => p.indicatorID === savedParIndID); + const parentIndFormat = parentInd?.format || ''; return savedChildFormat !== this.childFormat || savedParentFormat !== parentIndFormat; }, @@ -554,46 +524,38 @@ const ConditionsEditor = Vue.createApp({ return !['', 'crosswalk'].includes(this.selectedOutcome) && this.selectableParents.length < 1; }, childIndicator() { - const indicator = this.currFormIndicators.find(i => parseInt(i.indicatorID) === this.childIndID); + const indicator = this.currFormIndicators.find(i => i.indicatorID === this.childIndID); return indicator === undefined ? {} : {...indicator}; }, /** * @returns {object} current parent selection */ selectedParentIndicator() { - const indicator = this.selectableParents.find( - i => parseInt(i.indicatorID) === this.parentIndID - ); + const indicator = this.selectableParents.find(i => i.indicatorID === this.parentIndID); return indicator === undefined ? {} : {...indicator}; }, /** * @returns {string} lower case base format of the parent question if there is one */ parentFormat() { - const f = (this.selectedParentIndicator?.format || '').toLowerCase(); - return f.split('\n')[0].trim(); + return this.selectedParentIndicator?.format || ""; }, /** * @returns {string} lower case base format of the child question */ childFormat() { - const f = (this.childIndicator?.format || '').toLowerCase(); - return f.split('\n')[0].trim(); + return this.childIndicator?.format || ""; }, /** * @returns list of indicators that are on the same page, enabled as parents, and different than child */ selectableParents() { - let selectable = []; - const headerIndicatorID = this.childIndicator?.headerIndicatorID || 0; - if (headerIndicatorID !== 0) { - selectable = this.currFormIndicators.filter(i => { - const parFormat = i.format?.split('\n')[0].trim().toLowerCase(); - return i.headerIndicatorID === headerIndicatorID && - parseInt(i.indicatorID) !== this.childIndID && - this.enabledParentFormats[parFormat] === 1; - }); - } + const formPage = this.childIndicator.formPage; + const selectable = this.currFormIndicators.filter(i => { + return i.formPage === formPage && + i.indicatorID !== this.childIndID && + this.enabledParentFormats[i.format] === 1; + }); return selectable; }, /** @@ -644,36 +606,27 @@ const ConditionsEditor = Vue.createApp({ */ crosswalkLevelTwo() { let levelOptions = []; - const headerIndicatorID = this.childIndicator?.headerIndicatorID || 0; - if(headerIndicatorID !== 0) { - levelOptions = this.currFormIndicators.filter((i) => { - const format = i.format?.split("\n")[0].trim().toLowerCase(); - return ( - i.headerIndicatorID === headerIndicatorID && - parseInt(i.indicatorID) !== this.childIndID && - ['dropdown', 'multiselect'].includes(format) - ); - }); - } + const formPage = this.childIndicator.formPage; + levelOptions = this.currFormIndicators.filter(i => { + return ( + i.formPage === formPage && + i.indicatorID !== this.childIndID && + ['dropdown', 'multiselect'].includes(i.format) + ); + }); return levelOptions; }, /** * @returns list of options for comparison based on parent indicator selection */ selectedParentValueOptions() { - const fullFormatToArray = (this.selectedParentIndicator?.format || '').split("\n"); - let options = fullFormatToArray.length > 1 ? fullFormatToArray.slice(1) : []; - options = options.map(o => o.trim()); - return options.filter(o => o !== ''); + return this.selectedParentIndicator?.options || [] }, /** - * @returns list of options for prefill outcomes. Does NOT combine with file loaded options. + * @returns list of options for prefill outcomes. Does not combine with file loaded options. */ selectedChildValueOptions() { - const fullFormatToArray = (this.childIndicator?.format || '').split("\n"); - let options = fullFormatToArray.length > 1 ? fullFormatToArray.slice(1) : []; - options = options.map(o => o.trim()); - return options.filter(o => o !== ''); + return this.childIndicator?.options || [] }, canAddCrosswalk() { return (this.childFormat === 'dropdown' || this.childFormat === 'multiselect') @@ -784,20 +737,25 @@ const ConditionsEditor = Vue.createApp({ } }, watch: { + formID() { + this.getFormIndicators(); + }, childIndID(newVal, oldVal) { setTimeout(() => { const elNew = document.querySelector('#condition_editor_inputs .btnNewCondition'); if(+newVal > 0 && elNew !== null) { + let elPanel = document.getElementById("condition_editor_center_panel"); + this.dragElement(elPanel); elNew.focus(); } }); }, - childChoicesKey(newVal, oldVal) { + childChoicesKey() { if(this.selectedOutcome.toLowerCase() == 'pre-fill' && this.multiOptionFormats.includes(this.childFormat)) { this.updateChoicesJS() } }, - parentChoicesKey(newVal, oldVal) { + parentChoicesKey() { if(this.multiOptionFormats.includes(this.parentFormat)) { this.updateChoicesJS() } @@ -809,7 +767,7 @@ const ConditionsEditor = Vue.createApp({ } }, template: `
    -
    +
    From e042c7b83bcfd7b3bed2200c794b019a8d337265 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 13 Dec 2023 13:04:52 -0500 Subject: [PATCH 08/11] LEAF 4169 vue side endpoint update, cleanup --- .../LEAF_conditions_editor.js | 25 ++-- .../form_editor/form-editor-view.chunk.js | 2 +- .../dialog_content/ConditionsEditorDialog.js | 125 +++++++----------- 3 files changed, 61 insertions(+), 91 deletions(-) diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index 405b277a0..d1e1df471 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -5,7 +5,6 @@ const ConditionsEditor = Vue.createApp({ formID: '', childIndID: 0, parentIndID: 0, - windowTop: 0, currFormIndicators: [], selectedOperator: "", @@ -550,13 +549,11 @@ const ConditionsEditor = Vue.createApp({ * @returns list of indicators that are on the same page, enabled as parents, and different than child */ selectableParents() { - const formPage = this.childIndicator.formPage; - const selectable = this.currFormIndicators.filter(i => { - return i.formPage === formPage && + return this.currFormIndicators.filter(i => + i.formPage === this.childIndicator.formPage && i.indicatorID !== this.childIndID && - this.enabledParentFormats[i.format] === 1; - }); - return selectable; + this.enabledParentFormats[i.format] === 1 + ); }, /** * @returns list of operators and human readable text base on parent format @@ -605,16 +602,12 @@ const ConditionsEditor = Vue.createApp({ * on the same page, not the currently selected question, base format is dropdown or multiselect */ crosswalkLevelTwo() { - let levelOptions = []; const formPage = this.childIndicator.formPage; - levelOptions = this.currFormIndicators.filter(i => { - return ( - i.formPage === formPage && - i.indicatorID !== this.childIndID && - ['dropdown', 'multiselect'].includes(i.format) - ); - }); - return levelOptions; + return this.currFormIndicators.filter(i => + i.formPage === formPage && + i.indicatorID !== this.childIndID && + ['dropdown', 'multiselect'].includes(i.format) + ); }, /** * @returns list of options for comparison based on parent indicator selection diff --git a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js index 41fa97442..7d041788d 100644 --- a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js +++ b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js @@ -1 +1 @@ -"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes)},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
    \n \n
    \n
    '}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
    \n
    \n
    Form Name (up to 50 characters)
    \n
    {{nameCharsRemaining}}
    \n
    \n \n
    \n
    Form Description (up to 255 characters)
    \n
    {{descrCharsRemaining}}
    \n
    \n \n
    '}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
    \n
    \n Loading...\n loading...\n
    \n
    \n
    \n \n \n
    \n
    '},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:(null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
    \n Move column left\n Move column right
    \n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
    \n \n \n
    \n
    \n \n \n \n \n
    \n
    '},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
    \n Special access restrictions\n
    \n Restrictions will limit view access to the request initiator and members of specific groups.
    \n They will also only allow the specified groups to apply search filters for this field.
    \n All others will see "[protected data]".\n
    \n \n
    {{ statusMessageError }}
    \n \n
    \n \n
    \n
    '}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
      ","
    1. ","
      ","

      ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

      \n
      \n \n \n
      \n \n \n
      \n
      \n
      \n
      \n \n
      {{shortlabelCharsRemaining}}
      \n
      \n \n
      \n
      \n
      \n \n
      \n \n \n
      \n
      \n

      Format Information

      \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
      \n
      \n
      \n \n \n
      \n
      \n \n \n
      \n
      \n \n
      \n
      \n  Columns ({{gridJSON.length}}):\n
      \n
      \n \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n Attributes\n
      \n \n \n
      \n \n \n \n This field will be archived.  It can be
      re-enabled by using Restore Fields.\n
      \n \n Deleted items can only be re-enabled
      within 30 days by using Restore Fields.\n
      \n
      \n
      '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
      \n
      Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
      {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
      {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

      \n
      \n html (for pages where the user can edit data): \n \n
      \n
      \n
      \n htmlPrint (for pages where the user can only read data): \n \n
      \n \n
      \n
      \n
      \n Notice:
      \n

      Please go to LEAF Programmer\n to ensure continued access to this area.

      \n
      '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      Stapled forms will show up on the same page as the primary form.

      \n

      The order of the forms will be determined by the forms\' assigned sort values.

      \n
      \n
        \n
      • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
      • \n
      \n

      \n
      \n \n
      There are no available forms to merge
      \n
      \n
      '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      {{formNameStripped()}}

      \n

      Collaborators have access to fill out data fields at any time in the workflow.

      \n

      This is typically used to give groups access to fill out internal-use fields.

      \n
      \n \n

      \n
      \n \n
      There are no available groups to add
      \n
      \n
      '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
      \n
      Are you sure you want to delete this form?
      \n
      {{formName}}
      \n
      {{formDescription}}
      \n
      ⚠️ This form still has stapled forms attached
      \n
      '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&0===parseInt(t.isDisabled)&&t.categoryID===e.formID}));e.indicators=o,e.indicators.forEach((function(t){null!==t.parentIndicatorID?e.addHeaderIDs(parseInt(t.parentIndicatorID),t):t.headerIndicatorID=parseInt(t.indicatorID)})),e.appIsLoadingIndicators=!1},error:function(e){return console.log(e)}})},updateSelectedParentIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue="")},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&this.addOrgSelector()},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="";!0===(null==e?void 0:e.multiple)?(Array.from(e.selectedOptions).forEach((function(e){o+=e.label.trim()+"\n"})),o=o.trim()):o=e.value.trim(),"parent"===t.toLowerCase()?this.selectedParentValue=XSSHelpers.stripAllTags(o):"child"===t.toLowerCase()&&(this.selectedChildValue=XSSHelpers.stripAllTags(o))},addHeaderIDs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.indicators.find((function(t){return parseInt(t.indicatorID)===e}));void 0!==o&&(null===(null==o?void 0:o.parentIndicatorID)?t.headerIndicatorID=e:this.addHeaderIDs(parseInt(o.parentIndicatorID),t))},newCondition:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selectedConditionJSON="",this.showConditionEditor=e,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),n=n.length>0?JSON.stringify(n):"",$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n,CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.indicators.find((function(e){return e.indicatorID===t.childIndID})).conditions=n,t.showRemoveModal=!1,t.newCondition(!1)):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp,n=e.selectedOp;switch(n){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not";break;case"gt":case"gte":case"lt":case"lte":var i=n.includes("g")?"greater than":"less than",r=n.includes("e")?" or equal to":"";o="is ".concat(i).concat(r)}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return parseInt(e.indicatorID)===n})),r=((null==i?void 0:i.format)||"").toLowerCase().split("\n")[0].trim();return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return parseInt(t.indicatorID)===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return parseInt(t.indicatorID)===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?t.slice(1):[];return(o=o.map((function(e){return e.trim()}))).filter((function(e){return""!==e}))},selectedChildValueOptions:function(){var e=this.childIndicator.format.split("\n"),t=e.length>1?e.slice(1):[];return(t=t.map((function(e){return e.trim()}))).filter((function(e){return""!==e}))},canAddCrosswalk:function(){return"dropdown"===this.childFormat||"multiselect"===this.childFormat},childPrefillDisplay:function(){var e,t,o,n,i="";switch(this.childFormat){case"orgchart_employee":i=" '".concat((null===(e=this.orgchartSelectData)||void 0===e?void 0:e.firstName)||""," ").concat((null===(t=this.orgchartSelectData)||void 0===t?void 0:t.lastName)||"","'");break;case"orgchart_group":i=" '".concat((null===(o=this.orgchartSelectData)||void 0===o?void 0:o.groupTitle)||"","'");break;case"orgchart_position":i=" '".concat((null===(n=this.orgchartSelectData)||void 0===n?void 0:n.positionTitle)||"","'");break;case"multiselect":case"checkboxes":var r=this.selectedChildValue.split("\n").length>1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},childChoicesKey:function(){return this.selectedConditionJSON+this.selectedOutcome},parentChoicesKey:function(){return this.selectedConditionJSON+String(this.parentIndID)+this.selectedOperator},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")},childChoicesKey:function(e,t){"pre-fill"==this.selectedOutcome.toLowerCase()&&this.multiOptionFormats.includes(this.childFormat)&&this.updateChoicesJS()},parentChoicesKey:function(e,t){this.multiOptionFormats.includes(this.parentFormat)&&this.updateChoicesJS()},selectedOperator:function(e,t){""!==t&&this.numericOperators.includes(e)&&!this.numericOperators.includes(t)&&(this.selectedParentValue="")}},template:'
      \n \x3c!-- LOADING SPINNER --\x3e\n
      \n Loading... loading...\n
      \n
      \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
      \n
      Choose Delete to confirm removal, or cancel to return
      \n
      \n \n \n
      \n
      \n \n
      \n
      '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
      \n

      This is a Nationally Standardized Subordinate Site

      \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},_={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},T={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function O(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function P(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(P({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(P({},t.categories[i]));o.push(P(P({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(P(P({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=P({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file +"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes)},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
    \n \n
    \n
    '}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
    \n
    \n
    Form Name (up to 50 characters)
    \n
    {{nameCharsRemaining}}
    \n
    \n \n
    \n
    Form Description (up to 255 characters)
    \n
    {{descrCharsRemaining}}
    \n
    \n \n
    '}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
    \n
    \n Loading...\n loading...\n
    \n
    \n
    \n \n \n
    \n
    '},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:(null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
    \n Move column left\n Move column right
    \n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
    \n \n \n
    \n
    \n \n \n \n \n
    \n
    '},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
    \n Special access restrictions\n
    \n Restrictions will limit view access to the request initiator and members of specific groups.
    \n They will also only allow the specified groups to apply search filters for this field.
    \n All others will see "[protected data]".\n
    \n \n
    {{ statusMessageError }}
    \n \n
    \n \n
    \n
    '}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
      ","
    1. ","
      ","

      ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

      \n
      \n \n \n
      \n \n \n
      \n
      \n
      \n
      \n \n
      {{shortlabelCharsRemaining}}
      \n
      \n \n
      \n
      \n
      \n \n
      \n \n \n
      \n
      \n

      Format Information

      \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
      \n
      \n
      \n \n \n
      \n
      \n \n \n
      \n
      \n \n
      \n
      \n  Columns ({{gridJSON.length}}):\n
      \n
      \n \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n Attributes\n
      \n \n \n
      \n \n \n \n This field will be archived.  It can be
      re-enabled by using Restore Fields.\n
      \n \n Deleted items can only be re-enabled
      within 30 days by using Restore Fields.\n
      \n
      \n
      '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
      \n
      Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
      {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
      {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

      \n
      \n html (for pages where the user can edit data): \n \n
      \n
      \n
      \n htmlPrint (for pages where the user can only read data): \n \n
      \n \n
      \n
      \n
      \n Notice:
      \n

      Please go to LEAF Programmer\n to ensure continued access to this area.

      \n
      '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      Stapled forms will show up on the same page as the primary form.

      \n

      The order of the forms will be determined by the forms\' assigned sort values.

      \n
      \n
        \n
      • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
      • \n
      \n

      \n
      \n \n
      There are no available forms to merge
      \n
      \n
      '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      {{formNameStripped()}}

      \n

      Collaborators have access to fill out data fields at any time in the workflow.

      \n

      This is typically used to give groups access to fill out internal-use fields.

      \n
      \n \n

      \n
      \n \n
      There are no available groups to add
      \n
      \n
      '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
      \n
      Are you sure you want to delete this form?
      \n
      {{formName}}
      \n
      {{formDescription}}
      \n
      ⚠️ This form still has stapled forms attached
      \n
      '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue="")},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&this.addOrgSelector()},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="";!0===(null==e?void 0:e.multiple)?(Array.from(e.selectedOptions).forEach((function(e){o+=e.label.trim()+"\n"})),o=o.trim()):o=e.value.trim(),"parent"===t.toLowerCase()?this.selectedParentValue=XSSHelpers.stripAllTags(o):"child"===t.toLowerCase()&&(this.selectedChildValue=XSSHelpers.stripAllTags(o))},newCondition:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selectedConditionJSON="",this.showConditionEditor=e,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),n=n.length>0?JSON.stringify(n):"",$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n,CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.indicators.find((function(e){return e.indicatorID===t.childIndID})).conditions=n,t.showRemoveModal=!1,t.newCondition(!1)):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp,n=e.selectedOp;switch(n){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not";break;case"gt":case"gte":case"lt":case"lte":var i=n.includes("g")?"greater than":"less than",r=n.includes("e")?" or equal to":"";o="is ".concat(i).concat(r)}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return e.indicatorID===n})),r=(null==i?void 0:i.format)||"";return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return t.indicatorID===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return t.indicatorID===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},childChoicesKey:function(){return this.selectedConditionJSON+this.selectedOutcome},parentChoicesKey:function(){return this.selectedConditionJSON+String(this.parentIndID)+this.selectedOperator},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")},childChoicesKey:function(e,t){"pre-fill"==this.selectedOutcome.toLowerCase()&&this.multiOptionFormats.includes(this.childFormat)&&this.updateChoicesJS()},parentChoicesKey:function(e,t){this.multiOptionFormats.includes(this.parentFormat)&&this.updateChoicesJS()},selectedOperator:function(e,t){""!==t&&this.numericOperators.includes(e)&&!this.numericOperators.includes(t)&&(this.selectedParentValue="")}},template:'
      \n \x3c!-- LOADING SPINNER --\x3e\n
      \n Loading... loading...\n
      \n
      \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
      \n
      Choose Delete to confirm removal, or cancel to return
      \n
      \n \n \n
      \n
      \n \n
      \n
      '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
      \n

      This is a Nationally Standardized Subordinate Site

      \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},_={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},T={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function O(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function P(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(P({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(P({},t.categories[i]));o.push(P(P({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(P(P({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=P({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file diff --git a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js index efb8a28b0..c5828ec36 100644 --- a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js +++ b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js @@ -48,6 +48,7 @@ export default { 'checkRequiredData', 'orgchartFormats', 'focusedFormRecord', + 'focusedFormTree', 'getFormByCategoryID', 'closeFormDialog', 'truncateText', @@ -65,27 +66,36 @@ export default { if (elSaveDiv !== null) elSaveDiv.style.display = 'none'; }, methods: { - getFormIndicators(){ - $.ajax({ - type: 'GET', - url: `${this.APIroot}form/indicator/list/unabridged`, - success: (res)=> { - const filteredList = res.filter( - ele => parseInt(ele.indicatorID) > 0 && parseInt(ele.isDisabled) === 0 && ele.categoryID === this.formID - ); - this.indicators = filteredList; + /** + * create flat array for indicators from current form using injected form tree. + * Ensures number types for indIDs, trimmed lower format, trimmed options in array + */ + getFormIndicators() { + let formIndicators = []; + const addIndicator = (index, parentID, node) => { + let options = Array.isArray(node?.options) ? node.options.map(o => o.trim()) : []; + options = options.filter(o => o !== ""); - this.indicators.forEach(i => { - if (i.parentIndicatorID !== null) { - this.addHeaderIDs(parseInt(i.parentIndicatorID), i); - } else { - i.headerIndicatorID = parseInt(i.indicatorID); - } - }); - this.appIsLoadingIndicators = false; - }, - error: (err) => console.log(err) + formIndicators.push({ + formPage: index, + parentID: +parentID, //null will become 0 + indicatorID: +node.indicatorID, + name: node.name || "", + format: node.format.toLowerCase().trim(), + options: options, + conditions: node.conditions + }); + if(node.child !== null) { + for(let c in node.child) { + addIndicator(index, node.indicatorID, node.child[c]) + } + } + } + this.focusedFormTree.forEach((page, index) => { + addIndicator(index, null, page); }); + this.indicators = formIndicators; + this.appIsLoadingIndicators = false; }, /** * @param {number} indicatorID @@ -130,22 +140,6 @@ export default { this.selectedChildValue = XSSHelpers.stripAllTags(value); } }, - /** - * Recursively searches indicators to add headerIndicatorID to the indicators list. - * The headerIndicatorID is used to track which indicators are on the same page. - * @param {Number} indID parent ID of indicator at the current depth - * @param {Object} initialIndicator reference to the indicator to update - */ - addHeaderIDs(indID = 0, initialIndicator = {}) { - const parent = this.indicators.find(i => parseInt(i.indicatorID) === indID); - if(parent === undefined) return; - //if the parent has a null parentID, then this is the header, update the passed reference - if (parent?.parentIndicatorID === null) { - initialIndicator.headerIndicatorID = indID; - } else { - this.addHeaderIDs(parseInt(parent.parentIndicatorID), initialIndicator); - } - }, newCondition(showEditor = true) { this.selectedConditionJSON = ''; this.showConditionEditor = showEditor; @@ -303,13 +297,9 @@ export default { const savedChildFormat = (condition?.childFormat || '').toLowerCase().trim(); const savedParentFormat = (condition?.parentFormat || '').toLowerCase().trim(); const savedParIndID = parseInt(condition?.parentIndID || 0); - const parentInd = this.selectableParents.find( - p => parseInt(p.indicatorID) === savedParIndID - ); - const parentIndFormat = (parentInd?.format || '') - .toLowerCase() - .split('\n')[0].trim(); + const parentInd = this.selectableParents.find(p => p.indicatorID === savedParIndID); + const parentIndFormat = parentInd?.format || '' return savedChildFormat !== this.childFormat || savedParentFormat !== parentIndFormat; }, /** @@ -401,42 +391,38 @@ export default { return this.dialogData.indicatorID; }, childIndicator() { - return this.indicators.find(i => parseInt(i.indicatorID) === this.childIndID); + return this.indicators.find(i => i.indicatorID === this.childIndID); }, /** * @returns {object} current parent selection */ selectedParentIndicator() { const indicator = this.selectableParents.find( - i => parseInt(i.indicatorID) === parseInt(this.parentIndID) + i => i.indicatorID === parseInt(this.parentIndID) ); return indicator === undefined ? {} : {...indicator}; }, /** - * @returns {string} lower case base format of the parent question if there is one + * @returns {string} format of the parent question if there is one */ parentFormat() { - const f = (this.selectedParentIndicator?.format || '').toLowerCase(); - return f.split('\n')[0].trim(); + return this.selectedParentIndicator?.format || '' }, /** - * @returns {string} lower case base format of the child question + * @returns {string} format of the child question */ childFormat() { - const f = (this.childIndicator?.format || '').toLowerCase(); - return f.split('\n')[0].trim(); + return this.childIndicator?.format || ''; }, /** * @returns list of indicators that are on the same page, enabled as parents, and different than child */ selectableParents() { - const headerIndicatorID = this.childIndicator?.headerIndicatorID || 0; - return this.indicators.filter(i => { - const parFormat = i.format?.split('\n')[0].trim().toLowerCase(); - return i.headerIndicatorID === headerIndicatorID && - parseInt(i.indicatorID) !== parseInt(this.childIndicator.indicatorID) && - this.enabledParentFormats[parFormat] === 1; - }); + return this.indicators.filter(i => + i.formPage === this.childIndicator.formPage && + i.indicatorID !== this.childIndID && + this.enabledParentFormats[i.format] === 1 + ); }, /** * @returns list of operators and human readable text base on parent format @@ -481,33 +467,24 @@ export default { return operators; }, crosswalkLevelTwo() { - const headerIndicatorID = this.childIndicator.headerIndicatorID; - return this.indicators.filter((i) => { - const format = i.format?.split("\n")[0].trim().toLowerCase(); - return ( - i.headerIndicatorID === headerIndicatorID && - parseInt(i.indicatorID) !== parseInt(this.childIndicator.indicatorID) && - ['dropdown', 'multiselect'].includes(format) - ); - }); + const formPage = this.childIndicator.formPage; + return this.indicators.filter(i => + i.formPage === formPage && + i.indicatorID !== this.childIndID && + ['dropdown', 'multiselect'].includes(i.format) + ); }, /** * @returns list of options for comparison based on parent indicator selection */ selectedParentValueOptions() { - const fullFormatToArray = (this.selectedParentIndicator?.format || '').split("\n"); - let options = fullFormatToArray.length > 1 ? fullFormatToArray.slice(1) : []; - options = options.map(o => o.trim()); - return options.filter(o => o !== '') + return this.selectedParentIndicator?.options || [] }, /** - * @returns list of options for prefill outcomes. Does NOT combine with file loaded options. + * @returns list of options for prefill outcomes. Does not combine with file loaded options. */ selectedChildValueOptions() { - const fullFormatToArray = this.childIndicator.format.split("\n"); - let options = fullFormatToArray.length > 1 ? fullFormatToArray.slice(1) : []; - options = options.map(o => o.trim()); - return options.filter(o => o !== '') + return this.childIndicator?.options || [] }, canAddCrosswalk() { return (this.childFormat === 'dropdown' || this.childFormat === 'multiselect') From d9bdaf051f710f4b67ca14e5a65c7004c3133f05 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 13 Dec 2023 17:14:41 -0500 Subject: [PATCH 09/11] LEAF 4169 live side fix fetch trigger --- .../js/vue_conditions_editor/LEAF_conditions_editor.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index d1e1df471..ecb4ffd90 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -2,7 +2,6 @@ const ConditionsEditor = Vue.createApp({ data() { return { orgchartPath: orgchartPath, - formID: '', childIndID: 0, parentIndID: 0, @@ -302,8 +301,10 @@ const ConditionsEditor = Vue.createApp({ //called by event dispatch when indicator chosen forceUpdate() { this.clearSelections(); - this.formID = currCategoryID || ''; this.childIndID = ifThenIndicatorID; + if(this.childIndID === 0) { + this.getFormIndicators() + } }, truncateText(text = "", maxTextLength = 40) { return text?.length > maxTextLength @@ -730,9 +731,6 @@ const ConditionsEditor = Vue.createApp({ } }, watch: { - formID() { - this.getFormIndicators(); - }, childIndID(newVal, oldVal) { setTimeout(() => { const elNew = document.querySelector('#condition_editor_inputs .btnNewCondition'); From 81eda52caeedad4c266a674b1f9501b17571291b Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Tue, 2 Jan 2024 11:44:44 -0500 Subject: [PATCH 10/11] LEAF 4169 add number validation to ifthen val entry, tag filter on indicator editor name --- .../js/vue_conditions_editor/LEAF_conditions_editor.js | 9 +++++++++ .../js/vue-dest/form_editor/form-editor-view.chunk.js | 2 +- .../components/dialog_content/ConditionsEditorDialog.js | 9 +++++++++ .../components/dialog_content/IndicatorEditingDialog.js | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js index ecb4ffd90..90266eb95 100644 --- a/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js +++ b/LEAF_Request_Portal/js/vue_conditions_editor/LEAF_conditions_editor.js @@ -170,6 +170,15 @@ const ConditionsEditor = Vue.createApp({ } if (type.toLowerCase() === 'parent') { this.selectedParentValue = XSSHelpers.stripAllTags(value); + if(this.parentFormat === 'number' || this.parentFormat === 'currency') { + if (/^(\d*)(\.\d+)?$/.test(value)) { + const floatValue = parseFloat(value); + this.selectedParentValue = this.parentFormat === 'currency' ? + (Math.round(100 * floatValue) / 100).toFixed(2) : String(floatValue); + } else { + this.selectedParentValue = ''; + } + } } else if (type.toLowerCase() === 'child') { this.selectedChildValue = XSSHelpers.stripAllTags(value); } diff --git a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js index 7d041788d..72a604ae4 100644 --- a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js +++ b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js @@ -1 +1 @@ -"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes)},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
    \n \n
    \n
    '}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
    \n
    \n
    Form Name (up to 50 characters)
    \n
    {{nameCharsRemaining}}
    \n
    \n \n
    \n
    Form Description (up to 255 characters)
    \n
    {{descrCharsRemaining}}
    \n
    \n \n
    '}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
    \n
    \n Loading...\n loading...\n
    \n
    \n
    \n \n \n
    \n
    '},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:(null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
    \n Move column left\n Move column right
    \n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
    \n \n \n
    \n
    \n \n \n \n \n
    \n
    '},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
    \n Special access restrictions\n
    \n Restrictions will limit view access to the request initiator and members of specific groups.
    \n They will also only allow the specified groups to apply search filters for this field.
    \n All others will see "[protected data]".\n
    \n \n
    {{ statusMessageError }}
    \n \n
    \n \n
    \n
    '}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
      ","
    1. ","
      ","

      ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

      \n
      \n \n \n
      \n \n \n
      \n
      \n
      \n
      \n \n
      {{shortlabelCharsRemaining}}
      \n
      \n \n
      \n
      \n
      \n \n
      \n \n \n
      \n
      \n

      Format Information

      \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
      \n
      \n
      \n \n \n
      \n
      \n \n \n
      \n
      \n \n
      \n
      \n  Columns ({{gridJSON.length}}):\n
      \n
      \n \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n Attributes\n
      \n \n \n
      \n \n \n \n This field will be archived.  It can be
      re-enabled by using Restore Fields.\n
      \n \n Deleted items can only be re-enabled
      within 30 days by using Restore Fields.\n
      \n
      \n
      '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
      \n
      Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
      {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
      {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

      \n
      \n html (for pages where the user can edit data): \n \n
      \n
      \n
      \n htmlPrint (for pages where the user can only read data): \n \n
      \n \n
      \n
      \n
      \n Notice:
      \n

      Please go to LEAF Programmer\n to ensure continued access to this area.

      \n
      '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      Stapled forms will show up on the same page as the primary form.

      \n

      The order of the forms will be determined by the forms\' assigned sort values.

      \n
      \n
        \n
      • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
      • \n
      \n

      \n
      \n \n
      There are no available forms to merge
      \n
      \n
      '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      {{formNameStripped()}}

      \n

      Collaborators have access to fill out data fields at any time in the workflow.

      \n

      This is typically used to give groups access to fill out internal-use fields.

      \n
      \n \n

      \n
      \n \n
      There are no available groups to add
      \n
      \n
      '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
      \n
      Are you sure you want to delete this form?
      \n
      {{formName}}
      \n
      {{formDescription}}
      \n
      ⚠️ This form still has stapled forms attached
      \n
      '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue="")},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&this.addOrgSelector()},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="";!0===(null==e?void 0:e.multiple)?(Array.from(e.selectedOptions).forEach((function(e){o+=e.label.trim()+"\n"})),o=o.trim()):o=e.value.trim(),"parent"===t.toLowerCase()?this.selectedParentValue=XSSHelpers.stripAllTags(o):"child"===t.toLowerCase()&&(this.selectedChildValue=XSSHelpers.stripAllTags(o))},newCondition:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selectedConditionJSON="",this.showConditionEditor=e,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),n=n.length>0?JSON.stringify(n):"",$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n,CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.indicators.find((function(e){return e.indicatorID===t.childIndID})).conditions=n,t.showRemoveModal=!1,t.newCondition(!1)):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp,n=e.selectedOp;switch(n){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not";break;case"gt":case"gte":case"lt":case"lte":var i=n.includes("g")?"greater than":"less than",r=n.includes("e")?" or equal to":"";o="is ".concat(i).concat(r)}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return e.indicatorID===n})),r=(null==i?void 0:i.format)||"";return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return t.indicatorID===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return t.indicatorID===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},childChoicesKey:function(){return this.selectedConditionJSON+this.selectedOutcome},parentChoicesKey:function(){return this.selectedConditionJSON+String(this.parentIndID)+this.selectedOperator},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")},childChoicesKey:function(e,t){"pre-fill"==this.selectedOutcome.toLowerCase()&&this.multiOptionFormats.includes(this.childFormat)&&this.updateChoicesJS()},parentChoicesKey:function(e,t){this.multiOptionFormats.includes(this.parentFormat)&&this.updateChoicesJS()},selectedOperator:function(e,t){""!==t&&this.numericOperators.includes(e)&&!this.numericOperators.includes(t)&&(this.selectedParentValue="")}},template:'
      \n \x3c!-- LOADING SPINNER --\x3e\n
      \n Loading... loading...\n
      \n
      \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
      \n
      Choose Delete to confirm removal, or cancel to return
      \n
      \n \n \n
      \n
      \n \n
      \n
      '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
      \n

      This is a Nationally Standardized Subordinate Site

      \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},_={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},T={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function O(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function P(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(P({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(P({},t.categories[i]));o.push(P(P({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(P(P({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(P({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=P({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file +"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes)},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
    \n \n
    \n
    '}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
    \n
    \n
    Form Name (up to 50 characters)
    \n
    {{nameCharsRemaining}}
    \n
    \n \n
    \n
    Form Description (up to 255 characters)
    \n
    {{descrCharsRemaining}}
    \n
    \n \n
    '}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
    \n
    \n Loading...\n loading...\n
    \n
    \n
    \n \n \n
    \n
    '},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:XSSHelpers.stripTags((null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",["script"]),options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
    \n Move column left\n Move column right
    \n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
    \n \n \n
    \n
    \n \n \n \n \n
    \n
    '},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
    \n Special access restrictions\n
    \n Restrictions will limit view access to the request initiator and members of specific groups.
    \n They will also only allow the specified groups to apply search filters for this field.
    \n All others will see "[protected data]".\n
    \n \n
    {{ statusMessageError }}
    \n \n
    \n \n
    \n
    '}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
      ","
    1. ","
      ","

      ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

      \n
      \n \n \n
      \n \n \n
      \n
      \n
      \n
      \n \n
      {{shortlabelCharsRemaining}}
      \n
      \n \n
      \n
      \n
      \n \n
      \n \n \n
      \n
      \n

      Format Information

      \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
      \n
      \n
      \n \n \n
      \n
      \n \n \n
      \n
      \n \n
      \n
      \n  Columns ({{gridJSON.length}}):\n
      \n
      \n \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n Attributes\n
      \n \n \n
      \n \n \n \n This field will be archived.  It can be
      re-enabled by using Restore Fields.\n
      \n \n Deleted items can only be re-enabled
      within 30 days by using Restore Fields.\n
      \n
      \n
      '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
      \n
      Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
      {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
      {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

      \n
      \n html (for pages where the user can edit data): \n \n
      \n
      \n
      \n htmlPrint (for pages where the user can only read data): \n \n
      \n \n
      \n
      \n
      \n Notice:
      \n

      Please go to LEAF Programmer\n to ensure continued access to this area.

      \n
      '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      Stapled forms will show up on the same page as the primary form.

      \n

      The order of the forms will be determined by the forms\' assigned sort values.

      \n
      \n
        \n
      • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
      • \n
      \n

      \n
      \n \n
      There are no available forms to merge
      \n
      \n
      '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      {{formNameStripped()}}

      \n

      Collaborators have access to fill out data fields at any time in the workflow.

      \n

      This is typically used to give groups access to fill out internal-use fields.

      \n
      \n \n

      \n
      \n \n
      There are no available groups to add
      \n
      \n
      '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
      \n
      Are you sure you want to delete this form?
      \n
      {{formName}}
      \n
      {{formDescription}}
      \n
      ⚠️ This form still has stapled forms attached
      \n
      '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue="")},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&this.addOrgSelector()},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="";if(!0===(null==e?void 0:e.multiple)?(Array.from(e.selectedOptions).forEach((function(e){o+=e.label.trim()+"\n"})),o=o.trim()):o=e.value.trim(),"parent"===t.toLowerCase()){if(this.selectedParentValue=XSSHelpers.stripAllTags(o),"number"===this.parentFormat||"currency"===this.parentFormat)if(/^(\d*)(\.\d+)?$/.test(o)){var n=parseFloat(o);this.selectedParentValue="currency"===this.parentFormat?(Math.round(100*n)/100).toFixed(2):String(n)}else this.selectedParentValue=""}else"child"===t.toLowerCase()&&(this.selectedChildValue=XSSHelpers.stripAllTags(o))},newCondition:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selectedConditionJSON="",this.showConditionEditor=e,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),n=n.length>0?JSON.stringify(n):"",$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n,CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.indicators.find((function(e){return e.indicatorID===t.childIndID})).conditions=n,t.showRemoveModal=!1,t.newCondition(!1)):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp,n=e.selectedOp;switch(n){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not";break;case"gt":case"gte":case"lt":case"lte":var i=n.includes("g")?"greater than":"less than",r=n.includes("e")?" or equal to":"";o="is ".concat(i).concat(r)}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return e.indicatorID===n})),r=(null==i?void 0:i.format)||"";return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return t.indicatorID===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return t.indicatorID===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},childChoicesKey:function(){return this.selectedConditionJSON+this.selectedOutcome},parentChoicesKey:function(){return this.selectedConditionJSON+String(this.parentIndID)+this.selectedOperator},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")},childChoicesKey:function(e,t){"pre-fill"==this.selectedOutcome.toLowerCase()&&this.multiOptionFormats.includes(this.childFormat)&&this.updateChoicesJS()},parentChoicesKey:function(e,t){this.multiOptionFormats.includes(this.parentFormat)&&this.updateChoicesJS()},selectedOperator:function(e,t){""!==t&&this.numericOperators.includes(e)&&!this.numericOperators.includes(t)&&(this.selectedParentValue="")}},template:'
      \n \x3c!-- LOADING SPINNER --\x3e\n
      \n Loading... loading...\n
      \n
      \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
      \n
      Choose Delete to confirm removal, or cancel to return
      \n
      \n \n \n
      \n
      \n \n
      \n
      '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
      \n

      This is a Nationally Standardized Subordinate Site

      \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},T={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},_={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function P(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function O(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(O({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(O({},t.categories[i]));o.push(O(O({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(O(O({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=O({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file diff --git a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js index c5828ec36..922bd3f48 100644 --- a/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js +++ b/docker/vue-app/src/form_editor/components/dialog_content/ConditionsEditorDialog.js @@ -136,6 +136,15 @@ export default { } if (type.toLowerCase() === 'parent') { this.selectedParentValue = XSSHelpers.stripAllTags(value); + if(this.parentFormat === 'number' || this.parentFormat === 'currency') { + if (/^(\d*)(\.\d+)?$/.test(value)) { + const floatValue = parseFloat(value); + this.selectedParentValue = this.parentFormat === 'currency' ? + (Math.round(100 * floatValue) / 100).toFixed(2) : String(floatValue); + } else { + this.selectedParentValue = ''; + } + } } else if (type.toLowerCase() === 'child') { this.selectedChildValue = XSSHelpers.stripAllTags(value); } diff --git a/docker/vue-app/src/form_editor/components/dialog_content/IndicatorEditingDialog.js b/docker/vue-app/src/form_editor/components/dialog_content/IndicatorEditingDialog.js index 3d648ae4a..996b110e4 100644 --- a/docker/vue-app/src/form_editor/components/dialog_content/IndicatorEditingDialog.js +++ b/docker/vue-app/src/form_editor/components/dialog_content/IndicatorEditingDialog.js @@ -53,7 +53,7 @@ export default { isLoadingParentIDs: true, multianswerFormats: ['checkboxes','radio','multiselect','dropdown'], - name: this.dialogData?.indicator?.name || '', + name: XSSHelpers.stripTags(this.dialogData?.indicator?.name || '', ['script']), options: this.dialogData?.indicator?.options || [],//array of choices for radio, dropdown, etc. 1 ele w JSON for grids format: this.dialogData?.indicator?.format || '', //base format (eg 'radio') description: this.dialogData?.indicator?.description || '', From 6e7e258e89e097e003b219134bc224f626131c1d Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Tue, 30 Jan 2024 14:26:57 -0500 Subject: [PATCH 11/11] LEAF 4169 add method for updating chosen attributes to Vue side Form Editor --- .../js/vue-dest/form_editor/LEAF_FormEditor.js | 2 +- .../form_editor/form-editor-view.chunk.js | 2 +- .../src/form_editor/LEAF_FormEditor_App_vue.js | 18 ++++++++++++++++++ .../form_editor_view/FormQuestionDisplay.js | 2 +- .../form_editor_view/FormatPreview.js | 7 ++++--- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/app/libs/js/vue-dest/form_editor/LEAF_FormEditor.js b/app/libs/js/vue-dest/form_editor/LEAF_FormEditor.js index 6b0726340..029727959 100644 --- a/app/libs/js/vue-dest/form_editor/LEAF_FormEditor.js +++ b/app/libs/js/vue-dest/form_editor/LEAF_FormEditor.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,n={166:(e,t,n)=>{n.d(t,{Fl:()=>xi,ri:()=>ec,aZ:()=>xo,h:()=>wi,f3:()=>Wr,Y3:()=>_n,JJ:()=>Hr,qj:()=>kt,iH:()=>Ut,Um:()=>Tt,XI:()=>Ht,SU:()=>Kt,YP:()=>so});var o={};function r(e,t){const n=Object.create(null),o=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}n.r(o),n.d(o,{BaseTransition:()=>mo,BaseTransitionPropsValidators:()=>go,Comment:()=>Es,EffectScope:()=>pe,Fragment:()=>xs,KeepAlive:()=>Fo,ReactiveEffect:()=>ke,Static:()=>ks,Suspense:()=>Jn,Teleport:()=>Ss,Text:()=>ws,Transition:()=>rl,TransitionGroup:()=>Cl,VueElement:()=>Zi,assertNumber:()=>ln,callWithAsyncErrorHandling:()=>an,callWithErrorHandling:()=>cn,camelize:()=>A,capitalize:()=>L,cloneVNode:()=>zs,compatUtils:()=>Ni,computed:()=>xi,createApp:()=>ec,createBlock:()=>Ms,createCommentVNode:()=>Js,createElementBlock:()=>Ds,createElementVNode:()=>Hs,createHydrationRenderer:()=>ds,createPropsRestProxy:()=>kr,createRenderer:()=>fs,createSSRApp:()=>tc,createSlots:()=>or,createStaticVNode:()=>Gs,createTextVNode:()=>Ks,createVNode:()=>Ws,customRef:()=>Xt,defineAsyncComponent:()=>Eo,defineComponent:()=>xo,defineCustomElement:()=>Gi,defineEmits:()=>dr,defineExpose:()=>hr,defineModel:()=>vr,defineOptions:()=>gr,defineProps:()=>fr,defineSSRCustomElement:()=>Ji,defineSlots:()=>mr,devtools:()=>Rn,effect:()=>Fe,effectScope:()=>fe,getCurrentInstance:()=>si,getCurrentScope:()=>he,getTransitionRawChildren:()=>Co,guardReactiveProps:()=>qs,h:()=>wi,handleError:()=>un,hasInjectionContext:()=>qr,hydrate:()=>Ql,initCustomFormatter:()=>Ti,initDirectivesForSSR:()=>rc,inject:()=>Wr,isMemoSame:()=>Ri,isProxy:()=>At,isReactive:()=>It,isReadonly:()=>Ot,isRef:()=>Vt,isRuntimeOnly:()=>yi,isShallow:()=>Nt,isVNode:()=>Ls,markRaw:()=>Mt,mergeDefaults:()=>wr,mergeModels:()=>Er,mergeProps:()=>Qs,nextTick:()=>_n,normalizeClass:()=>Q,normalizeProps:()=>ee,normalizeStyle:()=>G,onActivated:()=>Po,onBeforeMount:()=>$o,onBeforeUnmount:()=>Uo,onBeforeUpdate:()=>jo,onDeactivated:()=>Io,onErrorCaptured:()=>Ko,onMounted:()=>Bo,onRenderTracked:()=>zo,onRenderTriggered:()=>qo,onScopeDispose:()=>ge,onServerPrefetch:()=>Wo,onUnmounted:()=>Ho,onUpdated:()=>Vo,openBlock:()=>Rs,popScopeId:()=>jn,provide:()=>Hr,proxyRefs:()=>Yt,pushScopeId:()=>Bn,queuePostFlushCb:()=>xn,reactive:()=>kt,readonly:()=>Ft,ref:()=>Ut,registerRuntimeCompiler:()=>vi,render:()=>Xl,renderList:()=>nr,renderSlot:()=>rr,resolveComponent:()=>Yo,resolveDirective:()=>Qo,resolveDynamicComponent:()=>Xo,resolveFilter:()=>Oi,resolveTransitionHooks:()=>yo,setBlockTracking:()=>Ns,setDevtoolsHook:()=>On,setTransitionHooks:()=>So,shallowReactive:()=>Tt,shallowReadonly:()=>Rt,shallowRef:()=>Ht,ssrContextKey:()=>Ei,ssrUtils:()=>Ii,stop:()=>Re,toDisplayString:()=>ce,toHandlerKey:()=>$,toHandlers:()=>ir,toRaw:()=>Dt,toRef:()=>nn,toRefs:()=>Qt,toValue:()=>Gt,transformVNodeArgs:()=>Bs,triggerRef:()=>zt,unref:()=>Kt,useAttrs:()=>_r,useCssModule:()=>Xi,useCssVars:()=>Qi,useModel:()=>Sr,useSSRContext:()=>ki,useSlots:()=>br,useTransitionState:()=>fo,vModelCheckbox:()=>Pl,vModelDynamic:()=>Ll,vModelRadio:()=>Ol,vModelSelect:()=>Nl,vModelText:()=>Rl,vShow:()=>ql,version:()=>Pi,warn:()=>sn,watch:()=>so,watchEffect:()=>to,watchPostEffect:()=>no,watchSyncEffect:()=>oo,withAsyncContext:()=>Tr,withCtx:()=>Un,withDefaults:()=>yr,withDirectives:()=>uo,withKeys:()=>Wl,withMemo:()=>Fi,withModifiers:()=>Ul,withScopeId:()=>Vn});const s={},i=[],l=()=>{},c=()=>!1,a=/^on[^a-z]/,u=e=>a.test(e),p=e=>e.startsWith("onUpdate:"),f=Object.assign,d=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,g=(e,t)=>h.call(e,t),m=Array.isArray,v=e=>"[object Map]"===k(e),y=e=>"[object Set]"===k(e),b=e=>"[object Date]"===k(e),_=e=>"function"==typeof e,S=e=>"string"==typeof e,C=e=>"symbol"==typeof e,x=e=>null!==e&&"object"==typeof e,w=e=>x(e)&&_(e.then)&&_(e.catch),E=Object.prototype.toString,k=e=>E.call(e),T=e=>k(e).slice(8,-1),F=e=>"[object Object]"===k(e),R=e=>S(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,P=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),I=r("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),O=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},N=/-(\w)/g,A=O((e=>e.replace(N,((e,t)=>t?t.toUpperCase():"")))),D=/\B([A-Z])/g,M=O((e=>e.replace(D,"-$1").toLowerCase())),L=O((e=>e.charAt(0).toUpperCase()+e.slice(1))),$=O((e=>e?`on${L(e)}`:"")),B=(e,t)=>!Object.is(e,t),j=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},U=e=>{const t=parseFloat(e);return isNaN(t)?e:t},H=e=>{const t=S(e)?Number(e):NaN;return isNaN(t)?e:t};let W;const q=()=>W||(W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),z={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"HYDRATE_EVENTS",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},K=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console");function G(e){if(m(e)){const t={};for(let n=0;n{if(e){const n=e.split(Y);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function Q(e){let t="";if(S(e))t=e;else if(m(e))for(let n=0;nie(e,t)))}const ce=e=>S(e)?e:null==e?"":m(e)||x(e)&&(e.toString===E||!_(e.toString))?JSON.stringify(e,ae,2):String(e),ae=(e,t)=>t&&t.__v_isRef?ae(e,t.value):v(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:y(t)?{[`Set(${t.size})`]:[...t.values()]}:!x(t)||m(t)||F(t)?t:String(t);let ue;class pe{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ue,!e&&ue&&(this.index=(ue.scopes||(ue.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=ue;try{return ue=this,e()}finally{ue=t}}}on(){ue=this}off(){ue=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},ve=e=>(e.w&Se)>0,ye=e=>(e.n&Se)>0,be=new WeakMap;let _e=0,Se=1;const Ce=30;let xe;const we=Symbol(""),Ee=Symbol("");class ke{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,de(this,n)}run(){if(!this.active)return this.fn();let e=xe,t=Pe;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=xe,xe=this,Pe=!0,Se=1<<++_e,_e<=Ce?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o{("length"===n||n>=e)&&l.push(t)}))}else switch(void 0!==n&&l.push(i.get(n)),t){case"add":m(e)?R(n)&&l.push(i.get("length")):(l.push(i.get(we)),v(e)&&l.push(i.get(Ee)));break;case"delete":m(e)||(l.push(i.get(we)),v(e)&&l.push(i.get(Ee)));break;case"set":v(e)&&l.push(i.get(we))}if(1===l.length)l[0]&&Le(l[0]);else{const e=[];for(const t of l)t&&e.push(...t);Le(me(e))}}function Le(e,t){const n=m(e)?e:[...e];for(const e of n)e.computed&&$e(e);for(const e of n)e.computed||$e(e)}function $e(e,t){(e!==xe||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const Be=r("__proto__,__v_isRef,__isVue"),je=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(C)),Ve=Ge(),Ue=Ge(!1,!0),He=Ge(!0),We=Ge(!0,!0),qe=ze();function ze(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Dt(this);for(let e=0,t=this.length;e{e[t]=function(...e){Oe();const n=Dt(this)[t].apply(this,e);return Ne(),n}})),e}function Ke(e){const t=Dt(this);return Ae(t,0,e),t.hasOwnProperty(e)}function Ge(e=!1,t=!1){return function(n,o,r){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_isShallow"===o)return t;if("__v_raw"===o&&r===(e?t?Et:wt:t?xt:Ct).get(n))return n;const s=m(n);if(!e){if(s&&g(qe,o))return Reflect.get(qe,o,r);if("hasOwnProperty"===o)return Ke}const i=Reflect.get(n,o,r);return(C(o)?je.has(o):Be(o))?i:(e||Ae(n,0,o),t?i:Vt(i)?s&&R(o)?i:i.value:x(i)?e?Ft(i):kt(i):i)}}function Je(e=!1){return function(t,n,o,r){let s=t[n];if(Ot(s)&&Vt(s)&&!Vt(o))return!1;if(!e&&(Nt(o)||Ot(o)||(s=Dt(s),o=Dt(o)),!m(t)&&Vt(s)&&!Vt(o)))return s.value=o,!0;const i=m(t)&&R(n)?Number(n)!0,deleteProperty:(e,t)=>!0},Xe=f({},Ye,{get:Ue,set:Je(!0)}),Qe=f({},Ze,{get:We}),et=e=>e,tt=e=>Reflect.getPrototypeOf(e);function nt(e,t,n=!1,o=!1){const r=Dt(e=e.__v_raw),s=Dt(t);n||(t!==s&&Ae(r,0,t),Ae(r,0,s));const{has:i}=tt(r),l=o?et:n?$t:Lt;return i.call(r,t)?l(e.get(t)):i.call(r,s)?l(e.get(s)):void(e!==r&&e.get(t))}function ot(e,t=!1){const n=this.__v_raw,o=Dt(n),r=Dt(e);return t||(e!==r&&Ae(o,0,e),Ae(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function rt(e,t=!1){return e=e.__v_raw,!t&&Ae(Dt(e),0,we),Reflect.get(e,"size",e)}function st(e){e=Dt(e);const t=Dt(this);return tt(t).has.call(t,e)||(t.add(e),Me(t,"add",e,e)),this}function it(e,t){t=Dt(t);const n=Dt(this),{has:o,get:r}=tt(n);let s=o.call(n,e);s||(e=Dt(e),s=o.call(n,e));const i=r.call(n,e);return n.set(e,t),s?B(t,i)&&Me(n,"set",e,t):Me(n,"add",e,t),this}function lt(e){const t=Dt(this),{has:n,get:o}=tt(t);let r=n.call(t,e);r||(e=Dt(e),r=n.call(t,e)),o&&o.call(t,e);const s=t.delete(e);return r&&Me(t,"delete",e,void 0),s}function ct(){const e=Dt(this),t=0!==e.size,n=e.clear();return t&&Me(e,"clear",void 0,void 0),n}function at(e,t){return function(n,o){const r=this,s=r.__v_raw,i=Dt(s),l=t?et:e?$t:Lt;return!e&&Ae(i,0,we),s.forEach(((e,t)=>n.call(o,l(e),l(t),r)))}}function ut(e,t,n){return function(...o){const r=this.__v_raw,s=Dt(r),i=v(s),l="entries"===e||e===Symbol.iterator&&i,c="keys"===e&&i,a=r[e](...o),u=n?et:t?$t:Lt;return!t&&Ae(s,0,c?Ee:we),{next(){const{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function pt(e){return function(...t){return"delete"!==e&&this}}function ft(){const e={get(e){return nt(this,e)},get size(){return rt(this)},has:ot,add:st,set:it,delete:lt,clear:ct,forEach:at(!1,!1)},t={get(e){return nt(this,e,!1,!0)},get size(){return rt(this)},has:ot,add:st,set:it,delete:lt,clear:ct,forEach:at(!1,!0)},n={get(e){return nt(this,e,!0)},get size(){return rt(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!1)},o={get(e){return nt(this,e,!0,!0)},get size(){return rt(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=ut(r,!1,!1),n[r]=ut(r,!0,!1),t[r]=ut(r,!1,!0),o[r]=ut(r,!0,!0)})),[e,n,t,o]}const[dt,ht,gt,mt]=ft();function vt(e,t){const n=t?e?mt:gt:e?ht:dt;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(g(n,o)&&o in t?n:t,o,r)}const yt={get:vt(!1,!1)},bt={get:vt(!1,!0)},_t={get:vt(!0,!1)},St={get:vt(!0,!0)},Ct=new WeakMap,xt=new WeakMap,wt=new WeakMap,Et=new WeakMap;function kt(e){return Ot(e)?e:Pt(e,!1,Ye,yt,Ct)}function Tt(e){return Pt(e,!1,Xe,bt,xt)}function Ft(e){return Pt(e,!0,Ze,_t,wt)}function Rt(e){return Pt(e,!0,Qe,St,Et)}function Pt(e,t,n,o,r){if(!x(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=r.get(e);if(s)return s;const i=(l=e).__v_skip||!Object.isExtensible(l)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(T(l));var l;if(0===i)return e;const c=new Proxy(e,2===i?o:n);return r.set(e,c),c}function It(e){return Ot(e)?It(e.__v_raw):!(!e||!e.__v_isReactive)}function Ot(e){return!(!e||!e.__v_isReadonly)}function Nt(e){return!(!e||!e.__v_isShallow)}function At(e){return It(e)||Ot(e)}function Dt(e){const t=e&&e.__v_raw;return t?Dt(t):e}function Mt(e){return V(e,"__v_skip",!0),e}const Lt=e=>x(e)?kt(e):e,$t=e=>x(e)?Ft(e):e;function Bt(e){Pe&&xe&&De((e=Dt(e)).dep||(e.dep=me()))}function jt(e,t){const n=(e=Dt(e)).dep;n&&Le(n)}function Vt(e){return!(!e||!0!==e.__v_isRef)}function Ut(e){return Wt(e,!1)}function Ht(e){return Wt(e,!0)}function Wt(e,t){return Vt(e)?e:new qt(e,t)}class qt{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Dt(e),this._value=t?e:Lt(e)}get value(){return Bt(this),this._value}set value(e){const t=this.__v_isShallow||Nt(e)||Ot(e);e=t?e:Dt(e),B(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Lt(e),jt(this))}}function zt(e){jt(e)}function Kt(e){return Vt(e)?e.value:e}function Gt(e){return _(e)?e():Kt(e)}const Jt={get:(e,t,n)=>Kt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return Vt(r)&&!Vt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Yt(e){return It(e)?e:new Proxy(e,Jt)}class Zt{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>Bt(this)),(()=>jt(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Xt(e){return new Zt(e)}function Qt(e){const t=m(e)?new Array(e.length):{};for(const n in e)t[n]=on(e,n);return t}class en{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=Dt(this._object),t=this._key,null==(n=be.get(e))?void 0:n.get(t);var e,t,n}}class tn{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function nn(e,t,n){return Vt(e)?e:_(e)?new tn(e):x(e)&&arguments.length>1?on(e,t,n):Ut(e)}function on(e,t,n){const o=e[t];return Vt(o)?o:new en(e,t,n)}class rn{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new ke(e,(()=>{this._dirty||(this._dirty=!0,jt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=Dt(this);return Bt(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function sn(e,...t){}function ln(e,t){}function cn(e,t,n,o){let r;try{r=o?e(...o):e()}catch(e){un(e,t,n)}return r}function an(e,t,n,o){if(_(e)){const r=cn(e,t,n,o);return r&&w(r)&&r.catch((e=>{un(e,t,n)})),r}const r=[];for(let s=0;s>>1;kn(dn[o])kn(e)-kn(t))),vn=0;vnnull==e.id?1/0:e.id,Tn=(e,t)=>{const n=kn(e)-kn(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Fn(e){fn=!1,pn=!0,dn.sort(Tn);try{for(hn=0;hnRn.emit(e,...t))),Pn=[]):"undefined"!=typeof window&&window.HTMLElement&&!(null==(o=null==(n=window.navigator)?void 0:n.userAgent)?void 0:o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{On(e,t)})),setTimeout((()=>{Rn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,In=!0,Pn=[])}),3e3)):(In=!0,Pn=[])}function Nn(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||s;let r=n;const i=t.startsWith("update:"),l=i&&t.slice(7);if(l&&l in o){const e=`${"modelValue"===l?"model":l}Modifiers`,{number:t,trim:i}=o[e]||s;i&&(r=n.map((e=>S(e)?e.trim():e))),t&&(r=n.map(U))}let c,a=o[c=$(t)]||o[c=$(A(t))];!a&&i&&(a=o[c=$(M(t))]),a&&an(a,e,6,r);const u=o[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,an(u,e,6,r)}}function An(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const s=e.emits;let i={},l=!1;if(!_(e)){const o=e=>{const n=An(e,t,!0);n&&(l=!0,f(i,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return s||l?(m(s)?s.forEach((e=>i[e]=null)):f(i,s),x(e)&&o.set(e,i),i):(x(e)&&o.set(e,null),null)}function Dn(e,t){return!(!e||!u(t))&&(t=t.slice(2).replace(/Once$/,""),g(e,t[0].toLowerCase()+t.slice(1))||g(e,M(t))||g(e,t))}let Mn=null,Ln=null;function $n(e){const t=Mn;return Mn=e,Ln=e&&e.type.__scopeId||null,t}function Bn(e){Ln=e}function jn(){Ln=null}const Vn=e=>Un;function Un(e,t=Mn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&Ns(-1);const r=$n(t);let s;try{s=e(...n)}finally{$n(r),o._d&&Ns(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function Hn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:s,propsOptions:[i],slots:l,attrs:c,emit:a,render:u,renderCache:f,data:d,setupState:h,ctx:g,inheritAttrs:m}=e;let v,y;const b=$n(e);try{if(4&n.shapeFlag){const e=r||o;v=Ys(u.call(e,e,f,s,h,d,g)),y=c}else{const e=t;v=Ys(e.length>1?e(s,{attrs:c,slots:l,emit:a}):e(s,null)),y=t.props?c:Wn(c)}}catch(t){Ts.length=0,un(t,e,1),v=Ws(Es)}let _=v;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=_;e.length&&7&t&&(i&&e.some(p)&&(y=qn(y,i)),_=zs(_,y))}return n.dirs&&(_=zs(_),_.dirs=_.dirs?_.dirs.concat(n.dirs):n.dirs),n.transition&&(_.transition=n.transition),v=_,$n(b),v}const Wn=e=>{let t;for(const n in e)("class"===n||"style"===n||u(n))&&((t||(t={}))[n]=e[n]);return t},qn=(e,t)=>{const n={};for(const o in e)p(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function zn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense,Jn={name:"Suspense",__isSuspense:!0,process(e,t,n,o,r,s,i,l,c,a){null==e?function(e,t,n,o,r,s,i,l,c){const{p:a,o:{createElement:u}}=c,p=u("div"),f=e.suspense=Zn(e,r,o,t,p,n,s,i,l,c);a(null,f.pendingBranch=e.ssContent,p,null,o,f,s,i),f.deps>0?(Yn(e,"onPending"),Yn(e,"onFallback"),a(null,e.ssFallback,t,n,o,null,s,i),eo(f,e.ssFallback)):f.resolve(!1,!0)}(t,n,o,r,s,i,l,c,a):function(e,t,n,o,r,s,i,l,{p:c,um:a,o:{createElement:u}}){const p=t.suspense=e.suspense;p.vnode=t,t.el=e.el;const f=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:v}=p;if(g)p.pendingBranch=f,$s(f,g)?(c(g,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():m&&(c(h,d,n,o,r,null,s,i,l),eo(p,d))):(p.pendingId++,v?(p.isHydrating=!1,p.activeBranch=g):a(g,r,p),p.deps=0,p.effects.length=0,p.hiddenContainer=u("div"),m?(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():(c(h,d,n,o,r,null,s,i,l),eo(p,d))):h&&$s(f,h)?(c(h,f,n,o,r,p,s,i,l),p.resolve(!0)):(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0&&p.resolve()));else if(h&&$s(f,h))c(h,f,n,o,r,p,s,i,l),eo(p,f);else if(Yn(t,"onPending"),p.pendingBranch=f,p.pendingId++,c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0)p.resolve();else{const{timeout:e,pendingId:t}=p;e>0?setTimeout((()=>{p.pendingId===t&&p.fallback(d)}),e):0===e&&p.fallback(d)}}(e,t,n,o,r,i,l,c,a)},hydrate:function(e,t,n,o,r,s,i,l,c){const a=t.suspense=Zn(t,o,n,e.parentNode,document.createElement("div"),null,r,s,i,l,!0),u=c(e,a.pendingBranch=t.ssContent,n,a,s,i);return 0===a.deps&&a.resolve(!1,!0),u},create:Zn,normalize:function(e){const{shapeFlag:t,children:n}=e,o=32&t;e.ssContent=Xn(o?n.default:n),e.ssFallback=o?Xn(n.fallback):Ws(Es)}};function Yn(e,t){const n=e.props&&e.props[t];_(n)&&n()}function Zn(e,t,n,o,r,s,i,l,c,a,u=!1){const{p,m:f,um:d,n:h,o:{parentNode:g,remove:m}}=a;let v;const y=function(e){var t;return null!=(null==(t=e.props)?void 0:t.suspensible)&&!1!==e.props.suspensible}(e);y&&(null==t?void 0:t.pendingBranch)&&(v=t.pendingId,t.deps++);const b=e.props?H(e.props.timeout):void 0,_={vnode:e,parent:t,parentComponent:n,isSVG:i,container:o,hiddenContainer:r,anchor:s,deps:0,pendingId:0,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:o,activeBranch:r,pendingBranch:s,pendingId:i,effects:l,parentComponent:c,container:a}=_;if(_.isHydrating)_.isHydrating=!1;else if(!e){const e=r&&s.transition&&"out-in"===s.transition.mode;e&&(r.transition.afterLeave=()=>{i===_.pendingId&&f(s,a,t,0)});let{anchor:t}=_;r&&(t=h(r),d(r,c,_,!0)),e||f(s,a,t,0)}eo(_,s),_.pendingBranch=null,_.isInFallback=!1;let u=_.parent,p=!1;for(;u;){if(u.pendingBranch){u.effects.push(...l),p=!0;break}u=u.parent}p||xn(l),_.effects=[],y&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),Yn(o,"onResolve")},fallback(e){if(!_.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:o,container:r,isSVG:s}=_;Yn(t,"onFallback");const i=h(n),a=()=>{_.isInFallback&&(p(null,e,r,i,o,null,s,l,c),eo(_,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=a),_.isInFallback=!0,d(n,o,null,!0),u||a()},move(e,t,n){_.activeBranch&&f(_.activeBranch,e,t,n),_.container=e},next:()=>_.activeBranch&&h(_.activeBranch),registerDep(e,t){const n=!!_.pendingBranch;n&&_.deps++;const o=e.vnode.el;e.asyncDep.catch((t=>{un(t,e,0)})).then((r=>{if(e.isUnmounted||_.isUnmounted||_.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:s}=e;mi(e,r,!1),o&&(s.el=o);const l=!o&&e.subTree.el;t(e,s,g(o||e.subTree.el),o?null:h(e.subTree),_,i,c),l&&m(l),Kn(e,s.el),n&&0==--_.deps&&_.resolve()}))},unmount(e,t){_.isUnmounted=!0,_.activeBranch&&d(_.activeBranch,n,e,t),_.pendingBranch&&d(_.pendingBranch,n,e,t)}};return _}function Xn(e){let t;if(_(e)){const n=Os&&e._c;n&&(e._d=!1,Rs()),e=e(),n&&(e._d=!0,t=Fs,Ps())}if(m(e)){const t=function(e){let t;for(let n=0;nt!==e))),e}function Qn(e,t){t&&t.pendingBranch?m(e)?t.effects.push(...e):t.effects.push(e):xn(e)}function eo(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e,r=n.el=t.el;o&&o.subTree===n&&(o.vnode.el=r,Kn(o,r))}function to(e,t){return io(e,null,t)}function no(e,t){return io(e,null,{flush:"post"})}function oo(e,t){return io(e,null,{flush:"sync"})}const ro={};function so(e,t,n){return io(e,t,n)}function io(e,t,{immediate:n,deep:o,flush:r,onTrack:i,onTrigger:c}=s){var a;const u=he()===(null==(a=ri)?void 0:a.scope)?ri:null;let p,f,h=!1,g=!1;if(Vt(e)?(p=()=>e.value,h=Nt(e)):It(e)?(p=()=>e,o=!0):m(e)?(g=!0,h=e.some((e=>It(e)||Nt(e))),p=()=>e.map((e=>Vt(e)?e.value:It(e)?ao(e):_(e)?cn(e,u,2):void 0))):p=_(e)?t?()=>cn(e,u,2):()=>{if(!u||!u.isUnmounted)return f&&f(),an(e,u,3,[y])}:l,t&&o){const e=p;p=()=>ao(e())}let v,y=e=>{f=x.onStop=()=>{cn(e,u,4)}};if(hi){if(y=l,t?n&&an(t,u,3,[p(),g?[]:void 0,y]):p(),"sync"!==r)return l;{const e=ki();v=e.__watcherHandles||(e.__watcherHandles=[])}}let b=g?new Array(e.length).fill(ro):ro;const S=()=>{if(x.active)if(t){const e=x.run();(o||h||(g?e.some(((e,t)=>B(e,b[t]))):B(e,b)))&&(f&&f(),an(t,u,3,[e,b===ro?void 0:g&&b[0]===ro?[]:b,y]),b=e)}else x.run()};let C;S.allowRecurse=!!t,"sync"===r?C=S:"post"===r?C=()=>ps(S,u&&u.suspense):(S.pre=!0,u&&(S.id=u.uid),C=()=>Sn(S));const x=new ke(p,C);t?n?S():b=x.run():"post"===r?ps(x.run.bind(x),u&&u.suspense):x.run();const w=()=>{x.stop(),u&&u.scope&&d(u.scope.effects,x)};return v&&v.push(w),w}function lo(e,t,n){const o=this.proxy,r=S(e)?e.includes(".")?co(o,e):()=>o[e]:e.bind(o,o);let s;_(t)?s=t:(s=t.handler,n=t);const i=ri;ai(this);const l=io(r,s.bind(o),n);return i?ai(i):ui(),l}function co(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{ao(e,t)}));else if(F(e))for(const n in e)ao(e[n],t);return e}function uo(e,t){const n=Mn;if(null===n)return e;const o=Si(n)||n.proxy,r=e.dirs||(e.dirs=[]);for(let e=0;e{e.isMounted=!0})),Uo((()=>{e.isUnmounting=!0})),e}const ho=[Function,Array],go={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ho,onEnter:ho,onAfterEnter:ho,onEnterCancelled:ho,onBeforeLeave:ho,onLeave:ho,onAfterLeave:ho,onLeaveCancelled:ho,onBeforeAppear:ho,onAppear:ho,onAfterAppear:ho,onAppearCancelled:ho},mo={name:"BaseTransition",props:go,setup(e,{slots:t}){const n=si(),o=fo();let r;return()=>{const s=t.default&&Co(t.default(),!0);if(!s||!s.length)return;let i=s[0];if(s.length>1){let e=!1;for(const t of s)if(t.type!==Es){i=t,e=!0;break}}const l=Dt(e),{mode:c}=l;if(o.isLeaving)return bo(i);const a=_o(i);if(!a)return bo(i);const u=yo(a,l,o,n);So(a,u);const p=n.subTree,f=p&&_o(p);let d=!1;const{getTransitionKey:h}=a.type;if(h){const e=h();void 0===r?r=e:e!==r&&(r=e,d=!0)}if(f&&f.type!==Es&&(!$s(a,f)||d)){const e=yo(f,l,o,n);if(So(f,e),"out-in"===c)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&n.update()},bo(i);"in-out"===c&&a.type!==Es&&(e.delayLeave=(e,t,n)=>{vo(o,f)[String(f.key)]=f,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete u.delayedLeave},u.delayedLeave=n})}return i}}};function vo(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function yo(e,t,n,o){const{appear:r,mode:s,persisted:i=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:a,onEnterCancelled:u,onBeforeLeave:p,onLeave:f,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:g,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,_=String(e.key),S=vo(n,e),C=(e,t)=>{e&&an(e,o,9,t)},x=(e,t)=>{const n=t[1];C(e,t),m(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},w={mode:s,persisted:i,beforeEnter(t){let o=l;if(!n.isMounted){if(!r)return;o=g||l}t._leaveCb&&t._leaveCb(!0);const s=S[_];s&&$s(e,s)&&s.el._leaveCb&&s.el._leaveCb(),C(o,[t])},enter(e){let t=c,o=a,s=u;if(!n.isMounted){if(!r)return;t=v||c,o=y||a,s=b||u}let i=!1;const l=e._enterCb=t=>{i||(i=!0,C(t?s:o,[e]),w.delayedLeave&&w.delayedLeave(),e._enterCb=void 0)};t?x(t,[e,l]):l()},leave(t,o){const r=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return o();C(p,[t]);let s=!1;const i=t._leaveCb=n=>{s||(s=!0,o(),C(n?h:d,[t]),t._leaveCb=void 0,S[r]===e&&delete S[r])};S[r]=e,f?x(f,[t,i]):i()},clone:e=>yo(e,t,n,o)};return w}function bo(e){if(To(e))return(e=zs(e)).children=null,e}function _o(e){return To(e)?e.children?e.children[0]:void 0:e}function So(e,t){6&e.shapeFlag&&e.component?So(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Co(e,t=!1,n){let o=[],r=0;for(let s=0;s1)for(let e=0;ef({name:e.name},t,{setup:e}))():e}const wo=e=>!!e.type.__asyncLoader;function Eo(e){_(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:i=!0,onError:l}=e;let c,a=null,u=0;const p=()=>{let e;return a||(e=a=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),l)return new Promise(((t,n)=>{l(e,(()=>t((u++,a=null,p()))),(()=>n(e)),u+1)}));throw e})).then((t=>e!==a&&a?a:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),c=t,t))))};return xo({name:"AsyncComponentWrapper",__asyncLoader:p,get __asyncResolved(){return c},setup(){const e=ri;if(c)return()=>ko(c,e);const t=t=>{a=null,un(t,e,13,!o)};if(i&&e.suspense||hi)return p().then((t=>()=>ko(t,e))).catch((e=>(t(e),()=>o?Ws(o,{error:e}):null)));const l=Ut(!1),u=Ut(),f=Ut(!!r);return r&&setTimeout((()=>{f.value=!1}),r),null!=s&&setTimeout((()=>{if(!l.value&&!u.value){const e=new Error(`Async component timed out after ${s}ms.`);t(e),u.value=e}}),s),p().then((()=>{l.value=!0,e.parent&&To(e.parent.vnode)&&Sn(e.parent.update)})).catch((e=>{t(e),u.value=e})),()=>l.value&&c?ko(c,e):u.value&&o?Ws(o,{error:u.value}):n&&!f.value?Ws(n):void 0}})}function ko(e,t){const{ref:n,props:o,children:r,ce:s}=t.vnode,i=Ws(e,o,r);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const To=e=>e.type.__isKeepAlive,Fo={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=si(),o=n.ctx;if(!o.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const r=new Map,s=new Set;let i=null;const l=n.suspense,{renderer:{p:c,m:a,um:u,o:{createElement:p}}}=o,f=p("div");function d(e){Ao(e),u(e,n,l,!0)}function h(e){r.forEach(((t,n)=>{const o=Ci(t.type);!o||e&&e(o)||g(n)}))}function g(e){const t=r.get(e);i&&$s(t,i)?i&&Ao(i):d(t),r.delete(e),s.delete(e)}o.activate=(e,t,n,o,r)=>{const s=e.component;a(e,t,n,0,l),c(s.vnode,e,t,n,s,l,o,e.slotScopeIds,r),ps((()=>{s.isDeactivated=!1,s.a&&j(s.a);const t=e.props&&e.props.onVnodeMounted;t&&ei(t,s.parent,e)}),l)},o.deactivate=e=>{const t=e.component;a(e,f,null,1,l),ps((()=>{t.da&&j(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&ei(n,t.parent,e),t.isDeactivated=!0}),l)},so((()=>[e.include,e.exclude]),(([e,t])=>{e&&h((t=>Ro(e,t))),t&&h((e=>!Ro(t,e)))}),{flush:"post",deep:!0});let m=null;const v=()=>{null!=m&&r.set(m,Do(n.subTree))};return Bo(v),Vo(v),Uo((()=>{r.forEach((e=>{const{subTree:t,suspense:o}=n,r=Do(t);if(e.type!==r.type||e.key!==r.key)d(e);else{Ao(r);const e=r.component.da;e&&ps(e,o)}}))})),()=>{if(m=null,!t.default)return null;const n=t.default(),o=n[0];if(n.length>1)return i=null,n;if(!Ls(o)||!(4&o.shapeFlag||128&o.shapeFlag))return i=null,o;let l=Do(o);const c=l.type,a=Ci(wo(l)?l.type.__asyncResolved||{}:c),{include:u,exclude:p,max:f}=e;if(u&&(!a||!Ro(u,a))||p&&a&&Ro(p,a))return i=l,o;const d=null==l.key?c:l.key,h=r.get(d);return l.el&&(l=zs(l),128&o.shapeFlag&&(o.ssContent=l)),m=d,h?(l.el=h.el,l.component=h.component,l.transition&&So(l,l.transition),l.shapeFlag|=512,s.delete(d),s.add(d)):(s.add(d),f&&s.size>parseInt(f,10)&&g(s.values().next().value)),l.shapeFlag|=256,i=l,Gn(o.type)?o:l}}};function Ro(e,t){return m(e)?e.some((e=>Ro(e,t))):S(e)?e.split(",").includes(t):"[object RegExp]"===k(e)&&e.test(t)}function Po(e,t){Oo(e,"a",t)}function Io(e,t){Oo(e,"da",t)}function Oo(e,t,n=ri){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Mo(t,o,n),n){let e=n.parent;for(;e&&e.parent;)To(e.parent.vnode)&&No(o,t,n,e),e=e.parent}}function No(e,t,n,o){const r=Mo(t,e,o,!0);Ho((()=>{d(o[t],r)}),n)}function Ao(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Do(e){return 128&e.shapeFlag?e.ssContent:e}function Mo(e,t,n=ri,o=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;Oe(),ai(n);const r=an(t,n,e,o);return ui(),Ne(),r});return o?r.unshift(s):r.push(s),s}}const Lo=e=>(t,n=ri)=>(!hi||"sp"===e)&&Mo(e,((...e)=>t(...e)),n),$o=Lo("bm"),Bo=Lo("m"),jo=Lo("bu"),Vo=Lo("u"),Uo=Lo("bum"),Ho=Lo("um"),Wo=Lo("sp"),qo=Lo("rtg"),zo=Lo("rtc");function Ko(e,t=ri){Mo("ec",e,t)}const Go="components",Jo="directives";function Yo(e,t){return er(Go,e,!0,t)||e}const Zo=Symbol.for("v-ndc");function Xo(e){return S(e)?er(Go,e,!1)||e:e||Zo}function Qo(e){return er(Jo,e)}function er(e,t,n=!0,o=!1){const r=Mn||ri;if(r){const n=r.type;if(e===Go){const e=Ci(n,!1);if(e&&(e===t||e===A(t)||e===L(A(t))))return n}const s=tr(r[e]||n[e],t)||tr(r.appContext[e],t);return!s&&o?n:s}}function tr(e,t){return e&&(e[t]||e[A(t)]||e[L(A(t))])}function nr(e,t,n,o){let r;const s=n&&n[o];if(m(e)||S(e)){r=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,s&&s[n])));else{const n=Object.keys(e);r=new Array(n.length);for(let o=0,i=n.length;o{const t=o.fn(...e);return t&&(t.key=o.key),t}:o.fn)}return e}function rr(e,t,n={},o,r){if(Mn.isCE||Mn.parent&&wo(Mn.parent)&&Mn.parent.isCE)return"default"!==t&&(n.name=t),Ws("slot",n,o&&o());let s=e[t];s&&s._c&&(s._d=!1),Rs();const i=s&&sr(s(n)),l=Ms(xs,{key:n.key||i&&i.key||`_${t}`},i||(o?o():[]),i&&1===e._?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function sr(e){return e.some((e=>!Ls(e)||e.type!==Es&&!(e.type===xs&&!sr(e.children))))?e:null}function ir(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:$(o)]=e[o];return n}const lr=e=>e?pi(e)?Si(e)||e.proxy:lr(e.parent):null,cr=f(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lr(e.parent),$root:e=>lr(e.root),$emit:e=>e.emit,$options:e=>Ir(e),$forceUpdate:e=>e.f||(e.f=()=>Sn(e.update)),$nextTick:e=>e.n||(e.n=_n.bind(e.proxy)),$watch:e=>lo.bind(e)}),ar=(e,t)=>e!==s&&!e.__isScriptSetup&&g(e,t),ur={get({_:e},t){const{ctx:n,setupState:o,data:r,props:i,accessCache:l,type:c,appContext:a}=e;let u;if("$"!==t[0]){const c=l[t];if(void 0!==c)switch(c){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(ar(o,t))return l[t]=1,o[t];if(r!==s&&g(r,t))return l[t]=2,r[t];if((u=e.propsOptions[0])&&g(u,t))return l[t]=3,i[t];if(n!==s&&g(n,t))return l[t]=4,n[t];Fr&&(l[t]=0)}}const p=cr[t];let f,d;return p?("$attrs"===t&&Ae(e,0,t),p(e)):(f=c.__cssModules)&&(f=f[t])?f:n!==s&&g(n,t)?(l[t]=4,n[t]):(d=a.config.globalProperties,g(d,t)?d[t]:void 0)},set({_:e},t,n){const{data:o,setupState:r,ctx:i}=e;return ar(r,t)?(r[t]=n,!0):o!==s&&g(o,t)?(o[t]=n,!0):!(g(e.props,t)||"$"===t[0]&&t.slice(1)in e||(i[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,propsOptions:i}},l){let c;return!!n[l]||e!==s&&g(e,l)||ar(t,l)||(c=i[0])&&g(c,l)||g(o,l)||g(cr,l)||g(r.config.globalProperties,l)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:g(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},pr=f({},ur,{get(e,t){if(t!==Symbol.unscopables)return ur.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!K(t)});function fr(){return null}function dr(){return null}function hr(e){}function gr(e){}function mr(){return null}function vr(){}function yr(e,t){return null}function br(){return Cr().slots}function _r(){return Cr().attrs}function Sr(e,t,n){const o=si();if(n&&n.local){const n=Ut(e[t]);return so((()=>e[t]),(e=>n.value=e)),so(n,(n=>{n!==e[t]&&o.emit(`update:${t}`,n)})),n}return{__v_isRef:!0,get value(){return e[t]},set value(e){o.emit(`update:${t}`,e)}}}function Cr(){const e=si();return e.setupContext||(e.setupContext=_i(e))}function xr(e){return m(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}function wr(e,t){const n=xr(e);for(const e in t){if(e.startsWith("__skip"))continue;let o=n[e];o?m(o)||_(o)?o=n[e]={type:o,default:t[e]}:o.default=t[e]:null===o&&(o=n[e]={default:t[e]}),o&&t[`__skip_${e}`]&&(o.skipFactory=!0)}return n}function Er(e,t){return e&&t?m(e)&&m(t)?e.concat(t):f({},xr(e),xr(t)):e||t}function kr(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Tr(e){const t=si();let n=e();return ui(),w(n)&&(n=n.catch((e=>{throw ai(t),e}))),[n,()=>ai(t)]}let Fr=!0;function Rr(e,t,n){an(m(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function Pr(e,t,n,o){const r=o.includes(".")?co(n,o):()=>n[o];if(S(e)){const n=t[e];_(n)&&so(r,n)}else if(_(e))so(r,e.bind(n));else if(x(e))if(m(e))e.forEach((e=>Pr(e,t,n,o)));else{const o=_(e.handler)?e.handler.bind(n):t[e.handler];_(o)&&so(r,o,e)}}function Ir(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let c;return l?c=l:r.length||n||o?(c={},r.length&&r.forEach((e=>Or(c,e,i,!0))),Or(c,t,i)):c=t,x(t)&&s.set(t,c),c}function Or(e,t,n,o=!1){const{mixins:r,extends:s}=t;s&&Or(e,s,n,!0),r&&r.forEach((t=>Or(e,t,n,!0)));for(const r in t)if(o&&"expose"===r);else{const o=Nr[r]||n&&n[r];e[r]=o?o(e[r],t[r]):t[r]}return e}const Nr={data:Ar,props:$r,emits:$r,methods:Lr,computed:Lr,beforeCreate:Mr,created:Mr,beforeMount:Mr,mounted:Mr,beforeUpdate:Mr,updated:Mr,beforeDestroy:Mr,beforeUnmount:Mr,destroyed:Mr,unmounted:Mr,activated:Mr,deactivated:Mr,errorCaptured:Mr,serverPrefetch:Mr,components:Lr,directives:Lr,watch:function(e,t){if(!e)return t;if(!t)return e;const n=f(Object.create(null),e);for(const o in t)n[o]=Mr(e[o],t[o]);return n},provide:Ar,inject:function(e,t){return Lr(Dr(e),Dr(t))}};function Ar(e,t){return t?e?function(){return f(_(e)?e.call(this,this):e,_(t)?t.call(this,this):t)}:t:e}function Dr(e){if(m(e)){const t={};for(let n=0;n(s.has(e)||(e&&_(e.install)?(s.add(e),e.install(l,...t)):_(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,c,a){if(!i){const u=Ws(n,o);return u.appContext=r,c&&t?t(u,s):e(u,s,a),i=!0,l._container=s,s.__vue_app__=l,Si(u.component)||u.component.proxy}},unmount(){i&&(e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){Ur=l;try{return e()}finally{Ur=null}}};return l}}let Ur=null;function Hr(e,t){if(ri){let n=ri.provides;const o=ri.parent&&ri.parent.provides;o===n&&(n=ri.provides=Object.create(o)),n[e]=t}}function Wr(e,t,n=!1){const o=ri||Mn;if(o||Ur){const r=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Ur._context.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&_(t)?t.call(o&&o.proxy):t}}function qr(){return!!(ri||Mn||Ur)}function zr(e,t,n,o){const[r,i]=e.propsOptions;let l,c=!1;if(t)for(let s in t){if(P(s))continue;const a=t[s];let u;r&&g(r,u=A(s))?i&&i.includes(u)?(l||(l={}))[u]=a:n[u]=a:Dn(e.emitsOptions,s)||s in o&&a===o[s]||(o[s]=a,c=!0)}if(i){const t=Dt(n),o=l||s;for(let s=0;s{u=!0;const[n,o]=Gr(e,t,!0);f(c,n),o&&a.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!l&&!u)return x(e)&&o.set(e,i),i;if(m(l))for(let e=0;e-1,o[1]=n<0||e-1||g(o,"default"))&&a.push(t)}}}const p=[c,a];return x(e)&&o.set(e,p),p}function Jr(e){return"$"!==e[0]}function Yr(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function Zr(e,t){return Yr(e)===Yr(t)}function Xr(e,t){return m(t)?t.findIndex((t=>Zr(t,e))):_(t)&&Zr(t,e)?0:-1}const Qr=e=>"_"===e[0]||"$stable"===e,es=e=>m(e)?e.map(Ys):[Ys(e)],ts=(e,t,n)=>{if(t._n)return t;const o=Un(((...e)=>es(t(...e))),n);return o._c=!1,o},ns=(e,t,n)=>{const o=e._ctx;for(const n in e){if(Qr(n))continue;const r=e[n];if(_(r))t[n]=ts(0,r,o);else if(null!=r){const e=es(r);t[n]=()=>e}}},os=(e,t)=>{const n=es(t);e.slots.default=()=>n},rs=(e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=Dt(t),V(t,"_",n)):ns(t,e.slots={})}else e.slots={},t&&os(e,t);V(e.slots,js,1)},ss=(e,t,n)=>{const{vnode:o,slots:r}=e;let i=!0,l=s;if(32&o.shapeFlag){const e=t._;e?n&&1===e?i=!1:(f(r,t),n||1!==e||delete r._):(i=!t.$stable,ns(t,r)),l=t}else t&&(os(e,t),l={default:1});if(i)for(const e in r)Qr(e)||e in l||delete r[e]};function is(e,t,n,o,r=!1){if(m(e))return void e.forEach(((e,s)=>is(e,t&&(m(t)?t[s]:t),n,o,r)));if(wo(o)&&!r)return;const i=4&o.shapeFlag?Si(o.component)||o.component.proxy:o.el,l=r?null:i,{i:c,r:a}=e,u=t&&t.r,p=c.refs===s?c.refs={}:c.refs,f=c.setupState;if(null!=u&&u!==a&&(S(u)?(p[u]=null,g(f,u)&&(f[u]=null)):Vt(u)&&(u.value=null)),_(a))cn(a,c,12,[l,p]);else{const t=S(a),o=Vt(a);if(t||o){const s=()=>{if(e.f){const n=t?g(f,a)?f[a]:p[a]:a.value;r?m(n)&&d(n,i):m(n)?n.includes(i)||n.push(i):t?(p[a]=[i],g(f,a)&&(f[a]=p[a])):(a.value=[i],e.k&&(p[e.k]=a.value))}else t?(p[a]=l,g(f,a)&&(f[a]=l)):o&&(a.value=l,e.k&&(p[e.k]=l))};l?(s.id=-1,ps(s,n)):s()}}}let ls=!1;const cs=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,as=e=>8===e.nodeType;function us(e){const{mt:t,p:n,o:{patchProp:o,createText:r,nextSibling:s,parentNode:i,remove:l,insert:c,createComment:a}}=e,p=(n,o,l,a,u,v=!1)=>{const y=as(n)&&"["===n.data,b=()=>g(n,o,l,a,u,y),{type:_,ref:S,shapeFlag:C,patchFlag:x}=o;let w=n.nodeType;o.el=n,-2===x&&(v=!1,o.dynamicChildren=null);let E=null;switch(_){case ws:3!==w?""===o.children?(c(o.el=r(""),i(n),n),E=n):E=b():(n.data!==o.children&&(ls=!0,n.data=o.children),E=s(n));break;case Es:E=8!==w||y?b():s(n);break;case ks:if(y&&(w=(n=s(n)).nodeType),1===w||3===w){E=n;const e=!o.children.length;for(let t=0;t{i=i||!!t.dynamicChildren;const{type:c,props:a,patchFlag:p,shapeFlag:f,dirs:h}=t,g="input"===c&&h||"option"===c;if(g||-1!==p){if(h&&po(t,null,n,"created"),a)if(g||!i||48&p)for(const t in a)(g&&t.endsWith("value")||u(t)&&!P(t))&&o(e,t,null,a[t],!1,void 0,n);else a.onClick&&o(e,"onClick",null,a.onClick,!1,void 0,n);let c;if((c=a&&a.onVnodeBeforeMount)&&ei(c,n,t),h&&po(t,null,n,"beforeMount"),((c=a&&a.onVnodeMounted)||h)&&Qn((()=>{c&&ei(c,n,t),h&&po(t,null,n,"mounted")}),r),16&f&&(!a||!a.innerHTML&&!a.textContent)){let o=d(e.firstChild,t,e,n,r,s,i);for(;o;){ls=!0;const e=o;o=o.nextSibling,l(e)}}else 8&f&&e.textContent!==t.children&&(ls=!0,e.textContent=t.children)}return e.nextSibling},d=(e,t,o,r,s,i,l)=>{l=l||!!t.dynamicChildren;const c=t.children,a=c.length;for(let t=0;t{const{slotScopeIds:u}=t;u&&(r=r?r.concat(u):u);const p=i(e),f=d(s(e),t,p,n,o,r,l);return f&&as(f)&&"]"===f.data?s(t.anchor=f):(ls=!0,c(t.anchor=a("]"),p,f),f)},g=(e,t,o,r,c,a)=>{if(ls=!0,t.el=null,a){const t=m(e);for(;;){const n=s(e);if(!n||n===t)break;l(n)}}const u=s(e),p=i(e);return l(e),n(null,t,p,u,o,r,cs(p),c),u},m=e=>{let t=0;for(;e;)if((e=s(e))&&as(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return s(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),En(),void(t._vnode=e);ls=!1,p(t.firstChild,e,null,null,null),En(),t._vnode=e,ls&&console.error("Hydration completed but contains mismatches.")},p]}const ps=Qn;function fs(e){return hs(e)}function ds(e){return hs(e,us)}function hs(e,t){q().__VUE__=!0;const{insert:n,remove:o,patchProp:r,createElement:c,createText:a,createComment:u,setText:p,setElementText:f,parentNode:d,nextSibling:h,setScopeId:m=l,insertStaticContent:v}=e,y=(e,t,n,o=null,r=null,s=null,i=!1,l=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!$s(e,t)&&(o=J(e),H(e,r,s,!0),e=null),-2===t.patchFlag&&(c=!1,t.dynamicChildren=null);const{type:a,ref:u,shapeFlag:p}=t;switch(a){case ws:b(e,t,n,o);break;case Es:_(e,t,n,o);break;case ks:null==e&&S(t,n,o,i);break;case xs:R(e,t,n,o,r,s,i,l,c);break;default:1&p?C(e,t,n,o,r,s,i,l,c):6&p?I(e,t,n,o,r,s,i,l,c):(64&p||128&p)&&a.process(e,t,n,o,r,s,i,l,c,Z)}null!=u&&r&&is(u,e&&e.ref,s,t||e,!t)},b=(e,t,o,r)=>{if(null==e)n(t.el=a(t.children),o,r);else{const n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},_=(e,t,o,r)=>{null==e?n(t.el=u(t.children||""),o,r):t.el=e.el},S=(e,t,n,o)=>{[e.el,e.anchor]=v(e.children,t,n,o,e.el,e.anchor)},C=(e,t,n,o,r,s,i,l,c)=>{i=i||"svg"===t.type,null==e?x(t,n,o,r,s,i,l,c):k(e,t,r,s,i,l,c)},x=(e,t,o,s,i,l,a,u)=>{let p,d;const{type:h,props:g,shapeFlag:m,transition:v,dirs:y}=e;if(p=e.el=c(e.type,l,g&&g.is,g),8&m?f(p,e.children):16&m&&E(e.children,p,null,s,i,l&&"foreignObject"!==h,a,u),y&&po(e,null,s,"created"),w(p,e,e.scopeId,a,s),g){for(const t in g)"value"===t||P(t)||r(p,t,null,g[t],l,e.children,s,i,G);"value"in g&&r(p,"value",null,g.value),(d=g.onVnodeBeforeMount)&&ei(d,s,e)}y&&po(e,null,s,"beforeMount");const b=(!i||i&&!i.pendingBranch)&&v&&!v.persisted;b&&v.beforeEnter(p),n(p,t,o),((d=g&&g.onVnodeMounted)||b||y)&&ps((()=>{d&&ei(d,s,e),b&&v.enter(p),y&&po(e,null,s,"mounted")}),i)},w=(e,t,n,o,r)=>{if(n&&m(e,n),o)for(let t=0;t{for(let a=c;a{const a=t.el=e.el;let{patchFlag:u,dynamicChildren:p,dirs:d}=t;u|=16&e.patchFlag;const h=e.props||s,g=t.props||s;let m;n&&gs(n,!1),(m=g.onVnodeBeforeUpdate)&&ei(m,n,t,e),d&&po(t,e,n,"beforeUpdate"),n&&gs(n,!0);const v=i&&"foreignObject"!==t.type;if(p?T(e.dynamicChildren,p,a,n,o,v,l):c||$(e,t,a,null,n,o,v,l,!1),u>0){if(16&u)F(a,t,h,g,n,o,i);else if(2&u&&h.class!==g.class&&r(a,"class",null,g.class,i),4&u&&r(a,"style",h.style,g.style,i),8&u){const s=t.dynamicProps;for(let t=0;t{m&&ei(m,n,t,e),d&&po(t,e,n,"updated")}),o)},T=(e,t,n,o,r,s,i)=>{for(let l=0;l{if(n!==o){if(n!==s)for(const s in n)P(s)||s in o||r(e,s,n[s],null,c,t.children,i,l,G);for(const s in o){if(P(s))continue;const a=o[s],u=n[s];a!==u&&"value"!==s&&r(e,s,u,a,c,t.children,i,l,G)}"value"in o&&r(e,"value",n.value,o.value)}},R=(e,t,o,r,s,i,l,c,u)=>{const p=t.el=e?e.el:a(""),f=t.anchor=e?e.anchor:a("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(c=c?c.concat(g):g),null==e?(n(p,o,r),n(f,o,r),E(t.children,o,f,s,i,l,c,u)):d>0&&64&d&&h&&e.dynamicChildren?(T(e.dynamicChildren,h,o,s,i,l,c),(null!=t.key||s&&t===s.subTree)&&ms(e,t,!0)):$(e,t,o,f,s,i,l,c,u)},I=(e,t,n,o,r,s,i,l,c)=>{t.slotScopeIds=l,null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,i,c):O(t,n,o,r,s,i,c):N(e,t,c)},O=(e,t,n,o,r,s,i)=>{const l=e.component=oi(e,o,r);if(To(e)&&(l.ctx.renderer=Z),gi(l),l.asyncDep){if(r&&r.registerDep(l,D),!e.el){const e=l.subTree=Ws(Es);_(null,e,t,n)}}else D(l,e,t,n,r,s,i)},N=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:s}=e,{props:i,children:l,patchFlag:c}=t,a=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&c>=0))return!(!r&&!l||l&&l.$stable)||o!==i&&(o?!i||zn(o,i,a):!!i);if(1024&c)return!0;if(16&c)return o?zn(o,i,a):!!i;if(8&c){const e=t.dynamicProps;for(let t=0;thn&&dn.splice(t,1)}(o.update),o.update()}else t.el=e.el,o.vnode=t},D=(e,t,n,o,r,s,i)=>{const l=e.effect=new ke((()=>{if(e.isMounted){let t,{next:n,bu:o,u:l,parent:c,vnode:a}=e,u=n;gs(e,!1),n?(n.el=a.el,L(e,n,i)):n=a,o&&j(o),(t=n.props&&n.props.onVnodeBeforeUpdate)&&ei(t,c,n,a),gs(e,!0);const p=Hn(e),f=e.subTree;e.subTree=p,y(f,p,d(f.el),J(f),e,r,s),n.el=p.el,null===u&&Kn(e,p.el),l&&ps(l,r),(t=n.props&&n.props.onVnodeUpdated)&&ps((()=>ei(t,c,n,a)),r)}else{let i;const{el:l,props:c}=t,{bm:a,m:u,parent:p}=e,f=wo(t);if(gs(e,!1),a&&j(a),!f&&(i=c&&c.onVnodeBeforeMount)&&ei(i,p,t),gs(e,!0),l&&Q){const n=()=>{e.subTree=Hn(e),Q(l,e.subTree,e,r,null)};f?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const i=e.subTree=Hn(e);y(null,i,n,o,e,r,s),t.el=i.el}if(u&&ps(u,r),!f&&(i=c&&c.onVnodeMounted)){const e=t;ps((()=>ei(i,p,e)),r)}(256&t.shapeFlag||p&&wo(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&ps(e.a,r),e.isMounted=!0,t=n=o=null}}),(()=>Sn(c)),e.scope),c=e.update=()=>l.run();c.id=e.uid,gs(e,!0),c()},L=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:s,vnode:{patchFlag:i}}=e,l=Dt(r),[c]=e.propsOptions;let a=!1;if(!(o||i>0)||16&i){let o;zr(e,t,r,s)&&(a=!0);for(const s in l)t&&(g(t,s)||(o=M(s))!==s&&g(t,o))||(c?!n||void 0===n[s]&&void 0===n[o]||(r[s]=Kr(c,l,s,void 0,e,!0)):delete r[s]);if(s!==l)for(const e in s)t&&g(t,e)||(delete s[e],a=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let o=0;o{const a=e&&e.children,u=e?e.shapeFlag:0,p=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d)return void V(a,p,n,o,r,s,i,l,c);if(256&d)return void B(a,p,n,o,r,s,i,l,c)}8&h?(16&u&&G(a,r,s),p!==a&&f(n,p)):16&u?16&h?V(a,p,n,o,r,s,i,l,c):G(a,r,s,!0):(8&u&&f(n,""),16&h&&E(p,n,o,r,s,i,l,c))},B=(e,t,n,o,r,s,l,c,a)=>{t=t||i;const u=(e=e||i).length,p=t.length,f=Math.min(u,p);let d;for(d=0;dp?G(e,r,s,!0,!1,f):E(t,n,o,r,s,l,c,a,f)},V=(e,t,n,o,r,s,l,c,a)=>{let u=0;const p=t.length;let f=e.length-1,d=p-1;for(;u<=f&&u<=d;){const o=e[u],i=t[u]=a?Zs(t[u]):Ys(t[u]);if(!$s(o,i))break;y(o,i,n,null,r,s,l,c,a),u++}for(;u<=f&&u<=d;){const o=e[f],i=t[d]=a?Zs(t[d]):Ys(t[d]);if(!$s(o,i))break;y(o,i,n,null,r,s,l,c,a),f--,d--}if(u>f){if(u<=d){const e=d+1,i=ed)for(;u<=f;)H(e[u],r,s,!0),u++;else{const h=u,g=u,m=new Map;for(u=g;u<=d;u++){const e=t[u]=a?Zs(t[u]):Ys(t[u]);null!=e.key&&m.set(e.key,u)}let v,b=0;const _=d-g+1;let S=!1,C=0;const x=new Array(_);for(u=0;u<_;u++)x[u]=0;for(u=h;u<=f;u++){const o=e[u];if(b>=_){H(o,r,s,!0);continue}let i;if(null!=o.key)i=m.get(o.key);else for(v=g;v<=d;v++)if(0===x[v-g]&&$s(o,t[v])){i=v;break}void 0===i?H(o,r,s,!0):(x[i-g]=u+1,i>=C?C=i:S=!0,y(o,t[i],n,null,r,s,l,c,a),b++)}const w=S?function(e){const t=e.slice(),n=[0];let o,r,s,i,l;const c=e.length;for(o=0;o>1,e[n[l]]0&&(t[o]=n[s-1]),n[s]=o)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=t[i];return n}(x):i;for(v=w.length-1,u=_-1;u>=0;u--){const e=g+u,i=t[e],f=e+1{const{el:i,type:l,transition:c,children:a,shapeFlag:u}=e;if(6&u)U(e.component.subTree,t,o,r);else if(128&u)e.suspense.move(t,o,r);else if(64&u)l.move(e,t,o,Z);else if(l!==xs)if(l!==ks)if(2!==r&&1&u&&c)if(0===r)c.beforeEnter(i),n(i,t,o),ps((()=>c.enter(i)),s);else{const{leave:e,delayLeave:r,afterLeave:s}=c,l=()=>n(i,t,o),a=()=>{e(i,(()=>{l(),s&&s()}))};r?r(i,l,a):a()}else n(i,t,o);else(({el:e,anchor:t},o,r)=>{let s;for(;e&&e!==t;)s=h(e),n(e,o,r),e=s;n(t,o,r)})(e,t,o);else{n(i,t,o);for(let e=0;e{const{type:s,props:i,ref:l,children:c,dynamicChildren:a,shapeFlag:u,patchFlag:p,dirs:f}=e;if(null!=l&&is(l,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const d=1&u&&f,h=!wo(e);let g;if(h&&(g=i&&i.onVnodeBeforeUnmount)&&ei(g,t,e),6&u)K(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);d&&po(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,Z,o):a&&(s!==xs||p>0&&64&p)?G(a,t,n,!1,!0):(s===xs&&384&p||!r&&16&u)&&G(c,t,n),o&&W(e)}(h&&(g=i&&i.onVnodeUnmounted)||d)&&ps((()=>{g&&ei(g,t,e),d&&po(e,null,t,"unmounted")}),n)},W=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===xs)return void z(n,r);if(t===ks)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),o(e),e=n;o(t)})(e);const i=()=>{o(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:o}=s,r=()=>t(n,i);o?o(e.el,i,r):r()}else i()},z=(e,t)=>{let n;for(;e!==t;)n=h(e),o(e),e=n;o(t)},K=(e,t,n)=>{const{bum:o,scope:r,update:s,subTree:i,um:l}=e;o&&j(o),r.stop(),s&&(s.active=!1,H(i,e,t,n)),l&&ps(l,t),ps((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},G=(e,t,n,o=!1,r=!1,s=0)=>{for(let i=s;i6&e.shapeFlag?J(e.component.subTree):128&e.shapeFlag?e.suspense.next():h(e.anchor||e.el),Y=(e,t,n)=>{null==e?t._vnode&&H(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),wn(),En(),t._vnode=e},Z={p:y,um:H,m:U,r:W,mt:O,mc:E,pc:$,pbc:T,n:J,o:e};let X,Q;return t&&([X,Q]=t(Z)),{render:Y,hydrate:X,createApp:Vr(Y,X)}}function gs({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function ms(e,t,n=!1){const o=e.children,r=t.children;if(m(o)&&m(r))for(let e=0;ee&&(e.disabled||""===e.disabled),ys=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,bs=(e,t)=>{const n=e&&e.to;if(S(n)){if(t){return t(n)}return null}return n};function _s(e,t,n,{o:{insert:o},m:r},s=2){0===s&&o(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:c,children:a,props:u}=e,p=2===s;if(p&&o(i,t,n),(!p||vs(u))&&16&c)for(let e=0;e{16&y&&u(b,e,t,r,s,i,l,c)};v?m(n,a):p&&m(p,f)}else{t.el=e.el;const o=t.anchor=e.anchor,u=t.target=e.target,d=t.targetAnchor=e.targetAnchor,g=vs(e.props),m=g?n:u,y=g?o:d;if(i=i||ys(u),_?(f(e.dynamicChildren,_,m,r,s,i,l),ms(e,t,!0)):c||p(e,t,m,y,r,s,i,l,!1),v)g||_s(t,n,o,a,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=bs(t.props,h);e&&_s(t,e,null,a,0)}else g&&_s(t,u,d,a,1)}Cs(t)},remove(e,t,n,o,{um:r,o:{remove:s}},i){const{shapeFlag:l,children:c,anchor:a,targetAnchor:u,target:p,props:f}=e;if(p&&s(u),(i||!vs(f))&&(s(a),16&l))for(let e=0;e0?Fs||i:null,Ps(),Os>0&&Fs&&Fs.push(e),e}function Ds(e,t,n,o,r,s){return As(Hs(e,t,n,o,r,s,!0))}function Ms(e,t,n,o,r){return As(Ws(e,t,n,o,r,!0))}function Ls(e){return!!e&&!0===e.__v_isVNode}function $s(e,t){return e.type===t.type&&e.key===t.key}function Bs(e){Is=e}const js="__vInternal",Vs=({key:e})=>null!=e?e:null,Us=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?S(e)||Vt(e)||_(e)?{i:Mn,r:e,k:t,f:!!n}:e:null);function Hs(e,t=null,n=null,o=0,r=null,s=(e===xs?0:1),i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Vs(t),ref:t&&Us(t),scopeId:Ln,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Mn};return l?(Xs(c,n),128&s&&e.normalize(c)):n&&(c.shapeFlag|=S(n)?8:16),Os>0&&!i&&Fs&&(c.patchFlag>0||6&s)&&32!==c.patchFlag&&Fs.push(c),c}const Ws=function(e,t=null,n=null,o=0,r=null,s=!1){if(e&&e!==Zo||(e=Es),Ls(e)){const o=zs(e,t,!0);return n&&Xs(o,n),Os>0&&!s&&Fs&&(6&o.shapeFlag?Fs[Fs.indexOf(e)]=o:Fs.push(o)),o.patchFlag|=-2,o}if(i=e,_(i)&&"__vccOpts"in i&&(e=e.__vccOpts),t){t=qs(t);let{class:e,style:n}=t;e&&!S(e)&&(t.class=Q(e)),x(n)&&(At(n)&&!m(n)&&(n=f({},n)),t.style=G(n))}var i;return Hs(e,t,n,o,r,S(e)?1:Gn(e)?128:(e=>e.__isTeleport)(e)?64:x(e)?4:_(e)?2:0,s,!0)};function qs(e){return e?At(e)||js in e?f({},e):e:null}function zs(e,t,n=!1){const{props:o,ref:r,patchFlag:s,children:i}=e,l=t?Qs(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Vs(l),ref:t&&t.ref?n&&r?m(r)?r.concat(Us(t)):[r,Us(t)]:Us(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==xs?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zs(e.ssContent),ssFallback:e.ssFallback&&zs(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Ks(e=" ",t=0){return Ws(ws,null,e,t)}function Gs(e,t){const n=Ws(ks,null,e);return n.staticCount=t,n}function Js(e="",t=!1){return t?(Rs(),Ms(Es,null,e)):Ws(Es,null,e)}function Ys(e){return null==e||"boolean"==typeof e?Ws(Es):m(e)?Ws(xs,null,e.slice()):"object"==typeof e?Zs(e):Ws(ws,null,String(e))}function Zs(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:zs(e)}function Xs(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(m(t))n=16;else if("object"==typeof t){if(65&o){const n=t.default;return void(n&&(n._c&&(n._d=!1),Xs(e,n()),n._c&&(n._d=!0)))}{n=32;const o=t._;o||js in t?3===o&&Mn&&(1===Mn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Mn}}else _(t)?(t={default:t,_ctx:Mn},n=32):(t=String(t),64&o?(n=16,t=[Ks(t)]):n=8);e.children=t,e.shapeFlag|=n}function Qs(...e){const t={};for(let n=0;nri||Mn;let ii,li,ci="__VUE_INSTANCE_SETTERS__";(li=q()[ci])||(li=q()[ci]=[]),li.push((e=>ri=e)),ii=e=>{li.length>1?li.forEach((t=>t(e))):li[0](e)};const ai=e=>{ii(e),e.scope.on()},ui=()=>{ri&&ri.scope.off(),ii(null)};function pi(e){return 4&e.vnode.shapeFlag}let fi,di,hi=!1;function gi(e,t=!1){hi=t;const{props:n,children:o}=e.vnode,r=pi(e);!function(e,t,n,o=!1){const r={},s={};V(s,js,1),e.propsDefaults=Object.create(null),zr(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=o?r:Tt(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,n,r,t),rs(e,o);const s=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Mt(new Proxy(e.ctx,ur));const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?_i(e):null;ai(e),Oe();const r=cn(o,e,0,[e.props,n]);if(Ne(),ui(),w(r)){if(r.then(ui,ui),t)return r.then((n=>{mi(e,n,t)})).catch((t=>{un(t,e,0)}));e.asyncDep=r}else mi(e,r,t)}else bi(e,t)}(e,t):void 0;return hi=!1,s}function mi(e,t,n){_(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:x(t)&&(e.setupState=Yt(t)),bi(e,n)}function vi(e){fi=e,di=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,pr))}}const yi=()=>!fi;function bi(e,t,n){const o=e.type;if(!e.render){if(!t&&fi&&!o.render){const t=o.template||Ir(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:i}=o,l=f(f({isCustomElement:n,delimiters:s},r),i);o.render=fi(t,l)}}e.render=o.render||l,di&&di(e)}ai(e),Oe(),function(e){const t=Ir(e),n=e.proxy,o=e.ctx;Fr=!1,t.beforeCreate&&Rr(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:i,watch:c,provide:a,inject:u,created:p,beforeMount:f,mounted:d,beforeUpdate:h,updated:g,activated:v,deactivated:y,beforeDestroy:b,beforeUnmount:S,destroyed:C,unmounted:w,render:E,renderTracked:k,renderTriggered:T,errorCaptured:F,serverPrefetch:R,expose:P,inheritAttrs:I,components:O,directives:N,filters:A}=t;if(u&&function(e,t,n=l){m(e)&&(e=Dr(e));for(const n in e){const o=e[n];let r;r=x(o)?"default"in o?Wr(o.from||n,o.default,!0):Wr(o.from||n):Wr(o),Vt(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(u,o,null),i)for(const e in i){const t=i[e];_(t)&&(o[e]=t.bind(n))}if(r){const t=r.call(n,n);x(t)&&(e.data=kt(t))}if(Fr=!0,s)for(const e in s){const t=s[e],r=_(t)?t.bind(n,n):_(t.get)?t.get.bind(n,n):l,i=!_(t)&&_(t.set)?t.set.bind(n):l,c=xi({get:r,set:i});Object.defineProperty(o,e,{enumerable:!0,configurable:!0,get:()=>c.value,set:e=>c.value=e})}if(c)for(const e in c)Pr(c[e],o,n,e);if(a){const e=_(a)?a.call(n):a;Reflect.ownKeys(e).forEach((t=>{Hr(t,e[t])}))}function D(e,t){m(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(p&&Rr(p,e,"c"),D($o,f),D(Bo,d),D(jo,h),D(Vo,g),D(Po,v),D(Io,y),D(Ko,F),D(zo,k),D(qo,T),D(Uo,S),D(Ho,w),D(Wo,R),m(P))if(P.length){const t=e.exposed||(e.exposed={});P.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});E&&e.render===l&&(e.render=E),null!=I&&(e.inheritAttrs=I),O&&(e.components=O),N&&(e.directives=N)}(e),Ne(),ui()}function _i(e){return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(Ae(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Si(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Yt(Mt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in cr?cr[n](e):void 0,has:(e,t)=>t in e||t in cr}))}function Ci(e,t=!0){return _(e)?e.displayName||e.name:e.name||t&&e.__name}const xi=(e,t)=>function(e,t,n=!1){let o,r;const s=_(e);return s?(o=e,r=l):(o=e.get,r=e.set),new rn(o,r,s||!r,n)}(e,0,hi);function wi(e,t,n){const o=arguments.length;return 2===o?x(t)&&!m(t)?Ls(t)?Ws(e,null,[t]):Ws(e,t):Ws(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Ls(n)&&(n=[n]),Ws(e,t,n))}const Ei=Symbol.for("v-scx"),ki=()=>Wr(Ei);function Ti(){}function Fi(e,t,n,o){const r=n[o];if(r&&Ri(r,e))return r;const s=t();return s.memo=e.slice(),n[o]=s}function Ri(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&Fs&&Fs.push(e),!0}const Pi="3.3.4",Ii={createComponentInstance:oi,setupComponent:gi,renderComponentRoot:Hn,setCurrentRenderingInstance:$n,isVNode:Ls,normalizeVNode:Ys},Oi=null,Ni=null,Ai="undefined"!=typeof document?document:null,Di=Ai&&Ai.createElement("template"),Mi={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t?Ai.createElementNS("http://www.w3.org/2000/svg",e):Ai.createElement(e,n?{is:n}:void 0);return"select"===e&&o&&null!=o.multiple&&r.setAttribute("multiple",o.multiple),r},createText:e=>Ai.createTextNode(e),createComment:e=>Ai.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ai.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,s){const i=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{Di.innerHTML=o?`${e}`:e;const r=Di.content;if(o){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Li=/\s*!important$/;function $i(e,t,n){if(m(n))n.forEach((n=>$i(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=ji[t];if(n)return n;let o=A(t);if("filter"!==o&&o in e)return ji[t]=o;o=L(o);for(let n=0;nWi||(qi.then((()=>Wi=0)),Wi=Date.now()),Ki=/^on[a-z]/;function Gi(e,t){const n=xo(e);class o extends Zi{constructor(e){super(n,e,t)}}return o.def=n,o}const Ji=e=>Gi(e,Ql),Yi="undefined"!=typeof HTMLElement?HTMLElement:class{};class Zi extends Yi{constructor(e,t={},n){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,_n((()=>{this._connected||(Xl(null,this.shadowRoot),this._instance=null)}))}_resolveDef(){this._resolved=!0;for(let e=0;e{for(const t of e)this._setAttr(t.attributeName)})).observe(this,{attributes:!0});const e=(e,t=!1)=>{const{props:n,styles:o}=e;let r;if(n&&!m(n))for(const e in n){const t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=H(this._props[e])),(r||(r=Object.create(null)))[A(e)]=!0)}this._numberProps=r,t&&this._resolveProps(e),this._applyStyles(o),this._update()},t=this._def.__asyncLoader;t?t().then((t=>e(t,!0))):e(this._def)}_resolveProps(e){const{props:t}=e,n=m(t)?t:Object.keys(t||{});for(const e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e],!0,!1);for(const e of n.map(A))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t)}})}_setAttr(e){let t=this.getAttribute(e);const n=A(e);this._numberProps&&this._numberProps[n]&&(t=H(t)),this._setProp(n,t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,o=!0){t!==this._props[e]&&(this._props[e]=t,o&&this._instance&&this._update(),n&&(!0===t?this.setAttribute(M(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(M(e),t+""):t||this.removeAttribute(M(e))))}_update(){Xl(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Ws(this._def,f({},this._props));return this._instance||(e.ce=e=>{this._instance=e,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,{detail:t}))};e.emit=(e,...n)=>{t(e,n),M(e)!==e&&t(M(e),n)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof Zi){e.parent=n._instance,e.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach((e=>{const t=document.createElement("style");t.textContent=e,this.shadowRoot.appendChild(t)}))}}function Xi(e="$style"){{const t=si();if(!t)return s;const n=t.type.__cssModules;if(!n)return s;return n[e]||s}}function Qi(e){const t=si();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach((e=>tl(e,n)))},o=()=>{const o=e(t.proxy);el(t.subTree,o),n(o)};no(o),Bo((()=>{const e=new MutationObserver(o);e.observe(t.subTree.el.parentNode,{childList:!0}),Ho((()=>e.disconnect()))}))}function el(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{el(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)tl(e.el,t);else if(e.type===xs)e.children.forEach((e=>el(e,t)));else if(e.type===ks){let{el:n,anchor:o}=e;for(;n&&(tl(n,t),n!==o);)n=n.nextSibling}}function tl(e,t){if(1===e.nodeType){const n=e.style;for(const e in t)n.setProperty(`--${e}`,t[e])}}const nl="transition",ol="animation",rl=(e,{slots:t})=>wi(mo,al(e),t);rl.displayName="Transition";const sl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},il=rl.props=f({},go,sl),ll=(e,t=[])=>{m(e)?e.forEach((e=>e(...t))):e&&e(...t)},cl=e=>!!e&&(m(e)?e.some((e=>e.length>1)):e.length>1);function al(e){const t={};for(const n in e)n in sl||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:o,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=s,appearActiveClass:a=i,appearToClass:u=l,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,g=function(e){if(null==e)return null;if(x(e))return[ul(e.enter),ul(e.leave)];{const t=ul(e);return[t,t]}}(r),m=g&&g[0],v=g&&g[1],{onBeforeEnter:y,onEnter:b,onEnterCancelled:_,onLeave:S,onLeaveCancelled:C,onBeforeAppear:w=y,onAppear:E=b,onAppearCancelled:k=_}=t,T=(e,t,n)=>{fl(e,t?u:l),fl(e,t?a:i),n&&n()},F=(e,t)=>{e._isLeaving=!1,fl(e,p),fl(e,h),fl(e,d),t&&t()},R=e=>(t,n)=>{const r=e?E:b,i=()=>T(t,e,n);ll(r,[t,i]),dl((()=>{fl(t,e?c:s),pl(t,e?u:l),cl(r)||gl(t,o,m,i)}))};return f(t,{onBeforeEnter(e){ll(y,[e]),pl(e,s),pl(e,i)},onBeforeAppear(e){ll(w,[e]),pl(e,c),pl(e,a)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>F(e,t);pl(e,p),bl(),pl(e,d),dl((()=>{e._isLeaving&&(fl(e,p),pl(e,h),cl(S)||gl(e,o,v,n))})),ll(S,[e,n])},onEnterCancelled(e){T(e,!1),ll(_,[e])},onAppearCancelled(e){T(e,!0),ll(k,[e])},onLeaveCancelled(e){F(e),ll(C,[e])}})}function ul(e){return H(e)}function pl(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function fl(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function dl(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let hl=0;function gl(e,t,n,o){const r=e._endId=++hl,s=()=>{r===e._endId&&o()};if(n)return setTimeout(s,n);const{type:i,timeout:l,propCount:c}=ml(e,t);if(!i)return o();const a=i+"end";let u=0;const p=()=>{e.removeEventListener(a,f),s()},f=t=>{t.target===e&&++u>=c&&p()};setTimeout((()=>{u(n[e]||"").split(", "),r=o(`${nl}Delay`),s=o(`${nl}Duration`),i=vl(r,s),l=o(`${ol}Delay`),c=o(`${ol}Duration`),a=vl(l,c);let u=null,p=0,f=0;return t===nl?i>0&&(u=nl,p=i,f=s.length):t===ol?a>0&&(u=ol,p=a,f=c.length):(p=Math.max(i,a),u=p>0?i>a?nl:ol:null,f=u?u===nl?s.length:c.length:0),{type:u,timeout:p,propCount:f,hasTransform:u===nl&&/\b(transform|all)(,|$)/.test(o(`${nl}Property`).toString())}}function vl(e,t){for(;e.lengthyl(t)+yl(e[n]))))}function yl(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function bl(){return document.body.offsetHeight}const _l=new WeakMap,Sl=new WeakMap,Cl={name:"TransitionGroup",props:f({},il,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=si(),o=fo();let r,s;return Vo((()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const o=e.cloneNode();e._vtc&&e._vtc.forEach((e=>{e.split(/\s+/).forEach((e=>e&&o.classList.remove(e)))})),n.split(/\s+/).forEach((e=>e&&o.classList.add(e))),o.style.display="none";const r=1===t.nodeType?t:t.parentNode;r.appendChild(o);const{hasTransform:s}=ml(o);return r.removeChild(o),s}(r[0].el,n.vnode.el,t))return;r.forEach(xl),r.forEach(wl);const o=r.filter(El);bl(),o.forEach((e=>{const n=e.el,o=n.style;pl(n,t),o.transform=o.webkitTransform=o.transitionDuration="";const r=n._moveCb=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n._moveCb=null,fl(n,t))};n.addEventListener("transitionend",r)}))})),()=>{const i=Dt(e),l=al(i);let c=i.tag||xs;r=s,s=t.default?Co(t.default()):[];for(let e=0;e{const t=e.props["onUpdate:modelValue"]||!1;return m(t)?e=>j(t,e):t};function Tl(e){e.target.composing=!0}function Fl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Rl={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e._assign=kl(r);const s=o||r.props&&"number"===r.props.type;Ui(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n&&(o=o.trim()),s&&(o=U(o)),e._assign(o)})),n&&Ui(e,"change",(()=>{e.value=e.value.trim()})),t||(Ui(e,"compositionstart",Tl),Ui(e,"compositionend",Fl),Ui(e,"change",Fl))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:o,number:r}},s){if(e._assign=kl(s),e.composing)return;if(document.activeElement===e&&"range"!==e.type){if(n)return;if(o&&e.value.trim()===t)return;if((r||"number"===e.type)&&U(e.value)===t)return}const i=null==t?"":t;e.value!==i&&(e.value=i)}},Pl={deep:!0,created(e,t,n){e._assign=kl(n),Ui(e,"change",(()=>{const t=e._modelValue,n=Dl(e),o=e.checked,r=e._assign;if(m(t)){const e=le(t,n),s=-1!==e;if(o&&!s)r(t.concat(n));else if(!o&&s){const n=[...t];n.splice(e,1),r(n)}}else if(y(t)){const e=new Set(t);o?e.add(n):e.delete(n),r(e)}else r(Ml(e,o))}))},mounted:Il,beforeUpdate(e,t,n){e._assign=kl(n),Il(e,t,n)}};function Il(e,{value:t,oldValue:n},o){e._modelValue=t,m(t)?e.checked=le(t,o.props.value)>-1:y(t)?e.checked=t.has(o.props.value):t!==n&&(e.checked=ie(t,Ml(e,!0)))}const Ol={created(e,{value:t},n){e.checked=ie(t,n.props.value),e._assign=kl(n),Ui(e,"change",(()=>{e._assign(Dl(e))}))},beforeUpdate(e,{value:t,oldValue:n},o){e._assign=kl(o),t!==n&&(e.checked=ie(t,o.props.value))}},Nl={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const r=y(t);Ui(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?U(Dl(e)):Dl(e)));e._assign(e.multiple?r?new Set(t):t:t[0])})),e._assign=kl(o)},mounted(e,{value:t}){Al(e,t)},beforeUpdate(e,t,n){e._assign=kl(n)},updated(e,{value:t}){Al(e,t)}};function Al(e,t){const n=e.multiple;if(!n||m(t)||y(t)){for(let o=0,r=e.options.length;o-1:r.selected=t.has(s);else if(ie(Dl(r),t))return void(e.selectedIndex!==o&&(e.selectedIndex=o))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function Dl(e){return"_value"in e?e._value:e.value}function Ml(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ll={created(e,t,n){Bl(e,t,n,null,"created")},mounted(e,t,n){Bl(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Bl(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Bl(e,t,n,o,"updated")}};function $l(e,t){switch(e){case"SELECT":return Nl;case"TEXTAREA":return Rl;default:switch(t){case"checkbox":return Pl;case"radio":return Ol;default:return Rl}}}function Bl(e,t,n,o,r){const s=$l(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,o)}const jl=["ctrl","shift","alt","meta"],Vl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>jl.some((n=>e[`${n}Key`]&&!t.includes(n)))},Ul=(e,t)=>(n,...o)=>{for(let e=0;en=>{if(!("key"in n))return;const o=M(n.key);return t.some((e=>e===o||Hl[e]===o))?e(n):void 0},ql={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):zl(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),zl(e,!0),o.enter(e)):o.leave(e,(()=>{zl(e,!1)})):zl(e,t))},beforeUnmount(e,{value:t}){zl(e,t)}};function zl(e,t){e.style.display=t?e._vod:"none"}const Kl=f({patchProp:(e,t,n,o,r=!1,s,i,l,c)=>{"class"===t?function(e,t,n){const o=e._vtc;o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,r):"style"===t?function(e,t,n){const o=e.style,r=S(n);if(n&&!r){if(t&&!S(t))for(const e in t)null==n[e]&&$i(o,e,"");for(const e in n)$i(o,e,n[e])}else{const s=o.display;r?t!==n&&(o.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(o.display=s)}}(e,n,o):u(t)?p(t)||function(e,t,n,o,r=null){const s=e._vei||(e._vei={}),i=s[t];if(o&&i)i.value=o;else{const[n,l]=function(e){let t;if(Hi.test(e)){let n;for(t={};n=e.match(Hi);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):M(e.slice(2)),t]}(t);if(o){const i=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();an(function(e,t){if(m(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=zi(),n}(o,r);Ui(e,n,i,l)}else i&&(function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,i,l),s[t]=void 0)}}(e,t,0,o,i):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){return o?"innerHTML"===t||"textContent"===t||!!(t in e&&Ki.test(t)&&_(n)):"spellcheck"!==t&&"draggable"!==t&&"translate"!==t&&("form"!==t&&(("list"!==t||"INPUT"!==e.tagName)&&(("type"!==t||"TEXTAREA"!==e.tagName)&&((!Ki.test(t)||!S(n))&&t in e))))}(e,t,o,r))?function(e,t,n,o,r,s,i){if("innerHTML"===t||"textContent"===t)return o&&i(o,r,s),void(e[t]=null==n?"":n);const l=e.tagName;if("value"===t&&"PROGRESS"!==l&&!l.includes("-")){e._value=n;const o=null==n?"":n;return("OPTION"===l?e.getAttribute("value"):e.value)!==o&&(e.value=o),void(null==n&&e.removeAttribute(t))}let c=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=se(n):null==n&&"string"===o?(n="",c=!0):"number"===o&&(n=0,c=!0)}try{e[t]=n}catch(e){}c&&e.removeAttribute(t)}(e,t,o,s,i,l,c):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o,r){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Vi,t.slice(6,t.length)):e.setAttributeNS(Vi,t,n);else{const o=re(t);null==n||o&&!se(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,r))}},Mi);let Gl,Jl=!1;function Yl(){return Gl||(Gl=fs(Kl))}function Zl(){return Gl=Jl?Gl:ds(Kl),Jl=!0,Gl}const Xl=(...e)=>{Yl().render(...e)},Ql=(...e)=>{Zl().hydrate(...e)},ec=(...e)=>{const t=Yl().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=nc(e);if(!o)return;const r=t._component;_(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const s=n(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},t},tc=(...e)=>{const t=Zl().createApp(...e),{mount:n}=t;return t.mount=e=>{const t=nc(e);if(t)return n(t,!0,t instanceof SVGElement)},t};function nc(e){return S(e)?document.querySelector(e):e}let oc=!1;const rc=()=>{oc||(oc=!0,Rl.getSSRProps=({value:e})=>({value:e}),Ol.getSSRProps=({value:e},t)=>{if(t.props&&ie(t.props.value,e))return{checked:!0}},Pl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&le(e,t.props.value)>-1)return{checked:!0}}else if(y(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Ll.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=$l(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0},ql.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})};function sc(e){throw e}function ic(e){}function lc(e,t,n,o){const r=new SyntaxError(String(e));return r.code=e,r.loc=t,r}const cc=Symbol(""),ac=Symbol(""),uc=Symbol(""),pc=Symbol(""),fc=Symbol(""),dc=Symbol(""),hc=Symbol(""),gc=Symbol(""),mc=Symbol(""),vc=Symbol(""),yc=Symbol(""),bc=Symbol(""),_c=Symbol(""),Sc=Symbol(""),Cc=Symbol(""),xc=Symbol(""),wc=Symbol(""),Ec=Symbol(""),kc=Symbol(""),Tc=Symbol(""),Fc=Symbol(""),Rc=Symbol(""),Pc=Symbol(""),Ic=Symbol(""),Oc=Symbol(""),Nc=Symbol(""),Ac=Symbol(""),Dc=Symbol(""),Mc=Symbol(""),Lc=Symbol(""),$c=Symbol(""),Bc=Symbol(""),jc=Symbol(""),Vc=Symbol(""),Uc=Symbol(""),Hc=Symbol(""),Wc=Symbol(""),qc=Symbol(""),zc=Symbol(""),Kc={[cc]:"Fragment",[ac]:"Teleport",[uc]:"Suspense",[pc]:"KeepAlive",[fc]:"BaseTransition",[dc]:"openBlock",[hc]:"createBlock",[gc]:"createElementBlock",[mc]:"createVNode",[vc]:"createElementVNode",[yc]:"createCommentVNode",[bc]:"createTextVNode",[_c]:"createStaticVNode",[Sc]:"resolveComponent",[Cc]:"resolveDynamicComponent",[xc]:"resolveDirective",[wc]:"resolveFilter",[Ec]:"withDirectives",[kc]:"renderList",[Tc]:"renderSlot",[Fc]:"createSlots",[Rc]:"toDisplayString",[Pc]:"mergeProps",[Ic]:"normalizeClass",[Oc]:"normalizeStyle",[Nc]:"normalizeProps",[Ac]:"guardReactiveProps",[Dc]:"toHandlers",[Mc]:"camelize",[Lc]:"capitalize",[$c]:"toHandlerKey",[Bc]:"setBlockTracking",[jc]:"pushScopeId",[Vc]:"popScopeId",[Uc]:"withCtx",[Hc]:"unref",[Wc]:"isRef",[qc]:"withMemo",[zc]:"isMemoSame"},Gc={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function Jc(e,t,n,o,r,s,i,l=!1,c=!1,a=!1,u=Gc){return e&&(l?(e.helper(dc),e.helper(sa(e.inSSR,a))):e.helper(ra(e.inSSR,a)),i&&e.helper(Ec)),{type:13,tag:t,props:n,children:o,patchFlag:r,dynamicProps:s,directives:i,isBlock:l,disableTracking:c,isComponent:a,loc:u}}function Yc(e,t=Gc){return{type:17,loc:t,elements:e}}function Zc(e,t=Gc){return{type:15,loc:t,properties:e}}function Xc(e,t){return{type:16,loc:Gc,key:S(e)?Qc(e,!0):e,value:t}}function Qc(e,t=!1,n=Gc,o=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:o}}function ea(e,t=Gc){return{type:8,loc:t,children:e}}function ta(e,t=[],n=Gc){return{type:14,loc:n,callee:e,arguments:t}}function na(e,t=void 0,n=!1,o=!1,r=Gc){return{type:18,params:e,returns:t,newline:n,isSlot:o,loc:r}}function oa(e,t,n,o=!0){return{type:19,test:e,consequent:t,alternate:n,newline:o,loc:Gc}}function ra(e,t){return e||t?mc:vc}function sa(e,t){return e||t?hc:gc}function ia(e,{helper:t,removeHelper:n,inSSR:o}){e.isBlock||(e.isBlock=!0,n(ra(o,e.isComponent)),t(dc),t(sa(o,e.isComponent)))}const la=e=>4===e.type&&e.isStatic,ca=(e,t)=>e===t||e===M(t);function aa(e){return ca(e,"Teleport")?ac:ca(e,"Suspense")?uc:ca(e,"KeepAlive")?pc:ca(e,"BaseTransition")?fc:void 0}const ua=/^\d|[^\$\w]/,pa=e=>!ua.test(e),fa=/[A-Za-z_$\xA0-\uFFFF]/,da=/[\.\?\w$\xA0-\uFFFF]/,ha=/\s+[.[]\s*|\s*[.[]\s+/g,ga=e=>{e=e.trim().replace(ha,(e=>e.trim()));let t=0,n=[],o=0,r=0,s=null;for(let i=0;i4===e.key.type&&e.key.content===o))}return n}function Pa(e,t){return`_${t}_${e.replace(/[^\w]/g,((t,n)=>"-"===t?"_":e.charCodeAt(n).toString()))}`}function Ia(e,t){const n=t.options?t.options.compatConfig:t.compatConfig,o=n&&n[e];return"MODE"===e?o||3:o}function Oa(e,t){const n=Ia("MODE",t),o=Ia(e,t);return 3===n?!0===o:!1!==o}function Na(e,t,n,...o){return Oa(e,t)}const Aa=/&(gt|lt|amp|apos|quot);/g,Da={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},Ma={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:c,isPreTag:c,isCustomElement:c,decodeEntities:e=>e.replace(Aa,((e,t)=>Da[t])),onError:sc,onWarn:ic,comments:!1};function La(e,t,n){const o=Qa(n),r=o?o.ns:0,s=[];for(;!su(e,t,n);){const i=e.source;let l;if(0===t||1===t)if(!e.inVPre&&eu(i,e.options.delimiters[0]))l=Ga(e,t);else if(0===t&&"<"===i[0])if(1===i.length)ru(e,5,1);else if("!"===i[1])eu(i,"\x3c!--")?l=ja(e):eu(i,""===i[2]){ru(e,14,2),tu(e,3);continue}if(/[a-z]/i.test(i[2])){ru(e,23),qa(e,Ha.End,o);continue}ru(e,12,2),l=Va(e)}else/[a-z]/i.test(i[1])?(l=Ua(e,n),Oa("COMPILER_NATIVE_TEMPLATE",e)&&l&&"template"===l.tag&&!l.props.some((e=>7===e.type&&Wa(e.name)))&&(l=l.children)):"?"===i[1]?(ru(e,21,1),l=Va(e)):ru(e,12,1);if(l||(l=Ja(e,t)),m(l))for(let e=0;e/.exec(e.source);if(o){o.index<=3&&ru(e,0),o[1]&&ru(e,10),n=e.source.slice(4,o.index);const t=e.source.slice(0,o.index);let r=1,s=0;for(;-1!==(s=t.indexOf("\x3c!--",r));)tu(e,s-r+1),s+4");return-1===r?(o=e.source.slice(n),tu(e,e.source.length)):(o=e.source.slice(n,r),tu(e,r+1)),{type:3,content:o,loc:Xa(e,t)}}function Ua(e,t){const n=e.inPre,o=e.inVPre,r=Qa(t),s=qa(e,Ha.Start,r),i=e.inPre&&!n,l=e.inVPre&&!o;if(s.isSelfClosing||e.options.isVoidTag(s.tag))return i&&(e.inPre=!1),l&&(e.inVPre=!1),s;t.push(s);const c=e.options.getTextMode(s,r),a=La(e,c,t);t.pop();{const t=s.props.find((e=>6===e.type&&"inline-template"===e.name));if(t&&Na("COMPILER_INLINE_TEMPLATE",e,t.loc)){const n=Xa(e,s.loc.end);t.value={type:2,content:n.source,loc:n}}}if(s.children=a,iu(e.source,s.tag))qa(e,Ha.End,r);else if(ru(e,24,0,s.loc.start),0===e.source.length&&"script"===s.tag.toLowerCase()){const t=a[0];t&&eu(t.loc.source,"\x3c!--")&&ru(e,8)}return s.loc=Xa(e,s.loc.start),i&&(e.inPre=!1),l&&(e.inVPre=!1),s}var Ha=(e=>(e[e.Start=0]="Start",e[e.End=1]="End",e))(Ha||{});const Wa=r("if,else,else-if,for,slot");function qa(e,t,n){const o=Za(e),r=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),s=r[1],i=e.options.getNamespace(s,n);tu(e,r[0].length),nu(e);const l=Za(e),c=e.source;e.options.isPreTag(s)&&(e.inPre=!0);let a=za(e,t);0===t&&!e.inVPre&&a.some((e=>7===e.type&&"pre"===e.name))&&(e.inVPre=!0,f(e,l),e.source=c,a=za(e,t).filter((e=>"v-pre"!==e.name)));let u=!1;if(0===e.source.length?ru(e,9):(u=eu(e.source,"/>"),1===t&&u&&ru(e,4),tu(e,u?2:1)),1===t)return;let p=0;return e.inVPre||("slot"===s?p=2:"template"===s?a.some((e=>7===e.type&&Wa(e.name)))&&(p=3):function(e,t,n){const o=n.options;if(o.isCustomElement(e))return!1;if("component"===e||/^[A-Z]/.test(e)||aa(e)||o.isBuiltInComponent&&o.isBuiltInComponent(e)||o.isNativeTag&&!o.isNativeTag(e))return!0;for(let e=0;e0&&!eu(e.source,">")&&!eu(e.source,"/>");){if(eu(e.source,"/")){ru(e,22),tu(e,1),nu(e);continue}1===t&&ru(e,3);const r=Ka(e,o);6===r.type&&r.value&&"class"===r.name&&(r.value.content=r.value.content.replace(/\s+/g," ").trim()),0===t&&n.push(r),/^[^\t\r\n\f />]/.test(e.source)&&ru(e,15),nu(e)}return n}function Ka(e,t){var n;const o=Za(e),r=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(r)&&ru(e,2),t.add(r),"="===r[0]&&ru(e,19);{const t=/["'<]/g;let n;for(;n=t.exec(r);)ru(e,17,n.index)}let s;tu(e,r.length),/^[\t\r\n\f ]*=/.test(e.source)&&(nu(e),tu(e,1),nu(e),s=function(e){const t=Za(e);let n;const o=e.source[0],r='"'===o||"'"===o;if(r){tu(e,1);const t=e.source.indexOf(o);-1===t?n=Ya(e,e.source.length,4):(n=Ya(e,t,4),tu(e,1))}else{const t=/^[^\t\r\n\f >]+/.exec(e.source);if(!t)return;const o=/["'<=`]/g;let r;for(;r=o.exec(t[0]);)ru(e,18,r.index);n=Ya(e,t[0].length,4)}return{content:n,isQuoted:r,loc:Xa(e,t)}}(e),s||ru(e,13));const i=Xa(e,o);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(r)){const t=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(r);let l,c=eu(r,"."),a=t[1]||(c||eu(r,":")?"bind":eu(r,"@")?"on":"slot");if(t[2]){const s="slot"===a,i=r.lastIndexOf(t[2],r.length-((null==(n=t[3])?void 0:n.length)||0)),c=Xa(e,ou(e,o,i),ou(e,o,i+t[2].length+(s&&t[3]||"").length));let u=t[2],p=!0;u.startsWith("[")?(p=!1,u.endsWith("]")?u=u.slice(1,u.length-1):(ru(e,27),u=u.slice(1))):s&&(u+=t[3]||""),l={type:4,content:u,isStatic:p,constType:p?3:0,loc:c}}if(s&&s.isQuoted){const e=s.loc;e.start.offset++,e.start.column++,e.end=va(e.start,s.content),e.source=e.source.slice(1,-1)}const u=t[3]?t[3].slice(1).split("."):[];return c&&u.push("prop"),"bind"===a&&l&&u.includes("sync")&&Na("COMPILER_V_BIND_SYNC",e,0,l.loc.source)&&(a="model",u.splice(u.indexOf("sync"),1)),{type:7,name:a,exp:s&&{type:4,content:s.content,isStatic:!1,constType:0,loc:s.loc},arg:l,modifiers:u,loc:i}}return!e.inVPre&&eu(r,"v-")&&ru(e,26),{type:6,name:r,value:s&&{type:2,content:s.content,loc:s.loc},loc:i}}function Ga(e,t){const[n,o]=e.options.delimiters,r=e.source.indexOf(o,n.length);if(-1===r)return void ru(e,25);const s=Za(e);tu(e,n.length);const i=Za(e),l=Za(e),c=r-n.length,a=e.source.slice(0,c),u=Ya(e,c,t),p=u.trim(),f=u.indexOf(p);return f>0&&ya(i,a,f),ya(l,a,c-(u.length-p.length-f)),tu(e,o.length),{type:5,content:{type:4,isStatic:!1,constType:0,content:p,loc:Xa(e,i,l)},loc:Xa(e,s)}}function Ja(e,t){const n=3===t?["]]>"]:["<",e.options.delimiters[0]];let o=e.source.length;for(let t=0;tr&&(o=r)}const r=Za(e);return{type:2,content:Ya(e,o,t),loc:Xa(e,r)}}function Ya(e,t,n){const o=e.source.slice(0,t);return tu(e,t),2!==n&&3!==n&&o.includes("&")?e.options.decodeEntities(o,4===n):o}function Za(e){const{column:t,line:n,offset:o}=e;return{column:t,line:n,offset:o}}function Xa(e,t,n){return{start:t,end:n=n||Za(e),source:e.originalSource.slice(t.offset,n.offset)}}function Qa(e){return e[e.length-1]}function eu(e,t){return e.startsWith(t)}function tu(e,t){const{source:n}=e;ya(e,n,t),e.source=n.slice(t)}function nu(e){const t=/^[\t\r\n\f ]+/.exec(e.source);t&&tu(e,t[0].length)}function ou(e,t,n){return va(t,e.originalSource.slice(t.offset,n),n)}function ru(e,t,n,o=Za(e)){n&&(o.offset+=n,o.column+=n),e.options.onError(lc(t,{start:o,end:o,source:""}))}function su(e,t,n){const o=e.source;switch(t){case 0:if(eu(o,"=0;--e)if(iu(o,n[e].tag))return!0;break;case 1:case 2:{const e=Qa(n);if(e&&iu(o,e.tag))return!0;break}case 3:if(eu(o,"]]>"))return!0}return!o}function iu(e,t){return eu(e,"]/.test(e[2+t.length]||">")}function lu(e,t){au(e,t,cu(e,e.children[0]))}function cu(e,t){const{children:n}=e;return 1===n.length&&1===t.type&&!Ea(t)}function au(e,t,n=!1){const{children:o}=e,r=o.length;let s=0;for(let e=0;e0){if(e>=2){r.codegenNode.patchFlag="-1",r.codegenNode=t.hoist(r.codegenNode),s++;continue}}else{const e=r.codegenNode;if(13===e.type){const n=gu(e);if((!n||512===n||1===n)&&du(r,t)>=2){const n=hu(r);n&&(e.props=t.hoist(n))}e.dynamicProps&&(e.dynamicProps=t.hoist(e.dynamicProps))}}}if(1===r.type){const e=1===r.tagType;e&&t.scopes.vSlot++,au(r,t),e&&t.scopes.vSlot--}else if(11===r.type)au(r,t,1===r.children.length);else if(9===r.type)for(let e=0;e1)for(let r=0;r`_${Kc[k.helper(e)]}`,replaceNode(e){k.parent.children[k.childIndex]=k.currentNode=e},removeNode(e){const t=k.parent.children,n=e?t.indexOf(e):k.currentNode?k.childIndex:-1;e&&e!==k.currentNode?k.childIndex>n&&(k.childIndex--,k.onNodeRemoved()):(k.currentNode=null,k.onNodeRemoved()),k.parent.children.splice(n,1)},onNodeRemoved:()=>{},addIdentifiers(e){},removeIdentifiers(e){},hoist(e){S(e)&&(e=Qc(e)),k.hoists.push(e);const t=Qc(`_hoisted_${k.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache:(e,t=!1)=>function(e,t,n=!1){return{type:20,index:e,value:t,isVNode:n,loc:Gc}}(k.cached++,e,t)};return k.filters=new Set,k}(e,t);vu(e,n),t.hoistStatic&&lu(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:o}=e;if(1===o.length){const n=o[0];if(cu(e,n)&&n.codegenNode){const o=n.codegenNode;13===o.type&&ia(o,t),e.codegenNode=o}else e.codegenNode=n}else if(o.length>1){let o=64;z[64],e.codegenNode=Jc(t,n(cc),void 0,e.children,o+"",void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.filters=[...n.filters]}function vu(e,t){t.currentNode=e;const{nodeTransforms:n}=t,o=[];for(let r=0;r{n--};for(;nt===e:t=>e.test(t);return(e,o)=>{if(1===e.type){const{props:r}=e;if(3===e.tagType&&r.some(xa))return;const s=[];for(let i=0;i`${Kc[e]}: _${Kc[e]}`;function Su(e,t={}){const n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:o=!1,filename:r="template.vue.html",scopeId:s=null,optimizeImports:i=!1,runtimeGlobalName:l="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:a="vue/server-renderer",ssr:u=!1,isTS:p=!1,inSSR:f=!1}){const d={mode:t,prefixIdentifiers:n,sourceMap:o,filename:r,scopeId:s,optimizeImports:i,runtimeGlobalName:l,runtimeModuleName:c,ssrRuntimeModuleName:a,ssr:u,isTS:p,inSSR:f,source:e.loc.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${Kc[e]}`,push(e,t){d.code+=e},indent(){h(++d.indentLevel)},deindent(e=!1){e?--d.indentLevel:h(--d.indentLevel)},newline(){h(d.indentLevel)}};function h(e){d.push("\n"+" ".repeat(e))}return d}(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:o,push:r,prefixIdentifiers:s,indent:i,deindent:l,newline:c,scopeId:a,ssr:u}=n,p=Array.from(e.helpers),f=p.length>0,d=!s&&"module"!==o;if(function(e,t){const{ssr:n,prefixIdentifiers:o,push:r,newline:s,runtimeModuleName:i,runtimeGlobalName:l,ssrRuntimeModuleName:c}=t,a=l,u=Array.from(e.helpers);u.length>0&&(r(`const _Vue = ${a}\n`),e.hoists.length)&&r(`const { ${[mc,vc,yc,bc,_c].filter((e=>u.includes(e))).map(_u).join(", ")} } = _Vue\n`),function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:o,helper:r,scopeId:s,mode:i}=t;o();for(let r=0;r0)&&c()),e.directives.length&&(Cu(e.directives,"directive",n),e.temps>0&&c()),e.filters&&e.filters.length&&(c(),Cu(e.filters,"filter",n),c()),e.temps>0){r("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(r("\n"),c()),u||r("return "),e.codegenNode?Eu(e.codegenNode,n):r("null"),d&&(l(),r("}")),l(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function Cu(e,t,{helper:n,push:o,newline:r,isTS:s}){const i=n("filter"===t?wc:"component"===t?Sc:xc);for(let n=0;n3||!1;t.push("["),n&&t.indent(),wu(e,t,n),n&&t.deindent(),t.push("]")}function wu(e,t,n=!1,o=!0){const{push:r,newline:s}=t;for(let i=0;ie||"null"))}([s,i,l,c,a]),t),n(")"),p&&n(")"),u&&(n(", "),Eu(u,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:o,pure:r}=t,s=S(e.callee)?e.callee:o(e.callee);r&&n(bu),n(s+"(",e),wu(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:o,deindent:r,newline:s}=t,{properties:i}=e;if(!i.length)return void n("{}",e);const l=i.length>1||!1;n(l?"{":"{ "),l&&o();for(let e=0;e "),(c||l)&&(n("{"),o()),i?(c&&n("return "),m(i)?xu(i,t):Eu(i,t)):l&&Eu(l,t),(c||l)&&(r(),n("}")),a&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){const{test:n,consequent:o,alternate:r,newline:s}=e,{push:i,indent:l,deindent:c,newline:a}=t;if(4===n.type){const e=!pa(n.content);e&&i("("),ku(n,t),e&&i(")")}else i("("),Eu(n,t),i(")");s&&l(),t.indentLevel++,s||i(" "),i("? "),Eu(o,t),t.indentLevel--,s&&a(),s||i(" "),i(": ");const u=19===r.type;u||t.indentLevel++,Eu(r,t),u||t.indentLevel--,s&&c(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:o,indent:r,deindent:s,newline:i}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(r(),n(`${o(Bc)}(-1),`),i()),n(`_cache[${e.index}] = `),Eu(e.value,t),e.isVNode&&(n(","),i(),n(`${o(Bc)}(1),`),i(),n(`_cache[${e.index}]`),s()),n(")")}(e,t);break;case 21:wu(e.body,t,!0,!1)}}function ku(e,t){const{content:n,isStatic:o}=e;t.push(o?JSON.stringify(n):n,e)}function Tu(e,t){for(let n=0;nfunction(e,t,n,o){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const o=t.exp?t.exp.loc:e.loc;n.onError(lc(28,t.loc)),t.exp=Qc("true",!1,o)}if("if"===t.name){const r=Pu(e,t),s={type:9,loc:e.loc,branches:[r]};if(n.replaceNode(s),o)return o(s,r,!0)}else{const r=n.parent.children;let s=r.indexOf(e);for(;s-- >=-1;){const i=r[s];if(i&&3===i.type)n.removeNode(i);else{if(!i||2!==i.type||i.content.trim().length){if(i&&9===i.type){"else-if"===t.name&&void 0===i.branches[i.branches.length-1].condition&&n.onError(lc(30,e.loc)),n.removeNode();const r=Pu(e,t);i.branches.push(r);const s=o&&o(i,r,!1);vu(r,n),s&&s(),n.currentNode=null}else n.onError(lc(30,e.loc));break}n.removeNode(i)}}}}(e,t,n,((e,t,o)=>{const r=n.parent.children;let s=r.indexOf(e),i=0;for(;s-- >=0;){const e=r[s];e&&9===e.type&&(i+=e.branches.length)}return()=>{if(o)e.codegenNode=Iu(t,i,n);else{const o=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);o.alternate=Iu(t,i+e.branches.length-1,n)}}}))));function Pu(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!ba(e,"for")?e.children:[e],userKey:_a(e,"key"),isTemplateIf:n}}function Iu(e,t,n){return e.condition?oa(e.condition,Ou(e,t,n),ta(n.helper(yc),['""',"true"])):Ou(e,t,n)}function Ou(e,t,n){const{helper:o}=n,r=Xc("key",Qc(`${t}`,!1,Gc,2)),{children:s}=e,i=s[0];if(1!==s.length||1!==i.type){if(1===s.length&&11===i.type){const e=i.codegenNode;return Fa(e,r,n),e}{let t=64;return z[64],Jc(n,o(cc),Zc([r]),s,t+"",void 0,void 0,!0,!1,!1,e.loc)}}{const e=i.codegenNode,t=14===(l=e).type&&l.callee===qc?l.arguments[1].returns:l;return 13===t.type&&ia(t,n),Fa(t,r,n),e}var l}const Nu=yu("for",((e,t,n)=>{const{helper:o,removeHelper:r}=n;return function(e,t,n,o){if(!t.exp)return void n.onError(lc(31,t.loc));const r=Lu(t.exp);if(!r)return void n.onError(lc(32,t.loc));const{addIdentifiers:s,removeIdentifiers:i,scopes:l}=n,{source:c,value:a,key:u,index:p}=r,f={type:11,loc:t.loc,source:c,valueAlias:a,keyAlias:u,objectIndexAlias:p,parseResult:r,children:wa(e)?e.children:[e]};n.replaceNode(f),l.vFor++;const d=o&&o(f);return()=>{l.vFor--,d&&d()}}(e,t,n,(t=>{const s=ta(o(kc),[t.source]),i=wa(e),l=ba(e,"memo"),c=_a(e,"key"),a=c&&(6===c.type?Qc(c.value.content,!0):c.exp),u=c?Xc("key",a):null,p=4===t.source.type&&t.source.constType>0,f=p?64:c?128:256;return t.codegenNode=Jc(n,o(cc),void 0,s,f+"",void 0,void 0,!0,!p,!1,e.loc),()=>{let c;const{children:f}=t,d=1!==f.length||1!==f[0].type,h=Ea(e)?e:i&&1===e.children.length&&Ea(e.children[0])?e.children[0]:null;if(h?(c=h.codegenNode,i&&u&&Fa(c,u,n)):d?c=Jc(n,o(cc),u?Zc([u]):void 0,e.children,"64",void 0,void 0,!0,void 0,!1):(c=f[0].codegenNode,i&&u&&Fa(c,u,n),c.isBlock!==!p&&(c.isBlock?(r(dc),r(sa(n.inSSR,c.isComponent))):r(ra(n.inSSR,c.isComponent))),c.isBlock=!p,c.isBlock?(o(dc),o(sa(n.inSSR,c.isComponent))):o(ra(n.inSSR,c.isComponent))),l){const e=na(Bu(t.parseResult,[Qc("_cached")]));e.body={type:21,body:[ea(["const _memo = (",l.exp,")"]),ea(["if (_cached",...a?[" && _cached.key === ",a]:[],` && ${n.helperString(zc)}(_cached, _memo)) return _cached`]),ea(["const _item = ",c]),Qc("_item.memo = _memo"),Qc("return _item")],loc:Gc},s.arguments.push(e,Qc("_cache"),Qc(String(n.cached++)))}else s.arguments.push(na(Bu(t.parseResult),c,!0))}}))})),Au=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Du=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Mu=/^\(|\)$/g;function Lu(e,t){const n=e.loc,o=e.content,r=o.match(Au);if(!r)return;const[,s,i]=r,l={source:$u(n,i.trim(),o.indexOf(i,s.length)),value:void 0,key:void 0,index:void 0};let c=s.trim().replace(Mu,"").trim();const a=s.indexOf(c),u=c.match(Du);if(u){c=c.replace(Du,"").trim();const e=u[1].trim();let t;if(e&&(t=o.indexOf(e,a+c.length),l.key=$u(n,e,t)),u[2]){const r=u[2].trim();r&&(l.index=$u(n,r,o.indexOf(r,l.key?t+e.length:a+c.length)))}}return c&&(l.value=$u(n,c,a)),l}function $u(e,t,n){return Qc(t,!1,ma(e,n,t.length))}function Bu({value:e,key:t,index:n},o=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map(((e,t)=>e||Qc("_".repeat(t+1),!1)))}([e,t,n,...o])}const ju=Qc("undefined",!1),Vu=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=ba(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},Uu=(e,t,n)=>na(e,t,!1,!0,t.length?t[0].loc:n);function Hu(e,t,n=Uu){t.helper(Uc);const{children:o,loc:r}=e,s=[],i=[];let l=t.scopes.vSlot>0||t.scopes.vFor>0;const c=ba(e,"slot",!0);if(c){const{arg:e,exp:t}=c;e&&!la(e)&&(l=!0),s.push(Xc(e||Qc("default",!0),n(t,o,r)))}let a=!1,u=!1;const p=[],f=new Set;let d=0;for(let e=0;e{const s=n(e,o,r);return t.compatConfig&&(s.isNonScopedSlot=!0),Xc("default",s)};a?p.length&&p.some((e=>zu(e)))&&(u?t.onError(lc(39,p[0].loc)):s.push(e(void 0,p))):s.push(e(void 0,o))}const h=l?2:qu(e.children)?3:1;let g=Zc(s.concat(Xc("_",Qc(h+"",!1))),r);return i.length&&(g=ta(t.helper(Fc),[g,Yc(i)])),{slots:g,hasDynamicSlots:l}}function Wu(e,t,n){const o=[Xc("name",e),Xc("fn",t)];return null!=n&&o.push(Xc("key",Qc(String(n),!0))),Zc(o)}function qu(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:o}=e,r=1===e.tagType;let s=r?function(e,t,n=!1){let{tag:o}=e;const r=Xu(o),s=_a(e,"is");if(s)if(r||Oa("COMPILER_IS_ON_ELEMENT",t)){const e=6===s.type?s.value&&Qc(s.value.content,!0):s.exp;if(e)return ta(t.helper(Cc),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(o=s.value.content.slice(4));const i=!r&&ba(e,"is");if(i&&i.exp)return ta(t.helper(Cc),[i.exp]);const l=aa(o)||t.isBuiltInComponent(o);return l?(n||t.helper(l),l):(t.helper(Sc),t.components.add(o),Pa(o,"component"))}(e,t):`"${n}"`;const i=x(s)&&s.callee===Cc;let l,c,a,u,p,f,d=0,h=i||s===ac||s===uc||!r&&("svg"===n||"foreignObject"===n);if(o.length>0){const n=Ju(e,t,void 0,r,i);l=n.props,d=n.patchFlag,p=n.dynamicPropNames;const o=n.directives;f=o&&o.length?Yc(o.map((e=>function(e,t){const n=[],o=Ku.get(e);o?n.push(t.helperString(o)):(t.helper(xc),t.directives.add(e.name),n.push(Pa(e.name,"directive")));const{loc:r}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=Qc("true",!1,r);n.push(Zc(e.modifiers.map((e=>Xc(e,t))),r))}return Yc(n,e.loc)}(e,t)))):void 0,n.shouldUseBlock&&(h=!0)}if(e.children.length>0)if(s===pc&&(h=!0,d|=1024),r&&s!==ac&&s!==pc){const{slots:n,hasDynamicSlots:o}=Hu(e,t);c=n,o&&(d|=1024)}else if(1===e.children.length&&s!==ac){const n=e.children[0],o=n.type,r=5===o||8===o;r&&0===uu(n,t)&&(d|=1),c=r||2===o?n:e.children}else c=e.children;0!==d&&(a=String(d),p&&p.length&&(u=function(e){let t="[";for(let n=0,o=e.length;n0;let h=!1,g=0,m=!1,v=!1,y=!1,b=!1,_=!1,S=!1;const x=[],w=e=>{a.length&&(p.push(Zc(Yu(a),l)),a=[]),e&&p.push(e)},E=({key:e,value:n})=>{if(la(e)){const s=e.content,i=u(s);if(!i||o&&!r||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||P(s)||(b=!0),i&&P(s)&&(S=!0),20===n.type||(4===n.type||8===n.type)&&uu(n,t)>0)return;"ref"===s?m=!0:"class"===s?v=!0:"style"===s?y=!0:"key"===s||x.includes(s)||x.push(s),!o||"class"!==s&&"style"!==s||x.includes(s)||x.push(s)}else _=!0};for(let r=0;r0&&a.push(Xc(Qc("ref_for",!0),Qc("true")))),"is"===n&&(Xu(i)||o&&o.content.startsWith("vue:")||Oa("COMPILER_IS_ON_ELEMENT",t)))continue;a.push(Xc(Qc(n,!0,ma(e,0,n.length)),Qc(o?o.content:"",r,o?o.loc:e)))}else{const{name:n,arg:r,exp:u,loc:g}=c,m="bind"===n,v="on"===n;if("slot"===n){o||t.onError(lc(40,g));continue}if("once"===n||"memo"===n)continue;if("is"===n||m&&Sa(r,"is")&&(Xu(i)||Oa("COMPILER_IS_ON_ELEMENT",t)))continue;if(v&&s)continue;if((m&&Sa(r,"key")||v&&d&&Sa(r,"vue:before-update"))&&(h=!0),m&&Sa(r,"ref")&&t.scopes.vFor>0&&a.push(Xc(Qc("ref_for",!0),Qc("true"))),!r&&(m||v)){if(_=!0,u)if(m){if(w(),Oa("COMPILER_V_BIND_OBJECT_ORDER",t)){p.unshift(u);continue}p.push(u)}else w({type:14,loc:g,callee:t.helper(Dc),arguments:o?[u]:[u,"true"]});else t.onError(lc(m?34:35,g));continue}const y=t.directiveTransforms[n];if(y){const{props:n,needRuntime:o}=y(c,e,t);!s&&n.forEach(E),v&&r&&!la(r)?w(Zc(n,l)):a.push(...n),o&&(f.push(c),C(o)&&Ku.set(c,o))}else I(n)||(f.push(c),d&&(h=!0))}}let k;if(p.length?(w(),k=p.length>1?ta(t.helper(Pc),p,l):p[0]):a.length&&(k=Zc(Yu(a),l)),_?g|=16:(v&&!o&&(g|=2),y&&!o&&(g|=4),x.length&&(g|=8),b&&(g|=32)),h||0!==g&&32!==g||!(m||S||f.length>0)||(g|=512),!t.inSSR&&k)switch(k.type){case 15:let e=-1,n=-1,o=!1;for(let t=0;t{if(Ea(e)){const{children:n,loc:o}=e,{slotName:r,slotProps:s}=function(e,t){let n,o='"default"';const r=[];for(let t=0;t0){const{props:o,directives:s}=Ju(e,t,r,!1,!1);n=o,s.length&&t.onError(lc(36,s[0].loc))}return{slotName:o,slotProps:n}}(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let l=2;s&&(i[2]=s,l=3),n.length&&(i[3]=na([],n,!1,!1,o),l=4),t.scopeId&&!t.slotted&&(l=5),i.splice(l),e.codegenNode=ta(t.helper(Tc),i,o)}},ep=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,tp=(e,t,n,o)=>{const{loc:r,modifiers:s,arg:i}=e;let l;if(e.exp||s.length||n.onError(lc(35,r)),4===i.type)if(i.isStatic){let e=i.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),l=Qc(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?$(A(e)):`on:${e}`,!0,i.loc)}else l=ea([`${n.helperString($c)}(`,i,")"]);else l=i,l.children.unshift(`${n.helperString($c)}(`),l.children.push(")");let c=e.exp;c&&!c.content.trim()&&(c=void 0);let a=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const e=ga(c.content),t=!(e||ep.test(c.content)),n=c.content.includes(";");(t||a&&e)&&(c=ea([`${t?"$event":"(...args)"} => ${n?"{":"("}`,c,n?"}":")"]))}let u={props:[Xc(l,c||Qc("() => {}",!1,r))]};return o&&(u=o(u)),a&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach((e=>e.key.isHandlerKey=!0)),u},np=(e,t,n)=>{const{exp:o,modifiers:r,loc:s}=e,i=e.arg;return 4!==i.type?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=`${i.content} || ""`),r.includes("camel")&&(4===i.type?i.isStatic?i.content=A(i.content):i.content=`${n.helperString(Mc)}(${i.content})`:(i.children.unshift(`${n.helperString(Mc)}(`),i.children.push(")"))),n.inSSR||(r.includes("prop")&&op(i,"."),r.includes("attr")&&op(i,"^")),!o||4===o.type&&!o.content.trim()?(n.onError(lc(34,s)),{props:[Xc(i,Qc("",!0,s))]}):{props:[Xc(i,o)]}},op=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},rp=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let o,r=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))||"template"===e.tag)))for(let e=0;e{if(1===e.type&&ba(e,"once",!0)){if(sp.has(e)||t.inVOnce||t.inSSR)return;return sp.add(e),t.inVOnce=!0,t.helper(Bc),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0))}}},lp=(e,t,n)=>{const{exp:o,arg:r}=e;if(!o)return n.onError(lc(41,e.loc)),cp();const s=o.loc.source,i=4===o.type?o.content:s,l=n.bindingMetadata[s];if("props"===l||"props-aliased"===l)return n.onError(lc(44,o.loc)),cp();if(!i.trim()||!ga(i))return n.onError(lc(42,o.loc)),cp();const c=r||Qc("modelValue",!0),a=r?la(r)?`onUpdate:${A(r.content)}`:ea(['"onUpdate:" + ',r]):"onUpdate:modelValue";let u;u=ea([(n.isTS?"($event: any)":"$event")+" => ((",o,") = $event)"]);const p=[Xc(c,e.exp),Xc(a,u)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map((e=>(pa(e)?e:JSON.stringify(e))+": true")).join(", "),n=r?la(r)?`${r.content}Modifiers`:ea([r,' + "Modifiers"']):"modelModifiers";p.push(Xc(n,Qc(`{ ${t} }`,!1,e.loc,2)))}return cp(p)};function cp(e=[]){return{props:e}}const ap=/[\w).+\-_$\]]/,up=(e,t)=>{Oa("COMPILER_FILTER",t)&&(5===e.type&&pp(e.content,t),1===e.type&&e.props.forEach((e=>{7===e.type&&"for"!==e.name&&e.exp&&pp(e.exp,t)})))};function pp(e,t){if(4===e.type)fp(e,t);else for(let n=0;n=0&&(e=n.charAt(t)," "===e);t--);e&&ap.test(e)||(u=!0)}}else void 0===i?(h=s+1,i=n.slice(0,s).trim()):m();function m(){g.push(n.slice(h,s).trim()),h=s+1}if(void 0===i?i=n.slice(0,s).trim():0!==h&&m(),g.length){for(s=0;s{if(1===e.type){const n=ba(e,"memo");if(!n||hp.has(e))return;return hp.add(e),()=>{const o=e.codegenNode||t.currentNode.codegenNode;o&&13===o.type&&(1!==e.tagType&&ia(o,t),e.codegenNode=ta(t.helper(qc),[n.exp,na(void 0,o),"_cache",String(t.cached++)]))}}};function mp(e,t={}){const n=t.onError||sc,o="module"===t.mode;!0===t.prefixIdentifiers?n(lc(47)):o&&n(lc(48)),t.cacheHandlers&&n(lc(49)),t.scopeId&&!o&&n(lc(50));const r=S(e)?function(e,t={}){const n=function(e,t){const n=f({},Ma);let o;for(o in t)n[o]=void 0===t[o]?Ma[o]:t[o];return{options:n,column:1,line:1,offset:0,originalSource:e,source:e,inPre:!1,inVPre:!1,onWarn:n.onWarn}}(e,t),o=Za(n);return function(e,t=Gc){return{type:0,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:t}}(La(n,0,[]),Xa(n,o))}(e,t):e,[s,i]=[[ip,Ru,gp,Nu,up,Qu,Gu,Vu,rp],{on:tp,bind:np,model:lp}];return mu(r,f({},t,{prefixIdentifiers:!1,nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:f({},i,t.directiveTransforms||{})})),Su(r,f({},t,{prefixIdentifiers:!1}))}const vp=Symbol(""),yp=Symbol(""),bp=Symbol(""),_p=Symbol(""),Sp=Symbol(""),Cp=Symbol(""),xp=Symbol(""),wp=Symbol(""),Ep=Symbol(""),kp=Symbol("");var Tp;let Fp;Tp={[vp]:"vModelRadio",[yp]:"vModelCheckbox",[bp]:"vModelText",[_p]:"vModelSelect",[Sp]:"vModelDynamic",[Cp]:"withModifiers",[xp]:"withKeys",[wp]:"vShow",[Ep]:"Transition",[kp]:"TransitionGroup"},Object.getOwnPropertySymbols(Tp).forEach((e=>{Kc[e]=Tp[e]}));const Rp=r("style,iframe,script,noscript",!0),Pp={isVoidTag:oe,isNativeTag:e=>te(e)||ne(e),isPreTag:e=>"pre"===e,decodeEntities:function(e,t=!1){return Fp||(Fp=document.createElement("div")),t?(Fp.innerHTML=`
    `,Fp.children[0].getAttribute("foo")):(Fp.innerHTML=e,Fp.textContent)},isBuiltInComponent:e=>ca(e,"Transition")?Ep:ca(e,"TransitionGroup")?kp:void 0,getNamespace(e,t){let n=t?t.ns:0;if(t&&2===n)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some((e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content)))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(n=0);else t&&1===n&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(n=0));if(0===n){if("svg"===e)return 1;if("math"===e)return 2}return n},getTextMode({tag:e,ns:t}){if(0===t){if("textarea"===e||"title"===e)return 1;if(Rp(e))return 2}return 0}},Ip=(e,t)=>{const n=X(e);return Qc(JSON.stringify(n),!1,t,3)};function Op(e,t){return lc(e,t)}const Np=r("passive,once,capture"),Ap=r("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Dp=r("left,right"),Mp=r("onkeyup,onkeydown,onkeypress",!0),Lp=(e,t)=>la(e)&&"onclick"===e.content.toLowerCase()?Qc(t,!0):4!==e.type?ea(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,$p=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()},Bp=[e=>{1===e.type&&e.props.forEach(((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:Qc("style",!0,t.loc),exp:Ip(t.value.content,t.loc),modifiers:[],loc:t.loc})}))}],jp={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:o,loc:r}=e;return o||n.onError(Op(53,r)),t.children.length&&(n.onError(Op(54,r)),t.children.length=0),{props:[Xc(Qc("innerHTML",!0,r),o||Qc("",!0))]}},text:(e,t,n)=>{const{exp:o,loc:r}=e;return o||n.onError(Op(55,r)),t.children.length&&(n.onError(Op(56,r)),t.children.length=0),{props:[Xc(Qc("textContent",!0),o?uu(o,n)>0?o:ta(n.helperString(Rc),[o],r):Qc("",!0))]}},model:(e,t,n)=>{const o=lp(e,t,n);if(!o.props.length||1===t.tagType)return o;e.arg&&n.onError(Op(58,e.arg.loc));const{tag:r}=t,s=n.isCustomElement(r);if("input"===r||"textarea"===r||"select"===r||s){let i=bp,l=!1;if("input"===r||s){const o=_a(t,"type");if(o){if(7===o.type)i=Sp;else if(o.value)switch(o.value.content){case"radio":i=vp;break;case"checkbox":i=yp;break;case"file":l=!0,n.onError(Op(59,e.loc))}}else(function(e){return e.props.some((e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic)))})(t)&&(i=Sp)}else"select"===r&&(i=_p);l||(o.needRuntime=n.helper(i))}else n.onError(Op(57,e.loc));return o.props=o.props.filter((e=>!(4===e.key.type&&"modelValue"===e.key.content))),o},on:(e,t,n)=>tp(e,t,n,(t=>{const{modifiers:o}=e;if(!o.length)return t;let{key:r,value:s}=t.props[0];const{keyModifiers:i,nonKeyModifiers:l,eventOptionModifiers:c}=((e,t,n,o)=>{const r=[],s=[],i=[];for(let o=0;o{const{exp:o,loc:r}=e;return o||n.onError(Op(61,r)),{props:[],needRuntime:n.helper(wp)}}},Vp=Object.create(null);vi((function(e,t){if(!S(e)){if(!e.nodeType)return l;e=e.innerHTML}const n=e,r=Vp[n];if(r)return r;if("#"===e[0]){const t=document.querySelector(e);e=t?t.innerHTML:""}const s=f({hoistStatic:!0,onError:void 0,onWarn:l},t);s.isCustomElement||"undefined"==typeof customElements||(s.isCustomElement=e=>!!customElements.get(e));const{code:i}=function(e,t={}){return mp(e,f({},Pp,t,{nodeTransforms:[$p,...Bp,...t.nodeTransforms||[]],directiveTransforms:f({},jp,t.directiveTransforms||{}),transformHoist:null}))}(e,s),c=new Function("Vue",i)(o);return c._rc=!0,Vp[n]=c}))}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var s=o[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.m=n,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>({145:"form-editor-view",526:"restore-fields-view",821:"form-browser-view"}[e]+".chunk.js"),r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="leaf_vue:",r.l=(n,o,s,i)=>{if(e[n])e[n].push(o);else{var l,c;if(void 0!==s)for(var a=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(d);var r=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),r&&r.forEach((e=>e(o))),t)return t(o)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),c&&document.head.appendChild(l)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={430:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var s=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=s);var i=r.p+r.u(t),l=new Error;r.l(i,(n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var s=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",l.name="ChunkLoadError",l.type=s,l.request=i,o[1](l)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,s,[i,l,c]=n,a=0;if(i.some((t=>0!==e[t]))){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);c&&c(r)}for(t&&t(n);a{var e=r(166);function t(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n{{ message }}
    '}},created:function(){var e=this;this.getEnabledCategories(),document.addEventListener("keydown",(function(t){"escape"===((null==t?void 0:t.key)||"").toLowerCase()&&!0===e.showFormDialog&&e.closeFormDialog()}))},methods:{truncateText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length<=t?e:e.slice(0,t)+n},decodeAndStripHTML:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e,XSSHelpers.stripAllTags(t.innerText)},showLastUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(new Date).toLocaleString(),n=document.getElementById(e);null!==n&&(n.style.display="flex",n.innerText="last modified: ".concat(t),n.style.border="2px solid #20a0f0",setTimeout((function(){n.style.border="2px solid transparent"}),750))},setDefaultAjaxResponseMessage:function(){var e=this;$.ajax({type:"POST",url:"ajaxIndex.php?a=checkstatus",data:{CSRFToken},success:function(t){e.ajaxResponseMessage=t||""},error:function(e){return reject(e)}})},initializeOrgSelector:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"employee",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s="group"===(e=e.toLowerCase())?"group#":"#",i={};(i="group"===e?new groupSelector("".concat(n,"orgSel_").concat(t)):"position"===e?new positionSelector("".concat(n,"orgSel_").concat(t)):new employeeSelector("".concat(n,"orgSel_").concat(t))).apiPath="".concat(this.orgchartPath,"/api/"),i.rootPath="".concat(this.orgchartPath,"/"),i.basePath="".concat(this.orgchartPath,"/"),i.setSelectHandler((function(){var t=document.querySelector("#".concat(i.containerID," input.").concat(e,"SelectorInput"));null!==t&&(t.value="".concat(s)+i.selection)})),"function"==typeof r&&i.setResultHandler((function(){return r(i)})),i.initialize();var l=document.querySelector("#".concat(i.containerID," input.").concat(e,"SelectorInput"));""!==o&&null!==l&&(l.value="".concat(s)+o)},getEnabledCategories:function(){var e=this;this.appIsLoadingCategories=!0,$.ajax({type:"GET",url:"".concat(this.APIroot,"formStack/categoryList/allWithStaples"),success:function(t){for(var n in e.categories={},t)e.categories[t[n].categoryID]=t[n],t[n].stapledFormIDs.forEach((function(t){e.allStapledFormCatIDs.includes(t)||e.allStapledFormCatIDs.push(t)}));e.appIsLoadingCategories=!1},error:function(e){return console.log(e)}})},getSiteSettings:function(){var e=this;try{fetch("".concat(this.APIroot,"system/settings")).then((function(t){t.json().then((function(t){e.siteSettings=t,+(null==t?void 0:t.leafSecure)>=1&&e.getSecureFormsInfo()}))}))}catch(e){console.log("error getting site settings",e)}},fetchLEAFSRequests:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t,n){var o=new LeafFormQuery;o.setRootURL("../"),o.addTerm("categoryID","=","leaf_secure"),!0===e?(o.addTerm("stepID","=","resolved"),o.join("recordResolutionData")):o.addTerm("stepID","!=","resolved"),o.onSuccess((function(e){return t(e)})),o.execute()}))},getSecureFormsInfo:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"form/indicator/list"),success:function(e){},error:function(e){return console.log(e)},cache:!1}),this.fetchLEAFSRequests(!0)];Promise.all(t).then((function(t){var n=t[0],o=t[1];e.checkLeafSRequestStatus(n,o)})).catch((function(e){return console.log("an error has occurred",e)}))},checkLeafSRequestStatus:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=!1,r=0;for(var s in n)"approved"===n[s].recordResolutionData.lastStatus.toLowerCase()&&n[s].recordResolutionData.fulfillmentTime>r&&(r=n[s].recordResolutionData.fulfillmentTime);var i=new Date(1e3*parseInt(r));for(var l in t)if(new Date(t[l].timeAdded).getTime()>i.getTime()){o=!0;break}!0===o?(this.showCertificationStatus=!0,this.fetchLEAFSRequests(!1).then((function(t){if(0===Object.keys(t).length)e.secureStatusText="Forms have been modified.",e.secureBtnText="Please Recertify Your Site",e.secureBtnLink="../report.php?a=LEAF_start_leaf_secure_certification";else{var n=t[Object.keys(t)[0]].recordID;e.secureStatusText="Re-certification in progress.",e.secureBtnText="Check Certification Progress",e.secureBtnLink="../index.php?a=printview&recordID="+n}})).catch((function(e){return console.log("an error has occurred",e)}))):this.showCertificationStatus=!1},updateCategoriesProperty:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";void 0!==this.categories[e][t]&&(this.categories[e][t]=n)},updateStapledFormsInfo:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";!0===(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?this.categories[n].stapledFormIDs=this.categories[n].stapledFormIDs.filter((function(t){return t!==e})):(this.allStapledFormCatIDs=Array.from(new Set([].concat(t(this.allStapledFormCatIDs),[e]))),this.categories[n].stapledFormIDs=Array.from(new Set([].concat(t(this.categories[n].stapledFormIDs),[e]))))},addNewCategory:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.categories[e]=t},removeCategory:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";delete this.categories[e]},closeFormDialog:function(){this.showFormDialog=!1,this.dialogTitle="",this.dialogFormContent="",this.dialogButtonText={confirm:"Save",cancel:"Cancel"},this.formSaveFunction=null,this.dialogData=null},lastModalTab:function(e){if(!1===(null==e?void 0:e.shiftKey)){var t=document.getElementById("leaf-vue-dialog-close");null!==t&&(t.focus(),e.preventDefault())}},setCustomDialogTitle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogTitle=e},setFormDialogComponent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogFormContent=e},setDialogSaveFunction:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";"function"==typeof e&&(this.formSaveFunction=e)},checkRequiredData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=Object.keys((null==this?void 0:this.dialogData)||{});e.forEach((function(e){n.includes(e)||t.push(e)})),t.length>0&&console.warn("expected dialogData key was not found",t)},openConfirmDeleteFormDialog:function(){this.setCustomDialogTitle("

    Delete this form

    "),this.setFormDialogComponent("confirm-delete-dialog"),this.dialogButtonText={confirm:"Yes",cancel:"No"},this.showFormDialog=!0},openStapleFormsDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogData={mainFormID:e},this.setCustomDialogTitle("

    Editing Stapled Forms

    "),this.setFormDialogComponent("staple-form-dialog"),this.dialogButtonText={confirm:"Add",cancel:"Close"},this.showFormDialog=!0},openEditCollaboratorsDialog:function(){this.setCustomDialogTitle("

    Editing Collaborators

    "),this.setFormDialogComponent("edit-collaborators-dialog"),this.dialogButtonText={confirm:"Add",cancel:"Close"},this.showFormDialog=!0},openIfThenDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Untitled",n=this.truncateText(this.decodeAndStripHTML(t),35);this.dialogData={indicatorID:e},this.dialogButtonText={confirm:"Save",cancel:"Close"},this.setCustomDialogTitle('

    Conditions For '.concat(n," (").concat(e,")

    ")),this.setFormDialogComponent("conditions-editor-dialog"),this.showFormDialog=!0},openIndicatorEditingDialog:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=null===t&&null===n?"

    Adding new Section

    ":null===t?"

    Adding question to ".concat(n,"

    "):"

    Editing indicator ".concat(t,"

    "),this.dialogData={indicatorID:t,parentID:n,indicator:o},this.setCustomDialogTitle(e),this.setFormDialogComponent("indicator-editing-dialog"),this.showFormDialog=!0},openAdvancedOptionsDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dialogData={indicatorID:e.indicatorID,html:(null==e?void 0:e.html)||"",htmlPrint:(null==e?void 0:e.htmlPrint)||""},this.setCustomDialogTitle("

    Advanced Options for indicator ".concat(e.indicatorID,"

    ")),this.setFormDialogComponent("advanced-options-dialog"),this.showFormDialog=!0},openNewFormDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogData={parentID:e};var t=""===e?"

    New Form

    ":"

    New Internal Use Form

    ";this.setCustomDialogTitle(t),this.setFormDialogComponent("new-form-dialog"),this.showFormDialog=!0},openImportFormDialog:function(){this.setCustomDialogTitle("

    Import Form

    "),this.setFormDialogComponent("import-form-dialog"),this.showFormDialog=!0},openFormHistoryDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogData={historyType:"form",historyID:e},this.setCustomDialogTitle("

    Form History

    "),this.setFormDialogComponent("history-dialog"),this.showFormDialog=!0}}},s="undefined"!=typeof window;const i=Object.assign;function l(e,t){const n={};for(const o in t){const r=t[o];n[o]=a(r)?r.map(e):e(r)}return n}const c=()=>{},a=Array.isArray,u=/\/$/,p=e=>e.replace(u,"");function f(e,t,n="/"){let o,r={},s="",i="";const l=t.indexOf("#");let c=t.indexOf("?");return l=0&&(c=-1),c>-1&&(o=t.slice(0,c),s=t.slice(c+1,l>-1?l:t.length),r=e(s)),l>-1&&(o=o||t.slice(0,l),i=t.slice(l,t.length)),o=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];".."!==r&&"."!==r||o.push("");let s,i,l=n.length-1;for(s=0;s1&&l--}return n.slice(0,l).join("/")+"/"+o.slice(s-(s===o.length?1:0)).join("/")}(null!=o?o:t,n),{fullPath:o+(s&&"?")+s+i,path:o,query:r,hash:i}}function d(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function h(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function g(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!m(e[n],t[n]))return!1;return!0}function m(e,t){return a(e)?v(e,t):a(t)?v(t,e):e===t}function v(e,t){return a(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var y,b;!function(e){e.pop="pop",e.push="push"}(y||(y={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(b||(b={}));const _=/^[^#]+#/;function S(e,t){return e.replace(_,"#")+t}const C=()=>({left:window.pageXOffset,top:window.pageYOffset});function x(e,t){return(history.state?history.state.position-t:-1)+e}const w=new Map;let E=()=>location.protocol+"//"+location.host;function k(e,t){const{pathname:n,search:o,hash:r}=t,s=e.indexOf("#");if(s>-1){let t=r.includes(e.slice(s))?e.slice(s).length:1,n=r.slice(t);return"/"!==n[0]&&(n="/"+n),d(n,"")}return d(n,e)+o+r}function T(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?C():null}}function F(e){return"string"==typeof e||"symbol"==typeof e}const R={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},P=Symbol("");var I;function O(e,t){return i(new Error,{type:e,[P]:!0},t)}function N(e,t){return e instanceof Error&&P in e&&(null==t||!!(e.type&t))}!function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"}(I||(I={}));const A="[^/]+?",D={sensitive:!1,strict:!1,start:!0,end:!0},M=/[.+*?^${}()[\]/\\]/g;function L(e,t){let n=0;for(;nt.length?1===t.length&&80===t[0]?1:-1:0}function B(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const V={type:0,value:""},U=/[a-zA-Z0-9_]/;function H(e,t,n){const o=function(e,t){const n=i({},D,t),o=[];let r=n.start?"^":"";const s=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(r+="/");for(let o=0;o1&&("*"===l||"+"===l)&&t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:a,regexp:u,repeatable:"*"===l||"+"===l,optional:"*"===l||"?"===l})):t("Invalid state to consume buffer"),a="")}function f(){a+=l}for(;ci(e,t.meta)),{})}function G(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function J(e,t){return t.children.some((t=>t===e||J(e,t)))}const Y=/#/g,Z=/&/g,X=/\//g,Q=/=/g,ee=/\?/g,te=/\+/g,ne=/%5B/g,oe=/%5D/g,re=/%5E/g,se=/%60/g,ie=/%7B/g,le=/%7C/g,ce=/%7D/g,ae=/%20/g;function ue(e){return encodeURI(""+e).replace(le,"|").replace(ne,"[").replace(oe,"]")}function pe(e){return ue(e).replace(te,"%2B").replace(ae,"+").replace(Y,"%23").replace(Z,"%26").replace(se,"`").replace(ie,"{").replace(ce,"}").replace(re,"^")}function fe(e){return null==e?"":function(e){return ue(e).replace(Y,"%23").replace(ee,"%3F")}(e).replace(X,"%2F")}function de(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function he(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;ee&&pe(e))):[o&&pe(o)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))})):void 0!==o&&(t+=(t.length?"&":"")+n)}return t}function me(e){const t={};for(const n in e){const o=e[n];void 0!==o&&(t[n]=a(o)?o.map((e=>null==e?null:""+e)):null==o?o:""+o)}return t}const ve=Symbol(""),ye=Symbol(""),be=Symbol(""),_e=Symbol(""),Se=Symbol("");function Ce(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e.slice(),reset:function(){e=[]}}}function xe(e,t,n,o,r){const s=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise(((i,l)=>{const c=e=>{var c;!1===e?l(O(4,{from:n,to:t})):e instanceof Error?l(e):"string"==typeof(c=e)||c&&"object"==typeof c?l(O(2,{from:t,to:e})):(s&&o.enterCallbacks[r]===s&&"function"==typeof e&&s.push(e),i())},a=e.call(o&&o.instances[r],t,n,c);let u=Promise.resolve(a);e.length<3&&(u=u.then(c)),u.catch((e=>l(e)))}))}function we(e,t,n,o){const r=[];for(const i of e)for(const e in i.components){let l=i.components[e];if("beforeRouteEnter"===t||i.instances[e])if("object"==typeof(s=l)||"displayName"in s||"props"in s||"__vccOpts"in s){const s=(l.__vccOpts||l)[t];s&&r.push(xe(s,n,o,i,e))}else{let s=l();r.push((()=>s.then((r=>{if(!r)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${i.path}"`));const s=(l=r).__esModule||"Module"===l[Symbol.toStringTag]?r.default:r;var l;i.components[e]=s;const c=(s.__vccOpts||s)[t];return c&&xe(c,n,o,i,e)()}))))}}var s;return r}function Ee(t){const n=(0,e.f3)(be),o=(0,e.f3)(_e),r=(0,e.Fl)((()=>n.resolve((0,e.SU)(t.to)))),s=(0,e.Fl)((()=>{const{matched:e}=r.value,{length:t}=e,n=e[t-1],s=o.matched;if(!n||!s.length)return-1;const i=s.findIndex(h.bind(null,n));if(i>-1)return i;const l=Te(e[t-2]);return t>1&&Te(n)===l&&s[s.length-1].path!==l?s.findIndex(h.bind(null,e[t-2])):i})),i=(0,e.Fl)((()=>s.value>-1&&function(e,t){for(const n in t){const o=t[n],r=e[n];if("string"==typeof o){if(o!==r)return!1}else if(!a(r)||r.length!==o.length||o.some(((e,t)=>e!==r[t])))return!1}return!0}(o.params,r.value.params))),l=(0,e.Fl)((()=>s.value>-1&&s.value===o.matched.length-1&&g(o.params,r.value.params)));return{route:r,href:(0,e.Fl)((()=>r.value.href)),isActive:i,isExactActive:l,navigate:function(o={}){return function(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||void 0!==e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}(o)?n[(0,e.SU)(t.replace)?"replace":"push"]((0,e.SU)(t.to)).catch(c):Promise.resolve()}}}const ke=(0,e.aZ)({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ee,setup(t,{slots:n}){const o=(0,e.qj)(Ee(t)),{options:r}=(0,e.f3)(be),s=(0,e.Fl)((()=>({[Fe(t.activeClass,r.linkActiveClass,"router-link-active")]:o.isActive,[Fe(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive})));return()=>{const r=n.default&&n.default(o);return t.custom?r:(0,e.h)("a",{"aria-current":o.isExactActive?t.ariaCurrentValue:null,href:o.href,onClick:o.navigate,class:s.value},r)}}});function Te(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Fe=(e,t,n)=>null!=e?e:null!=t?t:n;function Re(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Pe=(0,e.aZ)({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:n,slots:o}){const r=(0,e.f3)(Se),s=(0,e.Fl)((()=>t.route||r.value)),l=(0,e.f3)(ye,0),c=(0,e.Fl)((()=>{let t=(0,e.SU)(l);const{matched:n}=s.value;let o;for(;(o=n[t])&&!o.components;)t++;return t})),a=(0,e.Fl)((()=>s.value.matched[c.value]));(0,e.JJ)(ye,(0,e.Fl)((()=>c.value+1))),(0,e.JJ)(ve,a),(0,e.JJ)(Se,s);const u=(0,e.iH)();return(0,e.YP)((()=>[u.value,a.value,t.name]),(([e,t,n],[o,r,s])=>{t&&(t.instances[n]=e,r&&r!==t&&e&&e===o&&(t.leaveGuards.size||(t.leaveGuards=r.leaveGuards),t.updateGuards.size||(t.updateGuards=r.updateGuards))),!e||!t||r&&h(t,r)&&o||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const r=s.value,l=t.name,c=a.value,p=c&&c.components[l];if(!p)return Re(o.default,{Component:p,route:r});const f=c.props[l],d=f?!0===f?r.params:"function"==typeof f?f(r):f:null,h=(0,e.h)(p,i({},d,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(c.instances[l]=null)},ref:u}));return Re(o.default,{Component:h,route:r})||h}}});var Ie,Oe=[{path:"/",name:"browser",component:function(){return r.e(821).then(r.bind(r,105))}},{path:"/forms",name:"category",component:function(){return r.e(145).then(r.bind(r,601))}},{path:"/restore",name:"restore",component:function(){return r.e(526).then(r.bind(r,135))}}],Ne=function(t){const n=function(e,t){const n=[],o=new Map;function r(e,n,o){const a=!o,u=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:q(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);u.aliasOf=o&&o.record;const p=G(t,e),f=[u];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)f.push(i({},u,{components:o?o.record.components:u.components,path:e,aliasOf:o?o.record:u}))}let d,h;for(const t of f){const{path:i}=t;if(n&&"/"!==i[0]){const e=n.record.path,o="/"===e[e.length-1]?"":"/";t.path=n.record.path+(i&&o+i)}if(d=H(t,n,p),o?o.alias.push(d):(h=h||d,h!==d&&h.alias.push(d),a&&e.name&&!z(d)&&s(e.name)),u.children){const e=u.children;for(let t=0;t{s(h)}:c}function s(e){if(F(e)){const t=o.get(e);t&&(o.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(s),t.alias.forEach(s))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&o.delete(e.record.name),e.children.forEach(s),e.alias.forEach(s))}}function l(e){let t=0;for(;t=0&&(e.record.path!==n[t].record.path||!J(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!z(e)&&o.set(e.record.name,e)}return t=G({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>r(e))),{addRoute:r,resolve:function(e,t){let r,s,l,c={};if("name"in e&&e.name){if(r=o.get(e.name),!r)throw O(1,{location:e});l=r.record.name,c=i(W(t.params,r.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params&&W(e.params,r.keys.map((e=>e.name)))),s=r.stringify(c)}else if("path"in e)s=e.path,r=n.find((e=>e.re.test(s))),r&&(c=r.parse(s),l=r.record.name);else{if(r=t.name?o.get(t.name):n.find((e=>e.re.test(t.path))),!r)throw O(1,{location:e,currentLocation:t});l=r.record.name,c=i({},t.params,e.params),s=r.stringify(c)}const a=[];let u=r;for(;u;)a.unshift(u.record),u=u.parent;return{name:l,path:s,params:c,matched:a,meta:K(a)}},removeRoute:s,getRoutes:function(){return n},getRecordMatcher:function(e){return o.get(e)}}}(t.routes,t),o=t.parseQuery||he,r=t.stringifyQuery||ge,u=t.history,p=Ce(),d=Ce(),m=Ce(),v=(0,e.XI)(R);let b=R;s&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const _=l.bind(null,(e=>""+e)),S=l.bind(null,fe),E=l.bind(null,de);function k(e,t){if(t=i({},t||v.value),"string"==typeof e){const r=f(o,e,t.path),s=n.resolve({path:r.path},t),l=u.createHref(r.fullPath);return i(r,s,{params:E(s.params),hash:de(r.hash),redirectedFrom:void 0,href:l})}let s;if("path"in e)s=i({},e,{path:f(o,e.path,t.path).path});else{const n=i({},e.params);for(const e in n)null==n[e]&&delete n[e];s=i({},e,{params:S(n)}),t.params=S(t.params)}const l=n.resolve(s,t),c=e.hash||"";l.params=_(E(l.params));const a=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(r,i({},e,{hash:(p=c,ue(p).replace(ie,"{").replace(ce,"}").replace(re,"^")),path:l.path}));var p;const d=u.createHref(a);return i({fullPath:a,hash:c,query:r===ge?me(e.query):e.query||{}},l,{redirectedFrom:void 0,href:d})}function T(e){return"string"==typeof e?f(o,e,v.value.path):i({},e)}function P(e,t){if(b!==e)return O(8,{from:t,to:e})}function I(e){return D(e)}function A(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let o="function"==typeof n?n(e):n;return"string"==typeof o&&(o=o.includes("?")||o.includes("#")?o=T(o):{path:o},o.params={}),i({query:e.query,hash:e.hash,params:"path"in o?{}:e.params},o)}}function D(e,t){const n=b=k(e),o=v.value,s=e.state,l=e.force,c=!0===e.replace,a=A(n);if(a)return D(i(T(a),{state:"object"==typeof a?i({},s,a.state):s,force:l,replace:c}),t||n);const u=n;let p;return u.redirectedFrom=t,!l&&function(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&h(t.matched[o],n.matched[r])&&g(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(r,o,n)&&(p=O(16,{to:u,from:o}),te(o,o,!0,!1)),(p?Promise.resolve(p):$(u,o)).catch((e=>N(e)?N(e,2)?e:ee(e):Q(e,u,o))).then((e=>{if(e){if(N(e,2))return D(i({replace:c},T(e.to),{state:"object"==typeof e.to?i({},s,e.to.state):s,force:l}),t||u)}else e=V(u,o,!0,c,s);return j(u,o,e),e}))}function M(e,t){const n=P(e,t);return n?Promise.reject(n):Promise.resolve()}function L(e){const t=se.values().next().value;return t&&"function"==typeof t.runWithContext?t.runWithContext(e):e()}function $(e,t){let n;const[o,r,s]=function(e,t){const n=[],o=[],r=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;ih(e,s)))?o.push(s):n.push(s));const l=e.matched[i];l&&(t.matched.find((e=>h(e,l)))||r.push(l))}return[n,o,r]}(e,t);n=we(o.reverse(),"beforeRouteLeave",e,t);for(const r of o)r.leaveGuards.forEach((o=>{n.push(xe(o,e,t))}));const i=M.bind(null,e,t);return n.push(i),ae(n).then((()=>{n=[];for(const o of p.list())n.push(xe(o,e,t));return n.push(i),ae(n)})).then((()=>{n=we(r,"beforeRouteUpdate",e,t);for(const o of r)o.updateGuards.forEach((o=>{n.push(xe(o,e,t))}));return n.push(i),ae(n)})).then((()=>{n=[];for(const o of s)if(o.beforeEnter)if(a(o.beforeEnter))for(const r of o.beforeEnter)n.push(xe(r,e,t));else n.push(xe(o.beforeEnter,e,t));return n.push(i),ae(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=we(s,"beforeRouteEnter",e,t),n.push(i),ae(n)))).then((()=>{n=[];for(const o of d.list())n.push(xe(o,e,t));return n.push(i),ae(n)})).catch((e=>N(e,8)?e:Promise.reject(e)))}function j(e,t,n){m.list().forEach((o=>L((()=>o(e,t,n)))))}function V(e,t,n,o,r){const l=P(e,t);if(l)return l;const c=t===R,a=s?history.state:{};n&&(o||c?u.replace(e.fullPath,i({scroll:c&&a&&a.scroll},r)):u.push(e.fullPath,r)),v.value=e,te(e,t,n,c),ee()}let U;let Y,Z=Ce(),X=Ce();function Q(e,t,n){ee(e);const o=X.list();return o.length?o.forEach((o=>o(e,t,n))):console.error(e),Promise.reject(e)}function ee(e){return Y||(Y=!e,U||(U=u.listen(((e,t,n)=>{if(!le.listening)return;const o=k(e),r=A(o);if(r)return void D(i(r,{replace:!0}),o).catch(c);b=o;const l=v.value;var a,p;s&&(a=x(l.fullPath,n.delta),p=C(),w.set(a,p)),$(o,l).catch((e=>N(e,12)?e:N(e,2)?(D(e.to,o).then((e=>{N(e,20)&&!n.delta&&n.type===y.pop&&u.go(-1,!1)})).catch(c),Promise.reject()):(n.delta&&u.go(-n.delta,!1),Q(e,o,l)))).then((e=>{(e=e||V(o,l,!1))&&(n.delta&&!N(e,8)?u.go(-n.delta,!1):n.type===y.pop&&N(e,20)&&u.go(-1,!1)),j(o,l,e)})).catch(c)}))),Z.list().forEach((([t,n])=>e?n(e):t())),Z.reset()),e}function te(n,o,r,i){const{scrollBehavior:l}=t;if(!s||!l)return Promise.resolve();const c=!r&&function(e){const t=w.get(e);return w.delete(e),t}(x(n.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return(0,e.Y3)().then((()=>l(n,o,c))).then((e=>e&&function(e){let t;if("el"in e){const n=e.el,o="string"==typeof n&&n.startsWith("#"),r="string"==typeof n?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}(e))).catch((e=>Q(e,n,o)))}const ne=e=>u.go(e);let oe;const se=new Set,le={currentRoute:v,listening:!0,addRoute:function(e,t){let o,r;return F(e)?(o=n.getRecordMatcher(e),r=t):r=e,n.addRoute(r,o)},removeRoute:function(e){const t=n.getRecordMatcher(e);t&&n.removeRoute(t)},hasRoute:function(e){return!!n.getRecordMatcher(e)},getRoutes:function(){return n.getRoutes().map((e=>e.record))},resolve:k,options:t,push:I,replace:function(e){return I(i(T(e),{replace:!0}))},go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:p.add,beforeResolve:d.add,afterEach:m.add,onError:X.add,isReady:function(){return Y&&v.value!==R?Promise.resolve():new Promise(((e,t)=>{Z.add([e,t])}))},install(t){t.component("RouterLink",ke),t.component("RouterView",Pe),t.config.globalProperties.$router=this,Object.defineProperty(t.config.globalProperties,"$route",{enumerable:!0,get:()=>(0,e.SU)(v)}),s&&!oe&&v.value===R&&(oe=!0,I(u.location).catch((e=>{})));const n={};for(const e in R)Object.defineProperty(n,e,{get:()=>v.value[e],enumerable:!0});t.provide(be,this),t.provide(_e,(0,e.Um)(n)),t.provide(Se,v);const o=t.unmount;se.add(t),t.unmount=function(){se.delete(t),se.size<1&&(b=R,U&&U(),U=null,v.value=R,oe=!1,Y=!1),o()}}};function ae(e){return e.reduce(((e,t)=>e.then((()=>L(t)))),Promise.resolve())}return le}({history:((Ie=location.host?Ie||location.pathname+location.search:"").includes("#")||(Ie+="#"),function(e){const t=function(e){const{history:t,location:n}=window,o={value:k(e,n)},r={value:t.state};function s(o,s,i){const l=e.indexOf("#"),c=l>-1?(n.host&&document.querySelector("base")?e:e.slice(l))+o:E()+e+o;try{t[i?"replaceState":"pushState"](s,"",c),r.value=s}catch(e){console.error(e),n[i?"replace":"assign"](c)}}return r.value||s(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:o,state:r,push:function(e,n){const l=i({},r.value,t.state,{forward:e,scroll:C()});s(l.current,l,!0),s(e,i({},T(o.value,e,null),{position:l.position+1},n),!1),o.value=e},replace:function(e,n){s(e,i({},t.state,T(r.value.back,e,r.value.forward,!0),n,{position:r.value.position}),!0),o.value=e}}}(e=function(e){if(!e)if(s){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),p(e)}(e)),n=function(e,t,n,o){let r=[],s=[],l=null;const c=({state:s})=>{const i=k(e,location),c=n.value,a=t.value;let u=0;if(s){if(n.value=i,t.value=s,l&&l===c)return void(l=null);u=a?s.position-a.position:0}else o(i);r.forEach((e=>{e(n.value,c,{delta:u,type:y.pop,direction:u?u>0?b.forward:b.back:b.unknown})}))};function a(){const{history:e}=window;e.state&&e.replaceState(i({},e.state,{scroll:C()}),"")}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",a,{passive:!0}),{pauseListeners:function(){l=n.value},listen:function(e){r.push(e);const t=()=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)};return s.push(t),t},destroy:function(){for(const e of s)e();s=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",a)}}}(e,t.state,t.location,t.replace),o=i({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:S.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}(Ie)),routes:Oe});const Ae=Ne;var De=(0,e.ri)(o);De.use(Ae),De.mount("#vue-formeditor-app")})()})(); \ No newline at end of file +(()=>{"use strict";var e,t,n={166:(e,t,n)=>{n.d(t,{Fl:()=>xi,ri:()=>ec,aZ:()=>xo,h:()=>wi,f3:()=>Wr,Y3:()=>_n,JJ:()=>Hr,qj:()=>kt,iH:()=>Ut,Um:()=>Tt,XI:()=>Ht,SU:()=>Kt,YP:()=>so});var o={};function r(e,t){const n=Object.create(null),o=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}n.r(o),n.d(o,{BaseTransition:()=>mo,BaseTransitionPropsValidators:()=>go,Comment:()=>Es,EffectScope:()=>pe,Fragment:()=>xs,KeepAlive:()=>Fo,ReactiveEffect:()=>ke,Static:()=>ks,Suspense:()=>Jn,Teleport:()=>Ss,Text:()=>ws,Transition:()=>rl,TransitionGroup:()=>Cl,VueElement:()=>Zi,assertNumber:()=>ln,callWithAsyncErrorHandling:()=>an,callWithErrorHandling:()=>cn,camelize:()=>N,capitalize:()=>L,cloneVNode:()=>zs,compatUtils:()=>Oi,computed:()=>xi,createApp:()=>ec,createBlock:()=>Ms,createCommentVNode:()=>Js,createElementBlock:()=>Ds,createElementVNode:()=>Hs,createHydrationRenderer:()=>ds,createPropsRestProxy:()=>kr,createRenderer:()=>fs,createSSRApp:()=>tc,createSlots:()=>or,createStaticVNode:()=>Gs,createTextVNode:()=>Ks,createVNode:()=>Ws,customRef:()=>Xt,defineAsyncComponent:()=>Eo,defineComponent:()=>xo,defineCustomElement:()=>Gi,defineEmits:()=>dr,defineExpose:()=>hr,defineModel:()=>vr,defineOptions:()=>gr,defineProps:()=>fr,defineSSRCustomElement:()=>Ji,defineSlots:()=>mr,devtools:()=>Rn,effect:()=>Fe,effectScope:()=>fe,getCurrentInstance:()=>si,getCurrentScope:()=>he,getTransitionRawChildren:()=>Co,guardReactiveProps:()=>qs,h:()=>wi,handleError:()=>un,hasInjectionContext:()=>qr,hydrate:()=>Ql,initCustomFormatter:()=>Ti,initDirectivesForSSR:()=>rc,inject:()=>Wr,isMemoSame:()=>Ri,isProxy:()=>Nt,isReactive:()=>At,isReadonly:()=>It,isRef:()=>Vt,isRuntimeOnly:()=>yi,isShallow:()=>Ot,isVNode:()=>Ls,markRaw:()=>Mt,mergeDefaults:()=>wr,mergeModels:()=>Er,mergeProps:()=>Qs,nextTick:()=>_n,normalizeClass:()=>Q,normalizeProps:()=>ee,normalizeStyle:()=>G,onActivated:()=>Po,onBeforeMount:()=>$o,onBeforeUnmount:()=>Uo,onBeforeUpdate:()=>jo,onDeactivated:()=>Ao,onErrorCaptured:()=>Ko,onMounted:()=>Bo,onRenderTracked:()=>zo,onRenderTriggered:()=>qo,onScopeDispose:()=>ge,onServerPrefetch:()=>Wo,onUnmounted:()=>Ho,onUpdated:()=>Vo,openBlock:()=>Rs,popScopeId:()=>jn,provide:()=>Hr,proxyRefs:()=>Yt,pushScopeId:()=>Bn,queuePostFlushCb:()=>xn,reactive:()=>kt,readonly:()=>Ft,ref:()=>Ut,registerRuntimeCompiler:()=>vi,render:()=>Xl,renderList:()=>nr,renderSlot:()=>rr,resolveComponent:()=>Yo,resolveDirective:()=>Qo,resolveDynamicComponent:()=>Xo,resolveFilter:()=>Ii,resolveTransitionHooks:()=>yo,setBlockTracking:()=>Os,setDevtoolsHook:()=>In,setTransitionHooks:()=>So,shallowReactive:()=>Tt,shallowReadonly:()=>Rt,shallowRef:()=>Ht,ssrContextKey:()=>Ei,ssrUtils:()=>Ai,stop:()=>Re,toDisplayString:()=>ce,toHandlerKey:()=>$,toHandlers:()=>ir,toRaw:()=>Dt,toRef:()=>nn,toRefs:()=>Qt,toValue:()=>Gt,transformVNodeArgs:()=>Bs,triggerRef:()=>zt,unref:()=>Kt,useAttrs:()=>_r,useCssModule:()=>Xi,useCssVars:()=>Qi,useModel:()=>Sr,useSSRContext:()=>ki,useSlots:()=>br,useTransitionState:()=>fo,vModelCheckbox:()=>Pl,vModelDynamic:()=>Ll,vModelRadio:()=>Il,vModelSelect:()=>Ol,vModelText:()=>Rl,vShow:()=>ql,version:()=>Pi,warn:()=>sn,watch:()=>so,watchEffect:()=>to,watchPostEffect:()=>no,watchSyncEffect:()=>oo,withAsyncContext:()=>Tr,withCtx:()=>Un,withDefaults:()=>yr,withDirectives:()=>uo,withKeys:()=>Wl,withMemo:()=>Fi,withModifiers:()=>Ul,withScopeId:()=>Vn});const s={},i=[],l=()=>{},c=()=>!1,a=/^on[^a-z]/,u=e=>a.test(e),p=e=>e.startsWith("onUpdate:"),f=Object.assign,d=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},h=Object.prototype.hasOwnProperty,g=(e,t)=>h.call(e,t),m=Array.isArray,v=e=>"[object Map]"===k(e),y=e=>"[object Set]"===k(e),b=e=>"[object Date]"===k(e),_=e=>"function"==typeof e,S=e=>"string"==typeof e,C=e=>"symbol"==typeof e,x=e=>null!==e&&"object"==typeof e,w=e=>x(e)&&_(e.then)&&_(e.catch),E=Object.prototype.toString,k=e=>E.call(e),T=e=>k(e).slice(8,-1),F=e=>"[object Object]"===k(e),R=e=>S(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,P=r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),A=r("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),I=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},O=/-(\w)/g,N=I((e=>e.replace(O,((e,t)=>t?t.toUpperCase():"")))),D=/\B([A-Z])/g,M=I((e=>e.replace(D,"-$1").toLowerCase())),L=I((e=>e.charAt(0).toUpperCase()+e.slice(1))),$=I((e=>e?`on${L(e)}`:"")),B=(e,t)=>!Object.is(e,t),j=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},U=e=>{const t=parseFloat(e);return isNaN(t)?e:t},H=e=>{const t=S(e)?Number(e):NaN;return isNaN(t)?e:t};let W;const q=()=>W||(W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),z={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"HYDRATE_EVENTS",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},K=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console");function G(e){if(m(e)){const t={};for(let n=0;n{if(e){const n=e.split(Y);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function Q(e){let t="";if(S(e))t=e;else if(m(e))for(let n=0;nie(e,t)))}const ce=e=>S(e)?e:null==e?"":m(e)||x(e)&&(e.toString===E||!_(e.toString))?JSON.stringify(e,ae,2):String(e),ae=(e,t)=>t&&t.__v_isRef?ae(e,t.value):v(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:y(t)?{[`Set(${t.size})`]:[...t.values()]}:!x(t)||m(t)||F(t)?t:String(t);let ue;class pe{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ue,!e&&ue&&(this.index=(ue.scopes||(ue.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=ue;try{return ue=this,e()}finally{ue=t}}}on(){ue=this}off(){ue=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},ve=e=>(e.w&Se)>0,ye=e=>(e.n&Se)>0,be=new WeakMap;let _e=0,Se=1;const Ce=30;let xe;const we=Symbol(""),Ee=Symbol("");class ke{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,de(this,n)}run(){if(!this.active)return this.fn();let e=xe,t=Pe;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=xe,xe=this,Pe=!0,Se=1<<++_e,_e<=Ce?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o{("length"===n||n>=e)&&l.push(t)}))}else switch(void 0!==n&&l.push(i.get(n)),t){case"add":m(e)?R(n)&&l.push(i.get("length")):(l.push(i.get(we)),v(e)&&l.push(i.get(Ee)));break;case"delete":m(e)||(l.push(i.get(we)),v(e)&&l.push(i.get(Ee)));break;case"set":v(e)&&l.push(i.get(we))}if(1===l.length)l[0]&&Le(l[0]);else{const e=[];for(const t of l)t&&e.push(...t);Le(me(e))}}function Le(e,t){const n=m(e)?e:[...e];for(const e of n)e.computed&&$e(e);for(const e of n)e.computed||$e(e)}function $e(e,t){(e!==xe||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const Be=r("__proto__,__v_isRef,__isVue"),je=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(C)),Ve=Ge(),Ue=Ge(!1,!0),He=Ge(!0),We=Ge(!0,!0),qe=ze();function ze(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Dt(this);for(let e=0,t=this.length;e{e[t]=function(...e){Ie();const n=Dt(this)[t].apply(this,e);return Oe(),n}})),e}function Ke(e){const t=Dt(this);return Ne(t,0,e),t.hasOwnProperty(e)}function Ge(e=!1,t=!1){return function(n,o,r){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_isShallow"===o)return t;if("__v_raw"===o&&r===(e?t?Et:wt:t?xt:Ct).get(n))return n;const s=m(n);if(!e){if(s&&g(qe,o))return Reflect.get(qe,o,r);if("hasOwnProperty"===o)return Ke}const i=Reflect.get(n,o,r);return(C(o)?je.has(o):Be(o))?i:(e||Ne(n,0,o),t?i:Vt(i)?s&&R(o)?i:i.value:x(i)?e?Ft(i):kt(i):i)}}function Je(e=!1){return function(t,n,o,r){let s=t[n];if(It(s)&&Vt(s)&&!Vt(o))return!1;if(!e&&(Ot(o)||It(o)||(s=Dt(s),o=Dt(o)),!m(t)&&Vt(s)&&!Vt(o)))return s.value=o,!0;const i=m(t)&&R(n)?Number(n)!0,deleteProperty:(e,t)=>!0},Xe=f({},Ye,{get:Ue,set:Je(!0)}),Qe=f({},Ze,{get:We}),et=e=>e,tt=e=>Reflect.getPrototypeOf(e);function nt(e,t,n=!1,o=!1){const r=Dt(e=e.__v_raw),s=Dt(t);n||(t!==s&&Ne(r,0,t),Ne(r,0,s));const{has:i}=tt(r),l=o?et:n?$t:Lt;return i.call(r,t)?l(e.get(t)):i.call(r,s)?l(e.get(s)):void(e!==r&&e.get(t))}function ot(e,t=!1){const n=this.__v_raw,o=Dt(n),r=Dt(e);return t||(e!==r&&Ne(o,0,e),Ne(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function rt(e,t=!1){return e=e.__v_raw,!t&&Ne(Dt(e),0,we),Reflect.get(e,"size",e)}function st(e){e=Dt(e);const t=Dt(this);return tt(t).has.call(t,e)||(t.add(e),Me(t,"add",e,e)),this}function it(e,t){t=Dt(t);const n=Dt(this),{has:o,get:r}=tt(n);let s=o.call(n,e);s||(e=Dt(e),s=o.call(n,e));const i=r.call(n,e);return n.set(e,t),s?B(t,i)&&Me(n,"set",e,t):Me(n,"add",e,t),this}function lt(e){const t=Dt(this),{has:n,get:o}=tt(t);let r=n.call(t,e);r||(e=Dt(e),r=n.call(t,e)),o&&o.call(t,e);const s=t.delete(e);return r&&Me(t,"delete",e,void 0),s}function ct(){const e=Dt(this),t=0!==e.size,n=e.clear();return t&&Me(e,"clear",void 0,void 0),n}function at(e,t){return function(n,o){const r=this,s=r.__v_raw,i=Dt(s),l=t?et:e?$t:Lt;return!e&&Ne(i,0,we),s.forEach(((e,t)=>n.call(o,l(e),l(t),r)))}}function ut(e,t,n){return function(...o){const r=this.__v_raw,s=Dt(r),i=v(s),l="entries"===e||e===Symbol.iterator&&i,c="keys"===e&&i,a=r[e](...o),u=n?et:t?$t:Lt;return!t&&Ne(s,0,c?Ee:we),{next(){const{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:l?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function pt(e){return function(...t){return"delete"!==e&&this}}function ft(){const e={get(e){return nt(this,e)},get size(){return rt(this)},has:ot,add:st,set:it,delete:lt,clear:ct,forEach:at(!1,!1)},t={get(e){return nt(this,e,!1,!0)},get size(){return rt(this)},has:ot,add:st,set:it,delete:lt,clear:ct,forEach:at(!1,!0)},n={get(e){return nt(this,e,!0)},get size(){return rt(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!1)},o={get(e){return nt(this,e,!0,!0)},get size(){return rt(this,!0)},has(e){return ot.call(this,e,!0)},add:pt("add"),set:pt("set"),delete:pt("delete"),clear:pt("clear"),forEach:at(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=ut(r,!1,!1),n[r]=ut(r,!0,!1),t[r]=ut(r,!1,!0),o[r]=ut(r,!0,!0)})),[e,n,t,o]}const[dt,ht,gt,mt]=ft();function vt(e,t){const n=t?e?mt:gt:e?ht:dt;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(g(n,o)&&o in t?n:t,o,r)}const yt={get:vt(!1,!1)},bt={get:vt(!1,!0)},_t={get:vt(!0,!1)},St={get:vt(!0,!0)},Ct=new WeakMap,xt=new WeakMap,wt=new WeakMap,Et=new WeakMap;function kt(e){return It(e)?e:Pt(e,!1,Ye,yt,Ct)}function Tt(e){return Pt(e,!1,Xe,bt,xt)}function Ft(e){return Pt(e,!0,Ze,_t,wt)}function Rt(e){return Pt(e,!0,Qe,St,Et)}function Pt(e,t,n,o,r){if(!x(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=r.get(e);if(s)return s;const i=(l=e).__v_skip||!Object.isExtensible(l)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(T(l));var l;if(0===i)return e;const c=new Proxy(e,2===i?o:n);return r.set(e,c),c}function At(e){return It(e)?At(e.__v_raw):!(!e||!e.__v_isReactive)}function It(e){return!(!e||!e.__v_isReadonly)}function Ot(e){return!(!e||!e.__v_isShallow)}function Nt(e){return At(e)||It(e)}function Dt(e){const t=e&&e.__v_raw;return t?Dt(t):e}function Mt(e){return V(e,"__v_skip",!0),e}const Lt=e=>x(e)?kt(e):e,$t=e=>x(e)?Ft(e):e;function Bt(e){Pe&&xe&&De((e=Dt(e)).dep||(e.dep=me()))}function jt(e,t){const n=(e=Dt(e)).dep;n&&Le(n)}function Vt(e){return!(!e||!0!==e.__v_isRef)}function Ut(e){return Wt(e,!1)}function Ht(e){return Wt(e,!0)}function Wt(e,t){return Vt(e)?e:new qt(e,t)}class qt{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Dt(e),this._value=t?e:Lt(e)}get value(){return Bt(this),this._value}set value(e){const t=this.__v_isShallow||Ot(e)||It(e);e=t?e:Dt(e),B(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Lt(e),jt(this))}}function zt(e){jt(e)}function Kt(e){return Vt(e)?e.value:e}function Gt(e){return _(e)?e():Kt(e)}const Jt={get:(e,t,n)=>Kt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return Vt(r)&&!Vt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Yt(e){return At(e)?e:new Proxy(e,Jt)}class Zt{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>Bt(this)),(()=>jt(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Xt(e){return new Zt(e)}function Qt(e){const t=m(e)?new Array(e.length):{};for(const n in e)t[n]=on(e,n);return t}class en{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=Dt(this._object),t=this._key,null==(n=be.get(e))?void 0:n.get(t);var e,t,n}}class tn{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function nn(e,t,n){return Vt(e)?e:_(e)?new tn(e):x(e)&&arguments.length>1?on(e,t,n):Ut(e)}function on(e,t,n){const o=e[t];return Vt(o)?o:new en(e,t,n)}class rn{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new ke(e,(()=>{this._dirty||(this._dirty=!0,jt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=Dt(this);return Bt(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function sn(e,...t){}function ln(e,t){}function cn(e,t,n,o){let r;try{r=o?e(...o):e()}catch(e){un(e,t,n)}return r}function an(e,t,n,o){if(_(e)){const r=cn(e,t,n,o);return r&&w(r)&&r.catch((e=>{un(e,t,n)})),r}const r=[];for(let s=0;s>>1;kn(dn[o])kn(e)-kn(t))),vn=0;vnnull==e.id?1/0:e.id,Tn=(e,t)=>{const n=kn(e)-kn(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Fn(e){fn=!1,pn=!0,dn.sort(Tn);try{for(hn=0;hnRn.emit(e,...t))),Pn=[]):"undefined"!=typeof window&&window.HTMLElement&&!(null==(o=null==(n=window.navigator)?void 0:n.userAgent)?void 0:o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push((e=>{In(e,t)})),setTimeout((()=>{Rn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,An=!0,Pn=[])}),3e3)):(An=!0,Pn=[])}function On(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||s;let r=n;const i=t.startsWith("update:"),l=i&&t.slice(7);if(l&&l in o){const e=`${"modelValue"===l?"model":l}Modifiers`,{number:t,trim:i}=o[e]||s;i&&(r=n.map((e=>S(e)?e.trim():e))),t&&(r=n.map(U))}let c,a=o[c=$(t)]||o[c=$(N(t))];!a&&i&&(a=o[c=$(M(t))]),a&&an(a,e,6,r);const u=o[c+"Once"];if(u){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,an(u,e,6,r)}}function Nn(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const s=e.emits;let i={},l=!1;if(!_(e)){const o=e=>{const n=Nn(e,t,!0);n&&(l=!0,f(i,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return s||l?(m(s)?s.forEach((e=>i[e]=null)):f(i,s),x(e)&&o.set(e,i),i):(x(e)&&o.set(e,null),null)}function Dn(e,t){return!(!e||!u(t))&&(t=t.slice(2).replace(/Once$/,""),g(e,t[0].toLowerCase()+t.slice(1))||g(e,M(t))||g(e,t))}let Mn=null,Ln=null;function $n(e){const t=Mn;return Mn=e,Ln=e&&e.type.__scopeId||null,t}function Bn(e){Ln=e}function jn(){Ln=null}const Vn=e=>Un;function Un(e,t=Mn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&Os(-1);const r=$n(t);let s;try{s=e(...n)}finally{$n(r),o._d&&Os(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function Hn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:s,propsOptions:[i],slots:l,attrs:c,emit:a,render:u,renderCache:f,data:d,setupState:h,ctx:g,inheritAttrs:m}=e;let v,y;const b=$n(e);try{if(4&n.shapeFlag){const e=r||o;v=Ys(u.call(e,e,f,s,h,d,g)),y=c}else{const e=t;v=Ys(e.length>1?e(s,{attrs:c,slots:l,emit:a}):e(s,null)),y=t.props?c:Wn(c)}}catch(t){Ts.length=0,un(t,e,1),v=Ws(Es)}let _=v;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=_;e.length&&7&t&&(i&&e.some(p)&&(y=qn(y,i)),_=zs(_,y))}return n.dirs&&(_=zs(_),_.dirs=_.dirs?_.dirs.concat(n.dirs):n.dirs),n.transition&&(_.transition=n.transition),v=_,$n(b),v}const Wn=e=>{let t;for(const n in e)("class"===n||"style"===n||u(n))&&((t||(t={}))[n]=e[n]);return t},qn=(e,t)=>{const n={};for(const o in e)p(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function zn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;re.__isSuspense,Jn={name:"Suspense",__isSuspense:!0,process(e,t,n,o,r,s,i,l,c,a){null==e?function(e,t,n,o,r,s,i,l,c){const{p:a,o:{createElement:u}}=c,p=u("div"),f=e.suspense=Zn(e,r,o,t,p,n,s,i,l,c);a(null,f.pendingBranch=e.ssContent,p,null,o,f,s,i),f.deps>0?(Yn(e,"onPending"),Yn(e,"onFallback"),a(null,e.ssFallback,t,n,o,null,s,i),eo(f,e.ssFallback)):f.resolve(!1,!0)}(t,n,o,r,s,i,l,c,a):function(e,t,n,o,r,s,i,l,{p:c,um:a,o:{createElement:u}}){const p=t.suspense=e.suspense;p.vnode=t,t.el=e.el;const f=t.ssContent,d=t.ssFallback,{activeBranch:h,pendingBranch:g,isInFallback:m,isHydrating:v}=p;if(g)p.pendingBranch=f,$s(f,g)?(c(g,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():m&&(c(h,d,n,o,r,null,s,i,l),eo(p,d))):(p.pendingId++,v?(p.isHydrating=!1,p.activeBranch=g):a(g,r,p),p.deps=0,p.effects.length=0,p.hiddenContainer=u("div"),m?(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0?p.resolve():(c(h,d,n,o,r,null,s,i,l),eo(p,d))):h&&$s(f,h)?(c(h,f,n,o,r,p,s,i,l),p.resolve(!0)):(c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0&&p.resolve()));else if(h&&$s(f,h))c(h,f,n,o,r,p,s,i,l),eo(p,f);else if(Yn(t,"onPending"),p.pendingBranch=f,p.pendingId++,c(null,f,p.hiddenContainer,null,r,p,s,i,l),p.deps<=0)p.resolve();else{const{timeout:e,pendingId:t}=p;e>0?setTimeout((()=>{p.pendingId===t&&p.fallback(d)}),e):0===e&&p.fallback(d)}}(e,t,n,o,r,i,l,c,a)},hydrate:function(e,t,n,o,r,s,i,l,c){const a=t.suspense=Zn(t,o,n,e.parentNode,document.createElement("div"),null,r,s,i,l,!0),u=c(e,a.pendingBranch=t.ssContent,n,a,s,i);return 0===a.deps&&a.resolve(!1,!0),u},create:Zn,normalize:function(e){const{shapeFlag:t,children:n}=e,o=32&t;e.ssContent=Xn(o?n.default:n),e.ssFallback=o?Xn(n.fallback):Ws(Es)}};function Yn(e,t){const n=e.props&&e.props[t];_(n)&&n()}function Zn(e,t,n,o,r,s,i,l,c,a,u=!1){const{p,m:f,um:d,n:h,o:{parentNode:g,remove:m}}=a;let v;const y=function(e){var t;return null!=(null==(t=e.props)?void 0:t.suspensible)&&!1!==e.props.suspensible}(e);y&&(null==t?void 0:t.pendingBranch)&&(v=t.pendingId,t.deps++);const b=e.props?H(e.props.timeout):void 0,_={vnode:e,parent:t,parentComponent:n,isSVG:i,container:o,hiddenContainer:r,anchor:s,deps:0,pendingId:0,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:o,activeBranch:r,pendingBranch:s,pendingId:i,effects:l,parentComponent:c,container:a}=_;if(_.isHydrating)_.isHydrating=!1;else if(!e){const e=r&&s.transition&&"out-in"===s.transition.mode;e&&(r.transition.afterLeave=()=>{i===_.pendingId&&f(s,a,t,0)});let{anchor:t}=_;r&&(t=h(r),d(r,c,_,!0)),e||f(s,a,t,0)}eo(_,s),_.pendingBranch=null,_.isInFallback=!1;let u=_.parent,p=!1;for(;u;){if(u.pendingBranch){u.effects.push(...l),p=!0;break}u=u.parent}p||xn(l),_.effects=[],y&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),Yn(o,"onResolve")},fallback(e){if(!_.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:o,container:r,isSVG:s}=_;Yn(t,"onFallback");const i=h(n),a=()=>{_.isInFallback&&(p(null,e,r,i,o,null,s,l,c),eo(_,e))},u=e.transition&&"out-in"===e.transition.mode;u&&(n.transition.afterLeave=a),_.isInFallback=!0,d(n,o,null,!0),u||a()},move(e,t,n){_.activeBranch&&f(_.activeBranch,e,t,n),_.container=e},next:()=>_.activeBranch&&h(_.activeBranch),registerDep(e,t){const n=!!_.pendingBranch;n&&_.deps++;const o=e.vnode.el;e.asyncDep.catch((t=>{un(t,e,0)})).then((r=>{if(e.isUnmounted||_.isUnmounted||_.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:s}=e;mi(e,r,!1),o&&(s.el=o);const l=!o&&e.subTree.el;t(e,s,g(o||e.subTree.el),o?null:h(e.subTree),_,i,c),l&&m(l),Kn(e,s.el),n&&0==--_.deps&&_.resolve()}))},unmount(e,t){_.isUnmounted=!0,_.activeBranch&&d(_.activeBranch,n,e,t),_.pendingBranch&&d(_.pendingBranch,n,e,t)}};return _}function Xn(e){let t;if(_(e)){const n=Is&&e._c;n&&(e._d=!1,Rs()),e=e(),n&&(e._d=!0,t=Fs,Ps())}if(m(e)){const t=function(e){let t;for(let n=0;nt!==e))),e}function Qn(e,t){t&&t.pendingBranch?m(e)?t.effects.push(...e):t.effects.push(e):xn(e)}function eo(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e,r=n.el=t.el;o&&o.subTree===n&&(o.vnode.el=r,Kn(o,r))}function to(e,t){return io(e,null,t)}function no(e,t){return io(e,null,{flush:"post"})}function oo(e,t){return io(e,null,{flush:"sync"})}const ro={};function so(e,t,n){return io(e,t,n)}function io(e,t,{immediate:n,deep:o,flush:r,onTrack:i,onTrigger:c}=s){var a;const u=he()===(null==(a=ri)?void 0:a.scope)?ri:null;let p,f,h=!1,g=!1;if(Vt(e)?(p=()=>e.value,h=Ot(e)):At(e)?(p=()=>e,o=!0):m(e)?(g=!0,h=e.some((e=>At(e)||Ot(e))),p=()=>e.map((e=>Vt(e)?e.value:At(e)?ao(e):_(e)?cn(e,u,2):void 0))):p=_(e)?t?()=>cn(e,u,2):()=>{if(!u||!u.isUnmounted)return f&&f(),an(e,u,3,[y])}:l,t&&o){const e=p;p=()=>ao(e())}let v,y=e=>{f=x.onStop=()=>{cn(e,u,4)}};if(hi){if(y=l,t?n&&an(t,u,3,[p(),g?[]:void 0,y]):p(),"sync"!==r)return l;{const e=ki();v=e.__watcherHandles||(e.__watcherHandles=[])}}let b=g?new Array(e.length).fill(ro):ro;const S=()=>{if(x.active)if(t){const e=x.run();(o||h||(g?e.some(((e,t)=>B(e,b[t]))):B(e,b)))&&(f&&f(),an(t,u,3,[e,b===ro?void 0:g&&b[0]===ro?[]:b,y]),b=e)}else x.run()};let C;S.allowRecurse=!!t,"sync"===r?C=S:"post"===r?C=()=>ps(S,u&&u.suspense):(S.pre=!0,u&&(S.id=u.uid),C=()=>Sn(S));const x=new ke(p,C);t?n?S():b=x.run():"post"===r?ps(x.run.bind(x),u&&u.suspense):x.run();const w=()=>{x.stop(),u&&u.scope&&d(u.scope.effects,x)};return v&&v.push(w),w}function lo(e,t,n){const o=this.proxy,r=S(e)?e.includes(".")?co(o,e):()=>o[e]:e.bind(o,o);let s;_(t)?s=t:(s=t.handler,n=t);const i=ri;ai(this);const l=io(r,s.bind(o),n);return i?ai(i):ui(),l}function co(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{ao(e,t)}));else if(F(e))for(const n in e)ao(e[n],t);return e}function uo(e,t){const n=Mn;if(null===n)return e;const o=Si(n)||n.proxy,r=e.dirs||(e.dirs=[]);for(let e=0;e{e.isMounted=!0})),Uo((()=>{e.isUnmounting=!0})),e}const ho=[Function,Array],go={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ho,onEnter:ho,onAfterEnter:ho,onEnterCancelled:ho,onBeforeLeave:ho,onLeave:ho,onAfterLeave:ho,onLeaveCancelled:ho,onBeforeAppear:ho,onAppear:ho,onAfterAppear:ho,onAppearCancelled:ho},mo={name:"BaseTransition",props:go,setup(e,{slots:t}){const n=si(),o=fo();let r;return()=>{const s=t.default&&Co(t.default(),!0);if(!s||!s.length)return;let i=s[0];if(s.length>1){let e=!1;for(const t of s)if(t.type!==Es){i=t,e=!0;break}}const l=Dt(e),{mode:c}=l;if(o.isLeaving)return bo(i);const a=_o(i);if(!a)return bo(i);const u=yo(a,l,o,n);So(a,u);const p=n.subTree,f=p&&_o(p);let d=!1;const{getTransitionKey:h}=a.type;if(h){const e=h();void 0===r?r=e:e!==r&&(r=e,d=!0)}if(f&&f.type!==Es&&(!$s(a,f)||d)){const e=yo(f,l,o,n);if(So(f,e),"out-in"===c)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&n.update()},bo(i);"in-out"===c&&a.type!==Es&&(e.delayLeave=(e,t,n)=>{vo(o,f)[String(f.key)]=f,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete u.delayedLeave},u.delayedLeave=n})}return i}}};function vo(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function yo(e,t,n,o){const{appear:r,mode:s,persisted:i=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:a,onEnterCancelled:u,onBeforeLeave:p,onLeave:f,onAfterLeave:d,onLeaveCancelled:h,onBeforeAppear:g,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,_=String(e.key),S=vo(n,e),C=(e,t)=>{e&&an(e,o,9,t)},x=(e,t)=>{const n=t[1];C(e,t),m(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},w={mode:s,persisted:i,beforeEnter(t){let o=l;if(!n.isMounted){if(!r)return;o=g||l}t._leaveCb&&t._leaveCb(!0);const s=S[_];s&&$s(e,s)&&s.el._leaveCb&&s.el._leaveCb(),C(o,[t])},enter(e){let t=c,o=a,s=u;if(!n.isMounted){if(!r)return;t=v||c,o=y||a,s=b||u}let i=!1;const l=e._enterCb=t=>{i||(i=!0,C(t?s:o,[e]),w.delayedLeave&&w.delayedLeave(),e._enterCb=void 0)};t?x(t,[e,l]):l()},leave(t,o){const r=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return o();C(p,[t]);let s=!1;const i=t._leaveCb=n=>{s||(s=!0,o(),C(n?h:d,[t]),t._leaveCb=void 0,S[r]===e&&delete S[r])};S[r]=e,f?x(f,[t,i]):i()},clone:e=>yo(e,t,n,o)};return w}function bo(e){if(To(e))return(e=zs(e)).children=null,e}function _o(e){return To(e)?e.children?e.children[0]:void 0:e}function So(e,t){6&e.shapeFlag&&e.component?So(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Co(e,t=!1,n){let o=[],r=0;for(let s=0;s1)for(let e=0;ef({name:e.name},t,{setup:e}))():e}const wo=e=>!!e.type.__asyncLoader;function Eo(e){_(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:i=!0,onError:l}=e;let c,a=null,u=0;const p=()=>{let e;return a||(e=a=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),l)return new Promise(((t,n)=>{l(e,(()=>t((u++,a=null,p()))),(()=>n(e)),u+1)}));throw e})).then((t=>e!==a&&a?a:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),c=t,t))))};return xo({name:"AsyncComponentWrapper",__asyncLoader:p,get __asyncResolved(){return c},setup(){const e=ri;if(c)return()=>ko(c,e);const t=t=>{a=null,un(t,e,13,!o)};if(i&&e.suspense||hi)return p().then((t=>()=>ko(t,e))).catch((e=>(t(e),()=>o?Ws(o,{error:e}):null)));const l=Ut(!1),u=Ut(),f=Ut(!!r);return r&&setTimeout((()=>{f.value=!1}),r),null!=s&&setTimeout((()=>{if(!l.value&&!u.value){const e=new Error(`Async component timed out after ${s}ms.`);t(e),u.value=e}}),s),p().then((()=>{l.value=!0,e.parent&&To(e.parent.vnode)&&Sn(e.parent.update)})).catch((e=>{t(e),u.value=e})),()=>l.value&&c?ko(c,e):u.value&&o?Ws(o,{error:u.value}):n&&!f.value?Ws(n):void 0}})}function ko(e,t){const{ref:n,props:o,children:r,ce:s}=t.vnode,i=Ws(e,o,r);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const To=e=>e.type.__isKeepAlive,Fo={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=si(),o=n.ctx;if(!o.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const r=new Map,s=new Set;let i=null;const l=n.suspense,{renderer:{p:c,m:a,um:u,o:{createElement:p}}}=o,f=p("div");function d(e){No(e),u(e,n,l,!0)}function h(e){r.forEach(((t,n)=>{const o=Ci(t.type);!o||e&&e(o)||g(n)}))}function g(e){const t=r.get(e);i&&$s(t,i)?i&&No(i):d(t),r.delete(e),s.delete(e)}o.activate=(e,t,n,o,r)=>{const s=e.component;a(e,t,n,0,l),c(s.vnode,e,t,n,s,l,o,e.slotScopeIds,r),ps((()=>{s.isDeactivated=!1,s.a&&j(s.a);const t=e.props&&e.props.onVnodeMounted;t&&ei(t,s.parent,e)}),l)},o.deactivate=e=>{const t=e.component;a(e,f,null,1,l),ps((()=>{t.da&&j(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&ei(n,t.parent,e),t.isDeactivated=!0}),l)},so((()=>[e.include,e.exclude]),(([e,t])=>{e&&h((t=>Ro(e,t))),t&&h((e=>!Ro(t,e)))}),{flush:"post",deep:!0});let m=null;const v=()=>{null!=m&&r.set(m,Do(n.subTree))};return Bo(v),Vo(v),Uo((()=>{r.forEach((e=>{const{subTree:t,suspense:o}=n,r=Do(t);if(e.type!==r.type||e.key!==r.key)d(e);else{No(r);const e=r.component.da;e&&ps(e,o)}}))})),()=>{if(m=null,!t.default)return null;const n=t.default(),o=n[0];if(n.length>1)return i=null,n;if(!Ls(o)||!(4&o.shapeFlag||128&o.shapeFlag))return i=null,o;let l=Do(o);const c=l.type,a=Ci(wo(l)?l.type.__asyncResolved||{}:c),{include:u,exclude:p,max:f}=e;if(u&&(!a||!Ro(u,a))||p&&a&&Ro(p,a))return i=l,o;const d=null==l.key?c:l.key,h=r.get(d);return l.el&&(l=zs(l),128&o.shapeFlag&&(o.ssContent=l)),m=d,h?(l.el=h.el,l.component=h.component,l.transition&&So(l,l.transition),l.shapeFlag|=512,s.delete(d),s.add(d)):(s.add(d),f&&s.size>parseInt(f,10)&&g(s.values().next().value)),l.shapeFlag|=256,i=l,Gn(o.type)?o:l}}};function Ro(e,t){return m(e)?e.some((e=>Ro(e,t))):S(e)?e.split(",").includes(t):"[object RegExp]"===k(e)&&e.test(t)}function Po(e,t){Io(e,"a",t)}function Ao(e,t){Io(e,"da",t)}function Io(e,t,n=ri){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Mo(t,o,n),n){let e=n.parent;for(;e&&e.parent;)To(e.parent.vnode)&&Oo(o,t,n,e),e=e.parent}}function Oo(e,t,n,o){const r=Mo(t,e,o,!0);Ho((()=>{d(o[t],r)}),n)}function No(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Do(e){return 128&e.shapeFlag?e.ssContent:e}function Mo(e,t,n=ri,o=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;Ie(),ai(n);const r=an(t,n,e,o);return ui(),Oe(),r});return o?r.unshift(s):r.push(s),s}}const Lo=e=>(t,n=ri)=>(!hi||"sp"===e)&&Mo(e,((...e)=>t(...e)),n),$o=Lo("bm"),Bo=Lo("m"),jo=Lo("bu"),Vo=Lo("u"),Uo=Lo("bum"),Ho=Lo("um"),Wo=Lo("sp"),qo=Lo("rtg"),zo=Lo("rtc");function Ko(e,t=ri){Mo("ec",e,t)}const Go="components",Jo="directives";function Yo(e,t){return er(Go,e,!0,t)||e}const Zo=Symbol.for("v-ndc");function Xo(e){return S(e)?er(Go,e,!1)||e:e||Zo}function Qo(e){return er(Jo,e)}function er(e,t,n=!0,o=!1){const r=Mn||ri;if(r){const n=r.type;if(e===Go){const e=Ci(n,!1);if(e&&(e===t||e===N(t)||e===L(N(t))))return n}const s=tr(r[e]||n[e],t)||tr(r.appContext[e],t);return!s&&o?n:s}}function tr(e,t){return e&&(e[t]||e[N(t)]||e[L(N(t))])}function nr(e,t,n,o){let r;const s=n&&n[o];if(m(e)||S(e)){r=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,s&&s[n])));else{const n=Object.keys(e);r=new Array(n.length);for(let o=0,i=n.length;o{const t=o.fn(...e);return t&&(t.key=o.key),t}:o.fn)}return e}function rr(e,t,n={},o,r){if(Mn.isCE||Mn.parent&&wo(Mn.parent)&&Mn.parent.isCE)return"default"!==t&&(n.name=t),Ws("slot",n,o&&o());let s=e[t];s&&s._c&&(s._d=!1),Rs();const i=s&&sr(s(n)),l=Ms(xs,{key:n.key||i&&i.key||`_${t}`},i||(o?o():[]),i&&1===e._?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function sr(e){return e.some((e=>!Ls(e)||e.type!==Es&&!(e.type===xs&&!sr(e.children))))?e:null}function ir(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:$(o)]=e[o];return n}const lr=e=>e?pi(e)?Si(e)||e.proxy:lr(e.parent):null,cr=f(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lr(e.parent),$root:e=>lr(e.root),$emit:e=>e.emit,$options:e=>Ar(e),$forceUpdate:e=>e.f||(e.f=()=>Sn(e.update)),$nextTick:e=>e.n||(e.n=_n.bind(e.proxy)),$watch:e=>lo.bind(e)}),ar=(e,t)=>e!==s&&!e.__isScriptSetup&&g(e,t),ur={get({_:e},t){const{ctx:n,setupState:o,data:r,props:i,accessCache:l,type:c,appContext:a}=e;let u;if("$"!==t[0]){const c=l[t];if(void 0!==c)switch(c){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(ar(o,t))return l[t]=1,o[t];if(r!==s&&g(r,t))return l[t]=2,r[t];if((u=e.propsOptions[0])&&g(u,t))return l[t]=3,i[t];if(n!==s&&g(n,t))return l[t]=4,n[t];Fr&&(l[t]=0)}}const p=cr[t];let f,d;return p?("$attrs"===t&&Ne(e,0,t),p(e)):(f=c.__cssModules)&&(f=f[t])?f:n!==s&&g(n,t)?(l[t]=4,n[t]):(d=a.config.globalProperties,g(d,t)?d[t]:void 0)},set({_:e},t,n){const{data:o,setupState:r,ctx:i}=e;return ar(r,t)?(r[t]=n,!0):o!==s&&g(o,t)?(o[t]=n,!0):!(g(e.props,t)||"$"===t[0]&&t.slice(1)in e||(i[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,propsOptions:i}},l){let c;return!!n[l]||e!==s&&g(e,l)||ar(t,l)||(c=i[0])&&g(c,l)||g(o,l)||g(cr,l)||g(r.config.globalProperties,l)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:g(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},pr=f({},ur,{get(e,t){if(t!==Symbol.unscopables)return ur.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!K(t)});function fr(){return null}function dr(){return null}function hr(e){}function gr(e){}function mr(){return null}function vr(){}function yr(e,t){return null}function br(){return Cr().slots}function _r(){return Cr().attrs}function Sr(e,t,n){const o=si();if(n&&n.local){const n=Ut(e[t]);return so((()=>e[t]),(e=>n.value=e)),so(n,(n=>{n!==e[t]&&o.emit(`update:${t}`,n)})),n}return{__v_isRef:!0,get value(){return e[t]},set value(e){o.emit(`update:${t}`,e)}}}function Cr(){const e=si();return e.setupContext||(e.setupContext=_i(e))}function xr(e){return m(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}function wr(e,t){const n=xr(e);for(const e in t){if(e.startsWith("__skip"))continue;let o=n[e];o?m(o)||_(o)?o=n[e]={type:o,default:t[e]}:o.default=t[e]:null===o&&(o=n[e]={default:t[e]}),o&&t[`__skip_${e}`]&&(o.skipFactory=!0)}return n}function Er(e,t){return e&&t?m(e)&&m(t)?e.concat(t):f({},xr(e),xr(t)):e||t}function kr(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Tr(e){const t=si();let n=e();return ui(),w(n)&&(n=n.catch((e=>{throw ai(t),e}))),[n,()=>ai(t)]}let Fr=!0;function Rr(e,t,n){an(m(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function Pr(e,t,n,o){const r=o.includes(".")?co(n,o):()=>n[o];if(S(e)){const n=t[e];_(n)&&so(r,n)}else if(_(e))so(r,e.bind(n));else if(x(e))if(m(e))e.forEach((e=>Pr(e,t,n,o)));else{const o=_(e.handler)?e.handler.bind(n):t[e.handler];_(o)&&so(r,o,e)}}function Ar(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let c;return l?c=l:r.length||n||o?(c={},r.length&&r.forEach((e=>Ir(c,e,i,!0))),Ir(c,t,i)):c=t,x(t)&&s.set(t,c),c}function Ir(e,t,n,o=!1){const{mixins:r,extends:s}=t;s&&Ir(e,s,n,!0),r&&r.forEach((t=>Ir(e,t,n,!0)));for(const r in t)if(o&&"expose"===r);else{const o=Or[r]||n&&n[r];e[r]=o?o(e[r],t[r]):t[r]}return e}const Or={data:Nr,props:$r,emits:$r,methods:Lr,computed:Lr,beforeCreate:Mr,created:Mr,beforeMount:Mr,mounted:Mr,beforeUpdate:Mr,updated:Mr,beforeDestroy:Mr,beforeUnmount:Mr,destroyed:Mr,unmounted:Mr,activated:Mr,deactivated:Mr,errorCaptured:Mr,serverPrefetch:Mr,components:Lr,directives:Lr,watch:function(e,t){if(!e)return t;if(!t)return e;const n=f(Object.create(null),e);for(const o in t)n[o]=Mr(e[o],t[o]);return n},provide:Nr,inject:function(e,t){return Lr(Dr(e),Dr(t))}};function Nr(e,t){return t?e?function(){return f(_(e)?e.call(this,this):e,_(t)?t.call(this,this):t)}:t:e}function Dr(e){if(m(e)){const t={};for(let n=0;n(s.has(e)||(e&&_(e.install)?(s.add(e),e.install(l,...t)):_(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,c,a){if(!i){const u=Ws(n,o);return u.appContext=r,c&&t?t(u,s):e(u,s,a),i=!0,l._container=s,s.__vue_app__=l,Si(u.component)||u.component.proxy}},unmount(){i&&(e(null,l._container),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){Ur=l;try{return e()}finally{Ur=null}}};return l}}let Ur=null;function Hr(e,t){if(ri){let n=ri.provides;const o=ri.parent&&ri.parent.provides;o===n&&(n=ri.provides=Object.create(o)),n[e]=t}}function Wr(e,t,n=!1){const o=ri||Mn;if(o||Ur){const r=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Ur._context.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&_(t)?t.call(o&&o.proxy):t}}function qr(){return!!(ri||Mn||Ur)}function zr(e,t,n,o){const[r,i]=e.propsOptions;let l,c=!1;if(t)for(let s in t){if(P(s))continue;const a=t[s];let u;r&&g(r,u=N(s))?i&&i.includes(u)?(l||(l={}))[u]=a:n[u]=a:Dn(e.emitsOptions,s)||s in o&&a===o[s]||(o[s]=a,c=!0)}if(i){const t=Dt(n),o=l||s;for(let s=0;s{u=!0;const[n,o]=Gr(e,t,!0);f(c,n),o&&a.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!l&&!u)return x(e)&&o.set(e,i),i;if(m(l))for(let e=0;e-1,o[1]=n<0||e-1||g(o,"default"))&&a.push(t)}}}const p=[c,a];return x(e)&&o.set(e,p),p}function Jr(e){return"$"!==e[0]}function Yr(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function Zr(e,t){return Yr(e)===Yr(t)}function Xr(e,t){return m(t)?t.findIndex((t=>Zr(t,e))):_(t)&&Zr(t,e)?0:-1}const Qr=e=>"_"===e[0]||"$stable"===e,es=e=>m(e)?e.map(Ys):[Ys(e)],ts=(e,t,n)=>{if(t._n)return t;const o=Un(((...e)=>es(t(...e))),n);return o._c=!1,o},ns=(e,t,n)=>{const o=e._ctx;for(const n in e){if(Qr(n))continue;const r=e[n];if(_(r))t[n]=ts(0,r,o);else if(null!=r){const e=es(r);t[n]=()=>e}}},os=(e,t)=>{const n=es(t);e.slots.default=()=>n},rs=(e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=Dt(t),V(t,"_",n)):ns(t,e.slots={})}else e.slots={},t&&os(e,t);V(e.slots,js,1)},ss=(e,t,n)=>{const{vnode:o,slots:r}=e;let i=!0,l=s;if(32&o.shapeFlag){const e=t._;e?n&&1===e?i=!1:(f(r,t),n||1!==e||delete r._):(i=!t.$stable,ns(t,r)),l=t}else t&&(os(e,t),l={default:1});if(i)for(const e in r)Qr(e)||e in l||delete r[e]};function is(e,t,n,o,r=!1){if(m(e))return void e.forEach(((e,s)=>is(e,t&&(m(t)?t[s]:t),n,o,r)));if(wo(o)&&!r)return;const i=4&o.shapeFlag?Si(o.component)||o.component.proxy:o.el,l=r?null:i,{i:c,r:a}=e,u=t&&t.r,p=c.refs===s?c.refs={}:c.refs,f=c.setupState;if(null!=u&&u!==a&&(S(u)?(p[u]=null,g(f,u)&&(f[u]=null)):Vt(u)&&(u.value=null)),_(a))cn(a,c,12,[l,p]);else{const t=S(a),o=Vt(a);if(t||o){const s=()=>{if(e.f){const n=t?g(f,a)?f[a]:p[a]:a.value;r?m(n)&&d(n,i):m(n)?n.includes(i)||n.push(i):t?(p[a]=[i],g(f,a)&&(f[a]=p[a])):(a.value=[i],e.k&&(p[e.k]=a.value))}else t?(p[a]=l,g(f,a)&&(f[a]=l)):o&&(a.value=l,e.k&&(p[e.k]=l))};l?(s.id=-1,ps(s,n)):s()}}}let ls=!1;const cs=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,as=e=>8===e.nodeType;function us(e){const{mt:t,p:n,o:{patchProp:o,createText:r,nextSibling:s,parentNode:i,remove:l,insert:c,createComment:a}}=e,p=(n,o,l,a,u,v=!1)=>{const y=as(n)&&"["===n.data,b=()=>g(n,o,l,a,u,y),{type:_,ref:S,shapeFlag:C,patchFlag:x}=o;let w=n.nodeType;o.el=n,-2===x&&(v=!1,o.dynamicChildren=null);let E=null;switch(_){case ws:3!==w?""===o.children?(c(o.el=r(""),i(n),n),E=n):E=b():(n.data!==o.children&&(ls=!0,n.data=o.children),E=s(n));break;case Es:E=8!==w||y?b():s(n);break;case ks:if(y&&(w=(n=s(n)).nodeType),1===w||3===w){E=n;const e=!o.children.length;for(let t=0;t{i=i||!!t.dynamicChildren;const{type:c,props:a,patchFlag:p,shapeFlag:f,dirs:h}=t,g="input"===c&&h||"option"===c;if(g||-1!==p){if(h&&po(t,null,n,"created"),a)if(g||!i||48&p)for(const t in a)(g&&t.endsWith("value")||u(t)&&!P(t))&&o(e,t,null,a[t],!1,void 0,n);else a.onClick&&o(e,"onClick",null,a.onClick,!1,void 0,n);let c;if((c=a&&a.onVnodeBeforeMount)&&ei(c,n,t),h&&po(t,null,n,"beforeMount"),((c=a&&a.onVnodeMounted)||h)&&Qn((()=>{c&&ei(c,n,t),h&&po(t,null,n,"mounted")}),r),16&f&&(!a||!a.innerHTML&&!a.textContent)){let o=d(e.firstChild,t,e,n,r,s,i);for(;o;){ls=!0;const e=o;o=o.nextSibling,l(e)}}else 8&f&&e.textContent!==t.children&&(ls=!0,e.textContent=t.children)}return e.nextSibling},d=(e,t,o,r,s,i,l)=>{l=l||!!t.dynamicChildren;const c=t.children,a=c.length;for(let t=0;t{const{slotScopeIds:u}=t;u&&(r=r?r.concat(u):u);const p=i(e),f=d(s(e),t,p,n,o,r,l);return f&&as(f)&&"]"===f.data?s(t.anchor=f):(ls=!0,c(t.anchor=a("]"),p,f),f)},g=(e,t,o,r,c,a)=>{if(ls=!0,t.el=null,a){const t=m(e);for(;;){const n=s(e);if(!n||n===t)break;l(n)}}const u=s(e),p=i(e);return l(e),n(null,t,p,u,o,r,cs(p),c),u},m=e=>{let t=0;for(;e;)if((e=s(e))&&as(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return s(e);t--}return e};return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),En(),void(t._vnode=e);ls=!1,p(t.firstChild,e,null,null,null),En(),t._vnode=e,ls&&console.error("Hydration completed but contains mismatches.")},p]}const ps=Qn;function fs(e){return hs(e)}function ds(e){return hs(e,us)}function hs(e,t){q().__VUE__=!0;const{insert:n,remove:o,patchProp:r,createElement:c,createText:a,createComment:u,setText:p,setElementText:f,parentNode:d,nextSibling:h,setScopeId:m=l,insertStaticContent:v}=e,y=(e,t,n,o=null,r=null,s=null,i=!1,l=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!$s(e,t)&&(o=J(e),H(e,r,s,!0),e=null),-2===t.patchFlag&&(c=!1,t.dynamicChildren=null);const{type:a,ref:u,shapeFlag:p}=t;switch(a){case ws:b(e,t,n,o);break;case Es:_(e,t,n,o);break;case ks:null==e&&S(t,n,o,i);break;case xs:R(e,t,n,o,r,s,i,l,c);break;default:1&p?C(e,t,n,o,r,s,i,l,c):6&p?A(e,t,n,o,r,s,i,l,c):(64&p||128&p)&&a.process(e,t,n,o,r,s,i,l,c,Z)}null!=u&&r&&is(u,e&&e.ref,s,t||e,!t)},b=(e,t,o,r)=>{if(null==e)n(t.el=a(t.children),o,r);else{const n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},_=(e,t,o,r)=>{null==e?n(t.el=u(t.children||""),o,r):t.el=e.el},S=(e,t,n,o)=>{[e.el,e.anchor]=v(e.children,t,n,o,e.el,e.anchor)},C=(e,t,n,o,r,s,i,l,c)=>{i=i||"svg"===t.type,null==e?x(t,n,o,r,s,i,l,c):k(e,t,r,s,i,l,c)},x=(e,t,o,s,i,l,a,u)=>{let p,d;const{type:h,props:g,shapeFlag:m,transition:v,dirs:y}=e;if(p=e.el=c(e.type,l,g&&g.is,g),8&m?f(p,e.children):16&m&&E(e.children,p,null,s,i,l&&"foreignObject"!==h,a,u),y&&po(e,null,s,"created"),w(p,e,e.scopeId,a,s),g){for(const t in g)"value"===t||P(t)||r(p,t,null,g[t],l,e.children,s,i,G);"value"in g&&r(p,"value",null,g.value),(d=g.onVnodeBeforeMount)&&ei(d,s,e)}y&&po(e,null,s,"beforeMount");const b=(!i||i&&!i.pendingBranch)&&v&&!v.persisted;b&&v.beforeEnter(p),n(p,t,o),((d=g&&g.onVnodeMounted)||b||y)&&ps((()=>{d&&ei(d,s,e),b&&v.enter(p),y&&po(e,null,s,"mounted")}),i)},w=(e,t,n,o,r)=>{if(n&&m(e,n),o)for(let t=0;t{for(let a=c;a{const a=t.el=e.el;let{patchFlag:u,dynamicChildren:p,dirs:d}=t;u|=16&e.patchFlag;const h=e.props||s,g=t.props||s;let m;n&&gs(n,!1),(m=g.onVnodeBeforeUpdate)&&ei(m,n,t,e),d&&po(t,e,n,"beforeUpdate"),n&&gs(n,!0);const v=i&&"foreignObject"!==t.type;if(p?T(e.dynamicChildren,p,a,n,o,v,l):c||$(e,t,a,null,n,o,v,l,!1),u>0){if(16&u)F(a,t,h,g,n,o,i);else if(2&u&&h.class!==g.class&&r(a,"class",null,g.class,i),4&u&&r(a,"style",h.style,g.style,i),8&u){const s=t.dynamicProps;for(let t=0;t{m&&ei(m,n,t,e),d&&po(t,e,n,"updated")}),o)},T=(e,t,n,o,r,s,i)=>{for(let l=0;l{if(n!==o){if(n!==s)for(const s in n)P(s)||s in o||r(e,s,n[s],null,c,t.children,i,l,G);for(const s in o){if(P(s))continue;const a=o[s],u=n[s];a!==u&&"value"!==s&&r(e,s,u,a,c,t.children,i,l,G)}"value"in o&&r(e,"value",n.value,o.value)}},R=(e,t,o,r,s,i,l,c,u)=>{const p=t.el=e?e.el:a(""),f=t.anchor=e?e.anchor:a("");let{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(c=c?c.concat(g):g),null==e?(n(p,o,r),n(f,o,r),E(t.children,o,f,s,i,l,c,u)):d>0&&64&d&&h&&e.dynamicChildren?(T(e.dynamicChildren,h,o,s,i,l,c),(null!=t.key||s&&t===s.subTree)&&ms(e,t,!0)):$(e,t,o,f,s,i,l,c,u)},A=(e,t,n,o,r,s,i,l,c)=>{t.slotScopeIds=l,null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,i,c):I(t,n,o,r,s,i,c):O(e,t,c)},I=(e,t,n,o,r,s,i)=>{const l=e.component=oi(e,o,r);if(To(e)&&(l.ctx.renderer=Z),gi(l),l.asyncDep){if(r&&r.registerDep(l,D),!e.el){const e=l.subTree=Ws(Es);_(null,e,t,n)}}else D(l,e,t,n,r,s,i)},O=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:s}=e,{props:i,children:l,patchFlag:c}=t,a=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&c>=0))return!(!r&&!l||l&&l.$stable)||o!==i&&(o?!i||zn(o,i,a):!!i);if(1024&c)return!0;if(16&c)return o?zn(o,i,a):!!i;if(8&c){const e=t.dynamicProps;for(let t=0;thn&&dn.splice(t,1)}(o.update),o.update()}else t.el=e.el,o.vnode=t},D=(e,t,n,o,r,s,i)=>{const l=e.effect=new ke((()=>{if(e.isMounted){let t,{next:n,bu:o,u:l,parent:c,vnode:a}=e,u=n;gs(e,!1),n?(n.el=a.el,L(e,n,i)):n=a,o&&j(o),(t=n.props&&n.props.onVnodeBeforeUpdate)&&ei(t,c,n,a),gs(e,!0);const p=Hn(e),f=e.subTree;e.subTree=p,y(f,p,d(f.el),J(f),e,r,s),n.el=p.el,null===u&&Kn(e,p.el),l&&ps(l,r),(t=n.props&&n.props.onVnodeUpdated)&&ps((()=>ei(t,c,n,a)),r)}else{let i;const{el:l,props:c}=t,{bm:a,m:u,parent:p}=e,f=wo(t);if(gs(e,!1),a&&j(a),!f&&(i=c&&c.onVnodeBeforeMount)&&ei(i,p,t),gs(e,!0),l&&Q){const n=()=>{e.subTree=Hn(e),Q(l,e.subTree,e,r,null)};f?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const i=e.subTree=Hn(e);y(null,i,n,o,e,r,s),t.el=i.el}if(u&&ps(u,r),!f&&(i=c&&c.onVnodeMounted)){const e=t;ps((()=>ei(i,p,e)),r)}(256&t.shapeFlag||p&&wo(p.vnode)&&256&p.vnode.shapeFlag)&&e.a&&ps(e.a,r),e.isMounted=!0,t=n=o=null}}),(()=>Sn(c)),e.scope),c=e.update=()=>l.run();c.id=e.uid,gs(e,!0),c()},L=(e,t,n)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:s,vnode:{patchFlag:i}}=e,l=Dt(r),[c]=e.propsOptions;let a=!1;if(!(o||i>0)||16&i){let o;zr(e,t,r,s)&&(a=!0);for(const s in l)t&&(g(t,s)||(o=M(s))!==s&&g(t,o))||(c?!n||void 0===n[s]&&void 0===n[o]||(r[s]=Kr(c,l,s,void 0,e,!0)):delete r[s]);if(s!==l)for(const e in s)t&&g(t,e)||(delete s[e],a=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let o=0;o{const a=e&&e.children,u=e?e.shapeFlag:0,p=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d)return void V(a,p,n,o,r,s,i,l,c);if(256&d)return void B(a,p,n,o,r,s,i,l,c)}8&h?(16&u&&G(a,r,s),p!==a&&f(n,p)):16&u?16&h?V(a,p,n,o,r,s,i,l,c):G(a,r,s,!0):(8&u&&f(n,""),16&h&&E(p,n,o,r,s,i,l,c))},B=(e,t,n,o,r,s,l,c,a)=>{t=t||i;const u=(e=e||i).length,p=t.length,f=Math.min(u,p);let d;for(d=0;dp?G(e,r,s,!0,!1,f):E(t,n,o,r,s,l,c,a,f)},V=(e,t,n,o,r,s,l,c,a)=>{let u=0;const p=t.length;let f=e.length-1,d=p-1;for(;u<=f&&u<=d;){const o=e[u],i=t[u]=a?Zs(t[u]):Ys(t[u]);if(!$s(o,i))break;y(o,i,n,null,r,s,l,c,a),u++}for(;u<=f&&u<=d;){const o=e[f],i=t[d]=a?Zs(t[d]):Ys(t[d]);if(!$s(o,i))break;y(o,i,n,null,r,s,l,c,a),f--,d--}if(u>f){if(u<=d){const e=d+1,i=ed)for(;u<=f;)H(e[u],r,s,!0),u++;else{const h=u,g=u,m=new Map;for(u=g;u<=d;u++){const e=t[u]=a?Zs(t[u]):Ys(t[u]);null!=e.key&&m.set(e.key,u)}let v,b=0;const _=d-g+1;let S=!1,C=0;const x=new Array(_);for(u=0;u<_;u++)x[u]=0;for(u=h;u<=f;u++){const o=e[u];if(b>=_){H(o,r,s,!0);continue}let i;if(null!=o.key)i=m.get(o.key);else for(v=g;v<=d;v++)if(0===x[v-g]&&$s(o,t[v])){i=v;break}void 0===i?H(o,r,s,!0):(x[i-g]=u+1,i>=C?C=i:S=!0,y(o,t[i],n,null,r,s,l,c,a),b++)}const w=S?function(e){const t=e.slice(),n=[0];let o,r,s,i,l;const c=e.length;for(o=0;o>1,e[n[l]]0&&(t[o]=n[s-1]),n[s]=o)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=t[i];return n}(x):i;for(v=w.length-1,u=_-1;u>=0;u--){const e=g+u,i=t[e],f=e+1{const{el:i,type:l,transition:c,children:a,shapeFlag:u}=e;if(6&u)U(e.component.subTree,t,o,r);else if(128&u)e.suspense.move(t,o,r);else if(64&u)l.move(e,t,o,Z);else if(l!==xs)if(l!==ks)if(2!==r&&1&u&&c)if(0===r)c.beforeEnter(i),n(i,t,o),ps((()=>c.enter(i)),s);else{const{leave:e,delayLeave:r,afterLeave:s}=c,l=()=>n(i,t,o),a=()=>{e(i,(()=>{l(),s&&s()}))};r?r(i,l,a):a()}else n(i,t,o);else(({el:e,anchor:t},o,r)=>{let s;for(;e&&e!==t;)s=h(e),n(e,o,r),e=s;n(t,o,r)})(e,t,o);else{n(i,t,o);for(let e=0;e{const{type:s,props:i,ref:l,children:c,dynamicChildren:a,shapeFlag:u,patchFlag:p,dirs:f}=e;if(null!=l&&is(l,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const d=1&u&&f,h=!wo(e);let g;if(h&&(g=i&&i.onVnodeBeforeUnmount)&&ei(g,t,e),6&u)K(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);d&&po(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,Z,o):a&&(s!==xs||p>0&&64&p)?G(a,t,n,!1,!0):(s===xs&&384&p||!r&&16&u)&&G(c,t,n),o&&W(e)}(h&&(g=i&&i.onVnodeUnmounted)||d)&&ps((()=>{g&&ei(g,t,e),d&&po(e,null,t,"unmounted")}),n)},W=e=>{const{type:t,el:n,anchor:r,transition:s}=e;if(t===xs)return void z(n,r);if(t===ks)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),o(e),e=n;o(t)})(e);const i=()=>{o(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:o}=s,r=()=>t(n,i);o?o(e.el,i,r):r()}else i()},z=(e,t)=>{let n;for(;e!==t;)n=h(e),o(e),e=n;o(t)},K=(e,t,n)=>{const{bum:o,scope:r,update:s,subTree:i,um:l}=e;o&&j(o),r.stop(),s&&(s.active=!1,H(i,e,t,n)),l&&ps(l,t),ps((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},G=(e,t,n,o=!1,r=!1,s=0)=>{for(let i=s;i6&e.shapeFlag?J(e.component.subTree):128&e.shapeFlag?e.suspense.next():h(e.anchor||e.el),Y=(e,t,n)=>{null==e?t._vnode&&H(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),wn(),En(),t._vnode=e},Z={p:y,um:H,m:U,r:W,mt:I,mc:E,pc:$,pbc:T,n:J,o:e};let X,Q;return t&&([X,Q]=t(Z)),{render:Y,hydrate:X,createApp:Vr(Y,X)}}function gs({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function ms(e,t,n=!1){const o=e.children,r=t.children;if(m(o)&&m(r))for(let e=0;ee&&(e.disabled||""===e.disabled),ys=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,bs=(e,t)=>{const n=e&&e.to;if(S(n)){if(t){return t(n)}return null}return n};function _s(e,t,n,{o:{insert:o},m:r},s=2){0===s&&o(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:c,children:a,props:u}=e,p=2===s;if(p&&o(i,t,n),(!p||vs(u))&&16&c)for(let e=0;e{16&y&&u(b,e,t,r,s,i,l,c)};v?m(n,a):p&&m(p,f)}else{t.el=e.el;const o=t.anchor=e.anchor,u=t.target=e.target,d=t.targetAnchor=e.targetAnchor,g=vs(e.props),m=g?n:u,y=g?o:d;if(i=i||ys(u),_?(f(e.dynamicChildren,_,m,r,s,i,l),ms(e,t,!0)):c||p(e,t,m,y,r,s,i,l,!1),v)g||_s(t,n,o,a,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=bs(t.props,h);e&&_s(t,e,null,a,0)}else g&&_s(t,u,d,a,1)}Cs(t)},remove(e,t,n,o,{um:r,o:{remove:s}},i){const{shapeFlag:l,children:c,anchor:a,targetAnchor:u,target:p,props:f}=e;if(p&&s(u),(i||!vs(f))&&(s(a),16&l))for(let e=0;e0?Fs||i:null,Ps(),Is>0&&Fs&&Fs.push(e),e}function Ds(e,t,n,o,r,s){return Ns(Hs(e,t,n,o,r,s,!0))}function Ms(e,t,n,o,r){return Ns(Ws(e,t,n,o,r,!0))}function Ls(e){return!!e&&!0===e.__v_isVNode}function $s(e,t){return e.type===t.type&&e.key===t.key}function Bs(e){As=e}const js="__vInternal",Vs=({key:e})=>null!=e?e:null,Us=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?S(e)||Vt(e)||_(e)?{i:Mn,r:e,k:t,f:!!n}:e:null);function Hs(e,t=null,n=null,o=0,r=null,s=(e===xs?0:1),i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Vs(t),ref:t&&Us(t),scopeId:Ln,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Mn};return l?(Xs(c,n),128&s&&e.normalize(c)):n&&(c.shapeFlag|=S(n)?8:16),Is>0&&!i&&Fs&&(c.patchFlag>0||6&s)&&32!==c.patchFlag&&Fs.push(c),c}const Ws=function(e,t=null,n=null,o=0,r=null,s=!1){if(e&&e!==Zo||(e=Es),Ls(e)){const o=zs(e,t,!0);return n&&Xs(o,n),Is>0&&!s&&Fs&&(6&o.shapeFlag?Fs[Fs.indexOf(e)]=o:Fs.push(o)),o.patchFlag|=-2,o}if(i=e,_(i)&&"__vccOpts"in i&&(e=e.__vccOpts),t){t=qs(t);let{class:e,style:n}=t;e&&!S(e)&&(t.class=Q(e)),x(n)&&(Nt(n)&&!m(n)&&(n=f({},n)),t.style=G(n))}var i;return Hs(e,t,n,o,r,S(e)?1:Gn(e)?128:(e=>e.__isTeleport)(e)?64:x(e)?4:_(e)?2:0,s,!0)};function qs(e){return e?Nt(e)||js in e?f({},e):e:null}function zs(e,t,n=!1){const{props:o,ref:r,patchFlag:s,children:i}=e,l=t?Qs(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Vs(l),ref:t&&t.ref?n&&r?m(r)?r.concat(Us(t)):[r,Us(t)]:Us(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==xs?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zs(e.ssContent),ssFallback:e.ssFallback&&zs(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Ks(e=" ",t=0){return Ws(ws,null,e,t)}function Gs(e,t){const n=Ws(ks,null,e);return n.staticCount=t,n}function Js(e="",t=!1){return t?(Rs(),Ms(Es,null,e)):Ws(Es,null,e)}function Ys(e){return null==e||"boolean"==typeof e?Ws(Es):m(e)?Ws(xs,null,e.slice()):"object"==typeof e?Zs(e):Ws(ws,null,String(e))}function Zs(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:zs(e)}function Xs(e,t){let n=0;const{shapeFlag:o}=e;if(null==t)t=null;else if(m(t))n=16;else if("object"==typeof t){if(65&o){const n=t.default;return void(n&&(n._c&&(n._d=!1),Xs(e,n()),n._c&&(n._d=!0)))}{n=32;const o=t._;o||js in t?3===o&&Mn&&(1===Mn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=Mn}}else _(t)?(t={default:t,_ctx:Mn},n=32):(t=String(t),64&o?(n=16,t=[Ks(t)]):n=8);e.children=t,e.shapeFlag|=n}function Qs(...e){const t={};for(let n=0;nri||Mn;let ii,li,ci="__VUE_INSTANCE_SETTERS__";(li=q()[ci])||(li=q()[ci]=[]),li.push((e=>ri=e)),ii=e=>{li.length>1?li.forEach((t=>t(e))):li[0](e)};const ai=e=>{ii(e),e.scope.on()},ui=()=>{ri&&ri.scope.off(),ii(null)};function pi(e){return 4&e.vnode.shapeFlag}let fi,di,hi=!1;function gi(e,t=!1){hi=t;const{props:n,children:o}=e.vnode,r=pi(e);!function(e,t,n,o=!1){const r={},s={};V(s,js,1),e.propsDefaults=Object.create(null),zr(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=o?r:Tt(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,n,r,t),rs(e,o);const s=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Mt(new Proxy(e.ctx,ur));const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?_i(e):null;ai(e),Ie();const r=cn(o,e,0,[e.props,n]);if(Oe(),ui(),w(r)){if(r.then(ui,ui),t)return r.then((n=>{mi(e,n,t)})).catch((t=>{un(t,e,0)}));e.asyncDep=r}else mi(e,r,t)}else bi(e,t)}(e,t):void 0;return hi=!1,s}function mi(e,t,n){_(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:x(t)&&(e.setupState=Yt(t)),bi(e,n)}function vi(e){fi=e,di=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,pr))}}const yi=()=>!fi;function bi(e,t,n){const o=e.type;if(!e.render){if(!t&&fi&&!o.render){const t=o.template||Ar(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:i}=o,l=f(f({isCustomElement:n,delimiters:s},r),i);o.render=fi(t,l)}}e.render=o.render||l,di&&di(e)}ai(e),Ie(),function(e){const t=Ar(e),n=e.proxy,o=e.ctx;Fr=!1,t.beforeCreate&&Rr(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:i,watch:c,provide:a,inject:u,created:p,beforeMount:f,mounted:d,beforeUpdate:h,updated:g,activated:v,deactivated:y,beforeDestroy:b,beforeUnmount:S,destroyed:C,unmounted:w,render:E,renderTracked:k,renderTriggered:T,errorCaptured:F,serverPrefetch:R,expose:P,inheritAttrs:A,components:I,directives:O,filters:N}=t;if(u&&function(e,t,n=l){m(e)&&(e=Dr(e));for(const n in e){const o=e[n];let r;r=x(o)?"default"in o?Wr(o.from||n,o.default,!0):Wr(o.from||n):Wr(o),Vt(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(u,o,null),i)for(const e in i){const t=i[e];_(t)&&(o[e]=t.bind(n))}if(r){const t=r.call(n,n);x(t)&&(e.data=kt(t))}if(Fr=!0,s)for(const e in s){const t=s[e],r=_(t)?t.bind(n,n):_(t.get)?t.get.bind(n,n):l,i=!_(t)&&_(t.set)?t.set.bind(n):l,c=xi({get:r,set:i});Object.defineProperty(o,e,{enumerable:!0,configurable:!0,get:()=>c.value,set:e=>c.value=e})}if(c)for(const e in c)Pr(c[e],o,n,e);if(a){const e=_(a)?a.call(n):a;Reflect.ownKeys(e).forEach((t=>{Hr(t,e[t])}))}function D(e,t){m(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(p&&Rr(p,e,"c"),D($o,f),D(Bo,d),D(jo,h),D(Vo,g),D(Po,v),D(Ao,y),D(Ko,F),D(zo,k),D(qo,T),D(Uo,S),D(Ho,w),D(Wo,R),m(P))if(P.length){const t=e.exposed||(e.exposed={});P.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});E&&e.render===l&&(e.render=E),null!=A&&(e.inheritAttrs=A),I&&(e.components=I),O&&(e.directives=O)}(e),Oe(),ui()}function _i(e){return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(Ne(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Si(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Yt(Mt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in cr?cr[n](e):void 0,has:(e,t)=>t in e||t in cr}))}function Ci(e,t=!0){return _(e)?e.displayName||e.name:e.name||t&&e.__name}const xi=(e,t)=>function(e,t,n=!1){let o,r;const s=_(e);return s?(o=e,r=l):(o=e.get,r=e.set),new rn(o,r,s||!r,n)}(e,0,hi);function wi(e,t,n){const o=arguments.length;return 2===o?x(t)&&!m(t)?Ls(t)?Ws(e,null,[t]):Ws(e,t):Ws(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&Ls(n)&&(n=[n]),Ws(e,t,n))}const Ei=Symbol.for("v-scx"),ki=()=>Wr(Ei);function Ti(){}function Fi(e,t,n,o){const r=n[o];if(r&&Ri(r,e))return r;const s=t();return s.memo=e.slice(),n[o]=s}function Ri(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&Fs&&Fs.push(e),!0}const Pi="3.3.4",Ai={createComponentInstance:oi,setupComponent:gi,renderComponentRoot:Hn,setCurrentRenderingInstance:$n,isVNode:Ls,normalizeVNode:Ys},Ii=null,Oi=null,Ni="undefined"!=typeof document?document:null,Di=Ni&&Ni.createElement("template"),Mi={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t?Ni.createElementNS("http://www.w3.org/2000/svg",e):Ni.createElement(e,n?{is:n}:void 0);return"select"===e&&o&&null!=o.multiple&&r.setAttribute("multiple",o.multiple),r},createText:e=>Ni.createTextNode(e),createComment:e=>Ni.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ni.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,s){const i=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{Di.innerHTML=o?`${e}`:e;const r=Di.content;if(o){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Li=/\s*!important$/;function $i(e,t,n){if(m(n))n.forEach((n=>$i(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=ji[t];if(n)return n;let o=N(t);if("filter"!==o&&o in e)return ji[t]=o;o=L(o);for(let n=0;nWi||(qi.then((()=>Wi=0)),Wi=Date.now()),Ki=/^on[a-z]/;function Gi(e,t){const n=xo(e);class o extends Zi{constructor(e){super(n,e,t)}}return o.def=n,o}const Ji=e=>Gi(e,Ql),Yi="undefined"!=typeof HTMLElement?HTMLElement:class{};class Zi extends Yi{constructor(e,t={},n){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&n?n(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,_n((()=>{this._connected||(Xl(null,this.shadowRoot),this._instance=null)}))}_resolveDef(){this._resolved=!0;for(let e=0;e{for(const t of e)this._setAttr(t.attributeName)})).observe(this,{attributes:!0});const e=(e,t=!1)=>{const{props:n,styles:o}=e;let r;if(n&&!m(n))for(const e in n){const t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=H(this._props[e])),(r||(r=Object.create(null)))[N(e)]=!0)}this._numberProps=r,t&&this._resolveProps(e),this._applyStyles(o),this._update()},t=this._def.__asyncLoader;t?t().then((t=>e(t,!0))):e(this._def)}_resolveProps(e){const{props:t}=e,n=m(t)?t:Object.keys(t||{});for(const e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e],!0,!1);for(const e of n.map(N))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t)}})}_setAttr(e){let t=this.getAttribute(e);const n=N(e);this._numberProps&&this._numberProps[n]&&(t=H(t)),this._setProp(n,t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,o=!0){t!==this._props[e]&&(this._props[e]=t,o&&this._instance&&this._update(),n&&(!0===t?this.setAttribute(M(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(M(e),t+""):t||this.removeAttribute(M(e))))}_update(){Xl(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Ws(this._def,f({},this._props));return this._instance||(e.ce=e=>{this._instance=e,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,{detail:t}))};e.emit=(e,...n)=>{t(e,n),M(e)!==e&&t(M(e),n)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof Zi){e.parent=n._instance,e.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach((e=>{const t=document.createElement("style");t.textContent=e,this.shadowRoot.appendChild(t)}))}}function Xi(e="$style"){{const t=si();if(!t)return s;const n=t.type.__cssModules;if(!n)return s;return n[e]||s}}function Qi(e){const t=si();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach((e=>tl(e,n)))},o=()=>{const o=e(t.proxy);el(t.subTree,o),n(o)};no(o),Bo((()=>{const e=new MutationObserver(o);e.observe(t.subTree.el.parentNode,{childList:!0}),Ho((()=>e.disconnect()))}))}function el(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{el(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)tl(e.el,t);else if(e.type===xs)e.children.forEach((e=>el(e,t)));else if(e.type===ks){let{el:n,anchor:o}=e;for(;n&&(tl(n,t),n!==o);)n=n.nextSibling}}function tl(e,t){if(1===e.nodeType){const n=e.style;for(const e in t)n.setProperty(`--${e}`,t[e])}}const nl="transition",ol="animation",rl=(e,{slots:t})=>wi(mo,al(e),t);rl.displayName="Transition";const sl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},il=rl.props=f({},go,sl),ll=(e,t=[])=>{m(e)?e.forEach((e=>e(...t))):e&&e(...t)},cl=e=>!!e&&(m(e)?e.some((e=>e.length>1)):e.length>1);function al(e){const t={};for(const n in e)n in sl||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:o,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=s,appearActiveClass:a=i,appearToClass:u=l,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,g=function(e){if(null==e)return null;if(x(e))return[ul(e.enter),ul(e.leave)];{const t=ul(e);return[t,t]}}(r),m=g&&g[0],v=g&&g[1],{onBeforeEnter:y,onEnter:b,onEnterCancelled:_,onLeave:S,onLeaveCancelled:C,onBeforeAppear:w=y,onAppear:E=b,onAppearCancelled:k=_}=t,T=(e,t,n)=>{fl(e,t?u:l),fl(e,t?a:i),n&&n()},F=(e,t)=>{e._isLeaving=!1,fl(e,p),fl(e,h),fl(e,d),t&&t()},R=e=>(t,n)=>{const r=e?E:b,i=()=>T(t,e,n);ll(r,[t,i]),dl((()=>{fl(t,e?c:s),pl(t,e?u:l),cl(r)||gl(t,o,m,i)}))};return f(t,{onBeforeEnter(e){ll(y,[e]),pl(e,s),pl(e,i)},onBeforeAppear(e){ll(w,[e]),pl(e,c),pl(e,a)},onEnter:R(!1),onAppear:R(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>F(e,t);pl(e,p),bl(),pl(e,d),dl((()=>{e._isLeaving&&(fl(e,p),pl(e,h),cl(S)||gl(e,o,v,n))})),ll(S,[e,n])},onEnterCancelled(e){T(e,!1),ll(_,[e])},onAppearCancelled(e){T(e,!0),ll(k,[e])},onLeaveCancelled(e){F(e),ll(C,[e])}})}function ul(e){return H(e)}function pl(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function fl(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function dl(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let hl=0;function gl(e,t,n,o){const r=e._endId=++hl,s=()=>{r===e._endId&&o()};if(n)return setTimeout(s,n);const{type:i,timeout:l,propCount:c}=ml(e,t);if(!i)return o();const a=i+"end";let u=0;const p=()=>{e.removeEventListener(a,f),s()},f=t=>{t.target===e&&++u>=c&&p()};setTimeout((()=>{u(n[e]||"").split(", "),r=o(`${nl}Delay`),s=o(`${nl}Duration`),i=vl(r,s),l=o(`${ol}Delay`),c=o(`${ol}Duration`),a=vl(l,c);let u=null,p=0,f=0;return t===nl?i>0&&(u=nl,p=i,f=s.length):t===ol?a>0&&(u=ol,p=a,f=c.length):(p=Math.max(i,a),u=p>0?i>a?nl:ol:null,f=u?u===nl?s.length:c.length:0),{type:u,timeout:p,propCount:f,hasTransform:u===nl&&/\b(transform|all)(,|$)/.test(o(`${nl}Property`).toString())}}function vl(e,t){for(;e.lengthyl(t)+yl(e[n]))))}function yl(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function bl(){return document.body.offsetHeight}const _l=new WeakMap,Sl=new WeakMap,Cl={name:"TransitionGroup",props:f({},il,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=si(),o=fo();let r,s;return Vo((()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const o=e.cloneNode();e._vtc&&e._vtc.forEach((e=>{e.split(/\s+/).forEach((e=>e&&o.classList.remove(e)))})),n.split(/\s+/).forEach((e=>e&&o.classList.add(e))),o.style.display="none";const r=1===t.nodeType?t:t.parentNode;r.appendChild(o);const{hasTransform:s}=ml(o);return r.removeChild(o),s}(r[0].el,n.vnode.el,t))return;r.forEach(xl),r.forEach(wl);const o=r.filter(El);bl(),o.forEach((e=>{const n=e.el,o=n.style;pl(n,t),o.transform=o.webkitTransform=o.transitionDuration="";const r=n._moveCb=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n._moveCb=null,fl(n,t))};n.addEventListener("transitionend",r)}))})),()=>{const i=Dt(e),l=al(i);let c=i.tag||xs;r=s,s=t.default?Co(t.default()):[];for(let e=0;e{const t=e.props["onUpdate:modelValue"]||!1;return m(t)?e=>j(t,e):t};function Tl(e){e.target.composing=!0}function Fl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Rl={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e._assign=kl(r);const s=o||r.props&&"number"===r.props.type;Ui(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n&&(o=o.trim()),s&&(o=U(o)),e._assign(o)})),n&&Ui(e,"change",(()=>{e.value=e.value.trim()})),t||(Ui(e,"compositionstart",Tl),Ui(e,"compositionend",Fl),Ui(e,"change",Fl))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:o,number:r}},s){if(e._assign=kl(s),e.composing)return;if(document.activeElement===e&&"range"!==e.type){if(n)return;if(o&&e.value.trim()===t)return;if((r||"number"===e.type)&&U(e.value)===t)return}const i=null==t?"":t;e.value!==i&&(e.value=i)}},Pl={deep:!0,created(e,t,n){e._assign=kl(n),Ui(e,"change",(()=>{const t=e._modelValue,n=Dl(e),o=e.checked,r=e._assign;if(m(t)){const e=le(t,n),s=-1!==e;if(o&&!s)r(t.concat(n));else if(!o&&s){const n=[...t];n.splice(e,1),r(n)}}else if(y(t)){const e=new Set(t);o?e.add(n):e.delete(n),r(e)}else r(Ml(e,o))}))},mounted:Al,beforeUpdate(e,t,n){e._assign=kl(n),Al(e,t,n)}};function Al(e,{value:t,oldValue:n},o){e._modelValue=t,m(t)?e.checked=le(t,o.props.value)>-1:y(t)?e.checked=t.has(o.props.value):t!==n&&(e.checked=ie(t,Ml(e,!0)))}const Il={created(e,{value:t},n){e.checked=ie(t,n.props.value),e._assign=kl(n),Ui(e,"change",(()=>{e._assign(Dl(e))}))},beforeUpdate(e,{value:t,oldValue:n},o){e._assign=kl(o),t!==n&&(e.checked=ie(t,o.props.value))}},Ol={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const r=y(t);Ui(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?U(Dl(e)):Dl(e)));e._assign(e.multiple?r?new Set(t):t:t[0])})),e._assign=kl(o)},mounted(e,{value:t}){Nl(e,t)},beforeUpdate(e,t,n){e._assign=kl(n)},updated(e,{value:t}){Nl(e,t)}};function Nl(e,t){const n=e.multiple;if(!n||m(t)||y(t)){for(let o=0,r=e.options.length;o-1:r.selected=t.has(s);else if(ie(Dl(r),t))return void(e.selectedIndex!==o&&(e.selectedIndex=o))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function Dl(e){return"_value"in e?e._value:e.value}function Ml(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ll={created(e,t,n){Bl(e,t,n,null,"created")},mounted(e,t,n){Bl(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Bl(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Bl(e,t,n,o,"updated")}};function $l(e,t){switch(e){case"SELECT":return Ol;case"TEXTAREA":return Rl;default:switch(t){case"checkbox":return Pl;case"radio":return Il;default:return Rl}}}function Bl(e,t,n,o,r){const s=$l(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,o)}const jl=["ctrl","shift","alt","meta"],Vl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>jl.some((n=>e[`${n}Key`]&&!t.includes(n)))},Ul=(e,t)=>(n,...o)=>{for(let e=0;en=>{if(!("key"in n))return;const o=M(n.key);return t.some((e=>e===o||Hl[e]===o))?e(n):void 0},ql={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):zl(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),zl(e,!0),o.enter(e)):o.leave(e,(()=>{zl(e,!1)})):zl(e,t))},beforeUnmount(e,{value:t}){zl(e,t)}};function zl(e,t){e.style.display=t?e._vod:"none"}const Kl=f({patchProp:(e,t,n,o,r=!1,s,i,l,c)=>{"class"===t?function(e,t,n){const o=e._vtc;o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,r):"style"===t?function(e,t,n){const o=e.style,r=S(n);if(n&&!r){if(t&&!S(t))for(const e in t)null==n[e]&&$i(o,e,"");for(const e in n)$i(o,e,n[e])}else{const s=o.display;r?t!==n&&(o.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(o.display=s)}}(e,n,o):u(t)?p(t)||function(e,t,n,o,r=null){const s=e._vei||(e._vei={}),i=s[t];if(o&&i)i.value=o;else{const[n,l]=function(e){let t;if(Hi.test(e)){let n;for(t={};n=e.match(Hi);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):M(e.slice(2)),t]}(t);if(o){const i=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();an(function(e,t){if(m(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=zi(),n}(o,r);Ui(e,n,i,l)}else i&&(function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,i,l),s[t]=void 0)}}(e,t,0,o,i):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){return o?"innerHTML"===t||"textContent"===t||!!(t in e&&Ki.test(t)&&_(n)):"spellcheck"!==t&&"draggable"!==t&&"translate"!==t&&("form"!==t&&(("list"!==t||"INPUT"!==e.tagName)&&(("type"!==t||"TEXTAREA"!==e.tagName)&&((!Ki.test(t)||!S(n))&&t in e))))}(e,t,o,r))?function(e,t,n,o,r,s,i){if("innerHTML"===t||"textContent"===t)return o&&i(o,r,s),void(e[t]=null==n?"":n);const l=e.tagName;if("value"===t&&"PROGRESS"!==l&&!l.includes("-")){e._value=n;const o=null==n?"":n;return("OPTION"===l?e.getAttribute("value"):e.value)!==o&&(e.value=o),void(null==n&&e.removeAttribute(t))}let c=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=se(n):null==n&&"string"===o?(n="",c=!0):"number"===o&&(n=0,c=!0)}try{e[t]=n}catch(e){}c&&e.removeAttribute(t)}(e,t,o,s,i,l,c):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o,r){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Vi,t.slice(6,t.length)):e.setAttributeNS(Vi,t,n);else{const o=re(t);null==n||o&&!se(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,r))}},Mi);let Gl,Jl=!1;function Yl(){return Gl||(Gl=fs(Kl))}function Zl(){return Gl=Jl?Gl:ds(Kl),Jl=!0,Gl}const Xl=(...e)=>{Yl().render(...e)},Ql=(...e)=>{Zl().hydrate(...e)},ec=(...e)=>{const t=Yl().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=nc(e);if(!o)return;const r=t._component;_(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const s=n(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},t},tc=(...e)=>{const t=Zl().createApp(...e),{mount:n}=t;return t.mount=e=>{const t=nc(e);if(t)return n(t,!0,t instanceof SVGElement)},t};function nc(e){return S(e)?document.querySelector(e):e}let oc=!1;const rc=()=>{oc||(oc=!0,Rl.getSSRProps=({value:e})=>({value:e}),Il.getSSRProps=({value:e},t)=>{if(t.props&&ie(t.props.value,e))return{checked:!0}},Pl.getSSRProps=({value:e},t)=>{if(m(e)){if(t.props&&le(e,t.props.value)>-1)return{checked:!0}}else if(y(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Ll.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=$l(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0},ql.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})};function sc(e){throw e}function ic(e){}function lc(e,t,n,o){const r=new SyntaxError(String(e));return r.code=e,r.loc=t,r}const cc=Symbol(""),ac=Symbol(""),uc=Symbol(""),pc=Symbol(""),fc=Symbol(""),dc=Symbol(""),hc=Symbol(""),gc=Symbol(""),mc=Symbol(""),vc=Symbol(""),yc=Symbol(""),bc=Symbol(""),_c=Symbol(""),Sc=Symbol(""),Cc=Symbol(""),xc=Symbol(""),wc=Symbol(""),Ec=Symbol(""),kc=Symbol(""),Tc=Symbol(""),Fc=Symbol(""),Rc=Symbol(""),Pc=Symbol(""),Ac=Symbol(""),Ic=Symbol(""),Oc=Symbol(""),Nc=Symbol(""),Dc=Symbol(""),Mc=Symbol(""),Lc=Symbol(""),$c=Symbol(""),Bc=Symbol(""),jc=Symbol(""),Vc=Symbol(""),Uc=Symbol(""),Hc=Symbol(""),Wc=Symbol(""),qc=Symbol(""),zc=Symbol(""),Kc={[cc]:"Fragment",[ac]:"Teleport",[uc]:"Suspense",[pc]:"KeepAlive",[fc]:"BaseTransition",[dc]:"openBlock",[hc]:"createBlock",[gc]:"createElementBlock",[mc]:"createVNode",[vc]:"createElementVNode",[yc]:"createCommentVNode",[bc]:"createTextVNode",[_c]:"createStaticVNode",[Sc]:"resolveComponent",[Cc]:"resolveDynamicComponent",[xc]:"resolveDirective",[wc]:"resolveFilter",[Ec]:"withDirectives",[kc]:"renderList",[Tc]:"renderSlot",[Fc]:"createSlots",[Rc]:"toDisplayString",[Pc]:"mergeProps",[Ac]:"normalizeClass",[Ic]:"normalizeStyle",[Oc]:"normalizeProps",[Nc]:"guardReactiveProps",[Dc]:"toHandlers",[Mc]:"camelize",[Lc]:"capitalize",[$c]:"toHandlerKey",[Bc]:"setBlockTracking",[jc]:"pushScopeId",[Vc]:"popScopeId",[Uc]:"withCtx",[Hc]:"unref",[Wc]:"isRef",[qc]:"withMemo",[zc]:"isMemoSame"},Gc={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function Jc(e,t,n,o,r,s,i,l=!1,c=!1,a=!1,u=Gc){return e&&(l?(e.helper(dc),e.helper(sa(e.inSSR,a))):e.helper(ra(e.inSSR,a)),i&&e.helper(Ec)),{type:13,tag:t,props:n,children:o,patchFlag:r,dynamicProps:s,directives:i,isBlock:l,disableTracking:c,isComponent:a,loc:u}}function Yc(e,t=Gc){return{type:17,loc:t,elements:e}}function Zc(e,t=Gc){return{type:15,loc:t,properties:e}}function Xc(e,t){return{type:16,loc:Gc,key:S(e)?Qc(e,!0):e,value:t}}function Qc(e,t=!1,n=Gc,o=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:o}}function ea(e,t=Gc){return{type:8,loc:t,children:e}}function ta(e,t=[],n=Gc){return{type:14,loc:n,callee:e,arguments:t}}function na(e,t=void 0,n=!1,o=!1,r=Gc){return{type:18,params:e,returns:t,newline:n,isSlot:o,loc:r}}function oa(e,t,n,o=!0){return{type:19,test:e,consequent:t,alternate:n,newline:o,loc:Gc}}function ra(e,t){return e||t?mc:vc}function sa(e,t){return e||t?hc:gc}function ia(e,{helper:t,removeHelper:n,inSSR:o}){e.isBlock||(e.isBlock=!0,n(ra(o,e.isComponent)),t(dc),t(sa(o,e.isComponent)))}const la=e=>4===e.type&&e.isStatic,ca=(e,t)=>e===t||e===M(t);function aa(e){return ca(e,"Teleport")?ac:ca(e,"Suspense")?uc:ca(e,"KeepAlive")?pc:ca(e,"BaseTransition")?fc:void 0}const ua=/^\d|[^\$\w]/,pa=e=>!ua.test(e),fa=/[A-Za-z_$\xA0-\uFFFF]/,da=/[\.\?\w$\xA0-\uFFFF]/,ha=/\s+[.[]\s*|\s*[.[]\s+/g,ga=e=>{e=e.trim().replace(ha,(e=>e.trim()));let t=0,n=[],o=0,r=0,s=null;for(let i=0;i4===e.key.type&&e.key.content===o))}return n}function Pa(e,t){return`_${t}_${e.replace(/[^\w]/g,((t,n)=>"-"===t?"_":e.charCodeAt(n).toString()))}`}function Aa(e,t){const n=t.options?t.options.compatConfig:t.compatConfig,o=n&&n[e];return"MODE"===e?o||3:o}function Ia(e,t){const n=Aa("MODE",t),o=Aa(e,t);return 3===n?!0===o:!1!==o}function Oa(e,t,n,...o){return Ia(e,t)}const Na=/&(gt|lt|amp|apos|quot);/g,Da={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},Ma={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:c,isPreTag:c,isCustomElement:c,decodeEntities:e=>e.replace(Na,((e,t)=>Da[t])),onError:sc,onWarn:ic,comments:!1};function La(e,t,n){const o=Qa(n),r=o?o.ns:0,s=[];for(;!su(e,t,n);){const i=e.source;let l;if(0===t||1===t)if(!e.inVPre&&eu(i,e.options.delimiters[0]))l=Ga(e,t);else if(0===t&&"<"===i[0])if(1===i.length)ru(e,5,1);else if("!"===i[1])eu(i,"\x3c!--")?l=ja(e):eu(i,""===i[2]){ru(e,14,2),tu(e,3);continue}if(/[a-z]/i.test(i[2])){ru(e,23),qa(e,Ha.End,o);continue}ru(e,12,2),l=Va(e)}else/[a-z]/i.test(i[1])?(l=Ua(e,n),Ia("COMPILER_NATIVE_TEMPLATE",e)&&l&&"template"===l.tag&&!l.props.some((e=>7===e.type&&Wa(e.name)))&&(l=l.children)):"?"===i[1]?(ru(e,21,1),l=Va(e)):ru(e,12,1);if(l||(l=Ja(e,t)),m(l))for(let e=0;e/.exec(e.source);if(o){o.index<=3&&ru(e,0),o[1]&&ru(e,10),n=e.source.slice(4,o.index);const t=e.source.slice(0,o.index);let r=1,s=0;for(;-1!==(s=t.indexOf("\x3c!--",r));)tu(e,s-r+1),s+4");return-1===r?(o=e.source.slice(n),tu(e,e.source.length)):(o=e.source.slice(n,r),tu(e,r+1)),{type:3,content:o,loc:Xa(e,t)}}function Ua(e,t){const n=e.inPre,o=e.inVPre,r=Qa(t),s=qa(e,Ha.Start,r),i=e.inPre&&!n,l=e.inVPre&&!o;if(s.isSelfClosing||e.options.isVoidTag(s.tag))return i&&(e.inPre=!1),l&&(e.inVPre=!1),s;t.push(s);const c=e.options.getTextMode(s,r),a=La(e,c,t);t.pop();{const t=s.props.find((e=>6===e.type&&"inline-template"===e.name));if(t&&Oa("COMPILER_INLINE_TEMPLATE",e,t.loc)){const n=Xa(e,s.loc.end);t.value={type:2,content:n.source,loc:n}}}if(s.children=a,iu(e.source,s.tag))qa(e,Ha.End,r);else if(ru(e,24,0,s.loc.start),0===e.source.length&&"script"===s.tag.toLowerCase()){const t=a[0];t&&eu(t.loc.source,"\x3c!--")&&ru(e,8)}return s.loc=Xa(e,s.loc.start),i&&(e.inPre=!1),l&&(e.inVPre=!1),s}var Ha=(e=>(e[e.Start=0]="Start",e[e.End=1]="End",e))(Ha||{});const Wa=r("if,else,else-if,for,slot");function qa(e,t,n){const o=Za(e),r=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),s=r[1],i=e.options.getNamespace(s,n);tu(e,r[0].length),nu(e);const l=Za(e),c=e.source;e.options.isPreTag(s)&&(e.inPre=!0);let a=za(e,t);0===t&&!e.inVPre&&a.some((e=>7===e.type&&"pre"===e.name))&&(e.inVPre=!0,f(e,l),e.source=c,a=za(e,t).filter((e=>"v-pre"!==e.name)));let u=!1;if(0===e.source.length?ru(e,9):(u=eu(e.source,"/>"),1===t&&u&&ru(e,4),tu(e,u?2:1)),1===t)return;let p=0;return e.inVPre||("slot"===s?p=2:"template"===s?a.some((e=>7===e.type&&Wa(e.name)))&&(p=3):function(e,t,n){const o=n.options;if(o.isCustomElement(e))return!1;if("component"===e||/^[A-Z]/.test(e)||aa(e)||o.isBuiltInComponent&&o.isBuiltInComponent(e)||o.isNativeTag&&!o.isNativeTag(e))return!0;for(let e=0;e0&&!eu(e.source,">")&&!eu(e.source,"/>");){if(eu(e.source,"/")){ru(e,22),tu(e,1),nu(e);continue}1===t&&ru(e,3);const r=Ka(e,o);6===r.type&&r.value&&"class"===r.name&&(r.value.content=r.value.content.replace(/\s+/g," ").trim()),0===t&&n.push(r),/^[^\t\r\n\f />]/.test(e.source)&&ru(e,15),nu(e)}return n}function Ka(e,t){var n;const o=Za(e),r=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(r)&&ru(e,2),t.add(r),"="===r[0]&&ru(e,19);{const t=/["'<]/g;let n;for(;n=t.exec(r);)ru(e,17,n.index)}let s;tu(e,r.length),/^[\t\r\n\f ]*=/.test(e.source)&&(nu(e),tu(e,1),nu(e),s=function(e){const t=Za(e);let n;const o=e.source[0],r='"'===o||"'"===o;if(r){tu(e,1);const t=e.source.indexOf(o);-1===t?n=Ya(e,e.source.length,4):(n=Ya(e,t,4),tu(e,1))}else{const t=/^[^\t\r\n\f >]+/.exec(e.source);if(!t)return;const o=/["'<=`]/g;let r;for(;r=o.exec(t[0]);)ru(e,18,r.index);n=Ya(e,t[0].length,4)}return{content:n,isQuoted:r,loc:Xa(e,t)}}(e),s||ru(e,13));const i=Xa(e,o);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(r)){const t=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(r);let l,c=eu(r,"."),a=t[1]||(c||eu(r,":")?"bind":eu(r,"@")?"on":"slot");if(t[2]){const s="slot"===a,i=r.lastIndexOf(t[2],r.length-((null==(n=t[3])?void 0:n.length)||0)),c=Xa(e,ou(e,o,i),ou(e,o,i+t[2].length+(s&&t[3]||"").length));let u=t[2],p=!0;u.startsWith("[")?(p=!1,u.endsWith("]")?u=u.slice(1,u.length-1):(ru(e,27),u=u.slice(1))):s&&(u+=t[3]||""),l={type:4,content:u,isStatic:p,constType:p?3:0,loc:c}}if(s&&s.isQuoted){const e=s.loc;e.start.offset++,e.start.column++,e.end=va(e.start,s.content),e.source=e.source.slice(1,-1)}const u=t[3]?t[3].slice(1).split("."):[];return c&&u.push("prop"),"bind"===a&&l&&u.includes("sync")&&Oa("COMPILER_V_BIND_SYNC",e,0,l.loc.source)&&(a="model",u.splice(u.indexOf("sync"),1)),{type:7,name:a,exp:s&&{type:4,content:s.content,isStatic:!1,constType:0,loc:s.loc},arg:l,modifiers:u,loc:i}}return!e.inVPre&&eu(r,"v-")&&ru(e,26),{type:6,name:r,value:s&&{type:2,content:s.content,loc:s.loc},loc:i}}function Ga(e,t){const[n,o]=e.options.delimiters,r=e.source.indexOf(o,n.length);if(-1===r)return void ru(e,25);const s=Za(e);tu(e,n.length);const i=Za(e),l=Za(e),c=r-n.length,a=e.source.slice(0,c),u=Ya(e,c,t),p=u.trim(),f=u.indexOf(p);return f>0&&ya(i,a,f),ya(l,a,c-(u.length-p.length-f)),tu(e,o.length),{type:5,content:{type:4,isStatic:!1,constType:0,content:p,loc:Xa(e,i,l)},loc:Xa(e,s)}}function Ja(e,t){const n=3===t?["]]>"]:["<",e.options.delimiters[0]];let o=e.source.length;for(let t=0;tr&&(o=r)}const r=Za(e);return{type:2,content:Ya(e,o,t),loc:Xa(e,r)}}function Ya(e,t,n){const o=e.source.slice(0,t);return tu(e,t),2!==n&&3!==n&&o.includes("&")?e.options.decodeEntities(o,4===n):o}function Za(e){const{column:t,line:n,offset:o}=e;return{column:t,line:n,offset:o}}function Xa(e,t,n){return{start:t,end:n=n||Za(e),source:e.originalSource.slice(t.offset,n.offset)}}function Qa(e){return e[e.length-1]}function eu(e,t){return e.startsWith(t)}function tu(e,t){const{source:n}=e;ya(e,n,t),e.source=n.slice(t)}function nu(e){const t=/^[\t\r\n\f ]+/.exec(e.source);t&&tu(e,t[0].length)}function ou(e,t,n){return va(t,e.originalSource.slice(t.offset,n),n)}function ru(e,t,n,o=Za(e)){n&&(o.offset+=n,o.column+=n),e.options.onError(lc(t,{start:o,end:o,source:""}))}function su(e,t,n){const o=e.source;switch(t){case 0:if(eu(o,"=0;--e)if(iu(o,n[e].tag))return!0;break;case 1:case 2:{const e=Qa(n);if(e&&iu(o,e.tag))return!0;break}case 3:if(eu(o,"]]>"))return!0}return!o}function iu(e,t){return eu(e,"]/.test(e[2+t.length]||">")}function lu(e,t){au(e,t,cu(e,e.children[0]))}function cu(e,t){const{children:n}=e;return 1===n.length&&1===t.type&&!Ea(t)}function au(e,t,n=!1){const{children:o}=e,r=o.length;let s=0;for(let e=0;e0){if(e>=2){r.codegenNode.patchFlag="-1",r.codegenNode=t.hoist(r.codegenNode),s++;continue}}else{const e=r.codegenNode;if(13===e.type){const n=gu(e);if((!n||512===n||1===n)&&du(r,t)>=2){const n=hu(r);n&&(e.props=t.hoist(n))}e.dynamicProps&&(e.dynamicProps=t.hoist(e.dynamicProps))}}}if(1===r.type){const e=1===r.tagType;e&&t.scopes.vSlot++,au(r,t),e&&t.scopes.vSlot--}else if(11===r.type)au(r,t,1===r.children.length);else if(9===r.type)for(let e=0;e1)for(let r=0;r`_${Kc[k.helper(e)]}`,replaceNode(e){k.parent.children[k.childIndex]=k.currentNode=e},removeNode(e){const t=k.parent.children,n=e?t.indexOf(e):k.currentNode?k.childIndex:-1;e&&e!==k.currentNode?k.childIndex>n&&(k.childIndex--,k.onNodeRemoved()):(k.currentNode=null,k.onNodeRemoved()),k.parent.children.splice(n,1)},onNodeRemoved:()=>{},addIdentifiers(e){},removeIdentifiers(e){},hoist(e){S(e)&&(e=Qc(e)),k.hoists.push(e);const t=Qc(`_hoisted_${k.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache:(e,t=!1)=>function(e,t,n=!1){return{type:20,index:e,value:t,isVNode:n,loc:Gc}}(k.cached++,e,t)};return k.filters=new Set,k}(e,t);vu(e,n),t.hoistStatic&&lu(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:o}=e;if(1===o.length){const n=o[0];if(cu(e,n)&&n.codegenNode){const o=n.codegenNode;13===o.type&&ia(o,t),e.codegenNode=o}else e.codegenNode=n}else if(o.length>1){let o=64;z[64],e.codegenNode=Jc(t,n(cc),void 0,e.children,o+"",void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.filters=[...n.filters]}function vu(e,t){t.currentNode=e;const{nodeTransforms:n}=t,o=[];for(let r=0;r{n--};for(;nt===e:t=>e.test(t);return(e,o)=>{if(1===e.type){const{props:r}=e;if(3===e.tagType&&r.some(xa))return;const s=[];for(let i=0;i`${Kc[e]}: _${Kc[e]}`;function Su(e,t={}){const n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:o=!1,filename:r="template.vue.html",scopeId:s=null,optimizeImports:i=!1,runtimeGlobalName:l="Vue",runtimeModuleName:c="vue",ssrRuntimeModuleName:a="vue/server-renderer",ssr:u=!1,isTS:p=!1,inSSR:f=!1}){const d={mode:t,prefixIdentifiers:n,sourceMap:o,filename:r,scopeId:s,optimizeImports:i,runtimeGlobalName:l,runtimeModuleName:c,ssrRuntimeModuleName:a,ssr:u,isTS:p,inSSR:f,source:e.loc.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${Kc[e]}`,push(e,t){d.code+=e},indent(){h(++d.indentLevel)},deindent(e=!1){e?--d.indentLevel:h(--d.indentLevel)},newline(){h(d.indentLevel)}};function h(e){d.push("\n"+" ".repeat(e))}return d}(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:o,push:r,prefixIdentifiers:s,indent:i,deindent:l,newline:c,scopeId:a,ssr:u}=n,p=Array.from(e.helpers),f=p.length>0,d=!s&&"module"!==o;if(function(e,t){const{ssr:n,prefixIdentifiers:o,push:r,newline:s,runtimeModuleName:i,runtimeGlobalName:l,ssrRuntimeModuleName:c}=t,a=l,u=Array.from(e.helpers);u.length>0&&(r(`const _Vue = ${a}\n`),e.hoists.length)&&r(`const { ${[mc,vc,yc,bc,_c].filter((e=>u.includes(e))).map(_u).join(", ")} } = _Vue\n`),function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:o,helper:r,scopeId:s,mode:i}=t;o();for(let r=0;r0)&&c()),e.directives.length&&(Cu(e.directives,"directive",n),e.temps>0&&c()),e.filters&&e.filters.length&&(c(),Cu(e.filters,"filter",n),c()),e.temps>0){r("let ");for(let t=0;t0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(r("\n"),c()),u||r("return "),e.codegenNode?Eu(e.codegenNode,n):r("null"),d&&(l(),r("}")),l(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function Cu(e,t,{helper:n,push:o,newline:r,isTS:s}){const i=n("filter"===t?wc:"component"===t?Sc:xc);for(let n=0;n3||!1;t.push("["),n&&t.indent(),wu(e,t,n),n&&t.deindent(),t.push("]")}function wu(e,t,n=!1,o=!0){const{push:r,newline:s}=t;for(let i=0;ie||"null"))}([s,i,l,c,a]),t),n(")"),p&&n(")"),u&&(n(", "),Eu(u,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:o,pure:r}=t,s=S(e.callee)?e.callee:o(e.callee);r&&n(bu),n(s+"(",e),wu(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:o,deindent:r,newline:s}=t,{properties:i}=e;if(!i.length)return void n("{}",e);const l=i.length>1||!1;n(l?"{":"{ "),l&&o();for(let e=0;e "),(c||l)&&(n("{"),o()),i?(c&&n("return "),m(i)?xu(i,t):Eu(i,t)):l&&Eu(l,t),(c||l)&&(r(),n("}")),a&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){const{test:n,consequent:o,alternate:r,newline:s}=e,{push:i,indent:l,deindent:c,newline:a}=t;if(4===n.type){const e=!pa(n.content);e&&i("("),ku(n,t),e&&i(")")}else i("("),Eu(n,t),i(")");s&&l(),t.indentLevel++,s||i(" "),i("? "),Eu(o,t),t.indentLevel--,s&&a(),s||i(" "),i(": ");const u=19===r.type;u||t.indentLevel++,Eu(r,t),u||t.indentLevel--,s&&c(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:o,indent:r,deindent:s,newline:i}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(r(),n(`${o(Bc)}(-1),`),i()),n(`_cache[${e.index}] = `),Eu(e.value,t),e.isVNode&&(n(","),i(),n(`${o(Bc)}(1),`),i(),n(`_cache[${e.index}]`),s()),n(")")}(e,t);break;case 21:wu(e.body,t,!0,!1)}}function ku(e,t){const{content:n,isStatic:o}=e;t.push(o?JSON.stringify(n):n,e)}function Tu(e,t){for(let n=0;nfunction(e,t,n,o){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const o=t.exp?t.exp.loc:e.loc;n.onError(lc(28,t.loc)),t.exp=Qc("true",!1,o)}if("if"===t.name){const r=Pu(e,t),s={type:9,loc:e.loc,branches:[r]};if(n.replaceNode(s),o)return o(s,r,!0)}else{const r=n.parent.children;let s=r.indexOf(e);for(;s-- >=-1;){const i=r[s];if(i&&3===i.type)n.removeNode(i);else{if(!i||2!==i.type||i.content.trim().length){if(i&&9===i.type){"else-if"===t.name&&void 0===i.branches[i.branches.length-1].condition&&n.onError(lc(30,e.loc)),n.removeNode();const r=Pu(e,t);i.branches.push(r);const s=o&&o(i,r,!1);vu(r,n),s&&s(),n.currentNode=null}else n.onError(lc(30,e.loc));break}n.removeNode(i)}}}}(e,t,n,((e,t,o)=>{const r=n.parent.children;let s=r.indexOf(e),i=0;for(;s-- >=0;){const e=r[s];e&&9===e.type&&(i+=e.branches.length)}return()=>{if(o)e.codegenNode=Au(t,i,n);else{const o=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);o.alternate=Au(t,i+e.branches.length-1,n)}}}))));function Pu(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!ba(e,"for")?e.children:[e],userKey:_a(e,"key"),isTemplateIf:n}}function Au(e,t,n){return e.condition?oa(e.condition,Iu(e,t,n),ta(n.helper(yc),['""',"true"])):Iu(e,t,n)}function Iu(e,t,n){const{helper:o}=n,r=Xc("key",Qc(`${t}`,!1,Gc,2)),{children:s}=e,i=s[0];if(1!==s.length||1!==i.type){if(1===s.length&&11===i.type){const e=i.codegenNode;return Fa(e,r,n),e}{let t=64;return z[64],Jc(n,o(cc),Zc([r]),s,t+"",void 0,void 0,!0,!1,!1,e.loc)}}{const e=i.codegenNode,t=14===(l=e).type&&l.callee===qc?l.arguments[1].returns:l;return 13===t.type&&ia(t,n),Fa(t,r,n),e}var l}const Ou=yu("for",((e,t,n)=>{const{helper:o,removeHelper:r}=n;return function(e,t,n,o){if(!t.exp)return void n.onError(lc(31,t.loc));const r=Lu(t.exp);if(!r)return void n.onError(lc(32,t.loc));const{addIdentifiers:s,removeIdentifiers:i,scopes:l}=n,{source:c,value:a,key:u,index:p}=r,f={type:11,loc:t.loc,source:c,valueAlias:a,keyAlias:u,objectIndexAlias:p,parseResult:r,children:wa(e)?e.children:[e]};n.replaceNode(f),l.vFor++;const d=o&&o(f);return()=>{l.vFor--,d&&d()}}(e,t,n,(t=>{const s=ta(o(kc),[t.source]),i=wa(e),l=ba(e,"memo"),c=_a(e,"key"),a=c&&(6===c.type?Qc(c.value.content,!0):c.exp),u=c?Xc("key",a):null,p=4===t.source.type&&t.source.constType>0,f=p?64:c?128:256;return t.codegenNode=Jc(n,o(cc),void 0,s,f+"",void 0,void 0,!0,!p,!1,e.loc),()=>{let c;const{children:f}=t,d=1!==f.length||1!==f[0].type,h=Ea(e)?e:i&&1===e.children.length&&Ea(e.children[0])?e.children[0]:null;if(h?(c=h.codegenNode,i&&u&&Fa(c,u,n)):d?c=Jc(n,o(cc),u?Zc([u]):void 0,e.children,"64",void 0,void 0,!0,void 0,!1):(c=f[0].codegenNode,i&&u&&Fa(c,u,n),c.isBlock!==!p&&(c.isBlock?(r(dc),r(sa(n.inSSR,c.isComponent))):r(ra(n.inSSR,c.isComponent))),c.isBlock=!p,c.isBlock?(o(dc),o(sa(n.inSSR,c.isComponent))):o(ra(n.inSSR,c.isComponent))),l){const e=na(Bu(t.parseResult,[Qc("_cached")]));e.body={type:21,body:[ea(["const _memo = (",l.exp,")"]),ea(["if (_cached",...a?[" && _cached.key === ",a]:[],` && ${n.helperString(zc)}(_cached, _memo)) return _cached`]),ea(["const _item = ",c]),Qc("_item.memo = _memo"),Qc("return _item")],loc:Gc},s.arguments.push(e,Qc("_cache"),Qc(String(n.cached++)))}else s.arguments.push(na(Bu(t.parseResult),c,!0))}}))})),Nu=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Du=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Mu=/^\(|\)$/g;function Lu(e,t){const n=e.loc,o=e.content,r=o.match(Nu);if(!r)return;const[,s,i]=r,l={source:$u(n,i.trim(),o.indexOf(i,s.length)),value:void 0,key:void 0,index:void 0};let c=s.trim().replace(Mu,"").trim();const a=s.indexOf(c),u=c.match(Du);if(u){c=c.replace(Du,"").trim();const e=u[1].trim();let t;if(e&&(t=o.indexOf(e,a+c.length),l.key=$u(n,e,t)),u[2]){const r=u[2].trim();r&&(l.index=$u(n,r,o.indexOf(r,l.key?t+e.length:a+c.length)))}}return c&&(l.value=$u(n,c,a)),l}function $u(e,t,n){return Qc(t,!1,ma(e,n,t.length))}function Bu({value:e,key:t,index:n},o=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map(((e,t)=>e||Qc("_".repeat(t+1),!1)))}([e,t,n,...o])}const ju=Qc("undefined",!1),Vu=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=ba(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},Uu=(e,t,n)=>na(e,t,!1,!0,t.length?t[0].loc:n);function Hu(e,t,n=Uu){t.helper(Uc);const{children:o,loc:r}=e,s=[],i=[];let l=t.scopes.vSlot>0||t.scopes.vFor>0;const c=ba(e,"slot",!0);if(c){const{arg:e,exp:t}=c;e&&!la(e)&&(l=!0),s.push(Xc(e||Qc("default",!0),n(t,o,r)))}let a=!1,u=!1;const p=[],f=new Set;let d=0;for(let e=0;e{const s=n(e,o,r);return t.compatConfig&&(s.isNonScopedSlot=!0),Xc("default",s)};a?p.length&&p.some((e=>zu(e)))&&(u?t.onError(lc(39,p[0].loc)):s.push(e(void 0,p))):s.push(e(void 0,o))}const h=l?2:qu(e.children)?3:1;let g=Zc(s.concat(Xc("_",Qc(h+"",!1))),r);return i.length&&(g=ta(t.helper(Fc),[g,Yc(i)])),{slots:g,hasDynamicSlots:l}}function Wu(e,t,n){const o=[Xc("name",e),Xc("fn",t)];return null!=n&&o.push(Xc("key",Qc(String(n),!0))),Zc(o)}function qu(e){for(let t=0;tfunction(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:o}=e,r=1===e.tagType;let s=r?function(e,t,n=!1){let{tag:o}=e;const r=Xu(o),s=_a(e,"is");if(s)if(r||Ia("COMPILER_IS_ON_ELEMENT",t)){const e=6===s.type?s.value&&Qc(s.value.content,!0):s.exp;if(e)return ta(t.helper(Cc),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(o=s.value.content.slice(4));const i=!r&&ba(e,"is");if(i&&i.exp)return ta(t.helper(Cc),[i.exp]);const l=aa(o)||t.isBuiltInComponent(o);return l?(n||t.helper(l),l):(t.helper(Sc),t.components.add(o),Pa(o,"component"))}(e,t):`"${n}"`;const i=x(s)&&s.callee===Cc;let l,c,a,u,p,f,d=0,h=i||s===ac||s===uc||!r&&("svg"===n||"foreignObject"===n);if(o.length>0){const n=Ju(e,t,void 0,r,i);l=n.props,d=n.patchFlag,p=n.dynamicPropNames;const o=n.directives;f=o&&o.length?Yc(o.map((e=>function(e,t){const n=[],o=Ku.get(e);o?n.push(t.helperString(o)):(t.helper(xc),t.directives.add(e.name),n.push(Pa(e.name,"directive")));const{loc:r}=e;if(e.exp&&n.push(e.exp),e.arg&&(e.exp||n.push("void 0"),n.push(e.arg)),Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=Qc("true",!1,r);n.push(Zc(e.modifiers.map((e=>Xc(e,t))),r))}return Yc(n,e.loc)}(e,t)))):void 0,n.shouldUseBlock&&(h=!0)}if(e.children.length>0)if(s===pc&&(h=!0,d|=1024),r&&s!==ac&&s!==pc){const{slots:n,hasDynamicSlots:o}=Hu(e,t);c=n,o&&(d|=1024)}else if(1===e.children.length&&s!==ac){const n=e.children[0],o=n.type,r=5===o||8===o;r&&0===uu(n,t)&&(d|=1),c=r||2===o?n:e.children}else c=e.children;0!==d&&(a=String(d),p&&p.length&&(u=function(e){let t="[";for(let n=0,o=e.length;n0;let h=!1,g=0,m=!1,v=!1,y=!1,b=!1,_=!1,S=!1;const x=[],w=e=>{a.length&&(p.push(Zc(Yu(a),l)),a=[]),e&&p.push(e)},E=({key:e,value:n})=>{if(la(e)){const s=e.content,i=u(s);if(!i||o&&!r||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||P(s)||(b=!0),i&&P(s)&&(S=!0),20===n.type||(4===n.type||8===n.type)&&uu(n,t)>0)return;"ref"===s?m=!0:"class"===s?v=!0:"style"===s?y=!0:"key"===s||x.includes(s)||x.push(s),!o||"class"!==s&&"style"!==s||x.includes(s)||x.push(s)}else _=!0};for(let r=0;r0&&a.push(Xc(Qc("ref_for",!0),Qc("true")))),"is"===n&&(Xu(i)||o&&o.content.startsWith("vue:")||Ia("COMPILER_IS_ON_ELEMENT",t)))continue;a.push(Xc(Qc(n,!0,ma(e,0,n.length)),Qc(o?o.content:"",r,o?o.loc:e)))}else{const{name:n,arg:r,exp:u,loc:g}=c,m="bind"===n,v="on"===n;if("slot"===n){o||t.onError(lc(40,g));continue}if("once"===n||"memo"===n)continue;if("is"===n||m&&Sa(r,"is")&&(Xu(i)||Ia("COMPILER_IS_ON_ELEMENT",t)))continue;if(v&&s)continue;if((m&&Sa(r,"key")||v&&d&&Sa(r,"vue:before-update"))&&(h=!0),m&&Sa(r,"ref")&&t.scopes.vFor>0&&a.push(Xc(Qc("ref_for",!0),Qc("true"))),!r&&(m||v)){if(_=!0,u)if(m){if(w(),Ia("COMPILER_V_BIND_OBJECT_ORDER",t)){p.unshift(u);continue}p.push(u)}else w({type:14,loc:g,callee:t.helper(Dc),arguments:o?[u]:[u,"true"]});else t.onError(lc(m?34:35,g));continue}const y=t.directiveTransforms[n];if(y){const{props:n,needRuntime:o}=y(c,e,t);!s&&n.forEach(E),v&&r&&!la(r)?w(Zc(n,l)):a.push(...n),o&&(f.push(c),C(o)&&Ku.set(c,o))}else A(n)||(f.push(c),d&&(h=!0))}}let k;if(p.length?(w(),k=p.length>1?ta(t.helper(Pc),p,l):p[0]):a.length&&(k=Zc(Yu(a),l)),_?g|=16:(v&&!o&&(g|=2),y&&!o&&(g|=4),x.length&&(g|=8),b&&(g|=32)),h||0!==g&&32!==g||!(m||S||f.length>0)||(g|=512),!t.inSSR&&k)switch(k.type){case 15:let e=-1,n=-1,o=!1;for(let t=0;t{if(Ea(e)){const{children:n,loc:o}=e,{slotName:r,slotProps:s}=function(e,t){let n,o='"default"';const r=[];for(let t=0;t0){const{props:o,directives:s}=Ju(e,t,r,!1,!1);n=o,s.length&&t.onError(lc(36,s[0].loc))}return{slotName:o,slotProps:n}}(e,t),i=[t.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let l=2;s&&(i[2]=s,l=3),n.length&&(i[3]=na([],n,!1,!1,o),l=4),t.scopeId&&!t.slotted&&(l=5),i.splice(l),e.codegenNode=ta(t.helper(Tc),i,o)}},ep=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,tp=(e,t,n,o)=>{const{loc:r,modifiers:s,arg:i}=e;let l;if(e.exp||s.length||n.onError(lc(35,r)),4===i.type)if(i.isStatic){let e=i.content;e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`),l=Qc(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?$(N(e)):`on:${e}`,!0,i.loc)}else l=ea([`${n.helperString($c)}(`,i,")"]);else l=i,l.children.unshift(`${n.helperString($c)}(`),l.children.push(")");let c=e.exp;c&&!c.content.trim()&&(c=void 0);let a=n.cacheHandlers&&!c&&!n.inVOnce;if(c){const e=ga(c.content),t=!(e||ep.test(c.content)),n=c.content.includes(";");(t||a&&e)&&(c=ea([`${t?"$event":"(...args)"} => ${n?"{":"("}`,c,n?"}":")"]))}let u={props:[Xc(l,c||Qc("() => {}",!1,r))]};return o&&(u=o(u)),a&&(u.props[0].value=n.cache(u.props[0].value)),u.props.forEach((e=>e.key.isHandlerKey=!0)),u},np=(e,t,n)=>{const{exp:o,modifiers:r,loc:s}=e,i=e.arg;return 4!==i.type?(i.children.unshift("("),i.children.push(') || ""')):i.isStatic||(i.content=`${i.content} || ""`),r.includes("camel")&&(4===i.type?i.isStatic?i.content=N(i.content):i.content=`${n.helperString(Mc)}(${i.content})`:(i.children.unshift(`${n.helperString(Mc)}(`),i.children.push(")"))),n.inSSR||(r.includes("prop")&&op(i,"."),r.includes("attr")&&op(i,"^")),!o||4===o.type&&!o.content.trim()?(n.onError(lc(34,s)),{props:[Xc(i,Qc("",!0,s))]}):{props:[Xc(i,o)]}},op=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},rp=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let o,r=!1;for(let e=0;e7===e.type&&!t.directiveTransforms[e.name]))||"template"===e.tag)))for(let e=0;e{if(1===e.type&&ba(e,"once",!0)){if(sp.has(e)||t.inVOnce||t.inSSR)return;return sp.add(e),t.inVOnce=!0,t.helper(Bc),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0))}}},lp=(e,t,n)=>{const{exp:o,arg:r}=e;if(!o)return n.onError(lc(41,e.loc)),cp();const s=o.loc.source,i=4===o.type?o.content:s,l=n.bindingMetadata[s];if("props"===l||"props-aliased"===l)return n.onError(lc(44,o.loc)),cp();if(!i.trim()||!ga(i))return n.onError(lc(42,o.loc)),cp();const c=r||Qc("modelValue",!0),a=r?la(r)?`onUpdate:${N(r.content)}`:ea(['"onUpdate:" + ',r]):"onUpdate:modelValue";let u;u=ea([(n.isTS?"($event: any)":"$event")+" => ((",o,") = $event)"]);const p=[Xc(c,e.exp),Xc(a,u)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map((e=>(pa(e)?e:JSON.stringify(e))+": true")).join(", "),n=r?la(r)?`${r.content}Modifiers`:ea([r,' + "Modifiers"']):"modelModifiers";p.push(Xc(n,Qc(`{ ${t} }`,!1,e.loc,2)))}return cp(p)};function cp(e=[]){return{props:e}}const ap=/[\w).+\-_$\]]/,up=(e,t)=>{Ia("COMPILER_FILTER",t)&&(5===e.type&&pp(e.content,t),1===e.type&&e.props.forEach((e=>{7===e.type&&"for"!==e.name&&e.exp&&pp(e.exp,t)})))};function pp(e,t){if(4===e.type)fp(e,t);else for(let n=0;n=0&&(e=n.charAt(t)," "===e);t--);e&&ap.test(e)||(u=!0)}}else void 0===i?(h=s+1,i=n.slice(0,s).trim()):m();function m(){g.push(n.slice(h,s).trim()),h=s+1}if(void 0===i?i=n.slice(0,s).trim():0!==h&&m(),g.length){for(s=0;s{if(1===e.type){const n=ba(e,"memo");if(!n||hp.has(e))return;return hp.add(e),()=>{const o=e.codegenNode||t.currentNode.codegenNode;o&&13===o.type&&(1!==e.tagType&&ia(o,t),e.codegenNode=ta(t.helper(qc),[n.exp,na(void 0,o),"_cache",String(t.cached++)]))}}};function mp(e,t={}){const n=t.onError||sc,o="module"===t.mode;!0===t.prefixIdentifiers?n(lc(47)):o&&n(lc(48)),t.cacheHandlers&&n(lc(49)),t.scopeId&&!o&&n(lc(50));const r=S(e)?function(e,t={}){const n=function(e,t){const n=f({},Ma);let o;for(o in t)n[o]=void 0===t[o]?Ma[o]:t[o];return{options:n,column:1,line:1,offset:0,originalSource:e,source:e,inPre:!1,inVPre:!1,onWarn:n.onWarn}}(e,t),o=Za(n);return function(e,t=Gc){return{type:0,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:t}}(La(n,0,[]),Xa(n,o))}(e,t):e,[s,i]=[[ip,Ru,gp,Ou,up,Qu,Gu,Vu,rp],{on:tp,bind:np,model:lp}];return mu(r,f({},t,{prefixIdentifiers:!1,nodeTransforms:[...s,...t.nodeTransforms||[]],directiveTransforms:f({},i,t.directiveTransforms||{})})),Su(r,f({},t,{prefixIdentifiers:!1}))}const vp=Symbol(""),yp=Symbol(""),bp=Symbol(""),_p=Symbol(""),Sp=Symbol(""),Cp=Symbol(""),xp=Symbol(""),wp=Symbol(""),Ep=Symbol(""),kp=Symbol("");var Tp;let Fp;Tp={[vp]:"vModelRadio",[yp]:"vModelCheckbox",[bp]:"vModelText",[_p]:"vModelSelect",[Sp]:"vModelDynamic",[Cp]:"withModifiers",[xp]:"withKeys",[wp]:"vShow",[Ep]:"Transition",[kp]:"TransitionGroup"},Object.getOwnPropertySymbols(Tp).forEach((e=>{Kc[e]=Tp[e]}));const Rp=r("style,iframe,script,noscript",!0),Pp={isVoidTag:oe,isNativeTag:e=>te(e)||ne(e),isPreTag:e=>"pre"===e,decodeEntities:function(e,t=!1){return Fp||(Fp=document.createElement("div")),t?(Fp.innerHTML=`
    `,Fp.children[0].getAttribute("foo")):(Fp.innerHTML=e,Fp.textContent)},isBuiltInComponent:e=>ca(e,"Transition")?Ep:ca(e,"TransitionGroup")?kp:void 0,getNamespace(e,t){let n=t?t.ns:0;if(t&&2===n)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some((e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content)))&&(n=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(n=0);else t&&1===n&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(n=0));if(0===n){if("svg"===e)return 1;if("math"===e)return 2}return n},getTextMode({tag:e,ns:t}){if(0===t){if("textarea"===e||"title"===e)return 1;if(Rp(e))return 2}return 0}},Ap=(e,t)=>{const n=X(e);return Qc(JSON.stringify(n),!1,t,3)};function Ip(e,t){return lc(e,t)}const Op=r("passive,once,capture"),Np=r("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Dp=r("left,right"),Mp=r("onkeyup,onkeydown,onkeypress",!0),Lp=(e,t)=>la(e)&&"onclick"===e.content.toLowerCase()?Qc(t,!0):4!==e.type?ea(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e,$p=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()},Bp=[e=>{1===e.type&&e.props.forEach(((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:Qc("style",!0,t.loc),exp:Ap(t.value.content,t.loc),modifiers:[],loc:t.loc})}))}],jp={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:o,loc:r}=e;return o||n.onError(Ip(53,r)),t.children.length&&(n.onError(Ip(54,r)),t.children.length=0),{props:[Xc(Qc("innerHTML",!0,r),o||Qc("",!0))]}},text:(e,t,n)=>{const{exp:o,loc:r}=e;return o||n.onError(Ip(55,r)),t.children.length&&(n.onError(Ip(56,r)),t.children.length=0),{props:[Xc(Qc("textContent",!0),o?uu(o,n)>0?o:ta(n.helperString(Rc),[o],r):Qc("",!0))]}},model:(e,t,n)=>{const o=lp(e,t,n);if(!o.props.length||1===t.tagType)return o;e.arg&&n.onError(Ip(58,e.arg.loc));const{tag:r}=t,s=n.isCustomElement(r);if("input"===r||"textarea"===r||"select"===r||s){let i=bp,l=!1;if("input"===r||s){const o=_a(t,"type");if(o){if(7===o.type)i=Sp;else if(o.value)switch(o.value.content){case"radio":i=vp;break;case"checkbox":i=yp;break;case"file":l=!0,n.onError(Ip(59,e.loc))}}else(function(e){return e.props.some((e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic)))})(t)&&(i=Sp)}else"select"===r&&(i=_p);l||(o.needRuntime=n.helper(i))}else n.onError(Ip(57,e.loc));return o.props=o.props.filter((e=>!(4===e.key.type&&"modelValue"===e.key.content))),o},on:(e,t,n)=>tp(e,t,n,(t=>{const{modifiers:o}=e;if(!o.length)return t;let{key:r,value:s}=t.props[0];const{keyModifiers:i,nonKeyModifiers:l,eventOptionModifiers:c}=((e,t,n,o)=>{const r=[],s=[],i=[];for(let o=0;o{const{exp:o,loc:r}=e;return o||n.onError(Ip(61,r)),{props:[],needRuntime:n.helper(wp)}}},Vp=Object.create(null);vi((function(e,t){if(!S(e)){if(!e.nodeType)return l;e=e.innerHTML}const n=e,r=Vp[n];if(r)return r;if("#"===e[0]){const t=document.querySelector(e);e=t?t.innerHTML:""}const s=f({hoistStatic:!0,onError:void 0,onWarn:l},t);s.isCustomElement||"undefined"==typeof customElements||(s.isCustomElement=e=>!!customElements.get(e));const{code:i}=function(e,t={}){return mp(e,f({},Pp,t,{nodeTransforms:[$p,...Bp,...t.nodeTransforms||[]],directiveTransforms:f({},jp,t.directiveTransforms||{}),transformHoist:null}))}(e,s),c=new Function("Vue",i)(o);return c._rc=!0,Vp[n]=c}))}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var s=o[e]={exports:{}};return n[e](s,s.exports,r),s.exports}r.m=n,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>({145:"form-editor-view",526:"restore-fields-view",821:"form-browser-view"}[e]+".chunk.js"),r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="leaf_vue:",r.l=(n,o,s,i)=>{if(e[n])e[n].push(o);else{var l,c;if(void 0!==s)for(var a=document.getElementsByTagName("script"),u=0;u{l.onerror=l.onload=null,clearTimeout(d);var r=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),r&&r.forEach((e=>e(o))),t)return t(o)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),c&&document.head.appendChild(l)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={430:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var s=new Promise(((n,r)=>o=e[t]=[n,r]));n.push(o[2]=s);var i=r.p+r.u(t),l=new Error;r.l(i,(n=>{if(r.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var s=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+s+": "+i+")",l.name="ChunkLoadError",l.type=s,l.request=i,o[1](l)}}),"chunk-"+t,t)}};var t=(t,n)=>{var o,s,[i,l,c]=n,a=0;if(i.some((t=>0!==e[t]))){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);c&&c(r)}for(t&&t(n);a{var e=r(166);function t(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n{{ message }}
    '}},created:function(){var e=this;this.getEnabledCategories(),document.addEventListener("keydown",(function(t){"escape"===((null==t?void 0:t.key)||"").toLowerCase()&&!0===e.showFormDialog&&e.closeFormDialog()}))},methods:{truncateText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length<=t?e:e.slice(0,t)+n},decodeAndStripHTML:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e,XSSHelpers.stripAllTags(t.innerText)},updateChosenAttributes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"List Selection",o=document.querySelector("#".concat(e,"_chosen input.chosen-search-input")),r=document.querySelector("#".concat(e,"-chosen-search-results"));null!==o&&(o.setAttribute("role","combobox"),o.setAttribute("aria-labelledby",t)),null!==r&&(r.setAttribute("title",n),r.setAttribute("role","listbox"))},showLastUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(new Date).toLocaleString(),n=document.getElementById(e);null!==n&&(n.style.display="flex",n.innerText="last modified: ".concat(t),n.style.border="2px solid #20a0f0",setTimeout((function(){n.style.border="2px solid transparent"}),750))},setDefaultAjaxResponseMessage:function(){var e=this;$.ajax({type:"POST",url:"ajaxIndex.php?a=checkstatus",data:{CSRFToken},success:function(t){e.ajaxResponseMessage=t||""},error:function(e){return reject(e)}})},initializeOrgSelector:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"employee",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s="group"===(e=e.toLowerCase())?"group#":"#",i={};(i="group"===e?new groupSelector("".concat(n,"orgSel_").concat(t)):"position"===e?new positionSelector("".concat(n,"orgSel_").concat(t)):new employeeSelector("".concat(n,"orgSel_").concat(t))).apiPath="".concat(this.orgchartPath,"/api/"),i.rootPath="".concat(this.orgchartPath,"/"),i.basePath="".concat(this.orgchartPath,"/"),i.setSelectHandler((function(){var t=document.querySelector("#".concat(i.containerID," input.").concat(e,"SelectorInput"));null!==t&&(t.value="".concat(s)+i.selection)})),"function"==typeof r&&i.setResultHandler((function(){return r(i)})),i.initialize();var l=document.querySelector("#".concat(i.containerID," input.").concat(e,"SelectorInput"));""!==o&&null!==l&&(l.value="".concat(s)+o)},getEnabledCategories:function(){var e=this;this.appIsLoadingCategories=!0,$.ajax({type:"GET",url:"".concat(this.APIroot,"formStack/categoryList/allWithStaples"),success:function(t){for(var n in e.categories={},t)e.categories[t[n].categoryID]=t[n],t[n].stapledFormIDs.forEach((function(t){e.allStapledFormCatIDs.includes(t)||e.allStapledFormCatIDs.push(t)}));e.appIsLoadingCategories=!1},error:function(e){return console.log(e)}})},getSiteSettings:function(){var e=this;try{fetch("".concat(this.APIroot,"system/settings")).then((function(t){t.json().then((function(t){e.siteSettings=t,+(null==t?void 0:t.leafSecure)>=1&&e.getSecureFormsInfo()}))}))}catch(e){console.log("error getting site settings",e)}},fetchLEAFSRequests:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t,n){var o=new LeafFormQuery;o.setRootURL("../"),o.addTerm("categoryID","=","leaf_secure"),!0===e?(o.addTerm("stepID","=","resolved"),o.join("recordResolutionData")):o.addTerm("stepID","!=","resolved"),o.onSuccess((function(e){return t(e)})),o.execute()}))},getSecureFormsInfo:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"form/indicator/list"),success:function(e){},error:function(e){return console.log(e)},cache:!1}),this.fetchLEAFSRequests(!0)];Promise.all(t).then((function(t){var n=t[0],o=t[1];e.checkLeafSRequestStatus(n,o)})).catch((function(e){return console.log("an error has occurred",e)}))},checkLeafSRequestStatus:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=!1,r=0;for(var s in n)"approved"===n[s].recordResolutionData.lastStatus.toLowerCase()&&n[s].recordResolutionData.fulfillmentTime>r&&(r=n[s].recordResolutionData.fulfillmentTime);var i=new Date(1e3*parseInt(r));for(var l in t)if(new Date(t[l].timeAdded).getTime()>i.getTime()){o=!0;break}!0===o?(this.showCertificationStatus=!0,this.fetchLEAFSRequests(!1).then((function(t){if(0===Object.keys(t).length)e.secureStatusText="Forms have been modified.",e.secureBtnText="Please Recertify Your Site",e.secureBtnLink="../report.php?a=LEAF_start_leaf_secure_certification";else{var n=t[Object.keys(t)[0]].recordID;e.secureStatusText="Re-certification in progress.",e.secureBtnText="Check Certification Progress",e.secureBtnLink="../index.php?a=printview&recordID="+n}})).catch((function(e){return console.log("an error has occurred",e)}))):this.showCertificationStatus=!1},updateCategoriesProperty:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";void 0!==this.categories[e][t]&&(this.categories[e][t]=n)},updateStapledFormsInfo:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";!0===(arguments.length>2&&void 0!==arguments[2]&&arguments[2])?this.categories[n].stapledFormIDs=this.categories[n].stapledFormIDs.filter((function(t){return t!==e})):(this.allStapledFormCatIDs=Array.from(new Set([].concat(t(this.allStapledFormCatIDs),[e]))),this.categories[n].stapledFormIDs=Array.from(new Set([].concat(t(this.categories[n].stapledFormIDs),[e]))))},addNewCategory:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.categories[e]=t},removeCategory:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";delete this.categories[e]},closeFormDialog:function(){this.showFormDialog=!1,this.dialogTitle="",this.dialogFormContent="",this.dialogButtonText={confirm:"Save",cancel:"Cancel"},this.formSaveFunction=null,this.dialogData=null},lastModalTab:function(e){if(!1===(null==e?void 0:e.shiftKey)){var t=document.getElementById("leaf-vue-dialog-close");null!==t&&(t.focus(),e.preventDefault())}},setCustomDialogTitle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogTitle=e},setFormDialogComponent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogFormContent=e},setDialogSaveFunction:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";"function"==typeof e&&(this.formSaveFunction=e)},checkRequiredData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=Object.keys((null==this?void 0:this.dialogData)||{});e.forEach((function(e){n.includes(e)||t.push(e)})),t.length>0&&console.warn("expected dialogData key was not found",t)},openConfirmDeleteFormDialog:function(){this.setCustomDialogTitle("

    Delete this form

    "),this.setFormDialogComponent("confirm-delete-dialog"),this.dialogButtonText={confirm:"Yes",cancel:"No"},this.showFormDialog=!0},openStapleFormsDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogData={mainFormID:e},this.setCustomDialogTitle("

    Editing Stapled Forms

    "),this.setFormDialogComponent("staple-form-dialog"),this.dialogButtonText={confirm:"Add",cancel:"Close"},this.showFormDialog=!0},openEditCollaboratorsDialog:function(){this.setCustomDialogTitle("

    Editing Collaborators

    "),this.setFormDialogComponent("edit-collaborators-dialog"),this.dialogButtonText={confirm:"Add",cancel:"Close"},this.showFormDialog=!0},openIfThenDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Untitled",n=this.truncateText(this.decodeAndStripHTML(t),35);this.dialogData={indicatorID:e},this.dialogButtonText={confirm:"Save",cancel:"Close"},this.setCustomDialogTitle('

    Conditions For '.concat(n," (").concat(e,")

    ")),this.setFormDialogComponent("conditions-editor-dialog"),this.showFormDialog=!0},openIndicatorEditingDialog:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=null===t&&null===n?"

    Adding new Section

    ":null===t?"

    Adding question to ".concat(n,"

    "):"

    Editing indicator ".concat(t,"

    "),this.dialogData={indicatorID:t,parentID:n,indicator:o},this.setCustomDialogTitle(e),this.setFormDialogComponent("indicator-editing-dialog"),this.showFormDialog=!0},openAdvancedOptionsDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dialogData={indicatorID:e.indicatorID,html:(null==e?void 0:e.html)||"",htmlPrint:(null==e?void 0:e.htmlPrint)||""},this.setCustomDialogTitle("

    Advanced Options for indicator ".concat(e.indicatorID,"

    ")),this.setFormDialogComponent("advanced-options-dialog"),this.showFormDialog=!0},openNewFormDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogData={parentID:e};var t=""===e?"

    New Form

    ":"

    New Internal Use Form

    ";this.setCustomDialogTitle(t),this.setFormDialogComponent("new-form-dialog"),this.showFormDialog=!0},openImportFormDialog:function(){this.setCustomDialogTitle("

    Import Form

    "),this.setFormDialogComponent("import-form-dialog"),this.showFormDialog=!0},openFormHistoryDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.dialogData={historyType:"form",historyID:e},this.setCustomDialogTitle("

    Form History

    "),this.setFormDialogComponent("history-dialog"),this.showFormDialog=!0}}},s="undefined"!=typeof window;const i=Object.assign;function l(e,t){const n={};for(const o in t){const r=t[o];n[o]=a(r)?r.map(e):e(r)}return n}const c=()=>{},a=Array.isArray,u=/\/$/,p=e=>e.replace(u,"");function f(e,t,n="/"){let o,r={},s="",i="";const l=t.indexOf("#");let c=t.indexOf("?");return l=0&&(c=-1),c>-1&&(o=t.slice(0,c),s=t.slice(c+1,l>-1?l:t.length),r=e(s)),l>-1&&(o=o||t.slice(0,l),i=t.slice(l,t.length)),o=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];".."!==r&&"."!==r||o.push("");let s,i,l=n.length-1;for(s=0;s1&&l--}return n.slice(0,l).join("/")+"/"+o.slice(s-(s===o.length?1:0)).join("/")}(null!=o?o:t,n),{fullPath:o+(s&&"?")+s+i,path:o,query:r,hash:i}}function d(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function h(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function g(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!m(e[n],t[n]))return!1;return!0}function m(e,t){return a(e)?v(e,t):a(t)?v(t,e):e===t}function v(e,t){return a(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var y,b;!function(e){e.pop="pop",e.push="push"}(y||(y={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(b||(b={}));const _=/^[^#]+#/;function S(e,t){return e.replace(_,"#")+t}const C=()=>({left:window.pageXOffset,top:window.pageYOffset});function x(e,t){return(history.state?history.state.position-t:-1)+e}const w=new Map;let E=()=>location.protocol+"//"+location.host;function k(e,t){const{pathname:n,search:o,hash:r}=t,s=e.indexOf("#");if(s>-1){let t=r.includes(e.slice(s))?e.slice(s).length:1,n=r.slice(t);return"/"!==n[0]&&(n="/"+n),d(n,"")}return d(n,e)+o+r}function T(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?C():null}}function F(e){return"string"==typeof e||"symbol"==typeof e}const R={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},P=Symbol("");var A;function I(e,t){return i(new Error,{type:e,[P]:!0},t)}function O(e,t){return e instanceof Error&&P in e&&(null==t||!!(e.type&t))}!function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"}(A||(A={}));const N="[^/]+?",D={sensitive:!1,strict:!1,start:!0,end:!0},M=/[.+*?^${}()[\]/\\]/g;function L(e,t){let n=0;for(;nt.length?1===t.length&&80===t[0]?1:-1:0}function B(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const V={type:0,value:""},U=/[a-zA-Z0-9_]/;function H(e,t,n){const o=function(e,t){const n=i({},D,t),o=[];let r=n.start?"^":"";const s=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(r+="/");for(let o=0;o1&&("*"===l||"+"===l)&&t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:a,regexp:u,repeatable:"*"===l||"+"===l,optional:"*"===l||"?"===l})):t("Invalid state to consume buffer"),a="")}function f(){a+=l}for(;ci(e,t.meta)),{})}function G(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function J(e,t){return t.children.some((t=>t===e||J(e,t)))}const Y=/#/g,Z=/&/g,X=/\//g,Q=/=/g,ee=/\?/g,te=/\+/g,ne=/%5B/g,oe=/%5D/g,re=/%5E/g,se=/%60/g,ie=/%7B/g,le=/%7C/g,ce=/%7D/g,ae=/%20/g;function ue(e){return encodeURI(""+e).replace(le,"|").replace(ne,"[").replace(oe,"]")}function pe(e){return ue(e).replace(te,"%2B").replace(ae,"+").replace(Y,"%23").replace(Z,"%26").replace(se,"`").replace(ie,"{").replace(ce,"}").replace(re,"^")}function fe(e){return null==e?"":function(e){return ue(e).replace(Y,"%23").replace(ee,"%3F")}(e).replace(X,"%2F")}function de(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function he(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;ee&&pe(e))):[o&&pe(o)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))})):void 0!==o&&(t+=(t.length?"&":"")+n)}return t}function me(e){const t={};for(const n in e){const o=e[n];void 0!==o&&(t[n]=a(o)?o.map((e=>null==e?null:""+e)):null==o?o:""+o)}return t}const ve=Symbol(""),ye=Symbol(""),be=Symbol(""),_e=Symbol(""),Se=Symbol("");function Ce(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e.slice(),reset:function(){e=[]}}}function xe(e,t,n,o,r){const s=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise(((i,l)=>{const c=e=>{var c;!1===e?l(I(4,{from:n,to:t})):e instanceof Error?l(e):"string"==typeof(c=e)||c&&"object"==typeof c?l(I(2,{from:t,to:e})):(s&&o.enterCallbacks[r]===s&&"function"==typeof e&&s.push(e),i())},a=e.call(o&&o.instances[r],t,n,c);let u=Promise.resolve(a);e.length<3&&(u=u.then(c)),u.catch((e=>l(e)))}))}function we(e,t,n,o){const r=[];for(const i of e)for(const e in i.components){let l=i.components[e];if("beforeRouteEnter"===t||i.instances[e])if("object"==typeof(s=l)||"displayName"in s||"props"in s||"__vccOpts"in s){const s=(l.__vccOpts||l)[t];s&&r.push(xe(s,n,o,i,e))}else{let s=l();r.push((()=>s.then((r=>{if(!r)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${i.path}"`));const s=(l=r).__esModule||"Module"===l[Symbol.toStringTag]?r.default:r;var l;i.components[e]=s;const c=(s.__vccOpts||s)[t];return c&&xe(c,n,o,i,e)()}))))}}var s;return r}function Ee(t){const n=(0,e.f3)(be),o=(0,e.f3)(_e),r=(0,e.Fl)((()=>n.resolve((0,e.SU)(t.to)))),s=(0,e.Fl)((()=>{const{matched:e}=r.value,{length:t}=e,n=e[t-1],s=o.matched;if(!n||!s.length)return-1;const i=s.findIndex(h.bind(null,n));if(i>-1)return i;const l=Te(e[t-2]);return t>1&&Te(n)===l&&s[s.length-1].path!==l?s.findIndex(h.bind(null,e[t-2])):i})),i=(0,e.Fl)((()=>s.value>-1&&function(e,t){for(const n in t){const o=t[n],r=e[n];if("string"==typeof o){if(o!==r)return!1}else if(!a(r)||r.length!==o.length||o.some(((e,t)=>e!==r[t])))return!1}return!0}(o.params,r.value.params))),l=(0,e.Fl)((()=>s.value>-1&&s.value===o.matched.length-1&&g(o.params,r.value.params)));return{route:r,href:(0,e.Fl)((()=>r.value.href)),isActive:i,isExactActive:l,navigate:function(o={}){return function(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||void 0!==e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}(o)?n[(0,e.SU)(t.replace)?"replace":"push"]((0,e.SU)(t.to)).catch(c):Promise.resolve()}}}const ke=(0,e.aZ)({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ee,setup(t,{slots:n}){const o=(0,e.qj)(Ee(t)),{options:r}=(0,e.f3)(be),s=(0,e.Fl)((()=>({[Fe(t.activeClass,r.linkActiveClass,"router-link-active")]:o.isActive,[Fe(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive})));return()=>{const r=n.default&&n.default(o);return t.custom?r:(0,e.h)("a",{"aria-current":o.isExactActive?t.ariaCurrentValue:null,href:o.href,onClick:o.navigate,class:s.value},r)}}});function Te(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Fe=(e,t,n)=>null!=e?e:null!=t?t:n;function Re(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Pe=(0,e.aZ)({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:n,slots:o}){const r=(0,e.f3)(Se),s=(0,e.Fl)((()=>t.route||r.value)),l=(0,e.f3)(ye,0),c=(0,e.Fl)((()=>{let t=(0,e.SU)(l);const{matched:n}=s.value;let o;for(;(o=n[t])&&!o.components;)t++;return t})),a=(0,e.Fl)((()=>s.value.matched[c.value]));(0,e.JJ)(ye,(0,e.Fl)((()=>c.value+1))),(0,e.JJ)(ve,a),(0,e.JJ)(Se,s);const u=(0,e.iH)();return(0,e.YP)((()=>[u.value,a.value,t.name]),(([e,t,n],[o,r,s])=>{t&&(t.instances[n]=e,r&&r!==t&&e&&e===o&&(t.leaveGuards.size||(t.leaveGuards=r.leaveGuards),t.updateGuards.size||(t.updateGuards=r.updateGuards))),!e||!t||r&&h(t,r)&&o||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const r=s.value,l=t.name,c=a.value,p=c&&c.components[l];if(!p)return Re(o.default,{Component:p,route:r});const f=c.props[l],d=f?!0===f?r.params:"function"==typeof f?f(r):f:null,h=(0,e.h)(p,i({},d,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(c.instances[l]=null)},ref:u}));return Re(o.default,{Component:h,route:r})||h}}});var Ae,Ie=[{path:"/",name:"browser",component:function(){return r.e(821).then(r.bind(r,105))}},{path:"/forms",name:"category",component:function(){return r.e(145).then(r.bind(r,601))}},{path:"/restore",name:"restore",component:function(){return r.e(526).then(r.bind(r,135))}}],Oe=function(t){const n=function(e,t){const n=[],o=new Map;function r(e,n,o){const a=!o,u=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:q(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);u.aliasOf=o&&o.record;const p=G(t,e),f=[u];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)f.push(i({},u,{components:o?o.record.components:u.components,path:e,aliasOf:o?o.record:u}))}let d,h;for(const t of f){const{path:i}=t;if(n&&"/"!==i[0]){const e=n.record.path,o="/"===e[e.length-1]?"":"/";t.path=n.record.path+(i&&o+i)}if(d=H(t,n,p),o?o.alias.push(d):(h=h||d,h!==d&&h.alias.push(d),a&&e.name&&!z(d)&&s(e.name)),u.children){const e=u.children;for(let t=0;t{s(h)}:c}function s(e){if(F(e)){const t=o.get(e);t&&(o.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(s),t.alias.forEach(s))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&o.delete(e.record.name),e.children.forEach(s),e.alias.forEach(s))}}function l(e){let t=0;for(;t=0&&(e.record.path!==n[t].record.path||!J(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!z(e)&&o.set(e.record.name,e)}return t=G({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>r(e))),{addRoute:r,resolve:function(e,t){let r,s,l,c={};if("name"in e&&e.name){if(r=o.get(e.name),!r)throw I(1,{location:e});l=r.record.name,c=i(W(t.params,r.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params&&W(e.params,r.keys.map((e=>e.name)))),s=r.stringify(c)}else if("path"in e)s=e.path,r=n.find((e=>e.re.test(s))),r&&(c=r.parse(s),l=r.record.name);else{if(r=t.name?o.get(t.name):n.find((e=>e.re.test(t.path))),!r)throw I(1,{location:e,currentLocation:t});l=r.record.name,c=i({},t.params,e.params),s=r.stringify(c)}const a=[];let u=r;for(;u;)a.unshift(u.record),u=u.parent;return{name:l,path:s,params:c,matched:a,meta:K(a)}},removeRoute:s,getRoutes:function(){return n},getRecordMatcher:function(e){return o.get(e)}}}(t.routes,t),o=t.parseQuery||he,r=t.stringifyQuery||ge,u=t.history,p=Ce(),d=Ce(),m=Ce(),v=(0,e.XI)(R);let b=R;s&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const _=l.bind(null,(e=>""+e)),S=l.bind(null,fe),E=l.bind(null,de);function k(e,t){if(t=i({},t||v.value),"string"==typeof e){const r=f(o,e,t.path),s=n.resolve({path:r.path},t),l=u.createHref(r.fullPath);return i(r,s,{params:E(s.params),hash:de(r.hash),redirectedFrom:void 0,href:l})}let s;if("path"in e)s=i({},e,{path:f(o,e.path,t.path).path});else{const n=i({},e.params);for(const e in n)null==n[e]&&delete n[e];s=i({},e,{params:S(n)}),t.params=S(t.params)}const l=n.resolve(s,t),c=e.hash||"";l.params=_(E(l.params));const a=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(r,i({},e,{hash:(p=c,ue(p).replace(ie,"{").replace(ce,"}").replace(re,"^")),path:l.path}));var p;const d=u.createHref(a);return i({fullPath:a,hash:c,query:r===ge?me(e.query):e.query||{}},l,{redirectedFrom:void 0,href:d})}function T(e){return"string"==typeof e?f(o,e,v.value.path):i({},e)}function P(e,t){if(b!==e)return I(8,{from:t,to:e})}function A(e){return D(e)}function N(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let o="function"==typeof n?n(e):n;return"string"==typeof o&&(o=o.includes("?")||o.includes("#")?o=T(o):{path:o},o.params={}),i({query:e.query,hash:e.hash,params:"path"in o?{}:e.params},o)}}function D(e,t){const n=b=k(e),o=v.value,s=e.state,l=e.force,c=!0===e.replace,a=N(n);if(a)return D(i(T(a),{state:"object"==typeof a?i({},s,a.state):s,force:l,replace:c}),t||n);const u=n;let p;return u.redirectedFrom=t,!l&&function(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&h(t.matched[o],n.matched[r])&&g(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(r,o,n)&&(p=I(16,{to:u,from:o}),te(o,o,!0,!1)),(p?Promise.resolve(p):$(u,o)).catch((e=>O(e)?O(e,2)?e:ee(e):Q(e,u,o))).then((e=>{if(e){if(O(e,2))return D(i({replace:c},T(e.to),{state:"object"==typeof e.to?i({},s,e.to.state):s,force:l}),t||u)}else e=V(u,o,!0,c,s);return j(u,o,e),e}))}function M(e,t){const n=P(e,t);return n?Promise.reject(n):Promise.resolve()}function L(e){const t=se.values().next().value;return t&&"function"==typeof t.runWithContext?t.runWithContext(e):e()}function $(e,t){let n;const[o,r,s]=function(e,t){const n=[],o=[],r=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;ih(e,s)))?o.push(s):n.push(s));const l=e.matched[i];l&&(t.matched.find((e=>h(e,l)))||r.push(l))}return[n,o,r]}(e,t);n=we(o.reverse(),"beforeRouteLeave",e,t);for(const r of o)r.leaveGuards.forEach((o=>{n.push(xe(o,e,t))}));const i=M.bind(null,e,t);return n.push(i),ae(n).then((()=>{n=[];for(const o of p.list())n.push(xe(o,e,t));return n.push(i),ae(n)})).then((()=>{n=we(r,"beforeRouteUpdate",e,t);for(const o of r)o.updateGuards.forEach((o=>{n.push(xe(o,e,t))}));return n.push(i),ae(n)})).then((()=>{n=[];for(const o of s)if(o.beforeEnter)if(a(o.beforeEnter))for(const r of o.beforeEnter)n.push(xe(r,e,t));else n.push(xe(o.beforeEnter,e,t));return n.push(i),ae(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=we(s,"beforeRouteEnter",e,t),n.push(i),ae(n)))).then((()=>{n=[];for(const o of d.list())n.push(xe(o,e,t));return n.push(i),ae(n)})).catch((e=>O(e,8)?e:Promise.reject(e)))}function j(e,t,n){m.list().forEach((o=>L((()=>o(e,t,n)))))}function V(e,t,n,o,r){const l=P(e,t);if(l)return l;const c=t===R,a=s?history.state:{};n&&(o||c?u.replace(e.fullPath,i({scroll:c&&a&&a.scroll},r)):u.push(e.fullPath,r)),v.value=e,te(e,t,n,c),ee()}let U;let Y,Z=Ce(),X=Ce();function Q(e,t,n){ee(e);const o=X.list();return o.length?o.forEach((o=>o(e,t,n))):console.error(e),Promise.reject(e)}function ee(e){return Y||(Y=!e,U||(U=u.listen(((e,t,n)=>{if(!le.listening)return;const o=k(e),r=N(o);if(r)return void D(i(r,{replace:!0}),o).catch(c);b=o;const l=v.value;var a,p;s&&(a=x(l.fullPath,n.delta),p=C(),w.set(a,p)),$(o,l).catch((e=>O(e,12)?e:O(e,2)?(D(e.to,o).then((e=>{O(e,20)&&!n.delta&&n.type===y.pop&&u.go(-1,!1)})).catch(c),Promise.reject()):(n.delta&&u.go(-n.delta,!1),Q(e,o,l)))).then((e=>{(e=e||V(o,l,!1))&&(n.delta&&!O(e,8)?u.go(-n.delta,!1):n.type===y.pop&&O(e,20)&&u.go(-1,!1)),j(o,l,e)})).catch(c)}))),Z.list().forEach((([t,n])=>e?n(e):t())),Z.reset()),e}function te(n,o,r,i){const{scrollBehavior:l}=t;if(!s||!l)return Promise.resolve();const c=!r&&function(e){const t=w.get(e);return w.delete(e),t}(x(n.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return(0,e.Y3)().then((()=>l(n,o,c))).then((e=>e&&function(e){let t;if("el"in e){const n=e.el,o="string"==typeof n&&n.startsWith("#"),r="string"==typeof n?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}(e))).catch((e=>Q(e,n,o)))}const ne=e=>u.go(e);let oe;const se=new Set,le={currentRoute:v,listening:!0,addRoute:function(e,t){let o,r;return F(e)?(o=n.getRecordMatcher(e),r=t):r=e,n.addRoute(r,o)},removeRoute:function(e){const t=n.getRecordMatcher(e);t&&n.removeRoute(t)},hasRoute:function(e){return!!n.getRecordMatcher(e)},getRoutes:function(){return n.getRoutes().map((e=>e.record))},resolve:k,options:t,push:A,replace:function(e){return A(i(T(e),{replace:!0}))},go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:p.add,beforeResolve:d.add,afterEach:m.add,onError:X.add,isReady:function(){return Y&&v.value!==R?Promise.resolve():new Promise(((e,t)=>{Z.add([e,t])}))},install(t){t.component("RouterLink",ke),t.component("RouterView",Pe),t.config.globalProperties.$router=this,Object.defineProperty(t.config.globalProperties,"$route",{enumerable:!0,get:()=>(0,e.SU)(v)}),s&&!oe&&v.value===R&&(oe=!0,A(u.location).catch((e=>{})));const n={};for(const e in R)Object.defineProperty(n,e,{get:()=>v.value[e],enumerable:!0});t.provide(be,this),t.provide(_e,(0,e.Um)(n)),t.provide(Se,v);const o=t.unmount;se.add(t),t.unmount=function(){se.delete(t),se.size<1&&(b=R,U&&U(),U=null,v.value=R,oe=!1,Y=!1),o()}}};function ae(e){return e.reduce(((e,t)=>e.then((()=>L(t)))),Promise.resolve())}return le}({history:((Ae=location.host?Ae||location.pathname+location.search:"").includes("#")||(Ae+="#"),function(e){const t=function(e){const{history:t,location:n}=window,o={value:k(e,n)},r={value:t.state};function s(o,s,i){const l=e.indexOf("#"),c=l>-1?(n.host&&document.querySelector("base")?e:e.slice(l))+o:E()+e+o;try{t[i?"replaceState":"pushState"](s,"",c),r.value=s}catch(e){console.error(e),n[i?"replace":"assign"](c)}}return r.value||s(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:o,state:r,push:function(e,n){const l=i({},r.value,t.state,{forward:e,scroll:C()});s(l.current,l,!0),s(e,i({},T(o.value,e,null),{position:l.position+1},n),!1),o.value=e},replace:function(e,n){s(e,i({},t.state,T(r.value.back,e,r.value.forward,!0),n,{position:r.value.position}),!0),o.value=e}}}(e=function(e){if(!e)if(s){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),p(e)}(e)),n=function(e,t,n,o){let r=[],s=[],l=null;const c=({state:s})=>{const i=k(e,location),c=n.value,a=t.value;let u=0;if(s){if(n.value=i,t.value=s,l&&l===c)return void(l=null);u=a?s.position-a.position:0}else o(i);r.forEach((e=>{e(n.value,c,{delta:u,type:y.pop,direction:u?u>0?b.forward:b.back:b.unknown})}))};function a(){const{history:e}=window;e.state&&e.replaceState(i({},e.state,{scroll:C()}),"")}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",a,{passive:!0}),{pauseListeners:function(){l=n.value},listen:function(e){r.push(e);const t=()=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)};return s.push(t),t},destroy:function(){for(const e of s)e();s=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",a)}}}(e,t.state,t.location,t.replace),o=i({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:S.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}(Ae)),routes:Ie});const Ne=Oe;var De=(0,e.ri)(o);De.use(Ne),De.mount("#vue-formeditor-app")})()})(); \ No newline at end of file diff --git a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js index 7101c0e9d..f78617630 100644 --- a/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js +++ b/app/libs/js/vue-dest/form_editor/form-editor-view.chunk.js @@ -1 +1 @@ -"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null,elClose:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText","lastModalTab"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes),this.elClose=document.getElementById("leaf-vue-dialog-close"),this.elClose.focus()},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},firstTab:function(e){if(!0===(null==e?void 0:e.shiftKey)){var t=document.querySelector("#ifthen_deletion_dialog button.btn-general"),o=document.getElementById("next"),n=document.getElementById("button_cancelchange"),i=t||o||n;null!==i&&"function"==typeof i.focus&&(i.focus(),e.preventDefault())}},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
    \n \n
    \n
    '}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
    \n
    \n
    Form Name (up to 50 characters)
    \n
    {{nameCharsRemaining}}
    \n
    \n \n
    \n
    Form Description (up to 255 characters)
    \n
    {{descrCharsRemaining}}
    \n
    \n \n
    '}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData","lastModalTab"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
    \n
    \n Loading...\n loading...\n
    \n
    \n
    \n \n \n
    \n
    '},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:XSSHelpers.stripTags((null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",["script"]),options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
    \n Move column left\n Move column right
    \n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
    \n \n \n
    \n
    \n \n \n \n \n
    \n
    '},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
    \n Special access restrictions\n
    \n Restrictions will limit view access to the request initiator and members of specific groups.
    \n They will also only allow the specified groups to apply search filters for this field.
    \n All others will see "[protected data]".\n
    \n \n
    {{ statusMessageError }}
    \n \n
    \n \n
    \n
    '}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
      ","
    1. ","
      ","

      ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

      \n
      \n \n \n
      \n \n \n
      \n
      \n
      \n
      \n \n
      {{shortlabelCharsRemaining}}
      \n
      \n \n
      \n
      \n
      \n \n
      \n \n \n
      \n
      \n

      Format Information

      \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
      \n
      \n
      \n \n \n
      \n
      \n \n \n
      \n
      \n \n
      \n
      \n  Columns ({{gridJSON.length}}):\n
      \n
      \n \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n Attributes\n
      \n \n \n
      \n \n \n \n This field will be archived.  It can be
      re-enabled by using Restore Fields.\n
      \n \n Deleted items can only be re-enabled
      within 30 days by using Restore Fields.\n
      \n
      \n
      '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
      \n
      Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
      {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
      {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

      \n
      \n html (for pages where the user can edit data): \n \n
      \n
      \n
      \n htmlPrint (for pages where the user can only read data): \n \n
      \n \n
      \n
      \n
      \n Notice:
      \n

      Please go to LEAF Programmer\n to ensure continued access to this area.

      \n
      '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      Stapled forms will show up on the same page as the primary form.

      \n

      The order of the forms will be determined by the forms\' assigned sort values.

      \n
      \n
        \n
      • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
      • \n
      \n

      \n
      \n \n
      There are no available forms to merge
      \n
      \n
      '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      {{formNameStripped()}}

      \n

      Collaborators have access to fill out data fields at any time in the workflow.

      \n

      This is typically used to give groups access to fill out internal-use fields.

      \n
      \n \n

      \n
      \n \n
      There are no available groups to add
      \n
      \n
      '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
      \n
      Are you sure you want to delete this form?
      \n
      {{formName}}
      \n
      {{formDescription}}
      \n
      ⚠️ This form still has stapled forms attached
      \n
      '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue="")},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&this.addOrgSelector()},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="";if(!0===(null==e?void 0:e.multiple)?(Array.from(e.selectedOptions).forEach((function(e){o+=e.label.trim()+"\n"})),o=o.trim()):o=e.value.trim(),"parent"===t.toLowerCase()){if(this.selectedParentValue=XSSHelpers.stripAllTags(o),"number"===this.parentFormat||"currency"===this.parentFormat)if(/^(\d*)(\.\d+)?$/.test(o)){var n=parseFloat(o);this.selectedParentValue="currency"===this.parentFormat?(Math.round(100*n)/100).toFixed(2):String(n)}else this.selectedParentValue=""}else"child"===t.toLowerCase()&&(this.selectedChildValue=XSSHelpers.stripAllTags(o))},newCondition:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selectedConditionJSON="",this.showConditionEditor=e,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),n=n.length>0?JSON.stringify(n):"",$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n,CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.indicators.find((function(e){return e.indicatorID===t.childIndID})).conditions=n,t.showRemoveModal=!1,t.newCondition(!1)):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp,n=e.selectedOp;switch(n){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not";break;case"gt":case"gte":case"lt":case"lte":var i=n.includes("g")?"greater than":"less than",r=n.includes("e")?" or equal to":"";o="is ".concat(i).concat(r)}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return e.indicatorID===n})),r=(null==i?void 0:i.format)||"";return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return t.indicatorID===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return t.indicatorID===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},childChoicesKey:function(){return this.selectedConditionJSON+this.selectedOutcome},parentChoicesKey:function(){return this.selectedConditionJSON+String(this.parentIndID)+this.selectedOperator},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")},childChoicesKey:function(e,t){"pre-fill"==this.selectedOutcome.toLowerCase()&&this.multiOptionFormats.includes(this.childFormat)&&this.updateChoicesJS()},parentChoicesKey:function(e,t){this.multiOptionFormats.includes(this.parentFormat)&&this.updateChoicesJS()},selectedOperator:function(e,t){""!==t&&this.numericOperators.includes(e)&&!this.numericOperators.includes(t)&&(this.selectedParentValue="")}},template:'
      \n \x3c!-- LOADING SPINNER --\x3e\n
      \n Loading... loading...\n
      \n
      \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
      \n
      Choose Delete to confirm removal, or cancel to return
      \n
      \n \n \n
      \n
      \n \n
      \n
      '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
      \n

      This is a Nationally Standardized Subordinate Site

      \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return this.indID+"_format_label"},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r,a=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+a.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),null===(t=document.querySelector("#".concat(this.inputElID,"_chosen input.chosen-search-input")))||void 0===t||t.setAttribute("aria-labelledby",this.labelSelector);break;case"multiselect":var l=document.getElementById(this.inputElID);if(null!==l&&!0===l.multiple&&"active"!==(null==l?void 0:l.getAttribute("data-choice"))){var s=this.indicator.options||[];s=s.map((function(e){return{value:e,label:e,selected:""!==a.strippedDefault&&a.strippedDefault===e}}));var c=new Choices(l,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:s.filter((function(e){return""!==e.value}))});l.choicesjs=c}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(o=this.indicator)||void 0===o?void 0:o.default)||"");break;case"checkbox":null===(n=document.getElementById(this.inputElID+"_check0"))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(i=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(r=document.getElementById(this.inputElID))||void 0===r||r.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},T={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},_={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function P(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function O(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(O({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(O({},t.categories[i]));o.push(O(O({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(O(O({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=O({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file +"use strict";(self.webpackChunkleaf_vue=self.webpackChunkleaf_vue||[]).push([[145],{775:(e,t,o)=>{o.d(t,{Z:()=>n});const n={data:function(){return{scrollY:window.scrollY,initialTop:15,modalElementID:"leaf_dialog_content",modalBackgroundID:"leaf-vue-dialog-background",elBody:null,elModal:null,elBackground:null,elClose:null}},inject:["dialogTitle","closeFormDialog","formSaveFunction","dialogButtonText","lastModalTab"],mounted:function(){this.elBody=document.querySelector("body"),this.elModal=document.getElementById(this.modalElementID),this.elBackground=document.getElementById(this.modalBackgroundID);var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minHeight=200+this.elBody.clientHeight+"px",this.elBackground.style.minWidth=e+"px",this.makeDraggable(this.elModal),window.addEventListener("resize",this.checkSizes),this.elClose=document.getElementById("leaf-vue-dialog-close"),this.elClose.focus()},beforeUnmount:function(){window.removeEventListener("resize",this.checkSizes)},methods:{checkSizes:function(){var e=this.elModal.clientWidth>this.elBody.clientWidth?this.elModal.clientWidth:this.elBody.clientWidth;this.elBackground.style.minWidth=e+"px",this.elBackground.style.minHeight=this.elModal.offsetTop+this.elBody.clientHeight+"px"},firstTab:function(e){if(!0===(null==e?void 0:e.shiftKey)){var t=document.querySelector("#ifthen_deletion_dialog button.btn-general"),o=document.getElementById("next"),n=document.getElementById("button_cancelchange"),i=t||o||n;null!==i&&"function"==typeof i.focus&&(i.focus(),e.preventDefault())}},makeDraggable:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0,n=0,i=0,r=0,a=function(e){(e=e||window.event).preventDefault(),o=i-e.clientX,n=r-e.clientY,i=e.clientX,r=e.clientY,t.style.top=t.offsetTop-n+"px",t.style.left=t.offsetLeft-o+"px",s()},l=function(){document.onmouseup=null,document.onmousemove=null},s=function(){t.offsetTopwindow.innerWidth+window.scrollX&&(t.style.left=window.innerWidth+window.scrollX-t.clientWidth-18+"px"),e.elBackground.style.minWidth=e.elBody.clientWidth+"px",e.elBackground.style.minHeight=e.elModal.offsetTop+e.elBody.clientHeight+"px"};document.getElementById(this.modalElementID+"_drag_handle")&&(document.getElementById(this.modalElementID+"_drag_handle").onmousedown=function(e){(e=e||window.event).preventDefault(),i=e.clientX,r=e.clientY,document.onmouseup=l,document.onmousemove=a})}},template:'\n
    \n \n
    \n
    '}},491:(e,t,o)=>{o.d(t,{Z:()=>n});const n={name:"new-form-dialog",data:function(){return{requiredDataProperties:["parentID"],categoryName:"",categoryDescription:"",newFormParentID:this.dialogData.parentID}},inject:["APIroot","CSRFToken","decodeAndStripHTML","setDialogSaveFunction","dialogData","checkRequiredData","addNewCategory","closeFormDialog"],created:function(){this.checkRequiredData(this.requiredDataProperties),this.setDialogSaveFunction(this.onSave)},mounted:function(){document.getElementById("name").focus()},emits:["get-form"],computed:{nameCharsRemaining:function(){return Math.max(50-this.categoryName.length,0)},descrCharsRemaining:function(){return Math.max(255-this.categoryDescription.length,0)}},methods:{onSave:function(){var e=this,t=XSSHelpers.stripAllTags(this.categoryName),o=XSSHelpers.stripAllTags(this.categoryDescription);$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/new"),data:{name:t,description:o,parentID:this.newFormParentID,CSRFToken:this.CSRFToken},success:function(n){var i=n,r={};r.categoryID=i,r.categoryName=t,r.categoryDescription=o,r.parentID=e.newFormParentID,r.workflowID=0,r.needToKnow=0,r.visible=1,r.sort=0,r.type="",r.stapledFormIDs=[],r.destructionAge=null,e.addNewCategory(i,r),""===e.newFormParentID?e.$router.push({name:"category",query:{formID:i}}):e.$emit("get-form",i),e.closeFormDialog()},error:function(e){console.log("error posting new form",e)}})}},template:'
    \n
    \n
    Form Name (up to 50 characters)
    \n
    {{nameCharsRemaining}}
    \n
    \n \n
    \n
    Form Description (up to 255 characters)
    \n
    {{descrCharsRemaining}}
    \n
    \n \n
    '}},601:(e,t,o)=>{o.r(t),o.d(t,{default:()=>E});var n=o(166),i=o(775);const r={name:"history-dialog",data:function(){return{requiredDataProperties:["historyType","historyID"],divSaveCancelID:"leaf-vue-dialog-cancel-save",page:1,historyType:this.dialogData.historyType,historyID:this.dialogData.historyID,ajaxRes:null}},inject:["dialogData","checkRequiredData","lastModalTab"],created:function(){this.checkRequiredData(this.requiredDataProperties)},mounted:function(){document.getElementById(this.divSaveCancelID).style.display="none",this.getPage()},computed:{showNext:function(){return null!==this.ajaxRes&&-1===this.ajaxRes.indexOf("No history to show")},showPrev:function(){return this.page>1}},methods:{getNext:function(){this.page++,this.getPage()},getPrev:function(){this.page--,this.getPage()},getPage:function(){var e=this;try{var t="ajaxIndex.php?a=gethistory&type=".concat(this.historyType,"&gethistoryslice=1&page=").concat(this.page,"&id=").concat(this.historyID);fetch(t).then((function(t){t.text().then((function(t){return e.ajaxRes=t}))}))}catch(e){console.log("error getting history",e)}}},template:'
    \n
    \n Loading...\n loading...\n
    \n
    \n
    \n \n \n
    \n
    '},a={name:"indicator-editing-dialog",data:function(){var e,t,o,n,i,r,a,l,s,c,d,u,p,m,h,f;return{requiredDataProperties:["indicator","indicatorID","parentID"],initialFocusElID:"name",showAdditionalOptions:!1,showDetailedFormatInfo:!1,formats:{text:"Single line text",textarea:"Multi-line text",grid:"Grid (Table with rows and columns)",number:"Numeric",currency:"Currency",date:"Date",radio:"Radio (single select, multiple options)",checkbox:"Checkbox (A single checkbox)",checkboxes:"Checkboxes (Multiple Checkboxes)",multiselect:"Multi-Select Dropdown",dropdown:"Dropdown Menu (single select, multiple options)",fileupload:"File Attachment",image:"Image Attachment",orgchart_group:"Orgchart Group",orgchart_position:"Orgchart Position",orgchart_employee:"Orgchart Employee",raw_data:"Raw Data (for programmers)"},formatInfo:{text:"A single input for short text entries.",textarea:"A large area for multiple lines of text and limited text formatting options.",grid:"A table format with rows and columns. Additional rows can be added, removed, or moved during data entry.",number:"A single input used to store numeric data. Useful for information that will be used for calculations.",currency:"A single input used to store currency values in dollars to two decimal places.",date:"Embeds a datepicker.",radio:"Radio buttons allow a single selection from multiple options. All of the question's options will display.",checkbox:"A single checkbox is typically used for confirmation. The checkbox label text can be further customized.",checkboxes:"Checkboxes will allow the selection of multiple options. All of the question's options will display.",multiselect:"Multi-Select format will allow the selection of several options from a selection box with a dropdown. Only selected items will display.",dropdown:"A dropdown menu will allow one selection from multiple options. Only the selected option will display.",fileupload:"File Attachment",image:"Similar to file upload, but only image format files will be shown during selection",orgchart_group:"Orgchart Group format is used to select a specific LEAF User Access Group",orgchart_position:"Orgchart Position format is used to select a specific LEAF user by their position in the orgchart",orgchart_employee:"Orgchart Employee format is used to select a specific LEAF user from the orgchart",raw_data:"Raw Data is associated with Advanced Options, which can be used by programmers to run custom code during form data entry or review"},listForParentIDs:[],isLoadingParentIDs:!0,multianswerFormats:["checkboxes","radio","multiselect","dropdown"],name:XSSHelpers.stripTags((null===(e=this.dialogData)||void 0===e||null===(e=e.indicator)||void 0===e?void 0:e.name)||"",["script"]),options:(null===(t=this.dialogData)||void 0===t||null===(t=t.indicator)||void 0===t?void 0:t.options)||[],format:(null===(o=this.dialogData)||void 0===o||null===(o=o.indicator)||void 0===o?void 0:o.format)||"",description:(null===(n=this.dialogData)||void 0===n||null===(n=n.indicator)||void 0===n?void 0:n.description)||"",defaultValue:this.decodeAndStripHTML((null===(i=this.dialogData)||void 0===i||null===(i=i.indicator)||void 0===i?void 0:i.default)||""),required:1===parseInt(null===(r=this.dialogData)||void 0===r||null===(r=r.indicator)||void 0===r?void 0:r.required)||!1,is_sensitive:1===parseInt(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a?void 0:a.is_sensitive)||!1,parentID:(null===(l=this.dialogData)||void 0===l?void 0:l.parentID)||null,sort:void 0!==(null===(s=this.dialogData)||void 0===s||null===(s=s.indicator)||void 0===s?void 0:s.sort)?parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.sort):null,singleOptionValue:"checkbox"===(null===(d=this.dialogData)||void 0===d||null===(d=d.indicator)||void 0===d?void 0:d.format)?null===(u=this.dialogData)||void 0===u?void 0:u.indicator.options:"",multiOptionValue:["checkboxes","radio","multiselect","dropdown"].includes(null===(p=this.dialogData)||void 0===p||null===(p=p.indicator)||void 0===p?void 0:p.format)?((null===(m=this.dialogData)||void 0===m?void 0:m.indicator.options)||[]).join("\n"):"",gridJSON:"grid"===(null===(h=this.dialogData)||void 0===h||null===(h=h.indicator)||void 0===h?void 0:h.format)?JSON.parse(null===(f=this.dialogData)||void 0===f||null===(f=f.indicator)||void 0===f?void 0:f.options[0]):[],archived:!1,deleted:!1}},inject:["APIroot","CSRFToken","dialogData","checkRequiredData","setDialogSaveFunction","advancedMode","initializeOrgSelector","closeFormDialog","showLastUpdate","focusedFormRecord","focusedFormTree","getFormByCategoryID","truncateText","decodeAndStripHTML","orgchartFormats"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},provide:function(){var e=this;return{gridJSON:(0,n.Fl)((function(){return e.gridJSON})),updateGridJSON:this.updateGridJSON}},components:{GridCell:{name:"grid-cell",data:function(){var e,t,o,n,i,r;return{name:(null===(e=this.cell)||void 0===e?void 0:e.name)||"No title",id:(null===(t=this.cell)||void 0===t?void 0:t.id)||this.makeColumnID(),gridType:(null===(o=this.cell)||void 0===o?void 0:o.type)||"text",textareaDropOptions:null!==(n=this.cell)&&void 0!==n&&n.options?this.cell.options.join("\n"):[],file:(null===(i=this.cell)||void 0===i?void 0:i.file)||"",hasHeader:(null===(r=this.cell)||void 0===r?void 0:r.hasHeader)||!1}},props:{cell:Object,column:Number},inject:["libsPath","gridJSON","updateGridJSON","fileManagerTextFiles"],mounted:function(){0===this.gridJSON.length&&this.updateGridJSON()},computed:{gridJSONlength:function(){return this.gridJSON.length}},methods:{makeColumnID:function(){return"col_"+(65536*(1+Math.random())|0).toString(16).substring(1)},deleteColumn:function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),o=document.getElementById("gridcell_col_parent"),n=Array.from(o.querySelectorAll("div.cell")),i=n.indexOf(t)+1,r=n.length;2===r?(t.remove(),r--,e=n[0]):(e=null===t.querySelector('[title="Move column right"]')?t.previousElementSibling.querySelector('[title="Delete column"]'):t.nextElementSibling.querySelector('[title="Delete column"]'),t.remove(),r--),document.getElementById("tableStatus").setAttribute("aria-label","column ".concat(i," removed, ").concat(r," total.")),e.focus(),this.updateGridJSON()},moveRight:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.nextElementSibling,o=e.nextElementSibling.querySelector('[title="Move column right"]');t.after(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"left":"right",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved right to column ".concat(this.column+1," of ").concat(this.gridJSONlength)),this.updateGridJSON()},moveLeft:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).currentTarget.closest("div.cell"),t=e.previousElementSibling,o=e.previousElementSibling.querySelector('[title="Move column left"]');t.before(e),setTimeout((function(){var t;null===(t=e.querySelector('[title="Move column '.concat(null===o?"right":"left",'"]')))||void 0===t||t.focus()}),0),document.getElementById("tableStatus").setAttribute("aria-label","Moved left to column ".concat(this.column-1," of ").concat(this.gridJSONlength)),this.updateGridJSON()}},watch:{gridJSONlength:function(e,t){e>t&&document.getElementById("tableStatus").setAttribute("aria-label","Added a new column, ".concat(this.gridJSONlength," total."))}},template:'
    \n Move column left\n Move column right
    \n \n Column #{{column}}:\n Delete column\n \n \n \n \n \n
    \n \n \n
    \n
    \n \n \n \n \n
    \n
    '},IndicatorPrivileges:{name:"indicator-privileges",data:function(){return{allGroups:[],groupsWithPrivileges:[],group:0,statusMessageError:""}},props:{indicatorID:{type:Number,required:!0}},inject:["APIroot","CSRFToken"],mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),success:function(t){e.groupsWithPrivileges=t},error:function(t){console.log(t),e.statusMessageError="There was an error retrieving the Indicator Privileges. Please try again."},cache:!1})];Promise.all(t).then((function(e){})).catch((function(e){return console.log("an error has occurred",e)}))},computed:{availableGroups:function(){var e=[];return this.groupsWithPrivileges.map((function(t){return e.push(parseInt(t.id))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removeIndicatorPrivilege:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;0!==t&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges/remove"),data:{groupID:t,CSRFToken:this.CSRFToken},success:function(o){e.groupsWithPrivileges=e.groupsWithPrivileges.filter((function(e){return e.id!==t}))},error:function(e){return console.log(e)}})},addIndicatorPrivilege:function(){var e=this;0!==this.group&&$.ajax({method:"POST",url:"".concat(this.APIroot,"formEditor/indicator/").concat(this.indicatorID,"/privileges"),data:{groupIDs:[this.group.groupID],CSRFToken:this.CSRFToken},success:function(){e.groupsWithPrivileges.push({id:e.group.groupID,name:e.group.name}),e.group=0},error:function(e){return console.log("an error occurred while setting group access restrictions",e)}})}},template:'
    \n Special access restrictions\n
    \n Restrictions will limit view access to the request initiator and members of specific groups.
    \n They will also only allow the specified groups to apply search filters for this field.
    \n All others will see "[protected data]".\n
    \n \n
    {{ statusMessageError }}
    \n \n
    \n \n
    \n
    '}},mounted:function(){var e=this;if(!0===this.isEditingModal&&this.getFormParentIDs().then((function(t){e.listForParentIDs=t,e.isLoadingParentIDs=!1})).catch((function(e){return console.log("an error has occurred",e)})),null===this.sort&&(this.sort=this.newQuestionSortValue),XSSHelpers.containsTags(this.name,["","","","
      ","
    1. ","
      ","

      ",""])?(document.getElementById("advNameEditor").click(),document.querySelector(".trumbowyg-editor").focus()):document.getElementById(this.initialFocusElID).focus(),this.orgchartFormats.includes(this.format)){var t=this.format.slice(this.format.indexOf("_")+1);this.initializeOrgSelector(t,this.indicatorID,"modal_",this.defaultValue,this.setOrgSelDefaultValue);var o=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==o&&o.addEventListener("change",(function(t){""===t.target.value.trim()&&(e.defaultValue="")}))}},computed:{isEditingModal:function(){return+this.indicatorID>0},indicatorID:function(){var e;return(null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID)||null},formID:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryID)||""},nameLabelText:function(){return null===this.parentID?"Section Heading":"Field Name"},showFormatSelect:function(){return null!==this.parentID||!0===this.advancedMode||""!==this.format},shortLabelTriggered:function(){return this.name.trim().split(" ").length>3},formatBtnText:function(){return this.showDetailedFormatInfo?"Hide Details":"What's this?"},isMultiOptionQuestion:function(){return this.multianswerFormats.includes(this.format)},fullFormatForPost:function(){var e=this.format;switch(this.format.toLowerCase()){case"grid":this.updateGridJSON(),e=e+"\n"+JSON.stringify(this.gridJSON);break;case"radio":case"checkboxes":case"multiselect":case"dropdown":e=e+"\n"+this.formatIndicatorMultiAnswer();break;case"checkbox":e=e+"\n"+this.singleOptionValue}return e},shortlabelCharsRemaining:function(){return 50-this.description.length},newQuestionSortValue:function(){var e="#drop_area_parent_".concat(this.parentID," > li");return null===this.parentID?this.focusedFormTree.length-128:Array.from(document.querySelectorAll(e)).length-128}},methods:{setOrgSelDefaultValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.defaultValue=e.selection.toString())},toggleSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"showDetailedFormatInfo";"boolean"==typeof this[t]&&(this[t]=!this[t])},getFormParentIDs:function(){var e=this;return new Promise((function(t,o){$.ajax({type:"GET",url:"".concat(e.APIroot,"/form/_").concat(e.formID,"/flat"),success:function(e){for(var o in e)e[o][1].name=XSSHelpers.stripAllTags(e[o][1].name);t(e)},error:function(e){return o(e)}})}))},preventSelectionIfFormatNone:function(){""!==this.format||!0!==this.required&&!0!==this.is_sensitive||(this.required=!1,this.is_sensitive=!1,alert('You can\'t mark a field as sensitive or required if the Input Format is "None".'))},onSave:function(){var e=this,t=document.querySelector(".trumbowyg-editor");null!=t&&(this.name=t.innerHTML);var o=[];if(this.isEditingModal){var n,i,r,a,l,s,c,d,u,p=this.name!==(null===(n=this.dialogData)||void 0===n?void 0:n.indicator.name),m=this.description!==(null===(i=this.dialogData)||void 0===i?void 0:i.indicator.description),h=null!==(r=this.dialogData)&&void 0!==r&&null!==(r=r.indicator)&&void 0!==r&&r.options?"\n"+(null===(a=this.dialogData)||void 0===a||null===(a=a.indicator)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.join("\n")):"",f=this.fullFormatForPost!==(null===(l=this.dialogData)||void 0===l?void 0:l.indicator.format)+h,v=this.decodeAndStripHTML(this.defaultValue)!==this.decodeAndStripHTML(null===(s=this.dialogData)||void 0===s?void 0:s.indicator.default),g=+this.required!==parseInt(null===(c=this.dialogData)||void 0===c?void 0:c.indicator.required),y=+this.is_sensitive!==parseInt(null===(d=this.dialogData)||void 0===d?void 0:d.indicator.is_sensitive),I=this.parentID!==(null===(u=this.dialogData)||void 0===u?void 0:u.indicator.parentID),b=!0===this.archived,D=!0===this.deleted;p&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/name"),data:{name:this.name,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind name post err",e)}})),m&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/description"),data:{description:this.description,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind desciption post err",e)}})),f&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/format"),data:{format:this.fullFormatForPost,CSRFToken:this.CSRFToken},success:function(e){"size limit exceeded"===e&&alert("The input format was not saved because it was too long.\nIf you require extended length, please submit a YourIT ticket.")},error:function(e){return console.log("ind format post err",e)}})),v&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/default"),data:{default:this.defaultValue,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind default value post err",e)}})),g&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/required"),data:{required:this.required?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind required post err",e)}})),y&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/sensitive"),data:{is_sensitive:this.is_sensitive?1:0,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind is_sensitive post err",e)}})),y&&!0===this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),b&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:1,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (archive) post err",e)}})),D&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/disabled"),data:{disabled:2,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind disabled (deletion) post err",e)}})),I&&this.parentID!==this.indicatorID&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/parentID"),data:{parentID:this.parentID,CSRFToken:this.CSRFToken},error:function(e){return console.log("ind parentID post err",e)}}))}else this.is_sensitive&&1!=+this.focusedFormRecord.needToKnow&&o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:1,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){var e=document.querySelector("select#needToKnow");null!==e&&(e.value=1,e.dispatchEvent(new Event("change")))},error:function(e){return console.log("set form need to know post err",e)}})),o.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/newIndicator"),data:{name:this.name,format:this.fullFormatForPost,description:this.description,default:this.defaultValue,parentID:this.parentID,categoryID:this.formID,required:this.required?1:0,is_sensitive:this.is_sensitive?1:0,sort:this.newQuestionSortValue,CSRFToken:this.CSRFToken},success:function(e){},error:function(e){return console.log("error posting new question",e)}}));Promise.all(o).then((function(t){t.length>0&&(e.getFormByCategoryID(e.formID),e.showLastUpdate("form_properties_last_update")),e.closeFormDialog()})).catch((function(e){return console.log("an error has occurred",e)}))},radioBehavior:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null==e?void 0:e.target.id;"archived"===t.toLowerCase()&&this.deleted&&(document.getElementById("deleted").checked=!1,this.deleted=!1),"deleted"===t.toLowerCase()&&this.archived&&(document.getElementById("archived").checked=!1,this.archived=!1)},appAddCell:function(){this.gridJSON.push({})},formatGridDropdown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(null!==e&&0!==e.length){var o=e.replaceAll(/,/g,"").split("\n");o=(o=o.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),t=Array.from(new Set(o))}return t},updateGridJSON:function(){var e=this,t=[],o=document.getElementById("gridcell_col_parent");Array.from(o.querySelectorAll("div.cell")).forEach((function(o){var n,i,r,a,l=o.id,s=((null===(n=document.getElementById("gridcell_type_"+l))||void 0===n?void 0:n.value)||"").toLowerCase(),c=new Object;if(c.id=l,c.name=(null===(i=document.getElementById("gridcell_title_"+l))||void 0===i?void 0:i.value)||"No Title",c.type=s,"dropdown"===s){var d=document.getElementById("gridcell_options_"+l);c.options=e.formatGridDropdown(d.value||"")}"dropdown_file"===s&&(c.file=null===(r=document.getElementById("dropdown_file_select_"+l))||void 0===r?void 0:r.value,c.hasHeader=Boolean(null===(a=document.getElementById("dropdown_file_header_select_"+l))||void 0===a?void 0:a.value)),t.push(c)})),this.gridJSON=t},formatIndicatorMultiAnswer:function(){var e=this.multiOptionValue.split("\n");return e=(e=e.map((function(e){return e.trim()}))).map((function(e){return"no"===e?"No":e})),Array.from(new Set(e)).join("\n")},advNameEditorClick:function(){$("#advNameEditor").css("display","none"),$("#rawNameEditor").css("display","block"),$("#name").trumbowyg({resetCss:!0,btns:["formatting","bold","italic","underline","|","unorderedList","orderedList","|","link","|","foreColor","|","justifyLeft","justifyCenter","justifyRight"]}),$(".trumbowyg-box").css({"min-height":"130px","max-width":"700px",margin:"0.5rem 0"}),$(".trumbowyg-editor, .trumbowyg-texteditor").css({"min-height":"100px",height:"100px",padding:"1rem"})},rawNameEditorClick:function(){$("#advNameEditor").css("display","block"),$("#rawNameEditor").css("display","none"),$("#name").trumbowyg("destroy")}},watch:{format:function(e,t){var o=this;if(this.defaultValue="",this.orgchartFormats.includes(e)){var n=e.slice(e.indexOf("_")+1);this.initializeOrgSelector(n,this.indicatorID,"modal_","",this.setOrgSelDefaultValue);var i=document.querySelector("#modal_orgSel_".concat(this.indicatorID," input"));null!==i&&i.addEventListener("change",(function(e){""===e.target.value.trim()&&(o.defaultValue="")}))}}},template:'

      \n
      \n \n \n
      \n \n \n
      \n
      \n
      \n
      \n \n
      {{shortlabelCharsRemaining}}
      \n
      \n \n
      \n
      \n
      \n \n
      \n \n \n
      \n
      \n

      Format Information

      \n {{ format !== \'\' ? formatInfo[format] : \'No format. Indicators without a format are often used to provide additional information for the user. They are often used for form section headers.\' }}\n
      \n
      \n
      \n \n \n
      \n
      \n \n \n
      \n
      \n \n
      \n
      \n  Columns ({{gridJSON.length}}):\n
      \n
      \n \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n Attributes\n
      \n \n \n
      \n \n \n \n This field will be archived.  It can be
      re-enabled by using Restore Fields.\n
      \n \n Deleted items can only be re-enabled
      within 30 days by using Restore Fields.\n
      \n
      \n
      '},l={name:"advanced-options-dialog",data:function(){var e,t;return{requiredDataProperties:["indicatorID","html","htmlPrint"],initialFocusElID:"#advanced legend",left:"{{",right:"}}",codeEditorHtml:{},codeEditorHtmlPrint:{},html:(null===(e=this.dialogData)||void 0===e?void 0:e.html)||"",htmlPrint:(null===(t=this.dialogData)||void 0===t?void 0:t.htmlPrint)||""}},inject:["APIroot","libsPath","CSRFToken","setDialogSaveFunction","dialogData","checkRequiredData","closeFormDialog","focusedFormRecord","getFormByCategoryID","hasDevConsoleAccess"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){var e;null===(e=document.querySelector(this.initialFocusElID))||void 0===e||e.focus(),1==+this.hasDevConsoleAccess&&this.setupAdvancedOptions()},computed:{indicatorID:function(){var e;return null===(e=this.dialogData)||void 0===e?void 0:e.indicatorID},formID:function(){return this.focusedFormRecord.categoryID}},methods:{setupAdvancedOptions:function(){var e=this;this.codeEditorHtml=CodeMirror.fromTextArea(document.getElementById("html"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTML()}}}),this.codeEditorHtmlPrint=CodeMirror.fromTextArea(document.getElementById("htmlPrint"),{mode:"htmlmixed",lineNumbers:!0,extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-S":function(t){e.saveCodeHTMLPrint()}}}),$(".CodeMirror").css("border","1px solid black")},saveCodeHTML:function(){var e=this,t=this.codeEditorHtml.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:t,CSRFToken:this.CSRFToken},success:function(){e.html=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_html").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},saveCodeHTMLPrint:function(){var e=this,t=this.codeEditorHtmlPrint.getValue();$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:t,CSRFToken:this.CSRFToken},success:function(){e.htmlPrint=t;var o=(new Date).toLocaleTimeString();document.getElementById("codeSaveStatus_htmlPrint").innerHTML=", Last saved: "+o,e.getFormByCategoryID(e.formID)},error:function(e){return console.log(e)}})},onSave:function(){var e=this,t=[],o=this.html!==this.codeEditorHtml.getValue(),n=this.htmlPrint!==this.codeEditorHtmlPrint.getValue();o&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/html"),data:{html:this.codeEditorHtml.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind html post err",e)}})),n&&t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.indicatorID,"/htmlPrint"),data:{htmlPrint:this.codeEditorHtmlPrint.getValue(),CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind htmlPrint post err",e)}})),Promise.all(t).then((function(t){e.closeFormDialog(),t.length>0&&e.getFormByCategoryID(e.formID)})).catch((function(e){return console.log("an error has occurred",e)}))}},template:'
      \n
      Template Variables and Controls\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      {{ left }} iID {{ right }}The indicatorID # of the current data field.Ctrl-SSave the focused section
      {{ left }} recordID {{ right }}The record ID # of the current request.F11Toggle Full Screen mode for the focused section
      {{ left }} data {{ right }}The contents of the current data field as stored in the database.EscEscape Full Screen mode

      \n
      \n html (for pages where the user can edit data): \n \n
      \n
      \n
      \n htmlPrint (for pages where the user can only read data): \n \n
      \n \n
      \n
      \n
      \n Notice:
      \n

      Please go to LEAF Programmer\n to ensure continued access to this area.

      \n
      '};var s=o(491);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function u(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const p={name:"staple-form-dialog",data:function(){var e;return{requiredDataProperties:["mainFormID"],mainFormID:(null===(e=this.dialogData)||void 0===e?void 0:e.mainFormID)||"",catIDtoStaple:""}},inject:["APIroot","CSRFToken","setDialogSaveFunction","truncateText","decodeAndStripHTML","categories","dialogData","checkRequiredData","closeFormDialog","updateStapledFormsInfo"],created:function(){this.setDialogSaveFunction(this.onSave),this.checkRequiredData(this.requiredDataProperties)},mounted:function(){if(this.isSubform&&this.closeFormDialog(),this.mergeableForms.length>0){var e=document.getElementById("select-form-to-staple");null!==e&&e.focus()}},computed:{isSubform:function(){var e;return""!==(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.parentID)},currentStapleIDs:function(){var e;return(null===(e=this.categories[this.mainFormID])||void 0===e?void 0:e.stapledFormIDs)||[]},mergeableForms:function(){var e=this,t=[],o=function(){var o=parseInt(e.categories[n].workflowID),i=e.categories[n].categoryID,r=e.categories[n].parentID,a=e.currentStapleIDs.every((function(e){return e!==i}));0===o&&""===r&&i!==e.mainFormID&&a&&t.push(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"";$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(o){e.updateStapledFormsInfo(e.mainFormID,t,!0)},error:function(e){return console.log(e)}})},onSave:function(){var e=this;""!==this.catIDtoStaple&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.mainFormID,"/stapled"),data:{CSRFToken:this.CSRFToken,stapledCategoryID:this.catIDtoStaple},success:function(t){1!=+t?alert(t):(e.updateStapledFormsInfo(e.mainFormID,e.catIDtoStaple),e.catIDtoStaple="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      Stapled forms will show up on the same page as the primary form.

      \n

      The order of the forms will be determined by the forms\' assigned sort values.

      \n
      \n
        \n
      • \n {{truncateText(decodeAndStripHTML(categories[id]?.categoryName || \'Untitled\')) }}\n \n
      • \n
      \n

      \n
      \n \n
      There are no available forms to merge
      \n
      \n
      '},m={name:"edit-collaborators-dialog",data:function(){return{formID:this.focusedFormRecord.categoryID,group:"",allGroups:[],collaborators:[]}},inject:["APIroot","CSRFToken","setDialogSaveFunction","categories","focusedFormRecord","checkFormCollaborators","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},mounted:function(){var e=this,t=[$.ajax({type:"GET",url:"".concat(this.APIroot,"system/groups"),success:function(t){e.allGroups=t},error:function(e){return console.log(e)},cache:!1}),$.ajax({type:"GET",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),success:function(t){e.collaborators=t},error:function(e){return console.log(e)},cache:!1})];Promise.all(t).then((function(){var e=document.getElementById("selectFormCollaborators");null!==e&&e.focus()})).catch((function(e){return console.log("an error has occurred",e)}))},beforeUnmount:function(){this.checkFormCollaborators()},computed:{availableGroups:function(){var e=[];return this.collaborators.map((function(t){return e.push(parseInt(t.groupID))})),this.allGroups.filter((function(t){return!e.includes(parseInt(t.groupID))}))}},methods:{removePermission:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:t,read:0,write:0},success:function(o){e.collaborators=e.collaborators.filter((function(e){return parseInt(e.groupID)!==t}))},error:function(e){return console.log(e)}})},formNameStripped:function(){var e=this.categories[this.formID].categoryName;return XSSHelpers.stripAllTags(e)||"Untitled"},onSave:function(){var e=this;""!==this.group&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/_").concat(this.formID,"/privileges"),data:{CSRFToken:this.CSRFToken,groupID:parseInt(this.group.groupID),read:1,write:1},success:function(t){void 0===e.collaborators.find((function(t){return parseInt(t.groupID)===parseInt(e.group.groupID)}))&&(e.collaborators.push({groupID:e.group.groupID,name:e.group.name}),e.group="")},error:function(e){return console.log(e)},cache:!1})}},template:'
      \n

      {{formNameStripped()}}

      \n

      Collaborators have access to fill out data fields at any time in the workflow.

      \n

      This is typically used to give groups access to fill out internal-use fields.

      \n
      \n \n

      \n
      \n \n
      There are no available groups to add
      \n
      \n
      '},h={name:"confirm-delete-dialog",inject:["APIroot","CSRFToken","setDialogSaveFunction","decodeAndStripHTML","focusedFormRecord","getFormByCategoryID","removeCategory","closeFormDialog"],created:function(){this.setDialogSaveFunction(this.onSave)},computed:{formName:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryName))},formDescription:function(){return XSSHelpers.stripAllTags(this.decodeAndStripHTML(this.focusedFormRecord.categoryDescription))},currentStapleIDs:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e?void 0:e.stapledFormIDs)||[]}},methods:{onSave:function(){var e=this;if(0===this.currentStapleIDs.length){var t=this.focusedFormRecord.categoryID,o=this.focusedFormRecord.parentID;$.ajax({type:"DELETE",url:"".concat(this.APIroot,"formStack/_").concat(t,"?")+$.param({CSRFToken:this.CSRFToken}),success:function(n){1==+n?(e.removeCategory(t),""===o?e.$router.push({name:"browser"}):e.getFormByCategoryID(o,!0),e.closeFormDialog()):alert(n)},error:function(e){return console.log("an error has occurred",e)}})}else alert("Please remove all stapled forms before deleting.")}},template:'
      \n
      Are you sure you want to delete this form?
      \n
      {{formName}}
      \n
      {{formDescription}}
      \n
      ⚠️ This form still has stapled forms attached
      \n
      '};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function v(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function g(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:0;this.parentIndID=e,this.selectedParentValueOptions.includes(this.selectedParentValue)||(this.selectedParentValue="")},updateSelectedOutcome:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.selectedOutcome=e.toLowerCase(),this.selectedChildValue="",this.crosswalkFile="",this.crosswalkHasHeader=!1,this.level2IndID=null,"pre-fill"===this.selectedOutcome&&this.addOrgSelector()},updateSelectedOptionValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parent",o="";if(!0===(null==e?void 0:e.multiple)?(Array.from(e.selectedOptions).forEach((function(e){o+=e.label.trim()+"\n"})),o=o.trim()):o=e.value.trim(),"parent"===t.toLowerCase()){if(this.selectedParentValue=XSSHelpers.stripAllTags(o),"number"===this.parentFormat||"currency"===this.parentFormat)if(/^(\d*)(\.\d+)?$/.test(o)){var n=parseFloat(o);this.selectedParentValue="currency"===this.parentFormat?(Math.round(100*n)/100).toFixed(2):String(n)}else this.selectedParentValue=""}else"child"===t.toLowerCase()&&(this.selectedChildValue=XSSHelpers.stripAllTags(o))},newCondition:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selectedConditionJSON="",this.showConditionEditor=e,this.selectedOperator="",this.parentIndID=0,this.selectedParentValue="",this.selectedOutcome="",this.selectedChildValue=""},postConditions:function(){var e,t=this,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.conditionComplete||!1===o){var n=(e=this.savedConditions,function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).filter((function(e){return JSON.stringify(e)!==t.selectedConditionJSON}));n.forEach((function(e){e.childIndID=parseInt(e.childIndID),e.parentIndID=parseInt(e.parentIndID),e.selectedChildValue=XSSHelpers.stripAllTags(e.selectedChildValue),e.selectedParentValue=XSSHelpers.stripAllTags(e.selectedParentValue)}));var i=JSON.stringify(this.conditions),r=n.every((function(e){return JSON.stringify(e)!==i}));!0===o&&r&&n.push(this.conditions),n=n.length>0?JSON.stringify(n):"",$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/").concat(this.childIndID,"/conditions"),data:{conditions:n,CSRFToken:this.CSRFToken},success:function(e){"Invalid Token."!==e?(t.getFormByCategoryID(t.formID),t.indicators.find((function(e){return e.indicatorID===t.childIndID})).conditions=n,t.showRemoveModal=!1,t.newCondition(!1)):console.log("error adding condition",e)},error:function(e){return console.log(e)}})}},removeCondition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.confirmDelete,o=void 0!==t&&t,n=e.condition,i=void 0===n?{}:n;!0===o?this.postConditions(!1):(this.selectConditionFromList(i),this.showRemoveModal=!0)},selectConditionFromList:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selectedConditionJSON=JSON.stringify(e),this.parentIndID=parseInt((null==e?void 0:e.parentIndID)||0),this.selectedOperator=(null==e?void 0:e.selectedOp)||"",this.selectedOutcome=((null==e?void 0:e.selectedOutcome)||"").toLowerCase(),this.selectedParentValue=(null==e?void 0:e.selectedParentValue)||"",this.selectedChildValue=(null==e?void 0:e.selectedChildValue)||"",this.crosswalkFile=(null==e?void 0:e.crosswalkFile)||"",this.crosswalkHasHeader=(null==e?void 0:e.crosswalkHasHeader)||!1,this.level2IndID=(null==e?void 0:e.level2IndID)||null,this.showConditionEditor=!0,this.addOrgSelector()},getIndicatorName:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=(null===(e=this.indicators.find((function(e){return parseInt(e.indicatorID)===t})))||void 0===e?void 0:e.name)||"";return o=this.decodeAndStripHTML(o),this.truncateText(o)},getOperatorText:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.parentFormat.toLowerCase(),o=e.selectedOp,n=e.selectedOp;switch(n){case"==":o=this.multiOptionFormats.includes(t)?"includes":"is";break;case"!=":o=this.multiOptionFormats.includes(t)?"does not include":"is not";break;case"gt":case"gte":case"lt":case"lte":var i=n.includes("g")?"greater than":"less than",r=n.includes("e")?" or equal to":"";o="is ".concat(i).concat(r)}return o},isOrphan:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=parseInt((null==e?void 0:e.parentIndID)||0);return"crosswalk"!==e.selectedOutcome.toLowerCase()&&!this.selectableParents.some((function(e){return parseInt(e.indicatorID)===t}))},listHeaderText:function(){var e="";switch((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase()){case"show":e="This field will be hidden except:";break;case"hide":e="This field will be shown except:";break;case"prefill":e="This field will be pre-filled:";break;case"crosswalk":e="This field has loaded dropdown(s)"}return e},childFormatChangedSinceSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=((null==e?void 0:e.childFormat)||"").toLowerCase().trim(),o=((null==e?void 0:e.parentFormat)||"").toLowerCase().trim(),n=parseInt((null==e?void 0:e.parentIndID)||0),i=this.selectableParents.find((function(e){return e.indicatorID===n})),r=(null==i?void 0:i.format)||"";return t!==this.childFormat||o!==r},updateChoicesJS:function(){var e=this;setTimeout((function(){var t,o=document.querySelector("#child_choices_wrapper > div.choices"),n=document.getElementById("parent_compValue_entry_multi"),i=document.getElementById("child_prefill_entry_multi"),r=e.conditions.selectedOutcome;if(e.multiOptionFormats.includes(e.parentFormat)&&null!==n&&!0!==(null==n||null===(t=n.choicesjs)||void 0===t?void 0:t.initialised)){var a=e.conditions.selectedParentValue.split("\n")||[];a=a.map((function(t){return e.decodeAndStripHTML(t).trim()}));var l=e.selectedParentValueOptions;l=l.map((function(e){return{value:e.trim(),label:e.trim(),selected:a.includes(e.trim())}}));var s=new Choices(n,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});n.choicesjs=s}if("pre-fill"===r&&e.multiOptionFormats.includes(e.childFormat)&&null!==i&&null===o){var c=e.conditions.selectedChildValue.split("\n")||[];c=c.map((function(t){return e.decodeAndStripHTML(t).trim()}));var d=e.selectedChildValueOptions;d=d.map((function(e){return{value:e.trim(),label:e.trim(),selected:c.includes(e.trim())}}));var u=new Choices(i,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:d.filter((function(e){return""!==e.value}))});i.choicesjs=u}}))},addOrgSelector:function(){var e=this;if("pre-fill"===this.selectedOutcome&&this.orgchartFormats.includes(this.childFormat)){var t=this.childFormat.slice(this.childFormat.indexOf("_")+1);setTimeout((function(){e.initializeOrgSelector(t,e.childIndID,"ifthen_child_",e.selectedChildValue,e.setOrgSelChildValue)}))}},setOrgSelChildValue:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.selection&&(this.orgchartSelectData=e.selectionData[e.selection],this.selectedChildValue=e.selection.toString())},onSave:function(){this.postConditions(!0)}},computed:{formID:function(){return this.focusedFormRecord.categoryID},showSetup:function(){return this.showConditionEditor&&this.selectedOutcome&&("crosswalk"===this.selectedOutcome||this.selectableParents.length>0)},noOptions:function(){return!["","crosswalk"].includes(this.selectedOutcome)&&this.selectableParents.length<1},childIndID:function(){return this.dialogData.indicatorID},childIndicator:function(){var e=this;return this.indicators.find((function(t){return t.indicatorID===e.childIndID}))},selectedParentIndicator:function(){var e=this,t=this.selectableParents.find((function(t){return t.indicatorID===parseInt(e.parentIndID)}));return void 0===t?{}:function(e){for(var t=1;t1?"s":"";i="".concat(r," '").concat(this.decodeAndStripHTML(this.selectedChildValue),"'");break;default:i=" '".concat(this.decodeAndStripHTML(this.selectedChildValue),"'")}return i},childChoicesKey:function(){return this.selectedConditionJSON+this.selectedOutcome},parentChoicesKey:function(){return this.selectedConditionJSON+String(this.parentIndID)+this.selectedOperator},conditions:function(){var e,t;return{childIndID:parseInt((null===(e=this.childIndicator)||void 0===e?void 0:e.indicatorID)||0),parentIndID:parseInt((null===(t=this.selectedParentIndicator)||void 0===t?void 0:t.indicatorID)||0),selectedOp:this.selectedOperator,selectedParentValue:XSSHelpers.stripAllTags(this.selectedParentValue),selectedChildValue:XSSHelpers.stripAllTags(this.selectedChildValue),selectedOutcome:this.selectedOutcome.toLowerCase(),crosswalkFile:this.crosswalkFile,crosswalkHasHeader:this.crosswalkHasHeader,level2IndID:this.level2IndID,childFormat:this.childFormat,parentFormat:this.parentFormat}},conditionComplete:function(){var e=this.conditions,t=e.parentIndID,o=e.selectedOp,n=e.selectedParentValue,i=e.selectedChildValue,r=e.selectedOutcome,a=e.crosswalkFile,l=!1;if(!this.showRemoveModal)switch(r){case"pre-fill":l=0!==t&&""!==o&&""!==n&&""!==i;break;case"hide":case"show":l=0!==t&&""!==o&&""!==n;break;case"crosswalk":l=""!==a}var s=document.getElementById("button_save");return null!==s&&(s.style.display=!0===l?"block":"none"),l},savedConditions:function(){return"string"==typeof this.childIndicator.conditions&&"["===this.childIndicator.conditions[0]?JSON.parse(this.childIndicator.conditions):[]},conditionTypes:function(){return{show:this.savedConditions.filter((function(e){return"show"===e.selectedOutcome.toLowerCase()})),hide:this.savedConditions.filter((function(e){return"hide"===e.selectedOutcome.toLowerCase()})),prefill:this.savedConditions.filter((function(e){return"pre-fill"===e.selectedOutcome.toLowerCase()})),crosswalk:this.savedConditions.filter((function(e){return"crosswalk"===e.selectedOutcome.toLowerCase()}))}}},watch:{showRemoveModal:function(e){var t=document.getElementById("leaf-vue-dialog-cancel-save");null!==t&&(t.style.display=!0===e?"none":"flex")},childChoicesKey:function(e,t){"pre-fill"==this.selectedOutcome.toLowerCase()&&this.multiOptionFormats.includes(this.childFormat)&&this.updateChoicesJS()},parentChoicesKey:function(e,t){this.multiOptionFormats.includes(this.parentFormat)&&this.updateChoicesJS()},selectedOperator:function(e,t){""!==t&&this.numericOperators.includes(e)&&!this.numericOperators.includes(t)&&(this.selectedParentValue="")}},template:'
      \n \x3c!-- LOADING SPINNER --\x3e\n
      \n Loading... loading...\n
      \n
      \n \x3c!-- NOTE: DELETION DIALOG --\x3e\n
      \n
      Choose Delete to confirm removal, or cancel to return
      \n
      \n \n \n
      \n
      \n \n
      \n
      '};function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function D(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function w(e){for(var t=1;t\n
      \n

      This is a Nationally Standardized Subordinate Site

      \n Do not make modifications!  Synchronization problems will occur.  Please contact your process POC if modifications need to be made.\n
    '},k={name:"form-question-display",props:{categoryID:String,depth:Number,formPage:Number,index:Number,formNode:Object},components:{FormatPreview:{name:"format-preview",data:function(){return{indID:this.indicator.indicatorID}},props:{indicator:Object},inject:["libsPath","initializeOrgSelector","orgchartFormats","decodeAndStripHTML","updateChosenAttributes"],computed:{baseFormat:function(){var e;return(null===(e=this.indicator.format)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim())||""},truncatedOptions:function(){var e;return(null===(e=this.indicator.options)||void 0===e?void 0:e.slice(0,6))||[]},defaultValue:function(){var e;return(null===(e=this.indicator)||void 0===e?void 0:e.default)||""},strippedDefault:function(){return this.decodeAndStripHTML(this.defaultValue||"")},inputElID:function(){return"input_preview_".concat(this.indID)},selType:function(){return this.baseFormat.slice(this.baseFormat.indexOf("_")+1)},labelSelector:function(){return"format_label_"+this.indID},printResponseID:function(){return"xhrIndicator_".concat(this.indID,"_").concat(this.indicator.series)},gridOptions:function(){var e,t=JSON.parse((null===(e=this.indicator)||void 0===e?void 0:e.options)||"[]");return t.map((function(e){e.name=XSSHelpers.stripAllTags(e.name),null!=e&&e.options&&e.options.map((function(e){return XSSHelpers.stripAllTags(e)}))})),t}},mounted:function(){var e,t,o,n,i,r=this;switch(this.baseFormat){case"raw_data":break;case"date":$("#".concat(this.inputElID)).datepicker({autoHide:!0,showAnim:"slideDown",onSelect:function(){$("#"+r.indID+"_focusfix").focus()}}),null===(e=document.getElementById(this.inputElID))||void 0===e||e.setAttribute("aria-labelledby",this.labelSelector);break;case"dropdown":$("#".concat(this.inputElID)).chosen({disable_search_threshold:5,allow_single_deselect:!0,width:"50%"}),this.updateChosenAttributes(this.inputElID,this.labelSelector,"Select Question Option");break;case"multiselect":var a=document.getElementById(this.inputElID);if(null!==a&&!0===a.multiple&&"active"!==(null==a?void 0:a.getAttribute("data-choice"))){var l=this.indicator.options||[];l=l.map((function(e){return{value:e,label:e,selected:""!==r.strippedDefault&&r.strippedDefault===e}}));var s=new Choices(a,{allowHTML:!1,removeItemButton:!0,editItems:!0,choices:l.filter((function(e){return""!==e.value}))});a.choicesjs=s}document.querySelector("#".concat(this.inputElID," ~ input.choices__input")).setAttribute("aria-labelledby",this.labelSelector);break;case"orgchart_group":case"orgchart_position":case"orgchart_employee":this.initializeOrgSelector(this.selType,this.indID,"",(null===(t=this.indicator)||void 0===t?void 0:t.default)||"");break;case"checkbox":null===(o=document.getElementById(this.inputElID+"_check0"))||void 0===o||o.setAttribute("aria-labelledby",this.labelSelector);break;case"checkboxes":case"radio":null===(n=document.querySelector("#".concat(this.printResponseID," .format-preview")))||void 0===n||n.setAttribute("aria-labelledby",this.labelSelector);break;default:null===(i=document.getElementById(this.inputElID))||void 0===i||i.setAttribute("aria-labelledby",this.labelSelector)}},methods:{useAdvancedEditor:function(){$("#"+this.inputElID).trumbowyg({btns:["bold","italic","underline","|","unorderedList","orderedList","|","justifyLeft","justifyCenter","justifyRight","fullscreen"]}),$("#textarea_format_button_".concat(this.indID)).css("display","none")}},template:'
    \n \n \n\n \n\n \n\n \n\n \n\n \n \n
    File Attachment(s)\n

    Select File to attach:

    \n \n
    \n\n \n\n \n \n \n \n \n\n \n
    '}},inject:["libsPath","newQuestion","shortIndicatorNameStripped","focusedFormID","focusIndicator","focusedIndicatorID","editQuestion","hasDevConsoleAccess","editAdvancedOptions","openIfThenDialog","listTracker","previewMode","handleNameClick","makePreviewKey","moveListItem"],computed:{indicatorID:function(){var e;return+(null===(e=this.formNode)||void 0===e?void 0:e.indicatorID)},isHeader:function(){return 0===this.depth},sensitiveImg:function(){return this.sensitive?''):""},hasCode:function(){var e,t;return""!==(null===(e=this.formNode)||void 0===e?void 0:e.html)||""!==(null===(t=this.formNode)||void 0===t?void 0:t.htmlPrint)},conditionalQuestion:function(){return!this.isHeader&&null!==this.formNode.conditions&&""!==this.formNode.conditions&"null"!==this.formNode.conditions},conditionsAllowed:function(){return!this.isHeader&&"raw_data"!==(this.formNode.format||"").toLowerCase()},indicatorName:function(){var e,t=0===this.depth?'
    '.concat(this.formPage+1,"
    "):"",o=this.required?'* Required':"",n=this.sensitive?'* Sensitive '.concat(this.sensitiveImg):"",i=""===((null===(e=this.formNode)||void 0===e?void 0:e.description)||"")||this.previewMode?"":' ('.concat(this.formNode.description,")"),r=0===this.depth&&this.formNode.categoryID!==this.focusedFormID?'📌 ':"",a=""!==this.formNode.name.trim()?this.formNode.name.trim():"[ blank ]";return"".concat(t).concat(r).concat(a).concat(i).concat(o).concat(n)},required:function(){return 1===parseInt(this.formNode.required)},sensitive:function(){return 1===parseInt(this.formNode.is_sensitive)}},template:'
    \n
    \n \x3c!-- VISIBLE DRAG INDICATOR / UP DOWN --\x3e\n \n \x3c!-- NAME --\x3e\n
    \n
    \n\n \x3c!-- TOOLBAR --\x3e\n
    \n\n
    \n \n \n \n \n
    \n \n
    \n
    \n\n \x3c!-- FORMAT PREVIEW --\x3e\n \n
    '},T={name:"form-index-listing",props:{categoryID:String,formPage:Number,depth:Number,indicatorID:Number,formNode:Object,index:Number,parentID:Number},components:{FormQuestionDisplay:k},inject:["shortIndicatorNameStripped","clearListItem","addToListTracker","focusedIndicatorID","previewMode","startDrag","onDragEnter","onDragLeave","onDrop","moveListItem","makePreviewKey","newQuestion"],mounted:function(){this.previewMode||this.addToListTracker(this.formNode,this.parentID,this.index)},beforeUnmount:function(){this.clearListItem(this.formNode.indicatorID)},computed:{suffix:function(){return"".concat(this.formNode.indicatorID,"_").concat(this.formNode.series)},printResponseID:function(){return"xhrIndicator_".concat(this.suffix)},required:function(){return 1===parseInt(this.formNode.required)}},template:'
  • \n
    \n \n \n \n \x3c!-- NOTE: ul for drop zones --\x3e\n
      \n\n \n
    \n
    \n \n
  • '},_={name:"edit-properties-panel",data:function(){var e,t,o,n,i,r,a,l,s,c;return{categoryName:this.decodeAndStripHTML((null===(e=this.focusedFormRecord)||void 0===e?void 0:e.categoryName)||"Untitled"),categoryDescription:this.decodeAndStripHTML((null===(t=this.focusedFormRecord)||void 0===t?void 0:t.categoryDescription)||""),workflowID:parseInt(null===(o=this.focusedFormRecord)||void 0===o?void 0:o.workflowID)||0,needToKnow:parseInt(null===(n=this.focusedFormRecord)||void 0===n?void 0:n.needToKnow)||0,visible:parseInt(null===(i=this.focusedFormRecord)||void 0===i?void 0:i.visible)||0,type:(null===(r=this.focusedFormRecord)||void 0===r?void 0:r.type)||"",formID:(null===(a=this.focusedFormRecord)||void 0===a?void 0:a.categoryID)||"",formParentID:(null===(l=this.focusedFormRecord)||void 0===l?void 0:l.parentID)||"",destructionAgeYears:(null===(s=this.focusedFormRecord)||void 0===s?void 0:s.destructionAge)>0?(null===(c=this.focusedFormRecord)||void 0===c?void 0:c.destructionAge)/365:null,workflowsLoading:!0,workflowRecords:[]}},props:{hasCollaborators:Boolean},created:function(){this.getWorkflowRecords()},inject:["APIroot","CSRFToken","appIsLoadingForm","allStapledFormCatIDs","focusedFormRecord","focusedFormIsSensitive","updateCategoriesProperty","openEditCollaboratorsDialog","openFormHistoryDialog","showLastUpdate","truncateText","decodeAndStripHTML"],computed:{loading:function(){return this.appIsLoadingForm||this.workflowsLoading},workflowDescription:function(){var e=this,t="";if(0!==this.workflowID){var o=this.workflowRecords.find((function(t){return parseInt(t.workflowID)===e.workflowID}));t=(null==o?void 0:o.description)||""}return t},isSubForm:function(){return""!==this.focusedFormRecord.parentID},isStaple:function(){return this.allStapledFormCatIDs.includes(this.formID)},isNeedToKnow:function(){return 1===parseInt(this.focusedFormRecord.needToKnow)},formNameCharsRemaining:function(){return 50-this.categoryName.length},formDescrCharsRemaining:function(){return 255-this.categoryDescription.length}},methods:{getWorkflowRecords:function(){var e=this;$.ajax({type:"GET",url:"".concat(this.APIroot,"workflow"),success:function(t){e.workflowRecords=t||[],e.workflowsLoading=!1},error:function(e){return console.log(e)}})},updateName:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formName"),data:{name:XSSHelpers.stripAllTags(this.categoryName),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryName",e.categoryName),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("name post err",e)}})},updateDescription:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formDescription"),data:{description:XSSHelpers.stripAllTags(this.categoryDescription),categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"categoryDescription",e.categoryDescription),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("form description post err",e)}})},updateWorkflow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formWorkflow"),data:{workflowID:this.workflowID,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){!1===t?alert("The workflow could not be set because this form is stapled to another form"):(e.updateCategoriesProperty(e.formID,"workflowID",e.workflowID),e.updateCategoriesProperty(e.formID,"workflowDescription",e.workflowDescription),e.showLastUpdate("form_properties_last_update"))},error:function(e){return console.log("workflow post err",e)}})},updateAvailability:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formVisible"),data:{visible:this.visible,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"visible",e.visible),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("visibility post err",e)}})},updateNeedToKnow:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formNeedToKnow"),data:{needToKnow:this.needToKnow,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"needToKnow",e.needToKnow),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("ntk post err",e)}})},updateType:function(){var e=this;$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/formType"),data:{type:this.type,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(){e.updateCategoriesProperty(e.formID,"type",e.type),e.showLastUpdate("form_properties_last_update")},error:function(e){return console.log("type post err",e)}})},updateDestructionAge:function(){var e=this;(null===this.destructionAgeYears||this.destructionAgeYears>=1&&this.destructionAgeYears<=30)&&$.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/destructionAge"),data:{destructionAge:this.destructionAgeYears,categoryID:this.formID,CSRFToken:this.CSRFToken},success:function(t){var o;if(2==+(null==t||null===(o=t.status)||void 0===o?void 0:o.code)&&+t.data==365*+e.destructionAgeYears){var n=(null==t?void 0:t.data)>0?+t.data:null;e.updateCategoriesProperty(e.formID,"destructionAge",n),e.showLastUpdate("form_properties_last_update")}},error:function(e){return console.log("destruction age post err",e)}})}},template:'
    \n {{formID}}\n (internal for {{formParentID}})\n \n
    \n \n \n \n \n \n
    \n
    \n
    \n \n \n
    \n \n
    This is an Internal Form
    \n
    \n
    '};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function P(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function O(e){for(var t=1;t0){var n,i,r=[];for(var a in this.categories)this.categories[a].parentID===this.currentCategoryQuery.categoryID&&r.push(O({},this.categories[a]));((null===(n=this.currentCategoryQuery)||void 0===n?void 0:n.stapledFormIDs)||[]).forEach((function(e){var n=[];for(var i in t.categories)t.categories[i].parentID===e&&n.push(O({},t.categories[i]));o.push(O(O({},t.categories[e]),{},{formContextType:"staple",internalForms:n}))}));var l=""!==this.currentCategoryQuery.parentID?"internal":this.allStapledFormCatIDs.includes((null===(i=this.currentCategoryQuery)||void 0===i?void 0:i.categoryID)||"")?"staple":"main form";o.push(O(O({},this.currentCategoryQuery),{},{formContextType:l,internalForms:r}))}return o.sort((function(e,t){return e.sort-t.sort}))},formPreviewIDs:function(){var e=[];return this.currentFormCollection.forEach((function(t){e.push(t.categoryID)})),e.join()},usePreviewTree:function(){var e;return(null===(e=this.focusedFormRecord)||void 0===e||null===(e=e.stapledFormIDs)||void 0===e?void 0:e.length)>0&&this.previewMode&&this.focusedFormID===this.queryID},fullFormTree:function(){return this.usePreviewTree?this.previewTree:this.focusedFormTree},firstEditModeIndicator:function(){var e;return(null===(e=this.focusedFormTree)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.indicatorID)||0},sortOrParentChanged:function(){return this.sortValuesToUpdate.length>0||this.parentIDsToUpdate.length>0},sortValuesToUpdate:function(){var e=[];for(var t in this.listTracker)this.listTracker[t].sort!==this.listTracker[t].listIndex-this.sortOffset&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},parentIDsToUpdate:function(){var e=[];for(var t in this.listTracker)""!==this.listTracker[t].newParentID&&this.listTracker[t].parentID!==this.listTracker[t].newParentID&&e.push(O({indicatorID:parseInt(t)},this.listTracker[t]));return e},indexHeaderText:function(){return""!==this.focusedFormRecord.parentID?"Internal Form":this.currentFormCollection.length>1?"Form Layout":"Primary Form"}},methods:{onScroll:function(){var e=document.getElementById("form_entry_and_preview"),t=document.getElementById("form_index_display");if(null!==e&&null!==t){var o=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top,i=(t.style.top||"0").replace("px","");if(this.appIsLoadingForm||window.innerWidth<=600||0==+i&&o>0)t.style.top=0;else{var r=Math.round(-n-8);t.style.top=r<0?0:r+"px"}}},focusFirstIndicator:function(){var e=document.getElementById("edit_indicator_".concat(this.firstEditModeIndicator));null!==e&&e.focus()},getFormFromQueryParam:function(){if(!0===/^form_[0-9a-f]{5}$/i.test(this.queryID||"")){var e=this.queryID;if(void 0===this.categories[e])this.focusedFormID="",this.focusedFormTree=[];else{var t=this.categories[e].parentID;""===t?this.getFormByCategoryID(e,!0):this.$router.push({name:"category",query:{formID:t}})}}else this.$router.push({name:"browser"})},getFormByCategoryID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];""===t?(this.focusedFormID="",this.focusedFormTree=[]):(this.appIsLoadingForm=o,this.setDefaultAjaxResponseMessage(),$.ajax({type:"GET",url:"".concat(this.APIroot,"form/_").concat(t,"?childkeys=nonnumeric"),success:function(o){e.focusedFormID===t&&(e.updateKey+=1),e.focusedFormID=t||"",e.focusedFormTree=o||[],e.appIsLoadingForm=!1},error:function(e){return console.log(e)}}))},getPreviewTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(""!==t&&""!==this.formPreviewIDs){this.appIsLoadingForm=!0,this.setDefaultAjaxResponseMessage();try{fetch("".concat(this.APIroot,"form/specified?childkeys=nonnumeric&categoryIDs=").concat(this.formPreviewIDs)).then((function(o){o.json().then((function(o){var n;2===(null==o||null===(n=o.status)||void 0===n?void 0:n.code)?(e.previewTree=o.data||[],e.focusedFormID=t):console.log(o),e.appIsLoadingForm=!1})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},getIndicatorByID:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(o,n){try{fetch("".concat(e.APIroot,"formEditor/indicator/").concat(t)).then((function(e){e.json().then((function(e){o(e[t])})).catch((function(e){return n(e)}))})).catch((function(e){return n(e)}))}catch(e){n(e)}}))},getFileManagerTextFiles:function(){var e=this;try{fetch("".concat(this.APIroot,"system/files")).then((function(t){t.json().then((function(t){var o=t||[];e.fileManagerTextFiles=o.filter((function(e){return e.indexOf(".txt")>-1||e.indexOf(".csv")>-1}))})).catch((function(e){return console.log(e)}))}))}catch(e){console.log(e)}},editAdvancedOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(t){e.openAdvancedOptionsDialog(t)})).catch((function(e){return console.log("error getting indicator information",e)}))},newQuestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.openIndicatorEditingDialog(null,e,{})},editQuestion:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.getIndicatorByID(t).then((function(o){e.focusedIndicatorID=t;var n=(null==o?void 0:o.parentID)||null;e.openIndicatorEditingDialog(t,n,o)})).catch((function(e){return console.log("error getting indicator information",e)}))},checkSensitive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(1===parseInt(e.is_sensitive))return!0;var t=!1;if(e.child)for(var o in e.child)if(!0===(t=this.checkSensitive(e.child[o])||!1))break;return t},focusIndicator:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.focusedIndicatorID=e},toggleToolbars:function(){this.focusedIndicatorID=null,this.previewMode=!this.previewMode,this.updateKey+=1,this.usePreviewTree?this.getPreviewTree(this.focusedFormID):this.previewTree=[]},moveListItem:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.previewMode){var i;32===(null==t?void 0:t.keyCode)&&t.preventDefault();var r=null==t||null===(i=t.currentTarget)||void 0===i?void 0:i.closest("ul"),a=document.getElementById("index_listing_".concat(o)),l=Array.from(document.querySelectorAll("#".concat(r.id," > li"))),s=l.filter((function(e){return e!==a})),c=this.listTracker[o],d=!0===n?-1:1;if(!0===n?c.listIndex>0:c.listIndex0){var o=[];this.sortValuesToUpdate.forEach((function(t){o.push({indicatorID:t.indicatorID,sort:t.listIndex-e.sortOffset})})),t.push($.ajax({type:"POST",url:"".concat(this.APIroot,"formEditor/sort/batch"),data:{sortData:o,CSRFToken:this.CSRFToken},success:function(){},error:function(e){return console.log("ind sort post err",e)}}))}var n=[];this.parentIDsToUpdate.forEach((function(t){n.push($.ajax({type:"POST",url:"".concat(e.APIroot,"formEditor/").concat(t.indicatorID,"/parentID"),data:{parentID:t.newParentID,CSRFToken:e.CSRFToken},success:function(){},error:function(e){return console.log("ind parentID post err",e)}}))}));var i=t.concat(n);Promise.all(i).then((function(t){t.length>0&&(e.getFormByCategoryID(e.focusedFormID),e.showLastUpdate("form_properties_last_update"))})).catch((function(e){return console.log("an error has occurred",e)}))},clearListItem:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.listTracker[e]&&delete this.listTracker[e]},addToListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.indicatorID,i={sort:e.sort,parentID:t,listIndex:o,newParentID:""};this.listTracker[n]=i},updateListTracker:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=O({},this.listTracker[e]);n.listIndex=o,n.newParentID=t,this.listTracker[e]=n},startDrag:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.previewMode&&null!=e&&e.dataTransfer){e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id);var t=(e.target.id||"").replace(this.dragLI_Prefix,"");this.focusIndicator(+t)}},onDrop:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed){var o=t.currentTarget;if("UL"!==o.nodeName)return;t.preventDefault();var n=t.dataTransfer.getData("text"),i=document.getElementById(n),r=parseInt(n.replace(this.dragLI_Prefix,"")),a=(o.id||"").includes("base_drop_area")?null:parseInt(o.id.replace(this.dragUL_Prefix,"")),l=Array.from(document.querySelectorAll("#".concat(o.id," > li")));if(0===l.length)try{o.append(i),this.updateListTracker(r,a,0)}catch(e){console.log(e)}else{var s=o.getBoundingClientRect().top,c=l.find((function(e){return t.clientY-s<=e.offsetTop+e.offsetHeight/2}))||null;if(c!==i)try{o.insertBefore(i,c),Array.from(document.querySelectorAll("#".concat(o.id," > li"))).forEach((function(t,o){var n=parseInt(t.id.replace(e.dragLI_Prefix,""));e.updateListTracker(n,a,o)}))}catch(e){console.log(e)}}o.classList.contains("entered-drop-zone")&&t.target.classList.remove("entered-drop-zone")}},onDragLeave:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.remove("entered-drop-zone")},onDragEnter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null!=t&&t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&null!=t&&null!==(e=t.target)&&void 0!==e&&e.classList.contains("form-index-listing-ul")&&t.target.classList.add("entered-drop-zone")},handleNameClick:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.previewMode&&(this.previewMode=!1,this.focusedIndicatorID=t,e!==this.focusedFormID?this.getFormByCategoryID(e,!0):this.updateKey+=1)},shortFormNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,o=this.categories[e]||"",n=this.decodeAndStripHTML((null==o?void 0:o.categoryName)||"Untitled");return this.truncateText(n,t).trim()},shortIndicatorNameStripped:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35,o=this.decodeAndStripHTML(e);return this.truncateText(o,t).trim()||"[ blank ]"},makePreviewKey:function(e){var t;return"".concat(e.format).concat((null==e||null===(t=e.options)||void 0===t?void 0:t.join())||"","_").concat((null==e?void 0:e.default)||"")},checkFormCollaborators:function(){var e=this;try{fetch("".concat(this.APIroot,"formEditor/_").concat(this.focusedFormID,"/privileges")).then((function(t){t.json().then((function(t){return e.hasCollaborators=(null==t?void 0:t.length)>0})).catch((function(e){return console.log(e)}))})).catch((function(e){return console.log(e)}))}catch(e){console.log(e)}}},watch:{appIsLoadingCategories:function(e,t){!0===t&&this.queryID&&this.getFormFromQueryParam()},queryID:function(){this.appIsLoadingCategories||this.getFormFromQueryParam()},sortOrParentChanged:function(e,t){!0!==e||this.previewMode||this.applySortAndParentID_Updates()},focusedFormID:function(e,t){var o=this;window.scrollTo(0,0),e&&(this.checkFormCollaborators(),setTimeout((function(){var e=document.querySelector("#layoutFormRecords_".concat(o.queryID," li.selected button"));null!==e&&e.focus()})))}},template:'\n
    \n
    \n Loading... \n loading...\n
    \n
    \n The form you are looking for ({{ queryID }}) was not found.\n \n Back to Form Browser\n \n
    \n\n \n\n \x3c!-- DIALOGS --\x3e\n \n \n \n
    '}}}]); \ No newline at end of file diff --git a/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js b/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js index 7bcdfe08d..7afa79d58 100644 --- a/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js +++ b/docker/vue-app/src/form_editor/LEAF_FormEditor_App_vue.js @@ -61,6 +61,7 @@ export default { updateStapledFormsInfo: this.updateStapledFormsInfo, addNewCategory: this.addNewCategory, removeCategory: this.removeCategory, + updateChosenAttributes: this.updateChosenAttributes, openAdvancedOptionsDialog: this.openAdvancedOptionsDialog, openNewFormDialog: this.openNewFormDialog, @@ -115,6 +116,23 @@ export default { elDiv.innerHTML = content; return XSSHelpers.stripAllTags(elDiv.innerText); }, + /** + * @param {string} selectID id of the select element + * @param {string} labelID id of the associated label element + * @param {string} title descriptor for the list selection generated by chosen + */ + updateChosenAttributes(selectID = "", labelID = "", title = "List Selection") { + let chosenInput = document.querySelector(`#${selectID}_chosen input.chosen-search-input`); + let chosenSearchResults = document.querySelector(`#${selectID}-chosen-search-results`); + if(chosenInput !== null) { + chosenInput.setAttribute('role', 'combobox'); + chosenInput.setAttribute('aria-labelledby', labelID); + } + if(chosenSearchResults !== null) { + chosenSearchResults.setAttribute('title', title); + chosenSearchResults.setAttribute('role', 'listbox'); + } + }, /** * @param {string} elementID of targetted DOM element. Briefly display last updated message */ diff --git a/docker/vue-app/src/form_editor/components/form_editor_view/FormQuestionDisplay.js b/docker/vue-app/src/form_editor/components/form_editor_view/FormQuestionDisplay.js index 8f03f9cde..aee5e19d6 100644 --- a/docker/vue-app/src/form_editor/components/form_editor_view/FormQuestionDisplay.js +++ b/docker/vue-app/src/form_editor/components/form_editor_view/FormQuestionDisplay.js @@ -88,7 +88,7 @@ export default {
    + class="indicator-name-preview" :id="'format_label_' + indicatorID">
    diff --git a/docker/vue-app/src/form_editor/components/form_editor_view/FormatPreview.js b/docker/vue-app/src/form_editor/components/form_editor_view/FormatPreview.js index 05651bd03..092b00cbe 100644 --- a/docker/vue-app/src/form_editor/components/form_editor_view/FormatPreview.js +++ b/docker/vue-app/src/form_editor/components/form_editor_view/FormatPreview.js @@ -12,7 +12,8 @@ export default { 'libsPath', 'initializeOrgSelector', 'orgchartFormats', - 'decodeAndStripHTML' + 'decodeAndStripHTML', + 'updateChosenAttributes', ], computed: { baseFormat() { @@ -34,7 +35,7 @@ export default { return this.baseFormat.slice(this.baseFormat.indexOf('_') + 1); }, labelSelector() { - return this.indID + '_format_label'; + return 'format_label_' + this.indID; }, printResponseID() { return `xhrIndicator_${this.indID}_${this.indicator.series}`; @@ -71,7 +72,7 @@ export default { allow_single_deselect: true, width: '50%' }); - document.querySelector(`#${this.inputElID}_chosen input.chosen-search-input`)?.setAttribute('aria-labelledby', this.labelSelector); + this.updateChosenAttributes(this.inputElID, this.labelSelector, "Select Question Option"); break; case 'multiselect': const elSelect = document.getElementById(this.inputElID);