survey-creator-core 2.5.0 → 2.5.1
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/fesm/i18n/arabic.mjs +1 -1
- package/fesm/i18n/bulgarian.mjs +1 -1
- package/fesm/i18n/burmese.mjs +1 -1
- package/fesm/i18n/croatian.mjs +1 -1
- package/fesm/i18n/czech.mjs +1 -1
- package/fesm/i18n/danish.mjs +1 -1
- package/fesm/i18n/dutch.mjs +1 -1
- package/fesm/i18n/english.mjs +1 -1
- package/fesm/i18n/finnish.mjs +1 -1
- package/fesm/i18n/french.mjs +1 -1
- package/fesm/i18n/german.mjs +1 -1
- package/fesm/i18n/greek.mjs +1 -1
- package/fesm/i18n/haitian-creole.mjs +1 -1
- package/fesm/i18n/hebrew.mjs +1 -1
- package/fesm/i18n/hungarian.mjs +1 -1
- package/fesm/i18n/index.mjs +1 -1
- package/fesm/i18n/indonesian.mjs +1 -1
- package/fesm/i18n/italian.mjs +1 -1
- package/fesm/i18n/japanese.mjs +1 -1
- package/fesm/i18n/korean.mjs +1 -1
- package/fesm/i18n/malay.mjs +1 -1
- package/fesm/i18n/mongolian.mjs +1 -1
- package/fesm/i18n/norwegian.mjs +1 -1
- package/fesm/i18n/persian.mjs +1 -1
- package/fesm/i18n/polish.mjs +1 -1
- package/fesm/i18n/portuguese.mjs +1 -1
- package/fesm/i18n/romanian.mjs +1 -1
- package/fesm/i18n/russian.mjs +1 -1
- package/fesm/i18n/simplified-chinese.mjs +1 -1
- package/fesm/i18n/slovak.mjs +1 -1
- package/fesm/i18n/slovenian.mjs +1 -1
- package/fesm/i18n/spanish.mjs +1 -1
- package/fesm/i18n/swedish.mjs +1 -1
- package/fesm/i18n/tajik.mjs +1 -1
- package/fesm/i18n/thai.mjs +1 -1
- package/fesm/i18n/traditional-chinese.mjs +1 -1
- package/fesm/i18n/turkish.mjs +1 -1
- package/fesm/presets/index.mjs +32 -8
- package/fesm/presets/index.mjs.map +1 -1
- package/fesm/survey-creator-core.i18n.mjs +1 -1
- package/fesm/survey-creator-core.mjs +36 -6
- package/fesm/survey-creator-core.mjs.map +1 -1
- package/fesm/themes/index.mjs +1 -1
- package/fonts.fontless.css +1 -1
- package/fonts.fontless.min.css +1 -1
- package/i18n/arabic.js +1 -1
- package/i18n/arabic.min.js.LICENSE.txt +1 -1
- package/i18n/bulgarian.js +1 -1
- package/i18n/bulgarian.min.js.LICENSE.txt +1 -1
- package/i18n/burmese.js +1 -1
- package/i18n/burmese.min.js.LICENSE.txt +1 -1
- package/i18n/croatian.js +1 -1
- package/i18n/croatian.min.js.LICENSE.txt +1 -1
- package/i18n/czech.js +1 -1
- package/i18n/czech.min.js.LICENSE.txt +1 -1
- package/i18n/danish.js +1 -1
- package/i18n/danish.min.js.LICENSE.txt +1 -1
- package/i18n/dutch.js +1 -1
- package/i18n/dutch.min.js.LICENSE.txt +1 -1
- package/i18n/english.js +1 -1
- package/i18n/english.min.js.LICENSE.txt +1 -1
- package/i18n/finnish.js +1 -1
- package/i18n/finnish.min.js.LICENSE.txt +1 -1
- package/i18n/french.js +1 -1
- package/i18n/french.min.js.LICENSE.txt +1 -1
- package/i18n/german.js +1 -1
- package/i18n/german.min.js.LICENSE.txt +1 -1
- package/i18n/greek.js +1 -1
- package/i18n/greek.min.js.LICENSE.txt +1 -1
- package/i18n/haitian-creole.js +1 -1
- package/i18n/haitian-creole.min.js.LICENSE.txt +1 -1
- package/i18n/hebrew.js +1 -1
- package/i18n/hebrew.min.js.LICENSE.txt +1 -1
- package/i18n/hungarian.js +1 -1
- package/i18n/hungarian.min.js.LICENSE.txt +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.min.js.LICENSE.txt +1 -1
- package/i18n/indonesian.js +1 -1
- package/i18n/indonesian.min.js.LICENSE.txt +1 -1
- package/i18n/italian.js +1 -1
- package/i18n/italian.min.js.LICENSE.txt +1 -1
- package/i18n/japanese.js +1 -1
- package/i18n/japanese.min.js.LICENSE.txt +1 -1
- package/i18n/korean.js +1 -1
- package/i18n/korean.min.js.LICENSE.txt +1 -1
- package/i18n/malay.js +1 -1
- package/i18n/malay.min.js.LICENSE.txt +1 -1
- package/i18n/mongolian.js +1 -1
- package/i18n/mongolian.min.js.LICENSE.txt +1 -1
- package/i18n/norwegian.js +1 -1
- package/i18n/norwegian.min.js.LICENSE.txt +1 -1
- package/i18n/persian.js +1 -1
- package/i18n/persian.min.js.LICENSE.txt +1 -1
- package/i18n/polish.js +1 -1
- package/i18n/polish.min.js.LICENSE.txt +1 -1
- package/i18n/portuguese.js +1 -1
- package/i18n/portuguese.min.js.LICENSE.txt +1 -1
- package/i18n/romanian.js +1 -1
- package/i18n/romanian.min.js.LICENSE.txt +1 -1
- package/i18n/russian.js +1 -1
- package/i18n/russian.min.js.LICENSE.txt +1 -1
- package/i18n/simplified-chinese.js +1 -1
- package/i18n/simplified-chinese.min.js.LICENSE.txt +1 -1
- package/i18n/slovak.js +1 -1
- package/i18n/slovak.min.js.LICENSE.txt +1 -1
- package/i18n/slovenian.js +1 -1
- package/i18n/slovenian.min.js.LICENSE.txt +1 -1
- package/i18n/spanish.js +1 -1
- package/i18n/spanish.min.js.LICENSE.txt +1 -1
- package/i18n/swedish.js +1 -1
- package/i18n/swedish.min.js.LICENSE.txt +1 -1
- package/i18n/tajik.js +1 -1
- package/i18n/tajik.min.js.LICENSE.txt +1 -1
- package/i18n/thai.js +1 -1
- package/i18n/thai.min.js.LICENSE.txt +1 -1
- package/i18n/traditional-chinese.js +1 -1
- package/i18n/traditional-chinese.min.js.LICENSE.txt +1 -1
- package/i18n/turkish.js +1 -1
- package/i18n/turkish.min.js.LICENSE.txt +1 -1
- package/package.json +2 -2
- package/presets/index.js +6 -6
- package/presets/index.min.js +1 -1
- package/presets/index.min.js.map +1 -1
- package/presets/localization/english.d.ts +4 -0
- package/presets/presets-editable-categorized.d.ts +1 -0
- package/presets/presets-plugin.d.ts +1 -0
- package/survey-creator-core.css +3 -3
- package/survey-creator-core.fontless.css +2 -2
- package/survey-creator-core.fontless.css.map +1 -1
- package/survey-creator-core.fontless.min.css +2 -2
- package/survey-creator-core.i18n.js +1 -1
- package/survey-creator-core.i18n.min.js.LICENSE.txt +1 -1
- package/survey-creator-core.js +40 -6
- package/survey-creator-core.js.map +1 -1
- package/survey-creator-core.min.css +3 -3
- package/survey-creator-core.min.js +1 -1
- package/survey-creator-core.min.js.LICENSE.txt +1 -1
- package/themes/default-contrast.js +1 -1
- package/themes/default-contrast.min.js.LICENSE.txt +1 -1
- package/themes/default-dark.js +1 -1
- package/themes/default-dark.min.js.LICENSE.txt +1 -1
- package/themes/default-light.js +1 -1
- package/themes/default-light.min.js.LICENSE.txt +1 -1
- package/themes/index.js +1 -1
- package/themes/index.min.js.LICENSE.txt +1 -1
- package/themes/sc2020.js +1 -1
- package/themes/sc2020.min.js.LICENSE.txt +1 -1
- package/themes/test.js +1 -1
- package/themes/test.min.js.LICENSE.txt +1 -1
- package/typings/creator-base.d.ts +6 -1
- package/typings/creator-settings.d.ts +1 -0
package/presets/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("survey-core"),require("survey-creator-core")):"function"==typeof define&&define.amd?define("[dashedname]",["survey-core","survey-creator-core"],t):"object"==typeof exports?exports["[dashedname]"]=t(require("survey-core"),require("survey-creator-core")):e.SurveyCreatorCorePresets=t(e.Survey,e.SurveyCreatorCore)}(this,(e,t)=>(()=>{"use strict";var o={156:t=>{t.exports=e},982:e=>{e.exports=t}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};i.r(r),i.d(r,{CreatorPresetEditableBase:()=>d,CreatorPresetEditableLanguages:()=>S,CreatorPresetEditableOptions:()=>T,CreatorPresetEditableTabs:()=>_,CreatorPresetEditableToolboxConfigurator:()=>v,CreatorPresetEditorModel:()=>P,NavigationBar:()=>L,QuestionPresetJsonModel:()=>A,TabPresetsPlugin:()=>R,Version:()=>N,enStrings:()=>I});var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},s(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var l=function(){return l=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function u(e,t,o){if(o||2===arguments.length)for(var n,i=0,r=t.length;i<r;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var p=i(156),c=i(982),d=function(){function e(e){this.preset=e,this.children=[],this.notifyCallback=function(e){}}return Object.defineProperty(e.prototype,"navigationPanelName",{get:function(){return this.path+"_navigation"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.preset.getPath()},enumerable:!1,configurable:!0}),e.prototype.getJsonPath=function(e){return this.path},Object.defineProperty(e.prototype,"fullPath",{get:function(){var e=this.parent?this.parent.fullPath:"";return this.path&&e&&(e+="_"),e+this.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageName",{get:function(){return"page_"+this.fullPath},enumerable:!1,configurable:!0}),e.prototype.getPageTitle=function(e){return e.getPageByName(this.pageName).title},e.prototype.getPageShortTitle=function(e){return e.getPageByName(this.pageName).navigationTitle},Object.defineProperty(e.prototype,"mainPanelName",{get:function(){return this.path+"_mainPanel"},enumerable:!1,configurable:!0}),e.prototype.getMainElementNames=function(){return[this.mainPanelName]},e.prototype.getMainPanelName=function(){return this.mainPanelName},e.prototype.getCustomQuestionCssSuffix=function(e){return""},e.prototype.createPages=function(){var e=[],t=this.createMainPage();return t&&e.push(t),this.children.forEach(function(t){var o=t.createPages();Array.isArray(o)&&o.forEach(function(t){return e.push(t)})}),e},Object.defineProperty(e.prototype,"questionNames",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.validate=function(e){if(!this.validateCore(e))return!1;for(var t=0;t<this.children.length;t++)if(!this.children[t].validate(e))return!1;return!0},e.prototype.validateCore=function(e){return!0},e.prototype.createMainPage=function(){var e=this.createMainPageCore();return e&&(e.name=this.pageName),e},e.prototype.getBoolVisibleIf=function(e,t){return void 0===t&&(t=!0),"{"+e+"}="+(t?"true":"false")},e.prototype.getTextVisibleIf=function(e,t){return"{"+e+"}='"+t+"'"},e.prototype.getNotEmptyVisibleIf=function(e){return"{"+e+"} notempty"},e.prototype.createMainPageCore=function(){},e.prototype.getNavigationElementName=function(){return this.navigationPanelName},e.prototype.getJsonValue=function(e,t,o){var n=e.getPageByName(this.pageName),i=n&&n.isVisible?this.getJsonValueCore(e,t,o):void 0,r=!!i,s=r?i:{};return this.children.forEach(function(o){var n=o.getJsonValue(e,t);n&&(r=!0,s[o.getJsonPath(e)]=n)}),r?s:void 0},e.prototype.getDefaultJsonValue=function(e){var t=this.getDefaultJsonValueCore(e);return this.children.forEach(function(o){return t[o.path]=o.getDefaultJsonValueCore(e)}),t},e.prototype.setJsonLocalizationStrings=function(e,t){this.setJsonLocalizationStringsCore(e,t),this.children.forEach(function(o){return o.setJsonLocalizationStrings(e,t)})},e.prototype.updateJsonLocalizationStrings=function(e){this.updateJsonLocalizationStringsCore(e),this.children.forEach(function(t){return t.updateJsonLocalizationStrings(e)})},e.prototype.dispose=function(){this.disposeCore(),this.children.forEach(function(e){return e.dispose()})},e.prototype.setupQuestions=function(e,t){this.setupQuestionsCore(e,t),this.children.forEach(function(o){o.setupQuestions(e,t)})},e.prototype.resetToDefaults=function(e,t){void 0===t&&(t=!0),this.restoreValuesFromDefault(e),this.notifyCallback(this.getPageTitle(e)+" "+(0,c.getLocString)("presets.editor.resoredToDefault")),this.children.forEach(function(o){o.resetToDefaults(e,t)})},e.prototype.setupOnCurrentPage=function(e,t,o){this.setupOnCurrentPageCore(e,t,o),this.children.forEach(function(n){n.setupOnCurrentPage(e,t,o)})},e.prototype.updateOnValueChanged=function(e,t){this.updateOnValueChangedCore(e,t),this.children.forEach(function(o){o.updateOnValueChanged(e,t)})},e.prototype.updateOnMatrixDetailPanelVisibleChanged=function(e,t,o){this.updateOnMatrixDetailPanelVisibleChangedCore(e,t,o),this.children.forEach(function(n){n.updateOnMatrixDetailPanelVisibleChanged(e,t,o)})},e.prototype.onGetMatrixRowActions=function(e,t,o){this.onGetMatrixRowActionsCore(e,t,o),this.children.forEach(function(n){n.onGetMatrixRowActions(e,t,o)})},e.prototype.onGetPanelTitleActions=function(e,t,o){},e.prototype.onMatrixRowDragOver=function(e,t,o){},e.prototype.onMatrixRowRemoving=function(e,t,o){},e.prototype.onMatrixRowAdded=function(e,t,o){},e.prototype.onMatrixCellValueChanged=function(e,t,o){},e.prototype.setupQuestionsValue=function(e,t,o){this.setupQuestionsValueCore(e,t,o),this.saveValuesAsDefault(e),this.children.forEach(function(n){n.setupQuestionsValue(e,t?t[n.path]:void 0,o)})},e.prototype.onLocaleChanged=function(e,t,o){this.onLocaleChangedCore(e,t,o),this.children.forEach(function(n){n.setupQuestionsValue(e,t?t[n.path]:void 0,o)})},e.prototype.saveValuesAsDefault=function(e){this.questionNames.forEach(function(t){return e.getQuestionByName(t).defaultValue=e.getValue(t)&&JSON.parse(JSON.stringify(e.getValue(t)))})},e.prototype.restoreValuesFromDefault=function(e){this.questionNames.forEach(function(t){return e.getQuestionByName(t).value=e.getQuestionByName(t).defaultValue&&JSON.parse(JSON.stringify(e.getQuestionByName(t).defaultValue))})},e.prototype.setupQuestionsCore=function(e,t){},e.prototype.resetToDefaultsCore=function(e){},e.prototype.setupQuestionsValueCore=function(e,t,o){},e.prototype.onLocaleChangedCore=function(e,t,o){},e.prototype.getJsonValueCore=function(e,t,o){},e.prototype.getDefaultJsonValueCore=function(e){return{}},e.prototype.setJsonLocalizationStringsCore=function(e,t){},e.prototype.updateJsonLocalizationStringsCore=function(e){},e.prototype.disposeCore=function(){},e.prototype.setupOnCurrentPageCore=function(e,t,o){},e.prototype.updateOnValueChangedCore=function(e,t){},e.prototype.updateOnMatrixDetailPanelVisibleChangedCore=function(e,t,o){},e.prototype.onGetMatrixRowActionsCore=function(e,t,o){},e.prototype.copyJson=function(e){return p.Helpers.getUnbindValue(e)},e.updateModifiedText=function(t,o,n){if(n&&o){var i=c.editorLocalization.presetStrings;c.editorLocalization.presetStrings=void 0,o!==c.editorLocalization.getString(n)&&e.saveTextInLocStrs(t,o,n),c.editorLocalization.presetStrings=i}},e.saveTextInLocStrs=function(e,t,o){for(var n=o.split("."),i=0;i<n.length-1;i++){var r=n[i];e[r]||(e[r]={}),e=e[r]}e[n[n.length-1]]=t},e}(),m={root:"sps-root-modern",container:"sps-container-modern",header:"sps-title sps-container-modern__title",body:"sps-body",bodyEmpty:"sps-body sps-body--empty",footer:"sps-footer sps-body__footer sps-clearfix",title:"",description:"",logo:"sps-logo",logoImage:"sps-logo__image",headerText:"sps-header__text",navigationButton:"",bodyNavigationButton:"",completedPage:"sps-completedpage",navigation:{complete:"sps-btn sps-btn--primary-brand sps-footer__complete-btn",prev:"sps-btn sps-btn--secondary-brand sps-footer__prev-btn",next:"sps-btn sps-btn--primary-brand sps-footer__next-btn",start:"sps-btn sps-footer__start-btn",preview:"sps-btn sps-footer__preview-btn",edit:"sps-btn sps-footer__edit-btn"},list:JSON.parse(JSON.stringify(c.listComponentCss)),panel:{withFrame:"sps-panel--with-frame",nested:"sps-panel--nested",expandableAnimating:"",header:"sps-panel__header",title:"sps-title sps-panel__title",titleBar:"sd-action-title-bar sps-action-title-bar",contentEnter:"sps-panel__content--enter",contentLeave:"sps-panel__content--leave",titleExpandable:"sps-panel__title--expandable",titleExpanded:"sps-panel__title--expanded",titleCollapsed:"sps-panel__title--collapsed",titleOnError:"sps-panel__title--error",description:"sps-description sps-panel__description",container:"sps-panel sps-row__panel",content:"sps-panel__content",icon:"sps-panel__icon",iconExpanded:"sps-panel__icon--expanded",footer:"sps-panel__footer",requiredMark:"sps-panel__required-text",collapsed:"sps-panel--collapsed",expanded:"sps-panel--expanded"},paneldynamic:{nested:"",mainRoot:"sps-question sps-row__question",root:"sps-paneldynamic",navigation:"sps-paneldynamic__navigation",title:"sps-title sps-question__title",button:"sps-action-button sps-action-button--text",buttonRemove:"sps-action-button--danger",buttonAdd:"sps-paneldynamic__add-btn",panelsContainer:"",panelWrapper:"sps-paneldynamic__panel-wrapper",panelWrapperList:"",progressTop:"sps-paneldynamic__progress sps-paneldynamic__progress--top",progressBottom:"sps-paneldynamic__progress sps-paneldynamic__progress--bottom",buttonPrev:"sps-paneldynamic__prev-btn",buttonNext:"sps-paneldynamic__next-btn",progressContainer:"sps-paneldynamic__progress-container",progress:"sps-progress",progressBar:"sps-progress__bar",progressText:"sps-paneldynamic__progress-text",panelFooter:"sps-panel__footer",separator:"sps-paneldynamic__separator",footer:"sps-paneldynamic__footer",footerButtonsContainer:"sps-paneldynamic__buttons-container"},progress:"sps-progress sps-body__progress",progressBar:"sps-progress__bar",progressText:"sps-progress__text",progressTextInBar:"sps-hidden",page:{root:"sps-page sps-body__page",title:"sps-title sps-page__title",description:"sps-description sps-page__description"},pageTitle:"sps-title sps-page__title",pageDescription:"sps-description sps-page__description",row:"sps-row sps-clearfix",rowEnter:"sps-row--enter",rowLeave:"sps-row--leave",rowDelayedEnter:"sps-row--delayed-fade-in",rowMultiple:"sps-row--multiple",question:{withFrame:"sps-question--with-frame",nested:"sps-question--nested",mainRoot:"sps-question sps-row__question",flowRoot:"sps-question sps-row__question sps-row__question--flow",asCell:"sps-table__cell",header:"sps-question__header",headerLeft:"sps-question__header--location--left",headerTop:"sps-question__header--location--top",headerBottom:"sps-question__header--location--bottom",content:"sps-question__content",contentLeft:"sps-question__content--left",titleLeftRoot:"sps-question--location--left",titleOnAnswer:"sps-question__title--answer",titleOnError:"sps-question__title--error",title:"sps-title sps-question__title",titleBar:"sd-action-title-bar sps-action-title-bar",requiredMark:"sps-question__required-text",number:"sps-question__num",description:"sps-description sps-question__description",descriptionUnderInput:"sps-question__description--under",comment:"sps-comment",required:"sps-question--required",titleRequired:"sps-question__title--required",indent:0,footer:"sps-question__footer",formGroup:"sps-question__form-group",hasError:"",readOnly:"sd-question--readonly sps-question--disabled",confirmDialog:"sps-popup--confirm sv-popup--confirm svc-creator-popup",errorsContainerBottom:"sps-question__erbox--below-question"},checkbox:{root:"sps-selectbase",item:"sps-item sps-checkbox sps-selectbase__item",itemSelectAll:"sps-checkbox--selectall",itemNone:"sps-checkbox--none",itemReadOnly:"sps-item--disabled sps-checkbox--disabled",itemChecked:"sps-checkbox--checked",itemHover:"sps-checkbox--allowhover",itemInline:"sps-selectbase__item--inline",label:"sps-selectbase__label",itemSvgIconId:"#icon-check-16x16",labelChecked:"",itemControl:"sps-checkbox__control",itemDecorator:"sps-checkbox__svg",controlLabel:"sps-checkbox__caption",materialDecorator:"sps-checkbox__rectangle",other:"sps-comment sps-question__other",column:"sps-selectbase__column"},radiogroup:{root:"sps-selectbase",item:"sps-item sps-radio sps-selectbase__item",itemInline:"sps-selectbase__item--inline",label:"sps-selectbase__label",labelChecked:"",itemReadOnly:"sps-item--disabled sps-radio--disabled",itemChecked:"sps-radio--checked",itemHover:"sps-radio--allowhover",itemControl:"sps-visuallyhidden sps-item__control",itemDecorator:"sps-item__svg sps-radio__svg",controlLabel:"sps-item__control-label",materialDecorator:"sps-item__decorator sps-radio__decorator",other:"sps-comment sps-question__other",clearButton:"sps-btn sps-selectbase__clear-btn",column:"sps-selectbase__column"},boolean:{mainRoot:"sps-question sps-row__question sps-question--boolean",rootCheckbox:"sps-selectbase",checkboxItem:"sps-checkbox",checkboxItemChecked:"sps-checkbox--checked",checkboxitemIndeterminate:"sps-checkbox--indeterminate",checkboxItemReadOnly:"sps-checkbox--disabled",svgIconId:"#icon-v2check",checkboxLabel:"sps-selectbase__label",controlCheckbox:"sps-checkbox__control",checkboxControlLabel:"sps-checkbox__caption",checkboxItemDecorator:"sps-checkbox__svg",checkboxMaterialDecorator:"sps-checkbox__rectangle"},text:{root:"sps-input sps-text",controlReadOnly:"sps-input--readonly",small:"sps-row__question--small",content:"sps-question__content sps-text__content",remainingCharacterCounter:"sps-remaining-character-counter",onError:"sps-input--error"},comment:{root:"sps-input sps-comment",content:"sps-question__content sps-comment__content",remainingCharacterCounter:"sps-remaining-character-counter",small:"sps-row__question--small",onError:"sps-input--error"},dropdown:{root:"sps-selectbase",popup:"sps-dropdown-popup svc-creator-popup",small:"sps-row__question--small sd-row__question--small",control:"sps-input sps-dropdown",controlEmpty:"sps-dropdown--empty sd-dropdown--empty",controlValue:"sps-dropdown__value",filterStringInput:"sd-dropdown__filter-string-input sps-dropdown__filter-string-input",other:"sps-comment sps-question__other",onError:"sps-input--error",selectWrapper:"sv-dropdown_select-wrapper sps-dropdown_select-wrapper",chevronButtonIconId:"icon-chevron",cleanButton:"sps-dropdown__clean-button sps-input__edit-button",controlReadOnly:"sps-input--readonly sd-input--disabled sd-input--readonly",hintPrefix:"sps-dropdown__hint-prefix sd-dropdown__hint-prefix",hintSuffix:"sps-dropdown__hint-suffix sd-dropdown__hint-suffix"},matrix:{tableWrapper:"sps-matrix sps-table-wrapper",root:"sps-table",rowError:"sps-matrix__row--error",cell:"sps-table__cell sps-matrix__cell",headerCell:"sps-table__cell sps-table__cell--header",label:"sps-item sps-radio sps-matrix__label",itemValue:"sps-visuallyhidden sps-item__control sps-radio__control",itemChecked:"sps-radio--checked",itemReadOnly:"sps-item--disabled sps-radio--disabled",itemHover:"sps-radio--allowhover",materialDecorator:"sps-item__decorator sps-radio__decorator",itemDecorator:"sps-item__svg sps-radio__svg",cellText:"sps-matrix__text",cellTextSelected:"sps-matrix__text--checked",cellTextReadOnly:"sps-matrix__text--disabled"},matrixdropdown:{tableWrapper:"sps-table-wrapper",root:"sps-table",cell:"sps-table__cell",headerCell:"sps-table__cell sps-table__cell--header",emptyCell:"sps-table__cell--empty",rowEnter:"sps-table__row--enter",rowLeave:"sps-table__row--leave"},matrixdynamic:{mainRoot:"sps-question sps-question--matrixdynamic sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",tableWrapper:"sps-table-wrapper",root:"sps-table sps-matrixdynamic",content:"sps-matrixdynamic__content sps-text__content",cell:"sps-table__cell",row:"sps-table__row",rowDisabled:"sps-table__row-disabled",rowReadOnly:"sps-table__row-readonly",headerCell:"sps-table__cell sps-table__cell--header",button:"sps-btn",detailRow:"sps-table__row sps-table__row--detail",detailButton:"sps-table__cell--detail-button sps-action-button",detailButtonExpanded:"sps-table__cell--detail-button--expanded",detailIcon:"sps-detail-panel__icon sps-action-button__icon",detailIconExpanded:"sps-detail-panel__icon--expanded",detailIconExpandedId:"icon-collapse-24x24",detailIconId:"icon-expand-24x24",detailPanelCell:"sps-table__cell sps-table__cell--detail-panel",actionsCell:"sps-table__cell sps-table__cell--actions",buttonAdd:"sps-matrixdynamic__add-btn sps-action-button sps-action-button--large",buttonRemove:"sps-matrixdynamic__remove-btn",iconAdd:"",iconRemove:"xxx",dragElementDecorator:"sps-drag-element__svg",iconDragElement:"#icon-drag-24x24",iconDrag:"sps-matrixdynamic__drag-element",footer:"sps-matrixdynamic__footer",dragDropGhostPositionTop:"sps-matrixdynamic__drag-drop-ghost-position-top",dragDropGhostPositionBottom:"sps-matrixdynamic__drag-drop-ghost-position-bottom",noRowsSection:"sps-matrixdynamic__placeholder",noRowsText:"sps-matrixdynamic__placeholder-text",cellQuestionWrapper:"sps-table__question-wrapper",draggedRow:"sps-matrixdynamic__dragged-row",emptyCell:"sps-table__cell--empty",rowEmpty:"sps-table__row--empty",rowEnter:"sps-table__row--enter",rowLeave:"sps-table__row--leave"},actionBar:{root:"sps-action-bar",item:"sps-action-button",itemPressed:"sps-action-button--pressed",itemAsIcon:"sps-action-button--icon",itemIcon:"sps-action-button__icon",itemTitle:"sps-action-button__title"}},g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultIcon="square-dashed-24x24",t}return a(t,e),Object.defineProperty(t.prototype,"nameItems",{get:function(){return this.path+"_items"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameMatrix",{get:function(){return this.fullPath+"_matrix"},enumerable:!1,configurable:!0}),t.prototype.hasIcon=function(e){return!1},t.prototype.getMainElementNames=function(){return[this.nameItems]},Object.defineProperty(t.prototype,"iconList",{get:function(){return Object.keys(p.SvgRegistry.icons).map(function(e){return"icon-"+e})},enumerable:!1,configurable:!0}),t.prototype.getMatrixKeyColumnName=function(e){return"name"},t.prototype.getDefaultItems=function(e){return this.defaultItems},t.prototype.getDefaultItem=function(e,t){var o=this.getMatrixKeyColumnName(e);return this.getDefaultItems(e).filter(function(e){return e[o]==t})[0]},t.prototype.updateOnValueChangedCore=function(e,t){if(this.needToSetActions(t)){var o=e.getQuestionByName(t);this.updateMatrixRowActions(e,o)}},t.prototype.updateMatrixRowActions=function(e,t){var o=this;t.renderedTable.rows.forEach(function(e){var n,i,r;if(e.row){var s=null===(i=null===(n=e.cells[1])||void 0===n?void 0:n.item)||void 0===i?void 0:i.value.actions;o.updateRowActions(t,e.row,s);var a=null===(r=e.cells[e.cells.length-1].item)||void 0===r?void 0:r.value.actions;o.updateRowActions(t,e.row,a)}})},t.prototype.updateRowActions=function(e,t,o){var n=this;if(o){var i=this.getMatrixKeyColumnName(e);if(e.value){var r=e.value.filter(function(e){var o;return(null===(o=t.value)||void 0===o?void 0:o[i])==(null==e?void 0:e[i])})[0];r&&o.forEach(function(o){return n.updateRowAction(e,t,r,i,o)})}}},t.prototype.updateRowAction=function(e,t,o,n,i){if("icon-action"==i.id&&(i.iconName=o.iconName||this.defaultIcon),"reset-to-default"==i.id){var r=this.getDefaultItem(e,o[n]);if(!r)return;var s={};Object.keys(o).forEach(function(e){return s[e]=r[e]}),i.enabled=!p.Helpers.isTwoValueEquals(o,s)}},t.prototype.createResetAction=function(e,t,o){return{id:"reset-to-default",iconName:"icon-reset",tooltip:(0,c.getLocString)("presets.items.restoreToDefault"),location:"end",visibleIndex:15,action:o}},t.prototype.createEditAction=function(e,t,o,n){var i=this;return{id:"edit-item",iconName:"icon-edit",tooltip:(0,c.getLocString)("presets.items.edit"),location:"end",visibleIndex:13,action:function(){i.editItem(e,t,o,n)}}},t.prototype.createIconAction=function(e,t){return void 0===t&&(t="sps-matrixdynamic__row-icon"),{id:"icon-action",iconName:e,innerCss:t,location:"start",enabled:!1}},t.prototype.setupStandardActions=function(e,t,o,n,i){e.forEach(function(e){"show-detail"==e.id&&(e.location="end",e.iconName="icon-expand-24x24",e.title=new p.ComputedUpdater(function(){return o.isDetailPanelShowing?(0,c.getLocString)("presets.items.collapse"):(0,c.getLocString)("presets.items.expand")}),e.tooltip=(0,c.getLocString)("presets.items.expand"),e.visibleIndex=10,e.visible=n),"remove-row"==e.id&&(e.visibleIndex=20,e.component="sv-action-bar-item",e.action=function(){return t.removeRowUI(o)},e.iconName=i?"icon-add_24x24":"icon-remove_24x24",e.tooltip=i?(0,c.getLocString)("presets.items.add"):(0,c.getLocString)("presets.items.delete"))})},t.prototype.editItem=function(e,t,o,n,i){var r,s,a=this,l=this.getMatrixKeyColumnName(o),u={id:"reset-to-default",title:(0,c.getLocString)("presets.editor.resetToDefault"),css:"sps-action--grow",innerCss:"sps-btn sps-btn--secondary-alert",visibleIndex:15,action:function(e){var t=a.getDefaultItem(o,r.getValue(l));r.data=t,s.enabled=!1,a.notifyCallback((0,c.getLocString)("presets.editor.itemRestoredToDefault"))}};s=new p.Action(u),r=this.showDetailPanelInPopup(o,n,e.rootElement,{actions:[s],title:null==i?void 0:i.description,removeOnCancel:null==i?void 0:i.isNew}),s.enabled=!p.Helpers.isTwoValueEquals(r.data,this.getDefaultItem(o,r.getValue(l))),r.onValueChanged.add(function(){return s.enabled=!0});var d=r.getQuestionByName(l);this.getDefaultItem(o,d.value)&&(d.readOnly=!0)},t.prototype.resetItem=function(e,t,o){var n=o.getValue("name"),i=this.getDefaultItem(t,n);if(i){var r=t.value,s=r.filter(function(e){return e.name==n})[0];Object.keys(s).forEach(function(e){s[e]=i[e]}),t.value=r}this.notifyCallback((0,c.getLocString)("presets.editor.itemRestoredToDefault"))},t.prototype.restoreItems=function(e,t,o){var n=t.value[o],i=e.value?u([],e.value,!0):[];i.push(n),e.value=i},t.prototype.getMatrix=function(e){return e.getQuestionByName(this.nameMatrix)},t.prototype.isItemsMatrix=function(e){return e===this.nameMatrix},t.prototype.needToSetActions=function(e){return this.isItemsMatrix(e)},t.prototype.onGetMatrixRowActionsCore=function(e,t,o){var n,i,r=this;if(this.needToSetActions(o.question.name)){var s=o.question,a=s.detailElements.filter(function(e){return e.visible}).length>0;if(this.hasIcon(o.question.name)){var l=this.getMatrixKeyColumnName(o.question),u=(null===(i=null===(n=s.value)||void 0===n?void 0:n.filter(function(e){return e[l]==o.row.getValue(l)})[0])||void 0===i?void 0:i.iconName)||this.defaultIcon;o.actions.push(this.createIconAction(u))}var p=this.createResetAction(e,o.row,function(t){r.resetItem(e,s,o.row),t.enabled=!1});o.actions.push(p),o.actions.push(this.createEditAction(e,t,s,o.row)),this.setupStandardActions(o.actions,s,o.row,a,s.name==this.nameMatrix),this.updateRowActions(s,o.row,o.actions)}},t.prototype.onMatrixRowDragOver=function(e,t,o){this.isItemsMatrix(o.fromMatrix.name)&&this.isItemsMatrix(o.toMatrix.name)&&(o.allow=!0)},t.prototype.onMatrixRowRemoving=function(e,t,o){if(this.isItemsMatrix(o.question.name)&&o.question.name!=this.nameMatrix){var n=o.question.value[o.rowIndex],i=this.getMatrix(e),r=i.value?u([],i.value,!0):[];r.push(n),i.value=r}},t.prototype.getExistingKeys=function(e,t){var o=e.getQuestionByName(this.nameItems).value||[],n=e.getQuestionByName(this.nameMatrix).value||[];return u(u([],o,!0),n,!0)},t.prototype.getDefaultValueForRow=function(e,t,o){return c.SurveyHelper.getNewName(this.getExistingKeys(e,o).map(function(e){return e[o]}).filter(function(e){return!!e}).map(function(e){return{name:e}}),o)},t.prototype.setDefaultValueForRow=function(e,t,o){var n=this.getMatrixKeyColumnName(t),i=this.getDefaultValueForRow(e,t,n);o.getQuestionByName(n).value=i,o.getQuestionByName("title").value=i},t.prototype.onMatrixRowAdded=function(e,t,o){var n,i;this.isItemsMatrix(o.question.name)&&(this.setDefaultValueForRow(e,o.question,o.row),this.editItem(e,t,o.question,o.row,{description:(0,c.getLocString)("presets.items.newItem")+" "+((null===(i=null===(n=o.question.data)||void 0===n?void 0:n.value)||void 0===i?void 0:i.title)||this.getPageShortTitle(e)),isNew:!0}))},t.prototype.onMatrixCellValueChanged=function(e,t,o){if(this.needToSetActions(o.question.name)){var n=o.question.renderedTable.rows.find(function(e){return e.row==o.row});if(!n)return;var i=n.cells[n.cells.length-1].item.value.actions;if(!i)return;this.updateRowActions(o.question,o.row,i)}},t.prototype.showDetailPanelInPopup=function(e,t,o,n){var i,r,s=this,a=e.visibleRows.findIndex(function(e){return e===t}),d=e.value[a],g=new p.SurveyModel({elements:e.toJSON().detailElements});if(g.fitToContainer=!1,g.showNavigationButtons=!1,g.data=d,g.css=m,g.enterKeyAction="loseFocus",g.questionErrorLocation="bottom",p.settings.showDialog){var h=null===(r=p.settings.showDialog)||void 0===r?void 0:r.call(p.settings,{componentName:"survey",data:{survey:g,model:g},onApply:function(){if(g.validate()){var t=u([],e.value,!0),o={};g.getAllQuestions().forEach(function(e){e.visible&&(o[e.name]=g.data[e.name])});var n=l(l({},e.value[a]),o);return t[a]=n,e.value=t,s.updateMatrixRowActions(e.survey,e),!0}return!1},onCancel:function(){return n.removeOnCancel&&e.removeRowUI(t),!0},cssClass:"sps-popup svc-property-editor svc-creator-popup",title:n.title||(0,c.getLocString)("presets.editor.edit"),displayMode:"popup"},o);if(g.getAllQuestions().filter(function(e){return!e.startWithNewLine}).length>0&&(h.width="100%"),h.footerToolbar){var f=h.footerToolbar.cssClasses;f.item="sps-btn",h.footerToolbar.cssClasses=f,h.footerToolbar.getActionById("apply").innerCss="sps-btn--primary-brand",h.footerToolbar.getActionById("cancel").innerCss="sps-btn--secondary-brand",n.actions&&(i=h.footerToolbar.actions).unshift.apply(i,n.actions)}g.getAllPanels().forEach(function(e){return e.visible=!e.visible}),g.getAllQuestions().forEach(function(e){e.visible=!e.visible,e.isRequired&&(e.requiredErrorText=(0,c.getLocString)("presets.editor.required"))})}return g},t}(d),h={root:"sps-list__container",itemsContainer:"sps-list",itemsContainerFiltering:"sps-list--filtering",emptyContainer:"sps-list__empty-container",emptyText:"sps-list__empty-text",filter:"sps-list__filter",filterIcon:"sps-list__filter-icon",filterInput:"sps-list__input",searchClearButtonIcon:"sps-list__filter-clear-button",loadingIndicator:"sps-list__loading-indicator",item:"sps-list__item",itemSelected:"sps-list__item--selected",itemGroup:"sps-list__item--group",itemGroupSelected:"sps-list__item--group-selected",itemWithIcon:"sps-list__item--with-icon",itemDisabled:"sps-list__item--disabled",itemFocused:"sps-list__item--focused",itemHovered:"sps-list__item--hovered",itemTextWrap:"sps-list__item-text--wrap",itemIcon:"sps-list__item-icon",itemMarkerIcon:"sps-list-item__marker-icon",itemSeparator:"sps-list__item-separator",itemBody:"sps-list__item-body"},f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.getDefaultItems=function(e){return(null==e?void 0:e.name)===this.nameCategories?this.defaultCategories:this.defaultItems},Object.defineProperty(t.prototype,"nameInnerMatrix",{get:function(){return"items"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameCategories",{get:function(){return this.fullPath+"_categories"},enumerable:!1,configurable:!0}),t.prototype.getMainElementNames=function(){return[this.nameCategories]},t.prototype.getMatrixKeyColumnName=function(e){return e.name===this.nameCategories?"category":"name"},Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.nameCategories]},enumerable:!1,configurable:!0}),t.prototype.setupCategoryActions=function(e,t,o,n,i){var r=this;i.forEach(function(t){"remove-row"==t.id&&(t.iconName="icon-delete_24x24",t.tooltip=(0,c.getLocString)("presets.items.delete"),t.innerCss="sps-action-button sps-action-button--icon sps-action-button--danger"),"reset-to-default"==t.id&&(t.action=function(){r.resetCategory(e,n)})})},t.prototype.ejectRowData=function(e,t,o){var n=e.value,i=e.visibleRows.indexOf(t),r=n[i];return o&&(n.splice(i,1),e.value=n),r},t.prototype.moveToCategory=function(e,t,o,n,i){void 0===i&&(i=!1);var r=this.ejectRowData(t,o,i),s=this.getQuestionCategories(e),a=s.value;return this.findOrCreateCategory(a,n)[this.nameInnerMatrix].push(r),s.value=a,s.visibleRows.find(function(e){return e.getValue("category")==n})},t.prototype.itemMenuCategoriesEnabled=function(e){return!0},t.prototype.setSubitemsToAction=function(e,t){e.setSubItems({items:t,cssClasses:h}),e.markerIconName="icon-chevronright-24x24"},t.prototype.getItemMenuActionsCore=function(e,t,o){var n=this,i=this.getQuestionCategories(e),r=i.value,s=[],a=t.name==this.nameMatrix,l=this.itemMenuCategoriesEnabled(e);if(a?l?s.push(new p.Action({id:"move-to",title:(0,c.getLocString)("presets.items.moveTo"),css:"sps-list__item--label",enabled:!1})):s.push(new p.Action({id:"restore-item",title:(0,c.getLocString)("presets.toolbox.addToToolbox"),action:function(){var e=t.visibleRows.indexOf(o);t.removeRow(e)}})):s.push(new p.Action({id:"remove-from",title:(0,c.getLocString)("presets.items.removeFrom").replace("{0}",t.title),action:function(){var e=t.visibleRows.indexOf(o);t.removeRow(e)}})),!l)return s;var u=r.filter(function(e){return e[n.nameInnerMatrix].filter(function(e){var t;return e.name==(null===(t=o.value)||void 0===t?void 0:t.name)}).length>0})[0],d=r.filter(function(e){return e.category!=(null==u?void 0:u.category)}).map(function(i){return new p.Action({id:"to-"+i.category,title:i.title,action:function(){n.moveToCategory(e,t,o,i.category,!0)}})});if(a)s.push.apply(s,d);else{s.push(new p.Action({id:"categories",title:(0,c.getLocString)("presets.items.categoriesLabel"),css:"sps-list__item--label",enabled:!1,needSeparator:!0}));var m=new p.Action({id:"move-to-categories",title:(0,c.getLocString)("presets.items.moveToCategory")});this.setSubitemsToAction(m,d),s.push(m)}return s.push(new p.Action({id:"move-to-new-category",title:(0,c.getLocString)("presets.items.moveToNewCategory"),needSeparator:a,action:function(){var r=n.moveToCategory(e,t,o,n.getDefaultValueForRow(e,t,"category"),!0);n.editItem(e,null,i,r,{description:(0,c.getLocString)("presets.items.newCategory")+" "+n.getPageShortTitle(e),isNew:!0})}})),s},t.prototype.getItemMenuActions=function(e,t,o){var n=this,i=this.getItemMenuActionsCore(e,t,o);return this.getDefaultItem(t,o.value.name)||i.push(new p.Action({id:"remove-custom-item",title:(0,c.getLocString)("presets.toolbox.deleteCustomItem"),css:"sps-list__item--alert",needSeparator:!0,action:function(){n.ejectRowData(t,o,!0)}})),i},t.prototype.replaceRemoveAction=function(e,t,o,n){var i=this,r=n.filter(function(e){return"remove-row"==e.id})[0];if(r){r.visible=!1;var s=(0,p.createDropdownActionModel)({id:"context-menu",iconName:"more-circle-24x24",tooltip:(0,c.getLocString)("presets.items.more"),location:"end",visibleIndex:20},{items:[],showPointer:!1,verticalPosition:"bottom",horizontalPosition:"center",cssClass:"sps-popup-menu sps-popup-menu--context",cssClasses:h,searchEnabled:!1});s.popupModel.onVisibilityChanged.add(function(n,r){if(r.isVisible){var s=r.model.contentComponentData.model;s.actions=i.getItemMenuActions(e,t,o),s.flushUpdates()}}),n.push(s)}},t.prototype.getQuestionCategories=function(e){return e.getQuestionByName(this.nameCategories)},t.prototype.isItemsMatrix=function(t){return e.prototype.isItemsMatrix.call(this,t)||t===this.nameInnerMatrix},t.prototype.resetCategory=function(e,t){var o,n=this,i=t.getValue("category"),r=null===(o=this.defaultCategories.filter(function(e){return e.category==i})[0])||void 0===o?void 0:o[this.nameInnerMatrix];if(r){var s=this.getQuestionCategories(e),a=this.getMatrix(e),l=a.value||[],u=s.value,p=u.filter(function(e){return e.category==i})[0];p[this.nameInnerMatrix].forEach(function(e){r.some(function(t){return t.name==e.name})||l.push(e)}),p[this.nameInnerMatrix]=r,u.filter(function(e){return e.category!=i}).forEach(function(e){r.forEach(function(t){d(e[n.nameInnerMatrix])})}),d(l),a.value=l,s.value=u,this.notifyCallback((0,c.getLocString)("presets.editor.categoryRestoredToDefault"))}function d(e){e&&r.forEach(function(t){var o=e.findIndex(function(e){return e.name==t.name});o>=0&&e.splice(o,1)})}},t.prototype.findOrCreateCategory=function(e,t){var o,n=e.filter(function(e){return e.category==t})[0];return n||((o={category:t||"general",title:t||"General"})[this.nameInnerMatrix]=[],n=o,e.push(n)),n},t.prototype.needToSetActions=function(e){return this.isItemsMatrix(e)||e===this.nameCategories},t.prototype.onGetMatrixRowActionsCore=function(t,o,n){e.prototype.onGetMatrixRowActionsCore.call(this,t,o,n),n.question.name===this.nameCategories&&this.setupCategoryActions(t,o,n.question,n.row,n.actions),this.isItemsMatrix(n.question.name)&&this.replaceRemoveAction(t,n.question,n.row,n.actions)},t.prototype.getExistingKeys=function(e,t){var o=e.getQuestionByName(this.nameCategories).value||[],n=e.getQuestionByName(this.nameMatrix).value||[];return u(u(u([],o,!0),o.map(function(e){return e.items}).flat().filter(function(e){return!!e}),!0),n,!0)},t.prototype.onMatrixRowRemoving=function(t,o,n){var i=this;if(e.prototype.onMatrixRowRemoving.call(this,t,o,n),n.question.name==this.nameCategories){var r=n.question.value[n.rowIndex][this.nameInnerMatrix];if(r){var s=this.getMatrix(t),a=s.value?s.value.concat(r):r;s.value=a}}if(n.question.name==this.nameMatrix){var l=n.question.value[n.rowIndex],u=this.defaultCategories.filter(function(e){return e[i.nameInnerMatrix].filter(function(e){return e.name==l.name}).length>0})[0];this.moveToCategory(t,n.question,n.row,null==u?void 0:u.category)}},t.prototype.onMatrixRowAdded=function(t,o,n){e.prototype.onMatrixRowAdded.call(this,t,o,n),n.question.name==this.nameCategories&&(this.setDefaultValueForRow(t,n.question,n.row),this.editItem(t,o,n.question,n.row,{description:(0,c.getLocString)("presets.items.newCategory")+" "+this.getPageShortTitle(t),isNew:!0}))},t}(g),y="toolboxCategories";p.FunctionFactory.Instance.register("validateToolboxJson",function(e){var t=e[0];return!t||!t.type||!!p.Serializer.createClass(t.type,t)});var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createItemsMatrixJSON=function(e,t){var o={type:"matrixdynamic",name:"items",title:"Toolbox",allowRowReorder:!0,cellType:"text",showHeader:!1,rowCount:0,allowAddRows:!1,addRowButtonLocation:"top",columns:[{name:"name",visible:!1},{name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"panel",name:"details",maxWidth:"30%",elements:[{type:"text",name:"name",title:(0,c.getLocString)("presets.toolbox.categoryName"),isUnique:!0,visible:!1,isRequired:!0},{type:"text",name:"title",title:(0,c.getLocString)("presets.toolbox.categoryTitle"),visible:!1},{type:"dropdown",name:"iconName",title:(0,c.getLocString)("presets.toolbox.iconName"),itemComponent:"svc-presets-icon-item",allowCustomChoices:!0,choices:this.iconList,visible:!1},{type:"text",name:"tooltip",title:(0,c.getLocString)("presets.toolbox.tooltip"),visible:!1}],visible:!1},{type:"presetjson",name:"json",startWithNewLine:!1,renderAs:"default-comment",title:(0,c.getLocString)("presets.toolbox.jsonObject"),validators:[{type:"expression",text:"JSON should be correct",expression:"validateToolboxJson({json})"}],visible:!1}]},n=l(l({},o),e);return t&&n.detailElements.push(this.createItemsMatrixJSON({allowAddRows:!0,addRowText:(0,c.getLocString)("presets.toolbox.addNewSubitem"),addRowButtonLocation:"bottom",name:this.nameSubitems,valueName:"subitems",titleLocation:"hidden",startWithNewLine:!1},!1)),n},t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.toolbox.title"),description:(0,c.getLocString)("presets.toolbox.description"),navigationTitle:(0,c.getLocString)("presets.toolbox.navigationTitle"),elements:[{type:"panel",name:this.mainPanelName,elements:[{type:"matrixdynamic",name:this.nameCategories,title:(0,c.getLocString)("presets.toolbox.toolbox"),visibleIf:this.getTextVisibleIf(this.nameCategoriesMode,"categories"),allowRowReorder:!0,allowAddRows:!0,addRowButtonLocation:"top",noRowsText:(0,c.getLocString)("presets.toolbox.noCategoriesText"),addRowText:(0,c.getLocString)("presets.toolbox.addCustomCategory"),showHeader:!1,columns:[{cellType:"text",name:"category",isUnique:!0,isRequired:!0,visible:!1},{cellType:"text",name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"category",title:(0,c.getLocString)("presets.toolbox.categoryName"),isRequired:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.toolbox.categoryTitle"),visible:!1},{type:"text",name:"tooltip",title:(0,c.getLocString)("presets.toolbox.tooltip"),visible:!1},this.createItemsMatrixJSON({name:this.nameInnerMatrix,titleLocation:"hidden",allowAddRows:!0,addRowButtonLocation:"bottom",noRowsText:(0,c.getLocString)("presets.toolbox.noItemsText"),addRowText:(0,c.getLocString)("presets.toolbox.addNewItem"),valueName:"items"},!0)]},this.createItemsMatrixJSON({name:this.nameItems,title:(0,c.getLocString)("presets.toolbox.toolbox"),addRowButtonLocation:"top",noRowsText:(0,c.getLocString)("presets.toolbox.noItemsText"),addRowText:(0,c.getLocString)("presets.toolbox.addCustomItem"),startWithNewLine:!1,visibleIf:this.getTextVisibleIf(this.nameCategoriesMode,"items")},!0),this.createItemsMatrixJSON({allowAddRows:!0,title:(0,c.getLocString)("presets.toolbox.hiddenItems"),noRowsText:(0,c.getLocString)("presets.toolbox.noHiddenItemsText"),descriptionLocation:"underInput",addRowButtonLocation:"bottom",addRowText:(0,c.getLocString)("presets.toolbox.addNewItem"),startWithNewLine:!1,name:this.nameMatrix},!0)]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"boolean",name:this.nameCategoriesMode,title:(0,c.getLocString)("presets.toolbox.enableGrouping"),titleLocation:"hidden",defaultValue:"categories",valueTrue:"categories",valueFalse:"items",clearIfInvisible:"onHidden",renderAs:"switch"},{type:"boolean",name:this.nameShowCategoryTitles,title:(0,c.getLocString)("presets.toolbox.showCategoryTitles"),defaultValue:!1,useTitleAsLabel:!0,visibleIf:this.getTextVisibleIf(this.nameCategoriesMode,"categories"),clearIfInvisible:"onHidden",renderAs:"switch"}]}]}},Object.defineProperty(t.prototype,"nameCategoriesMode",{get:function(){return this.fullPath+"_mode"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameItems",{get:function(){return this.fullPath+"_items"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameSubitems",{get:function(){return"subitems"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameShowCategoryTitles",{get:function(){return this.fullPath+"_showCategoryTitles"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.nameCategories,this.nameItems,this.nameMatrix,this.nameShowCategoryTitles,this.nameCategoriesMode]},enumerable:!1,configurable:!0}),t.prototype.hasIcon=function(e){return e!==this.nameCategories&&e!==this.nameSubitems},t.prototype.getDefaultItems=function(e){return(null==e?void 0:e.name)===this.nameCategories?this.defaultCategories:u(u([],this.defaultItems,!0),this.defaultSubitems,!0)},t.prototype.updateRowAction=function(t,o,n,i,r){e.prototype.updateRowAction.call(this,t,o,n,i,r),"show-detail"==r.id&&t.name!=this.nameCategories&&(r.visible=o.isDetailPanelShowing||!!n.subitems)},t.prototype.findItem=function(e,t,o){return o?e.map(function(e){return e.items.filter(function(e){return e.name==t})[0]}).filter(function(e){return!!e})[0]:e.filter(function(e){return e.name==t})[0]},t.prototype.moveToSubitems=function(e,t,o,n,i){void 0===i&&(i=!1);var r=this.ejectRowData(t,o,i),s=this.itemMenuCategoriesEnabled(e),a=s?this.getQuestionCategories(e):this.getQuestionItems(e),l=JSON.parse(JSON.stringify(a.value)),u=this.findItem(l,n,s);u&&(u.subitems||(u.subitems=[]),u.subitems.push(r)),a.value=l},t.prototype.getExistingKeys=function(t,o){var n=e.prototype.getExistingKeys.call(this,t,o),i=t.getQuestionByName(this.nameItems).value||[],r=u(u([],n,!0),i,!0),s=r.map(function(e){return e.subitems||[]}).flat();return u(u([],r,!0),s,!0)},t.prototype.itemMenuCategoriesEnabled=function(e){return"items"!==e.getValue(this.nameCategoriesMode)},t.prototype.getItemMenuActionsCore=function(t,o,n){var i=this,r=this.getQuestionCategories(t).value,s=e.prototype.getItemMenuActionsCore.call(this,t,o,n),a=this.itemMenuCategoriesEnabled(t),l=r.map(function(e){var r=new p.Action({id:"tosubitemcategory-"+e.category,title:e.title});if(e.items){var s=e.items.filter(function(e){var t;return e.name!=(null===(t=n.value)||void 0===t?void 0:t.name)}).map(function(e){return new p.Action({id:"tosubitem-"+e.name,title:e.title,action:function(){i.moveToSubitems(t,o,n,e.name,!0)}})});i.setSubitemsToAction(r,s)}return r}),u=a?l:l.map(function(e){return e.items}).flat(),d=o.visibleRows.indexOf(n),m=o.value[d];if(!m.subitems){o.name!=this.nameItems&&o.name!=this.nameInnerMatrix||(s.push(new p.Action({id:"subcategories",title:(0,c.getLocString)("presets.toolbox.subitems"),css:"sps-list__item--label",enabled:!1,needSeparator:!0})),s.push(new p.Action({id:"convert-to-subcategory",title:(0,c.getLocString)("presets.toolbox.enableSubitems"),action:function(){var e=a?i.getQuestionCategories(t):i.getQuestionItems(t),r=JSON.parse(JSON.stringify(e.value)),s=i.findItem(r,m.name,a);s&&(s.subitems=[]),e.value=r,i.updateMatrixRowActions(t,o),n.showDetailPanel()}})));var g=new p.Action({id:"move-as-subitem",title:(0,c.getLocString)("presets.toolbox.moveAsSubitem"),needSeparator:!0});this.setSubitemsToAction(g,u),s.push(g)}return s},t.prototype.getJsonValueCore=function(e,t,o){var n={},i=this.getJsonItemsDefinition(e);i&&(n.definition=i);var r=e.getValue(this.nameCategoriesMode),s=(t.toolbox,null==o?void 0:o.categories);if("categories"===r){var a=this.getCategoriesJson(e);Array.isArray(a)&&a.length>0&&!this.isCategoriesSame(a,s)&&(n.categories=this.getCategoriesJson(e))}else n.categories=[];return e.getValue(this.nameShowCategoryTitles)&&(n.showCategoryTitles=!0),Object.keys(n).length>0?n:void 0},t.prototype.getDefaultJsonValueCore=function(e){return{categories:e.toolbox.categories.map(function(e){return{category:e.name,title:e.title,items:e.items.map(function(e){return e.name})}})}},t.prototype.isCategoriesSame=function(e,t){if(e.length!==t.length)return!1;for(var o=0;o<e.length;o++){if(e[o].category!==t[o].category)return!1;var n=t[o].items,i=e[o].items;if(!p.Helpers.isTwoValueEquals(i,n))return!1}return!0},t.prototype.getCategoriesJson=function(e){var t=e.getValue(this.nameCategories);if(Array.isArray(t))return t.map(function(e){var t;return{category:e.category,items:null===(t=e.items)||void 0===t?void 0:t.map(function(e){return e.name})}})},t.prototype.cleanIfNotDiffers=function(e,t){if(!t)return!0;var o=!1;return Object.keys(l(l({},e),t)).forEach(function(n){p.Helpers.isTwoValueEquals(e[n],t[n])?"name"!==n&&delete e[n]:o=!0}),o},t.prototype.getJsonItemsDefinition=function(e){var t=this,o=(("items"===e.getValue(this.nameCategoriesMode)?e.getValue(this.nameItems):(e.getValue(this.nameCategories)||[]).map(function(e){return e.items}).flat())||[]).map(function(e){return l({},e)}),n=!1;return o.forEach(function(e){var o=t.defaultItems.filter(function(t){return t.name==e.name})[0];!e.subitems&&(null==o?void 0:o.subitems)&&(e.subitems=[]),t.cleanIfNotDiffers(e,o)&&(n=!0)}),n||p.Helpers.isTwoValueEquals(o.map(function(e){return e.name}),this.defaultItems.map(function(e){return e.name}))||(n=!0),n?o:void 0},t.prototype.isItemsMatrix=function(t){return t===this.nameItems||t===this.nameSubitems||e.prototype.isItemsMatrix.call(this,t)},t.prototype.onMatrixRowRemoving=function(t,o,n){n.question.name==this.nameMatrix&&"items"===t.getValue(this.nameCategoriesMode)&&this.restoreItems(this.getQuestionItems(t),n.question,n.rowIndex),e.prototype.onMatrixRowRemoving.call(this,t,o,n)},t.prototype.setupOnCurrentPageCore=function(e,t,o){t.toolbox.forceCompact=!o,t.toolbox.isCompact=!o,t.readOnly!=o&&t.setPropertyValue("readOnly",o),t.toolbox.items.forEach(function(e){return e.enabled=o}),t.toolbox.enabled=o},t.prototype.setupQuestionsCore=function(t,o){e.prototype.setupQuestionsCore.call(this,t,o),this.setupDefaults(t,o.creator)},t.prototype.setupDefaults=function(e,t){var o=this,n=t.toolbox.getDefaultItems([],!0,!0,!0),i=t.toolbox.getDefaultCategories();this.defaultItems=n.map(function(e){return o.createToolboxItemRow(e)}),this.defaultSubitems=[],n.forEach(function(e){var t;e.items&&(t=o.defaultSubitems).push.apply(t,e.items.map(function(e){return o.createToolboxItemRow(e)}))}),this.defaultCategories=i.map(function(e){return o.createToolboxCategoryRow(e)})},t.prototype.setupQuestionsValueCore=function(e,t,o){var n=this.defaultItems.reduce(function(e,t){return e[t.name]=t,e},{}),i=this.defaultCategories.reduce(function(e,t){return e[t.category]=t,e},{});this.defaultItems.filter(function(e){return e.subitems}).map(function(e){return e.subitems.forEach(function(e){return n[e.name]=e})});var r=((t=t||{}).definition||[]).map(function(e){return"string"==typeof e?{name:e}:e}),s=t.categories||[];r=0===r.length?this.defaultItems:r.map(function(e){return l(l({},n[e.name]||{}),e)});var a={};r.forEach(function(e){return a[e.name]=l(l({},e),{subitems:e.subitems&&e.subitems.map(function(e){return l(l({},n[e.name]||{}),e)})})}),(s=0===s.length?this.defaultCategories:s.map(function(e){return l(l(l({},i[e.category]),e),{items:e.items.map(function(e){return a[e]}).filter(function(e){return!!e})})})).filter(function(e){return e.items}).forEach(function(e){return e.items.forEach(function(e){return delete n[e.name]})});var u=this.defaultItems.filter(function(e){return n[e.name]});e.setValue(this.nameMatrix,u),e.setValue(this.nameCategories,s),this.updateItemsFromCategories(e),this.updateShowCategoriesTitlesElements(e)},t.prototype.onLocaleChangedCore=function(e,t,o){this.setupDefaults(e,o),this.setupQuestionsValueCore(e,t,o)},t.prototype.updateItemsFromCategories=function(e){this.getQuestionItems(e).value=this.getQuestionCategories(e).value.map(function(e){return u([],e.items||[],!0)}).flat()},t.prototype.updateCategoriesFromItems=function(e){var t=this,o=this.getQuestionCategories(e).value,n=u([],this.getQuestionItems(e).value,!0).reduce(function(e,t){return e[t.name]=t,e},{});o.forEach(function(e){e.items=e.items.map(function(e){var t=n[e.name];return delete n[e.name],t}).filter(function(e){return!!e})});var i=Object.keys(n);if(i.length>0){var r=this.findOrCreateCategory(o,"general");r.items=r.items.concat(i.map(function(e){return t.createToolboxItemRow(n[e])}))}this.getQuestionCategories(e).value=o},t.prototype.updateOnValueChangedCore=function(t,o){e.prototype.updateOnValueChangedCore.call(this,t,o),o===this.nameCategoriesMode&&("items"==t.getValue(this.nameCategoriesMode)?this.updateItemsFromCategories(t):this.updateCategoriesFromItems(t)),o===this.nameShowCategoryTitles&&this.updateShowCategoriesTitlesElements(t)},t.prototype.updateShowCategoriesTitlesElements=function(e){var t=this;e.getValue(this.nameShowCategoryTitles),this.getQuestionCategories(e).visibleRows.forEach(function(e){var o=e.getValue("category"),n=t.getCategoryTitle(o);n&&(e.getQuestionByName("category").readOnly=!0);var i=e.getQuestionByName("title");i.isEmpty()&&(i.value=n)})},t.prototype.getCategoryTitle=function(e){return c.editorLocalization.getString(y+"."+e)},t.prototype.setJsonLocalizationStringsCore=function(e,t){var o=this;function n(e,t){e&&e.visibleRows.forEach(function(e){d.updateModifiedText(t,e.getValue("title"),"qt."+e.getValue("name"))})}n(this.getQuestionItems(e),t);var i=this.getQuestionCategories(e);i.isVisible&&i.visibleRows.forEach(function(e){var i=e.getValue("category");e.getValue("title")!==o.getCategoryTitle(i)&&(t[y]||(t[y]={}),t[y][i]=e.getValue("title")),n(e.getQuestionByName("items"),t)})},t.prototype.getQuestionItems=function(e){return e.getQuestionByName(this.nameItems)},t.prototype.createToolboxItemRow=function(e){var t,o=this,n={name:e.name,title:e.title,iconName:e.iconName,tooltip:e.tooltip,json:e.json,subitems:null===(t=e.items)||void 0===t?void 0:t.map(function(e){return o.createToolboxItemRow(e)})};for(var i in n)void 0===n[i]&&delete n[i];return n},t.prototype.createToolboxCategoryRow=function(e){var t,o=this,n={category:e.name,title:e.title,items:null===(t=e.items)||void 0===t?void 0:t.map(function(e){return o.createToolboxItemRow(e)})};for(var i in n)void 0===n[i]&&delete n[i];return n},t}(f),b=function(e){function t(t,o,n){return e.call(this,t,null,o,null,null,null,n)||this}return a(t,e),t.prototype.getIsPropertyVisible=function(e){return!1!==e.visible},t}(c.SurveyQuestionProperties),x=["question","matrixdropdownbase","selectbase","panelbase","matrixdropdowncolumn@default","matrixdropdowncolumn@selectbase"],w=function(){function e(e,t){var o=this;this.className=e,this.currentJson=t,this.propertiesHash={},this.classes=new Array;var n={},i=this.createObj();this.obj=i,this.properties=new b(i,e,t);var r=this.properties.getAllVisiblePropertiesNames(!0),s={};p.Serializer.getPropertiesByObj(i).forEach(function(e){return s[e.name]=e}),r.forEach(function(e){var t=s[e];if(t){var i=o.getPropClassName(t);o.propertiesHash[e]=i,n[i]=!0}});for(var a=0;a<x.length;a++){var l=x[a];n[l]&&this.classes.push(l)}this.classes.indexOf(e)<0&&this.classes.push(e),this.propertyGridValue=this.createPropertyGrid(i,this.currentJson),this.propertyGridDefaultValue=this.createPropertyGrid(i)}return e.prototype.getObj=function(){return this.obj},e.prototype.createPropertyGrid=function(e,t){var o=new c.PropertyGridModel(void 0,void 0,t);return o.showOneCategoryInPropertyGrid=!0,o.obj=e,o},e.prototype.createObj=function(){if("survey"===this.className)return new p.SurveyModel;var e=this.className.indexOf("@");if(e<0)return p.Serializer.createClass(this.className);var t=this.className.substring(0,e),o=this.className.substring(e+1),n=p.Serializer.createClass(t);return n.cellType&&(n.cellType=o),n},e.prototype.getInitialJson=function(e){var t=e?this.propertyGridDefaultValue:this.propertyGridValue;return t.survey.toJSON().pages.filter(function(e){return e.name!=t.placeholderPageName}).map(function(e){var t;return{category:e.name,title:e.title,iconName:e.iconName,properties:null===(t=e.elements)||void 0===t?void 0:t.filter(function(e){return e.name&&-1==e.name.indexOf("overridingProperty")}).map(function(e){var t={name:e.name,title:e.title};return void 0!==e.description&&(t.description=e.description),t})}})},Object.defineProperty(e.prototype,"propertyGridDefault",{get:function(){return this.propertyGridDefaultValue},enumerable:!1,configurable:!0}),e.prototype.getPropertyClassName=function(e){return this.propertiesHash[e]},e.prototype.updateCurrentJson=function(e){this.updateCurrentJsonCore(this.currentJson.classes,e)},e.prototype.updateCurrentJsonCore=function(e,t){var o=this;Array.isArray(t)||(t=[]);var n=[];this.classes.forEach(function(i){o.updateCurrentJsonClass(e,t,i,n)})},e.prototype.updateCurrentJsonClass=function(e,t,o,n){var i=this,r=[],s=[];t.forEach(function(e){var t=e.items;if(Array.isArray(t)){var a=[];i.classes.forEach(function(e){return a.push(0)});for(var l={},u=0;u<t.length;u++){var p=i.propertiesHash[t[u]],c=i.classes.indexOf(p);if(!(c<0)){for(var d=1e4/Math.pow(10,c),m=0,g=0;g<=c;g++)a[g]>m&&(m=a[g]);var h=m+d;l[t[u]]=h,a[c]=h}}t.forEach(function(t){if(i.propertiesHash[t]===o){var a=e.name;a&&n.indexOf(e.name)<0&&(n.push(e.name),s.push({name:e.name,index:100*n.length,iconName:e.iconName}));var u={name:t,index:l[t]};a&&(u.tab=a),r.push(u)}})}}),e[o]={properties:r,tabs:s}},e.prototype.getPropClassName=function(e){for(var t=e.classInfo.name,o=1;o<x.length;o++){var n=x[o];if(t===n||p.Serializer.isDescendantOf(t,n))return this.getClassName(n)}return t===this.className?this.className:this.getClassName("question")},e.prototype.getClassName=function(e){var t=this.className.indexOf("@");if(t<0)return e;var o=this.className.substring(0,t);return o!==e&&"question"!==e||(e="default"),o+"@"+e},e}(),C=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.firstTimeLoading=!1,t}return a(t,e),Object.defineProperty(t.prototype,"nameInnerMatrix",{get:function(){return"properties"},enumerable:!1,configurable:!0}),t.prototype.createItemsMatrixJSON=function(e){var t={type:"matrixdynamic",allowRowReorder:!0,cellType:"text",showHeader:!1,rowCount:0,allowAddRows:!1,addRowButtonLocation:"top",addRowText:"Add Custom Item",noRowsText:"There are no items",columns:[{name:"name",visible:!1},{name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"name",title:(0,c.getLocString)("presets.propertyGrid.name"),isUnique:!0,isRequired:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.propertyGrid.titleField"),isUnique:!0,isRequired:!0,visible:!1},{type:"comment",name:"description",title:(0,c.getLocString)("presets.propertyGrid.descriptionField"),visible:!1}]};return l(l({},t),e)},t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.propertyGrid.title"),navigationTitle:(0,c.getLocString)("presets.propertyGrid.navigationTitle"),description:(0,c.getLocString)("presets.propertyGrid.description"),elements:[{type:"dropdown",name:this.nameSelector,allowClear:!1,clearIfInvisible:"onHidden",title:(0,c.getLocString)("presets.propertyGrid.selectElement")},{type:"panel",name:this.mainPanelName,visibleIf:this.getNotEmptyVisibleIf(this.nameSelector),elements:[{type:"matrixdynamic",name:this.nameCategories,title:(0,c.getLocString)("presets.propertyGrid.propertyGrid"),allowRowReorder:!0,addRowButtonLocation:"top",rowCount:0,allowAddRows:!0,noRowsText:(0,c.getLocString)("presets.propertyGrid.noCategoriesText"),addRowText:(0,c.getLocString)("presets.propertyGrid.addCustomCategory"),showHeader:!1,columns:[{cellType:"text",name:"category",isUnique:!0,isRequired:!0,visible:!1},{type:"boolean",name:"isDefault",visible:!1},{cellType:"text",name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"category",title:(0,c.getLocString)("presets.propertyGrid.categoryName"),isRequired:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.propertyGrid.categoryTitle"),visible:!1},{type:"dropdown",name:"iconName",title:(0,c.getLocString)("presets.propertyGrid.iconName"),itemComponent:"svc-presets-icon-item",allowCustomChoices:!0,choices:this.iconList,visible:!1},this.createItemsMatrixJSON({name:this.nameInnerMatrix,noRowsText:(0,c.getLocString)("presets.propertyGrid.noItemsText"),titleLocation:"hidden"})]},this.createItemsMatrixJSON({title:(0,c.getLocString)("presets.propertyGrid.hiddenItems"),name:this.nameMatrix,noRowsText:(0,c.getLocString)("presets.propertyGrid.noHiddenItemsText"),descriptionLocation:"underInput",startWithNewLine:!1})]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"html",html:" "}]}]}},t.prototype.propertyGridSetObj=function(e){var t,o=null===(t=this.propertyGrid.survey.currentPage)||void 0===t?void 0:t.name;this.propertyGrid.setObj(e),this.propertyGrid.survey.currentPage=this.propertyGrid.survey.getPageByName(o)},t.prototype.hasIcon=function(e){return e==this.nameCategories},t.prototype.restoreValuesFromDefault=function(e){this.isModified=!1,this.currentJson=this.copyJson(c.defaultPropertyGridDefinition),this.updateMatrices(e)},t.prototype.getJsonValueCore=function(e,t,o){if(this.isModified)return{definition:this.currentJson}},t.prototype.setupPageQuestions=function(e,t){this.getSelector(e).choices=this.getSelectorChoices(t);var o=c.settings.propertyGrid.enableSearch;c.settings.propertyGrid.enableSearch=!1,c.settings.propertyGrid.enableSearch=o},t.prototype.setupQuestionsCore=function(t,o){this.propertyGrid=o.creator.designerPropertyGrid,e.prototype.setupQuestionsCore.call(this,t,o),this.setupPageQuestions(t,o.creator)},t.prototype.setJSONForTitlesAndDescriptions=function(e,t){var o=this.localeStrings[t];Object.keys(o).length>0&&(e[t]=o)},t.prototype.onLocaleChangedCore=function(e,t,o){this.setupPageQuestions(e,o),this.setupQuestionsValueCore(e,t,o)},t.prototype.setJsonLocalizationStringsCore=function(e,t){this.setJSONForTitlesAndDescriptions(t,"pe"),this.setJSONForTitlesAndDescriptions(t,"pehelp")},t.prototype.updateJsonLocalizationStringsCore=function(e){this.localeStrings={pe:e.pe||{},pehelp:e.pehelp||{}}},t.prototype.setupOnCurrentPageCore=function(e,t,o){var n;t.setSidebarEnabled(o),this.propertyGridSetObj(o?null===(n=this.currentProperties)||void 0===n?void 0:n.getObj():null)},t.prototype.updateOnValueChangedCore=function(t,o){var n,i=this;if(e.prototype.updateOnValueChangedCore.call(this,t,o),o==this.nameCategories){this.firstTimeLoading||(this.isModified=!0);var r=this.getQuestionCategories(t);r.isVisible&&(null===(n=r.value)||void 0===n||n.forEach(function(e){var t,o=e.category,n=e.title;e.title!==c.editorLocalization.getString("pe.tabs."+o)&&(i.ensureLocalizationPath("pe.tabs"),i.localeStrings.pe.tabs[o]=n),null===(t=e.properties)||void 0===t||t.forEach(function(e){e.title!==c.editorLocalization.getString("pe."+e.name)&&i.changePropTitleAndDescription("pe",e.name,e.title),e.description!==c.editorLocalization.getString("pehelp."+e.name)&&i.changePropTitleAndDescription("pehelp",e.name,e.description)})})),this.firstTimeLoading||this.updateCurrentJson(t)}if(o===this.nameSelector){this.firstTimeLoading=!0,this.currentProperties&&(this.currentProperties=void 0);var s=this.getSelector(t);this.currentClassName=s.value,this.updateMatrices(t),this.firstTimeLoading=!1}},t.prototype.updateMatrices=function(e){if(this.currentClassName){this.currentProperties=new w(this.currentClassName,this.currentJson),this.setupDefaults(e);var t=this.currentProperties.getInitialJson(!1);e.setValue(this.nameCategories,t);var o=this.getCurrentlyHiddenItems(t);e.setValue(this.nameMatrix,o),this.propertyGridSetObj(this.currentProperties.getObj())}},t.prototype.getCurrentlyHiddenItems=function(e){var t=["progressBarInheritWidthFrom"],o={};return this.defaultItems.forEach(function(e){return o[e.name]=e}),e.filter(function(e){return e.properties}).forEach(function(e){return e.properties.forEach(function(e){return delete o[e.name]})}),Object.keys(o).map(function(e){return o[e]}).filter(function(e){return-1==t.indexOf(e.name)})},t.prototype.setupDefaults=function(e){var t,o=this,n=(null===(t=this.currentProperties)||void 0===t?void 0:t.getInitialJson(!0))||[];this.defaultCategories=u([],n,!0),this.defaultItems=[],n.forEach(function(e){var t;return(t=o.defaultItems).push.apply(t,e.properties)})},t.prototype.setupQuestionsValueCore=function(e,t,o){this.getSelector(e).value="survey";var n=o.getPropertyGridDefinition();this.isModified=!!(null==t?void 0:t.definition)||n&&JSON.stringify(n)!==JSON.stringify(c.defaultPropertyGridDefinition),this.currentJson=(null==t?void 0:t.definition)||this.copyJson(n||c.defaultPropertyGridDefinition),this.currentJson.autoGenerateProperties=!1,this.updateOnValueChangedCore(e,this.nameSelector)},t.prototype.getSelector=function(e){return e.getQuestionByName(this.nameSelector)},Object.defineProperty(t.prototype,"nameSelector",{get:function(){return this.fullPath+"_selector"},enumerable:!1,configurable:!0}),t.prototype.getSelectorChoices=function(e){var t=this,o=["survey","page"];e.toolbox.getDefaultItems([],!1,!0,!0).forEach(function(e){o.push(e.id)});var n=[];o.forEach(function(e){return n.push(new p.ItemValue(e,t.getSelectorItemTitle(e)))});var i="matrixdropdowncolumn@";for(var r in n.push(new p.ItemValue(i+"default",this.getColumnItemTitle(""))),p.matrixDropdownColumnTypes)n.push(new p.ItemValue(i+r,this.getColumnItemTitle(r)));return n},t.prototype.getSelectorItemTitle=function(e){return"survey"===e?c.editorLocalization.getString("ed.surveyTypeName"):"page"===e?c.editorLocalization.getString("ed.pageTypeName"):c.editorLocalization.getString("qt."+e)},t.prototype.getColumnItemTitle=function(e){return c.editorLocalization.getString("ed.columnTypeName")+": "+(e?this.getSelectorItemTitle(e):"default")},t.prototype.updateCurrentJson=function(e){this.currentProperties&&this.currentProperties.updateCurrentJson(this.getPropertiesArray(e))},t.prototype.getPropertiesArray=function(e){var t=this.getQuestionCategories(e).value;return null==t?void 0:t.map(function(e){var t;return{name:e.category,items:null===(t=e.properties)||void 0===t?void 0:t.map(function(e){return e.name}),iconName:e.iconName}})},t.prototype.changePropTitleAndDescription=function(e,t,o){this.ensureLocalizationPath(e);var n=this.localeStrings[e],i=this.currentProperties.getPropertyClassName(t);i&&(n[i]||(n[i]={}),n[i][t]=o)},t.prototype.ensureLocalizationPath=function(e){this.localeStrings||(this.localeStrings={});for(var t=e.split("."),o=this.localeStrings,n=0;n<t.length;n++){var i=t[n];o[i]||(o[i]={}),o=o[i]}},t}(f),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createItemsMatrixJSON=function(e){var t={type:"matrixdynamic",name:"items",allowRowReorder:!0,cellType:"text",showHeader:!1,rowCount:0,allowAddRows:!1,addRowButtonLocation:"top",addRowText:"Add Custom Item",noRowsText:"There are no items",columns:[{name:"name",visible:!1},{name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"name",title:(0,c.getLocString)("presets.tabs.name"),isUnique:!0,isRequired:!0,readOnly:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.tabs.titleField"),visible:!1},{type:"dropdown",name:"iconName",title:(0,c.getLocString)("presets.tabs.iconName"),itemComponent:"svc-presets-icon-item",allowCustomChoices:!0,choices:this.iconList,visible:!1}]};return l(l({},t),e)},t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.tabs.title"),description:(0,c.getLocString)("presets.tabs.description"),navigationTitle:(0,c.getLocString)("presets.tabs.navigationTitle"),elements:[{type:"panel",name:this.mainPanelName,elements:[this.createItemsMatrixJSON({title:(0,c.getLocString)("presets.tabs.items"),noRowsText:(0,c.getLocString)("presets.tabs.noItemsText"),name:this.nameItems}),this.createItemsMatrixJSON({startWithNewLine:!1,title:(0,c.getLocString)("presets.tabs.hiddenItems"),noRowsText:(0,c.getLocString)("presets.tabs.noHiddenItemsText"),name:this.nameMatrix,descriptionLocation:"underInput"})]},{type:"panel",name:"panel_tabs_controls",elements:[{type:"dropdown",name:this.nameActiveTab,allowClear:!1,title:(0,c.getLocString)("presets.tabs.defaultTab")}]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"html",html:" "}]}]}},Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.nameItems,this.nameActiveTab]},enumerable:!1,configurable:!0}),t.prototype.filterTabs=function(e){return e.filter(function(e){return"presets"!=e.name})},t.prototype.hasIcon=function(e){return!0},t.prototype.getJsonValueCore=function(e,t,o){var n=e.getQuestionByName(this.nameItems).value;if(Array.isArray(n)){var i=this.filterTabs((null==o?void 0:o.items)||t.getTabs()),r=this.filterTabs(t.getAvailableTabs()),s=n.map(function(e){return{name:e.name,iconName:e.iconName}});s.forEach(function(e){var t;e.iconName&&e.iconName!=(null===(t=r.filter(function(t){return t.name==e.name})[0])||void 0===t?void 0:t.iconName)||delete e.iconName}),p.Helpers.isArraysEqual(s,i,!1)&&(s=void 0);var a=e.getValue(this.nameActiveTab);if(s||a!==((null==o?void 0:o.activeTab)||t.activeTab)||(a=void 0),s||a){var l={};return s&&(l.items=s),a&&(l.activeTab=a),l}}},t.prototype.getDefaultJsonValueCore=function(e){return{activeTab:e.activeTab,items:this.filterTabs(e.getTabs()).map(function(e){return{name:e.name}})}},t.prototype.getQuestionItems=function(e){return e.getQuestionByName(this.nameItems)},t.prototype.onMatrixRowRemoving=function(t,o,n){n.question.name===this.nameMatrix&&this.restoreItems(this.getQuestionItems(t),n.question,n.rowIndex),e.prototype.onMatrixRowRemoving.call(this,t,o,n)},t.prototype.isItemsMatrix=function(t){return t===this.nameItems||e.prototype.isItemsMatrix.call(this,t)},t.prototype.setJsonLocalizationStringsCore=function(e,t){this.getQuestionItems(e).visibleRows.forEach(function(e){d.updateModifiedText(t,e.getValue("title"),"tabs."+e.getValue("name"))})},t.prototype.setupQuestionsCore=function(e,t){this.setupPageQuestions(e,t.creator)},t.prototype.getAllTabs=function(e){return this.filterTabs(e.getAvailableTabs().map(function(e){return{name:e.name,title:c.editorLocalization.getString("tabs."+e.name),iconName:e.iconName}}))},t.prototype.setupOnCurrentPageCore=function(e,t,o){t.tabs.forEach(function(e){return e.enabled=o})},t.prototype.setupQuestionsValueCore=function(e,t,o){var n=((t=t||{}).items||[]).map(function(e){return"string"==typeof e?{name:e}:e}),i=o.initialTabs(),r=this.getAllTabs(o),s=r.filter(function(e){return i.indexOf(e.name)>=0});if(0===n.length)n=s;else for(var a=function(e){var t=s.filter(function(t){return t.name==n[e].name})[0];t&&(n[e]=l(l({},t),n[e]))},u=0;u<n.length;u++)a(u);var c=n.map(function(e){return e.name}),d=r.filter(function(e){return c.indexOf(e.name)<0});e.setValue(this.nameItems,n),e.setValue(this.nameMatrix,d),e.setValue(this.nameActiveTab,t.activeTab||o.activeTab),e.getQuestionByName(this.nameActiveTab).choices=n.map(function(e){return new p.ItemValue(e.name,e.title)})},t.prototype.onLocaleChangedCore=function(e,t,o){this.setupPageQuestions(e,o),this.setupQuestionsValueCore(e,t,o)},t.prototype.setupPageQuestions=function(e,t){this.defaultItems=this.getAllTabs(t),e.getQuestionByName(this.nameActiveTab).choices=this.defaultItems.map(function(e){return new p.ItemValue(e.name,e.title)})},t.prototype.updateOnValueChangedCore=function(t,o){if(e.prototype.updateOnValueChangedCore.call(this,t,o),o===this.nameItems){var n=t.getValue(o)||[],i=t.getQuestionByName(this.nameActiveTab);i.choices=n.map(function(e){return new p.ItemValue(e.name,e.title)}),i.selectedItem||i.selectItem(i.choices[0])}},Object.defineProperty(t.prototype,"nameActiveTab",{get:function(){return this.path+"_activeTab"},enumerable:!1,configurable:!0}),t}(g);p.FunctionFactory.Instance.register("searchItem",function(e){var t=this.survey.getQuestionByName(e[0]),o=e[1],n=e[2];if(!n)return!0;var i=t.choices.filter(function(e){return e.value==o})[0];return!i||-1!=i.text.toUpperCase().indexOf(n.toUpperCase())});var S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.languages.title"),description:(0,c.getLocString)("presets.languages.description"),navigationTitle:(0,c.getLocString)("presets.languages.navigationTitle"),elements:[{type:"dropdown",title:(0,c.getLocString)("presets.languages.creatorUI"),placeholder:c.editorLocalization.getLocaleName(""),name:this.creatorLocaleName,searchEnabled:!0,choices:this.getCreatorLocales()},{type:"panel",title:(0,c.getLocString)("presets.languages.surveyLanguages"),elements:[{type:"text",name:this.searchLocalesName,placeholder:(0,c.getLocString)("presets.languages.searchPlaceholder"),titleLocation:"hidden",textUpdateMode:"onTyping"},{type:"checkbox",name:this.surveyLocalesName,titleLocation:"hidden",minSelectedChoices:1,colCount:3,showSelectAllItem:!0,choices:this.getSurveyLocales(),choicesVisibleIf:"searchItem('"+this.surveyLocalesName+"', {item}, {"+this.searchLocalesName+"}"}]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"boolean",name:this.surveyUseEnglishNames,title:(0,c.getLocString)("presets.languages.translateToEnglish"),titleLocation:"hidden",renderAs:"switch"}]}]}},t.prototype.getMainElementNames=function(){return[this.surveyLocalesName]},t.prototype.getCustomQuestionCssSuffix=function(e){return e.name===this.searchLocalesName?"search":""},t.prototype.getJsonValueCore=function(e,t,o){var n=e.getValue(this.creatorLocaleName),i=!0===e.getValue(this.surveyUseEnglishNames),r=e.getQuestionByName(this.surveyLocalesName);if(n||!r.isAllSelected||i){var s={};return n&&(s.creator=n),i&&(s.useEnglishNames=!0),!r.isAllSelected&&Array.isArray(r.value)&&(s.surveyLocales=[],r.value.forEach(function(e){return s.surveyLocales.push(e)})),s}},t.prototype.setupQuestionsValueCore=function(e,t,o){t=t||{},e.setValue(this.creatorLocaleName,t.creator),e.setValue(this.surveyUseEnglishNames,!0===t.showInEnglish),this.updateLocaleNames(e);var n=e.getQuestionByName(this.surveyLocalesName),i=t.surveyLocales;Array.isArray(i)&&i.length>0?n.valule=i:n.selectAll()},t.prototype.updateOnValueChangedCore=function(e,t){t===this.surveyUseEnglishNames&&this.updateLocaleNames(e)},Object.defineProperty(t.prototype,"creatorLocaleName",{get:function(){return this.path+"_creator"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surveyLocalesName",{get:function(){return this.path+"_surveyLocales"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"searchLocalesName",{get:function(){return this.path+"_searchLocales"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surveyUseEnglishNames",{get:function(){return this.path+"_surveyUseEnglishNames"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.creatorLocaleName,this.surveyLocalesName,this.surveyUseEnglishNames]},enumerable:!1,configurable:!0}),t.prototype.getIsShowInEnglishSelected=function(e){return!0===e.getValue(this.surveyUseEnglishNames)},t.prototype.getCreatorLocales=function(){return this.getLocaleItemValues(c.editorLocalization.getLocales(),!1)},t.prototype.getSurveyLocales=function(){return this.getLocaleItemValues(p.surveyLocalization.getLocales(!0),!0)},t.prototype.getLocaleItemValues=function(e,t){var o=[];return e.forEach(function(e){if(e&&"en"!==e){var t=c.editorLocalization.getLocaleName(e);t&&t!==e&&o.push(new p.ItemValue(e,t))}}),t&&o.unshift(new p.ItemValue("en",c.editorLocalization.getLocaleName("en"))),o},t.prototype.updateLocaleNames=function(e){var t=this.getIsShowInEnglishSelected(e),o=e.getQuestionByName(this.surveyLocalesName);o.choices.forEach(function(e){e.text=c.editorLocalization.getLocaleName(e.value,null,t)}),o.choicesOrder="none",o.choicesOrder="asc"},t}(d),T=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.optionsList=[],t}return a(t,e),t.prototype.createElements=function(){return[{type:"panel",name:"designer",state:"expanded",elements:[{name:"pageEditMode",type:"dropdown",choices:[{value:"standard",text:"Standard"},{value:"single",text:"Single"},{value:"bypage",text:"By Page"}]},{type:"panel",name:"designerHeader",elements:[{name:"showSurveyHeader",type:"boolean"},{name:"showHeaderInEmptySurvey",type:"boolean"}]},{type:"panel",name:"designerTitles",elements:[{name:"useElementTitles",type:"boolean"}]},{type:"panel",name:"designerZoomDrag",elements:[{name:"allowDragPages",type:"boolean"},{name:"collapseOnDrag",type:"boolean"},{name:"allowZoom",type:"boolean"}]},{name:"expandCollapseButtonVisibility",type:"dropdown",choices:[{value:"never",text:"Never"},{value:"onhover",text:"On Hover"},{value:"always",text:"Always"}]},{type:"panel",name:"designerExpandCollapse",elements:[{name:"collapseQuestions",type:"boolean"},{name:"collapsePanels",type:"boolean"},{name:"collapsePages",type:"boolean"}]},{name:"maxRows",type:"text",inputType:"number"},{name:"maxColumns",type:"text",inputType:"number"},{type:"panel",name:"designerChoices",elements:[{name:"inplaceEditChoiceValues",type:"boolean"}]},{name:"minChoices",type:"text",inputType:"number"},{name:"maxChoices",type:"text",inputType:"number"},{name:"maxVisibleChoices",type:"text",inputType:"number"},{name:"maxRateValues",type:"text",inputType:"number"},{name:"forbiddenNestedElements",type:"text"},{name:"maxPanelNestingLevel",type:"text",inputType:"number"}]},{type:"panel",name:"preview",state:"expanded",elements:[{type:"panel",name:"previewSimulateDevice",elements:[{name:"previewAllowSimulateDevice",type:"boolean"}]},{name:"previewDevice",type:"dropdown",choices:[{value:"desktop",text:"Desktop"},{value:"iPhoneSE",text:"iPhone SE"},{value:"iPhone15",text:"iPhone 15"},{value:"iPhone15Plus",text:"iPhone 15 Plus"},{value:"iPad",text:"iPad"},{value:"iPadMini",text:"iPad Mini"},{value:"androidPhone",text:"Android Phone"},{value:"androidTablet",text:"Android Tablet"},{value:"microsoftSurface",text:"Microsoft Surface"}]},{name:"previewOrientation",type:"dropdown",choices:[{value:"landscape",text:"Landscape"},{value:"portrait",text:"Portrait"}]},{type:"panel",name:"previewAllowSelect",elements:[{name:"previewAllowSelectLanguage",type:"boolean"},{name:"previewAllowSelectPage",type:"boolean"}]},{name:"previewAllowHiddenElements",type:"boolean"}]},{type:"panel",name:"logic",state:"expanded",elements:[{name:"logicAllowTextEditExpressions",type:"boolean"},{name:"logicMaxItemsInCondition",type:"text",inputType:"number"}]},{type:"panel",name:"translation",state:"expanded",elements:[{name:"clearTranslationsOnSourceTextChange",type:"boolean"}]}]},t.prototype.addPathToName=function(e){return this.fullPath+"_"+e},t.prototype.patchElements=function(e){var t=this;return e.map(function(e){return"panel"===e.type?("expanded"==e.state&&(e.title=c.editorLocalization.getString("tabs."+e.name)),t.patchElements(e.elements)):(t.optionsList.push(e.name),e.title=e.name),"boolean"===e.type&&(e.renderAs="checkbox",e.useTitleAsLabel=!0),"dropdown"===e.type&&(e.searchEnabled=!1),e.name=t.addPathToName(e.name),e})},t.prototype.createMainPageCore=function(){return this.optionsList=[],{title:(0,c.getLocString)("presets.options.title"),description:(0,c.getLocString)("presets.options.description"),navigationTitle:(0,c.getLocString)("presets.options.navigationTitle"),elements:this.patchElements(this.createElements())}},t.prototype.getDefaultJsonValueCore=function(e){return this.optionsList.reduce(function(t,o){return t[o]=e[o],t},{})},t.prototype.getJsonValueCore=function(e,t,o){var n=this,i={};if(this.optionsList.forEach(function(t){var o=e.getQuestionByName(n.addPathToName(t));o&&(i[t]=o.value)}),!p.Helpers.isTwoValueEquals(i,o))return i},t.prototype.setupQuestionsValueCore=function(e,t,o){var n=this;this.optionsList.forEach(function(i){return e.getQuestionByName(n.addPathToName(i)).value=t?t[i]:o[i]})},Object.defineProperty(t.prototype,"questionNames",{get:function(){var e=this;return this.optionsList.map(function(t){return e.addPathToName(t)})},enumerable:!1,configurable:!0}),t.prototype.onGetPanelTitleActions=function(e,t,o){var n=this.fullPath+"_";o.panel.name.substring(0,n.length)===n&&(o.actions=[{id:"collapse",css:"sv-action-bar-item--collapse",locTooltipName:new p.ComputedUpdater(function(){return o.panel.isCollapsed?"ed.expandTooltip":"ed.collapseTooltip"}),iconName:new p.ComputedUpdater(function(){return o.panel.isCollapsed?"icon-expandpanel-16x16":"icon-collapsepanel-16x16"}),iconSize:"auto",action:function(){o.panel.isCollapsed?o.panel.expand():o.panel.collapse()}}])},t}(d),I={languages:{title:"Languages",navigationTitle:"Languages",description:"Select the language of the Survey Creator UI and target\nlanguages for the survey being configured.",creatorUI:"Survey Creator UI language",surveyLanguages:"Survey languages",searchPlaceholder:"Type to search...",translateToEnglish:"Translate language names to English"},tabs:{title:"Configure tabs",navigationTitle:"Tabs",description:"Select the tabs you want to show, reorder them, change their titles,\nand choose the tab that will be active by default.",items:"Visible tabs",hiddenItems:"Hidden tabs",defaultTab:"Default tab",noItemsText:"Drag tabs here to show them",noHiddenItemsText:"Drag tabs here to hide them",name:"Name",titleField:"Title",iconName:"Icon name"},toolbox:{title:"Set up the Toolbox",navigationTitle:"Toolbox",description:"Select the toolbox items you want to show, group them into categories, \nrename them, and change their order if required.",toolbox:"Toolbox",categories:"Categories",noCategoriesText:"No categories",noItemsText:"Drag items here to show them",noHiddenItemsText:"Drag items here to hide them",hiddenItems:"Hidden toolbox items",enableGrouping:"Enable grouping",showCategoryTitles:"Show category titles",categoryName:"Name",categoryTitle:"Title",tooltip:"Tooltip",iconName:"Icon name",jsonObject:"JSON object to apply when users select this toolbox item",subitems:"Subitems",enableSubitems:"Enable subitems for this question",moveAsSubitem:"Move as a subitem to...",addToToolbox:"Add to Toolbox",deleteCustomItem:"Delete Custom Item",addCustomCategory:"New Category",addCustomItem:"New Item",addNewItem:"Add a new item",addNewSubitem:"Add a new subitem",noRowsText:"There are no items",newItem:"New item in"},propertyGrid:{title:"Customize the Property Grid",navigationTitle:"Property Grid",description:"Hide, rename, reorder, or change property grouping in the Property Grid.",selectElement:"Select a survey element to customize",propertyGrid:"Property Grid",noCategoriesText:"No categories",noItemsText:"Drag properties here to show them",noHiddenItemsText:"Drag properties here to hide them",hiddenItems:"Hidden properties",categoryName:"Name",categoryTitle:"Title",iconName:"Icon name",name:"Name",titleField:"Title",descriptionField:"Helper text",addCustomCategory:"New Category"},options:{title:"Options",navigationTitle:"Options",description:"Detailed configuration settings for Survey Creator."},items:{addNewItem:"Add a new item",addNewSubitem:"Add a new subitem",newItem:"New item in",addCustomCategory:"New Category",newCategory:"New category in",moveToCategory:"Move to category...",moveToNewCategory:"Move to new category",categoriesLabel:"Categories",moveTo:"Move To...",removeFrom:"Remove from {0}",more:"More",restoreToDefault:"Restore",edit:"Edit",expand:"Expand",collapse:"Collapse",remove:"Remove",add:"Add",delete:"Delete"},editor:{title:"Creator Presets",presetJson:"Preset JSON:",copy:"Copy",download:"Download",load:"Load",saveExit:"Save & Exit",back:"Back",resetToDefault:"Reset",resetToDefaults:"All settings restored to default",resoredToDefault:"resored to default",itemRestoredToDefault:"Item restored to default",categoryRestoredToDefault:"Category restored to default",edit:"Edit",completeText:"Save & Exit",pagePrevText:"Back",required:"Please enter a value."},plugin:{buttonTitle:"UI Configuration Manager",buttonDescription:"Configure the Toolbox, Tabs, Property Grid, and other UI elements, and save the setup as a reusable preset.",presetsTab:"Presets",creatorPresets:"Creator Presets",save:"Save & Exit",file:"File",import:"Import",export:"Export",edit:"Edit",resetLanguages:"Reset Languages",resetAll:"Reset all changes",resetConfirmation:"Do you really want to reset the settings?",resetConfirmationOk:"Yes, reset the settings",resetToDefaults:"Reset {0}",defaultSettings:"Default Settings",basic:"Basic",advanced:"Advanced",expert:"Expert"}};(0,c.getLocaleStrings)("en").presets=I;var N,L=function(e){function t(){var t=e.call(this)||this;return t.cssClasses={root:"presets-navigation-bar",defaultSizeMode:"",smallSizeMode:"",item:"presets-navigation-bar__item presets-navigation-bar-item",itemWithTitle:"",itemAsIcon:"",itemActive:"presets-navigation-bar-item--active",itemPressed:"presets-navigation-bar-item--pressed",itemIcon:"",itemTitle:"",itemTitleWithIcon:""},t}return a(t,e),t}(p.ActionContainer),P=function(e){function t(t,o,n){var i=e.call(this)||this;return i.creatorValue=o,i.defaultJsonValue=n,i.applying=!1,c.editorLocalization.presetStrings=void 0,i.presetValue=new c.CreatorPreset(t),i.creatorValue||(i.creatorValue=i.createCreator({})),i.modelValue=i.createModel(),i.resultModelValue=i.createResultModel(),i.locTitle=new p.LocalizableString(void 0,!1),i.locTitle.text=(0,c.getLocString)("presets.editor.title"),i.navigationBarValue=new L,i.preset.setJson(i.getJsonFromSurveyModel()),i}return a(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposeModel()},t.prototype.disposeModel=function(){this.resetAllPages(),this.model.editablePresets.forEach(function(e){return e.dispose()}),this.model.dispose()},Object.defineProperty(t.prototype,"preset",{get:function(){return this.presetValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"creator",{get:function(){return this.creatorValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultModel",{get:function(){return this.upldateResultJson(),this.resultModelValue},enumerable:!1,configurable:!0}),t.prototype.getLocale=function(){return c.editorLocalization.currentLocale||"en"},Object.defineProperty(t.prototype,"json",{get:function(){return this.preset.getJson()},set:function(e){this.preset.setJson(e),this.updateDataFromJson(this.modelValue),this.upldateResultJson()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jsonText",{get:function(){return JSON.stringify(this.json,null,2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultJson",{get:function(){return this.defaultJsonValue},enumerable:!1,configurable:!0}),t.prototype.createCreator=function(e){return new c.SurveyCreatorModel(e)},t.prototype.resetAllPages=function(){var e=this;this.model.editablePresets.forEach(function(t){return t.setupOnCurrentPage(e.model,e.creator,!0)}),this.creator.readOnly=!1},t.prototype.resetToDefaults=function(e){var t=this;e||this.notify((0,c.getLocString)("presets.editor.resetToDefaults")),this.model.editablePresets.forEach(function(o){e&&o.pageName!=e||o.resetToDefaults(t.model,!!e)})},t.prototype.activatePage=function(e,t,o){var n=this,i=o.filter(function(t){return e.currentPage.name!==t.pageName}),r=o.filter(function(t){return e.currentPage.name===t.pageName})[0];i.forEach(function(t){return t.setupOnCurrentPage(e,n.creator,!1)}),r.setupOnCurrentPage(e,this.creator,!0)},t.prototype.notify=function(e){this.creator.notify(e)},t.prototype.updateDataFromJson=function(e){var t=this,o=this.preset.getJson()||{};return c.editorLocalization.presetStrings=o.localization,e.editablePresets.forEach(function(o){return o.setupQuestions(e,t)}),e.editablePresets.forEach(function(n){return n.setupQuestionsValue(e,o[n.path],t.creator)}),this.updateJsonLocalizationStrings(e.editablePresets),o},t.prototype.onLocaleChanged=function(){var e=this,t=this.preset.getJson();this.model.editablePresets.forEach(function(o){return o.onLocaleChanged(e.model,t[o.path],e.creator)})},t.prototype.createModel=function(){var e=this,t=this.createEditablePresets(),o=new p.SurveyModel(this.getEditModelJson(t));o.css=m,o.editablePresets=t,o.keepIncorrectValues=!0,o.showNavigationButtons=!1,o.completeText=(0,c.getLocString)("presets.editor.completeText"),o.pagePrevText=(0,c.getLocString)("presets.editor.pagePrevText"),o.enterKeyAction="loseFocus",t.forEach(function(t){return t.notifyCallback=function(t){return e.notify(t)}}),this.defaultJsonValue||(this.defaultJsonValue={},t.forEach(function(t){return e.defaultJsonValue[t.path]=t.getDefaultJsonValue(e.creator)})),this.updateDataFromJson(o),this.activatePage(o,this.creator,t),o.onCurrentPageChanged.add(function(n,i){e.activatePage(o,e.creator,t)});var n=t.map(function(e){return e.questionNames}).reduce(function(e,t){return e.concat(t)},[]);function i(e){e.isDescendantOf("matrixdynamic")&&(e.onCreateDetailPanelRenderedRowCallback=function(e){e.cells=[e.cells[1]],e.cells[0].colSpans+=2})}return o.onValueChanged.add(function(i,r){t.forEach(function(e){return e.updateOnValueChanged(o,r.name)}),-1==n.indexOf(r.name)||e.applying||(e.applyFromSurveyModel(!1),e.activatePage(o,e.creator,t))}),o.onGetQuestionTitleActions.add(function(e,n){t.forEach(function(e){n.question.name==e.getNavigationElementName()&&(n.question.getTitleToolbar().isResponsivenessDisabled=!0,n.actions=o.navigationBar.actions)})}),o.onGetPanelTitleActions.add(function(n,i){t.forEach(function(t){i.panel.name==t.getNavigationElementName()&&(i.panel.getTitleToolbar().isResponsivenessDisabled=!0,i.actions=o.navigationBar.actions),t.onGetPanelTitleActions(o,e.creator,i)})}),o.getAllQuestions().forEach(function(e){return i(e)}),o.onQuestionCreated.add(function(e,t){i(t.question)}),o.onMatrixDetailPanelVisibleChanged.add(function(n,i){t.forEach(function(t){return t.updateOnMatrixDetailPanelVisibleChanged(o,e.creator,i)})}),o.onGetMatrixRowActions.add(function(n,i){t.forEach(function(t){return t.onGetMatrixRowActions(o,e.creator,i)})}),o.onMatrixRowDragOver.add(function(n,i){t.forEach(function(t){return t.onMatrixRowDragOver(o,e.creator,i)})}),o.onMatrixRowRemoving.add(function(n,i){t.forEach(function(t){return t.onMatrixRowRemoving(o,e.creator,i)})}),o.onMatrixRowAdded.add(function(n,i){t.forEach(function(t){return t.onMatrixRowAdded(o,e.creator,i)})}),o.onMatrixCellValueChanged.add(function(n,i){t.forEach(function(t){return t.onMatrixCellValueChanged(o,e.creator,i)})}),o.onUpdateQuestionCssClasses.add(function(e,o){t.forEach(function(e){var t=e.getCustomQuestionCssSuffix(o.question);t&&(o.cssClasses.mainRoot+=" sps-question--"+t),e.getMainElementNames().indexOf(o.question.name)>=0&&(o.cssClasses.mainRoot+=" sps-question--main",o.cssClasses.row+=" sps-table__row--main",o.cssClasses.buttonAdd+=" sps-matrixdynamic__add-btn--icon",o.cssClasses.iconAdd="sps-matrixdynamic__add-btn-icon",o.cssClasses.iconAddId="#icon-add-24x24")})}),o.onUpdatePanelCssClasses.add(function(e,o){t.forEach(function(e){o.panel.name===e.getNavigationElementName()&&(o.cssClasses.panel.container+=" sps-panel--navigation ")})}),o.onUpdatePageCssClasses.add(function(e,o){t.forEach(function(e){e.pageName===o.page.name&&(o.cssClasses.page.root+=" sps-page--"+e.fullPath)})}),o},t.prototype.createResultModel=function(){var e=this,t=new p.SurveyModel({elements:[{type:"html",name:"q1",html:this.getResultHtml()},{type:"comment",name:"json",title:(0,c.getLocString)("presets.editor.presetJson"),rows:60,cols:120,readOnly:!0}]});return t.showPrevButton=!1,t.showCompleteButton=!1,t.showQuestionNumbers=!1,t.width="900px",t.onGetQuestionTitleActions.add(function(t,o){if("json"===o.question.name){var n=o.question;o.actions.push({id:"json_copy",iconName:"icon-copy",title:(0,c.getLocString)("presets.editor.copy"),action:function(){navigator.clipboard.writeText(n.value)}}),o.actions.push({id:"json_download",iconName:"icon-download",title:(0,c.getLocString)("presets.editor.download"),action:function(){e.downloadJsonFile(n.value)}}),o.actions.push({id:"icon-load",iconName:"icon-load",title:(0,c.getLocString)("presets.editor.load"),action:function(){e.loadJsonFile()}})}}),t},t.prototype.getResultHtml=function(){return"<div>".concat((0,c.getLocString)("presets.editor.usageExample"),"</div>")},t.prototype.downloadJsonFile=function(e){e||(e=this.jsonText);var t=new Blob([e],{type:"application/json"}),o=window.document.createElement("a");o.href=window.URL.createObjectURL(t),o.download="preset.json",document.body.appendChild(o),o.click(),document.body.removeChild(o)},t.prototype.loadJsonFile=function(){var e=this;this.inputFileElement||(this.inputFileElement=document.createElement("input"),this.inputFileElement.type="file",this.inputFileElement.accept=".json",this.inputFileElement.style.display="none",this.inputFileElement.onchange=function(){e.inputFileElement.files.length<1||(e.importFromFile(e.inputFileElement.files[0]),e.inputFileElement.value="")}),this.inputFileElement.click()},t.prototype.importFromFile=function(e){var t=this,o=new FileReader;o.onload=function(e){var n=o.result;t.json=JSON.parse(n)},o.readAsText(e)},t.prototype.upldateResultJson=function(){this.resultModelValue.getQuestionByName("json").value=this.jsonText},t.prototype.applyFromSurveyModel=function(e){return void 0===e&&(e=!0),this.applying=!0,e&&!this.validateEditableModel(this.model)?(this.applying=!1,!1):(this.preset.setJson(this.getJsonFromSurveyModel()),this.model.setValue("json_result",JSON.stringify(this.preset.getJson(),null,2)),this.preset.apply(this.creator,!0),this.applying=!1,!0)},t.prototype.getJsonFromSurveyModel=function(){var e=this,t={};return this.model.editablePresets.forEach(function(o){var n,i=o.getJsonValue(e.model,e.creator,null===(n=e.defaultJsonValue)||void 0===n?void 0:n[o.path]);i&&(t[o.path]=i)}),this.getJsonLocalizationStrings(t),t},t.prototype.getJsonLocalizationStrings=function(e){var t=this,o={};this.model.editablePresets.forEach(function(e){e.setJsonLocalizationStrings(t.model,o)}),this.json&&this.json.localization&&(e.localization=JSON.parse(JSON.stringify(this.json.localization)));var n=this.getLocale();Object.keys(o).length>0?(e.localization||(e.localization={}),e.localization[n]=o):e.localization&&(e.localization[n]&&delete e.localization[n],0===Object.keys(e.localization).length&&delete e.localization)},t.prototype.updateJsonLocalizationStrings=function(e){var t=(this.json&&this.json.localization?JSON.parse(JSON.stringify(this.json.localization)):{})[this.getLocale()]||{};e.forEach(function(e){e.updateJsonLocalizationStrings(t)})},t.prototype.validateEditableModel=function(e){if(!e.validate(!0,!0))return!1;for(var t=e.editablePresets,o=0;o<t.length;o++)if(!t[o].validate(e))return!1;return!0},t.prototype.createEditableCore=function(e,t){return"languages"===t?new S(e):"tabs"===t?new _(e):"toolbox"===t?new v(e):"propertyGrid"===t?new C(e):"options"===t?new T(e):void 0},t.prototype.createEditable=function(e,t,o){var n=this,i=this.createEditableCore(e,o);return i&&e.children.forEach(function(e){var t=n.createEditable(e,i,o+"_"+e.getPath());t&&(i.children.push(t),t.parent=i)}),i},t.prototype.createEditablePresets=function(){var e=this,t=[];return this.preset.children.forEach(function(o){var n=e.createEditable(o,void 0,o.getPath());n&&t.push(n)}),t},t.prototype.getEditModelJson=function(e){var t={pages:[],showQuestionNumbers:!1};return e.forEach(function(e){var o=e.createPages();Array.isArray(o)&&o.forEach(function(e){return t.pages.push(e)})}),t},t}(p.Base),E={tabs:{items:[{name:"designer",iconName:"icon-config"},{name:"preview",iconName:"icon-preview"},{name:"json",iconName:"icon-codeeditor-24x24"}],activeTab:"designer"}},M={tabs:{items:[{name:"designer",iconName:"icon-config"},{name:"preview",iconName:"icon-preview"},{name:"logic",iconName:"icon-logic-24x24"},{name:"json",iconName:"icon-codeeditor-24x24"}],activeTab:"designer"}},O={},R=function(){function e(t){var o=this;this.creator=t,this.currentPresetIndex=0,this.saveToFileHandler=c.saveToFileHandler,this.preventTabSwitch=function(e,t){t.allow=!1},t.addTab({name:"presets",title:(0,c.getLocString)("presets.plugin.presetsTab"),plugin:this,iconName:e.iconName}),t.tabs.filter(function(e){return"presets"==e.id})[0].css="svc-tabbed-menu-item-container--presets",this.designerPlugin=t.getPlugin("designer");var n=this.creator.sidebar.getPageById("creatorTheme");n.componentData.showPresets=function(){return o.showPresets()},n.componentName="svc-presets-property-grid",this.toolboxCompact=t.toolbox.forceCompact}return e.prototype.showPresets=function(){this.activeTab=this.creator.activeTab,this.creator.activeTab="presets"},e.prototype.hidePresets=function(){this.creator.onActiveTabChanging.remove(this.preventTabSwitch),this.creator.activeTab=this.activeTab},e.prototype.confirmReset=function(e){p.settings.confirmActionAsync((0,c.getLocString)("presets.plugin.resetConfirmation"),function(t){t&&e()},{applyTitle:(0,c.getLocString)("presets.plugin.resetConfirmationOk"),locale:this.creator.locale,cssClass:"sv-popup--confirm svc-creator-popup"})},e.prototype.activate=function(){var e,t=this;this.creator.onActiveTabChanging.add(this.preventTabSwitch),this.model=new P({},this.creator,this.defaultJson),this.defaultJson=l({},this.model.defaultJson),this.currentValue&&(this.model.model.data=this.currentValue),this.designerPlugin.activateSidebar(),this.model.model.onComplete.add(function(){return t.hidePresets()});var o,n=null===(e=this.model)||void 0===e?void 0:e.model.pages.map(function(e){return{id:e.name,title:e.navigationTitle}}),i=function(e){o.popupModel.show()},r=[{id:"save",title:(0,c.getLocString)("presets.plugin.save"),markerIconName:"check-24x24",needSeparator:!0,action:function(){return t.hidePresets()}},{id:"defaultSettings",title:(0,c.getLocString)("presets.plugin.defaultSettings"),needSeparator:!0,css:"sps-list__item--label",enabled:!1},{id:"basic",title:(0,c.getLocString)("presets.plugin.basic"),action:function(e){i(),t.model.json=E}},{id:"advanced",title:(0,c.getLocString)("presets.plugin.advanced"),action:function(e){i(),t.model.json=M}},{id:"expert",title:(0,c.getLocString)("presets.plugin.expert"),action:function(e){i(),t.model.json=O}},{id:"file",title:(0,c.getLocString)("presets.plugin.file"),needSeparator:!0,css:"sps-list__item--label",enabled:!1},{id:"import",title:(0,c.getLocString)("presets.plugin.import"),markerIconName:"import-24x24",action:function(e){var o;i(),null===(o=t.model)||void 0===o||o.loadJsonFile()}},{id:"export",title:(0,c.getLocString)("presets.plugin.export"),markerIconName:"download-24x24",action:function(e){var o;i(),null===(o=t.model)||void 0===o||o.downloadJsonFile()}},{id:"edit",title:(0,c.getLocString)("presets.plugin.edit"),needSeparator:!0,css:"sps-list__item--label",enabled:!1},{id:"reset-current",title:(0,c.getLocString)("presets.plugin.resetLanguages"),action:function(){t.confirmReset(function(){var e;return null===(e=t.model)||void 0===e?void 0:e.resetToDefaults("page_languages")})}},{id:"reset",title:(0,c.getLocString)("presets.plugin.resetAll"),css:"sps-list__item--alert",action:function(){t.confirmReset(function(){var e;return null===(e=t.model)||void 0===e?void 0:e.resetToDefaults()})}}];n.forEach(function(e){e.action=function(e){t.presetsList.selectedItem=e,i(),t.model.model.currentPage=t.model.model.getPageByName(e.id)}}),o=(0,p.createDropdownActionModel)({id:"presets-menu",tooltip:(0,c.getLocString)("presets.plugin.creatorPresets"),iconName:"navmenu-24x24",css:"sps-menu-floating-action",action:function(){o.popupModel.isVisible&&setTimeout(function(){return o.popupModel.hide()},1)}},{items:u(u([{id:"creator-presets",title:(0,c.getLocString)("presets.plugin.creatorPresets"),css:"sps-list__item--label",enabled:!1}],n,!0),r,!0),showPointer:!1,verticalPosition:"top",horizontalPosition:"center",searchEnabled:!1,cssClass:"sps-popup-menu sps-popup-menu--always-on-top",cssClasses:h,onHide:function(){o.iconName="navmenu-24x24"},onShow:function(){o.iconName="close-24x24"}},this.model.model);var s=this.designerPlugin.tabControlModel.bottomToolbar.actions;s.forEach(function(e){return e.visible=!1}),s.unshift(o),this.presetsList=o.popupModel.contentComponentData.model;var a=this.presetsList.getActionById("reset-current");this.presetsList.selectedItem=this.presetsList.actions[0],this.model.model.onCurrentPageChanged.add(function(e,o){t.presetsList.selectedItem=t.presetsList.actions[t.model.model.currentPageNo+1],a.title=(0,c.getLocString)("presets.plugin.resetToDefaults").replace("{0}",t.model.model.currentPage.navigationTitle),a.action=function(){var e;null===(e=t.model)||void 0===e||e.resetToDefaults(t.presetsList.selectedItem.id)}}),setTimeout(function(){n[t.currentPresetIndex].action(n[t.currentPresetIndex])},100)},e.prototype.deactivate=function(){var e,t;this.creator.toolbox.forceCompact=this.toolboxCompact,this.currentValue=null===(e=this.model)||void 0===e?void 0:e.model.data;var o=this.designerPlugin.tabControlModel.bottomToolbar.actions;return o.forEach(function(e){return e.visible=!0}),o.splice(0,1),this.currentPresetIndex=(null===(t=this.model)||void 0===t?void 0:t.model.currentPageNo)||0,this.model&&this.model.dispose(),this.model=void 0,!0},e.prototype.onLocaleChanged=function(){this.model&&this.model.onLocaleChanged()},e.iconName="icon-settings",e}(),A=function(e){function t(t){var o=e.call(this,t)||this;return o.jsonErrors=[],o}return a(t,e),t.prototype.getType=function(){return"presetjson"},t.prototype.getCssType=function(){return"comment"},t.prototype.getTemplate=function(){return"comment"},Object.defineProperty(t.prototype,"textAreaModel",{get:function(){var e=this;if(!this.jsonAreaModelValue){var t=this.getTextAreaOptions(),o=this;t.getTextValue=function(){return JSON.stringify(e.value,null,2)},t.onTextAreaChange=function(t){!function(t){if(p.Helpers.isTwoValueEquals(JSON.stringify(o.value,null,2),t,!1,!0,!1))e.jsonErrors=[];else try{var n=(new c.SurveyJSON5).parse(t),i=l(l({},n),{name:"temp"}),r=new p.JsonObject;if(r.toObject({elements:[i]},new p.SurveyModel),e.jsonErrors=r.errors.map(function(e){return e.message}),e.jsonErrors.length>0)return;o.value=n}catch(t){e.jsonErrors=[t.message]}}(t.target.value)},this.jsonAreaModelValue=new p.TextAreaModel(t)}return this.jsonAreaModelValue},enumerable:!1,configurable:!0}),t.prototype.onCheckForErrors=function(t,o,n){var i=this;e.prototype.onCheckForErrors.call(this,t,o,n),this.jsonErrors.forEach(function(e){t.push(new p.CustomError(e,i))})},t}(p.QuestionCommentModel);return p.ElementFactory.Instance.registerElement("presetjson",function(e){return new A(e)},!1),p.Serializer.addClass("presetjson",[],function(){return new A("")},"comment"),N="".concat("2.5.0"),(0,p.checkLibraryVersion)(N,"survey-creator-core-presets"),r})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("survey-core"),require("survey-creator-core")):"function"==typeof define&&define.amd?define("[dashedname]",["survey-core","survey-creator-core"],t):"object"==typeof exports?exports["[dashedname]"]=t(require("survey-core"),require("survey-creator-core")):e.SurveyCreatorCorePresets=t(e.Survey,e.SurveyCreatorCore)}(this,(e,t)=>(()=>{"use strict";var o={156:t=>{t.exports=e},982:e=>{e.exports=t}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};i.r(r),i.d(r,{CreatorPresetEditableBase:()=>d,CreatorPresetEditableLanguages:()=>S,CreatorPresetEditableOptions:()=>T,CreatorPresetEditableTabs:()=>_,CreatorPresetEditableToolboxConfigurator:()=>v,CreatorPresetEditorModel:()=>P,NavigationBar:()=>L,QuestionPresetJsonModel:()=>A,TabPresetsPlugin:()=>R,Version:()=>N,enStrings:()=>I});var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},s(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var l=function(){return l=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function u(e,t,o){if(o||2===arguments.length)for(var n,i=0,r=t.length;i<r;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var p=i(156),c=i(982),d=function(){function e(e){this.preset=e,this.children=[],this.notifyCallback=function(e){}}return Object.defineProperty(e.prototype,"navigationPanelName",{get:function(){return this.path+"_navigation"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.preset.getPath()},enumerable:!1,configurable:!0}),e.prototype.getJsonPath=function(e){return this.path},Object.defineProperty(e.prototype,"fullPath",{get:function(){var e=this.parent?this.parent.fullPath:"";return this.path&&e&&(e+="_"),e+this.path},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageName",{get:function(){return"page_"+this.fullPath},enumerable:!1,configurable:!0}),e.prototype.getPageTitle=function(e){return e.getPageByName(this.pageName).title},e.prototype.getPageShortTitle=function(e){return e.getPageByName(this.pageName).navigationTitle},Object.defineProperty(e.prototype,"mainPanelName",{get:function(){return this.path+"_mainPanel"},enumerable:!1,configurable:!0}),e.prototype.getMainElementNames=function(){return[this.mainPanelName]},e.prototype.getMainPanelName=function(){return this.mainPanelName},e.prototype.getCustomQuestionCssSuffix=function(e){return""},e.prototype.createPages=function(){var e=[],t=this.createMainPage();return t&&e.push(t),this.children.forEach(function(t){var o=t.createPages();Array.isArray(o)&&o.forEach(function(t){return e.push(t)})}),e},Object.defineProperty(e.prototype,"questionNames",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.validate=function(e){if(!this.validateCore(e))return!1;for(var t=0;t<this.children.length;t++)if(!this.children[t].validate(e))return!1;return!0},e.prototype.validateCore=function(e){return!0},e.prototype.createMainPage=function(){var e=this.createMainPageCore();return e&&(e.name=this.pageName),e},e.prototype.getBoolVisibleIf=function(e,t){return void 0===t&&(t=!0),"{"+e+"}="+(t?"true":"false")},e.prototype.getTextVisibleIf=function(e,t){return"{"+e+"}='"+t+"'"},e.prototype.getNotEmptyVisibleIf=function(e){return"{"+e+"} notempty"},e.prototype.createMainPageCore=function(){},e.prototype.getNavigationElementName=function(){return this.navigationPanelName},e.prototype.getJsonValue=function(e,t,o){var n=e.getPageByName(this.pageName),i=n&&n.isVisible?this.getJsonValueCore(e,t,o):void 0,r=!!i,s=r?i:{};return this.children.forEach(function(o){var n=o.getJsonValue(e,t);n&&(r=!0,s[o.getJsonPath(e)]=n)}),r?s:void 0},e.prototype.getDefaultJsonValue=function(e){var t=this.getDefaultJsonValueCore(e);return this.children.forEach(function(o){return t[o.path]=o.getDefaultJsonValueCore(e)}),t},e.prototype.setJsonLocalizationStrings=function(e,t){this.setJsonLocalizationStringsCore(e,t),this.children.forEach(function(o){return o.setJsonLocalizationStrings(e,t)})},e.prototype.updateJsonLocalizationStrings=function(e){this.updateJsonLocalizationStringsCore(e),this.children.forEach(function(t){return t.updateJsonLocalizationStrings(e)})},e.prototype.dispose=function(){this.disposeCore(),this.children.forEach(function(e){return e.dispose()})},e.prototype.setupQuestions=function(e,t){this.setupQuestionsCore(e,t),this.children.forEach(function(o){o.setupQuestions(e,t)})},e.prototype.resetToDefaults=function(e,t){void 0===t&&(t=!0),this.restoreValuesFromDefault(e),this.notifyCallback(this.getPageTitle(e)+" "+(0,c.getLocString)("presets.editor.resoredToDefault")),this.children.forEach(function(o){o.resetToDefaults(e,t)})},e.prototype.setupOnCurrentPage=function(e,t,o){this.setupOnCurrentPageCore(e,t,o),this.children.forEach(function(n){n.setupOnCurrentPage(e,t,o)})},e.prototype.updateOnValueChanged=function(e,t){this.updateOnValueChangedCore(e,t),this.children.forEach(function(o){o.updateOnValueChanged(e,t)})},e.prototype.updateOnMatrixDetailPanelVisibleChanged=function(e,t,o){this.updateOnMatrixDetailPanelVisibleChangedCore(e,t,o),this.children.forEach(function(n){n.updateOnMatrixDetailPanelVisibleChanged(e,t,o)})},e.prototype.onGetMatrixRowActions=function(e,t,o){this.onGetMatrixRowActionsCore(e,t,o),this.children.forEach(function(n){n.onGetMatrixRowActions(e,t,o)})},e.prototype.onGetPanelTitleActions=function(e,t,o){},e.prototype.onMatrixRowDragOver=function(e,t,o){},e.prototype.onMatrixRowRemoving=function(e,t,o){},e.prototype.onMatrixRowAdded=function(e,t,o){},e.prototype.onMatrixCellValueChanged=function(e,t,o){},e.prototype.setupQuestionsValue=function(e,t,o){this.setupQuestionsValueCore(e,t,o),this.saveValuesAsDefault(e),this.children.forEach(function(n){n.setupQuestionsValue(e,t?t[n.path]:void 0,o)})},e.prototype.onLocaleChanged=function(e,t,o){this.onLocaleChangedCore(e,t,o),this.children.forEach(function(n){n.setupQuestionsValue(e,t?t[n.path]:void 0,o)})},e.prototype.saveValuesAsDefault=function(e){this.questionNames.forEach(function(t){return e.getQuestionByName(t).defaultValue=e.getValue(t)&&JSON.parse(JSON.stringify(e.getValue(t)))})},e.prototype.restoreValuesFromDefault=function(e){this.questionNames.forEach(function(t){return e.getQuestionByName(t).value=e.getQuestionByName(t).defaultValue&&JSON.parse(JSON.stringify(e.getQuestionByName(t).defaultValue))})},e.prototype.setupQuestionsCore=function(e,t){},e.prototype.resetToDefaultsCore=function(e){},e.prototype.setupQuestionsValueCore=function(e,t,o){},e.prototype.onLocaleChangedCore=function(e,t,o){},e.prototype.getJsonValueCore=function(e,t,o){},e.prototype.getDefaultJsonValueCore=function(e){return{}},e.prototype.setJsonLocalizationStringsCore=function(e,t){},e.prototype.updateJsonLocalizationStringsCore=function(e){},e.prototype.disposeCore=function(){},e.prototype.setupOnCurrentPageCore=function(e,t,o){},e.prototype.updateOnValueChangedCore=function(e,t){},e.prototype.updateOnMatrixDetailPanelVisibleChangedCore=function(e,t,o){},e.prototype.onGetMatrixRowActionsCore=function(e,t,o){},e.prototype.copyJson=function(e){return p.Helpers.getUnbindValue(e)},e.updateModifiedText=function(t,o,n){if(n&&o){var i=c.editorLocalization.presetStrings;c.editorLocalization.presetStrings=void 0,o!==c.editorLocalization.getString(n)&&e.saveTextInLocStrs(t,o,n),c.editorLocalization.presetStrings=i}},e.saveTextInLocStrs=function(e,t,o){for(var n=o.split("."),i=0;i<n.length-1;i++){var r=n[i];e[r]||(e[r]={}),e=e[r]}e[n[n.length-1]]=t},e}(),m={root:"sps-root-modern",container:"sps-container-modern",header:"sps-title sps-container-modern__title",body:"sps-body",bodyEmpty:"sps-body sps-body--empty",footer:"sps-footer sps-body__footer sps-clearfix",title:"",description:"",logo:"sps-logo",logoImage:"sps-logo__image",headerText:"sps-header__text",navigationButton:"",bodyNavigationButton:"",completedPage:"sps-completedpage",navigation:{complete:"sps-btn sps-btn--primary-brand sps-footer__complete-btn",prev:"sps-btn sps-btn--secondary-brand sps-footer__prev-btn",next:"sps-btn sps-btn--primary-brand sps-footer__next-btn",start:"sps-btn sps-footer__start-btn",preview:"sps-btn sps-footer__preview-btn",edit:"sps-btn sps-footer__edit-btn"},list:JSON.parse(JSON.stringify(c.listComponentCss)),panel:{withFrame:"sps-panel--with-frame",nested:"sps-panel--nested",expandableAnimating:"",header:"sps-panel__header",title:"sps-title sps-panel__title",titleBar:"sd-action-title-bar sps-action-title-bar",contentEnter:"sps-panel__content--enter",contentLeave:"sps-panel__content--leave",titleExpandable:"sps-panel__title--expandable",titleExpanded:"sps-panel__title--expanded",titleCollapsed:"sps-panel__title--collapsed",titleOnError:"sps-panel__title--error",description:"sps-description sps-panel__description",container:"sps-panel sps-row__panel",content:"sps-panel__content",icon:"sps-panel__icon",iconExpanded:"sps-panel__icon--expanded",footer:"sps-panel__footer",requiredMark:"sps-panel__required-text",collapsed:"sps-panel--collapsed",expanded:"sps-panel--expanded"},paneldynamic:{nested:"",mainRoot:"sps-question sps-row__question",root:"sps-paneldynamic",navigation:"sps-paneldynamic__navigation",title:"sps-title sps-question__title",button:"sps-action-button sps-action-button--text",buttonRemove:"sps-action-button--danger",buttonAdd:"sps-paneldynamic__add-btn",panelsContainer:"",panelWrapper:"sps-paneldynamic__panel-wrapper",panelWrapperList:"",progressTop:"sps-paneldynamic__progress sps-paneldynamic__progress--top",progressBottom:"sps-paneldynamic__progress sps-paneldynamic__progress--bottom",buttonPrev:"sps-paneldynamic__prev-btn",buttonNext:"sps-paneldynamic__next-btn",progressContainer:"sps-paneldynamic__progress-container",progress:"sps-progress",progressBar:"sps-progress__bar",progressText:"sps-paneldynamic__progress-text",panelFooter:"sps-panel__footer",separator:"sps-paneldynamic__separator",footer:"sps-paneldynamic__footer",footerButtonsContainer:"sps-paneldynamic__buttons-container"},progress:"sps-progress sps-body__progress",progressBar:"sps-progress__bar",progressText:"sps-progress__text",progressTextInBar:"sps-hidden",page:{root:"sps-page sps-body__page",title:"sps-title sps-page__title",description:"sps-description sps-page__description"},pageTitle:"sps-title sps-page__title",pageDescription:"sps-description sps-page__description",row:"sps-row sps-clearfix",rowEnter:"sps-row--enter",rowLeave:"sps-row--leave",rowDelayedEnter:"sps-row--delayed-fade-in",rowMultiple:"sps-row--multiple",question:{withFrame:"sps-question--with-frame",nested:"sps-question--nested",mainRoot:"sps-question sps-row__question",flowRoot:"sps-question sps-row__question sps-row__question--flow",asCell:"sps-table__cell",header:"sps-question__header",headerLeft:"sps-question__header--location--left",headerTop:"sps-question__header--location--top",headerBottom:"sps-question__header--location--bottom",content:"sps-question__content",contentLeft:"sps-question__content--left",titleLeftRoot:"sps-question--location--left",titleOnAnswer:"sps-question__title--answer",titleOnError:"sps-question__title--error",title:"sps-title sps-question__title",titleBar:"sd-action-title-bar sps-action-title-bar",requiredMark:"sps-question__required-text",number:"sps-question__num",description:"sps-description sps-question__description",descriptionUnderInput:"sps-question__description--under",comment:"sps-comment",required:"sps-question--required",titleRequired:"sps-question__title--required",indent:0,footer:"sps-question__footer",formGroup:"sps-question__form-group",hasError:"",readOnly:"sd-question--readonly sps-question--disabled",confirmDialog:"sps-popup--confirm sv-popup--confirm svc-creator-popup",errorsContainerBottom:"sps-question__erbox--below-question"},checkbox:{root:"sps-selectbase",item:"sps-item sps-checkbox sps-selectbase__item",itemSelectAll:"sps-checkbox--selectall",itemNone:"sps-checkbox--none",itemReadOnly:"sps-item--disabled sps-checkbox--disabled",itemChecked:"sps-checkbox--checked",itemHover:"sps-checkbox--allowhover",itemInline:"sps-selectbase__item--inline",label:"sps-selectbase__label",itemSvgIconId:"#icon-check-16x16",labelChecked:"",itemControl:"sps-checkbox__control",itemDecorator:"sps-checkbox__svg",controlLabel:"sps-checkbox__caption",materialDecorator:"sps-checkbox__rectangle",other:"sps-comment sps-question__other",column:"sps-selectbase__column"},radiogroup:{root:"sps-selectbase",item:"sps-item sps-radio sps-selectbase__item",itemInline:"sps-selectbase__item--inline",label:"sps-selectbase__label",labelChecked:"",itemReadOnly:"sps-item--disabled sps-radio--disabled",itemChecked:"sps-radio--checked",itemHover:"sps-radio--allowhover",itemControl:"sps-visuallyhidden sps-item__control",itemDecorator:"sps-item__svg sps-radio__svg",controlLabel:"sps-item__control-label",materialDecorator:"sps-item__decorator sps-radio__decorator",other:"sps-comment sps-question__other",clearButton:"sps-btn sps-selectbase__clear-btn",column:"sps-selectbase__column"},boolean:{mainRoot:"sps-question sps-row__question sps-question--boolean",rootCheckbox:"sps-selectbase",checkboxItem:"sps-checkbox",checkboxItemChecked:"sps-checkbox--checked",checkboxitemIndeterminate:"sps-checkbox--indeterminate",checkboxItemReadOnly:"sps-checkbox--disabled",svgIconId:"#icon-v2check",checkboxLabel:"sps-selectbase__label",controlCheckbox:"sps-checkbox__control",checkboxControlLabel:"sps-checkbox__caption",checkboxItemDecorator:"sps-checkbox__svg",checkboxMaterialDecorator:"sps-checkbox__rectangle"},text:{root:"sps-input sps-text",controlReadOnly:"sps-input--readonly",small:"sps-row__question--small",content:"sps-question__content sps-text__content",remainingCharacterCounter:"sps-remaining-character-counter",onError:"sps-input--error"},comment:{root:"sps-input sps-comment",content:"sps-question__content sps-comment__content",remainingCharacterCounter:"sps-remaining-character-counter",small:"sps-row__question--small",onError:"sps-input--error"},dropdown:{root:"sps-selectbase",popup:"sps-dropdown-popup svc-creator-popup",small:"sps-row__question--small sd-row__question--small",control:"sps-input sps-dropdown",controlEmpty:"sps-dropdown--empty sd-dropdown--empty",controlValue:"sps-dropdown__value",filterStringInput:"sd-dropdown__filter-string-input sps-dropdown__filter-string-input",other:"sps-comment sps-question__other",onError:"sps-input--error",selectWrapper:"sv-dropdown_select-wrapper sps-dropdown_select-wrapper",chevronButtonIconId:"icon-chevron",cleanButton:"sps-dropdown__clean-button sps-input__edit-button",controlReadOnly:"sps-input--readonly sd-input--disabled sd-input--readonly",hintPrefix:"sps-dropdown__hint-prefix sd-dropdown__hint-prefix",hintSuffix:"sps-dropdown__hint-suffix sd-dropdown__hint-suffix"},matrix:{tableWrapper:"sps-matrix sps-table-wrapper",root:"sps-table",rowError:"sps-matrix__row--error",cell:"sps-table__cell sps-matrix__cell",headerCell:"sps-table__cell sps-table__cell--header",label:"sps-item sps-radio sps-matrix__label",itemValue:"sps-visuallyhidden sps-item__control sps-radio__control",itemChecked:"sps-radio--checked",itemReadOnly:"sps-item--disabled sps-radio--disabled",itemHover:"sps-radio--allowhover",materialDecorator:"sps-item__decorator sps-radio__decorator",itemDecorator:"sps-item__svg sps-radio__svg",cellText:"sps-matrix__text",cellTextSelected:"sps-matrix__text--checked",cellTextReadOnly:"sps-matrix__text--disabled"},matrixdropdown:{tableWrapper:"sps-table-wrapper",root:"sps-table",cell:"sps-table__cell",headerCell:"sps-table__cell sps-table__cell--header",emptyCell:"sps-table__cell--empty",rowEnter:"sps-table__row--enter",rowLeave:"sps-table__row--leave"},matrixdynamic:{mainRoot:"sps-question sps-question--matrixdynamic sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",tableWrapper:"sps-table-wrapper",root:"sps-table sps-matrixdynamic",content:"sps-matrixdynamic__content sps-text__content",cell:"sps-table__cell",row:"sps-table__row",rowDisabled:"sps-table__row-disabled",rowReadOnly:"sps-table__row-readonly",headerCell:"sps-table__cell sps-table__cell--header",button:"sps-btn",detailRow:"sps-table__row sps-table__row--detail",detailButton:"sps-table__cell--detail-button sps-action-button",detailButtonExpanded:"sps-table__cell--detail-button--expanded",detailIcon:"sps-detail-panel__icon sps-action-button__icon",detailIconExpanded:"sps-detail-panel__icon--expanded",detailIconExpandedId:"icon-collapse-24x24",detailIconId:"icon-expand-24x24",detailPanelCell:"sps-table__cell sps-table__cell--detail-panel",actionsCell:"sps-table__cell sps-table__cell--actions",buttonAdd:"sps-matrixdynamic__add-btn sps-action-button sps-action-button--large",buttonRemove:"sps-matrixdynamic__remove-btn",iconAdd:"",iconRemove:"xxx",dragElementDecorator:"sps-drag-element__svg",iconDragElement:"#icon-drag-24x24",iconDrag:"sps-matrixdynamic__drag-element",footer:"sps-matrixdynamic__footer",dragDropGhostPositionTop:"sps-matrixdynamic__drag-drop-ghost-position-top",dragDropGhostPositionBottom:"sps-matrixdynamic__drag-drop-ghost-position-bottom",noRowsSection:"sps-matrixdynamic__placeholder",noRowsText:"sps-matrixdynamic__placeholder-text",cellQuestionWrapper:"sps-table__question-wrapper",draggedRow:"sps-matrixdynamic__dragged-row",emptyCell:"sps-table__cell--empty",rowEmpty:"sps-table__row--empty",rowEnter:"sps-table__row--enter",rowLeave:"sps-table__row--leave"},actionBar:{root:"sps-action-bar",item:"sps-action-button",itemPressed:"sps-action-button--pressed",itemAsIcon:"sps-action-button--icon",itemIcon:"sps-action-button__icon",itemTitle:"sps-action-button__title"}},g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultIcon="square-dashed-24x24",t}return a(t,e),Object.defineProperty(t.prototype,"nameItems",{get:function(){return this.path+"_items"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameMatrix",{get:function(){return this.fullPath+"_matrix"},enumerable:!1,configurable:!0}),t.prototype.hasIcon=function(e){return!1},t.prototype.getMainElementNames=function(){return[this.nameItems]},Object.defineProperty(t.prototype,"iconList",{get:function(){return Object.keys(p.SvgRegistry.icons).map(function(e){return"icon-"+e})},enumerable:!1,configurable:!0}),t.prototype.getMatrixKeyColumnName=function(e){return"name"},t.prototype.getDefaultItems=function(e){return this.defaultItems},t.prototype.getDefaultItem=function(e,t){var o=this.getMatrixKeyColumnName(e);return this.getDefaultItems(e).filter(function(e){return e[o]==t})[0]},t.prototype.updateOnValueChangedCore=function(e,t){if(this.needToSetActions(t)){var o=e.getQuestionByName(t);this.updateMatrixRowActions(e,o)}},t.prototype.updateMatrixRowActions=function(e,t){var o=this;t.renderedTable.rows.forEach(function(e){var n,i,r;if(e.row){var s=null===(i=null===(n=e.cells[1])||void 0===n?void 0:n.item)||void 0===i?void 0:i.value.actions;o.updateRowActions(t,e.row,s);var a=null===(r=e.cells[e.cells.length-1].item)||void 0===r?void 0:r.value.actions;o.updateRowActions(t,e.row,a)}})},t.prototype.updateRowActions=function(e,t,o){var n=this;if(o){var i=this.getMatrixKeyColumnName(e);if(e.value){var r=e.value.filter(function(e){var o;return(null===(o=t.value)||void 0===o?void 0:o[i])==(null==e?void 0:e[i])})[0];r&&o.forEach(function(o){return n.updateRowAction(e,t,r,i,o)})}}},t.prototype.updateRowAction=function(e,t,o,n,i){if("icon-action"==i.id&&(i.iconName=o.iconName||this.defaultIcon),"reset-to-default"==i.id){var r=this.getDefaultItem(e,o[n]);if(!r)return;var s={};Object.keys(o).forEach(function(e){return s[e]=r[e]}),i.enabled=!p.Helpers.isTwoValueEquals(o,s)}},t.prototype.createResetAction=function(e,t,o){return{id:"reset-to-default",iconName:"icon-reset",tooltip:(0,c.getLocString)("presets.items.restoreToDefault"),location:"end",visibleIndex:15,action:o}},t.prototype.createEditAction=function(e,t,o,n){var i=this;return{id:"edit-item",iconName:"icon-edit",tooltip:(0,c.getLocString)("presets.items.edit"),location:"end",visibleIndex:13,action:function(){i.editItem(e,t,o,n)}}},t.prototype.createIconAction=function(e,t){return void 0===t&&(t="sps-matrixdynamic__row-icon"),{id:"icon-action",iconName:e,innerCss:t,location:"start",enabled:!1}},t.prototype.setupStandardActions=function(e,t,o,n,i){e.forEach(function(e){"show-detail"==e.id&&(e.location="end",e.iconName="icon-expand-24x24",e.title=new p.ComputedUpdater(function(){return o.isDetailPanelShowing?(0,c.getLocString)("presets.items.collapse"):(0,c.getLocString)("presets.items.expand")}),e.tooltip=(0,c.getLocString)("presets.items.expand"),e.visibleIndex=10,e.visible=n),"remove-row"==e.id&&(e.visibleIndex=20,e.component="sv-action-bar-item",e.action=function(){return t.removeRowUI(o)},e.iconName=i?"icon-add_24x24":"icon-remove_24x24",e.tooltip=i?(0,c.getLocString)("presets.items.add"):(0,c.getLocString)("presets.items.delete"))})},t.prototype.editItem=function(e,t,o,n,i){var r,s,a=this,l=this.getMatrixKeyColumnName(o),u={id:"reset-to-default",title:(0,c.getLocString)("presets.editor.resetToDefault"),css:"sps-action--grow",innerCss:"sps-btn sps-btn--secondary-alert",visibleIndex:15,action:function(e){var t=a.getDefaultItem(o,r.getValue(l));r.data=t,s.enabled=!1,a.notifyCallback((0,c.getLocString)("presets.editor.itemRestoredToDefault"))}};s=new p.Action(u),r=this.showDetailPanelInPopup(o,n,e.rootElement,{actions:[s],title:null==i?void 0:i.description,removeOnCancel:null==i?void 0:i.isNew}),s.enabled=!p.Helpers.isTwoValueEquals(r.data,this.getDefaultItem(o,r.getValue(l))),r.onValueChanged.add(function(){return s.enabled=!0});var d=r.getQuestionByName(l);this.getDefaultItem(o,d.value)&&(d.readOnly=!0)},t.prototype.resetItem=function(e,t,o){var n=o.getValue("name"),i=this.getDefaultItem(t,n);if(i){var r=t.value,s=r.filter(function(e){return e.name==n})[0];Object.keys(s).forEach(function(e){s[e]=i[e]}),t.value=r}this.notifyCallback((0,c.getLocString)("presets.editor.itemRestoredToDefault"))},t.prototype.restoreItems=function(e,t,o){var n=t.value[o],i=e.value?u([],e.value,!0):[];i.push(n),e.value=i},t.prototype.getMatrix=function(e){return e.getQuestionByName(this.nameMatrix)},t.prototype.isItemsMatrix=function(e){return e===this.nameMatrix},t.prototype.needToSetActions=function(e){return this.isItemsMatrix(e)},t.prototype.onGetMatrixRowActionsCore=function(e,t,o){var n,i,r=this;if(this.needToSetActions(o.question.name)){var s=o.question,a=s.detailElements.filter(function(e){return e.visible}).length>0;if(this.hasIcon(o.question.name)){var l=this.getMatrixKeyColumnName(o.question),u=(null===(i=null===(n=s.value)||void 0===n?void 0:n.filter(function(e){return e[l]==o.row.getValue(l)})[0])||void 0===i?void 0:i.iconName)||this.defaultIcon;o.actions.push(this.createIconAction(u))}var p=this.createResetAction(e,o.row,function(t){r.resetItem(e,s,o.row),t.enabled=!1});o.actions.push(p),o.actions.push(this.createEditAction(e,t,s,o.row)),this.setupStandardActions(o.actions,s,o.row,a,s.name==this.nameMatrix),this.updateRowActions(s,o.row,o.actions)}},t.prototype.onMatrixRowDragOver=function(e,t,o){this.isItemsMatrix(o.fromMatrix.name)&&this.isItemsMatrix(o.toMatrix.name)&&(o.allow=!0)},t.prototype.onMatrixRowRemoving=function(e,t,o){if(this.isItemsMatrix(o.question.name)&&o.question.name!=this.nameMatrix){var n=o.question.value[o.rowIndex],i=this.getMatrix(e),r=i.value?u([],i.value,!0):[];r.push(n),i.value=r}},t.prototype.getExistingKeys=function(e,t){var o=e.getQuestionByName(this.nameItems).value||[],n=e.getQuestionByName(this.nameMatrix).value||[];return u(u([],o,!0),n,!0)},t.prototype.getDefaultValueForRow=function(e,t,o){return c.SurveyHelper.getNewName(this.getExistingKeys(e,o).map(function(e){return e[o]}).filter(function(e){return!!e}).map(function(e){return{name:e}}),o)},t.prototype.setDefaultValueForRow=function(e,t,o){var n=this.getMatrixKeyColumnName(t),i=this.getDefaultValueForRow(e,t,n);o.getQuestionByName(n).value=i,o.getQuestionByName("title").value=i},t.prototype.onMatrixRowAdded=function(e,t,o){var n,i;this.isItemsMatrix(o.question.name)&&(this.setDefaultValueForRow(e,o.question,o.row),this.editItem(e,t,o.question,o.row,{description:(0,c.getLocString)("presets.items.newItem")+" "+((null===(i=null===(n=o.question.data)||void 0===n?void 0:n.value)||void 0===i?void 0:i.title)||this.getPageShortTitle(e)),isNew:!0}))},t.prototype.onMatrixCellValueChanged=function(e,t,o){if(this.needToSetActions(o.question.name)){var n=o.question.renderedTable.rows.find(function(e){return e.row==o.row});if(!n)return;var i=n.cells[n.cells.length-1].item.value.actions;if(!i)return;this.updateRowActions(o.question,o.row,i)}},t.prototype.showDetailPanelInPopup=function(e,t,o,n){var i,r,s=this,a=e.visibleRows.findIndex(function(e){return e===t}),d=e.value[a],g=new p.SurveyModel({elements:e.toJSON().detailElements});if(g.fitToContainer=!1,g.showNavigationButtons=!1,g.data=d,g.css=m,g.enterKeyAction="loseFocus",g.questionErrorLocation="bottom",p.settings.showDialog){var h=null===(r=p.settings.showDialog)||void 0===r?void 0:r.call(p.settings,{componentName:"survey",data:{survey:g,model:g},onApply:function(){if(g.validate()){var t=u([],e.value,!0),o={};g.getAllQuestions().forEach(function(e){e.visible&&(o[e.name]=g.data[e.name])});var n=l(l({},e.value[a]),o);return t[a]=n,e.value=t,s.updateMatrixRowActions(e.survey,e),!0}return!1},onCancel:function(){return n.removeOnCancel&&e.removeRowUI(t),!0},cssClass:"sps-popup svc-property-editor svc-creator-popup",title:n.title||(0,c.getLocString)("presets.editor.edit"),displayMode:"popup"},o);if(g.getAllQuestions().filter(function(e){return!e.startWithNewLine}).length>0&&(h.width="100%"),h.footerToolbar){var f=h.footerToolbar.cssClasses;f.item="sps-btn",h.footerToolbar.cssClasses=f,h.footerToolbar.getActionById("apply").innerCss="sps-btn--primary-brand",h.footerToolbar.getActionById("cancel").innerCss="sps-btn--secondary-brand",n.actions&&(i=h.footerToolbar.actions).unshift.apply(i,n.actions)}g.getAllPanels().forEach(function(e){return e.visible=!e.visible}),g.getAllQuestions().forEach(function(e){e.visible=!e.visible,e.isRequired&&(e.requiredErrorText=(0,c.getLocString)("presets.editor.required"))})}return g},t}(d),h={root:"sps-list__container",itemsContainer:"sps-list",itemsContainerFiltering:"sps-list--filtering",emptyContainer:"sps-list__empty-container",emptyText:"sps-list__empty-text",filter:"sps-list__filter",filterIcon:"sps-list__filter-icon",filterInput:"sps-list__input",searchClearButtonIcon:"sps-list__filter-clear-button",loadingIndicator:"sps-list__loading-indicator",item:"sps-list__item",itemSelected:"sps-list__item--selected",itemGroup:"sps-list__item--group",itemGroupSelected:"sps-list__item--group-selected",itemWithIcon:"sps-list__item--with-icon",itemDisabled:"sps-list__item--disabled",itemFocused:"sps-list__item--focused",itemHovered:"sps-list__item--hovered",itemTextWrap:"sps-list__item-text--wrap",itemIcon:"sps-list__item-icon",itemMarkerIcon:"sps-list-item__marker-icon",itemSeparator:"sps-list__item-separator",itemBody:"sps-list__item-body"},f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),Object.defineProperty(t.prototype,"defaultCategoriesMap",{get:function(){return this.defaultCategories.reduce(function(e,t){return e[t.category]=t,e},{})},enumerable:!1,configurable:!0}),t.prototype.getDefaultItems=function(e){return(null==e?void 0:e.name)===this.nameCategories?this.defaultCategories:this.defaultItems},Object.defineProperty(t.prototype,"nameInnerMatrix",{get:function(){return"items"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameCategories",{get:function(){return this.fullPath+"_categories"},enumerable:!1,configurable:!0}),t.prototype.getMainElementNames=function(){return[this.nameCategories]},t.prototype.getMatrixKeyColumnName=function(e){return e.name===this.nameCategories?"category":"name"},Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.nameCategories]},enumerable:!1,configurable:!0}),t.prototype.setupCategoryActions=function(e,t,o,n,i){var r=this;i.forEach(function(t){"remove-row"==t.id&&(t.iconName="icon-delete_24x24",t.tooltip=(0,c.getLocString)("presets.items.delete"),t.innerCss="sps-action-button sps-action-button--icon sps-action-button--danger"),"reset-to-default"==t.id&&(t.action=function(){r.resetCategory(e,n)})})},t.prototype.ejectRowData=function(e,t,o){var n=e.value,i=e.visibleRows.indexOf(t),r=n[i];return o&&(n.splice(i,1),e.value=n),r},t.prototype.moveToCategory=function(e,t,o,n,i){void 0===i&&(i=!1);var r=this.ejectRowData(t,o,i),s=this.getQuestionCategories(e),a=s.value;return this.findOrCreateCategory(a,n)[this.nameInnerMatrix].push(r),s.value=a,s.visibleRows.find(function(e){return e.getValue("category")==n})},t.prototype.itemMenuCategoriesEnabled=function(e){return!0},t.prototype.setSubitemsToAction=function(e,t){e.setSubItems({items:t,cssClasses:h}),e.markerIconName="icon-chevronright-24x24"},t.prototype.getItemMenuActionsCore=function(e,t,o){var n=this,i=this.getQuestionCategories(e),r=i.value,s=[],a=t.name==this.nameMatrix,l=this.itemMenuCategoriesEnabled(e);if(a?l?s.push(new p.Action({id:"move-to",title:(0,c.getLocString)("presets.items.moveTo"),css:"sps-list__item--label",enabled:!1})):s.push(new p.Action({id:"restore-item",title:(0,c.getLocString)("presets.toolbox.addToToolbox"),action:function(){var e=t.visibleRows.indexOf(o);t.removeRow(e)}})):s.push(new p.Action({id:"remove-from",title:(0,c.getLocString)("presets.items.removeFrom").replace("{0}",t.title),action:function(){var e=t.visibleRows.indexOf(o);t.removeRow(e)}})),!l)return s;var u=r.filter(function(e){return e[n.nameInnerMatrix].filter(function(e){var t;return e.name==(null===(t=o.value)||void 0===t?void 0:t.name)}).length>0})[0],d=r.filter(function(e){return e.category!=(null==u?void 0:u.category)}).map(function(i){return new p.Action({id:"to-"+i.category,title:i.title,action:function(){n.moveToCategory(e,t,o,i.category,!0)}})});if(a)s.push.apply(s,d);else{s.push(new p.Action({id:"categories",title:(0,c.getLocString)("presets.items.categoriesLabel"),css:"sps-list__item--label",enabled:!1,needSeparator:!0}));var m=new p.Action({id:"move-to-categories",title:(0,c.getLocString)("presets.items.moveToCategory")});this.setSubitemsToAction(m,d),s.push(m)}return s.push(new p.Action({id:"move-to-new-category",title:(0,c.getLocString)("presets.items.moveToNewCategory"),needSeparator:a,action:function(){var r=n.moveToCategory(e,t,o,n.getDefaultValueForRow(e,t,"category"),!0);n.editItem(e,null,i,r,{description:(0,c.getLocString)("presets.items.newCategory")+" "+n.getPageShortTitle(e),isNew:!0})}})),s},t.prototype.getItemMenuActions=function(e,t,o){var n=this,i=this.getItemMenuActionsCore(e,t,o);return this.getDefaultItem(t,o.value.name)||i.push(new p.Action({id:"remove-custom-item",title:(0,c.getLocString)("presets.toolbox.deleteCustomItem"),css:"sps-list__item--alert",needSeparator:!0,action:function(){n.ejectRowData(t,o,!0)}})),i},t.prototype.replaceRemoveAction=function(e,t,o,n){var i=this,r=n.filter(function(e){return"remove-row"==e.id})[0];if(r){r.visible=!1;var s=(0,p.createDropdownActionModel)({id:"context-menu",iconName:"more-circle-24x24",tooltip:(0,c.getLocString)("presets.items.more"),location:"end",visibleIndex:20},{items:[],showPointer:!1,verticalPosition:"bottom",horizontalPosition:"center",cssClass:"sps-popup-menu sps-popup-menu--context",cssClasses:h,searchEnabled:!1});s.popupModel.onVisibilityChanged.add(function(n,r){if(r.isVisible){var s=r.model.contentComponentData.model;s.actions=i.getItemMenuActions(e,t,o),s.flushUpdates()}}),n.push(s)}},t.prototype.getQuestionCategories=function(e){return e.getQuestionByName(this.nameCategories)},t.prototype.isItemsMatrix=function(t){return e.prototype.isItemsMatrix.call(this,t)||t===this.nameInnerMatrix},t.prototype.resetCategory=function(e,t){var o,n=this,i=t.getValue("category"),r=null===(o=this.defaultCategories.filter(function(e){return e.category==i})[0])||void 0===o?void 0:o[this.nameInnerMatrix];if(r){var s=this.getQuestionCategories(e),a=this.getMatrix(e),l=a.value||[],u=s.value,p=u.filter(function(e){return e.category==i})[0];p[this.nameInnerMatrix].forEach(function(e){r.some(function(t){return t.name==e.name})||l.push(e)}),p[this.nameInnerMatrix]=r,u.filter(function(e){return e.category!=i}).forEach(function(e){r.forEach(function(t){d(e[n.nameInnerMatrix])})}),d(l),a.value=l,s.value=u,this.notifyCallback((0,c.getLocString)("presets.editor.categoryRestoredToDefault"))}function d(e){e&&r.forEach(function(t){var o=e.findIndex(function(e){return e.name==t.name});o>=0&&e.splice(o,1)})}},t.prototype.findOrCreateCategory=function(e,t){var o,n=e.filter(function(e){return e.category==t})[0];return n||((o={category:t||"general",title:t||"General"})[this.nameInnerMatrix]=[],n=o,e.push(n)),n},t.prototype.needToSetActions=function(e){return this.isItemsMatrix(e)||e===this.nameCategories},t.prototype.onGetMatrixRowActionsCore=function(t,o,n){e.prototype.onGetMatrixRowActionsCore.call(this,t,o,n),n.question.name===this.nameCategories&&this.setupCategoryActions(t,o,n.question,n.row,n.actions),this.isItemsMatrix(n.question.name)&&this.replaceRemoveAction(t,n.question,n.row,n.actions)},t.prototype.getExistingKeys=function(e,t){var o=e.getQuestionByName(this.nameCategories).value||[],n=e.getQuestionByName(this.nameMatrix).value||[];return u(u(u([],o,!0),o.map(function(e){return e.items}).flat().filter(function(e){return!!e}),!0),n,!0)},t.prototype.onMatrixRowRemoving=function(t,o,n){var i=this;if(e.prototype.onMatrixRowRemoving.call(this,t,o,n),n.question.name==this.nameCategories){var r=n.question.value[n.rowIndex][this.nameInnerMatrix];if(r){var s=this.getMatrix(t),a=s.value?s.value.concat(r):r;s.value=a}}if(n.question.name==this.nameMatrix){var l=n.question.value[n.rowIndex],u=this.defaultCategories.filter(function(e){return e[i.nameInnerMatrix].filter(function(e){return e.name==l.name}).length>0})[0];this.moveToCategory(t,n.question,n.row,null==u?void 0:u.category)}},t.prototype.onMatrixRowAdded=function(t,o,n){e.prototype.onMatrixRowAdded.call(this,t,o,n),n.question.name==this.nameCategories&&(this.setDefaultValueForRow(t,n.question,n.row),this.editItem(t,o,n.question,n.row,{description:(0,c.getLocString)("presets.items.newCategory")+" "+this.getPageShortTitle(t),isNew:!0}))},t}(g),y="toolboxCategories";p.FunctionFactory.Instance.register("validateToolboxJson",function(e){var t=e[0];return!t||!t.type||!!p.Serializer.createClass(t.type,t)});var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createItemsMatrixJSON=function(e,t){var o={type:"matrixdynamic",name:"items",title:"Toolbox",allowRowReorder:!0,cellType:"text",showHeader:!1,rowCount:0,allowAddRows:!1,addRowButtonLocation:"top",columns:[{name:"name",visible:!1},{name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"panel",name:"details",maxWidth:"30%",elements:[{type:"text",name:"name",title:(0,c.getLocString)("presets.toolbox.categoryName"),isUnique:!0,visible:!1,isRequired:!0},{type:"text",name:"title",title:(0,c.getLocString)("presets.toolbox.categoryTitle"),visible:!1},{type:"dropdown",name:"iconName",title:(0,c.getLocString)("presets.toolbox.iconName"),itemComponent:"svc-presets-icon-item",allowCustomChoices:!0,choices:this.iconList,visible:!1},{type:"text",name:"tooltip",title:(0,c.getLocString)("presets.toolbox.tooltip"),visible:!1}],visible:!1},{type:"presetjson",name:"json",startWithNewLine:!1,renderAs:"default-comment",title:(0,c.getLocString)("presets.toolbox.jsonObject"),validators:[{type:"expression",text:"JSON should be correct",expression:"validateToolboxJson({json})"}],visible:!1}]},n=l(l({},o),e);return t&&n.detailElements.push(this.createItemsMatrixJSON({allowAddRows:!0,addRowText:(0,c.getLocString)("presets.toolbox.addNewSubitem"),addRowButtonLocation:"bottom",name:this.nameSubitems,valueName:"subitems",titleLocation:"hidden",startWithNewLine:!1},!1)),n},t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.toolbox.title"),description:(0,c.getLocString)("presets.toolbox.description"),navigationTitle:(0,c.getLocString)("presets.toolbox.navigationTitle"),elements:[{type:"panel",name:this.mainPanelName,elements:[{type:"matrixdynamic",name:this.nameCategories,title:(0,c.getLocString)("presets.toolbox.toolbox"),visibleIf:this.getTextVisibleIf(this.nameCategoriesMode,"categories"),allowRowReorder:!0,allowAddRows:!0,addRowButtonLocation:"top",noRowsText:(0,c.getLocString)("presets.toolbox.noCategoriesText"),addRowText:(0,c.getLocString)("presets.toolbox.addCustomCategory"),showHeader:!1,columns:[{cellType:"text",name:"category",isUnique:!0,isRequired:!0,visible:!1},{cellType:"text",name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"category",title:(0,c.getLocString)("presets.toolbox.categoryName"),isRequired:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.toolbox.categoryTitle"),visible:!1},{type:"text",name:"tooltip",title:(0,c.getLocString)("presets.toolbox.tooltip"),visible:!1},this.createItemsMatrixJSON({name:this.nameInnerMatrix,titleLocation:"hidden",allowAddRows:!0,addRowButtonLocation:"bottom",noRowsText:(0,c.getLocString)("presets.toolbox.noItemsText"),addRowText:(0,c.getLocString)("presets.toolbox.addNewItem"),valueName:"items"},!0)]},this.createItemsMatrixJSON({name:this.nameItems,title:(0,c.getLocString)("presets.toolbox.toolbox"),addRowButtonLocation:"top",noRowsText:(0,c.getLocString)("presets.toolbox.noItemsText"),addRowText:(0,c.getLocString)("presets.toolbox.addCustomItem"),startWithNewLine:!1,visibleIf:this.getTextVisibleIf(this.nameCategoriesMode,"items")},!0),this.createItemsMatrixJSON({allowAddRows:!0,title:(0,c.getLocString)("presets.toolbox.hiddenItems"),noRowsText:(0,c.getLocString)("presets.toolbox.noHiddenItemsText"),descriptionLocation:"underInput",addRowButtonLocation:"bottom",addRowText:(0,c.getLocString)("presets.toolbox.addNewItem"),startWithNewLine:!1,name:this.nameMatrix},!0)]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"boolean",name:this.nameCategoriesMode,title:(0,c.getLocString)("presets.toolbox.enableGrouping"),titleLocation:"hidden",defaultValue:"categories",valueTrue:"categories",valueFalse:"items",clearIfInvisible:"onHidden",renderAs:"switch"},{type:"boolean",name:this.nameShowCategoryTitles,title:(0,c.getLocString)("presets.toolbox.showCategoryTitles"),defaultValue:!1,useTitleAsLabel:!0,visibleIf:this.getTextVisibleIf(this.nameCategoriesMode,"categories"),clearIfInvisible:"onHidden",renderAs:"switch"}]}]}},Object.defineProperty(t.prototype,"nameCategoriesMode",{get:function(){return this.fullPath+"_mode"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameItems",{get:function(){return this.fullPath+"_items"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameSubitems",{get:function(){return"subitems"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameShowCategoryTitles",{get:function(){return this.fullPath+"_showCategoryTitles"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.nameCategories,this.nameItems,this.nameMatrix,this.nameShowCategoryTitles,this.nameCategoriesMode]},enumerable:!1,configurable:!0}),t.prototype.hasIcon=function(e){return e!==this.nameCategories&&e!==this.nameSubitems},t.prototype.getDefaultItems=function(e){return(null==e?void 0:e.name)===this.nameCategories?this.defaultCategories:u(u([],this.defaultItems,!0),this.defaultSubitems,!0)},t.prototype.updateRowAction=function(t,o,n,i,r){e.prototype.updateRowAction.call(this,t,o,n,i,r),"show-detail"==r.id&&t.name!=this.nameCategories&&(r.visible=o.isDetailPanelShowing||!!n.subitems)},t.prototype.findItem=function(e,t,o){return o?e.map(function(e){return e.items.filter(function(e){return e.name==t})[0]}).filter(function(e){return!!e})[0]:e.filter(function(e){return e.name==t})[0]},t.prototype.moveToSubitems=function(e,t,o,n,i){void 0===i&&(i=!1);var r=this.ejectRowData(t,o,i),s=this.itemMenuCategoriesEnabled(e),a=s?this.getQuestionCategories(e):this.getQuestionItems(e),l=JSON.parse(JSON.stringify(a.value)),u=this.findItem(l,n,s);u&&(u.subitems||(u.subitems=[]),u.subitems.push(r)),a.value=l},t.prototype.getExistingKeys=function(t,o){var n=e.prototype.getExistingKeys.call(this,t,o),i=t.getQuestionByName(this.nameItems).value||[],r=u(u([],n,!0),i,!0),s=r.map(function(e){return e.subitems||[]}).flat();return u(u([],r,!0),s,!0)},t.prototype.itemMenuCategoriesEnabled=function(e){return"items"!==e.getValue(this.nameCategoriesMode)},t.prototype.getItemMenuActionsCore=function(t,o,n){var i=this,r=this.getQuestionCategories(t).value,s=e.prototype.getItemMenuActionsCore.call(this,t,o,n),a=this.itemMenuCategoriesEnabled(t),l=r.map(function(e){var r=new p.Action({id:"tosubitemcategory-"+e.category,title:e.title});if(e.items){var s=e.items.filter(function(e){var t;return e.name!=(null===(t=n.value)||void 0===t?void 0:t.name)}).map(function(e){return new p.Action({id:"tosubitem-"+e.name,title:e.title,action:function(){i.moveToSubitems(t,o,n,e.name,!0)}})});i.setSubitemsToAction(r,s)}return r}),u=a?l:l.map(function(e){return e.items}).flat(),d=o.visibleRows.indexOf(n),m=o.value[d];if(!m.subitems){o.name!=this.nameItems&&o.name!=this.nameInnerMatrix||(s.push(new p.Action({id:"subcategories",title:(0,c.getLocString)("presets.toolbox.subitems"),css:"sps-list__item--label",enabled:!1,needSeparator:!0})),s.push(new p.Action({id:"convert-to-subcategory",title:(0,c.getLocString)("presets.toolbox.enableSubitems"),action:function(){var e=a?i.getQuestionCategories(t):i.getQuestionItems(t),r=JSON.parse(JSON.stringify(e.value)),s=i.findItem(r,m.name,a);s&&(s.subitems=[]),e.value=r,i.updateMatrixRowActions(t,o),n.showDetailPanel()}})));var g=new p.Action({id:"move-as-subitem",title:(0,c.getLocString)("presets.toolbox.moveAsSubitem"),needSeparator:!0});this.setSubitemsToAction(g,u),s.push(g)}return s},t.prototype.getJsonValueCore=function(e,t,o){var n={},i=this.getJsonItemsDefinition(e);i&&(n.definition=i);var r=e.getValue(this.nameCategoriesMode),s=(t.toolbox,null==o?void 0:o.categories);if("categories"===r){var a=this.getCategoriesJson(e);Array.isArray(a)&&a.length>0&&!this.isCategoriesSame(a,s)&&(n.categories=this.getCategoriesJson(e))}else n.categories=[];return e.getValue(this.nameShowCategoryTitles)&&(n.showCategoryTitles=!0),Object.keys(n).length>0?n:void 0},t.prototype.getDefaultJsonValueCore=function(e){return{categories:e.toolbox.categories.map(function(e){return{category:e.name,title:e.title,items:e.items.map(function(e){return e.name})}})}},t.prototype.isCategoriesSame=function(e,t){if(e.length!==t.length)return!1;for(var o=0;o<e.length;o++){if(e[o].category!==t[o].category)return!1;var n=t[o].items,i=e[o].items;if(!p.Helpers.isTwoValueEquals(i,n))return!1}return!0},t.prototype.getCategoriesJson=function(e){var t=e.getValue(this.nameCategories);if(Array.isArray(t))return t.map(function(e){var t;return{category:e.category,items:null===(t=e.items)||void 0===t?void 0:t.map(function(e){return e.name})}})},t.prototype.cleanIfNotDiffers=function(e,t){if(!t)return!0;var o=!1;return Object.keys(l(l({},e),t)).forEach(function(n){p.Helpers.isTwoValueEquals(e[n],t[n])?"name"!==n&&delete e[n]:o=!0}),o},t.prototype.getJsonItemsDefinition=function(e){var t=this,o=(("items"===e.getValue(this.nameCategoriesMode)?e.getValue(this.nameItems):(e.getValue(this.nameCategories)||[]).map(function(e){return e.items}).flat())||[]).map(function(e){return l({},e)}),n=!1;return o.forEach(function(e){var o=t.defaultItems.filter(function(t){return t.name==e.name})[0];!e.subitems&&(null==o?void 0:o.subitems)&&(e.subitems=[]),t.cleanIfNotDiffers(e,o)&&(n=!0)}),n||p.Helpers.isTwoValueEquals(o.map(function(e){return e.name}),this.defaultItems.map(function(e){return e.name}))||(n=!0),n?o:void 0},t.prototype.isItemsMatrix=function(t){return t===this.nameItems||t===this.nameSubitems||e.prototype.isItemsMatrix.call(this,t)},t.prototype.onMatrixRowRemoving=function(t,o,n){n.question.name==this.nameMatrix&&"items"===t.getValue(this.nameCategoriesMode)&&this.restoreItems(this.getQuestionItems(t),n.question,n.rowIndex),e.prototype.onMatrixRowRemoving.call(this,t,o,n)},t.prototype.setupOnCurrentPageCore=function(e,t,o){t.toolbox.forceCompact=!o,t.toolbox.isCompact=!o,t.readOnly!=o&&t.setPropertyValue("readOnly",o),t.toolbox.items.forEach(function(e){return e.enabled=o}),t.toolbox.enabled=o},t.prototype.setupQuestionsCore=function(t,o){e.prototype.setupQuestionsCore.call(this,t,o),this.setupDefaults(t,o.creator)},t.prototype.setupDefaults=function(e,t){var o=this,n=t.toolbox.getDefaultItems([],!0,!0,!0),i=t.toolbox.getDefaultCategories();this.defaultItems=n.map(function(e){return o.createToolboxItemRow(e)}),this.defaultSubitems=[],n.forEach(function(e){var t;e.items&&(t=o.defaultSubitems).push.apply(t,e.items.map(function(e){return o.createToolboxItemRow(e)}))}),this.defaultCategories=i.map(function(e){return o.createToolboxCategoryRow(e)})},t.prototype.setupQuestionsValueCore=function(e,t,o){var n=this.defaultItems.reduce(function(e,t){return e[t.name]=t,e},{}),i=this.defaultCategoriesMap;this.defaultItems.filter(function(e){return e.subitems}).map(function(e){return e.subitems.forEach(function(e){return n[e.name]=e})});var r=((t=t||{}).definition||[]).map(function(e){return"string"==typeof e?{name:e}:e}),s=t.categories||[];r=0===r.length?this.defaultItems:r.map(function(e){return l(l({},n[e.name]||{}),e)});var a={};r.forEach(function(e){return a[e.name]=l(l({},e),{subitems:e.subitems&&e.subitems.map(function(e){return l(l({},n[e.name]||{}),e)})})}),(s=0===s.length?this.defaultCategories:s.map(function(e){return l(l(l({},i[e.category]),e),{items:e.items.map(function(e){return a[e]}).filter(function(e){return!!e})})})).filter(function(e){return e.items}).forEach(function(e){return e.items.forEach(function(e){return delete n[e.name]})});var u=this.defaultItems.filter(function(e){return n[e.name]});e.setValue(this.nameMatrix,u),e.setValue(this.nameCategories,s),this.updateItemsFromCategories(e),this.updateShowCategoriesTitlesElements(e)},t.prototype.onLocaleChangedCore=function(e,t,o){this.setupDefaults(e,o),this.setupQuestionsValueCore(e,t,o)},t.prototype.updateItemsFromCategories=function(e){this.getQuestionItems(e).value=this.getQuestionCategories(e).value.map(function(e){return u([],e.items||[],!0)}).flat()},t.prototype.updateCategoriesFromItems=function(e){var t=this,o=this.getQuestionCategories(e).value,n=u([],this.getQuestionItems(e).value,!0).reduce(function(e,t){return e[t.name]=t,e},{});o.forEach(function(e){e.items=e.items.map(function(e){var t=n[e.name];return delete n[e.name],t}).filter(function(e){return!!e})});var i=Object.keys(n);if(i.length>0){var r=this.findOrCreateCategory(o,"general");r.items=r.items.concat(i.map(function(e){return t.createToolboxItemRow(n[e])}))}this.getQuestionCategories(e).value=o},t.prototype.updateOnValueChangedCore=function(t,o){e.prototype.updateOnValueChangedCore.call(this,t,o),o===this.nameCategoriesMode&&("items"==t.getValue(this.nameCategoriesMode)?this.updateItemsFromCategories(t):this.updateCategoriesFromItems(t)),o===this.nameShowCategoryTitles&&this.updateShowCategoriesTitlesElements(t)},t.prototype.updateShowCategoriesTitlesElements=function(e){var t=this;e.getValue(this.nameShowCategoryTitles),this.getQuestionCategories(e).visibleRows.forEach(function(e){var o=e.getValue("category"),n=t.getCategoryTitle(o);n&&(e.getQuestionByName("category").readOnly=!0);var i=e.getQuestionByName("title");i.isEmpty()&&(i.value=n)})},t.prototype.getCategoryTitle=function(e){return c.editorLocalization.getString(y+"."+e)},t.prototype.setJsonLocalizationStringsCore=function(e,t){function o(e,t){e&&e.visibleRows.forEach(function(e){d.updateModifiedText(t,e.getValue("title"),"qt."+e.getValue("name"))})}o(this.getQuestionItems(e),t);var n=this.getQuestionCategories(e),i=this.defaultCategoriesMap;n.isVisible&&n.visibleRows.forEach(function(e){var n,r=e.getValue("category");e.getValue("title")!==(null===(n=i[r])||void 0===n?void 0:n.title)&&(t[y]||(t[y]={}),t[y][r]=e.getValue("title")),o(e.getQuestionByName("items"),t)})},t.prototype.getQuestionItems=function(e){return e.getQuestionByName(this.nameItems)},t.prototype.createToolboxItemRow=function(e){var t,o=this,n={name:e.name,title:e.title,iconName:e.iconName,tooltip:e.tooltip,json:e.json,subitems:null===(t=e.items)||void 0===t?void 0:t.map(function(e){return o.createToolboxItemRow(e)})};for(var i in n)void 0===n[i]&&delete n[i];return n},t.prototype.createToolboxCategoryRow=function(e){var t,o=this,n={category:e.name,title:e.title,items:null===(t=e.items)||void 0===t?void 0:t.map(function(e){return o.createToolboxItemRow(e)})};for(var i in n)void 0===n[i]&&delete n[i];return n},t}(f),b=function(e){function t(t,o,n){return e.call(this,t,null,o,null,null,null,n)||this}return a(t,e),t.prototype.getIsPropertyVisible=function(e){return!1!==e.visible},t}(c.SurveyQuestionProperties),x=["question","matrixdropdownbase","selectbase","panelbase","matrixdropdowncolumn@default","matrixdropdowncolumn@selectbase"],w=function(){function e(e,t){var o=this;this.className=e,this.currentJson=t,this.propertiesHash={},this.classes=new Array;var n={},i=this.createObj();this.obj=i,this.properties=new b(i,e,t);var r=this.properties.getAllVisiblePropertiesNames(!0),s={};p.Serializer.getPropertiesByObj(i).forEach(function(e){return s[e.name]=e}),r.forEach(function(e){var t=s[e];if(t){var i=o.getPropClassName(t);o.propertiesHash[e]=i,n[i]=!0}});for(var a=0;a<x.length;a++){var l=x[a];n[l]&&this.classes.push(l)}this.classes.indexOf(e)<0&&this.classes.push(e),this.propertyGridValue=this.createPropertyGrid(i,this.currentJson),this.propertyGridDefaultValue=this.createPropertyGrid(i)}return e.prototype.getObj=function(){return this.obj},e.prototype.createPropertyGrid=function(e,t){var o=new c.PropertyGridModel(void 0,void 0,t);return o.showOneCategoryInPropertyGrid=!0,o.obj=e,o},e.prototype.createObj=function(){if("survey"===this.className)return new p.SurveyModel;var e=this.className.indexOf("@");if(e<0)return p.Serializer.createClass(this.className);var t=this.className.substring(0,e),o=this.className.substring(e+1),n=p.Serializer.createClass(t);return n.cellType&&(n.cellType=o),n},e.prototype.getInitialJson=function(e){var t=e?this.propertyGridDefaultValue:this.propertyGridValue;return t.survey.toJSON().pages.filter(function(e){return e.name!=t.placeholderPageName}).map(function(e){var t;return{category:e.name,title:e.title,iconName:e.iconName,properties:null===(t=e.elements)||void 0===t?void 0:t.filter(function(e){return e.name&&-1==e.name.indexOf("overridingProperty")}).map(function(e){var t={name:e.name,title:e.title};return void 0!==e.description&&(t.description=e.description),t})}})},Object.defineProperty(e.prototype,"propertyGridDefault",{get:function(){return this.propertyGridDefaultValue},enumerable:!1,configurable:!0}),e.prototype.getPropertyClassName=function(e){return this.propertiesHash[e]},e.prototype.updateCurrentJson=function(e){this.updateCurrentJsonCore(this.currentJson.classes,e)},e.prototype.updateCurrentJsonCore=function(e,t){var o=this;Array.isArray(t)||(t=[]);var n=[];this.classes.forEach(function(i){o.updateCurrentJsonClass(e,t,i,n)})},e.prototype.updateCurrentJsonClass=function(e,t,o,n){var i=this,r=[],s=[];t.forEach(function(e){var t=e.items;if(Array.isArray(t)){var a=[];i.classes.forEach(function(e){return a.push(0)});for(var l={},u=0;u<t.length;u++){var p=i.propertiesHash[t[u]],c=i.classes.indexOf(p);if(!(c<0)){for(var d=1e4/Math.pow(10,c),m=0,g=0;g<=c;g++)a[g]>m&&(m=a[g]);var h=m+d;l[t[u]]=h,a[c]=h}}t.forEach(function(t){if(i.propertiesHash[t]===o){var a=e.name;a&&n.indexOf(e.name)<0&&(n.push(e.name),s.push({name:e.name,index:100*n.length,iconName:e.iconName}));var u={name:t,index:l[t]};a&&(u.tab=a),r.push(u)}})}}),e[o]={properties:r,tabs:s}},e.prototype.getPropClassName=function(e){for(var t=e.classInfo.name,o=1;o<x.length;o++){var n=x[o];if(t===n||p.Serializer.isDescendantOf(t,n))return this.getClassName(n)}return t===this.className?this.className:this.getClassName("question")},e.prototype.getClassName=function(e){var t=this.className.indexOf("@");if(t<0)return e;var o=this.className.substring(0,t);return o!==e&&"question"!==e||(e="default"),o+"@"+e},e}(),C=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.firstTimeLoading=!1,t}return a(t,e),Object.defineProperty(t.prototype,"nameInnerMatrix",{get:function(){return"properties"},enumerable:!1,configurable:!0}),t.prototype.createItemsMatrixJSON=function(e){var t={type:"matrixdynamic",allowRowReorder:!0,cellType:"text",showHeader:!1,rowCount:0,allowAddRows:!1,addRowButtonLocation:"top",addRowText:"Add Custom Item",noRowsText:"There are no items",columns:[{name:"name",visible:!1},{name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"name",title:(0,c.getLocString)("presets.propertyGrid.name"),isUnique:!0,isRequired:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.propertyGrid.titleField"),isUnique:!0,isRequired:!0,visible:!1},{type:"comment",name:"description",title:(0,c.getLocString)("presets.propertyGrid.descriptionField"),visible:!1}]};return l(l({},t),e)},t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.propertyGrid.title"),navigationTitle:(0,c.getLocString)("presets.propertyGrid.navigationTitle"),description:(0,c.getLocString)("presets.propertyGrid.description"),elements:[{type:"dropdown",name:this.nameSelector,allowClear:!1,clearIfInvisible:"onHidden",title:(0,c.getLocString)("presets.propertyGrid.selectElement")},{type:"panel",name:this.mainPanelName,visibleIf:this.getNotEmptyVisibleIf(this.nameSelector),elements:[{type:"matrixdynamic",name:this.nameCategories,title:(0,c.getLocString)("presets.propertyGrid.propertyGrid"),allowRowReorder:!0,addRowButtonLocation:"top",rowCount:0,allowAddRows:!0,noRowsText:(0,c.getLocString)("presets.propertyGrid.noCategoriesText"),addRowText:(0,c.getLocString)("presets.propertyGrid.addCustomCategory"),showHeader:!1,columns:[{cellType:"text",name:"category",isUnique:!0,isRequired:!0,visible:!1},{type:"boolean",name:"isDefault",visible:!1},{cellType:"text",name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"category",title:(0,c.getLocString)("presets.propertyGrid.categoryName"),isRequired:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.propertyGrid.categoryTitle"),visible:!1},{type:"dropdown",name:"iconName",title:(0,c.getLocString)("presets.propertyGrid.iconName"),itemComponent:"svc-presets-icon-item",allowCustomChoices:!0,choices:this.iconList,visible:!1},this.createItemsMatrixJSON({name:this.nameInnerMatrix,noRowsText:(0,c.getLocString)("presets.propertyGrid.noItemsText"),titleLocation:"hidden"})]},this.createItemsMatrixJSON({title:(0,c.getLocString)("presets.propertyGrid.hiddenItems"),name:this.nameMatrix,noRowsText:(0,c.getLocString)("presets.propertyGrid.noHiddenItemsText"),descriptionLocation:"underInput",startWithNewLine:!1})]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"html",html:" "}]}]}},t.prototype.propertyGridSetObj=function(e){var t,o=null===(t=this.propertyGrid.survey.currentPage)||void 0===t?void 0:t.name;this.propertyGrid.setObj(e),this.propertyGrid.survey.currentPage=this.propertyGrid.survey.getPageByName(o)},t.prototype.hasIcon=function(e){return e==this.nameCategories},t.prototype.restoreValuesFromDefault=function(e){this.isModified=!1,this.currentJson=this.copyJson(c.defaultPropertyGridDefinition),this.updateMatrices(e)},t.prototype.getJsonValueCore=function(e,t,o){if(this.isModified)return{definition:this.currentJson}},t.prototype.setupPageQuestions=function(e,t){this.getSelector(e).choices=this.getSelectorChoices(t);var o=c.settings.propertyGrid.enableSearch;c.settings.propertyGrid.enableSearch=!1,c.settings.propertyGrid.enableSearch=o},t.prototype.setupQuestionsCore=function(t,o){this.propertyGrid=o.creator.designerPropertyGrid,e.prototype.setupQuestionsCore.call(this,t,o),this.setupPageQuestions(t,o.creator)},t.prototype.setJSONForTitlesAndDescriptions=function(e,t){var o=this.localeStrings[t];Object.keys(o).length>0&&(e[t]=o)},t.prototype.onLocaleChangedCore=function(e,t,o){this.setupPageQuestions(e,o),this.setupQuestionsValueCore(e,t,o)},t.prototype.setJsonLocalizationStringsCore=function(e,t){this.setJSONForTitlesAndDescriptions(t,"pe"),this.setJSONForTitlesAndDescriptions(t,"pehelp")},t.prototype.updateJsonLocalizationStringsCore=function(e){this.localeStrings={pe:e.pe||{},pehelp:e.pehelp||{}}},t.prototype.setupOnCurrentPageCore=function(e,t,o){var n;t.setSidebarEnabled(o),this.propertyGridSetObj(o?null===(n=this.currentProperties)||void 0===n?void 0:n.getObj():null)},t.prototype.updateOnValueChangedCore=function(t,o){var n,i=this;if(e.prototype.updateOnValueChangedCore.call(this,t,o),o==this.nameCategories){this.firstTimeLoading||(this.isModified=!0);var r=this.getQuestionCategories(t);r.isVisible&&(null===(n=r.value)||void 0===n||n.forEach(function(e){var t,o=e.category,n=e.title;e.title!==c.editorLocalization.getString("pe.tabs."+o)&&(i.ensureLocalizationPath("pe.tabs"),i.localeStrings.pe.tabs[o]=n),null===(t=e.properties)||void 0===t||t.forEach(function(e){e.title!==c.editorLocalization.getString("pe."+e.name)&&i.changePropTitleAndDescription("pe",e.name,e.title),e.description!==c.editorLocalization.getString("pehelp."+e.name)&&i.changePropTitleAndDescription("pehelp",e.name,e.description)})})),this.firstTimeLoading||this.updateCurrentJson(t)}if(o===this.nameSelector){this.firstTimeLoading=!0,this.currentProperties&&(this.currentProperties=void 0);var s=this.getSelector(t);this.currentClassName=s.value,this.updateMatrices(t),this.firstTimeLoading=!1}},t.prototype.updateMatrices=function(e){if(this.currentClassName){this.currentProperties=new w(this.currentClassName,this.currentJson),this.setupDefaults(e);var t=this.currentProperties.getInitialJson(!1);e.setValue(this.nameCategories,t);var o=this.getCurrentlyHiddenItems(t);e.setValue(this.nameMatrix,o),this.propertyGridSetObj(this.currentProperties.getObj())}},t.prototype.getCurrentlyHiddenItems=function(e){var t=["progressBarInheritWidthFrom"],o={};return this.defaultItems.forEach(function(e){return o[e.name]=e}),e.filter(function(e){return e.properties}).forEach(function(e){return e.properties.forEach(function(e){return delete o[e.name]})}),Object.keys(o).map(function(e){return o[e]}).filter(function(e){return-1==t.indexOf(e.name)})},t.prototype.setupDefaults=function(e){var t,o=this,n=(null===(t=this.currentProperties)||void 0===t?void 0:t.getInitialJson(!0))||[];this.defaultCategories=u([],n,!0),this.defaultItems=[],n.forEach(function(e){var t;return(t=o.defaultItems).push.apply(t,e.properties)})},t.prototype.setupQuestionsValueCore=function(e,t,o){this.getSelector(e).value="survey";var n=o.getPropertyGridDefinition();this.isModified=!!(null==t?void 0:t.definition)||n&&JSON.stringify(n)!==JSON.stringify(c.defaultPropertyGridDefinition),this.currentJson=(null==t?void 0:t.definition)||this.copyJson(n||c.defaultPropertyGridDefinition),this.currentJson.autoGenerateProperties=!1,this.updateOnValueChangedCore(e,this.nameSelector)},t.prototype.getSelector=function(e){return e.getQuestionByName(this.nameSelector)},Object.defineProperty(t.prototype,"nameSelector",{get:function(){return this.fullPath+"_selector"},enumerable:!1,configurable:!0}),t.prototype.getSelectorChoices=function(e){var t=this,o=["survey","page"];e.toolbox.getDefaultItems([],!1,!0,!0).forEach(function(e){o.push(e.id)});var n=[];o.forEach(function(e){return n.push(new p.ItemValue(e,t.getSelectorItemTitle(e)))});var i="matrixdropdowncolumn@";for(var r in n.push(new p.ItemValue(i+"default",this.getColumnItemTitle(""))),p.matrixDropdownColumnTypes)n.push(new p.ItemValue(i+r,this.getColumnItemTitle(r)));return n},t.prototype.getSelectorItemTitle=function(e){return"survey"===e?c.editorLocalization.getString("ed.surveyTypeName"):"page"===e?c.editorLocalization.getString("ed.pageTypeName"):c.editorLocalization.getString("qt."+e)},t.prototype.getColumnItemTitle=function(e){return c.editorLocalization.getString("ed.columnTypeName")+": "+(e?this.getSelectorItemTitle(e):"default")},t.prototype.updateCurrentJson=function(e){this.currentProperties&&this.currentProperties.updateCurrentJson(this.getPropertiesArray(e))},t.prototype.getPropertiesArray=function(e){var t=this.getQuestionCategories(e).value;return null==t?void 0:t.map(function(e){var t;return{name:e.category,items:null===(t=e.properties)||void 0===t?void 0:t.map(function(e){return e.name}),iconName:e.iconName}})},t.prototype.changePropTitleAndDescription=function(e,t,o){this.ensureLocalizationPath(e);var n=this.localeStrings[e],i=this.currentProperties.getPropertyClassName(t);i&&(n[i]||(n[i]={}),n[i][t]=o)},t.prototype.ensureLocalizationPath=function(e){this.localeStrings||(this.localeStrings={});for(var t=e.split("."),o=this.localeStrings,n=0;n<t.length;n++){var i=t[n];o[i]||(o[i]={}),o=o[i]}},t}(f),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createItemsMatrixJSON=function(e){var t={type:"matrixdynamic",name:"items",allowRowReorder:!0,cellType:"text",showHeader:!1,rowCount:0,allowAddRows:!1,addRowButtonLocation:"top",addRowText:"Add Custom Item",noRowsText:"There are no items",columns:[{name:"name",visible:!1},{name:"title"}],detailPanelMode:"underRow",detailElements:[{type:"text",name:"name",title:(0,c.getLocString)("presets.tabs.name"),isUnique:!0,isRequired:!0,readOnly:!0,visible:!1},{type:"text",name:"title",title:(0,c.getLocString)("presets.tabs.titleField"),visible:!1},{type:"dropdown",name:"iconName",title:(0,c.getLocString)("presets.tabs.iconName"),itemComponent:"svc-presets-icon-item",allowCustomChoices:!0,choices:this.iconList,visible:!1}]};return l(l({},t),e)},t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.tabs.title"),description:(0,c.getLocString)("presets.tabs.description"),navigationTitle:(0,c.getLocString)("presets.tabs.navigationTitle"),elements:[{type:"panel",name:this.mainPanelName,elements:[this.createItemsMatrixJSON({title:(0,c.getLocString)("presets.tabs.items"),noRowsText:(0,c.getLocString)("presets.tabs.noItemsText"),name:this.nameItems}),this.createItemsMatrixJSON({startWithNewLine:!1,title:(0,c.getLocString)("presets.tabs.hiddenItems"),noRowsText:(0,c.getLocString)("presets.tabs.noHiddenItemsText"),name:this.nameMatrix,descriptionLocation:"underInput"})]},{type:"panel",name:"panel_tabs_controls",elements:[{type:"dropdown",name:this.nameActiveTab,allowClear:!1,title:(0,c.getLocString)("presets.tabs.defaultTab")}]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"html",html:" "}]}]}},Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.nameItems,this.nameActiveTab]},enumerable:!1,configurable:!0}),t.prototype.filterTabs=function(e){return e.filter(function(e){return"presets"!=e.name})},t.prototype.hasIcon=function(e){return!0},t.prototype.getJsonValueCore=function(e,t,o){var n=e.getQuestionByName(this.nameItems).value;if(Array.isArray(n)){var i=this.filterTabs((null==o?void 0:o.items)||t.getTabs()),r=t.getTabsInfo(),s=n.map(function(e){return{name:e.name,iconName:e.iconName}});s.forEach(function(e){var t;e.iconName&&e.iconName!=(null===(t=r[e.name])||void 0===t?void 0:t.iconName)||delete e.iconName}),p.Helpers.isArraysEqual(s,i,!1)&&(s=void 0);var a=e.getValue(this.nameActiveTab);if(s||a!==((null==o?void 0:o.activeTab)||t.activeTab)||(a=void 0),s||a){var l={};return s&&(l.items=s),a&&(l.activeTab=a),l}}},t.prototype.getDefaultJsonValueCore=function(e){return{activeTab:e.activeTab,items:this.filterTabs(e.getTabs()).map(function(e){return{name:e.name}})}},t.prototype.getQuestionItems=function(e){return e.getQuestionByName(this.nameItems)},t.prototype.onMatrixRowRemoving=function(t,o,n){n.question.name===this.nameMatrix&&this.restoreItems(this.getQuestionItems(t),n.question,n.rowIndex),e.prototype.onMatrixRowRemoving.call(this,t,o,n)},t.prototype.isItemsMatrix=function(t){return t===this.nameItems||e.prototype.isItemsMatrix.call(this,t)},t.prototype.setJsonLocalizationStringsCore=function(e,t){this.getQuestionItems(e).visibleRows.forEach(function(e){d.updateModifiedText(t,e.getValue("title"),"tabs."+e.getValue("name"))})},t.prototype.setupQuestionsCore=function(e,t){this.setupPageQuestions(e,t.creator)},t.prototype.getAllTabs=function(e){return this.filterTabs(e.getAvailableTabs().map(function(e){return{name:e.name,title:c.editorLocalization.getString("tabs."+e.name),iconName:e.iconName}}))},t.prototype.setupOnCurrentPageCore=function(e,t,o){t.tabs.forEach(function(e){return e.enabled=o})},t.prototype.setupQuestionsValueCore=function(e,t,o){var n=((t=t||{}).items||[]).map(function(e){return"string"==typeof e?{name:e}:e}),i=o.initialTabs(),r=this.getAllTabs(o),s=r.filter(function(e){return i.indexOf(e.name)>=0});if(0===n.length)n=s;else for(var a=function(e){var t=s.filter(function(t){return t.name==n[e].name})[0];t&&(n[e]=l(l({},t),n[e]))},u=0;u<n.length;u++)a(u);var c=n.map(function(e){return e.name}),d=r.filter(function(e){return c.indexOf(e.name)<0});e.setValue(this.nameItems,n),e.setValue(this.nameMatrix,d),e.setValue(this.nameActiveTab,t.activeTab||o.activeTab),e.getQuestionByName(this.nameActiveTab).choices=n.map(function(e){return new p.ItemValue(e.name,e.title)})},t.prototype.onLocaleChangedCore=function(e,t,o){this.setupPageQuestions(e,o),this.setupQuestionsValueCore(e,t,o)},t.prototype.setupPageQuestions=function(e,t){this.defaultItems=this.getAllTabs(t),e.getQuestionByName(this.nameActiveTab).choices=this.defaultItems.map(function(e){return new p.ItemValue(e.name,e.title)})},t.prototype.updateOnValueChangedCore=function(t,o){if(e.prototype.updateOnValueChangedCore.call(this,t,o),o===this.nameItems){var n=t.getValue(o)||[],i=t.getQuestionByName(this.nameActiveTab);i.choices=n.map(function(e){return new p.ItemValue(e.name,e.title)}),i.selectedItem||i.selectItem(i.choices[0])}},Object.defineProperty(t.prototype,"nameActiveTab",{get:function(){return this.path+"_activeTab"},enumerable:!1,configurable:!0}),t}(g);p.FunctionFactory.Instance.register("searchItem",function(e){var t=this.survey.getQuestionByName(e[0]),o=e[1],n=e[2];if(!n)return!0;var i=t.choices.filter(function(e){return e.value==o})[0];return!i||-1!=i.text.toUpperCase().indexOf(n.toUpperCase())});var S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.createMainPageCore=function(){return{title:(0,c.getLocString)("presets.languages.title"),description:(0,c.getLocString)("presets.languages.description"),navigationTitle:(0,c.getLocString)("presets.languages.navigationTitle"),elements:[{type:"dropdown",title:(0,c.getLocString)("presets.languages.creatorUI"),placeholder:c.editorLocalization.getLocaleName(""),name:this.creatorLocaleName,searchEnabled:!0,choices:this.getCreatorLocales()},{type:"panel",title:(0,c.getLocString)("presets.languages.surveyLanguages"),elements:[{type:"text",name:this.searchLocalesName,placeholder:(0,c.getLocString)("presets.languages.searchPlaceholder"),titleLocation:"hidden",textUpdateMode:"onTyping"},{type:"checkbox",name:this.surveyLocalesName,titleLocation:"hidden",minSelectedChoices:1,colCount:3,showSelectAllItem:!0,choices:this.getSurveyLocales(),choicesVisibleIf:"searchItem('"+this.surveyLocalesName+"', {item}, {"+this.searchLocalesName+"}"}]},{type:"panel",title:" ",name:this.navigationPanelName,elements:[{type:"boolean",name:this.surveyUseEnglishNames,title:(0,c.getLocString)("presets.languages.translateToEnglish"),titleLocation:"hidden",renderAs:"switch"}]}]}},t.prototype.getMainElementNames=function(){return[this.surveyLocalesName]},t.prototype.getCustomQuestionCssSuffix=function(e){return e.name===this.searchLocalesName?"search":""},t.prototype.getJsonValueCore=function(e,t,o){var n=e.getValue(this.creatorLocaleName),i=!0===e.getValue(this.surveyUseEnglishNames),r=e.getQuestionByName(this.surveyLocalesName);if(n||!r.isAllSelected||i){var s={};return n&&(s.creator=n),i&&(s.useEnglishNames=!0),!r.isAllSelected&&Array.isArray(r.value)&&(s.surveyLocales=[],r.value.forEach(function(e){return s.surveyLocales.push(e)})),s}},t.prototype.setupQuestionsValueCore=function(e,t,o){t=t||{},e.setValue(this.creatorLocaleName,t.creator),e.setValue(this.surveyUseEnglishNames,!0===t.showInEnglish),this.updateLocaleNames(e);var n=e.getQuestionByName(this.surveyLocalesName),i=t.surveyLocales;Array.isArray(i)&&i.length>0?n.valule=i:n.selectAll()},t.prototype.updateOnValueChangedCore=function(e,t){t===this.surveyUseEnglishNames&&this.updateLocaleNames(e)},Object.defineProperty(t.prototype,"creatorLocaleName",{get:function(){return this.path+"_creator"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surveyLocalesName",{get:function(){return this.path+"_surveyLocales"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"searchLocalesName",{get:function(){return this.path+"_searchLocales"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"surveyUseEnglishNames",{get:function(){return this.path+"_surveyUseEnglishNames"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"questionNames",{get:function(){return[this.creatorLocaleName,this.surveyLocalesName,this.surveyUseEnglishNames]},enumerable:!1,configurable:!0}),t.prototype.getIsShowInEnglishSelected=function(e){return!0===e.getValue(this.surveyUseEnglishNames)},t.prototype.getCreatorLocales=function(){return this.getLocaleItemValues(c.editorLocalization.getLocales(),!1)},t.prototype.getSurveyLocales=function(){return this.getLocaleItemValues(p.surveyLocalization.getLocales(!0),!0)},t.prototype.getLocaleItemValues=function(e,t){var o=[];return e.forEach(function(e){if(e&&"en"!==e){var t=c.editorLocalization.getLocaleName(e);t&&t!==e&&o.push(new p.ItemValue(e,t))}}),t&&o.unshift(new p.ItemValue("en",c.editorLocalization.getLocaleName("en"))),o},t.prototype.updateLocaleNames=function(e){var t=this.getIsShowInEnglishSelected(e),o=e.getQuestionByName(this.surveyLocalesName);o.choices.forEach(function(e){e.text=c.editorLocalization.getLocaleName(e.value,null,t)}),o.choicesOrder="none",o.choicesOrder="asc"},t}(d),T=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.optionsList=[],t}return a(t,e),t.prototype.createElements=function(){return[{type:"panel",name:"designer",state:"expanded",elements:[{name:"pageEditMode",type:"dropdown",choices:[{value:"standard",text:"Standard"},{value:"single",text:"Single"},{value:"bypage",text:"By Page"}]},{type:"panel",name:"designerHeader",elements:[{name:"showSurveyHeader",type:"boolean"},{name:"showHeaderInEmptySurvey",type:"boolean"}]},{type:"panel",name:"designerTitles",elements:[{name:"useElementTitles",type:"boolean"}]},{type:"panel",name:"designerZoomDrag",elements:[{name:"allowDragPages",type:"boolean"},{name:"collapseOnDrag",type:"boolean"},{name:"allowZoom",type:"boolean"}]},{name:"expandCollapseButtonVisibility",type:"dropdown",choices:[{value:"never",text:"Never"},{value:"onhover",text:"On Hover"},{value:"always",text:"Always"}]},{type:"panel",name:"designerExpandCollapse",elements:[{name:"collapseQuestions",type:"boolean"},{name:"collapsePanels",type:"boolean"},{name:"collapsePages",type:"boolean"}]},{name:"maxRows",type:"text",inputType:"number"},{name:"maxColumns",type:"text",inputType:"number"},{type:"panel",name:"designerChoices",elements:[{name:"inplaceEditChoiceValues",type:"boolean"}]},{name:"minChoices",type:"text",inputType:"number"},{name:"maxChoices",type:"text",inputType:"number"},{name:"maxVisibleChoices",type:"text",inputType:"number"},{name:"maxRateValues",type:"text",inputType:"number"},{name:"forbiddenNestedElements",type:"text"},{name:"maxPanelNestingLevel",type:"text",inputType:"number"}]},{type:"panel",name:"preview",state:"expanded",elements:[{type:"panel",name:"previewSimulateDevice",elements:[{name:"previewAllowSimulateDevice",type:"boolean"}]},{name:"previewDevice",type:"dropdown",choices:[{value:"desktop",text:"Desktop"},{value:"iPhoneSE",text:"iPhone SE"},{value:"iPhone15",text:"iPhone 15"},{value:"iPhone15Plus",text:"iPhone 15 Plus"},{value:"iPad",text:"iPad"},{value:"iPadMini",text:"iPad Mini"},{value:"androidPhone",text:"Android Phone"},{value:"androidTablet",text:"Android Tablet"},{value:"microsoftSurface",text:"Microsoft Surface"}]},{name:"previewOrientation",type:"dropdown",choices:[{value:"landscape",text:"Landscape"},{value:"portrait",text:"Portrait"}]},{type:"panel",name:"previewAllowSelect",elements:[{name:"previewAllowSelectLanguage",type:"boolean"},{name:"previewAllowSelectPage",type:"boolean"}]},{name:"previewAllowHiddenElements",type:"boolean"}]},{type:"panel",name:"logic",state:"expanded",elements:[{name:"logicAllowTextEditExpressions",type:"boolean"},{name:"logicMaxItemsInCondition",type:"text",inputType:"number"}]},{type:"panel",name:"translation",state:"expanded",elements:[{name:"clearTranslationsOnSourceTextChange",type:"boolean"}]}]},t.prototype.addPathToName=function(e){return this.fullPath+"_"+e},t.prototype.patchElements=function(e){var t=this;return e.map(function(e){return"panel"===e.type?("expanded"==e.state&&(e.title=c.editorLocalization.getString("tabs."+e.name)),t.patchElements(e.elements)):(t.optionsList.push(e.name),e.title=e.name),"boolean"===e.type&&(e.renderAs="checkbox",e.useTitleAsLabel=!0),"dropdown"===e.type&&(e.searchEnabled=!1),e.name=t.addPathToName(e.name),e})},t.prototype.createMainPageCore=function(){return this.optionsList=[],{title:(0,c.getLocString)("presets.options.title"),description:(0,c.getLocString)("presets.options.description"),navigationTitle:(0,c.getLocString)("presets.options.navigationTitle"),elements:this.patchElements(this.createElements())}},t.prototype.getDefaultJsonValueCore=function(e){return this.optionsList.reduce(function(t,o){return t[o]=e[o],t},{})},t.prototype.getJsonValueCore=function(e,t,o){var n=this,i={};if(this.optionsList.forEach(function(t){var o=e.getQuestionByName(n.addPathToName(t));o&&(i[t]=o.value)}),!p.Helpers.isTwoValueEquals(i,o))return i},t.prototype.setupQuestionsValueCore=function(e,t,o){var n=this;this.optionsList.forEach(function(i){return e.getQuestionByName(n.addPathToName(i)).value=t?t[i]:o[i]})},Object.defineProperty(t.prototype,"questionNames",{get:function(){var e=this;return this.optionsList.map(function(t){return e.addPathToName(t)})},enumerable:!1,configurable:!0}),t.prototype.onGetPanelTitleActions=function(e,t,o){var n=this.fullPath+"_";o.panel.name.substring(0,n.length)===n&&(o.actions=[{id:"collapse",css:"sv-action-bar-item--collapse",locTooltipName:new p.ComputedUpdater(function(){return o.panel.isCollapsed?"ed.expandTooltip":"ed.collapseTooltip"}),iconName:new p.ComputedUpdater(function(){return o.panel.isCollapsed?"icon-expandpanel-16x16":"icon-collapsepanel-16x16"}),iconSize:"auto",action:function(){o.panel.isCollapsed?o.panel.expand():o.panel.collapse()}}])},t}(d),I={languages:{title:"Languages",navigationTitle:"Languages",description:"Select the language of the Survey Creator UI and target\nlanguages for the survey being configured.",creatorUI:"Survey Creator UI language",surveyLanguages:"Survey languages",searchPlaceholder:"Type to search...",translateToEnglish:"Translate language names to English"},tabs:{title:"Configure tabs",navigationTitle:"Tabs",description:"Select the tabs you want to show, reorder them, change their titles,\nand choose the tab that will be active by default.",items:"Visible tabs",hiddenItems:"Hidden tabs",defaultTab:"Default tab",noItemsText:"Drag tabs here to show them",noHiddenItemsText:"Drag tabs here to hide them",name:"Name",titleField:"Title",iconName:"Icon name"},toolbox:{title:"Set up the Toolbox",navigationTitle:"Toolbox",description:"Select the toolbox items you want to show, group them into categories, \nrename them, and change their order if required.",toolbox:"Toolbox",categories:"Categories",noCategoriesText:"No categories",noItemsText:"Drag items here to show them",noHiddenItemsText:"Drag items here to hide them",hiddenItems:"Hidden toolbox items",enableGrouping:"Enable grouping",showCategoryTitles:"Show category titles",categoryName:"Name",categoryTitle:"Title",tooltip:"Tooltip",iconName:"Icon name",jsonObject:"JSON object to apply when users select this toolbox item",subitems:"Subitems",enableSubitems:"Enable subitems for this question",moveAsSubitem:"Move as a subitem to...",addToToolbox:"Add to Toolbox",deleteCustomItem:"Delete Custom Item",addCustomCategory:"New Category",addCustomItem:"New Item",addNewItem:"Add a new item",addNewSubitem:"Add a new subitem",noRowsText:"There are no items",newItem:"New item in"},propertyGrid:{title:"Customize the Property Grid",navigationTitle:"Property Grid",description:"Hide, rename, reorder, or change property grouping in the Property Grid.",selectElement:"Select a survey element to customize",propertyGrid:"Property Grid",noCategoriesText:"No categories",noItemsText:"Drag properties here to show them",noHiddenItemsText:"Drag properties here to hide them",hiddenItems:"Hidden properties",categoryName:"Name",categoryTitle:"Title",iconName:"Icon name",name:"Name",titleField:"Title",descriptionField:"Helper text",addCustomCategory:"New Category"},options:{title:"Options",navigationTitle:"Options",description:"Detailed configuration settings for Survey Creator."},items:{addNewItem:"Add a new item",addNewSubitem:"Add a new subitem",newItem:"New item in",addCustomCategory:"New Category",newCategory:"New category in",moveToCategory:"Move to category...",moveToNewCategory:"Move to new category",categoriesLabel:"Categories",moveTo:"Move To...",removeFrom:"Remove from {0}",more:"More",restoreToDefault:"Restore",edit:"Edit",expand:"Expand",collapse:"Collapse",remove:"Remove",add:"Add",delete:"Delete"},editor:{title:"Creator Presets",presetJson:"Preset JSON:",copy:"Copy",download:"Download",load:"Load",saveExit:"Save & Exit",back:"Back",resetToDefault:"Reset",resetToDefaults:"All settings restored to default",resoredToDefault:"resored to default",itemRestoredToDefault:"Item restored to default",categoryRestoredToDefault:"Category restored to default",edit:"Edit",completeText:"Save & Exit",pagePrevText:"Back",required:"Please enter a value."},plugin:{buttonTitle:"UI Configuration Manager",buttonDescription:"Configure the Toolbox, Tabs, Property Grid, and other UI elements, and save the setup as a reusable preset.",presetsTab:"Presets",creatorPresets:"Creator Presets",save:"Save & Exit",file:"File",import:"Import",export:"Export",edit:"Edit",resetLanguages:"Reset Languages",resetAll:"Reset all changes",resetConfirmation:"Do you really want to reset the settings?",resetConfirmationOk:"Yes, reset the settings",resetToDefaults:"Reset {0}",defaultSettings:"Default Settings",basic:"Basic",advanced:"Advanced",expert:"Expert",license:"<a href='https://surveyjs.io/' target='_blank'>UI Preset Editor</a> is available only with a PRO license. To use it in your application, please <a href='https://surveyjs.io/manage#renewals-and-upgrades' target='_blank'>upgrade your license</a>.",license2:"Your maintenance subscription expired on {date}. You may continue using all <a href='https://surveyjs.io/stay-updated/release-notes' target='_blank'>versions released up to that date</a>. To remove this banner in the latest version, please <a href='https://surveyjs.io/manage#license-manager' target='_blank'>renew your subscription</a> and <a href='https://surveyjs.io/remove-alert-banner' target='_blank'>set up a new license key</a>. Please note <a href='https://surveyjs.io/' target='_blank'>UI Preset Editor</a> is available to all users with an active PRO license.",licenseCreator:"To use the Survey Creator plugin in your application, a <a href='https://surveyjs.io/licensing' target='_blank'>developer license</a> is required. If you have an active license, please <a href='https://surveyjs.io/remove-alert-banner' target='_blank'>set up your license key</a> and ensure you're using the <a href='https://surveyjs.io/stay-updated/release-notes' target='_blank'>latest version</a>. Please note <a href='https://surveyjs.io/' target='_blank'>UI Preset Editor</a> is included only in the PRO license tier.",licenseCreator2:"Your maintenance subscription expired on {date}. You may continue using all <a href='https://surveyjs.io/stay-updated/release-notes' target='_blank'>versions released up to that date</a>. To remove this banner in the latest version, please <a href='https://surveyjs.io/manage#license-manager' target='_blank'>renew your subscription</a> and <a href='https://surveyjs.io/remove-alert-banner' target='_blank'>set up a new license key</a>. Please note <a href='https://surveyjs.io/' target='_blank'>UI Preset Editor</a> is included only in the PRO license tier. To use it in your application, please also <a href='https://surveyjs.io/manage#renewals-and-upgrades' target='_blank'>upgrade your license</a>."}};(0,c.getLocaleStrings)("en").presets=I;var N,L=function(e){function t(){var t=e.call(this)||this;return t.cssClasses={root:"presets-navigation-bar",defaultSizeMode:"",smallSizeMode:"",item:"presets-navigation-bar__item presets-navigation-bar-item",itemWithTitle:"",itemAsIcon:"",itemActive:"presets-navigation-bar-item--active",itemPressed:"presets-navigation-bar-item--pressed",itemIcon:"",itemTitle:"",itemTitleWithIcon:""},t}return a(t,e),t}(p.ActionContainer),P=function(e){function t(t,o,n){var i=e.call(this)||this;return i.creatorValue=o,i.defaultJsonValue=n,i.applying=!1,c.editorLocalization.presetStrings=void 0,i.presetValue=new c.CreatorPreset(t),i.creatorValue||(i.creatorValue=i.createCreator({})),i.modelValue=i.createModel(),i.resultModelValue=i.createResultModel(),i.locTitle=new p.LocalizableString(void 0,!1),i.locTitle.text=(0,c.getLocString)("presets.editor.title"),i.navigationBarValue=new L,i.preset.setJson(i.getJsonFromSurveyModel()),i}return a(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this.disposeModel()},t.prototype.disposeModel=function(){this.resetAllPages(),this.model.editablePresets.forEach(function(e){return e.dispose()}),this.model.dispose()},Object.defineProperty(t.prototype,"preset",{get:function(){return this.presetValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"creator",{get:function(){return this.creatorValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resultModel",{get:function(){return this.upldateResultJson(),this.resultModelValue},enumerable:!1,configurable:!0}),t.prototype.getLocale=function(){return c.editorLocalization.currentLocale||"en"},Object.defineProperty(t.prototype,"json",{get:function(){return this.preset.getJson()},set:function(e){this.preset.setJson(e),this.updateDataFromJson(this.modelValue),this.upldateResultJson()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jsonText",{get:function(){return JSON.stringify(this.json,null,2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultJson",{get:function(){return this.defaultJsonValue},enumerable:!1,configurable:!0}),t.prototype.createCreator=function(e){return new c.SurveyCreatorModel(e)},t.prototype.resetAllPages=function(){var e=this;this.model.editablePresets.forEach(function(t){return t.setupOnCurrentPage(e.model,e.creator,!0)}),this.creator.readOnly=!1},t.prototype.resetToDefaults=function(e){var t=this;e||this.notify((0,c.getLocString)("presets.editor.resetToDefaults")),this.model.editablePresets.forEach(function(o){e&&o.pageName!=e||o.resetToDefaults(t.model,!!e)})},t.prototype.activatePage=function(e,t,o){var n=this,i=o.filter(function(t){return e.currentPage.name!==t.pageName}),r=o.filter(function(t){return e.currentPage.name===t.pageName})[0];i.forEach(function(t){return t.setupOnCurrentPage(e,n.creator,!1)}),r.setupOnCurrentPage(e,this.creator,!0)},t.prototype.notify=function(e){this.creator.notify(e)},t.prototype.updateDataFromJson=function(e){var t=this,o=this.preset.getJson()||{};return c.editorLocalization.presetStrings=o.localization,e.editablePresets.forEach(function(o){return o.setupQuestions(e,t)}),e.editablePresets.forEach(function(n){return n.setupQuestionsValue(e,o[n.path],t.creator)}),this.updateJsonLocalizationStrings(e.editablePresets),o},t.prototype.onLocaleChanged=function(){var e=this,t=this.preset.getJson();this.model.editablePresets.forEach(function(o){return o.onLocaleChanged(e.model,t[o.path],e.creator)})},t.prototype.createModel=function(){var e=this,t=this.createEditablePresets(),o=new p.SurveyModel(this.getEditModelJson(t));o.css=m,o.editablePresets=t,o.keepIncorrectValues=!0,o.showNavigationButtons=!1,o.completeText=(0,c.getLocString)("presets.editor.completeText"),o.pagePrevText=(0,c.getLocString)("presets.editor.pagePrevText"),o.enterKeyAction="loseFocus",t.forEach(function(t){return t.notifyCallback=function(t){return e.notify(t)}}),this.defaultJsonValue||(this.defaultJsonValue={},t.forEach(function(t){return e.defaultJsonValue[t.path]=t.getDefaultJsonValue(e.creator)})),this.updateDataFromJson(o),this.activatePage(o,this.creator,t),o.onCurrentPageChanged.add(function(n,i){e.activatePage(o,e.creator,t)});var n=t.map(function(e){return e.questionNames}).reduce(function(e,t){return e.concat(t)},[]);function i(e){e.isDescendantOf("matrixdynamic")&&(e.onCreateDetailPanelRenderedRowCallback=function(e){e.cells=[e.cells[1]],e.cells[0].colSpans+=2})}return o.onValueChanged.add(function(i,r){t.forEach(function(e){return e.updateOnValueChanged(o,r.name)}),-1==n.indexOf(r.name)||e.applying||(e.applyFromSurveyModel(!1),e.activatePage(o,e.creator,t))}),o.onGetQuestionTitleActions.add(function(e,n){t.forEach(function(e){n.question.name==e.getNavigationElementName()&&(n.question.getTitleToolbar().isResponsivenessDisabled=!0,n.actions=o.navigationBar.actions)})}),o.onGetPanelTitleActions.add(function(n,i){t.forEach(function(t){i.panel.name==t.getNavigationElementName()&&(i.panel.getTitleToolbar().isResponsivenessDisabled=!0,i.actions=o.navigationBar.actions),t.onGetPanelTitleActions(o,e.creator,i)})}),o.getAllQuestions().forEach(function(e){return i(e)}),o.onQuestionCreated.add(function(e,t){i(t.question)}),o.onMatrixDetailPanelVisibleChanged.add(function(n,i){t.forEach(function(t){return t.updateOnMatrixDetailPanelVisibleChanged(o,e.creator,i)})}),o.onGetMatrixRowActions.add(function(n,i){t.forEach(function(t){return t.onGetMatrixRowActions(o,e.creator,i)})}),o.onMatrixRowDragOver.add(function(n,i){t.forEach(function(t){return t.onMatrixRowDragOver(o,e.creator,i)})}),o.onMatrixRowRemoving.add(function(n,i){t.forEach(function(t){return t.onMatrixRowRemoving(o,e.creator,i)})}),o.onMatrixRowAdded.add(function(n,i){t.forEach(function(t){return t.onMatrixRowAdded(o,e.creator,i)})}),o.onMatrixCellValueChanged.add(function(n,i){t.forEach(function(t){return t.onMatrixCellValueChanged(o,e.creator,i)})}),o.onUpdateQuestionCssClasses.add(function(e,o){t.forEach(function(e){var t=e.getCustomQuestionCssSuffix(o.question);t&&(o.cssClasses.mainRoot+=" sps-question--"+t),e.getMainElementNames().indexOf(o.question.name)>=0&&(o.cssClasses.mainRoot+=" sps-question--main",o.cssClasses.row+=" sps-table__row--main",o.cssClasses.buttonAdd+=" sps-matrixdynamic__add-btn--icon",o.cssClasses.iconAdd="sps-matrixdynamic__add-btn-icon",o.cssClasses.iconAddId="#icon-add-24x24")})}),o.onUpdatePanelCssClasses.add(function(e,o){t.forEach(function(e){o.panel.name===e.getNavigationElementName()&&(o.cssClasses.panel.container+=" sps-panel--navigation ")})}),o.onUpdatePageCssClasses.add(function(e,o){t.forEach(function(e){e.pageName===o.page.name&&(o.cssClasses.page.root+=" sps-page--"+e.fullPath)})}),o},t.prototype.createResultModel=function(){var e=this,t=new p.SurveyModel({elements:[{type:"html",name:"q1",html:this.getResultHtml()},{type:"comment",name:"json",title:(0,c.getLocString)("presets.editor.presetJson"),rows:60,cols:120,readOnly:!0}]});return t.showPrevButton=!1,t.showCompleteButton=!1,t.showQuestionNumbers=!1,t.width="900px",t.onGetQuestionTitleActions.add(function(t,o){if("json"===o.question.name){var n=o.question;o.actions.push({id:"json_copy",iconName:"icon-copy",title:(0,c.getLocString)("presets.editor.copy"),action:function(){navigator.clipboard.writeText(n.value)}}),o.actions.push({id:"json_download",iconName:"icon-download",title:(0,c.getLocString)("presets.editor.download"),action:function(){e.downloadJsonFile(n.value)}}),o.actions.push({id:"icon-load",iconName:"icon-load",title:(0,c.getLocString)("presets.editor.load"),action:function(){e.loadJsonFile()}})}}),t},t.prototype.getResultHtml=function(){return"<div>".concat((0,c.getLocString)("presets.editor.usageExample"),"</div>")},t.prototype.downloadJsonFile=function(e){e||(e=this.jsonText);var t=new Blob([e],{type:"application/json"}),o=window.document.createElement("a");o.href=window.URL.createObjectURL(t),o.download="preset.json",document.body.appendChild(o),o.click(),document.body.removeChild(o)},t.prototype.loadJsonFile=function(){var e=this;this.inputFileElement||(this.inputFileElement=document.createElement("input"),this.inputFileElement.type="file",this.inputFileElement.accept=".json",this.inputFileElement.style.display="none",this.inputFileElement.onchange=function(){e.inputFileElement.files.length<1||(e.importFromFile(e.inputFileElement.files[0]),e.inputFileElement.value="")}),this.inputFileElement.click()},t.prototype.importFromFile=function(e){var t=this,o=new FileReader;o.onload=function(e){var n=o.result;t.json=JSON.parse(n)},o.readAsText(e)},t.prototype.upldateResultJson=function(){this.resultModelValue.getQuestionByName("json").value=this.jsonText},t.prototype.applyFromSurveyModel=function(e){return void 0===e&&(e=!0),this.applying=!0,e&&!this.validateEditableModel(this.model)?(this.applying=!1,!1):(this.preset.setJson(this.getJsonFromSurveyModel()),this.model.setValue("json_result",JSON.stringify(this.preset.getJson(),null,2)),this.preset.apply(this.creator,!0),this.applying=!1,!0)},t.prototype.getJsonFromSurveyModel=function(){var e=this,t={};return this.model.editablePresets.forEach(function(o){var n,i=o.getJsonValue(e.model,e.creator,null===(n=e.defaultJsonValue)||void 0===n?void 0:n[o.path]);i&&(t[o.path]=i)}),this.getJsonLocalizationStrings(t),t},t.prototype.getJsonLocalizationStrings=function(e){var t=this,o={};this.model.editablePresets.forEach(function(e){e.setJsonLocalizationStrings(t.model,o)}),this.json&&this.json.localization&&(e.localization=JSON.parse(JSON.stringify(this.json.localization)));var n=this.getLocale();Object.keys(o).length>0?(e.localization||(e.localization={}),e.localization[n]=o):e.localization&&(e.localization[n]&&delete e.localization[n],0===Object.keys(e.localization).length&&delete e.localization)},t.prototype.updateJsonLocalizationStrings=function(e){var t=(this.json&&this.json.localization?JSON.parse(JSON.stringify(this.json.localization)):{})[this.getLocale()]||{};e.forEach(function(e){e.updateJsonLocalizationStrings(t)})},t.prototype.validateEditableModel=function(e){if(!e.validate(!0,!0))return!1;for(var t=e.editablePresets,o=0;o<t.length;o++)if(!t[o].validate(e))return!1;return!0},t.prototype.createEditableCore=function(e,t){return"languages"===t?new S(e):"tabs"===t?new _(e):"toolbox"===t?new v(e):"propertyGrid"===t?new C(e):"options"===t?new T(e):void 0},t.prototype.createEditable=function(e,t,o){var n=this,i=this.createEditableCore(e,o);return i&&e.children.forEach(function(e){var t=n.createEditable(e,i,o+"_"+e.getPath());t&&(i.children.push(t),t.parent=i)}),i},t.prototype.createEditablePresets=function(){var e=this,t=[];return this.preset.children.forEach(function(o){var n=e.createEditable(o,void 0,o.getPath());n&&t.push(n)}),t},t.prototype.getEditModelJson=function(e){var t={pages:[],showQuestionNumbers:!1};return e.forEach(function(e){var o=e.createPages();Array.isArray(o)&&o.forEach(function(e){return t.pages.push(e)})}),t},t}(p.Base),E={tabs:{items:[{name:"designer",iconName:"icon-config"},{name:"preview",iconName:"icon-preview"},{name:"json",iconName:"icon-codeeditor-24x24"}],activeTab:"designer"}},M={tabs:{items:[{name:"designer",iconName:"icon-config"},{name:"preview",iconName:"icon-preview"},{name:"logic",iconName:"icon-logic-24x24"},{name:"json",iconName:"icon-codeeditor-24x24"}],activeTab:"designer"}},O={},R=function(){function e(t){var o=this;this.creator=t,this.currentPresetIndex=0,this.saveToFileHandler=c.saveToFileHandler,this.preventTabSwitch=function(e,t){t.allow=!1},t.addTab({name:"presets",title:(0,c.getLocString)("presets.plugin.presetsTab"),plugin:this,iconName:e.iconName}),t.tabs.filter(function(e){return"presets"==e.id})[0].css="svc-tabbed-menu-item-container--presets",this.designerPlugin=t.getPlugin("designer");var n=this.creator.sidebar.getPageById("creatorTheme");n.componentData.showPresets=function(){return o.showPresets()},n.componentName="svc-presets-property-grid",this.toolboxCompact=t.toolbox.forceCompact}return e.prototype.showPresets=function(){this.activeTab=this.creator.activeTab,this.creator.activeTab="presets"},e.prototype.hidePresets=function(){this.creator.onActiveTabChanging.remove(this.preventTabSwitch),this.creator.activeTab=this.activeTab},e.prototype.confirmReset=function(e){p.settings.confirmActionAsync((0,c.getLocString)("presets.plugin.resetConfirmation"),function(t){t&&e()},{applyTitle:(0,c.getLocString)("presets.plugin.resetConfirmationOk"),locale:this.creator.locale,cssClass:"sv-popup--confirm svc-creator-popup"})},e.prototype.activate=function(){var e,t=this;this.creator.onActiveTabChanging.add(this.preventTabSwitch),this.model=new P({},this.creator,this.defaultJson),this.defaultJson=l({},this.model.defaultJson),this.currentValue&&(this.model.model.data=this.currentValue),this.designerPlugin.activateSidebar(),this.model.model.onComplete.add(function(){return t.hidePresets()});var o,n=null===(e=this.model)||void 0===e?void 0:e.model.pages.map(function(e){return{id:e.name,title:e.navigationTitle}}),i=function(e){o.popupModel.show()},r=[{id:"save",title:(0,c.getLocString)("presets.plugin.save"),markerIconName:"check-24x24",needSeparator:!0,action:function(){return t.hidePresets()}},{id:"defaultSettings",title:(0,c.getLocString)("presets.plugin.defaultSettings"),needSeparator:!0,css:"sps-list__item--label",enabled:!1},{id:"basic",title:(0,c.getLocString)("presets.plugin.basic"),action:function(e){i(),t.model.json=E}},{id:"advanced",title:(0,c.getLocString)("presets.plugin.advanced"),action:function(e){i(),t.model.json=M}},{id:"expert",title:(0,c.getLocString)("presets.plugin.expert"),action:function(e){i(),t.model.json=O}},{id:"file",title:(0,c.getLocString)("presets.plugin.file"),needSeparator:!0,css:"sps-list__item--label",enabled:!1},{id:"import",title:(0,c.getLocString)("presets.plugin.import"),markerIconName:"import-24x24",action:function(e){var o;i(),null===(o=t.model)||void 0===o||o.loadJsonFile()}},{id:"export",title:(0,c.getLocString)("presets.plugin.export"),markerIconName:"download-24x24",action:function(e){var o;i(),null===(o=t.model)||void 0===o||o.downloadJsonFile()}},{id:"edit",title:(0,c.getLocString)("presets.plugin.edit"),needSeparator:!0,css:"sps-list__item--label",enabled:!1},{id:"reset-current",title:(0,c.getLocString)("presets.plugin.resetLanguages"),action:function(){t.confirmReset(function(){var e;return null===(e=t.model)||void 0===e?void 0:e.resetToDefaults("page_languages")})}},{id:"reset",title:(0,c.getLocString)("presets.plugin.resetAll"),css:"sps-list__item--alert",action:function(){t.confirmReset(function(){var e;return null===(e=t.model)||void 0===e?void 0:e.resetToDefaults()})}}];n.forEach(function(e){e.action=function(e){t.presetsList.selectedItem=e,i(),t.model.model.currentPage=t.model.model.getPageByName(e.id)}}),o=(0,p.createDropdownActionModel)({id:"presets-menu",tooltip:(0,c.getLocString)("presets.plugin.creatorPresets"),iconName:"navmenu-24x24",css:"sps-menu-floating-action",action:function(){o.popupModel.isVisible&&setTimeout(function(){return o.popupModel.hide()},1)}},{items:u(u([{id:"creator-presets",title:(0,c.getLocString)("presets.plugin.creatorPresets"),css:"sps-list__item--label",enabled:!1}],n,!0),r,!0),showPointer:!1,verticalPosition:"top",horizontalPosition:"center",searchEnabled:!1,cssClass:"sps-popup-menu sps-popup-menu--always-on-top",cssClasses:h,onHide:function(){o.iconName="navmenu-24x24"},onShow:function(){o.iconName="close-24x24"}},this.model.model);var s=this.designerPlugin.tabControlModel.bottomToolbar.actions;s.forEach(function(e){return e.visible=!1}),s.unshift(o),this.presetsList=o.popupModel.contentComponentData.model;var a=this.presetsList.getActionById("reset-current");this.presetsList.selectedItem=this.presetsList.actions[0],this.model.model.onCurrentPageChanged.add(function(e,o){t.presetsList.selectedItem=t.presetsList.actions[t.model.model.currentPageNo+1],a.title=(0,c.getLocString)("presets.plugin.resetToDefaults").replace("{0}",t.model.model.currentPage.navigationTitle),a.action=function(){var e;null===(e=t.model)||void 0===e||e.resetToDefaults(t.presetsList.selectedItem.id)}}),setTimeout(function(){n[t.currentPresetIndex].action(n[t.currentPresetIndex])},100)},e.prototype.deactivate=function(){var e,t;this.creator.toolbox.forceCompact=this.toolboxCompact,this.currentValue=null===(e=this.model)||void 0===e?void 0:e.model.data;var o=this.designerPlugin.tabControlModel.bottomToolbar.actions;return o.forEach(function(e){return e.visible=!0}),o.splice(0,1),this.currentPresetIndex=(null===(t=this.model)||void 0===t?void 0:t.model.currentPageNo)||0,this.model&&this.model.dispose(),this.model=void 0,!0},e.prototype.onLocaleChanged=function(){this.model&&this.model.onLocaleChanged()},e.prototype.getLicenseText=function(e,t){var o,n;if(!(null===p.hasLicense||void 0===p.hasLicense?void 0:(0,p.hasLicense)(8))){var i=null===(n=null===(o=null===p.glc||void 0===p.glc?void 0:(0,p.glc)(8))||void 0===o?void 0:o.toLocaleDateString)||void 0===n?void 0:n.call(o);return i?(0,c.getLocString)("presets.plugin.license2").replace("{date}",i):e?(0,c.getLocString)("presets.plugin.license"):t?(0,c.getLocString)("presets.plugin.licenseCreator2").replace("{date}",t):(0,c.getLocString)("presets.plugin.licenseCreator")}return""},e.iconName="icon-settings",e}(),A=function(e){function t(t){var o=e.call(this,t)||this;return o.jsonErrors=[],o}return a(t,e),t.prototype.getType=function(){return"presetjson"},t.prototype.getCssType=function(){return"comment"},t.prototype.getTemplate=function(){return"comment"},Object.defineProperty(t.prototype,"textAreaModel",{get:function(){var e=this;if(!this.jsonAreaModelValue){var t=this.getTextAreaOptions(),o=this;t.getTextValue=function(){return JSON.stringify(e.value,null,2)},t.onTextAreaChange=function(t){!function(t){if(p.Helpers.isTwoValueEquals(JSON.stringify(o.value,null,2),t,!1,!0,!1))e.jsonErrors=[];else try{var n=(new c.SurveyJSON5).parse(t),i=l(l({},n),{name:"temp"}),r=new p.JsonObject;if(r.toObject({elements:[i]},new p.SurveyModel),e.jsonErrors=r.errors.map(function(e){return e.message}),e.jsonErrors.length>0)return;o.value=n}catch(t){e.jsonErrors=[t.message]}}(t.target.value)},this.jsonAreaModelValue=new p.TextAreaModel(t)}return this.jsonAreaModelValue},enumerable:!1,configurable:!0}),t.prototype.onCheckForErrors=function(t,o,n){var i=this;e.prototype.onCheckForErrors.call(this,t,o,n),this.jsonErrors.forEach(function(e){t.push(new p.CustomError(e,i))})},t}(p.QuestionCommentModel);return p.ElementFactory.Instance.registerElement("presetjson",function(e){return new A(e)},!1),p.Serializer.addClass("presetjson",[],function(){return new A("")},"comment"),N="".concat("2.5.1"),(0,p.checkLibraryVersion)(N,"survey-creator-core-presets"),r})());
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|