{"version":3,"sources":["node_modules/survey-core/survey.core.js","node_modules/@angular/animations/fesm2022/browser.mjs","node_modules/@angular/platform-browser/fesm2022/animations.mjs","src/app/app-routing.ts","node_modules/@ng-idle/core/fesm2020/ng-idle-core.mjs","node_modules/@ng-idle/keepalive/fesm2020/ng-idle-keepalive.mjs","src/app/shared/shared.module.ts","src/app/core/interceptors/token.interceptor.ts","src/app/app.component.ts","src/app/app.component.html","node_modules/survey-angular-ui/fesm2015/survey-angular-ui.js","src/app/app.module.ts","src/main.ts"],"sourcesContent":["/*!\n * surveyjs - Survey JavaScript library v1.12.25\n * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n if (typeof exports === 'object' && typeof module === 'object') module.exports = factory();else if (typeof define === 'function' && define.amd) define(\"survey-core\", [], factory);else if (typeof exports === 'object') exports[\"survey-core\"] = factory();else root[\"Survey\"] = factory();\n})(this, function () {\n return /******/function (modules) {\n // webpackBootstrap\n /******/ // The module cache\n /******/\n var installedModules = {};\n /******/\n /******/ // The require function\n /******/\n function __webpack_require__(moduleId) {\n /******/\n /******/ // Check if module is in cache\n /******/if (installedModules[moduleId]) {\n /******/return installedModules[moduleId].exports;\n /******/\n }\n /******/ // Create a new module (and put it into the cache)\n /******/\n var module = installedModules[moduleId] = {\n /******/i: moduleId,\n /******/l: false,\n /******/exports: {}\n /******/\n };\n /******/\n /******/ // Execute the module function\n /******/\n modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n /******/\n /******/ // Flag the module as loaded\n /******/\n module.l = true;\n /******/\n /******/ // Return the exports of the module\n /******/\n return module.exports;\n /******/\n }\n /******/\n /******/\n /******/ // expose the modules object (__webpack_modules__)\n /******/\n __webpack_require__.m = modules;\n /******/\n /******/ // expose the module cache\n /******/\n __webpack_require__.c = installedModules;\n /******/\n /******/ // define getter function for harmony exports\n /******/\n __webpack_require__.d = function (exports, name, getter) {\n /******/if (!__webpack_require__.o(exports, name)) {\n /******/Object.defineProperty(exports, name, {\n enumerable: true,\n get: getter\n });\n /******/\n }\n /******/\n };\n /******/\n /******/ // define __esModule on exports\n /******/\n __webpack_require__.r = function (exports) {\n /******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n /******/Object.defineProperty(exports, Symbol.toStringTag, {\n value: 'Module'\n });\n /******/\n }\n /******/\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n /******/\n };\n /******/\n /******/ // create a fake namespace object\n /******/ // mode & 1: value is a module id, require it\n /******/ // mode & 2: merge all properties of value into the ns\n /******/ // mode & 4: return value when already ns object\n /******/ // mode & 8|1: behave like require\n /******/\n __webpack_require__.t = function (value, mode) {\n /******/if (mode & 1) value = __webpack_require__(value);\n /******/\n if (mode & 8) return value;\n /******/\n if (mode & 4 && typeof value === 'object' && value && value.__esModule) return value;\n /******/\n var ns = Object.create(null);\n /******/\n __webpack_require__.r(ns);\n /******/\n Object.defineProperty(ns, 'default', {\n enumerable: true,\n value: value\n });\n /******/\n if (mode & 2 && typeof value != 'string') for (var key in value) __webpack_require__.d(ns, key, function (key) {\n return value[key];\n }.bind(null, key));\n /******/\n return ns;\n /******/\n };\n /******/\n /******/ // getDefaultExport function for compatibility with non-harmony modules\n /******/\n __webpack_require__.n = function (module) {\n /******/var getter = module && module.__esModule ? /******/function getDefault() {\n return module['default'];\n } : /******/function getModuleExports() {\n return module;\n };\n /******/\n __webpack_require__.d(getter, 'a', getter);\n /******/\n return getter;\n /******/\n };\n /******/\n /******/ // Object.prototype.hasOwnProperty.call\n /******/\n __webpack_require__.o = function (object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n };\n /******/\n /******/ // __webpack_public_path__\n /******/\n __webpack_require__.p = \"\";\n /******/\n /******/\n /******/ // Load entry module and return exports\n /******/\n return __webpack_require__(__webpack_require__.s = \"./src/entries/core.ts\");\n /******/\n }\n /************************************************************************/\n /******/({\n /***/\"./src/entries/core.ts\": (\n /*!*******************************************!*\\\n !*** ./src/entries/core.ts + 127 modules ***!\n \\*******************************************/\n /*! exports provided: Version, ReleaseDate, checkLibraryVersion, setLicenseKey, slk, hasLicense, settings, Helpers, AnswerCountValidator, EmailValidator, NumericValidator, RegexValidator, SurveyValidator, TextValidator, ValidatorResult, ExpressionValidator, ValidatorRunner, ItemValue, Base, Event, EventBase, ArrayChanges, ComputedUpdater, SurveyError, SurveyElementCore, SurveyElement, DragTypeOverMeEnum, CalculatedValue, CustomError, AnswerRequiredError, OneAnswerRequiredError, RequreNumericError, ExceedSizeError, LocalizableString, LocalizableStrings, HtmlConditionItem, UrlConditionItem, ChoicesRestful, ChoicesRestfull, FunctionFactory, registerFunction, ConditionRunner, ExpressionRunner, ExpressionExecutor, Operand, Const, BinaryOperand, Variable, FunctionOperand, ArrayOperand, UnaryOperand, ConditionsParser, ProcessValue, JsonError, JsonIncorrectTypeError, JsonMetadata, JsonMetadataClass, JsonMissingTypeError, JsonMissingTypeErrorBase, JsonObject, JsonObjectProperty, JsonRequiredPropertyError, JsonUnknownPropertyError, Serializer, property, propertyArray, MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase, MatrixDropdownColumn, matrixDropdownColumnTypes, QuestionMatrixDropdownRenderedCell, QuestionMatrixDropdownRenderedRow, QuestionMatrixDropdownRenderedErrorRow, QuestionMatrixDropdownRenderedTable, MatrixDropdownRowModel, QuestionMatrixDropdownModel, MatrixDynamicRowModel, QuestionMatrixDynamicModel, MatrixRowModel, MatrixCells, QuestionMatrixModel, QuestionMatrixBaseModel, MultipleTextItemModel, MultipleTextCell, MultipleTextErrorCell, MutlipleTextErrorRow, MutlipleTextRow, QuestionMultipleTextModel, MultipleTextEditorModel, PanelModel, PanelModelBase, QuestionRowModel, FlowPanelModel, PageModel, DefaultTitleModel, Question, QuestionNonValue, QuestionEmptyModel, QuestionCheckboxBase, QuestionSelectBase, QuestionCheckboxModel, QuestionTagboxModel, QuestionRankingModel, QuestionCommentModel, QuestionDropdownModel, QuestionFactory, ElementFactory, QuestionFileModel, QuestionFilePage, QuestionHtmlModel, QuestionRadiogroupModel, QuestionRatingModel, RenderedRatingItem, QuestionExpressionModel, QuestionTextBase, CharacterCounter, QuestionTextModel, QuestionBooleanModel, QuestionImagePickerModel, ImageItemValue, QuestionImageModel, QuestionSignaturePadModel, QuestionPanelDynamicModel, QuestionPanelDynamicItem, SurveyTimer, SurveyTimerModel, tryFocusPage, createTOCListModel, getTocRootCss, TOCModel, SurveyProgressModel, ProgressButtons, ProgressButtonsResponsivityManager, SurveyModel, SurveyTrigger, SurveyTriggerComplete, SurveyTriggerSetValue, SurveyTriggerVisible, SurveyTriggerCopyValue, SurveyTriggerRunExpression, SurveyTriggerSkip, Trigger, PopupSurveyModel, SurveyWindowModel, TextPreProcessor, Notifier, Cover, CoverCell, dxSurveyService, englishStrings, surveyLocalization, surveyStrings, getLocaleString, getLocaleStrings, setupLocale, QuestionCustomWidget, CustomWidgetCollection, QuestionCustomModel, QuestionCompositeModel, ComponentQuestionJSON, ComponentCollection, ListModel, MultiSelectListModel, PopupModel, createDialogOptions, PopupBaseViewModel, PopupDropdownViewModel, PopupModalViewModel, createPopupViewModel, createPopupModalViewModel, DropdownListModel, DropdownMultiSelectListModel, QuestionButtonGroupModel, ButtonGroupItemModel, ButtonGroupItemValue, IsMobile, IsTouch, _setIsTouch, confirmAction, confirmActionAsync, detectIEOrEdge, doKey2ClickUp, doKey2ClickDown, doKey2ClickBlur, loadFileFromBase64, increaseHeightByContent, createSvg, chooseFiles, sanitizeEditableContent, prepareElementForVerticalAnimation, cleanHtmlElementAfterAnimation, classesToSelector, renamedIcons, getIconNameFromProxy, InputMaskBase, InputMaskPattern, InputMaskNumeric, InputMaskDateTime, InputMaskCurrency, CssClassBuilder, TextAreaModel, surveyCss, defaultV2Css, defaultV2ThemeName, DragDropCore, DragDropChoices, DragDropRankingSelectToRank, StylesManager, defaultStandardCss, modernCss, SvgIconRegistry, SvgRegistry, SvgThemeSets, addIconsToThemeSet, RendererFactory, ResponsivityManager, VerticalResponsivityManager, unwrap, getOriginalEvent, getElement, activateLazyRenderingChecks, createDropdownActionModel, createDropdownActionModelAdvanced, createPopupModelWithListModel, getActionDropdownButtonTarget, BaseAction, Action, ActionDropdownViewModel, AnimationUtils, AnimationPropertyUtils, AnimationGroupUtils, AnimationProperty, AnimationBoolean, AnimationGroup, AnimationTab, AdaptiveActionContainer, defaultActionBarCss, ActionContainer, DragOrClickHelper, Model */\n /***/\n function (module, __webpack_exports__, __webpack_require__) {\n \"use strict\";\n\n // ESM COMPAT FLAG\n __webpack_require__.r(__webpack_exports__);\n\n // EXPORTS\n __webpack_require__.d(__webpack_exports__, \"Version\", function () {\n return /* reexport */Version;\n });\n __webpack_require__.d(__webpack_exports__, \"ReleaseDate\", function () {\n return /* reexport */ReleaseDate;\n });\n __webpack_require__.d(__webpack_exports__, \"checkLibraryVersion\", function () {\n return /* reexport */checkLibraryVersion;\n });\n __webpack_require__.d(__webpack_exports__, \"setLicenseKey\", function () {\n return /* reexport */setLicenseKey;\n });\n __webpack_require__.d(__webpack_exports__, \"slk\", function () {\n return /* reexport */slk;\n });\n __webpack_require__.d(__webpack_exports__, \"hasLicense\", function () {\n return /* reexport */hasLicense;\n });\n __webpack_require__.d(__webpack_exports__, \"settings\", function () {\n return /* reexport */settings;\n });\n __webpack_require__.d(__webpack_exports__, \"Helpers\", function () {\n return /* reexport */helpers_Helpers;\n });\n __webpack_require__.d(__webpack_exports__, \"AnswerCountValidator\", function () {\n return /* reexport */AnswerCountValidator;\n });\n __webpack_require__.d(__webpack_exports__, \"EmailValidator\", function () {\n return /* reexport */EmailValidator;\n });\n __webpack_require__.d(__webpack_exports__, \"NumericValidator\", function () {\n return /* reexport */validator_NumericValidator;\n });\n __webpack_require__.d(__webpack_exports__, \"RegexValidator\", function () {\n return /* reexport */RegexValidator;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyValidator\", function () {\n return /* reexport */validator_SurveyValidator;\n });\n __webpack_require__.d(__webpack_exports__, \"TextValidator\", function () {\n return /* reexport */TextValidator;\n });\n __webpack_require__.d(__webpack_exports__, \"ValidatorResult\", function () {\n return /* reexport */ValidatorResult;\n });\n __webpack_require__.d(__webpack_exports__, \"ExpressionValidator\", function () {\n return /* reexport */validator_ExpressionValidator;\n });\n __webpack_require__.d(__webpack_exports__, \"ValidatorRunner\", function () {\n return /* reexport */ValidatorRunner;\n });\n __webpack_require__.d(__webpack_exports__, \"ItemValue\", function () {\n return /* reexport */itemvalue_ItemValue;\n });\n __webpack_require__.d(__webpack_exports__, \"Base\", function () {\n return /* reexport */base_Base;\n });\n __webpack_require__.d(__webpack_exports__, \"Event\", function () {\n return /* reexport */Event;\n });\n __webpack_require__.d(__webpack_exports__, \"EventBase\", function () {\n return /* reexport */EventBase;\n });\n __webpack_require__.d(__webpack_exports__, \"ArrayChanges\", function () {\n return /* reexport */ArrayChanges;\n });\n __webpack_require__.d(__webpack_exports__, \"ComputedUpdater\", function () {\n return /* reexport */ComputedUpdater;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyError\", function () {\n return /* reexport */survey_error_SurveyError;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyElementCore\", function () {\n return /* reexport */survey_element_SurveyElementCore;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyElement\", function () {\n return /* reexport */survey_element_SurveyElement;\n });\n __webpack_require__.d(__webpack_exports__, \"DragTypeOverMeEnum\", function () {\n return /* reexport */DragTypeOverMeEnum;\n });\n __webpack_require__.d(__webpack_exports__, \"CalculatedValue\", function () {\n return /* reexport */calculatedValue_CalculatedValue;\n });\n __webpack_require__.d(__webpack_exports__, \"CustomError\", function () {\n return /* reexport */CustomError;\n });\n __webpack_require__.d(__webpack_exports__, \"AnswerRequiredError\", function () {\n return /* reexport */AnswerRequiredError;\n });\n __webpack_require__.d(__webpack_exports__, \"OneAnswerRequiredError\", function () {\n return /* reexport */OneAnswerRequiredError;\n });\n __webpack_require__.d(__webpack_exports__, \"RequreNumericError\", function () {\n return /* reexport */RequreNumericError;\n });\n __webpack_require__.d(__webpack_exports__, \"ExceedSizeError\", function () {\n return /* reexport */ExceedSizeError;\n });\n __webpack_require__.d(__webpack_exports__, \"LocalizableString\", function () {\n return /* reexport */localizablestring_LocalizableString;\n });\n __webpack_require__.d(__webpack_exports__, \"LocalizableStrings\", function () {\n return /* reexport */localizablestring_LocalizableStrings;\n });\n __webpack_require__.d(__webpack_exports__, \"HtmlConditionItem\", function () {\n return /* reexport */HtmlConditionItem;\n });\n __webpack_require__.d(__webpack_exports__, \"UrlConditionItem\", function () {\n return /* reexport */UrlConditionItem;\n });\n __webpack_require__.d(__webpack_exports__, \"ChoicesRestful\", function () {\n return /* reexport */choicesRestful_ChoicesRestful;\n });\n __webpack_require__.d(__webpack_exports__, \"ChoicesRestfull\", function () {\n return /* reexport */choicesRestful_ChoicesRestfull;\n });\n __webpack_require__.d(__webpack_exports__, \"FunctionFactory\", function () {\n return /* reexport */functionsfactory_FunctionFactory;\n });\n __webpack_require__.d(__webpack_exports__, \"registerFunction\", function () {\n return /* reexport */registerFunction;\n });\n __webpack_require__.d(__webpack_exports__, \"ConditionRunner\", function () {\n return /* reexport */ConditionRunner;\n });\n __webpack_require__.d(__webpack_exports__, \"ExpressionRunner\", function () {\n return /* reexport */ExpressionRunner;\n });\n __webpack_require__.d(__webpack_exports__, \"ExpressionExecutor\", function () {\n return /* reexport */conditions_ExpressionExecutor;\n });\n __webpack_require__.d(__webpack_exports__, \"Operand\", function () {\n return /* reexport */Operand;\n });\n __webpack_require__.d(__webpack_exports__, \"Const\", function () {\n return /* reexport */expressions_Const;\n });\n __webpack_require__.d(__webpack_exports__, \"BinaryOperand\", function () {\n return /* reexport */BinaryOperand;\n });\n __webpack_require__.d(__webpack_exports__, \"Variable\", function () {\n return /* reexport */expressions_Variable;\n });\n __webpack_require__.d(__webpack_exports__, \"FunctionOperand\", function () {\n return /* reexport */expressions_FunctionOperand;\n });\n __webpack_require__.d(__webpack_exports__, \"ArrayOperand\", function () {\n return /* reexport */ArrayOperand;\n });\n __webpack_require__.d(__webpack_exports__, \"UnaryOperand\", function () {\n return /* reexport */UnaryOperand;\n });\n __webpack_require__.d(__webpack_exports__, \"ConditionsParser\", function () {\n return /* reexport */conditionsParser_ConditionsParser;\n });\n __webpack_require__.d(__webpack_exports__, \"ProcessValue\", function () {\n return /* reexport */conditionProcessValue_ProcessValue;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonError\", function () {\n return /* reexport */JsonError;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonIncorrectTypeError\", function () {\n return /* reexport */JsonIncorrectTypeError;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonMetadata\", function () {\n return /* reexport */JsonMetadata;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonMetadataClass\", function () {\n return /* reexport */jsonobject_JsonMetadataClass;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonMissingTypeError\", function () {\n return /* reexport */JsonMissingTypeError;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonMissingTypeErrorBase\", function () {\n return /* reexport */JsonMissingTypeErrorBase;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonObject\", function () {\n return /* reexport */jsonobject_JsonObject;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonObjectProperty\", function () {\n return /* reexport */jsonobject_JsonObjectProperty;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonRequiredPropertyError\", function () {\n return /* reexport */JsonRequiredPropertyError;\n });\n __webpack_require__.d(__webpack_exports__, \"JsonUnknownPropertyError\", function () {\n return /* reexport */JsonUnknownPropertyError;\n });\n __webpack_require__.d(__webpack_exports__, \"Serializer\", function () {\n return /* reexport */Serializer;\n });\n __webpack_require__.d(__webpack_exports__, \"property\", function () {\n return /* reexport */jsonobject_property;\n });\n __webpack_require__.d(__webpack_exports__, \"propertyArray\", function () {\n return /* reexport */propertyArray;\n });\n __webpack_require__.d(__webpack_exports__, \"MatrixDropdownCell\", function () {\n return /* reexport */question_matrixdropdownbase_MatrixDropdownCell;\n });\n __webpack_require__.d(__webpack_exports__, \"MatrixDropdownRowModelBase\", function () {\n return /* reexport */question_matrixdropdownbase_MatrixDropdownRowModelBase;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixDropdownModelBase\", function () {\n return /* reexport */question_matrixdropdownbase_QuestionMatrixDropdownModelBase;\n });\n __webpack_require__.d(__webpack_exports__, \"MatrixDropdownColumn\", function () {\n return /* reexport */question_matrixdropdowncolumn_MatrixDropdownColumn;\n });\n __webpack_require__.d(__webpack_exports__, \"matrixDropdownColumnTypes\", function () {\n return /* reexport */matrixDropdownColumnTypes;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixDropdownRenderedCell\", function () {\n return /* reexport */question_matrixdropdownrendered_QuestionMatrixDropdownRenderedCell;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixDropdownRenderedRow\", function () {\n return /* reexport */question_matrixdropdownrendered_QuestionMatrixDropdownRenderedRow;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixDropdownRenderedErrorRow\", function () {\n return /* reexport */question_matrixdropdownrendered_QuestionMatrixDropdownRenderedErrorRow;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixDropdownRenderedTable\", function () {\n return /* reexport */question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable;\n });\n __webpack_require__.d(__webpack_exports__, \"MatrixDropdownRowModel\", function () {\n return /* reexport */MatrixDropdownRowModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixDropdownModel\", function () {\n return /* reexport */question_matrixdropdown_QuestionMatrixDropdownModel;\n });\n __webpack_require__.d(__webpack_exports__, \"MatrixDynamicRowModel\", function () {\n return /* reexport */MatrixDynamicRowModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixDynamicModel\", function () {\n return /* reexport */question_matrixdynamic_QuestionMatrixDynamicModel;\n });\n __webpack_require__.d(__webpack_exports__, \"MatrixRowModel\", function () {\n return /* reexport */question_matrix_MatrixRowModel;\n });\n __webpack_require__.d(__webpack_exports__, \"MatrixCells\", function () {\n return /* reexport */question_matrix_MatrixCells;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixModel\", function () {\n return /* reexport */question_matrix_QuestionMatrixModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMatrixBaseModel\", function () {\n return /* reexport */martixBase_QuestionMatrixBaseModel;\n });\n __webpack_require__.d(__webpack_exports__, \"MultipleTextItemModel\", function () {\n return /* reexport */question_multipletext_MultipleTextItemModel;\n });\n __webpack_require__.d(__webpack_exports__, \"MultipleTextCell\", function () {\n return /* reexport */question_multipletext_MultipleTextCell;\n });\n __webpack_require__.d(__webpack_exports__, \"MultipleTextErrorCell\", function () {\n return /* reexport */question_multipletext_MultipleTextErrorCell;\n });\n __webpack_require__.d(__webpack_exports__, \"MutlipleTextErrorRow\", function () {\n return /* reexport */MutlipleTextErrorRow;\n });\n __webpack_require__.d(__webpack_exports__, \"MutlipleTextRow\", function () {\n return /* reexport */question_multipletext_MutlipleTextRow;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionMultipleTextModel\", function () {\n return /* reexport */question_multipletext_QuestionMultipleTextModel;\n });\n __webpack_require__.d(__webpack_exports__, \"MultipleTextEditorModel\", function () {\n return /* reexport */MultipleTextEditorModel;\n });\n __webpack_require__.d(__webpack_exports__, \"PanelModel\", function () {\n return /* reexport */panel_PanelModel;\n });\n __webpack_require__.d(__webpack_exports__, \"PanelModelBase\", function () {\n return /* reexport */panel_PanelModelBase;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionRowModel\", function () {\n return /* reexport */panel_QuestionRowModel;\n });\n __webpack_require__.d(__webpack_exports__, \"FlowPanelModel\", function () {\n return /* reexport */flowpanel_FlowPanelModel;\n });\n __webpack_require__.d(__webpack_exports__, \"PageModel\", function () {\n return /* reexport */page_PageModel;\n });\n __webpack_require__.d(__webpack_exports__, \"DefaultTitleModel\", function () {\n return /* reexport */defaultTitle_DefaultTitleModel;\n });\n __webpack_require__.d(__webpack_exports__, \"Question\", function () {\n return /* reexport */question_Question;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionNonValue\", function () {\n return /* reexport */QuestionNonValue;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionEmptyModel\", function () {\n return /* reexport */QuestionEmptyModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionCheckboxBase\", function () {\n return /* reexport */QuestionCheckboxBase;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionSelectBase\", function () {\n return /* reexport */question_baseselect_QuestionSelectBase;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionCheckboxModel\", function () {\n return /* reexport */question_checkbox_QuestionCheckboxModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionTagboxModel\", function () {\n return /* reexport */question_tagbox_QuestionTagboxModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionRankingModel\", function () {\n return /* reexport */question_ranking_QuestionRankingModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionCommentModel\", function () {\n return /* reexport */question_comment_QuestionCommentModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionDropdownModel\", function () {\n return /* reexport */question_dropdown_QuestionDropdownModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionFactory\", function () {\n return /* reexport */questionfactory_QuestionFactory;\n });\n __webpack_require__.d(__webpack_exports__, \"ElementFactory\", function () {\n return /* reexport */questionfactory_ElementFactory;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionFileModel\", function () {\n return /* reexport */question_file_QuestionFileModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionFilePage\", function () {\n return /* reexport */question_file_QuestionFilePage;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionHtmlModel\", function () {\n return /* reexport */question_html_QuestionHtmlModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionRadiogroupModel\", function () {\n return /* reexport */question_radiogroup_QuestionRadiogroupModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionRatingModel\", function () {\n return /* reexport */question_rating_QuestionRatingModel;\n });\n __webpack_require__.d(__webpack_exports__, \"RenderedRatingItem\", function () {\n return /* reexport */question_rating_RenderedRatingItem;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionExpressionModel\", function () {\n return /* reexport */question_expression_QuestionExpressionModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionTextBase\", function () {\n return /* reexport */question_textbase_QuestionTextBase;\n });\n __webpack_require__.d(__webpack_exports__, \"CharacterCounter\", function () {\n return /* reexport */question_textbase_CharacterCounter;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionTextModel\", function () {\n return /* reexport */question_text_QuestionTextModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionBooleanModel\", function () {\n return /* reexport */question_boolean_QuestionBooleanModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionImagePickerModel\", function () {\n return /* reexport */question_imagepicker_QuestionImagePickerModel;\n });\n __webpack_require__.d(__webpack_exports__, \"ImageItemValue\", function () {\n return /* reexport */question_imagepicker_ImageItemValue;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionImageModel\", function () {\n return /* reexport */question_image_QuestionImageModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionSignaturePadModel\", function () {\n return /* reexport */question_signaturepad_QuestionSignaturePadModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionPanelDynamicModel\", function () {\n return /* reexport */question_paneldynamic_QuestionPanelDynamicModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionPanelDynamicItem\", function () {\n return /* reexport */question_paneldynamic_QuestionPanelDynamicItem;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTimer\", function () {\n return /* reexport */surveytimer_SurveyTimer;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTimerModel\", function () {\n return /* reexport */surveyTimerModel_SurveyTimerModel;\n });\n __webpack_require__.d(__webpack_exports__, \"tryFocusPage\", function () {\n return /* reexport */tryFocusPage;\n });\n __webpack_require__.d(__webpack_exports__, \"createTOCListModel\", function () {\n return /* reexport */createTOCListModel;\n });\n __webpack_require__.d(__webpack_exports__, \"getTocRootCss\", function () {\n return /* reexport */getTocRootCss;\n });\n __webpack_require__.d(__webpack_exports__, \"TOCModel\", function () {\n return /* reexport */surveyToc_TOCModel;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyProgressModel\", function () {\n return /* reexport */surveyProgress_SurveyProgressModel;\n });\n __webpack_require__.d(__webpack_exports__, \"ProgressButtons\", function () {\n return /* reexport */progress_buttons_ProgressButtons;\n });\n __webpack_require__.d(__webpack_exports__, \"ProgressButtonsResponsivityManager\", function () {\n return /* reexport */ProgressButtonsResponsivityManager;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyModel\", function () {\n return /* reexport */survey_SurveyModel;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTrigger\", function () {\n return /* reexport */SurveyTrigger;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTriggerComplete\", function () {\n return /* reexport */trigger_SurveyTriggerComplete;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTriggerSetValue\", function () {\n return /* reexport */SurveyTriggerSetValue;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTriggerVisible\", function () {\n return /* reexport */SurveyTriggerVisible;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTriggerCopyValue\", function () {\n return /* reexport */SurveyTriggerCopyValue;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTriggerRunExpression\", function () {\n return /* reexport */trigger_SurveyTriggerRunExpression;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyTriggerSkip\", function () {\n return /* reexport */trigger_SurveyTriggerSkip;\n });\n __webpack_require__.d(__webpack_exports__, \"Trigger\", function () {\n return /* reexport */trigger_Trigger;\n });\n __webpack_require__.d(__webpack_exports__, \"PopupSurveyModel\", function () {\n return /* reexport */popup_survey_PopupSurveyModel;\n });\n __webpack_require__.d(__webpack_exports__, \"SurveyWindowModel\", function () {\n return /* reexport */SurveyWindowModel;\n });\n __webpack_require__.d(__webpack_exports__, \"TextPreProcessor\", function () {\n return /* reexport */textPreProcessor_TextPreProcessor;\n });\n __webpack_require__.d(__webpack_exports__, \"Notifier\", function () {\n return /* reexport */notifier_Notifier;\n });\n __webpack_require__.d(__webpack_exports__, \"Cover\", function () {\n return /* reexport */header_Cover;\n });\n __webpack_require__.d(__webpack_exports__, \"CoverCell\", function () {\n return /* reexport */CoverCell;\n });\n __webpack_require__.d(__webpack_exports__, \"dxSurveyService\", function () {\n return /* reexport */dxSurveyService_dxSurveyService;\n });\n __webpack_require__.d(__webpack_exports__, \"englishStrings\", function () {\n return /* reexport */englishStrings;\n });\n __webpack_require__.d(__webpack_exports__, \"surveyLocalization\", function () {\n return /* reexport */surveyLocalization;\n });\n __webpack_require__.d(__webpack_exports__, \"surveyStrings\", function () {\n return /* reexport */surveyStrings;\n });\n __webpack_require__.d(__webpack_exports__, \"getLocaleString\", function () {\n return /* reexport */getLocaleString;\n });\n __webpack_require__.d(__webpack_exports__, \"getLocaleStrings\", function () {\n return /* reexport */getLocaleStrings;\n });\n __webpack_require__.d(__webpack_exports__, \"setupLocale\", function () {\n return /* reexport */setupLocale;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionCustomWidget\", function () {\n return /* reexport */QuestionCustomWidget;\n });\n __webpack_require__.d(__webpack_exports__, \"CustomWidgetCollection\", function () {\n return /* reexport */questionCustomWidgets_CustomWidgetCollection;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionCustomModel\", function () {\n return /* reexport */question_custom_QuestionCustomModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionCompositeModel\", function () {\n return /* reexport */question_custom_QuestionCompositeModel;\n });\n __webpack_require__.d(__webpack_exports__, \"ComponentQuestionJSON\", function () {\n return /* reexport */question_custom_ComponentQuestionJSON;\n });\n __webpack_require__.d(__webpack_exports__, \"ComponentCollection\", function () {\n return /* reexport */question_custom_ComponentCollection;\n });\n __webpack_require__.d(__webpack_exports__, \"ListModel\", function () {\n return /* reexport */list_ListModel;\n });\n __webpack_require__.d(__webpack_exports__, \"MultiSelectListModel\", function () {\n return /* reexport */multiSelectListModel_MultiSelectListModel;\n });\n __webpack_require__.d(__webpack_exports__, \"PopupModel\", function () {\n return /* reexport */popup_PopupModel;\n });\n __webpack_require__.d(__webpack_exports__, \"createDialogOptions\", function () {\n return /* reexport */createDialogOptions;\n });\n __webpack_require__.d(__webpack_exports__, \"PopupBaseViewModel\", function () {\n return /* reexport */popup_view_model_PopupBaseViewModel;\n });\n __webpack_require__.d(__webpack_exports__, \"PopupDropdownViewModel\", function () {\n return /* reexport */popup_dropdown_view_model_PopupDropdownViewModel;\n });\n __webpack_require__.d(__webpack_exports__, \"PopupModalViewModel\", function () {\n return /* reexport */PopupModalViewModel;\n });\n __webpack_require__.d(__webpack_exports__, \"createPopupViewModel\", function () {\n return /* reexport */createPopupViewModel;\n });\n __webpack_require__.d(__webpack_exports__, \"createPopupModalViewModel\", function () {\n return /* reexport */createPopupModalViewModel;\n });\n __webpack_require__.d(__webpack_exports__, \"DropdownListModel\", function () {\n return /* reexport */dropdownListModel_DropdownListModel;\n });\n __webpack_require__.d(__webpack_exports__, \"DropdownMultiSelectListModel\", function () {\n return /* reexport */dropdownMultiSelectListModel_DropdownMultiSelectListModel;\n });\n __webpack_require__.d(__webpack_exports__, \"QuestionButtonGroupModel\", function () {\n return /* reexport */QuestionButtonGroupModel;\n });\n __webpack_require__.d(__webpack_exports__, \"ButtonGroupItemModel\", function () {\n return /* reexport */question_buttongroup_ButtonGroupItemModel;\n });\n __webpack_require__.d(__webpack_exports__, \"ButtonGroupItemValue\", function () {\n return /* reexport */question_buttongroup_ButtonGroupItemValue;\n });\n __webpack_require__.d(__webpack_exports__, \"IsMobile\", function () {\n return /* reexport */IsMobile;\n });\n __webpack_require__.d(__webpack_exports__, \"IsTouch\", function () {\n return /* reexport */IsTouch;\n });\n __webpack_require__.d(__webpack_exports__, \"_setIsTouch\", function () {\n return /* reexport */_setIsTouch;\n });\n __webpack_require__.d(__webpack_exports__, \"confirmAction\", function () {\n return /* reexport */confirmAction;\n });\n __webpack_require__.d(__webpack_exports__, \"confirmActionAsync\", function () {\n return /* reexport */confirmActionAsync;\n });\n __webpack_require__.d(__webpack_exports__, \"detectIEOrEdge\", function () {\n return /* reexport */detectIEOrEdge;\n });\n __webpack_require__.d(__webpack_exports__, \"doKey2ClickUp\", function () {\n return /* reexport */doKey2ClickUp;\n });\n __webpack_require__.d(__webpack_exports__, \"doKey2ClickDown\", function () {\n return /* reexport */doKey2ClickDown;\n });\n __webpack_require__.d(__webpack_exports__, \"doKey2ClickBlur\", function () {\n return /* reexport */doKey2ClickBlur;\n });\n __webpack_require__.d(__webpack_exports__, \"loadFileFromBase64\", function () {\n return /* reexport */loadFileFromBase64;\n });\n __webpack_require__.d(__webpack_exports__, \"increaseHeightByContent\", function () {\n return /* reexport */increaseHeightByContent;\n });\n __webpack_require__.d(__webpack_exports__, \"createSvg\", function () {\n return /* reexport */createSvg;\n });\n __webpack_require__.d(__webpack_exports__, \"chooseFiles\", function () {\n return /* reexport */chooseFiles;\n });\n __webpack_require__.d(__webpack_exports__, \"sanitizeEditableContent\", function () {\n return /* reexport */sanitizeEditableContent;\n });\n __webpack_require__.d(__webpack_exports__, \"prepareElementForVerticalAnimation\", function () {\n return /* reexport */prepareElementForVerticalAnimation;\n });\n __webpack_require__.d(__webpack_exports__, \"cleanHtmlElementAfterAnimation\", function () {\n return /* reexport */cleanHtmlElementAfterAnimation;\n });\n __webpack_require__.d(__webpack_exports__, \"classesToSelector\", function () {\n return /* reexport */classesToSelector;\n });\n __webpack_require__.d(__webpack_exports__, \"renamedIcons\", function () {\n return /* reexport */renamedIcons;\n });\n __webpack_require__.d(__webpack_exports__, \"getIconNameFromProxy\", function () {\n return /* reexport */getIconNameFromProxy;\n });\n __webpack_require__.d(__webpack_exports__, \"InputMaskBase\", function () {\n return /* reexport */mask_base_InputMaskBase;\n });\n __webpack_require__.d(__webpack_exports__, \"InputMaskPattern\", function () {\n return /* reexport */mask_pattern_InputMaskPattern;\n });\n __webpack_require__.d(__webpack_exports__, \"InputMaskNumeric\", function () {\n return /* reexport */mask_numeric_InputMaskNumeric;\n });\n __webpack_require__.d(__webpack_exports__, \"InputMaskDateTime\", function () {\n return /* reexport */mask_datetime_InputMaskDateTime;\n });\n __webpack_require__.d(__webpack_exports__, \"InputMaskCurrency\", function () {\n return /* reexport */mask_currency_InputMaskCurrency;\n });\n __webpack_require__.d(__webpack_exports__, \"CssClassBuilder\", function () {\n return /* reexport */CssClassBuilder;\n });\n __webpack_require__.d(__webpack_exports__, \"TextAreaModel\", function () {\n return /* reexport */text_area_TextAreaModel;\n });\n __webpack_require__.d(__webpack_exports__, \"surveyCss\", function () {\n return /* reexport */surveyCss;\n });\n __webpack_require__.d(__webpack_exports__, \"defaultV2Css\", function () {\n return /* reexport */defaultV2Css;\n });\n __webpack_require__.d(__webpack_exports__, \"defaultV2ThemeName\", function () {\n return /* reexport */defaultV2ThemeName;\n });\n __webpack_require__.d(__webpack_exports__, \"DragDropCore\", function () {\n return /* reexport */core_DragDropCore;\n });\n __webpack_require__.d(__webpack_exports__, \"DragDropChoices\", function () {\n return /* reexport */choices_DragDropChoices;\n });\n __webpack_require__.d(__webpack_exports__, \"DragDropRankingSelectToRank\", function () {\n return /* reexport */DragDropRankingSelectToRank;\n });\n __webpack_require__.d(__webpack_exports__, \"StylesManager\", function () {\n return /* reexport */stylesmanager_StylesManager;\n });\n __webpack_require__.d(__webpack_exports__, \"defaultStandardCss\", function () {\n return /* reexport */defaultStandardCss;\n });\n __webpack_require__.d(__webpack_exports__, \"modernCss\", function () {\n return /* reexport */modernCss;\n });\n __webpack_require__.d(__webpack_exports__, \"SvgIconRegistry\", function () {\n return /* reexport */svgbundle_SvgIconRegistry;\n });\n __webpack_require__.d(__webpack_exports__, \"SvgRegistry\", function () {\n return /* reexport */SvgRegistry;\n });\n __webpack_require__.d(__webpack_exports__, \"SvgThemeSets\", function () {\n return /* reexport */SvgThemeSets;\n });\n __webpack_require__.d(__webpack_exports__, \"addIconsToThemeSet\", function () {\n return /* reexport */addIconsToThemeSet;\n });\n __webpack_require__.d(__webpack_exports__, \"RendererFactory\", function () {\n return /* reexport */RendererFactory;\n });\n __webpack_require__.d(__webpack_exports__, \"ResponsivityManager\", function () {\n return /* reexport */responsivity_manager_ResponsivityManager;\n });\n __webpack_require__.d(__webpack_exports__, \"VerticalResponsivityManager\", function () {\n return /* reexport */VerticalResponsivityManager;\n });\n __webpack_require__.d(__webpack_exports__, \"unwrap\", function () {\n return /* reexport */unwrap;\n });\n __webpack_require__.d(__webpack_exports__, \"getOriginalEvent\", function () {\n return /* reexport */getOriginalEvent;\n });\n __webpack_require__.d(__webpack_exports__, \"getElement\", function () {\n return /* reexport */getElement;\n });\n __webpack_require__.d(__webpack_exports__, \"activateLazyRenderingChecks\", function () {\n return /* reexport */activateLazyRenderingChecks;\n });\n __webpack_require__.d(__webpack_exports__, \"createDropdownActionModel\", function () {\n return /* reexport */createDropdownActionModel;\n });\n __webpack_require__.d(__webpack_exports__, \"createDropdownActionModelAdvanced\", function () {\n return /* reexport */createDropdownActionModelAdvanced;\n });\n __webpack_require__.d(__webpack_exports__, \"createPopupModelWithListModel\", function () {\n return /* reexport */createPopupModelWithListModel;\n });\n __webpack_require__.d(__webpack_exports__, \"getActionDropdownButtonTarget\", function () {\n return /* reexport */getActionDropdownButtonTarget;\n });\n __webpack_require__.d(__webpack_exports__, \"BaseAction\", function () {\n return /* reexport */action_BaseAction;\n });\n __webpack_require__.d(__webpack_exports__, \"Action\", function () {\n return /* reexport */action_Action;\n });\n __webpack_require__.d(__webpack_exports__, \"ActionDropdownViewModel\", function () {\n return /* reexport */ActionDropdownViewModel;\n });\n __webpack_require__.d(__webpack_exports__, \"AnimationUtils\", function () {\n return /* reexport */animation_AnimationUtils;\n });\n __webpack_require__.d(__webpack_exports__, \"AnimationPropertyUtils\", function () {\n return /* reexport */AnimationPropertyUtils;\n });\n __webpack_require__.d(__webpack_exports__, \"AnimationGroupUtils\", function () {\n return /* reexport */AnimationGroupUtils;\n });\n __webpack_require__.d(__webpack_exports__, \"AnimationProperty\", function () {\n return /* reexport */animation_AnimationProperty;\n });\n __webpack_require__.d(__webpack_exports__, \"AnimationBoolean\", function () {\n return /* reexport */AnimationBoolean;\n });\n __webpack_require__.d(__webpack_exports__, \"AnimationGroup\", function () {\n return /* reexport */animation_AnimationGroup;\n });\n __webpack_require__.d(__webpack_exports__, \"AnimationTab\", function () {\n return /* reexport */AnimationTab;\n });\n __webpack_require__.d(__webpack_exports__, \"AdaptiveActionContainer\", function () {\n return /* reexport */adaptive_container_AdaptiveActionContainer;\n });\n __webpack_require__.d(__webpack_exports__, \"defaultActionBarCss\", function () {\n return /* reexport */defaultActionBarCss;\n });\n __webpack_require__.d(__webpack_exports__, \"ActionContainer\", function () {\n return /* reexport */container_ActionContainer;\n });\n __webpack_require__.d(__webpack_exports__, \"DragOrClickHelper\", function () {\n return /* reexport */dragOrClickHelper_DragOrClickHelper;\n });\n __webpack_require__.d(__webpack_exports__, \"Model\", function () {\n return /* reexport */survey_SurveyModel;\n });\n\n // CONCATENATED MODULE: ./packages/survey-core/src/global_variables_utils.ts\n /* eslint-disable no-restricted-globals */\n var DomWindowHelper = /** @class */function () {\n function DomWindowHelper() {}\n DomWindowHelper.isAvailable = function () {\n return \"undefined\" !== typeof window;\n };\n DomWindowHelper.isFileReaderAvailable = function () {\n if (!DomWindowHelper.isAvailable()) return false;\n return !!window[\"FileReader\"];\n };\n DomWindowHelper.getLocation = function () {\n if (!DomWindowHelper.isAvailable()) return;\n return window.location;\n };\n DomWindowHelper.getVisualViewport = function () {\n if (!DomWindowHelper.isAvailable()) return null;\n return window.visualViewport;\n };\n DomWindowHelper.getInnerWidth = function () {\n if (!DomWindowHelper.isAvailable()) return;\n return window.innerWidth;\n };\n DomWindowHelper.getInnerHeight = function () {\n if (!DomWindowHelper.isAvailable()) return null;\n return window.innerHeight;\n };\n DomWindowHelper.getWindow = function () {\n if (!DomWindowHelper.isAvailable()) return;\n return window;\n };\n DomWindowHelper.hasOwn = function (propertyName) {\n if (!DomWindowHelper.isAvailable()) return;\n return propertyName in window;\n };\n DomWindowHelper.getSelection = function () {\n if (DomWindowHelper.isAvailable() && window.getSelection) {\n return window.getSelection();\n }\n };\n DomWindowHelper.requestAnimationFrame = function (callback) {\n if (DomWindowHelper.isAvailable()) {\n return window.requestAnimationFrame(callback);\n }\n };\n DomWindowHelper.addEventListener = function (type, listener) {\n if (!DomWindowHelper.isAvailable()) return;\n window.addEventListener(type, listener);\n };\n DomWindowHelper.removeEventListener = function (type, listener) {\n if (!DomWindowHelper.isAvailable()) return;\n window.removeEventListener(type, listener);\n };\n DomWindowHelper.matchMedia = function (mediaQueryString) {\n if (!DomWindowHelper.isAvailable() || typeof window.matchMedia === \"undefined\") return null;\n return window.matchMedia(mediaQueryString);\n };\n return DomWindowHelper;\n }();\n var DomDocumentHelper = /** @class */function () {\n function DomDocumentHelper() {}\n DomDocumentHelper.isAvailable = function () {\n return \"undefined\" !== typeof document;\n };\n DomDocumentHelper.getBody = function () {\n if (!DomDocumentHelper.isAvailable()) return;\n return document.body;\n };\n DomDocumentHelper.getDocumentElement = function () {\n if (!DomDocumentHelper.isAvailable()) return;\n return document.documentElement;\n };\n DomDocumentHelper.getDocument = function () {\n if (!DomDocumentHelper.isAvailable()) return;\n return document;\n };\n DomDocumentHelper.getCookie = function () {\n if (!DomDocumentHelper.isAvailable()) return;\n return document.cookie;\n };\n DomDocumentHelper.setCookie = function (newCookie) {\n if (!DomDocumentHelper.isAvailable()) return;\n document.cookie = newCookie;\n };\n DomDocumentHelper.activeElementBlur = function () {\n if (!DomDocumentHelper.isAvailable()) return;\n var activeElement = document.activeElement;\n if (!!activeElement && !!activeElement.blur) {\n activeElement.blur();\n }\n };\n DomDocumentHelper.createElement = function (tagName) {\n if (!DomDocumentHelper.isAvailable()) return;\n return document.createElement(tagName);\n };\n DomDocumentHelper.getComputedStyle = function (elt) {\n if (!DomDocumentHelper.isAvailable()) return new CSSStyleDeclaration();\n return document.defaultView.getComputedStyle(elt);\n };\n DomDocumentHelper.addEventListener = function (type, listener) {\n if (!DomDocumentHelper.isAvailable()) return;\n document.addEventListener(type, listener);\n };\n DomDocumentHelper.removeEventListener = function (type, listener) {\n if (!DomDocumentHelper.isAvailable()) return;\n document.removeEventListener(type, listener);\n };\n return DomDocumentHelper;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/helpers.ts\n\n function createDate(reason, val) {\n if (!val) return new Date();\n if (!settings.storeUtcDates && typeof val === \"string\" && isISODateOnly(val)) {\n val += \"T00:00:00\";\n }\n var d = new Date(val);\n return settings.onDateCreated(d, reason, val);\n }\n function isISODateOnly(str) {\n if (str.indexOf(\"T\") > 0) return false;\n if (!/\\d{4}-\\d{2}-\\d{2}/.test(str)) return false;\n return !isNaN(new Date(str).getTime());\n }\n var helpers_Helpers = /** @class */function () {\n function Helpers() {}\n /**\n * A static methods that returns true if a value undefined, null, empty string or empty array.\n * @param value\n */\n Helpers.isValueEmpty = function (value) {\n if (Array.isArray(value) && value.length === 0) return true;\n if (!!value && Helpers.isValueObject(value) && value.constructor === Object) {\n for (var key in value) {\n if (!Helpers.isValueEmpty(value[key])) return false;\n }\n return true;\n }\n return !value && value !== 0 && value !== false;\n };\n Helpers.isValueUndefined = function (value) {\n return value === undefined || value === null || typeof value === \"number\" && isNaN(value);\n };\n Helpers.isArrayContainsEqual = function (x, y) {\n if (!Array.isArray(x) || !Array.isArray(y)) return false;\n if (x.length !== y.length) return false;\n for (var i = 0; i < x.length; i++) {\n var j = 0;\n for (; j < y.length; j++) {\n if (Helpers.isTwoValueEquals(x[i], y[j])) break;\n }\n if (j === y.length) return false;\n }\n return true;\n };\n Helpers.isArraysEqual = function (x, y, ignoreOrder, caseSensitive, trimStrings) {\n if (ignoreOrder === void 0) {\n ignoreOrder = false;\n }\n if (!Array.isArray(x) || !Array.isArray(y)) return false;\n if (x.length !== y.length) return false;\n if (ignoreOrder) {\n var xSorted = [];\n var ySorted = [];\n for (var i = 0; i < x.length; i++) {\n xSorted.push(x[i]);\n ySorted.push(y[i]);\n }\n xSorted.sort();\n ySorted.sort();\n x = xSorted;\n y = ySorted;\n }\n for (var i = 0; i < x.length; i++) {\n if (!Helpers.isTwoValueEquals(x[i], y[i], ignoreOrder, caseSensitive, trimStrings)) return false;\n }\n return true;\n };\n Helpers.compareStrings = function (x, y) {\n var normalize = settings.comparator.normalizeTextCallback;\n if (!!x) x = normalize(x, \"compare\").trim();\n if (!!y) y = normalize(y, \"compare\").trim();\n if (!x && !y) return 0;\n if (!x) return -1;\n if (!y) return 1;\n if (x === y) return 0;\n var digitIndex = -1;\n for (var i = 0; i < x.length && i < y.length; i++) {\n if (this.isCharDigit(x[i]) && this.isCharDigit(y[i])) {\n digitIndex = i;\n break;\n }\n if (x[i] !== y[i]) break;\n }\n if (digitIndex > -1) {\n var nX = this.getNumberFromStr(x, digitIndex);\n var nY = this.getNumberFromStr(y, digitIndex);\n if (!Number.isNaN(nX) && !Number.isNaN(nY) && nX !== nY) {\n return nX > nY ? 1 : -1;\n }\n }\n return x > y ? 1 : -1;\n };\n Helpers.isTwoValueEquals = function (x, y, ignoreOrder, caseSensitive, trimStrings) {\n if (ignoreOrder === void 0) {\n ignoreOrder = false;\n }\n if (x === y) return true;\n if (Array.isArray(x) && x.length === 0 && typeof y === \"undefined\") return true;\n if (Array.isArray(y) && y.length === 0 && typeof x === \"undefined\") return true;\n if ((x === undefined || x === null) && y === \"\") return true;\n if ((y === undefined || y === null) && x === \"\") return true;\n if (trimStrings === undefined) trimStrings = settings.comparator.trimStrings;\n if (caseSensitive === undefined) caseSensitive = settings.comparator.caseSensitive;\n if (typeof x === \"string\" && typeof y === \"string\") {\n var normalize = settings.comparator.normalizeTextCallback;\n x = normalize(x, \"compare\");\n y = normalize(y, \"compare\");\n if (trimStrings) {\n x = x.trim();\n y = y.trim();\n }\n if (!caseSensitive) {\n x = x.toLowerCase();\n y = y.toLowerCase();\n }\n return x === y;\n }\n if (x instanceof Date && y instanceof Date) return x.getTime() == y.getTime();\n if (Helpers.isConvertibleToNumber(x) && Helpers.isConvertibleToNumber(y)) {\n if (parseInt(x) === parseInt(y) && parseFloat(x) === parseFloat(y)) {\n return true;\n }\n }\n if (!Helpers.isValueEmpty(x) && Helpers.isValueEmpty(y) || Helpers.isValueEmpty(x) && !Helpers.isValueEmpty(y)) return false;\n if ((x === true || x === false) && typeof y == \"string\") {\n return x.toString() === y.toLocaleLowerCase();\n }\n if ((y === true || y === false) && typeof x == \"string\") {\n return y.toString() === x.toLocaleLowerCase();\n }\n if (!Helpers.isValueObject(x) && !Helpers.isValueObject(y)) return x == y;\n if (!Helpers.isValueObject(x) || !Helpers.isValueObject(y)) return false;\n if (x[\"equals\"] && y[\"equals\"]) return x.equals(y);\n if (Array.isArray(x) && Array.isArray(y)) {\n return Helpers.isArraysEqual(x, y, ignoreOrder, caseSensitive, trimStrings);\n }\n for (var p in x) {\n if (!x.hasOwnProperty(p)) continue;\n if (!y.hasOwnProperty(p)) return false;\n if (!this.isTwoValueEquals(x[p], y[p], ignoreOrder, caseSensitive, trimStrings)) return false;\n }\n for (p in y) {\n if (y.hasOwnProperty(p) && !x.hasOwnProperty(p)) return false;\n }\n return true;\n };\n Helpers.randomizeArray = function (array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n };\n Helpers.getUnbindValue = function (value) {\n if (Array.isArray(value)) {\n var res = [];\n for (var i = 0; i < value.length; i++) {\n res.push(Helpers.getUnbindValue(value[i]));\n }\n return res;\n }\n if (!!value && Helpers.isValueObject(value) && !(value instanceof Date)) {\n return JSON.parse(JSON.stringify(value));\n }\n return value;\n };\n Helpers.createCopy = function (obj) {\n var res = {};\n if (!obj) return res;\n for (var key in obj) {\n res[key] = obj[key];\n }\n return res;\n };\n Helpers.isConvertibleToNumber = function (value) {\n return value !== undefined && value !== null && !Array.isArray(value) && !isNaN(value);\n };\n Helpers.isValueObject = function (val, excludeArray) {\n return val instanceof Object && (!excludeArray || !Array.isArray(val));\n };\n Helpers.isNumber = function (value) {\n return !isNaN(this.getNumber(value));\n };\n Helpers.getNumber = function (value) {\n var newValue = Helpers.getNumberCore(value);\n return settings.parseNumber(value, newValue);\n };\n Helpers.getNumberCore = function (value) {\n if (typeof value == \"string\") {\n value = value.trim();\n if (!value) return NaN;\n if (value.indexOf(\"0x\") == 0) {\n if (value.length > 32) return NaN;\n return parseInt(value);\n }\n if (value.length > 15 && Helpers.isDigitsOnly(value)) return NaN;\n if (Helpers.isStringHasOperator(value)) return NaN;\n }\n value = this.prepareStringToNumber(value);\n var res = parseFloat(value);\n if (isNaN(res) || !isFinite(value)) return NaN;\n return res;\n };\n Helpers.isStringHasOperator = function (str) {\n if (str.lastIndexOf(\"-\") > 0) return false;\n if (str.lastIndexOf(\"+\") > 0) return false;\n var operators = \"*^/%\";\n for (var i = 0; i < operators.length; i++) {\n if (str.indexOf(operators[i]) > -1) return true;\n }\n return false;\n };\n Helpers.prepareStringToNumber = function (val) {\n if (typeof val !== \"string\" || !val) return val;\n var i = val.indexOf(\",\");\n if (i > -1 && val.indexOf(\",\", i + 1) < 0) {\n return val.replace(\",\", \".\");\n }\n return val;\n };\n Helpers.getMaxLength = function (maxLength, surveyLength) {\n if (maxLength < 0) {\n maxLength = surveyLength;\n }\n return maxLength > 0 ? maxLength : null;\n };\n Helpers.getRemainingCharacterCounterText = function (newValue, maxLength) {\n if (!maxLength || maxLength <= 0 || !settings.showMaxLengthIndicator) {\n return \"\";\n }\n var value = newValue ? newValue.length : \"0\";\n return [value, maxLength].join(\"/\");\n };\n Helpers.getNumberByIndex = function (index, startIndexStr, parentIndex) {\n if (index < 0) return \"\";\n var startIndex = 1;\n var prefix = \"\";\n var postfix = \".\";\n var isNumeric = true;\n var strIndex = \"A\";\n var str = \"\";\n var hasDigitFunc = function (str) {\n if (!str) return false;\n for (var i = 0; i < str.length; i++) {\n if (Helpers.isCharDigit(str[i])) return true;\n }\n return false;\n };\n if (!!startIndexStr) {\n str = startIndexStr;\n var ind = str.length - 1;\n var hasDigit = hasDigitFunc(str);\n var checkLetter = function () {\n return hasDigit && !Helpers.isCharDigit(str[ind]) || Helpers.isCharNotLetterAndDigit(str[ind]);\n };\n while (ind >= 0 && checkLetter()) ind--;\n var newPostfix = \"\";\n if (ind < str.length - 1) {\n newPostfix = str.substring(ind + 1);\n str = str.substring(0, ind + 1);\n }\n ind = str.length - 1;\n while (ind >= 0) {\n if (checkLetter()) break;\n ind--;\n if (!hasDigit) break;\n }\n strIndex = str.substring(ind + 1);\n prefix = str.substring(0, ind + 1);\n if (parseInt(strIndex)) startIndex = parseInt(strIndex);else if (strIndex.length == 1) isNumeric = false;\n if (!!newPostfix || !!prefix) {\n postfix = newPostfix;\n }\n }\n if (parentIndex > -1 && hasDigitFunc(prefix)) {\n prefix = this.getNumberByIndex(parentIndex, prefix);\n }\n if (isNumeric) {\n var val = (index + startIndex).toString();\n while (val.length < strIndex.length) val = \"0\" + val;\n return prefix + val + postfix;\n }\n return prefix + String.fromCharCode(strIndex.charCodeAt(0) + index) + postfix;\n };\n Helpers.isCharNotLetterAndDigit = function (ch) {\n return ch.toUpperCase() == ch.toLowerCase() && !Helpers.isCharDigit(ch);\n };\n Helpers.isCharDigit = function (ch) {\n return ch >= \"0\" && ch <= \"9\";\n };\n Helpers.isDigitsOnly = function (str) {\n if (!str) return false;\n for (var i = 0; i < str.length; i++) {\n if (!Helpers.isCharDigit(str[i])) return false;\n }\n return true;\n };\n Helpers.getNumberFromStr = function (str, index) {\n if (!this.isCharDigit(str[index])) return NaN;\n var nStr = \"\";\n while (index < str.length && this.isCharDigit(str[index])) {\n nStr += str[index];\n index++;\n }\n if (!nStr) return NaN;\n return this.getNumber(nStr);\n };\n Helpers.countDecimals = function (value) {\n if (Helpers.isNumber(value) && Math.floor(value) !== value) {\n var strs = value.toString().split(\".\");\n return strs.length > 1 && strs[1].length || 0;\n }\n return 0;\n };\n Helpers.correctAfterPlusMinis = function (a, b, res) {\n var digitsA = Helpers.countDecimals(a);\n var digitsB = Helpers.countDecimals(b);\n if (digitsA > 0 || digitsB > 0) {\n var digits = Math.max(digitsA, digitsB);\n res = parseFloat(res.toFixed(digits));\n }\n return res;\n };\n Helpers.sumAnyValues = function (a, b) {\n if (!Helpers.isNumber(a) || !Helpers.isNumber(b)) {\n if (Array.isArray(a) && Array.isArray(b)) return [].concat(a).concat(b);\n if (Array.isArray(a) || Array.isArray(b)) {\n var arr = Array.isArray(a) ? a : b;\n var val = arr === a ? b : a;\n if (typeof val === \"string\") {\n var str = arr.join(\", \");\n return arr === a ? str + val : val + str;\n }\n if (typeof val === \"number\") {\n var res = 0;\n for (var i = 0; i < arr.length; i++) {\n if (typeof arr[i] === \"number\") {\n res = Helpers.correctAfterPlusMinis(res, arr[i], res + arr[i]);\n }\n }\n return Helpers.correctAfterPlusMinis(res, val, res + val);\n }\n }\n return a + b;\n }\n if (typeof a === \"string\" || typeof b === \"string\") return a + b;\n return Helpers.correctAfterPlusMinis(a, b, a + b);\n };\n Helpers.correctAfterMultiple = function (a, b, res) {\n var digits = Helpers.countDecimals(a) + Helpers.countDecimals(b);\n if (digits > 0) {\n res = parseFloat(res.toFixed(digits));\n }\n return res;\n };\n Helpers.convertArrayValueToObject = function (src, propName, dest) {\n if (dest === void 0) {\n dest = undefined;\n }\n var res = new Array();\n if (!src || !Array.isArray(src)) return res;\n for (var i = 0; i < src.length; i++) {\n var item = void 0;\n if (Array.isArray(dest)) {\n item = Helpers.findObjByPropValue(dest, propName, src[i]);\n }\n if (!item) {\n item = {};\n item[propName] = src[i];\n }\n res.push(item);\n }\n return res;\n };\n Helpers.findObjByPropValue = function (arr, propName, val) {\n for (var i = 0; i < arr.length; i++) {\n if (Helpers.isTwoValueEquals(arr[i][propName], val)) return arr[i];\n }\n return undefined;\n };\n Helpers.convertArrayObjectToValue = function (src, propName) {\n var res = new Array();\n if (!src || !Array.isArray(src)) return res;\n for (var i = 0; i < src.length; i++) {\n var itemVal = !!src[i] ? src[i][propName] : undefined;\n if (!Helpers.isValueEmpty(itemVal)) res.push(itemVal);\n }\n return res;\n };\n Helpers.convertDateToString = function (date) {\n var toStr = function (val) {\n if (val < 10) return \"0\" + val.toString();\n return val.toString();\n };\n return date.getFullYear() + \"-\" + toStr(date.getMonth() + 1) + \"-\" + toStr(date.getDate());\n };\n Helpers.convertDateTimeToString = function (date) {\n var toStr = function (val) {\n if (val < 10) return \"0\" + val.toString();\n return val.toString();\n };\n return this.convertDateToString(date) + \" \" + toStr(date.getHours()) + \":\" + toStr(date.getMinutes());\n };\n Helpers.convertValToQuestionVal = function (val, inputType) {\n if (val instanceof Date) {\n if (inputType === \"datetime-local\") return Helpers.convertDateTimeToString(val);\n return Helpers.convertDateToString(val);\n }\n return this.getUnbindValue(val);\n };\n Helpers.compareVerions = function (ver1, ver2) {\n if (!ver1 && !ver2) return 0;\n var ver1Ar = ver1.split(\".\");\n var ver2Ar = ver2.split(\".\");\n var len1 = ver1Ar.length;\n var len2 = ver2Ar.length;\n for (var i = 0; i < len1 && i < len2; i++) {\n var str1 = ver1Ar[i];\n var str2 = ver2Ar[i];\n if (str1.length === str2.length) {\n if (str1 !== str2) {\n return str1 < str2 ? -1 : 1;\n }\n } else {\n return str1.length < str2.length ? -1 : 1;\n }\n }\n return len1 === len2 ? 0 : len1 < len2 ? -1 : 1;\n };\n Helpers.isUrlYoutubeVideo = function (url) {\n if (!url) return false;\n var youtubeDomains = [\"www.youtube.com\", \"m.youtube.com\", \"youtube.com\", \"youtu.be\"];\n url = url.toLowerCase();\n url = url.replace(/^https?:\\/\\//, \"\");\n for (var i = 0; i < youtubeDomains.length; i++) {\n if (url.indexOf(youtubeDomains[i] + \"/\") === 0) return true;\n }\n return false;\n };\n return Helpers;\n }();\n if (!String.prototype[\"format\"]) {\n String.prototype[\"format\"] = function () {\n var args = arguments;\n return this.replace(/{(\\d+)}/g, function (match, number) {\n return typeof args[number] != \"undefined\" ? args[number] : match;\n });\n };\n }\n\n // CONCATENATED MODULE: ./packages/survey-core/src/localization/english.ts\n // Uncomment the line below if you create a custom dictionary\n // import { setupLocale } from \"survey-core\";\n var englishStrings = {\n pagePrevText: \"Previous\",\n pageNextText: \"Next\",\n completeText: \"Complete\",\n previewText: \"Preview\",\n editText: \"Edit\",\n startSurveyText: \"Start\",\n otherItemText: \"Other (describe)\",\n noneItemText: \"None\",\n refuseItemText: \"Refuse to answer\",\n dontKnowItemText: \"Don't know\",\n selectAllItemText: \"Select All\",\n deselectAllItemText: \"Deselect all\",\n progressText: \"Page {0} of {1}\",\n indexText: \"{0} of {1}\",\n panelDynamicProgressText: \"{0} of {1}\",\n panelDynamicTabTextFormat: \"Panel {panelIndex}\",\n questionsProgressText: \"Answered {0}/{1} questions\",\n emptySurvey: \"The survey doesn't contain any visible elements.\",\n completingSurvey: \"Thank you for completing the survey\",\n completingSurveyBefore: \"You have already completed this survey.\",\n loadingSurvey: \"Loading Survey...\",\n placeholder: \"Select...\",\n ratingOptionsCaption: \"Select...\",\n value: \"value\",\n requiredError: \"Response required.\",\n requiredErrorInPanel: \"Response required: answer at least one question.\",\n requiredInAllRowsError: \"Response required: answer questions in all rows.\",\n eachRowUniqueError: \"Each row must have a unique value.\",\n numericError: \"The value should be numeric.\",\n minError: \"The value should not be less than {0}\",\n maxError: \"The value should not be greater than {0}\",\n textNoDigitsAllow: \"Numbers are not allowed.\",\n textMinLength: \"Please enter at least {0} character(s).\",\n textMaxLength: \"Please enter no more than {0} character(s).\",\n textMinMaxLength: \"Please enter at least {0} and no more than {1} characters.\",\n minRowCountError: \"Please fill in at least {0} row(s).\",\n minSelectError: \"Please select at least {0} option(s).\",\n maxSelectError: \"Please select no more than {0} option(s).\",\n numericMinMax: \"The '{0}' should be at least {1} and at most {2}\",\n numericMin: \"The '{0}' should be at least {1}\",\n numericMax: \"The '{0}' should be at most {1}\",\n invalidEmail: \"Please enter a valid e-mail address.\",\n invalidExpression: \"The expression: {0} should return 'true'.\",\n urlRequestError: \"The request returned error '{0}'. {1}\",\n urlGetChoicesError: \"The request returned empty data or the 'path' property is incorrect\",\n exceedMaxSize: \"The file size should not exceed {0}.\",\n noUploadFilesHandler: \"Files cannot be uploaded. Please add a handler for the 'onUploadFiles' event.\",\n otherRequiredError: \"Response required: enter another value.\",\n uploadingFile: \"Your file is uploading. Please wait several seconds and try again.\",\n loadingFile: \"Loading...\",\n chooseFile: \"Choose file(s)...\",\n noFileChosen: \"No file selected\",\n filePlaceholder: \"Drag and drop a file here or click the button below to select a file to upload.\",\n confirmDelete: \"Are you sure you want to delete this record?\",\n keyDuplicationError: \"This value should be unique.\",\n addColumn: \"Add Column\",\n addRow: \"Add Row\",\n removeRow: \"Remove\",\n emptyRowsText: \"There are no rows.\",\n addPanel: \"Add new\",\n removePanel: \"Remove\",\n showDetails: \"Show Details\",\n hideDetails: \"Hide Details\",\n choices_Item: \"item\",\n matrix_column: \"Column\",\n matrix_row: \"Row\",\n multipletext_itemname: \"text\",\n savingData: \"The results are being saved on the server...\",\n savingDataError: \"An error occurred and we could not save the results.\",\n savingDataSuccess: \"The results were saved successfully!\",\n savingExceedSize: \"Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact the survey owner.\",\n saveAgainButton: \"Try again\",\n timerMin: \"min\",\n timerSec: \"sec\",\n timerSpentAll: \"You have spent {0} on this page and {1} in total.\",\n timerSpentPage: \"You have spent {0} on this page.\",\n timerSpentSurvey: \"You have spent {0} in total.\",\n timerLimitAll: \"You have spent {0} of {1} on this page and {2} of {3} in total.\",\n timerLimitPage: \"You have spent {0} of {1} on this page.\",\n timerLimitSurvey: \"You have spent {0} of {1} in total.\",\n clearCaption: \"Clear\",\n signaturePlaceHolder: \"Sign here\",\n signaturePlaceHolderReadOnly: \"No signature\",\n chooseFileCaption: \"Select File\",\n takePhotoCaption: \"Take Photo\",\n photoPlaceholder: \"Click the button below to take a photo using the camera.\",\n fileOrPhotoPlaceholder: \"Drag and drop or select a file to upload or take a photo using the camera.\",\n replaceFileCaption: \"Replace file\",\n removeFileCaption: \"Remove this file\",\n booleanCheckedLabel: \"Yes\",\n booleanUncheckedLabel: \"No\",\n confirmRemoveFile: \"Are you sure that you want to remove this file: {0}?\",\n confirmRemoveAllFiles: \"Are you sure that you want to remove all files?\",\n questionTitlePatternText: \"Question Title\",\n modalCancelButtonText: \"Cancel\",\n modalApplyButtonText: \"Apply\",\n filterStringPlaceholder: \"Type to search...\",\n emptyMessage: \"No data to display\",\n noEntriesText: \"No entries yet.\\nClick the button below to add a new entry.\",\n noEntriesReadonlyText: \"No entries\",\n tabTitlePlaceholder: \"New Panel\",\n more: \"More\",\n tagboxDoneButtonCaption: \"OK\",\n selectToRankEmptyRankedAreaText: \"All choices are selected for ranking\",\n selectToRankEmptyUnrankedAreaText: \"Drag choices here to rank them\",\n ok: \"OK\",\n cancel: \"Cancel\"\n };\n // Uncomment the lines below if you create a custom dictionary.\n // Replace \"en\" with a custom locale code (for example, \"fr\" or \"de\"),\n // Replace `englishStrings` with the name of the variable that contains the custom dictionary.\n //setupLocale({ localeCode: \"en\", strings: englishStrings, nativeName: \"English\", englishName: \"English\" });\n\n // CONCATENATED MODULE: ./packages/survey-core/src/surveyStrings.ts\n\n var surveyLocalization = {\n currentLocaleValue: \"\",\n defaultLocaleValue: \"en\",\n locales: {},\n localeNames: {},\n localeNamesInEnglish: {},\n localeDirections: {},\n supportedLocales: [],\n useEnglishNames: false,\n //TODO remove on next week\n get showNamesInEnglish() {\n return this.useEnglishNames;\n },\n set showNamesInEnglish(val) {\n this.useEnglishNames = val;\n },\n setupLocale: function (localeConfig) {\n var loc = localeConfig.localeCode;\n this.locales[loc] = localeConfig.strings;\n this.localeNames[loc] = localeConfig.nativeName;\n this.localeNamesInEnglish[loc] = localeConfig.englishName;\n if (localeConfig.rtl !== undefined) {\n this.localeDirections[loc] = localeConfig.rtl;\n }\n },\n get currentLocale() {\n return this.currentLocaleValue === this.defaultLocaleValue ? \"\" : this.currentLocaleValue;\n },\n set currentLocale(val) {\n if (val === \"cz\") val = \"cs\";\n this.currentLocaleValue = val;\n },\n get defaultLocale() {\n return this.defaultLocaleValue;\n },\n set defaultLocale(val) {\n if (val === \"cz\") val = \"cs\";\n this.defaultLocaleValue = val;\n },\n getLocaleStrings: function (loc) {\n return this.locales[loc];\n },\n getString: function (strName, locale) {\n var _this = this;\n if (locale === void 0) {\n locale = null;\n }\n var locs = new Array();\n var addLocaleCore = function (locName) {\n var strs = _this.locales[locName];\n if (!!strs) locs.push(strs);\n };\n var addLocale = function (locName) {\n if (!locName) return;\n addLocaleCore(locName);\n var index = locName.indexOf(\"-\");\n if (index < 1) return;\n locName = locName.substring(0, index);\n addLocaleCore(locName);\n };\n addLocale(locale);\n addLocale(this.currentLocale);\n addLocale(this.defaultLocale);\n if (this.defaultLocale !== \"en\") {\n addLocaleCore(\"en\");\n }\n for (var i = 0; i < locs.length; i++) {\n var res = locs[i][strName];\n if (res !== undefined) return res;\n }\n return this.onGetExternalString(strName, locale);\n },\n getLocaleName: function (loc, inEnglish) {\n if (!loc) return \"\";\n if (inEnglish === undefined) inEnglish = this.showNamesInEnglish;\n var firstNames = inEnglish ? this.localeNamesInEnglish : this.localeNames;\n var secondNames = inEnglish ? this.localeNames : this.localeNamesInEnglish;\n return firstNames[loc] || secondNames[loc] || loc;\n },\n getLocales: function (removeDefaultLoc) {\n var _this = this;\n if (removeDefaultLoc === void 0) {\n removeDefaultLoc = false;\n }\n var res = [];\n res.push(\"\");\n var locs = this.locales;\n if (this.supportedLocales && this.supportedLocales.length > 0) {\n locs = {};\n for (var i = 0; i < this.supportedLocales.length; i++) {\n locs[this.supportedLocales[i]] = true;\n }\n }\n for (var key in locs) {\n if (removeDefaultLoc && key == this.defaultLocale) continue;\n res.push(key);\n }\n var locName = function (loc) {\n return _this.getLocaleName(loc).toLowerCase();\n };\n res.sort(function (a, b) {\n var str1 = locName(a);\n var str2 = locName(b);\n if (str1 === str2) return 0;\n return str1 < str2 ? -1 : 1;\n });\n return res;\n },\n onGetExternalString: function (name, locale) {\n return undefined;\n }\n };\n function getLocaleString(strName, locale) {\n if (locale === void 0) {\n locale = null;\n }\n return surveyLocalization.getString(strName, locale);\n }\n function getLocaleStrings(locale) {\n return surveyLocalization.getLocaleStrings(locale);\n }\n function setupLocale(localeConfig) {\n surveyLocalization.setupLocale(localeConfig);\n }\n var surveyStrings = englishStrings;\n surveyLocalization.locales[\"en\"] = englishStrings;\n surveyLocalization.localeNames[\"en\"] = \"english\";\n\n // CONCATENATED MODULE: ./packages/survey-core/src/jsonobject.ts\n var __extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var __spreadArray = undefined && undefined.__spreadArray || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];\n return to;\n };\n function ensureLocString(target, options, key) {\n var locString = target.getLocalizableString(key);\n if (!locString) {\n var defaultStr = void 0;\n if (typeof options.localizable === \"object\" && options.localizable.defaultStr) {\n defaultStr = options.localizable.defaultStr;\n }\n locString = target.createLocalizableString(key, target, true, defaultStr);\n if (typeof options.localizable === \"object\" && typeof options.localizable.onGetTextCallback === \"function\") {\n locString.onGetTextCallback = options.localizable.onGetTextCallback;\n }\n }\n }\n function getLocStringValue(target, options, key) {\n ensureLocString(target, options, key);\n var res = target.getLocalizableStringText(key);\n if (!!res) return res;\n if (typeof options.localizable === \"object\" && options.localizable.defaultStr) {\n var loc = !!target.getLocale ? target.getLocale() : \"\";\n return getLocaleString(options.localizable.defaultStr, loc);\n }\n return \"\";\n }\n function jsonobject_property(options) {\n if (options === void 0) {\n options = {};\n }\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n return function (target, key) {\n var processComputedUpdater = function (obj, val) {\n if (!!val && typeof val === \"object\" && val.type === ComputedUpdater.ComputedUpdaterType) {\n base_Base.startCollectDependencies(function () {\n return obj[key] = val.updater();\n }, obj, key);\n var result = val.updater();\n var dependencies = base_Base.finishCollectDependencies();\n val.setDependencies(dependencies);\n if (obj.dependencies[key]) {\n obj.dependencies[key].dispose();\n }\n obj.dependencies[key] = val;\n return result;\n }\n return val;\n };\n if (!options || !options.localizable) {\n Object.defineProperty(target, key, {\n get: function () {\n // const serializationProperty = Serializer.getProperty(target.getType(), key);\n // if(!!serializationProperty && options.defaultValue !== undefined) {\n // ConsoleWarnings.error(\"remove defaultValue from @property for class \" + target.getType() + \" property name is \" + key);\n // }\n var defaultVal = null;\n if (!!options) {\n if (typeof options.getDefaultValue === \"function\") {\n defaultVal = options.getDefaultValue(this);\n }\n if (options.defaultValue !== undefined) {\n defaultVal = options.defaultValue;\n }\n }\n return this.getPropertyValue(key, defaultVal);\n },\n set: function (val) {\n var newValue = processComputedUpdater(this, val);\n var prevValue = this.getPropertyValue(key);\n if (newValue !== prevValue) {\n this.setPropertyValue(key, newValue);\n if (!!options && options.onSet) {\n options.onSet(newValue, this, prevValue);\n }\n }\n }\n });\n } else {\n Object.defineProperty(target, key, {\n get: function () {\n return getLocStringValue(this, options, key);\n },\n set: function (val) {\n ensureLocString(this, options, key);\n var newValue = processComputedUpdater(this, val);\n this.setLocalizableStringText(key, newValue);\n if (!!options && options.onSet) {\n options.onSet(newValue, this);\n }\n }\n });\n Object.defineProperty(target, typeof options.localizable === \"object\" && !!options.localizable.name ? options.localizable.name : \"loc\" + key.charAt(0).toUpperCase() + key.slice(1), {\n get: function () {\n ensureLocString(this, options, key);\n return this.getLocalizableString(key);\n }\n });\n }\n };\n }\n function ensureArray(target, options, key) {\n target.ensureArray(key, function (item, index) {\n var handler = !!options ? options.onPush : null;\n handler && handler(item, index, target);\n }, function (item, index) {\n var handler = !!options ? options.onRemove : null;\n handler && handler(item, index, target);\n });\n }\n function propertyArray(options) {\n return function (target, key) {\n Object.defineProperty(target, key, {\n get: function () {\n ensureArray(this, options, key);\n return this.getPropertyValue(key);\n },\n set: function (val) {\n ensureArray(this, options, key);\n var arr = this.getPropertyValue(key);\n if (val === arr) {\n return;\n }\n if (arr) {\n arr.splice.apply(arr, __spreadArray([0, arr.length], val || []));\n } else {\n this.setPropertyValue(key, val);\n }\n if (!!options && options.onSet) {\n options.onSet(val, this);\n }\n }\n });\n };\n }\n /**\n * Contains information about a property of a survey element (page, panel, questions, and etc).\n * @see addProperty\n * @see removeProperty\n * @see [Add Properties](https://surveyjs.io/Documentation/Survey-Creator#addproperties)\n * @see [Remove Properties](https://surveyjs.io/Documentation/Survey-Creator#removeproperties)\n */\n var jsonobject_JsonObjectProperty = /** @class */function () {\n function JsonObjectProperty(classInfo, name, isRequired) {\n if (isRequired === void 0) {\n isRequired = false;\n }\n this.name = name;\n this.isRequiredValue = false;\n this.isUniqueValue = false;\n this.isSerializable = true;\n this.isLightSerializable = true;\n this.isCustom = false;\n this.isDynamicChoices = false; //TODO obsolete, use dependsOn attribute\n this.isBindable = false;\n this.category = \"\";\n this.categoryIndex = -1;\n this.visibleIndex = -1;\n this.maxLength = -1;\n this.isArray = false;\n this.classInfoValue = classInfo;\n this.isRequiredValue = isRequired;\n this.idValue = JsonObjectProperty.Index++;\n }\n Object.defineProperty(JsonObjectProperty.prototype, \"id\", {\n get: function () {\n return this.idValue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"classInfo\", {\n get: function () {\n return this.classInfoValue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"type\", {\n get: function () {\n return this.typeValue ? this.typeValue : \"string\";\n },\n set: function (value) {\n if (value === \"itemvalues\") value = \"itemvalue[]\";\n if (value === \"textitems\") value = \"textitem[]\";\n this.typeValue = value;\n if (this.typeValue.indexOf(\"[]\") === this.typeValue.length - 2) {\n this.isArray = true;\n this.className = this.typeValue.substring(0, this.typeValue.length - 2);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"isRequired\", {\n get: function () {\n return this.isRequiredValue;\n },\n set: function (val) {\n if (val !== this.isRequired) {\n this.isRequiredValue = val;\n if (!!this.classInfo) {\n this.classInfo.resetAllProperties();\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"isUnique\", {\n get: function () {\n return this.isUniqueValue;\n },\n set: function (val) {\n this.isUniqueValue = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"uniquePropertyName\", {\n get: function () {\n return this.uniquePropertyValue;\n },\n set: function (val) {\n this.uniquePropertyValue = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"hasToUseGetValue\", {\n get: function () {\n return this.onGetValue || this.serializationProperty;\n },\n enumerable: false,\n configurable: true\n });\n JsonObjectProperty.prototype.getDefaultValue = function (obj) {\n var result = !!this.defaultValueFunc ? this.defaultValueFunc(obj) : this.defaultValueValue;\n if (!!JsonObjectProperty.getItemValuesDefaultValue && Serializer.isDescendantOf(this.className, \"itemvalue\")) {\n result = JsonObjectProperty.getItemValuesDefaultValue(this.defaultValueValue || [], this.className);\n }\n return result;\n };\n Object.defineProperty(JsonObjectProperty.prototype, \"defaultValue\", {\n get: function () {\n return this.getDefaultValue(undefined);\n },\n set: function (newValue) {\n this.defaultValueValue = newValue;\n },\n enumerable: false,\n configurable: true\n });\n JsonObjectProperty.prototype.isDefaultValue = function (value) {\n return this.isDefaultValueByObj(undefined, value);\n };\n JsonObjectProperty.prototype.isDefaultValueByObj = function (obj, value) {\n if (this.isLocalizable) return value === null || value === undefined;\n var dValue = this.getDefaultValue(obj);\n if (!helpers_Helpers.isValueEmpty(dValue)) {\n return helpers_Helpers.isTwoValueEquals(value, dValue, false, true, false);\n }\n return value === false && (this.type == \"boolean\" || this.type == \"switch\") && !this.defaultValueFunc || value === \"\" || helpers_Helpers.isValueEmpty(value);\n };\n JsonObjectProperty.prototype.getSerializableValue = function (obj, storeDefaults) {\n if (!!this.onSerializeValue) return this.onSerializeValue(obj);\n var value = this.getValue(obj);\n if (value === undefined || value === null) return undefined;\n if (!storeDefaults && this.isDefaultValueByObj(obj, value)) return undefined;\n return value;\n };\n JsonObjectProperty.prototype.getValue = function (obj) {\n if (this.onGetValue) {\n obj = this.getOriginalObj(obj);\n return this.onGetValue(obj);\n }\n if (this.serializationProperty && !!obj[this.serializationProperty]) return obj[this.serializationProperty].getJson();\n return obj[this.name];\n };\n JsonObjectProperty.prototype.getPropertyValue = function (obj) {\n if (this.isLocalizable) {\n return !!obj[this.serializationProperty] ? obj[this.serializationProperty].text : null;\n }\n return this.getValue(obj);\n };\n Object.defineProperty(JsonObjectProperty.prototype, \"hasToUseSetValue\", {\n get: function () {\n return this.onSetValue || this.serializationProperty;\n },\n enumerable: false,\n configurable: true\n });\n JsonObjectProperty.prototype.settingValue = function (obj, value) {\n if (!this.onSettingValue || obj.isLoadingFromJson) return value;\n return this.onSettingValue(obj, value);\n };\n JsonObjectProperty.prototype.setValue = function (obj, value, jsonConv) {\n if (this.onSetValue) {\n obj = this.getOriginalObj(obj);\n this.onSetValue(obj, value, jsonConv);\n } else {\n if (this.serializationProperty && !!obj[this.serializationProperty]) obj[this.serializationProperty].setJson(value, true);else {\n if (value && typeof value === \"string\") {\n if (this.type == \"number\") {\n value = parseInt(value);\n }\n if (this.type == \"boolean\" || this.type == \"switch\") {\n value = value.toLowerCase() === \"true\";\n }\n }\n obj[this.name] = value;\n }\n }\n };\n JsonObjectProperty.prototype.validateValue = function (value) {\n var choices = this.choices;\n if (!Array.isArray(choices) || choices.length === 0) return true;\n return choices.indexOf(value) > -1;\n };\n JsonObjectProperty.prototype.getObjType = function (objType) {\n if (!this.classNamePart) return objType;\n return objType.replace(this.classNamePart, \"\");\n };\n Object.defineProperty(JsonObjectProperty.prototype, \"choices\", {\n /**\n * Depricated, please use getChoices\n */\n get: function () {\n return this.getChoices(null);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"hasChoices\", {\n get: function () {\n return !!this.choicesValue || !!this.choicesfunc;\n },\n enumerable: false,\n configurable: true\n });\n JsonObjectProperty.prototype.getChoices = function (obj, choicesCallback) {\n if (choicesCallback === void 0) {\n choicesCallback = null;\n }\n if (this.choicesValue != null) return this.choicesValue;\n if (this.choicesfunc != null) return this.choicesfunc(obj, choicesCallback);\n return null;\n };\n JsonObjectProperty.prototype.setChoices = function (value, valueFunc) {\n if (valueFunc === void 0) {\n valueFunc = null;\n }\n this.choicesValue = value;\n this.choicesfunc = valueFunc;\n };\n JsonObjectProperty.prototype.getBaseValue = function () {\n if (!this.baseValue) return \"\";\n if (typeof this.baseValue == \"function\") return this.baseValue();\n return this.baseValue;\n };\n JsonObjectProperty.prototype.setBaseValue = function (val) {\n this.baseValue = val;\n };\n Object.defineProperty(JsonObjectProperty.prototype, \"readOnly\", {\n get: function () {\n return this.readOnlyValue != null ? this.readOnlyValue : false;\n },\n set: function (val) {\n this.readOnlyValue = val;\n },\n enumerable: false,\n configurable: true\n });\n JsonObjectProperty.prototype.isEnable = function (obj) {\n if (this.readOnly) return false;\n if (!obj || !this.enableIf) return true;\n return this.enableIf(this.getOriginalObj(obj));\n };\n JsonObjectProperty.prototype.isVisible = function (layout, obj) {\n if (obj === void 0) {\n obj = null;\n }\n var isLayout = !this.layout || !layout || this.layout === layout;\n if (!this.visible || !isLayout) return false;\n if (!!this.visibleIf && !!obj) {\n return this.visibleIf(this.getOriginalObj(obj));\n }\n return true;\n };\n JsonObjectProperty.prototype.getOriginalObj = function (obj) {\n if (obj && obj.getOriginalObj) {\n var orjObj = obj.getOriginalObj();\n if (orjObj && Serializer.findProperty(orjObj.getType(), this.name)) {\n return orjObj;\n }\n }\n return obj;\n };\n Object.defineProperty(JsonObjectProperty.prototype, \"visible\", {\n get: function () {\n return this.visibleValue != null ? this.visibleValue : true;\n },\n set: function (val) {\n this.visibleValue = val;\n },\n enumerable: false,\n configurable: true\n });\n JsonObjectProperty.prototype.isAvailableInVersion = function (ver) {\n if (!!this.alternativeName || this.oldName) return true;\n return this.isAvailableInVersionCore(ver);\n };\n JsonObjectProperty.prototype.getSerializedName = function (ver) {\n if (!this.alternativeName) return this.name;\n return this.isAvailableInVersionCore(ver) ? this.name : this.alternativeName || this.oldName;\n };\n JsonObjectProperty.prototype.getSerializedProperty = function (obj, ver) {\n if (!this.oldName || this.isAvailableInVersionCore(ver)) return this;\n if (!obj || !obj.getType) return null;\n return Serializer.findProperty(obj.getType(), this.oldName);\n };\n JsonObjectProperty.prototype.isAvailableInVersionCore = function (ver) {\n if (!ver || !this.version) return true;\n return helpers_Helpers.compareVerions(this.version, ver) <= 0;\n };\n Object.defineProperty(JsonObjectProperty.prototype, \"isLocalizable\", {\n get: function () {\n return this.isLocalizableValue != null ? this.isLocalizableValue : false;\n },\n set: function (val) {\n this.isLocalizableValue = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(JsonObjectProperty.prototype, \"dataList\", {\n get: function () {\n return Array.isArray(this.dataListValue) ? this.dataListValue : [];\n },\n set: function (val) {\n this.dataListValue = val;\n },\n enumerable: false,\n configurable: true\n });\n JsonObjectProperty.prototype.mergeWith = function (prop) {\n var valuesNames = JsonObjectProperty.mergableValues;\n for (var i = 0; i < valuesNames.length; i++) {\n this.mergeValue(prop, valuesNames[i]);\n }\n };\n JsonObjectProperty.prototype.addDependedProperty = function (name) {\n if (!this.dependedProperties) {\n this.dependedProperties = [];\n }\n if (this.dependedProperties.indexOf(name) < 0) {\n this.dependedProperties.push(name);\n }\n };\n JsonObjectProperty.prototype.getDependedProperties = function () {\n return !!this.dependedProperties ? this.dependedProperties : [];\n };\n JsonObjectProperty.prototype.schemaType = function () {\n if (this.className === \"choicesByUrl\") return undefined;\n if (this.className === \"string\") return this.className;\n if (!!this.className) return \"array\";\n if (!!this.baseClassName) return \"array\";\n if (this.type == \"switch\") return \"boolean\";\n if (this.type == \"boolean\" || this.type == \"number\") return this.type;\n return \"string\";\n };\n JsonObjectProperty.prototype.schemaRef = function () {\n if (!!this.className) return this.className;\n return undefined;\n };\n JsonObjectProperty.prototype.mergeValue = function (prop, valueName) {\n if (this[valueName] == null && prop[valueName] != null) {\n this[valueName] = prop[valueName];\n }\n };\n JsonObjectProperty.Index = 1;\n JsonObjectProperty.mergableValues = [\"typeValue\", \"choicesValue\", \"baseValue\", \"readOnlyValue\", \"visibleValue\", \"isSerializable\", \"isLightSerializable\", \"isCustom\", \"isBindable\", \"isUnique\", \"uniquePropertyName\", \"isDynamicChoices\", \"isLocalizableValue\", \"className\", \"alternativeName\", \"oldName\", \"layout\", \"version\", \"classNamePart\", \"baseClassName\", \"defaultValue\", \"defaultValueFunc\", \"serializationProperty\", \"onGetValue\", \"onSetValue\", \"onSettingValue\", \"displayName\", \"category\", \"categoryIndex\", \"visibleIndex\", \"nextToProperty\", \"overridingProperty\", \"showMode\", \"dependedProperties\", \"visibleIf\", \"enableIf\", \"onExecuteExpression\", \"onPropertyEditorUpdate\", \"maxLength\", \"maxValue\", \"minValue\", \"dataListValue\"];\n return JsonObjectProperty;\n }();\n var CustomPropertiesCollection = /** @class */function () {\n function CustomPropertiesCollection() {}\n CustomPropertiesCollection.addProperty = function (className, property) {\n className = className.toLowerCase();\n var props = CustomPropertiesCollection.properties;\n if (!props[className]) {\n props[className] = [];\n }\n props[className].push(property);\n };\n CustomPropertiesCollection.removeProperty = function (className, propertyName) {\n className = className.toLowerCase();\n var props = CustomPropertiesCollection.properties;\n if (!props[className]) return;\n var properties = props[className];\n for (var i = 0; i < properties.length; i++) {\n if (properties[i].name == propertyName) {\n props[className].splice(i, 1);\n break;\n }\n }\n };\n CustomPropertiesCollection.removeAllProperties = function (className) {\n className = className.toLowerCase();\n delete CustomPropertiesCollection.properties[className];\n };\n CustomPropertiesCollection.addClass = function (className, parentClassName) {\n className = className.toLowerCase();\n if (parentClassName) {\n parentClassName = parentClassName.toLowerCase();\n }\n CustomPropertiesCollection.parentClasses[className] = parentClassName;\n };\n CustomPropertiesCollection.getProperties = function (className) {\n className = className.toLowerCase();\n var res = [];\n var props = CustomPropertiesCollection.properties;\n while (className) {\n var properties = props[className];\n if (properties) {\n for (var i = 0; i < properties.length; i++) {\n res.push(properties[i]);\n }\n }\n className = CustomPropertiesCollection.parentClasses[className];\n }\n return res;\n };\n CustomPropertiesCollection.createProperties = function (obj) {\n if (!obj || !obj.getType) return;\n CustomPropertiesCollection.createPropertiesCore(obj, obj.getType());\n };\n CustomPropertiesCollection.createPropertiesCore = function (obj, className) {\n var props = CustomPropertiesCollection.properties;\n if (props[className]) {\n CustomPropertiesCollection.createPropertiesInObj(obj, props[className]);\n }\n var parentClass = CustomPropertiesCollection.parentClasses[className];\n if (parentClass) {\n CustomPropertiesCollection.createPropertiesCore(obj, parentClass);\n }\n };\n CustomPropertiesCollection.createPropertiesInObj = function (obj, properties) {\n for (var i = 0; i < properties.length; i++) {\n CustomPropertiesCollection.createPropertyInObj(obj, properties[i]);\n }\n };\n CustomPropertiesCollection.createPropertyInObj = function (obj, prop) {\n if (CustomPropertiesCollection.checkIsPropertyExists(obj, prop.name)) return;\n if (!!prop.serializationProperty && CustomPropertiesCollection.checkIsPropertyExists(obj, prop.serializationProperty)) return;\n if (prop.isLocalizable && prop.serializationProperty && obj.createCustomLocalizableObj) {\n var locStr = obj.createCustomLocalizableObj(prop.name);\n locStr.defaultValue = prop.getDefaultValue(obj);\n var locDesc = {\n get: function () {\n return obj.getLocalizableString(prop.name);\n }\n };\n Object.defineProperty(obj, prop.serializationProperty, locDesc);\n var desc = {\n get: function () {\n return obj.getLocalizableStringText(prop.name);\n },\n set: function (v) {\n obj.setLocalizableStringText(prop.name, v);\n }\n };\n Object.defineProperty(obj, prop.name, desc);\n } else {\n var isArrayProp = prop.isArray || prop.type === \"multiplevalues\";\n if (typeof obj.createNewArray === \"function\") {\n if (Serializer.isDescendantOf(prop.className, \"itemvalue\")) {\n obj.createNewArray(prop.name, function (item) {\n item.locOwner = obj;\n item.ownerPropertyName = prop.name;\n });\n isArrayProp = true;\n } else {\n //It is a simple array property\n if (isArrayProp) {\n obj.createNewArray(prop.name);\n }\n }\n if (isArrayProp) {\n var defaultValue = prop.getDefaultValue(obj);\n if (Array.isArray(defaultValue)) {\n obj.setPropertyValue(prop.name, defaultValue);\n }\n }\n }\n if (!!obj.getPropertyValue && !!obj.setPropertyValue) {\n var desc = {\n get: function () {\n if (!!prop.onGetValue) {\n return prop.onGetValue(obj);\n }\n return obj.getPropertyValue(prop.name, undefined);\n },\n set: function (v) {\n if (!!prop.onSetValue) {\n prop.onSetValue(obj, v, null);\n } else {\n obj.setPropertyValue(prop.name, v);\n }\n }\n };\n Object.defineProperty(obj, prop.name, desc);\n }\n }\n if (prop.type === \"condition\" || prop.type === \"expression\") {\n if (!!prop.onExecuteExpression) {\n obj.addExpressionProperty(prop.name, prop.onExecuteExpression);\n }\n }\n };\n CustomPropertiesCollection.checkIsPropertyExists = function (obj, name) {\n return obj.hasOwnProperty(name) || obj[name];\n };\n CustomPropertiesCollection.properties = {};\n CustomPropertiesCollection.parentClasses = {};\n return CustomPropertiesCollection;\n }();\n var jsonobject_JsonMetadataClass = /** @class */function () {\n function JsonMetadataClass(name, properties, creator, parentName) {\n if (creator === void 0) {\n creator = null;\n }\n if (parentName === void 0) {\n parentName = null;\n }\n this.name = name;\n this.creator = creator;\n this.parentName = parentName;\n name = name.toLowerCase();\n this.isCustomValue = !creator && name !== \"survey\";\n if (this.parentName) {\n this.parentName = this.parentName.toLowerCase();\n CustomPropertiesCollection.addClass(name, this.parentName);\n if (!!creator) {\n this.makeParentRegularClass();\n }\n }\n this.properties = new Array();\n for (var i = 0; i < properties.length; i++) {\n this.createProperty(properties[i], this.isCustom);\n }\n }\n //Obsolete\n JsonMetadataClass.prototype.find = function (name) {\n for (var i = 0; i < this.properties.length; i++) {\n if (this.properties[i].name == name) return this.properties[i];\n }\n return null;\n };\n JsonMetadataClass.prototype.findProperty = function (name) {\n this.fillAllProperties();\n return this.hashProperties[name];\n };\n JsonMetadataClass.prototype.getAllProperties = function () {\n this.fillAllProperties();\n return this.allProperties;\n };\n JsonMetadataClass.prototype.getRequiredProperties = function () {\n if (!!this.requiredProperties) return this.requiredProperties;\n this.requiredProperties = [];\n var props = this.getAllProperties();\n for (var i = 0; i < props.length; i++) {\n if (props[i].isRequired) this.requiredProperties.push(props[i]);\n }\n return this.requiredProperties;\n };\n JsonMetadataClass.prototype.resetAllProperties = function () {\n this.allProperties = undefined;\n this.requiredProperties = undefined;\n this.hashProperties = undefined;\n var childClasses = Serializer.getChildrenClasses(this.name);\n for (var i = 0; i < childClasses.length; i++) {\n childClasses[i].resetAllProperties();\n }\n };\n Object.defineProperty(JsonMetadataClass.prototype, \"isCustom\", {\n get: function () {\n return this.isCustomValue;\n },\n enumerable: false,\n configurable: true\n });\n JsonMetadataClass.prototype.fillAllProperties = function () {\n var _this = this;\n if (!!this.allProperties) return;\n this.allProperties = [];\n this.hashProperties = {};\n var localProperties = {};\n this.properties.forEach(function (prop) {\n return localProperties[prop.name] = prop;\n });\n var parentClass = !!this.parentName ? Serializer.findClass(this.parentName) : null;\n if (!!parentClass) {\n var parentProperties = parentClass.getAllProperties();\n parentProperties.forEach(function (prop) {\n var overridedProp = localProperties[prop.name];\n if (!!overridedProp) {\n overridedProp.mergeWith(prop);\n _this.addPropCore(overridedProp);\n } else {\n _this.addPropCore(prop);\n }\n });\n }\n this.properties.forEach(function (prop) {\n if (!_this.hashProperties[prop.name]) {\n _this.addPropCore(prop);\n }\n });\n };\n JsonMetadataClass.prototype.addPropCore = function (prop) {\n this.allProperties.push(prop);\n this.hashProperties[prop.name] = prop;\n if (!!prop.alternativeName) {\n this.hashProperties[prop.alternativeName] = prop;\n }\n };\n JsonMetadataClass.prototype.isOverridedProp = function (propName) {\n return !!this.parentName && !!Serializer.findProperty(this.parentName, propName);\n };\n JsonMetadataClass.prototype.hasRegularChildClass = function () {\n if (!this.isCustom) return;\n this.isCustomValue = false;\n for (var i = 0; i < this.properties.length; i++) {\n this.properties[i].isCustom = false;\n }\n CustomPropertiesCollection.removeAllProperties(this.name);\n this.makeParentRegularClass();\n };\n JsonMetadataClass.prototype.makeParentRegularClass = function () {\n if (!this.parentName) return;\n var parent = Serializer.findClass(this.parentName);\n if (!!parent) {\n parent.hasRegularChildClass();\n }\n };\n JsonMetadataClass.prototype.createProperty = function (propInfo, isCustom) {\n if (isCustom === void 0) {\n isCustom = false;\n }\n var propertyName = typeof propInfo === \"string\" ? propInfo : propInfo.name;\n if (!propertyName) return;\n var propertyType = null;\n var typeIndex = propertyName.indexOf(JsonMetadataClass.typeSymbol);\n if (typeIndex > -1) {\n propertyType = propertyName.substring(typeIndex + 1);\n propertyName = propertyName.substring(0, typeIndex);\n }\n var isRequired = this.getIsPropertyNameRequired(propertyName) || !!propInfo.isRequired;\n propertyName = this.getPropertyName(propertyName);\n var prop = new jsonobject_JsonObjectProperty(this, propertyName, isRequired);\n if (propertyType) {\n prop.type = propertyType;\n }\n if (typeof propInfo === \"object\") {\n if (propInfo.type) {\n prop.type = propInfo.type;\n }\n if (propInfo.default !== undefined) {\n prop.defaultValue = propInfo.default;\n }\n if (propInfo.defaultFunc !== undefined) {\n prop.defaultValueFunc = propInfo.defaultFunc;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.isSerializable)) {\n prop.isSerializable = propInfo.isSerializable;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.isLightSerializable)) {\n prop.isLightSerializable = propInfo.isLightSerializable;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.maxLength)) {\n prop.maxLength = propInfo.maxLength;\n }\n if (propInfo.displayName !== undefined) {\n prop.displayName = propInfo.displayName;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.category)) {\n prop.category = propInfo.category;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.categoryIndex)) {\n prop.categoryIndex = propInfo.categoryIndex;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.nextToProperty)) {\n prop.nextToProperty = propInfo.nextToProperty;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.overridingProperty)) {\n prop.overridingProperty = propInfo.overridingProperty;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.visibleIndex)) {\n prop.visibleIndex = propInfo.visibleIndex;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.showMode)) {\n prop.showMode = propInfo.showMode;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.maxValue)) {\n prop.maxValue = propInfo.maxValue;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.minValue)) {\n prop.minValue = propInfo.minValue;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.dataList)) {\n prop.dataList = propInfo.dataList;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.isDynamicChoices)) {\n prop.isDynamicChoices = propInfo.isDynamicChoices;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.isBindable)) {\n prop.isBindable = propInfo.isBindable;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.isUnique)) {\n prop.isUnique = propInfo.isUnique;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.uniqueProperty)) {\n prop.uniquePropertyName = propInfo.uniqueProperty;\n }\n if (!helpers_Helpers.isValueEmpty(propInfo.isArray)) {\n prop.isArray = propInfo.isArray;\n }\n if (propInfo.visible === true || propInfo.visible === false) {\n prop.visible = propInfo.visible;\n }\n if (!!propInfo.visibleIf) {\n prop.visibleIf = propInfo.visibleIf;\n }\n if (!!propInfo.enableIf) {\n prop.enableIf = propInfo.enableIf;\n }\n if (!!propInfo.onExecuteExpression) {\n prop.onExecuteExpression = propInfo.onExecuteExpression;\n }\n if (!!propInfo.onPropertyEditorUpdate) {\n prop.onPropertyEditorUpdate = propInfo.onPropertyEditorUpdate;\n }\n if (propInfo.readOnly === true) {\n prop.readOnly = true;\n }\n if (propInfo.availableInMatrixColumn === true) {\n prop.availableInMatrixColumn = true;\n }\n if (propInfo.choices) {\n var choicesFunc = typeof propInfo.choices === \"function\" ? propInfo.choices : null;\n var choicesValue = typeof propInfo.choices !== \"function\" ? propInfo.choices : null;\n prop.setChoices(choicesValue, choicesFunc);\n }\n if (!!propInfo.baseValue) {\n prop.setBaseValue(propInfo.baseValue);\n }\n if (propInfo.onSerializeValue) {\n prop.onSerializeValue = propInfo.onSerializeValue;\n }\n if (propInfo.onGetValue) {\n prop.onGetValue = propInfo.onGetValue;\n }\n if (propInfo.onSetValue) {\n prop.onSetValue = propInfo.onSetValue;\n }\n if (propInfo.onSettingValue) {\n prop.onSettingValue = propInfo.onSettingValue;\n }\n if (propInfo.isLocalizable) {\n propInfo.serializationProperty = \"loc\" + prop.name;\n }\n if (propInfo.serializationProperty) {\n prop.serializationProperty = propInfo.serializationProperty;\n var s;\n if (prop.serializationProperty && prop.serializationProperty.indexOf(\"loc\") == 0) {\n prop.isLocalizable = true;\n }\n }\n if (propInfo.isLocalizable) {\n prop.isLocalizable = propInfo.isLocalizable;\n }\n if (propInfo.className) {\n prop.className = propInfo.className;\n }\n if (propInfo.baseClassName) {\n prop.baseClassName = propInfo.baseClassName;\n prop.isArray = true;\n }\n if (prop.isArray === true) {\n prop.isArray = true;\n }\n if (propInfo.classNamePart) {\n prop.classNamePart = propInfo.classNamePart;\n }\n if (propInfo.alternativeName) {\n prop.alternativeName = propInfo.alternativeName;\n }\n if (propInfo.oldName) {\n prop.oldName = propInfo.oldName;\n }\n if (propInfo.layout) {\n prop.layout = propInfo.layout;\n }\n if (propInfo.version) {\n prop.version = propInfo.version;\n }\n if (propInfo.dependsOn) {\n this.addDependsOnProperties(prop, propInfo.dependsOn);\n }\n }\n this.properties.push(prop);\n if (isCustom && !this.isOverridedProp(prop.name)) {\n prop.isCustom = true;\n CustomPropertiesCollection.addProperty(this.name, prop);\n }\n return prop;\n };\n JsonMetadataClass.prototype.addDependsOnProperties = function (prop, dependsOn) {\n var dArray = Array.isArray(dependsOn) ? dependsOn : [dependsOn];\n prop.dependsOn = dArray;\n for (var i = 0; i < dArray.length; i++) {\n this.addDependsOnProperty(prop, dArray[i]);\n }\n };\n JsonMetadataClass.prototype.addDependsOnProperty = function (prop, dependsOn) {\n var property = this.find(dependsOn);\n if (!property) {\n property = Serializer.findProperty(this.parentName, dependsOn);\n }\n if (!property) return;\n property.addDependedProperty(prop.name);\n };\n JsonMetadataClass.prototype.getIsPropertyNameRequired = function (propertyName) {\n return propertyName.length > 0 && propertyName[0] == JsonMetadataClass.requiredSymbol;\n };\n JsonMetadataClass.prototype.getPropertyName = function (propertyName) {\n if (!this.getIsPropertyNameRequired(propertyName)) return propertyName;\n propertyName = propertyName.slice(1);\n return propertyName;\n };\n JsonMetadataClass.requiredSymbol = \"!\";\n JsonMetadataClass.typeSymbol = \":\";\n return JsonMetadataClass;\n }();\n\n /**\n * The metadata object. It contains object properties' runtime information and allows you to modify it.\n */\n var JsonMetadata = /** @class */function () {\n function JsonMetadata() {\n this.classes = {};\n this.alternativeNames = {};\n this.childrenClasses = {};\n this.dynamicPropsCache = {};\n }\n JsonMetadata.prototype.getObjPropertyValue = function (obj, name) {\n if (this.isObjWrapper(obj) && this.isNeedUseObjWrapper(obj, name)) {\n var orignalObj = obj.getOriginalObj();\n var prop_1 = Serializer.findProperty(orignalObj.getType(), name);\n if (!!prop_1) return this.getObjPropertyValueCore(orignalObj, prop_1);\n }\n var prop = Serializer.findProperty(obj.getType(), name);\n if (!prop) return obj[name];\n return this.getObjPropertyValueCore(obj, prop);\n };\n JsonMetadata.prototype.setObjPropertyValue = function (obj, name, val) {\n if (obj[name] === val) return;\n if (!!obj[name] && !!obj[name].setJson) {\n obj[name].setJson(val, true);\n } else {\n if (Array.isArray(val)) {\n var newVal = [];\n for (var i = 0; i < val.length; i++) newVal.push(val[i]);\n val = newVal;\n }\n obj[name] = val;\n }\n };\n JsonMetadata.prototype.getObjPropertyValueCore = function (obj, prop) {\n if (!prop.isSerializable) return obj[prop.name];\n if (prop.isLocalizable) {\n if (prop.isArray) return obj[prop.name];\n if (!!prop.serializationProperty) return obj[prop.serializationProperty].text;\n }\n return obj.getPropertyValue(prop.name);\n };\n JsonMetadata.prototype.isObjWrapper = function (obj) {\n return !!obj.getOriginalObj && !!obj.getOriginalObj();\n };\n JsonMetadata.prototype.isNeedUseObjWrapper = function (obj, name) {\n if (!obj.getDynamicProperties) return true;\n var props = obj.getDynamicProperties();\n if (!Array.isArray(props)) return false;\n for (var i = 0; i < props.length; i++) {\n if (props[i].name === name) return true;\n }\n return false;\n };\n JsonMetadata.prototype.addClass = function (name, properties, creator, parentName) {\n if (creator === void 0) {\n creator = null;\n }\n if (parentName === void 0) {\n parentName = null;\n }\n name = name.toLowerCase();\n var metaDataClass = new jsonobject_JsonMetadataClass(name, properties, creator, parentName);\n this.classes[name] = metaDataClass;\n if (parentName) {\n parentName = parentName.toLowerCase();\n var children = this.childrenClasses[parentName];\n if (!children) {\n this.childrenClasses[parentName] = [];\n }\n this.childrenClasses[parentName].push(metaDataClass);\n }\n return metaDataClass;\n };\n JsonMetadata.prototype.removeClass = function (name) {\n var metaClass = this.findClass(name);\n if (!metaClass) return;\n delete this.classes[metaClass.name];\n if (!!metaClass.parentName) {\n var index = this.childrenClasses[metaClass.parentName].indexOf(metaClass);\n if (index > -1) {\n this.childrenClasses[metaClass.parentName].splice(index, 1);\n }\n }\n };\n JsonMetadata.prototype.overrideClassCreatore = function (name, creator) {\n this.overrideClassCreator(name, creator);\n };\n JsonMetadata.prototype.overrideClassCreator = function (name, creator) {\n name = name.toLowerCase();\n var metaDataClass = this.findClass(name);\n if (metaDataClass) {\n metaDataClass.creator = creator;\n }\n };\n JsonMetadata.prototype.getProperties = function (className) {\n var metaClass = this.findClass(className);\n if (!metaClass) return [];\n return metaClass.getAllProperties();\n };\n JsonMetadata.prototype.getPropertiesByObj = function (obj) {\n var type = !!obj && !!obj.getType ? obj.getType() : undefined;\n if (!type) return [];\n var props = this.getProperties(type);\n var dynamicProps = this.getDynamicPropertiesByObj(obj);\n for (var i = dynamicProps.length - 1; i >= 0; i--) {\n if (this.findProperty(type, dynamicProps[i].name)) {\n dynamicProps.splice(i, 1);\n }\n }\n if (dynamicProps.length === 0) return props;\n return [].concat(props).concat(dynamicProps);\n };\n JsonMetadata.prototype.addDynamicPropertiesIntoObj = function (dest, src, props) {\n var _this = this;\n props.forEach(function (prop) {\n _this.addDynamicPropertyIntoObj(dest, src, prop.name, false);\n if (prop.serializationProperty) {\n _this.addDynamicPropertyIntoObj(dest, src, prop.serializationProperty, true);\n }\n if (prop.alternativeName) {\n _this.addDynamicPropertyIntoObj(dest, src, prop.alternativeName, false);\n }\n });\n };\n JsonMetadata.prototype.addDynamicPropertyIntoObj = function (dest, src, propName, isReadOnly) {\n var desc = {\n configurable: true,\n get: function () {\n return src[propName];\n }\n };\n if (!isReadOnly) {\n desc[\"set\"] = function (v) {\n src[propName] = v;\n };\n }\n Object.defineProperty(dest, propName, desc);\n };\n JsonMetadata.prototype.getDynamicPropertiesByObj = function (obj, dynamicType) {\n if (dynamicType === void 0) {\n dynamicType = null;\n }\n if (!obj || !obj.getType) return [];\n if (!!obj.getDynamicProperties) return obj.getDynamicProperties();\n if (!obj.getDynamicType && !dynamicType) return [];\n var dType = !!dynamicType ? dynamicType : obj.getDynamicType();\n return this.getDynamicPropertiesByTypes(obj.getType(), dType);\n };\n JsonMetadata.prototype.getDynamicPropertiesByTypes = function (objType, dynamicType, invalidNames) {\n if (!dynamicType) return [];\n var cacheType = dynamicType + \"-\" + objType;\n if (this.dynamicPropsCache[cacheType]) return this.dynamicPropsCache[cacheType];\n var dynamicProps = this.getProperties(dynamicType);\n if (!dynamicProps || dynamicProps.length == 0) return [];\n var hash = {};\n var props = this.getProperties(objType);\n for (var i = 0; i < props.length; i++) {\n hash[props[i].name] = props[i];\n }\n var res = [];\n if (!invalidNames) invalidNames = [];\n for (var i_1 = 0; i_1 < dynamicProps.length; i_1++) {\n var dProp = dynamicProps[i_1];\n if (invalidNames.indexOf(dProp.name) < 0 && this.canAddDybamicProp(dProp, hash[dProp.name])) {\n res.push(dProp);\n }\n }\n this.dynamicPropsCache[cacheType] = res;\n return res;\n };\n JsonMetadata.prototype.canAddDybamicProp = function (dProp, orgProp) {\n if (!orgProp) return true;\n if (dProp === orgProp) return false;\n var classInfo = dProp.classInfo;\n while (classInfo && classInfo.parentName) {\n dProp = this.findProperty(classInfo.parentName, dProp.name);\n if (dProp && dProp === orgProp) return true;\n classInfo = !!dProp ? dProp.classInfo : undefined;\n }\n return false;\n };\n JsonMetadata.prototype.hasOriginalProperty = function (obj, propName) {\n return !!this.getOriginalProperty(obj, propName);\n };\n JsonMetadata.prototype.getOriginalProperty = function (obj, propName) {\n var res = this.findProperty(obj.getType(), propName);\n if (!!res) return res;\n if (this.isObjWrapper(obj)) return this.findProperty(obj.getOriginalObj().getType(), propName);\n return null;\n };\n JsonMetadata.prototype.getProperty = function (className, propertyName) {\n var prop = this.findProperty(className, propertyName);\n if (!prop) return prop;\n var classInfo = this.findClass(className);\n if (prop.classInfo === classInfo) return prop;\n var newProp = new jsonobject_JsonObjectProperty(classInfo, prop.name, prop.isRequired);\n newProp.mergeWith(prop);\n newProp.isArray = prop.isArray;\n classInfo.properties.push(newProp);\n classInfo.resetAllProperties();\n return newProp;\n };\n JsonMetadata.prototype.findProperty = function (className, propertyName) {\n var cl = this.findClass(className);\n return !!cl ? cl.findProperty(propertyName) : null;\n };\n JsonMetadata.prototype.findProperties = function (className, propertyNames) {\n var result = new Array();\n var cl = this.findClass(className);\n if (!cl) return result;\n for (var i = 0; i < propertyNames.length; i++) {\n var prop = cl.findProperty(propertyNames[i]);\n if (prop) {\n result.push(prop);\n }\n }\n return result;\n };\n JsonMetadata.prototype.getAllPropertiesByName = function (propertyName) {\n var res = new Array();\n var classes = this.getAllClasses();\n for (var i = 0; i < classes.length; i++) {\n var classInfo = this.findClass(classes[i]);\n for (var j = 0; j < classInfo.properties.length; j++) {\n if (classInfo.properties[j].name == propertyName) {\n res.push(classInfo.properties[j]);\n break;\n }\n }\n }\n return res;\n };\n JsonMetadata.prototype.getAllClasses = function () {\n var res = new Array();\n for (var name in this.classes) {\n res.push(name);\n }\n return res;\n };\n JsonMetadata.prototype.createClass = function (name, json) {\n if (json === void 0) {\n json = undefined;\n }\n name = name.toLowerCase();\n var metaDataClass = this.findClass(name);\n if (!metaDataClass) return null;\n if (metaDataClass.creator) return metaDataClass.creator(json);\n var parentName = metaDataClass.parentName;\n while (parentName) {\n metaDataClass = this.findClass(parentName);\n if (!metaDataClass) return null;\n parentName = metaDataClass.parentName;\n if (metaDataClass.creator) return this.createCustomType(name, metaDataClass.creator, json);\n }\n return null;\n };\n JsonMetadata.prototype.createCustomType = function (name, creator, json) {\n if (json === void 0) {\n json = undefined;\n }\n name = name.toLowerCase();\n var res = creator(json);\n var customTypeName = name;\n var customTemplateName = res.getTemplate ? res.getTemplate() : res.getType();\n res.getType = function () {\n return customTypeName;\n };\n res.getTemplate = function () {\n return customTemplateName;\n };\n CustomPropertiesCollection.createProperties(res);\n return res;\n };\n JsonMetadata.prototype.getChildrenClasses = function (name, canBeCreated) {\n if (canBeCreated === void 0) {\n canBeCreated = false;\n }\n name = name.toLowerCase();\n var result = [];\n this.fillChildrenClasses(name, canBeCreated, result);\n return result;\n };\n JsonMetadata.prototype.getRequiredProperties = function (name) {\n var metaClass = this.findClass(name);\n if (!metaClass) return [];\n var props = metaClass.getRequiredProperties();\n var res = [];\n for (var i = 0; i < props.length; i++) {\n res.push(props[i].name);\n }\n return res;\n };\n JsonMetadata.prototype.addProperties = function (className, propertiesInfos) {\n className = className.toLowerCase();\n var metaDataClass = this.findClass(className);\n for (var i = 0; i < propertiesInfos.length; i++) {\n this.addCustomPropertyCore(metaDataClass, propertiesInfos[i]);\n }\n };\n JsonMetadata.prototype.addProperty = function (className, propertyInfo) {\n return this.addCustomPropertyCore(this.findClass(className), propertyInfo);\n };\n JsonMetadata.prototype.addCustomPropertyCore = function (metaDataClass, propertyInfo) {\n if (!metaDataClass) return null;\n var property = metaDataClass.createProperty(propertyInfo, true);\n if (property) {\n this.clearDynamicPropsCache(metaDataClass);\n metaDataClass.resetAllProperties();\n }\n return property;\n };\n JsonMetadata.prototype.removeProperty = function (className, propertyName) {\n var metaDataClass = this.findClass(className);\n if (!metaDataClass) return false;\n var property = metaDataClass.find(propertyName);\n if (property) {\n this.clearDynamicPropsCache(metaDataClass);\n this.removePropertyFromClass(metaDataClass, property);\n metaDataClass.resetAllProperties();\n CustomPropertiesCollection.removeProperty(metaDataClass.name, propertyName);\n }\n };\n JsonMetadata.prototype.clearDynamicPropsCache = function (metaDataClass) {\n this.dynamicPropsCache = {};\n };\n JsonMetadata.prototype.removePropertyFromClass = function (metaDataClass, property) {\n var index = metaDataClass.properties.indexOf(property);\n if (index < 0) return;\n metaDataClass.properties.splice(index, 1);\n };\n JsonMetadata.prototype.fillChildrenClasses = function (name, canBeCreated, result) {\n var children = this.childrenClasses[name];\n if (!children) return;\n for (var i = 0; i < children.length; i++) {\n if (!canBeCreated || children[i].creator) {\n result.push(children[i]);\n }\n this.fillChildrenClasses(children[i].name, canBeCreated, result);\n }\n };\n JsonMetadata.prototype.findClass = function (name) {\n name = name.toLowerCase();\n var res = this.classes[name];\n if (!res) {\n var newName = this.alternativeNames[name];\n if (!!newName && newName != name) return this.findClass(newName);\n }\n return res;\n };\n JsonMetadata.prototype.isDescendantOf = function (className, ancestorClassName) {\n if (!className || !ancestorClassName) {\n return false;\n }\n className = className.toLowerCase();\n ancestorClassName = ancestorClassName.toLowerCase();\n var class_ = this.findClass(className);\n if (!class_) {\n return false;\n }\n var parentClass = class_;\n do {\n if (parentClass.name === ancestorClassName) {\n return true;\n }\n parentClass = this.classes[parentClass.parentName];\n } while (!!parentClass);\n return false;\n };\n JsonMetadata.prototype.addAlterNativeClassName = function (name, alternativeName) {\n this.alternativeNames[alternativeName.toLowerCase()] = name.toLowerCase();\n };\n JsonMetadata.prototype.generateSchema = function (className) {\n if (className === void 0) {\n className = undefined;\n }\n if (!className) className = \"survey\";\n var classInfo = this.findClass(className);\n if (!classInfo) return null;\n var res = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n title: \"SurveyJS Library json schema\",\n type: \"object\",\n properties: {},\n definitions: {\n locstring: this.generateLocStrClass()\n }\n };\n this.generateSchemaProperties(classInfo, res, res.definitions, true);\n return res;\n };\n JsonMetadata.prototype.generateLocStrClass = function () {\n var props = {};\n var locProp = Serializer.findProperty(\"survey\", \"locale\");\n if (!!locProp) {\n var choices = locProp.getChoices(null);\n if (Array.isArray(choices)) {\n if (choices.indexOf(\"en\") < 0) {\n choices.splice(0, 0, \"en\");\n }\n choices.splice(0, 0, \"default\");\n choices.forEach(function (l) {\n if (!!l) {\n props[l] = {\n type: \"string\"\n };\n }\n });\n }\n }\n return {\n $id: \"locstring\",\n type: \"object\",\n properties: props\n };\n };\n JsonMetadata.prototype.generateSchemaProperties = function (classInfo, classSchema, schemaDef, isRoot) {\n if (!classInfo) return;\n var schemaProperties = classSchema.properties;\n var requiredProps = [];\n if (classInfo.name === \"question\") {\n schemaProperties.type = {\n type: \"string\"\n };\n requiredProps.push(\"type\");\n }\n for (var i = 0; i < classInfo.properties.length; i++) {\n var prop = classInfo.properties[i];\n if (prop.isSerializable === false) continue;\n if (!!classInfo.parentName && !!Serializer.findProperty(classInfo.parentName, prop.name)) continue;\n schemaProperties[prop.name] = this.generateSchemaProperty(prop, schemaDef, isRoot);\n if (prop.isRequired) requiredProps.push(prop.name);\n }\n if (requiredProps.length > 0) {\n classSchema.required = requiredProps;\n }\n };\n JsonMetadata.prototype.generateSchemaProperty = function (prop, schemaDef, isRoot) {\n if (prop.isLocalizable) {\n return {\n oneOf: [{\n \"type\": \"string\"\n }, {\n \"$ref\": this.getChemeRefName(\"locstring\", isRoot)\n }]\n };\n }\n var propType = prop.schemaType();\n var refType = prop.schemaRef();\n var res = {};\n if (!!propType) {\n res.type = propType;\n }\n if (prop.hasChoices) {\n var enumRes = prop.getChoices(null);\n if (Array.isArray(enumRes) && enumRes.length > 0) {\n res.enum = this.getChoicesValues(enumRes);\n }\n }\n if (!!refType) {\n if (propType === \"array\") {\n if (prop.className === \"string\") {\n res.items = {\n type: prop.className\n };\n } else {\n res.items = {\n $ref: this.getChemeRefName(prop.className, isRoot)\n };\n }\n } else {\n res[\"$ref\"] = this.getChemeRefName(refType, isRoot);\n }\n this.generateChemaClass(prop.className, schemaDef, false);\n }\n if (!!prop.baseClassName) {\n var usedClasses = this.getChildrenClasses(prop.baseClassName, true);\n if (prop.baseClassName == \"question\") {\n usedClasses.push(this.findClass(\"panel\"));\n }\n res.items = {\n anyOf: []\n };\n for (var i = 0; i < usedClasses.length; i++) {\n var className = usedClasses[i].name;\n res.items.anyOf.push({\n $ref: this.getChemeRefName(className, isRoot)\n });\n this.generateChemaClass(className, schemaDef, false);\n }\n }\n return res;\n };\n JsonMetadata.prototype.getChemeRefName = function (className, isRoot) {\n //Fix for #6486, according to https://niem.github.io/json/reference/json-schema/references/#:~:text=In%20a%20JSON%20schema%2C%20a,%2C%20an%20in%2Dschema%20reference\n //Checked by https://www.jsonschemavalidator.net/\n return isRoot ? \"#/definitions/\" + className : className;\n };\n JsonMetadata.prototype.generateChemaClass = function (className, schemaDef, isRoot) {\n if (!!schemaDef[className]) return;\n var classInfo = this.findClass(className);\n if (!classInfo) return;\n var hasParent = !!classInfo.parentName && classInfo.parentName != \"base\";\n if (hasParent) {\n this.generateChemaClass(classInfo.parentName, schemaDef, isRoot);\n }\n var res = {\n type: \"object\",\n $id: className\n };\n schemaDef[className] = res;\n var chemaProps = {\n properties: {}\n };\n this.generateSchemaProperties(classInfo, chemaProps, schemaDef, isRoot);\n if (hasParent) {\n res.allOf = [{\n $ref: this.getChemeRefName(classInfo.parentName, isRoot)\n }, {\n properties: chemaProps.properties\n }];\n } else {\n res.properties = chemaProps.properties;\n }\n if (Array.isArray(chemaProps.required)) {\n res.required = chemaProps.required;\n }\n };\n JsonMetadata.prototype.getChoicesValues = function (enumRes) {\n var res = new Array();\n enumRes.forEach(function (item) {\n if (typeof item === \"object\" && item.value !== undefined) {\n res.push(item.value);\n } else {\n res.push(item);\n }\n });\n return res;\n };\n return JsonMetadata;\n }();\n var JsonError = /** @class */function () {\n function JsonError(type, message) {\n this.type = type;\n this.message = message;\n this.description = \"\";\n this.at = -1;\n this.end = -1;\n }\n JsonError.prototype.getFullDescription = function () {\n return this.message + (this.description ? \"\\n\" + this.description : \"\");\n };\n return JsonError;\n }();\n var JsonUnknownPropertyError = /** @class */function (_super) {\n __extends(JsonUnknownPropertyError, _super);\n function JsonUnknownPropertyError(propertyName, className) {\n var _this = _super.call(this, \"unknownproperty\", \"Unknown property in class '\" + className + \"': '\" + propertyName + \"'.\") || this;\n _this.propertyName = propertyName;\n _this.className = className;\n return _this;\n }\n return JsonUnknownPropertyError;\n }(JsonError);\n var JsonMissingTypeErrorBase = /** @class */function (_super) {\n __extends(JsonMissingTypeErrorBase, _super);\n function JsonMissingTypeErrorBase(baseClassName, type, message) {\n var _this = _super.call(this, type, message) || this;\n _this.baseClassName = baseClassName;\n _this.type = type;\n _this.message = message;\n return _this;\n }\n return JsonMissingTypeErrorBase;\n }(JsonError);\n var JsonMissingTypeError = /** @class */function (_super) {\n __extends(JsonMissingTypeError, _super);\n function JsonMissingTypeError(propertyName, baseClassName) {\n var _this = _super.call(this, baseClassName, \"missingtypeproperty\", \"The property type is missing in the object. Please take a look at property: '\" + propertyName + \"'.\") || this;\n _this.propertyName = propertyName;\n _this.baseClassName = baseClassName;\n return _this;\n }\n return JsonMissingTypeError;\n }(JsonMissingTypeErrorBase);\n var JsonIncorrectTypeError = /** @class */function (_super) {\n __extends(JsonIncorrectTypeError, _super);\n function JsonIncorrectTypeError(propertyName, baseClassName) {\n var _this = _super.call(this, baseClassName, \"incorrecttypeproperty\", \"The property type is incorrect in the object. Please take a look at property: '\" + propertyName + \"'.\") || this;\n _this.propertyName = propertyName;\n _this.baseClassName = baseClassName;\n return _this;\n }\n return JsonIncorrectTypeError;\n }(JsonMissingTypeErrorBase);\n var JsonRequiredPropertyError = /** @class */function (_super) {\n __extends(JsonRequiredPropertyError, _super);\n function JsonRequiredPropertyError(propertyName, className) {\n var _this = _super.call(this, \"requiredproperty\", \"The property '\" + propertyName + \"' is required in class '\" + className + \"'.\") || this;\n _this.propertyName = propertyName;\n _this.className = className;\n return _this;\n }\n return JsonRequiredPropertyError;\n }(JsonError);\n var JsonRequiredArrayPropertyError = /** @class */function (_super) {\n __extends(JsonRequiredArrayPropertyError, _super);\n function JsonRequiredArrayPropertyError(propertyName, className) {\n var _this = _super.call(this, \"arrayproperty\", \"The property '\" + propertyName + \"' should be an array in '\" + className + \"'.\") || this;\n _this.propertyName = propertyName;\n _this.className = className;\n return _this;\n }\n return JsonRequiredArrayPropertyError;\n }(JsonError);\n var JsonIncorrectPropertyValueError = /** @class */function (_super) {\n __extends(JsonIncorrectPropertyValueError, _super);\n function JsonIncorrectPropertyValueError(property, value) {\n var _this = _super.call(this, \"incorrectvalue\", \"The property value: '\" + value + \"' is incorrect for property '\" + property.name + \"'.\") || this;\n _this.property = property;\n _this.value = value;\n return _this;\n }\n return JsonIncorrectPropertyValueError;\n }(JsonError);\n var jsonobject_JsonObject = /** @class */function () {\n function JsonObject() {\n this.errors = new Array();\n this.lightSerializing = false;\n }\n Object.defineProperty(JsonObject, \"metaData\", {\n get: function () {\n return JsonObject.metaDataValue;\n },\n enumerable: false,\n configurable: true\n });\n JsonObject.prototype.toJsonObject = function (obj, options) {\n return this.toJsonObjectCore(obj, null, options);\n };\n JsonObject.prototype.toObject = function (jsonObj, obj, options) {\n this.toObjectCore(jsonObj, obj, options);\n var error = this.getRequiredError(obj, jsonObj);\n if (!!error) {\n this.addNewError(error, jsonObj, obj);\n }\n };\n JsonObject.prototype.toObjectCore = function (jsonObj, obj, options) {\n if (!jsonObj) return;\n var properties = null;\n var objType = undefined;\n var needAddErrors = true;\n if (obj.getType) {\n objType = obj.getType();\n properties = Serializer.getProperties(objType);\n needAddErrors = !!objType && !Serializer.isDescendantOf(objType, \"itemvalue\");\n }\n if (!properties) return;\n if (obj.startLoadingFromJson) {\n obj.startLoadingFromJson(jsonObj);\n }\n properties = this.addDynamicProperties(obj, jsonObj, properties);\n this.options = options;\n var processedProps = {};\n processedProps[JsonObject.typePropertyName] = true;\n var parentProps = {};\n for (var key in jsonObj) {\n this.setPropertyValueToObj(jsonObj, obj, key, properties, processedProps, parentProps, objType, needAddErrors, options);\n }\n this.options = undefined;\n if (obj.endLoadingFromJson) {\n obj.endLoadingFromJson();\n }\n };\n JsonObject.prototype.setPropertyValueToObj = function (jsonObj, obj, key, properties, processedProps, parentProps, objType, needAddErrors, options) {\n var _this = this;\n if (processedProps[key]) return;\n if (key === JsonObject.positionPropertyName) {\n obj[key] = jsonObj[key];\n return;\n }\n var property = this.findProperty(properties, key);\n if (!property && needAddErrors) {\n this.addNewError(new JsonUnknownPropertyError(key.toString(), objType), jsonObj, obj);\n }\n if (property) {\n var dProps = property.dependsOn;\n if (Array.isArray(dProps)) {\n parentProps[key] = true;\n dProps.forEach(function (propKey) {\n if (!parentProps[propKey]) {\n _this.setPropertyValueToObj(jsonObj, obj, propKey, properties, processedProps, parentProps, objType, false, options);\n }\n });\n }\n this.valueToObj(jsonObj[key], obj, property, jsonObj, options);\n processedProps[key] = true;\n }\n };\n JsonObject.prototype.toJsonObjectCore = function (obj, property, options) {\n if (!obj || !obj.getType) return obj;\n if (!obj.isSurvey && typeof obj.getData === \"function\") return obj.getData();\n var result = {};\n if (property != null && !property.className) {\n result[JsonObject.typePropertyName] = property.getObjType(obj.getType());\n }\n var storeDefaults = options === true;\n if (!options || options === true) {\n options = {};\n }\n if (storeDefaults) {\n options.storeDefaults = storeDefaults;\n }\n this.propertiesToJson(obj, Serializer.getProperties(obj.getType()), result, options);\n this.propertiesToJson(obj, this.getDynamicProperties(obj), result, options);\n return result;\n };\n JsonObject.prototype.getDynamicProperties = function (obj) {\n return Serializer.getDynamicPropertiesByObj(obj);\n };\n JsonObject.prototype.addDynamicProperties = function (obj, jsonObj, props) {\n if (!obj.getDynamicPropertyName && !obj.getDynamicProperties) return props;\n if (obj.getDynamicPropertyName) {\n var dynamicPropName = obj.getDynamicPropertyName();\n if (!dynamicPropName) return props;\n if (dynamicPropName && jsonObj[dynamicPropName]) {\n obj[dynamicPropName] = jsonObj[dynamicPropName];\n }\n }\n var dynamicProps = this.getDynamicProperties(obj);\n return dynamicProps.length === 0 ? props : [].concat(props).concat(dynamicProps);\n };\n JsonObject.prototype.propertiesToJson = function (obj, properties, json, options) {\n for (var i = 0; i < properties.length; i++) {\n this.valueToJson(obj, json, properties[i], options);\n }\n };\n JsonObject.prototype.valueToJson = function (obj, result, prop, options) {\n if (!options) options = {};\n if (prop.isSerializable === false || prop.isLightSerializable === false && this.lightSerializing) return;\n if (options.version && !prop.isAvailableInVersion(options.version)) return;\n this.valueToJsonCore(obj, result, prop, options);\n };\n JsonObject.prototype.valueToJsonCore = function (obj, result, prop, options) {\n var serProp = prop.getSerializedProperty(obj, options.version);\n if (serProp && serProp !== prop) {\n this.valueToJsonCore(obj, result, serProp, options);\n return;\n }\n var value = prop.getSerializableValue(obj, options.storeDefaults);\n if (value === undefined) return;\n if (this.isValueArray(value)) {\n var arrValue = [];\n for (var i = 0; i < value.length; i++) {\n arrValue.push(this.toJsonObjectCore(value[i], prop, options));\n }\n value = arrValue.length > 0 ? arrValue : null;\n } else {\n value = this.toJsonObjectCore(value, prop, options);\n }\n if (value === undefined || value === null) return;\n var name = prop.getSerializedName(options.version);\n var hasValue = typeof obj[\"getPropertyValue\"] === \"function\" && obj[\"getPropertyValue\"](name, null) !== null;\n if (options.storeDefaults && hasValue || !prop.isDefaultValueByObj(obj, value)) {\n if (!Serializer.onSerializingProperty || !Serializer.onSerializingProperty(obj, prop, value, result)) {\n result[name] = this.removePosOnValueToJson(prop, value);\n }\n }\n };\n JsonObject.prototype.valueToObj = function (value, obj, property, jsonObj, options) {\n if (value === null || value === undefined) return;\n this.removePos(property, value);\n if (property != null && property.hasToUseSetValue) {\n property.setValue(obj, value, this);\n return;\n }\n if (property.isArray && !Array.isArray(value) && !!value) {\n value = [value];\n var propName = !!jsonObj && property.alternativeName && !!jsonObj[property.alternativeName] ? property.alternativeName : property.name;\n this.addNewError(new JsonRequiredArrayPropertyError(propName, obj.getType()), !!jsonObj ? jsonObj : value, obj);\n }\n if (this.isValueArray(value)) {\n this.valueToArray(value, obj, property.name, property, options);\n return;\n }\n var newObj = this.createNewObj(value, property);\n if (newObj.newObj) {\n this.toObjectCore(value, newObj.newObj, options);\n value = newObj.newObj;\n }\n if (!newObj.error) {\n if (property != null) {\n property.setValue(obj, value, this);\n if (!!options && options.validatePropertyValues) {\n if (!property.validateValue(value)) {\n this.addNewError(new JsonIncorrectPropertyValueError(property, value), jsonObj, obj);\n }\n }\n } else {\n obj[property.name] = value;\n }\n }\n };\n JsonObject.prototype.removePosOnValueToJson = function (property, value) {\n if (!property.isCustom || !value) return value;\n this.removePosFromObj(value);\n return value;\n };\n JsonObject.prototype.removePos = function (property, value) {\n if (!property || !property.type || property.type.indexOf(\"value\") < 0) return;\n this.removePosFromObj(value);\n };\n JsonObject.prototype.removePosFromObj = function (obj) {\n if (!obj || typeof obj.getType === \"function\") return;\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n this.removePosFromObj(obj[i]);\n }\n }\n if (typeof obj !== \"object\") return;\n if (!!obj[JsonObject.positionPropertyName]) {\n delete obj[JsonObject.positionPropertyName];\n }\n for (var key in obj) {\n this.removePosFromObj(obj[key]);\n }\n };\n JsonObject.prototype.isValueArray = function (value) {\n return value && Array.isArray(value);\n };\n JsonObject.prototype.createNewObj = function (value, property) {\n var result = {\n newObj: null,\n error: null\n };\n var className = this.getClassNameForNewObj(value, property);\n result.newObj = className ? Serializer.createClass(className, value) : null;\n result.error = this.checkNewObjectOnErrors(result.newObj, value, property, className);\n return result;\n };\n JsonObject.prototype.getClassNameForNewObj = function (value, property) {\n var res = property != null && property.className ? property.className : undefined;\n if (!res) {\n res = value[JsonObject.typePropertyName];\n }\n if (!res) return res;\n res = res.toLowerCase();\n var classNamePart = property.classNamePart;\n if (classNamePart && res.indexOf(classNamePart) < 0) {\n res += classNamePart;\n }\n return res;\n };\n JsonObject.prototype.checkNewObjectOnErrors = function (newObj, value, property, className) {\n var error = null;\n if (newObj) {\n error = this.getRequiredError(newObj, value);\n } else {\n if (property.baseClassName) {\n if (!className) {\n error = new JsonMissingTypeError(property.name, property.baseClassName);\n } else {\n error = new JsonIncorrectTypeError(property.name, property.baseClassName);\n }\n }\n }\n if (error) {\n this.addNewError(error, value, newObj);\n }\n return error;\n };\n JsonObject.prototype.getRequiredError = function (obj, jsonValue) {\n if (!obj.getType || typeof obj.getData === \"function\") return null;\n var metaClass = Serializer.findClass(obj.getType());\n if (!metaClass) return null;\n var props = metaClass.getRequiredProperties();\n if (!Array.isArray(props)) return null;\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n if (!helpers_Helpers.isValueEmpty(prop.defaultValue)) continue;\n if (!jsonValue[prop.name]) {\n return new JsonRequiredPropertyError(prop.name, obj.getType());\n }\n }\n return null;\n };\n JsonObject.prototype.addNewError = function (error, jsonObj, element) {\n error.jsonObj = jsonObj;\n error.element = element;\n this.errors.push(error);\n if (!jsonObj) return;\n var posObj = jsonObj[JsonObject.positionPropertyName];\n if (!posObj) return;\n error.at = posObj.start;\n error.end = posObj.end;\n };\n JsonObject.prototype.valueToArray = function (value, obj, key, property, options) {\n if (obj[key] && !this.isValueArray(obj[key])) return;\n if (obj[key] && value.length > 0) obj[key].splice(0, obj[key].length);\n var valueRes = obj[key] ? obj[key] : [];\n this.addValuesIntoArray(value, valueRes, property, options);\n if (!obj[key]) obj[key] = valueRes;\n };\n JsonObject.prototype.addValuesIntoArray = function (value, result, property, options) {\n for (var i = 0; i < value.length; i++) {\n var newValue = this.createNewObj(value[i], property);\n if (newValue.newObj) {\n if (!!value[i].name) {\n newValue.newObj.name = value[i].name;\n }\n if (!!value[i].valueName) {\n newValue.newObj.valueName = value[i].valueName.toString();\n }\n result.push(newValue.newObj);\n this.toObjectCore(value[i], newValue.newObj, options);\n } else {\n if (!newValue.error) {\n result.push(value[i]);\n }\n }\n }\n };\n JsonObject.prototype.findProperty = function (properties, key) {\n if (!properties) return null;\n for (var i = 0; i < properties.length; i++) {\n var prop = properties[i];\n if (prop.name == key || prop.alternativeName == key) return prop;\n }\n return null;\n };\n JsonObject.typePropertyName = \"type\";\n JsonObject.positionPropertyName = \"pos\";\n JsonObject.metaDataValue = new JsonMetadata();\n return JsonObject;\n }();\n\n /**\n * An alias for the metadata object. It contains object properties' runtime information and allows you to modify it.\n * @see JsonMetadata\n */\n var Serializer = jsonobject_JsonObject.metaData;\n\n // CONCATENATED MODULE: ./packages/survey-core/src/conditionProcessValue.ts\n\n var surveyBuiltInVarible = \"@survey\";\n var conditionProcessValue_ProcessValue = /** @class */function () {\n function ProcessValue() {\n this.values = null;\n this.properties = null;\n this.asyncValues = {};\n }\n ProcessValue.prototype.getFirstName = function (text, obj) {\n if (obj === void 0) {\n obj = null;\n }\n if (!text) return text;\n var res = \"\";\n if (!!obj) {\n res = this.getFirstPropertyName(text, obj);\n if (!!res) return res;\n }\n for (var i = 0; i < text.length; i++) {\n var ch = text[i];\n if (ch == \".\" || ch == \"[\") break;\n res += ch;\n }\n return res;\n };\n ProcessValue.prototype.hasValue = function (text, values) {\n if (values === void 0) {\n values = null;\n }\n if (!values) values = this.values;\n var res = this.getValueCore(text, values);\n return res.hasValue;\n };\n ProcessValue.prototype.getValue = function (text, values) {\n if (values === void 0) {\n values = null;\n }\n if (!values) values = this.values;\n var res = this.getValueCore(text, values);\n return res.value;\n };\n ProcessValue.prototype.setValue = function (obj, text, value) {\n if (!text) return;\n var nonNestedObj = this.getNonNestedObject(obj, text, true);\n if (!nonNestedObj) return;\n obj = nonNestedObj.value;\n text = nonNestedObj.text;\n if (!!obj && !!text) {\n obj[text] = value;\n }\n };\n ProcessValue.prototype.getValueInfo = function (valueInfo) {\n if (!!valueInfo.path) {\n valueInfo.value = this.getValueFromPath(valueInfo.path, this.values);\n valueInfo.hasValue = valueInfo.value !== null && !helpers_Helpers.isValueEmpty(valueInfo.value);\n if (!valueInfo.hasValue && valueInfo.path.length > 1 && valueInfo.path[valueInfo.path.length - 1] == \"length\") {\n valueInfo.hasValue = true;\n valueInfo.value = 0;\n }\n return;\n }\n var res = this.getValueCore(valueInfo.name, this.values);\n valueInfo.value = res.value;\n valueInfo.hasValue = res.hasValue;\n valueInfo.path = res.hasValue ? res.path : null;\n valueInfo.sctrictCompare = res.sctrictCompare;\n };\n ProcessValue.prototype.isAnyKeyChanged = function (keys, usedNames) {\n for (var i = 0; i < usedNames.length; i++) {\n var name_1 = usedNames[i];\n if (!name_1) continue;\n var lowerName = name_1.toLowerCase();\n if (keys.hasOwnProperty(name_1)) return true;\n if (name_1 !== lowerName && keys.hasOwnProperty(lowerName)) return true;\n var firstName = this.getFirstName(name_1);\n if (!keys.hasOwnProperty(firstName)) continue;\n if (name_1 === firstName) return true;\n var keyValue = keys[firstName];\n if (keyValue == undefined) continue;\n if (!keyValue.hasOwnProperty(\"oldValue\") || !keyValue.hasOwnProperty(\"newValue\")) return true;\n var v = {};\n v[firstName] = keyValue[\"oldValue\"];\n var oldValue = this.getValue(name_1, v);\n v[firstName] = keyValue[\"newValue\"];\n var newValue = this.getValue(name_1, v);\n if (!helpers_Helpers.isTwoValueEquals(oldValue, newValue, false, false, false)) return true;\n }\n return false;\n };\n ProcessValue.prototype.getValueFromPath = function (path, values) {\n if (path.length === 2 && path[0] === surveyBuiltInVarible) {\n return this.getValueFromSurvey(path[1]);\n }\n var index = 0;\n while (!!values && index < path.length) {\n var ind_name = path[index];\n if (helpers_Helpers.isNumber(ind_name) && Array.isArray(values) && ind_name >= values.length) return null;\n values = values[ind_name];\n index++;\n }\n return values;\n };\n ProcessValue.prototype.getValueCore = function (text, values) {\n var question = this.getQuestionDirectly(text);\n if (question) {\n return {\n hasValue: true,\n value: question.value,\n path: [text],\n sctrictCompare: question.requireStrictCompare\n };\n }\n var res = this.getValueFromValues(text, values);\n if (!!text && !res.hasValue) {\n var val = this.getValueFromSurvey(text);\n if (val !== undefined) {\n res.hasValue = true;\n res.value = val;\n res.path = [surveyBuiltInVarible, text];\n }\n }\n return res;\n };\n ProcessValue.prototype.getQuestionDirectly = function (name) {\n if (!!this.properties && !!this.properties.survey) return this.properties.survey.getQuestionByValueName(name);\n return undefined;\n };\n ProcessValue.prototype.getValueFromSurvey = function (name) {\n if (!!this.properties && !!this.properties.survey) return this.properties.survey.getBuiltInVariableValue(name.toLocaleLowerCase());\n return undefined;\n };\n ProcessValue.prototype.getValueFromValues = function (text, values) {\n var res = {\n hasValue: false,\n value: null,\n path: null\n };\n var curValue = values;\n if (!curValue && curValue !== 0 && curValue !== false) return res;\n if (text && text.lastIndexOf(\".length\") > -1 && text.lastIndexOf(\".length\") === text.length - \".length\".length) {\n res.value = 0;\n res.hasValue = true;\n }\n var nonNestedObj = this.getNonNestedObject(curValue, text, false);\n if (!nonNestedObj) return res;\n res.path = nonNestedObj.path;\n res.value = !!nonNestedObj.text ? this.getObjectValue(nonNestedObj.value, nonNestedObj.text) : nonNestedObj.value;\n res.hasValue = !helpers_Helpers.isValueEmpty(res.value);\n return res;\n };\n ProcessValue.prototype.getNonNestedObject = function (obj, text, createPath) {\n var checkedKeys = new Array();\n var len = 0;\n var res = this.getNonNestedObjectCore(obj, text, createPath, checkedKeys);\n while (!res && len < checkedKeys.length) {\n len = checkedKeys.length;\n res = this.getNonNestedObjectCore(obj, text, createPath, checkedKeys);\n }\n return res;\n };\n ProcessValue.prototype.getNonNestedObjectCore = function (obj, text, createPath, checkedKeys) {\n var curName = this.getFirstPropertyName(text, obj, createPath, checkedKeys);\n if (!!curName) {\n checkedKeys.push(curName);\n }\n var path = !!curName ? [curName] : null;\n while (text != curName && !!obj) {\n var isArray = text[0] == \"[\";\n if (!isArray) {\n if (!curName && text == this.getFirstName(text)) return {\n value: obj,\n text: text,\n path: path\n };\n obj = this.getObjectValue(obj, curName);\n if (helpers_Helpers.isValueEmpty(obj) && !createPath) return null;\n text = text.substring(curName.length);\n } else {\n var objInArray = this.getObjInArray(obj, text);\n if (!objInArray) return null;\n obj = objInArray.value;\n text = objInArray.text;\n path.push(objInArray.index);\n }\n if (!!text && text[0] == \".\") {\n text = text.substring(1);\n }\n curName = this.getFirstPropertyName(text, obj, createPath, checkedKeys);\n if (!!curName) {\n path.push(curName);\n }\n }\n return {\n value: obj,\n text: text,\n path: path\n };\n };\n ProcessValue.prototype.getObjInArray = function (curValue, text) {\n if (!Array.isArray(curValue)) return null;\n var index = 1;\n var str = \"\";\n while (index < text.length && text[index] != \"]\") {\n str += text[index];\n index++;\n }\n text = index < text.length ? text.substring(index + 1) : \"\";\n index = this.getIntValue(str);\n if (index < 0 || index >= curValue.length) return null;\n return {\n value: curValue[index],\n text: text,\n index: index\n };\n };\n ProcessValue.prototype.getFirstPropertyName = function (name, obj, createProp, checkedKeys) {\n if (createProp === void 0) {\n createProp = false;\n }\n if (checkedKeys === void 0) {\n checkedKeys = undefined;\n }\n if (!name) return name;\n if (!obj) obj = {};\n if (obj.hasOwnProperty(name)) return name;\n var nameInLow = name.toLowerCase();\n var A = nameInLow[0];\n var a = A.toUpperCase();\n for (var key in obj) {\n if (Array.isArray(checkedKeys) && checkedKeys.indexOf(key) > -1) continue;\n var first = key[0];\n if (first === a || first === A) {\n var keyName = key.toLowerCase();\n if (keyName == nameInLow) return key;\n if (nameInLow.length <= keyName.length) continue;\n var ch = nameInLow[keyName.length];\n if (ch != \".\" && ch != \"[\") continue;\n if (keyName == nameInLow.substring(0, keyName.length)) return key;\n }\n }\n if (createProp && name[0] !== \"[\") {\n var ind = name.indexOf(\".\");\n if (ind > -1) {\n name = name.substring(0, ind);\n obj[name] = {};\n }\n return name;\n }\n return \"\";\n };\n ProcessValue.prototype.getObjectValue = function (obj, name) {\n if (!name) return null;\n return obj[name];\n };\n ProcessValue.prototype.getIntValue = function (str) {\n if (str == \"0\" || (str | 0) > 0 && str % 1 == 0) return Number(str);\n return -1;\n };\n return ProcessValue;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/console-warnings.ts\n var ConsoleWarnings = /** @class */function () {\n function ConsoleWarnings() {}\n ConsoleWarnings.disposedObjectChangedProperty = function (propName, objType) {\n ConsoleWarnings.warn(\"An attempt to set a property \\\"\" + propName + \"\\\" of a disposed object \\\"\" + objType + \"\\\"\");\n };\n ConsoleWarnings.inCorrectQuestionValue = function (questionName, val) {\n var valStr = JSON.stringify(val, null, 3);\n ConsoleWarnings.warn(\"An attempt to assign an incorrect value\" + valStr + \" to the following question: \\\"\" + questionName + \"\\\"\");\n };\n ConsoleWarnings.warn = function (text) {\n // eslint-disable-next-line no-console\n console.warn(text);\n };\n ConsoleWarnings.error = function (text) {\n // eslint-disable-next-line no-console\n console.error(text);\n };\n return ConsoleWarnings;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/functionsfactory.ts\n\n var functionsfactory_FunctionFactory = /** @class */function () {\n function FunctionFactory() {\n this.functionHash = {};\n this.isAsyncHash = {};\n }\n FunctionFactory.prototype.register = function (name, func, isAsync) {\n if (isAsync === void 0) {\n isAsync = false;\n }\n this.functionHash[name] = func;\n if (isAsync) this.isAsyncHash[name] = true;\n };\n FunctionFactory.prototype.unregister = function (name) {\n delete this.functionHash[name];\n delete this.isAsyncHash[name];\n };\n FunctionFactory.prototype.hasFunction = function (name) {\n return !!this.functionHash[name];\n };\n FunctionFactory.prototype.isAsyncFunction = function (name) {\n return !!this.isAsyncHash[name];\n };\n FunctionFactory.prototype.clear = function () {\n this.functionHash = {};\n };\n FunctionFactory.prototype.getAll = function () {\n var result = [];\n for (var key in this.functionHash) {\n result.push(key);\n }\n return result.sort();\n };\n FunctionFactory.prototype.run = function (name, params, properties, originalParams) {\n if (properties === void 0) {\n properties = null;\n }\n var func = this.functionHash[name];\n if (!func) {\n ConsoleWarnings.warn(\"Unknown function name: \" + name);\n return null;\n }\n var classRunner = {\n func: func\n };\n if (properties) {\n for (var key in properties) {\n classRunner[key] = properties[key];\n }\n }\n return classRunner.func(params, originalParams);\n };\n FunctionFactory.Instance = new FunctionFactory();\n return FunctionFactory;\n }();\n var registerFunction = functionsfactory_FunctionFactory.Instance.register;\n function getParamsAsArray(value, arr) {\n if (value === undefined || value === null) return;\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n getParamsAsArray(value[i], arr);\n }\n } else {\n if (helpers_Helpers.isNumber(value)) {\n value = helpers_Helpers.getNumber(value);\n }\n arr.push(value);\n }\n }\n function sum(params) {\n var arr = [];\n getParamsAsArray(params, arr);\n var res = 0;\n for (var i = 0; i < arr.length; i++) {\n res = helpers_Helpers.correctAfterPlusMinis(res, arr[i], res + arr[i]);\n }\n return res;\n }\n functionsfactory_FunctionFactory.Instance.register(\"sum\", sum);\n function min_max(params, isMin) {\n var arr = [];\n getParamsAsArray(params, arr);\n var res = undefined;\n for (var i = 0; i < arr.length; i++) {\n if (res === undefined) {\n res = arr[i];\n }\n if (isMin) {\n if (res > arr[i]) res = arr[i];\n } else {\n if (res < arr[i]) res = arr[i];\n }\n }\n return res;\n }\n function functionsfactory_min(params) {\n return min_max(params, true);\n }\n functionsfactory_FunctionFactory.Instance.register(\"min\", functionsfactory_min);\n function functionsfactory_max(params) {\n return min_max(params, false);\n }\n functionsfactory_FunctionFactory.Instance.register(\"max\", functionsfactory_max);\n function count(params) {\n var arr = [];\n getParamsAsArray(params, arr);\n return arr.length;\n }\n functionsfactory_FunctionFactory.Instance.register(\"count\", count);\n function avg(params) {\n var arr = [];\n getParamsAsArray(params, arr);\n var res = sum(params);\n return arr.length > 0 ? res / arr.length : 0;\n }\n functionsfactory_FunctionFactory.Instance.register(\"avg\", avg);\n function getInArrayParams(params, originalParams) {\n if (params.length < 2 || params.length > 3) return null;\n var arr = params[0];\n if (!arr) return null;\n if (!Array.isArray(arr) && !Array.isArray(Object.keys(arr))) return null;\n var name = params[1];\n if (typeof name !== \"string\" && !(name instanceof String)) return null;\n var expression = params.length > 2 ? params[2] : undefined;\n if (typeof expression !== \"string\" && !(expression instanceof String)) {\n expression = undefined;\n }\n if (!expression) {\n var operand = Array.isArray(originalParams) && originalParams.length > 2 ? originalParams[2] : undefined;\n if (operand && !!operand.toString()) {\n expression = operand.toString();\n }\n }\n return {\n data: arr,\n name: name,\n expression: expression\n };\n }\n function convertToNumber(val) {\n if (typeof val === \"string\") return helpers_Helpers.isNumber(val) ? helpers_Helpers.getNumber(val) : undefined;\n return val;\n }\n function processItemInArray(item, name, res, func, needToConvert, condition) {\n if (!item || helpers_Helpers.isValueEmpty(item[name])) return res;\n if (condition && !condition.run(item)) return res;\n var val = needToConvert ? convertToNumber(item[name]) : 1;\n return func(res, val);\n }\n function calcInArray(params, originalParams, func, needToConvert) {\n if (needToConvert === void 0) {\n needToConvert = true;\n }\n var v = getInArrayParams(params, originalParams);\n if (!v) return undefined;\n var condition = !!v.expression ? new ConditionRunner(v.expression) : undefined;\n if (condition && condition.isAsync) {\n condition = undefined;\n }\n var res = undefined;\n if (Array.isArray(v.data)) {\n for (var i = 0; i < v.data.length; i++) {\n res = processItemInArray(v.data[i], v.name, res, func, needToConvert, condition);\n }\n } else {\n for (var key in v.data) {\n res = processItemInArray(v.data[key], v.name, res, func, needToConvert, condition);\n }\n }\n return res;\n }\n function sumInArray(params, originalParams) {\n var res = calcInArray(params, originalParams, function (res, val) {\n if (res == undefined) res = 0;\n if (val == undefined || val == null) return res;\n return helpers_Helpers.correctAfterPlusMinis(res, val, res + val);\n });\n return res !== undefined ? res : 0;\n }\n functionsfactory_FunctionFactory.Instance.register(\"sumInArray\", sumInArray);\n function minInArray(params, originalParams) {\n return calcInArray(params, originalParams, function (res, val) {\n if (res == undefined) return val;\n if (val == undefined || val == null) return res;\n return res < val ? res : val;\n });\n }\n functionsfactory_FunctionFactory.Instance.register(\"minInArray\", minInArray);\n function maxInArray(params, originalParams) {\n return calcInArray(params, originalParams, function (res, val) {\n if (res == undefined) return val;\n if (val == undefined || val == null) return res;\n return res > val ? res : val;\n });\n }\n functionsfactory_FunctionFactory.Instance.register(\"maxInArray\", maxInArray);\n function countInArray(params, originalParams) {\n var res = calcInArray(params, originalParams, function (res, val) {\n if (res == undefined) res = 0;\n if (val == undefined || val == null) return res;\n return res + 1;\n }, false);\n return res !== undefined ? res : 0;\n }\n functionsfactory_FunctionFactory.Instance.register(\"countInArray\", countInArray);\n function avgInArray(params, originalParams) {\n var count = countInArray(params, originalParams);\n if (count == 0) return 0;\n return sumInArray(params, originalParams) / count;\n }\n functionsfactory_FunctionFactory.Instance.register(\"avgInArray\", avgInArray);\n function iif(params) {\n if (!params && params.length !== 3) return \"\";\n return params[0] ? params[1] : params[2];\n }\n functionsfactory_FunctionFactory.Instance.register(\"iif\", iif);\n function getDate(params) {\n if (!params && params.length < 1) return null;\n if (!params[0]) return null;\n return createDate(\"function-getDate\", params[0]);\n }\n functionsfactory_FunctionFactory.Instance.register(\"getDate\", getDate);\n function dateDiffMonths(date1Param, date2Param, type) {\n if (type === \"days\") return diffDays([date1Param, date2Param]);\n var date1 = createDate(\"function-dateDiffMonths\", date1Param);\n var date2 = createDate(\"function-dateDiffMonths\", date2Param);\n var age = date2.getFullYear() - date1.getFullYear();\n type = type || \"years\";\n var ageInMonths = age * 12 + date2.getMonth() - date1.getMonth();\n if (date2.getDate() < date1.getDate()) {\n ageInMonths -= 1;\n }\n return type === \"months\" ? ageInMonths : ~~(ageInMonths / 12);\n }\n function functionsfactory_age(params) {\n if (!Array.isArray(params) || params.length < 1 || !params[0]) return null;\n return dateDiffMonths(params[0], undefined, (params.length > 1 ? params[1] : \"\") || \"years\");\n }\n functionsfactory_FunctionFactory.Instance.register(\"age\", functionsfactory_age);\n function dateDiff(params) {\n if (!Array.isArray(params) || params.length < 2 || !params[0] || !params[1]) return null;\n return dateDiffMonths(params[0], params[1], (params.length > 2 ? params[2] : \"\") || \"days\");\n }\n functionsfactory_FunctionFactory.Instance.register(\"dateDiff\", dateDiff);\n function dateAdd(params) {\n if (!Array.isArray(params) || params.length < 2 || !params[0] || !params[1]) return null;\n var date = createDate(\"function-dateAdd\", params[0]);\n var valToAdd = params[1];\n var interval = params[2] || \"days\";\n if (interval === \"days\") {\n date.setDate(date.getDate() + valToAdd);\n }\n if (interval === \"months\") {\n date.setMonth(date.getMonth() + valToAdd);\n }\n if (interval === \"years\") {\n date.setFullYear(date.getFullYear() + valToAdd);\n }\n return date;\n }\n functionsfactory_FunctionFactory.Instance.register(\"dateAdd\", dateAdd);\n function isContainerReadyCore(container) {\n if (!container) return false;\n var questions = container.questions;\n for (var i = 0; i < questions.length; i++) {\n if (!questions[i].validate(false)) return false;\n }\n return true;\n }\n function isContainerReady(params) {\n if (!params && params.length < 1) return false;\n if (!params[0] || !this.survey) return false;\n var name = params[0];\n var container = this.survey.getPageByName(name);\n if (!container) container = this.survey.getPanelByName(name);\n if (!container) {\n var question = this.survey.getQuestionByName(name);\n if (!question || !Array.isArray(question.panels)) return false;\n if (params.length > 1) {\n if (params[1] < question.panels.length) {\n container = question.panels[params[1]];\n }\n } else {\n for (var i = 0; i < question.panels.length; i++) {\n if (!isContainerReadyCore(question.panels[i])) return false;\n }\n return true;\n }\n }\n return isContainerReadyCore(container);\n }\n functionsfactory_FunctionFactory.Instance.register(\"isContainerReady\", isContainerReady);\n function isDisplayMode() {\n return this.survey && this.survey.isDisplayMode;\n }\n functionsfactory_FunctionFactory.Instance.register(\"isDisplayMode\", isDisplayMode);\n function currentDate() {\n return createDate(\"function-currentDate\");\n }\n functionsfactory_FunctionFactory.Instance.register(\"currentDate\", currentDate);\n function today(params) {\n var res = createDate(\"function-today\");\n if (settings.localization.useLocalTimeZone) {\n res.setHours(0, 0, 0, 0);\n } else {\n res.setUTCHours(0, 0, 0, 0);\n }\n if (Array.isArray(params) && params.length == 1) {\n res.setDate(res.getDate() + params[0]);\n }\n return res;\n }\n functionsfactory_FunctionFactory.Instance.register(\"today\", today);\n function getYear(params) {\n if (params.length !== 1 || !params[0]) return undefined;\n return createDate(\"function-getYear\", params[0]).getFullYear();\n }\n functionsfactory_FunctionFactory.Instance.register(\"getYear\", getYear);\n function currentYear() {\n return createDate(\"function-currentYear\").getFullYear();\n }\n functionsfactory_FunctionFactory.Instance.register(\"currentYear\", currentYear);\n function diffDays(params) {\n if (!Array.isArray(params) || params.length !== 2) return 0;\n if (!params[0] || !params[1]) return 0;\n var date1 = createDate(\"function-diffDays\", params[0]);\n var date2 = createDate(\"function-diffDays\", params[1]);\n var diffTime = Math.abs(date2 - date1);\n return Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n }\n functionsfactory_FunctionFactory.Instance.register(\"diffDays\", diffDays);\n function dateFromFirstParameterOrToday(name, params) {\n var date = today(undefined);\n if (params && params[0]) {\n date = createDate(\"function-\" + name, params[0]);\n }\n return date;\n }\n function functionsfactory_year(params) {\n var date = dateFromFirstParameterOrToday(\"year\", params);\n return date.getFullYear();\n }\n functionsfactory_FunctionFactory.Instance.register(\"year\", functionsfactory_year);\n function functionsfactory_month(params) {\n var date = dateFromFirstParameterOrToday(\"month\", params);\n return date.getMonth() + 1;\n }\n functionsfactory_FunctionFactory.Instance.register(\"month\", functionsfactory_month);\n function day(params) {\n var date = dateFromFirstParameterOrToday(\"day\", params);\n return date.getDate();\n }\n functionsfactory_FunctionFactory.Instance.register(\"day\", day);\n function weekday(params) {\n var date = dateFromFirstParameterOrToday(\"weekday\", params);\n return date.getDay();\n }\n functionsfactory_FunctionFactory.Instance.register(\"weekday\", weekday);\n function getQuestionValueByContext(context, name) {\n if (!context || !name) return undefined;\n var q = context.question;\n while (q && q.parent) {\n var res = q.parent.getQuestionByName(name);\n if (!!res) return res;\n q = q.parentQuestion;\n }\n var keys = [\"row\", \"panel\", \"survey\"];\n for (var i = 0; i < keys.length; i++) {\n var ctx = context[keys[i]];\n if (ctx && ctx.getQuestionByName) {\n var res = ctx.getQuestionByName(name);\n if (res) return res;\n }\n }\n return null;\n }\n function getDisplayValueReturnResult(q, params) {\n if (params.length > 1 && !helpers_Helpers.isValueEmpty(params[1])) return q.getDisplayValue(true, params[1]);\n return q.displayValue;\n }\n function displayValue(params) {\n var _this = this;\n var q = getQuestionValueByContext(this, params[0]);\n if (!q) return \"\";\n if (q.isReady) {\n this.returnResult(getDisplayValueReturnResult(q, params));\n } else {\n var displayValueOnReadyChanged_1 = function (sender, options) {\n if (sender.isReady) {\n sender.onReadyChanged.remove(displayValueOnReadyChanged_1);\n _this.returnResult(getDisplayValueReturnResult(sender, params));\n }\n };\n q.onReadyChanged.add(displayValueOnReadyChanged_1);\n }\n return undefined;\n }\n functionsfactory_FunctionFactory.Instance.register(\"displayValue\", displayValue, true);\n function propertyValue(params) {\n if (params.length !== 2 || !params[0] || !params[1]) return undefined;\n var q = getQuestionValueByContext(this, params[0]);\n return q ? q[params[1]] : undefined;\n }\n functionsfactory_FunctionFactory.Instance.register(\"propertyValue\", propertyValue);\n function substring_(params) {\n if (params.length < 2) return \"\";\n var s = params[0];\n if (!s || typeof s !== \"string\") return \"\";\n var start = params[1];\n if (!helpers_Helpers.isNumber(start)) return \"\";\n var end = params.length > 2 ? params[2] : undefined;\n if (!helpers_Helpers.isNumber(end)) return s.substring(start);\n return s.substring(start, end);\n }\n functionsfactory_FunctionFactory.Instance.register(\"substring\", substring_);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/expressions/expressions.ts\n var expressions_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var Operand = /** @class */function () {\n function Operand() {\n this._id = Operand.counter++;\n }\n Object.defineProperty(Operand.prototype, \"id\", {\n get: function () {\n return this._id;\n },\n enumerable: false,\n configurable: true\n });\n Operand.prototype.toString = function (func) {\n if (func === void 0) {\n func = undefined;\n }\n return \"\";\n };\n Operand.prototype.hasFunction = function () {\n return false;\n };\n Operand.prototype.hasAsyncFunction = function () {\n return false;\n };\n Operand.prototype.addToAsyncList = function (list) {};\n Operand.prototype.isEqual = function (op) {\n return !!op && op.getType() === this.getType() && this.isContentEqual(op);\n };\n Operand.prototype.areOperatorsEquals = function (op1, op2) {\n return !op1 && !op2 || !!op1 && op1.isEqual(op2);\n };\n Operand.counter = 1;\n return Operand;\n }();\n var BinaryOperand = /** @class */function (_super) {\n expressions_extends(BinaryOperand, _super);\n function BinaryOperand(operatorName, left, right, isArithmeticOp) {\n if (left === void 0) {\n left = null;\n }\n if (right === void 0) {\n right = null;\n }\n if (isArithmeticOp === void 0) {\n isArithmeticOp = false;\n }\n var _this = _super.call(this) || this;\n _this.operatorName = operatorName;\n _this.left = left;\n _this.right = right;\n _this.isArithmeticValue = isArithmeticOp;\n if (isArithmeticOp) {\n _this.consumer = expressions_OperandMaker.binaryFunctions[\"arithmeticOp\"](operatorName);\n } else {\n _this.consumer = expressions_OperandMaker.binaryFunctions[operatorName];\n }\n if (_this.consumer == null) {\n expressions_OperandMaker.throwInvalidOperatorError(operatorName);\n }\n return _this;\n }\n Object.defineProperty(BinaryOperand.prototype, \"requireStrictCompare\", {\n get: function () {\n return this.getIsOperandRequireStrict(this.left) || this.getIsOperandRequireStrict(this.right);\n },\n enumerable: false,\n configurable: true\n });\n BinaryOperand.prototype.getIsOperandRequireStrict = function (op) {\n return !!op && op.requireStrictCompare;\n };\n BinaryOperand.prototype.getType = function () {\n return \"binary\";\n };\n Object.defineProperty(BinaryOperand.prototype, \"isArithmetic\", {\n get: function () {\n return this.isArithmeticValue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BinaryOperand.prototype, \"isConjunction\", {\n get: function () {\n return this.operatorName == \"or\" || this.operatorName == \"and\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BinaryOperand.prototype, \"conjunction\", {\n get: function () {\n return this.isConjunction ? this.operatorName : \"\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BinaryOperand.prototype, \"operator\", {\n get: function () {\n return this.operatorName;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BinaryOperand.prototype, \"leftOperand\", {\n get: function () {\n return this.left;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BinaryOperand.prototype, \"rightOperand\", {\n get: function () {\n return this.right;\n },\n enumerable: false,\n configurable: true\n });\n BinaryOperand.prototype.isContentEqual = function (op) {\n var bOp = op;\n return bOp.operator === this.operator && this.areOperatorsEquals(this.left, bOp.left) && this.areOperatorsEquals(this.right, bOp.right);\n };\n BinaryOperand.prototype.evaluateParam = function (x, processValue) {\n return x == null ? null : x.evaluate(processValue);\n };\n BinaryOperand.prototype.evaluate = function (processValue) {\n return this.consumer.call(this, this.evaluateParam(this.left, processValue), this.evaluateParam(this.right, processValue), this.requireStrictCompare);\n };\n BinaryOperand.prototype.toString = function (func) {\n if (func === void 0) {\n func = undefined;\n }\n if (!!func) {\n var res = func(this);\n if (!!res) return res;\n }\n return \"(\" + expressions_OperandMaker.safeToString(this.left, func) + \" \" + expressions_OperandMaker.operatorToString(this.operatorName) + \" \" + expressions_OperandMaker.safeToString(this.right, func) + \")\";\n };\n BinaryOperand.prototype.setVariables = function (variables) {\n if (this.left != null) this.left.setVariables(variables);\n if (this.right != null) this.right.setVariables(variables);\n };\n BinaryOperand.prototype.hasFunction = function () {\n return !!this.left && this.left.hasFunction() || !!this.right && this.right.hasFunction();\n };\n BinaryOperand.prototype.hasAsyncFunction = function () {\n return !!this.left && this.left.hasAsyncFunction() || !!this.right && this.right.hasAsyncFunction();\n };\n BinaryOperand.prototype.addToAsyncList = function (list) {\n if (!!this.left) this.left.addToAsyncList(list);\n if (!!this.right) this.right.addToAsyncList(list);\n };\n return BinaryOperand;\n }(Operand);\n var UnaryOperand = /** @class */function (_super) {\n expressions_extends(UnaryOperand, _super);\n function UnaryOperand(expressionValue, operatorName) {\n var _this = _super.call(this) || this;\n _this.expressionValue = expressionValue;\n _this.operatorName = operatorName;\n _this.consumer = expressions_OperandMaker.unaryFunctions[operatorName];\n if (_this.consumer == null) {\n expressions_OperandMaker.throwInvalidOperatorError(operatorName);\n }\n return _this;\n }\n Object.defineProperty(UnaryOperand.prototype, \"operator\", {\n get: function () {\n return this.operatorName;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(UnaryOperand.prototype, \"expression\", {\n get: function () {\n return this.expressionValue;\n },\n enumerable: false,\n configurable: true\n });\n UnaryOperand.prototype.getType = function () {\n return \"unary\";\n };\n UnaryOperand.prototype.toString = function (func) {\n if (func === void 0) {\n func = undefined;\n }\n if (!!func) {\n var res = func(this);\n if (!!res) return res;\n }\n return expressions_OperandMaker.operatorToString(this.operatorName) + \" \" + this.expression.toString(func);\n };\n UnaryOperand.prototype.isContentEqual = function (op) {\n var uOp = op;\n return uOp.operator == this.operator && this.areOperatorsEquals(this.expression, uOp.expression);\n };\n UnaryOperand.prototype.hasFunction = function () {\n return this.expression.hasFunction();\n };\n UnaryOperand.prototype.hasAsyncFunction = function () {\n return this.expression.hasAsyncFunction();\n };\n UnaryOperand.prototype.addToAsyncList = function (list) {\n this.expression.addToAsyncList(list);\n };\n UnaryOperand.prototype.evaluate = function (processValue) {\n var value = this.expression.evaluate(processValue);\n return this.consumer.call(this, value);\n };\n UnaryOperand.prototype.setVariables = function (variables) {\n this.expression.setVariables(variables);\n };\n return UnaryOperand;\n }(Operand);\n var ArrayOperand = /** @class */function (_super) {\n expressions_extends(ArrayOperand, _super);\n function ArrayOperand(values) {\n var _this = _super.call(this) || this;\n _this.values = values;\n return _this;\n }\n ArrayOperand.prototype.getType = function () {\n return \"array\";\n };\n ArrayOperand.prototype.toString = function (func) {\n if (func === void 0) {\n func = undefined;\n }\n if (!!func) {\n var res = func(this);\n if (!!res) return res;\n }\n return \"[\" + this.values.map(function (el) {\n return el.toString(func);\n }).join(\", \") + \"]\";\n };\n ArrayOperand.prototype.evaluate = function (processValue) {\n return this.values.map(function (el) {\n return el.evaluate(processValue);\n });\n };\n ArrayOperand.prototype.setVariables = function (variables) {\n this.values.forEach(function (el) {\n el.setVariables(variables);\n });\n };\n ArrayOperand.prototype.hasFunction = function () {\n return this.values.some(function (operand) {\n return operand.hasFunction();\n });\n };\n ArrayOperand.prototype.hasAsyncFunction = function () {\n return this.values.some(function (operand) {\n return operand.hasAsyncFunction();\n });\n };\n ArrayOperand.prototype.addToAsyncList = function (list) {\n this.values.forEach(function (operand) {\n return operand.addToAsyncList(list);\n });\n };\n ArrayOperand.prototype.isContentEqual = function (op) {\n var aOp = op;\n if (aOp.values.length !== this.values.length) return false;\n for (var i = 0; i < this.values.length; i++) {\n if (!aOp.values[i].isEqual(this.values[i])) return false;\n }\n return true;\n };\n return ArrayOperand;\n }(Operand);\n var expressions_Const = /** @class */function (_super) {\n expressions_extends(Const, _super);\n function Const(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n Const.prototype.getType = function () {\n return \"const\";\n };\n Const.prototype.toString = function (func) {\n if (func === void 0) {\n func = undefined;\n }\n if (!!func) {\n var res = func(this);\n if (!!res) return res;\n }\n return this.value.toString();\n };\n Object.defineProperty(Const.prototype, \"correctValue\", {\n get: function () {\n return this.getCorrectValue(this.value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Const.prototype, \"requireStrictCompare\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Const.prototype.evaluate = function () {\n return this.getCorrectValue(this.value);\n };\n Const.prototype.setVariables = function (variables) {};\n Const.prototype.getCorrectValue = function (value) {\n if (!value || typeof value != \"string\") return value;\n if (expressions_OperandMaker.isBooleanValue(value)) return value.toLowerCase() === \"true\";\n if (value.length > 1 && this.isQuote(value[0]) && this.isQuote(value[value.length - 1])) return value.substring(1, value.length - 1);\n if (helpers_Helpers.isNumber(value)) {\n if (value[0] === \"0\" && value.indexOf(\"0x\") != 0) {\n var len = value.length;\n var hasPoint = len > 1 && (value[1] === \".\" || value[1] === \",\");\n if (!hasPoint && len > 1 || hasPoint && len < 2) return value;\n }\n return helpers_Helpers.getNumber(value);\n }\n return value;\n };\n Const.prototype.isContentEqual = function (op) {\n var cOp = op;\n return cOp.value == this.value;\n };\n Const.prototype.isQuote = function (ch) {\n return ch == \"'\" || ch == '\"';\n };\n return Const;\n }(Operand);\n var expressions_Variable = /** @class */function (_super) {\n expressions_extends(Variable, _super);\n function Variable(variableName) {\n var _this = _super.call(this, variableName) || this;\n _this.variableName = variableName;\n _this.valueInfo = {};\n _this.useValueAsItIs = false;\n if (!!_this.variableName && _this.variableName.length > 1 && _this.variableName[0] === Variable.DisableConversionChar) {\n _this.variableName = _this.variableName.substring(1);\n _this.useValueAsItIs = true;\n }\n return _this;\n }\n Object.defineProperty(Variable, \"DisableConversionChar\", {\n get: function () {\n return settings.expressionDisableConversionChar;\n },\n set: function (val) {\n settings.expressionDisableConversionChar = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Variable.prototype, \"requireStrictCompare\", {\n get: function () {\n return this.valueInfo.sctrictCompare === true;\n },\n enumerable: false,\n configurable: true\n });\n Variable.prototype.getType = function () {\n return \"variable\";\n };\n Variable.prototype.toString = function (func) {\n if (func === void 0) {\n func = undefined;\n }\n if (!!func) {\n var res = func(this);\n if (!!res) return res;\n }\n var prefix = this.useValueAsItIs ? Variable.DisableConversionChar : \"\";\n return \"{\" + prefix + this.variableName + \"}\";\n };\n Object.defineProperty(Variable.prototype, \"variable\", {\n get: function () {\n return this.variableName;\n },\n enumerable: false,\n configurable: true\n });\n Variable.prototype.evaluate = function (processValue) {\n this.valueInfo.name = this.variableName;\n processValue.getValueInfo(this.valueInfo);\n return this.valueInfo.hasValue ? this.getCorrectValue(this.valueInfo.value) : null;\n };\n Variable.prototype.setVariables = function (variables) {\n variables.push(this.variableName);\n };\n Variable.prototype.getCorrectValue = function (value) {\n if (this.useValueAsItIs) return value;\n return _super.prototype.getCorrectValue.call(this, value);\n };\n Variable.prototype.isContentEqual = function (op) {\n var vOp = op;\n return vOp.variable == this.variable;\n };\n return Variable;\n }(expressions_Const);\n var expressions_FunctionOperand = /** @class */function (_super) {\n expressions_extends(FunctionOperand, _super);\n function FunctionOperand(originalValue, parameters) {\n var _this = _super.call(this) || this;\n _this.originalValue = originalValue;\n _this.parameters = parameters;\n if (Array.isArray(parameters) && parameters.length === 0) {\n _this.parameters = new ArrayOperand([]);\n }\n return _this;\n }\n FunctionOperand.prototype.getType = function () {\n return \"function\";\n };\n FunctionOperand.prototype.evaluate = function (processValue) {\n var asyncVal = this.getAsynValue(processValue);\n if (!!asyncVal) return asyncVal.value;\n return this.evaluateCore(processValue);\n };\n FunctionOperand.prototype.evaluateCore = function (processValue) {\n var properties = processValue.properties;\n if (this.isAsyncFunction) {\n properties = helpers_Helpers.createCopy(processValue.properties);\n var id_1 = this.id;\n var asyncValues_1 = processValue.asyncValues;\n var onComplete_1 = processValue.onCompleteAsyncFunc;\n var item_1 = this;\n properties.returnResult = function (result) {\n asyncValues_1[id_1] = {\n value: result\n };\n onComplete_1(item_1);\n };\n }\n return functionsfactory_FunctionFactory.Instance.run(this.originalValue, this.parameters.evaluate(processValue), properties, this.parameters.values);\n };\n FunctionOperand.prototype.toString = function (func) {\n if (func === void 0) {\n func = undefined;\n }\n if (!!func) {\n var res = func(this);\n if (!!res) return res;\n }\n return this.originalValue + \"(\" + this.parameters.toString(func) + \")\";\n };\n FunctionOperand.prototype.setVariables = function (variables) {\n this.parameters.setVariables(variables);\n };\n FunctionOperand.prototype.isReady = function (proccessValue) {\n return !!this.getAsynValue(proccessValue);\n };\n FunctionOperand.prototype.getAsynValue = function (proccessValue) {\n return proccessValue.asyncValues[this.id];\n };\n FunctionOperand.prototype.hasFunction = function () {\n return true;\n };\n FunctionOperand.prototype.hasAsyncFunction = function () {\n return this.isAsyncFunction() || this.parameters.hasAsyncFunction();\n };\n FunctionOperand.prototype.isAsyncFunction = function () {\n return functionsfactory_FunctionFactory.Instance.isAsyncFunction(this.originalValue);\n };\n FunctionOperand.prototype.addToAsyncList = function (list) {\n var item = undefined;\n if (this.isAsyncFunction()) {\n item = {\n operand: this\n };\n }\n if (this.parameters.hasAsyncFunction()) {\n var children = new Array();\n this.parameters.addToAsyncList(children);\n children.forEach(function (child) {\n return child.parent = item;\n });\n if (!item) {\n item = {};\n }\n item.children = children;\n }\n if (item) {\n list.push(item);\n }\n };\n FunctionOperand.prototype.isContentEqual = function (op) {\n var fOp = op;\n return fOp.originalValue == this.originalValue && this.areOperatorsEquals(fOp.parameters, this.parameters);\n };\n return FunctionOperand;\n }(Operand);\n var expressions_OperandMaker = /** @class */function () {\n function OperandMaker() {}\n OperandMaker.throwInvalidOperatorError = function (op) {\n throw new Error(\"Invalid operator: '\" + op + \"'\");\n };\n OperandMaker.safeToString = function (operand, func) {\n return operand == null ? \"\" : operand.toString(func);\n };\n OperandMaker.toOperandString = function (value) {\n if (!!value && !helpers_Helpers.isNumber(value) && !OperandMaker.isBooleanValue(value)) value = \"'\" + value + \"'\";\n return value;\n };\n OperandMaker.isBooleanValue = function (value) {\n return !!value && (value.toLowerCase() === \"true\" || value.toLowerCase() === \"false\");\n };\n OperandMaker.countDecimals = function (value) {\n if (helpers_Helpers.isNumber(value) && Math.floor(value) !== value) {\n var strs = value.toString().split(\".\");\n return strs.length > 1 && strs[1].length || 0;\n }\n return 0;\n };\n OperandMaker.plusMinus = function (a, b, res) {\n var digitsA = OperandMaker.countDecimals(a);\n var digitsB = OperandMaker.countDecimals(b);\n if (digitsA > 0 || digitsB > 0) {\n var digits = Math.max(digitsA, digitsB);\n res = parseFloat(res.toFixed(digits));\n }\n return res;\n };\n OperandMaker.isTwoValueEquals = function (x, y, ignoreOrder) {\n if (ignoreOrder === void 0) {\n ignoreOrder = true;\n }\n if (x === \"undefined\") x = undefined;\n if (y === \"undefined\") y = undefined;\n return helpers_Helpers.isTwoValueEquals(x, y, ignoreOrder);\n };\n OperandMaker.operatorToString = function (operatorName) {\n var opStr = OperandMaker.signs[operatorName];\n return opStr == null ? operatorName : opStr;\n };\n OperandMaker.convertValForDateCompare = function (val, second) {\n if (second instanceof Date && typeof val === \"string\") {\n var res = createDate(\"expression-operand\", val);\n res.setHours(0, 0, 0);\n return res;\n }\n return val;\n };\n OperandMaker.unaryFunctions = {\n empty: function (value) {\n return helpers_Helpers.isValueEmpty(value);\n },\n notempty: function (value) {\n return !OperandMaker.unaryFunctions.empty(value);\n },\n negate: function (value) {\n return !value;\n }\n };\n OperandMaker.binaryFunctions = {\n arithmeticOp: function (operatorName) {\n var convertForArithmeticOp = function (val, second) {\n if (!helpers_Helpers.isValueEmpty(val)) return val;\n if (typeof second === \"number\") return 0;\n if (typeof val === \"string\") return val;\n if (typeof second === \"string\") return \"\";\n if (Array.isArray(second)) return [];\n return 0;\n };\n return function (a, b) {\n a = convertForArithmeticOp(a, b);\n b = convertForArithmeticOp(b, a);\n var consumer = OperandMaker.binaryFunctions[operatorName];\n return consumer == null ? null : consumer.call(this, a, b);\n };\n },\n and: function (a, b) {\n return a && b;\n },\n or: function (a, b) {\n return a || b;\n },\n plus: function (a, b) {\n return helpers_Helpers.sumAnyValues(a, b);\n },\n minus: function (a, b) {\n return helpers_Helpers.correctAfterPlusMinis(a, b, a - b);\n },\n mul: function (a, b) {\n return helpers_Helpers.correctAfterMultiple(a, b, a * b);\n },\n div: function (a, b) {\n if (!b) return null;\n return a / b;\n },\n mod: function (a, b) {\n if (!b) return null;\n return a % b;\n },\n power: function (a, b) {\n return Math.pow(a, b);\n },\n greater: function (left, right) {\n if (left == null || right == null) return false;\n left = OperandMaker.convertValForDateCompare(left, right);\n right = OperandMaker.convertValForDateCompare(right, left);\n return left > right;\n },\n less: function (left, right) {\n if (left == null || right == null) return false;\n left = OperandMaker.convertValForDateCompare(left, right);\n right = OperandMaker.convertValForDateCompare(right, left);\n return left < right;\n },\n greaterorequal: function (left, right) {\n if (OperandMaker.binaryFunctions.equal(left, right)) return true;\n return OperandMaker.binaryFunctions.greater(left, right);\n },\n lessorequal: function (left, right) {\n if (OperandMaker.binaryFunctions.equal(left, right)) return true;\n return OperandMaker.binaryFunctions.less(left, right);\n },\n equal: function (left, right, strictCompare) {\n left = OperandMaker.convertValForDateCompare(left, right);\n right = OperandMaker.convertValForDateCompare(right, left);\n return OperandMaker.isTwoValueEquals(left, right, strictCompare !== true);\n },\n notequal: function (left, right, strictCompare) {\n return !OperandMaker.binaryFunctions.equal(left, right, strictCompare);\n },\n contains: function (left, right) {\n return OperandMaker.binaryFunctions.containsCore(left, right, true);\n },\n notcontains: function (left, right) {\n if (!left && !helpers_Helpers.isValueEmpty(right)) return true;\n return OperandMaker.binaryFunctions.containsCore(left, right, false);\n },\n anyof: function (left, right) {\n if (helpers_Helpers.isValueEmpty(left) && helpers_Helpers.isValueEmpty(right)) return true;\n if (helpers_Helpers.isValueEmpty(left) || !Array.isArray(left) && left.length === 0) return false;\n if (helpers_Helpers.isValueEmpty(right)) return true;\n if (!Array.isArray(left)) return OperandMaker.binaryFunctions.contains(right, left);\n if (!Array.isArray(right)) return OperandMaker.binaryFunctions.contains(left, right);\n for (var i = 0; i < right.length; i++) {\n if (OperandMaker.binaryFunctions.contains(left, right[i])) return true;\n }\n return false;\n },\n allof: function (left, right) {\n if (!left && !helpers_Helpers.isValueEmpty(right)) return false;\n if (!Array.isArray(right)) return OperandMaker.binaryFunctions.contains(left, right);\n for (var i = 0; i < right.length; i++) {\n if (!OperandMaker.binaryFunctions.contains(left, right[i])) return false;\n }\n return true;\n },\n containsCore: function (left, right, isContains) {\n if (!left && left !== 0 && left !== false) return false;\n if (!left.length) {\n left = left.toString();\n if (typeof right === \"string\" || right instanceof String) {\n left = left.toUpperCase();\n right = right.toUpperCase();\n }\n }\n if (typeof left === \"string\" || left instanceof String) {\n if (!right) return false;\n right = right.toString();\n var found = left.indexOf(right) > -1;\n return isContains ? found : !found;\n }\n var rightArray = Array.isArray(right) ? right : [right];\n for (var rIndex = 0; rIndex < rightArray.length; rIndex++) {\n var i = 0;\n right = rightArray[rIndex];\n for (; i < left.length; i++) {\n if (OperandMaker.isTwoValueEquals(left[i], right)) break;\n }\n if (i == left.length) return !isContains;\n }\n return isContains;\n }\n };\n OperandMaker.signs = {\n less: \"<\",\n lessorequal: \"<=\",\n greater: \">\",\n greaterorequal: \">=\",\n equal: \"==\",\n notequal: \"!=\",\n plus: \"+\",\n minus: \"-\",\n mul: \"*\",\n div: \"/\",\n and: \"and\",\n or: \"or\",\n power: \"^\",\n mod: \"%\",\n negate: \"!\"\n };\n return OperandMaker;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/expressions/expressionParser.ts\n var expressionParser_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n /* eslint-disable */\n\n // Generated by PEG.js v. 0.10.0 (ts-pegjs plugin v. 0.3.1 )\n //\n // https://pegjs.org/ https://github.com/metadevpro/ts-pegjs\n \"use strict\";\n var SyntaxError = /** @class */function (_super) {\n expressionParser_extends(SyntaxError, _super);\n function SyntaxError(message, expected, found, location) {\n var _this = _super.call(this) || this;\n _this.message = message;\n _this.expected = expected;\n _this.found = found;\n _this.location = location;\n _this.name = \"SyntaxError\";\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(_this, SyntaxError);\n }\n return _this;\n }\n SyntaxError.buildMessage = function (expected, found) {\n function hex(ch) {\n return ch.charCodeAt(0).toString(16).toUpperCase();\n }\n function literalEscape(s) {\n return s.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\0/g, \"\\\\0\").replace(/\\t/g, \"\\\\t\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/[\\x00-\\x0F]/g, function (ch) {\n return \"\\\\x0\" + hex(ch);\n }).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function (ch) {\n return \"\\\\x\" + hex(ch);\n });\n }\n function classEscape(s) {\n return s.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\]/g, \"\\\\]\").replace(/\\^/g, \"\\\\^\").replace(/-/g, \"\\\\-\").replace(/\\0/g, \"\\\\0\").replace(/\\t/g, \"\\\\t\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/[\\x00-\\x0F]/g, function (ch) {\n return \"\\\\x0\" + hex(ch);\n }).replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function (ch) {\n return \"\\\\x\" + hex(ch);\n });\n }\n function describeExpectation(expectation) {\n switch (expectation.type) {\n case \"literal\":\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n case \"class\":\n var escapedParts = expectation.parts.map(function (part) {\n return Array.isArray(part) ? classEscape(part[0]) + \"-\" + classEscape(part[1]) : classEscape(part);\n });\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n case \"any\":\n return \"any character\";\n case \"end\":\n return \"end of input\";\n case \"other\":\n return expectation.description;\n }\n }\n function describeExpected(expected1) {\n var descriptions = expected1.map(describeExpectation);\n var i;\n var j;\n descriptions.sort();\n if (descriptions.length > 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n default:\n return descriptions.slice(0, -1).join(\", \") + \", or \" + descriptions[descriptions.length - 1];\n }\n }\n function describeFound(found1) {\n return found1 ? \"\\\"\" + literalEscape(found1) + \"\\\"\" : \"end of input\";\n }\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n return SyntaxError;\n }(Error);\n function peg$parse(input, options) {\n options = options !== undefined ? options : {};\n var peg$FAILED = {};\n var peg$startRuleFunctions = {\n Expression: peg$parseExpression\n };\n var peg$startRuleFunction = peg$parseExpression;\n var peg$c0 = function (head, tail) {\n return buildBinaryOperand(head, tail, true);\n };\n var peg$c1 = \"||\";\n var peg$c2 = peg$literalExpectation(\"||\", false);\n var peg$c3 = \"or\";\n var peg$c4 = peg$literalExpectation(\"or\", true);\n var peg$c5 = function () {\n return \"or\";\n };\n var peg$c6 = \"&&\";\n var peg$c7 = peg$literalExpectation(\"&&\", false);\n var peg$c8 = \"and\";\n var peg$c9 = peg$literalExpectation(\"and\", true);\n var peg$c10 = function () {\n return \"and\";\n };\n var peg$c11 = function (head, tail) {\n return buildBinaryOperand(head, tail);\n };\n var peg$c12 = \"<=\";\n var peg$c13 = peg$literalExpectation(\"<=\", false);\n var peg$c14 = \"lessorequal\";\n var peg$c15 = peg$literalExpectation(\"lessorequal\", true);\n var peg$c16 = function () {\n return \"lessorequal\";\n };\n var peg$c17 = \">=\";\n var peg$c18 = peg$literalExpectation(\">=\", false);\n var peg$c19 = \"greaterorequal\";\n var peg$c20 = peg$literalExpectation(\"greaterorequal\", true);\n var peg$c21 = function () {\n return \"greaterorequal\";\n };\n var peg$c22 = \"==\";\n var peg$c23 = peg$literalExpectation(\"==\", false);\n var peg$c24 = \"equal\";\n var peg$c25 = peg$literalExpectation(\"equal\", true);\n var peg$c26 = function () {\n return \"equal\";\n };\n var peg$c27 = \"=\";\n var peg$c28 = peg$literalExpectation(\"=\", false);\n var peg$c29 = \"!=\";\n var peg$c30 = peg$literalExpectation(\"!=\", false);\n var peg$c31 = \"notequal\";\n var peg$c32 = peg$literalExpectation(\"notequal\", true);\n var peg$c33 = function () {\n return \"notequal\";\n };\n var peg$c34 = \"<\";\n var peg$c35 = peg$literalExpectation(\"<\", false);\n var peg$c36 = \"less\";\n var peg$c37 = peg$literalExpectation(\"less\", true);\n var peg$c38 = function () {\n return \"less\";\n };\n var peg$c39 = \">\";\n var peg$c40 = peg$literalExpectation(\">\", false);\n var peg$c41 = \"greater\";\n var peg$c42 = peg$literalExpectation(\"greater\", true);\n var peg$c43 = function () {\n return \"greater\";\n };\n var peg$c44 = \"+\";\n var peg$c45 = peg$literalExpectation(\"+\", false);\n var peg$c46 = function () {\n return \"plus\";\n };\n var peg$c47 = \"-\";\n var peg$c48 = peg$literalExpectation(\"-\", false);\n var peg$c49 = function () {\n return \"minus\";\n };\n var peg$c50 = \"*\";\n var peg$c51 = peg$literalExpectation(\"*\", false);\n var peg$c52 = function () {\n return \"mul\";\n };\n var peg$c53 = \"/\";\n var peg$c54 = peg$literalExpectation(\"/\", false);\n var peg$c55 = function () {\n return \"div\";\n };\n var peg$c56 = \"%\";\n var peg$c57 = peg$literalExpectation(\"%\", false);\n var peg$c58 = function () {\n return \"mod\";\n };\n var peg$c59 = \"^\";\n var peg$c60 = peg$literalExpectation(\"^\", false);\n var peg$c61 = \"power\";\n var peg$c62 = peg$literalExpectation(\"power\", true);\n var peg$c63 = function () {\n return \"power\";\n };\n var peg$c64 = \"*=\";\n var peg$c65 = peg$literalExpectation(\"*=\", false);\n var peg$c66 = \"contains\";\n var peg$c67 = peg$literalExpectation(\"contains\", true);\n var peg$c68 = \"contain\";\n var peg$c69 = peg$literalExpectation(\"contain\", true);\n var peg$c70 = function () {\n return \"contains\";\n };\n var peg$c71 = \"notcontains\";\n var peg$c72 = peg$literalExpectation(\"notcontains\", true);\n var peg$c73 = \"notcontain\";\n var peg$c74 = peg$literalExpectation(\"notcontain\", true);\n var peg$c75 = function () {\n return \"notcontains\";\n };\n var peg$c76 = \"anyof\";\n var peg$c77 = peg$literalExpectation(\"anyof\", true);\n var peg$c78 = function () {\n return \"anyof\";\n };\n var peg$c79 = \"allof\";\n var peg$c80 = peg$literalExpectation(\"allof\", true);\n var peg$c81 = function () {\n return \"allof\";\n };\n var peg$c82 = \"(\";\n var peg$c83 = peg$literalExpectation(\"(\", false);\n var peg$c84 = \")\";\n var peg$c85 = peg$literalExpectation(\")\", false);\n var peg$c86 = function (expr) {\n return expr;\n };\n var peg$c87 = function (name, params) {\n return new expressions_FunctionOperand(name, params);\n };\n var peg$c88 = \"!\";\n var peg$c89 = peg$literalExpectation(\"!\", false);\n var peg$c90 = \"negate\";\n var peg$c91 = peg$literalExpectation(\"negate\", true);\n var peg$c92 = function (expr) {\n return new UnaryOperand(expr, \"negate\");\n };\n var peg$c93 = function (expr, op) {\n return new UnaryOperand(expr, op);\n };\n var peg$c94 = \"empty\";\n var peg$c95 = peg$literalExpectation(\"empty\", true);\n var peg$c96 = function () {\n return \"empty\";\n };\n var peg$c97 = \"notempty\";\n var peg$c98 = peg$literalExpectation(\"notempty\", true);\n var peg$c99 = function () {\n return \"notempty\";\n };\n var peg$c100 = \"undefined\";\n var peg$c101 = peg$literalExpectation(\"undefined\", false);\n var peg$c102 = \"null\";\n var peg$c103 = peg$literalExpectation(\"null\", false);\n var peg$c104 = function () {\n return null;\n };\n var peg$c105 = function (value) {\n return new expressions_Const(value);\n };\n var peg$c106 = \"{\";\n var peg$c107 = peg$literalExpectation(\"{\", false);\n var peg$c108 = \"}\";\n var peg$c109 = peg$literalExpectation(\"}\", false);\n var peg$c110 = function (value) {\n return new expressions_Variable(value);\n };\n var peg$c111 = function (value) {\n return value;\n };\n var peg$c112 = \"''\";\n var peg$c113 = peg$literalExpectation(\"''\", false);\n var peg$c114 = function () {\n return \"\";\n };\n var peg$c115 = \"\\\"\\\"\";\n var peg$c116 = peg$literalExpectation(\"\\\"\\\"\", false);\n var peg$c117 = \"'\";\n var peg$c118 = peg$literalExpectation(\"'\", false);\n var peg$c119 = function (value) {\n return \"'\" + value + \"'\";\n };\n var peg$c120 = \"\\\"\";\n var peg$c121 = peg$literalExpectation(\"\\\"\", false);\n var peg$c122 = \"[\";\n var peg$c123 = peg$literalExpectation(\"[\", false);\n var peg$c124 = \"]\";\n var peg$c125 = peg$literalExpectation(\"]\", false);\n var peg$c126 = function (sequence) {\n return sequence;\n };\n var peg$c127 = \",\";\n var peg$c128 = peg$literalExpectation(\",\", false);\n var peg$c129 = function (expr, tail) {\n if (expr == null) return new ArrayOperand([]);\n var array = [expr];\n if (Array.isArray(tail)) {\n var flatten = flattenArray(tail);\n for (var i = 3; i < flatten.length; i += 4) {\n array.push(flatten[i]);\n }\n }\n return new ArrayOperand(array);\n };\n var peg$c130 = \"true\";\n var peg$c131 = peg$literalExpectation(\"true\", true);\n var peg$c132 = function () {\n return true;\n };\n var peg$c133 = \"false\";\n var peg$c134 = peg$literalExpectation(\"false\", true);\n var peg$c135 = function () {\n return false;\n };\n var peg$c136 = \"0x\";\n var peg$c137 = peg$literalExpectation(\"0x\", false);\n var peg$c138 = function () {\n return parseInt(text(), 16);\n };\n var peg$c139 = /^[\\-]/;\n var peg$c140 = peg$classExpectation([\"-\"], false, false);\n var peg$c141 = function (sign, num) {\n return sign == null ? num : -num;\n };\n var peg$c142 = \".\";\n var peg$c143 = peg$literalExpectation(\".\", false);\n var peg$c144 = function () {\n return parseFloat(text());\n };\n var peg$c145 = function () {\n return parseInt(text(), 10);\n };\n var peg$c146 = \"0\";\n var peg$c147 = peg$literalExpectation(\"0\", false);\n var peg$c148 = function () {\n return 0;\n };\n var peg$c149 = function (chars) {\n return chars.join(\"\");\n };\n var peg$c150 = \"\\\\'\";\n var peg$c151 = peg$literalExpectation(\"\\\\'\", false);\n var peg$c152 = function () {\n return \"'\";\n };\n var peg$c153 = \"\\\\\\\"\";\n var peg$c154 = peg$literalExpectation(\"\\\\\\\"\", false);\n var peg$c155 = function () {\n return \"\\\"\";\n };\n var peg$c156 = /^[^\"']/;\n var peg$c157 = peg$classExpectation([\"\\\"\", \"'\"], true, false);\n var peg$c158 = function () {\n return text();\n };\n var peg$c159 = /^[^{}]/;\n var peg$c160 = peg$classExpectation([\"{\", \"}\"], true, false);\n var peg$c161 = /^[0-9]/;\n var peg$c162 = peg$classExpectation([[\"0\", \"9\"]], false, false);\n var peg$c163 = /^[1-9]/;\n var peg$c164 = peg$classExpectation([[\"1\", \"9\"]], false, false);\n var peg$c165 = /^[a-zA-Z_]/;\n var peg$c166 = peg$classExpectation([[\"a\", \"z\"], [\"A\", \"Z\"], \"_\"], false, false);\n var peg$c167 = peg$otherExpectation(\"whitespace\");\n var peg$c168 = /^[ \\t\\n\\r]/;\n var peg$c169 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], false, false);\n var peg$currPos = 0;\n var peg$savedPos = 0;\n var peg$posDetailsCache = [{\n line: 1,\n column: 1\n }];\n var peg$maxFailPos = 0;\n var peg$maxFailExpected = [];\n var peg$silentFails = 0;\n var peg$resultsCache = {};\n var peg$result;\n if (options.startRule !== undefined) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n function expected(description, location1) {\n location1 = location1 !== undefined ? location1 : peg$computeLocation(peg$savedPos, peg$currPos);\n throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location1);\n }\n function error(message, location1) {\n location1 = location1 !== undefined ? location1 : peg$computeLocation(peg$savedPos, peg$currPos);\n throw peg$buildSimpleError(message, location1);\n }\n function peg$literalExpectation(text1, ignoreCase) {\n return {\n type: \"literal\",\n text: text1,\n ignoreCase: ignoreCase\n };\n }\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return {\n type: \"class\",\n parts: parts,\n inverted: inverted,\n ignoreCase: ignoreCase\n };\n }\n function peg$anyExpectation() {\n return {\n type: \"any\"\n };\n }\n function peg$endExpectation() {\n return {\n type: \"end\"\n };\n }\n function peg$otherExpectation(description) {\n return {\n type: \"other\",\n description: description\n };\n }\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos];\n var p;\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n p++;\n }\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos);\n var endPosDetails = peg$computePosDetails(endPos);\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n function peg$fail(expected1) {\n if (peg$currPos < peg$maxFailPos) {\n return;\n }\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n peg$maxFailExpected.push(expected1);\n }\n function peg$buildSimpleError(message, location1) {\n return new SyntaxError(message, [], \"\", location1);\n }\n function peg$buildStructuredError(expected1, found, location1) {\n return new SyntaxError(SyntaxError.buildMessage(expected1, found), expected1, found, location1);\n }\n function peg$parseExpression() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8;\n var key = peg$currPos * 34 + 0;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseLogicOr();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n s5 = peg$parse_();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseOrSign();\n if (s6 !== peg$FAILED) {\n s7 = peg$parse_();\n if (s7 !== peg$FAILED) {\n s8 = peg$parseLogicOr();\n if (s8 !== peg$FAILED) {\n s5 = [s5, s6, s7, s8];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = peg$parse_();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseOrSign();\n if (s6 !== peg$FAILED) {\n s7 = peg$parse_();\n if (s7 !== peg$FAILED) {\n s8 = peg$parseLogicOr();\n if (s8 !== peg$FAILED) {\n s5 = [s5, s6, s7, s8];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseOrSign() {\n var s0, s1;\n var key = peg$currPos * 34 + 1;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c1) {\n s1 = peg$c1;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c2);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 2).toLowerCase() === peg$c3) {\n s1 = input.substr(peg$currPos, 2);\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c4);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5();\n }\n s0 = s1;\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseLogicOr() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n var key = peg$currPos * 34 + 2;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseLogicAnd();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseAndSign();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseLogicAnd();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseAndSign();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseLogicAnd();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseAndSign() {\n var s0, s1;\n var key = peg$currPos * 34 + 3;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c6) {\n s1 = peg$c6;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c7);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 3).toLowerCase() === peg$c8) {\n s1 = input.substr(peg$currPos, 3);\n peg$currPos += 3;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c9);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c10();\n }\n s0 = s1;\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseLogicAnd() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n var key = peg$currPos * 34 + 4;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseCompOps();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseComparableOperators();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseCompOps();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseComparableOperators();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseCompOps();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c11(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseComparableOperators() {\n var s0, s1;\n var key = peg$currPos * 34 + 5;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c12) {\n s1 = peg$c12;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c13);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 11).toLowerCase() === peg$c14) {\n s1 = input.substr(peg$currPos, 11);\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c15);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c16();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c17) {\n s1 = peg$c17;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c18);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 14).toLowerCase() === peg$c19) {\n s1 = input.substr(peg$currPos, 14);\n peg$currPos += 14;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c20);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c21();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c22) {\n s1 = peg$c22;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c23);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 5).toLowerCase() === peg$c24) {\n s1 = input.substr(peg$currPos, 5);\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c25);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c26();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 61) {\n s1 = peg$c27;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c28);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 5).toLowerCase() === peg$c24) {\n s1 = input.substr(peg$currPos, 5);\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c25);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c26();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c29) {\n s1 = peg$c29;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c30);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 8).toLowerCase() === peg$c31) {\n s1 = input.substr(peg$currPos, 8);\n peg$currPos += 8;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c32);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c33();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 60) {\n s1 = peg$c34;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c35);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 4).toLowerCase() === peg$c36) {\n s1 = input.substr(peg$currPos, 4);\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c37);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c38();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 62) {\n s1 = peg$c39;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c40);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 7).toLowerCase() === peg$c41) {\n s1 = input.substr(peg$currPos, 7);\n peg$currPos += 7;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c42);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c43();\n }\n s0 = s1;\n }\n }\n }\n }\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseCompOps() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n var key = peg$currPos * 34 + 6;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parsePlusMinusOps();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsePlusMinusSigns();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsePlusMinusOps();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsePlusMinusSigns();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parsePlusMinusOps();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parsePlusMinusSigns() {\n var s0, s1;\n var key = peg$currPos * 34 + 7;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 43) {\n s1 = peg$c44;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c45);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c46();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 45) {\n s1 = peg$c47;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c48);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c49();\n }\n s0 = s1;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parsePlusMinusOps() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n var key = peg$currPos * 34 + 8;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseMulDivOps();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseMulDivSigns();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseMulDivOps();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseMulDivSigns();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseMulDivOps();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseMulDivSigns() {\n var s0, s1;\n var key = peg$currPos * 34 + 9;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 42) {\n s1 = peg$c50;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c51);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c52();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 47) {\n s1 = peg$c53;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c54);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c55();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 37) {\n s1 = peg$c56;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c57);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c58();\n }\n s0 = s1;\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseMulDivOps() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n var key = peg$currPos * 34 + 10;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseBinaryFuncOp();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsePowerSigns();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseBinaryFuncOp();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parsePowerSigns();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseBinaryFuncOp();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parsePowerSigns() {\n var s0, s1;\n var key = peg$currPos * 34 + 11;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 94) {\n s1 = peg$c59;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c60);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 5).toLowerCase() === peg$c61) {\n s1 = input.substr(peg$currPos, 5);\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c62);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c63();\n }\n s0 = s1;\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseBinaryFuncOp() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n var key = peg$currPos * 34 + 12;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseFactor();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseBinFunctions();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseFactor();\n if (s7 === peg$FAILED) {\n s7 = null;\n }\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseBinFunctions();\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseFactor();\n if (s7 === peg$FAILED) {\n s7 = null;\n }\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c11(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseBinFunctions() {\n var s0, s1;\n var key = peg$currPos * 34 + 13;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c64) {\n s1 = peg$c64;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c65);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 8).toLowerCase() === peg$c66) {\n s1 = input.substr(peg$currPos, 8);\n peg$currPos += 8;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c67);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 7).toLowerCase() === peg$c68) {\n s1 = input.substr(peg$currPos, 7);\n peg$currPos += 7;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c69);\n }\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c70();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 11).toLowerCase() === peg$c71) {\n s1 = input.substr(peg$currPos, 11);\n peg$currPos += 11;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c72);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 10).toLowerCase() === peg$c73) {\n s1 = input.substr(peg$currPos, 10);\n peg$currPos += 10;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c74);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c75();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5).toLowerCase() === peg$c76) {\n s1 = input.substr(peg$currPos, 5);\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c77);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c78();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5).toLowerCase() === peg$c79) {\n s1 = input.substr(peg$currPos, 5);\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c80);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c81();\n }\n s0 = s1;\n }\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseFactor() {\n var s0, s1, s2, s3, s4, s5;\n var key = peg$currPos * 34 + 14;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 40) {\n s1 = peg$c82;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c83);\n }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseExpression();\n if (s3 !== peg$FAILED) {\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c84;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c85);\n }\n }\n if (s5 === peg$FAILED) {\n s5 = null;\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c86(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseFunctionOp();\n if (s0 === peg$FAILED) {\n s0 = peg$parseUnaryFunctionOp();\n if (s0 === peg$FAILED) {\n s0 = peg$parseAtom();\n if (s0 === peg$FAILED) {\n s0 = peg$parseArrayOp();\n }\n }\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseFunctionOp() {\n var s0, s1, s2, s3, s4;\n var key = peg$currPos * 34 + 15;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseLettersAndDigits();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 40) {\n s2 = peg$c82;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c83);\n }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseSequence();\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s4 = peg$c84;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c85);\n }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c87(s1, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseUnaryFunctionOp() {\n var s0, s1, s2, s3;\n var key = peg$currPos * 34 + 16;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 33) {\n s1 = peg$c88;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c89);\n }\n }\n if (s1 === peg$FAILED) {\n if (input.substr(peg$currPos, 6).toLowerCase() === peg$c90) {\n s1 = input.substr(peg$currPos, 6);\n peg$currPos += 6;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c91);\n }\n }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseExpression();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c92(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseAtom();\n if (s1 !== peg$FAILED) {\n s2 = peg$parse_();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseUnFunctions();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c93(s1, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseUnFunctions() {\n var s0, s1;\n var key = peg$currPos * 34 + 17;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5).toLowerCase() === peg$c94) {\n s1 = input.substr(peg$currPos, 5);\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c95);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c96();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 8).toLowerCase() === peg$c97) {\n s1 = input.substr(peg$currPos, 8);\n peg$currPos += 8;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c98);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c99();\n }\n s0 = s1;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseAtom() {\n var s0, s1, s2, s3, s4;\n var key = peg$currPos * 34 + 18;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.substr(peg$currPos, 9) === peg$c100) {\n s2 = peg$c100;\n peg$currPos += 9;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c101);\n }\n }\n if (s2 === peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c102) {\n s2 = peg$c102;\n peg$currPos += 4;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c103);\n }\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c104();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseConstValue();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c105(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parse_();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 123) {\n s2 = peg$c106;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c107);\n }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseValueInput();\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 125) {\n s4 = peg$c108;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c109);\n }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c110(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseConstValue() {\n var s0, s1, s2, s3;\n var key = peg$currPos * 34 + 19;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseLogicValue();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c111(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseArithmeticValue();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c111(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseLettersAndDigits();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c111(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c112) {\n s1 = peg$c112;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c113);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c114();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c115) {\n s1 = peg$c115;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c116);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c114();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c117;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c118);\n }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseAnyInput();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c117;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c118);\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c119(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c120;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c121);\n }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseAnyInput();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c120;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c121);\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c119(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n }\n }\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseArrayOp() {\n var s0, s1, s2, s3;\n var key = peg$currPos * 34 + 20;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c122;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c123);\n }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseSequence();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c124;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c125);\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c126(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseSequence() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n var key = peg$currPos * 34 + 21;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseExpression();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c127;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c128);\n }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseExpression();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parse_();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c127;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c128);\n }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parse_();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseExpression();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c129(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseLogicValue() {\n var s0, s1;\n var key = peg$currPos * 34 + 22;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4).toLowerCase() === peg$c130) {\n s1 = input.substr(peg$currPos, 4);\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c131);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c132();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5).toLowerCase() === peg$c133) {\n s1 = input.substr(peg$currPos, 5);\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c134);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c135();\n }\n s0 = s1;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseArithmeticValue() {\n var s0, s1, s2;\n var key = peg$currPos * 34 + 23;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c136) {\n s1 = peg$c136;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c137);\n }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseDigits();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c138();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (peg$c139.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c140);\n }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseNumber();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c141(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseNumber() {\n var s0, s1, s2, s3;\n var key = peg$currPos * 34 + 24;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseDigits();\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s2 = peg$c142;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c143);\n }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseDigits();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c144();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseNonZeroDigits();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseDigits();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c145();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 48) {\n s1 = peg$c146;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c147);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c148();\n }\n s0 = s1;\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseValueInput() {\n var s0, s1, s2;\n var key = peg$currPos * 34 + 25;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseValueCharacters();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseValueCharacters();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c149(s1);\n }\n s0 = s1;\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseAnyInput() {\n var s0, s1, s2;\n var key = peg$currPos * 34 + 26;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseAnyCharacters();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseAnyCharacters();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c149(s1);\n }\n s0 = s1;\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseAnyCharacters() {\n var s0, s1;\n var key = peg$currPos * 34 + 27;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c150) {\n s1 = peg$c150;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c151);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c152();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c153) {\n s1 = peg$c153;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c154);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c155();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (peg$c156.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c157);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c158();\n }\n s0 = s1;\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseValueCharacters() {\n var s0, s1;\n var key = peg$currPos * 34 + 28;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n if (peg$c159.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c160);\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c158();\n }\n s0 = s1;\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseLettersAndDigits() {\n var s0, s1, s2, s3, s4, s5, s6;\n var key = peg$currPos * 34 + 29;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = peg$currPos;\n s1 = peg$parseLetters();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parseDigits();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parseLetters();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseLetters();\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parseDigits();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parseLetters();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseLetters();\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c158();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseDigits() {\n var s0, s1;\n var key = peg$currPos * 34 + 30;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = [];\n if (peg$c161.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c162);\n }\n }\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (peg$c161.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c162);\n }\n }\n }\n } else {\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseNonZeroDigits() {\n var s0, s1;\n var key = peg$currPos * 34 + 31;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = [];\n if (peg$c163.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c164);\n }\n }\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (peg$c163.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c164);\n }\n }\n }\n } else {\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parseLetters() {\n var s0, s1;\n var key = peg$currPos * 34 + 32;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n s0 = [];\n if (peg$c165.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c166);\n }\n }\n if (s1 !== peg$FAILED) {\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (peg$c165.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c166);\n }\n }\n }\n } else {\n s0 = peg$FAILED;\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function peg$parse_() {\n var s0, s1;\n var key = peg$currPos * 34 + 33;\n var cached = peg$resultsCache[key];\n if (cached) {\n peg$currPos = cached.nextPos;\n return cached.result;\n }\n peg$silentFails++;\n s0 = [];\n if (peg$c168.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c169);\n }\n }\n while (s1 !== peg$FAILED) {\n s0.push(s1);\n if (peg$c168.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c169);\n }\n }\n }\n peg$silentFails--;\n if (s0 === peg$FAILED) {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) {\n peg$fail(peg$c167);\n }\n }\n peg$resultsCache[key] = {\n nextPos: peg$currPos,\n result: s0\n };\n return s0;\n }\n function buildBinaryOperand(head, tail, isArithmeticOp) {\n if (isArithmeticOp === void 0) {\n isArithmeticOp = false;\n }\n return tail.reduce(function (result, elements) {\n return new BinaryOperand(elements[1], result, elements[3], isArithmeticOp);\n }, head);\n }\n function flattenArray(array) {\n return [].concat.apply([], array);\n }\n peg$result = peg$startRuleFunction();\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));\n }\n }\n var parse = peg$parse;\n\n // CONCATENATED MODULE: ./packages/survey-core/src/conditionsParser.ts\n\n var ConditionsParserError = /** @class */function () {\n function ConditionsParserError(at, code) {\n this.at = at;\n this.code = code;\n }\n return ConditionsParserError;\n }();\n var conditionsParser_ConditionsParser = /** @class */function () {\n function ConditionsParser() {}\n ConditionsParser.prototype.patchExpression = function (text) {\n return text.replace(/=>/g, \">=\").replace(/=/g, \"!=\").replace(/equals/g, \"equal \").replace(/notequals/g, \"notequal \");\n };\n ConditionsParser.prototype.createCondition = function (text) {\n return this.parseExpression(text);\n };\n ConditionsParser.prototype.parseExpression = function (text) {\n try {\n var result = ConditionsParser.parserCache[text];\n if (result === undefined) {\n result = parse(this.patchExpression(text));\n if (!result.hasAsyncFunction()) {\n ConditionsParser.parserCache[text] = result;\n }\n }\n return result;\n } catch (e) {\n if (e instanceof SyntaxError) {\n this.conditionError = new ConditionsParserError(e.location.start.offset, e.message);\n }\n }\n };\n Object.defineProperty(ConditionsParser.prototype, \"error\", {\n get: function () {\n return this.conditionError;\n },\n enumerable: false,\n configurable: true\n });\n ConditionsParser.parserCache = {};\n return ConditionsParser;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/conditions.ts\n var conditions_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var conditions_ExpressionExecutorRunner = /** @class */function () {\n function ExpressionExecutorRunner(operand, id, onComplete, values, properties) {\n this.operand = operand;\n this.id = id;\n this.onComplete = onComplete;\n this.processValue = new conditionProcessValue_ProcessValue();\n this.processValue.values = values;\n this.processValue.properties = properties;\n }\n ExpressionExecutorRunner.prototype.run = function (isAsync) {\n var _this = this;\n if (!isAsync) return this.runValues();\n this.processValue.values = helpers_Helpers.createCopy(this.processValue.values);\n this.processValue.onCompleteAsyncFunc = function (op) {\n var item = _this.getAsyncItemByOperand(op, _this.asyncFuncList);\n if (item) {\n _this.doAsyncFunctionReady(item);\n }\n };\n this.asyncFuncList = new Array();\n this.operand.addToAsyncList(this.asyncFuncList);\n for (var i = 0; i < this.asyncFuncList.length; i++) {\n this.runAsyncItem(this.asyncFuncList[i]);\n }\n return false;\n };\n ExpressionExecutorRunner.prototype.getAsyncItemByOperand = function (op, list) {\n if (!Array.isArray(list)) return null;\n for (var i = 0; i < list.length; i++) {\n if (list[i].operand === op) return list[i];\n var res = this.getAsyncItemByOperand(op, list[i].children);\n if (!!res) return res;\n }\n return null;\n };\n ExpressionExecutorRunner.prototype.runAsyncItem = function (item) {\n var _this = this;\n if (item.children) {\n item.children.forEach(function (child) {\n return _this.runAsyncItem(child);\n });\n } else {\n this.runAsyncItemCore(item);\n }\n };\n ExpressionExecutorRunner.prototype.runAsyncItemCore = function (item) {\n if (item.operand) {\n item.operand.evaluate(this.processValue);\n } else {\n this.doAsyncFunctionReady(item);\n }\n };\n ExpressionExecutorRunner.prototype.doAsyncFunctionReady = function (item) {\n if (item.parent && this.isAsyncChildrenReady(item)) {\n this.runAsyncItemCore(item.parent);\n return;\n }\n for (var i = 0; i < this.asyncFuncList.length; i++) {\n if (!this.isAsyncFuncReady(this.asyncFuncList[i])) return;\n }\n this.runValues();\n };\n ExpressionExecutorRunner.prototype.isAsyncFuncReady = function (item) {\n if (item.operand && !item.operand.isReady(this.processValue)) return false;\n return this.isAsyncChildrenReady(item);\n };\n ExpressionExecutorRunner.prototype.isAsyncChildrenReady = function (item) {\n if (item.children) {\n for (var i = 0; i < item.children.length; i++) {\n if (!this.isAsyncFuncReady(item.children[i])) return false;\n }\n }\n return true;\n };\n ExpressionExecutorRunner.prototype.runValues = function () {\n var res = this.operand.evaluate(this.processValue);\n if (!!this.onComplete) {\n this.onComplete(res, this.id);\n }\n return res;\n };\n return ExpressionExecutorRunner;\n }();\n var conditions_ExpressionExecutor = /** @class */function () {\n function ExpressionExecutor(expression) {\n this.parser = new conditionsParser_ConditionsParser();\n this.isAsyncValue = false;\n this.hasFunctionValue = false;\n this.setExpression(expression);\n }\n Object.defineProperty(ExpressionExecutor.prototype, \"expression\", {\n get: function () {\n return this.expressionValue;\n },\n enumerable: false,\n configurable: true\n });\n ExpressionExecutor.prototype.setExpression = function (value) {\n if (this.expression === value) return;\n this.expressionValue = value;\n this.operand = this.parser.parseExpression(value);\n this.hasFunctionValue = this.canRun() ? this.operand.hasFunction() : false;\n this.isAsyncValue = this.hasFunction() ? this.operand.hasAsyncFunction() : false;\n };\n ExpressionExecutor.prototype.getVariables = function () {\n if (!this.operand) return [];\n var variables = [];\n this.operand.setVariables(variables);\n return variables;\n };\n ExpressionExecutor.prototype.hasFunction = function () {\n return this.hasFunctionValue;\n };\n Object.defineProperty(ExpressionExecutor.prototype, \"isAsync\", {\n get: function () {\n return this.isAsyncValue;\n },\n enumerable: false,\n configurable: true\n });\n ExpressionExecutor.prototype.canRun = function () {\n return !!this.operand;\n };\n ExpressionExecutor.prototype.run = function (values, properties, id) {\n if (properties === void 0) {\n properties = null;\n }\n if (!this.operand) {\n if (!!this.expression) {\n ConsoleWarnings.warn(\"Invalid expression: \" + this.expression);\n }\n return null;\n }\n var runner = new conditions_ExpressionExecutorRunner(this.operand, id, this.onComplete, values, properties);\n return runner.run(this.isAsync);\n };\n ExpressionExecutor.createExpressionExecutor = function (expression) {\n return new ExpressionExecutor(expression);\n };\n return ExpressionExecutor;\n }();\n var ExpressionRunnerBase = /** @class */function () {\n function ExpressionRunnerBase(expression) {\n this.expression = expression;\n }\n Object.defineProperty(ExpressionRunnerBase.prototype, \"expression\", {\n get: function () {\n return !!this.expressionExecutor ? this.expressionExecutor.expression : \"\";\n },\n set: function (value) {\n var _this = this;\n if (!!this.expressionExecutor && value === this.expression) return;\n this.expressionExecutor = conditions_ExpressionExecutor.createExpressionExecutor(value);\n this.expressionExecutor.onComplete = function (res, id) {\n _this.doOnComplete(res, id);\n };\n this.variables = undefined;\n this.containsFunc = undefined;\n },\n enumerable: false,\n configurable: true\n });\n ExpressionRunnerBase.prototype.getVariables = function () {\n if (this.variables === undefined) {\n this.variables = this.expressionExecutor.getVariables();\n }\n return this.variables;\n };\n ExpressionRunnerBase.prototype.hasFunction = function () {\n if (this.containsFunc === undefined) {\n this.containsFunc = this.expressionExecutor.hasFunction();\n }\n return this.containsFunc;\n };\n Object.defineProperty(ExpressionRunnerBase.prototype, \"isAsync\", {\n get: function () {\n return this.expressionExecutor.isAsync;\n },\n enumerable: false,\n configurable: true\n });\n ExpressionRunnerBase.prototype.canRun = function () {\n return this.expressionExecutor.canRun();\n };\n ExpressionRunnerBase.prototype.runCore = function (values, properties) {\n if (properties === void 0) {\n properties = null;\n }\n var id = ExpressionRunnerBase.IdRunnerCounter++;\n if (this.onBeforeAsyncRun && this.isAsync) {\n this.onBeforeAsyncRun(id);\n }\n return this.expressionExecutor.run(values, properties, id);\n };\n ExpressionRunnerBase.prototype.doOnComplete = function (res, id) {\n if (this.onAfterAsyncRun && this.isAsync) {\n this.onAfterAsyncRun(id);\n }\n };\n ExpressionRunnerBase.IdRunnerCounter = 1;\n return ExpressionRunnerBase;\n }();\n var ConditionRunner = /** @class */function (_super) {\n conditions_extends(ConditionRunner, _super);\n function ConditionRunner() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ConditionRunner.prototype.run = function (values, properties) {\n if (properties === void 0) {\n properties = null;\n }\n return this.runCore(values, properties) == true;\n };\n ConditionRunner.prototype.doOnComplete = function (res, id) {\n if (!!this.onRunComplete) this.onRunComplete(res == true);\n _super.prototype.doOnComplete.call(this, res, id);\n };\n return ConditionRunner;\n }(ExpressionRunnerBase);\n var ExpressionRunner = /** @class */function (_super) {\n conditions_extends(ExpressionRunner, _super);\n function ExpressionRunner() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ExpressionRunner.prototype.run = function (values, properties) {\n if (properties === void 0) {\n properties = null;\n }\n return this.runCore(values, properties);\n };\n ExpressionRunner.prototype.doOnComplete = function (res, id) {\n if (!!this.onRunComplete) this.onRunComplete(res);\n _super.prototype.doOnComplete.call(this, res, id);\n };\n return ExpressionRunner;\n }(ExpressionRunnerBase);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/base.ts\n var base_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var base_spreadArray = undefined && undefined.__spreadArray || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];\n return to;\n };\n var base_Bindings = /** @class */function () {\n function Bindings(obj) {\n this.obj = obj;\n this.properties = null;\n this.values = null;\n }\n Bindings.prototype.getType = function () {\n return \"bindings\";\n };\n Bindings.prototype.getNames = function () {\n var res = [];\n this.fillProperties();\n for (var i = 0; i < this.properties.length; i++) {\n if (this.properties[i].isVisible(\"\", this.obj)) {\n res.push(this.properties[i].name);\n }\n }\n return res;\n };\n Bindings.prototype.getProperties = function () {\n var res = [];\n this.fillProperties();\n for (var i = 0; i < this.properties.length; i++) {\n res.push(this.properties[i]);\n }\n return res;\n };\n Bindings.prototype.setBinding = function (propertyName, valueName) {\n if (!this.values) this.values = {};\n var oldValue = this.getJson();\n if (oldValue === valueName) return;\n if (!!valueName) {\n this.values[propertyName] = valueName;\n } else {\n delete this.values[propertyName];\n if (Object.keys(this.values).length == 0) {\n this.values = null;\n }\n }\n this.onChangedJSON(oldValue);\n };\n Bindings.prototype.clearBinding = function (propertyName) {\n this.setBinding(propertyName, \"\");\n };\n Bindings.prototype.isEmpty = function () {\n if (!this.values) return true;\n for (var key in this.values) return false;\n return true;\n };\n Bindings.prototype.getValueNameByPropertyName = function (propertyName) {\n if (!this.values) return undefined;\n return this.values[propertyName];\n };\n Bindings.prototype.getPropertiesByValueName = function (valueName) {\n if (!this.values) return [];\n var res = [];\n for (var key in this.values) {\n if (this.values[key] == valueName) {\n res.push(key);\n }\n }\n return res;\n };\n Bindings.prototype.getJson = function () {\n if (this.isEmpty()) return undefined;\n var res = {};\n for (var key in this.values) {\n res[key] = this.values[key];\n }\n return res;\n };\n Bindings.prototype.setJson = function (value, isLoading) {\n var oldValue = this.getJson();\n this.values = null;\n if (!!value) {\n this.values = {};\n for (var key in value) {\n this.values[key] = value[key];\n }\n }\n if (!isLoading) {\n this.onChangedJSON(oldValue);\n }\n };\n Bindings.prototype.fillProperties = function () {\n if (this.properties !== null) return;\n this.properties = [];\n var objProperties = Serializer.getPropertiesByObj(this.obj);\n for (var i = 0; i < objProperties.length; i++) {\n if (objProperties[i].isBindable) {\n this.properties.push(objProperties[i]);\n }\n }\n };\n Bindings.prototype.onChangedJSON = function (oldValue) {\n if (this.obj) {\n this.obj.onBindingChanged(oldValue, this.getJson());\n }\n };\n return Bindings;\n }();\n var Dependencies = /** @class */function () {\n function Dependencies(currentDependency, target, property) {\n this.currentDependency = currentDependency;\n this.target = target;\n this.property = property;\n this.dependencies = [];\n this.id = \"\" + ++Dependencies.DependenciesCount;\n }\n Dependencies.prototype.addDependency = function (target, property) {\n if (this.target === target && this.property === property) return;\n if (this.dependencies.some(function (dependency) {\n return dependency.obj === target && dependency.prop === property;\n })) return;\n this.dependencies.push({\n obj: target,\n prop: property,\n id: this.id\n });\n target.registerPropertyChangedHandlers([property], this.currentDependency, this.id);\n };\n Dependencies.prototype.dispose = function () {\n this.dependencies.forEach(function (dependency) {\n dependency.obj.unregisterPropertyChangedHandlers([dependency.prop], dependency.id);\n });\n // this.currentDependency = undefined;\n };\n Dependencies.DependenciesCount = 0;\n return Dependencies;\n }();\n var ComputedUpdater = /** @class */function () {\n function ComputedUpdater(_updater) {\n this._updater = _updater;\n this.dependencies = undefined;\n this.type = ComputedUpdater.ComputedUpdaterType;\n }\n Object.defineProperty(ComputedUpdater.prototype, \"updater\", {\n get: function () {\n return this._updater;\n },\n enumerable: false,\n configurable: true\n });\n ComputedUpdater.prototype.setDependencies = function (dependencies) {\n this.clearDependencies();\n this.dependencies = dependencies;\n };\n ComputedUpdater.prototype.getDependencies = function () {\n return this.dependencies;\n };\n ComputedUpdater.prototype.clearDependencies = function () {\n if (this.dependencies) {\n this.dependencies.dispose();\n this.dependencies = undefined;\n }\n };\n ComputedUpdater.prototype.dispose = function () {\n this.clearDependencies();\n this._updater = undefined;\n };\n ComputedUpdater.ComputedUpdaterType = \"__dependency_computed\";\n return ComputedUpdater;\n }();\n\n /**\n * A base class for all SurveyJS objects.\n */\n var base_Base = /** @class */function () {\n function Base() {\n this.dependencies = {};\n this.propertyHash = Base.createPropertiesHash();\n this.eventList = [];\n this.isLoadingFromJsonValue = false;\n this.loadingOwner = null;\n /**\n * An event that is raised when a property of this SurveyJS object has changed.\n *\n * Parameters:\n *\n * - `sender`: `this`\\\n * A SurveyJS object whose property has changed.\n * - `options.name`: `string`\\\n * The name of the changed property.\n * - `options.newValue`: `any`\\\n * A new value for the property.\n * - `options.oldValue`: `any`\\\n * An old value of the property. If the property is an array, `oldValue` contains the same array as `newValue` does.\n *\n * If you need to add and remove property change event handlers dynamically, use the [`registerPropertyChangedHandlers`](#registerPropertyChangedHandlers) and [`unregisterPropertyChangedHandlers`](#unregisterPropertyChangedHandlers) methods instead.\n */\n this.onPropertyChanged = this.addEvent();\n /**\n * An event that is raised when an [`ItemValue`](https://surveyjs.io/form-library/documentation/itemvalue) property is changed.\n *\n * Parameters:\n *\n * - `sender`: `this`\\\n * A SurveyJS object whose property contains an array of `ItemValue` objects.\n * - `options.obj`: [`ItemValue`](https://surveyjs.io/form-library/documentation/itemvalue)\\\n * An `ItemValue` object.\n * - `options.propertyName`: `string`\\\n * The name of the property to which an array of `ItemValue` objects is assigned (for example, `\"choices\"` or `\"rows\"`).\n * - `options.name`: `\"text\"` | `\"value\"`\\\n * The name of the changed property.\n * - `options.newValue`: `any`\\\n * A new value for the property.\n */\n this.onItemValuePropertyChanged = this.addEvent();\n this.isCreating = true;\n this.animationAllowedLock = 0;\n //remove when knockout obsolete\n this.supportOnElementRerenderedEvent = true;\n this.onElementRerenderedEventEnabled = false;\n this._onElementRerendered = new EventBase();\n this.bindingsValue = new base_Bindings(this);\n CustomPropertiesCollection.createProperties(this);\n this.onBaseCreating();\n this.isCreating = false;\n }\n Base.finishCollectDependencies = function () {\n var deps = Base.currentDependencis;\n Base.currentDependencis = undefined;\n return deps;\n };\n Base.startCollectDependencies = function (updater, target, property) {\n if (Base.currentDependencis !== undefined) {\n throw new Error(\"Attempt to collect nested dependencies. Nested dependencies are not supported.\");\n }\n Base.currentDependencis = new Dependencies(updater, target, property);\n };\n Base.collectDependency = function (target, property) {\n if (Base.currentDependencis === undefined) return;\n Base.currentDependencis.addDependency(target, property);\n };\n Object.defineProperty(Base, \"commentSuffix\", {\n get: function () {\n return settings.commentSuffix;\n },\n set: function (val) {\n settings.commentSuffix = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Base, \"commentPrefix\", {\n get: function () {\n return Base.commentSuffix;\n },\n set: function (val) {\n Base.commentSuffix = val;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns `true` if a passed `value` is an empty string, array, or object or if it equals to `undefined` or `null`.\n *\n * @param value A value to be checked.\n * @param trimString *(Optional)* When this parameter is `true`, the method ignores whitespace characters at the beginning and end of a string value. Pass `false` to disable this functionality.\n */\n Base.prototype.isValueEmpty = function (value, trimString) {\n if (trimString === void 0) {\n trimString = true;\n }\n if (trimString) {\n value = this.trimValue(value);\n }\n return helpers_Helpers.isValueEmpty(value);\n };\n Base.prototype.equals = function (obj) {\n if (!obj) return false;\n if (this.isDisposed || obj.isDisposed) return false;\n if (this.getType() != obj.getType()) return false;\n return this.equalsCore(obj);\n };\n Base.prototype.equalsCore = function (obj) {\n if (this.name !== obj.name) return false;\n return helpers_Helpers.isTwoValueEquals(this.toJSON(), obj.toJSON(), false, true, false);\n };\n Base.prototype.trimValue = function (value) {\n if (!!value && (typeof value === \"string\" || value instanceof String)) return value.trim();\n return value;\n };\n Base.createPropertiesHash = function () {\n return {};\n };\n Base.prototype.dispose = function () {\n var _this = this;\n for (var i = 0; i < this.eventList.length; i++) {\n this.eventList[i].clear();\n }\n this.onPropertyValueChangedCallback = undefined;\n this.isDisposedValue = true;\n Object.keys(this.dependencies).forEach(function (key) {\n return _this.dependencies[key].dispose();\n });\n // this.dependencies = {};\n Object.keys(this.propertyHash).forEach(function (key) {\n var propVal = _this.getPropertyValueCore(_this.propertyHash, key);\n if (!!propVal && propVal.type == ComputedUpdater.ComputedUpdaterType) {\n propVal.dispose();\n }\n });\n };\n Object.defineProperty(Base.prototype, \"isDisposed\", {\n get: function () {\n return this.isDisposedValue === true;\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.addEvent = function () {\n var res = new EventBase();\n this.eventList.push(res);\n return res;\n };\n Base.prototype.onBaseCreating = function () {};\n /**\n * Returns the object type as it is used in the JSON schema.\n */\n Base.prototype.getType = function () {\n return \"base\";\n };\n /**\n * Use this method to find out if the current object is of a given `typeName` or inherited from it.\n *\n * @param typeName One of the values listed in the [getType()](https://surveyjs.io/form-library/documentation/question#getType) description.\n * @returns `true` if the current object is of a given `typeName` or inherited from it.\n * @see getType\n */\n Base.prototype.isDescendantOf = function (typeName) {\n return Serializer.isDescendantOf(this.getType(), typeName);\n };\n Base.prototype.getSurvey = function (isLive) {\n if (isLive === void 0) {\n isLive = false;\n }\n return null;\n };\n Object.defineProperty(Base.prototype, \"isDesignMode\", {\n /**\n * Returns `true` if the survey is being designed in Survey Creator.\n */\n get: function () {\n var survey = this.getSurvey();\n return !!survey && survey.isDesignMode;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Base.prototype, \"isDesignModeV2\", {\n get: function () {\n return settings.supportCreatorV2 && this.isDesignMode;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Base.prototype, \"inSurvey\", {\n /**\n * Returns `true` if the object is included in a survey.\n *\n * This property may return `false`, for example, when you [create a survey model dynamically](https://surveyjs.io/form-library/documentation/design-survey-create-a-simple-survey#create-or-change-a-survey-model-dynamically).\n */\n get: function () {\n return !!this.getSurvey(true);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Base.prototype, \"bindings\", {\n get: function () {\n return this.bindingsValue;\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.checkBindings = function (valueName, value) {};\n Base.prototype.updateBindings = function (propertyName, value) {\n var valueName = this.bindings.getValueNameByPropertyName(propertyName);\n if (!!valueName) {\n this.updateBindingValue(valueName, value);\n }\n };\n Base.prototype.updateBindingValue = function (valueName, value) {};\n Base.prototype.getTemplate = function () {\n return this.getType();\n };\n Object.defineProperty(Base.prototype, \"isLoadingFromJson\", {\n /**\n * Returns `true` if the object configuration is being loaded from JSON.\n */\n get: function () {\n return this.isLoadingFromJsonValue || this.getIsLoadingFromJson();\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.getIsLoadingFromJson = function () {\n if (!!this.loadingOwner && this.loadingOwner.isLoadingFromJson) return true;\n return this.isLoadingFromJsonValue;\n };\n Base.prototype.startLoadingFromJson = function (json) {\n this.isLoadingFromJsonValue = true;\n this.jsonObj = json;\n };\n Base.prototype.endLoadingFromJson = function () {\n this.isLoadingFromJsonValue = false;\n };\n /**\n * Returns a JSON object that corresponds to the current SurveyJS object.\n * @see fromJSON\n */\n Base.prototype.toJSON = function (options) {\n return new jsonobject_JsonObject().toJsonObject(this, options);\n };\n /**\n * Assigns a new configuration to the current SurveyJS object. This configuration is taken from a passed JSON object.\n *\n * The JSON object should contain only serializable properties of this SurveyJS object. Event handlers and properties that do not belong to the SurveyJS object are ignored.\n *\n * @param json A JSON object with properties that you want to apply to the current SurveyJS object.\n * @param options An object with configuration options.\n * @param {boolean} options.validatePropertyValues Pass `true` if you want to validate property values. Use the [`jsonErrors`](#jsonErrors) array to access validation errors.\n * @see toJSON\n */\n Base.prototype.fromJSON = function (json, options) {\n new jsonobject_JsonObject().toObject(json, this, options);\n this.onSurveyLoad();\n };\n Base.prototype.onSurveyLoad = function () {};\n /**\n * Creates a new object that has the same type and properties as the current SurveyJS object.\n */\n Base.prototype.clone = function () {\n var clonedObj = Serializer.createClass(this.getType());\n clonedObj.fromJSON(this.toJSON());\n return clonedObj;\n };\n /**\n * Returns a `JsonObjectProperty` object with metadata about a serializable property that belongs to the current SurveyJS object.\n *\n * If the property is not found, this method returns `null`.\n * @param propName A property name.\n */\n Base.prototype.getPropertyByName = function (propName) {\n var type = this.getType();\n if (!this.classMetaData || this.classMetaData.name !== type) {\n this.classMetaData = Serializer.findClass(type);\n }\n return !!this.classMetaData ? this.classMetaData.findProperty(propName) : null;\n };\n Base.prototype.isPropertyVisible = function (propName) {\n var prop = this.getPropertyByName(propName);\n return !!prop ? prop.isVisible(\"\", this) : false;\n };\n Base.createProgressInfo = function () {\n return {\n questionCount: 0,\n answeredQuestionCount: 0,\n requiredQuestionCount: 0,\n requiredAnsweredQuestionCount: 0\n };\n };\n Base.prototype.getProgressInfo = function () {\n return Base.createProgressInfo();\n };\n Base.prototype.localeChanged = function () {};\n Base.prototype.locStrsChanged = function () {\n if (!!this.arraysInfo) {\n for (var key in this.arraysInfo) {\n var item = this.arraysInfo[key];\n if (item && item.isItemValues) {\n var arr = this.getPropertyValue(key);\n if (arr && !!Base.itemValueLocStrChanged) Base.itemValueLocStrChanged(arr);\n }\n }\n }\n if (!!this.localizableStrings) {\n for (var key in this.localizableStrings) {\n var item = this.getLocalizableString(key);\n if (item) item.strChanged();\n }\n }\n };\n /**\n * Returns the value of a property with a specified name.\n *\n * If the property is not found or does not have a value, this method returns either `undefined`, `defaultValue` specified in the property configuration, or a value passed as the `defaultValue` parameter.\n *\n * @param name A property name.\n * @param defaultValue *(Optional)* A value to return if the property is not found or does not have a value.\n */\n Base.prototype.getPropertyValue = function (name, defaultValue, calcFunc) {\n var res = this.getPropertyValueWithoutDefault(name);\n if (this.isValueUndefined(res)) {\n var locStr = this.localizableStrings ? this.localizableStrings[name] : undefined;\n if (locStr) return locStr.text;\n if (!this.isValueUndefined(defaultValue)) return defaultValue;\n if (!!calcFunc) {\n var newVal = calcFunc();\n if (newVal !== undefined) {\n if (Array.isArray(newVal)) {\n var array = this.createNewArray(name);\n array.splice.apply(array, base_spreadArray([0, 0], newVal));\n return array;\n } else {\n this.setPropertyValueDirectly(name, newVal);\n return newVal;\n }\n }\n }\n var propDefaultValue = this.getDefaultPropertyValue(name);\n if (propDefaultValue !== undefined) return propDefaultValue;\n }\n return res;\n };\n Base.prototype.isValueUndefined = function (value) {\n return helpers_Helpers.isValueUndefined(value);\n };\n Base.prototype.getDefaultPropertyValue = function (name) {\n var prop = this.getPropertyByName(name);\n if (!prop || prop.isCustom && this.isCreating) return undefined;\n if (!!prop.defaultValueFunc) return prop.defaultValueFunc(this);\n var dValue = prop.getDefaultValue(this);\n if (!this.isValueUndefined(dValue) && !Array.isArray(dValue)) return dValue;\n var locStr = this.localizableStrings ? this.localizableStrings[name] : undefined;\n if (locStr && locStr.localizationName) return this.getLocalizationString(locStr.localizationName);\n if (prop.type == \"boolean\" || prop.type == \"switch\") return false;\n if (prop.isCustom && !!prop.onGetValue) return prop.onGetValue(this);\n return undefined;\n };\n Base.prototype.hasDefaultPropertyValue = function (name) {\n return this.getDefaultPropertyValue(name) !== undefined;\n };\n Base.prototype.resetPropertyValue = function (name) {\n var locStr = this.localizableStrings ? this.localizableStrings[name] : undefined;\n if (locStr) {\n this.setLocalizableStringText(name, undefined);\n locStr.clear();\n } else {\n this.setPropertyValue(name, undefined);\n }\n };\n Base.prototype.getPropertyValueWithoutDefault = function (name) {\n return this.getPropertyValueCore(this.propertyHash, name);\n };\n Base.prototype.getPropertyValueCore = function (propertiesHash, name) {\n if (!this.isLoadingFromJson) {\n Base.collectDependency(this, name);\n }\n if (this.getPropertyValueCoreHandler) return this.getPropertyValueCoreHandler(propertiesHash, name);else return propertiesHash[name];\n };\n Base.prototype.geValueFromHash = function () {\n return this.propertyHash[\"value\"];\n };\n Base.prototype.setPropertyValueCore = function (propertiesHash, name, val) {\n if (this.setPropertyValueCoreHandler) {\n if (!this.isDisposedValue) {\n this.setPropertyValueCoreHandler(propertiesHash, name, val);\n } else {\n ConsoleWarnings.disposedObjectChangedProperty(name, this.getType());\n }\n } else propertiesHash[name] = val;\n };\n Object.defineProperty(Base.prototype, \"isEditingSurveyElement\", {\n get: function () {\n var survey = this.getSurvey();\n return !!survey && survey.isEditingSurveyElement;\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.iteratePropertiesHash = function (func) {\n var _this = this;\n var keys = [];\n for (var key in this.propertyHash) {\n if (key === \"value\" && this.isEditingSurveyElement && Array.isArray(this.value)) continue;\n keys.push(key);\n }\n keys.forEach(function (key) {\n return func(_this.propertyHash, key);\n });\n };\n /**\n * Assigns a new value to a specified property.\n * @param name A property name.\n * @param val A new value for the property.\n */\n Base.prototype.setPropertyValue = function (name, val) {\n if (this.isDisposedValue) return;\n if (!this.isLoadingFromJson) {\n var prop = this.getPropertyByName(name);\n if (!!prop) {\n val = prop.settingValue(this, val);\n }\n }\n var oldValue = this.getPropertyValue(name);\n if (oldValue && Array.isArray(oldValue) && !!this.arraysInfo && (!val || Array.isArray(val))) {\n if (!this.isTwoValueEquals(oldValue, val)) {\n this.setArrayPropertyDirectly(name, val);\n }\n } else {\n if (val !== oldValue) {\n this.setPropertyValueDirectly(name, val);\n if (!this.isTwoValueEquals(oldValue, val)) {\n this.propertyValueChanged(name, oldValue, val);\n }\n }\n }\n };\n Base.prototype.setArrayPropertyDirectly = function (name, val, sendNotification) {\n if (sendNotification === void 0) {\n sendNotification = true;\n }\n var arrayInfo = this.arraysInfo[name];\n this.setArray(name, this.getPropertyValue(name), val, arrayInfo ? arrayInfo.isItemValues : false, arrayInfo ? sendNotification && arrayInfo.onPush : null);\n };\n Base.prototype.setPropertyValueDirectly = function (name, val) {\n this.setPropertyValueCore(this.propertyHash, name, val);\n };\n Base.prototype.clearPropertyValue = function (name) {\n this.setPropertyValueCore(this.propertyHash, name, null);\n delete this.propertyHash[name];\n };\n Base.prototype.onPropertyValueChangedCallback = function (name, oldValue, newValue, sender, arrayChanges) {};\n Base.prototype.itemValuePropertyChanged = function (item, name, oldValue, newValue) {\n this.onItemValuePropertyChanged.fire(this, {\n obj: item,\n name: name,\n oldValue: oldValue,\n newValue: newValue,\n propertyName: item.ownerPropertyName\n });\n };\n Base.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {};\n Base.prototype.propertyValueChanged = function (name, oldValue, newValue, arrayChanges, target) {\n if (this.isLoadingFromJson) return;\n this.updateBindings(name, newValue);\n this.onPropertyValueChanged(name, oldValue, newValue);\n this.onPropertyChanged.fire(this, {\n name: name,\n oldValue: oldValue,\n newValue: newValue,\n arrayChanges: arrayChanges,\n target: target\n });\n this.doPropertyValueChangedCallback(name, oldValue, newValue, arrayChanges, this);\n this.checkConditionPropertyChanged(name);\n if (!this.onPropChangeFunctions) return;\n for (var i = 0; i < this.onPropChangeFunctions.length; i++) {\n if (this.onPropChangeFunctions[i].name == name) this.onPropChangeFunctions[i].func(newValue, arrayChanges);\n }\n };\n Base.prototype.onBindingChanged = function (oldValue, newValue) {\n if (this.isLoadingFromJson) return;\n this.doPropertyValueChangedCallback(\"bindings\", oldValue, newValue);\n };\n Object.defineProperty(Base.prototype, \"isInternal\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.doPropertyValueChangedCallback = function (name, oldValue, newValue, arrayChanges, target) {\n var fireCallback = function (obj) {\n if (!!obj && !!obj.onPropertyValueChangedCallback) {\n obj.onPropertyValueChangedCallback(name, oldValue, newValue, target, arrayChanges);\n }\n };\n if (this.isInternal) {\n fireCallback(this);\n return;\n }\n if (!target) target = this;\n var notifier = this.getSurvey();\n if (!notifier) notifier = this;\n fireCallback(notifier);\n if (notifier !== this) {\n fireCallback(this);\n }\n };\n Base.prototype.addExpressionProperty = function (name, onExecute, canRun) {\n if (!this.expressionInfo) {\n this.expressionInfo = {};\n }\n this.expressionInfo[name] = {\n onExecute: onExecute,\n canRun: canRun\n };\n };\n Base.prototype.getDataFilteredValues = function () {\n return {};\n };\n Base.prototype.getDataFilteredProperties = function () {\n return {};\n };\n Base.prototype.runConditionCore = function (values, properties) {\n if (!this.expressionInfo) return;\n for (var key in this.expressionInfo) {\n this.runConditionItemCore(key, values, properties);\n }\n };\n Base.prototype.canRunConditions = function () {\n return !this.isDesignMode;\n };\n Base.prototype.checkConditionPropertyChanged = function (propName) {\n if (!this.expressionInfo || !this.expressionInfo[propName]) return;\n if (!this.canRunConditions()) return;\n this.runConditionItemCore(propName, this.getDataFilteredValues(), this.getDataFilteredProperties());\n };\n Base.prototype.runConditionItemCore = function (propName, values, properties) {\n var _this = this;\n var info = this.expressionInfo[propName];\n var expression = this.getPropertyValue(propName);\n if (!expression) return;\n if (!!info.canRun && !info.canRun(this)) return;\n if (!info.runner) {\n info.runner = this.createExpressionRunner(expression);\n info.runner.onRunComplete = function (res) {\n info.onExecute(_this, res);\n };\n }\n info.runner.expression = expression;\n info.runner.run(values, properties);\n };\n Base.prototype.doBeforeAsynRun = function (id) {\n if (!this.asynExpressionHash) this.asynExpressionHash = {};\n var isChanged = !this.isAsyncExpressionRunning;\n this.asynExpressionHash[id] = true;\n if (isChanged) {\n this.onAsyncRunningChanged();\n }\n };\n Base.prototype.doAfterAsynRun = function (id) {\n if (!!this.asynExpressionHash) {\n delete this.asynExpressionHash[id];\n if (!this.isAsyncExpressionRunning) {\n this.onAsyncRunningChanged();\n }\n }\n };\n Base.prototype.onAsyncRunningChanged = function () {};\n Object.defineProperty(Base.prototype, \"isAsyncExpressionRunning\", {\n get: function () {\n return !!this.asynExpressionHash && Object.keys(this.asynExpressionHash).length > 0;\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.createExpressionRunner = function (expression) {\n var _this = this;\n var res = new ExpressionRunner(expression);\n res.onBeforeAsyncRun = function (id) {\n _this.doBeforeAsynRun(id);\n };\n res.onAfterAsyncRun = function (id) {\n _this.doAfterAsynRun(id);\n };\n return res;\n };\n /**\n * Registers a single value change handler for one or multiple properties.\n *\n * The `registerPropertyChangedHandlers` and [`unregisterPropertyChangedHandlers`](#unregisterPropertyChangedHandlers) methods allow you to manage property change event handlers dynamically. If you only need to attach an event handler without removing it afterwards, you can use the [`onPropertyChanged`](#onPropertyChanged) event instead.\n * @param propertyNames An array of one or multiple property names.\n * @param handler A function to call when one of the listed properties change. Accepts a new property value as an argument.\n * @param key *(Optional)* A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.\n * @see unregisterPropertyChangedHandlers\n */\n Base.prototype.registerPropertyChangedHandlers = function (propertyNames, handler, key) {\n if (key === void 0) {\n key = null;\n }\n for (var i = 0; i < propertyNames.length; i++) {\n this.registerFunctionOnPropertyValueChanged(propertyNames[i], handler, key);\n }\n };\n /**\n * Unregisters value change event handlers for the specified properties.\n * @param propertyNames An array of one or multiple property names.\n * @param key *(Optional)* A key of the registration that you want to cancel.\n * @see registerPropertyChangedHandlers\n */\n Base.prototype.unregisterPropertyChangedHandlers = function (propertyNames, key) {\n if (key === void 0) {\n key = null;\n }\n for (var i = 0; i < propertyNames.length; i++) {\n this.unRegisterFunctionOnPropertyValueChanged(propertyNames[i], key);\n }\n };\n Base.prototype.registerFunctionOnPropertyValueChanged = function (name, func, key) {\n if (key === void 0) {\n key = null;\n }\n if (!this.onPropChangeFunctions) {\n this.onPropChangeFunctions = [];\n }\n if (key) {\n for (var i = 0; i < this.onPropChangeFunctions.length; i++) {\n var item = this.onPropChangeFunctions[i];\n if (item.name == name && item.key == key) {\n item.func = func;\n return;\n }\n }\n }\n this.onPropChangeFunctions.push({\n name: name,\n func: func,\n key: key\n });\n };\n Base.prototype.registerFunctionOnPropertiesValueChanged = function (names, func, key) {\n if (key === void 0) {\n key = null;\n }\n this.registerPropertyChangedHandlers(names, func, key);\n };\n Base.prototype.unRegisterFunctionOnPropertyValueChanged = function (name, key) {\n if (key === void 0) {\n key = null;\n }\n if (!this.onPropChangeFunctions) return;\n for (var i = 0; i < this.onPropChangeFunctions.length; i++) {\n var item = this.onPropChangeFunctions[i];\n if (item.name == name && item.key == key) {\n this.onPropChangeFunctions.splice(i, 1);\n return;\n }\n }\n };\n Base.prototype.unRegisterFunctionOnPropertiesValueChanged = function (names, key) {\n if (key === void 0) {\n key = null;\n }\n this.unregisterPropertyChangedHandlers(names, key);\n };\n Base.prototype.createCustomLocalizableObj = function (name) {\n var locStr = this.getLocalizableString(name);\n if (locStr) return locStr;\n return this.createLocalizableString(name, this, false, true);\n };\n Base.prototype.getLocale = function () {\n var locOwner = this.getSurvey();\n return !!locOwner ? locOwner.getLocale() : \"\";\n };\n Base.prototype.getLocalizationString = function (strName) {\n return getLocaleString(strName, this.getLocale());\n };\n Base.prototype.getLocalizationFormatString = function (strName) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var str = this.getLocalizationString(strName);\n if (!str || !str.format) return \"\";\n return str.format.apply(str, args);\n };\n Base.prototype.createLocalizableString = function (name, owner, useMarkDown, defaultStr) {\n var _this = this;\n if (useMarkDown === void 0) {\n useMarkDown = false;\n }\n if (defaultStr === void 0) {\n defaultStr = false;\n }\n var locName = undefined;\n if (defaultStr) {\n locName = defaultStr === true ? name : defaultStr;\n }\n var locStr = new localizablestring_LocalizableString(owner, useMarkDown, name, locName);\n locStr.onStrChanged = function (oldValue, newValue) {\n _this.propertyValueChanged(name, oldValue, newValue);\n };\n if (!this.localizableStrings) {\n this.localizableStrings = {};\n }\n this.localizableStrings[name] = locStr;\n var prop = this.getPropertyByName(name);\n locStr.disableLocalization = prop && prop.isLocalizable === false;\n return locStr;\n };\n Base.prototype.getLocalizableString = function (name) {\n return !!this.localizableStrings ? this.localizableStrings[name] : null;\n };\n Base.prototype.getLocalizableStringText = function (name, defaultStr) {\n if (defaultStr === void 0) {\n defaultStr = \"\";\n }\n Base.collectDependency(this, name);\n var locStr = this.getLocalizableString(name);\n if (!locStr) return \"\";\n var res = locStr.text;\n return res ? res : defaultStr;\n };\n Base.prototype.setLocalizableStringText = function (name, value) {\n var locStr = this.getLocalizableString(name);\n if (!locStr) return;\n var oldValue = locStr.text;\n if (oldValue != value) {\n locStr.text = value;\n // this.propertyValueChanged(name, oldValue, value);\n }\n };\n Base.prototype.addUsedLocales = function (locales) {\n if (!!this.localizableStrings) {\n for (var key in this.localizableStrings) {\n var item = this.getLocalizableString(key);\n if (item) this.AddLocStringToUsedLocales(item, locales);\n }\n }\n if (!!this.arraysInfo) {\n for (var key in this.arraysInfo) {\n var prop = this.getPropertyByName(key);\n if (!prop || !prop.isSerializable) continue;\n var items = this.getPropertyValue(key);\n if (!items || !items.length) continue;\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (item && item.addUsedLocales) {\n item.addUsedLocales(locales);\n }\n }\n }\n }\n };\n Base.prototype.searchText = function (text, founded) {\n var strs = [];\n this.getSearchableLocalizedStrings(strs);\n for (var i = 0; i < strs.length; i++) {\n if (strs[i].setFindText(text)) {\n founded.push({\n element: this,\n str: strs[i]\n });\n }\n }\n };\n Base.prototype.getSearchableLocalizedStrings = function (arr) {\n if (!!this.localizableStrings) {\n var keys_1 = [];\n this.getSearchableLocKeys(keys_1);\n for (var i = 0; i < keys_1.length; i++) {\n var item = this.getLocalizableString(keys_1[i]);\n if (item) arr.push(item);\n }\n }\n if (!this.arraysInfo) return;\n var keys = [];\n this.getSearchableItemValueKeys(keys);\n for (var i = 0; i < keys.length; i++) {\n var items = this.getPropertyValue(keys[i]);\n if (!items) continue;\n for (var j = 0; j < items.length; j++) {\n arr.push(items[j].locText);\n }\n }\n };\n Base.prototype.getSearchableLocKeys = function (keys) {};\n Base.prototype.getSearchableItemValueKeys = function (keys) {};\n Base.prototype.AddLocStringToUsedLocales = function (locStr, locales) {\n var locs = locStr.getLocales();\n for (var i = 0; i < locs.length; i++) {\n if (locales.indexOf(locs[i]) < 0) {\n locales.push(locs[i]);\n }\n }\n };\n Base.prototype.createItemValues = function (name) {\n var self = this;\n var result = this.createNewArray(name, function (item) {\n item.locOwner = self;\n item.ownerPropertyName = name;\n if (typeof item.getSurvey == \"function\") {\n var survey = item.getSurvey();\n if (!!survey && typeof survey.makeReactive == \"function\") {\n survey.makeReactive(item);\n }\n }\n });\n this.arraysInfo[name].isItemValues = true;\n return result;\n };\n Base.prototype.notifyArrayChanged = function (ar, arrayChanges) {\n !!ar.onArrayChanged && ar.onArrayChanged(arrayChanges);\n };\n Base.prototype.createNewArrayCore = function (name) {\n var res = null;\n if (!!this.createArrayCoreHandler) {\n res = this.createArrayCoreHandler(this.propertyHash, name);\n }\n if (!res) {\n res = new Array();\n this.setPropertyValueCore(this.propertyHash, name, res);\n }\n return res;\n };\n Base.prototype.ensureArray = function (name, onPush, onRemove) {\n if (onPush === void 0) {\n onPush = null;\n }\n if (onRemove === void 0) {\n onRemove = null;\n }\n if (this.arraysInfo && this.arraysInfo[name]) {\n return;\n }\n return this.createNewArray(name, onPush, onRemove);\n };\n Base.prototype.createNewArray = function (name, onPush, onRemove) {\n if (onPush === void 0) {\n onPush = null;\n }\n if (onRemove === void 0) {\n onRemove = null;\n }\n var newArray = this.createNewArrayCore(name);\n if (!this.arraysInfo) {\n this.arraysInfo = {};\n }\n this.arraysInfo[name] = {\n onPush: onPush,\n isItemValues: false\n };\n var self = this;\n newArray.push = function (value) {\n var result = Object.getPrototypeOf(newArray).push.call(newArray, value);\n if (!self.isDisposedValue) {\n if (onPush) onPush(value, newArray.length - 1);\n var arrayChanges = new ArrayChanges(newArray.length - 1, 0, [value], []);\n self.propertyValueChanged(name, newArray, newArray, arrayChanges);\n self.notifyArrayChanged(newArray, arrayChanges);\n }\n return result;\n };\n newArray.shift = function () {\n var result = Object.getPrototypeOf(newArray).shift.call(newArray);\n if (!self.isDisposedValue && result) {\n if (onRemove) onRemove(result);\n var arrayChanges = new ArrayChanges(newArray.length - 1, 1, [], []);\n self.propertyValueChanged(name, newArray, newArray, arrayChanges);\n self.notifyArrayChanged(newArray, arrayChanges);\n }\n return result;\n };\n newArray.unshift = function (value) {\n var result = Object.getPrototypeOf(newArray).unshift.call(newArray, value);\n if (!self.isDisposedValue) {\n if (onPush) onPush(value, newArray.length - 1);\n var arrayChanges = new ArrayChanges(0, 0, [value], []);\n self.propertyValueChanged(name, newArray, newArray, arrayChanges);\n self.notifyArrayChanged(newArray, arrayChanges);\n }\n return result;\n };\n newArray.pop = function () {\n var result = Object.getPrototypeOf(newArray).pop.call(newArray);\n if (!self.isDisposedValue) {\n if (onRemove) onRemove(result);\n var arrayChanges = new ArrayChanges(newArray.length - 1, 1, [], []);\n self.propertyValueChanged(name, newArray, newArray, arrayChanges);\n self.notifyArrayChanged(newArray, arrayChanges);\n }\n return result;\n };\n newArray.splice = function (start, deleteCount) {\n var _a;\n var items = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n items[_i - 2] = arguments[_i];\n }\n if (!start) start = 0;\n if (!deleteCount) deleteCount = 0;\n var result = (_a = Object.getPrototypeOf(newArray).splice).call.apply(_a, base_spreadArray([newArray, start, deleteCount], items));\n if (!items) items = [];\n if (!self.isDisposedValue) {\n if (onRemove && result) {\n for (var i = 0; i < result.length; i++) {\n onRemove(result[i]);\n }\n }\n if (onPush) {\n for (var i = 0; i < items.length; i++) {\n onPush(items[i], start + i);\n }\n }\n var arrayChanges = new ArrayChanges(start, deleteCount, items, result);\n self.propertyValueChanged(name, newArray, newArray, arrayChanges);\n self.notifyArrayChanged(newArray, arrayChanges);\n }\n return result;\n };\n return newArray;\n };\n Base.prototype.getItemValueType = function () {\n return undefined;\n };\n Base.prototype.setArray = function (name, src, dest, isItemValues, onPush) {\n var deletedItems = [].concat(src);\n Object.getPrototypeOf(src).splice.call(src, 0, src.length);\n if (!!dest) {\n for (var i = 0; i < dest.length; i++) {\n var item = dest[i];\n if (isItemValues) {\n if (!!Base.createItemValue) {\n item = Base.createItemValue(item, this.getItemValueType());\n }\n }\n Object.getPrototypeOf(src).push.call(src, item);\n if (onPush) onPush(src[i]);\n }\n }\n var arrayChanges = new ArrayChanges(0, deletedItems.length, src, deletedItems);\n this.propertyValueChanged(name, deletedItems, src, arrayChanges);\n this.notifyArrayChanged(src, arrayChanges);\n };\n Base.prototype.isTwoValueEquals = function (x, y, caseInSensitive, trimString) {\n if (caseInSensitive === void 0) {\n caseInSensitive = false;\n }\n if (trimString === void 0) {\n trimString = false;\n }\n return helpers_Helpers.isTwoValueEquals(x, y, false, !caseInSensitive, trimString);\n };\n Base.copyObject = function (dst, src) {\n for (var key in src) {\n var source = src[key];\n if (typeof source === \"object\") {\n source = {};\n this.copyObject(source, src[key]);\n }\n dst[key] = source;\n }\n };\n Base.prototype.copyCssClasses = function (dest, source) {\n if (!source) return;\n if (typeof source === \"string\" || source instanceof String) {\n dest[\"root\"] = source;\n } else {\n Base.copyObject(dest, source);\n }\n };\n Base.prototype.getValueInLowCase = function (val) {\n if (!!val && typeof val == \"string\") return val.toLowerCase();\n return val;\n };\n Base.prototype.getElementsInDesign = function (includeHidden) {\n if (includeHidden === void 0) {\n includeHidden = false;\n }\n return [];\n };\n Object.defineProperty(Base.prototype, \"animationAllowed\", {\n get: function () {\n return this.getIsAnimationAllowed();\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.getIsAnimationAllowed = function () {\n return settings.animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed && (!!this.onElementRerendered || !this.supportOnElementRerenderedEvent);\n };\n Base.prototype.blockAnimations = function () {\n this.animationAllowedLock--;\n };\n Base.prototype.releaseAnimations = function () {\n this.animationAllowedLock++;\n };\n Base.prototype.enableOnElementRerenderedEvent = function () {\n this.onElementRerenderedEventEnabled = true;\n };\n Base.prototype.disableOnElementRerenderedEvent = function () {\n var _a;\n (_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this, {\n isCancel: true\n });\n this.onElementRerenderedEventEnabled = false;\n };\n Object.defineProperty(Base.prototype, \"onElementRerendered\", {\n get: function () {\n return this.supportOnElementRerenderedEvent && this.onElementRerenderedEventEnabled ? this._onElementRerendered : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Base.prototype.afterRerender = function () {\n var _a;\n (_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this, {\n isCancel: false\n });\n };\n Base.currentDependencis = undefined;\n return Base;\n }();\n var ArrayChanges = /** @class */function () {\n function ArrayChanges(index, deleteCount, itemsToAdd, deletedItems) {\n this.index = index;\n this.deleteCount = deleteCount;\n this.itemsToAdd = itemsToAdd;\n this.deletedItems = deletedItems;\n }\n return ArrayChanges;\n }();\n var Event = /** @class */function () {\n function Event() {}\n Object.defineProperty(Event.prototype, \"isEmpty\", {\n get: function () {\n return this.length === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Event.prototype, \"length\", {\n get: function () {\n return !!this.callbacks ? this.callbacks.length : 0;\n },\n enumerable: false,\n configurable: true\n });\n Event.prototype.fireByCreatingOptions = function (sender, createOptions) {\n if (!this.callbacks) return;\n for (var i = 0; i < this.callbacks.length; i++) {\n this.callbacks[i](sender, createOptions());\n if (!this.callbacks) return;\n }\n };\n Event.prototype.fire = function (sender, options) {\n if (!this.callbacks) return;\n var callbacks = [].concat(this.callbacks);\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i](sender, options);\n if (!this.callbacks) return;\n }\n };\n Event.prototype.clear = function () {\n this.callbacks = undefined;\n };\n Event.prototype.add = function (func) {\n if (this.hasFunc(func)) return;\n if (!this.callbacks) {\n this.callbacks = new Array();\n }\n this.callbacks.push(func);\n this.fireCallbackChanged();\n };\n Event.prototype.remove = function (func) {\n if (this.hasFunc(func)) {\n var index = this.callbacks.indexOf(func, 0);\n this.callbacks.splice(index, 1);\n this.fireCallbackChanged();\n }\n };\n Event.prototype.hasFunc = function (func) {\n if (this.callbacks == null) return false;\n return this.callbacks.indexOf(func, 0) > -1;\n };\n Event.prototype.fireCallbackChanged = function () {\n if (!!this.onCallbacksChanged) {\n this.onCallbacksChanged();\n }\n };\n return Event;\n }();\n var EventBase = /** @class */function (_super) {\n base_extends(EventBase, _super);\n function EventBase() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return EventBase;\n }(Event);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/utils/responsivity-manager.ts\n var responsivity_manager_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var responsivity_manager_ResponsivityManager = /** @class */function () {\n function ResponsivityManager(container, model, itemsSelector, dotsItemSize, delayedUpdateFunction) {\n var _this = this;\n if (dotsItemSize === void 0) {\n dotsItemSize = null;\n }\n if (delayedUpdateFunction === void 0) {\n delayedUpdateFunction = function (callback) {\n if (queueMicrotask) queueMicrotask(callback);else callback();\n };\n }\n this.container = container;\n this.model = model;\n this.itemsSelector = itemsSelector;\n this.dotsItemSize = dotsItemSize;\n this.delayedUpdateFunction = delayedUpdateFunction;\n this.resizeObserver = undefined;\n this.isInitialized = false;\n this.minDimensionConst = 56;\n this.separatorSize = 17;\n this.separatorAddConst = 1;\n this.paddingSizeConst = 8;\n this.dotsSizeConst = 48;\n this.dotsIconClass = \".sv-dots\";\n this.iconClass = \".sv-svg-icon\";\n this.recalcMinDimensionConst = true;\n this.getComputedStyle = function (elt) {\n return DomDocumentHelper.getComputedStyle(elt);\n };\n this.model.updateCallback = function (isResetInitialized) {\n if (isResetInitialized) {\n _this.isInitialized = false;\n }\n setTimeout(function () {\n _this.process();\n }, 1);\n };\n if (typeof ResizeObserver !== \"undefined\") {\n this.resizeObserver = new ResizeObserver(function (entries) {\n DomWindowHelper.requestAnimationFrame(function () {\n _this.process();\n });\n });\n this.resizeObserver.observe(this.container.parentElement);\n }\n }\n ResponsivityManager.prototype.getDimensions = function (element) {\n return {\n scroll: element.scrollWidth,\n offset: element.offsetWidth\n };\n };\n ResponsivityManager.prototype.getAvailableSpace = function () {\n var style = this.getComputedStyle(this.container);\n var space = this.container.offsetWidth;\n if (style.boxSizing === \"border-box\") {\n space -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n }\n return space;\n };\n ResponsivityManager.prototype.calcItemSize = function (item) {\n return item.offsetWidth || item.getBoundingClientRect().width;\n };\n ResponsivityManager.prototype.calcMinDimension = function (currentAction, item) {\n var iconSize;\n if (!!item && (!currentAction.iconSize || currentAction.iconSize === \"auto\")) {\n var iconElement = item.querySelector(this.iconClass);\n iconSize = iconElement && this.calcItemSize(iconElement);\n } else if (currentAction.iconSize && typeof currentAction.iconSize === \"number\" && this.recalcMinDimensionConst) {\n iconSize = currentAction.iconSize;\n }\n var minDimensionConst = !!iconSize ? iconSize + 2 * this.paddingSizeConst : this.minDimensionConst;\n return currentAction.canShrink ? minDimensionConst + (currentAction.needSeparator ? this.separatorSize : 0) : currentAction.maxDimension;\n };\n ResponsivityManager.prototype.calcItemsSizes = function () {\n var _this = this;\n if (!this.container || this.isInitialized) return;\n var actions = this.model.actions;\n var _items = this.container.querySelectorAll(this.itemsSelector);\n (_items || []).forEach(function (item, index) {\n var currentAction = actions[index];\n if (!!currentAction) {\n _this.calcActionDimensions(currentAction, item);\n }\n });\n };\n ResponsivityManager.prototype.calcActionDimensions = function (currentAction, item) {\n currentAction.maxDimension = this.calcItemSize(item);\n currentAction.minDimension = this.calcMinDimension(currentAction, item);\n };\n Object.defineProperty(ResponsivityManager.prototype, \"isContainerVisible\", {\n get: function () {\n return !!this.container && isContainerVisible(this.container);\n },\n enumerable: false,\n configurable: true\n });\n ResponsivityManager.prototype.process = function () {\n var _this = this;\n if (this.isContainerVisible && !this.model.isResponsivenessDisabled) {\n if (!this.isInitialized) {\n this.model.setActionsMode(\"large\");\n }\n var processResponsiveness_1 = function () {\n var _a;\n var dotsItemSize = _this.dotsItemSize;\n if (!_this.dotsItemSize) {\n var dotsItemElement = (_a = _this.container) === null || _a === void 0 ? void 0 : _a.querySelector(_this.dotsIconClass);\n dotsItemSize = dotsItemElement && _this.calcItemSize(dotsItemElement) || _this.dotsSizeConst;\n }\n _this.model.fit(_this.getAvailableSpace(), dotsItemSize);\n };\n if (!this.isInitialized) {\n var callback = function () {\n if (!_this.container) {\n return;\n }\n _this.calcItemsSizes();\n _this.isInitialized = true;\n processResponsiveness_1();\n };\n if (this.delayedUpdateFunction) {\n this.delayedUpdateFunction(callback);\n } else {\n callback();\n }\n } else {\n processResponsiveness_1();\n }\n }\n };\n ResponsivityManager.prototype.dispose = function () {\n this.model.updateCallback = undefined;\n if (!!this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n this.resizeObserver = undefined;\n this.container = undefined;\n };\n return ResponsivityManager;\n }();\n var VerticalResponsivityManager = /** @class */function (_super) {\n responsivity_manager_extends(VerticalResponsivityManager, _super);\n function VerticalResponsivityManager(container, model, itemsSelector, dotsItemSize, minDimension, delayedUpdateFunction) {\n if (minDimension === void 0) {\n minDimension = 40;\n }\n var _this = _super.call(this, container, model, itemsSelector, dotsItemSize, delayedUpdateFunction) || this;\n _this.minDimensionConst = minDimension;\n _this.recalcMinDimensionConst = false;\n return _this;\n }\n VerticalResponsivityManager.prototype.getDimensions = function () {\n return {\n scroll: this.container.scrollHeight,\n offset: this.container.offsetHeight\n };\n };\n VerticalResponsivityManager.prototype.getAvailableSpace = function () {\n var style = this.getComputedStyle(this.container);\n var space = this.container.offsetHeight;\n if (style.boxSizing === \"border-box\") {\n space -= parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n }\n return space;\n };\n VerticalResponsivityManager.prototype.calcItemSize = function (item) {\n return item.offsetHeight;\n };\n VerticalResponsivityManager.prototype.calcActionDimensions = function (currentAction, item) {\n currentAction.maxDimension = this.calcItemSize(item);\n currentAction.minDimension = this.calcItemSize(item);\n };\n return VerticalResponsivityManager;\n }(responsivity_manager_ResponsivityManager);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/utils/cssClassBuilder.ts\n var CssClassBuilder = /** @class */function () {\n function CssClassBuilder() {\n this.classes = [];\n }\n CssClassBuilder.prototype.isEmpty = function () {\n return this.toString() === \"\";\n };\n CssClassBuilder.prototype.append = function (value, condition) {\n if (condition === void 0) {\n condition = true;\n }\n if (!!value && condition) {\n if (typeof value === \"string\") {\n value = value.trim();\n }\n this.classes.push(value);\n }\n return this;\n };\n CssClassBuilder.prototype.toString = function () {\n return this.classes.join(\" \");\n };\n return CssClassBuilder;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/actions/container.ts\n var container_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n var defaultActionBarCss = {\n root: \"sv-action-bar\",\n defaultSizeMode: \"sv-action-bar--default-size-mode\",\n smallSizeMode: \"sv-action-bar--small-size-mode\",\n item: \"sv-action-bar-item\",\n itemWithTitle: \"\",\n itemAsIcon: \"sv-action-bar-item--icon\",\n itemActive: \"sv-action-bar-item--active\",\n itemPressed: \"sv-action-bar-item--pressed\",\n itemIcon: \"sv-action-bar-item__icon\",\n itemTitle: \"sv-action-bar-item__title\",\n itemTitleWithIcon: \"sv-action-bar-item__title--with-icon\"\n };\n var container_ActionContainer = /** @class */function (_super) {\n container_extends(ActionContainer, _super);\n function ActionContainer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.sizeMode = \"default\";\n return _this;\n }\n ActionContainer.prototype.getMarkdownHtml = function (text, name) {\n return !!this.locOwner ? this.locOwner.getMarkdownHtml(text, name) : undefined;\n };\n ActionContainer.prototype.getRenderer = function (name) {\n return !!this.locOwner ? this.locOwner.getRenderer(name) : null;\n };\n ActionContainer.prototype.getRendererContext = function (locStr) {\n return !!this.locOwner ? this.locOwner.getRendererContext(locStr) : locStr;\n };\n ActionContainer.prototype.getProcessedText = function (text) {\n return this.locOwner ? this.locOwner.getProcessedText(text) : text;\n };\n ActionContainer.prototype.getLocale = function () {\n return !!this.locOwner ? this.locOwner.getLocale() : \"\";\n };\n ActionContainer.prototype.getRenderedActions = function () {\n return this.actions;\n };\n ActionContainer.prototype.locStrsChanged = function () {\n _super.prototype.locStrsChanged.call(this);\n this.actions.forEach(function (item) {\n if (item.locTitle) item.locTitle.strChanged();\n item.locStrsChanged();\n });\n };\n ActionContainer.prototype.raiseUpdate = function (isResetInitialized) {\n this.isEmpty = !this.actions.some(function (action) {\n return action.visible;\n });\n this.updateCallback && this.updateCallback(isResetInitialized);\n };\n ActionContainer.prototype.onSet = function () {\n var _this = this;\n this.actions.forEach(function (item) {\n _this.setActionCssClasses(item);\n });\n this.raiseUpdate(true);\n };\n ActionContainer.prototype.onPush = function (item) {\n this.setActionCssClasses(item);\n item.owner = this;\n this.raiseUpdate(true);\n };\n ActionContainer.prototype.onRemove = function (item) {\n item.owner = null;\n this.raiseUpdate(true);\n };\n ActionContainer.prototype.setActionCssClasses = function (item) {\n item.cssClasses = this.cssClasses;\n };\n Object.defineProperty(ActionContainer.prototype, \"hasActions\", {\n get: function () {\n return (this.actions || []).length > 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ActionContainer.prototype, \"renderedActions\", {\n get: function () {\n return this.getRenderedActions();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ActionContainer.prototype, \"visibleActions\", {\n get: function () {\n return this.actions.filter(function (action) {\n return action.visible !== false;\n });\n },\n enumerable: false,\n configurable: true\n });\n ActionContainer.prototype.getRootCss = function () {\n var sizeModeClass = this.sizeMode === \"small\" ? this.cssClasses.smallSizeMode : this.cssClasses.defaultSizeMode;\n return new CssClassBuilder().append(this.cssClasses.root + (!!sizeModeClass ? \" \" + sizeModeClass : \"\") + (!!this.containerCss ? \" \" + this.containerCss : \"\")).append(this.cssClasses.root + \"--empty\", this.isEmpty).toString();\n };\n ActionContainer.prototype.getDefaultCssClasses = function () {\n return defaultActionBarCss;\n };\n Object.defineProperty(ActionContainer.prototype, \"cssClasses\", {\n get: function () {\n if (!this.cssClassesValue) {\n this.cssClassesValue = this.getDefaultCssClasses();\n }\n return this.cssClassesValue;\n },\n set: function (val) {\n var _this = this;\n this.cssClassesValue = {};\n this.copyCssClasses(this.cssClassesValue, this.getDefaultCssClasses());\n mergeValues(val, this.cssClasses);\n this.actions.forEach(function (action) {\n _this.setActionCssClasses(action);\n });\n },\n enumerable: false,\n configurable: true\n });\n ActionContainer.prototype.createAction = function (item) {\n return item instanceof action_BaseAction ? item : new action_Action(item);\n };\n ActionContainer.prototype.addAction = function (val, sortByVisibleIndex) {\n if (sortByVisibleIndex === void 0) {\n sortByVisibleIndex = true;\n }\n var res = this.createAction(val);\n if (sortByVisibleIndex && !this.isActionVisible(res)) return res;\n var items = [].concat(this.actions, res);\n this.sortItems(items);\n this.actions = items;\n return res;\n };\n ActionContainer.prototype.setItems = function (items, sortByVisibleIndex) {\n var _this = this;\n if (sortByVisibleIndex === void 0) {\n sortByVisibleIndex = true;\n }\n var newActions = [];\n items.forEach(function (item) {\n if (!sortByVisibleIndex || _this.isActionVisible(item)) {\n newActions.push(_this.createAction(item));\n }\n });\n if (sortByVisibleIndex) {\n this.sortItems(newActions);\n }\n this.actions = newActions;\n };\n ActionContainer.prototype.sortItems = function (items) {\n if (this.hasSetVisibleIndex(items)) {\n items.sort(this.compareByVisibleIndex);\n }\n };\n ActionContainer.prototype.hasSetVisibleIndex = function (items) {\n for (var i = 0; i < items.length; i++) {\n var index = items[i].visibleIndex;\n if (index !== undefined && index >= 0) return true;\n }\n return false;\n };\n ActionContainer.prototype.compareByVisibleIndex = function (first, second) {\n return first.visibleIndex - second.visibleIndex;\n };\n ActionContainer.prototype.isActionVisible = function (item) {\n return item.visibleIndex >= 0 || item.visibleIndex === undefined;\n };\n ActionContainer.prototype.popupAfterShowCallback = function (itemValue) {};\n ActionContainer.prototype.mouseOverHandler = function (itemValue) {\n var _this = this;\n itemValue.isHovered = true;\n this.actions.forEach(function (action) {\n if (action === itemValue && !!itemValue.popupModel) {\n itemValue.showPopupDelayed(_this.subItemsShowDelay);\n _this.popupAfterShowCallback(itemValue);\n }\n });\n };\n ActionContainer.prototype.initResponsivityManager = function (container, delayedUpdateFunction) {\n return;\n };\n ActionContainer.prototype.resetResponsivityManager = function () {};\n ActionContainer.prototype.getActionById = function (id) {\n for (var i = 0; i < this.actions.length; i++) {\n if (this.actions[i].id === id) return this.actions[i];\n }\n return null;\n };\n ActionContainer.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n this.resetResponsivityManager();\n this.actions.forEach(function (action) {\n return action.dispose();\n });\n this.actions.length = 0;\n };\n __decorate([propertyArray({\n onSet: function (_, target) {\n target.onSet();\n },\n onPush: function (item, i, target) {\n target.onPush(item);\n },\n onRemove: function (item, i, target) {\n target.onRemove(item);\n }\n })], ActionContainer.prototype, \"actions\", void 0);\n __decorate([jsonobject_property({})], ActionContainer.prototype, \"containerCss\", void 0);\n __decorate([jsonobject_property({\n defaultValue: false\n })], ActionContainer.prototype, \"isEmpty\", void 0);\n __decorate([jsonobject_property({\n defaultValue: 300\n })], ActionContainer.prototype, \"subItemsShowDelay\", void 0);\n __decorate([jsonobject_property({\n defaultValue: 300\n })], ActionContainer.prototype, \"subItemsHideDelay\", void 0);\n return ActionContainer;\n }(base_Base);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/element-helper.ts\n\n var element_helper_ElementHelper = /** @class */function () {\n function ElementHelper() {}\n ElementHelper.focusElement = function (element) {\n element && element.focus();\n };\n ElementHelper.visibility = function (node) {\n var style = DomDocumentHelper.getComputedStyle(node);\n if (style.display === \"none\" || style.visibility === \"hidden\") return false;\n return node.parentElement ? this.visibility(node.parentElement) : true;\n };\n ElementHelper.getNextElementPreorder = function (element) {\n var result = !!element.nextElementSibling ? element.nextElementSibling : element.parentElement.firstElementChild;\n if (this.visibility(result)) {\n return result;\n } else {\n return this.getNextElementPreorder(result);\n }\n };\n ElementHelper.getNextElementPostorder = function (element) {\n var result = !!element.previousElementSibling ? element.previousElementSibling : element.parentElement.lastElementChild;\n if (this.visibility(result)) {\n return result;\n } else {\n return this.getNextElementPostorder(result);\n }\n };\n ElementHelper.hasHorizontalScroller = function (element) {\n if (!!element) {\n return element.scrollWidth > element.offsetWidth;\n }\n return false;\n };\n ElementHelper.hasVerticalScroller = function (element) {\n if (!!element) {\n return element.scrollHeight > element.offsetHeight;\n }\n return false;\n };\n return ElementHelper;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/list.ts\n var list_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var list_decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n var defaultListCss = {\n root: \"sv-list__container\",\n item: \"sv-list__item\",\n searchClearButtonIcon: \"sv-list__filter-clear-button\",\n loadingIndicator: \"sv-list__loading-indicator\",\n itemSelected: \"sv-list__item--selected\",\n itemGroup: \"sv-list__item--group\",\n itemGroupSelected: \"sv-list__item--group-selected\",\n itemWithIcon: \"sv-list__item--with-icon\",\n itemDisabled: \"sv-list__item--disabled\",\n itemFocused: \"sv-list__item--focused\",\n itemHovered: \"sv-list__item--hovered\",\n itemTextWrap: \"sv-list__item-text--wrap\",\n itemIcon: \"sv-list__item-icon\",\n itemMarkerIcon: \"sv-list-item__marker-icon\",\n itemSeparator: \"sv-list__item-separator\",\n itemBody: \"sv-list__item-body\",\n itemsContainer: \"sv-list\",\n itemsContainerFiltering: \"sv-list--filtering\",\n filter: \"sv-list__filter\",\n filterIcon: \"sv-list__filter-icon\",\n filterInput: \"sv-list__input\",\n emptyContainer: \"sv-list__empty-container\",\n emptyText: \"sv-list__empty-text\"\n };\n var list_ListModel = /** @class */function (_super) {\n list_extends(ListModel, _super);\n function ListModel(items, onSelectionChanged, allowSelection, selectedItem, elementId) {\n var _this = _super.call(this) || this;\n _this.onSelectionChanged = onSelectionChanged;\n _this.allowSelection = allowSelection;\n _this.elementId = elementId;\n _this.onItemClick = function (itemValue) {\n if (_this.isItemDisabled(itemValue)) {\n return;\n }\n _this.isExpanded = false;\n if (_this.allowSelection) {\n _this.selectedItem = itemValue;\n }\n if (!!_this.onSelectionChanged) {\n _this.onSelectionChanged(itemValue);\n }\n var action = itemValue.action;\n if (!!action) {\n action(itemValue);\n }\n };\n _this.onItemHover = function (itemValue) {\n _this.mouseOverHandler(itemValue);\n };\n _this.isItemDisabled = function (itemValue) {\n return itemValue.enabled !== undefined && !itemValue.enabled;\n };\n _this.isItemSelected = function (itemValue) {\n return _this.areSameItems(_this.selectedItem, itemValue);\n };\n _this.isItemFocused = function (itemValue) {\n return _this.areSameItems(_this.focusedItem, itemValue);\n };\n _this.getListClass = function () {\n return new CssClassBuilder().append(_this.cssClasses.itemsContainer).append(_this.cssClasses.itemsContainerFiltering, !!_this.filterString && _this.visibleActions.length !== _this.visibleItems.length).toString();\n };\n _this.getItemClass = function (itemValue) {\n var isSelected = _this.isItemSelected(itemValue);\n return new CssClassBuilder().append(_this.cssClasses.item).append(_this.cssClasses.itemWithIcon, !!itemValue.iconName).append(_this.cssClasses.itemDisabled, _this.isItemDisabled(itemValue)).append(_this.cssClasses.itemFocused, _this.isItemFocused(itemValue)).append(_this.cssClasses.itemSelected, !itemValue.hasSubItems && isSelected).append(_this.cssClasses.itemGroup, itemValue.hasSubItems).append(_this.cssClasses.itemGroupSelected, itemValue.hasSubItems && isSelected).append(_this.cssClasses.itemHovered, itemValue.isHovered).append(_this.cssClasses.itemTextWrap, _this.textWrapEnabled).append(itemValue.css).toString();\n };\n // public getItemIndent = (itemValue: any) => {\n // const level: number = itemValue.level || 0;\n // return (level + 1) * ListModel.INDENT + \"px\";\n // };\n _this.getItemStyle = function (itemValue) {\n var level = itemValue.level || 0;\n return {\n \"--sjs-list-item-level\": level + 1\n };\n };\n if (Object.keys(items).indexOf(\"items\") !== -1) {\n var options_1 = items;\n Object.keys(options_1).forEach(function (key) {\n switch (key) {\n case \"items\":\n _this.setItems(options_1.items);\n break;\n case \"onFilterStringChangedCallback\":\n _this.setOnFilterStringChangedCallback(options_1.onFilterStringChangedCallback);\n break;\n case \"onTextSearchCallback\":\n _this.setOnTextSearchCallback(options_1.onTextSearchCallback);\n break;\n default:\n _this[key] = options_1[key];\n }\n });\n _this.updateActionsIds();\n } else {\n _this.setItems(items);\n _this.selectedItem = selectedItem;\n }\n return _this;\n }\n ListModel.prototype.hasText = function (item, filterStringInLow) {\n if (!filterStringInLow) return true;\n var text = item.title || \"\";\n if (this.onTextSearchCallback) return this.onTextSearchCallback(item, filterStringInLow);\n var textInLow = text.toLocaleLowerCase();\n textInLow = settings.comparator.normalizeTextCallback(textInLow, \"filter\");\n return textInLow.indexOf(filterStringInLow.toLocaleLowerCase()) > -1;\n };\n ListModel.prototype.isItemVisible = function (item) {\n return item.visible && (!this.shouldProcessFilter || this.hasText(item, this.filterString));\n };\n ListModel.prototype.getRenderedActions = function () {\n var actions = _super.prototype.getRenderedActions.call(this);\n if (this.filterString) {\n var newActions_1 = [];\n actions.forEach(function (action) {\n newActions_1.push(action);\n if (action.items) {\n action.items.forEach(function (item) {\n var a = new action_Action(item);\n if (!a.iconName) {\n a.iconName = action.iconName;\n }\n newActions_1.push(a);\n });\n }\n });\n return newActions_1;\n }\n return actions;\n };\n Object.defineProperty(ListModel.prototype, \"visibleItems\", {\n get: function () {\n var _this = this;\n return this.visibleActions.filter(function (item) {\n return _this.isItemVisible(item);\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ListModel.prototype, \"shouldProcessFilter\", {\n get: function () {\n return !this.onFilterStringChangedCallback;\n },\n enumerable: false,\n configurable: true\n });\n ListModel.prototype.onFilterStringChanged = function (text) {\n if (!!this.onFilterStringChangedCallback) {\n this.onFilterStringChangedCallback(text);\n }\n this.updateIsEmpty();\n };\n ListModel.prototype.updateIsEmpty = function () {\n var _this = this;\n this.isEmpty = this.renderedActions.filter(function (action) {\n return _this.isItemVisible(action);\n }).length === 0;\n };\n ListModel.prototype.scrollToItem = function (classes, ms) {\n var _this = this;\n if (ms === void 0) {\n ms = 0;\n }\n setTimeout(function () {\n if (!_this.listContainerHtmlElement) return;\n var item = _this.listContainerHtmlElement.querySelector(classesToSelector(classes));\n if (item) {\n setTimeout(function () {\n item.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\"\n });\n }, ms);\n }\n }, ms);\n };\n ListModel.prototype.setOnFilterStringChangedCallback = function (callback) {\n this.onFilterStringChangedCallback = callback;\n };\n ListModel.prototype.setOnTextSearchCallback = function (callback) {\n this.onTextSearchCallback = callback;\n };\n ListModel.prototype.setItems = function (items, sortByVisibleIndex) {\n if (sortByVisibleIndex === void 0) {\n sortByVisibleIndex = true;\n }\n _super.prototype.setItems.call(this, items, sortByVisibleIndex);\n this.updateActionsIds();\n if (!this.isAllDataLoaded && !!this.actions.length) {\n this.actions.push(this.loadingIndicator);\n }\n };\n ListModel.prototype.updateActionsIds = function () {\n var _this = this;\n if (this.elementId) {\n this.renderedActions.forEach(function (action) {\n action.elementId = _this.elementId + action.id;\n });\n }\n };\n ListModel.prototype.setSearchEnabled = function (newValue) {\n this.searchEnabled = newValue;\n this.showSearchClearButton = newValue;\n };\n ListModel.prototype.onSet = function () {\n this.showFilter = this.searchEnabled && (this.forceShowFilter || (this.actions || []).length > ListModel.MINELEMENTCOUNT);\n _super.prototype.onSet.call(this);\n };\n ListModel.prototype.getDefaultCssClasses = function () {\n return defaultListCss;\n };\n ListModel.prototype.popupAfterShowCallback = function (itemValue) {\n this.addScrollEventListener(function () {\n itemValue.hidePopup();\n });\n };\n ListModel.prototype.onItemLeave = function (itemValue) {\n itemValue.hidePopupDelayed(this.subItemsHideDelay);\n };\n ListModel.prototype.areSameItems = function (item1, item2) {\n if (!!this.areSameItemsCallback) return this.areSameItemsCallback(item1, item2);\n return !!item1 && !!item2 && item1.id == item2.id;\n };\n Object.defineProperty(ListModel.prototype, \"filterStringPlaceholder\", {\n get: function () {\n return this.getLocalizationString(\"filterStringPlaceholder\");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ListModel.prototype, \"emptyMessage\", {\n get: function () {\n return this.isAllDataLoaded ? this.getLocalizationString(\"emptyMessage\") : this.loadingText;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ListModel.prototype, \"scrollableContainer\", {\n get: function () {\n return this.listContainerHtmlElement.querySelector(classesToSelector(this.cssClasses.itemsContainer));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ListModel.prototype, \"loadingText\", {\n get: function () {\n return this.getLocalizationString(\"loadingFile\");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ListModel.prototype, \"loadingIndicator\", {\n get: function () {\n if (!this.loadingIndicatorValue) {\n this.loadingIndicatorValue = new action_Action({\n id: \"loadingIndicator\",\n title: this.loadingText,\n action: function () {},\n css: this.cssClasses.loadingIndicator\n });\n }\n return this.loadingIndicatorValue;\n },\n enumerable: false,\n configurable: true\n });\n ListModel.prototype.goToItems = function (event) {\n if (event.key === \"ArrowDown\" || event.keyCode === 40) {\n var currentElement = event.target.parentElement;\n var listElement = currentElement.parentElement.querySelector(\"ul\");\n var firstChild = getFirstVisibleChild(listElement);\n if (!!listElement && !!firstChild) {\n element_helper_ElementHelper.focusElement(firstChild);\n event.preventDefault();\n }\n }\n };\n ListModel.prototype.onMouseMove = function (event) {\n this.resetFocusedItem();\n };\n ListModel.prototype.onKeyDown = function (event) {\n var currentElement = event.target;\n if (event.key === \"ArrowDown\" || event.keyCode === 40) {\n element_helper_ElementHelper.focusElement(element_helper_ElementHelper.getNextElementPreorder(currentElement));\n event.preventDefault();\n } else if (event.key === \"ArrowUp\" || event.keyCode === 38) {\n element_helper_ElementHelper.focusElement(element_helper_ElementHelper.getNextElementPostorder(currentElement));\n event.preventDefault();\n }\n };\n ListModel.prototype.onPointerDown = function (event, item) {};\n ListModel.prototype.refresh = function () {\n if (this.filterString !== \"\") {\n this.filterString = \"\";\n } else {\n this.updateIsEmpty();\n }\n this.resetFocusedItem();\n };\n ListModel.prototype.onClickSearchClearButton = function (event) {\n event.currentTarget.parentElement.querySelector(\"input\").focus();\n this.refresh();\n };\n ListModel.prototype.resetFocusedItem = function () {\n this.focusedItem = undefined;\n };\n ListModel.prototype.focusFirstVisibleItem = function () {\n this.focusedItem = this.visibleItems[0];\n };\n ListModel.prototype.focusLastVisibleItem = function () {\n this.focusedItem = this.visibleItems[this.visibleItems.length - 1];\n };\n ListModel.prototype.initFocusedItem = function () {\n var _this = this;\n this.focusedItem = this.visibleItems.filter(function (item) {\n return item.visible && _this.isItemSelected(item);\n })[0];\n if (!this.focusedItem) {\n this.focusFirstVisibleItem();\n }\n };\n ListModel.prototype.focusNextVisibleItem = function () {\n if (!this.focusedItem) {\n this.initFocusedItem();\n } else {\n var items = this.visibleItems;\n var currentFocusedItemIndex = items.indexOf(this.focusedItem);\n var nextItem = items[currentFocusedItemIndex + 1];\n if (nextItem) {\n this.focusedItem = nextItem;\n } else {\n this.focusFirstVisibleItem();\n }\n }\n };\n ListModel.prototype.focusPrevVisibleItem = function () {\n if (!this.focusedItem) {\n this.initFocusedItem();\n } else {\n var items = this.visibleItems;\n var currentFocusedItemIndex = items.indexOf(this.focusedItem);\n var prevItem = items[currentFocusedItemIndex - 1];\n if (prevItem) {\n this.focusedItem = prevItem;\n } else {\n this.focusLastVisibleItem();\n }\n }\n };\n ListModel.prototype.selectFocusedItem = function () {\n !!this.focusedItem && this.onItemClick(this.focusedItem);\n };\n ListModel.prototype.initListContainerHtmlElement = function (htmlElement) {\n this.listContainerHtmlElement = htmlElement;\n };\n ListModel.prototype.onLastItemRended = function (item) {\n if (this.isAllDataLoaded) return;\n if (item === this.actions[this.actions.length - 1] && !!this.listContainerHtmlElement) {\n this.hasVerticalScroller = element_helper_ElementHelper.hasVerticalScroller(this.scrollableContainer);\n }\n };\n ListModel.prototype.scrollToFocusedItem = function () {\n this.scrollToItem(this.cssClasses.itemFocused);\n };\n ListModel.prototype.scrollToSelectedItem = function () {\n if (!!this.selectedItem && this.selectedItem.items && this.selectedItem.items.length > 0) {\n this.scrollToItem(this.cssClasses.itemGroupSelected, 110);\n } else {\n this.scrollToItem(this.cssClasses.itemSelected, 110);\n }\n };\n ListModel.prototype.addScrollEventListener = function (handler) {\n if (!!handler) {\n this.removeScrollEventListener();\n this.scrollHandler = handler;\n }\n if (!!this.scrollHandler) {\n this.scrollableContainer.addEventListener(\"scroll\", this.scrollHandler);\n }\n };\n ListModel.prototype.removeScrollEventListener = function () {\n if (!!this.scrollHandler) {\n this.scrollableContainer.removeEventListener(\"scroll\", this.scrollHandler);\n }\n };\n ListModel.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n if (!!this.loadingIndicatorValue) {\n this.loadingIndicatorValue.dispose();\n }\n this.listContainerHtmlElement = undefined;\n };\n ListModel.INDENT = 16;\n ListModel.MINELEMENTCOUNT = 10;\n list_decorate([jsonobject_property({\n defaultValue: true,\n onSet: function (newValue, target) {\n target.onSet();\n }\n })], ListModel.prototype, \"searchEnabled\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: false\n })], ListModel.prototype, \"showFilter\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: false\n })], ListModel.prototype, \"forceShowFilter\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: false\n })], ListModel.prototype, \"isExpanded\", void 0);\n list_decorate([jsonobject_property({})], ListModel.prototype, \"selectedItem\", void 0);\n list_decorate([jsonobject_property()], ListModel.prototype, \"focusedItem\", void 0);\n list_decorate([jsonobject_property({\n onSet: function (_, target) {\n target.onFilterStringChanged(target.filterString);\n }\n })], ListModel.prototype, \"filterString\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: false\n })], ListModel.prototype, \"hasVerticalScroller\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: true\n })], ListModel.prototype, \"isAllDataLoaded\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: false\n })], ListModel.prototype, \"showSearchClearButton\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: true\n })], ListModel.prototype, \"renderElements\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: false\n })], ListModel.prototype, \"textWrapEnabled\", void 0);\n list_decorate([jsonobject_property({\n defaultValue: \"sv-list-item-content\"\n })], ListModel.prototype, \"itemComponent\", void 0);\n return ListModel;\n }(container_ActionContainer);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/popup.ts\n var popup_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var popup_decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n var popup_PopupModel = /** @class */function (_super) {\n popup_extends(PopupModel, _super);\n function PopupModel(contentComponentName, contentComponentData, option1, option2) {\n var _this = _super.call(this) || this;\n _this.focusFirstInputSelector = \"\";\n _this.onCancel = function () {};\n _this.onApply = function () {\n return true;\n };\n _this.onHide = function () {};\n _this.onShow = function () {};\n _this.onDispose = function () {};\n _this.onVisibilityChanged = _this.addEvent();\n _this.onFooterActionsCreated = _this.addEvent();\n _this.onRecalculatePosition = _this.addEvent();\n _this.contentComponentName = contentComponentName;\n _this.contentComponentData = contentComponentData;\n if (!!option1 && typeof option1 === \"string\") {\n _this.verticalPosition = option1;\n _this.horizontalPosition = option2;\n } else if (!!option1) {\n var popupOptions = option1;\n for (var key in popupOptions) {\n _this[key] = popupOptions[key];\n }\n }\n return _this;\n }\n PopupModel.prototype.refreshInnerModel = function () {\n var innerModel = this.contentComponentData[\"model\"];\n innerModel && innerModel.refresh && innerModel.refresh();\n };\n Object.defineProperty(PopupModel.prototype, \"isVisible\", {\n get: function () {\n return this.getPropertyValue(\"isVisible\", false);\n },\n set: function (value) {\n if (this.isVisible === value) {\n return;\n }\n this.setPropertyValue(\"isVisible\", value);\n this.onVisibilityChanged.fire(this, {\n model: this,\n isVisible: value\n });\n },\n enumerable: false,\n configurable: true\n });\n PopupModel.prototype.toggleVisibility = function () {\n this.isVisible = !this.isVisible;\n };\n PopupModel.prototype.show = function () {\n if (!this.isVisible) this.isVisible = true;\n };\n PopupModel.prototype.hide = function () {\n if (this.isVisible) this.isVisible = false;\n };\n PopupModel.prototype.recalculatePosition = function (isResetHeight) {\n this.onRecalculatePosition.fire(this, {\n isResetHeight: isResetHeight\n });\n };\n PopupModel.prototype.updateFooterActions = function (footerActions) {\n var options = {\n actions: footerActions\n };\n this.onFooterActionsCreated.fire(this, options);\n return options.actions;\n };\n PopupModel.prototype.updateDisplayMode = function (menuType) {\n if (this.displayMode !== menuType) {\n this.setWidthByTarget = menuType === \"dropdown\";\n }\n switch (menuType) {\n case \"dropdown\":\n {\n this.displayMode = \"popup\";\n break;\n }\n case \"popup\":\n {\n this.displayMode = \"overlay\";\n this.overlayDisplayMode = \"tablet-dropdown-overlay\";\n break;\n }\n case \"overlay\":\n {\n this.displayMode = \"overlay\";\n this.overlayDisplayMode = \"dropdown-overlay\";\n break;\n }\n }\n };\n PopupModel.prototype.onHiding = function () {\n this.refreshInnerModel();\n this.onHide();\n };\n PopupModel.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n this.onDispose();\n };\n popup_decorate([jsonobject_property()], PopupModel.prototype, \"contentComponentName\", void 0);\n popup_decorate([jsonobject_property()], PopupModel.prototype, \"contentComponentData\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: \"bottom\"\n })], PopupModel.prototype, \"verticalPosition\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: \"left\"\n })], PopupModel.prototype, \"horizontalPosition\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: true\n })], PopupModel.prototype, \"showPointer\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: false\n })], PopupModel.prototype, \"isModal\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: true\n })], PopupModel.prototype, \"canShrink\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: true\n })], PopupModel.prototype, \"isFocusedContent\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: true\n })], PopupModel.prototype, \"isFocusedContainer\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: \"\"\n })], PopupModel.prototype, \"cssClass\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: \"\"\n })], PopupModel.prototype, \"title\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: \"auto\"\n })], PopupModel.prototype, \"overlayDisplayMode\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: \"popup\"\n })], PopupModel.prototype, \"displayMode\", void 0);\n popup_decorate([jsonobject_property({\n defaultValue: \"flex\"\n })], PopupModel.prototype, \"positionMode\", void 0);\n return PopupModel;\n }(base_Base);\n function createDialogOptions(componentName, data, onApply, onCancel, onHide, onShow, cssClass, title, displayMode) {\n if (onHide === void 0) {\n onHide = function () {};\n }\n if (onShow === void 0) {\n onShow = function () {};\n }\n if (displayMode === void 0) {\n displayMode = \"popup\";\n }\n ConsoleWarnings.warn(\"The `showModal()` and `createDialogOptions()` methods are obsolete. Use the `showDialog()` method instead.\");\n return {\n componentName: componentName,\n data: data,\n onApply: onApply,\n onCancel: onCancel,\n onHide: onHide,\n onShow: onShow,\n cssClass: cssClass,\n title: title,\n displayMode: displayMode\n };\n }\n\n // CONCATENATED MODULE: ./packages/survey-core/src/actions/action.ts\n var action_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var action_decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n var action_spreadArray = undefined && undefined.__spreadArray || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];\n return to;\n };\n function createDropdownActionModel(actionOptions, dropdownOptions, locOwner) {\n dropdownOptions.locOwner = locOwner;\n return createDropdownActionModelAdvanced(actionOptions, dropdownOptions, dropdownOptions);\n }\n function createDropdownActionModelAdvanced(actionOptions, listOptions, popupOptions) {\n var _a;\n var originalSelectionChanged = listOptions.onSelectionChanged;\n listOptions.onSelectionChanged = function (item) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n if (newAction.hasTitle) {\n newAction.title = item.title;\n }\n if (originalSelectionChanged) {\n originalSelectionChanged(item, params);\n }\n };\n var popupModel = createPopupModelWithListModel(listOptions, popupOptions);\n popupModel.getTargetCallback = getActionDropdownButtonTarget;\n var newActionOptions = Object.assign({}, actionOptions, {\n component: \"sv-action-bar-item-dropdown\",\n popupModel: popupModel,\n action: function (action, isUserAction) {\n !!actionOptions.action && actionOptions.action();\n popupModel.isFocusedContent = popupModel.isFocusedContent || !isUserAction;\n popupModel.show();\n }\n });\n var newAction = new action_Action(newActionOptions);\n newAction.data = (_a = popupModel.contentComponentData) === null || _a === void 0 ? void 0 : _a.model;\n return newAction;\n }\n function createPopupModelWithListModel(listOptions, popupOptions) {\n var listModel = new list_ListModel(listOptions);\n listModel.onSelectionChanged = function (item) {\n if (listOptions.onSelectionChanged) {\n listOptions.onSelectionChanged(item);\n }\n popupModel.hide();\n };\n var _popupOptions = popupOptions || {};\n _popupOptions.onDispose = function () {\n listModel.dispose();\n };\n var popupModel = new popup_PopupModel(\"sv-list\", {\n model: listModel\n }, _popupOptions);\n popupModel.isFocusedContent = listModel.showFilter;\n popupModel.onShow = function () {\n if (!!_popupOptions.onShow) _popupOptions.onShow();\n listModel.scrollToSelectedItem();\n };\n return popupModel;\n }\n function getActionDropdownButtonTarget(container) {\n return container === null || container === void 0 ? void 0 : container.previousElementSibling;\n }\n var action_BaseAction = /** @class */function (_super) {\n action_extends(BaseAction, _super);\n function BaseAction() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rendredIdValue = BaseAction.getNextRendredId();\n return _this;\n }\n BaseAction.getNextRendredId = function () {\n return BaseAction.renderedId++;\n };\n Object.defineProperty(BaseAction.prototype, \"renderedId\", {\n get: function () {\n return this.rendredIdValue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"owner\", {\n get: function () {\n return this.ownerValue;\n },\n set: function (val) {\n if (val !== this.owner) {\n this.ownerValue = val;\n this.locStrsChanged();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"visible\", {\n get: function () {\n return this.getVisible();\n },\n set: function (val) {\n this.setVisible(val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"enabled\", {\n get: function () {\n return this.getEnabled();\n },\n set: function (val) {\n this.setEnabled(val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"component\", {\n get: function () {\n return this.getComponent();\n },\n set: function (val) {\n this.setComponent(val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"locTitle\", {\n get: function () {\n return this.getLocTitle();\n },\n set: function (val) {\n this.setLocTitle(val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"title\", {\n get: function () {\n return this.getTitle();\n },\n set: function (val) {\n this.setTitle(val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"cssClasses\", {\n get: function () {\n return this.cssClassesValue || defaultActionBarCss;\n },\n set: function (val) {\n this.cssClassesValue = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"isVisible\", {\n get: function () {\n return this.visible && this.mode !== \"popup\" && this.mode !== \"removed\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"disabled\", {\n get: function () {\n return this.enabled !== undefined && !this.enabled;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"canShrink\", {\n get: function () {\n return !this.disableShrink && !!this.iconName;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"hasTitle\", {\n get: function () {\n return (this.mode != \"small\" && (this.showTitle || this.showTitle === undefined) || !this.iconName) && !!this.title;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseAction.prototype, \"hasSubItems\", {\n get: function () {\n return !!this.items && this.items.length > 0;\n },\n enumerable: false,\n configurable: true\n });\n BaseAction.prototype.getActionBarItemTitleCss = function () {\n return new CssClassBuilder().append(this.cssClasses.itemTitle).append(this.cssClasses.itemTitleWithIcon, !!this.iconName).toString();\n };\n BaseAction.prototype.getActionBarItemCss = function () {\n return new CssClassBuilder().append(this.cssClasses.item).append(this.cssClasses.itemWithTitle, this.hasTitle).append(this.cssClasses.itemAsIcon, !this.hasTitle).append(this.cssClasses.itemActive, !!this.active).append(this.cssClasses.itemPressed, !!this.pressed).append(this.innerCss).toString();\n };\n BaseAction.prototype.getActionRootCss = function () {\n return new CssClassBuilder().append(\"sv-action\").append(this.css).append(\"sv-action--space\", this.needSpace).append(\"sv-action--hidden\", !this.isVisible).toString();\n };\n BaseAction.prototype.getTooltip = function () {\n return this.tooltip || this.title;\n };\n BaseAction.prototype.getIsTrusted = function (args) {\n if (!!args.originalEvent) {\n return args.originalEvent.isTrusted;\n }\n return args.isTrusted;\n };\n BaseAction.prototype.showPopup = function () {\n if (!!this.popupModel) {\n this.popupModel.show();\n }\n };\n BaseAction.prototype.hidePopup = function () {\n if (!!this.popupModel) {\n this.popupModel.hide();\n }\n };\n BaseAction.prototype.clearPopupTimeouts = function () {\n if (this.showPopupTimeout) clearTimeout(this.showPopupTimeout);\n if (this.hidePopupTimeout) clearTimeout(this.hidePopupTimeout);\n };\n BaseAction.prototype.showPopupDelayed = function (delay) {\n var _this = this;\n this.clearPopupTimeouts();\n this.showPopupTimeout = setTimeout(function () {\n _this.clearPopupTimeouts();\n _this.showPopup();\n }, delay);\n };\n BaseAction.prototype.hidePopupDelayed = function (delay) {\n var _this = this;\n var _a;\n if ((_a = this.popupModel) === null || _a === void 0 ? void 0 : _a.isVisible) {\n this.clearPopupTimeouts();\n this.hidePopupTimeout = setTimeout(function () {\n _this.clearPopupTimeouts();\n _this.hidePopup();\n _this.isHovered = false;\n }, delay);\n } else {\n this.clearPopupTimeouts();\n this.isHovered = false;\n }\n };\n BaseAction.renderedId = 1;\n action_decorate([jsonobject_property()], BaseAction.prototype, \"tooltip\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"showTitle\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"innerCss\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"active\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"pressed\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"popupModel\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"needSeparator\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"template\", void 0);\n action_decorate([jsonobject_property({\n defaultValue: \"large\"\n })], BaseAction.prototype, \"mode\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"visibleIndex\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"disableTabStop\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"disableShrink\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"disableHide\", void 0);\n action_decorate([jsonobject_property({\n defaultValue: false\n })], BaseAction.prototype, \"needSpace\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"ariaChecked\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"ariaExpanded\", void 0);\n action_decorate([jsonobject_property({\n defaultValue: \"button\"\n })], BaseAction.prototype, \"ariaRole\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"iconName\", void 0);\n action_decorate([jsonobject_property({\n defaultValue: 24\n })], BaseAction.prototype, \"iconSize\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"markerIconName\", void 0);\n action_decorate([jsonobject_property()], BaseAction.prototype, \"css\", void 0);\n action_decorate([jsonobject_property({\n defaultValue: false\n })], BaseAction.prototype, \"isPressed\", void 0);\n action_decorate([jsonobject_property({\n defaultValue: false\n })], BaseAction.prototype, \"isHovered\", void 0);\n return BaseAction;\n }(base_Base);\n var action_Action = /** @class */function (_super) {\n action_extends(Action, _super);\n function Action(innerItemData) {\n var _this = _super.call(this) || this;\n _this.locTitleChanged = function () {\n var val = _this.locTitle.renderedHtml;\n _this.setPropertyValue(\"_title\", !!val ? val : undefined);\n };\n var innerItem = innerItemData instanceof Action ? innerItemData.innerItem : innerItemData;\n _this.innerItem = innerItem;\n _this.locTitle = !!innerItem ? innerItem[\"locTitle\"] : null;\n //Object.assign(this, item) to support IE11\n if (!!innerItem) {\n for (var key in innerItem) {\n if (key === \"locTitle\" || key === \"title\" && !!_this.locTitle && !!_this.title) continue;\n _this[key] = innerItem[key];\n }\n }\n if (!!_this.locTitleName) {\n _this.locTitleChanged();\n }\n _this.registerFunctionOnPropertyValueChanged(\"_title\", function () {\n _this.raiseUpdate(true);\n });\n _this.locStrChangedInPopupModel();\n return _this;\n }\n Action.prototype.raiseUpdate = function (isResetInitialized) {\n if (isResetInitialized === void 0) {\n isResetInitialized = false;\n }\n this.updateCallback && this.updateCallback(isResetInitialized);\n };\n Action.prototype.createLocTitle = function () {\n return this.createLocalizableString(\"title\", this, true);\n };\n Action.prototype.setSubItems = function (options) {\n this.markerIconName = \"icon-next_16x16\";\n this.component = \"sv-list-item-group\";\n this.items = action_spreadArray([], options.items);\n var listOptions = Object.assign({}, options);\n listOptions.searchEnabled = false;\n var popupModel = createPopupModelWithListModel(listOptions, {\n horizontalPosition: \"right\",\n showPointer: false,\n canShrink: false\n });\n popupModel.cssClass = \"sv-popup-inner\";\n this.popupModel = popupModel;\n };\n Action.prototype.getLocTitle = function () {\n return this.locTitleValue;\n };\n Action.prototype.setLocTitle = function (val) {\n if (!val && !this.locTitleValue) {\n val = this.createLocTitle();\n }\n if (!!this.locTitleValue) {\n this.locTitleValue.onStringChanged.remove(this.locTitleChanged);\n }\n this.locTitleValue = val;\n this.locTitleValue.onStringChanged.add(this.locTitleChanged);\n this.locTitleChanged();\n };\n Action.prototype.getTitle = function () {\n return this._title;\n };\n Action.prototype.setTitle = function (val) {\n this._title = val;\n };\n Object.defineProperty(Action.prototype, \"locTitleName\", {\n get: function () {\n return this.locTitle.localizationName;\n },\n set: function (val) {\n this.locTitle.localizationName = val;\n },\n enumerable: false,\n configurable: true\n });\n Action.prototype.locStrsChanged = function () {\n _super.prototype.locStrsChanged.call(this);\n this.locTooltipChanged();\n this.locStrChangedInPopupModel();\n };\n Action.prototype.doAction = function (args) {\n var evt = !!args.originalEvent ? args.originalEvent : args;\n this.action(this, evt.isTrusted);\n evt.preventDefault();\n evt.stopPropagation();\n return true;\n };\n Action.prototype.doMouseDown = function (args) {\n this.isMouseDown = true;\n };\n Action.prototype.doFocus = function (args) {\n if (!!this.onFocus) {\n var evt = !!args.originalEvent ? args.originalEvent : args;\n this.onFocus(this.isMouseDown, evt);\n }\n this.isMouseDown = false;\n };\n Action.prototype.locStrChangedInPopupModel = function () {\n if (!this.popupModel || !this.popupModel.contentComponentData || !this.popupModel.contentComponentData.model) return;\n var model = this.popupModel.contentComponentData.model;\n if (Array.isArray(model.actions)) {\n var actions = model.actions;\n actions.forEach(function (item) {\n if (!!item.locStrsChanged) {\n item.locStrsChanged();\n }\n });\n }\n };\n Action.prototype.locTooltipChanged = function () {\n if (!this.locTooltipName) return;\n this.tooltip = getLocaleString(this.locTooltipName, this.locTitle.locale);\n };\n //ILocalizableOwner\n Action.prototype.getLocale = function () {\n return this.owner ? this.owner.getLocale() : \"\";\n };\n Action.prototype.getMarkdownHtml = function (text, name) {\n return this.owner ? this.owner.getMarkdownHtml(text, name) : undefined;\n };\n Action.prototype.getProcessedText = function (text) {\n return this.owner ? this.owner.getProcessedText(text) : text;\n };\n Action.prototype.getRenderer = function (name) {\n return this.owner ? this.owner.getRenderer(name) : null;\n };\n Action.prototype.getRendererContext = function (locStr) {\n return this.owner ? this.owner.getRendererContext(locStr) : locStr;\n };\n Action.prototype.setVisible = function (val) {\n if (this.visible !== val) {\n this._visible = val;\n }\n };\n Action.prototype.getVisible = function () {\n return this._visible;\n };\n Action.prototype.setEnabled = function (val) {\n this._enabled = val;\n };\n Action.prototype.getEnabled = function () {\n if (this.enabledIf) return this.enabledIf();\n return this._enabled;\n };\n Action.prototype.setComponent = function (val) {\n this._component = val;\n };\n Action.prototype.getComponent = function () {\n return this._component;\n };\n Action.prototype.dispose = function () {\n this.updateCallback = undefined;\n if (!!this.locTitleValue) {\n this.locTitleValue.onStringChanged.remove(this.locTitleChanged);\n }\n this.locTitleChanged = undefined;\n this.action = undefined;\n _super.prototype.dispose.call(this);\n if (this.popupModel) {\n this.popupModel.dispose();\n }\n };\n action_decorate([jsonobject_property()], Action.prototype, \"id\", void 0);\n action_decorate([jsonobject_property({\n defaultValue: true,\n onSet: function (_, target) {\n target.raiseUpdate();\n }\n })], Action.prototype, \"_visible\", void 0);\n action_decorate([jsonobject_property({\n onSet: function (_, target) {\n target.locTooltipChanged();\n }\n })], Action.prototype, \"locTooltipName\", void 0);\n action_decorate([jsonobject_property()], Action.prototype, \"_enabled\", void 0);\n action_decorate([jsonobject_property()], Action.prototype, \"action\", void 0);\n action_decorate([jsonobject_property()], Action.prototype, \"onFocus\", void 0);\n action_decorate([jsonobject_property()], Action.prototype, \"_component\", void 0);\n action_decorate([jsonobject_property()], Action.prototype, \"items\", void 0);\n action_decorate([jsonobject_property({\n onSet: function (val, target) {\n if (target.locTitleValue.text === val) return;\n target.locTitleValue.text = val;\n }\n })], Action.prototype, \"_title\", void 0);\n return Action;\n }(action_BaseAction);\n var ActionDropdownViewModel = /** @class */function () {\n function ActionDropdownViewModel(item) {\n this.item = item;\n this.funcKey = \"sv-dropdown-action\";\n this.setupPopupCallbacks();\n }\n ActionDropdownViewModel.prototype.setupPopupCallbacks = function () {\n var _this = this;\n var popupModel = this.popupModel = this.item.popupModel;\n if (!popupModel) return;\n popupModel.registerPropertyChangedHandlers([\"isVisible\"], function () {\n if (!popupModel.isVisible) {\n _this.item.pressed = false;\n } else {\n _this.item.pressed = true;\n }\n }, this.funcKey);\n };\n ActionDropdownViewModel.prototype.removePopupCallbacks = function () {\n if (!!this.popupModel) {\n this.popupModel.unregisterPropertyChangedHandlers([\"isVisible\"], this.funcKey);\n }\n };\n ActionDropdownViewModel.prototype.dispose = function () {\n this.removePopupCallbacks();\n };\n return ActionDropdownViewModel;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/actions/adaptive-container.ts\n var adaptive_container_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var adaptive_container_AdaptiveActionContainer = /** @class */function (_super) {\n adaptive_container_extends(AdaptiveActionContainer, _super);\n function AdaptiveActionContainer() {\n var _this = _super.call(this) || this;\n _this.minVisibleItemsCount = 0;\n _this.isResponsivenessDisabled = false;\n _this.dotsItem = createDropdownActionModelAdvanced({\n id: \"dotsItem-id\" + AdaptiveActionContainer.ContainerID++,\n css: \"sv-dots\",\n innerCss: \"sv-dots__item\",\n iconName: \"icon-more\",\n visible: false,\n tooltip: getLocaleString(\"more\")\n }, {\n items: [],\n allowSelection: false\n });\n return _this;\n }\n AdaptiveActionContainer.prototype.hideItemsGreaterN = function (visibleItemsCount) {\n var actionsToHide = this.getActionsToHide();\n visibleItemsCount = Math.max(visibleItemsCount, this.minVisibleItemsCount - (this.visibleActions.length - actionsToHide.length));\n var hiddenItems = [];\n actionsToHide.forEach(function (item) {\n if (visibleItemsCount <= 0) {\n if (item.removePriority) {\n item.mode = \"removed\";\n } else {\n item.mode = \"popup\";\n hiddenItems.push(item.innerItem);\n }\n }\n visibleItemsCount--;\n });\n this.hiddenItemsListModel.setItems(hiddenItems);\n };\n AdaptiveActionContainer.prototype.getActionsToHide = function () {\n return this.visibleActions.filter(function (action) {\n return !action.disableHide;\n }).sort(function (a, b) {\n return a.removePriority || 0 - b.removePriority || 0;\n });\n };\n AdaptiveActionContainer.prototype.getVisibleItemsCount = function (availableSize) {\n this.visibleActions.filter(function (action) {\n return action.disableHide;\n }).forEach(function (action) {\n return availableSize -= action.minDimension;\n });\n var itemsSizes = this.getActionsToHide().map(function (item) {\n return item.minDimension;\n });\n var currSize = 0;\n for (var i = 0; i < itemsSizes.length; i++) {\n currSize += itemsSizes[i];\n if (currSize > availableSize) return i;\n }\n return i;\n };\n AdaptiveActionContainer.prototype.updateItemMode = function (availableSize, itemsSize) {\n var items = this.visibleActions;\n for (var index = items.length - 1; index >= 0; index--) {\n if (itemsSize > availableSize && !items[index].disableShrink) {\n itemsSize -= items[index].maxDimension - items[index].minDimension;\n items[index].mode = \"small\";\n } else {\n items[index].mode = \"large\";\n }\n }\n if (itemsSize > availableSize) {\n var hidableItems = this.visibleActions.filter(function (a) {\n return a.removePriority;\n });\n hidableItems.sort(function (a, b) {\n return a.removePriority - b.removePriority;\n });\n for (var index = 0; index < hidableItems.length; index++) {\n if (itemsSize > availableSize) {\n itemsSize -= items[index].disableShrink ? hidableItems[index].maxDimension : hidableItems[index].minDimension;\n hidableItems[index].mode = \"removed\";\n }\n }\n }\n };\n Object.defineProperty(AdaptiveActionContainer.prototype, \"hiddenItemsListModel\", {\n get: function () {\n return this.dotsItem.data;\n },\n enumerable: false,\n configurable: true\n });\n AdaptiveActionContainer.prototype.onSet = function () {\n var _this = this;\n this.actions.forEach(function (action) {\n return action.updateCallback = function (isResetInitialized) {\n return _this.raiseUpdate(isResetInitialized);\n };\n });\n _super.prototype.onSet.call(this);\n };\n AdaptiveActionContainer.prototype.onPush = function (item) {\n var _this = this;\n item.updateCallback = function (isResetInitialized) {\n return _this.raiseUpdate(isResetInitialized);\n };\n _super.prototype.onPush.call(this, item);\n };\n AdaptiveActionContainer.prototype.getRenderedActions = function () {\n if (this.actions.length === 1 && !!this.actions[0].iconName) return this.actions;\n return this.actions.concat([this.dotsItem]);\n };\n AdaptiveActionContainer.prototype.raiseUpdate = function (isResetInitialized) {\n if (!this.isResponsivenessDisabled) {\n _super.prototype.raiseUpdate.call(this, isResetInitialized);\n }\n };\n AdaptiveActionContainer.prototype.fit = function (dimension, dotsItemSize) {\n if (dimension <= 0) return;\n this.dotsItem.visible = false;\n var minSize = 0;\n var maxSize = 0;\n var items = this.visibleActions;\n items.forEach(function (item) {\n minSize += item.minDimension;\n maxSize += item.maxDimension;\n });\n if (dimension >= maxSize) {\n this.setActionsMode(\"large\");\n } else if (dimension < minSize) {\n this.setActionsMode(\"small\");\n this.hideItemsGreaterN(this.getVisibleItemsCount(dimension - dotsItemSize));\n this.dotsItem.visible = !!this.hiddenItemsListModel.actions.length;\n } else {\n this.updateItemMode(dimension, maxSize);\n }\n };\n AdaptiveActionContainer.prototype.initResponsivityManager = function (container, delayedUpdateFunction) {\n if (!!this.responsivityManager) {\n if (this.responsivityManager.container == container) {\n return;\n }\n this.responsivityManager.dispose();\n }\n this.responsivityManager = new responsivity_manager_ResponsivityManager(container, this, \":scope > .sv-action:not(.sv-dots) > .sv-action__content\", null, delayedUpdateFunction);\n };\n AdaptiveActionContainer.prototype.resetResponsivityManager = function () {\n if (!!this.responsivityManager) {\n this.responsivityManager.dispose();\n this.responsivityManager = undefined;\n }\n };\n AdaptiveActionContainer.prototype.setActionsMode = function (mode) {\n this.actions.forEach(function (action) {\n if (mode == \"small\" && action.disableShrink) {\n action.mode = \"large\";\n } else {\n action.mode = mode;\n }\n });\n };\n AdaptiveActionContainer.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n this.dotsItem.data.dispose();\n this.dotsItem.dispose();\n this.resetResponsivityManager();\n };\n AdaptiveActionContainer.ContainerID = 1;\n return AdaptiveActionContainer;\n }(container_ActionContainer);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/utils/taskmanager.ts\n var Task = /** @class */function () {\n function Task(func, isMultiple) {\n var _this = this;\n if (isMultiple === void 0) {\n isMultiple = false;\n }\n this.func = func;\n this.isMultiple = isMultiple;\n this._isCompleted = false;\n this.execute = function () {\n if (!_this._isCompleted) {\n _this.func();\n _this._isCompleted = !_this.isMultiple;\n }\n };\n }\n Task.prototype.discard = function () {\n this._isCompleted = true;\n };\n Object.defineProperty(Task.prototype, \"isCompleted\", {\n get: function () {\n return this._isCompleted;\n },\n enumerable: false,\n configurable: true\n });\n return Task;\n }();\n var TaskManger = /** @class */function () {\n function TaskManger(interval) {\n if (interval === void 0) {\n interval = 100;\n }\n this.interval = interval;\n setTimeout(TaskManger.Instance().tick, interval);\n }\n // dispose\n TaskManger.Instance = function () {\n if (!TaskManger.instance) {\n TaskManger.instance = new TaskManger();\n }\n return TaskManger.instance;\n };\n TaskManger.prototype.tick = function () {\n try {\n var newTasks = [];\n for (var i = 0; i < TaskManger.tasks.length; i++) {\n var task = TaskManger.tasks[i];\n task.execute();\n if (!task.isCompleted) {\n newTasks.push(task);\n } else {\n if (typeof task.dispose === \"function\") {\n task.dispose();\n }\n }\n }\n TaskManger.tasks = newTasks;\n } finally {\n setTimeout(TaskManger.Instance().tick, this.interval);\n }\n };\n TaskManger.schedule = function (task) {\n TaskManger.tasks.push(task);\n };\n TaskManger.instance = undefined;\n TaskManger.tasks = [];\n return TaskManger;\n }();\n function debounce(func) {\n var _this = this;\n var isSheduled = false;\n var isCanceled = false;\n var funcArgs;\n return {\n run: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n isCanceled = false;\n funcArgs = args;\n if (!isSheduled) {\n isSheduled = true;\n queueMicrotask(function () {\n if (!isCanceled) {\n func.apply(_this, funcArgs);\n }\n isCanceled = false;\n isSheduled = false;\n });\n }\n },\n cancel: function () {\n isCanceled = true;\n }\n };\n }\n\n // CONCATENATED MODULE: ./packages/survey-core/src/utils/animation.ts\n var animation_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var animation_AnimationUtils = /** @class */function () {\n function AnimationUtils() {\n this.cancelQueue = [];\n }\n AnimationUtils.prototype.getMsFromRule = function (value) {\n if (value === \"auto\") return 0;\n return Number(value.slice(0, -1).replace(\",\", \".\")) * 1000;\n };\n AnimationUtils.prototype.reflow = function (element) {\n return element.offsetHeight;\n };\n AnimationUtils.prototype.getAnimationsCount = function (element) {\n var animationName = \"\";\n if (getComputedStyle) {\n animationName = getComputedStyle(element).animationName;\n }\n return animationName && animationName != \"none\" ? animationName.split(\", \").length : 0;\n };\n AnimationUtils.prototype.getAnimationDuration = function (element) {\n var style = getComputedStyle(element);\n var delays = style[\"animationDelay\"].split(\", \");\n var durations = style[\"animationDuration\"].split(\", \");\n var duration = 0;\n for (var i = 0; i < Math.max(durations.length, delays.length); i++) {\n duration = Math.max(duration, this.getMsFromRule(durations[i % durations.length]) + this.getMsFromRule(delays[i % delays.length]));\n }\n return duration;\n };\n AnimationUtils.prototype.addCancelCallback = function (callback) {\n this.cancelQueue.push(callback);\n };\n AnimationUtils.prototype.removeCancelCallback = function (callback) {\n if (this.cancelQueue.indexOf(callback) >= 0) {\n this.cancelQueue.splice(this.cancelQueue.indexOf(callback), 1);\n }\n };\n AnimationUtils.prototype.onAnimationEnd = function (element, callback, options) {\n var _this = this;\n var cancelTimeout;\n var animationsCount = this.getAnimationsCount(element);\n var onEndCallback = function (isCancel) {\n if (isCancel === void 0) {\n isCancel = true;\n }\n callback(isCancel);\n clearTimeout(cancelTimeout);\n _this.removeCancelCallback(onEndCallback);\n element.removeEventListener(\"animationend\", onAnimationEndCallback);\n };\n var onAnimationEndCallback = function (event) {\n if (event.target == event.currentTarget && --animationsCount <= 0) {\n onEndCallback(false);\n }\n };\n if (animationsCount > 0) {\n element.addEventListener(\"animationend\", onAnimationEndCallback);\n this.addCancelCallback(onEndCallback);\n cancelTimeout = setTimeout(function () {\n onEndCallback(false);\n }, this.getAnimationDuration(element) + 10);\n } else {\n callback(true);\n }\n };\n AnimationUtils.prototype.afterAnimationRun = function (element, options) {\n if (element && options) {\n options.onAfterRunAnimation && options.onAfterRunAnimation(element);\n }\n };\n AnimationUtils.prototype.beforeAnimationRun = function (element, options) {\n if (element && options) {\n options.onBeforeRunAnimation && options.onBeforeRunAnimation(element);\n }\n };\n AnimationUtils.prototype.getCssClasses = function (options) {\n return options.cssClass.replace(/\\s+$/, \"\").split(/\\s+/);\n };\n AnimationUtils.prototype.runAnimation = function (element, options, callback) {\n if (element && (options === null || options === void 0 ? void 0 : options.cssClass)) {\n this.reflow(element);\n this.getCssClasses(options).forEach(function (cssClass) {\n element.classList.add(cssClass);\n });\n this.onAnimationEnd(element, callback, options);\n } else {\n callback(true);\n }\n };\n AnimationUtils.prototype.clearHtmlElement = function (element, options) {\n if (element && options.cssClass) {\n this.getCssClasses(options).forEach(function (cssClass) {\n element.classList.remove(cssClass);\n });\n }\n this.afterAnimationRun(element, options);\n };\n AnimationUtils.prototype.onNextRender = function (callback, isCancel) {\n var _this = this;\n if (isCancel === void 0) {\n isCancel = false;\n }\n if (!isCancel && DomWindowHelper.isAvailable()) {\n var cancelCallback_1 = function () {\n callback(true);\n cancelAnimationFrame(latestRAF_1);\n };\n var latestRAF_1 = DomWindowHelper.requestAnimationFrame(function () {\n latestRAF_1 = DomWindowHelper.requestAnimationFrame(function () {\n callback(false);\n _this.removeCancelCallback(cancelCallback_1);\n });\n });\n this.addCancelCallback(cancelCallback_1);\n } else {\n callback(true);\n }\n };\n AnimationUtils.prototype.cancel = function () {\n var cancelQueue = [].concat(this.cancelQueue);\n cancelQueue.forEach(function (callback) {\n return callback();\n });\n this.cancelQueue = [];\n };\n return AnimationUtils;\n }();\n var AnimationPropertyUtils = /** @class */function (_super) {\n animation_extends(AnimationPropertyUtils, _super);\n function AnimationPropertyUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnimationPropertyUtils.prototype.onEnter = function (options) {\n var _this = this;\n var htmlElement = options.getAnimatedElement();\n var enterOptions = options.getEnterOptions ? options.getEnterOptions() : {};\n this.beforeAnimationRun(htmlElement, enterOptions);\n this.runAnimation(htmlElement, enterOptions, function () {\n _this.clearHtmlElement(htmlElement, enterOptions);\n });\n };\n AnimationPropertyUtils.prototype.onLeave = function (options, callback) {\n var _this = this;\n var htmlElement = options.getAnimatedElement();\n var leaveOptions = options.getLeaveOptions ? options.getLeaveOptions() : {};\n this.beforeAnimationRun(htmlElement, leaveOptions);\n this.runAnimation(htmlElement, leaveOptions, function (isCancel) {\n callback();\n _this.onNextRender(function () {\n _this.clearHtmlElement(htmlElement, leaveOptions);\n }, isCancel);\n });\n };\n return AnimationPropertyUtils;\n }(animation_AnimationUtils);\n var AnimationGroupUtils = /** @class */function (_super) {\n animation_extends(AnimationGroupUtils, _super);\n function AnimationGroupUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AnimationGroupUtils.prototype.runGroupAnimation = function (options, addedItems, removedItems, reorderedItems, callback) {\n var _this = this;\n var info = {\n isAddingRunning: addedItems.length > 0,\n isDeletingRunning: removedItems.length > 0,\n isReorderingRunning: reorderedItems.length > 0\n };\n var addedHtmlElements = addedItems.map(function (el) {\n return options.getAnimatedElement(el);\n });\n var enterOptions = addedItems.map(function (el) {\n return options.getEnterOptions ? options.getEnterOptions(el, info) : {};\n });\n var removedHtmlElements = removedItems.map(function (el) {\n return options.getAnimatedElement(el);\n });\n var leaveOptions = removedItems.map(function (el) {\n return options.getLeaveOptions ? options.getLeaveOptions(el, info) : {};\n });\n var reorderedHtmlElements = reorderedItems.map(function (el) {\n return options.getAnimatedElement(el.item);\n });\n var reorderedOptions = reorderedItems.map(function (el) {\n return options.getReorderOptions ? options.getReorderOptions(el.item, el.movedForward, info) : {};\n });\n addedItems.forEach(function (_, i) {\n _this.beforeAnimationRun(addedHtmlElements[i], enterOptions[i]);\n });\n removedItems.forEach(function (_, i) {\n _this.beforeAnimationRun(removedHtmlElements[i], leaveOptions[i]);\n });\n reorderedItems.forEach(function (_, i) {\n _this.beforeAnimationRun(reorderedHtmlElements[i], reorderedOptions[i]);\n });\n var counter = addedItems.length + removedItems.length + reorderedHtmlElements.length;\n var onAnimationEndCallback = function (isCancel) {\n if (--counter <= 0) {\n callback && callback();\n _this.onNextRender(function () {\n addedItems.forEach(function (_, i) {\n _this.clearHtmlElement(addedHtmlElements[i], enterOptions[i]);\n });\n removedItems.forEach(function (_, i) {\n _this.clearHtmlElement(removedHtmlElements[i], leaveOptions[i]);\n });\n reorderedItems.forEach(function (_, i) {\n _this.clearHtmlElement(reorderedHtmlElements[i], reorderedOptions[i]);\n });\n }, isCancel);\n }\n };\n addedItems.forEach(function (_, i) {\n _this.runAnimation(addedHtmlElements[i], enterOptions[i], onAnimationEndCallback);\n });\n removedItems.forEach(function (_, i) {\n _this.runAnimation(removedHtmlElements[i], leaveOptions[i], onAnimationEndCallback);\n });\n reorderedItems.forEach(function (_, i) {\n _this.runAnimation(reorderedHtmlElements[i], reorderedOptions[i], onAnimationEndCallback);\n });\n };\n return AnimationGroupUtils;\n }(animation_AnimationUtils);\n var animation_AnimationProperty = /** @class */function () {\n function AnimationProperty(animationOptions, update, getCurrentValue) {\n var _this = this;\n this.animationOptions = animationOptions;\n this.update = update;\n this.getCurrentValue = getCurrentValue;\n this._debouncedSync = debounce(function (newValue) {\n _this.cancelAnimations();\n try {\n _this._sync(newValue);\n } catch (_a) {\n _this.update(newValue);\n }\n });\n }\n AnimationProperty.prototype.onNextRender = function (callback, onCancel) {\n var _this = this;\n var rerenderEvent = this.animationOptions.getRerenderEvent();\n if (!rerenderEvent) {\n if (DomWindowHelper.isAvailable()) {\n var raf_1 = DomWindowHelper.requestAnimationFrame(function () {\n callback();\n _this.cancelCallback = undefined;\n });\n this.cancelCallback = function () {\n onCancel && onCancel();\n cancelAnimationFrame(raf_1);\n _this.cancelCallback = undefined;\n };\n } else {\n throw new Error(\"Can't get next render\");\n }\n } else {\n var clear_1 = function () {\n rerenderEvent.remove(nextRenderCallback_1);\n _this.cancelCallback = undefined;\n };\n var nextRenderCallback_1 = function (_, options) {\n if (options.isCancel) {\n onCancel && onCancel();\n } else {\n callback();\n }\n clear_1();\n };\n this.cancelCallback = function () {\n onCancel && onCancel();\n clear_1();\n };\n rerenderEvent.add(nextRenderCallback_1);\n }\n };\n AnimationProperty.prototype.sync = function (newValue) {\n if (this.animationOptions.isAnimationEnabled()) {\n this._debouncedSync.run(newValue);\n } else {\n this.cancel();\n this.update(newValue);\n }\n };\n AnimationProperty.prototype.cancel = function () {\n this._debouncedSync.cancel();\n this.cancelAnimations();\n };\n AnimationProperty.prototype.cancelAnimations = function () {\n this.cancelCallback && this.cancelCallback();\n this.animation.cancel();\n };\n return AnimationProperty;\n }();\n var AnimationBoolean = /** @class */function (_super) {\n animation_extends(AnimationBoolean, _super);\n function AnimationBoolean() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.animation = new AnimationPropertyUtils();\n return _this;\n }\n AnimationBoolean.prototype._sync = function (newValue) {\n var _this = this;\n if (newValue !== this.getCurrentValue()) {\n if (newValue) {\n this.onNextRender(function () {\n _this.animation.onEnter(_this.animationOptions);\n });\n this.update(newValue);\n } else {\n this.animation.onLeave(this.animationOptions, function () {\n _this.update(newValue);\n });\n }\n } else {\n this.update(newValue);\n }\n };\n return AnimationBoolean;\n }(animation_AnimationProperty);\n var animation_AnimationGroup = /** @class */function (_super) {\n animation_extends(AnimationGroup, _super);\n function AnimationGroup() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.animation = new AnimationGroupUtils();\n return _this;\n }\n AnimationGroup.prototype._sync = function (newValue) {\n var _this = this;\n var _a, _b;\n newValue = [].concat(newValue);\n var oldValue = [].concat(this.getCurrentValue());\n var allowSyncRemovalAddition = (_a = this.animationOptions.allowSyncRemovalAddition) !== null && _a !== void 0 ? _a : true;\n var compareResult = compareArrays(oldValue, newValue, (_b = this.animationOptions.getKey) !== null && _b !== void 0 ? _b : function (item) {\n return item;\n });\n if (!allowSyncRemovalAddition && (compareResult.reorderedItems.length > 0 || compareResult.addedItems.length > 0)) {\n compareResult.deletedItems = [];\n compareResult.mergedItems = newValue;\n }\n if (!!this.animationOptions.onCompareArrays) {\n this.animationOptions.onCompareArrays(compareResult);\n }\n var addedItems = compareResult.addedItems,\n reorderedItems = compareResult.reorderedItems,\n deletedItems = compareResult.deletedItems,\n mergedItems = compareResult.mergedItems;\n var runAnimationCallback = function () {\n _this.animation.runGroupAnimation(_this.animationOptions, addedItems, deletedItems, reorderedItems, function () {\n if (deletedItems.length > 0) {\n _this.update(newValue);\n }\n });\n };\n if ([addedItems, deletedItems, reorderedItems].some(function (arr) {\n return arr.length > 0;\n })) {\n if (deletedItems.length <= 0 || reorderedItems.length > 0 || addedItems.length > 0) {\n this.onNextRender(runAnimationCallback, function () {\n _this.update(newValue);\n });\n this.update(mergedItems);\n } else {\n runAnimationCallback();\n }\n } else {\n this.update(newValue);\n }\n };\n return AnimationGroup;\n }(animation_AnimationProperty);\n var AnimationTab = /** @class */function (_super) {\n animation_extends(AnimationTab, _super);\n function AnimationTab(animationOptions, update, getCurrentValue, mergeValues) {\n var _this = _super.call(this, animationOptions, update, getCurrentValue) || this;\n _this.mergeValues = mergeValues;\n _this.animation = new AnimationGroupUtils();\n return _this;\n }\n AnimationTab.prototype._sync = function (newValue) {\n var _this = this;\n var oldValue = [].concat(this.getCurrentValue());\n if (oldValue[0] !== newValue[0]) {\n var tempValue = !!this.mergeValues ? this.mergeValues(newValue, oldValue) : [].concat(oldValue, newValue);\n this.onNextRender(function () {\n _this.animation.runGroupAnimation(_this.animationOptions, newValue, oldValue, [], function () {\n _this.update(newValue);\n });\n }, function () {\n return _this.update(newValue);\n });\n this.update(tempValue, true);\n } else {\n this.update(newValue);\n }\n };\n return AnimationTab;\n }(animation_AnimationProperty);\n\n // CONCATENATED MODULE: ./packages/survey-core/src/survey-element.ts\n var survey_element_extends = undefined && undefined.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n }();\n var survey_element_decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };\n\n /**\n * A base class for the [`SurveyElement`](https://surveyjs.io/form-library/documentation/surveyelement) and [`SurveyModel`](https://surveyjs.io/form-library/documentation/surveymodel) classes.\n */\n var survey_element_SurveyElementCore = /** @class */function (_super) {\n survey_element_extends(SurveyElementCore, _super);\n function SurveyElementCore() {\n var _this = _super.call(this) || this;\n _this.createLocTitleProperty();\n return _this;\n }\n SurveyElementCore.prototype.createLocTitleProperty = function () {\n return this.createLocalizableString(\"title\", this, true);\n };\n Object.defineProperty(SurveyElementCore.prototype, \"isPage\", {\n /**\n * Returns `true` if the survey element is a page.\n *\n * This property returns `false` for [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model) objects in the following cases:\n *\n * - `SurveyModel`'s [`questionsOnPageMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode) is set to `\"singlePage\"`.\n * - The page is included in a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page).\n *\n * In those cases, the survey creates an internal `PageModel` object to show all questions on one page, and all regular pages become panels.\n */\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"isPanel\", {\n /**\n * Returns `true` if the survey element is a panel or acts as one.\n *\n * This property returns `true` for `PageModel` objects in the following cases:\n *\n * - `SurveyModel`'s [`questionsOnPageMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode) is set to `\"singlePage\"`.\n * - The page is included in a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page).\n *\n * In those cases, the survey creates an internal `PageModel` object to show all questions on one page, and all regular pages become panels.\n */\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"isQuestion\", {\n /**\n * Returns `true` if the survey element is a question.\n */\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"isSurvey\", {\n /**\n * Returns `true` if the element is a survey.\n */\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"title\", {\n /**\n * A title for the survey element. If `title` is undefined, the `name` property value is displayed instead.\n *\n * Empty pages and panels do not display their titles or names.\n *\n * @see [Configure Question Titles](https://surveyjs.io/form-library/documentation/design-survey-question-titles)\n */\n get: function () {\n return this.getLocalizableStringText(\"title\", this.getDefaultTitleValue());\n },\n set: function (val) {\n this.setTitleValue(val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"locTitle\", {\n get: function () {\n return this.getLocalizableString(\"title\");\n },\n enumerable: false,\n configurable: true\n });\n SurveyElementCore.prototype.getDefaultTitleValue = function () {\n return undefined;\n };\n SurveyElementCore.prototype.setTitleValue = function (val) {\n this.setLocalizableStringText(\"title\", val);\n };\n SurveyElementCore.prototype.updateDescriptionVisibility = function (newDescription) {\n var showPlaceholder = false;\n if (this.isDesignMode) {\n var property_1 = Serializer.findProperty(this.getType(), \"description\");\n showPlaceholder = !!(property_1 === null || property_1 === void 0 ? void 0 : property_1.placeholder);\n }\n this.hasDescription = !!newDescription || showPlaceholder && this.isDesignMode;\n };\n Object.defineProperty(SurveyElementCore.prototype, \"locDescription\", {\n get: function () {\n return this.getLocalizableString(\"description\");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"titleTagName\", {\n get: function () {\n var titleTagName = this.getDefaultTitleTagName();\n var survey = this.getSurvey();\n return !!survey ? survey.getElementTitleTagName(this, titleTagName) : titleTagName;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElementCore.prototype.getDefaultTitleTagName = function () {\n return settings.titleTags[this.getType()];\n };\n Object.defineProperty(SurveyElementCore.prototype, \"hasTitle\", {\n get: function () {\n return this.title.length > 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"hasTitleActions\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"hasTitleEvents\", {\n get: function () {\n return this.hasTitleActions;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElementCore.prototype.getTitleToolbar = function () {\n return null;\n };\n SurveyElementCore.prototype.getTitleOwner = function () {\n return undefined;\n };\n Object.defineProperty(SurveyElementCore.prototype, \"isTitleOwner\", {\n get: function () {\n return !!this.getTitleOwner();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"isTitleRenderedAsString\", {\n get: function () {\n return this.getIsTitleRenderedAsString();\n },\n enumerable: false,\n configurable: true\n });\n SurveyElementCore.prototype.toggleState = function () {\n return undefined;\n };\n Object.defineProperty(SurveyElementCore.prototype, \"cssClasses\", {\n get: function () {\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"cssTitle\", {\n get: function () {\n return \"\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"ariaTitleId\", {\n get: function () {\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"ariaDescriptionId\", {\n get: function () {\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"titleTabIndex\", {\n get: function () {\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"titleAriaExpanded\", {\n get: function () {\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"titleAriaRole\", {\n get: function () {\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"ariaLabel\", {\n get: function () {\n return this.locTitle.renderedHtml;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElementCore.prototype, \"titleAriaLabel\", {\n get: function () {\n return this.ariaLabel;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElementCore.prototype.getIsTitleRenderedAsString = function () {\n return !this.isTitleOwner;\n };\n survey_element_decorate([jsonobject_property({})], SurveyElementCore.prototype, \"hasDescription\", void 0);\n survey_element_decorate([jsonobject_property({\n localizable: true,\n onSet: function (newDescription, self) {\n self.updateDescriptionVisibility(newDescription);\n }\n })], SurveyElementCore.prototype, \"description\", void 0);\n return SurveyElementCore;\n }(base_Base);\n\n // TODO: rename\n var DragTypeOverMeEnum = /*#__PURE__*/function (DragTypeOverMeEnum) {\n DragTypeOverMeEnum[DragTypeOverMeEnum[\"InsideEmptyPanel\"] = 1] = \"InsideEmptyPanel\";\n DragTypeOverMeEnum[DragTypeOverMeEnum[\"MultilineRight\"] = 2] = \"MultilineRight\";\n DragTypeOverMeEnum[DragTypeOverMeEnum[\"MultilineLeft\"] = 3] = \"MultilineLeft\";\n DragTypeOverMeEnum[DragTypeOverMeEnum[\"Top\"] = 4] = \"Top\";\n DragTypeOverMeEnum[DragTypeOverMeEnum[\"Right\"] = 5] = \"Right\";\n DragTypeOverMeEnum[DragTypeOverMeEnum[\"Bottom\"] = 6] = \"Bottom\";\n DragTypeOverMeEnum[DragTypeOverMeEnum[\"Left\"] = 7] = \"Left\";\n return DragTypeOverMeEnum;\n }(DragTypeOverMeEnum || {});\n /**\n * A base class for all survey elements.\n */\n var survey_element_SurveyElement = /** @class */function (_super) {\n survey_element_extends(SurveyElement, _super);\n function SurveyElement(name) {\n var _this = _super.call(this) || this;\n _this.selectedElementInDesignValue = _this;\n _this.disableDesignActions = SurveyElement.CreateDisabledDesignElements;\n _this.parentQuestionValue = null;\n _this.isContentElement = false;\n _this.isEditableTemplateElement = false;\n _this.isInteractiveDesignElement = true;\n _this.isSingleInRow = true;\n _this._renderedIsExpanded = true;\n _this._isAnimatingCollapseExpand = false;\n _this.animationCollapsed = new AnimationBoolean(_this.getExpandCollapseAnimationOptions(), function (val) {\n _this._renderedIsExpanded = val;\n if (_this.animationAllowed) {\n if (val) {\n _this.isAnimatingCollapseExpand = true;\n } else {\n _this.updateElementCss(false);\n }\n }\n }, function () {\n return _this.renderedIsExpanded;\n });\n _this.onAfterRenderElement = _this.addEvent();\n _this.name = name;\n _this.createNewArray(\"errors\");\n _this.createNewArray(\"titleActions\");\n _this.registerPropertyChangedHandlers([\"isReadOnly\"], function () {\n _this.onReadOnlyChanged();\n });\n _this.registerPropertyChangedHandlers([\"errors\"], function () {\n _this.updateVisibleErrors();\n });\n _this.registerPropertyChangedHandlers([\"isSingleInRow\"], function () {\n _this.updateElementCss(false);\n });\n _this.registerPropertyChangedHandlers([\"minWidth\", \"maxWidth\", \"renderWidth\", \"allowRootStyle\", \"parent\"], function () {\n _this.updateRootStyle();\n });\n return _this;\n }\n SurveyElement.getProgressInfoByElements = function (children, isRequired) {\n var info = base_Base.createProgressInfo();\n for (var i = 0; i < children.length; i++) {\n if (!children[i].isVisible) continue;\n var childInfo = children[i].getProgressInfo();\n info.questionCount += childInfo.questionCount;\n info.answeredQuestionCount += childInfo.answeredQuestionCount;\n info.requiredQuestionCount += childInfo.requiredQuestionCount;\n info.requiredAnsweredQuestionCount += childInfo.requiredAnsweredQuestionCount;\n }\n if (isRequired && info.questionCount > 0) {\n if (info.requiredQuestionCount == 0) info.requiredQuestionCount = 1;\n if (info.answeredQuestionCount > 0) info.requiredAnsweredQuestionCount = 1;\n }\n return info;\n };\n SurveyElement.IsNeedScrollIntoView = function (el, checkLeft, scrollIfVisible) {\n var elTop = scrollIfVisible ? -1 : el.getBoundingClientRect().top;\n var needScroll = elTop < 0;\n var elLeft = -1;\n if (!needScroll && checkLeft) {\n elLeft = el.getBoundingClientRect().left;\n needScroll = elLeft < 0;\n }\n if (!needScroll && DomWindowHelper.isAvailable()) {\n var height = DomWindowHelper.getInnerHeight();\n needScroll = height > 0 && height < elTop;\n if (!needScroll && checkLeft) {\n var width = DomWindowHelper.getInnerWidth();\n needScroll = width > 0 && width < elLeft;\n }\n }\n return needScroll;\n };\n SurveyElement.ScrollIntoView = function (el, scrollIntoViewOptions, doneCallback) {\n el.scrollIntoView(scrollIntoViewOptions);\n if (typeof doneCallback === \"function\") {\n var lastPos_1 = null;\n var same_1 = 0;\n var checkPos_1 = function () {\n var newPos = el.getBoundingClientRect().top;\n if (newPos === lastPos_1) {\n if (same_1++ > 2) {\n doneCallback();\n return;\n }\n } else {\n lastPos_1 = newPos;\n same_1 = 0;\n }\n requestAnimationFrame(checkPos_1);\n };\n DomWindowHelper.requestAnimationFrame(checkPos_1);\n }\n };\n SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions, doneCallback) {\n var root = settings.environment.root;\n if (!elementId || typeof root === \"undefined\") return false;\n var el = root.getElementById(elementId);\n return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions, doneCallback);\n };\n SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions, doneCallback) {\n if (!el || !el.scrollIntoView) {\n doneCallback && doneCallback();\n return false;\n }\n var needScroll = SurveyElement.IsNeedScrollIntoView(el, checkLeft, scrollIfVisible);\n if (needScroll) {\n SurveyElement.ScrollIntoView(el, scrollIntoViewOptions, doneCallback);\n } else {\n doneCallback && doneCallback();\n }\n return needScroll;\n };\n SurveyElement.GetFirstNonTextElement = function (elements, removeSpaces) {\n if (removeSpaces === void 0) {\n removeSpaces = false;\n }\n if (!elements || !elements.length || elements.length == 0) return null;\n if (removeSpaces) {\n var tEl = elements[0];\n if (tEl.nodeName === \"#text\") tEl.data = \"\";\n tEl = elements[elements.length - 1];\n if (tEl.nodeName === \"#text\") tEl.data = \"\";\n }\n for (var i = 0; i < elements.length; i++) {\n if (elements[i].nodeName != \"#text\" && elements[i].nodeName != \"#comment\") return elements[i];\n }\n return null;\n };\n SurveyElement.FocusElement = function (elementId, isTimeOut, containerEl) {\n if (!elementId || !DomDocumentHelper.isAvailable()) return false;\n var res = !isTimeOut ? SurveyElement.focusElementCore(elementId, containerEl) : false;\n if (!res) {\n setTimeout(function () {\n SurveyElement.focusElementCore(elementId, containerEl);\n }, isTimeOut ? 100 : 10);\n }\n return res;\n };\n SurveyElement.focusElementCore = function (elementId, containerEl) {\n var root = settings.environment.root;\n if (!root && !containerEl) return false;\n var el = containerEl ? containerEl.querySelector(\"#\" + CSS.escape(elementId)) : root.getElementById(elementId);\n // https://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom\n if (el && !el[\"disabled\"] && el.style.display !== \"none\" && el.offsetParent !== null) {\n SurveyElement.ScrollElementToViewCore(el, true, false);\n el.focus();\n return true;\n }\n return false;\n };\n Object.defineProperty(SurveyElement.prototype, \"colSpan\", {\n get: function () {\n return this.getPropertyValue(\"colSpan\", 1);\n },\n set: function (val) {\n this.setPropertyValue(\"colSpan\", val);\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {\n _super.prototype.onPropertyValueChanged.call(this, name, oldValue, newValue);\n if (name === \"state\") {\n this.updateElementCss(false);\n this.notifyStateChanged(oldValue);\n if (this.stateChangedCallback) this.stateChangedCallback();\n }\n };\n SurveyElement.prototype.getSkeletonComponentNameCore = function () {\n if (this.survey) {\n return this.survey.getSkeletonComponentName(this);\n }\n return \"\";\n };\n Object.defineProperty(SurveyElement.prototype, \"parentQuestion\", {\n /**\n * A Dynamic Panel, Dynamic Matrix, or Dropdown Matrix that includes the current question.\n *\n * This property is `null` for standalone questions.\n */\n get: function () {\n return this.parentQuestionValue;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.setParentQuestion = function (val) {\n this.parentQuestionValue = val;\n this.onParentQuestionChanged();\n };\n SurveyElement.prototype.onParentQuestionChanged = function () {};\n SurveyElement.prototype.updateElementVisibility = function () {\n this.setPropertyValue(\"isVisible\", this.isVisible);\n };\n Object.defineProperty(SurveyElement.prototype, \"skeletonComponentName\", {\n get: function () {\n return this.getSkeletonComponentNameCore();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"state\", {\n /**\n * Gets and sets the survey element's expand state.\n *\n * Possible values:\n *\n * - `\"default\"` (default) - The survey element is displayed in full and cannot be collapsed in the UI.\n * - `\"expanded\"` - The survey element is displayed in full and can be collapsed in the UI.\n * - `\"collapsed\"` - The survey element displays only `title` and `description` and can be expanded in the UI.\n *\n * @see toggleState\n * @see collapse\n * @see expand\n * @see isCollapsed\n * @see isExpanded\n */\n get: function () {\n return this.getPropertyValue(\"state\");\n },\n set: function (val) {\n this.setPropertyValue(\"state\", val);\n this.renderedIsExpanded = !this.isCollapsed;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.notifyStateChanged = function (prevState) {\n if (this.survey) {\n this.survey.elementContentVisibilityChanged(this);\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"isCollapsed\", {\n /**\n * Returns `true` if the survey element is collapsed.\n * @see state\n * @see toggleState\n * @see collapse\n * @see expand\n * @see isExpanded\n */\n get: function () {\n return this.state === \"collapsed\" && !this.isDesignMode;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"isExpanded\", {\n /**\n * Returns `true` if the survey element is expanded.\n * @see state\n * @see toggleState\n * @see collapse\n * @see expand\n * @see isCollapsed\n */\n get: function () {\n return this.state === \"expanded\";\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Collapses the survey element.\n *\n * In collapsed state, the element displays only `title` and `description`.\n * @see title\n * @see description\n * @see state\n * @see toggleState\n * @see expand\n * @see isCollapsed\n * @see isExpanded\n */\n SurveyElement.prototype.collapse = function () {\n if (this.isDesignMode) return;\n this.state = \"collapsed\";\n };\n /**\n * Expands the survey element.\n * @see state\n * @see toggleState\n * @see collapse\n * @see isCollapsed\n * @see isExpanded\n */\n SurveyElement.prototype.expand = function () {\n this.state = \"expanded\";\n };\n /**\n * Toggles the survey element's `state` between collapsed and expanded.\n * @see state\n * @see collapse\n * @see expand\n * @see isCollapsed\n * @see isExpanded\n */\n SurveyElement.prototype.toggleState = function () {\n if (this.isCollapsed) {\n this.expand();\n return true;\n }\n if (this.isExpanded) {\n this.collapse();\n return false;\n }\n return true;\n };\n Object.defineProperty(SurveyElement.prototype, \"hasStateButton\", {\n get: function () {\n return this.isExpanded || this.isCollapsed;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"shortcutText\", {\n get: function () {\n return this.title || this.name;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getTitleToolbar = function () {\n if (!this.titleToolbarValue) {\n this.titleToolbarValue = this.createActionContainer(true);\n this.titleToolbarValue.locOwner = this;\n this.titleToolbarValue.containerCss = (this.isPanel ? this.cssClasses.panel.titleBar : this.cssClasses.titleBar) || \"sv-action-title-bar\";\n this.titleToolbarValue.setItems(this.getTitleActions());\n }\n return this.titleToolbarValue;\n };\n SurveyElement.prototype.createActionContainer = function (allowAdaptiveActions) {\n var actionContainer = allowAdaptiveActions ? new adaptive_container_AdaptiveActionContainer() : new container_ActionContainer();\n if (this.survey && !!this.survey.getCss().actionBar) {\n actionContainer.cssClasses = this.survey.getCss().actionBar;\n }\n return actionContainer;\n };\n Object.defineProperty(SurveyElement.prototype, \"titleActions\", {\n get: function () {\n return this.getPropertyValue(\"titleActions\");\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getTitleActions = function () {\n if (!this.isTitleActionRequested) {\n this.updateTitleActions();\n this.isTitleActionRequested = true;\n }\n return this.titleActions;\n };\n SurveyElement.prototype.getDefaultTitleActions = function () {\n return [];\n };\n SurveyElement.prototype.updateTitleActions = function () {\n var actions = this.getDefaultTitleActions();\n if (!!this.survey) {\n actions = this.survey.getUpdatedElementTitleActions(this, actions);\n }\n this.setPropertyValue(\"titleActions\", actions);\n };\n SurveyElement.prototype.locStrsChanged = function () {\n _super.prototype.locStrsChanged.call(this);\n if (!!this.titleToolbarValue) {\n this.titleToolbarValue.locStrsChanged();\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"hasTitleActions\", {\n get: function () {\n return this.getTitleActions().length > 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"hasTitleEvents\", {\n get: function () {\n return this.state !== undefined && this.state !== \"default\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"titleTabIndex\", {\n get: function () {\n return !this.isPage && this.state !== \"default\" ? 0 : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"titleAriaExpanded\", {\n get: function () {\n if (this.isPage || this.state === \"default\") return undefined;\n return this.state === \"expanded\" ? \"true\" : \"false\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"titleAriaRole\", {\n get: function () {\n if (this.isPage || this.state === \"default\") return undefined;\n return \"button\";\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.setSurveyImpl = function (value, isLight) {\n this.surveyImplValue = value;\n if (!this.surveyImplValue) {\n this.setSurveyCore(null);\n this.surveyDataValue = null;\n } else {\n this.surveyDataValue = this.surveyImplValue.getSurveyData();\n this.setSurveyCore(this.surveyImplValue.getSurvey());\n this.textProcessorValue = this.surveyImplValue.getTextProcessor();\n this.onSetData();\n }\n if (!!this.survey /* && !this.isLoadingFromJson*/) {\n this.updateDescriptionVisibility(this.description);\n this.clearCssClasses();\n }\n this.blockAnimations();\n this.renderedIsExpanded = !this.isCollapsed;\n this.releaseAnimations();\n };\n SurveyElement.prototype.canRunConditions = function () {\n return _super.prototype.canRunConditions.call(this) && !!this.data;\n };\n SurveyElement.prototype.getDataFilteredValues = function () {\n return !!this.data ? this.data.getFilteredValues() : {};\n };\n SurveyElement.prototype.getDataFilteredProperties = function () {\n var props = !!this.data ? this.data.getFilteredProperties() : {};\n props.question = this;\n return props;\n };\n Object.defineProperty(SurveyElement.prototype, \"surveyImpl\", {\n get: function () {\n return this.surveyImplValue;\n },\n enumerable: false,\n configurable: true\n });\n /* You shouldn't use this method ever */\n SurveyElement.prototype.__setData = function (data) {\n if (settings.supportCreatorV2) {\n this.surveyDataValue = data;\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"data\", {\n get: function () {\n return this.surveyDataValue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"survey\", {\n /**\n * Returns the survey object.\n */\n get: function () {\n return this.getSurvey();\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getSurvey = function (live) {\n if (live === void 0) {\n live = false;\n }\n if (!!this.surveyValue) return this.surveyValue;\n if (!!this.surveyImplValue) {\n this.setSurveyCore(this.surveyImplValue.getSurvey());\n }\n return this.surveyValue;\n };\n SurveyElement.prototype.setSurveyCore = function (value) {\n this.surveyValue = value;\n if (!!this.surveyChangedCallback) {\n this.surveyChangedCallback();\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"skeletonHeight\", {\n get: function () {\n var skeletonHeight = undefined;\n if (!!this.survey && this.survey.skeletonHeight) {\n skeletonHeight = this.survey.skeletonHeight + \"px\";\n }\n return skeletonHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"isInternal\", {\n get: function () {\n return this.isContentElement;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"areInvisibleElementsShowing\", {\n get: function () {\n return !!this.survey && this.survey.areInvisibleElementsShowing && !this.isContentElement;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"isVisible\", {\n get: function () {\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"isReadOnly\", {\n /**\n * Returns `true` if the survey element or its parent element is read-only.\n *\n * If you want to switch a survey element to the read-only state based on a condition, specify the [`enableIf`](https://surveyjs.io/form-library/documentation/question#enableIf) property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).\n * @see readOnly\n */\n get: function () {\n return this.readOnly;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"readOnly\", {\n /**\n * Makes the survey element read-only.\n *\n * If you want to switch a survey element to the read-only state based on a condition, specify the [`enableIf`](https://surveyjs.io/form-library/documentation/question#enableIf) property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).\n * @see isReadOnly\n */\n get: function () {\n return this.getPropertyValue(\"readOnly\");\n },\n set: function (val) {\n if (this.readOnly == val) return;\n this.setPropertyValue(\"readOnly\", val);\n if (!this.isLoadingFromJson) {\n this.setPropertyValue(\"isReadOnly\", this.isReadOnly);\n }\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.onReadOnlyChanged = function () {\n if (!!this.readOnlyChangedCallback) {\n this.readOnlyChangedCallback();\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"css\", {\n get: function () {\n return !!this.survey ? this.survey.getCss() : {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"cssClassesValue\", {\n get: function () {\n var res = this.getPropertyValueWithoutDefault(\"cssClassesValue\");\n if (!res && !this.isCssValueCalculating) {\n this.isCssValueCalculating = true;\n res = this.createCssClassesValue();\n this.isCssValueCalculating = false;\n }\n return res;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.ensureCssClassesValue = function () {\n if (!this.cssClassesValue) {\n this.createCssClassesValue();\n }\n };\n SurveyElement.prototype.createCssClassesValue = function () {\n var res = this.calcCssClasses(this.css);\n this.setPropertyValue(\"cssClassesValue\", res);\n this.onCalcCssClasses(res);\n this.updateElementCssCore(this.cssClassesValue);\n return res;\n };\n SurveyElement.prototype.onCalcCssClasses = function (classes) {};\n Object.defineProperty(SurveyElement.prototype, \"cssClasses\", {\n /**\n * Returns an object in which keys are UI elements and values are CSS classes applied to them.\n *\n * Use the following events of the [`SurveyModel`](https://surveyjs.io/form-library/documentation/surveymodel) object to override CSS classes:\n *\n * - [`onUpdateQuestionCssClasses`](https://surveyjs.io/form-library/documentation/surveymodel#onUpdateQuestionCssClasses)\n * - [`onUpdatePanelCssClasses`](https://surveyjs.io/form-library/documentation/surveymodel#onUpdatePanelCssClasses)\n * - [`onUpdatePageCssClasses`](https://surveyjs.io/form-library/documentation/surveymodel#onUpdatePageCssClasses)\n * - [`onUpdateChoiceItemCss`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onUpdateChoiceItemCss)\n */\n get: function () {\n var _dummy = this.cssClassesValue;\n if (!this.survey) return this.calcCssClasses(this.css);\n this.ensureCssClassesValue();\n return this.cssClassesValue;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"cssTitleNumber\", {\n get: function () {\n var css = this.cssClasses;\n if (css.number) return css.number;\n return css.panel ? css.panel.number : undefined;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"cssRequiredText\", {\n get: function () {\n var css = this.cssClasses;\n return css.requiredText || css.panel && css.panel.requiredText;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getCssTitleExpandableSvg = function () {\n if (this.state === \"default\") return null;\n return this.cssClasses.titleExpandableSvg;\n };\n SurveyElement.prototype.calcCssClasses = function (css) {\n return undefined;\n };\n SurveyElement.prototype.updateElementCssCore = function (cssClasses) {};\n Object.defineProperty(SurveyElement.prototype, \"cssError\", {\n get: function () {\n return \"\";\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.updateElementCss = function (reNew) {\n this.clearCssClasses();\n };\n SurveyElement.prototype.clearCssClasses = function () {\n this.resetPropertyValue(\"cssClassesValue\");\n };\n SurveyElement.prototype.getIsLoadingFromJson = function () {\n if (_super.prototype.getIsLoadingFromJson.call(this)) return true;\n return this.surveyValue ? this.surveyValue.isLoadingFromJson : false;\n };\n Object.defineProperty(SurveyElement.prototype, \"name\", {\n /**\n * A survey element identifier.\n *\n * > Question names must be unique.\n */\n get: function () {\n return this.getPropertyValue(\"name\", \"\");\n },\n set: function (val) {\n var oldValue = this.name;\n this.setPropertyValue(\"name\", this.getValidName(val));\n if (!this.isLoadingFromJson && !!oldValue) {\n this.onNameChanged(oldValue);\n }\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getValidName = function (name) {\n return name;\n };\n SurveyElement.prototype.onNameChanged = function (oldValue) {};\n SurveyElement.prototype.updateBindingValue = function (valueName, value) {\n if (!!this.data && !this.isTwoValueEquals(value, this.data.getValue(valueName))) {\n this.data.setValue(valueName, value, false);\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"errors\", {\n /**\n * Validation errors. Call the `validate()` method to validate survey element data.\n * @see validate\n */\n get: function () {\n return this.getPropertyValue(\"errors\");\n },\n set: function (val) {\n this.setPropertyValue(\"errors\", val);\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.updateVisibleErrors = function () {\n var counter = 0;\n for (var i = 0; i < this.errors.length; i++) {\n if (this.errors[i].visible) counter++;\n }\n this.hasVisibleErrors = counter > 0;\n };\n Object.defineProperty(SurveyElement.prototype, \"containsErrors\", {\n /**\n * Returns `true` if the survey element or its child elements have validation errors.\n *\n * This property contains the result of the most recent validation. This result may be outdated. Call the `validate` method to get an up-to-date value.\n * @see errors\n */\n get: function () {\n return this.getPropertyValue(\"containsErrors\", false);\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.updateContainsErrors = function () {\n this.setPropertyValue(\"containsErrors\", this.getContainsErrors());\n };\n SurveyElement.prototype.getContainsErrors = function () {\n return this.errors.length > 0;\n };\n Object.defineProperty(SurveyElement.prototype, \"selectedElementInDesign\", {\n get: function () {\n return this.selectedElementInDesignValue;\n },\n set: function (val) {\n this.selectedElementInDesignValue = val;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.updateCustomWidgets = function () {};\n SurveyElement.prototype.onSurveyLoad = function () {};\n Object.defineProperty(SurveyElement.prototype, \"wasRendered\", {\n get: function () {\n return !!this.wasRenderedValue;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.onFirstRendering = function () {\n if (!this.wasRendered) {\n this.wasRenderedValue = true;\n this.onFirstRenderingCore();\n }\n };\n SurveyElement.prototype.onFirstRenderingCore = function () {\n this.ensureCssClassesValue();\n };\n SurveyElement.prototype.endLoadingFromJson = function () {\n _super.prototype.endLoadingFromJson.call(this);\n if (!this.survey) {\n this.onSurveyLoad();\n }\n this.updateDescriptionVisibility(this.description);\n };\n SurveyElement.prototype.setVisibleIndex = function (index) {\n return 0;\n };\n SurveyElement.prototype.delete = function (doDispose) {};\n /**\n * Returns the survey's [locale](https://surveyjs.io/form-library/documentation/surveymodel#locale).\n *\n * If a default locale is used, this method returns an empty string. To get the applied locale in this case, use the following code:\n *\n * ```js\n * import { surveyLocalization } from 'survey-core';\n * const defaultLocale = surveyLocalization.defaultLocale;\n * ```\n *\n * @see [Localization & Globalization](https://surveyjs.io/form-library/documentation/localization)\n */\n SurveyElement.prototype.getLocale = function () {\n return this.survey ? this.survey.getLocale() : this.locOwner ? this.locOwner.getLocale() : \"\";\n };\n SurveyElement.prototype.getMarkdownHtml = function (text, name) {\n return this.survey ? this.survey.getSurveyMarkdownHtml(this, text, name) : this.locOwner ? this.locOwner.getMarkdownHtml(text, name) : undefined;\n };\n SurveyElement.prototype.getRenderer = function (name) {\n return this.survey && typeof this.survey.getRendererForString === \"function\" ? this.survey.getRendererForString(this, name) : this.locOwner && typeof this.locOwner.getRenderer === \"function\" ? this.locOwner.getRenderer(name) : null;\n };\n SurveyElement.prototype.getRendererContext = function (locStr) {\n return this.survey && typeof this.survey.getRendererContextForString === \"function\" ? this.survey.getRendererContextForString(this, locStr) : this.locOwner && typeof this.locOwner.getRendererContext === \"function\" ? this.locOwner.getRendererContext(locStr) : locStr;\n };\n SurveyElement.prototype.getProcessedText = function (text) {\n if (this.isLoadingFromJson) return text;\n if (this.textProcessor) return this.textProcessor.processText(text, this.getUseDisplayValuesInDynamicTexts());\n if (this.locOwner) return this.locOwner.getProcessedText(text);\n return text;\n };\n SurveyElement.prototype.getUseDisplayValuesInDynamicTexts = function () {\n return true;\n };\n SurveyElement.prototype.removeSelfFromList = function (list) {\n if (!list || !Array.isArray(list)) return;\n var index = list.indexOf(this);\n if (index > -1) {\n list.splice(index, 1);\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"textProcessor\", {\n get: function () {\n return this.textProcessorValue;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getProcessedHtml = function (html) {\n if (!html || !this.textProcessor) return html;\n return this.textProcessor.processText(html, true);\n };\n SurveyElement.prototype.onSetData = function () {};\n Object.defineProperty(SurveyElement.prototype, \"parent\", {\n get: function () {\n return this.getPropertyValue(\"parent\", null);\n },\n set: function (val) {\n this.setPropertyValue(\"parent\", val);\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getPage = function (parent) {\n while (parent && parent.parent) parent = parent.parent;\n if (parent && parent.isPage) return parent;\n return null;\n };\n SurveyElement.prototype.moveToBase = function (parent, container, insertBefore) {\n if (insertBefore === void 0) {\n insertBefore = null;\n }\n if (!container) return false;\n parent.removeElement(this);\n var index = -1;\n if (helpers_Helpers.isNumber(insertBefore)) {\n index = parseInt(insertBefore);\n }\n if (index == -1 && !!insertBefore && !!insertBefore.getType) {\n index = container.indexOf(insertBefore);\n }\n container.addElement(this, index);\n return true;\n };\n SurveyElement.prototype.setPage = function (parent, newPage) {\n var oldPage = this.getPage(parent);\n this.prevSurvey = this.survey;\n //fix for the creator v1: https://github.com/surveyjs/survey-creator/issues/1744\n if (typeof newPage === \"string\") {\n var survey = this.getSurvey();\n survey.pages.forEach(function (page) {\n if (newPage === page.name) newPage = page;\n });\n }\n if (oldPage === newPage) return;\n if (parent) parent.removeElement(this);\n if (newPage) {\n newPage.addElement(this, -1);\n }\n this.prevSurvey = undefined;\n };\n SurveyElement.prototype.getSearchableLocKeys = function (keys) {\n keys.push(\"title\");\n keys.push(\"description\");\n };\n Object.defineProperty(SurveyElement.prototype, \"isDefaultV2Theme\", {\n get: function () {\n return this.survey && this.survey.getCss().root.indexOf(\"sd-root-modern\") !== -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"hasParent\", {\n get: function () {\n return this.parent && !this.parent.isPage || this.parent === undefined;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.shouldAddRunnerStyles = function () {\n return !this.isDesignMode && this.isDefaultV2Theme;\n };\n Object.defineProperty(SurveyElement.prototype, \"isCompact\", {\n get: function () {\n return this.survey && this.survey[\"isCompact\"];\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.canHaveFrameStyles = function () {\n return this.parent !== undefined && (!this.hasParent || this.parent && this.parent.showPanelAsPage);\n };\n SurveyElement.prototype.getHasFrameV2 = function () {\n return this.shouldAddRunnerStyles() && this.canHaveFrameStyles();\n };\n SurveyElement.prototype.getIsNested = function () {\n return this.shouldAddRunnerStyles() && !this.canHaveFrameStyles();\n };\n SurveyElement.prototype.getCssRoot = function (cssClasses) {\n var isExpanadable = !!this.isCollapsed || !!this.isExpanded;\n return new CssClassBuilder().append(cssClasses.withFrame, this.getHasFrameV2() && !this.isCompact).append(cssClasses.compact, this.isCompact && this.getHasFrameV2()).append(cssClasses.collapsed, !!this.isCollapsed).append(cssClasses.expandableAnimating, isExpanadable && this.isAnimatingCollapseExpand).append(cssClasses.expanded, !!this.isExpanded && this.renderedIsExpanded).append(cssClasses.expandable, isExpanadable).append(cssClasses.nested, this.getIsNested()).toString();\n };\n Object.defineProperty(SurveyElement.prototype, \"width\", {\n /**\n * Sets survey element width in CSS values.\n *\n * Default value: \"\"\n * @see minWidth\n * @see maxWidth\n */\n get: function () {\n return this.getPropertyValue(\"width\", \"\");\n },\n set: function (val) {\n this.setPropertyValue(\"width\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"minWidth\", {\n /**\n * Gets or sets minimum survey element width in CSS values.\n *\n * Default value: \"300px\" (taken from [`settings.minWidth`](https://surveyjs.io/form-library/documentation/settings#minWidth))\n * @see maxWidth\n * @see renderWidth\n * @see width\n */\n get: function () {\n return this.getPropertyValue(\"minWidth\");\n },\n set: function (val) {\n this.setPropertyValue(\"minWidth\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"maxWidth\", {\n /**\n * Gets or sets maximum survey element width in CSS values.\n *\n * Default value: \"100%\" (taken from [`settings.maxWidth`](https://surveyjs.io/form-library/documentation/settings#maxWidth))\n * @see minWidth\n * @see renderWidth\n * @see width\n */\n get: function () {\n return this.getPropertyValue(\"maxWidth\");\n },\n set: function (val) {\n this.setPropertyValue(\"maxWidth\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"renderWidth\", {\n /**\n * Returns a calculated width of the rendered survey element in CSS values.\n * @see width\n * @see minWidth\n * @see maxWidth\n */\n get: function () {\n return this.getPropertyValue(\"renderWidth\", \"\");\n },\n set: function (val) {\n this.setPropertyValue(\"renderWidth\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"indent\", {\n /**\n * Increases or decreases an indent of survey element content from the left edge. Accepts positive integer values and 0. Does not apply in the Default V2 theme.\n * @see rightIndent\n */\n get: function () {\n return this.getPropertyValue(\"indent\");\n },\n set: function (val) {\n this.setPropertyValue(\"indent\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"rightIndent\", {\n /**\n * Increases or decreases an indent of survey element content from the right edge. Accepts positive integer values and 0. Does not apply in the Default V2 theme.\n * @see indent\n */\n get: function () {\n return this.getPropertyValue(\"rightIndent\", 0);\n },\n set: function (val) {\n this.setPropertyValue(\"rightIndent\", val);\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getRootStyle = function () {\n var style = {};\n if (!!this.paddingLeft) {\n style[\"--sv-element-add-padding-left\"] = this.paddingLeft;\n }\n if (!!this.paddingRight) {\n style[\"--sv-element-add-padding-right\"] = this.paddingRight;\n }\n return style;\n };\n Object.defineProperty(SurveyElement.prototype, \"paddingLeft\", {\n get: function () {\n var _this = this;\n return this.getPropertyValue(\"paddingLeft\", undefined, function () {\n return _this.calcPaddingLeft();\n });\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.calcPaddingLeft = function () {\n return \"\";\n };\n Object.defineProperty(SurveyElement.prototype, \"paddingRight\", {\n get: function () {\n var _this = this;\n return this.getPropertyValue(\"paddingRight\", undefined, function () {\n return _this.calcPaddingRight();\n });\n },\n set: function (val) {\n this.setPropertyValue(\"paddingRight\", val);\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.calcPaddingRight = function () {\n return \"\";\n };\n SurveyElement.prototype.resetIndents = function () {\n this.resetPropertyValue(\"paddingLeft\");\n this.resetPropertyValue(\"paddingRight\");\n };\n SurveyElement.prototype.updateRootStyle = function () {\n var style = {};\n var _width;\n if (!!this.parent) {\n var columns = this.parent.getColumsForElement(this);\n _width = columns.reduce(function (sum, col) {\n return col.effectiveWidth + sum;\n }, 0);\n if (!!_width && _width !== 100) {\n style[\"flexGrow\"] = 1;\n style[\"flexShrink\"] = 0;\n style[\"flexBasis\"] = _width + \"%\";\n style[\"minWidth\"] = undefined;\n style[\"maxWidth\"] = this.maxWidth;\n }\n }\n if (Object.keys(style).length == 0) {\n var minWidth = \"\" + this.minWidth;\n if (!!minWidth && minWidth != \"auto\") {\n if (minWidth.indexOf(\"px\") != -1 && this.survey) {\n minWidth = minWidth.replace(\"px\", \"\");\n var minWidthNum = parseFloat(minWidth);\n if (!isNaN(minWidthNum)) {\n minWidth = minWidthNum * this.survey.widthScale / 100;\n minWidth = \"\" + minWidth + \"px\";\n }\n }\n minWidth = \"min(100%, \" + minWidth + \")\";\n }\n if (this.allowRootStyle && this.renderWidth) {\n // style[\"width\"] = this.renderWidth;\n style[\"flexGrow\"] = 1;\n style[\"flexShrink\"] = 1;\n style[\"flexBasis\"] = this.renderWidth;\n style[\"minWidth\"] = minWidth;\n style[\"maxWidth\"] = this.maxWidth;\n }\n }\n this.rootStyle = style;\n };\n SurveyElement.prototype.isContainsSelection = function (el) {\n var elementWithSelection = undefined;\n var _document = DomDocumentHelper.getDocument();\n if (DomDocumentHelper.isAvailable() && !!_document && _document[\"selection\"]) {\n elementWithSelection = _document[\"selection\"].createRange().parentElement();\n } else {\n var selection = DomWindowHelper.getSelection();\n if (!!selection && selection.rangeCount > 0) {\n var range = selection.getRangeAt(0);\n if (range.startOffset !== range.endOffset) {\n elementWithSelection = range.startContainer.parentNode;\n }\n }\n }\n return elementWithSelection == el;\n };\n Object.defineProperty(SurveyElement.prototype, \"clickTitleFunction\", {\n get: function () {\n var _this = this;\n if (this.needClickTitleFunction()) {\n return function (event) {\n if (!!event && _this.isContainsSelection(event.target)) {\n return;\n }\n return _this.processTitleClick();\n };\n }\n return undefined;\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.needClickTitleFunction = function () {\n return this.state !== \"default\";\n };\n SurveyElement.prototype.processTitleClick = function () {\n if (this.state !== \"default\") {\n this.toggleState();\n }\n };\n Object.defineProperty(SurveyElement.prototype, \"hasAdditionalTitleToolbar\", {\n get: function () {\n return false;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"additionalTitleToolbar\", {\n get: function () {\n return this.getAdditionalTitleToolbar();\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getAdditionalTitleToolbar = function () {\n return null;\n };\n SurveyElement.prototype.getCssTitle = function (cssClasses) {\n if (!cssClasses) return \"\";\n var isExpandable = this.state !== \"default\";\n var numInlineLimit = 4;\n return new CssClassBuilder().append(cssClasses.title).append(cssClasses.titleNumInline, (this.no || \"\").length > numInlineLimit || isExpandable).append(cssClasses.titleExpandable, isExpandable).append(cssClasses.titleExpanded, this.isExpanded).append(cssClasses.titleCollapsed, this.isCollapsed).append(cssClasses.titleDisabled, this.isDisabledStyle).append(cssClasses.titleReadOnly, this.isReadOnly).append(cssClasses.titleOnError, this.containsErrors).toString();\n };\n Object.defineProperty(SurveyElement.prototype, \"isDisabledStyle\", {\n get: function () {\n return this.getIsDisableAndReadOnlyStyles(false)[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"isReadOnlyStyle\", {\n get: function () {\n return this.getIsDisableAndReadOnlyStyles(false)[0];\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getIsDisableAndReadOnlyStyles = function (itemReadOnly) {\n var isPreview = this.isPreviewStyle;\n var isReadOnly = itemReadOnly || this.isReadOnly;\n var isReadOnlyStyle = isReadOnly && !isPreview;\n var isDisableStyle = !this.isDefaultV2Theme && (isReadOnly || isPreview);\n return [isReadOnlyStyle, isDisableStyle];\n };\n Object.defineProperty(SurveyElement.prototype, \"isPreviewStyle\", {\n get: function () {\n return !!this.survey && this.survey.state === \"preview\";\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.localeChanged = function () {\n _super.prototype.localeChanged.call(this);\n this.updateDescriptionVisibility(this.description);\n if (this.errors.length > 0) {\n this.errors.forEach(function (err) {\n err.updateText();\n });\n }\n };\n SurveyElement.prototype.setWrapperElement = function (element) {\n this.wrapperElement = element;\n };\n SurveyElement.prototype.getWrapperElement = function () {\n return this.wrapperElement;\n };\n Object.defineProperty(SurveyElement.prototype, \"isAnimatingCollapseExpand\", {\n get: function () {\n return this._isAnimatingCollapseExpand || this._renderedIsExpanded != this.isExpanded;\n },\n set: function (val) {\n if (val !== this._isAnimatingCollapseExpand) {\n this._isAnimatingCollapseExpand = val;\n this.updateElementCss(false);\n }\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.onElementExpanded = function (elementIsRendered) {};\n SurveyElement.prototype.getExpandCollapseAnimationOptions = function () {\n var _this = this;\n var beforeRunAnimation = function (el) {\n _this.isAnimatingCollapseExpand = true;\n prepareElementForVerticalAnimation(el);\n };\n var afterRunAnimation = function (el) {\n _this.isAnimatingCollapseExpand = false;\n cleanHtmlElementAfterAnimation(el);\n };\n return {\n getRerenderEvent: function () {\n return _this.onElementRerendered;\n },\n getEnterOptions: function () {\n var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;\n return {\n cssClass: cssClasses.contentEnter,\n onBeforeRunAnimation: beforeRunAnimation,\n onAfterRunAnimation: function (el) {\n afterRunAnimation(el);\n _this.onElementExpanded(true);\n }\n };\n },\n getLeaveOptions: function () {\n var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;\n return {\n cssClass: cssClasses.contentLeave,\n onBeforeRunAnimation: beforeRunAnimation,\n onAfterRunAnimation: afterRunAnimation\n };\n },\n getAnimatedElement: function () {\n var _a;\n var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;\n if (cssClasses.content) {\n var selector = classesToSelector(cssClasses.content);\n if (selector) {\n return (_a = _this.getWrapperElement()) === null || _a === void 0 ? void 0 : _a.querySelector(\":scope \" + selector);\n }\n }\n return undefined;\n },\n isAnimationEnabled: function () {\n return _this.isExpandCollapseAnimationEnabled;\n }\n };\n };\n Object.defineProperty(SurveyElement.prototype, \"isExpandCollapseAnimationEnabled\", {\n get: function () {\n return this.animationAllowed && !this.isDesignMode;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SurveyElement.prototype, \"renderedIsExpanded\", {\n get: function () {\n return !!this._renderedIsExpanded;\n },\n set: function (val) {\n var oldValue = this._renderedIsExpanded;\n this.animationCollapsed.sync(val);\n if (!this.isExpandCollapseAnimationEnabled && !oldValue && this.renderedIsExpanded) {\n this.onElementExpanded(false);\n }\n },\n enumerable: false,\n configurable: true\n });\n SurveyElement.prototype.getIsAnimationAllowed = function () {\n return _super.prototype.getIsAnimationAllowed.call(this) && !!this.survey && !this.survey[\"isEndLoadingFromJson\"];\n };\n SurveyElement.prototype.afterRenderCore = function (element) {\n this.onAfterRenderElement.fire(this, {\n htmlElement: element\n });\n };\n SurveyElement.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n if (this.titleToolbarValue) {\n this.titleToolbarValue.dispose();\n }\n };\n // TODO V2: get rid of this flag\n SurveyElement.CreateDisabledDesignElements = false;\n survey_element_decorate([jsonobject_property({\n defaultValue: null\n })], SurveyElement.prototype, \"dragTypeOverMe\", void 0);\n survey_element_decorate([jsonobject_property({\n defaultValue: false\n })], SurveyElement.prototype, \"isDragMe\", void 0);\n survey_element_decorate([jsonobject_property({\n onSet: function (newValue, target) {\n target.colSpan = newValue;\n }\n })], SurveyElement.prototype, \"effectiveColSpan\", void 0);\n survey_element_decorate([jsonobject_property({\n defaultValue: false\n })], SurveyElement.prototype, \"hasVisibleErrors\", void 0);\n survey_element_decorate([jsonobject_property({\n defaultValue: true\n })], SurveyElement.prototype, \"isSingleInRow\", void 0);\n survey_element_decorate([jsonobject_property({\n defaultValue: true\n })], SurveyElement.prototype, \"allowRootStyle\", void 0);\n survey_element_decorate([jsonobject_property()], SurveyElement.prototype, \"rootStyle\", void 0);\n survey_element_decorate([jsonobject_property()], SurveyElement.prototype, \"_renderedIsExpanded\", void 0);\n return SurveyElement;\n }(survey_element_SurveyElementCore);\n var RenderingCompletedAwaiter = /** @class */function () {\n function RenderingCompletedAwaiter(_elements, _renderedHandler, waitingTimeout) {\n var _this = this;\n if (waitingTimeout === void 0) {\n waitingTimeout = 100;\n }\n this._elements = _elements;\n this._renderedHandler = _renderedHandler;\n this._elementsToRenderCount = 0;\n this._elementsToRenderTimer = undefined;\n this._elementRenderedHandler = function (s, o) {\n var _a;\n (_a = s.onAfterRenderElement) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);\n _this._elementsToRenderCount--;\n if (_this._elementsToRenderCount <= 0) {\n _this.visibleElementsRendered();\n }\n };\n this._elements.forEach(function (element) {\n if (element.onAfterRenderElement) {\n element.onAfterRenderElement.add(_this._elementRenderedHandler);\n _this._elementsToRenderCount++;\n }\n });\n if (this._elementsToRenderCount > 0) {\n this._elementsToRenderTimer = setTimeout(function () {\n if (_this._elementsToRenderCount > 0) {\n _this.visibleElementsRendered();\n }\n }, waitingTimeout);\n } else {\n this.visibleElementsRendered();\n }\n }\n RenderingCompletedAwaiter.prototype.stopWaitingForElementsRendering = function () {\n var _this = this;\n if (this._elementsToRenderTimer) {\n clearTimeout(this._elementsToRenderTimer);\n this._elementsToRenderTimer = undefined;\n }\n this._elements.forEach(function (element) {\n var _a;\n (_a = element.onAfterRenderElement) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);\n });\n this._elementsToRenderCount = 0;\n };\n RenderingCompletedAwaiter.prototype.visibleElementsRendered = function () {\n var renderedHandler = this._renderedHandler;\n this.dispose();\n if (typeof renderedHandler == \"function\") {\n renderedHandler();\n }\n };\n RenderingCompletedAwaiter.prototype.dispose = function () {\n this.stopWaitingForElementsRendering();\n this._elements = undefined;\n this._renderedHandler = undefined;\n };\n return RenderingCompletedAwaiter;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/localizablestring.ts\n\n /**\n * The class represents the string that supports multi-languages and markdown.\n * It uses in all objects where support for multi-languages and markdown is required.\n */\n var localizablestring_LocalizableString = /** @class */function () {\n function LocalizableString(owner, useMarkdown, name, locName) {\n if (useMarkdown === void 0) {\n useMarkdown = false;\n }\n this.owner = owner;\n this.useMarkdown = useMarkdown;\n this.name = name;\n this.values = {};\n this.htmlValues = {};\n this.onStringChanged = new EventBase();\n this._localizationName = locName;\n this.onCreating();\n }\n Object.defineProperty(LocalizableString, \"defaultLocale\", {\n get: function () {\n return settings.localization.defaultLocaleName;\n },\n set: function (val) {\n settings.localization.defaultLocaleName = val;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"localizationName\", {\n get: function () {\n return this._localizationName;\n },\n set: function (val) {\n if (this._localizationName != val) {\n this._localizationName = val;\n this.strChanged();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"allowLineBreaks\", {\n get: function () {\n var _a;\n if (this._allowLineBreaks === undefined) {\n this._allowLineBreaks = false;\n if (!!this.name && this.owner instanceof survey_element_SurveyElementCore) {\n this._allowLineBreaks = ((_a = Serializer.findProperty(this.owner.getType(), this.name)) === null || _a === void 0 ? void 0 : _a.type) == \"text\";\n }\n }\n return this._allowLineBreaks;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.prototype.getIsMultiple = function () {\n return false;\n };\n Object.defineProperty(LocalizableString.prototype, \"locale\", {\n get: function () {\n if (this.owner && this.owner.getLocale) {\n var res = this.owner.getLocale();\n if (!!res || !this.sharedData) return res;\n }\n if (!!this.sharedData) return this.sharedData.locale;\n return \"\";\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.prototype.strChanged = function () {\n this.searchableText = undefined;\n if (this.renderedText === undefined && this.isEmpty && !this.onGetTextCallback && !this.localizationName) return;\n this.calculatedTextValue = this.calcText();\n if (this.renderedText !== this.calculatedTextValue) {\n this.renderedText = undefined;\n this.calculatedTextValue = undefined;\n }\n this.htmlValues = {};\n this.onChanged();\n this.onStringChanged.fire(this, {});\n };\n Object.defineProperty(LocalizableString.prototype, \"text\", {\n get: function () {\n return this.pureText;\n },\n set: function (value) {\n this.setLocaleText(this.locale, value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"calculatedText\", {\n get: function () {\n this.renderedText = this.calculatedTextValue !== undefined ? this.calculatedTextValue : this.calcText();\n this.calculatedTextValue = undefined;\n return this.renderedText;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.prototype.calcText = function () {\n var pureText = this.pureText;\n var res = pureText;\n if (res && this.owner && this.owner.getProcessedText && res.indexOf(\"{\") > -1) {\n res = this.owner.getProcessedText(res);\n }\n if (this.onGetTextCallback) res = this.onGetTextCallback(res, pureText);\n return res;\n };\n Object.defineProperty(LocalizableString.prototype, \"pureText\", {\n get: function () {\n var loc = this.locale;\n if (!loc) loc = this.defaultLoc;\n var res = this.getValue(loc);\n if (this.isValueEmpty(res) && loc === this.defaultLoc) {\n res = this.getValue(surveyLocalization.defaultLocale);\n }\n if (this.isValueEmpty(res)) {\n var dialect = this.getRootDialect(loc);\n if (!!dialect) {\n res = this.getValue(dialect);\n }\n }\n if (this.isValueEmpty(res) && loc !== this.defaultLoc) {\n res = this.getValue(this.defaultLoc);\n }\n if (this.isValueEmpty(res) && !!this.getLocalizationName()) {\n res = this.getLocalizationStr();\n if (!!this.onGetLocalizationTextCallback) {\n res = this.onGetLocalizationTextCallback(res);\n }\n }\n if (!res) res = this.defaultValue || \"\";\n return res;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.prototype.getRootDialect = function (loc) {\n if (!loc) return loc;\n var index = loc.indexOf(\"-\");\n return index > -1 ? loc.substring(0, index) : \"\";\n };\n LocalizableString.prototype.getLocalizationName = function () {\n return !!this.sharedData ? this.sharedData.localizationName : this.localizationName;\n };\n LocalizableString.prototype.getLocalizationStr = function () {\n var name = this.getLocalizationName();\n return !!name ? getLocaleString(name, this.locale) : \"\";\n };\n Object.defineProperty(LocalizableString.prototype, \"hasHtml\", {\n get: function () {\n return this.hasHtmlValue();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"html\", {\n get: function () {\n if (!this.hasHtml) return \"\";\n return this.getHtmlValue();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"isEmpty\", {\n get: function () {\n return this.getValuesKeys().length == 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"textOrHtml\", {\n get: function () {\n return this.hasHtml ? this.getHtmlValue() : this.calculatedText;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"renderedHtml\", {\n get: function () {\n return this.textOrHtml;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.prototype.getLocaleText = function (loc) {\n var res = this.getLocaleTextCore(loc);\n return res ? res : \"\";\n };\n LocalizableString.prototype.getLocaleTextCore = function (loc) {\n if (!loc) loc = this.defaultLoc;\n return this.getValue(loc);\n };\n LocalizableString.prototype.isLocaleTextEqualsWithDefault = function (loc, val) {\n var res = this.getLocaleTextCore(loc);\n if (res === val) return true;\n return this.isValueEmpty(res) && this.isValueEmpty(val);\n };\n LocalizableString.prototype.clear = function () {\n this.setJson(undefined);\n };\n LocalizableString.prototype.clearLocale = function (loc) {\n this.setLocaleText(loc, undefined);\n };\n LocalizableString.prototype.setLocaleText = function (loc, value) {\n loc = this.getValueLoc(loc);\n if (!!loc && value === undefined) {\n var oldValue_1 = this.getValue(loc);\n if (oldValue_1 !== undefined) {\n this.deleteValue(loc);\n this.fireStrChanged(loc, oldValue_1);\n }\n return;\n }\n if (!this.storeDefaultText && this.isLocaleTextEqualsWithDefault(loc, value)) {\n if (!this.isValueEmpty(value) || !!loc && loc !== this.defaultLoc) return;\n var dl = surveyLocalization.defaultLocale;\n var oldValue_2 = this.getValue(dl);\n if (!!dl && !this.isValueEmpty(oldValue_2)) {\n this.setValue(dl, value);\n this.fireStrChanged(dl, oldValue_2);\n }\n return;\n }\n if (!settings.localization.storeDuplicatedTranslations && !this.isValueEmpty(value) && loc && loc != this.defaultLoc && !this.getValue(loc) && value == this.getLocaleText(this.defaultLoc)) return;\n var curLoc = this.curLocale;\n if (!loc) loc = this.defaultLoc;\n var oldValue = this.onStrChanged && loc === curLoc ? this.pureText : undefined;\n delete this.htmlValues[loc];\n if (this.isValueEmpty(value)) {\n this.deleteValue(loc);\n } else {\n if (typeof value === \"string\") {\n if (this.canRemoveLocValue(loc, value)) {\n this.setLocaleText(loc, null);\n } else {\n this.setValue(loc, value);\n if (loc == this.defaultLoc) {\n this.deleteValuesEqualsToDefault(value);\n }\n }\n }\n }\n this.fireStrChanged(loc, oldValue);\n };\n LocalizableString.prototype.isValueEmpty = function (val) {\n if (val === undefined || val === null) return true;\n if (this.localizationName) return false;\n return val === \"\";\n };\n Object.defineProperty(LocalizableString.prototype, \"curLocale\", {\n get: function () {\n return !!this.locale ? this.locale : this.defaultLoc;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.prototype.canRemoveLocValue = function (loc, val) {\n if (settings.localization.storeDuplicatedTranslations) return false;\n if (loc === this.defaultLoc) return false;\n var dialect = this.getRootDialect(loc);\n if (!!dialect) {\n var dialectVal = this.getLocaleText(dialect);\n if (!!dialectVal) return dialectVal == val;\n return this.canRemoveLocValue(dialect, val);\n } else {\n return val == this.getLocaleText(this.defaultLoc);\n }\n };\n LocalizableString.prototype.fireStrChanged = function (loc, oldValue) {\n this.strChanged();\n if (!this.onStrChanged) return;\n var value = this.pureText;\n if (loc !== this.curLocale || oldValue !== value) {\n this.onStrChanged(oldValue, value);\n }\n };\n LocalizableString.prototype.hasNonDefaultText = function () {\n var keys = this.getValuesKeys();\n if (keys.length == 0) return false;\n return keys.length > 1 || keys[0] != this.defaultLoc;\n };\n LocalizableString.prototype.getLocales = function () {\n var keys = this.getValuesKeys();\n if (keys.length == 0) return [];\n return keys;\n };\n LocalizableString.prototype.getJson = function () {\n if (!!this.sharedData) return this.sharedData.getJson();\n var keys = this.getValuesKeys();\n if (keys.length == 0) {\n if (this.serializeCallBackText) {\n var text = this.calcText();\n if (!!text) return text;\n }\n return null;\n }\n if (keys.length == 1 && keys[0] == settings.localization.defaultLocaleName && !settings.serialization.localizableStringSerializeAsObject) return this.values[keys[0]];\n var res = {};\n for (var key in this.values) {\n res[key] = this.values[key];\n }\n return res;\n };\n LocalizableString.prototype.setJson = function (value, isLoading) {\n if (!!this.sharedData) {\n this.sharedData.setJson(value, isLoading);\n return;\n }\n this.values = {};\n this.htmlValues = {};\n if (value === null || value === undefined) return;\n if (isLoading) {\n if (typeof value === \"string\") {\n this.values[settings.defaultLocaleName] = value;\n } else {\n this.values = value;\n delete this.values[\"pos\"];\n }\n } else {\n if (typeof value === \"string\") {\n this.setLocaleText(null, value);\n } else {\n for (var key in value) {\n this.setLocaleText(key, value[key]);\n }\n }\n this.strChanged();\n }\n };\n Object.defineProperty(LocalizableString.prototype, \"renderAs\", {\n get: function () {\n if (!this.owner || typeof this.owner.getRenderer !== \"function\") {\n return LocalizableString.defaultRenderer;\n }\n return this.owner.getRenderer(this.name) || LocalizableString.defaultRenderer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableString.prototype, \"renderAsData\", {\n get: function () {\n if (!this.owner || typeof this.owner.getRendererContext !== \"function\") {\n return this;\n }\n return this.owner.getRendererContext(this) || this;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.prototype.equals = function (obj) {\n if (!!this.sharedData) return this.sharedData.equals(obj);\n if (!obj || !obj.values) return false;\n return helpers_Helpers.isTwoValueEquals(this.values, obj.values, false, true, false);\n };\n LocalizableString.prototype.setFindText = function (text) {\n if (this.searchText == text) return;\n this.searchText = text;\n if (!this.searchableText) {\n var textOrHtml = this.textOrHtml;\n this.searchableText = !!textOrHtml ? textOrHtml.toLowerCase() : \"\";\n }\n var str = this.searchableText;\n var index = !!str && !!text ? str.indexOf(text) : undefined;\n if (index < 0) index = undefined;\n if (index != undefined || this.searchIndex != index) {\n this.searchIndex = index;\n if (!!this.onSearchChanged) {\n this.onSearchChanged();\n }\n }\n return this.searchIndex != undefined;\n };\n LocalizableString.prototype.onChanged = function () {};\n LocalizableString.prototype.onCreating = function () {};\n LocalizableString.prototype.hasHtmlValue = function () {\n if (!this.owner || !this.useMarkdown) return false;\n var loc = this.locale;\n if (!loc) loc = this.defaultLoc;\n if (this.htmlValues[loc] !== undefined) return !!this.htmlValues[loc];\n var renderedText = this.calculatedText;\n if (!renderedText) {\n this.setHtmlValue(loc, \"\");\n return false;\n }\n if (!!this.getLocalizationName() && renderedText === this.getLocalizationStr()) {\n this.setHtmlValue(loc, \"\");\n return false;\n }\n var res = this.owner.getMarkdownHtml(renderedText, this.name);\n this.setHtmlValue(loc, res);\n return !!res;\n };\n LocalizableString.prototype.setHtmlValue = function (loc, val) {\n this.htmlValues[loc] = val;\n };\n LocalizableString.prototype.getHtmlValue = function () {\n var loc = this.locale;\n if (!loc) loc = this.defaultLoc;\n return this.htmlValues[loc];\n };\n LocalizableString.prototype.deleteValuesEqualsToDefault = function (defaultValue) {\n if (settings.localization.storeDuplicatedTranslations) return;\n var keys = this.getValuesKeys();\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] == this.defaultLoc) continue;\n if (this.getValue(keys[i]) == defaultValue) {\n this.deleteValue(keys[i]);\n }\n }\n };\n LocalizableString.prototype.getValue = function (loc) {\n if (!!this.sharedData) return this.sharedData.getValue(loc);\n return this.values[this.getValueLoc(loc)];\n };\n LocalizableString.prototype.setValue = function (loc, value) {\n if (!!this.sharedData) this.sharedData.setValue(loc, value);else this.values[this.getValueLoc(loc)] = value;\n };\n LocalizableString.prototype.deleteValue = function (loc) {\n if (!!this.sharedData) this.sharedData.deleteValue(loc);else delete this.values[this.getValueLoc(loc)];\n };\n LocalizableString.prototype.getValueLoc = function (loc) {\n if (this.disableLocalization) return settings.localization.defaultLocaleName;\n return loc;\n };\n LocalizableString.prototype.getValuesKeys = function () {\n if (!!this.sharedData) return this.sharedData.getValuesKeys();\n return Object.keys(this.values);\n };\n Object.defineProperty(LocalizableString.prototype, \"defaultLoc\", {\n get: function () {\n return settings.localization.defaultLocaleName;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableString.SerializeAsObject = false;\n LocalizableString.defaultRenderer = \"sv-string-viewer\";\n LocalizableString.editableRenderer = \"sv-string-editor\";\n return LocalizableString;\n }();\n\n /**\n * The class represents the list of strings that supports multi-languages.\n */\n var localizablestring_LocalizableStrings = /** @class */function () {\n function LocalizableStrings(owner) {\n this.owner = owner;\n this.values = {};\n }\n LocalizableStrings.prototype.getIsMultiple = function () {\n return true;\n };\n Object.defineProperty(LocalizableStrings.prototype, \"locale\", {\n get: function () {\n return this.owner && this.owner.getLocale ? this.owner.getLocale() : \"\";\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableStrings.prototype, \"value\", {\n get: function () {\n return this.getValue(\"\");\n },\n set: function (val) {\n this.setValue(\"\", val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizableStrings.prototype, \"text\", {\n get: function () {\n return Array.isArray(this.value) ? this.value.join(\"\\n\") : \"\";\n },\n set: function (val) {\n this.value = !!val ? val.split(\"\\n\") : [];\n },\n enumerable: false,\n configurable: true\n });\n LocalizableStrings.prototype.getLocaleText = function (loc) {\n var res = this.getValueCore(loc, !loc || loc === this.locale);\n if (!res || !Array.isArray(res) || res.length == 0) return \"\";\n return res.join(\"\\n\");\n };\n LocalizableStrings.prototype.setLocaleText = function (loc, newValue) {\n var val = !!newValue ? newValue.split(\"\\n\") : null;\n this.setValue(loc, val);\n };\n LocalizableStrings.prototype.getValue = function (loc) {\n return this.getValueCore(loc);\n };\n LocalizableStrings.prototype.getValueCore = function (loc, useDefault) {\n if (useDefault === void 0) {\n useDefault = true;\n }\n loc = this.getLocale(loc);\n if (this.values[loc]) return this.values[loc];\n if (useDefault) {\n var defLoc = settings.localization.defaultLocaleName;\n if (loc !== defLoc && this.values[defLoc]) return this.values[defLoc];\n }\n return [];\n };\n LocalizableStrings.prototype.setValue = function (loc, val) {\n loc = this.getLocale(loc);\n var oldValue = helpers_Helpers.createCopy(this.values);\n if (!val || val.length == 0) {\n delete this.values[loc];\n } else {\n this.values[loc] = val;\n }\n if (!!this.onValueChanged) {\n this.onValueChanged(oldValue, this.values);\n }\n };\n LocalizableStrings.prototype.hasValue = function (loc) {\n if (loc === void 0) {\n loc = \"\";\n }\n return !this.isEmpty && this.getValue(loc).length > 0;\n };\n Object.defineProperty(LocalizableStrings.prototype, \"isEmpty\", {\n get: function () {\n return this.getValuesKeys().length == 0;\n },\n enumerable: false,\n configurable: true\n });\n LocalizableStrings.prototype.getLocale = function (loc) {\n if (!!loc) return loc;\n loc = this.locale;\n return !!loc ? loc : settings.localization.defaultLocaleName;\n };\n LocalizableStrings.prototype.getLocales = function () {\n var keys = this.getValuesKeys();\n if (keys.length == 0) return [];\n return keys;\n };\n LocalizableStrings.prototype.getJson = function () {\n var keys = this.getValuesKeys();\n if (keys.length == 0) return null;\n if (keys.length == 1 && keys[0] == settings.localization.defaultLocaleName && !settings.serialization.localizableStringSerializeAsObject) return this.values[keys[0]];\n return helpers_Helpers.createCopy(this.values);\n };\n LocalizableStrings.prototype.setJson = function (value) {\n this.values = {};\n if (!value) return;\n if (Array.isArray(value)) {\n this.setValue(null, value);\n } else {\n for (var key in value) {\n this.setValue(key, value[key]);\n }\n }\n };\n LocalizableStrings.prototype.getValuesKeys = function () {\n return Object.keys(this.values);\n };\n return LocalizableStrings;\n }();\n\n // CONCATENATED MODULE: ./packages/survey-core/src/utils/utils.ts\n\n function compareVersions(a, b) {\n var regExStrip0 = /(\\.0+)+$/;\n var segmentsA = a.replace(regExStrip0, \"\").split(\".\");\n var segmentsB = b.replace(regExStrip0, \"\").split(\".\");\n var len = Math.min(segmentsA.length, segmentsB.length);\n for (var i = 0; i < len; i++) {\n var diff = parseInt(segmentsA[i], 10) - parseInt(segmentsB[i], 10);\n if (diff) {\n return diff;\n }\n }\n return segmentsA.length - segmentsB.length;\n }\n function confirmAction(message) {\n if (!!settings && !!settings.confirmActionFunc) return settings.confirmActionFunc(message);\n return confirm(message);\n }\n function confirmActionAsync(options) {\n var callbackFunc = function (res) {\n if (res) options.funcOnYes();else if (!!options.funcOnNo) options.funcOnNo();\n };\n if (!!settings && !!settings.confirmActionAsync) {\n if (settings.confirmActionAsync(options.message, callbackFunc, options)) return;\n }\n callbackFunc(confirmAction(options.message));\n }\n function detectIEBrowser() {\n var ua = navigator.userAgent;\n var oldIe = ua.indexOf(\"MSIE \");\n var elevenIe = ua.indexOf(\"Trident/\");\n return oldIe > -1 || elevenIe > -1;\n }\n function detectIEOrEdge() {\n if (typeof detectIEOrEdge.isIEOrEdge === \"undefined\") {\n var ua = navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n var trident = ua.indexOf(\"Trident/\");\n var edge = ua.indexOf(\"Edge/\");\n detectIEOrEdge.isIEOrEdge = edge > 0 || trident > 0 || msie > 0;\n }\n return detectIEOrEdge.isIEOrEdge;\n }\n function loadFileFromBase64(b64Data, fileName) {\n try {\n var byteString = atob(b64Data.split(\",\")[1]);\n // separate out the mime component\n var mimeString = b64Data.split(\",\")[0].split(\":\")[1].split(\";\")[0];\n // write the bytes of the string to an ArrayBuffer\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n // write the ArrayBuffer to a blob, and you're done\n var bb = new Blob([ab], {\n type: mimeString\n });\n if (!!navigator && navigator[\"msSaveBlob\"]) {\n navigator[\"msSaveOrOpenBlob\"](bb, fileName);\n }\n } catch (err) {}\n }\n function isMobile() {\n return DomWindowHelper.isAvailable() && DomWindowHelper.hasOwn(\"orientation\");\n }\n var isShadowDOM = function (rootElement) {\n return !!rootElement && !!(\"host\" in rootElement && rootElement.host);\n };\n var getElement = function (element) {\n var root = settings.environment.root;\n return typeof element === \"string\" ? root.getElementById(element) : element;\n };\n function isElementVisible(element, threshold) {\n if (threshold === void 0) {\n threshold = 0;\n }\n if (typeof settings.environment === \"undefined\") {\n return false;\n }\n var root = settings.environment.root;\n var clientHeight = isShadowDOM(root) ? root.host.clientHeight : root.documentElement.clientHeight;\n var elementRect = element.getBoundingClientRect();\n var viewHeight = Math.max(clientHeight, DomWindowHelper.getInnerHeight());\n var topWin = -threshold;\n var bottomWin = viewHeight + threshold;\n var topEl = elementRect.top;\n var bottomEl = elementRect.bottom;\n var maxTop = Math.max(topWin, topEl);\n var minBottom = Math.min(bottomWin, bottomEl);\n return maxTop <= minBottom;\n }\n function findScrollableParent(element) {\n var root = settings.environment.root;\n if (!element) {\n return isShadowDOM(root) ? root.host : root.documentElement;\n }\n if (element.scrollHeight > element.clientHeight && (getComputedStyle(element).overflowY === \"scroll\" || getComputedStyle(element).overflowY === \"auto\")) {\n return element;\n }\n if (element.scrollWidth > element.clientWidth && (getComputedStyle(element).overflowX === \"scroll\" || getComputedStyle(element).overflowX === \"auto\")) {\n return element;\n }\n return findScrollableParent(element.parentElement);\n }\n function activateLazyRenderingChecks(id) {\n var environment = settings.environment;\n if (!environment) return;\n var root = environment.root;\n var el = root.getElementById(id);\n if (!el) return;\n var scrollableEl = findScrollableParent(el);\n if (!!scrollableEl) {\n setTimeout(function () {\n return scrollableEl.dispatchEvent(new CustomEvent(\"scroll\"));\n }, 10);\n }\n }\n function navigateToUrl(url) {\n var location = DomWindowHelper.getLocation();\n if (!url || !location) return;\n location.href = getSafeUrl(url);\n }\n function wrapUrlForBackgroundImage(url) {\n return !!url ? [\"url(\", url, \")\"].join(\"\") : \"\";\n }\n function isBase64URL(url) {\n if (typeof url == \"string\") {\n return /^data:((?:\\w+\\/(?:(?!;).)+)?)((?:;[^;]+?)*),(.+)$/.test(url);\n }\n return null;\n }\n // old-name: new-name\n var renamedIcons = {\n \"changecamera\": \"flip-24x24\",\n \"clear\": \"clear-24x24\",\n \"cancel\": \"cancel-24x24\",\n \"closecamera\": \"close-24x24\",\n \"defaultfile\": \"file-72x72\",\n \"choosefile\": \"folder-24x24\",\n \"file\": \"toolbox-file-24x24\",\n \"left\": \"chevronleft-16x16\",\n \"modernbooleancheckchecked\": \"plus-32x32\",\n \"modernbooleancheckunchecked\": \"minus-32x32\",\n \"more\": \"more-24x24\",\n \"navmenu_24x24\": \"navmenu-24x24\",\n \"removefile\": \"error-24x24\",\n \"takepicture\": \"camera-32x32\",\n \"takepicture_24x24\": \"camera-24x24\",\n \"v2check\": \"check-16x16\",\n \"checked\": \"check-16x16\",\n \"v2check_24x24\": \"check-24x24\",\n \"back-to-panel_16x16\": \"restoredown-16x16\",\n \"clear_16x16\": \"clear-16x16\",\n \"close_16x16\": \"close-16x16\",\n \"collapsedetail\": \"collapsedetails-16x16\",\n \"expanddetail\": \"expanddetails-16x16\",\n \"full-screen_16x16\": \"maximize-16x16\",\n \"loading\": \"loading-48x48\",\n \"minimize_16x16\": \"minimize-16x16\",\n \"next_16x16\": \"chevronright-16x16\",\n \"previous_16x16\": \"chevronleft-16x16\",\n \"no-image\": \"noimage-48x48\",\n \"ranking-dash\": \"rankingundefined-16x16\",\n \"drag-n-drop\": \"drag-24x24\",\n \"ranking-arrows\": \"reorder-24x24\",\n \"restore_16x16\": \"fullsize-16x16\",\n \"reset\": \"restore-24x24\",\n \"search\": \"search-24x24\",\n \"average\": \"smiley-rate5-24x24\",\n \"excellent\": \"smiley-rate9-24x24\",\n \"good\": \"smiley-rate7-24x24\",\n \"normal\": \"smiley-rate6-24x24\",\n \"not-good\": \"smiley-rate4-24x24\",\n \"perfect\": \"smiley-rate10-24x24\",\n \"poor\": \"smiley-rate3-24x24\",\n \"terrible\": \"smiley-rate1-24x24\",\n \"very-good\": \"smiley-rate8-24x24\",\n \"very-poor\": \"smiley-rate2-24x24\",\n \"add_16x16\": \"add-16x16\",\n \"add_24x24\": \"add-24x24\",\n \"alert_24x24\": \"warning-24x24\",\n \"apply\": \"apply-24x24\",\n \"arrow-down\": \"arrowdown-24x24\",\n \"arrow-left\": \"arrowleft-24x24\",\n \"arrow-left_16x16\": \"arrowleft-16x16\",\n \"arrowleft\": \"arrowleft-16x16\",\n \"arrow-right\": \"arrowright-24x24\",\n \"arrow-right_16x16\": \"arrowright-16x16\",\n \"arrowright\": \"arrowright-16x16\",\n \"arrow-up\": \"arrowup-24x24\",\n \"boolean\": \"toolbox-boolean-24x24\",\n \"change-question-type_16x16\": \"speechbubble-16x16\",\n \"checkbox\": \"toolbox-checkbox-24x24\",\n \"collapse-detail_16x16\": \"minusbox-16x16\",\n \"collapse-panel\": \"collapse-pg-24x24\",\n \"collapse_16x16\": \"collapse-16x16\",\n \"color-picker\": \"dropper-16x16\",\n \"comment\": \"toolbox-longtext-24x24\",\n \"config\": \"wrench-24x24\",\n \"copy\": \"copy-24x24\",\n \"default\": \"toolbox-customquestion-24x24\",\n \"delete_16x16\": \"delete-16x16\",\n \"delete_24x24\": \"delete-24x24\",\n \"delete\": \"delete-24x24\",\n \"description-hide\": \"hidehint-16x16\",\n \"description\": \"hint-16x16\",\n \"device-desktop\": \"desktop-24x24\",\n \"device-phone\": \"phone-24x24\",\n \"device-rotate\": \"rotate-24x24\",\n \"device-tablet\": \"tablet-24x24\",\n \"download\": \"download-24x24\",\n \"drag-area-indicator\": \"drag-24x24\",\n \"drag-area-indicator_24x16\": \"draghorizontal-24x16\",\n \"v2dragelement_16x16\": \"draghorizontal-24x16\",\n \"drop-down-arrow\": \"chevrondown-24x24\",\n \"drop-down-arrow_16x16\": \"chevrondown-16x16\",\n \"chevron_16x16\": \"chevrondown-16x16\",\n \"dropdown\": \"toolbox-dropdown-24x24\",\n \"duplicate_16x16\": \"copy-16x16\",\n \"edit\": \"edit-24x24\",\n \"edit_16x16\": \"edit-16x16\",\n \"editing-finish\": \"finishedit-24x24\",\n \"error\": \"error-16x16\",\n \"expand-detail_16x16\": \"plusbox-16x16\",\n \"expand-panel\": \"expand-pg-24x24\",\n \"expand_16x16\": \"expand-16x16\",\n \"expression\": \"toolbox-expression-24x24\",\n \"fast-entry\": \"textedit-24x24\",\n \"fix\": \"fix-24x24\",\n \"html\": \"toolbox-html-24x24\",\n \"image\": \"toolbox-image-24x24\",\n \"imagepicker\": \"toolbox-imagepicker-24x24\",\n \"import\": \"import-24x24\",\n \"invisible-items\": \"invisible-24x24\",\n \"language\": \"language-24x24\",\n \"load\": \"import-24x24\",\n \"logic-collapse\": \"collapse-24x24\",\n \"logic-expand\": \"expand-24x24\",\n \"logo\": \"image-48x48\",\n \"matrix\": \"toolbox-matrix-24x24\",\n \"matrixdropdown\": \"toolbox-multimatrix-24x24\",\n \"matrixdynamic\": \"toolbox-dynamicmatrix-24x24\",\n \"multipletext\": \"toolbox-multipletext-24x24\",\n \"panel\": \"toolbox-panel-24x24\",\n \"paneldynamic\": \"toolbox-dynamicpanel-24x24\",\n \"preview\": \"preview-24x24\",\n \"radiogroup\": \"toolbox-radiogroup-24x24\",\n \"ranking\": \"toolbox-ranking-24x24\",\n \"rating\": \"toolbox-rating-24x24\",\n \"redo\": \"redo-24x24\",\n \"remove_16x16\": \"remove-16x16\",\n \"required\": \"required-16x16\",\n \"save\": \"save-24x24\",\n \"select-page\": \"selectpage-24x24\",\n \"settings\": \"settings-24x24\",\n \"settings_16x16\": \"settings-16x16\",\n \"signaturepad\": \"toolbox-signature-24x24\",\n \"switch-active_16x16\": \"switchon-16x16\",\n \"switch-inactive_16x16\": \"switchoff-16x16\",\n \"tagbox\": \"toolbox-tagbox-24x24\",\n \"text\": \"toolbox-singleline-24x24\",\n \"theme\": \"theme-24x24\",\n \"toolbox\": \"toolbox-24x24\",\n \"undo\": \"undo-24x24\",\n \"visible\": \"visible-24x24\",\n \"wizard\": \"wand-24x24\",\n \"searchclear\": \"clear-16x16\",\n \"chevron-16x16\": \"chevrondown-16x16\",\n \"chevron\": \"chevrondown-24x24\",\n \"progressbuttonv2\": \"arrowleft-16x16\",\n \"right\": \"chevronright-16x16\",\n \"add-lg\": \"add-24x24\",\n \"add\": \"add-24x24\"\n };\n function getIconNameFromProxy(iconName) {\n var customIconName = getCustomNewIconNameIfExists(iconName);\n return customIconName || getNewIconName(iconName);\n }\n function getNewIconName(iconName) {\n var prefix = \"icon-\";\n var nameWithoutPrefix = iconName.replace(prefix, \"\");\n var result = renamedIcons[nameWithoutPrefix] || nameWithoutPrefix;\n return prefix + result;\n }\n function getCustomNewIconNameIfExists(iconName) {\n // only for settings.customIcons[\"icon-import\"] = \"icon-export\"; feature\n var result = settings.customIcons[iconName];\n if (result) return getNewIconName(result);\n iconName = getNewIconName(iconName);\n result = settings.customIcons[iconName];\n if (result) return result;\n return null;\n }\n function createSvg(size, width, height, iconName, svgElem, title) {\n if (!svgElem) return;\n if (size !== \"auto\") {\n svgElem.style.width = (size || width || 16) + \"px\";\n svgElem.style.height = (size || height || 16) + \"px\";\n }\n var node = svgElem.childNodes[0];\n var realIconName = getIconNameFromProxy(iconName);\n node.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", \"#\" + realIconName);\n var titleElement = svgElem.getElementsByTagName(\"title\")[0];\n if (!title) {\n if (!!titleElement) {\n svgElem.removeChild(titleElement);\n }\n return;\n } else {\n if (!titleElement) {\n titleElement = DomDocumentHelper.getDocument().createElementNS(\"http://www.w3.org/2000/svg\", \"title\");\n svgElem.appendChild(titleElement);\n }\n }\n titleElement.textContent = title;\n }\n function getSafeUrl(url) {\n if (!url) return url;\n if (url.toLocaleLowerCase().indexOf(\"javascript:\") > -1) return encodeURIComponent(url);\n return url;\n }\n function unwrap(value) {\n if (typeof value !== \"function\") {\n return value;\n } else {\n return value();\n }\n }\n // export function getSize(value: any): number {\n // if (typeof value === \"number\") {\n // return value;\n // }\n // if (typeof value === \"string\" && value.includes(\"px\")) {\n // return parseInt(value);\n // }\n // if (!!value && typeof value === \"string\" && value.length > 0) {\n // const lastSymbol: string = value[value.length - 1];\n // if ((lastSymbol >= \"0\" && lastSymbol <= \"9\") || lastSymbol == \".\") {\n // try {\n // const num: number = parseInt(value);\n // return num;\n // } catch { }\n // }\n // }\n // return value;\n // }\n function getRenderedSize(val) {\n if (typeof val == \"string\") {\n if (!isNaN(Number(val))) {\n return Number(val);\n } else if (val.includes(\"px\")) {\n return parseFloat(val);\n }\n }\n if (typeof val == \"number\") {\n return val;\n }\n return undefined;\n }\n function getRenderedStyleSize(val) {\n if (getRenderedSize(val) !== undefined) {\n return undefined;\n }\n return val;\n }\n var keyFocusedClassName = \"sv-focused--by-key\";\n function doKey2ClickBlur(evt) {\n var element = evt.target;\n if (!element || !element.classList) return;\n element.classList.remove(keyFocusedClassName);\n }\n function doKey2ClickUp(evt, options) {\n if (!!evt.target && evt.target[\"contentEditable\"] === \"true\") {\n return;\n }\n var element = evt.target;\n if (!element) return;\n var char = evt.which || evt.keyCode;\n if (char === 9) {\n if (!!element.classList && !element.classList.contains(keyFocusedClassName)) {\n element.classList.add(keyFocusedClassName);\n }\n return;\n }\n if (options) {\n if (!options.__keyDownReceived) return;\n options.__keyDownReceived = false;\n }\n if (char === 13 || char === 32) {\n if (element.click) element.click();\n } else if ((!options || options.processEsc) && char === 27) {\n if (element.blur) element.blur();\n }\n }\n function doKey2ClickDown(evt, options) {\n if (options === void 0) {\n options = {\n processEsc: true\n };\n }\n if (options) options.__keyDownReceived = true;\n if (!!evt.target && evt.target[\"contentEditable\"] === \"true\") {\n return;\n }\n var char = evt.which || evt.keyCode;\n var supportedCodes = [13, 32];\n if (options.processEsc) {\n supportedCodes.push(27);\n }\n if (supportedCodes.indexOf(char) !== -1) {\n evt.preventDefault();\n }\n }\n function increaseHeightByContent(element, getComputedStyle) {\n if (!element) return;\n if (!getComputedStyle) getComputedStyle = function (elt) {\n return DomDocumentHelper.getComputedStyle(elt);\n };\n var style = getComputedStyle(element);\n element.style.height = \"auto\";\n if (!!element.scrollHeight) {\n element.style.height = element.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth) + \"px\";\n }\n }\n function getOriginalEvent(event) {\n return event.originalEvent || event;\n }\n function preventDefaults(event) {\n event.preventDefault();\n event.stopPropagation();\n }\n function classesToSelector(str) {\n if (!str) return str;\n var re = /\\s*?([\\w-]+)\\s*?/g;\n return str.replace(re, \".$1\");\n }\n function getElementWidth(el) {\n return !!getComputedStyle ? Number.parseFloat(getComputedStyle(el).width) : el.offsetWidth;\n }\n function isContainerVisible(el) {\n return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);\n }\n function getFirstVisibleChild(el) {\n var result;\n for (var index = 0; index < el.children.length; index++) {\n if (!result && getComputedStyle(el.children[index]).display !== \"none\") {\n result = el.children[index];\n }\n }\n return result;\n }\n function findParentByClassNames(element, classNames) {\n if (!!element) {\n if (classNames.every(function (className) {\n return !className || element.classList.contains(className);\n })) {\n return element;\n } else {\n return findParentByClassNames(element.parentElement, classNames);\n }\n }\n }\n function sanitizeEditableContent(element, cleanLineBreaks) {\n if (cleanLineBreaks === void 0) {\n cleanLineBreaks = true;\n }\n if (DomWindowHelper.isAvailable() && DomDocumentHelper.isAvailable() && element.childNodes.length > 0) {\n var selection = DomWindowHelper.getSelection();\n if (selection.rangeCount == 0) {\n return;\n }\n var range = selection.getRangeAt(0);\n range.setStart(range.endContainer, range.endOffset);\n range.setEndAfter(element.lastChild);\n selection.removeAllRanges();\n selection.addRange(range);\n var tail = selection.toString();\n var innerText = element.innerText;\n tail = tail.replace(/\\r/g, \"\");\n if (cleanLineBreaks) {\n tail = tail.replace(/\\n/g, \"\");\n innerText = innerText.replace(/\\n/g, \"\");\n }\n var tail_len = tail.length;\n element.innerText = innerText;\n range = DomDocumentHelper.getDocument().createRange();\n range.setStart(element.firstChild, 0);\n range.setEnd(element.firstChild, 0);\n selection.removeAllRanges();\n selection.addRange(range);\n while (selection.toString().length < innerText.length - tail_len) {\n var selLen = selection.toString().length;\n selection.modify(\"extend\", \"forward\", \"character\");\n if (selection.toString().length == selLen) break;\n }\n range = selection.getRangeAt(0);\n range.setStart(range.endContainer, range.endOffset);\n }\n }\n function mergeValues(src, dest) {\n if (!dest || !src) return;\n if (typeof dest !== \"object\") return;\n for (var key in src) {\n var value = src[key];\n if (!Array.isArray(value) && value && typeof value === \"object\") {\n if (!dest[key] || typeof dest[key] !== \"object\") dest[key] = {};\n mergeValues(value, dest[key]);\n } else {\n dest[key] = value;\n }\n }\n }\n function updateListCssValues(res, css) {\n var listCssClasses = {};\n mergeValues(css.list, listCssClasses);\n mergeValues(res.list, listCssClasses);\n res[\"list\"] = listCssClasses;\n }\n var Logger = /** @class */function () {\n function Logger() {\n this._result = \"\";\n }\n Logger.prototype.log = function (action) {\n this._result += \"->\" + action;\n };\n Object.defineProperty(Logger.prototype, \"result\", {\n get: function () {\n return this._result;\n },\n enumerable: false,\n configurable: true\n });\n return Logger;\n }();\n function showConfirmDialog(message, callback, options) {\n var locStr = new localizablestring_LocalizableString(undefined);\n var popupViewModel = settings.showDialog({\n componentName: \"sv-string-viewer\",\n data: {\n locStr: locStr,\n locString: locStr,\n model: locStr\n },\n onApply: function () {\n callback(true);\n return true;\n },\n onCancel: function () {\n callback(false);\n return false;\n },\n title: message || options.message,\n displayMode: \"popup\",\n isFocusedContent: false,\n cssClass: options.cssClass || \"sv-popup--confirm\"\n }, options.rootElement);\n var toolbar = popupViewModel.footerToolbar;\n var applyBtn = toolbar.getActionById(\"apply\");\n var cancelBtn = toolbar.getActionById(\"cancel\");\n cancelBtn.title = getLocaleString(\"cancel\", options.locale);\n cancelBtn.innerCss = \"sv-popup__body-footer-item sv-popup__button sd-btn sd-btn--small\";\n applyBtn.title = options.applyTitle || getLocaleString(\"ok\", options.locale);\n applyBtn.innerCss = \"sv-popup__body-footer-item sv-popup__button sv-popup__button--danger sd-btn sd-btn--small sd-btn--danger\";\n configConfirmDialog(popupViewModel);\n return true;\n }\n function configConfirmDialog(popupViewModel) {\n popupViewModel.width = \"min-content\";\n }\n function chooseFiles(input, callback) {\n if (!DomWindowHelper.isFileReaderAvailable()) return;\n input.value = \"\";\n input.onchange = function (event) {\n if (!DomWindowHelper.isFileReaderAvailable()) return;\n if (!input || !input.files || input.files.length < 1) return;\n var files = [];\n for (var i = 0; i < input.files.length; i++) {\n files.push(input.files[i]);\n }\n callback(files);\n };\n input.click();\n }\n function compareArrays(oldValue, newValue, getKey) {\n var oldItemsMap = new Map();\n var newItemsMap = new Map();\n var commonItemsInNewMap = new Map();\n var commonItemsInOldMap = new Map();\n oldValue.forEach(function (item) {\n var itemKey = getKey(item);\n if (!oldItemsMap.has(itemKey)) {\n oldItemsMap.set(getKey(item), item);\n } else {\n //if keys are set incorrectly do not process comparing\n throw new Error(\"keys must be unique\");\n }\n });\n newValue.forEach(function (item) {\n var itemKey = getKey(item);\n if (!newItemsMap.has(itemKey)) {\n newItemsMap.set(itemKey, item);\n } else {\n //if keys are set incorrectly do not process comparing\n throw new Error(\"keys must be unique\");\n }\n });\n var addedItems = [];\n var deletedItems = [];\n //calculating addedItems and items that exist in both arrays\n newItemsMap.forEach(function (item, key) {\n if (!oldItemsMap.has(key)) {\n addedItems.push(item);\n } else {\n commonItemsInNewMap.set(key, commonItemsInNewMap.size);\n }\n });\n //calculating deletedItems and items that exist in both arrays\n oldItemsMap.forEach(function (item, key) {\n if (!newItemsMap.has(key)) {\n deletedItems.push(item);\n } else {\n commonItemsInOldMap.set(key, commonItemsInOldMap.size);\n }\n });\n //calculating reordered items\n var reorderedItems = [];\n commonItemsInNewMap.forEach(function (index, key) {\n var oldIndex = commonItemsInOldMap.get(key);\n var item = newItemsMap.get(key);\n if (oldIndex !== index) reorderedItems.push({\n item: item,\n movedForward: oldIndex < index\n });\n });\n //calculating merged array if multiple operations are applied at once\n var oldItemsWithCorrectOrder = new Array(oldValue.length);\n var commonItemsIndex = 0;\n var commonItemsKeysOrder = Array.from(commonItemsInNewMap.keys());\n oldValue.forEach(function (item, index) {\n if (commonItemsInNewMap.has(getKey(item))) {\n oldItemsWithCorrectOrder[index] = newItemsMap.get(commonItemsKeysOrder[commonItemsIndex]);\n commonItemsIndex++;\n } else {\n oldItemsWithCorrectOrder[index] = item;\n }\n });\n var valuesToInsertBeforeKey = new Map();\n var tempValuesArray = [];\n oldItemsWithCorrectOrder.forEach(function (item) {\n var itemKey = getKey(item);\n if (newItemsMap.has(itemKey)) {\n if (tempValuesArray.length > 0) {\n valuesToInsertBeforeKey.set(itemKey, tempValuesArray);\n tempValuesArray = [];\n }\n } else {\n tempValuesArray.push(item);\n }\n });\n var mergedItems = new Array();\n newItemsMap.forEach(function (item, key) {\n if (valuesToInsertBeforeKey.has(key)) {\n valuesToInsertBeforeKey.get(key).forEach(function (item) {\n mergedItems.push(item);\n });\n }\n mergedItems.push(item);\n });\n tempValuesArray.forEach(function (item) {\n mergedItems.push(item);\n });\n return {\n reorderedItems: reorderedItems,\n deletedItems: deletedItems,\n addedItems: addedItems,\n mergedItems: mergedItems\n };\n }\n function getVerticalDimensions(el) {\n if (DomDocumentHelper.isAvailable()) {\n var _a = DomDocumentHelper.getComputedStyle(el),\n paddingTop = _a.paddingTop,\n paddingBottom = _a.paddingBottom,\n borderTopWidth = _a.borderTopWidth,\n borderBottomWidth = _a.borderBottomWidth,\n marginTop = _a.marginTop,\n marginBottom = _a.marginBottom,\n boxSizing = _a.boxSizing;\n var heightTo = el.offsetHeight + \"px\";\n if (boxSizing == \"content-box\") {\n var heightPx_1 = el.offsetHeight;\n [borderBottomWidth, borderTopWidth, paddingBottom, paddingTop].forEach(function (style) {\n heightPx_1 -= parseFloat(style);\n });\n heightTo = heightPx_1 + \"px\";\n }\n return {\n paddingTop: paddingTop,\n paddingBottom: paddingBottom,\n borderTopWidth: borderTopWidth,\n borderBottomWidth: borderBottomWidth,\n marginTop: marginTop,\n marginBottom: marginBottom,\n heightFrom: \"0px\",\n heightTo: heightTo\n };\n } else {\n return undefined;\n }\n }\n function setPropertiesOnElementForAnimation(el, styles, prefix) {\n var _a;\n if (prefix === void 0) {\n prefix = \"--animation-\";\n }\n el[\"__sv_created_properties\"] = (_a = el[\"__sv_created_properties\"]) !== null && _a !== void 0 ? _a : [];\n Object.keys(styles).forEach(function (key) {\n var propertyName = \"\" + prefix + key.split(/\\.?(?=[A-Z])/).join(\"-\").toLowerCase();\n el.style.setProperty(propertyName, styles[key]);\n el[\"__sv_created_properties\"].push(propertyName);\n });\n }\n function prepareElementForVerticalAnimation(el) {\n setPropertiesOnElementForAnimation(el, getVerticalDimensions(el));\n }\n function cleanHtmlElementAfterAnimation(el) {\n if (Array.isArray(el[\"__sv_created_properties\"])) {\n el[\"__sv_created_properties\"].forEach(function (propertyName) {\n el.style.removeProperty(propertyName);\n });\n delete el[\"__sv_created_properties\"];\n }\n }\n function floorTo2Decimals(number) {\n return Math.floor(number * 100) / 100;\n }\n\n // CONCATENATED MODULE: ./packages/survey-core/src/settings.ts\n\n var settings_document = typeof globalThis !== \"undefined\" ? globalThis.document : undefined.document;\n var defaultEnvironment = !!settings_document ? {\n root: settings_document,\n _rootElement: DomDocumentHelper.getBody(),\n get rootElement() {\n var _a;\n return (_a = this._rootElement) !== null && _a !== void 0 ? _a : DomDocumentHelper.getBody();\n },\n set rootElement(rootElement) {\n this._rootElement = rootElement;\n },\n _popupMountContainer: DomDocumentHelper.getBody(),\n get popupMountContainer() {\n var _a;\n return (_a = this._popupMountContainer) !== null && _a !== void 0 ? _a : DomDocumentHelper.getBody();\n },\n set popupMountContainer(popupMountContainer) {\n this._popupMountContainer = popupMountContainer;\n },\n svgMountContainer: settings_document.head,\n stylesSheetsMountContainer: settings_document.head\n } : undefined;\n var columnWidthsByType = {\n \"file\": {\n minWidth: \"240px\"\n },\n \"comment\": {\n minWidth: \"200px\"\n }\n };\n /**\n * Global settings that apply to all surveys on the page. To specify one of the settings, use the code below:\n *\n * ```js\n * import { settings } from \"survey-core\";\n *\n * settings.settingName = \"value\";\n * ```\n */\n var settings = {\n version: \"\",\n /**\n * An object that configures survey appearance when the survey is being designed in Survey Creator.\n *\n * Nested properties:\n *\n * - `showEmptyDescriptions`: `boolean`\\\n * Specifies whether to display an empty description for pages and panels. Default value: `true`.\n *\n * - `showEmptyTitles`: `boolean`\\\n * Specifies whether to display an empty title for pages and panels. Default value: `true`.\n */\n designMode: {\n showEmptyDescriptions: true,\n showEmptyTitles: true\n },\n //#region designMode section, Obsolete properties\n get allowShowEmptyDescriptionInDesignMode() {\n return this.designMode.showEmptyDescriptions;\n },\n set allowShowEmptyDescriptionInDesignMode(val) {\n this.designMode.showEmptyDescriptions = val;\n },\n get allowShowEmptyTitleInDesignMode() {\n return this.designMode.showEmptyTitles;\n },\n set allowShowEmptyTitleInDesignMode(val) {\n this.designMode.showEmptyTitles = val;\n },\n //#endregion\n /**\n * An object that contains properties related to localization.\n *\n * Nested properties:\n *\n * - `useLocalTimeZone`: `boolean`\\\n * Disable this property if you want internal SurveyJS functions to use methods that work with UTC date and time (`setUTCDate()` `setUTCHours()`, etc.) instead of methods that work with local date and time (`setYear()`, `setHours()`, etc.). Default value: `true`.\n *\n * - `defaultLocaleName`: `string`\\\n * A property key that stores a translation for the default locale. Default value: `\"default\"`.\n *\n * - `storeDuplicatedTranslations`: `boolean`\\\n * Specifies whether surveys should store translation strings that equal the translation strings in the default locale. Default value: `false`.\n */\n localization: {\n useLocalTimeZone: true,\n storeDuplicatedTranslations: false,\n defaultLocaleName: \"default\"\n },\n //#region localization section, obsolete properties\n get useLocalTimeZone() {\n return this.localization.useLocalTimeZone;\n },\n set useLocalTimeZone(val) {\n this.localization.useLocalTimeZone = val;\n },\n get storeDuplicatedTranslations() {\n return this.localization.storeDuplicatedTranslations;\n },\n set storeDuplicatedTranslations(val) {\n this.localization.storeDuplicatedTranslations = val;\n },\n get defaultLocaleName() {\n return this.localization.defaultLocaleName;\n },\n set defaultLocaleName(val) {\n this.localization.defaultLocaleName = val;\n },\n //#endregion\n /**\n * An object with properties that configure surveys when they work with a web service.\n *\n * Nested properties:\n *\n * - `encodeUrlParams`: `boolean`\\\n * Specifies whether to encode URL parameters when you access a web service. Default value: `true`.\n *\n * - `cacheLoadedChoices`: `boolean`\\\n * Specifies whether to cache [choices loaded from a web service](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choicesByUrl). Default value: `true`.\n *\n * - `disableQuestionWhileLoadingChoices`: `boolean`\\\n * Disables a question while its choices are being loaded from a web service. Default value: `false`.\n *\n * - `surveyServiceUrl`: `string`\\\n * The URL of the SurveyJS Service API endpoint.\n *\n * - `onBeforeRequestChoices`: `(sender: ChoicesRestful, options: { request: XMLHttpRequest })`\\\n * An event that is raised before a request for choices is send. Applies to questions with a specified [`choiceByUrl`](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choicesByUrl) property. Use the `options.request` parameter to access and modify the `XMLHttpRequest` object. For instance, you can add authentication headers to it:\n *\n * ```js\n * import { settings } from \"survey-core\";\n *\n * settings.web.onBeforeSendRequest = (sender, options) => {\n * options.request.setRequestHeader('RequestVerificationToken', requestVerificationToken);\n * };\n * ```\n */\n web: {\n onBeforeRequestChoices: function (sender, options) {},\n encodeUrlParams: true,\n cacheLoadedChoices: true,\n disableQuestionWhileLoadingChoices: false,\n surveyServiceUrl: \"https://api.surveyjs.io/public/v1/Survey\"\n },\n //#region web section, obsolete properties\n get webserviceEncodeParameters() {\n return this.web.encodeUrlParams;\n },\n set webserviceEncodeParameters(val) {\n this.web.encodeUrlParams = val;\n },\n get useCachingForChoicesRestful() {\n return this.web.cacheLoadedChoices;\n },\n set useCachingForChoicesRestful(val) {\n this.web.cacheLoadedChoices = val;\n },\n get useCachingForChoicesRestfull() {\n return this.web.cacheLoadedChoices;\n },\n set useCachingForChoicesRestfull(val) {\n this.web.cacheLoadedChoices = val;\n },\n get disableOnGettingChoicesFromWeb() {\n return this.web.disableQuestionWhileLoadingChoices;\n },\n set disableOnGettingChoicesFromWeb(val) {\n this.web.disableQuestionWhileLoadingChoices = val;\n },\n get surveyServiceUrl() {\n return this.web.surveyServiceUrl;\n },\n set surveyServiceUrl(val) {\n this.web.surveyServiceUrl = val;\n },\n //#endregion\n /**\n * An object that contains properties related to [triggers](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-survey-logic-triggers).\n *\n * Nested properties:\n *\n * - `changeNavigationButtonsOnComplete`: `boolean`\\\n * Specifies whether to re-evaluate an expression associated with the [Complete trigger](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#complete) immediately when a question value changes. If the expression evaluates to `true`, the trigger is executed. Default value: `false`.\\\n * Keep this property set to `false` if you want to re-evaluate the Complete trigger's expression only when the respondents navigate to another page.\n *\n * - `executeCompleteOnValueChanged`: `boolean`\\\n * Specifies whether to replace the Next button with the Complete button when the [Complete trigger](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#complete) is going to be executed. Default value: `true`.\n *\n * - `executeSkipOnValueChanged`: `boolean`\\\n * Specifies whether to re-evaluate an expression associated with the [Skip trigger](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#skip) immediately when a question value changes. If the expression evaluates to `true`, the trigger is executed. Default value: `true`.\\\n * Disable this property if you want to re-evaluate the Skip trigger's expression only when respondents navigate to another page.\n */\n triggers: {\n changeNavigationButtonsOnComplete: true,\n executeCompleteOnValueChanged: false,\n executeSkipOnValueChanged: true\n },\n //#region triggers section, Obsolete properties\n get executeCompleteTriggerOnValueChanged() {\n return this.triggers.executeCompleteOnValueChanged;\n },\n set executeCompleteTriggerOnValueChanged(val) {\n this.triggers.executeCompleteOnValueChanged = val;\n },\n get changeNavigationButtonsOnCompleteTrigger() {\n return this.triggers.changeNavigationButtonsOnComplete;\n },\n set changeNavigationButtonsOnCompleteTrigger(val) {\n this.triggers.changeNavigationButtonsOnComplete = val;\n },\n get executeSkipTriggerOnValueChanged() {\n return this.triggers.executeSkipOnValueChanged;\n },\n set executeSkipTriggerOnValueChanged(val) {\n this.triggers.executeSkipOnValueChanged = val;\n },\n //#endregion\n /**\n * An object that contains properties related to JSON serialization.\n *\n * Nested properties:\n *\n * - `itemValueSerializeAsObject`: `boolean`\\\n * Enable this property if you want to serialize [`ItemValue`](https://surveyjs.io/form-library/documentation/api-reference/itemvalue) instances (choice options, matrix rows, columns in a [Single-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model)) as objects even when they include only the `value` property. Default value: `false`.\n *\n * - `itemValueSerializeDisplayText`: `boolean`\\\n * Enable this property if you want to serialize the `text` property of [`ItemValue`](https://surveyjs.io/form-library/documentation/api-reference/itemvalue) objects even when it is empty or equal to the `value` property. Default value: `false`.\n *\n * - `localizableStringSerializeAsObject`: `boolean`\\\n * Enable this property if you want to serialize [`LocalizableString`](https://surveyjs.io/form-library/documentation/api-reference/localizablestring) instances as objects even when they include only a translation string for the default locale. For example, `\"Custom String\"` will be serialized as `{ default: \"Custom String\" }`. Default value: `false`.\n *\n * - `matrixDropdownColumnSerializeTitle`: `boolean`\\\n * Enable this property if you want to serialize the `title` property of [`MatrixDropdownColumn`](https://surveyjs.io/form-library/documentation/api-reference/multi-select-matrix-column-values) objects even when it is empty or equal to the `name` property. Default value: `false`.\n * @see [settings.parseNumber](https://surveyjs.io/form-library/documentation/api-reference/settings#parseNumber)\n */\n serialization: {\n itemValueSerializeAsObject: false,\n itemValueSerializeDisplayText: false,\n localizableStringSerializeAsObject: false,\n matrixDropdownColumnSerializeTitle: false\n },\n //#region serialization section, Obsolete properties\n get itemValueAlwaysSerializeAsObject() {\n return this.serialization.itemValueSerializeAsObject;\n },\n set itemValueAlwaysSerializeAsObject(val) {\n this.serialization.itemValueSerializeAsObject = val;\n },\n get itemValueAlwaysSerializeText() {\n return this.serialization.itemValueSerializeDisplayText;\n },\n set itemValueAlwaysSerializeText(val) {\n this.serialization.itemValueSerializeDisplayText = val;\n },\n get serializeLocalizableStringAsObject() {\n return this.serialization.localizableStringSerializeAsObject;\n },\n set serializeLocalizableStringAsObject(val) {\n this.serialization.localizableStringSerializeAsObject = val;\n },\n //#endregion\n /**\n * An object that configures lazy rendering.\n *\n * Nested properties:\n *\n * - `enabled`: `boolean`\\\n * Specifies whether to add questions to the DOM only when they get into the viewport. Default value: `false`.\n *\n * [View Demo](https://surveyjs.io/form-library/examples/survey-lazy/ (linkStyle))\n * @see [SurveyModel.lazyRendering](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#lazyRendering)\n */\n lazyRender: {\n enabled: false,\n firstBatchSize: 3\n },\n //#region lazyRender section, Obsolete properties\n get lazyRowsRendering() {\n return this.lazyRender.enabled;\n },\n set lazyRowsRendering(val) {\n this.lazyRender.enabled = val;\n },\n get lazyRowsRenderingStartRow() {\n return this.lazyRender.firstBatchSize;\n },\n set lazyRowsRenderingStartRow(val) {\n this.lazyRender.firstBatchSize = val;\n },\n //#endregion\n /**\n * An object with properties that apply to [Single-Choice](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-question-model), [Multiple-Choice](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list), and [Dynamic Matrix](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model) questions.\n *\n * Nested properties:\n *\n * - `defaultRowName`: `string`\\\n * A property key that stores an object with default cell values. Default value: \"default\".\n *\n * - `defaultCellType`: `string`\\\n * The default type of matrix cells. Default value: `\"dropdown\"`.\\\n * You can specify this setting for individual questions or matrix columns: [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model#cellType). Refer to the `cellType` property description for information on possible values.\n *\n * - `totalsSuffix`: `string`\\\n * A suffix added to the name of the property that stores total values. The resulting property name consists of the matrix name and the suffix. Default value: `\"-total\"`.\n *\n * - `maxRowCount`: `number`\\\n * A maximum number of rows in a Dynamic Matrix. Default value: 1000.\\\n * You can specify this setting for an individual Dynamic Matrix: [`maxRowCount`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model#maxRowCount).\n *\n * - `maxRowCountInCondition`: `number`\\\n * A maximum number of matrix rows included in the Condition drop-down menu in Survey Creator. This menu is used to configure conditional survey logic. Default value: 1.\\\n * If you set this property to 0, the Condition menu does not include any matrix rows. Users still can specify conditions that use matrix rows but only with Manual Entry.\n *\n * - `renderRemoveAsIcon`: `boolean`\\\n * Disable this property if you want to render the Remove action in Dynamic Matrix as a button. Otherwise, the action is rendered as an icon. Default value: `true`.\n *\n * - `columnWidthsByType`: `object`\\\n * An object that specifies fixed and minimum column width based on the column type.\\\n * Example: `settings.matrix.columnWidthsByType = { \"tagbox\": { minWidth: \"240px\", width: \"300px\" } }`\n *\n * - `rateSize`: `\"small\"` (default) | `\"normal\"`\\\n * Specifies the size of rate values. Applies to [Rating Scale](https://surveyjs.io/form-library/examples/rating-scale/) questions within matrixes.\n */\n matrix: {\n defaultCellType: \"dropdown\",\n defaultRowName: \"default\",\n totalsSuffix: \"-total\",\n maxRowCount: 1000,\n maxRowCountInCondition: 1,\n renderRemoveAsIcon: true,\n columnWidthsByType: columnWidthsByType,\n rateSize: \"small\"\n },\n //#region matrix section, Obsolete properties\n get matrixDefaultRowName() {\n return this.matrix.defaultRowName;\n },\n set matrixDefaultRowName(val) {\n this.matrix.defaultRowName = val;\n },\n get matrixDefaultCellType() {\n return this.matrix.defaultCellType;\n },\n set matrixDefaultCellType(val) {\n this.matrix.defaultCellType = val;\n },\n get matrixTotalValuePostFix() {\n return this.matrix.totalsSuffix;\n },\n set matrixTotalValuePostFix(val) {\n this.matrix.totalsSuffix = val;\n },\n get matrixMaximumRowCount() {\n return this.matrix.maxRowCount;\n },\n set matrixMaximumRowCount(val) {\n this.matrix.maxRowCount = val;\n },\n get matrixMaxRowCountInCondition() {\n return this.matrix.maxRowCountInCondition;\n },\n set matrixMaxRowCountInCondition(val) {\n this.matrix.maxRowCountInCondition = val;\n },\n get matrixRenderRemoveAsIcon() {\n return this.matrix.renderRemoveAsIcon;\n },\n set matrixRenderRemoveAsIcon(val) {\n this.matrix.renderRemoveAsIcon = val;\n },\n //#endregion\n /**\n * An object with properties that apply to [Dynamic Panel](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model) questions.\n *\n * Nested properties:\n *\n * - `maxPanelCount`: `number`\\\n * A maximum number of panels in Dynamic Panel. Default value: 100.\\\n * You can specify this setting for an individual Dynamic Panel: [`maxPanelCount`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#maxPanelCount).\n *\n * - `maxPanelCountInCondition`: `number`\\\n * A maximum number of Dynamic Panel panels included in the Condition drop-down menu in Survey Creator. This menu is used to configure conditional survey logic. Default value: 1.\\\n * If you set this property to 0, the Condition menu does not include any panel questions. Users still can specify conditions that use panel questions but only with Manual Entry.\n */\n panel: {\n maxPanelCount: 100,\n maxPanelCountInCondition: 1\n },\n //#region panel section, Obsolete properties\n get panelDynamicMaxPanelCountInCondition() {\n return this.panel.maxPanelCountInCondition;\n },\n set panelDynamicMaxPanelCountInCondition(val) {\n this.panel.maxPanelCountInCondition = val;\n },\n get panelMaximumPanelCount() {\n return this.panel.maxPanelCount;\n },\n set panelMaximumPanelCount(val) {\n this.panel.maxPanelCount = val;\n },\n //#endregion\n /**\n * An object with properties that configure questions in read-only mode.\n *\n * Nested properties:\n *\n * - `commentRenderMode`: `\"textarea\"` (default) | `\"div\"`\\\n * Specifies how to render the input field of [Comment](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model) questions in [read-only](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model#readOnly) mode: as a disabled `