@yoobic/yobi 7.7.88 → 7.7.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{form-helpers-0b6c3054.js → form-helpers-ec3c2d29.js} +1 -1
- package/dist/cjs/{form-helpers-71b62854.js → form-helpers-f895ae5a.js} +4 -0
- package/dist/cjs/{grid-renderers-f5edc87d.js → grid-renderers-dacdc474.js} +9 -3
- package/dist/cjs/{index-4e7dd1d7.js → index-541062cd.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -2
- package/dist/cjs/isNil-6a494bf8.js +27 -0
- package/dist/cjs/yoo-action-sheet-controller_15.cjs.entry.js +6 -5
- package/dist/cjs/yoo-ag-grid_96.cjs.entry.js +6 -6
- package/dist/cjs/yoo-alert.cjs.entry.js +2 -1
- package/dist/cjs/yoo-camera-preview-dialog_7.cjs.entry.js +3 -2
- package/dist/cjs/yoo-card-list-image_12.cjs.entry.js +4 -3
- package/dist/cjs/yoo-form-choice_4.cjs.entry.js +5 -4
- package/dist/cjs/yoo-form-creator-block-expandable.cjs.entry.js +3 -2
- package/dist/cjs/yoo-form-creator-block-simple_4.cjs.entry.js +3 -2
- package/dist/cjs/yoo-form-creator-card_2.cjs.entry.js +3 -2
- package/dist/cjs/yoo-form-creator-field-selector_8.cjs.entry.js +3 -2
- package/dist/cjs/yoo-form-creator-translate-dialog.cjs.entry.js +3 -2
- package/dist/cjs/yoo-form-creator.cjs.entry.js +3 -2
- package/dist/cjs/yoo-form-json.cjs.entry.js +3 -2
- package/dist/cjs/yoo-lesson-question-result.cjs.entry.js +2 -1
- package/dist/cjs/yoo-points-recap_2.cjs.entry.js +3 -26
- package/dist/collection/components/form/form-choice/form-choice.js +2 -2
- package/dist/collection/components/form/form-input/form-input.css +43 -62
- package/dist/collection/components/form/form-input/form-input.js +1 -1
- package/dist/collection/components/form/form-number-picker/form-number-picker.js +0 -1
- package/dist/collection/components/grid/ag-grid/grid-renderers.js +8 -2
- package/dist/collection/components/grid/grid/grid.js +2 -2
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/p-02385015.entry.js +1 -0
- package/dist/design-system/p-1f8cfec7.entry.js +1 -0
- package/dist/design-system/p-332efa96.entry.js +1 -0
- package/dist/design-system/p-44f019ff.entry.js +1 -0
- package/dist/design-system/{p-db225b69.entry.js → p-5a82b3da.entry.js} +1 -1
- package/dist/design-system/{p-ef754e66.js → p-5c6ef130.js} +1 -1
- package/dist/design-system/p-67582664.entry.js +1 -0
- package/dist/design-system/p-6cfa75b3.js +1 -0
- package/dist/design-system/p-6e516cc5.entry.js +1 -0
- package/dist/design-system/{p-41e155f7.entry.js → p-725509dd.entry.js} +2 -2
- package/dist/design-system/p-7274cb11.entry.js +1 -0
- package/dist/design-system/{p-57f5b030.entry.js → p-aba8ab17.entry.js} +1 -1
- package/dist/design-system/p-bf6acbfe.js +1 -0
- package/dist/design-system/p-c047c9ba.entry.js +1 -0
- package/dist/design-system/p-c3ec533d.js +1 -0
- package/dist/design-system/p-cbb53f3f.js +1 -0
- package/dist/design-system/p-d74f2bbf.entry.js +1 -0
- package/dist/design-system/p-e57f6d89.entry.js +1 -0
- package/dist/design-system/p-e63f2b3a.entry.js +1 -0
- package/dist/design-system/p-eb421ff4.entry.js +1 -0
- package/dist/esm/{form-helpers-1b9c9641.js → form-helpers-304f10bc.js} +4 -0
- package/dist/esm/{form-helpers-63173698.js → form-helpers-d54ae23e.js} +1 -1
- package/dist/esm/{grid-renderers-1dd42472.js → grid-renderers-f81f061f.js} +10 -4
- package/dist/esm/{index-6f7890f4.js → index-70924cfc.js} +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/isNil-7611dfec.js +25 -0
- package/dist/esm/yoo-action-sheet-controller_15.entry.js +6 -5
- package/dist/esm/yoo-ag-grid_96.entry.js +6 -6
- package/dist/esm/yoo-alert.entry.js +2 -1
- package/dist/esm/yoo-camera-preview-dialog_7.entry.js +3 -2
- package/dist/esm/yoo-card-list-image_12.entry.js +4 -3
- package/dist/esm/yoo-form-choice_4.entry.js +5 -4
- package/dist/esm/yoo-form-creator-block-expandable.entry.js +3 -2
- package/dist/esm/yoo-form-creator-block-simple_4.entry.js +3 -2
- package/dist/esm/yoo-form-creator-card_2.entry.js +3 -2
- package/dist/esm/yoo-form-creator-field-selector_8.entry.js +3 -2
- package/dist/esm/yoo-form-creator-translate-dialog.entry.js +3 -2
- package/dist/esm/yoo-form-creator.entry.js +3 -2
- package/dist/esm/yoo-form-json.entry.js +3 -2
- package/dist/esm/yoo-lesson-question-result.entry.js +2 -1
- package/dist/esm/yoo-points-recap_2.entry.js +1 -24
- package/package.json +1 -1
- package/dist/design-system/p-16951157.entry.js +0 -1
- package/dist/design-system/p-1fbf2bdc.entry.js +0 -1
- package/dist/design-system/p-27145597.entry.js +0 -1
- package/dist/design-system/p-2a056ca7.entry.js +0 -1
- package/dist/design-system/p-2ede5c0e.entry.js +0 -1
- package/dist/design-system/p-2f6b3544.js +0 -1
- package/dist/design-system/p-41bd35bc.entry.js +0 -1
- package/dist/design-system/p-466a2e4b.entry.js +0 -1
- package/dist/design-system/p-4f7b5084.entry.js +0 -1
- package/dist/design-system/p-9d8da4a0.entry.js +0 -1
- package/dist/design-system/p-b038a7bd.js +0 -1
- package/dist/design-system/p-bab8cef4.entry.js +0 -1
- package/dist/design-system/p-d735b1dd.entry.js +0 -1
- package/dist/design-system/p-db36fb06.js +0 -1
- package/dist/design-system/p-e8327344.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as n,F as e,S as l,A as i}from"./p-4d956bd4.js";import{u as o,a3 as d,t,Y as a,a1 as u}from"./p-a966475f.js";import{g as s}from"./p-e37ba040.js";import{m as r,f as v,n as c}from"./p-9a039ee7.js";import{m as f,n as x}from"./p-2f6b3544.js";import"./p-b5241164.js";import{i as p}from"./p-9de400aa.js";import{c as I}from"./p-a7d0e964.js";import{i as g}from"./p-ca8f9900.js";import{g as m}from"./p-179b66ff.js";import{s as h}from"./p-dd576b82.js";const b=5;function y(n){var e;const l=[],i=[];return null===(e=null==n?void 0:n.fields)||void 0===e||e.forEach((e=>{e.sequentialConditionalField&&e.sequentialConditionalField.conditionId===n.condition._id?l.push(e):(!e.sequentialConditionalField||e.sequentialConditionalField&&e.sequentialConditionalField.conditionId!==n.condition._id)&&i.push(Object.assign(Object.assign({},e),{condition:n.condition}))})),{sequentialFields:l,nonSequentialFields:i}}function C(n){var e;let l=0;return null===(e=null==n?void 0:n.parentConditions)||void 0===e||e.forEach((e=>{var i;const o=null===(i=null==e?void 0:e.fields)||void 0===i?void 0:i.filter((e=>{var l;return(null===(l=e.sequentialConditionalField)||void 0===l?void 0:l.parentFieldName)===n.name}));l+=(null==o?void 0:o.length)||0,null==o||o.forEach((n=>{l+=C(n)}))})),l}function L(n,e,l=!1,i,o=!1){var d,t;const a=null===(d=n[e.slideIndex])||void 0===d?void 0:d.items[e.itemIndex];if(a){const d=I(a);if((null==d?void 0:d.opValues)&&(null===(t=null==d?void 0:d.opValues[0])||void 0===t?void 0:t.length)&&!d.values&&(d.values=I(d.opValues[0])),o?(d.name=r(d.title,e.slideIndex,e.itemIndex+1),d.customName=s()):d.name=s(),d.locked=!1,l)n[e.slideIndex].items.push(d);else if(i){const e=C(n[i.slideIndex].items[i.itemIndex]);n[i.slideIndex].items.splice(i.itemIndex+1+e,0,d)}else{const l=C(a);n[e.slideIndex].items.splice(e.itemIndex+1+l,0,d)}}return n}function V(n,e){null==n||n.forEach((n=>{var l;o(n.condition)&&(n.condition=n.condition.filter((n=>n._id!==e)),n.condition.length||delete n.condition),null===(l=n.items)||void 0===l||l.forEach((n=>{o(n.condition)&&(n.condition=n.condition.filter((n=>"string"!=typeof n&&n._id!==e)),n.condition.length||delete n.condition)}))}))}function $(n,e){return n.filter((n=>n.condition._id!==e))}function S(n,e){var l,i,t;if(d(e.itemIndex)||d(e.slideIndex)){const{slideIndex:l,itemIndex:i}=v(n,e.name);e=Object.assign({slideIndex:l,itemIndex:i},e)}null===(t=null===(i=null===(l=n[e.slideIndex])||void 0===l?void 0:l.items[e.itemIndex])||void 0===i?void 0:i.parentConditions)||void 0===t||t.forEach((e=>{var l;const i=e.condition._id;null===(l=e.fields)||void 0===l||l.forEach((e=>{n=F(n,e.name,[],i,{slideIndex:e.slideIndex,itemIndex:e.formCreatorIndex}).slides}))})),(n=function(n,e){return n.map((n=>(o(n.condition)&&n.condition.length>0&&(n.condition=n.condition.map((n=>o(n.field)&&n.field.length>0?n.field.filter((n=>n.name!==e)):n.field&&n.field.name!==e?n:n.field?void 0:n)),1===n.condition.length&&void 0===n.condition[0]&&delete n.condition),n)))}(n,e.name))[e.slideIndex].items.splice(e.itemIndex,1)}function F(n,e,l,i,t){let a;(d(t)||d(null==t?void 0:t.slideIndex)||d(null==t?void 0:t.itemIndex))&&(t=v(n,e)),i&&n[t.slideIndex].items[t.itemIndex]&&o(n[t.slideIndex].items[t.itemIndex].condition)&&n[t.slideIndex].items[t.itemIndex].condition.length>0?(a=n[t.slideIndex].items[t.itemIndex].condition.find((n=>n._id===i)),n[t.slideIndex].items[t.itemIndex].condition=n[t.slideIndex].items[t.itemIndex].condition.filter((n=>n._id!==i)),0===n[t.slideIndex].items[t.itemIndex].condition.length&&delete n[t.slideIndex].items[t.itemIndex].condition):(i&&n[t.slideIndex].items[t.itemIndex]&&n[t.slideIndex].items[t.itemIndex].condition&&n[t.slideIndex].items[t.itemIndex].condition._id===i||!i)&&(a=n[t.slideIndex].items[t.itemIndex].condition,delete n[t.slideIndex].items[t.itemIndex].condition);const u=j(n,a,l);return{slides:n=u.slides,unattachedParentConditions:l=u.unattachedParentConditions}}function j(n,e,l){if(e){const i=O(n,e._id);if(1===i.length){const{slides:o,unattachedParentConditions:d}=T(n,l,i.slideIndex,i.itemIndex,e);return{slides:o,unattachedParentConditions:d}}}return{slides:n,unattachedParentConditions:l}}function q(n,e,l,i){if(n[e]&&n[e].condition){let d;o(n[e].condition)?(d=n[e].condition.find((n=>n._id===l)),n[e].condition=n[e].condition.filter((n=>n._id!==l)),0===n[e].condition.length&&delete n[e].condition):n[e].condition._id===l&&(d=n[e].condition,delete n[e].condition);const t=j(n,d,i);n=t.slides,i=t.unattachedParentConditions}return{slides:n,unattachedParentConditions:i}}function O(n,e){let l=-1,i=-1,o=0;for(;i<0&&l<n.length-1;)l+=1,n[l].items&&n[l].items.length>0&&n[l].items.forEach(((n,l)=>{var d,t;(null===(d=null==n?void 0:n.parentConditions)||void 0===d?void 0:d.length)>0&&(null===(t=null==n?void 0:n.parentConditions)||void 0===t?void 0:t.findIndex((n=>n.condition._id===e)))>-1&&(i=l,o=n.parentConditions.length)}));return{slideIndex:l,itemIndex:i,length:o}}function T(n,e,l,i,o){var d,t,a;return(null===(t=null===(d=n[l])||void 0===d?void 0:d.items[i])||void 0===t?void 0:t.parentConditions)?n[l].items[i].parentConditions.push({condition:o,expandOnLoad:!0}):(null===(a=n[l])||void 0===a?void 0:a.items[i])&&(n[l].items[i].parentConditions=[{condition:o,expandOnLoad:!0}]),e.push({condition:o,slideIndex:l,itemIndex:i}),{slides:n,unattachedParentConditions:e}}function E(n,e,l){const i=l||[];return n[e.slideIndex].items[e.itemIndex]&&n[e.slideIndex].items[e.itemIndex].condition&&n[e.slideIndex].items[e.itemIndex].condition.length>0&&n[e.slideIndex].items[e.itemIndex].condition.forEach((e=>{const{length:l}=O(n,e._id);if(1===l){const{slideIndex:l,itemIndex:o}=v(n,e.field.name);i.push({slideIndex:l,itemIndex:o,condition:e})}})),i}function w(n){null==n||n.forEach((n=>{var e;null===(e=n.items)||void 0===e||e.forEach((n=>{delete n.selected}))}))}function A(n,e,l,i){if(n)return n.map(((n,o)=>{let d=o===l;return!d&&n.pageConditionIds&&n.pageConditionIds.length>0&&(d=n.pageConditionIds.includes(e._id)),{text:n.pageTitle,handler:()=>i(o),disabled:d}}))}function D(n,e,l,i){if(n){const o=n.map(((n,o)=>{var d;let t=[];return t=0===n.pageItems.length&&(null==i?void 0:i.emptySubmenuHandlerTitle)?[{text:null==i?void 0:i.emptySubmenuHandlerTitle,handler:()=>l(o,0,null)}]:n.pageItems.map(((n,d)=>{let t=!1;return(e&&e.field&&n.itemId===e.field.name||e&&n.conditionIds&&n.conditionIds.length>0&&n.conditionIds.includes(e._id))&&(t=!0),(null==i?void 0:i.selectedFields)&&(t=i.selectedFields.some((e=>e.name===n.itemId))),{text:n.itemTitle,handler:()=>l(o,d,n.itemId),disabled:t}})),(null===(d=null==i?void 0:i.extraStartingItems)||void 0===d?void 0:d.length)>0&&i.extraStartingItems.forEach((e=>{e.hideIfNoItems&&0===n.pageItems.length||t.unshift({text:e.title,handler:e.useHandler?()=>l(o,0,null):null,cssClass:e.cssClass})})),{text:n.pageTitle,subMenu:t}}));return 1===(null==n?void 0:n.length)?o[0].subMenu:o}}function P(e){return e===n.scoring}function B(n,e){var l;let o={type:n,_id:s(),operator:""},d=e.values;if(!d&&e.opValues&&e.opValues[0]&&(d=e.opValues[0]),"field"===n){let n;n=!(null==e?void 0:e.multiple)||"autocomplete"!==(null==e?void 0:e.type)&&"selectimage"!==(null==e?void 0:e.type)?null===(l=i.find((n=>n.type===e.type)))||void 0===l?void 0:l.conditionalOperators:["in","notin","equals","notequals"];const t=n?n[0]:null;o=Object.assign(Object.assign({},o),{field:{name:e.name,title:e.title,type:e.type,values:d},values:[d?d[0]:null],operator:t})}return o}function M(n,l){const i={type:n.type,title:t(n.title),name:s(),icon:n.icon,category:n.category};return n.type===e.select&&(i.imageLayout="row"),n.type===e.multiphotos&&(i.maxPhotos=5),n.type!==e.photo&&n.type!==e.multiphotos||(i.allowLibrary=!0,i.allowUnsplash=!0,i.allowGif=!0),n.type===e.information&&(i.value=""),n.type===e.emailreport&&(i.showUsers=!0),"lesson"===l&&(i.required=!0),i}function N(n){let e,l=[];n.forEach(((i,d)=>{var t;i.condition&&o(i.condition)&&i.condition.forEach((n=>{n.field&&(l=function(n,e,l){return l.field&&o(l.field)?l.field.forEach((()=>{n=R(n,l,e)})):l.field&&(n=R(n,l,e)),n}(l,d,n))})),null===(t=i.items)||void 0===t||t.forEach(((l,i)=>{var t,a;l.condition&&(o(l.condition)?l.condition.forEach((o=>{var t,a;(null===(a=null===(t=o)||void 0===t?void 0:t.field)||void 0===a?void 0:a.name)!==l.name&&(e=k({fieldConditions:e,slides:n,condition:o,field:l,childSlideIndex:d,childItemIndex:i}))})):(null===(a=null===(t=null==l?void 0:l.condition)||void 0===t?void 0:t.field)||void 0===a?void 0:a.name)!==l.name&&(e=k({fieldConditions:e,slides:n,condition:l.condition,field:l,childSlideIndex:d,childItemIndex:i})))}))}));const i=function(n,e){let l=e;return(null==n?void 0:n.length)&&(null==e?void 0:e.length)?n.forEach((n=>{l.push();const e=l.findIndex((e=>e.condition._id===n.condition._id));e>-1?l[e]=Object.assign(Object.assign({},l[e]),{pages:n.pages}):l.push(n)})):(null==n?void 0:n.length)?l=n:(null==e?void 0:e.length)&&(l=e),l}(l,e);return n=function(n,e){return null==e||e.forEach((e=>{var l,i,o,d;const{slideIndex:t,itemIndex:a}=v(n,e.condition.field.name);if(null===(o=null===(i=null===(l=n[t])||void 0===l?void 0:l.items[a])||void 0===i?void 0:i.parentConditions)||void 0===o?void 0:o.length){const l=n[t].items[a].parentConditions.findIndex((n=>n.condition._id===e.condition._id));l>-1?n[t].items[a].parentConditions[l]=e:n[t].items[a].parentConditions.push(e)}else(null===(d=n[t])||void 0===d?void 0:d.items[a])&&(n[t].items[a].parentConditions=[e])})),n}(n,i)}function k({fieldConditions:n,slides:e,condition:l,field:i,childSlideIndex:o,childItemIndex:d}){if(l.field){const t=l.field.name,{slideIndex:a,itemIndex:u}=v(e,t);if(e[a].items[u]){const s={condition:l,fields:[i]};if(H({slides:e,parentFieldSlideIndex:a,parentFieldItemIndex:u,childSlideIndex:o,childItemIndex:d,conditionId:l._id})?i.sequentialConditionalField={conditionId:l._id,parentFieldName:t,parentCustomFieldName:e[a].items[u].customName}:i.nonSequentialConditionalFieldPosition={slideIndex:o,itemIndex:d},null==n?void 0:n.length){const e=n.findIndex((n=>n.condition._id===l._id));e>-1?n[e].fields.push(i):n.push(s)}else n=[s]}}return n}function H({slides:n,parentFieldSlideIndex:e,parentFieldItemIndex:l,childSlideIndex:i,childItemIndex:o,conditionId:d}){var t;if(e===i&&o>0){const a=o-1;if(l===a)return!0;const u=n[i].items,s=u[a];let r=!1;if(null==u?void 0:u.length){const n=null===(t=u[o])||void 0===t?void 0:t.condition;(null==n?void 0:n.length)>1&&n.forEach((n=>{var e;n._id!==d&&(null===(e=null==n?void 0:n.field)||void 0===e?void 0:e.name)===s.name&&(r=!0)}))}if((null==s?void 0:s.sequentialConditionalField)&&!r)return H({slides:n,parentFieldSlideIndex:e,parentFieldItemIndex:l,childSlideIndex:i,childItemIndex:a,conditionId:d})}return!1}function R(n,e,l){if(n&&n.length>0){const i=n.findIndex((n=>n.condition._id===e._id));i>-1?n[i].pages.push({pageIndex:l}):n.push({condition:e,pages:[{pageIndex:l}]})}else n.push({condition:e,pages:[{pageIndex:l}]});return n}function z(n,e){const l={slideIndex:-1,itemIndex:-1,conditionIndex:-1};return null==n||n.some(((n,i)=>{var o;return null===(o=n.items)||void 0===o||o.some(((n,o)=>{var d;return!!((null===(d=null==n?void 0:n.parentConditions)||void 0===d?void 0:d.length)&&(l.conditionIndex=n.parentConditions.findIndex((n=>n.condition._id===e)),l.conditionIndex>-1))&&(l.slideIndex=i,l.itemIndex=o,!0)})),l.conditionIndex>=0})),l}function W(n,e){null==e||e.forEach((n=>{var e;null===(e=null==n?void 0:n.items)||void 0===e||e.forEach((n=>{var e;Array.isArray(n.condition)&&(null===(e=n.condition)||void 0===e?void 0:e.length)&&n.condition.forEach((()=>{}))}))}))}function U(n){const e=[];return n.reduce(((n,l)=>((null==l?void 0:l.selectedFields)&&l.selectedFields.forEach((l=>{e.indexOf(l.name)<0&&n.push(l.name),e.push(l.name)})),n)),[])}function Y(n){return(null==n?void 0:n.reduce(((n,e)=>{var l;return n+(null===(l=e.items)||void 0===l?void 0:l.length)||0}),0))||0}function G(n,e,l,i,o,d,{missionDescriptionChanged:t,slidesChanged:a,translationsUpdated:u,scoringChanged:s},r=null,v=!1){if(e){let n=!1;n=pn(l,{title:e.title,baseLanguage:d,order:0,entity:e,location:"lesson"===e.type?"lesson":"campaign",path:"title"},null,n),n=pn(l,{title:e.title,baseLanguage:d,order:1,entity:e,location:"lesson"===e.type?"lesson":"campaign",path:"text"},null,n),n&&(null==t||t.emit(e))}if(null==i?void 0:i.length){let n=!1;i.forEach(((i,o)=>{"lesson"!==(null==e?void 0:e.type)&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1),entity:i,location:"slide",path:"title",slideIndex:o},null,n),n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+1,entity:i,location:"slide",path:"description",slideIndex:o},null,n)),i.items&&i.items.forEach(((i,t)=>{var a,u,s,r;n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1),entity:i,location:"field",path:"title",slideIndex:o,fieldIndex:t},null,n),n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+2),entity:i,location:"field",path:"description",slideIndex:o,fieldIndex:t},null,n);let v=3;const c=function(n){var e,l,i,o,d,t;let a="";return n.complexSelectImageValues&&n.complexSelectImageValues.length>0?a="complexSelectImageValues":n.complexSwipeCardValues&&n.complexSwipeCardValues.length>0&&((null===(e=n.complexSwipeCardValues[0])||void 0===e?void 0:e.length)>0||(null===(l=n.complexSwipeCardValues[1])||void 0===l?void 0:l.length)>0)?a="complexSwipeCardValues":n.complexImageCollectionValues&&n.complexImageCollectionValues.length>0&&((null===(i=n.complexImageCollectionValues[0])||void 0===i?void 0:i.length)>0||(null===(o=n.complexImageCollectionValues[1])||void 0===o?void 0:o.length)>0)?a="complexImageCollectionValues":n.complexCategorizeWordsValues&&n.complexCategorizeWordsValues.length>0?a="complexCategorizeWordsValues":n.complexConnectValues&&n.complexConnectValues.length>0&&((null===(d=n.complexConnectValues[0])||void 0===d?void 0:d.length)>0||(null===(t=n.complexConnectValues[1])||void 0===t?void 0:t.length)>0)&&(a="complexConnectValues"),a}(i);if((null==c?void 0:c.length)>0){const{index:a,hasBeenEdited:u}=function(n,{baseLanguage:e,title:l,path:i,slideIndex:o,fieldIndex:d,idIndex:t,f:a},u=!1){var s;return null===(s=a[i])||void 0===s||s.forEach(((s,r)=>{null==s||s.forEach(((s,v)=>{g(s)?(u=pn(n,{title:l,baseLanguage:e,order:1e3*(o+1)+100*(d+1)+t,entity:a,location:"field",path:`${i}[${r}][${v}]`,slideIndex:o,fieldIndex:d,oldValue:s},null,u),t+=1):s&&s.text&&(u=pn(n,{title:l,baseLanguage:e,order:1e3*(o+1)+100*(d+1)+t,entity:a,location:"field",path:`${i}[${r}][${v}].text`,slideIndex:o,fieldIndex:d,oldValue:s.text},null,u),t+=1)}))})),{index:t,hasBeenEdited:u}}(l,{baseLanguage:d,title:e.title,path:c,slideIndex:o,fieldIndex:t,idIndex:v,f:i},n);n=u,v=a}else{const{values:a,path:u}=xn(i);a&&a.length>0&&u?a.forEach((a=>{n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:`${u}[${a.firstIndex}][${a.secondIndex}]`,slideIndex:o,fieldIndex:t,oldValue:a.value},null,n),v+=1})):i.values&&i.values.length>0&&i.values.forEach(((a,u)=>{n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"values["+u+"]",slideIndex:o,fieldIndex:t,oldValue:a},null,n),v+=1}))}if((null===(u=null===(a=i.complexImageTaggingValues)||void 0===a?void 0:a.annotations)||void 0===u?void 0:u.length)>0){const{index:a,hasBeenEdited:u}=function(n,{baseLanguage:e,title:l,path:i,slideIndex:o,fieldIndex:d,idIndex:t,f:a},u=!1){var s,r;return null===(r=null===(s=a[i])||void 0===s?void 0:s.annotations)||void 0===r||r.forEach(((s,r)=>{p(s)||(u=pn(n,{title:l,baseLanguage:e,order:1e3*(o+1)+100*(d+1)+t,entity:a,location:"field",path:`${i}.annotations[${r}].text`,slideIndex:o,fieldIndex:d,oldValue:s.text},null,u),t+=1)})),{index:t,hasBeenEdited:u}}(l,{baseLanguage:d,title:e.title,path:"complexImageTaggingValues",slideIndex:o,fieldIndex:t,idIndex:v,f:i},n);n=u,v=a}"information"===i.type&&i.value&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"value",slideIndex:o,fieldIndex:t},null,n),v+=1),i.answer&&i.answer.length>0&&i.answer.forEach(((a,u)=>{g(a)&&a.length>0&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"answer["+u+"]",slideIndex:o,fieldIndex:t},null,n),v+=1)})),i.categories&&i.categories.length>0&&(i.complexWordsCategories&&i.complexWordsCategories[0]&&i.complexWordsCategories[0].length>0&&(i.categories=i.complexWordsCategories[0]),i.complexSwipeCategories&&i.complexSwipeCategories[0]&&i.complexSwipeCategories[0].length>0&&(i.categories=i.complexSwipeCategories[0]),i.categories.forEach(((a,u)=>{n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"categories["+u+"]",slideIndex:o,fieldIndex:t},null,n),v+=1}))),i.sentence&&!i.complexSentence&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"sentence",slideIndex:o,fieldIndex:t},null,n),v+=1),i.complexSentence&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"complexSentence",slideIndex:o,fieldIndex:t},null,n),v+=1),i.complexTextSequenceHeading&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"complexTextSequenceHeading",slideIndex:o,fieldIndex:t},null,n),v+=1),i.explanation&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"explanation",slideIndex:o,fieldIndex:t},null,n),v+=1),(null===(r=null===(s=null==i?void 0:i.scratchValues)||void 0===s?void 0:s[1])||void 0===r?void 0:r.text)&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"scratchValues[1].text",slideIndex:o,fieldIndex:t},null,n),v+=1)}))})),n&&(null==a||a.emit({slides:i}))}(null==o?void 0:o.length)&&!(null==e?void 0:e.active)&&(o.forEach(((n,i)=>{pn(l,{title:e.title,baseLanguage:d,order:1e4*(i+1),entity:n,location:"scoring",path:"title"}),pn(l,{title:e.title,baseLanguage:d,order:1e4*(i+1)+1,entity:n,location:"scoring",path:"description"})})),null==s||s.emit(o)),u&&u.emit({translations:l,overwrite:n,googleTranslate:!0,languages:r,onlyTranslateMissingTranslations:v})}function J(n,e){null==n||n.forEach((n=>{var l;null===(l=n.items)||void 0===l||l.forEach((n=>{e.indexOf(n.name)>-1&&(n.hasScoring=!0)}))}))}function K(n,e){var l;const i=null===(l=null==n?void 0:n.scoreValuePairs)||void 0===l?void 0:l.map((n=>n.value));return e.forEach((e=>{var l;i.includes(e)||null===(l=null==n?void 0:n.scoreValuePairs)||void 0===l||l.push({value:e,score:null})})),n}function Q(n,e){var i;const o=[];return o.push(`${null==n?void 0:n.fieldName}value`),e===(null==l?void 0:l.numberRating)?o.push(null==n?void 0:n.fieldName):null===(i=null==n?void 0:n.scoreValuePairs)||void 0===i||i.forEach((e=>{null==o||o.push(`${null==n?void 0:n.fieldName}${null==e?void 0:e.value}`)})),o}function _(n,e){return n.reduce(((n,l)=>(l.name!==e&&n.push(l),n)),[])}function X(n){let e,l=0;return[n.map(((n,i)=>(n.isActive?(e=Object.assign({},n),n.isSelected=!0,l=i):n&&(n.isSelected=!1),n))),e,l]}function Z(n,e){var l,i;return!!n&&!!(null===(i=null===(l=n[e])||void 0===l?void 0:l.items)||void 0===i?void 0:i.length)}function nn(n){let e=[],l=[];return n&&o(n)?n.forEach((n=>{"tags"===n.type||"groups"===n.type?e.push(n):"field"===n.type&&l.push(n)})):!n||"tags"!==n.type&&"groups"!==n.type?n&&"field"===n.type&&(l=[n]):e=[n],{restrictionConditions:e,fieldConditions:l}}function en(n){null==n||n.forEach((n=>{var e;null===(e=n.items)||void 0===e||e.forEach(((n,e)=>{n.formCreatorIndex=e}))}))}function ln(n,e){return null==n||n.forEach((n=>{var l,i,o;const d=n.condition;(null===(i=null===(l=e[n.slideIndex])||void 0===l?void 0:l.items[n.itemIndex])||void 0===i?void 0:i.parentConditions)?e[n.slideIndex].items[n.itemIndex].parentConditions.findIndex((n=>n.condition._id===d._id))<0&&e[n.slideIndex].items[n.itemIndex].parentConditions.push({condition:d}):(null===(o=e[n.slideIndex])||void 0===o?void 0:o.items[n.itemIndex])&&(e[n.slideIndex].items[n.itemIndex].parentConditions=[{condition:d}])})),e}function on(n,e){const l=(null==n?void 0:n.findIndex((n=>n.condition._id===e._id)))||-1;return l>-1&&n.splice(l,1),n}function dn(n,e){var l,i;let o=(null===(l=null==e?void 0:e.sequentialConditionalField)||void 0===l?void 0:l.parentCustomFieldName)||(null===(i=null==e?void 0:e.sequentialConditionalField)||void 0===i?void 0:i.parentFieldName);const d=n.find((n=>n.name===o));return d&&(o=dn(n,d)),o}function tn(n,e,l){var i;if(null===(i=n.fields)||void 0===i?void 0:i.length){let i=[];return n.fields.forEach((n=>{var o;(null===(o=null==n?void 0:n.parentConditions)||void 0===o?void 0:o.length)&&n.parentConditions.forEach((n=>{const e=tn(n);e&&(i=[...i,...e.childFields])})),(null==n?void 0:n.sequentialConditionalField)&&l&&(l=function(n,e,l){if(l){const i=l.findIndex((e=>e.conditionId===n.sequentialConditionalField.conditionId));i>-1?l[i]={conditionId:n.sequentialConditionalField.conditionId,lastSequentialFieldIndex:e}:l.push({conditionId:n.sequentialConditionalField.conditionId,lastSequentialFieldIndex:e})}else l.push({conditionId:n.sequentialConditionalField.conditionId,lastSequentialFieldIndex:e});return l}(n,e+=1,l)),i.push({name:n.customName||n.name,sequentialConditionalField:n.sequentialConditionalField})})),l?{childFields:i,sequentialConditionFields:l,lastSequentialFieldIndex:e}:{childFields:i}}}function an(n,e){let l=[],i=[];if(null==n?void 0:n.length){let o=e;n.forEach((n=>{const e=tn(n,o,i);e&&(i=e.sequentialConditionFields,o=e.lastSequentialFieldIndex,l=[...l,...e.childFields])})),l.forEach((n=>{(null==n?void 0:n.sequentialConditionalField)&&(n.sequentialConditionalField.masterParentFieldName=dn(l,n))}))}return{childFields:l,sequentialConditionFields:i}}function un(n){var e,l;const i=[];null===(e=null==n?void 0:n.items)||void 0===e||e.forEach((n=>{const e=s();i.push({oldId:n.name,newId:e}),n.name=e})),null===(l=null==n?void 0:n.items)||void 0===l||l.forEach((n=>{var e;o(n.condition)?null===(e=n.condition)||void 0===e||e.forEach((n=>{sn(n,i)})):sn(n.condition,i)}))}function sn(n,e){var l;if(n&&!g(n)&&"field"===n.type&&(null===(l=n.field)||void 0===l?void 0:l.name)){const l=null==e?void 0:e.findIndex((e=>e.oldId===n.field.name));l>-1&&(n.field.name=e[l].newId,n._id=s())}}function rn(n){var e;let l=0;return(null===(e=null==n?void 0:n.parentConditions)||void 0===e?void 0:e.length)>0&&n.parentConditions.forEach((e=>{e&&e.fields&&e.fields.length>0&&e.fields&&e.fields.forEach((e=>{e.sequentialConditionalField&&e.sequentialConditionalField.parentFieldName===n.name&&(l+=1,l+=rn(e))}))})),l}function vn(n,e,l){let i=l;for(;n[e]&&n[e].items[i]&&n[e].items[i].sequentialConditionalField;)i=v(n,n[e].items[i].sequentialConditionalField.parentFieldName).itemIndex;return i}function cn(n,e,l,i){let o;if(n&&i){i=i.replace(/%/g,"");let d=e.findIndex((n=>i===n.key));-1===d&&(i=i.replace(/(<([^>]+)>)/gi,""),d=e.findIndex((n=>i===n.key))),e[d]&&e[d][l]&&(e[d][l]!==n&&(o=e[d]),e[d][l]=n)}return{translations:e,updatedTranslation:o}}function fn(n){const e=[];return n.forEach(((n,l)=>{n&&n.length>0&&n.forEach(((n,i)=>{e.push({value:n,firstIndex:l,secondIndex:i})}))})),e}function xn(n){return n.complexSelectValues&&n.complexSelectValues.length>0?{path:"complexSelectValues",values:fn(n.complexSelectValues)}:n.complexSelectMultiValues&&n.complexSelectMultiValues.length>0?{path:"complexSelectMultiValues",values:fn(n.complexSelectMultiValues)}:n.complexConnectValues&&n.complexConnectValues.length>0?{path:"complexConnectValues",values:fn(n.complexConnectValues)}:n.complexRevealValues&&n.complexRevealValues.length>0?{path:"complexRevealValues",values:fn(n.complexRevealValues)}:n.complexTextSequenceValues&&n.complexTextSequenceValues.length>0?{path:"complexTextSequenceValues",values:fn(n.complexTextSequenceValues)}:n.complexChatValues&&n.complexChatValues.length>0?{path:"complexChatValues",values:fn(n.complexChatValues)}:n.complexMissingWordValues&&n.complexMissingWordValues.length>0?{path:"complexMissingWordValues",values:fn(n.complexMissingWordValues)}:n.complexSwipeCardTextValues&&n.complexSwipeCardTextValues.length>0?{path:"complexSwipeCardTextValues",values:fn(n.complexSwipeCardTextValues)}:n.complexRankingValues&&n.complexRankingValues.length>0?{path:"complexRankingValues",values:fn(n.complexRankingValues)}:n.complexImageTaggingMockValues&&n.complexImageTaggingMockValues.length>0?{path:"complexImageTaggingMockValues",values:fn(n.complexImageTaggingMockValues)}:n.opValues&&n.opValues.length>0?{path:"opValues",values:fn(n.opValues)}:{path:null,values:null}}function pn(n,{title:e,order:l,entity:i,location:o,path:t,slideIndex:a,fieldIndex:u,oldValue:s,baseLanguage:r},v,c=!1){if("string"!=typeof(s=s||m(i,t)))return c;const x=$n(s,n)&&("field"===o&&"description"===t||"lesson"===o||"campaign"===o);if(!d(s)&&""!==s&&!x){let d=n.findIndex((n=>"%"+n.key+"%"===s||n.key===s));if(-1===d){const e=s.replace(/(<([^>]+)>)/gi,"");d=n.findIndex((n=>"%"+n.key+"%"===e||n.key===e))}if(d<0){const d=function(n,e,l){return f(n,e,l)}(e,s,{slideIndex:a,fieldIndex:u}),x={order:l,location:o,type:t,value:s,key:d,language:r};v&&(x.group=v.group,x.missionDescriptionRef=v.missionDescriptionRef,x._tenant=v._tenant,x._tenantRef=v._tenantRef),x[r]=s,n.push(x),h(i,t,"%"+d+"%"),c=!0}else n[d]&&(n[d].order=l)}return c}function In(n,e,l,i){return e.map((e=>{var o,d;return{text:n?e.title:`${t("FIELDIF")} ${a(null===(o=null==e?void 0:e.field)||void 0===o?void 0:o.title)} ${t(null===(d=e.operator)||void 0===d?void 0:d.toUpperCase())}: ${a(e.values?e.values[0]:e.value)}`,icon:n?"restriction":"condition",handler:()=>l.emit({conditionId:e._id}),actionableIcon:{icon:"delete",handler:()=>i.event.emit(Object.assign(Object.assign({},i.options),{conditionId:e._id}))}}}))}function gn(n,e,l){return(null==l?void 0:l.length)?!!l.find((l=>n&&n[l.slideIndex]&&n[l.slideIndex].items&&n[l.slideIndex].items[l.itemIndex]&&n[l.slideIndex].items[l.itemIndex][e])):!!(null==n?void 0:n.find((n=>n.items.findIndex((n=>n[e]))>-1)))}function mn(n,e){return(null==n?void 0:n.editable)?e={title:"EDITABLE",icon:"brush"}:(null==n?void 0:n.hidden)?e={title:"HIDDEN",icon:"offline"}:(null==n?void 0:n.readonly)&&(e={title:"READONLY",icon:"eye"}),e}function hn(n,e,l,i){n.stopPropagation();const o=n.detail;return null==e||e.forEach((n=>{var e;"parallel"===(null==n?void 0:n.type)?null===(e=null==n?void 0:n.steps)||void 0===e||e.forEach((n=>n.forEach((n=>{(null==n?void 0:n._id)===o&&(l=n)})))):(null==n?void 0:n._id)===o&&(l=n)})),i.emit(l),l}function bn(n,e){const l=[];return n.forEach((i=>{var o;delete i.parentConditions,delete i.slideIndex,delete i.slideTitle,(null==e?void 0:e.length)>0&&Ln(i,e),Array.isArray(null==i?void 0:i.condition)&&(null===(o=i.condition)||void 0===o?void 0:o.length)>0&&(i.condition=u(i.condition.map((e=>{var i;return"field"!==(null===(i=e)||void 0===i?void 0:i.type)||n.findIndex((n=>{var l;return n.name===(null===(l=e)||void 0===l?void 0:l.field.name)}))>-1?e:void l.push(e._id)}))))})),{cleanedFields:n,removedConditionIds:l}}function yn(n){const e=n.map((n=>{const e=I(n);return e.name=s(),e}));return e.forEach((l=>{var i;Array.isArray(null==l?void 0:l.condition)&&(null===(i=l.condition)||void 0===i?void 0:i.length)>0&&l.condition.forEach((l=>{if(l._id=s(),"field"===l.type){const i=n.findIndex((n=>{var e;return n.name===(null===(e=l)||void 0===e?void 0:e.field.name)}));i>-1&&(l.field.name=e[i].name)}}))})),e}function Cn(n,e,l){const i=n[e]?n[e]:m(n,e);if(n){const o=l.find((n=>{let e="";return i&&i.replace&&(e=i.replace(/(<([^>]+)>)/gi,"")),"%"+n.key+"%"===i||n.key===i||"%"+n.key+"%"===e||n.key===e}));o&&o.value&&h(n,e,o.value)}}function Ln(n,e){var l,i,o,d,t,a,u,s,r,v,c,f;Cn(n,"title",e),Cn(n,"description",e),Cn(n,"explanation",e),Cn(n,"sentence",e),Cn(n,"complexSentence",e),Cn(n,"value",e),Cn(n,"complexTextSequenceHeading",e);const{values:x,path:I}=xn(n);(null==x?void 0:x.length)&&I?x.forEach((l=>{Cn(n,`${I}[${l.firstIndex}][${l.secondIndex}]`,e)})):(null===(l=null==n?void 0:n.values)||void 0===l?void 0:l.length)&&n.values.forEach(((l,i)=>{Cn(n,"values["+i+"]",e)})),(null===(i=null==n?void 0:n.categories)||void 0===i?void 0:i.length)&&(n.categories.forEach(((l,i)=>{Cn(n,"categories["+i+"]",e)})),n.complexSwipeCategories&&n.complexSwipeCategories[0]&&n.complexSwipeCategories[0].length>0&&(n.complexSwipeCategories[0]=n.categories)),(null===(o=null==n?void 0:n.complexSelectImageValues)||void 0===o?void 0:o.length)&&Vn("complexSelectImageValues",n,e),(null===(d=null==n?void 0:n.complexSwipeCardValues)||void 0===d?void 0:d.length)&&Vn("complexSwipeCardValues",n,e),(null===(t=null==n?void 0:n.complexImageCollectionValues)||void 0===t?void 0:t.length)&&Vn("complexImageCollectionValues",n,e),(null===(a=null==n?void 0:n.complexCategorizeWordsValues)||void 0===a?void 0:a.length)&&Vn("complexCategorizeWordsValues",n,e),(null===(u=null==n?void 0:n.complexConnectValues)||void 0===u?void 0:u.length)&&Vn("complexConnectValues",n,e),(null===(r=null===(s=null==n?void 0:n.complexImageTaggingValues)||void 0===s?void 0:s.annotations)||void 0===r?void 0:r.length)&&function(n,e,l){var i,o;(null===(o=null===(i=e[n])||void 0===i?void 0:i.annotations)||void 0===o?void 0:o.length)&&e[n].annotations.forEach(((i,o)=>{p(i)||Cn(e,`${n}.annotations[${o}].text`,l)}))}("complexImageTaggingValues",n,e),(null===(v=null==n?void 0:n.answer)||void 0===v?void 0:v.length)&&n.answer.forEach(((l,i)=>{Cn(n,"answer["+i+"]",e)})),(null===(f=null===(c=null==n?void 0:n.scratchValues)||void 0===c?void 0:c[1])||void 0===f?void 0:f.text)&&Cn(n,"scratchValues[1].text",e)}function Vn(n,e,l){e[n].forEach(((i,o)=>{(null==i?void 0:i.length)&&i.forEach(((i,d)=>{g(i)?Cn(e,`${n}[${o}][${d}]`,l):i&&i.text&&Cn(e,`${n}[${o}][${d}].text`,l)}))}))}function $n(n,e){let l=x(n);if(!l&&(null==n?void 0:n.replace)){const e=n.replace(/(<([^>]+)>)/gi,"");l=x(e)}else!l&&c(n)&&e&&(l=(null==e?void 0:e.findIndex((e=>e.key===n)))>-1);return l}export{Z as A,rn as B,B as C,T as D,yn as E,M as F,gn as G,K as H,nn as I,an as J,Cn as K,Ln as L,$n as M,pn as N,hn as O,mn as P,cn as Q,In as R,b as S,y as T,A as U,un as a,q as b,E as c,S as d,L as e,V as f,vn as g,$ as h,P as i,z as j,W as k,D as l,bn as m,on as n,w as o,X as p,U as q,F as r,Q as s,G as t,_ as u,J as v,en as w,Y as x,N as y,ln as z}
|
|
1
|
+
import{i as n,F as e,S as l,A as i}from"./p-4d956bd4.js";import{u as o,a3 as d,t,Y as a,a1 as u}from"./p-a966475f.js";import{g as s}from"./p-e37ba040.js";import{m as r,f as v,n as c}from"./p-9a039ee7.js";import{m as f,n as x}from"./p-cbb53f3f.js";import"./p-b5241164.js";import{i as p}from"./p-9de400aa.js";import{c as I}from"./p-a7d0e964.js";import{i as g}from"./p-ca8f9900.js";import{g as m}from"./p-179b66ff.js";import{s as h}from"./p-dd576b82.js";const b=5;function y(n){var e;const l=[],i=[];return null===(e=null==n?void 0:n.fields)||void 0===e||e.forEach((e=>{e.sequentialConditionalField&&e.sequentialConditionalField.conditionId===n.condition._id?l.push(e):(!e.sequentialConditionalField||e.sequentialConditionalField&&e.sequentialConditionalField.conditionId!==n.condition._id)&&i.push(Object.assign(Object.assign({},e),{condition:n.condition}))})),{sequentialFields:l,nonSequentialFields:i}}function C(n){var e;let l=0;return null===(e=null==n?void 0:n.parentConditions)||void 0===e||e.forEach((e=>{var i;const o=null===(i=null==e?void 0:e.fields)||void 0===i?void 0:i.filter((e=>{var l;return(null===(l=e.sequentialConditionalField)||void 0===l?void 0:l.parentFieldName)===n.name}));l+=(null==o?void 0:o.length)||0,null==o||o.forEach((n=>{l+=C(n)}))})),l}function L(n,e,l=!1,i,o=!1){var d,t;const a=null===(d=n[e.slideIndex])||void 0===d?void 0:d.items[e.itemIndex];if(a){const d=I(a);if((null==d?void 0:d.opValues)&&(null===(t=null==d?void 0:d.opValues[0])||void 0===t?void 0:t.length)&&!d.values&&(d.values=I(d.opValues[0])),o?(d.name=r(d.title,e.slideIndex,e.itemIndex+1),d.customName=s()):d.name=s(),d.locked=!1,l)n[e.slideIndex].items.push(d);else if(i){const e=C(n[i.slideIndex].items[i.itemIndex]);n[i.slideIndex].items.splice(i.itemIndex+1+e,0,d)}else{const l=C(a);n[e.slideIndex].items.splice(e.itemIndex+1+l,0,d)}}return n}function V(n,e){null==n||n.forEach((n=>{var l;o(n.condition)&&(n.condition=n.condition.filter((n=>n._id!==e)),n.condition.length||delete n.condition),null===(l=n.items)||void 0===l||l.forEach((n=>{o(n.condition)&&(n.condition=n.condition.filter((n=>"string"!=typeof n&&n._id!==e)),n.condition.length||delete n.condition)}))}))}function $(n,e){return n.filter((n=>n.condition._id!==e))}function S(n,e){var l,i,t;if(d(e.itemIndex)||d(e.slideIndex)){const{slideIndex:l,itemIndex:i}=v(n,e.name);e=Object.assign({slideIndex:l,itemIndex:i},e)}null===(t=null===(i=null===(l=n[e.slideIndex])||void 0===l?void 0:l.items[e.itemIndex])||void 0===i?void 0:i.parentConditions)||void 0===t||t.forEach((e=>{var l;const i=e.condition._id;null===(l=e.fields)||void 0===l||l.forEach((e=>{n=F(n,e.name,[],i,{slideIndex:e.slideIndex,itemIndex:e.formCreatorIndex}).slides}))})),(n=function(n,e){return n.map((n=>(o(n.condition)&&n.condition.length>0&&(n.condition=n.condition.map((n=>o(n.field)&&n.field.length>0?n.field.filter((n=>n.name!==e)):n.field&&n.field.name!==e?n:n.field?void 0:n)),1===n.condition.length&&void 0===n.condition[0]&&delete n.condition),n)))}(n,e.name))[e.slideIndex].items.splice(e.itemIndex,1)}function F(n,e,l,i,t){let a;(d(t)||d(null==t?void 0:t.slideIndex)||d(null==t?void 0:t.itemIndex))&&(t=v(n,e)),i&&n[t.slideIndex].items[t.itemIndex]&&o(n[t.slideIndex].items[t.itemIndex].condition)&&n[t.slideIndex].items[t.itemIndex].condition.length>0?(a=n[t.slideIndex].items[t.itemIndex].condition.find((n=>n._id===i)),n[t.slideIndex].items[t.itemIndex].condition=n[t.slideIndex].items[t.itemIndex].condition.filter((n=>n._id!==i)),0===n[t.slideIndex].items[t.itemIndex].condition.length&&delete n[t.slideIndex].items[t.itemIndex].condition):(i&&n[t.slideIndex].items[t.itemIndex]&&n[t.slideIndex].items[t.itemIndex].condition&&n[t.slideIndex].items[t.itemIndex].condition._id===i||!i)&&(a=n[t.slideIndex].items[t.itemIndex].condition,delete n[t.slideIndex].items[t.itemIndex].condition);const u=j(n,a,l);return{slides:n=u.slides,unattachedParentConditions:l=u.unattachedParentConditions}}function j(n,e,l){if(e){const i=O(n,e._id);if(1===i.length){const{slides:o,unattachedParentConditions:d}=T(n,l,i.slideIndex,i.itemIndex,e);return{slides:o,unattachedParentConditions:d}}}return{slides:n,unattachedParentConditions:l}}function q(n,e,l,i){if(n[e]&&n[e].condition){let d;o(n[e].condition)?(d=n[e].condition.find((n=>n._id===l)),n[e].condition=n[e].condition.filter((n=>n._id!==l)),0===n[e].condition.length&&delete n[e].condition):n[e].condition._id===l&&(d=n[e].condition,delete n[e].condition);const t=j(n,d,i);n=t.slides,i=t.unattachedParentConditions}return{slides:n,unattachedParentConditions:i}}function O(n,e){let l=-1,i=-1,o=0;for(;i<0&&l<n.length-1;)l+=1,n[l].items&&n[l].items.length>0&&n[l].items.forEach(((n,l)=>{var d,t;(null===(d=null==n?void 0:n.parentConditions)||void 0===d?void 0:d.length)>0&&(null===(t=null==n?void 0:n.parentConditions)||void 0===t?void 0:t.findIndex((n=>n.condition._id===e)))>-1&&(i=l,o=n.parentConditions.length)}));return{slideIndex:l,itemIndex:i,length:o}}function T(n,e,l,i,o){var d,t,a;return(null===(t=null===(d=n[l])||void 0===d?void 0:d.items[i])||void 0===t?void 0:t.parentConditions)?n[l].items[i].parentConditions.push({condition:o,expandOnLoad:!0}):(null===(a=n[l])||void 0===a?void 0:a.items[i])&&(n[l].items[i].parentConditions=[{condition:o,expandOnLoad:!0}]),e.push({condition:o,slideIndex:l,itemIndex:i}),{slides:n,unattachedParentConditions:e}}function E(n,e,l){const i=l||[];return n[e.slideIndex].items[e.itemIndex]&&n[e.slideIndex].items[e.itemIndex].condition&&n[e.slideIndex].items[e.itemIndex].condition.length>0&&n[e.slideIndex].items[e.itemIndex].condition.forEach((e=>{const{length:l}=O(n,e._id);if(1===l){const{slideIndex:l,itemIndex:o}=v(n,e.field.name);i.push({slideIndex:l,itemIndex:o,condition:e})}})),i}function w(n){null==n||n.forEach((n=>{var e;null===(e=n.items)||void 0===e||e.forEach((n=>{delete n.selected}))}))}function A(n,e,l,i){if(n)return n.map(((n,o)=>{let d=o===l;return!d&&n.pageConditionIds&&n.pageConditionIds.length>0&&(d=n.pageConditionIds.includes(e._id)),{text:n.pageTitle,handler:()=>i(o),disabled:d}}))}function D(n,e,l,i){if(n){const o=n.map(((n,o)=>{var d;let t=[];return t=0===n.pageItems.length&&(null==i?void 0:i.emptySubmenuHandlerTitle)?[{text:null==i?void 0:i.emptySubmenuHandlerTitle,handler:()=>l(o,0,null)}]:n.pageItems.map(((n,d)=>{let t=!1;return(e&&e.field&&n.itemId===e.field.name||e&&n.conditionIds&&n.conditionIds.length>0&&n.conditionIds.includes(e._id))&&(t=!0),(null==i?void 0:i.selectedFields)&&(t=i.selectedFields.some((e=>e.name===n.itemId))),{text:n.itemTitle,handler:()=>l(o,d,n.itemId),disabled:t}})),(null===(d=null==i?void 0:i.extraStartingItems)||void 0===d?void 0:d.length)>0&&i.extraStartingItems.forEach((e=>{e.hideIfNoItems&&0===n.pageItems.length||t.unshift({text:e.title,handler:e.useHandler?()=>l(o,0,null):null,cssClass:e.cssClass})})),{text:n.pageTitle,subMenu:t}}));return 1===(null==n?void 0:n.length)?o[0].subMenu:o}}function P(e){return e===n.scoring}function B(n,e){var l;let o={type:n,_id:s(),operator:""},d=e.values;if(!d&&e.opValues&&e.opValues[0]&&(d=e.opValues[0]),"field"===n){let n;n=!(null==e?void 0:e.multiple)||"autocomplete"!==(null==e?void 0:e.type)&&"selectimage"!==(null==e?void 0:e.type)?null===(l=i.find((n=>n.type===e.type)))||void 0===l?void 0:l.conditionalOperators:["in","notin","equals","notequals"];const t=n?n[0]:null;o=Object.assign(Object.assign({},o),{field:{name:e.name,title:e.title,type:e.type,values:d},values:[d?d[0]:null],operator:t})}return o}function M(n,l){const i={type:n.type,title:t(n.title),name:s(),icon:n.icon,category:n.category};return n.type===e.select&&(i.imageLayout="row"),n.type===e.multiphotos&&(i.maxPhotos=5),n.type!==e.photo&&n.type!==e.multiphotos||(i.allowLibrary=!0,i.allowUnsplash=!0,i.allowGif=!0),n.type===e.information&&(i.value=""),n.type===e.emailreport&&(i.showUsers=!0),"lesson"===l&&(i.required=!0),i}function N(n){let e,l=[];n.forEach(((i,d)=>{var t;i.condition&&o(i.condition)&&i.condition.forEach((n=>{n.field&&(l=function(n,e,l){return l.field&&o(l.field)?l.field.forEach((()=>{n=R(n,l,e)})):l.field&&(n=R(n,l,e)),n}(l,d,n))})),null===(t=i.items)||void 0===t||t.forEach(((l,i)=>{var t,a;l.condition&&(o(l.condition)?l.condition.forEach((o=>{var t,a;(null===(a=null===(t=o)||void 0===t?void 0:t.field)||void 0===a?void 0:a.name)!==l.name&&(e=k({fieldConditions:e,slides:n,condition:o,field:l,childSlideIndex:d,childItemIndex:i}))})):(null===(a=null===(t=null==l?void 0:l.condition)||void 0===t?void 0:t.field)||void 0===a?void 0:a.name)!==l.name&&(e=k({fieldConditions:e,slides:n,condition:l.condition,field:l,childSlideIndex:d,childItemIndex:i})))}))}));const i=function(n,e){let l=e;return(null==n?void 0:n.length)&&(null==e?void 0:e.length)?n.forEach((n=>{l.push();const e=l.findIndex((e=>e.condition._id===n.condition._id));e>-1?l[e]=Object.assign(Object.assign({},l[e]),{pages:n.pages}):l.push(n)})):(null==n?void 0:n.length)?l=n:(null==e?void 0:e.length)&&(l=e),l}(l,e);return n=function(n,e){return null==e||e.forEach((e=>{var l,i,o,d;const{slideIndex:t,itemIndex:a}=v(n,e.condition.field.name);if(null===(o=null===(i=null===(l=n[t])||void 0===l?void 0:l.items[a])||void 0===i?void 0:i.parentConditions)||void 0===o?void 0:o.length){const l=n[t].items[a].parentConditions.findIndex((n=>n.condition._id===e.condition._id));l>-1?n[t].items[a].parentConditions[l]=e:n[t].items[a].parentConditions.push(e)}else(null===(d=n[t])||void 0===d?void 0:d.items[a])&&(n[t].items[a].parentConditions=[e])})),n}(n,i)}function k({fieldConditions:n,slides:e,condition:l,field:i,childSlideIndex:o,childItemIndex:d}){if(l.field){const t=l.field.name,{slideIndex:a,itemIndex:u}=v(e,t);if(e[a].items[u]){const s={condition:l,fields:[i]};if(H({slides:e,parentFieldSlideIndex:a,parentFieldItemIndex:u,childSlideIndex:o,childItemIndex:d,conditionId:l._id})?i.sequentialConditionalField={conditionId:l._id,parentFieldName:t,parentCustomFieldName:e[a].items[u].customName}:i.nonSequentialConditionalFieldPosition={slideIndex:o,itemIndex:d},null==n?void 0:n.length){const e=n.findIndex((n=>n.condition._id===l._id));e>-1?n[e].fields.push(i):n.push(s)}else n=[s]}}return n}function H({slides:n,parentFieldSlideIndex:e,parentFieldItemIndex:l,childSlideIndex:i,childItemIndex:o,conditionId:d}){var t;if(e===i&&o>0){const a=o-1;if(l===a)return!0;const u=n[i].items,s=u[a];let r=!1;if(null==u?void 0:u.length){const n=null===(t=u[o])||void 0===t?void 0:t.condition;(null==n?void 0:n.length)>1&&n.forEach((n=>{var e;n._id!==d&&(null===(e=null==n?void 0:n.field)||void 0===e?void 0:e.name)===s.name&&(r=!0)}))}if((null==s?void 0:s.sequentialConditionalField)&&!r)return H({slides:n,parentFieldSlideIndex:e,parentFieldItemIndex:l,childSlideIndex:i,childItemIndex:a,conditionId:d})}return!1}function R(n,e,l){if(n&&n.length>0){const i=n.findIndex((n=>n.condition._id===e._id));i>-1?n[i].pages.push({pageIndex:l}):n.push({condition:e,pages:[{pageIndex:l}]})}else n.push({condition:e,pages:[{pageIndex:l}]});return n}function z(n,e){const l={slideIndex:-1,itemIndex:-1,conditionIndex:-1};return null==n||n.some(((n,i)=>{var o;return null===(o=n.items)||void 0===o||o.some(((n,o)=>{var d;return!!((null===(d=null==n?void 0:n.parentConditions)||void 0===d?void 0:d.length)&&(l.conditionIndex=n.parentConditions.findIndex((n=>n.condition._id===e)),l.conditionIndex>-1))&&(l.slideIndex=i,l.itemIndex=o,!0)})),l.conditionIndex>=0})),l}function W(n,e){null==e||e.forEach((n=>{var e;null===(e=null==n?void 0:n.items)||void 0===e||e.forEach((n=>{var e;Array.isArray(n.condition)&&(null===(e=n.condition)||void 0===e?void 0:e.length)&&n.condition.forEach((()=>{}))}))}))}function U(n){const e=[];return n.reduce(((n,l)=>((null==l?void 0:l.selectedFields)&&l.selectedFields.forEach((l=>{e.indexOf(l.name)<0&&n.push(l.name),e.push(l.name)})),n)),[])}function Y(n){return(null==n?void 0:n.reduce(((n,e)=>{var l;return n+(null===(l=e.items)||void 0===l?void 0:l.length)||0}),0))||0}function G(n,e,l,i,o,d,{missionDescriptionChanged:t,slidesChanged:a,translationsUpdated:u,scoringChanged:s},r=null,v=!1){if(e){let n=!1;n=pn(l,{title:e.title,baseLanguage:d,order:0,entity:e,location:"lesson"===e.type?"lesson":"campaign",path:"title"},null,n),n=pn(l,{title:e.title,baseLanguage:d,order:1,entity:e,location:"lesson"===e.type?"lesson":"campaign",path:"text"},null,n),n&&(null==t||t.emit(e))}if(null==i?void 0:i.length){let n=!1;i.forEach(((i,o)=>{"lesson"!==(null==e?void 0:e.type)&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1),entity:i,location:"slide",path:"title",slideIndex:o},null,n),n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+1,entity:i,location:"slide",path:"description",slideIndex:o},null,n)),i.items&&i.items.forEach(((i,t)=>{var a,u,s,r;n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1),entity:i,location:"field",path:"title",slideIndex:o,fieldIndex:t},null,n),n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+2),entity:i,location:"field",path:"description",slideIndex:o,fieldIndex:t},null,n);let v=3;const c=function(n){var e,l,i,o,d,t;let a="";return n.complexSelectImageValues&&n.complexSelectImageValues.length>0?a="complexSelectImageValues":n.complexSwipeCardValues&&n.complexSwipeCardValues.length>0&&((null===(e=n.complexSwipeCardValues[0])||void 0===e?void 0:e.length)>0||(null===(l=n.complexSwipeCardValues[1])||void 0===l?void 0:l.length)>0)?a="complexSwipeCardValues":n.complexImageCollectionValues&&n.complexImageCollectionValues.length>0&&((null===(i=n.complexImageCollectionValues[0])||void 0===i?void 0:i.length)>0||(null===(o=n.complexImageCollectionValues[1])||void 0===o?void 0:o.length)>0)?a="complexImageCollectionValues":n.complexCategorizeWordsValues&&n.complexCategorizeWordsValues.length>0?a="complexCategorizeWordsValues":n.complexConnectValues&&n.complexConnectValues.length>0&&((null===(d=n.complexConnectValues[0])||void 0===d?void 0:d.length)>0||(null===(t=n.complexConnectValues[1])||void 0===t?void 0:t.length)>0)&&(a="complexConnectValues"),a}(i);if((null==c?void 0:c.length)>0){const{index:a,hasBeenEdited:u}=function(n,{baseLanguage:e,title:l,path:i,slideIndex:o,fieldIndex:d,idIndex:t,f:a},u=!1){var s;return null===(s=a[i])||void 0===s||s.forEach(((s,r)=>{null==s||s.forEach(((s,v)=>{g(s)?(u=pn(n,{title:l,baseLanguage:e,order:1e3*(o+1)+100*(d+1)+t,entity:a,location:"field",path:`${i}[${r}][${v}]`,slideIndex:o,fieldIndex:d,oldValue:s},null,u),t+=1):s&&s.text&&(u=pn(n,{title:l,baseLanguage:e,order:1e3*(o+1)+100*(d+1)+t,entity:a,location:"field",path:`${i}[${r}][${v}].text`,slideIndex:o,fieldIndex:d,oldValue:s.text},null,u),t+=1)}))})),{index:t,hasBeenEdited:u}}(l,{baseLanguage:d,title:e.title,path:c,slideIndex:o,fieldIndex:t,idIndex:v,f:i},n);n=u,v=a}else{const{values:a,path:u}=xn(i);a&&a.length>0&&u?a.forEach((a=>{n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:`${u}[${a.firstIndex}][${a.secondIndex}]`,slideIndex:o,fieldIndex:t,oldValue:a.value},null,n),v+=1})):i.values&&i.values.length>0&&i.values.forEach(((a,u)=>{n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"values["+u+"]",slideIndex:o,fieldIndex:t,oldValue:a},null,n),v+=1}))}if((null===(u=null===(a=i.complexImageTaggingValues)||void 0===a?void 0:a.annotations)||void 0===u?void 0:u.length)>0){const{index:a,hasBeenEdited:u}=function(n,{baseLanguage:e,title:l,path:i,slideIndex:o,fieldIndex:d,idIndex:t,f:a},u=!1){var s,r;return null===(r=null===(s=a[i])||void 0===s?void 0:s.annotations)||void 0===r||r.forEach(((s,r)=>{p(s)||(u=pn(n,{title:l,baseLanguage:e,order:1e3*(o+1)+100*(d+1)+t,entity:a,location:"field",path:`${i}.annotations[${r}].text`,slideIndex:o,fieldIndex:d,oldValue:s.text},null,u),t+=1)})),{index:t,hasBeenEdited:u}}(l,{baseLanguage:d,title:e.title,path:"complexImageTaggingValues",slideIndex:o,fieldIndex:t,idIndex:v,f:i},n);n=u,v=a}"information"===i.type&&i.value&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"value",slideIndex:o,fieldIndex:t},null,n),v+=1),i.answer&&i.answer.length>0&&i.answer.forEach(((a,u)=>{g(a)&&a.length>0&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"answer["+u+"]",slideIndex:o,fieldIndex:t},null,n),v+=1)})),i.categories&&i.categories.length>0&&(i.complexWordsCategories&&i.complexWordsCategories[0]&&i.complexWordsCategories[0].length>0&&(i.categories=i.complexWordsCategories[0]),i.complexSwipeCategories&&i.complexSwipeCategories[0]&&i.complexSwipeCategories[0].length>0&&(i.categories=i.complexSwipeCategories[0]),i.categories.forEach(((a,u)=>{n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"categories["+u+"]",slideIndex:o,fieldIndex:t},null,n),v+=1}))),i.sentence&&!i.complexSentence&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"sentence",slideIndex:o,fieldIndex:t},null,n),v+=1),i.complexSentence&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"complexSentence",slideIndex:o,fieldIndex:t},null,n),v+=1),i.complexTextSequenceHeading&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"complexTextSequenceHeading",slideIndex:o,fieldIndex:t},null,n),v+=1),i.explanation&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"explanation",slideIndex:o,fieldIndex:t},null,n),v+=1),(null===(r=null===(s=null==i?void 0:i.scratchValues)||void 0===s?void 0:s[1])||void 0===r?void 0:r.text)&&(n=pn(l,{title:e.title,baseLanguage:d,order:1e3*(o+1)+100*(t+1)+v,entity:i,location:"field",path:"scratchValues[1].text",slideIndex:o,fieldIndex:t},null,n),v+=1)}))})),n&&(null==a||a.emit({slides:i}))}(null==o?void 0:o.length)&&!(null==e?void 0:e.active)&&(o.forEach(((n,i)=>{pn(l,{title:e.title,baseLanguage:d,order:1e4*(i+1),entity:n,location:"scoring",path:"title"}),pn(l,{title:e.title,baseLanguage:d,order:1e4*(i+1)+1,entity:n,location:"scoring",path:"description"})})),null==s||s.emit(o)),u&&u.emit({translations:l,overwrite:n,googleTranslate:!0,languages:r,onlyTranslateMissingTranslations:v})}function J(n,e){null==n||n.forEach((n=>{var l;null===(l=n.items)||void 0===l||l.forEach((n=>{e.indexOf(n.name)>-1&&(n.hasScoring=!0)}))}))}function K(n,e){var l;const i=null===(l=null==n?void 0:n.scoreValuePairs)||void 0===l?void 0:l.map((n=>n.value));return e.forEach((e=>{var l;i.includes(e)||null===(l=null==n?void 0:n.scoreValuePairs)||void 0===l||l.push({value:e,score:null})})),n}function Q(n,e){var i;const o=[];return o.push(`${null==n?void 0:n.fieldName}value`),e===(null==l?void 0:l.numberRating)?o.push(null==n?void 0:n.fieldName):null===(i=null==n?void 0:n.scoreValuePairs)||void 0===i||i.forEach((e=>{null==o||o.push(`${null==n?void 0:n.fieldName}${null==e?void 0:e.value}`)})),o}function _(n,e){return n.reduce(((n,l)=>(l.name!==e&&n.push(l),n)),[])}function X(n){let e,l=0;return[n.map(((n,i)=>(n.isActive?(e=Object.assign({},n),n.isSelected=!0,l=i):n&&(n.isSelected=!1),n))),e,l]}function Z(n,e){var l,i;return!!n&&!!(null===(i=null===(l=n[e])||void 0===l?void 0:l.items)||void 0===i?void 0:i.length)}function nn(n){let e=[],l=[];return n&&o(n)?n.forEach((n=>{"tags"===n.type||"groups"===n.type?e.push(n):"field"===n.type&&l.push(n)})):!n||"tags"!==n.type&&"groups"!==n.type?n&&"field"===n.type&&(l=[n]):e=[n],{restrictionConditions:e,fieldConditions:l}}function en(n){null==n||n.forEach((n=>{var e;null===(e=n.items)||void 0===e||e.forEach(((n,e)=>{n.formCreatorIndex=e}))}))}function ln(n,e){return null==n||n.forEach((n=>{var l,i,o;const d=n.condition;(null===(i=null===(l=e[n.slideIndex])||void 0===l?void 0:l.items[n.itemIndex])||void 0===i?void 0:i.parentConditions)?e[n.slideIndex].items[n.itemIndex].parentConditions.findIndex((n=>n.condition._id===d._id))<0&&e[n.slideIndex].items[n.itemIndex].parentConditions.push({condition:d}):(null===(o=e[n.slideIndex])||void 0===o?void 0:o.items[n.itemIndex])&&(e[n.slideIndex].items[n.itemIndex].parentConditions=[{condition:d}])})),e}function on(n,e){const l=(null==n?void 0:n.findIndex((n=>n.condition._id===e._id)))||-1;return l>-1&&n.splice(l,1),n}function dn(n,e){var l,i;let o=(null===(l=null==e?void 0:e.sequentialConditionalField)||void 0===l?void 0:l.parentCustomFieldName)||(null===(i=null==e?void 0:e.sequentialConditionalField)||void 0===i?void 0:i.parentFieldName);const d=n.find((n=>n.name===o));return d&&(o=dn(n,d)),o}function tn(n,e,l){var i;if(null===(i=n.fields)||void 0===i?void 0:i.length){let i=[];return n.fields.forEach((n=>{var o;(null===(o=null==n?void 0:n.parentConditions)||void 0===o?void 0:o.length)&&n.parentConditions.forEach((n=>{const e=tn(n);e&&(i=[...i,...e.childFields])})),(null==n?void 0:n.sequentialConditionalField)&&l&&(l=function(n,e,l){if(l){const i=l.findIndex((e=>e.conditionId===n.sequentialConditionalField.conditionId));i>-1?l[i]={conditionId:n.sequentialConditionalField.conditionId,lastSequentialFieldIndex:e}:l.push({conditionId:n.sequentialConditionalField.conditionId,lastSequentialFieldIndex:e})}else l.push({conditionId:n.sequentialConditionalField.conditionId,lastSequentialFieldIndex:e});return l}(n,e+=1,l)),i.push({name:n.customName||n.name,sequentialConditionalField:n.sequentialConditionalField})})),l?{childFields:i,sequentialConditionFields:l,lastSequentialFieldIndex:e}:{childFields:i}}}function an(n,e){let l=[],i=[];if(null==n?void 0:n.length){let o=e;n.forEach((n=>{const e=tn(n,o,i);e&&(i=e.sequentialConditionFields,o=e.lastSequentialFieldIndex,l=[...l,...e.childFields])})),l.forEach((n=>{(null==n?void 0:n.sequentialConditionalField)&&(n.sequentialConditionalField.masterParentFieldName=dn(l,n))}))}return{childFields:l,sequentialConditionFields:i}}function un(n){var e,l;const i=[];null===(e=null==n?void 0:n.items)||void 0===e||e.forEach((n=>{const e=s();i.push({oldId:n.name,newId:e}),n.name=e})),null===(l=null==n?void 0:n.items)||void 0===l||l.forEach((n=>{var e;o(n.condition)?null===(e=n.condition)||void 0===e||e.forEach((n=>{sn(n,i)})):sn(n.condition,i)}))}function sn(n,e){var l;if(n&&!g(n)&&"field"===n.type&&(null===(l=n.field)||void 0===l?void 0:l.name)){const l=null==e?void 0:e.findIndex((e=>e.oldId===n.field.name));l>-1&&(n.field.name=e[l].newId,n._id=s())}}function rn(n){var e;let l=0;return(null===(e=null==n?void 0:n.parentConditions)||void 0===e?void 0:e.length)>0&&n.parentConditions.forEach((e=>{e&&e.fields&&e.fields.length>0&&e.fields&&e.fields.forEach((e=>{e.sequentialConditionalField&&e.sequentialConditionalField.parentFieldName===n.name&&(l+=1,l+=rn(e))}))})),l}function vn(n,e,l){let i=l;for(;n[e]&&n[e].items[i]&&n[e].items[i].sequentialConditionalField;)i=v(n,n[e].items[i].sequentialConditionalField.parentFieldName).itemIndex;return i}function cn(n,e,l,i){let o;if(n&&i){i=i.replace(/%/g,"");let d=e.findIndex((n=>i===n.key));-1===d&&(i=i.replace(/(<([^>]+)>)/gi,""),d=e.findIndex((n=>i===n.key))),e[d]&&e[d][l]&&(e[d][l]!==n&&(o=e[d]),e[d][l]=n)}return{translations:e,updatedTranslation:o}}function fn(n){const e=[];return n.forEach(((n,l)=>{n&&n.length>0&&n.forEach(((n,i)=>{e.push({value:n,firstIndex:l,secondIndex:i})}))})),e}function xn(n){return n.complexSelectValues&&n.complexSelectValues.length>0?{path:"complexSelectValues",values:fn(n.complexSelectValues)}:n.complexSelectMultiValues&&n.complexSelectMultiValues.length>0?{path:"complexSelectMultiValues",values:fn(n.complexSelectMultiValues)}:n.complexConnectValues&&n.complexConnectValues.length>0?{path:"complexConnectValues",values:fn(n.complexConnectValues)}:n.complexRevealValues&&n.complexRevealValues.length>0?{path:"complexRevealValues",values:fn(n.complexRevealValues)}:n.complexTextSequenceValues&&n.complexTextSequenceValues.length>0?{path:"complexTextSequenceValues",values:fn(n.complexTextSequenceValues)}:n.complexChatValues&&n.complexChatValues.length>0?{path:"complexChatValues",values:fn(n.complexChatValues)}:n.complexMissingWordValues&&n.complexMissingWordValues.length>0?{path:"complexMissingWordValues",values:fn(n.complexMissingWordValues)}:n.complexSwipeCardTextValues&&n.complexSwipeCardTextValues.length>0?{path:"complexSwipeCardTextValues",values:fn(n.complexSwipeCardTextValues)}:n.complexRankingValues&&n.complexRankingValues.length>0?{path:"complexRankingValues",values:fn(n.complexRankingValues)}:n.complexImageTaggingMockValues&&n.complexImageTaggingMockValues.length>0?{path:"complexImageTaggingMockValues",values:fn(n.complexImageTaggingMockValues)}:n.opValues&&n.opValues.length>0?{path:"opValues",values:fn(n.opValues)}:{path:null,values:null}}function pn(n,{title:e,order:l,entity:i,location:o,path:t,slideIndex:a,fieldIndex:u,oldValue:s,baseLanguage:r},v,c=!1){if("string"!=typeof(s=s||m(i,t)))return c;const x=$n(s,n)&&("field"===o&&"description"===t||"lesson"===o||"campaign"===o);if(!d(s)&&""!==s&&!x){let d=n.findIndex((n=>"%"+n.key+"%"===s||n.key===s));if(-1===d){const e=s.replace(/(<([^>]+)>)/gi,"");d=n.findIndex((n=>"%"+n.key+"%"===e||n.key===e))}if(d<0){const d=function(n,e,l){return f(n,e,l)}(e,s,{slideIndex:a,fieldIndex:u}),x={order:l,location:o,type:t,value:s,key:d,language:r};v&&(x.group=v.group,x.missionDescriptionRef=v.missionDescriptionRef,x._tenant=v._tenant,x._tenantRef=v._tenantRef),x[r]=s,n.push(x),h(i,t,"%"+d+"%"),c=!0}else n[d]&&(n[d].order=l)}return c}function In(n,e,l,i){return e.map((e=>{var o,d;return{text:n?e.title:`${t("FIELDIF")} ${a(null===(o=null==e?void 0:e.field)||void 0===o?void 0:o.title)} ${t(null===(d=e.operator)||void 0===d?void 0:d.toUpperCase())}: ${a(e.values?e.values[0]:e.value)}`,icon:n?"restriction":"condition",handler:()=>l.emit({conditionId:e._id}),actionableIcon:{icon:"delete",handler:()=>i.event.emit(Object.assign(Object.assign({},i.options),{conditionId:e._id}))}}}))}function gn(n,e,l){return(null==l?void 0:l.length)?!!l.find((l=>n&&n[l.slideIndex]&&n[l.slideIndex].items&&n[l.slideIndex].items[l.itemIndex]&&n[l.slideIndex].items[l.itemIndex][e])):!!(null==n?void 0:n.find((n=>n.items.findIndex((n=>n[e]))>-1)))}function mn(n,e){return(null==n?void 0:n.editable)?e={title:"EDITABLE",icon:"brush"}:(null==n?void 0:n.hidden)?e={title:"HIDDEN",icon:"offline"}:(null==n?void 0:n.readonly)&&(e={title:"READONLY",icon:"eye"}),e}function hn(n,e,l,i){n.stopPropagation();const o=n.detail;return null==e||e.forEach((n=>{var e;"parallel"===(null==n?void 0:n.type)?null===(e=null==n?void 0:n.steps)||void 0===e||e.forEach((n=>n.forEach((n=>{(null==n?void 0:n._id)===o&&(l=n)})))):(null==n?void 0:n._id)===o&&(l=n)})),i.emit(l),l}function bn(n,e){const l=[];return n.forEach((i=>{var o;delete i.parentConditions,delete i.slideIndex,delete i.slideTitle,(null==e?void 0:e.length)>0&&Ln(i,e),Array.isArray(null==i?void 0:i.condition)&&(null===(o=i.condition)||void 0===o?void 0:o.length)>0&&(i.condition=u(i.condition.map((e=>{var i;return"field"!==(null===(i=e)||void 0===i?void 0:i.type)||n.findIndex((n=>{var l;return n.name===(null===(l=e)||void 0===l?void 0:l.field.name)}))>-1?e:void l.push(e._id)}))))})),{cleanedFields:n,removedConditionIds:l}}function yn(n){const e=n.map((n=>{const e=I(n);return e.name=s(),e}));return e.forEach((l=>{var i;Array.isArray(null==l?void 0:l.condition)&&(null===(i=l.condition)||void 0===i?void 0:i.length)>0&&l.condition.forEach((l=>{if(l._id=s(),"field"===l.type){const i=n.findIndex((n=>{var e;return n.name===(null===(e=l)||void 0===e?void 0:e.field.name)}));i>-1&&(l.field.name=e[i].name)}}))})),e}function Cn(n,e,l){const i=n[e]?n[e]:m(n,e);if(n){const o=l.find((n=>{let e="";return i&&i.replace&&(e=i.replace(/(<([^>]+)>)/gi,"")),"%"+n.key+"%"===i||n.key===i||"%"+n.key+"%"===e||n.key===e}));o&&o.value&&h(n,e,o.value)}}function Ln(n,e){var l,i,o,d,t,a,u,s,r,v,c,f;Cn(n,"title",e),Cn(n,"description",e),Cn(n,"explanation",e),Cn(n,"sentence",e),Cn(n,"complexSentence",e),Cn(n,"value",e),Cn(n,"complexTextSequenceHeading",e);const{values:x,path:I}=xn(n);(null==x?void 0:x.length)&&I?x.forEach((l=>{Cn(n,`${I}[${l.firstIndex}][${l.secondIndex}]`,e)})):(null===(l=null==n?void 0:n.values)||void 0===l?void 0:l.length)&&n.values.forEach(((l,i)=>{Cn(n,"values["+i+"]",e)})),(null===(i=null==n?void 0:n.categories)||void 0===i?void 0:i.length)&&(n.categories.forEach(((l,i)=>{Cn(n,"categories["+i+"]",e)})),n.complexSwipeCategories&&n.complexSwipeCategories[0]&&n.complexSwipeCategories[0].length>0&&(n.complexSwipeCategories[0]=n.categories)),(null===(o=null==n?void 0:n.complexSelectImageValues)||void 0===o?void 0:o.length)&&Vn("complexSelectImageValues",n,e),(null===(d=null==n?void 0:n.complexSwipeCardValues)||void 0===d?void 0:d.length)&&Vn("complexSwipeCardValues",n,e),(null===(t=null==n?void 0:n.complexImageCollectionValues)||void 0===t?void 0:t.length)&&Vn("complexImageCollectionValues",n,e),(null===(a=null==n?void 0:n.complexCategorizeWordsValues)||void 0===a?void 0:a.length)&&Vn("complexCategorizeWordsValues",n,e),(null===(u=null==n?void 0:n.complexConnectValues)||void 0===u?void 0:u.length)&&Vn("complexConnectValues",n,e),(null===(r=null===(s=null==n?void 0:n.complexImageTaggingValues)||void 0===s?void 0:s.annotations)||void 0===r?void 0:r.length)&&function(n,e,l){var i,o;(null===(o=null===(i=e[n])||void 0===i?void 0:i.annotations)||void 0===o?void 0:o.length)&&e[n].annotations.forEach(((i,o)=>{p(i)||Cn(e,`${n}.annotations[${o}].text`,l)}))}("complexImageTaggingValues",n,e),(null===(v=null==n?void 0:n.answer)||void 0===v?void 0:v.length)&&n.answer.forEach(((l,i)=>{Cn(n,"answer["+i+"]",e)})),(null===(f=null===(c=null==n?void 0:n.scratchValues)||void 0===c?void 0:c[1])||void 0===f?void 0:f.text)&&Cn(n,"scratchValues[1].text",e)}function Vn(n,e,l){e[n].forEach(((i,o)=>{(null==i?void 0:i.length)&&i.forEach(((i,d)=>{g(i)?Cn(e,`${n}[${o}][${d}]`,l):i&&i.text&&Cn(e,`${n}[${o}][${d}].text`,l)}))}))}function $n(n,e){let l=x(n);if(!l&&(null==n?void 0:n.replace)){const e=n.replace(/(<([^>]+)>)/gi,"");l=x(e)}else!l&&c(n)&&e&&(l=(null==e?void 0:e.findIndex((e=>e.key===n)))>-1);return l}export{Z as A,rn as B,B as C,T as D,yn as E,M as F,gn as G,K as H,nn as I,an as J,Cn as K,Ln as L,$n as M,pn as N,hn as O,mn as P,cn as Q,In as R,b as S,y as T,A as U,un as a,q as b,E as c,S as d,L as e,V as f,vn as g,$ as h,P as i,z as j,W as k,D as l,bn as m,on as n,w as o,X as p,U as q,F as r,Q as s,G as t,_ as u,J as v,en as w,Y as x,N as y,ln as z}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,f as e,h as o,H as s,g as a}from"./p-c26cc6ff.js";import{h as n,i as r,j as l,k as h,S as d,A as c,l as p}from"./p-4d956bd4.js";import{c as m}from"./p-6dbac5f2.js";import{t as b,b1 as f,Y as v,u as g,a1 as u,s as y,an as x,a3 as w}from"./p-a966475f.js";import{g as C}from"./p-e37ba040.js";import{u as k,c as I,r as S,s as E,a as T,f as O,b as F,d as A,e as N,g as L,h as D,p as j,i as z,j as R,k as B,l as P,m as M}from"./p-9a039ee7.js";import"./p-b5241164.js";import{f as U}from"./p-33b2d3a2.js";import{S as V}from"./p-12797a88.js";import{N as G,A as q}from"./p-67fc8d0d.js";import{a as H,s as W,u as Y,i as K,g as $,r as Q,b as _,c as Z,d as J,e as X,f as tt,h as it,j as et,k as ot,l as st,m as at,t as nt,n as rt,o as lt,p as ht,q as dt,v as ct,w as pt,x as mt,y as bt,z as ft,A as vt,B as gt,C as ut,D as yt,E as xt,F as wt,G as Ct,H as kt,I as It,J as St}from"./p-5c6ef130.js";import{c as Et}from"./p-a7d0e964.js";import{o as Tt}from"./p-4ae61297.js";import"./p-9229f5bb.js";import"./p-e0d6fbed.js";import"./p-ca8f9900.js";import"./p-0bb947fc.js";import"./p-cfdeea96.js";import"./p-c5108113.js";import"./p-43f71ef3.js";import"./p-a1142cd3.js";import"./p-b5ba03fd.js";import"./p-56bcc009.js";import"./p-baaa30cf.js";import"./p-e3093327.js";import"./p-bd19a341.js";import"./p-179b66ff.js";import"./p-12bedee1.js";import"./p-cbb53f3f.js";import"./p-c5efae11.js";import"./p-b4aad66a.js";import"./p-f9649bd9.js";import"./p-773567d1.js";import"./p-1901b669.js";import"./p-3fc615dd.js";import"./p-ba705441.js";import"./p-5ebbcf89.js";import"./p-49399b44.js";import"./p-3c4a6a3e.js";import"./p-55a739af.js";import"./p-bdb9f4f1.js";import"./p-e1378940.js";import"./p-cfca4271.js";import"./p-c3ec533d.js";import"./p-935fbfac.js";import"./p-2043b4c7.js";import"./p-0dae56e6.js";import"./p-10b2bb56.js";import"./p-6348f445.js";import"./p-c06335c1.js";import"./p-01267bd9.js";import"./p-c412a16f.js";import"./p-9de400aa.js";import"./p-dd576b82.js";import"./p-d7e73bcb.js";const Ot=[n.custom,n.settings,n.move,n.duplicate,n.delete,n.close],Ft=class{constructor(e){t(this,e),this.planChanged=i(this,"planChanged",7),this.reloadLivePreview=i(this,"reloadLivePreview",7),this.leftMenuChange=i(this,"leftMenuChange",7),this.loadNewTranslations=i(this,"loadNewTranslations",7),this.closeClicked=i(this,"closeClicked",7),this.saveClicked=i(this,"saveClicked",7),this.pageHeaderClicked=i(this,"pageHeaderClicked",7),this.formCreatorBlockExpanded=i(this,"formCreatorBlockExpanded",7),this.slidesChanged=i(this,"slidesChanged",7),this.addNewPageClicked=i(this,"addNewPageClicked",7),this.newScoringClicked=i(this,"newScoringClicked",7),this.scoringChanged=i(this,"scoringChanged",7),this.scoringQuickSetup=i(this,"scoringQuickSetup",7),this.editPageSettings=i(this,"editPageSettings",7),this.openFullPageLivePreviewClicked=i(this,"openFullPageLivePreviewClicked",7),this.baseLanguageChanged=i(this,"baseLanguageChanged",7),this.selectedLanguagesChanged=i(this,"selectedLanguagesChanged",7),this.translationUpdated=i(this,"translationUpdated",7),this.translationsUpdated=i(this,"translationsUpdated",7),this.translationEdited=i(this,"translationEdited",7),this.translationRemoved=i(this,"translationRemoved",7),this.translationRemoveAll=i(this,"translationRemoveAll",7),this.translationImport=i(this,"translationImport",7),this.translateValue=i(this,"translateValue",7),this.saveNewTranslations=i(this,"saveNewTranslations",7),this.missionDescriptionChanged=i(this,"missionDescriptionChanged",7),this.editMultipleFields=i(this,"editMultipleFields",7),this.createCustomFormFields=i(this,"createCustomFormFields",7),this.customFieldEdited=i(this,"customFieldEdited",7),this.customFieldDeleted=i(this,"customFieldDeleted",7),this.hasLoaded=i(this,"hasLoaded",7),this.formFieldBlockExpanded=i(this,"formFieldBlockExpanded",7),this.centerContentWidthChanged=i(this,"centerContentWidthChanged",7),this.scrollContent=i(this,"scrollContent",7),this.createNewRestrictionClicked=i(this,"createNewRestrictionClicked",7),this.editRestrictionCondition=i(this,"editRestrictionCondition",7),this.formFieldDelete=i(this,"formFieldDelete",7),this.setLoading=i(this,"setLoading",7),this.translateDialogClosed=i(this,"translateDialogClosed",7),this.newPageAdded=i(this,"newPageAdded",7),this.translateDialogLanguageChanged=i(this,"translateDialogLanguageChanged",7),this.showQrCode=i(this,"showQrCode",7),this.headerWarningClicked=i(this,"headerWarningClicked",7),this.workflowStepAdded=i(this,"workflowStepAdded",7),this.workflowStepUpdated=i(this,"workflowStepUpdated",7),this.workflowStepEdited=i(this,"workflowStepEdited",7),this.workflowStepRemoved=i(this,"workflowStepRemoved",7),this.workflowBranchAdded=i(this,"workflowBranchAdded",7),this.workflowStepParallelStepAdded=i(this,"workflowStepParallelStepAdded",7),this.workflowCurrentStepChanged=i(this,"workflowCurrentStepChanged",7),this.openZenDesk=i(this,"openZenDesk",7),this.formFields=[],this.categories=[],this.options=[],this.helpCenterOptions=[],this.bulkActions=Ot,this.showPagesSection=!0,this.scoring=[],this.selectedLeftMenuOption=r.blocks,this.selectedPageIndex=0,this.showConditions=!1,this.showLeftMenuSelection=!0,this.numberOfBlocksToRender=20,this.selectionMode=!1,this.isLivePreviewHidden=!1,this.selectedFields=[],this.shouldRenderLeftSelectionContent=!0,this.currentSlides=[],this.parentBlockIndices=[],this.simpleFormBlocks={information:[]},this.newFieldContainerBlocks=[],this.newFieldCategoryBlocks=[],this.expandableBlockContainers=[],this.expandableBlocks=[],this.leftMenuSortables=[],this.hasPageChanged=-1,this.hasLeftMenuOptionChanged=!1,this.totalFields=0,this.fieldsWithScoring=[],this.selectedScoringIndex=0,this.isPagesAccordionOpen=!0,this.hasAdditionBeenClicked=!1,this.infiniteScrolls=[],this.unattachedParentConditions=[],this.restrictionConditionSelectedTab=0,this.expandedConditions=[],this.onInsertPageAfterClicked=t=>{t&&this.onAddNewPage(t.detail+1)},this.onPageClicked=t=>{var i,e,o;(null===(i=this.newUndefinedCondition)||void 0===i?void 0:i.pageCondition)&&(null===(e=this.newUndefinedCondition)||void 0===e?void 0:e.condition)?(this.addPageCondition(this.newUndefinedCondition.condition,t.detail),this.newUndefinedCondition=null,this.removeOverlays()):(null===(o=this.newUndefinedCondition)||void 0===o?void 0:o.pageCondition)?(this.createNewRestrictionClicked.emit({pageIndex:t.detail,type:this.newUndefinedCondition.type}),this.newUndefinedCondition=null,this.removeOverlays()):(this.selectedPageIndex=t.detail,this.pageHeaderClicked.emit(t.detail),this.hasPageChanged=t.detail,this.resetExpandableBlockReferences())},this.onDuplicatePageClicked=t=>{var i,e,o;if(t){const s=Et(this.currentSlides[t.detail]);H(s);const a=[];(null===(i=this.translations)||void 0===i?void 0:i.length)>0&&(null===(e=this.translations)||void 0===e||e.forEach((t=>{const i=k(Et(t),this.baseLanguage);I(null,!1,`%${t.key}%`,s,`%${i.key}%`,{key:t.key,updateKey:i.key})&&a.push(i)})),null===(o=null==s?void 0:s.items)||void 0===o||o.forEach((t=>{var i;t.opValues&&(null===(i=t.opValues[0])||void 0===i?void 0:i.length)>0&&t.values&&(t.opValues[0]=Et(t.values))}))),this.saveNewTranslations.emit(a),this.currentSlides.splice(t.detail+1,0,s),this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender()}},this.onDeletePageClicked=t=>{var i;if(t){const e=(null===(i=this.missionDescription)||void 0===i?void 0:i.active)?b("DELETEPAGEACTIVECAMPAIGN"):b("DELETECONFIRMPAGE");f(b("CONFIRM"),[b("YOOBICNO"),b("YOOBICOK")],e).then((i=>{var e,o,s;i&&(null===(e=this.currentSlides[t.detail])||void 0===e||e.items.forEach((t=>{this.scoring=S(t.name,this.scoring)})),this.computeScoringTotal(),(null===(o=this.scoring)||void 0===o?void 0:o.length)>0&&this.scoringChanged.emit(this.scoring),t.detail===this.selectedPageIndex&&(null===(s=this.currentExpandableFieldSortable)||void 0===s||s.destroy(),this.currentExpandableFieldSortable=null),this.currentSlides.splice(t.detail,1),this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender())}))}},this.onEditPageClicked=t=>{t&&this.editPageSettings.emit(t.detail)},this.onAddSiteTagRestrictionClicked=t=>{t&&this.createNewRestrictionClicked.emit({pageIndex:t.detail,type:"tags"})},this.onAddUserGroupRestrictionClicked=t=>{t&&this.createNewRestrictionClicked.emit({pageIndex:t.detail,type:"groups"})},this.onScoreChanged=t=>{const{formattedScoring:i,scoringCategory:e}=t.detail,o=E(i,e);this.updateScoring(o)},this.onScoreDeleted=t=>{const{formattedScoring:i,scoringCategory:e}=t.detail;W(i,e).forEach((t=>{delete this.selectedScoring[t]})),this.selectedScoring.selectedFields=Y(this.selectedScoring.selectedFields,null==i?void 0:i.fieldName),this.selectedScoring=Object.assign({},this.selectedScoring),this.scoring[this.selectedScoringIndex]=this.selectedScoring,this.isInOtherScoring(null==i?void 0:i.fieldName)||this.toggleHasScoring(null==i?void 0:i.fieldName),this.computeScoringTotal(),this.scoringChanged.emit(this.scoring),this.emitNewSlidesAndRerender()},this.onScoreAdded=t=>{const{formattedScoring:i,scoringCategory:e}=t.detail,o=E(i,e),s=this.slides[this.selectedPageIndex].items.find((t=>t.name===i.fieldName));this.selectedScoring.selectedFields=Y(this.selectedScoring.selectedFields,i.fieldName),this.selectedScoring=Object.assign({},this.selectedScoring),this.isInOtherScoring(i.fieldName)||this.toggleHasScoring(i.fieldName),this.scoring[this.selectedScoringIndex].selectedFields.push(s),this.updateScoring(o),this.emitNewSlidesAndRerender()}}get isTranslatorForm(){var t;return 1===(null===(t=this.options)||void 0===t?void 0:t.length)&&this.options[0]===r.translate}get showLogics(){return this.options.includes(r.logic)}get showScorings(){return this.options.includes(r.scoring)}get showTranslations(){return this.options.includes(r.translate)}get showDesign(){return this.options.includes(r.design)}get showWorkflow(){return this.options.includes(r.workflow)}get isLesson(){var t;return"lesson"===(null===(t=this.missionDescription)||void 0===t?void 0:t.type)}onCustomFormFieldsUpdated(){this.fieldSelectorElement&&(this.fieldSelectorElement.initialCustomFormFields=null,this.fieldSelectorElement.initialCustomFormFields=this.customFormFields)}updateSelectedScoring(t){const i=this.scoring.findIndex((i=>i.title===t.title));i>-1&&(this.selectedScoringIndex=i),this.selectedScoring=t}updateInternalSlides(t){var i;t=null==t?void 0:t.map(((t,i)=>{var e;return t.items=null===(e=null==t?void 0:t.items)||void 0===e?void 0:e.map(((t,e)=>{var o,s,a;return(t=T(t,c)).isExpanded||(null===(o=this.currentExpandedBlockLocation)||void 0===o?void 0:o.slideIndex)!==i||(null===(s=this.currentExpandedBlockLocation)||void 0===s?void 0:s.itemIndex)!==e||(null===(a=this.newFieldCondition)||void 0===a?void 0:a.condition)||(t.isExpanded=!0),t})),t})),this.currentSlides=this.hasLeftMenuOptionChanged?Et(t):[...t],this.selectedLeftMenuOption===r.workflow&&(this.missionDescription.slides=t),this.hasAdditionBeenClicked&&(null===(i=this.newFieldCondition)||void 0===i?void 0:i.condition)&&(this.newFieldCondition=null,this.overlayElement.initialNewFieldCondition=this.newFieldCondition,this.hasAdditionBeenClicked=!1)}onTranslationsChanged(){var t,i,e,o;this.haveTranslationsUpdated=!0,this.reloadLivePreview.emit(),this.livePreviewElement&&(this.livePreviewElement.missionDescriptionTitle=v((null===(t=this.missionDescription)||void 0===t?void 0:t.title)||(null===(i=this.plan)||void 0===i?void 0:i.title))),this.formCreatorHeader&&(this.formCreatorHeader.formTitle=v((null===(e=this.missionDescription)||void 0===e?void 0:e.title)||(null===(o=this.plan)||void 0===o?void 0:o.title))),this.formCreatorTranslateDialog&&(this.formCreatorTranslateDialog.translations=this.translations,this.formCreatorTranslateDialog.forceUpdateTranslations())}onAdditionClicked(t){t.detail.customFieldId?this.onCustomFieldAdded(t.detail.customFieldId):t.detail.conditionType||t.detail.condition?this.onAddNewCondition(t.detail.conditionType,t.detail.pageRestriction,t.detail.condition):t.detail.field&&(this.hasAdditionBeenClicked=!0,this.onFormFieldAdd(t.detail.field))}onCustomFieldEdited(t){t.stopImmediatePropagation(),this.customFieldEdited.emit(t.detail)}onCustomFieldDeleted(t){t.stopImmediatePropagation(),this.customFieldDeleted.emit(t.detail)}onConditionExpanded(t){t.detail.expanded&&(this.collapseAllBlocks(null,!0),this.scrollToField(t.detail.index,t.detail.host),this.expandedConditions.push(t.detail.host))}onCreatorBlockExpanded(t){var i;if(null==t?void 0:t.detail){const{slideIndex:e,itemIndex:o}=O(this.currentSlides,t.detail.name);if(o>-1)if(t.detail.expanded&&!K(this.selectedLeftMenuOption)){if(this.currentExpandedBlockLocation&&o!==this.currentExpandedBlockLocation.itemIndex){const t=$(this.currentSlides,this.selectedPageIndex,this.currentExpandedBlockLocation.itemIndex);this.expandableBlocks&&this.expandableBlocks[t]&&this.expandableBlocks[t].expandBlock(!1,this.currentExpandedBlockLocation.itemIndex!==t,o)}this.collapseAllBlocks(t.detail.name,!0),this.formCreatorBlockExpanded.emit({pageIndex:e,itemIndex:o}),this.currentExpandedBlockLocation={slideIndex:e,itemIndex:o},this.expandedFieldName=t.detail.name||this.expandedFieldName,this.scrollToField(o)}else!t.detail.expanded&&this.currentExpandedBlockLocation&&o===this.currentExpandedBlockLocation.itemIndex?(this.currentExpandedBlockLocation=null,this.currentSlides[e].items[o].isExpanded=!1):!t.detail.expanded&&this.forceFieldRerender&&(this.forceFieldRerender=null);t.detail.expanded&&(null===(i=this.expandedConditions)||void 0===i||i.forEach((t=>{t.forceCollapse()})),this.expandedConditions=[])}}onRemoveConditionClicked(t){f(b("CONFIRM"),[b("YOOBICNO"),b("YOOBICOK")],b("REMOVECONDITIONCONFIRM")).then((i=>{if(i){const{slides:i,unattachedParentConditions:e}=Q(this.currentSlides,t.detail.name,this.unattachedParentConditions,t.detail.conditionId);this.currentSlides=i,this.unattachedParentConditions=e,this.emitNewSlidesAndRerender()}}))}onRemovePageCondition(t){if(t&&t.detail){const{slides:i,unattachedParentConditions:e}=_(this.currentSlides,t.detail.slideIndex,t.detail.conditionId,this.unattachedParentConditions);this.currentSlides=i,this.unattachedParentConditions=e,this.emitNewSlidesAndRerender()}}onFormFieldDelete(t){var i;if(t&&t.detail){const{slideIndex:e,itemIndex:o}=O(this.currentSlides,t.detail.name),s=(null===(i=this.missionDescription)||void 0===i?void 0:i.active)?b("DELETEFIELDACTIVECAMPAIGN"):b("DELETECONFIRMFIELD");f(b("CONFIRM"),[b("YOOBICNO"),b("YOOBICOK")],s).then((i=>{var s,a,n,r,l;i&&(this.unattachedParentConditions=Z(this.currentSlides,{slideIndex:e,itemIndex:o},this.unattachedParentConditions),this.formFieldDelete.emit({name:t.detail.name}),this.scoring=S(t.detail.name,this.scoring),this.computeScoringTotal(),J(this.currentSlides,{slideIndex:e,itemIndex:o,name:t.detail.name}),this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender(),0!==(null===(a=null===(s=this.currentSlides[e])||void 0===s?void 0:s.items)||void 0===a?void 0:a.length)&&(null===(n=this.currentSlides[e])||void 0===n?void 0:n.items)||(this.leftMenuSortables.forEach((t=>t.destroy())),this.leftMenuSortables=[],this.forceSortableRefresh=!0),(null===(r=this.currentExpandedBlockLocation)||void 0===r?void 0:r.slideIndex)===e&&(null===(l=this.currentExpandedBlockLocation)||void 0===l?void 0:l.itemIndex)===o&&(this.currentExpandedBlockLocation=null))}))}}onFormFieldDuplicate(t){var i,e;if(null==t?void 0:t.detail){const{slideIndex:o,itemIndex:s}=O(this.currentSlides,t.detail.name);if(this.currentSlides=X(this.currentSlides,{slideIndex:o,itemIndex:s},!1,null,"dataset"===(null===(i=this.missionDescription)||void 0===i?void 0:i.type)),null===(e=this.translations)||void 0===e?void 0:e.length){const t=[];this.updateDuplicatedFieldTranslations(this.currentSlides,o,s+1,t),(null==t?void 0:t.length)&&this.saveNewTranslations.emit(t)}this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender()}}onFormFieldMarkAsMandatory(t){if(t&&t.detail){const{slideIndex:i,itemIndex:e}=O(this.currentSlides,t.detail.name);let o=this.currentSlides[i].items[e];o=Object.assign(Object.assign({},o),{required:!0}),this.currentSlides[i].items[e]=o,this.emitNewSlidesAndRerender()}}onMoveUpClicked(t){this.onFormFieldMove(t,!0)}onMoveDownClicked(t){this.onFormFieldMove(t,!1)}onLinkToFieldClicked(t){t.detail&&(void 0!==t.detail.itemIndex&&(this.currentSlides[t.detail.slideIndex].items[t.detail.itemIndex].isExpanded=!0),this.setSelectedPage(t.detail.slideIndex))}onEditPageSettings(t){t.stopPropagation(),t.detail&&this.editPageSettings.emit(t.detail)}onDeleteCondition(t){f(b("CONFIRM"),[b("YOOBICNO"),b("YOOBICOK")],b("DELETECONFIRMCONDITION")).then((i=>{i&&(tt(this.currentSlides,t.detail.conditionId),this.unattachedParentConditions=it(this.unattachedParentConditions,t.detail.conditionId),this.emitNewSlidesAndRerender(!0,!0))}))}onEditRestriction(t){t.stopPropagation(),this.editRestrictionCondition.emit(t.detail)}onDuplicateCondition(t){this.createNewCondition("field",void 0,t.detail.itemIndex,t.detail.slideIndex,t.detail.condition)}onAddCondition(t){this.addCondition(t.detail.condition,t.detail.slideIndex,t.detail.itemIndex)}onAddPageCondition(t){this.addPageCondition(t.detail.condition,t.detail.slideIndex)}onConditionClicked(t){const{slideIndex:i,conditionIndex:e}=et(this.currentSlides,t.detail.conditionId);e>=0&&(this.selectedPageIndex!==i&&(this.selectedPageIndex=i,this.pageHeaderClicked.emit(i),this.hasPageChanged=i,this.resetExpandableBlockReferences()),this.showConditions=!0,this.selectedLeftMenuOption=r.logic)}onScoringSelected(t){(null==t?void 0:t.detail)&&([this.scoring,this.selectedScoring,this.selectedScoringIndex]=F(this.scoring,t.detail))}onDeleteScoringClicked(t){(null==t?void 0:t.detail)>-1&&(this.scoring.splice(t.detail,1),this.selectedScoring=0===this.scoring.length?null:this.scoring[0],this.scoring=[...this.scoring],this.scoringChanged.emit(this.scoring))}onNewConditionalFieldClicked(t){var i;this.selectedLeftMenuOption=r.blocks,this.newFieldCondition=t.detail,this.overlayElement.initialNewFieldCondition=this.newFieldCondition,null===(i=this.newFieldCategoryBlocks)||void 0===i||i.forEach((t=>t.forEach((t=>null==t?void 0:t.classList.add("overlay-active")))))}onHeaderClicked(t){var i,e,o;if("field"===(null===(i=this.newUndefinedCondition)||void 0===i?void 0:i.type))this.createNewCondition(this.newUndefinedCondition.type,t.detail.name);else if(null===(e=this.newUndefinedCondition)||void 0===e?void 0:e.type)this.createNewRestrictionClicked.emit({name:t.detail.name,type:this.newUndefinedCondition.type}),this.newUndefinedCondition=null;else if(null===(o=this.newUndefinedCondition)||void 0===o?void 0:o.condition){const{slideIndex:i,itemIndex:e}=O(this.currentSlides,t.detail.name);this.addCondition(this.newUndefinedCondition.condition,i,e)}}onCreateNewCondition(t){this.collapseAllBlocks(),this.showConditions=!0,this.createNewCondition("field",t.detail.name)}onConditionChanged(t){if("field"===t.detail.condition.type){const{slideIndex:i,itemIndex:e}=O(this.currentSlides,t.detail.fieldName);let o=!1;this.unattachedParentConditions&&this.unattachedParentConditions.length>0&&(this.unattachedParentConditions=this.unattachedParentConditions.map((i=>(i.condition._id===t.detail.condition._id&&(o=!0,i.condition=t.detail.condition),i)))),!o&&this.currentSlides[i].items[e].condition&&this.currentSlides[i].items[e].condition.length>0&&this.currentSlides[i].items[e].condition.forEach(((o,s)=>{o._id===t.detail.condition._id&&(this.currentSlides[i].items[e].condition[s].condition=t.detail.condition)})),o||ot(t.detail.condition,this.currentSlides),this.emitNewSlidesAndRerender()}}onPageConditionChanged(t){t.detail&&this.currentSlides[t.detail.pageIndex].condition&&(this.currentSlides[t.detail.pageIndex].condition=g(this.currentSlides[t.detail.pageIndex].condition)?this.currentSlides[t.detail.pageIndex].condition.map((i=>i._id===t.detail.condition._id?t.detail.condition:i)):t.detail.condition,this.emitNewSlidesAndRerender())}onItemSelected(t){if(this.selectionMode){const{slideIndex:i,itemIndex:e}=O(this.currentSlides,t.detail.name);this.currentSlides[i].items[e].selected?(this.currentSlides[i].items[e].selected=!1,this.selectedFields=this.selectedFields.filter((t=>!(t.slideIndex===i&&t.itemIndex===e)))):(this.currentSlides[i].items[e].selected=!0,this.selectedFields.push({slideIndex:i,itemIndex:e,name:t.detail.name})),this.selectedFields=[...this.selectedFields],this.selectedFields=Tt(this.selectedFields,["slideIndex","itemIndex"],["asc","asc"]),this.selectedMoveActions=st(this.itemList,null,((t,i,e)=>this.moveSelectedFields(e,t)),{selectedFields:this.selectedFields,extraStartingItems:[{title:"MOVEFIELDSAFTER",useHandler:!1,cssClass:"no-hover",hideIfNoItems:!0},{title:"MOVEFIELDSATBEGINNING",useHandler:!0,cssClass:"bottom-border"}]})}}onTranslateFieldClicked(t,i=null){var e;(null===(e=this.translations)||void 0===e?void 0:e.length)>0?(this.loadNewTranslations.emit(),i=O(this.currentSlides,t.detail.name),this.reloadTranslationModalOnUpdate=i):this.showTranslationDialog(t)}onCreateNewRestriction(t){this.selectedLeftMenuOption=r.logic,this.newRestrictionCondition=t.detail,this.restrictionSelector&&(this.restrictionSelector.disableSecondaryActions=!0),this.overlayElement.initialNewRestrictionCondition=this.newRestrictionCondition}onRestricitonHeaderClicked(t){if(this.newRestrictionCondition&&t.detail.type)this.createNewRestrictionClicked.emit({name:this.newRestrictionCondition.name,type:t.detail.type}),this.removeOverlays();else if(this.newRestrictionCondition&&t.detail.condition){const{slideIndex:i,itemIndex:e}=O(this.currentSlides,this.newRestrictionCondition.name);this.addCondition(t.detail.condition,i,e)}}onRestrictionConditionClicked(){this.restrictionConditionSelectedTab=1,this.selectedLeftMenuOption===r.logic?this.restrictionSelector.updateSelectedTab(this.restrictionConditionSelectedTab):this.selectedLeftMenuOption=r.logic}onFieldMove(t){this.moveSelectedFields(t.detail.targetFieldName,t.detail.targetFieldSlideIndex,t.detail.selectedField)}onfieldChanged(t){var i,e,o,s,a,n;if((null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.opValues)&&(null===(e=this.scoring)||void 0===e?void 0:e.length)){const i=null===(n=null===(a=null===(s=null===(o=this.missionDescription)||void 0===o?void 0:o.slides[this.selectedPageIndex])||void 0===s?void 0:s.items)||void 0===a?void 0:a.find((i=>i.name===t.detail.name)))||void 0===n?void 0:n.values,e=t.detail.opValues[0];i&&e&&(null==e||e.forEach(((e,o)=>{this.scoring.map(((s,a)=>{const n=i=>`${t.detail.name}${i}`,r=t=>s[n(t)];void 0!==r(i[o])&&void 0===r(e)&&(this.scoring[a]=Object.assign(Object.assign({},s),{[n(e)]:r(i[o])}),delete this.scoring[a][n(i[o])],this.missionDescription.slides[this.selectedPageIndex].items.find((i=>i.name===t.detail.name)).values[o]=e)}))})))}}onSaveAsTemplateClicked(t){const i=O(this.slides,t.detail.name),e=[this.slides[i.slideIndex].items[i.itemIndex]],{cleanedFields:o,removedConditionIds:s}=at(e,this.translations);this.createCustomFormFields.emit({cleanedFields:o,removedConditionIds:s})}async updateHeaderWarning(t){this.formCreatorHeader.showWarning=t}async translateAllFields(){nt(!1,this.missionDescription,this.translations,this.currentSlides,this.scoring,this.baseLanguage,{missionDescriptionChanged:this.missionDescriptionChanged,slidesChanged:this.slidesChanged,scoringChanged:this.scoringChanged,translationsUpdated:this.translationsUpdated},null,!0)}async translationUpdateShowTranslateDialog(){this.reloadTranslationModalOnUpdate&&this.haveTranslationsUpdated&&this.translations&&this.translations.length>0&&(this.showTranslationDialog(null,this.reloadTranslationModalOnUpdate),this.reloadTranslationModalOnUpdate=null,this.haveTranslationsUpdated=!1)}async addPageCondition(t,i){if(this.currentSlides[i].condition){const e=[...this.currentSlides[i].condition,t];this.currentSlides[i].condition=e}else this.currentSlides[i].condition=[t];this.unattachedParentConditions=rt(this.unattachedParentConditions,t),this.emitNewSlidesAndRerender()}async addCondition(t,i,e){var o;if((null===(o=null==t?void 0:t.field)||void 0===o?void 0:o.values)&&(t.field.values=Et(t.field.values)),this.currentSlides[i].items[e].condition){const o=[...this.currentSlides[i].items[e].condition,t];this.currentSlides[i].items[e].condition=o}else this.currentSlides[i].items[e].condition=[t];this.unattachedParentConditions=rt(this.unattachedParentConditions,t),this.emitNewSlidesAndRerender()}async updateTranslationValueInDialog(t){this.formCreatorTranslateDialog&&this.formCreatorTranslateDialog.updateTranslationValue(t)}async scrollToField(t,i){setTimeout((()=>{var e,o;let s=t;this.expandableBlocks[s]||i||(s=$(this.slides,this.selectedPageIndex,t));const a=48*(t-s),n=i||this.expandableBlocks[s];if(n){const t=n.getBoundingClientRect(),i=null===(e=this.mainContentScrollElement)||void 0===e?void 0:e.getBoundingClientRect();i&&t&&(t.y<i.y||t.bottom>i.bottom-160)&&this.mainContentScrollElement.scrollByPoint(0,t.y-i.y-8+a,200)}this.newFieldAdded=null,null===(o=this.newFieldContainerBlocks)||void 0===o||o.forEach((t=>{var i;return null===(i=null==t?void 0:t.classList)||void 0===i?void 0:i.remove("disabled")}))}),500)}async setAreSlidesDirtyAndDisableSaveButton(t,i=!1){this.areSlidesDirty=t,this.formCreatorHeader&&this.formCreatorHeader.setSaveButtonDisabled(!this.areSlidesDirty||i)}async toggleSelectionMode(t){this.selectionMode=!t&&!this.selectionMode,this.selectionMode?this.currentExpandedBlockLocation&&this.expandableBlocks[this.currentExpandedBlockLocation.itemIndex]&&this.expandableBlocks[this.currentExpandedBlockLocation.itemIndex].expandBlock(!1):(this.removeOverlays(),lt(this.currentSlides),this.selectedFields=[])}async setSelectedPage(t){t=Math.max(0,t),this.hasPageChanged=t,this.selectedPageIndex=t}async addNewPage(t,i){this.currentSlides.splice(i,0,t),this.selectedPageIndex=i,this.hasPageChanged=i,this.newPageAdded.emit(i),this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender()}async pageOrderChange(t,i){const e=e=>{const o=e[t];e.splice(t,1),e.splice(i,0,o)};e(this.currentSlides),e(this.itemList),this.emitNewSlidesAndRerender()}async expandFormFieldBlock(t,i){t===this.selectedPageIndex&&(this.scrollToField(i),this.expandableBlocks[i]?this.expandableBlocks[i].expandBlock(!0):await this.expandChildBlocks(i))}async setScoring(t,i=!1){t&&t.length>0&&([t,this.selectedScoring,this.selectedScoringIndex]=ht(t),i&&(this.fieldsWithScoring=dt(t),ct(this.currentSlides,this.fieldsWithScoring),this.computeScoringTotal()))}async forceUpdateBlockValues({slideIndex:t,itemIndex:i},o){if(this.selectedPageIndex===t){let s=!1;const a=i;for(;!s&&i>=0;)this.expandableBlocks[i]?(this.expandableBlocks[i].formField.title=a===i&&o?o.title:this.currentSlides[t].items[i].title,this.expandableBlocks[i].formField.values=this.currentSlides[t].items[i].values,this.expandableBlocks[i].formField.required=a===i&&o?o.required:this.currentSlides[t].items[i].required,e(this.expandableBlocks[i]),s=!0):i-=1}}componentWillLoad(){this.currentSlides=this.slides,this.isTallScreen()&&(this.numberOfBlocksToRender=30),this.isTranslatorForm?this.selectedLeftMenuOption=r.translate:(pt(this.currentSlides),this.setItemList(),this.newFieldCategoryBlocks=Array.from(Array(this.categories.length),(()=>[])),this.setSimpleFormBlockArrays(),this.totalFields=mt(this.slides),this.currentSlides=bt(this.currentSlides),this.scoring=u(this.scoring),this.setScoring(this.scoring,!0)),this.isLivePreviewHidden=this.selectedLeftMenuOption===r.workflow}componentDidLoad(){this.plan||(this.initExpandedFieldsSortable(),this.initNewFieldsSortable(),this.currentSlides=bt(this.currentSlides),this.updateGlobalActions(),this.hasLoaded.emit(),this.containerElWatch=setInterval((()=>{var t;(null===(t=this.containerEl)||void 0===t?void 0:t.scrollTop)>0&&(this.containerEl.scrollTop=0)}),1e3)),this.hasLoaded.emit()}componentWillUpdate(){this.currentSlides=bt(this.currentSlides),this.currentSlides=ft(this.unattachedParentConditions,this.currentSlides),pt(this.currentSlides),this.totalFields=mt(this.slides),this.newFieldAdded||(this.newFieldContainerBlocks=[]),this.setItemList()}componentDidUpdate(){var t;this.currentSlides=bt(this.currentSlides),this.restrictionConditionSelectedTab=0,this.updateGlobalActions(),(this.hasPageChanged>-1||this.forceSortableRefresh)&&this.isSelectedLeftMenu(r.blocks)&&(this.currentExpandableFieldSortable&&this.hasPageChanged>-1&&this.currentExpandableFieldSortable.destroy(),setTimeout((()=>{this.initExpandedFieldsSortable(),this.initNewFieldsSortable()}),this.forceSortableRefresh?1e3:0),this.forceSortableRefresh=!1,this.hasPageChanged=-1),this.hasLeftMenuOptionChanged&&this.isSelectedLeftMenu(r.blocks)&&(this.initExpandedFieldsSortable(),this.initNewFieldsSortable(),this.hasLeftMenuOptionChanged=!1),this.checkExpandedFieldsHaveForms(),(null===(t=this.newFieldAdded)||void 0===t?void 0:t.conditional)&&(this.showConditions=!0,this.forceFieldRerender&&(this.forceFieldRerender=null)),this.shouldRenderLeftSelectionContent=!0}updateGlobalActions(){this.selectedMoveActions=st(this.itemList,null,((t,i,e)=>this.moveSelectedFields(e,t)),{extraStartingItems:[{title:"MOVEFIELDSAFTER",useHandler:!1,cssClass:"no-hover",hideIfNoItems:!0},{title:"MOVEFIELDSATBEGINNING",useHandler:!0,cssClass:"bottom-border"}]}),this.selectedDuplicateActions=st(this.itemList,null,((t,i)=>this.duplicateSelectedFields(t,i)),{emptySubmenuHandlerTitle:"ADDTOSTART"})}disconnectedCallback(){this.containerElWatch&&clearInterval(this.containerElWatch)}async expandChildBlocks(t){var i;const[e,o]=this.getIndexAndChildCount(t),s=await(null===(i=this.expandableBlocks[o])||void 0===i?void 0:i.getExpandableChildBlocks());s&&s.length>0&&s[e-1]&&s[e-1].expandBlock(!0)}computeScoringTotal(){this.scoring=this.scoring.map((t=>A(t)))}isTallScreen(){return window.innerHeight>1300}updateScoring(t){this.scoring[this.selectedScoringIndex]=Object.assign(Object.assign({},this.scoring[this.selectedScoringIndex]),t),this.scoring[this.selectedScoringIndex].selectedFields=this.scoring[this.selectedScoringIndex].selectedFields.filter(((t,i,e)=>e.findIndex((i=>i.name===t.name))===i)),this.selectedScoring=Object.assign({},this.scoring[this.selectedScoringIndex]),this.scoring=[...this.scoring],this.computeScoringTotal(),this.scoringChanged.emit(this.scoring)}isInOtherScoring(t){let i=!1;return this.scoring.forEach((e=>{e.selectedFields.find((i=>i.name===t))&&(i=!0)})),i}onScoringQuickSetup(){this.scoringQuickSetup.emit({title:this.selectedScoring.title,pages:this.slides,scoringIndex:this.selectedScoringIndex})}getIndexAndChildCount(t){let i=0;for(;!this.expandableBlocks[t]&&t>0;)t-=1,i+=1;return[i,t]}toggleInvisibleDiv(){vt(this.currentSlides,this.selectedPageIndex)&&this.currentSlides[this.selectedPageIndex].items.forEach(((t,i)=>{var e;if(t&&t.isExpanded)if(this.expandableBlocks[i])this.expandableBlocks[i].toggleInvisibleDiv();else{const[t,o]=this.getIndexAndChildCount(i);null===(e=this.expandableBlocks[o])||void 0===e||e.getExpandableChildBlocks().then((i=>{i.length>0&&i[t-1]&&i[t-1].toggleInvisibleDiv()}))}}))}showTranslationDialog(t,i=null){var e;let o=!1;t?i=null===i?O(this.currentSlides,t.detail.name):i:i||(i={slideIndex:0,itemIndex:0}),this.formCreatorTranslateDialog=document.createElement("yoo-form-creator-translate-dialog"),this.formCreatorTranslateDialog.baseLanguage=this.baseLanguage,this.formCreatorTranslateDialog.translatedLanguages=null===(e=this.missionDescription)||void 0===e?void 0:e.languages,this.formCreatorTranslateDialog.allLanguages=this.allLanguages,this.translations&&this.translations.length>0?(o=!0,this.formCreatorTranslateDialog.isTranslator=this.isTranslator,this.formCreatorTranslateDialog.disableNewLanguageButton=this.isLesson&&!this.plan?"ADDNEWLANGAUGEINCOURSE":null,this.formCreatorTranslateDialog.translations=this.translations,this.formCreatorTranslateDialog.slides=N(this.currentSlides,!0),this.formCreatorTranslateDialog.initialSelectedFieldLocation=i,this.formCreatorTranslateDialog.addEventListener("translationUpdated",(t=>{t.stopPropagation(),this.translationUpdated.emit(t.detail)})),this.formCreatorTranslateDialog.addEventListener("languageChanged",(t=>{t.stopPropagation(),this.translateDialogLanguageChanged.emit(t.detail)})),this.formCreatorTranslateDialog.addEventListener("translateValue",(t=>{this.translateValue.emit(t.detail)}))):(this.formCreatorTranslateDialog.mode="createInitial",this.formCreatorTranslateDialog.addEventListener("selectedLanguagesChanged",(t=>{this.selectedLanguagesChanged.emit(t.detail)})),this.formCreatorTranslateDialog.addEventListener("baseLanguageChanged",(t=>{this.baseLanguageChanged.emit(t.detail)}))),y(this.formCreatorTranslateDialog,{},"visible-overflow responsive","fadeEnterAnimation","fadeLeaveAnimation",!0).then((e=>{var s,a,n,r;this.translateDialogClosed.emit({refreshForms:o}),(null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.createNewTranslations)?this.translateNewLanguages([],!1,i):(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.addNewLanguage)?this.showChangeLanguageTranslationDialog(t,i):(this.reloadLivePreview.emit(),this.livePreviewElement&&(this.livePreviewElement.missionDescriptionTitle=v(null===(n=this.missionDescription)||void 0===n?void 0:n.title)),this.formCreatorHeader&&(this.formCreatorHeader.formTitle=v(null===(r=this.missionDescription)||void 0===r?void 0:r.title)))}))}showChangeLanguageTranslationDialog(t,i){var e;const o=document.createElement("yoo-form-creator-translate-dialog");o.baseLanguage=this.baseLanguage,o.mode="create",o.translatedLanguages=null===(e=this.missionDescription)||void 0===e?void 0:e.languages,o.allLanguages=this.allLanguages,o.addEventListener("selectedLanguagesChanged",(t=>{this.selectedLanguagesChanged.emit([...t.detail,...this.selectedLanguages])})),y(o,{},"visible-overflow responsive","fadeEnterAnimation","fadeLeaveAnimation",!0).then((e=>{var o,s,a;(null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.createNewTranslations)?this.translateNewLanguages(this.translations,!0,i,null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.newLanguesToTranslate):(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.presentTranslationModal)&&this.showTranslationDialog(t,i)}))}setItemList(){this.itemList=this.currentSlides.map((t=>{let i;t.condition&&u(t.condition).length>0&&(i=u(t.condition).map((t=>t._id)));const e=t.items.map((t=>{let i=[];return t.condition&&g(t.condition)&&(i=t.condition.filter((t=>"string"!=typeof t)).map((t=>t._id))),{itemTitle:t.title,itemId:t.name,conditionIds:i}}));return{pageTitle:t.title,pageConditionIds:i,pageItems:e}}))}toggleHasScoring(t){this.slides=this.slides.map((i=>(i.items.forEach((i=>{i.name===t&&(i.hasScoring=!i.hasScoring)})),i)))}async initNewFieldsSortable(t=!1){var i,e;0===(null===(i=this.newFieldContainerBlocks)||void 0===i?void 0:i.length)&&this.fieldSelectorElement&&(this.newFieldContainerBlocks=await this.fieldSelectorElement.getNewFieldContainerBlocks()),null===(e=this.newFieldContainerBlocks)||void 0===e||e.forEach(((i,e)=>{var o;if(i){t&&(null===(o=null==i?void 0:i.classList)||void 0===o||o.remove("disabled"));const s=V.create(i,{group:{name:"fields",pull:"clone",put:!1},animation:150,sort:!1,filter:".disabled",onClone:t=>{switch(this.currentExpandedBlockLocation&&this.expandableBlocks[this.currentExpandedBlockLocation.itemIndex]&&this.expandableBlocks[this.currentExpandedBlockLocation.itemIndex].expandBlock(!1),this.toggleInvisibleDiv(),this.selectedLeftMenuOption){case r.blocks:this.handleNewFieldOnClone(t);break;case r.logic:this.handleNewLogicFieldOnClone(t)}},onEnd:t=>{switch(this.toggleInvisibleDiv(),this.selectedLeftMenuOption){case r.blocks:this.handleNewFieldOnEnd(t,e)}}});this.leftMenuSortables.push(s)}}))}handleNewFieldOnEnd(t,i){var e,o;if(i>(null===(e=this.categories)||void 0===e?void 0:e.length)-1&&(null===(o=this.customFormFields)||void 0===o?void 0:o.length)>0&&(null==t?void 0:t.item)){const i=t.item.classList;t.item.remove();let e=i[1];if(e){e=e.replace("custom-field-","");const i=parseInt(e);this.customFormFields[i]&&this.onCustomFieldAdded(null,this.customFormFields[i],t.newIndex)}}else{const e=this.newFieldCategoryBlocks[i][t.oldIndex],o=t.to,s=null==e?void 0:e.formField;if(e&&o&&!o.classList.contains("category-block-selection")&&!o.classList.contains("condition-block-selection")){t.item.remove();const i={title:s.title,type:s.type,icon:s.icon,category:s.category,config:s.config};this.shouldRenderLeftSelectionContent=!1,this.onFormFieldAdd(i,t.newIndex)}this.fieldEmptyStateContainer&&this.fieldEmptyStateContainer.classList.contains("empty-state")&&(this.fieldEmptyStateContainer.style.opacity="1")}}handleNewLogicFieldOnClone(t){const i=t.clone.firstChild;i.type&&(i.mode="new")}handleNewFieldOnClone(t){const i=t.clone.firstChild,e=t.item.firstChild.formField;i.mode="new",i.formField=e,this.fieldEmptyStateContainer&&this.fieldEmptyStateContainer.classList.contains("empty-state")&&(this.fieldEmptyStateContainer.style.opacity="0")}initExpandedFieldsSortable(){this.expandableBlockContainers&&this.expandableBlockContainers.length&&this.expandableBlockContainers[this.selectedPageIndex]&&(this.currentExpandableFieldSortable=V.create(this.expandableBlockContainers[this.selectedPageIndex],{animation:150,group:{name:"fields"},chosenClass:"sortable-chosen-no-border",direction:"vertical",draggable:".sortable-container",filter:".selection",scroll:!0,swapThreshold:.2,onStart:()=>{this.toggleInvisibleDiv(),this.currentExpandedBlockLocation&&this.expandableBlocks[this.currentExpandedBlockLocation.itemIndex]&&this.expandableBlocks[this.currentExpandedBlockLocation.itemIndex].expandBlock(!1)},onEnd:t=>{const i=this.parentBlockIndices[t.oldIndex],e=this.parentBlockIndices[t.newIndex],o=gt(this.currentSlides[this.selectedPageIndex].items[i])+1,s=this.currentSlides[this.selectedPageIndex].items.slice(i,i+o);this.currentSlides[this.selectedPageIndex].items.splice(i,o),this.currentSlides[this.selectedPageIndex].items.splice(e,0,...s),this.toggleInvisibleDiv(),pt(this.currentSlides),this.slidesChanged.emit({slides:this.currentSlides,pageIndex:this.selectedPageIndex})}}))}removeOverlays(){var t,i,e,o,s;this.newUndefinedCondition=null,this.newRestrictionCondition=null,this.hasAdditionBeenClicked||(this.newFieldCondition=null),this.currentSlides[this.selectedPageIndex].items.forEach(((t,i)=>{var e;const[o]=this.getIndexAndChildCount(i);null===(e=this.expandableBlocks[o])||void 0===e||e.getExpandableChildBlocks().then((t=>null==t?void 0:t.forEach((t=>null==t?void 0:t.classList.remove("overlay-active")))))})),null===(t=this.pageCardList)||void 0===t||t.classList.remove("overlay-active"),null===(i=this.pageCardList)||void 0===i||i.addCardClassList(),null===(e=this.expandableBlocks)||void 0===e||e.forEach((t=>{var i;return null===(i=null==t?void 0:t.classList)||void 0===i?void 0:i.remove("overlay-active")})),null===(o=this.newFieldCategoryBlocks)||void 0===o||o.forEach((t=>null==t?void 0:t.forEach((t=>null==t?void 0:t.classList.remove("overlay-active"))))),null===(s=this.expandableBlocks)||void 0===s||s.forEach((t=>{(null==t?void 0:t.mode)&&(t.mode="added")})),this.newCustomFormFieldSelectionMode&&(this.newCustomFormFieldSelectionMode=!1,this.overlayElement.newCustomFormField=!1,this.selectionMode=!1),this.overlayElement.initialNewUndefinedCondition=this.newUndefinedCondition,this.overlayElement.initialNewFieldCondition=this.newFieldCondition,this.overlayElement.initialNewRestrictionCondition=this.newRestrictionCondition,this.restrictionSelector&&(this.restrictionSelector.disableSecondaryActions=!1)}createNewCondition(t,i,e,o,s){if(!s){const a=O(this.currentSlides,i);s=ut(t,this.currentSlides[o=a.slideIndex].items[e=a.itemIndex])}if("field"===t)if(G.includes(this.currentSlides[o].items[e].category))x({message:b("CANNOTAPPLYCONDITIONSTOINFORMATION"),duration:2e3,showCloseButton:!0,closable:!0,cssClass:"form-creator",position:"top"});else{const{slides:t,unattachedParentConditions:i}=yt(this.currentSlides,this.unattachedParentConditions,o,e,s);this.currentSlides=t,this.unattachedParentConditions=i}else this.addCondition(s,o,e);this.emitNewSlidesAndRerender(!1)}checkExpandedFieldsHaveForms(){vt(this.currentSlides,this.selectedPageIndex)&&this.currentSlides[this.selectedPageIndex].items.forEach(((t,i)=>{(null==t?void 0:t.isExpanded)&&!t.hasExpanded&&this.formCreatorBlockExpanded.emit({pageIndex:this.selectedPageIndex,itemIndex:i})}))}duplicateSelectedFields(t,i){var e,o;if(null===(e=this.selectedFields)||void 0===e?void 0:e.length){let e;e=0===i&&0===(null===(o=this.currentSlides[t].items)||void 0===o?void 0:o.length)?this.selectedFields:this.selectedFields.reverse();const s=[];e.forEach((e=>{var o,a;const{slideIndex:n,itemIndex:r}=O(this.currentSlides,e.name);this.currentSlides=X(this.currentSlides,{slideIndex:n,itemIndex:r},!1,{slideIndex:t,itemIndex:i},"dataset"===(null===(o=this.missionDescription)||void 0===o?void 0:o.type)),(null===(a=this.translations)||void 0===a?void 0:a.length)&&this.updateDuplicatedFieldTranslations(this.currentSlides,t,i+1,s)})),(null==s?void 0:s.length)&&this.saveNewTranslations.emit(s),this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender()}}updateDuplicatedFieldTranslations(t,i,e,o){this.translations.forEach((s=>{var a,n,r,l;const h=k(Et(s),this.baseLanguage);L(!1,`%${s.key}%`,t[i].items[e],`%${null==h?void 0:h.key}%`,{key:s.key,updateKey:null==h?void 0:h.key})&&(o.push(h),(null===(n=null===(a=t[i].items[e])||void 0===a?void 0:a.opValues)||void 0===n?void 0:n.length)>0&&(null===(l=null===(r=t[i].items[e])||void 0===r?void 0:r.opValues[0])||void 0===l?void 0:l.length)>0&&(t[i].items[e].opValues[0]=t[i].items[e].values))}))}deleteSelectedFields(){if(this.selectedFields&&this.selectedFields.length>0){const t=1===this.selectedFields.length?"DELETECONFIRMFIELD":"DELETECONFIRMFIELDS";f(b("CONFIRM"),[b("YOOBICNO"),b("YOOBICOK")],b(t,{number:this.selectedFields.length})).then((t=>{var i,e,o;t&&(this.selectedFields.forEach((t=>{J(this.currentSlides,{name:t.name})})),this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender(),0!==(null===(e=null===(i=this.currentSlides[this.selectedPageIndex])||void 0===i?void 0:i.items)||void 0===e?void 0:e.length)&&(null===(o=this.currentSlides[this.selectedPageIndex])||void 0===o?void 0:o.items)||(this.leftMenuSortables.forEach((t=>t.destroy())),this.leftMenuSortables=[],this.forceSortableRefresh=!0))}))}}editSelectedFields(){var t;(null===(t=this.selectedFields)||void 0===t?void 0:t.length)>0&&this.editMultipleFields.emit(this.selectedFields)}onCreateCustomFormFields(){var t;if((null===(t=this.selectedFields)||void 0===t?void 0:t.length)>0){const t=this.selectedFields.map((t=>this.slides[t.slideIndex].items[t.itemIndex])),{cleanedFields:i,removedConditionIds:e}=at(t,this.translations);this.createCustomFormFields.emit({cleanedFields:i,removedConditionIds:e})}}moveSelectedFields(t,i,e){if((e=e||this.selectedFields)&&e.length>0){let o=0,s=0;const a=[],n=[];if(e.forEach((t=>{a.push(this.currentSlides[t.slideIndex].items[t.itemIndex]),n.push(this.currentSlides[t.slideIndex].items[t.itemIndex].name)})),n.forEach((t=>{const i=O(this.currentSlides,t);this.currentSlides[i.slideIndex].items.splice(i.itemIndex,1)})),t){const e=O(this.currentSlides,t);i=e.slideIndex,o=e.itemIndex,s=1}this.currentSlides[i].items.splice(o+s,0,...a),this.emitNewSlidesAndRerender()}}isSelectedLeftMenu(t){return t===this.selectedLeftMenuOption}emitNewSlidesAndRerender(t=!0,i=!1){this.removeOverlays(),t&&(this.currentSlides=D(this.currentSlides)),lt(this.currentSlides),this.selectionMode&&this.toggleSelectionMode(),this.currentSlides=N(this.currentSlides),this.slidesChanged.emit({slides:this.currentSlides,pageIndex:this.selectedPageIndex,reloadRestrictionConditions:i}),this.currentSlides=[...this.currentSlides]}setSimpleFormBlockArrays(){this.categories.forEach((t=>{this.simpleFormBlocks[t]=[]})),[...this.formFields].forEach((t=>{this.simpleFormBlocks[t.category].push(t),t.mostUsed&&this.simpleFormBlocks.mostused&&this.simpleFormBlocks.mostused.push(t)}))}selectAll(){var t,i;null===(i=null===(t=this.currentSlides[this.selectedPageIndex])||void 0===t?void 0:t.items)||void 0===i||i.forEach(((t,i)=>{t.selected||(t.selected=!0,this.selectedFields.push({slideIndex:this.selectedPageIndex,itemIndex:i,name:t.name}))})),this.selectedFields=[...this.selectedFields]}resetExpandableBlockReferences(){this.expandableBlocks=[]}translateNewLanguages(t,i,e,o){var s;"mission"===(null===(s=this.missionDescription)||void 0===s?void 0:s.type)?f(b(this.missionDescription.active?"CAUTION":"BESTPRACTICES"),[b("CANCEL"),b("TRANSLATECAMPAIGN")],null,"translate-warning",null,null,null,this.missionDescription.active?"TRANSLATEACTIVECAMPAIGNLINK":"TRANSLATECAMPAIGNLINK").then((e=>{e&&nt(i,this.missionDescription,t,this.currentSlides,this.scoring,this.baseLanguage,{missionDescriptionChanged:this.missionDescriptionChanged,slidesChanged:this.slidesChanged,scoringChanged:this.scoringChanged,translationsUpdated:this.translationsUpdated},o)})):nt(i,this.missionDescription,t,this.currentSlides,this.scoring,this.baseLanguage,{missionDescriptionChanged:this.missionDescriptionChanged,slidesChanged:this.slidesChanged,scoringChanged:this.scoringChanged,translationsUpdated:this.translationsUpdated},o),this.reloadTranslationModalOnUpdate=e}onInfiniteScroll(){var t;this.numberOfBlocksToRender<this.slides[this.selectedPageIndex].items.length&&(this.numberOfBlocksToRender+=20,null===(t=this.infiniteScrolls[this.selectedPageIndex])||void 0===t||t.complete())}onMainContentScrolled(t){t&&(this.scrollContent.emit(t.detail),t.detail.deltaY>200&&this.pagesAccordion&&this.isPagesAccordionOpen&&this.pagesAccordion.clickAccordion(0))}onPagesAccordionSelected(t){this.isPagesAccordionOpen=t.detail.selected}onLeftMenuIconSelected(t){var i;if(this.removeOverlays(),this.hasLeftMenuOptionChanged=!0,this.leftMenuSortables.forEach((t=>t.destroy())),this.leftMenuSortables=[],this.showLeftMenuSelection=this.selectedLeftMenuOption!==t||!this.showLeftMenuSelection,t===r.logic&&(this.showConditions=!0),t===r.scoring&&this.scoring[0])if((null===(i=this.scoring)||void 0===i?void 0:i.length)>0&&(this.scoring=j(this.scoring,this.currentSlides),this.computeScoringTotal()),this.scoring.some((t=>!0===t.isSelected))){const t=this.scoring.findIndex((t=>!0===t.isSelected));this.selectedScoring=this.scoring[t]}else this.scoring[0].isSelected=!0,this.selectedScoring=this.scoring[0];this.leftMenuChange.emit(t),this.selectedLeftMenuOption=t,this.isLivePreviewHidden=this.selectedLeftMenuOption===r.workflow,this.onWorkflowStep(null)}onCloseClicked(t){t.stopPropagation(),this.closeClicked.emit()}onSaveClicked(t){t.stopPropagation(),this.saveClicked.emit(!0)}onAddNewPage(t=this.currentSlides.length){this.hasPageChanged=t,this.addNewPageClicked.emit(t)}collapseAllBlocks(t=null,i=!1){vt(this.currentSlides,this.selectedPageIndex)&&(this.currentSlides[this.selectedPageIndex].items.forEach((i=>{i.isExpanded=t&&i.name===t})),i&&(this.currentSlides=N(this.currentSlides),this.currentSlides=[...this.currentSlides]))}onCustomFieldAdded(t,i,e){var o,s,a,n;if(!this.currentSlides[this.selectedPageIndex])return;i||(i=null===(o=this.customFormFields)||void 0===o?void 0:o.find((i=>i._id===t)));const r=xt(i.fields);null==r||r.forEach((t=>{var i;t.slideIndex=this.selectedPageIndex,t.slideTitle=null===(i=this.currentSlides[this.selectedPageIndex])||void 0===i?void 0:i.title})),(null===(a=null===(s=this.currentSlides[this.selectedPageIndex])||void 0===s?void 0:s.items)||void 0===a?void 0:a.length)>0?w(e)?this.currentSlides[this.selectedPageIndex].items=[...null===(n=this.currentSlides[this.selectedPageIndex])||void 0===n?void 0:n.items,...r]:this.currentSlides[this.selectedPageIndex].items.splice(e,0,...r):this.currentSlides[this.selectedPageIndex].items=r,this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender()}onAddNewCondition(t,i=!1,e){var o,s,a,n;this.currentSlides[this.selectedPageIndex].items.forEach(((t,i)=>{var e;const[o]=this.getIndexAndChildCount(i);null===(e=this.expandableBlocks[o])||void 0===e||e.getExpandableChildBlocks().then((t=>null==t?void 0:t.forEach((t=>null==t?void 0:t.classList.add("overlay-active")))))})),null===(o=this.pageCardList)||void 0===o||o.classList.add("overlay-active"),null===(s=this.pageCardList)||void 0===s||s.addCardClassList(),null===(a=this.expandableBlocks)||void 0===a||a.forEach((t=>{var i;return null===(i=null==t?void 0:t.classList)||void 0===i?void 0:i.add("overlay-active")})),null===(n=this.expandableBlocks)||void 0===n||n.forEach((t=>{(null==t?void 0:t.mode)&&(t.mode="no-expand")})),this.newUndefinedCondition={type:t,pageCondition:i,condition:e},this.overlayElement.initialNewUndefinedCondition=this.newUndefinedCondition}onFormFieldAdd(t,i,e){var o,s,a,n,r,l,h;if(!this.currentSlides[this.selectedPageIndex])return;null===(o=this.newFieldContainerBlocks)||void 0===o||o.forEach((t=>null==t?void 0:t.classList.add("disabled"))),this.collapseAllBlocks();let d,c=this.currentSlides[this.selectedPageIndex].items.length;if(t){if(d=wt(t,null===(s=this.missionDescription)||void 0===s?void 0:s.type),d=Object.assign({isExpanded:!(null===(a=this.newFieldCondition)||void 0===a?void 0:a.condition)},d),this.newFieldCondition){const t=this.newFieldCondition.condition;(null===(n=null==t?void 0:t.field)||void 0===n?void 0:n.values)&&(t.field.values=Et(t.field.values)),d=Object.assign(Object.assign({},d),{condition:[t]}),c=this.newFieldCondition.index,this.unattachedParentConditions=rt(this.unattachedParentConditions,this.newFieldCondition.condition),this.showConditions=!1,this.forceFieldRerender=this.newFieldCondition.condition.field.name}"dataset"===(null===(r=this.missionDescription)||void 0===r?void 0:r.type)&&(d.name=d.title.split(" ").join("_").toLowerCase(),d.customName=C(),z(d,this.currentSlides)||(d.name=M(d.title,this.selectedPageIndex,c)))}else e&&(d=e);void 0!==i&&i<this.parentBlockIndices.length&&!e?c=this.parentBlockIndices[i]:e&&i>-1&&((null===(l=this.currentExpandedBlockLocation)||void 0===l?void 0:l.itemIndex)!==i||e||(this.forceFieldRerender=e.name),c=i),d=Object.assign(Object.assign({},d),{formCreatorIndex:c||0,slideIndex:this.selectedPageIndex}),(null===(h=this.newFieldCondition)||void 0===h?void 0:h.condition)||(this.currentExpandedBlockLocation={slideIndex:this.selectedPageIndex,itemIndex:c}),c<this.currentSlides[this.selectedPageIndex].items.length?this.currentSlides[this.selectedPageIndex].items.splice(c,0,d):this.currentSlides[this.selectedPageIndex].items.push(d),this.newFieldAdded={slideIndex:this.selectedPageIndex,itemIndex:c,conditional:!w(this.newFieldCondition)},this.resetExpandableBlockReferences(),this.emitNewSlidesAndRerender(),1===this.currentSlides[this.selectedPageIndex].items.length&&(this.leftMenuSortables.forEach((t=>t.destroy())),this.leftMenuSortables=[],this.forceSortableRefresh=!0)}onFormFieldMove(t,i){if(t&&t.detail){const{slideIndex:e,itemIndex:o}=O(this.currentSlides,t.detail.name);this.currentExpandedBlockLocation&&this.currentExpandedBlockLocation.slideIndex===e&&this.currentExpandedBlockLocation.itemIndex===o&&this.expandableBlocks[o]&&this.expandableBlocks[o].expandBlock(!1);const s=this.currentSlides[e].items[o],a=i?o-1:o+1;this.currentSlides[e].items.splice(o,1),this.currentSlides[e].items.splice(a,0,s),this.emitNewSlidesAndRerender()}}renderHeader(){var t,i;return o("yoo-form-creator-header",{ref:t=>this.formCreatorHeader=t,logo:this.logo,formTitle:(null===(t=this.missionDescription)||void 0===t?void 0:t.title)||(null===(i=this.plan)||void 0===i?void 0:i.title),prefixTitle:this.prefixTitle,isLesson:this.isLesson,selectedLeftMenuOption:this.selectedLeftMenuOption,initialSaveButtonDisabled:!this.areSlidesDirty,hideSave:this.isTranslator,onCloseClicked:t=>this.onCloseClicked(t),onSaveClicked:t=>this.onSaveClicked(t),onShowQrCode:t=>{t.stopImmediatePropagation(),this.showQrCode.emit()},onWarningClicked:t=>{t.stopImmediatePropagation(),this.headerWarningClicked.emit()}})}renderContent(){var t;const i=this.selectedLeftMenuOption!==r.translate&&this.selectedLeftMenuOption!==r.design&&this.selectedLeftMenuOption!==r.workflow,e=this.selectedLeftMenuOption!==r.design&&this.selectedLeftMenuOption!==r.workflow,s=this.selectedLeftMenuOption===r.workflow;let a=(this.selectedLeftMenuOption!==r.translate||this.isLesson)&&this.selectedLeftMenuOption!==r.design&&!this.plan;return s&&!(null===(t=this.missionDescription)||void 0===t?void 0:t.hasWorkflow)&&(a=!1),o("div",{class:"content"},this.renderLeftMenu(),i&&this.renderLeftSelection(),e&&(this.selectedLeftMenuOption!==r.translate?this.renderFormContent():this.renderTranslateContent()),s&&this.renderWorkflow(),a&&!K(this.selectedLeftMenuOption)&&this.renderLivePreview())}renderLeftMenu(){return o("div",{class:"left-menu"},o("div",{class:"left-menu-top"},!this.isTranslatorForm&&this.renderIcon(r.blocks),this.showLogics&&this.renderIcon(r.logic),this.showScorings&&this.renderIcon(r.scoring),this.showTranslations&&this.renderIcon(r.translate),this.showDesign&&this.renderIcon(r.design),this.showWorkflow&&this.renderIcon(r.workflow)),o("div",{class:"left-menu-bottom"},this.renderHelp()))}renderHelp(){var t;const i=null===(t=this.helpCenterOptions)||void 0===t?void 0:t.filter((t=>!t.isVisible||t.isVisible()));return!!(null==i?void 0:i.length)&&o("yoo-context-menu",{contentButtons:i,placement:"above"},o("yoo-tooltip",{content:b("YOOBICHELP"),hoverable:!0,placement:"right"},o("yoo-icon",{color:"stable",name:"help",size:"medium"})))}renderIcon(t){const i=t===r.blocks?"categories":t,e="translation"===i?"translate":"workflow"===i?"hr":"design"===i?"color-picker":i;return o("yoo-tooltip",{content:b(t.toUpperCase()),hoverable:!0,placement:"right"},o("yoo-icon",{onClick:()=>this.onLeftMenuIconSelected(t),name:e,color:this.isSelectedLeftMenu(t)?"app-color":"stable",size:"medium"}))}renderLeftSelection(){return o("div",{class:{"left-selection":!0,hide:!this.showLeftMenuSelection,scoring:K(this.selectedLeftMenuOption)}},this.shouldRenderLeftSelectionContent&&this.renderLeftSelectionContent())}renderLeftSelectionContent(){switch(this.selectedLeftMenuOption){case"fields":return this.renderBlockCategorySelection();case"logic":return this.renderLogicSelection();case"scoring":return this.renderScoringSelection();case"translation":return this.renderTranslateSelection()}}renderBlockCategorySelection(){return o("yoo-form-creator-field-selector",{ref:t=>this.fieldSelectorElement=t,masterTitle:this.selectedLeftMenuOption.toUpperCase(),categories:this.categories,initialSimpleFormBlocks:this.simpleFormBlocks,initialCustomFormFields:this.customFormFields,onElementReferencesLoaded:t=>{this.newFieldContainerBlocks=t.detail.newFieldContainerBlocks,this.newFieldCategoryBlocks=t.detail.newFieldCategoryBlocks,this.initNewFieldsSortable(!0)},onNewCustomFormFieldClicked:()=>{this.selectionMode=!0,this.newCustomFormFieldSelectionMode=!0,this.overlayElement.newCustomFormField=!0}})}renderLogicSelection(){const t=[{title:"ADDCONDITION",selected:!0,subTitle:"FIELDTOOLTIP",blurContent:!w(this.newRestrictionCondition)},{title:"ADDRESTRICTION",selected:!0,subTitle:"RESTRICTIONTOOLTIP"}];return o("div",{class:"logic-container"},o("yoo-ion-scroll",{forceOverscroll:!1,onClick:t=>t.stopPropagation()},o("yoo-accordion",{maxTitleCharacters:18,entries:t,iconPairLeft:q,allowMultipleSelection:!0},l.map(((i,e)=>o("div",{slot:t[e].title},o("div",{class:"condition-block-selection",ref:t=>this.newFieldContainerBlocks[e]=t},"conditions"===i&&this.renderNewConditionBlocks(i),"restrictions"===i&&this.renderRestrictionConditions(i))))))))}renderNewConditionBlocks(t){return m.map((i=>{if(i.conditionType===t)return o("div",{class:`${t}-sortable-container`},o("yoo-form-creator-condition-block",{mode:i.mode,type:i.type}))}))}renderRestrictionConditions(t){return o("yoo-form-creator-restriction-selector",{ref:t=>this.restrictionSelector=t,conditionType:t,restrictionConditions:this.restrictionConditions,initialSelectedTab:this.restrictionConditionSelectedTab,disableSecondaryActions:!w(this.newRestrictionCondition)})}renderEmptyScoringState(){return o("div",{class:"scoring-empty-state",slot:"CONTENT"},o("yoo-empty-state",{type:"scoring"}),o("div",null,b("LISTEMPTY")))}renderScoringSelection(){const t={text:b("ADDNEWSCORING"),size:"small",color:"app-color",handler:()=>this.newScoringClicked.emit()};return o("yoo-accordion",{class:"sub-accordion",entries:[{title:"SCORING",selected:!0,actionButtons:[t]}],showBottomBorder:!0,allowMultipleSelection:!0,disabled:!0},o("div",{slot:"SCORING"},o("yoo-ion-scroll",{forceOverscroll:!1,onClick:t=>t.stopPropagation()},o("yoo-form-creator-score-card-list",{scoring:this.scoring,totalFields:this.totalFields}))))}renderTranslateSelection(){return o("yoo-accordion",{class:"sub-accordion",entries:[{title:"TRANSLATE",selected:!0}],iconPairLeft:q,showBottomBorder:!0,allowMultipleSelection:!0},o("div",{slot:"TRANSLATE"},o("yoo-form-creator-block-expandable",{mode:"new",formField:{title:"PLACEHOLDER",icon:"info",category:p.information},options:this.options})))}renderTranslateContent(){var t;if(this.showTranslations)return o("yoo-form-creator-translate",{baseLanguage:this.baseLanguage,selectedLanguages:this.selectedLanguages,allLanguages:this.allLanguages,translations:this.translations,slides:this.currentSlides,scoring:this.scoring,missionDescription:this.missionDescription,plan:this.plan,showBilingualView:this.isTranslatorForm&&w(this.plan)&&!w(null===(t=this.currentSlides[0])||void 0===t?void 0:t.items[0]),isTranslator:this.isTranslator,disableNewLanguageButton:this.isLesson&&!this.plan?"ADDNEWLANGAUGEINCOURSE":null,disableTranslateButton:this.isLesson&&!this.plan?"INITIATETRANSLATIONSINCOURSE":null,onBaseLanguageChanged:t=>{t.stopPropagation(),this.baseLanguageChanged.emit(t.detail)},onSelectedLanguagesChanged:t=>{t.stopPropagation(),this.selectedLanguagesChanged.emit(t.detail)},onTranslationsUpdated:t=>{t.stopPropagation(),this.translationsUpdated.emit(Object.assign(Object.assign({},t.detail),{googleTranslate:!0}))},onTranslationEdited:t=>{t.stopPropagation(),this.translationEdited.emit(t.detail)},onTranslationRemoved:t=>{t.stopPropagation(),this.translationRemoved.emit(t.detail)},onTranslationRemoveAll:t=>{t.stopPropagation(),this.translationRemoveAll.emit()},onTranslationImport:t=>{t.stopPropagation(),this.translationImport.emit(t.detail)},onSlidesChanged:t=>{t.stopPropagation();const i=N(t.detail.slides,!0);this.slidesChanged.emit({slides:i})},onScoringChanged:t=>{t.stopPropagation(),this.scoringChanged.emit(t.detail)},onMissionDescriptionChanged:t=>{t.stopPropagation(),this.missionDescriptionChanged.emit(t.detail)},onPlanChanged:t=>{t.stopPropagation(),this.planChanged.emit(t.detail)},onSetLoading:t=>{t.stopPropagation(),this.setLoading.emit(t.detail)},onBilingualViewClicked:()=>this.showTranslationDialog(),onOpenZenDesk:t=>{t.stopPropagation(),this.openZenDesk.emit()}})}onWorkflowStep(t){this.currentWorkflowStep=t,this.workflowCurrentStepChanged.emit(this.currentWorkflowStep)}renderWorkflow(){return o("yoo-workflow",{missionDescription:this.missionDescription,onMissionDescriptionChanged:t=>{t.stopPropagation(),this.missionDescriptionChanged.emit(t.detail)},onWorkflowStepUpdated:t=>{t.stopPropagation(),this.workflowStepUpdated.emit(t.detail)},onWorkflowStepEdited:t=>{t.stopPropagation(),this.workflowStepEdited.emit(t.detail)},onWorkflowStepRemoved:t=>{t.stopPropagation(),this.workflowStepRemoved.emit(t.detail)},onWorkflowBranchAdded:t=>{t.stopPropagation(),this.workflowBranchAdded.emit(t.detail)},onWorkflowStepParallelStepAdded:t=>{t.stopPropagation(),this.workflowStepParallelStepAdded.emit(t.detail)}})}renderFormContent(){var t;const i={iconSlot:"start",icon:"circle-plus",iconSize:"small",text:b("ADDNEWPAGE"),size:"small",color:"light",handler:()=>this.onAddNewPage()},e={text:b("QUICKSETUP"),size:"small",color:"light",handler:()=>this.onScoringQuickSetup()},s=b("SELECTEDITEMS",{n:""}),a=this.selectedFields.length>0,r=[];if(!this.newCustomFormFieldSelectionMode&&this.bulkActions.includes(n.custom)&&r.push({icon:()=>"dashboards",color:()=>"stable",text:()=>b("CREATECUSTOMFIELD"),isVisible:()=>a,handler:()=>{this.onCreateCustomFormFields()}}),!this.newCustomFormFieldSelectionMode&&this.bulkActions.includes(n.settings)&&r.push({icon:()=>"settings",color:()=>"stable",text:()=>b("SETTINGS"),isVisible:()=>a,handler:()=>{this.editSelectedFields()}}),!this.newCustomFormFieldSelectionMode&&this.bulkActions.includes(n.move)&&r.push({icon:()=>"move",color:()=>"stable",text:()=>b("YOOBICMOVE"),isVisible:()=>a,contextMenuActions:{contentButtons:this.selectedMoveActions}}),!this.newCustomFormFieldSelectionMode&&this.bulkActions.includes(n.duplicate)&&r.push({icon:()=>"duplicate",color:()=>"stable",text:()=>b("DUPLICATE"),isVisible:()=>a,contextMenuActions:{contentButtons:this.selectedDuplicateActions,subDialogTitle:"DUPLICATEFIELDSAFTER"}}),this.newCustomFormFieldSelectionMode||!this.bulkActions.includes(n.delete)||Ct(this.slides,"locked",this.selectedFields)||r.push({icon:()=>"delete",color:()=>"stable",text:()=>b("DELETE"),isVisible:()=>a,handler:()=>{this.deleteSelectedFields()}}),this.newCustomFormFieldSelectionMode&&r.push({icon:()=>"check",color:()=>"success",text:()=>b("SAVE"),isVisible:()=>a,handler:()=>{this.onCreateCustomFormFields()}}),this.bulkActions.includes(n.settings)&&r.push({icon:()=>"cross",color:()=>"stable",text:()=>b("CLOSE"),isVisible:()=>a,handler:()=>{this.toggleSelectionMode()}}),K(this.selectedLeftMenuOption)&&0===this.scoring.length)return o("div",{class:"form-content relative"},this.renderEmptyScoringState());const l=K(this.selectedLeftMenuOption)?this.scoring.length>0?[e]:null:[i],h=o("yoo-accordion",{ref:t=>this.pagesAccordion=t,class:"pages-accordion",entries:[{title:"PAGES",subItemCount:this.currentSlides.length,selected:this.isPagesAccordionOpen,actionButtons:l}],iconPairLeft:q,showBottomBorder:!0,forceEntryUpdate:!0,allowMultipleSelection:!0,onAccordionSelected:t=>this.onPagesAccordionSelected(t)},o("div",{slot:"PAGES"},o("yoo-form-creator-page-card-list",{ref:t=>this.pageCardList=t,scoringMode:K(this.selectedLeftMenuOption)?this.selectedScoring:null,missionSlides:this.currentSlides,selectedPageIndex:this.selectedPageIndex,onPageClicked:this.onPageClicked,onDuplicatePageClicked:this.onDuplicatePageClicked,onInsertPageAfterClicked:this.onInsertPageAfterClicked,onDeletePageClicked:this.onDeletePageClicked,onEditPageClicked:this.onEditPageClicked,onAddSiteTagRestrictionClicked:this.onAddSiteTagRestrictionClicked,onAddUserGroupRestrictionClicked:this.onAddUserGroupRestrictionClicked,itemList:this.itemList,isSortable:"fields"===this.selectedLeftMenuOption}))),d=o("yoo-toast",{class:"bg-light-to-dark global-actions form-creator",message:s,extraButtons:r,count:this.selectedFields.length||0,showBackdrop:!1});return o("div",{class:"form-content"},this.showPagesSection&&h,this.renderFormContentBlocksContainer(),(null===(t=this.newUndefinedCondition)||void 0===t?void 0:t.pageCondition)&&o("div",{class:"page-condition-overlay",onClick:()=>this.removeOverlays()}),this.selectionMode&&d)}renderOverlays(){return o("yoo-form-creator-overlay",{ref:t=>this.overlayElement=t,initialNewUndefinedCondition:this.newUndefinedCondition,initialNewFieldCondition:this.newFieldCondition,initialNewRestrictionCondition:this.newRestrictionCondition,initialIsLivePreviewHidden:this.isLivePreviewHidden,newCustomFormField:this.newCustomFormFieldSelectionMode,onOverlaysCleared:()=>this.removeOverlays()})}renderScoringBlocksContainer(t){return o("div",{class:"expandable-form-block-container"},t.items.map((({multiple:t,title:i,icon:e,category:s,name:a,type:n,opValues:r,values:l,hasScoring:p,formCreatorIndex:m,parentConditions:b,max:f})=>{const v=R(n,c,t);let g,u={fieldName:a,scoreValuePairs:[],maxScore:null};if("feedback"===n&&(l=h),v!==d.noScoring){g=r&&r[0]?r[0]:l||[],g=null==g?void 0:g.map((t=>null==t?void 0:t.replace(/[.]/g,"_"))),u=B(this.selectedScoring,a,v),v!==d.singleChoice&&v!==d.multipleChoice||!g.length||(u=kt(u,g));const t=P(u.scoreValuePairs);null===u.maxScore&&(u.maxScore=t)}const y={title:i,icon:e,category:s,name:a,values:g,hasScoring:p,formCreatorIndex:m,type:n,expanded:!0,fieldConditions:b,formattedScoring:Object.assign({},u),scoringCategory:v,max:f};return o("div",{class:"scoring-block-container"},o("yoo-form-creator-block-expandable",{options:this.options,mode:this.selectedScoring.isPercentage?"scoring-percentage":"scoring",formField:y,onScoreDeleted:this.onScoreDeleted,onScoreChanged:this.onScoreChanged,onScoreAdded:this.onScoreAdded}))})))}renderFormContentBlocksContainer(){const t=this.slides.some((t=>{var i;return null===(i=null==t?void 0:t.items)||void 0===i?void 0:i.some((t=>(null==t?void 0:t.parentConditions)||(null==t?void 0:t.condition)))}));setTimeout((()=>{var t;if((null===(t=this.currentExpandableFieldSortable)||void 0===t?void 0:t.sort)&&this.currentSlides&&this.currentSlides[this.selectedPageIndex]&&this.currentSlides[this.selectedPageIndex].items){const t=this.currentSlides[this.selectedPageIndex].items.filter((t=>t)).map((t=>t.name));try{this.currentExpandableFieldSortable.sort(t)}catch(t){}}}),0),this.parentBlockIndices=[];const i="app-color",e=[{text:b("HIDELOGICTOOLTIP"),size:"small",color:i,fill:"transparent",animated:!1,handler:()=>this.showConditions=!this.showConditions,isVisible:()=>!this.selectionMode&&!this.isLesson&&t},{text:b("SELECTALL"),size:"small",color:i,fill:"transparent",animated:!1,handler:()=>this.selectAll(),isVisible:()=>this.selectionMode},{text:b(this.selectionMode?"CANCEL":"SELECTACTION"),size:"small",fill:"transparent",animated:!1,color:this.selectionMode?"stable":i,handler:()=>this.toggleSelectionMode()}];return o("div",{class:"form-content-blocks-container"},o("yoo-accordion",{class:"pages-accordion",forceEntryUpdate:!0,entries:[{title:"CONTENT",selected:!0,actionButtons:K(this.selectedLeftMenuOption)?[]:[...e]}],iconPairLeft:q,showBottomBorder:!0,allowMultipleSelection:!0},this.currentSlides.map(((t,i)=>o("div",{slot:i===this.selectedPageIndex?"CONTENT":"HIDDEN-CONTENT"},o("yoo-ion-scroll",{ref:t=>{i===this.selectedPageIndex&&(this.mainContentScrollElement=t)},scrollEvents:!0,onIonScroll:t=>this.onMainContentScrolled(t)},K(this.selectedLeftMenuOption)&&this.selectedScoring?this.renderScoringBlocksContainer(t):i===this.selectedPageIndex&&this.renderExpandableBlockContainer(t,i)))))))}renderExpandableBlockContainer(t,i){var e;return[o("div",{class:"form-block-sortable-container"},o("div",{class:{"expandable-form-block-container":!0,empty:t.items.length<1},ref:t=>this.expandableBlockContainers[i]=t},null===(e=t.items)||void 0===e?void 0:e.map(((t,e)=>t.formCreatorIndex<this.numberOfBlocksToRender&&!t.sequentialConditionalField&&t.name!==this.forceFieldRerender&&this.renderFormContentBlocks(t,e,i))))),t.items.length<1&&this.renderEmptyFieldState(),o("yoo-ion-infinite-scroll",{ref:t=>this.infiniteScrolls[i]=t,onIonInfinite:()=>this.onInfiniteScroll()},this.numberOfBlocksToRender<t.items.length&&o("yoo-ion-infinite-scroll-content",{loadingSpinner:"dots"}))]}renderEmptyFieldState(){return o("div",{class:"empty-state",ref:t=>this.fieldEmptyStateContainer=t},o("yoo-empty-state",{type:"scoring"}),o("div",{class:"text-container"},b("EMPTYFORMCREATOR"),o("yoo-icon",{name:"circle-plus",color:"stable"})))}renderFormContentBlocks({opValues:t,title:i,icon:e,category:s,name:a,customName:n,isExpanded:r,parentConditions:l,condition:h,type:d,values:c,hasScoring:p,selected:m,formCreatorIndex:b,required:f,hideMobile:v,locked:g},u,y){var x,C;const k=h,{restrictionConditions:I,fieldConditions:S}=It(k);null===c&&(null==t?void 0:t.length)&&(c=t[0]);const E={title:i,icon:e,category:s,name:a,customName:n,values:c,type:d,expanded:r,isFirst:0===u,isLast:u===this.currentSlides[y].items.length-1,fieldConditions:l,parentFieldConditions:S,restrictionConditions:I,hasScoring:p,selected:m,pageIndex:y,formCreatorIndex:b,required:f,hideMobile:v,locked:g},{childFields:T,sequentialConditionFields:O}=St(l,b),F=n||a;return u>=0&&y===this.selectedPageIndex&&this.parentBlockIndices.push(u),o("div",{class:"sortable-container","data-id":a},o("yoo-form-creator-block-expandable",{key:`yoo-form-creator-block-expandable-${(null==T?void 0:T.length)||0}`,options:this.options,id:`${y}-${u}`,ref:t=>{y===this.selectedPageIndex&&(this.expandableBlocks[u]=t)},showConditions:!this.selectionMode&&this.showConditions,class:{selection:this.selectionMode},formField:E,itemList:this.itemList,campaignType:null===(x=this.missionDescription)||void 0===x?void 0:x.type,sequentialConditionFields:O,isInSelectionMode:this.selectionMode,numberOfBlocksToRender:this.numberOfBlocksToRender,blockFieldExpansion:!w(this.newUndefinedCondition),disableFieldTranslation:this.isLesson&&(!this.translations||0===(null===(C=this.translations)||void 0===C?void 0:C.length))},o("div",{class:"parent-slot",slot:F},o("slot",{name:F})),null==T?void 0:T.map((t=>{var i;return(null===(i=t.sequentialConditionalField)||void 0===i?void 0:i.masterParentFieldName)===F&&o("div",{class:"child-slot",slot:t.name},o("slot",{name:t.name}))}))))}renderLivePreview(){var t;return o("yoo-form-creator-live-preview",{ref:t=>this.livePreviewElement=t,mode:"panel",hidden:this.isLivePreviewHidden,showDevices:!1,missionDescriptionTitle:null===(t=this.missionDescription)||void 0===t?void 0:t.title,onVisibilityToggled:()=>this.isLivePreviewHidden=!this.isLivePreviewHidden},o("div",{class:"slot-container",slot:"livePreview"},o("slot",{name:"livePreview"})))}renderFormDynamic(){var t;return o("div",{class:"form-dynamic-container"},o("yoo-header",null,o("yoo-navbar",null,o("yoo-truncate",null,v(null===(t=this.missionDescription)||void 0===t?void 0:t.title)))))}render(){return o(s,{class:U(this.host)},o("div",{class:"container",ref:t=>this.containerEl=t},this.renderHeader(),this.renderContent(),this.renderOverlays()))}get host(){return a(this)}static get watchers(){return{customFormFields:["onCustomFormFieldsUpdated"],selectedNewScoring:["updateSelectedScoring"],slides:["updateInternalSlides"],translations:["onTranslationsChanged"]}}};Ft.style=":root{--ease-in-back:cubic-bezier(0.36, 0, 0.66, -0.56);--ease-in-circ:cubic-bezier(0.55, 0, 1, 0.45);--ease-in-cubic:cubic-bezier(0.32, 0, 0.67, 0);--ease-in-expo:cubic-bezier(0.7, 0, 0.84, 0);--ease-in-quad:cubic-bezier(0.11, 0, 0.5, 0);--ease-in-quart:cubic-bezier(0.5, 0, 0.75, 0);--ease-in-quint:cubic-bezier(0.64, 0, 0.78, 0);--ease-in-sine:cubic-bezier(0.12, 0, 0.39, 0);--ease-out-back:cubic-bezier(0.34, 1.56, 0.64, 1);--ease-out-circ:cubic-bezier(0, 0.55, 0.45, 1);--ease-out-cubic:cubic-bezier(0.33, 1, 0.68, 1);--ease-out-expo:cubic-bezier(0.16, 1, 0.3, 1);--ease-out-quad:cubic-bezier(0.5, 1, 0.89, 1);--ease-out-quart:cubic-bezier(0.25, 1, 0.5, 1);--ease-out-quint:cubic-bezier(0.22, 1, 0.36, 1);--ease-out-sine:cubic-bezier(0.61, 1, 0.88, 1);--ease-in-out-back:cubic-bezier(0.68, -0.6, 0.32, 1.6);--ease-in-out-circ:cubic-bezier(0.85, 0, 0.15, 1);--ease-in-out-cubic:cubic-bezier(0.65, 0, 0.35, 1);--ease-in-out-expo:cubic-bezier(0.87, 0, 0.13, 1);--ease-in-out-quad:cubic-bezier(0.45, 0, 0.55, 1);--ease-in-out-quart:cubic-bezier(0.76, 0, 0.24, 1);--ease-in-out-quint:cubic-bezier(0.83, 0, 0.17, 1);--ease-in-out-sine:cubic-bezier(0.37, 0, 0.63, 1)}.tippy-box,.tippy-popper{white-space:pre-wrap}.tippy-box .tippy-tooltip,.tippy-popper .tippy-tooltip{padding:var(--spacing-02, 0.125rem)}.tippy-box{-webkit-box-shadow:var(--shadow-03, 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-03, 0 0.5rem 1rem 0 rgba(0, 0, 0, 0.1))}.tippy-box .tippy-content.editable{padding:0}.tippy-box .tippy-content .flex{display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around}.tippy-box .tippy-content .hidden{display:none}.tippy-box .tippy-content .editable-content{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;color:var(--dark, #000000)}.tippy-box .tippy-content .editable-content .text-content{min-width:5rem;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.tippy-box .tippy-content .editable-content .text-content>div{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.tippy-box .tippy-content .editable-content.readonly{padding:var(--spacing-08, 0.5rem)}.tippy-box .tippy-content .editable-content .maxchar-content{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-item-align:end;align-self:flex-end;height:var(--spacing-24, 1.5rem);padding-right:var(--spacing-08, 0.5rem)}.tippy-box .tippy-content .editable-content .action-content{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.tippy-box .tippy-content .editable-content .action-content yoo-button{padding:0 var(--spacing-08, 0.5rem)}.tippy-box .tippy-content .editable-content .action-content .edit-content{-ms-flex-align:center;align-items:center}.tippy-box .tippy-content .editable-content .action-content .edit-content yoo-icon{padding-left:var(--spacing-08, 0.5rem);cursor:pointer}.tippy-box .tippy-content .editable-content .edit-content>*{cursor:pointer}.tippy-box .tippy-content .request-access{padding:var(--spacing-08, 0.5rem)}.tippy-box .tippy-content .request-access .title{margin-bottom:var(--spacing-08, 0.5rem);font-weight:var(--font-weight-700, 700)}.tippy-box .tippy-content .request-access .sub-title{display:-ms-flexbox;display:flex;margin-bottom:var(--spacing-08, 0.5rem);font-weight:var(--font-weight-300, 300);font-size:var(--font-size-14, 0.875rem)}.tippy-box .tippy-content .request-access .sub-title yoo-avatar{margin:0 var(--spacing-04, 0.25rem)}.tippy-box .tippy-content .request-access yoo-button{max-width:8rem}.tippy-box[data-theme~=startameeting] .tippy-content{padding:0;border-radius:var(--border-radius-04, 0.25rem)}.tippy-box[data-theme~=large]{font-size:var(--font-size-16, 1rem)}.tippy-box[data-theme~=large] .tippy-content{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=large] .tippy-content .editable-content{padding:var(--spacing-04, 0.25rem)}.tippy-box[data-theme~=large] .tippy-content .editable-content .text-content{padding-right:var(--spacing-16, 1rem)}.tippy-box[data-theme~=large] .tippy-content .editable-content yoo-icon{margin:0 var(--spacing-04, 0.25rem)}.tippy-box[data-theme~=small]{font-size:var(--font-size-16, 1rem)}.tippy-box[data-theme~=small] .tippy-content{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=small] .tippy-content .editable-content{padding:var(--spacing-04, 0.25rem)}.tippy-box[data-theme~=small] .tippy-content .editable-content .text-content{padding-right:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=small] .tippy-content .editable-content yoo-icon{margin:0 var(--spacing-04, 0.25rem)}.tippy-box[data-theme~=accent]{background-color:var(--accent, #276ef1)}.tippy-box[data-theme~=accent] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=accent] .tippy-svg-arrow{fill:var(--accent, #276ef1)}.tippy-box[data-theme~=accent][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--accent, #276ef1)}.tippy-box[data-theme~=accent][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--accent, #276ef1)}.tippy-box[data-theme~=accent][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--accent, #276ef1)}.tippy-box[data-theme~=accent][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--accent, #276ef1)}.tippy-box[data-theme~=anthracite]{background-color:var(--anthracite, #1a1a1a)}.tippy-box[data-theme~=anthracite] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=anthracite] .tippy-svg-arrow{fill:var(--anthracite, #1a1a1a)}.tippy-box[data-theme~=anthracite][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--anthracite, #1a1a1a)}.tippy-box[data-theme~=anthracite][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--anthracite, #1a1a1a)}.tippy-box[data-theme~=anthracite][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--anthracite, #1a1a1a)}.tippy-box[data-theme~=anthracite][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--anthracite, #1a1a1a)}.tippy-box[data-theme~=app-color]{background-color:var(--app-color)}.tippy-box[data-theme~=app-color] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=app-color] .tippy-svg-arrow{fill:var(--app-color)}.tippy-box[data-theme~=app-color][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--app-color)}.tippy-box[data-theme~=app-color][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--app-color)}.tippy-box[data-theme~=app-color][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--app-color)}.tippy-box[data-theme~=app-color][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--app-color)}.tippy-box[data-theme~=danger]{background-color:var(--danger, #d44333)}.tippy-box[data-theme~=danger] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=danger] .tippy-svg-arrow{fill:var(--danger, #d44333)}.tippy-box[data-theme~=danger][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--danger, #d44333)}.tippy-box[data-theme~=danger][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--danger, #d44333)}.tippy-box[data-theme~=danger][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--danger, #d44333)}.tippy-box[data-theme~=danger][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--danger, #d44333)}.tippy-box[data-theme~=danger-light]{background-color:var(--danger-light, #f46885)}.tippy-box[data-theme~=danger-light] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=danger-light] .tippy-svg-arrow{fill:var(--danger-light, #f46885)}.tippy-box[data-theme~=danger-light][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--danger-light, #f46885)}.tippy-box[data-theme~=danger-light][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--danger-light, #f46885)}.tippy-box[data-theme~=danger-light][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--danger-light, #f46885)}.tippy-box[data-theme~=danger-light][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--danger-light, #f46885)}.tippy-box[data-theme~=dark]{background-color:var(--dark, #000000)}.tippy-box[data-theme~=dark] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=dark] .tippy-svg-arrow{fill:var(--dark, #000000)}.tippy-box[data-theme~=dark][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--dark, #000000)}.tippy-box[data-theme~=dark][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--dark, #000000)}.tippy-box[data-theme~=dark][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--dark, #000000)}.tippy-box[data-theme~=dark][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--dark, #000000)}.tippy-box[data-theme~=energized]{background-color:var(--energized, #fed05b)}.tippy-box[data-theme~=energized] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=energized] .tippy-svg-arrow{fill:var(--energized, #fed05b)}.tippy-box[data-theme~=energized][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--energized, #fed05b)}.tippy-box[data-theme~=energized][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--energized, #fed05b)}.tippy-box[data-theme~=energized][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--energized, #fed05b)}.tippy-box[data-theme~=energized][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--energized, #fed05b)}.tippy-box[data-theme~=info]{background-color:var(--info, #fc459e)}.tippy-box[data-theme~=info] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=info] .tippy-svg-arrow{fill:var(--info, #fc459e)}.tippy-box[data-theme~=info][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--info, #fc459e)}.tippy-box[data-theme~=info][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--info, #fc459e)}.tippy-box[data-theme~=info][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--info, #fc459e)}.tippy-box[data-theme~=info][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--info, #fc459e)}.tippy-box[data-theme~=light]{background-color:var(--light, #ffffff)}.tippy-box[data-theme~=light] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=light] .tippy-svg-arrow{fill:var(--light, #ffffff)}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--light, #ffffff)}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--light, #ffffff)}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--light, #ffffff)}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--light, #ffffff)}.tippy-box[data-theme~=light-orange]{background-color:var(--light-orange, #fcae49)}.tippy-box[data-theme~=light-orange] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=light-orange] .tippy-svg-arrow{fill:var(--light-orange, #fcae49)}.tippy-box[data-theme~=light-orange][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--light-orange, #fcae49)}.tippy-box[data-theme~=light-orange][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--light-orange, #fcae49)}.tippy-box[data-theme~=light-orange][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--light-orange, #fcae49)}.tippy-box[data-theme~=light-orange][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--light-orange, #fcae49)}.tippy-box[data-theme~=light-to-text-color]{background-color:var(--light-to-text-color, #ffffff)}.tippy-box[data-theme~=light-to-text-color] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=light-to-text-color] .tippy-svg-arrow{fill:var(--light-to-text-color, #ffffff)}.tippy-box[data-theme~=light-to-text-color][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--light-to-text-color, #ffffff)}.tippy-box[data-theme~=light-to-text-color][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--light-to-text-color, #ffffff)}.tippy-box[data-theme~=light-to-text-color][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--light-to-text-color, #ffffff)}.tippy-box[data-theme~=light-to-text-color][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--light-to-text-color, #ffffff)}.tippy-box[data-theme~=royal]{background-color:var(--royal, #7577ff)}.tippy-box[data-theme~=royal] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=royal] .tippy-svg-arrow{fill:var(--royal, #7577ff)}.tippy-box[data-theme~=royal][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--royal, #7577ff)}.tippy-box[data-theme~=royal][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--royal, #7577ff)}.tippy-box[data-theme~=royal][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--royal, #7577ff)}.tippy-box[data-theme~=royal][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--royal, #7577ff)}.tippy-box[data-theme~=stable]{background-color:var(--stable, #adadad)}.tippy-box[data-theme~=stable] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=stable] .tippy-svg-arrow{fill:var(--stable, #adadad)}.tippy-box[data-theme~=stable][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--stable, #adadad)}.tippy-box[data-theme~=stable][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--stable, #adadad)}.tippy-box[data-theme~=stable][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--stable, #adadad)}.tippy-box[data-theme~=stable][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--stable, #adadad)}.tippy-box[data-theme~=stable-alt]{background-color:var(--stable-alt, #d0d0d0)}.tippy-box[data-theme~=stable-alt] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=stable-alt] .tippy-svg-arrow{fill:var(--stable-alt, #d0d0d0)}.tippy-box[data-theme~=stable-alt][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--stable-alt, #d0d0d0)}.tippy-box[data-theme~=stable-alt][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--stable-alt, #d0d0d0)}.tippy-box[data-theme~=stable-alt][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--stable-alt, #d0d0d0)}.tippy-box[data-theme~=stable-alt][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--stable-alt, #d0d0d0)}.tippy-box[data-theme~=stable-light]{background-color:var(--stable-light, #f1f1f1)}.tippy-box[data-theme~=stable-light] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=stable-light] .tippy-svg-arrow{fill:var(--stable-light, #f1f1f1)}.tippy-box[data-theme~=stable-light][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--stable-light, #f1f1f1)}.tippy-box[data-theme~=stable-light][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--stable-light, #f1f1f1)}.tippy-box[data-theme~=stable-light][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--stable-light, #f1f1f1)}.tippy-box[data-theme~=stable-light][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--stable-light, #f1f1f1)}.tippy-box[data-theme~=stable-ultralight]{background-color:var(--stable-ultralight, #fafafa)}.tippy-box[data-theme~=stable-ultralight] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=stable-ultralight] .tippy-svg-arrow{fill:var(--stable-ultralight, #fafafa)}.tippy-box[data-theme~=stable-ultralight][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--stable-ultralight, #fafafa)}.tippy-box[data-theme~=stable-ultralight][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--stable-ultralight, #fafafa)}.tippy-box[data-theme~=stable-ultralight][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--stable-ultralight, #fafafa)}.tippy-box[data-theme~=stable-ultralight][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--stable-ultralight, #fafafa)}.tippy-box[data-theme~=success]{background-color:var(--success, #3aa76d)}.tippy-box[data-theme~=success] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=success] .tippy-svg-arrow{fill:var(--success, #3aa76d)}.tippy-box[data-theme~=success][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--success, #3aa76d)}.tippy-box[data-theme~=success][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--success, #3aa76d)}.tippy-box[data-theme~=success][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--success, #3aa76d)}.tippy-box[data-theme~=success][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--success, #3aa76d)}.tippy-box[data-theme~=text-color]{background-color:var(--text-color, #807f83)}.tippy-box[data-theme~=text-color] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=text-color] .tippy-svg-arrow{fill:var(--text-color, #807f83)}.tippy-box[data-theme~=text-color][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--text-color, #807f83)}.tippy-box[data-theme~=text-color][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--text-color, #807f83)}.tippy-box[data-theme~=text-color][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--text-color, #807f83)}.tippy-box[data-theme~=text-color][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--text-color, #807f83)}.tippy-box[data-theme~=warning]{background-color:var(--warning, #ff6402)}.tippy-box[data-theme~=warning] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=warning] .tippy-svg-arrow{fill:var(--warning, #ff6402)}.tippy-box[data-theme~=warning][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--warning, #ff6402)}.tippy-box[data-theme~=warning][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--warning, #ff6402)}.tippy-box[data-theme~=warning][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--warning, #ff6402)}.tippy-box[data-theme~=warning][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--warning, #ff6402)}.tippy-box[data-theme~=anthracite-to-text-color]{background-color:var(--anthracite-to-text-color, #1a1a1a)}.tippy-box[data-theme~=anthracite-to-text-color] .tippy-tooltip{padding:var(--spacing-08, 0.5rem)}.tippy-box[data-theme~=anthracite-to-text-color] .tippy-svg-arrow{fill:var(--anthracite-to-text-color, #1a1a1a)}.tippy-box[data-theme~=anthracite-to-text-color][data-placement^=top]>.tippy-arrow::before{border-top-color:var(--anthracite-to-text-color, #1a1a1a)}.tippy-box[data-theme~=anthracite-to-text-color][data-placement^=bottom]>.tippy-arrow::before{border-bottom-color:var(--anthracite-to-text-color, #1a1a1a)}.tippy-box[data-theme~=anthracite-to-text-color][data-placement^=left]>.tippy-arrow::before{border-left-color:var(--anthracite-to-text-color, #1a1a1a)}.tippy-box[data-theme~=anthracite-to-text-color][data-placement^=right]>.tippy-arrow::before{border-right-color:var(--anthracite-to-text-color, #1a1a1a)}:root{--safe-area-inset-top:0;--safe-area-inset-right:0;--safe-area-inset-bottom:0;--safe-area-inset-left:0}@supports (top: constant(safe-area-inset-top)){:root{--safe-area-inset-top:constant(safe-area-inset-top);--safe-area-inset-right:constant(safe-area-inset-right);--safe-area-inset-bottom:constant(safe-area-inset-bottom);--safe-area-inset-left:constant(safe-area-inset-left)}}@supports (top: env(safe-area-inset-top)){:root{--safe-area-inset-top:env(safe-area-inset-top);--safe-area-inset-right:env(safe-area-inset-right);--safe-area-inset-bottom:env(safe-area-inset-bottom);--safe-area-inset-left:env(safe-area-inset-left)}}.fr-popup.fr-active{z-index:30004 !important;display:block !important;opacity:1 !important}:host{display:block;width:100%;height:100%;background:var(--light-to-dark, #ffffff)}:host .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden}:host .container .content{display:-ms-flexbox;display:flex;height:calc(100% - 3rem);background-color:var(--stable-ultralight-to-light-10, #fafafa)}:host .container .content .sortable-chosen yoo-form-creator-block-expandable{--expandable-block-border:0.125rem solid var(--accent, #276ef1)}:host .container .content .left-menu{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:3rem;padding:var(--spacing-16, 1rem) 0;background:var(--light-to-dark, #ffffff);border-right:var(--border-width-01, 0.0625rem) solid var(--stable-light, #f1f1f1)}:host .container .content .left-menu-top,:host .container .content .left-menu-bottom{display:grid;gap:var(--spacing-16, 1rem)}:host .container .content .left-menu-top>*,:host .container .content .left-menu-bottom>*{cursor:pointer}:host .container .content .left-selection{position:relative;width:22rem;min-width:22rem;height:100%;overflow:hidden;background:var(--light-to-dark, #ffffff);border-right:0.0625rem solid var(--stable-light, #f1f1f1);-webkit-transition:0.3s;transition:0.3s}:host .container .content .left-selection.hide{width:0;min-width:0}:host .container .content .left-selection yoo-accordion{--outer-container-padding:0 var(--spacing-20-deprecated, 1.25rem);--outer-container-width:calc(100% - 2.5rem)}:host .container .content .left-selection yoo-accordion yoo-accordion.sub-accordion{--outer-container-padding:0;--outer-container-width:100%}:host .container .content .left-selection.scoring{min-width:26.25rem;max-width:26.25rem;padding-top:var(--spacing-16, 1rem)}:host .container .content .left-selection.scoring yoo-ion-scroll{--top-pos:3.5rem;padding:0 0 5rem var(--spacing-16, 1rem)}:host .container .content .left-selection .logic-container .condition-block-selection .condition-sortable-container,:host .container .content .left-selection .logic-container .condition-block-selection .restrictions-sortable-container{display:-ms-flexbox;display:flex}:host .container .content .left-selection .logic-container .condition-block-selection .condition-sortable-container yoo-form-creator-condition-block,:host .container .content .left-selection .logic-container .condition-block-selection .restrictions-sortable-container yoo-form-creator-condition-block{-ms-flex:1;flex:1}:host .container .content .left-selection .logic-container .condition-block-selection .condition-sortable-container yoo-tooltip,:host .container .content .left-selection .logic-container .condition-block-selection .restrictions-sortable-container yoo-tooltip{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .container .content .left-selection .logic-container .condition-block-selection .condition-sortable-container .help-container,:host .container .content .left-selection .logic-container .condition-block-selection .restrictions-sortable-container .help-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:0.875rem;height:0.875rem;margin-left:var(--spacing-10-deprecated, 0.625rem);color:var(--light, #ffffff);font-size:var(--font-size-12, 0.75rem);background:var(--dark-to-light, #000000);border-radius:50%}:host .container .content .left-selection .logic-container yoo-ion-scroll{padding-top:var(--spacing-08, 0.5rem)}:host .container .content .form-content{width:100%;min-width:25rem;max-width:800px;height:100%;margin:auto;padding:var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem) var(--spacing-24, 1.5rem);}:host .container .content .form-content::-webkit-scrollbar{width:var(--spacing-08, 0.5rem);height:var(--spacing-08, 0.5rem)}:host .container .content .form-content::-webkit-scrollbar-track{background-color:transparent;border-radius:var(--border-radius-08, 0.5rem)}:host .container .content .form-content::-webkit-scrollbar-thumb{background-color:transparent;border-radius:var(--border-radius-08, 0.5rem)}:host .container .content .form-content:hover::-webkit-scrollbar-track{background-color:var(--stable-light-to-anthracite)}:host .container .content .form-content:hover::-webkit-scrollbar-thumb{background:var(--stable, #adadad)}:host .container .content .form-content.relative{position:relative}:host .container .content .form-content yoo-accordion.pages-accordion{--accordion-background:var(--stable-background)}:host .container .content .form-content yoo-toast{position:absolute;top:auto;right:calc(50% - 225px);bottom:4rem;left:auto;height:auto}:host .container .content .form-content .page-condition-overlay{position:absolute;top:11rem;right:-1rem;bottom:0;left:0;z-index:1;background:var(--dark-to-light, #000000);opacity:0.8}:host .container .content .form-content .scoring-empty-state{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;height:100%}:host .container .content .form-content .scoring-empty-state yoo-empty-state{height:26rem}:host .container .content .form-content .scoring-empty-state div{color:var(--text-color-to-light-60, #807f83);font-size:var(--font-size-16, 1rem);opacity:0.7;padding:var(--spacing-16, 1rem)}:host .container .content .form-content .form-content-blocks-container{position:relative;height:100%;max-height:100%}:host .container .content .form-content .form-content-blocks-container yoo-ion-scroll{--top-pos:2.6875rem}:host .container .content .form-content .form-content-blocks-container .empty-state{position:absolute;top:20px;right:0;bottom:auto;left:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:2;text-align:center;background:var(--stable-light-to-ligh-10);border:0.0625rem dashed var(--stable-alt, #d0d0d0)}:host .container .content .form-content .form-content-blocks-container .empty-state yoo-empty-state{width:8rem;height:6.25rem;padding:var(--spacing-16, 1rem)}:host .container .content .form-content .form-content-blocks-container .empty-state .text-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:12rem;padding:var(--spacing-16, 1rem);color:var(--stable, #adadad);font-size:var(--font-size-16, 1rem)}:host .container .content .form-content .form-content-blocks-container .empty-state .text-container yoo-icon{margin:var(--spacing-08, 0.5rem) 0 0 var(--spacing-04, 0.25rem)}:host .container .content .form-content .form-content-blocks-container .expandable-form-block-container{padding-bottom:10rem}:host .container .content .form-content .form-content-blocks-container .form-block-sortable-container{position:relative;min-height:calc(100% - 13.75rem);padding:0 var(--spacing-10-deprecated, 0.625rem) 12.5rem}:host .container .content .form-content .form-content-blocks-container .form-block-sortable-container .expandable-form-block-container{min-height:3rem;padding-bottom:0}:host .container .content .form-content .form-content-blocks-container .form-block-sortable-container .expandable-form-block-container.empty{width:calc(100% - 2px);height:12.75rem;padding:0}:host .container .content .parent-slot{width:100%}:host yoo-accordion{--title-icon-color:var(--stable-alt, #d0d0d0)}";export{Ft as yoo_form_creator}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,d as o,a as n,e as t}from"./p-4d956bd4.js";import{E as r,u as i,aZ as s,as as c,a1 as a,Y as u,t as l,a9 as d,bi as v,a0 as m,aq as f,aG as h,aH as g,bj as y,a4 as p}from"./p-a966475f.js";import{t as b}from"./p-967f6f1d.js";import{e as R,i as $,g as N}from"./p-9430559f.js";import{p as x,r as j}from"./p-cf2b3a56.js";import{s as E,a as C}from"./p-90a6a15b.js";import"./p-b5241164.js";import{t as M}from"./p-33b2d3a2.js";import{f as k}from"./p-bf6acbfe.js";import{f as A}from"./p-25c4db8a.js";import{b as T}from"./p-3e96a3ac.js";import{i as I}from"./p-0bb947fc.js";import{i as O}from"./p-ca8f9900.js";import{g as S}from"./p-179b66ff.js";import{i as L}from"./p-1901b669.js";import{l as D}from"./p-cbb53f3f.js";import{k as G}from"./p-b5ba03fd.js";import{m as V}from"./p-10b2bb56.js";const w=Object.assign(Object.assign({},{width:"2rem",height:"2rem"}),{border:`1px solid ${r("stable-40")}`,"border-radius":"50%"});function z(e){var o;let n=e.value||"",t=u;if(e&&e.colDef&&e.colDef.translate&&(t=l),i(n))return n.map((e=>t(e||""))).join(", ");{let i;(null==n?void 0:n.title)&&(n=n.title),e&&e.colDef&&e.colDef.fieldDefinition&&e.colDef.fieldDefinition.valuesColor&&(i=e.colDef.fieldDefinition.valuesColor);const c=null===(o=null==i?void 0:i.find((e=>e.key===n)))||void 0===o?void 0:o.value,a=c?s(c):r("dark-to-light");return e.isExport?t(n.toString()):'<div class="'+(c?"color-container":"")+'" style="background:'+(c||"")+";color:"+a+'" >'+t(n.toString())+"</div>"}}function P(e){let o;if(e.isExport=!0,e&&e.column&&e.column.getColDef){const n=e.column.getColDef();o=c(n.cellRenderer)&&n.cellRenderer!==ie?n.cellRenderer(e):"agGroupCellRenderer"===n.cellRenderer&&I(e.value)?e.value.toLocaleString():z(e)}else o=z(e);return delete e.isExport,o}function H(e){let o=[].concat(e.value||[]);o=R(o);const n=u,t=document.createElement("yoo-tooltip");t.setAttribute("hoverable","true"),t.delay=[1500,0];const r=o.map((e=>n(e||""))).join("<br/>");t.content=r,t.placement="bottom";const i=document.createElement("yoo-truncate");return i.classList.add("grid"),i.style.cssText="--max-lines: "+(e.maxLine||2),i.innerHTML=r,t.appendChild(i),e.isExport?r:t}function U(e){let o=[].concat(e.value||[]);o=$(o);const n=u,t=document.createElement("yoo-tooltip");t.setAttribute("hoverable","true");const r=o.map((e=>n(e||""))).join("<br/>");t.delay=[1500,0],t.content=r,t.placement="bottom";const i=document.createElement("yoo-truncate");return i.classList.add("grid"),i.style.cssText="--max-lines: "+(e.maxLine||2),i.innerHTML=r,t.appendChild(i),e.isExport?r:t}function B(e){let o=a([].concat(e.value||[]));o=o.map((e=>(O(e)||(e=e.tag),e)));const n=document.createElement("yoo-tooltip");n.setAttribute("hoverable","true");const t=o.join(", "),r=o.map((e=>`<yoo-tag color="stable">${e}</yoo-tag>`)).join("");n.delay=[1500,0],n.content=t,n.placement="bottom";const i=document.createElement("yoo-truncate");i.classList.add("grid"),i.style.cssText="--max-lines: "+(e.maxLine||2),i.innerHTML=r,n.appendChild(i);const s=document.createElement("div");return s.appendChild(n),e.isExport?r:s}function F(e){const o=document.createElement("yoo-tooltip");o.setAttribute("hoverable","true");const n=(i(e.value)?e.value.join(", "):e.value)||"";if(o.content=n,o.placement="bottom",o.delay=[1500,0],e.maxLine>0){const t=document.createElement("yoo-truncate");t.classList.add("grid"),t.style.cssText="--max-lines: "+(e.maxLine||2),t.innerHTML=n,o.appendChild(t)}else o.innerHTML=n;return e.isExport?n:o}function K(e){var o,n;let t=e.value;return e.isExport?t:(!0!==t&&!1!==t&&(null===(n=null===(o=null==e?void 0:e.colDef)||void 0===o?void 0:o.field)||void 0===n?void 0:n.indexOf("["))>0&&(t=S(e.data,e.colDef.field)),!0===t||"true"===t?'<yoo-form-checkbox value="true" readonly="true"></yoo-form-checkbox>':!1===t||"false"===t?'<yoo-form-checkbox value="false" readonly="true"></yoo-form-checkbox>':!1!==t&&!0!==t?'<yoo-icon name="circle" color="stable"></yoo-icon>':"")}function q(e){var o;const n=e.value;return n&&n.toUpperCase?u(n.toUpperCase()):(null==n?void 0:n.value)&&(null===(o=null==n?void 0:n.value)||void 0===o?void 0:o.toUpperCase)?u(n.value.toUpperCase()):""}function Y(e){return e.value}function J(e){var o;const n=e.factor||1,t=e.numberPrecision;let r=e.value;if(r&&isFinite(r-0)&&(r-=0),I(r))r/=n,n>1&&(r=Math.round(r)),r=r.toFixed(t);else if(I(e.defaultValue))r=e.defaultValue.toString();else if(r&&r.toString)r=r.toString();else{if(null===(o=e)||void 0===o?void 0:o.loader)return'<yoo-loader class="transparent ccenter-container" color="stable-light-to-light-10" size="small"></yoo-loader>';r=""}return e.isPercentage&&r&&(r+="%"),e.isExport?r.toString():e.icon?`<div class="top-container"><yoo-icon class="margin-right" name="${e.icon}" color="${e.color}"></yoo-icon><span>${r.toString()}</span></div>`:r.toString()}function Q(e){var o;const n=Number(e.value),t=e.factor||1,r=e.numberPrecision;if(isNaN(n))return(null===(o=e)||void 0===o?void 0:o.loader)?'<yoo-loader class="transparent ccenter-container" color="stable-light-to-light-10" size="small"></yoo-loader>':`<div>${e.noValue||""}</div>`;const i=x.percent.transform(n,r,t);return e.isExport?`<div>${i.toString()}</div>`:e.icon?`<div class="top-container"><yoo-icon class="margin-right" name="${e.icon}" color="${e.color}"></yoo-icon><span>${i.toString()}</span></div>`:`<div>${i.toString()}</div>`}function X(e){const o=e.value;return I(o)?x.currency.transform(o,e.numberPrecision,e.symbol,e.forceSymbol):o.toString()}function Z(e){const o=e.value;return I(o)?Math.round(o)+" "+l("YOOBICMIN").toLowerCase()+".":o}function W(e){var o,n;let t,r=null===(o=e.node.data)||void 0===o?void 0:o._geoloc,i=null===(n=e.node.data)||void 0===n?void 0:n._geolocSave;return r=!1===L(r)?r.toJS?r.toJS():r:"",i=!1===L(i)?i.toJS?i.toJS():i:"",r&&2===r.length&&i&&2===i.length&&(t=function(e,o,n,t,r="K"){const i=Math.PI*e/180,s=Math.PI*n/180,c=Math.PI*(o-t)/180;let a=Math.sin(i)*Math.sin(s)+Math.cos(i)*Math.cos(s)*Math.cos(c);return a=Math.acos(a),a=180*a/Math.PI,a=60*a*1.1515,"K"===r&&(a*=1.609344),"N"===r&&(a*=.8684),a}(i[1],i[0],r[1],r[0])),A(t)}function _(e){var o;let n=e.value||"";const t=e.node.parent.allLeafChildren,r=D(t,e.node),i=null===(o=null==e?void 0:e.colDef)||void 0===o?void 0:o.field;if(r>0&&r<t.length){const e=t[r].data[i],o=t[r-1].data[i];if(I(e)&&I(o)&&Math.abs(o)>0){const t=Math.round((e-o)/o*100);Math.abs(t)>0&&(n+='<span style="margin-left:10px" class="'+(t>0?"success":"danger")+'"> ('+t+"%)</span>")}}return n}function ee(e,o){let n=e.value;return p(n)&&n.value&&(n=n.value),n?e.isExport?d(m(n),o):'<div class="not-center-container">'+d(m(n),o)+"</div>":""}function oe(e){var o;return ee(e,(null===(o=e)||void 0===o?void 0:o.format)||"L LT")}function ne(e){var o;return ee(e,(null===(o=e)||void 0===o?void 0:o.format)||"L")}function te(e){const o=e.value;return o?/^\d\d:\d\d/.test(o)?'<div class="not-center-container">'+d(v(o,"HH:mm"),"LT")+"</div>":'<div class="not-center-container">'+d(m(o),"LT")+"</div>":""}function re(e){const o=M(e.data),n=document.createElement("div");n.classList.add("col"),n.classList.add("flex-direction-column"),n.classList.add("flex-right");const t=document.createElement("yoo-icon");t.name="recent",t.size="small",t.color=o.color;const r=document.createElement("div");r.classList.add("flex-center"),r.classList.add(o.color),r.appendChild(t),r.appendChild(document.createTextNode(o.text));const i=document.createElement("div");i.classList.add("flex-center"),i.classList.add("stable");const s=d(e.data.startDate,"L"),c=d(e.data.endDate,"L");return i.appendChild(document.createTextNode(`${s} - ${c}`)),n.appendChild(r),n.appendChild(i),n}function ie(e){if(e.value){const o=document.createElement("yoo-img");return G(w).forEach((e=>{o.style[e]=w[e]})),o.src=e.value,o.onclick=n=>{n.stopPropagation(),f("gridcellPhotoSelected",o,Object.assign(Object.assign({},e),{index:0}))},o}return""}function se(e){const o=e.value;if(o&&i(o)&&o.length>0){const n=document.createElement("div");return n.style.display="inherit",o.forEach(((o,t)=>{const r=document.createElement("yoo-img");G(w).forEach((e=>{r.style[e]=w[e]})),r.src=o,r.onclick=o=>{o.stopPropagation(),f("gridcellPhotoSelected",r,Object.assign(Object.assign({},e),{index:t}))},n.appendChild(r)})),n}return""}function ce(e){return'<video class="ag-cell-image video" [src]="'+e.value+'"></video>'}function ae(e){let o=5;return e.colDef&&e.colDef.cellRendererParams&&e.colDef.cellRendererParams.max&&(o=e.colDef.cellRendererParams.max),'<yoo-form-star-rating class="ag-cell-image app-color" readonly="true" max="'+o+'" value="'+e.value+'"></yoo-form-star-rating>'}function ue(e){return"<pre>"+k(e.value)+"</pre>"}function le(e){return e.value?e.value.address?e.value.address:e.value:""}function de(e){const o=e.value;return o?(o.title?o.title+" - ":"")+o.address:""}function ve(e){const o=e.value;return o&&i(o)?V(o,(e=>{var o;return(null===(o=e.text)||void 0===o?void 0:o.value)||""})).join(", "):""}function me(e){const o=e.value;return o&&o.values?V(o.values,(e=>e.text.value)).join(", "):""}function fe(e){const o=e.value;if(o&&o.startDate&&o.endDate){const e=h(m(o.endDate),m(o.startDate));return Math.floor(g(e))+d(y(new Date(e)),":mm:ss")}return""}function he(e){var o,n,t,r;let i="";return(null===(n=null===(o=null==e?void 0:e.value)||void 0===o?void 0:o.currentTasks)||void 0===n?void 0:n.length)>=0&&(i+=l("NEXTACTIONS")+": "+e.value.currentTasks.length),(null===(r=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.previousTasks)||void 0===r?void 0:r.length)>=0&&(i.length>0&&(i+="<br>"),i+=l("PREVIOUSACTIONS")+": "+e.value.previousTasks.length),i}function ge(e){var o,n,t,r;const i=e.value;if(i){const e=document.createElement("span");e.innerHTML=N(i);const o=document.createElement("yoo-avatar");o.classList.add("inline"),o.user=i,o.size="small";const n=document.createElement("div");return n.classList.add("user"),n.appendChild(o),n.appendChild(e),n}if((null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.userDisplayname)||(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.ownerDisplayName)){const o=document.createElement("span");o.innerHTML=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.userDisplayname)||(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.ownerDisplayName);const n=document.createElement("div");return n.classList.add("user"),n.appendChild(o),n}return""}function ye(e){const o=document.createElement("div");o.classList.add("col");const n=document.createElement("yoo-img");n.classList.add("image"),n.type="background",n.src=e.data.courseImage,o.appendChild(n);const t=document.createElement("div");return t.classList.add("text"),t.innerText=u((e.data.courseName||"").toString()),o.appendChild(t),o}function pe(e){const o=document.createElement("div");o.classList.add("col"),o.classList.add("flex-center");const n=document.createElement("yoo-icon");return n.name="star",n.color="energized",n.size="small",o.appendChild(n),o.appendChild(document.createTextNode((e.data.points||0).toString())),o}function be(e){const o=e.data.score||0,n=e.data.questions-o,t=document.createElement("div");t.classList.add("col");const r=document.createElement("div");r.classList.add("flex-center");const i=document.createElement("div");i.classList.add("flex-center");const s=document.createElement("yoo-icon"),c=document.createElement("yoo-icon");return s.name="cross",s.color="danger",c.name="check",c.color="success",r.appendChild(s),r.appendChild(document.createTextNode(n+" "+l("INCORRECT"))),i.appendChild(c),i.appendChild(document.createTextNode(o+" "+l("CORRECT"))),t.appendChild(r),t.appendChild(i),t}function Re(e){const o=e.value;if(o){const n=document.createElement("yoo-avatars");return n.classList.add("inline"),n.users=o,n.size="small",n.layout="stack",n.maxDisplay=e.maxDisplay,n.withTooltip=!0,n}return""}function $e(e){const o=document.createElement("yoo-progress-bar");return o.classList.add("grid-cell"),o.progressValue=e.value,o}function Ne(e){const o=document.createElement("yoo-chart");return o.classList.add("grid-cell"),o.config=e.value,o}function xe(e){const o=document.createElement("yoo-form-catalog");return o.classList.add("grid-cell"),o.readonly=!0,o.isGridCell=!0,o.value=e.value,o}function je(o){let n=[];n=a([].concat(o.colDef.fieldDefinition.type===e.document?o.colDef.fieldDefinition.document:o.value));const t=document.createElement("div");return t.classList.add("col"),n.length>0&&n.forEach((e=>{const o=document.createElement("yoo-form-document");o.classList.add("grid-cell"),o.readonly=!0,o.document=e,o.showActionSheet=!1,t.appendChild(o)})),t}function Ee(e){const o=e.value;let n="";return o&&(n=G(o).map((e=>e+": "+o[e])).join(", ")),n}function Ce(e){return e.colDef&&e.colDef.cellRendererParams?`<yoo-button class="small outline-dark ${e.colDef.cellRendererParams.color||""}">\n <yoo-icon name="${e.colDef.cellRendererParams.icon||""}"</yoo-icon>\n </yoo-button>`:""}function Me(e){var o,n,t;const r=e.value;let i="";e.node&&e.node.data&&(i=e.node.data.status);let s="";return!0===r||"true"===r||"validated"===r?s=`<yoo-tag color="success">${l("VALIDATED")}</yoo-tag>`:!1===r||"false"===r||"rejected"===r?s=`<yoo-tag color="danger">${l("REJECTED")}</yoo-tag>`:("finished"===i&&!1!==r&&!0!==r&&"false"!==r&&"true"!==r||"tobevalidated"===r)&&(s=`<yoo-tag color="royal">${l("TOBEVALIDATED")}</yoo-tag>`),(null===(o=null==e?void 0:e.node)||void 0===o?void 0:o.group)&&"group"===(null===(n=null==e?void 0:e.colDef)||void 0===n?void 0:n.cellRenderer)&&(s=`<yoo-tag color="stable">${l("N/A")}</yoo-tag>`),"excel"===(null===(t=e)||void 0===t?void 0:t.type)?Te(s):s}function ke(e){var o,n,t,r;let i,s="";(null===(o=e.data)||void 0===o?void 0:o.hasWorkflow)?i=T(e.data):(null===(t=null===(n=e.data)||void 0===n?void 0:n.mission)||void 0===t?void 0:t.hasWorkflow)&&(e.data.mission.description=e.data.missiondescription||e.data.mission.description,i=T(e.data.mission)),i&&(s=`<div class="not-center-container"><yoo-tag color=${i.color} custom-color=${i.customColor}>${i.innerHTML}</yoo-tag></div>`);const c=e.value;return"finished"===c?s=`<div class="not-center-container"><yoo-tag color="dark">${l("FINISHED")}</yoo-tag></div>`:"booked"===c?s=`<div class="not-center-container"><yoo-tag color="info">${l("BOOKED")}</yoo-tag></div>`:"scheduled"===c?s=`<div class="not-center-container"><yoo-tag color="energized">${l("SCHEDULED")}</yoo-tag></div>`:"archived"===c?s=`<div class="not-center-container"><yoo-tag color="stable">${l("MISSIONARCHIVED")}</yoo-tag></div>`:("available"===c||e.hasWorkflow&&!c)&&(s=`<div class="not-center-container"><yoo-tag color="accent">${l("AVAILABLE")}</yoo-tag></div>`),s=s||(c?c.toString():s||""),"excel"===(null===(r=e)||void 0===r?void 0:r.type)?Te(s):s}function Ae(e){const o=e.value;return`<yoo-tag class="inverse-color" color="${E(o)}">${C(o)}</yoo-tag>`}function Te(e){return(null==e?void 0:e.replace(/(<([^>]+)>)/gi,""))||""}function Ie(e){var o,n;const t=e.data;if((null===(o=null==t?void 0:t.mission)||void 0===o?void 0:o.kanbanColumnId)&&(null===(n=null==t?void 0:t.missiondescription)||void 0===n?void 0:n.kanbanColumns)){const e=t.missiondescription.kanbanColumns.find((e=>e._id===t.mission.kanbanColumnId));if(e)return`\n <div class="not-center-container">\n <yoo-tag custom-color="${e.color}">${l(e.title)}</yoo-tag>\n </div>`}return""}function Oe(e){var o,n,t,r,i,s,c,a,u,l,d;return(null===(n=null===(o=null==e?void 0:e.node)||void 0===o?void 0:o.data)||void 0===n?void 0:n.uniqueKeySuffix)&&(null===(i=null===(r=null===(t=null==e?void 0:e.node)||void 0===t?void 0:t.data)||void 0===r?void 0:r.description)||void 0===i?void 0:i.uniqueKeyPrefix)?e.node.data.description.uniqueKeyPrefix+"-"+e.node.data.uniqueKeySuffix:(null===(a=null===(c=null===(s=null==e?void 0:e.node)||void 0===s?void 0:s.data)||void 0===c?void 0:c.mission)||void 0===a?void 0:a.uniqueKeySuffix)&&(null===(d=null===(l=null===(u=null==e?void 0:e.node)||void 0===u?void 0:u.data)||void 0===l?void 0:l.missiondescription)||void 0===d?void 0:d.uniqueKeyPrefix)?e.node.data.missiondescription.uniqueKeyPrefix+"-"+e.node.data.mission.uniqueKeySuffix:""}function Se(e){let o="";return e.node&&e.node.aggData&&e.node.aggData.status&&e.node.aggData.validated&&(e.node.aggData.conformityprogress=Le(e.node),o+=Ke("conformityprogress",e.node.aggData.conformityprogress," %",!0)),o}function Le(e){if(e.aggData&&e.aggData.validated&&e.aggData.validated.counts){const o=Math.round(100*(e.aggData.validated.counts.validated||0)/((e.aggData.validated.counts.validated||0)+(e.aggData.validated.counts.rejected||0)));return isNaN(o)?0:o}return 0}function De(e){let o="";return e.node&&e.node.aggData&&e.node.aggData.status&&e.node.aggData.validated&&(e.node.aggData.progress=Ge(e.node),o+=Ke("progress",e.node.aggData.progress," %",!0)),o}function Ge(e){if(e&&e.aggData&&e.aggData.status&&e.aggData.status.counts){const o=Math.round(100*(e.aggData.status.counts.finished||0)/((e.aggData.status.counts.finished||0)+(e.aggData.status.counts.available||0)));return isNaN(o)?0:o}return 0}function Ve(e){let o="";return e.node&&e.node.aggData&&e.node.aggData.status&&e.node.aggData.validated&&(e.node.aggData.validationprogress=we(e.node),o+=Ke("validationprogress",e.node.aggData.validationprogress," %",!0)),o}function we(e){if(e.aggData&&e.aggData.validated&&e.aggData.validated.counts){const o=Math.round(100*((e.aggData.validated.counts.validated||0)+(e.aggData.validated.counts.rejected||0))/(e.aggData.status.counts.finished||0));return isNaN(o)?0:o}return 0}function ze(e){let o="";return e.node&&e.node.aggData&&e.node.aggData.status&&e.node.aggData.validated&&(e.node.aggData.conformityrelativeprogress=Pe(e.node),o+=Ke("conformityrelativeprogress",e.node.aggData.conformityrelativeprogress," %",!0)),o}function Pe(e){const o=Ge(e),n=Le(e),t=Math.round(n*o/100);return isNaN(t)?0:t}function He(e){return e.data&&e.data.status!==o.draft?re(e):"<div>-</div>"}function Ue(e){return e.data&&e.data.status!==o.draft?`<div>${l(e.data.partType===n.teams?"INCENTIVETEAMSCOUNT":"INCENTIVEUSERSCOUNT",{n:e.value||0})}</div>`:"<div>-</div>"}function Be(e){if(e.data){const o=e.data.type===t.competition,n=e.data.unit;let r=e.data.totalKpis>=1e4?x.number.transform(e.data.totalKpis):j(e.data.totalKpis,2).toString(),i=e.data.totalTargets>=1e4?x.number.transform(e.data.totalTargets):j(e.data.totalTargets,2).toString();e.data.isUnitCurrency&&n&&(r=`${n} ${r}`,i=`${n} ${i}`);const s=document.createElement("div"),c=document.createElement("div");if(c.appendChild(document.createTextNode(o?r:`${r} / ${i}`)),s.appendChild(c),!e.data.isUnitCurrency&&n){const e=document.createElement("yoo-tooltip");e.setAttribute("hoverable","true"),e.content=n,e.placement="bottom",e.delay=[1500,0];const o=document.createElement("yoo-truncate");o.classList.add("stable"),o.maxLength=25,o.content=n,e.appendChild(o),s.appendChild(e)}return s}return"-"}function Fe(e){var o;const n=O(e.value)?e.value:null===(o=e.value)||void 0===o?void 0:o.tag,t=n?`<yoo-tag color="${"completed"===n?"success":"info"}">${l(n.toUpperCase())}</yoo-tag>`:"",r=document.createElement("yoo-truncate");r.classList.add("grid"),r.style.cssText="--max-lines: "+(e.maxLine||2),r.innerHTML=t;const i=document.createElement("div");return i.classList.add("scrollable"),i.appendChild(r),e.isExport?n:i}function Ke(e,o,n="",t=!1){let r=e;(null==e?void 0:e.toUpperCase)&&(r=l(e.toUpperCase())),isNaN(o)&&(o="?",n="");let i="success";return"?"===o?i="dark":o<33?i="danger":o<75&&(i="energized"),`<yoo-tag color=${i}>${(t?"":r+":")+o+n}</yoo-tag>`}class qe{getGui(){return this.eGui}init(e){const o=document.createElement("div");this.missionResults=document.createElement("yoo-mission-results"),this.missionResults.className="inline",this.missionResults.mission=e.data,this.missionForm=document.createElement("yoo-form-dynamic"),this.missionForm.forceReadonly=!0,this.missionForm.formType="mission";let n=[];e.slides.forEach((e=>n=[...n,...e.items])),this.missionForm.slides=[{title:"GENERAL",items:n}],this.missionForm.data=e.data,this.missionForm.showTabs=!1,this.missionForm.showRecap=!1,this.missionForm.suffix=".value",this.missionForm.classList.add("grid-cell"),this.missionForm.appendChild(this.missionResults),o.appendChild(this.missionForm),this.eGui=o}refresh(e){if(this.missionResults)return this.missionResults.mission=e.data,!0}}class Ye{getGui(){return this.eGui}init(e){var o,n,t,r;const i=document.createElement("div"),s=e.entityType||e.collectionName;this.entity=document.createElement("yoo-entity"),this.entity.classList.add("block","no-border"),this.entity.displayType=e.displayType||"card-list",this.entity.entityType=s,this.entity.customModel=e.customModel,this.entity.isGridCell=!0,this.entity.item=e.useValue?e.value:e.data,"missiondatas"===s&&(null===(n=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.mission)||void 0===n?void 0:n.hasWorkflow)&&(this.entity.entityType="missions",this.entity.item=null===(t=e.data)||void 0===t?void 0:t.mission,this.entity.item.description=null===(r=e.data)||void 0===r?void 0:r.missiondescription),i.appendChild(this.entity),this.eGui=i}refresh(e){if(this.entity)return this.entity.item=e.data,!0}}class Je{getGui(){return this.eGui}init(e){const o=document.createElement("div");this.grid=document.createElement("yoo-grid"),this.grid.displayType=e.displayType||"card-list",this.grid.collectionName=e.collectionName,this.grid.customModel=e.customModel,this.grid.items=e.value,this.grid.isLocal=!0,o.appendChild(this.grid),this.eGui=o}refresh(e){if(this.grid)return this.grid.items=e.value,!0}}class Qe{getGui(){return this.eGui}getButtonFromAction(e,o){const n=document.createElement("yoo-button"),t=(null==e?void 0:e.text)?e.text(o):"";n.size="medium",(null==e?void 0:e.color)&&(n.color=e.color(o));const r=document.createElement("yoo-icon");if((null==e?void 0:e.icon)&&(r.name=e.icon(o)),(null==e?void 0:e.iconColor)&&(r.color=e.iconColor(o)),r.size="small",t){const e=document.createElement("yoo-tooltip");e.setAttribute("hoverable","true"),e.delay=[500,0],e.content=t,e.placement="bottom",e.appendChild(r),n.appendChild(e)}else n.appendChild(r);return n.addEventListener("click",(n=>{null==n||n.preventDefault(),null==n||n.stopPropagation(),null==e||e.handler(o)})),n}init(e){var o,n;const t=e.data,r=null===(o=e.items)||void 0===o?void 0:o.filter((e=>!e.isVisible||t&&e.isVisible(t)));if(1===r.length&&(null===(n=r[0])||void 0===n?void 0:n.icon)){const e=document.createElement("span"),o=this.getButtonFromAction(r[0],t);e.appendChild(o),this.eGui=e}else if((null==r?void 0:r.length)>=1){const e=null==r?void 0:r.filter((e=>e.forceInCard&&e.forceInCard(t)&&e.icon)),o=null==r?void 0:r.filter((e=>!e.forceInCard||!e.forceInCard(t))),n=document.createElement("div");t&&e.length>0&&e.map((e=>this.getButtonFromAction(e,t))).forEach((e=>{e.classList.add("margin-right"),n.appendChild(e)})),t&&o.length>0&&(this.menu=document.createElement("yoo-context-menu"),this.menu.contentButtons=o.map((e=>b(e,t,!0))),this.menu.appendChild(function(e){const o=document.createElement("template");return e=e.trim(),o.innerHTML=e,o.content.firstChild}('<div class="center-container"><yoo-button color="light-to-dark" size="medium" shape="square"><yoo-icon size="small" name="more"></yoo-icon></yoo-button></div>')),n.classList.add("center-container"),n.appendChild(this.menu),this.menu.contentButtons.length<=0&&(this.menu.style.display="none")),this.eGui=n}}refresh(e){const o=e.data;return this.menu&&o&&(this.menu.contentButtons=e.items.filter((e=>!e.isVisible||o&&e.isVisible(o))).map((e=>({text:e.text(o),handler:()=>e.handler(o)}))),this.menu.style.display=this.menu.contentButtons.length<=0?"none":"visible"),!0}}function Xe(e){switch(e){case"aclRoleRenderer":return U;case"groupRenderer":return H;case"tagsRenderer":return B;case"booleanRenderer":return K;case"numberRenderer":return J;case"dateRenderer":return ne;case"dateTimeRenderer":return oe;case"timeRenderer":return te;case"dateRangeRenderer":return re;case"currencyRenderer":return X;case"percentageRenderer":return Q;case"durationRenderer":return Z;case"distanceRenderer":return W;case"deltaRenderer":return _;case"translateRenderer":return q;case"keyTranslateRenderer":return Y;case"photoRenderer":return ie;case"multiphotoRenderer":return se;case"videoRenderer":return ce;case"starratingRenderer":return ae;case"jsonRenderer":return ue;case"addressRenderer":return le;case"locationRenderer":return de;case"todoRenderer":return me;case"taskRenderer":return ve;case"timerRenderer":return fe;case"checklistRenderer":return he;case"truncateRenderer":return F;case"userRenderer":return ge;case"usersRenderer":return Re;case"courseRenderer":return ye;case"starRewardRenderer":return pe;case"boardRenderer":return Ie;case"battleAnswersRenderer":return be;case"buttonRenderer":return Ce;case"documentRenderer":return je;case"catalogRenderer":return xe;case"chartRenderer":return Ne;case"progressbarRenderer":return $e;case"pricecheckRenderer":return Ee;case"missionStatusRenderer":return ke;case"missionValidationRenderer":return Me;case"missionUniqueKeyRenderer":return Oe;case"progressRenderer":return De;case"validationProgressRenderer":return Ve;case"conformityProgressRenderer":return Se;case"conformityRelativeProgressRenderer":return ze;case"salesAIQuantityRenderer":return Ae;case"agGroupCellRenderer":return"agGroupCellRenderer";case"agAnimateShowChangeCellRenderer":return"agAnimateShowChangeCellRenderer";case"agAnimateSlideCellRenderer":return"agAnimateSlideCellRenderer";case"missionResultsRenderer":return qe;case"incentiveDateRangeRenderer":return He;case"incentiveParticipantsRenderer":return Ue;case"incentiveTotalRenderer":return Be;case"courseStatusRenderer":return Fe;case"entityRenderer":return Ye;case"actionsRenderer":return Qe;case"gridRenderer":return Je;case"exportRenderer":return P;case"defaultRenderer":default:return z}}export{Ke as a,Pe as b,Le as c,Xe as g,Ge as p,we as v}
|