diff --git a/js/survey.jquery.min.js b/js/survey.jquery.min.js index eaca09b..05872fd 100644 --- a/js/survey.jquery.min.js +++ b/js/survey.jquery.min.js @@ -1,6 +1,11 @@ /*! - * surveyjs - Survey JavaScript library v1.0.1 - * Copyright (c) 2015-2017 Devsoft Baltic OÜ - http://surveyjs.io/ + * surveyjs - Survey JavaScript library v1.1.1 + * Copyright (c) 2015-2019 Devsoft Baltic OÜ - http://surveyjs.io/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define("Survey",["jquery"],t):"object"==typeof exports?exports.Survey=t(require("jquery")):e.Survey=t(e.jQuery)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=109)}([function(e,t,r){"use strict";function n(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}r.d(t,"a",function(){return i}),t.b=n,r.d(t,"c",function(){return o});var i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}},function(e,t,r){"use strict";r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i});var n={currentLocale:"",defaultLocale:"en",locales:{},supportedLocales:[],getString:function(e){var t=this.currentLocale?this.locales[this.currentLocale]:this.locales[this.defaultLocale];return t&&t[e]||(t=this.locales[this.defaultLocale]),t[e]},getLocales:function(){var e=[];if(e.push(""),this.supportedLocales&&this.supportedLocales.length>0)for(var t=0;t2?i-2:0),a=2;a-1&&(n=r.substring(a+1),r=r.substring(0,a));var s=this.getIsPropertyNameRequired(r);r=this.getPropertyName(r);var u=new o(r,s);if(n&&(u.type=n),"object"==typeof t){if(t.type&&(u.type=t.type),i.a.isValueEmpty(t.default)||(u.defaultValue=t.default),i.a.isValueEmpty(t.isSerializable)||(u.isSerializable=t.isSerializable),!1===t.visible&&(u.visible=!1),t.isRequired&&this.makePropertyRequired(u.name),t.choices){var l="function"==typeof t.choices?t.choices:null,c="function"!=typeof t.choices?t.choices:null;u.setChoices(c,l)}if(t.onGetValue&&(u.onGetValue=t.onGetValue),t.onSetValue&&(u.onSetValue=t.onSetValue),t.serializationProperty){u.serializationProperty=t.serializationProperty;u.serializationProperty&&0==u.serializationProperty.indexOf("loc")&&(u.isLocalizable=!0)}t.isLocalizable&&(u.isLocalizable=t.isLocalizable),t.className&&(u.className=t.className),t.baseClassName&&(u.baseClassName=t.baseClassName),t.classNamePart&&(u.classNamePart=t.classNamePart),t.alternativeName&&(u.alternativeName=t.alternativeName)}return u}},e.prototype.getIsPropertyNameRequired=function(t){return t.length>0&&t[0]==e.requiredSymbol},e.prototype.getPropertyName=function(e){return this.getIsPropertyNameRequired(e)?(e=e.slice(1),this.makePropertyRequired(e),e):e},e.prototype.makePropertyRequired=function(e){this.requiredProperties||(this.requiredProperties=new Array),this.requiredProperties.push(e)},e.requiredSymbol="!",e.typeSymbol=":",e}(),u=function(){function e(){this.classes={},this.childrenClasses={},this.classProperties={},this.classRequiredProperties={}}return e.prototype.addClass=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var i=new s(e,t,r,n);if(this.classes[e]=i,n){this.childrenClasses[n]||(this.childrenClasses[n]=[]),this.childrenClasses[n].push(i)}return i},e.prototype.overrideClassCreatore=function(e,t){var r=this.findClass(e);r&&(r.creator=t)},e.prototype.getProperties=function(e){var t=this.classProperties[e];return t||(t=new Array,this.fillProperties(e,t),this.classProperties[e]=t),t},e.prototype.findProperty=function(e,t){for(var r=this.getProperties(e),n=0;n=0&&e.requiredProperties.splice(r,1))},e.prototype.emptyClassPropertiesHash=function(e){this.classProperties[e.name]=null;for(var t=this.getChildrenClasses(e.name),r=0;r0&&(n.description+=", "),n.description+=i[o].name;n.description+="."}return n}return n.b(t,e),t}(l),p=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;i.baseClassName=t,i.type=r,i.message=n,i.description="The following types are available: ";for(var o=g.metaData.getChildrenClasses(t,!0),a=0;a0&&(i.description+=", "),i.description+="'"+o[a].name+"'";return i.description+=".",i}return n.b(t,e),t}(l),h=function(e){function t(t,r){var n=e.call(this,r,"missingtypeproperty","The property type is missing in the object. Please take a look at property: '"+t+"'.")||this;return n.propertyName=t,n.baseClassName=r,n}return n.b(t,e),t}(p),d=function(e){function t(t,r){var n=e.call(this,r,"incorrecttypeproperty","The property type is incorrect in the object. Please take a look at property: '"+t+"'.")||this;return n.propertyName=t,n.baseClassName=r,n}return n.b(t,e),t}(p),f=function(e){function t(t,r){var n=e.call(this,"requiredproperty","The property '"+t+"' is required in class '"+r+"'.")||this;return n.propertyName=t,n.className=r,n}return n.b(t,e),t}(l),g=function(){function e(){this.errors=new Array}return Object.defineProperty(e,"metaData",{get:function(){return e.metaDataValue},enumerable:!0,configurable:!0}),e.prototype.toJsonObject=function(e){return this.toJsonObjectCore(e,null)},e.prototype.toObject=function(t,r){if(t){var n=null;if(r.getType&&(n=e.metaData.getProperties(r.getType())),n){r.startLoadingFromJson&&r.startLoadingFromJson();for(var i in t)if(i!=e.typePropertyName)if(i!=e.positionPropertyName){var o=this.findProperty(n,i);o?this.valueToObj(t[i],r,i,o):this.addNewError(new c(i.toString(),r.getType()),t)}else r[i]=t[i];r.endLoadingFromJson&&r.endLoadingFromJson()}}},e.prototype.toJsonObjectCore=function(t,r){if(!t.getType)return t;var n={};null==r||r.className||(n[e.typePropertyName]=r.getObjType(t.getType()));for(var i=e.metaData.getProperties(t.getType()),o=0;o0?i:null}else n=this.toJsonObjectCore(n,r);r.isDefaultValue(n)||(t[r.name]=n)}}},e.prototype.valueToObj=function(e,t,r,n){if(null!=e){if(null!=n&&n.hasToUseSetValue)return void n.setValue(t,e,this);if(this.isValueArray(e))return void this.valueToArray(e,t,n.name,n);var i=this.createNewObj(e,n);i.newObj&&(this.toObject(e,i.newObj),e=i.newObj),i.error||(null!=n?n.setValue(t,e,this):t[n.name]=e)}},e.prototype.isValueArray=function(e){return e&&Array.isArray(e)},e.prototype.createNewObj=function(t,r){var n={newObj:null,error:null},i=t[e.typePropertyName];return!i&&null!=r&&r.className&&(i=r.className),i=r.getClassName(i),n.newObj=i?e.metaData.createClass(i):null,n.error=this.checkNewObjectOnErrors(n.newObj,t,r,i),n},e.prototype.checkNewObjectOnErrors=function(t,r,n,i){var o=null;if(t){var a=e.metaData.getRequiredProperties(i);if(a)for(var s=0;s0&&t[r].splice(0,t[r].length),t[r]||(t[r]=[]);for(var i=0;i-1&&this.fireCallback(this.titleChangedCallback)}},Object.defineProperty(t.prototype,"no",{get:function(){if(this.visibleIndex<0)return"";var e=1,t=!0,r="";return this.survey&&this.survey.questionStartIndex&&(r=this.survey.questionStartIndex,parseInt(r)?e=parseInt(r):1==r.length&&(t=!1)),t?(this.visibleIndex+e).toString():String.fromCharCode(r.charCodeAt(0)+this.visibleIndex)},enumerable:!0,configurable:!0}),t.prototype.onSurveyLoad=function(){e.prototype.onSurveyLoad.call(this),this.defaultValue&&this.updateValueWithDefaults()},t.prototype.onSetData=function(){e.prototype.onSetData.call(this),this.onSurveyValueChanged(this.value),this.defaultValue&&this.updateValueWithDefaults()},Object.defineProperty(t.prototype,"value",{get:function(){return this.valueFromData(this.getValueCore())},set:function(e){this.setNewValue(e),this.isvalueChangedCallbackFiring||(this.isvalueChangedCallbackFiring=!0,this.fireCallback(this.valueChangedCallback),this.isvalueChangedCallbackFiring=!1)},enumerable:!0,configurable:!0}),t.prototype.clearValue=function(){this.value=null,this.comment=null},t.prototype.clearValueIfInvisible=function(){this.isVisible||this.clearValue()},Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultValue",{get:function(){return this.getPropertyValue("defaultValue")},set:function(e){this.setPropertyValue("defaultValue",e),this.updateValueWithDefaults()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"correctAnswer",{get:function(){return this.getPropertyValue("correctAnswer")},set:function(e){this.setPropertyValue("correctAnswer",e)},enumerable:!0,configurable:!0}),t.prototype.isAnswerCorrect=function(){return!this.isValueEmpty(this.value)&&!this.isValueEmpty(this.correctAnswer)&&this.isTwoValueEquals(this.value,this.correctAnswer)},t.prototype.updateValueWithDefaults=function(){this.isLoadingFromJson||!this.isDesignMode&&this.isValueEmpty(this.defaultValue)||(this.isDesignMode||this.isEmpty())&&this.setDefaultValue()},t.prototype.setDefaultValue=function(){this.value=this.defaultValue},Object.defineProperty(t.prototype,"comment",{get:function(){return this.getComment()},set:function(e){this.comment!=e&&(this.setComment(e),this.fireCallback(this.commentChangedCallback))},enumerable:!0,configurable:!0}),t.prototype.getComment=function(){return null!=this.data?this.data.getComment(this.getValueName()):this.questionComment},t.prototype.setComment=function(e){this.setNewComment(e)},t.prototype.isEmpty=function(){return this.isValueEmpty(this.value)},Object.defineProperty(t.prototype,"validators",{get:function(){return this.validatorsValue},set:function(e){this.setPropertyValue("validators",e)},enumerable:!0,configurable:!0}),t.prototype.hasErrors=function(e){return void 0===e&&(e=!0),this.checkForErrors(e),this.errors.length>0},Object.defineProperty(t.prototype,"currentErrorCount",{get:function(){return this.errors.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"requiredText",{get:function(){return null!=this.survey&&this.isRequired?this.survey.requiredText:""},enumerable:!0,configurable:!0}),t.prototype.addError=function(e){this.errors.push(e),this.fireCallback(this.errorsChangedCallback)},t.prototype.checkForErrors=function(e){var t=this.errors?this.errors.length:0;if(this.errors=[],this.onCheckForErrors(this.errors),0==this.errors.length&&!this.isEmpty()){var r=this.runValidators();r&&(this.errors=[],this.errors.push(r))}if(this.survey&&0==this.errors.length){var r=this.fireSurveyValidation();r&&this.errors.push(r)}e&&(t!=this.errors.length||t>0)&&this.fireCallback(this.errorsChangedCallback)},t.prototype.fireSurveyValidation=function(){return this.validateValueCallback?this.validateValueCallback():this.survey?this.survey.validateQuestion(this.name):null},t.prototype.onCheckForErrors=function(e){this.hasRequiredError()&&this.errors.push(new u.a(this.requiredErrorText))},t.prototype.hasRequiredError=function(){return this.isRequired&&this.isEmpty()},t.prototype.runValidators=function(){return(new l.a).run(this)},t.prototype.setNewValue=function(e){this.setNewValueInData(e),this.onValueChanged()},t.prototype.setNewValueInData=function(e){this.isValueChangedInSurvey||(e=this.valueToData(e),this.setValueCore(e))},t.prototype.getValueCore=function(){return null!=this.data?this.data.getValue(this.getValueName()):this.questionValue},t.prototype.setValueCore=function(e){null!=this.data?this.data.setValue(this.getValueName(),e):this.questionValue=e},t.prototype.valueFromData=function(e){return e},t.prototype.valueToData=function(e){return e},t.prototype.onValueChanged=function(){},t.prototype.setNewComment=function(e){null!=this.data?this.data.setComment(this.getValueName(),e):this.questionComment=e},t.prototype.onSurveyValueChanged=function(e){this.isValueChangedInSurvey=!0,this.value=this.valueFromData(e),this.fireCallback(this.commentChangedCallback),this.isValueChangedInSurvey=!1},t.prototype.getValidatorTitle=function(){return null},Object.defineProperty(t.prototype,"validatedValue",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!0,configurable:!0}),t}(o.a);i.b.metaData.addClass("question",[{name:"title:text",serializationProperty:"locTitle"},{name:"description:text",serializationProperty:"locDescription"},{name:"commentText",serializationProperty:"locCommentText"},"valueName","enableIf:condition","defaultValue:value","correctAnswer:value","isRequired:boolean",{name:"requiredErrorText:text",serializationProperty:"locRequiredErrorText"},"readOnly:boolean",{name:"validators:validators",baseClassName:"surveyvalidator",classNamePart:"validator"},{name:"titleLocation",default:"default",choices:["default","top","bottom","left"]}],null,"questionbase")},function(e,t,r){"use strict";var n=r(0),i=r(1),o=r(7);r.d(t,"a",function(){return a}),r.d(t,"e",function(){return s}),r.d(t,"b",function(){return u}),r.d(t,"d",function(){return l}),r.d(t,"c",function(){return c});var a=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this)||this;return r.customErrorText=t,r}return n.b(t,e),t.prototype.getText=function(){return this.customErrorText?this.customErrorText:i.a.getString("requiredError")},t}(o.d),s=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this)||this;return r.customErrorText=t,r}return n.b(t,e),t.prototype.getText=function(){return this.customErrorText?this.customErrorText:i.a.getString("requiredErrorInPanel")},t}(o.d),u=function(e){function t(){return e.call(this)||this}return n.b(t,e),t.prototype.getText=function(){return i.a.getString("numericError")},t}(o.d),l=function(e){function t(t){var r=e.call(this)||this;return r.maxSize=t,r}return n.b(t,e),t.prototype.getText=function(){return i.a.getString("exceedMaxSize").format(this.getTextSize())},t.prototype.getTextSize=function(){var e=["Bytes","KB","MB","GB","TB"],t=[0,0,2,3,3];if(0==this.maxSize)return"0 Byte";var r=Math.floor(Math.log(this.maxSize)/Math.log(1024));return(this.maxSize/Math.pow(1024,r)).toFixed(t[r])+" "+e[r]},t}(o.d),c=function(e){function t(t){var r=e.call(this)||this;return r.text=t,r}return n.b(t,e),t.prototype.getText=function(){return this.text},t}(o.d)},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(){}return e.isValueEmpty=function(e){return!(!Array.isArray(e)||0!==e.length)||(e&&("string"==typeof e||e instanceof String)&&(e=e.trim()),!e&&0!==e&&!1!==e)},e.randomizeArray=function(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e},e}();String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,function(t,r){return void 0!==e[r]?e[r]:t})})},function(e,t,r){"use strict";var n=r(22),i=r(3);r.d(t,"a",function(){return o});var o=function(){function e(e,t){void 0===t&&(t=null),this.locTextValue=new n.a(null,!0);var r=this;this.locTextValue.onGetTextCallback=function(e){return e||(r.isValueEmpty?null:r.value.toString())},t&&(this.locText.text=t),this.value=e}return e.createArray=function(t){var r=[];return e.setupArray(r,t),r},e.setupArray=function(e,t){e.push=function(e){var r=Array.prototype.push.call(this,e);return e.locOwner=t,r},e.splice=function(e,r){for(var n=[],i=2;i-1&&(this.itemValue=r.slice(0,n),this.text=r.slice(n+1))}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasText",{get:function(){return!!this.locText.pureText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.locText.text},set:function(e){this.locText.text=e},enumerable:!0,configurable:!0}),e.prototype.getData=function(){var e=this.getCustomAttributes(),t=this.locText.getJson();if(!e&&!t)return this.value;var r={value:this.value};if(t&&(r.text=t),e)for(var n in e)r[n]=e[n];return r},e.prototype.setData=function(t){if(void 0!==t.value){var r=null;this.isObjItemValue(t)&&(t.itemValue=t.itemValue,this.locText.setJson(t.locText.getJson()),r=e.itemValueProp),this.copyAttributes(t,r)}else this.value=t},Object.defineProperty(e.prototype,"isValueEmpty",{get:function(){return!this.itemValue&&0!==this.itemValue&&!1!==this.itemValue},enumerable:!0,configurable:!0}),e.prototype.isObjItemValue=function(e){return void 0!==e.getType&&"itemvalue"==e.getType()},e.prototype.copyAttributes=function(e,t){for(var r in e)"function"!=typeof e[r]&&(t&&t.indexOf(r)>-1||("text"==r?this.locText.setJson(e[r]):this[r]=e[r]))},e.prototype.getCustomAttributes=function(){var t=null;for(var r in this)"function"==typeof this[r]||e.itemValueProp.indexOf(r)>-1||"itemValue"==r||(null==t&&(t={}),t[r]=this[r]);return t},e.Separator="|",e.itemValueProp=["text","value","hasText","locOwner","locText","isValueEmpty","locTextValue","pos"],e}();i.b.metaData.addClass("itemvalue",["!value",{name:"text",onGetValue:function(e){return e.locText.pureText}}])},function(e,t,r){"use strict";r.d(t,"b",function(){return n}),r.d(t,"a",function(){return i});var n={currentType:"",getCss:function(){var e=this.currentType?this[this.currentType]:i;return e||(e=i),e}},i={root:"sv_main sv_default_css",header:"sv_header",body:"sv_body",footer:"sv_nav",navigationButton:"",navigation:{complete:"sv_complete_btn",prev:"sv_prev_btn",next:"sv_next_btn",start:"sv_start_btn"},progress:"sv_progress",progressBar:"sv_progress_bar",page:{root:"sv_p_root",title:"",description:""},pageTitle:"sv_page_title",pageDescription:"",row:"sv_row",question:{mainRoot:"sv_q sv_qstn",title:"sv_q_title",description:"sv_q_description",comment:"",required:"",titleRequired:"",indent:20,footer:"sv_q_footer"},panel:{title:"sv_p_title",description:"",container:"sv_p_container"},error:{root:"sv_q_erbox",icon:"",item:""},boolean:{root:"sv_qcbc sv_qbln",item:"sv_q_checkbox"},checkbox:{root:"sv_qcbc sv_qcbx",item:"sv_q_checkbox",label:"sv_q_checkbox_label",itemControl:"sv_q_checkbox_control_item",controlLabel:"sv_q_checkbox_control_label",other:"sv_q_other sv_q_checkbox_other"},comment:"",dropdown:{root:"",control:"sv_q_dropdown_control",selectWrapper:"sv_select_wrapper",other:"sv_q_other"},matrix:{root:"sv_q_matrix",label:"sv_q_m_label"},matrixdropdown:{root:"sv_q_matrix_dropdown"},matrixdynamic:{root:"sv_q_matrix_dynamic",button:"sv_matrix_dynamic_button"},paneldynamic:{root:"sv_panel_dynamic",title:"sv_p_title",button:""},multipletext:{root:"sv_q_mt",itemTitle:"sv_q_mt_title",row:"sv_q_mt_row",itemValue:"sv_q_mt_item_value sv_q_text_root"},radiogroup:{root:"sv_qcbc",item:"sv_q_radiogroup",label:"sv_q_radiogroup_label",itemControl:"sv_q_radiogroup_control_item",controlLabel:"",other:"sv_q_other sv_q_radiogroup_other"},rating:{root:"sv_q_rating",item:"sv_q_rating_item",selected:"active",minText:"sv_q_rating_min_text",itemText:"sv_q_rating_item_text",maxText:"sv_q_rating_max_text"},text:"sv_q_text_root",expression:"",saveData:{root:"",saving:"",error:"",success:"",saveAgainButton:""},window:{root:"sv_window",body:"sv_window_content",header:{root:"sv_window_title",title:"",button:"",buttonExpanded:"",buttonCollapsed:""}}};n.standard=i},function(e,t,r){"use strict";var n=r(0),i=r(31),o=r(33),a=r(15);r.d(t,"e",function(){return s}),r.d(t,"d",function(){return u}),r.d(t,"f",function(){return l}),r.d(t,"g",function(){return c}),r.d(t,"c",function(){return p}),r.d(t,"b",function(){return h}),r.d(t,"h",function(){return d}),r.d(t,"a",function(){return f});var s=function(){function e(e){this.origionalValue=e}return e.prototype.getValue=function(e){var t=this.getSimpleValue(this.origionalValue);if(t.isSimple)return t.value;var r=this.removeQuotesAndEscapes(this.origionalValue);if(e){var n=this.getValueName(r);if(n)return e.hasValue(n)?(r=e.getValue(n),this.getSimpleValue(r).value):null}return r},Object.defineProperty(e.prototype,"isBoolean",{get:function(){return this.isBooleanValue(this.origionalValue)},enumerable:!0,configurable:!0}),e.prototype.toString=function(){var e=this.origionalValue;return!e||this.isNumeric(e)||this.isBooleanValue(e)||(e="'"+e+"'"),e},e.prototype.removeQuotesAndEscapes=function(e){e.length>0&&("'"==e[0]||'"'==e[0])&&(e=e.substr(1));var t=e.length;return t>0&&("'"==e[t-1]||'"'==e[t-1])&&(e=e.substr(0,t-1)),e&&(e=e.replace("\\'","'"),e=e.replace('\\"','"')),e},e.prototype.getValueName=function(e){return e.length<3||"{"!=e[0]||"}"!=e[e.length-1]?null:e.substr(1,e.length-2)},e.prototype.isBooleanValue=function(e){return e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())},e.prototype.isNumeric=function(e){if(e&&(e.indexOf("-")>-1||e.indexOf("+")>1||e.indexOf("*")>-1||e.indexOf("/")>-1||e.indexOf("%")>-1))return!1;var t=parseFloat(e);return!isNaN(t)&&isFinite(t)},e.prototype.getSimpleValue=function(e){var t={isSimple:!1,value:e};return void 0===e||"undefined"===e?(t.value=null,t.isSimple=!0,t):e&&"string"==typeof e?this.isNumeric(e)?(t.isSimple=!0,t.value=parseFloat(e),t):this.isBooleanValue(e)?(t.value="true"==e.toLowerCase(),t.isSimple=!0,t):t:(t.isSimple=!0,t)},e}(),u=function(e){function t(t){var r=e.call(this,t)||this;return r.origionalValue=t,r.parameters=new Array,r}return n.b(t,e),t.prototype.getValue=function(e){for(var t=[],r=0;r0&&(e+=", "),e+=this.parameters[t].toString();return e},t}(s),l=function(e){function t(){return e.call(this,null)||this}return n.b(t,e),t.prototype.getValue=function(e){if(!this.left||!this.right)return null;var t=this.left.getValue(e),r=this.right.getValue(e);return"+"==this.operator?t+r:"-"==this.operator?t-r:"*"==this.operator?t*r:"/"==this.operator?r?t/r:null:"%"==this.operator&&r?t%r:null},t.prototype.toString=function(){var e=this.left?this.left.toString():"";return e+=" "+this.operator+" ",this.right&&(e+=this.right.toString()),e},t}(s),c=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this,null)||this;return t&&(r.root=t),r}return n.b(t,e),t.prototype.getValue=function(e){return!!this.root&&(this.processValue=e,this.runNode(this.root))},t.prototype.toString=function(){return this.root?this.root.toString():""},t.prototype.runNode=function(e){for(var t="and"==e.connective,r=0;r-1;return r?n:!n}for(var i=0;it},less:function(e,t){return null!=e&&null!=t&&e=t},lessorequal:function(e,t){return null!=e&&null!=t&&e<=t}},e.operatorsValue)},enumerable:!0,configurable:!0}),e.getOperator=function(t){return e.operators[t]},e.setOperator=function(t,r){e.operators[t]=r},e.isCorrectOperator=function(t){return!!t&&(t=t.toLowerCase(),void 0!=e.operators[t])},e.isNoRightOperation=function(e){return"empty"==e||"notempty"==e},Object.defineProperty(e.prototype,"left",{get:function(){return this.leftValue},set:function(e){this.leftValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.rightValue},set:function(e){this.rightValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operator",{get:function(){return this.opValue},set:function(t){t&&(t=t.toLowerCase(),e.operators[t]&&(this.opValue=t))},enumerable:!0,configurable:!0}),e.prototype.perform=function(e,t,r){return void 0===e&&(e=null),void 0===t&&(t=null),void 0===r&&(r=null),e||(e=this.left),t||(t=this.right),this.performExplicit(e,t,r)},e.prototype.performExplicit=function(t,r,n){var i=t?t.getValue(n):null;if(!r&&(!0===i||!1===i))return i;var o=r?r.getValue(n):null;return e.operators[this.operator](i,o)},e.prototype.toString=function(){if(!this.right||!this.operator)return"";var t=this.left.toString(),r=t+" "+this.operationToString();return e.isNoRightOperation(this.operator)?r:r+" "+this.right.toString()},e.prototype.operationToString=function(){var e=this.operator;return"equal"==e?"=":"notequal"==e?"!=":"greater"==e?">":"less"==e?"<":"greaterorequal"==e?">=":"lessorequal"==e?"<=":e},e.operatorsValue=null,e}(),h=function(){function e(){this.connectiveValue="and",this.children=[]}return Object.defineProperty(e.prototype,"connective",{get:function(){return this.connectiveValue},set:function(e){e&&(e=e.toLowerCase(),"&"!=e&&"&&"!=e||(e="and"),"|"!=e&&"||"!=e||(e="or"),"and"!=e&&"or"!=e||(this.connectiveValue=e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0==this.children.length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this.children=[],this.connective="and"},e.prototype.toString=function(){if(this.isEmpty)return"";for(var e="",t=0;t0&&(n="("+n+")"),n&&(e&&(e+=" "+this.connective+" "),e+=n)}return e},e}(),d=function(){function e(e){this.expression=e,this.processValue=new a.a}return Object.defineProperty(e.prototype,"expression",{get:function(){return this.expressionValue},set:function(e){this.expression!=e&&(this.expressionValue=e,this.operand=(new i.a).parseExpression(this.expressionValue))},enumerable:!0,configurable:!0}),e.prototype.run=function(e){return this.operand?(this.processValue.values=e,this.operand.getValue(this.processValue)):null},e}(),f=function(){function e(e){this.root=new h,this.expression=e}return Object.defineProperty(e.prototype,"expression",{get:function(){return this.expressionValue},set:function(e){this.expression!=e&&(this.expressionValue=e,(new i.a).parse(this.expressionValue,this.root))},enumerable:!0,configurable:!0}),e.prototype.run=function(e){var t=new c(this.root),r=new a.a;return r.values=e,t.getValue(r)},e}()},function(e,t,r){"use strict";var n=r(0),i=r(2),o=(r.n(i),r(4)),a=r(6);r.d(t,"b",function(){return s}),r.d(t,"a",function(){return u});var s=function(e){function t(t){var r=e.call(this,t)||this;return r.state={value:r.getStateValue()},r.handleOnChange=r.handleOnChange.bind(r),r.handleOnBlur=r.handleOnBlur.bind(r),r}return n.b(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.questionBase},enumerable:!0,configurable:!0}),t.prototype.componentWillReceiveProps=function(t){e.prototype.componentWillReceiveProps.call(this,t),this.setState({value:this.getStateValue()})},t.prototype.handleOnChange=function(e){this.setState({value:e.target.value})},t.prototype.handleOnBlur=function(e){this.question.value=e.target.value,this.setState({value:this.getStateValue()})},t.prototype.render=function(){if(!this.question)return null;var e=this.question.cssClasses;return i.createElement("textarea",{id:this.question.inputId,className:e.root,type:"text",readOnly:this.isDisplayMode,value:this.state.value,placeholder:this.question.placeHolder,onBlur:this.handleOnBlur,onChange:this.handleOnChange,cols:this.question.cols,rows:this.question.rows,"aria-label":this.question.locTitle.renderedHtml})},t.prototype.getStateValue=function(){return this.question.isEmpty()?"":this.question.value},t}(o.b),u=function(e){function t(t){var r=e.call(this,t)||this;return r.question=t.question,r.comment=r.question.comment,r.otherCss=t.otherCss,r.state={value:r.comment},r.handleOnChange=r.handleOnChange.bind(r),r.handleOnBlur=r.handleOnBlur.bind(r),r}return n.b(t,e),t.prototype.handleOnChange=function(e){this.comment=e.target.value,this.setState({value:this.comment})},t.prototype.handleOnBlur=function(e){this.question.comment=this.comment},t.prototype.componentWillReceiveProps=function(e){this.question=e.question},t.prototype.render=function(){if(!this.question)return null;if(this.isDisplayMode)return i.createElement("div",{className:this.cssClasses.comment},this.comment);var e=this.otherCss?this.otherCss:this.cssClasses.comment;return i.createElement("input",{type:"text",className:e,value:this.state.value,onChange:this.handleOnChange,onBlur:this.handleOnBlur,"aria-label":this.question.locTitle.renderedHtml})},t}(o.c);a.a.Instance.registerQuestion("comment",function(e){return i.createElement(s,e)})},function(e,t,r){"use strict";var n=r(10);r.d(t,"a",function(){return i});var i=function(){function e(){this.values=null}return e.prototype.getFirstName=function(e){if(!e)return e;for(var t="",r=0;r0;){if(!o&&"["==e[0]){if(!Array.isArray(i))return r;for(var a=1,s="";a=i.length)return r;i=i[a]}else{o||(e=e.substr(1));var u=this.getFirstName(e);if(!u)return r;if(n.a.isValueEmpty(i[u]))return r;i=i[u],e=e.substr(u.length)}o=!1}return r.value=i,r.hasValue=!0,r},e.prototype.getIntValue=function(e){return"0"==e||(0|e)>0&&e%1==0?Number(e):-1},e}()},function(e,t,r){"use strict";var n=r(0),i=r(3),o=r(8),a=r(11),s=r(10),u=r(1),l=r(9),c=r(21);r.d(t,"b",function(){return p}),r.d(t,"a",function(){return h});var p=function(e){function t(t){var r=e.call(this,t)||this;r.visibleChoicesCache=null,r.otherItemValue=new a.a("other",u.a.getString("otherItemText")),r.choicesFromUrl=null,r.cachedValueForUrlRequests=null,r.isSettingComment=!1;var n=r;return r.choicesValues=r.createItemValues("choices"),r.choicesByUrl=r.createRestfull(),r.choicesByUrl.owner=r,r.createLocalizableString("otherText",r,!0),r.createLocalizableString("otherErrorText",r,!0),r.otherItemValue.locOwner=r,r.choicesByUrl.getResultCallback=function(e){n.onLoadChoicesFromUrl(e)},r}return n.b(t,e),Object.defineProperty(t.prototype,"otherItem",{get:function(){return this.otherItemValue.text=this.otherText?this.otherText:u.a.getString("otherItemText"),this.otherItemValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isOtherSelected",{get:function(){return this.getStoreOthersAsComment()?this.getHasOther(this.value):this.getHasOther(this.cachedValue)},enumerable:!0,configurable:!0}),t.prototype.getHasOther=function(e){return e==this.otherItem.value},Object.defineProperty(t.prototype,"validatedValue",{get:function(){return this.valueToDataCore(this.value)},enumerable:!0,configurable:!0}),t.prototype.createRestfull=function(){return new c.a},t.prototype.getComment=function(){return this.getStoreOthersAsComment()?e.prototype.getComment.call(this):this.commentValue},t.prototype.setComment=function(t){this.getStoreOthersAsComment()?e.prototype.setComment.call(this,t):this.isSettingComment||t==this.commentValue||(this.isSettingComment=!0,this.commentValue=t,this.isOtherSelected&&this.setNewValueInData(this.cachedValue),this.isSettingComment=!1)},t.prototype.setNewValue=function(t){this.cachedValueForUrlRequests=t,e.prototype.setNewValue.call(this,t)},t.prototype.valueFromData=function(t){return this.getStoreOthersAsComment()?e.prototype.valueFromData.call(this,t):(this.cachedValue=this.valueFromDataCore(t),this.cachedValue)},t.prototype.valueToData=function(t){return this.getStoreOthersAsComment()?e.prototype.valueToData.call(this,t):(this.cachedValue=t,this.valueToDataCore(t))},t.prototype.valueFromDataCore=function(e){return this.hasUnknownValue(e)?e==this.otherItem.value?e:(this.comment=e,this.otherItem.value):e},t.prototype.valueToDataCore=function(e){return e==this.otherItem.value&&this.getComment()&&(e=this.getComment()),e},t.prototype.hasUnknownValue=function(e){if(!e)return!1;for(var t=this.activeChoices,r=0;r0||this.errors.length>0)&&this.fireCallback(this.errorsChangedCallback);var r=null,n=this.createCachedValueForUrlRequests(this.cachedValueForUrlRequests);if(e&&e.length>0&&(r=new Array,a.a.setData(r,e)),this.choicesFromUrl=r,r){var i=this.updateCachedValueForUrlRequests(n);i&&(this.value=i.value)}this.onVisibleChoicesChanged()},t.prototype.createCachedValueForUrlRequests=function(e){if(this.isValueEmpty(e))return null;if(Array.isArray(e)){for(var t=[],r=0;rr.text?1*t:0})},t.prototype.randomizeArray=function(e){return s.a.randomizeArray(e)},t.prototype.clearUnusedValues=function(){e.prototype.clearUnusedValues.call(this),this.isOtherSelected||this.hasComment||(this.comment=null)},t}(o.a),h=function(e){function t(t){var r=e.call(this,t)||this;return r.name=t,r.colCountValue=1,r}return n.b(t,e),Object.defineProperty(t.prototype,"colCount",{get:function(){return this.colCountValue},set:function(e){e<0||e>4||(this.colCountValue=e,this.fireCallback(this.colCountChangedCallback))},enumerable:!0,configurable:!0}),t}(p);i.b.metaData.addClass("selectbase",["hasComment:boolean","hasOther:boolean",{name:"choices:itemvalues",onGetValue:function(e){return a.a.getData(e.choices)},onSetValue:function(e,t){e.choices=t}},{name:"choicesOrder",default:"none",choices:["none","asc","desc","random"]},{name:"choicesByUrl:restfull",className:"ChoicesRestfull",onGetValue:function(e){return e.choicesByUrl.getData()},onSetValue:function(e,t){e.choicesByUrl.setData(t)}},{name:"otherText",serializationProperty:"locOtherText"},{name:"otherErrorText",serializationProperty:"locOtherErrorText"},{name:"storeOthersAsComment:boolean",default:!0}],null,"question"),i.b.metaData.addClass("checkboxbase",[{name:"colCount:number",default:1,choices:[0,1,2,3,4]}],null,"selectbase")},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=function(){function e(){}return e}(),i=function(){function e(e,t){this.name=e,this.returnDisplayValue=t,this.isExists=!1}return e}(),o=function(){function e(){this.hasAllValuesOnLastRunValue=!1}return e.prototype.process=function(e,t){if(void 0===t&&(t=!1),this.hasAllValuesOnLastRunValue=!0,!e)return e;if(!this.onProcess)return e;for(var r=this.getItems(e),n=r.length-1;n>=0;n--){var o=r[n],a=this.getName(e.substring(o.start+1,o.end));if(this.canProcessName(a)){var s=new i(a,t);this.onProcess(s),s.isExists?(null==s.value&&(s.value="",this.hasAllValuesOnLastRunValue=!1),e=e.substr(0,o.start)+s.value+e.substr(o.end+1)):this.hasAllValuesOnLastRunValue=!1}}return e},Object.defineProperty(e.prototype,"hasAllValuesOnLastRun",{get:function(){return this.hasAllValuesOnLastRunValue},enumerable:!0,configurable:!0}),e.prototype.getItems=function(e){for(var t=[],r=e.length,i=-1,o="",a=0;a-1){var s=new n;s.start=i,s.end=a,t.push(s)}i=-1}return t},e.prototype.getName=function(e){if(e)return e.trim()},e.prototype.canProcessName=function(e){if(!e)return!1;for(var t=0;t0&&(e[t]=this.valuesHash[t]);return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visiblePages",{get:function(){if(this.isDesignMode)return this.pages;for(var e=new Array,t=0;t0?this.pages[0]:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentPage",{get:function(){var e=this.visiblePages;return null!=this.currentPageValue&&e.indexOf(this.currentPageValue)<0&&(this.currentPage=null),null==this.currentPageValue&&e.length>0&&(this.currentPage=e[0]),this.currentPageValue},set:function(e){var t=this.visiblePages;if(!(null!=e&&t.indexOf(e)<0)&&e!=this.currentPageValue){var r=this.currentPageValue;this.currentPageValue=e,e&&(e.updateCustomWidgets(),e.setWasShown(!0)),this.currentPageChanged(e,r)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentPageNo",{get:function(){return this.visiblePages.indexOf(this.currentPage)},set:function(e){this.visiblePages;e<0||e>=this.visiblePages.length||(this.currentPage=this.visiblePages[e])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questionsOrder",{get:function(){return this.getPropertyValue("questionsOrder","initial")},set:function(e){this.setPropertyValue("questionsOrder",e)},enumerable:!0,configurable:!0}),t.prototype.focusFirstQuestion=function(){var e=this.currentPage;e&&(e.scrollToTop(),e.focusFirstQuestion())},t.prototype.scrollToTopOnPageChange=function(){var e=this.currentPage;e&&(e.scrollToTop(),this.focusFirstQuestionAutomatic&&e.focusFirstQuestion())},Object.defineProperty(t.prototype,"state",{get:function(){return this.isLoading?"loading":this.isCompleted?"completed":this.isCompletedBefore?"completedbefore":!this.isDesignMode&&this.isEditMode&&this.isStartedState&&this.startedPage?"starting":this.currentPage?"running":"empty"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"completedState",{get:function(){return this.completedStateValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"completedStateText",{get:function(){return this.completedStateTextValue},enumerable:!0,configurable:!0}),t.prototype.setCompletedState=function(e,t){this.completedStateValue=e,t||("saving"==e&&(t=this.getLocString("savingData")),"error"==e&&(t=this.getLocString("savingDataError")),"success"==e&&(t=this.getLocString("savingDataSuccess"))),this.completedStateTextValue=t},t.prototype.clear=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0),e&&(this.data=null,this.variablesHash={}),this.setTimeSpent(0);for(var r=0;r0&&(this.currentPage=this.visiblePages[0])},t.prototype.mergeValues=function(e,t){if(t&&e)for(var r in e){var n=e[r];n&&"object"==typeof n?(t[r]||(t[r]={}),this.mergeValues(n,t[r])):t[r]=n}},t.prototype.updateCustomWidgets=function(e){e&&e.updateCustomWidgets()},t.prototype.currentPageChanged=function(e,t){this.onCurrentPageChanged.fire(this,{oldCurrentPage:t,newCurrentPage:e})},t.prototype.getProgress=function(){if(null==this.currentPage)return 0;var e=this.visiblePages.indexOf(this.currentPage)+1;return Math.ceil(100*e/this.visiblePageCount)},Object.defineProperty(t.prototype,"isNavigationButtonsShowing",{get:function(){if(this.isDesignMode)return!1;var e=this.currentPage;return!!e&&("show"==e.navigationButtonsVisibility||"hide"!=e.navigationButtonsVisibility&&this.showNavigationButtons)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEditMode",{get:function(){return"edit"==this.mode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisplayMode",{get:function(){return"display"==this.mode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDesignMode",{get:function(){return this.getPropertyValue("isDesignMode",!1)},enumerable:!0,configurable:!0}),t.prototype.setDesignMode=function(e){this.setPropertyValue("isDesignMode",e),this.onIsSinglePageChanged()},Object.defineProperty(t.prototype,"hasCookie",{get:function(){if(!this.cookieName)return!1;var e=document.cookie;return e&&e.indexOf(this.cookieName+"=true")>-1},enumerable:!0,configurable:!0}),t.prototype.setCookie=function(){this.cookieName&&(document.cookie=this.cookieName+"=true; expires=Fri, 31 Dec 9999 0:0:0 GMT")},t.prototype.deleteCookie=function(){this.cookieName&&(document.cookie=this.cookieName+"=;")},t.prototype.nextPage=function(){return!this.isLastPage&&((!this.isEditMode||!this.isCurrentPageHasErrors)&&(!this.doServerValidation()&&(this.doNextPage(),!0)))},Object.defineProperty(t.prototype,"isCurrentPageHasErrors",{get:function(){return null==this.currentPage||this.currentPage.hasErrors(!0,!0)},enumerable:!0,configurable:!0}),t.prototype.prevPage=function(){if(this.isFirstPage)return!1;var e=this.visiblePages,t=e.indexOf(this.currentPage);this.currentPage=e[t-1]},t.prototype.completeLastPage=function(){return(!this.isEditMode||!this.isCurrentPageHasErrors)&&(!this.doServerValidation()&&(this.doComplete(),!0))},Object.defineProperty(t.prototype,"isSinglePage",{get:function(){return this.getPropertyValue("isSinglePage",!1)},set:function(e){this.setPropertyValue("isSinglePage",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstPageIsStarted",{get:function(){return this.getPropertyValue("firstPageIsStarted",!1)},set:function(e){this.setPropertyValue("firstPageIsStarted",e)},enumerable:!0,configurable:!0}),t.prototype.isPageStarted=function(e){return this.firstPageIsStarted&&this.pages.length>0&&this.pages[0]===e},t.prototype.onFirstPageIsStartedChanged=function(){0!=this.pages.length&&(this.isStartedState=this.firstPageIsStarted,this.pageVisibilityChanged(this.pages[0],!this.firstPageIsStarted))},t.prototype.onIsSinglePageChanged=function(){if(!this.isSinglePage||this.isDesignMode){if(this.origionalPages){this.pages.splice(0,this.pages.length);for(var e=0;e0)return!1;var e=this.visiblePages[this.currentPageNo-1];return this.getPageMaxTimeToFinish(e)<=0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLastPage",{get:function(){if(null==this.currentPage)return!0;var e=this.visiblePages;return e.indexOf(this.currentPage)==e.length-1},enumerable:!0,configurable:!0}),t.prototype.doComplete=function(){var e=this.hasCookie;this.stopTimer(),this.clearUnusedValues(),this.setCookie(),this.setCompleted();var t=this,r={showDataSaving:function(e){t.setCompletedState("saving",e)},showDataSavingError:function(e){t.setCompletedState("error",e)},showDataSavingSuccess:function(e){t.setCompletedState("success",e)},showDataSavingClear:function(e){t.setCompletedState("","")}};this.onComplete.fire(this,r),!e&&this.surveyPostId&&this.sendResult()},t.prototype.start=function(){this.firstPageIsStarted&&(this.isStartedState=!1,this.startTimerFromUI(),this.onStarted.fire(this,{}))},Object.defineProperty(t.prototype,"isValidatingOnServer",{get:function(){return this.getPropertyValue("isValidatingOnServer",!1)},enumerable:!0,configurable:!0}),t.prototype.setIsValidatingOnServer=function(e){e!=this.isValidatingOnServer&&(this.setPropertyValue("isValidatingOnServer",e),this.onIsValidatingOnServerChanged())},t.prototype.onIsValidatingOnServerChanged=function(){},t.prototype.doServerValidation=function(){if(!this.onServerValidateQuestions)return!1;for(var e=this,t={data:{},errors:{},survey:this,complete:function(){e.completeServerValidation(t)}},r=0;r"+this.getLocString("completingSurvey")+""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"processedCompletedBeforeHtml",{get:function(){return this.completedBeforeHtml?this.processHtml(this.completedBeforeHtml):"

"+this.getLocString("completingSurveyBefore")+"

"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"processedLoadingHtml",{get:function(){return this.loadingHtml?this.processHtml(this.loadingHtml):"

"+this.getLocString("loadingSurvey")+"

"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"progressText",{get:function(){if(null==this.currentPage)return"";var e=this.visiblePages,t=e.indexOf(this.currentPage)+1;return this.getLocString("progressText").format(t,e.length)},enumerable:!0,configurable:!0}),t.prototype.afterRenderSurvey=function(e){this.onAfterRenderSurvey.fire(this,{survey:this,htmlElement:e})},t.prototype.updateQuestionCssClasses=function(e,t){this.onUpdateQuestionCssClasses.fire(this,{question:e,cssClasses:t})},t.prototype.updatePanelCssClasses=function(e,t){this.onUpdatePanelCssClasses.fire(this,{panel:e,cssClasses:t})},t.prototype.afterRenderPage=function(e){this.onAfterRenderPage.isEmpty||this.onAfterRenderPage.fire(this,{page:this.currentPage,htmlElement:e})},t.prototype.afterRenderQuestion=function(e,t){this.onAfterRenderQuestion.fire(this,{question:e,htmlElement:t})},t.prototype.afterRenderPanel=function(e,t){this.onAfterRenderPanel.fire(this,{panel:e,htmlElement:t})},t.prototype.matrixRowAdded=function(e){this.onMatrixRowAdded.fire(this,{question:e})},t.prototype.matrixRowRemoved=function(e,t,r){this.onMatrixRowRemoved.fire(this,{question:e,rowIndex:t,row:r})},t.prototype.matrixCellCreated=function(e,t){t.question=e,this.onMatrixCellCreated.fire(this,t)},t.prototype.matrixAfterCellRender=function(e,t){t.question=e,this.onMatrixAfterCellRender.fire(this,t)},t.prototype.matrixCellValueChanged=function(e,t){t.question=e,this.onMatrixCellValueChanged.fire(this,t)},t.prototype.matrixCellValidate=function(e,t){return t.question=e,this.onMatrixCellValidate.fire(this,t),t.error?new p.c(t.error):null},t.prototype.uploadFile=function(e,t,r,n){var i=!0;return this.onUploadFile.fire(this,{name:e,file:t,accept:i}),!!i&&(!r&&this.surveyPostId&&this.uploadFileCore(e,t,n),!0)},t.prototype.createSurveyService=function(){return new l.a},t.prototype.uploadFileCore=function(e,t,r){var n=this;r&&r("uploading"),this.createSurveyService().sendFile(this.surveyPostId,t,function(t,i){r&&r(t?"success":"error"),t&&n.setValue(e,i)})},t.prototype.getPage=function(e){return this.pages[e]},t.prototype.addPage=function(e){null!=e&&(this.pages.push(e),this.updateVisibleIndexes())},t.prototype.addNewPage=function(e){void 0===e&&(e=null);var t=this.createNewPage(e);return this.addPage(t),t},t.prototype.removePage=function(e){var t=this.pages.indexOf(e);t<0||(this.pages.splice(t,1),this.currentPageValue==e&&(this.currentPage=this.pages.length>0?this.pages[0]:null),this.updateVisibleIndexes())},t.prototype.getQuestionByName=function(e,t){void 0===t&&(t=!1);var r=this.getAllQuestions();t&&(e=e.toLowerCase());for(var n=0;n0&&(this.jsonErrors=t.errors)}},t.prototype.endLoadingFromJson=function(){this.isStartedState=this.firstPageIsStarted,this.onIsSinglePageChanged(),this.runConditions(),this.updateVisibleIndexes(),e.prototype.endLoadingFromJson.call(this),this.hasCookie&&this.doComplete(),this.doElementsOnLoad()},t.prototype.onBeforeCreating=function(){},t.prototype.onCreating=function(){},t.prototype.getProcessedTextValue=function(e){var t=e.name.toLocaleLowerCase();if("pageno"===t){e.isExists=!0;var r=this.currentPage;return void(e.value=null!=r?this.visiblePages.indexOf(r)+1:0)}if("pagecount"===t)return e.isExists=!0,void(e.value=this.visiblePageCount);if("correctedanswers"===t||"correctedanswercount"===t)return e.isExists=!0,void(e.value=this.getCorrectedAnswerCount());if("incorrectedanswers"===t||"incorrectedanswercount"===t)return e.isExists=!0,void(e.value=this.getInCorrectedAnswerCount());if("questioncount"===t)return e.isExists=!0,void(e.value=this.getQuizQuestions().length);var n=(new u.a).getFirstName(t),i=this.getVariable(t);if(void 0!==i)return e.isExists=!0,void(e.value=i);var o=this.getQuestionByValueName(n,!0);if(o){e.isExists=!0,t=o.getValueName()+t.substr(n.length);var a={};return a[n]=e.returnDisplayValue?o.displayValue:this.getValue(n),void(e.value=(new u.a).getValue(t,a))}var s=this.getValue(e.name);void 0!==s&&(e.isExists=!0,e.value=s)},t.prototype.clearUnusedValues=function(){for(var e=this.getAllQuestions(),t=0;t0&&this.maxTimeToFinish>0)return this.getLocString("timerLimitAll").format(t,i,r,o);return this.getTimerInfoPageText(e,t,i)+" "+this.getTimerInfoSurveyText(r,o)}return""},t.prototype.getTimerInfoPageText=function(e,t,r){return this.getPageMaxTimeToFinish(e)>0?this.getLocString("timerLimitPage").format(t,r):this.getLocString("timerSpentPage").format(t,r)},t.prototype.getTimerInfoSurveyText=function(e,t){return this.maxTimeToFinish>0?this.getLocString("timerLimitSurvey").format(e,t):this.getLocString("timerSpentSurvey").format(e,t)},t.prototype.getDisplayTime=function(e){var t=Math.floor(e/60),r=e%60,n="";return t>0&&(n+=t+" "+this.getLocString("timerMin")),n&&0==r?n:(n&&(n+=" "),n+r+" "+this.getLocString("timerSec"))},t.prototype.startTimer=function(){if(!this.isTimerStarted&&!this.isDesignMode){var e=this;this.timerFunc=function(){e.doTimer()},this.isTimerStarted=!0,d.a.instance.start(this.timerFunc)}},t.prototype.startTimerFromUI=function(){"none"!=this.showTimerPanel&&"running"===this.state&&this.startTimer()},t.prototype.stopTimer=function(){this.isTimerStarted&&(this.isTimerStarted=!1,d.a.instance.stop(this.timerFunc))},Object.defineProperty(t.prototype,"timeSpent",{get:function(){return this.getPropertyValue("timeSpent",0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxTimeToFinish",{get:function(){return this.getPropertyValue("maxTimeToFinish",0)},set:function(e){this.setPropertyValue("maxTimeToFinish",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxTimeToFinishPage",{get:function(){return this.getPropertyValue("maxTimeToFinishPage",0)},set:function(e){this.setPropertyValue("maxTimeToFinishPage",e)},enumerable:!0,configurable:!0}),t.prototype.getPageMaxTimeToFinish=function(e){return!e||e.maxTimeToFinish<0?0:e.maxTimeToFinish>0?e.maxTimeToFinish:this.maxTimeToFinishPage},t.prototype.doTimer=function(){var e=this.currentPage;if(e&&(e.timeSpent=e.timeSpent+1),this.setTimeSpent(this.timeSpent+1),this.onTimer.fire(this,{}),this.maxTimeToFinish>0&&this.maxTimeToFinish==this.timeSpent&&this.completeLastPage(),e){var t=this.getPageMaxTimeToFinish(e);t>0&&t==e.timeSpent&&(this.isLastPage?this.completeLastPage():this.nextPage())}},t.prototype.setTimeSpent=function(e){this.setPropertyValue("timeSpent",e)},t.prototype.geSurveyData=function(){return this},t.prototype.getSurvey=function(){return this},t.prototype.getTextProcessor=function(){return this},t.prototype.getObjects=function(e,t){var r=[];return Array.prototype.push.apply(r,this.getPagesByNames(e)),Array.prototype.push.apply(r,this.getQuestionsByNames(t)),r},t.prototype.setTriggerValue=function(e,t,r){e&&(r?this.setVariable(e,t):this.setValue(e,t))},t.stylesManager=new h.a,t.platform="unknown",t}(o.c);i.b.metaData.addClass("survey",[{name:"locale",choices:function(){return c.a.getLocales()}},{name:"title:text",serializationProperty:"locTitle"},{name:"focusFirstQuestionAutomatic:boolean",default:!0},{name:"completedHtml:html",serializationProperty:"locCompletedHtml"},{name:"completedBeforeHtml:html",serializationProperty:"locCompletedBeforeHtml"},{name:"loadingHtml:html",serializationProperty:"locLoadingHtml"},{name:"pages",className:"page",visible:!1},{name:"questions",alternativeName:"elements",baseClassName:"question",visible:!1,onGetValue:function(e){return null},onSetValue:function(e,t,r){var n=e.addNewPage("");r.toObject({questions:t},n)}},{name:"triggers:triggers",baseClassName:"surveytrigger",classNamePart:"trigger"},{name:"surveyId",visible:!1},{name:"surveyPostId",visible:!1},{name:"surveyShowDataSaving",visible:!1},"cookieName","sendResultOnPageNext:boolean",{name:"showNavigationButtons:boolean",default:!0},{name:"showPrevButton:boolean",default:!0},{name:"showTitle:boolean",default:!0},{name:"showPageTitles:boolean",default:!0},{name:"showCompletedPage:boolean",default:!0},{name:"questionsOrder",default:"initial",choices:["initial","random"]},"showPageNumbers:boolean",{name:"showQuestionNumbers",default:"on",choices:["on","onPage","off"]},{name:"questionTitleLocation",default:"top",choices:["top","bottom","left"]},{name:"questionErrorLocation",default:"top",choices:["top","bottom"]},{name:"showProgressBar",default:"off",choices:["off","top","bottom"]},{name:"mode",default:"edit",choices:["edit","display"]},{name:"storeOthersAsComment:boolean",default:!0},"goNextPageAutomatic:boolean",{name:"clearInvisibleValues",default:"onComplete",choices:["none","onComplete","onHidden"]},{name:"startSurveyText",serializationProperty:"locStartSurveyText"},{name:"pagePrevText",serializationProperty:"locPagePrevText"},{name:"pageNextText",serializationProperty:"locPageNextText"},{name:"completeText",serializationProperty:"locCompleteText"},{name:"requiredText",default:"*"},"questionStartIndex",{name:"questionTitleTemplate",serializationProperty:"locQuestionTitleTemplate"},{name:"firstPageIsStarted:boolean",default:!1},{name:"isSinglePage:boolean",default:!1},{name:"maxTimeToFinish:number",default:0},{name:"maxTimeToFinishPage:number",default:0},{name:"showTimerPanel",default:"none",choices:["none","top","bottom"]},{name:"showTimerPanelMode",default:"all",choices:["all","page","survey"]}])},function(e,t,r){"use strict";var n=r(0),i=r(18),o=r(43);r.d(t,"a",function(){return a}),r.d(t,"b",function(){return s});var a=function(e){function t(t){return void 0===t&&(t=null),e.call(this,t)||this}return n.b(t,e),t.prototype.render=function(){this.renderCallback&&this.renderCallback()},t.prototype.mergeCss=function(e,t){this.mergeValues(e,t)},t.prototype.doAfterRenderSurvey=function(e){this.afterRenderSurvey(e)},t.prototype.onLoadSurveyFromService=function(){this.render()},t.prototype.onLoadingSurveyFromService=function(){this.render()},t.prototype.setCompletedState=function(t,r){e.prototype.setCompletedState.call(this,t,r),this.render()},t.prototype.start=function(){e.prototype.start.call(this),this.render()},t}(i.a),s=function(e){function t(t,r){return void 0===t&&(t=null),void 0===r&&(r=null),e.call(this,t,r)||this}return n.b(t,e),t.prototype.createSurvey=function(e){return new a(e)},t}(o.a);i.a.platform="react"},function(e,t,r){"use strict";var n=r(0),i=r(2),o=(r.n(i),r(19)),a=r(27),s=r(38),u=r(6),l=r(12),c=r(39),p=r(41),h=r(4);r.d(t,"a",function(){return d});var d=function(e){function t(t){var r=e.call(this,t)||this;return r.isCurrentPageChanged=!1,r.handleTryAgainClick=r.handleTryAgainClick.bind(r),r.state=r.getState(),r.updateSurvey(t),r}return n.b(t,e),Object.defineProperty(t,"cssType",{get:function(){return l.b.currentType},set:function(e){l.b.currentType=e},enumerable:!0,configurable:!0}),t.prototype.componentWillReceiveProps=function(e){this.setState(this.getState()),this.updateSurvey(e)},t.prototype.componentDidUpdate=function(){this.isCurrentPageChanged&&(this.isCurrentPageChanged=!1,this.survey.scrollToTopOnPageChange())},t.prototype.componentDidMount=function(){var e=this.refs.root;e&&this.survey&&this.survey.doAfterRenderSurvey(e),this.survey&&this.survey.startTimerFromUI()},t.prototype.componentWillUnmount=function(){this.survey&&this.survey.stopTimer()},t.prototype.render=function(){return"completed"==this.survey.state?this.renderCompleted():"completedbefore"==this.survey.state?this.renderCompletedBefore():"loading"==this.survey.state?this.renderLoading():"starting"==this.survey.state?this.renderStartPage():this.renderSurvey()},Object.defineProperty(t.prototype,"css",{get:function(){return l.b.getCss()},set:function(e){this.survey.mergeCss(e,this.css)},enumerable:!0,configurable:!0}),t.prototype.handleTryAgainClick=function(e){this.survey.doComplete()},t.prototype.renderCompleted=function(){if(!this.survey.showCompletedPage)return null;var e=null;if(this.survey.completedState){var t=null;if("error"==this.survey.completedState){var r=this.survey.getLocString("saveAgainButton");t=i.createElement("input",{type:"button",value:r,className:this.css.saveData.saveAgainButton,onClick:this.handleTryAgainClick})}var n=this.css.saveData[this.survey.completedState];e=i.createElement("div",{className:this.css.saveData.root},i.createElement("div",{className:n},i.createElement("span",null,this.survey.completedStateText),t))}var o={__html:this.survey.processedCompletedHtml};return i.createElement("div",null,i.createElement("div",{dangerouslySetInnerHTML:o}),e)},t.prototype.renderCompletedBefore=function(){var e={__html:this.survey.processedCompletedBeforeHtml};return i.createElement("div",{dangerouslySetInnerHTML:e})},t.prototype.renderLoading=function(){var e={__html:this.survey.processedLoadingHtml};return i.createElement("div",{dangerouslySetInnerHTML:e})},t.prototype.renderStartPage=function(){var e=this.survey.startedPage?this.renderPage(this.survey.startedPage):null,t=this.survey.startedPage?this.survey.startedPage.id:"",r=this.renderNavigation();return i.createElement("div",{ref:"root",className:this.css.root},i.createElement("div",{id:t,className:this.css.body},e),r)},t.prototype.renderSurvey=function(){var e=this.renderTitle(),t=this.survey.currentPage?this.renderPage(this.survey.currentPage):null,r=this.survey.currentPage?this.survey.currentPage.id:"",n="top"==this.survey.showProgressBar?this.renderProgress(!0):null,o="bottom"==this.survey.showProgressBar?this.renderProgress(!1):null,a=t?this.renderNavigation():null;return t||(t=this.renderEmptySurvey()),i.createElement("div",{ref:"root",className:this.css.root},i.createElement("div",{className:"sv_custom_header"}),i.createElement("div",{className:"sv_container"},e,i.createElement("div",{id:r,className:this.css.body},n,this.renderTimerPanel("top"),t,this.renderTimerPanel("bottom"),o,a)))},t.prototype.renderTitle=function(){var e=null;return this.survey.title&&this.survey.showTitle&&(e=h.a.renderLocString(this.survey.locTitle)),i.createElement("div",{className:this.css.header},i.createElement("h3",null,e))},t.prototype.renderTimerPanel=function(e){return this.survey.showTimerPanel!=e?null:i.createElement(p.a,{survey:this.survey,css:this.css})},t.prototype.renderPage=function(e){return i.createElement(a.a,{survey:this.survey,page:e,css:this.css,creator:this})},t.prototype.renderProgress=function(e){return i.createElement(c.a,{survey:this.survey,css:this.css,isTop:e})},t.prototype.renderNavigation=function(){return i.createElement(s.a,{survey:this.survey,css:this.css})},t.prototype.renderEmptySurvey=function(){return i.createElement("span",null,this.survey.emptySurveyText)},t.prototype.updateSurvey=function(e){if(e?e.model?this.survey=e.model:e.json&&(this.survey=new o.a(e.json)):this.survey=new o.a,e){var t=function(){if("model"==n||"children"==n)return"continue";if("css"==n)return r.survey.mergeCss(e.css,r.css),"continue";if(0==n.indexOf("on")&&r.survey[n]&&r.survey[n].add){var t=e[n],i=function(e,r){t(e,r)};r.survey[n].add(i)}else r.survey[n]=e[n]},r=this;for(var n in e)t()}this.survey.currentPage;this.setSurveyEvents(e)},t.prototype.getState=function(){return{pageIndexChange:0,isCompleted:!1,modelChanged:0}},t.prototype.setSurveyEvents=function(e){var t=this;this.survey.renderCallback=function(){t.setState({modelChanged:t.state.modelChanged+1})},this.survey.onComplete.add(function(e){t.setState({isCompleted:!0})}),this.survey.onPartialSend.add(function(e){t.setState(t.state)}),this.survey.onCurrentPageChanged.add(function(r,n){t.isCurrentPageChanged=!0,t.setState({pageIndexChange:t.state.pageIndexChange+1}),e&&e.onCurrentPageChanged&&e.onCurrentPageChanged(r,n)}),this.survey.onVisibleChanged.add(function(e,t){if(t.question&&t.question.react){var r=t.question.react.state;r.visible=t.question.visible,t.question.react.setState(r)}}),this.survey.onValueChanged.add(function(t,r){if(r.question&&r.question.react){var n=r.question.react.state;n.value=r.value,r.question.react.setState(n)}e&&e.data&&(e.data[r.name]=r.value)})},t.prototype.createQuestionElement=function(e){return u.a.Instance.createQuestion(e.getTemplate(),{question:e,isDisplayMode:e.isReadOnly,creator:this})},t.prototype.renderError=function(e,t,r){return i.createElement("div",{key:e,className:r.error.item},t)},t.prototype.questionTitleLocation=function(){return this.survey.questionTitleLocation},t.prototype.questionErrorLocation=function(){return this.survey.questionErrorLocation},t}(i.Component)},function(e,t,r){"use strict";var n=r(0),i=r(7),o=r(11),a=r(3),s=r(1),u=r(9);r.d(t,"a",function(){return c});var l=function(){function e(){this.parser=new DOMParser}return e.prototype.assignValue=function(e,t,r){Array.isArray(e[t])?e[t].push(r):void 0!==e[t]?e[t]=[e[t]].concat(r):"object"==typeof r&&1===Object.keys(r).length&&Object.keys(r)[0]===t?e[t]=r[t]:e[t]=r},e.prototype.xml2Json=function(e,t){if(e.children&&e.children.length>0)for(var r=0;r-1?this.path.split(";"):this.processedPath.split(","),0==e.length&&e.push(this.processedPath),e},t.prototype.getValue=function(e){return e?this.valueName?this.getValueCore(e,this.valueName):e instanceof Object?Object.keys(e).length<1?null:e[Object.keys(e)[0]]:e:null},t.prototype.getTitle=function(e){var t=this.titleName?this.titleName:"title";return this.getValueCore(e,t)},t.prototype.getValueCore=function(e,t){if(!e)return null;if(t.indexOf(".")<0)return e[t];for(var r=t.split("."),n=0;n0},e}(),p=function(e){function t(r){void 0===r&&(r="");var n=e.call(this,r)||this;n.name=r,n.rowValues=null,n.conditionRunner=null,n.isQuestionsReady=!1,n.questionsValue=new Array,n.elementsValue=n.createNewArray("elements",function(e){i.onAddElement(e,i.elementsValue.length)},function(e){i.onRemoveElement(e)}),n.registerFunctionOnPropertyValueChanged("elements",function(){i.markQuestionListDirty(),i.onRowsChanged()}),n.id=t.getPanelId();var i=n;return n.createLocalizableString("title",n,!0).onRenderedHtmlCallback=function(e){return i.getRenderedTitle(e)},n.createLocalizableString("description",n,!0).onGetTextCallback=function(e){return i.getProcessedHtml(e)},n.createLocalizableString("requiredErrorText",n),n}return n.b(t,e),t.getPanelId=function(){return"sp_"+t.panelCounter++},t.prototype.setSurveyImpl=function(t){e.prototype.setSurveyImpl.call(this,t),this.isDesignMode&&this.onVisibleChanged();for(var r=0;r0)&&this.errorsChangedCallback&&this.errorsChangedCallback()}}},t.prototype.hasErrorsCore=function(e){for(var t=0;t-1){r.updateVisible();break}}},t.prototype.buildRows=function(){for(var e=new Array,t=0;t=this.elements.length?this.elements.push(e):this.elements.splice(t,0,e))},t.prototype.addQuestion=function(e,t){void 0===t&&(t=-1),this.addElement(e,t)},t.prototype.addPanel=function(e,t){void 0===t&&(t=-1),this.addElement(e,t)},t.prototype.addNewQuestion=function(e,t){void 0===t&&(t=null);var r=s.a.Instance.createQuestion(e,t);return this.addQuestion(r),r},t.prototype.addNewPanel=function(e){void 0===e&&(e=null);var t=this.createNewPanel(e);return this.addPanel(t),t},t.prototype.createNewPanel=function(e){return new h(e)},t.prototype.removeElement=function(e){var t=this.elements.indexOf(e);if(t<0){for(var r=0;r-1&&this.locTitle.onChanged()},t.panelCounter=100,t}(o.a),h=function(e){function t(t){void 0===t&&(t="");var r=e.call(this,t)||this;r.name=t;var n=r;return r.registerFunctionOnPropertyValueChanged("state",function(){n.stateChangedCallback&&n.stateChangedCallback()}),r}return n.b(t,e),t.prototype.getType=function(){return"panel"},Object.defineProperty(t.prototype,"isPanel",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"page",{get:function(){return this.getPage(this.parent)},set:function(e){this.setPage(this.parent,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.getPropertyValue("state","default")},set:function(e){this.setPropertyValue("state",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCollapsed",{get:function(){return"collapsed"==this.state},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isExpanded",{get:function(){if(!this.isDesignMode)return"expanded"==this.state},enumerable:!0,configurable:!0}),t.prototype.collapse=function(){this.isDesignMode||(this.state="collapsed")},t.prototype.expand=function(){this.state="expanded"},t.prototype.hasErrorsCore=function(t){e.prototype.hasErrorsCore.call(this,t),this.isCollapsed&&t.result&&t.fireCallback&&this.expand()},t.prototype.getRenderedTitle=function(t){if(!t){if(this.isCollapsed||this.isExpanded)return this.name;if(this.isDesignMode)return"["+this.name+"]"}return e.prototype.getRenderedTitle.call(this,t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.getPropertyValue("width")},set:function(e){this.setPropertyValue("width",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"innerIndent",{get:function(){return this.getPropertyValue("innerIndent",0)},set:function(e){this.setPropertyValue("innerIndent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderWidth",{get:function(){return this.getPropertyValue("renderWidth")},set:function(e){this.setPropertyValue("renderWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startWithNewLine",{get:function(){return this.getPropertyValue("startWithNewLine",!0)},set:function(e){this.setPropertyValue("startWithNewLine",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rightIndent",{get:function(){return this.getPropertyValue("rightIndent",0)},set:function(e){this.setPropertyValue("rightIndent",e)},enumerable:!0,configurable:!0}),t.prototype.onVisibleChanged=function(){e.prototype.onVisibleChanged.call(this),this.setPropertyValue("isVisible",this.isVisible),null!=this.survey&&this.survey.panelVisibilityChanged(this,this.visible)},t}(p);i.b.metaData.addClass("panelbase",["name",{name:"elements",alternativeName:"questions",baseClassName:"question",visible:!1},{name:"visible:boolean",default:!0},"visibleIf:condition",{name:"questionTitleLocation",default:"default",choices:["default","top","bottom","left"]},{name:"title:text",serializationProperty:"locTitle"},{name:"description:text",serializationProperty:"locDescription"}],function(){return new p}),i.b.metaData.addClass("panel",[{name:"state",default:"default",choices:["default","collapsed","expanded"]},"isRequired:boolean",{name:"requiredErrorText:text",serializationProperty:"locRequiredErrorText"},{name:"startWithNewLine:boolean",default:!0},{name:"innerIndent:number",default:0,choices:[0,1,2,3]},{name:"page",isSerializable:!1,choices:function(e){var t=e?e.survey:null;return t?t.pages:[]}}],function(){return new h},"panelbase")},function(e,t,r){"use strict";var n=r(0),i=r(3),o=r(8),a=r(10),s=r(7),u=r(17),l=r(15),c=r(11),p=r(1),h=r(16),d=r(21),f=r(5);r.d(t,"b",function(){return g}),r.d(t,"a",function(){return m}),r.d(t,"c",function(){return y}),r.d(t,"d",function(){return v});var g=function(e){function t(t,r){void 0===r&&(r=null);var n=e.call(this)||this;n.colOwner=null,n.validators=new Array,n.name=t,n.choicesValue=n.createItemValues("choices");var i=n;return n.createLocalizableString("title",n,!0).onRenderedHtmlCallback=function(e){return i.getFullTitle(e)},n.createLocalizableString("optionsCaption",n),n.createLocalizableString("placeHolder",n),n.choicesByUrl=new d.a,r&&(n.title=r),n}return n.b(t,e),t.prototype.getType=function(){return"matrixdropdowncolumn"},Object.defineProperty(t.prototype,"name",{get:function(){return this.getPropertyValue("name")},set:function(e){this.setPropertyValue("name",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"choicesOrder",{get:function(){return this.getPropertyValue("choicesOrder","none")},set:function(e){e=e.toLocaleLowerCase(),this.setPropertyValue("choicesOrder",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputType",{get:function(){return this.getPropertyValue("inputType","text")},set:function(e){e=e.toLocaleLowerCase(),this.setPropertyValue("inputType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cellType",{get:function(){return this.getPropertyValue("cellType","default")},set:function(e){e=e.toLocaleLowerCase(),this.setPropertyValue("cellType",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.getLocalizableStringText("title",this.name)},set:function(e){this.setLocalizableStringText("title",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locTitle",{get:function(){return this.getLocalizableString("title")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fullTitle",{get:function(){return this.getFullTitle(this.locTitle.textOrHtml)},enumerable:!0,configurable:!0}),t.prototype.getFullTitle=function(e){if(e||(e=this.name),this.isRequired){var t=this.colOwner?this.colOwner.getRequiredText():"";t&&(t+=" "),e=t+e}return e},Object.defineProperty(t.prototype,"optionsCaption",{get:function(){return this.getLocalizableStringText("optionsCaption")},set:function(e){this.setLocalizableStringText("optionsCaption",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locOptionsCaption",{get:function(){return this.getLocalizableString("optionsCaption")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeHolder",{get:function(){return this.getLocalizableStringText("placeHolder")},set:function(e){this.setLocalizableStringText("placeHolder",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locPlaceHolder",{get:function(){return this.getLocalizableString("placeHolder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"choices",{get:function(){return this.choicesValue},set:function(e){this.setPropertyValue("choices",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"colCount",{get:function(){return this.getPropertyValue("colCount",-1)},set:function(e){e<-1||e>4||this.setPropertyValue("colCount",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRequired",{get:function(){return this.getPropertyValue("isRequired",!1)},set:function(e){this.setPropertyValue("isRequired",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasOther",{get:function(){return this.getPropertyValue("hasOther",!1)},set:function(e){this.setPropertyValue("hasOther",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minWidth",{get:function(){return this.getPropertyValue("minWidth","")},set:function(e){this.setPropertyValue("minWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibleIf",{get:function(){return this.getPropertyValue("visibleIf","")},set:function(e){this.setPropertyValue("visibleIf",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enableIf",{get:function(){return this.getPropertyValue("enableIf","")},set:function(e){this.setPropertyValue("enableIf",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"booleanDefaultValue",{get:function(){return this.getPropertyValue("booleanDefaultValue","indeterminate")},set:function(e){this.setPropertyValue("booleanDefaultValue",e)},enumerable:!0,configurable:!0}),t.prototype.getLocale=function(){return this.colOwner?this.colOwner.getLocale():""},t.prototype.getMarkdownHtml=function(e){return this.colOwner?this.colOwner.getMarkdownHtml(e):null},t.prototype.propertyValueChanged=function(t,r,n){e.prototype.propertyValueChanged.call(this,t,r,n),null==this.colOwner||this.isLoadingFromJson||this.colOwner.onColumnPropertiesChanged(this)},t}(s.c),m=function(){function e(e,t,r){var n=this;this.column=e,this.row=t,this.data=r,this.questionValue=r.createQuestion(this.row,this.column),this.questionValue.validateValueCallback=function(){return r.validateCell(t,e.name,t.value)},i.a.getProperties(e.getType()).forEach(function(t){var r=t.name;void 0!==e[r]&&null==n.questionValue.getPropertyValue(r,null)&&(n.questionValue[r]=e[r])}),Object.keys(e).forEach(function(e){}),this.questionValue.updateCustomWidget()}return Object.defineProperty(e.prototype,"question",{get:function(){return this.questionValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.question.value},set:function(e){this.question.value=e},enumerable:!0,configurable:!0}),e.prototype.runCondition=function(e){this.question.runCondition(e)},e}(),y=function(){function e(t,r){this.rowValues={},this.isSettingValue=!1,this.cells=[],this.data=t,this.value=r,this.textPreProcessor=new u.a;var n=this;this.textPreProcessor.onProcess=function(e){n.getProcessedTextValue(e)};for(var i=0;i4||(this.setPropertyValue("columnColCount",e),this.fireCallback(this.updateCellsCallback))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnMinWidth",{get:function(){return this.getPropertyValue("columnMinWidth","")},set:function(e){this.setPropertyValue("columnMinWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"horizontalScroll",{get:function(){return this.getPropertyValue("horizontalScroll",!1)},set:function(e){this.setPropertyValue("horizontalScroll",e)},enumerable:!0,configurable:!0}),t.prototype.getRequiredText=function(){return this.survey?this.survey.requiredText:""},t.prototype.onColumnPropertiesChanged=function(e){if(this.generatedVisibleRows)for(var t=0;t=t.length)return null;var r=this.createNewValue(this.value);return this.getRowValueCore(t[e],r)},t.prototype.setRowValue=function(e,t){if(e<0)return null;var r=this.visibleRows;if(e>=r.length)return null;this.onRowChanged(r[e],"",t),this.onValueChanged()},t.prototype.generateRows=function(){return null},t.prototype.createNewValue=function(e){return e||{}},t.prototype.getRowValueCore=function(e,t,r){void 0===r&&(r=!1);var n=t[e.rowName]?t[e.rowName]:null;return!n&&r&&(n={},t[e.rowName]=n),n},t.prototype.getRowDisplayValue=function(e,t){for(var r=0;r0&&(t=t.concat(a))}return t},t.prototype.hasErrorInColumns=function(e){if(!this.generatedVisibleRows)return!1;for(var t=!1,r=0;r0)return r[n].question}return null},t.prototype.createQuestion=function(e,t){return this.createQuestionCore(e,t)},t.prototype.createQuestionCore=function(e,t){var r="default"==t.cellType?this.cellType:t.cellType,n=this.createCellQuestion(r,t.name);return n.setSurveyImpl(e),this.setQuestionProperties(n,t,e),n},t.prototype.getColumnChoices=function(e){return e.choices&&e.choices.length>0?e.choices:this.choices},t.prototype.getColumnOptionsCaption=function(e){return e.optionsCaption?e.optionsCaption:this.optionsCaption},t.prototype.setQuestionProperties=function(e,t,r){if(e){e.name=t.name,e.isRequired=t.isRequired,e.hasOther=t.hasOther,e.readOnly=this.readOnly,e.validators=t.validators,e.visibleIf=t.visibleIf,e.enableIf=t.enableIf,t.hasOther&&e instanceof h.b&&(e.storeOthersAsComment=!1);var n=e.getType();"checkbox"!=n&&"radiogroup"!=n||(e.colCount=t.colCount>-1?t.colCount:this.columnColCount,this.setSelectBaseProperties(e,t,r)),"dropdown"==n&&(e.optionsCaption=this.getColumnOptionsCaption(t),this.setSelectBaseProperties(e,t,r)),"text"==n&&(e.inputType=t.inputType,e.placeHolder=t.placeHolder),"comment"==n&&(e.placeHolder=t.placeHolder),"boolean"==n&&(e.defaultValue=t.booleanDefaultValue,e.showTitle=!0)}},t.prototype.setSelectBaseProperties=function(e,t,r){e.choicesOrder=t.choicesOrder,e.choices=this.getColumnChoices(t),e.choicesByUrl.setData(t.choicesByUrl),e.choicesByUrl.isEmpty||e.choicesByUrl.run(r)},t.prototype.createCellQuestion=function(e,t){return f.a.Instance.createQuestion(e,t)},t.prototype.deleteRowValue=function(e,t){return delete e[t.rowName],0==Object.keys(e).length?null:e},t.prototype.onAnyValueChanged=function(e){if(!this.isLoadingFromJson)for(var t=this.visibleRows,r=0;r0)return!1;return!0}return 0==Object.keys(e).length}},t.prototype.getSurvey=function(){return this.survey},t}(o.a);i.b.metaData.addClass("matrixdropdowncolumn",["name",{name:"title",serializationProperty:"locTitle"},{name:"choices:itemvalues",onGetValue:function(e){return c.a.getData(e.choices)},onSetValue:function(e,t){e.choices=t}},{name:"optionsCaption",serializationProperty:"locOptionsCaption"},{name:"cellType",default:"default",choices:["default","dropdown","checkbox","radiogroup","text","comment","boolean"]},{name:"colCount",default:-1,choices:[-1,0,1,2,3,4]},"isRequired:boolean","hasOther:boolean","minWidth",{name:"placeHolder",serializationProperty:"locPlaceHolder"},{name:"choicesOrder",default:"none",choices:["none","asc","desc","random"]},{name:"choicesByUrl:restfull",className:"ChoicesRestfull",onGetValue:function(e){return e.choicesByUrl.isEmpty?null:e.choicesByUrl},onSetValue:function(e,t){e.choicesByUrl.setData(t)}},{name:"booleanDefaultValue",default:"indeterminate",choices:["indeterminate","false","true"]},{name:"inputType",default:"text",choices:["color","date","datetime","datetime-local","email","month","number","password","range","tel","text","time","url","week"]},"visibleIf:condition","enableIf:condition",{name:"validators:validators",baseClassName:"surveyvalidator",classNamePart:"validator"}],function(){return new g("")}),i.b.metaData.addClass("matrixdropdownbase",[{name:"columns:matrixdropdowncolumns",className:"matrixdropdowncolumn"},"horizontalScroll:boolean",{name:"choices:itemvalues",onGetValue:function(e){return c.a.getData(e.choices)},onSetValue:function(e,t){e.choices=t}},{name:"optionsCaption",serializationProperty:"locOptionsCaption"},{name:"cellType",default:"dropdown",choices:["dropdown","checkbox","radiogroup","text","comment","boolean"]},{name:"columnColCount",default:0,choices:[0,1,2,3,4]},"columnMinWidth"],function(){return new v("")},"question")},function(e,t,r){"use strict";var n=r(0),i=r(7),o=r(3),a=r(13),s=r(12),u=r(35);r.d(t,"a",function(){return l});var l=function(e){function t(r){var n=e.call(this,r)||this;return n.name=r,n.conditionRunner=null,n.isCustomWidgetRequested=!1,n.customWidgetData={isNeedRender:!0},n.localeChanged=new i.b,n.id=t.getQuestionId(),n.onCreating(),n}return n.b(t,e),t.getQuestionId=function(){return"sq_"+t.questionCounter++},t.prototype.getType=function(){return"questionbase"},t.prototype.setSurveyImpl=function(t){e.prototype.setSurveyImpl.call(this,t),this.survey&&this.survey.isDesignMode&&this.onVisibleChanged()},Object.defineProperty(t.prototype,"parent",{get:function(){return this.getPropertyValue("parent",null)},set:function(e){this.setPropertyValue("parent",e)},enumerable:!0,configurable:!0}),t.prototype.isAnswerCorrect=function(){return!1},t.prototype.getValueName=function(){return this.name},Object.defineProperty(t.prototype,"page",{get:function(){return this.getPage(this.parent)},set:function(e){this.setPage(this.parent,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPanel",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this.getPropertyValue("visible",!0)},set:function(e){e!=this.visible&&(this.setPropertyValue("visible",e),this.onVisibleChanged(),this.survey&&this.survey.questionVisibilityChanged(this,this.visible))},enumerable:!0,configurable:!0}),t.prototype.onVisibleChanged=function(){this.setPropertyValue("isVisible",this.isVisible),!this.isVisible&&this.errors&&this.errors.length>0&&(this.errors=[],this.fireCallback(this.errorsChangedCallback))},Object.defineProperty(t.prototype,"visibleIf",{get:function(){return this.getPropertyValue("visibleIf","")},set:function(e){this.setPropertyValue("visibleIf",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.visible||this.isDesignMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibleIndex",{get:function(){return this.getPropertyValue("visibleIndex",-1)},enumerable:!0,configurable:!0}),t.prototype.hasErrors=function(e){return void 0===e&&(e=!0),!1},t.prototype.isEmpty=function(){return!0},Object.defineProperty(t.prototype,"currentErrorCount",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasTitle",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasDescription",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasInput",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasComment",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.getPropertyValue("id")},set:function(e){this.setPropertyValue("id",e)},enumerable:!0,configurable:!0}),t.prototype.getAllErrors=function(){return[]},Object.defineProperty(t.prototype,"customWidget",{get:function(){return this.isCustomWidgetRequested||this.customWidgetValue||(this.isCustomWidgetRequested=!0,this.updateCustomWidget()),this.customWidgetValue},enumerable:!0,configurable:!0}),t.prototype.updateCustomWidget=function(){this.customWidgetValue=u.a.Instance.getCustomWidget(this)},Object.defineProperty(t.prototype,"startWithNewLine",{get:function(){return this.getPropertyValue("startWithNewLine",!0)},set:function(e){this.startWithNewLine!=e&&this.setPropertyValue("startWithNewLine",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cssClasses",{get:function(){var e=this.css,t={error:{}};return this.copyCssClasses(t,e.question),this.copyCssClasses(t.error,e.error),this.updateCssClasses(t,e),this.survey&&this.survey.updateQuestionCssClasses(this,t),t},enumerable:!0,configurable:!0}),t.prototype.getRootCss=function(e){return e.question.root},t.prototype.updateCssClasses=function(e,t){var r=t[this.getType()];if(void 0!==r&&null!==r)if("string"==typeof r||r instanceof String)e.root=r;else for(var n in r)e[n]=r[n]},Object.defineProperty(t.prototype,"css",{get:function(){return s.b.getCss()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.getPropertyValue("width","")},set:function(e){this.setPropertyValue("width",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderWidth",{get:function(){return this.getPropertyValue("renderWidth","")},set:function(e){this.setPropertyValue("renderWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"indent",{get:function(){return this.getPropertyValue("indent",0)},set:function(e){this.setPropertyValue("indent",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rightIndent",{get:function(){return this.getPropertyValue("rightIndent",0)},set:function(e){this.setPropertyValue("rightIndent",e)},enumerable:!0,configurable:!0}),t.prototype.focus=function(e){void 0===e&&(e=!1)},t.prototype.fireCallback=function(e){e&&e()},t.prototype.onCreating=function(){},t.prototype.runCondition=function(e){this.visibleIf&&(this.conditionRunner||(this.conditionRunner=new a.a(this.visibleIf)),this.conditionRunner.expression=this.visibleIf,this.visible=this.conditionRunner.run(e))},t.prototype.onSurveyValueChanged=function(e){},t.prototype.onSurveyLoad=function(){this.fireCallback(this.surveyLoadCallback)},t.prototype.setVisibleIndex=function(e){return this.visibleIndex==e?1:(this.setPropertyValue("visibleIndex",e),1)},t.prototype.removeElement=function(e){return!1},t.prototype.supportGoNextPageAutomatic=function(){return!1},t.prototype.clearUnusedValues=function(){},Object.defineProperty(t.prototype,"displayValue",{get:function(){return""},enumerable:!0,configurable:!0}),t.prototype.clearValue=function(){},t.prototype.clearValueIfInvisible=function(){},t.prototype.onLocaleChanged=function(){e.prototype.onLocaleChanged.call(this),this.localeChanged.fire(this,this.getLocale())},t.prototype.onReadOnlyChanged=function(){},t.prototype.onAnyValueChanged=function(e){},t.prototype.getLocale=function(){return this.survey?this.survey.getLocale():""},t.prototype.getMarkdownHtml=function(e){return this.survey?this.survey.getMarkdownHtml(e):null},t.questionCounter=100,t}(i.a);o.b.metaData.addClass("questionbase",["!name",{name:"visible:boolean",default:!0},"visibleIf:condition",{name:"width"},{name:"startWithNewLine:boolean",default:!0},{name:"indent:number",default:0,choices:[0,1,2,3]},{name:"page",isSerializable:!1,choices:function(e){var t=e?e.survey:null;return t?t.pages:[]}}])},function(e,t,r){"use strict";var n=r(0),i=r(2);r.n(i);r.d(t,"a",function(){return o});var o=function(e){function t(t){var r=e.call(this,t)||this;return r.updateStateFunction=null,r.survey=t.survey,r.css=t.css,r.state={update:0},r}return n.b(t,e),t.prototype.componentWillReceiveProps=function(e){this.survey=e.survey,this.css=e.css},t.prototype.componentDidMount=function(){if(this.survey){var e=this;this.updateStateFunction=function(){e.setState({update:e.state.update+1})},this.survey.onPageVisibleChanged.add(this.updateStateFunction)}},t.prototype.componentWillUnmount=function(){this.survey&&this.updateStateFunction&&(this.survey.onPageVisibleChanged.remove(this.updateStateFunction),this.updateStateFunction=null)},t}(i.Component)},function(e,t,r){"use strict";var n=r(0),i=r(2),o=(r.n(i),r(28)),a=r(4);r.d(t,"a",function(){return s}),r.d(t,"c",function(){return u}),r.d(t,"b",function(){return l});var s=function(e){function t(t){var r=e.call(this,t)||this;return r.page=t.page,r.survey=t.survey,r.creator=t.creator,r.css=t.css,r}return n.b(t,e),t.prototype.componentWillReceiveProps=function(e){this.page=e.page,this.survey=e.survey,this.creator=e.creator,this.css=e.css},t.prototype.componentDidMount=function(){this.doAfterRender()},t.prototype.componentDidUpdate=function(e,t){this.doAfterRender()},t.prototype.doAfterRender=function(){var e=this.refs.root;e&&this.survey&&this.survey.afterRenderPage(e)},t.prototype.render=function(){if(null==this.page||null==this.survey||null==this.creator)return null;for(var e=this.renderTitle(),t=this.renderDescription(),r=[],n=this.page.rows,o=this,a=0;a0?this.questionBase.indent*e.indent+"px":null,P=this.questionBase.rightIndent>0?this.questionBase.rightIndent*e.indent+"px":null,C={};return this.questionBase.renderWidth&&(C.width=this.questionBase.renderWidth),b&&(C.paddingLeft=b),P&&(C.paddingRight=P),i.createElement("div",{ref:"root",id:this.questionBase.id,className:f,style:C},i.createElement("div",{className:l},a,h,u,p),i.createElement("div",{className:c},y,t,g,v,s,d))},t.prototype.renderQuestion=function(){return this.questionBase.customWidget?i.createElement(l.a,{creator:this.creator,question:this.questionBase}):this.creator.createQuestionElement(this.questionBase)},t.prototype.renderTitle=function(e){var t=u.a.renderLocString(this.question.locTitle);return i.createElement("h5",{className:e.title},t)},t.prototype.renderDescription=function(e){if(!this.questionBase.hasDescription)return null;var t=u.a.renderLocString(this.question.locDescription);return i.createElement("div",{className:e.description},t)},t.prototype.renderComment=function(e){var t=u.a.renderLocString(this.question.locCommentText);return i.createElement("div",null,i.createElement("div",null,t),i.createElement(s.a,{question:this.question,cssClasses:e}))},t.prototype.renderErrors=function(e){return i.createElement(p,{element:this.question,cssClasses:e,creator:this.creator})},t}(i.Component),p=function(e){function t(t){var r=e.call(this,t)||this;return r.setElement(t.element),r.state=r.getState(),r.creator=t.creator,r}return n.b(t,e),t.prototype.componentWillReceiveProps=function(e){this.setElement(e.element),this.setState(this.getState()),this.creator=e.creator},t.prototype.setElement=function(e){if(this.element=e instanceof a.a?e:null,this.element){var t=this;this.element.errorsChangedCallback=function(){t.setState(t.getState(t.state))}}},t.prototype.getState=function(e){return void 0===e&&(e=null),e?{error:e.error+1}:{error:0}},t.prototype.render=function(){if(!this.element||0==this.element.errors.length)return null;for(var e=[],t=0;tr.value?(r.error=new o.c(this.getErrorText(t)),r):null!==this.maxValue&&this.maxValue0&&e.length0&&e.length>this.maxLength?new u(null,new o.c(this.getErrorText(t))):null},t.prototype.getDefaultErrorText=function(e){return this.minLength>0&&this.maxLength>0?a.a.getString("textMinMaxLength").format(this.minLength,this.maxLength):this.minLength>0?a.a.getString("textMinLength").format(this.minLength):a.a.getString("textMaxLength").format(this.maxLength)},t}(l),d=function(e){function t(t,r){void 0===t&&(t=null),void 0===r&&(r=null);var n=e.call(this)||this;return n.minCount=t,n.maxCount=r,n}return n.b(t,e),t.prototype.getType=function(){return"answercountvalidator"},t.prototype.validate=function(e,t){if(void 0===t&&(t=null),null==e||e.constructor!=Array)return null;var r=e.length;return this.minCount&&rthis.maxCount?new u(null,new o.c(this.getErrorText(a.a.getString("maxSelectError").format(this.maxCount)))):null},t.prototype.getDefaultErrorText=function(e){return e},t}(l),f=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this)||this;return r.regex=t,r}return n.b(t,e),t.prototype.getType=function(){return"regexvalidator"},t.prototype.validate=function(e,t){if(void 0===t&&(t=null),!this.regex||!e)return null;var r=new RegExp(this.regex);if(Array.isArray(e))for(var n=0;n()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,t}return n.b(t,e),t.prototype.getType=function(){return"emailvalidator"},t.prototype.validate=function(e,t){return void 0===t&&(t=null),e?this.re.test(e)?null:new u(e,new o.c(this.getErrorText(t))):null},t.prototype.getDefaultErrorText=function(e){return a.a.getString("invalidEmail")},t}(l);s.b.metaData.addClass("surveyvalidator",["text"]),s.b.metaData.addClass("numericvalidator",["minValue:number","maxValue:number"],function(){return new p},"surveyvalidator"),s.b.metaData.addClass("textvalidator",["minLength:number","maxLength:number"],function(){return new h},"surveyvalidator"),s.b.metaData.addClass("answercountvalidator",["minCount:number","maxCount:number"],function(){return new d},"surveyvalidator"),s.b.metaData.addClass("regexvalidator",["regex"],function(){return new f},"surveyvalidator"),s.b.metaData.addClass("emailvalidator",[],function(){return new g},"surveyvalidator")},function(e,t,r){"use strict";var n=r(0),i=r(2),o=(r.n(i),r(20)),a=r(19),s=r(4);r.d(t,"a",function(){return u});var u=function(e){function t(t){var r=e.call(this,t)||this;return r.handleOnExpanded=r.handleOnExpanded.bind(r),r}return n.b(t,e),t.prototype.componentWillReceiveProps=function(e){this.updateSurvey(e)},t.prototype.handleOnExpanded=function(e){this.window.isExpanded=!this.window.isExpanded},t.prototype.render=function(){if(!this.window.isShowing)return null;var e=this.renderHeader(),t=this.window.isExpanded?this.renderBody():null,r={position:"fixed",bottom:3,right:10};return i.createElement("div",{className:this.css.window.root,style:r},e,t)},t.prototype.renderHeader=function(){var e={width:"100%",cursor:"pointer"},t={paddingRight:"10px"},r=this.window.isExpanded?this.css.window.header.buttonCollapsed:this.css.window.header.buttonExpanded;r="glyphicon pull-right "+r;var n=s.a.renderLocString(this.survey.locTitle);return i.createElement("div",{className:this.css.window.header.root},i.createElement("span",{onClick:this.handleOnExpanded,style:e},i.createElement("span",{className:this.css.window.header.title,style:t},n),i.createElement("span",{className:r,"aria-hidden":"true"})))},t.prototype.renderBody=function(){return i.createElement("div",{className:this.css.window.body},this.renderSurvey())},t.prototype.updateSurvey=function(t){t||(t={}),t.window?this.window=t.window:t.json?this.window=new a.b(t.json):t.model&&(this.window=new a.b(null,t.model)),this.window||(this.window=new a.b),t.model=this.window.survey,(t.expanded||t.isExpanded)&&this.window.expand(),this.window.isShowing=!0,e.prototype.updateSurvey.call(this,t),this.setState({expanded:this.window.isExpanded,isShowing:this.window.isShowing});var r=this;this.window.expandedChangedCallback=function(){r.setState({expanded:r.window.isExpanded})},this.window.showingChangedCallback=function(){r.setState({isShowing:r.window.isShowing})},this.survey.onComplete.add(function(e){r.window.hide()})},t}(o.a)},function(e,t,r){"use strict";var n=r(13);r.d(t,"a",function(){return i});var i=function(){function e(){}return e.prototype.parse=function(e,t){return this.setProperties(e,t),this.parseText()},e.prototype.parseExpression=function(e){return this.setProperties(e,new n.b),this.readExpressionOperand()},e.prototype.setProperties=function(e,t){this.text=e,this.at=0,this.length=this.text.length,this.root=t,this.root.clear(),this.node=this.root,this.expressionNodes=[],this.expressionNodes.push(this.node)},e.prototype.toString=function(e){return e.toString()},e.prototype.parseText=function(){return this.readConditions()&&this.at>=this.length},e.prototype.readConditions=function(){var e=this.readCondition();if(!e)return e;var t=this.readConnective();return!t||(this.addConnective(t),this.readConditions())},e.prototype.readCondition=function(){var e=this.readExpression();if(e<0)return!1;if(1==e)return!0;var t=this.readExpressionOperand();if(!t)return!1;var r=this.readOperator();if(!r){if(t.isBoolean){var i=new n.c;return i.left=t,this.addCondition(i),!0}return!1}var i=new n.c;if(i.left=t,i.operator=r,!n.c.isNoRightOperation(r)){var o=this.readExpressionOperand();if(!o)return!1;i.right=o}return this.addCondition(i),!0},e.prototype.readOperand=function(){var e=this.readString();if(!e)return null;var t=this.readParameters();if(t){var r=new n.d(e);return r.parameters=t,r}return new n.e(e)},e.prototype.readExpression=function(){if(this.skip(),this.at>=this.length||"("!=this.ch)return 0;this.at++,this.pushExpression();var e=this.readConditions();return e?(this.skip(),e=")"==this.ch,this.at++,this.popExpression(),1):-1},e.prototype.readExpressionOperand=function(e,t){if(void 0===e&&(e=null),void 0===t&&(t=null),this.skip(),this.at>=this.length)return null;var r=this.isOpenBracket(this.ch);r&&(this.at++,this.pushExpression());var i=this.readOperand();if(!i)return null;var o=this.readOperandOperator();if(!o){if(null!=e&&(e.right=i,i=e),this.isCloseBracket(this.ch)){e=t&&t.length>0?t.pop():null;var a=this.at;this.at++,o=this.readOperandOperator();var s=o||e&&e.isOpenBracket;o||(this.at=a+(s?1:0)),s&&this.popExpression()}if(o){var u=new n.f;return u.left=e||i,u.operator=o,this.readExpressionOperand(u,t)}return i}var u=new n.f;if(u.isOpenBracket=r,u.left=i,u.operator=o,t||(t=[]),(0==t.length||r)&&t.push(u),e){if(r||!this.isHighPriorityOperand(e.operator)&&this.isHighPriorityOperand(o))return e.right=this.readExpressionOperand(u,t),e;e.right=i,u.left=e;var l=t.indexOf(e);l>-1&&(t[l]=u)}return this.readExpressionOperand(u,t)},Object.defineProperty(e.prototype,"ch",{get:function(){return this.text.charAt(this.at)},enumerable:!0,configurable:!0}),e.prototype.skip=function(){for(;this.at"==e||"<"==e||"="==e||"!"==e||"+"==e||"-"==e||"*"==e||"/"==e||"%"==e},e.prototype.isOpenBracket=function(e){return"("==e},e.prototype.isCloseBracket=function(e){return")"==e},e.prototype.isBrackets=function(e){return this.isOpenBracket(e)||this.isCloseBracket(e)},e.prototype.readString=function(){if(this.skip(),this.at>=this.length)return null;var e=this.at,t=this.isQuotes(this.ch),r="{"==this.ch;t&&this.at++;for(var n=this.isOperatorChar(this.ch),i=!1;this.at1&&this.isQuotes(a[0])){var s=a.length-1;this.isQuotes(a[a.length-1])&&s--,a=a.substr(1,s)}return a},e.prototype.readParameter=function(){for(var t=0,r=this.at;this.at"==t&&(t="greater"),"<"==t&&(t="less"),">="!=t&&"=>"!=t||(t="greaterorequal"),"<="!=t&&"=<"!=t||(t="lessorequal"),"="!=t&&"=="!=t||(t="equal"),"<>"!=t&&"!="!=t||(t="notequal"),"equals"==t&&(t="equal"),"notequals"==t&&(t="notequals"),"contain"!=t&&"*="!=t||(t="contains"),"notcontain"==t&&(t="notcontains"),n.c.isCorrectOperator(t)?t:(this.at=e,null)):null},e.prototype.readConnective=function(){var e=this.readString();return e?(e=e.toLowerCase(),"&"!=e&&"&&"!=e||(e="and"),"|"!=e&&"||"!=e||(e="or"),"and"!=e&&"or"!=e&&(e=null),e):null},e.prototype.pushExpression=function(){var e=null;this.expressionNodes.push(e),this.node=e},e.prototype.makeNodeCondition=function(){this.node&&this.node.children||(this.node=new n.b,this.expressionNodes[this.expressionNodes.length-1]=this.node)},e.prototype.popExpression=function(){var e=this.expressionNodes.pop();this.node=this.expressionNodes[this.expressionNodes.length-1],e&&(this.makeNodeCondition(),this.node.children.push(e))},e.prototype.addCondition=function(e){this.makeNodeCondition(),this.node.children.push(e)},e.prototype.addConnective=function(e){if(this.makeNodeCondition(),this.node.children.length<2)this.node.connective=e;else if(this.node.connective!=e){var t=this.node.connective,r=this.node.children;this.node.clear(),this.node.connective=e;var i=new n.b;i.connective=t,i.children=r,this.node.children.push(i);var o=new n.b;this.node.children.push(o),this.node=o}},e}()},function(e,t,r){"use strict";r.d(t,"a",function(){return n});var n=function(){function e(){}return e.prototype.loadSurvey=function(t,r){var n=new XMLHttpRequest;n.open("GET",e.serviceUrl+"/getSurvey?surveyId="+t),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.onload=function(){var e=JSON.parse(n.response);r(200==n.status,e,n.response)},n.send()},e.prototype.getSurveyJsonAndIsCompleted=function(t,r,n){var i=new XMLHttpRequest;i.open("GET",e.serviceUrl+"/getSurveyAndIsCompleted?surveyId="+t+"&clientId="+r),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.onload=function(){var e=JSON.parse(i.response),t=e?e.survey:null,r=e?e.isCompleted:null;n(200==i.status,t,r,i.response)},i.send()},e.prototype.sendResult=function(t,r,n,i,o){void 0===i&&(i=null),void 0===o&&(o=!1);var a=new XMLHttpRequest;a.open("POST",e.serviceUrl+"/post/"),a.setRequestHeader("Content-Type","application/json; charset=utf-8");var s={postId:t,surveyResult:JSON.stringify(r)};i&&(s.clientId=i),o&&(s.isPartialCompleted=!0);var u=JSON.stringify(s);a.onload=a.onerror=function(){n&&n(200==a.status,a.response)},a.send(u)},e.prototype.sendFile=function(t,r,n){var i=new XMLHttpRequest;i.onload=i.onerror=function(){n&&n(200==i.status,JSON.parse(i.response))},i.open("POST",e.serviceUrl+"/upload/",!0);var o=new FormData;o.append("file",r),o.append("postId",t),i.send(o)},e.prototype.getResult=function(t,r,n){var i=new XMLHttpRequest,o="resultId="+t+"&name="+r;i.open("GET",e.serviceUrl+"/getResult?"+o),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded");i.onload=function(){var e=null,t=null;if(200==i.status){e=JSON.parse(i.response),t=[];for(var r in e.QuestionResult){var o={name:r,value:e.QuestionResult[r]};t.push(o)}}n(200==i.status,e,t,i.response)},i.send()},e.prototype.isCompleted=function(t,r,n){var i=new XMLHttpRequest,o="resultId="+t+"&clientId="+r;i.open("GET",e.serviceUrl+"/isCompleted?"+o),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded");i.onload=function(){var e=null;200==i.status&&(e=JSON.parse(i.response)),n(200==i.status,e,i.response)},i.send()},e.serviceUrl="https://dxsurveyapi.azurewebsites.net/api/Survey",e}()},function(e,t,r){"use strict";function n(e){for(var t=0,r=0;r0&&(t=this.num+". "+t),t},Object.defineProperty(t.prototype,"wasShown",{get:function(){return this.hasShownValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasShown",{get:function(){return this.wasShown},enumerable:!0,configurable:!0}),t.prototype.setWasShown=function(e){this.survey.isDesignMode||e!=this.hasShownValue&&(1==e&&this.areQuestionsRandomized&&this.randomizeElements(),this.hasShownValue=e)},t.prototype.randomizeElements=function(){for(var e=[],t=0;t .sv_row":"border-color: $border-color;",".sv_default_css .sv_p_root > .sv_row:nth-child(odd)":"background-color: $body-background-color;",".sv_default_css .sv_p_root > .sv_row:nth-child(even)":"background-color: $body-container-background-color;",".sv_default_css .sv_q_other input":"color: $text-color; border-color: $border-color; background-color: $inputs-background-color;",".sv_default_css .sv_q_text_root":"color: $text-color; border-color: $border-color; background-color: $inputs-background-color;",".sv_default_css .sv_q_dropdown_control":"color: $text-color; border-color: $border-color; background-color: $inputs-background-color;",".sv_default_css input[type='text']":"color: $text-color; border-color: $border-color; background-color: $inputs-background-color;",".sv_default_css select":"color: $text-color; border-color: $border-color; background-color: $inputs-background-color;",".sv_default_css textarea":"color: $text-color; border-color: $border-color; background-color: $inputs-background-color;",".sv_default_css .sv_q_other input:focus":"border-color: $main-color;",".sv_default_css .sv_q_text_root:focus":"border-color: $main-color;",".sv_default_css .sv_q_dropdown_control:focus":"border-color: $main-color;",".sv_default_css input[type='text']:focus":"border-color: $main-color;",".sv_default_css select:focus":"border-color: $main-color;",".sv_default_css textarea:focus":"border-color: $main-color;",".sv_default_css .sv_select_wrapper":"background-color: $body-background-color;",".sv_default_css .sv_select_wrapper::before":"background-color: $main-color;",".sv_default_css .sv_q_rating_item.active .sv_q_rating_item_text":"background-color: $main-hover-color; border-color: $main-hover-color; color: $body-background-color;",".sv_default_css .sv_q_rating_item .sv_q_rating_item_text":"border-color: $border-color;",".sv_default_css .sv_q_rating_item .sv_q_rating_item_text:hover":"border-color: $main-hover-color;",".sv_default_css table.sv_q_matrix tr":"border-color: $border-color;",".sv_default_css table.sv_q_matrix_dropdown tr":"border-color: $border-color;",".sv_default_css table.sv_q_matrix_dynamic tr":"border-color: $border-color;"},e}()},function(e,t,r){"use strict";var n=r(0),i=r(7),o=r(18);r.d(t,"a",function(){return a});var a=function(e){function t(t,r){void 0===r&&(r=null);var n=e.call(this)||this;return n.isExpandedValue=!1,n.surveyValue=r||n.createSurvey(t),n.surveyValue.showTitle=!1,"undefined"!=typeof document&&(n.windowElement=document.createElement("div")),n}return n.b(t,e),t.prototype.getType=function(){return"window"},Object.defineProperty(t.prototype,"survey",{get:function(){return this.surveyValue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isShowing",{get:function(){return this.isShowingValue},set:function(e){this.isShowing!=e&&(this.isShowingValue=e,this.showingChangedCallback&&this.showingChangedCallback())},enumerable:!0,configurable:!0}),t.prototype.show=function(){this.isShowing=!0},t.prototype.hide=function(){this.isShowing=!1},Object.defineProperty(t.prototype,"isExpanded",{get:function(){return this.isExpandedValue},set:function(e){e?this.expand():this.collapse()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.survey.title},set:function(e){this.survey.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locTitle",{get:function(){return this.survey.locTitle},enumerable:!0,configurable:!0}),t.prototype.expand=function(){this.expandcollapse(!0)},t.prototype.collapse=function(){this.expandcollapse(!1)},t.prototype.createSurvey=function(e){return new o.a(e)},t.prototype.expandcollapse=function(e){this.isExpandedValue!=e&&(this.isExpandedValue=e,this.expandedChangedCallback&&this.expandedChangedCallback())},t.surveyElementName="windowSurveyJS",t}(i.c)},function(e,t,r){"use strict";var n=r(7);r.d(t,"a",function(){return o});var i={setInterval:function(e){return window.setInterval(e,1e3)},clearInterval:function(e){window.clearInterval(e)}},o=function(){function e(){this.listenerCounter=0,this.timerId=-1,this.onTimer=new n.b}return Object.defineProperty(e,"instance",{get:function(){return e.instanceValue||(e.instanceValue=new e),e.instanceValue},enumerable:!0,configurable:!0}),e.prototype.start=function(e){if(void 0===e&&(e=null),e&&this.onTimer.add(e),this.timerId<0){var t=this;this.timerId=i.setInterval(function(){t.doTimer()})}this.listenerCounter++},e.prototype.stop=function(e){void 0===e&&(e=null),e&&this.onTimer.remove(e),0==--this.listenerCounter&&this.timerId>-1&&(i.clearInterval(this.timerId),this.timerId=-1)},e.prototype.doTimer=function(){this.timerId<0||this.onTimer.fire(this,{})},e.instanceValue=null,e}()},function(e,t,r){"use strict";var n=r(54);r.d(t,"T",function(){return n.a}),r.d(t,"U",function(){return n.b}),r.d(t,"V",function(){return n.c}),r.d(t,"W",function(){return n.d}),r.d(t,"X",function(){return n.e}),r.d(t,"Y",function(){return n.f}),r.d(t,"Z",function(){return n.g}),r.d(t,"_0",function(){return n.h}),r.d(t,"_1",function(){return n.i}),r.d(t,"_2",function(){return n.j}),r.d(t,"_3",function(){return n.k}),r.d(t,"_4",function(){return n.l}),r.d(t,"_5",function(){return n.m}),r.d(t,"_6",function(){return n.n}),r.d(t,"_7",function(){return n.o}),r.d(t,"_8",function(){return n.p}),r.d(t,"_9",function(){return n.q}),r.d(t,"_10",function(){return n.r}),r.d(t,"_11",function(){return n.s}),r.d(t,"_12",function(){return n.t}),r.d(t,"_13",function(){return n.u}),r.d(t,"_14",function(){return n.v}),r.d(t,"_15",function(){return n.w}),r.d(t,"_16",function(){return n.x}),r.d(t,"_17",function(){return n.y}),r.d(t,"_18",function(){return n.z}),r.d(t,"_19",function(){return n.A}),r.d(t,"_20",function(){return n.B}),r.d(t,"_21",function(){return n.C}),r.d(t,"_22",function(){return n.D}),r.d(t,"_23",function(){return n.E}),r.d(t,"_24",function(){return n.F}),r.d(t,"_25",function(){return n.G}),r.d(t,"_26",function(){return n.H}),r.d(t,"_27",function(){return n.I}),r.d(t,"_28",function(){return n.J}),r.d(t,"_29",function(){return n.K}),r.d(t,"_30",function(){return n.L}),r.d(t,"_31",function(){return n.M}),r.d(t,"_32",function(){return n.N}),r.d(t,"_33",function(){return n.O}),r.d(t,"_34",function(){return n.P}),r.d(t,"_35",function(){return n.Q}),r.d(t,"_36",function(){return n.R}),r.d(t,"_37",function(){return n.S}),r.d(t,"_38",function(){return n.T}),r.d(t,"_39",function(){return n.U}),r.d(t,"_40",function(){return n.V}),r.d(t,"_41",function(){return n.W}),r.d(t,"_42",function(){return n.X}),r.d(t,"_43",function(){return n.Y}),r.d(t,"_44",function(){return n.Z}),r.d(t,"_45",function(){return n._0}),r.d(t,"_46",function(){return n._1}),r.d(t,"_47",function(){return n._2}),r.d(t,"_48",function(){return n._3}),r.d(t,"_49",function(){return n._4}),r.d(t,"_50",function(){return n._5}),r.d(t,"_51",function(){return n._6}),r.d(t,"_52",function(){return n._7}),r.d(t,"_53",function(){return n._8}),r.d(t,"_54",function(){return n._9}),r.d(t,"_55",function(){return n._10}),r.d(t,"_56",function(){return n._11}),r.d(t,"_57",function(){return n._12}),r.d(t,"_58",function(){return n._13}),r.d(t,"_59",function(){return n._14}),r.d(t,"_60",function(){return n._15}),r.d(t,"_61",function(){return n._16}),r.d(t,"_62",function(){return n._17}),r.d(t,"_63",function(){return n._18}),r.d(t,"_64",function(){return n._19}),r.d(t,"_65",function(){return n._20}),r.d(t,"_66",function(){return n._21}),r.d(t,"_67",function(){return n._22}),r.d(t,"_68",function(){return n._23}),r.d(t,"_69",function(){return n._24}),r.d(t,"_70",function(){return n._25}),r.d(t,"_71",function(){return n._26}),r.d(t,"_72",function(){return n._27}),r.d(t,"_73",function(){return n._28}),r.d(t,"_74",function(){return n._29}),r.d(t,"_75",function(){return n._30}),r.d(t,"_76",function(){return n._31}),r.d(t,"_77",function(){return n._32});var i=(r(53),r(0));r.d(t,"a",function(){return i.a}),r.d(t,"b",function(){return i.b}),r.d(t,"c",function(){return i.c});var o=r(12);r.d(t,"d",function(){return o.a});var a=r(51);r.d(t,"e",function(){return a.a});var s=r(52);r.d(t,"f",function(){return s.a});var u=r(20);r.d(t,"g",function(){return u.a});var l=r(19);r.d(t,"h",function(){return l.a}),r.d(t,"i",function(){return l.b}),r.d(t,"j",function(){return l.a}),r.d(t,"k",function(){return l.b});var c=r(26);r.d(t,"l",function(){return c.a});var p=r(41);r.d(t,"m",function(){return p.a});var h=r(38);r.d(t,"n",function(){return h.a});var d=r(27);r.d(t,"o",function(){return d.a}),r.d(t,"p",function(){return d.b});var f=r(28);r.d(t,"q",function(){return f.a}),r.d(t,"r",function(){return f.b});var g=r(4);r.d(t,"s",function(){return g.a}),r.d(t,"t",function(){return g.b});var m=r(14);r.d(t,"u",function(){return m.a}),r.d(t,"v",function(){return m.b});var y=r(94);r.d(t,"w",function(){return y.a}),r.d(t,"x",function(){return y.b});var v=r(95);r.d(t,"y",function(){return v.a});var b=r(40);r.d(t,"z",function(){return b.a}),r.d(t,"A",function(){return b.b});var P=r(100);r.d(t,"B",function(){return P.a}),r.d(t,"C",function(){return P.b});var C=r(99);r.d(t,"D",function(){return C.a});var x=r(98);r.d(t,"E",function(){return x.a});var w=r(102);r.d(t,"F",function(){return w.a}),r.d(t,"G",function(){return w.b});var V=r(104);r.d(t,"H",function(){return V.a});var S=r(106);r.d(t,"I",function(){return S.a});var T=r(93);r.d(t,"J",function(){return T.a});var O=r(96);r.d(t,"K",function(){return O.a});var E=r(101);r.d(t,"L",function(){return E.a}),r.d(t,"M",function(){return E.b});var q=r(103);r.d(t,"N",function(){return q.a});var R=r(39);r.d(t,"O",function(){return R.a});var _=r(105);r.d(t,"P",function(){return _.a});var k=r(97);r.d(t,"Q",function(){return k.a});var L=r(30);r.d(t,"R",function(){return L.a});var N=r(6);r.d(t,"S",function(){return N.a})},function(t,r){t.exports=e},function(e,t){},function(e,t,r){!function(e,r){r(t)}(0,function(e){function t(e,t,r){this.nodeName=e,this.attributes=t,this.children=r,this.key=t&&t.key}function r(e,r){var n,i,o,a,s;for(s=arguments.length;s-- >2;)A.push(arguments[s]);for(r&&r.children&&(A.length||A.push(r.children),delete r.children);A.length;)if((o=A.pop())instanceof Array)for(s=o.length;s--;)A.push(o[s]);else null!=o&&!0!==o&&!1!==o&&("number"==typeof o&&(o=String(o)),a="string"==typeof o,a&&i?n[n.length-1]+=o:((n||(n=[])).push(o),i=a));var u=new t(e,r||void 0,n||z);return M.vnode&&M.vnode(u),u}function n(e,t){if(t)for(var r in t)e[r]=t[r];return e}function i(e){return n({},e)}function o(e,t){for(var r=t.split("."),n=0;n2?[].slice.call(arguments,2):e.children)}function c(e,t,r){var n=t.split(".");return function(t){for(var i=t&&t.target||this,a={},u=a,l=s(r)?o(t,r):i.nodeName?i.type.match(/^che|rad/)?i.checked:i.value:t,c=0;c=f?e.appendChild(u):u!==l[b]&&(u===l[b+1]&&v(l[b]),e.insertBefore(u,l[b]||null)))}if(h)for(var b in p)p[b]&&E(p[b]);for(;d<=m;)(u=c[m--])&&E(u)}function E(e,t){var r=e._component;if(r)I(r,!t);else{e[U]&&e[U].ref&&e[U].ref(null),t||x(e);for(var n;n=e.lastChild;)E(n,t)}}function q(e,t,r){var n;for(n in r)t&&n in t||null==r[n]||b(e,n,r[n],r[n]=void 0,Y);if(t)for(n in t)"children"===n||"innerHTML"===n||n in r&&t[n]===("value"===n||"checked"===n?e[n]:r[n])||b(e,n,r[n],r[n]=t[n],Y)}function R(e){var t=e.constructor.name,r=te[t];r?r.push(e):te[t]=[e]}function _(e,t,r){var n=new e(t,r),i=te[e.name];if(j.call(n,t,r),i)for(var o=i.length;o--;)if(i[o].constructor===e){n.nextBase=i[o].nextBase,i.splice(o,1);break}return n}function k(e,t,r,n,i){e._disable||(e._disable=!0,(e.__ref=t.ref)&&delete t.ref,(e.__key=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,n),n&&n!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=n),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==r&&(1!==r&&!1===M.syncComponentUpdates&&e.base?p(e):L(e,1,i)),e.__ref&&e.__ref(e))}function L(e,t,r,o){if(!e._disable){var s,u,l,c,p=e.props,h=e.state,g=e.context,m=e.prevProps||p,v=e.prevState||h,b=e.prevContext||g,P=e.base,C=e.nextBase,x=P||C,w=e._component;if(P&&(e.props=m,e.state=v,e.context=b,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(p,h,g)?s=!0:e.componentWillUpdate&&e.componentWillUpdate(p,h,g),e.props=p,e.state=h,e.context=g),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!s){for(e.render&&(u=e.render(p,h,g)),e.getChildContext&&(g=n(i(g),e.getChildContext()));d(u);)u=f(u,g);var T,O,q=u&&u.nodeName;if(a(q)){var R=y(u);l=w,l&&l.constructor===q&&R.key==l.__key?k(l,R,1,g):(T=l,l=_(q,R,g),l.nextBase=l.nextBase||C,l._parentComponent=e,e._component=l,k(l,R,0,g),L(l,1,r,!0)),O=l.base}else c=x,T=w,T&&(c=e._component=null),(x||1===t)&&(c&&(c._component=null),O=S(c,u,g,r||!P,x&&x.parentNode,!0));if(x&&O!==x&&l!==w){var N=x.parentNode;N&&O!==N&&(N.replaceChild(O,x),T||(x._component=null,E(x)))}if(T&&I(T,O!==x),e.base=O,O&&!o){for(var j=e,D=e;D=D._parentComponent;)(j=D).base=O;O._component=j,O._componentConstructor=j.constructor}}!P||r?X.unshift(e):s||(e.componentDidUpdate&&e.componentDidUpdate(m,v,b),M.afterUpdate&&M.afterUpdate(e));var A,z=e._renderCallbacks;if(z)for(;A=z.pop();)A.call(e);K||o||V()}}function N(e,t,r,n){for(var i=e&&e._component,o=i,a=e,s=i&&e._componentConstructor===t.nodeName,u=s,l=y(t);i&&!u&&(i=i._parentComponent);)u=i.constructor===t.nodeName;return i&&u&&(!n||i._component)?(k(i,l,3,r,n),e=i.base):(o&&!s&&(I(o,!0),e=a=null),i=_(t.nodeName,l,r),e&&!i.nextBase&&(i.nextBase=e,a=null),k(i,l,1,r,n),e=i.base,a&&e!==a&&(a._component=null,E(a))),e}function I(e,t){M.beforeUnmount&&M.beforeUnmount(e);var r=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;if(n)I(n,t);else if(r){r[U]&&r[U].ref&&r[U].ref(null),e.nextBase=r,t&&(v(r),R(e));for(var i;i=r.lastChild;)E(i,!t)}e.__ref&&e.__ref(null),e.componentDidUnmount&&e.componentDidUnmount()}function j(e,t){this._dirty=!0,this.context=t,this.props=e,this.state||(this.state={})}function D(e,t,r){return S(r,e,{},!1,t)}var M={},A=[],z=[],B={},F=function(e){return B[e]||(B[e]=e.toLowerCase())},H="undefined"!=typeof Promise&&Promise.resolve(),Q=H?function(e){H.then(e)}:setTimeout,W={},U="undefined"!=typeof Symbol?Symbol.for("preactattr"):"__preactattr_",J={boxFlex:1,boxFlexGroup:1,columnCount:1,fillOpacity:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,fontWeight:1,lineClamp:1,lineHeight:1,opacity:1,order:1,orphans:1,strokeOpacity:1,widows:1,zIndex:1,zoom:1},$={blur:1,error:1,focus:1,load:1,resize:1,scroll:1},G=[],Z={},X=[],K=0,Y=!1,ee=!1,te={};n(j.prototype,{linkState:function(e,t){var r=this._linkedStates||(this._linkedStates={});return r[e+t]||(r[e+t]=c(this,e,t))},setState:function(e,t){var r=this.state;this.prevState||(this.prevState=i(r)),n(r,a(e)?e(r,this.props):e),t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),p(this)},forceUpdate:function(){L(this,2)},render:function(){}}),e.h=r,e.cloneElement=l,e.Component=j,e.render=D,e.rerender=h,e.options=M})},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===n||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){g&&d&&(g=!1,d.length?f=d.concat(f):m=-1,f.length&&s())}function s(){if(!g){var e=i(a);g=!0;for(var t=f.length;t;){for(d=f,f=[];++m1)for(var r=1;r=0},t.prototype.valueFromData=function(t){return t?Array.isArray(t)?e.prototype.valueFromData.call(this,t):[t]:t},t.prototype.valueFromDataCore=function(e){for(var t=0;t0&&e.size>this.maxSize&&this.errors.push(new s.d(this.maxSize)),(t!=this.errors.length||this.errors.length>0)&&this.fireCallback(this.errorsChangedCallback),this.errors.length>0},t.prototype.isFileImage=function(e){if(e&&e.type){return 0==e.type.toLowerCase().indexOf("image")}},t}(i.a);o.b.metaData.addClass("file",["showPreview:boolean","imageHeight","imageWidth",{name:"storeDataAsText:boolean",default:!0},"maxSize:number"],function(){return new l("")},"question"),a.a.Instance.registerQuestion("file",function(e){return new l(e)})},function(e,t,r){"use strict";var n=r(0),i=r(25),o=r(3),a=r(5);r.d(t,"a",function(){return s});var s=function(e){function t(t){var r=e.call(this,t)||this;return r.name=t,r.createLocalizableString("html",r),r}return n.b(t,e),t.prototype.getType=function(){return"html"},Object.defineProperty(t.prototype,"html",{get:function(){return this.getLocalizableStringText("html","")},set:function(e){this.setLocalizableStringText("html",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locHtml",{get:function(){return this.getLocalizableString("html")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"processedHtml",{get:function(){return this.survey?this.survey.processHtml(this.html):this.html},enumerable:!0,configurable:!0}),t}(i.a);o.b.metaData.addClass("html",[{name:"html:html",serializationProperty:"locHtml"}],function(){return new s("")},"questionbase"),a.a.Instance.registerQuestion("html",function(e){return new s(e)})},function(e,t,r){"use strict";var n=r(0),i=r(11),o=r(8),a=r(3),s=r(1),u=r(9),l=r(5);r.d(t,"a",function(){return c}),r.d(t,"b",function(){return p});var c=function(){function e(e,t,r,n){this.fullName=t,this.item=e,this.data=r,this.rowValue=n}return Object.defineProperty(e.prototype,"name",{get:function(){return this.item.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this.item.text},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locText",{get:function(){return this.item.locText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.rowValue},set:function(e){this.rowValue=e,this.data&&this.data.onMatrixRowChanged(this),this.onValueChanged()},enumerable:!0,configurable:!0}),e.prototype.onValueChanged=function(){},e}(),p=function(e){function t(t){var r=e.call(this,t)||this;return r.name=t,r.isRowChanging=!1,r.columnsValue=r.createItemValues("columns"),r.rowsValue=r.createItemValues("rows"),r}return n.b(t,e),t.prototype.getType=function(){return"matrix"},Object.defineProperty(t.prototype,"isAllowTitleLeft",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAllRowRequired",{get:function(){return this.getPropertyValue("isAllRowRequired",!1)},set:function(e){this.setPropertyValue("isAllRowRequired",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasRows",{get:function(){return this.rowsValue.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.columnsValue},set:function(e){this.setPropertyValue("columns",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this.rowsValue},set:function(e){this.setPropertyValue("rows",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibleRows",{get:function(){var e=new Array,t=this.value;t||(t={});for(var r=0;rt.MaxRowCount)){var r=this.rowCountValue;if(this.rowCountValue=e,this.value&&this.value.length>e){var n=this.value;n.splice(e),this.value=n}if(!this.isLoadingFromJson){if(this.generatedVisibleRows){this.generatedVisibleRows.splice(e);for(var i=r;ithis.maxRowCount||(this.setPropertyValue("minRowCount",e),this.rowCountt.MaxRowCount&&(e=t.MaxRowCount),e==this.maxRowCount||ee&&(this.rowCount=e)))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canAddRow",{get:function(){return this.rowCountthis.minRowCount},enumerable:!0,configurable:!0}),t.prototype.addRow=function(){if(this.canAddRow){var e=this.rowCount;this.rowCount=this.rowCount+1,this.data&&this.runCellsCondition(this.data.getAllValues()),this.survey&&e+1==this.rowCount&&this.survey.matrixRowAdded(this)}},t.prototype.removeRowUI=function(e){this.confirmDelete&&!confirm(this.confirmDeleteText)||this.removeRow(e)},t.prototype.removeRow=function(e){if(this.canRemoveRow&&!(e<0||e>=this.rowCount)){if(this.survey){var t=this.generatedVisibleRows?this.generatedVisibleRows[e]:null;this.survey.matrixRowRemoved(this,e,t)}if(this.generatedVisibleRows&&ethis.rowCount&&t.splice(this.rowCount-1);for(var r=t.length;r0){r=!1;break}return r?null:e},t.prototype.getRowValueByIndex=function(e,t){return t>=0&&t4||this.setPropertyValue("colCount",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemSize",{get:function(){return this.getPropertyValue("itemSize",25)},set:function(e){this.setPropertyValue("itemSize",e)},enumerable:!0,configurable:!0}),t.prototype.getRows=function(){for(var e=this.colCount,t=this.items,r=[],n=0,i=0;i=e&&(n=0);return r},t.prototype.onValueChanged=function(){e.prototype.onValueChanged.call(this),this.onItemValueChanged()},t.prototype.createTextItem=function(e,t){return new p(e,t)},t.prototype.onItemValueChanged=function(){if(!this.isMultipleItemValueChanging)for(var e=0;e0&&(this.currentIndexValue=0),this.currentIndexValue>=this.panelCount&&(this.currentIndexValue=this.panelCount-1),this.currentIndexValue)},set:function(e){e>=this.panelCount&&(e=this.panelCount-1),this.currentIndexValue=e,this.fireCallback(this.currentIndexChangedCallback)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentPanel",{get:function(){var e=this.currentIndex;return e<0||e>=this.panels.length?null:this.panels[e]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"confirmDelete",{get:function(){return this.getPropertyValue("confirmDelete",!1)},set:function(e){this.setPropertyValue("confirmDelete",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyName",{get:function(){return this.getPropertyValue("keyName","")},set:function(e){this.setPropertyValue("keyName",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"confirmDeleteText",{get:function(){return this.getLocalizableStringText("confirmDeleteText",o.a.getString("confirmDelete"))},set:function(e){this.setLocalizableStringText("confirmDeleteText",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locConfirmDeleteText",{get:function(){return this.getLocalizableString("confirmDeleteText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keyDuplicationError",{get:function(){return this.getLocalizableStringText("keyDuplicationError",o.a.getString("keyDuplicationError"))},set:function(e){this.setLocalizableStringText("keyDuplicationError",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locKeyDuplicationError",{get:function(){return this.getLocalizableString("keyDuplicationError")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"panelPrevText",{get:function(){return this.getLocalizableStringText("panelPrevText",o.a.getString("pagePrevText"))},set:function(e){this.setLocalizableStringText("panelPrevText",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locPanelPrevText",{get:function(){return this.getLocalizableString("panelPrevText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"panelNextText",{get:function(){return this.getLocalizableStringText("panelNextText",o.a.getString("pageNextText"))},set:function(e){this.setLocalizableStringText("panelNextText",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locPanelNextText",{get:function(){return this.getLocalizableString("panelNextText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"panelAddText",{get:function(){return this.getLocalizableStringText("panelAddText",o.a.getString("addPanel"))},set:function(e){this.setLocalizableStringText("panelAddText",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locPanelAddText",{get:function(){return this.getLocalizableString("panelAddText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"panelRemoveText",{get:function(){return this.getLocalizableStringText("panelRemoveText",o.a.getString("removePanel"))},set:function(e){this.setLocalizableStringText("panelRemoveText",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locPanelRemoveText",{get:function(){return this.getLocalizableString("panelRemoveText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isProgressTopShowing",{get:function(){return"progressTop"==this.renderMode||"progressTopBottom"==this.renderMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isProgressBottomShowing",{get:function(){return"progressBottom"==this.renderMode||"progressTopBottom"==this.renderMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPrevButtonShowing",{get:function(){return this.currentIndex>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isNextButtonShowing",{get:function(){return this.currentIndex>=0&&this.currentIndex=0&&this.panelCount>1},enumerable:!0,configurable:!0}),t.prototype.getElementsInDesign=function(e){return void 0===e&&(e=!1),e?[this.template]:this.templateElements},Object.defineProperty(t.prototype,"panelCount",{get:function(){return this.isLoadingFromJson||this.isDesignMode?this.loadingPanelCount:this.items.length},set:function(e){if(!(e<0)){if(this.isLoadingFromJson||this.isDesignMode)return void(this.loadingPanelCount=e);if(e!=this.items.length&&!this.isDesignMode){for(var t=this.panelCount;tthis.panelCount&&e.splice(this.panelCount,e.length-this.panelCount),this.value=e}},Object.defineProperty(t.prototype,"minPanelCount",{get:function(){return this.getPropertyValue("minPanelCount",0)},set:function(e){e<0&&(e=0),e==this.minPanelCount||e>this.maxPanelCount||(this.setPropertyValue("minPanelCount",e),this.panelCountt.MaxPanelCount&&(e=t.MaxPanelCount),e==this.maxPanelCount||ee&&(this.panelCount=e)))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowAddPanel",{get:function(){return this.getPropertyValue("allowAddPanel",!0)},set:function(e){this.setPropertyValue("allowAddPanel",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowRemovePanel",{get:function(){return this.getPropertyValue("allowRemovePanel",!0)},set:function(e){this.setPropertyValue("allowRemovePanel",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"templateTitleLocation",{get:function(){return this.getPropertyValue("templateTitleLocation","default")},set:function(e){this.setPropertyValue("templateTitleLocation",e.toLowerCase())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showQuestionNumbers",{get:function(){return this.getPropertyValue("showQuestionNumbers","off")},set:function(e){this.setPropertyValue("showQuestionNumbers",e),!this.isLoadingFromJson&&this.survey&&this.survey.questionVisibilityChanged(this,this.visible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showRangeInProgress",{get:function(){return this.getPropertyValue("showRangeInProgress",!0)},set:function(e){this.setPropertyValue("showRangeInProgress",e),this.fireCallback(this.currentIndexChangedCallback)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderMode",{get:function(){return this.getPropertyValue("renderMode","list")},set:function(e){this.setPropertyValue("renderMode",e),this.fireCallback(this.renderModeChangedCallback)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRenderModeList",{get:function(){return"list"==this.renderMode},enumerable:!0,configurable:!0}),t.prototype.setVisibleIndex=function(t){for(var r="onSurvey"==this.showQuestionNumbers?t:0,n=0;nthis.minPanelCount)},enumerable:!0,configurable:!0}),t.prototype.rebuildPanels=function(){var e=new Array;if(this.isDesignMode)e.push(new d(this,this.template)),this.oldTemplateRowsChangedCallback&&this.oldTemplateRowsChangedCallback(),this.rebuildTemplateRowsInElements(this.template.elements);else for(var t=0;t=this.panelCount)){this.items.splice(t,1);var e=this.value;!e||!Array.isArray(e)||t>=e.length||(e.splice(t,1),this.value=e,this.fireCallback(this.panelCountChangedCallback))}}},t.prototype.getPanelIndex=function(e){if(!isNaN(parseFloat(e))&&isFinite(e))return e;for(var t=0;t0&&(this.panelCount=this.loadingPanelCount),this.isDesignMode&&this.rebuildPanels(),e.prototype.onSurveyLoad.call(this)},t.prototype.runCondition=function(t){e.prototype.runCondition.call(this,t),this.runPanelsCondition(t)},t.prototype.reRunCondition=function(){this.data&&this.runCondition(this.data.getAllValues())},t.prototype.runPanelsCondition=function(e){var t={};e&&e instanceof Object&&(t=JSON.parse(JSON.stringify(e)));for(var r=0;r0&&(t=t.concat(o))}return t},t.prototype.hasErrorInPanels=function(e){for(var t=!1,r=this.panels,n=[],i=0;ithis.rateMax-this.rateStep&&(e=this.rateMax-this.rateStep),this.setPropertyValue("rateMin",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rateMax",{get:function(){return this.getPropertyValue("rateMax",5)},set:function(e){ethis.rateMax-this.rateMin&&(e=this.rateMax-this.rateMin),this.setPropertyValue("rateStep",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibleRateValues",{get:function(){if(this.rateValues.length>0)return this.rateValues;for(var e=[],r=this.rateMin;r<=this.rateMax&&e.length-1&&t.splice(r,1),this.question.value=t,this.setState({value:this.question.value})},t.prototype.render=function(){if(!this.item||!this.question)return null;var e=this.question.colCount>0?100/this.question.colCount+"%":"",t={display:"inline-block"};e&&(t.width=e);var r=this.question.value&&this.question.value.indexOf(this.item.value)>-1||!1,n=this.item.value===this.question.otherItem.value&&r?this.renderOther():null;return this.renderCheckbox(r,t,n)},Object.defineProperty(t.prototype,"inputStyle",{get:function(){return{marginRight:"3px"}},enumerable:!0,configurable:!0}),t.prototype.renderCheckbox=function(e,t,r){var n=this.isFirst?this.question.inputId:null,o=this.renderLocString(this.item.locText),a=this.cssClasses.item+(0===this.question.colCount?" sv_q_checkbox_inline":"");return e&&(a+=" checked"),i.createElement("div",{className:a,style:t},i.createElement("label",{className:this.cssClasses.label},i.createElement("input",{className:this.cssClasses.itemControl,type:"checkbox",value:this.item.value,id:n,style:this.inputStyle,disabled:this.isDisplayMode,checked:e,onChange:this.handleOnChange,"aria-label":this.question.locTitle.renderedHtml}),i.createElement("span",{className:"checkbox-material"},i.createElement("span",{className:"check"})),i.createElement("span",{className:this.cssClasses.controlLabel},o)),r)},t.prototype.renderOther=function(){return i.createElement("div",{className:this.cssClasses.other},i.createElement(a.a,{question:this.question,otherCss:this.cssClasses.other,cssClasses:this.cssClasses,isDisplayMode:this.isDisplayMode}))},t}(o.c);s.a.Instance.registerQuestion("checkbox",function(e){return i.createElement(u,e)})},function(e,t,r){"use strict";var n=r(0),i=r(2),o=(r.n(i),r(4)),a=r(14),s=r(6),u=r(108);r.d(t,"a",function(){return l});var l=function(e){function t(t){var r=e.call(this,t)||this;r.state={value:r.getStateValue(),choicesChanged:0};var n=r;return r.question.choicesChangedCallback=function(){n.setState({choicesChanged:n.state.choicesChanged+1,value:n.question.value})},r.handleOnChange=r.handleOnChange.bind(r),r}return n.b(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.questionBase},enumerable:!0,configurable:!0}),t.prototype.componentWillReceiveProps=function(t){e.prototype.componentWillReceiveProps.call(this,t),this.setState({value:this.getStateValue()})},t.prototype.handleOnChange=function(e){this.question.value=e.target.value,this.setState({value:this.getStateValue()})},t.prototype.render=function(){if(!this.question)return null;var e=this.question.cssClasses,t=this.question.value===this.question.otherItem.value?this.renderOther(e):null,r=this.renderSelect(e);return i.createElement("div",{className:e.root},r,t)},t.prototype.renderSelect=function(e){if(this.isDisplayMode)return i.createElement("div",{id:this.question.inputId,className:e.control},this.question.displayValue);for(var t=[],n=0;n0?100/this.question.colCount+"%":"",o={display:"inline-block"};i&&(o.width=i);var a=this.question.value==t.value,s=a&&t.value===this.question.otherItem.value?this.renderOther(n):null;return this.renderRadio(e,t,a,o,s,r,n)},t.prototype.renderRadio=function(e,t,r,n,o,a,s){var u=a?this.question.inputId:null,l=this.renderLocString(t.locText,this.textStyle),c=s.item+(0===this.question.colCount?" sv_q_radiogroup_inline":"");return r&&(c+=" checked"),i.createElement("div",{key:e,className:c,style:n},i.createElement("label",{className:s.label},i.createElement("input",{className:s.itemControl,id:u,type:"radio",name:this.question.name+"_"+this.questionBase.id,checked:r,value:t.value,disabled:this.isDisplayMode,onChange:this.handleOnChange,"aria-label":this.question.locTitle.renderedHtml}),i.createElement("span",{className:"circle"}),i.createElement("span",{className:"check"}),i.createElement("span",{className:s.controlLabel},l)),o)},t.prototype.renderOther=function(e){return i.createElement("div",{className:e.other},i.createElement(a.a,{question:this.question,otherCss:e.other,cssClasses:e,isDisplayMode:this.isDisplayMode}))},t}(o.b);s.a.Instance.registerQuestion("radiogroup",function(e){return i.createElement(u,e)})},function(e,t,r){"use strict";var n=r(0),i=r(2),o=(r.n(i),r(4)),a=r(14),s=r(6);r.d(t,"a",function(){return u});var u=function(e){function t(t){var r=e.call(this,t)||this;return r.handleOnChange=r.handleOnChange.bind(r),r}return n.b(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.questionBase},enumerable:!0,configurable:!0}),t.prototype.handleOnChange=function(e){this.question.value=e.target.value,this.setState({value:this.question.value})},t.prototype.render=function(){if(!this.question)return null;for(var e=this.question.cssClasses,t=[],r=this.question.minRateDescription?this.renderLocString(this.question.locMinRateDescription):null,n=this.question.maxRateDescription?this.renderLocString(this.question.locMaxRateDescription):null,o=0;o-1},notcontains:function(e,t){return!e||!e.indexOf||-1==e.indexOf(t)},greater:function(e,t){return e>t},less:function(e,t){return e=t},lessorequal:function(e,t){return e<=t}},t.operatorsValue)},enumerable:!0,configurable:!0}),t.prototype.getType=function(){return"triggerbase"},Object.defineProperty(t.prototype,"operator",{get:function(){return this.opValue},set:function(e){e&&(e=e.toLowerCase(),t.operators[e]&&(this.opValue=e))},enumerable:!0,configurable:!0}),t.prototype.check=function(e){t.operators[this.operator](e,this.value)?this.onSuccess():this.onFailure()},t.prototype.onSuccess=function(){},t.prototype.onFailure=function(){},t.operatorsValue=null,t}(i.c),s=function(e){function t(){var t=e.call(this)||this;return t.owner=null,t}return n.b(t,e),t.prototype.setOwner=function(e){this.owner=e},Object.defineProperty(t.prototype,"isOnNextPage",{get:function(){return!1},enumerable:!0,configurable:!0}),t}(a),u=function(e){function t(){var t=e.call(this)||this;return t.pages=[],t.questions=[],t}return n.b(t,e),t.prototype.getType=function(){return"visibletrigger"},t.prototype.onSuccess=function(){this.onTrigger(this.onItemSuccess)},t.prototype.onFailure=function(){this.onTrigger(this.onItemFailure)},t.prototype.onTrigger=function(e){if(this.owner)for(var t=this.owner.getObjects(this.pages,this.questions),r=0;r=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}},function(e,t,n){"use strict";var r=n(0),i=n(4);n.d(t,"c",function(){return o}),n.d(t,"d",function(){return a}),n.d(t,"h",function(){return s}),n.d(t,"g",function(){return u}),n.d(t,"e",function(){return l}),n.d(t,"l",function(){return c}),n.d(t,"j",function(){return p}),n.d(t,"i",function(){return d}),n.d(t,"f",function(){return h}),n.d(t,"k",function(){return f}),n.d(t,"b",function(){return m}),n.d(t,"a",function(){return g});var o=function(){function e(e,t){void 0===t&&(t=!1),this.name=e,this.typeValue=null,this.choicesValue=null,this.baseValue=null,this.isRequiredValue=!1,this.readOnlyValue=null,this.visibleValue=null,this.isLocalizableValue=null,this.choicesfunc=null,this.dependedProperties=null,this.isSerializable=!0,this.isLightSerializable=!0,this.isCustom=!1,this.isDynamicChoices=!1,this.className=null,this.alternativeName=null,this.classNamePart=null,this.baseClassName=null,this.defaultValueValue=null,this.serializationProperty=null,this.layout=null,this.onGetValue=null,this.onSetValue=null,this.visibleIf=null,this.isArray=!1,this.isRequiredValue=t}return Object.defineProperty(e.prototype,"type",{get:function(){return this.typeValue?this.typeValue:"string"},set:function(e){"itemvalues"===e&&(e="itemvalue[]"),this.typeValue=e,this.typeValue.indexOf("[]")===this.typeValue.length-2&&(this.isArray=!0,this.className=this.typeValue.substr(0,this.typeValue.length-2))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRequired",{get:function(){return this.isRequiredValue},set:function(e){this.isRequiredValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasToUseGetValue",{get:function(){return this.onGetValue||this.serializationProperty},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultValue",{get:function(){var t=this.defaultValueValue;return e.getItemValuesDefaultValue&&m.metaData.isDescendantOf(this.className,"itemvalue")&&(t=e.getItemValuesDefaultValue(this.defaultValueValue||[])),t},set:function(e){this.defaultValueValue=e},enumerable:!0,configurable:!0}),e.prototype.isDefaultValue=function(e){return i.a.isValueEmpty(this.defaultValue)?!1===e&&"boolean"==this.type||""===e||i.a.isValueEmpty(e):this.defaultValue==e},e.prototype.getValue=function(e){return this.onGetValue?this.onGetValue(e):this.serializationProperty&&e[this.serializationProperty]?e[this.serializationProperty].getJson():e[this.name]},e.prototype.getPropertyValue=function(e){return this.isLocalizable?e[this.serializationProperty].text:this.getValue(e)},Object.defineProperty(e.prototype,"hasToUseSetValue",{get:function(){return this.onSetValue||this.serializationProperty},enumerable:!0,configurable:!0}),e.prototype.setValue=function(e,t,n){this.onSetValue?this.onSetValue(e,t,n):this.serializationProperty&&e[this.serializationProperty]?e[this.serializationProperty].setJson(t):(t&&"string"==typeof t&&("number"==this.type&&(t=parseInt(t)),"boolean"==this.type&&(t="true"===t.toLowerCase())),e[this.name]=t)},e.prototype.getObjType=function(e){return this.classNamePart?e.replace(this.classNamePart,""):e},e.prototype.getClassName=function(e){return e&&(e=e.toLowerCase()),this.classNamePart&&e.indexOf(this.classNamePart)<0?e+this.classNamePart:e},Object.defineProperty(e.prototype,"choices",{get:function(){return this.getChoices(null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChoices",{get:function(){return!!this.choicesValue||!!this.choicesfunc},enumerable:!0,configurable:!0}),e.prototype.getChoices=function(e,t){return void 0===t&&(t=null),null!=this.choicesValue?this.choicesValue:null!=this.choicesfunc?this.choicesfunc(e,t):null},e.prototype.setChoices=function(e,t){this.choicesValue=e,this.choicesfunc=t},e.prototype.getBaseValue=function(){return this.baseValue?"function"==typeof this.baseValue?this.baseValue():this.baseValue:""},e.prototype.setBaseValue=function(e){this.baseValue=e},Object.defineProperty(e.prototype,"readOnly",{get:function(){return null!=this.readOnlyValue&&this.readOnlyValue},set:function(e){this.readOnlyValue=e},enumerable:!0,configurable:!0}),e.prototype.isVisible=function(e,t){void 0===t&&(t=null);var n=!this.layout||this.layout==e;return!(!this.visible||!n)&&(!this.visibleIf||!t||this.visibleIf(t))},Object.defineProperty(e.prototype,"visible",{get:function(){return null==this.visibleValue||this.visibleValue},set:function(e){this.visibleValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLocalizable",{get:function(){return null!=this.isLocalizableValue&&this.isLocalizableValue},set:function(e){this.isLocalizableValue=e},enumerable:!0,configurable:!0}),e.prototype.mergeWith=function(t){for(var n=e.mergableValues,r=0;r-1&&(r=n.substring(a+1),n=n.substring(0,a));var s=this.getIsPropertyNameRequired(n)||!!t.isRequired;n=this.getPropertyName(n);var u=new o(n,s);if(r&&(u.type=r),"object"==typeof t){if(t.type&&(u.type=t.type),i.a.isValueEmpty(t.default)||(u.defaultValue=t.default),i.a.isValueEmpty(t.isSerializable)||(u.isSerializable=t.isSerializable),i.a.isValueEmpty(t.isLightSerializable)||(u.isLightSerializable=t.isLightSerializable),i.a.isValueEmpty(t.isDynamicChoices)||(u.isDynamicChoices=t.isDynamicChoices),!1===t.visible&&(u.visible=!1),t.visibleIf&&(u.visibleIf=t.visibleIf),t.choices){var l="function"==typeof t.choices?t.choices:null,c="function"!=typeof t.choices?t.choices:null;u.setChoices(c,l)}if(t.baseValue&&u.setBaseValue(t.baseValue),t.onGetValue&&(u.onGetValue=t.onGetValue),t.onSetValue&&(u.onSetValue=t.onSetValue),t.isLocalizable&&(t.serializationProperty="loc"+t.name),t.serializationProperty){u.serializationProperty=t.serializationProperty;u.serializationProperty&&0==u.serializationProperty.indexOf("loc")&&(u.isLocalizable=!0)}t.isLocalizable&&(u.isLocalizable=t.isLocalizable),t.className&&(u.className=t.className),t.baseClassName&&(u.baseClassName=t.baseClassName),t.classNamePart&&(u.classNamePart=t.classNamePart),t.alternativeName&&(u.alternativeName=t.alternativeName),t.layout&&(u.layout=t.layout),t.dependsOn&&this.addDependsOnProperties(u,t.dependsOn)}return u}},e.prototype.addDependsOnProperties=function(e,t){if(Array.isArray(t))for(var n=0;n0&&t[0]==e.requiredSymbol},e.prototype.getPropertyName=function(e){return this.getIsPropertyNameRequired(e)?e=e.slice(1):e},e.requiredSymbol="!",e.typeSymbol=":",e}(),u=function(){function e(){this.classes={},this.alternativeNames={},this.childrenClasses={},this.classProperties={},this.classHashProperties={}}return e.prototype.addClass=function(e,t,n,r){void 0===n&&(n=null),void 0===r&&(r=null),e=e.toLowerCase();var i=new s(e,t,n,r);if(this.classes[e]=i,r){r=r.toLowerCase();this.childrenClasses[r]||(this.childrenClasses[r]=[]),this.childrenClasses[r].push(i)}return i},e.prototype.removeClass=function(e){var t=this.findClass(e);if(t&&(delete this.classes[t.name],t.parentName)){var n=this.childrenClasses[t.parentName].indexOf(t);n>-1&&this.childrenClasses[t.parentName].splice(n,1)}},e.prototype.overrideClassCreatore=function(e,t){this.overrideClassCreator(e,t)},e.prototype.overrideClassCreator=function(e,t){e=e.toLowerCase();var n=this.findClass(e);n&&(n.creator=t)},e.prototype.getProperties=function(e){var t=this.findClass(e);if(!t)return[];var n=this.classProperties[t.name];return n||(this.fillPropertiesForClass(t.name),this.classProperties[t.name])},e.prototype.getHashProperties=function(e){var t=this.findClass(e);if(!t)return{};var n=this.classHashProperties[t.name];return n||(this.fillPropertiesForClass(t.name),this.classHashProperties[t.name])},e.prototype.fillPropertiesForClass=function(e){var t=new Array,n={};this.fillProperties(e,t,n),this.classProperties[e]=t,this.classHashProperties[e]=n},e.prototype.getDynamicProperties=function(e){if(e.getDynamicProperties&&e.getDynamicType){var t=e.getDynamicProperties();return m.metaData.findProperties(e.getDynamicType(),t)}return[]},e.prototype.getPropertiesByObj=function(e){if(!e||!e.getType)return[];for(var t=[],n=this.getProperties(e.getType()),r=0;r0)for(var r=0;r0&&(r.description+=", "),r.description+=i[o].name;r.description+="."}return r}return r.a(t,e),t}(l),p=function(e){function t(t,n,r){var i=e.call(this,n,r)||this;i.baseClassName=t,i.type=n,i.message=r,i.description="The following types are available: ";for(var o=m.metaData.getChildrenClasses(t,!0),a=0;a0&&(i.description+=", "),i.description+="'"+o[a].name+"'";return i.description+=".",i}return r.a(t,e),t}(l),d=function(e){function t(t,n){var r=e.call(this,n,"missingtypeproperty","The property type is missing in the object. Please take a look at property: '"+t+"'.")||this;return r.propertyName=t,r.baseClassName=n,r}return r.a(t,e),t}(p),h=function(e){function t(t,n){var r=e.call(this,n,"incorrecttypeproperty","The property type is incorrect in the object. Please take a look at property: '"+t+"'.")||this;return r.propertyName=t,r.baseClassName=n,r}return r.a(t,e),t}(p),f=function(e){function t(t,n){var r=e.call(this,"requiredproperty","The property '"+t+"' is required in class '"+n+"'.")||this;return r.propertyName=t,r.className=n,r}return r.a(t,e),t}(l),m=function(){function e(){this.errors=new Array,this.lightSerializing=!1}return Object.defineProperty(e,"metaData",{get:function(){return e.metaDataValue},enumerable:!0,configurable:!0}),e.prototype.toJsonObject=function(e,t){return void 0===t&&(t=!1),this.toJsonObjectCore(e,null,t)},e.prototype.toObject=function(t,n){if(t){var r=null,i=void 0,o=!0;if(n.getType&&(i=n.getType(),r=e.metaData.getProperties(i),o=!!i&&!e.metaData.isDescendantOf(i,"itemvalue")),r){n.startLoadingFromJson&&n.startLoadingFromJson(),r=this.addDynamicProperties(n,t,r);for(var a in t)if(a!==e.typePropertyName)if(a!==e.positionPropertyName){var s=this.findProperty(r,a);s?this.valueToObj(t[a],n,s):o&&this.addNewError(new c(a.toString(),i),t)}else n[a]=t[a];n.endLoadingFromJson&&n.endLoadingFromJson()}}},e.prototype.toJsonObjectCore=function(t,n,r){if(void 0===r&&(r=!1),!t||!t.getType)return t;if("function"==typeof t.getData)return t.getData();var i={};return null==n||n.className||(i[e.typePropertyName]=n.getObjType(t.getType())),this.propertiesToJson(t,e.metaData.getProperties(t.getType()),i,r),this.propertiesToJson(t,this.getDynamicProperties(t),i,r),i},e.prototype.getDynamicProperties=function(t){if(t.getDynamicProperties&&t.getDynamicType){var n=t.getDynamicProperties();return e.metaData.findProperties(t.getDynamicType(),n)}return[]},e.prototype.addDynamicProperties=function(e,t,n){if(!e.getDynamicPropertyName)return n;var r=e.getDynamicPropertyName();if(!r)return n;t[r]&&(e[r]=t[r]);for(var i=this.getDynamicProperties(e),o=[],a=0;a0?o:null}else i=this.toJsonObjectCore(i,n,r);var s="function"==typeof e.getPropertyValue&&null!==e.getPropertyValue(n.name,null);(r&&s||!n.isDefaultValue(i))&&(t[n.name]=i)}}},e.prototype.valueToObj=function(e,t,n){if(null!=e){if(this.removePos(n,e),null!=n&&n.hasToUseSetValue)return void n.setValue(t,e,this);if(this.isValueArray(e))return void this.valueToArray(e,t,n.name,n);var r=this.createNewObj(e,n);r.newObj&&(this.toObject(e,r.newObj),e=r.newObj),r.error||(null!=n?n.setValue(t,e,this):t[n.name]=e)}},e.prototype.removePos=function(e,t){!e||!e.type||e.type.indexOf("value")<0||this.removePosFromObj(t)},e.prototype.removePosFromObj=function(t){if(t){if(Array.isArray(t))for(var n=0;n0&&t[n].splice(0,t[n].length),t[n]||(t[n]=[]);for(var i=0;i0)for(var t=0;t0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e},e.getUnbindValue=function(e){return e&&e instanceof Object?JSON.parse(JSON.stringify(e)):e},e.getMaxLength=function(e,t){return e<0&&(e=t),e>0?e:null},e}();String.prototype.format||(String.prototype.format=function(){var e=arguments;return this.replace(/{(\d+)}/g,function(t,n){return void 0!==e[n]?e[n]:t})})},function(e,t,n){"use strict";var r=n(0),i=n(14),o=n(4),a=n(1),s=n(9);n.d(t,"c",function(){return u}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return c}),n.d(t,"a",function(){return p});var u=function(){function e(){this.propertyHash={},this.isLoadingFromJsonValue=!1,this.onPropertyChanged=new p,a.d.createProperties(this)}return Object.defineProperty(e,"commentPrefix",{get:function(){return s.a.commentPrefix},set:function(e){s.a.commentPrefix=e},enumerable:!0,configurable:!0}),e.prototype.isValueEmpty=function(e){return o.a.isValueEmpty(e)},e.prototype.IsPropertyEmpty=function(e){return""!==e&&this.isValueEmpty(e)},e.prototype.getType=function(){return"base"},e.prototype.getTemplate=function(){return this.getType()},Object.defineProperty(e.prototype,"isLoadingFromJson",{get:function(){return this.isLoadingFromJsonValue},enumerable:!0,configurable:!0}),e.prototype.startLoadingFromJson=function(){this.isLoadingFromJsonValue=!0},e.prototype.endLoadingFromJson=function(){this.isLoadingFromJsonValue=!1},e.prototype.toJSON=function(){return(new a.b).toJsonObject(this)},e.prototype.locStrsChanged=function(){if(this.arraysInfo)for(var t in this.arraysInfo){var n=this.arraysInfo[t];if(n&&n.isItemValues){var r=this.getPropertyValue(t);r&&e.itemValueLocStrChanged&&e.itemValueLocStrChanged(r)}}if(this.localizableStrings)for(var t in this.localizableStrings){var n=this.getLocalizableString(t);n&&n.strChanged()}},e.prototype.getPropertyValue=function(e,t){void 0===t&&(t=null);var n=this.getPropertyValueCore(this.propertyHash,e);if(this.IsPropertyEmpty(n)){if(null!=t)return t;var r=a.a.findProperty(this.getType(),e),i=r&&!r.isCustom?r.defaultValue:null;if(!this.IsPropertyEmpty(i))return i}return n},e.prototype.getPropertyValueCore=function(e,t){return this.getPropertyValueCoreHandler?this.getPropertyValueCoreHandler(e,t):e[t]},e.prototype.geValueFromHash=function(){return this.propertyHash.value},e.prototype.setPropertyValueCore=function(e,t,n){this.setPropertyValueCoreHandler?this.setPropertyValueCoreHandler(e,t,n):e[t]=n},e.prototype.iteratePropertiesHash=function(e){var t=this,n=[];for(var r in this.propertyHash)n.push(r);n.forEach(function(n){return e(t.propertyHash,n)})},e.prototype.setPropertyValue=function(e,t){var n=this.getPropertyValue(e);if(n&&Array.isArray(n)){if(this.isTwoValueEquals(n,t))return;var r=this.arraysInfo[e];this.setArray(n,t,!!r&&r.isItemValues,r?r.onPush:null),this.propertyValueChanged(e,n,n)}else this.setPropertyValueCore(this.propertyHash,e,t),this.isTwoValueEquals(n,t)||this.propertyValueChanged(e,n,t)},e.prototype.propertyValueChanged=function(e,t,n){if(!this.isLoadingFromJson&&(this.onPropertyChanged.fire(this,{name:e,oldValue:t,newValue:n}),this.onPropChangeFunctions))for(var r=0;r-1},e}()},function(e,t,n){var r,i,o;/*! + * Knockout JavaScript library v3.4.0 + * (c) Steven Sanderson - http://knockoutjs.com/ + * License: MIT (http://www.opensource.org/licenses/mit-license.php) + */ +!function(){var a=!0;!function(s){var u=this||(0,eval)("this"),l=u.document,c=u.navigator,p=u.jQuery,d=u.JSON;!function(a){i=[t,n],r=a,(o="function"==typeof r?r.apply(t,i):r)!==s&&(e.exports=o)}(function(e,t){function n(e,t){return!!(null===e||typeof e in b)&&e===t}function r(e,t){var n;return function(){n||(n=v.utils.setTimeout(function(){n=s,e()},t))}}function i(e,t){var n;return function(){clearTimeout(n),n=v.utils.setTimeout(e,t)}}function o(e){var t=this;return e&&v.utils.objectForEach(e,function(e,n){var r=v.extenders[e];"function"==typeof r&&(t=r(t,n)||t)}),t}function h(e,t){t&&t!==x?"beforeChange"===t?this._limitBeforeChange(e):this._origNotifySubscribers(e,t):this._limitChange(e)}function f(e,t){null!==t&&t.dispose&&t.dispose()}function m(e,t){var n=this.computedObservable,r=n[S];r.isDisposed||(this.disposalCount&&this.disposalCandidates[t]?(n.addDependencyTracking(t,e,this.disposalCandidates[t]),this.disposalCandidates[t]=null,--this.disposalCount):r.dependencyTracking[t]||n.addDependencyTracking(t,e,r.isSleeping?{_target:e}:n.subscribeToDependency(e)))}function g(e){v.bindingHandlers[e]={init:function(t,n,r,i,o){var a=function(){var t={};return t[e]=n(),t};return v.bindingHandlers.event.init.call(this,t,a,r,i,o)}}}function y(e,t,n,r){v.bindingHandlers[e]={init:function(e,i,o,a,s){var u,l;return v.computed(function(){var o=v.utils.unwrapObservable(i()),a=!n!=!o,c=!l;(c||t||a!==u)&&(c&&v.computedContext.getDependenciesCount()&&(l=v.utils.cloneNodes(v.virtualElements.childNodes(e),!0)),a?(c||v.virtualElements.setDomNodeChildren(e,v.utils.cloneNodes(l)),v.applyBindingsToDescendants(r?r(s,o):s,e)):v.virtualElements.emptyNode(e),u=a)},null,{disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}},v.expressionRewriting.bindingRewriteValidators[e]=!1,v.virtualElements.allowedBindings[e]=!0}var v=void 0!==e?e:{};v.exportSymbol=function(e,t){for(var n=e.split("."),r=v,i=0;i4?e:s}(),x=6===b,C=7===b,w=/\S+/g;return{fieldsIncludedWithJsonPost:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],arrayForEach:function(e,t){for(var n=0,r=e.length;n0?e.splice(n,1):0===n&&e.shift()},arrayGetDistinctValues:function(e){e=e||[];for(var t=[],n=0,r=e.length;n0){for(var r=n[0],i=r.parentNode,o=0,a=t.length;o1&&e[e.length-1].parentNode!==t;)e.length--;if(e.length>1){var n=e[0],r=e[e.length-1];for(e.length=0;n!==r;)e.push(n),n=n.nextSibling;e.push(r)}}return e},setOptionNodeSelectionState:function(e,t){b<7?e.setAttribute("selected",t):e.selected=t},stringTrim:function(e){return null===e||e===s?"":e.trim?e.trim():e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},stringStartsWith:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},domNodeIsContainedBy:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},domNodeIsAttachedToDocument:function(e){return v.utils.domNodeIsContainedBy(e,e.ownerDocument.documentElement)},anyDomNodeIsAttachedToDocument:function(e){return!!v.utils.arrayFirst(e,v.utils.domNodeIsAttachedToDocument)},tagNameLower:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},catchFunctionErrors:function(e){return v.onError?function(){try{return e.apply(this,arguments)}catch(e){throw v.onError&&v.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(v.utils.catchFunctionErrors(e),t)},deferError:function(e){setTimeout(function(){throw v.onError&&v.onError(e),e},0)},registerEventHandler:function(e,t,n){var r=v.utils.catchFunctionErrors(n),i=b&&y[t];if(v.options.useOnlyNativeEvents||i||!p)if(i||"function"!=typeof e.addEventListener){if(void 0===e.attachEvent)throw new Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,o),v.utils.domNodeDisposal.addDisposeCallback(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,r,!1);else p(e).bind(t,r)},triggerEvent:function(e,t){if(!e||!e.nodeType)throw new Error("element must be a DOM node when calling triggerEvent");var n=r(e,t);if(v.options.useOnlyNativeEvents||!p||n)if("function"==typeof l.createEvent){if("function"!=typeof e.dispatchEvent)throw new Error("The supplied element doesn't support dispatchEvent");var i=g[t]||"HTMLEvents",o=l.createEvent(i);o.initEvent(t,!0,!0,u,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(n&&e.click)e.click();else{if(void 0===e.fireEvent)throw new Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}else p(e).trigger(t)},unwrapObservable:function(e){return v.isObservable(e)?e():e},peekObservable:function(e){return v.isObservable(e)?e.peek():e},toggleDomNodeCssClass:i,setTextContent:function(e,t){var n=v.utils.unwrapObservable(t);null!==n&&n!==s||(n="");var r=v.virtualElements.firstChild(e);!r||3!=r.nodeType||v.virtualElements.nextSibling(r)?v.virtualElements.setDomNodeChildren(e,[e.ownerDocument.createTextNode(n)]):r.data=n,v.utils.forceRefresh(e)},setElementName:function(e,t){if(e.name=t,b<=7)try{e.mergeAttributes(l.createElement(""),!1)}catch(e){}},forceRefresh:function(e){if(b>=9){var t=1==e.nodeType?e:e.parentNode;t.style&&(t.style.zoom=t.style.zoom)}},ensureSelectElementIsRenderedCorrectly:function(e){if(b){var t=e.style.width;e.style.width=0,e.style.width=t}},range:function(e,t){e=v.utils.unwrapObservable(e),t=v.utils.unwrapObservable(t);for(var n=[],r=e;r<=t;r++)n.push(r);return n},makeArray:function(e){for(var t=[],n=0,r=e.length;n=0;o--)r(n[o])&&i.push(n[o]);return i},parseJson:function(e){return"string"==typeof e&&(e=v.utils.stringTrim(e))?d&&d.parse?d.parse(e):new Function("return "+e)():null},stringifyJson:function(e,t,n){if(!d||!d.stringify)throw new Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return d.stringify(v.utils.unwrapObservable(e),t,n)},postJson:function(t,n,r){r=r||{};var i=r.params||{},o=r.includeFields||this.fieldsIncludedWithJsonPost,a=t;if("object"==typeof t&&"form"===v.utils.tagNameLower(t)){var s=t;a=s.action;for(var u=o.length-1;u>=0;u--)for(var c=v.utils.getFormFields(s,o[u]),p=c.length-1;p>=0;p--)i[c[p].name]=c[p].value}n=v.utils.unwrapObservable(n);var d=l.createElement("form");d.style.display="none",d.action=a,d.method="post";for(var h in n){var f=l.createElement("input");f.type="hidden",f.name=h,f.value=v.utils.stringifyJson(v.utils.unwrapObservable(n[h])),d.appendChild(f)}e(i,function(e,t){var n=l.createElement("input");n.type="hidden",n.name=e,n.value=t,d.appendChild(n)}),l.body.appendChild(d),r.submitter?r.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),v.exportSymbol("utils",v.utils),v.exportSymbol("utils.arrayForEach",v.utils.arrayForEach),v.exportSymbol("utils.arrayFirst",v.utils.arrayFirst),v.exportSymbol("utils.arrayFilter",v.utils.arrayFilter),v.exportSymbol("utils.arrayGetDistinctValues",v.utils.arrayGetDistinctValues),v.exportSymbol("utils.arrayIndexOf",v.utils.arrayIndexOf),v.exportSymbol("utils.arrayMap",v.utils.arrayMap),v.exportSymbol("utils.arrayPushAll",v.utils.arrayPushAll),v.exportSymbol("utils.arrayRemoveItem",v.utils.arrayRemoveItem),v.exportSymbol("utils.extend",v.utils.extend),v.exportSymbol("utils.fieldsIncludedWithJsonPost",v.utils.fieldsIncludedWithJsonPost),v.exportSymbol("utils.getFormFields",v.utils.getFormFields),v.exportSymbol("utils.peekObservable",v.utils.peekObservable),v.exportSymbol("utils.postJson",v.utils.postJson),v.exportSymbol("utils.parseJson",v.utils.parseJson),v.exportSymbol("utils.registerEventHandler",v.utils.registerEventHandler),v.exportSymbol("utils.stringifyJson",v.utils.stringifyJson),v.exportSymbol("utils.range",v.utils.range),v.exportSymbol("utils.toggleDomNodeCssClass",v.utils.toggleDomNodeCssClass),v.exportSymbol("utils.triggerEvent",v.utils.triggerEvent),v.exportSymbol("utils.unwrapObservable",v.utils.unwrapObservable),v.exportSymbol("utils.objectForEach",v.utils.objectForEach),v.exportSymbol("utils.addOrRemoveItem",v.utils.addOrRemoveItem),v.exportSymbol("utils.setTextContent",v.utils.setTextContent),v.exportSymbol("unwrap",v.utils.unwrapObservable),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),v.utils.domData=new function(){function e(e,i){var o=e[n];if(!o||"null"===o||!r[o]){if(!i)return s;o=e[n]="ko"+t++,r[o]={}}return r[o]}var t=0,n="__ko__"+(new Date).getTime(),r={};return{get:function(t,n){var r=e(t,!1);return r===s?s:r[n]},set:function(t,n,r){if(r!==s||e(t,!1)!==s){e(t,!0)[n]=r}},clear:function(e){var t=e[n];return!!t&&(delete r[t],e[n]=null,!0)},nextKey:function(){return t+++n}}},v.exportSymbol("utils.domData",v.utils.domData),v.exportSymbol("utils.domData.clear",v.utils.domData.clear),v.utils.domNodeDisposal=new function(){function e(e,t){var n=v.utils.domData.get(e,i);return n===s&&t&&(n=[],v.utils.domData.set(e,i,n)),n}function t(e){v.utils.domData.set(e,i,s)}function n(t){var n=e(t,!1);if(n){n=n.slice(0);for(var i=0;i]/);return t&&d[t[1]]||r}function t(t,n){n||(n=l);var r=n.parentWindow||n.defaultView||u,i=v.utils.stringTrim(t).toLowerCase(),o=n.createElement("div"),a=e(i),s=a[0],c="ignored
"+a[1]+t+a[2]+"
";for("function"==typeof r.innerShiv?o.appendChild(r.innerShiv(c)):(h&&n.appendChild(o),o.innerHTML=c,h&&o.parentNode.removeChild(o));s--;)o=o.lastChild;return v.utils.makeArray(o.lastChild.childNodes)}function n(e,t){if(p.parseHTML)return p.parseHTML(e,t)||[];var n=p.clean([e],t);if(n&&n[0]){for(var r=n[0];r.parentNode&&11!==r.parentNode.nodeType;)r=r.parentNode;r.parentNode&&r.parentNode.removeChild(r)}return n}var r=[0,"",""],i=[1,"","
"],o=[2,"","
"],a=[3,"","
"],c=[1,""],d={thead:i,tbody:i,tfoot:i,tr:o,td:a,th:a,option:c,optgroup:c},h=v.utils.ieVersion<=8;v.utils.parseHtmlFragment=function(e,r){return p?n(e,r):t(e,r)},v.utils.setHtml=function(e,t){if(v.utils.emptyDomNode(e),null!==(t=v.utils.unwrapObservable(t))&&t!==s)if("string"!=typeof t&&(t=t.toString()),p)p(e).html(t);else for(var n=v.utils.parseHtmlFragment(t,e.ownerDocument),r=0;rt){if(++n>=5e3){s=o,v.utils.deferError(Error("'Too much recursion' after processing "+n+" task groups."));break}t=o}try{e()}catch(e){v.utils.deferError(e)}}}function t(){e(),s=o=i.length=0}function n(){v.tasks.scheduler(t)}var r,i=[],o=0,a=1,s=0;return r=u.MutationObserver?function(e){var t=l.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(t):l&&"onreadystatechange"in l.createElement("script")?function(e){var t=l.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,l.documentElement.removeChild(t),t=null,e()},l.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},{scheduler:r,schedule:function(e){return o||n(),i[o++]=e,a++},cancel:function(e){var t=e-(a-o);t>=s&&t0?(t.isDifferent(t[w],arguments[0])&&(t.valueWillMutate(),t[w]=arguments[0],t.valueHasMutated()),this):(v.dependencyDetection.registerDependency(t),t[w])}return t[w]=e,v.utils.canSetPrototype||v.utils.extend(t,v.subscribable.fn),v.subscribable.fn.init(t),v.utils.setPrototypeOfOrExtend(t,P),v.options.deferUpdates&&v.extenders.deferred(t,!0),t};var P={equalityComparer:n,peek:function(){return this[w]},valueHasMutated:function(){this.notifySubscribers(this[w])},valueWillMutate:function(){this.notifySubscribers(this[w],"beforeChange")}};v.utils.canSetPrototype&&v.utils.setPrototypeOf(P,v.subscribable.fn);var V=v.observable.protoProperty="__ko_proto__";P[V]=v.observable,v.hasPrototype=function(e,t){return null!==e&&e!==s&&e[V]!==s&&(e[V]===t||v.hasPrototype(e[V],t))},v.isObservable=function(e){return v.hasPrototype(e,v.observable)},v.isWriteableObservable=function(e){return"function"==typeof e&&e[V]===v.observable||!("function"!=typeof e||e[V]!==v.dependentObservable||!e.hasWriteFunction)},v.exportSymbol("observable",v.observable),v.exportSymbol("isObservable",v.isObservable),v.exportSymbol("isWriteableObservable",v.isWriteableObservable),v.exportSymbol("isWritableObservable",v.isWriteableObservable),v.exportSymbol("observable.fn",P),v.exportProperty(P,"peek",P.peek),v.exportProperty(P,"valueHasMutated",P.valueHasMutated),v.exportProperty(P,"valueWillMutate",P.valueWillMutate),v.observableArray=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");var t=v.observable(e);return v.utils.setPrototypeOfOrExtend(t,v.observableArray.fn),t.extend({trackArrayChanges:!0})},v.observableArray.fn={remove:function(e){for(var t=this.peek(),n=[],r="function"!=typeof e||v.isObservable(e)?function(t){return t===e}:e,i=0;i=0}):[]},destroy:function(e){var t=this.peek(),n="function"!=typeof e||v.isObservable(e)?function(t){return t===e}:e;this.valueWillMutate();for(var r=t.length-1;r>=0;r--){n(t[r])&&(t[r]._destroy=!0)}this.valueHasMutated()},destroyAll:function(e){return e===s?this.destroy(function(){return!0}):e?this.destroy(function(t){return v.utils.arrayIndexOf(e,t)>=0}):[]},indexOf:function(e){var t=this();return v.utils.arrayIndexOf(t,e)},replace:function(e,t){var n=this.indexOf(e);n>=0&&(this.valueWillMutate(),this.peek()[n]=t,this.valueHasMutated())}},v.utils.canSetPrototype&&v.utils.setPrototypeOf(v.observableArray.fn,v.observable.fn),v.utils.arrayForEach(["pop","push","reverse","shift","sort","splice","unshift"],function(e){v.observableArray.fn[e]=function(){var t=this.peek();this.valueWillMutate(),this.cacheDiffForKnownOperation(t,e,arguments);var n=t[e].apply(t,arguments);return this.valueHasMutated(),n===t?this:n}}),v.utils.arrayForEach(["slice"],function(e){v.observableArray.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),v.exportSymbol("observableArray",v.observableArray);var T="arrayChange";v.extenders.trackArrayChanges=function(e,t){function n(){if(!o){o=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,n){return n&&n!==x||++s,t.apply(this,arguments)};var n=[].concat(e.peek()||[]);a=null,i=e.subscribe(function(t){if(t=[].concat(t||[]),e.hasSubscriptionsForEvent(T))var i=r(n,t);n=t,a=null,s=0,i&&i.length&&e.notifySubscribers(i,T)})}}function r(t,n){return(!a||s>1)&&(a=v.utils.compareArrays(t,n,e.compareArrayOptions)),a}if(e.compareArrayOptions={},t&&"object"==typeof t&&v.utils.extend(e.compareArrayOptions,t),e.compareArrayOptions.sparse=!0,!e.cacheDiffForKnownOperation){var i,o=!1,a=null,s=0,u=e.beforeSubscriptionAdd,l=e.afterSubscriptionRemove;e.beforeSubscriptionAdd=function(t){u&&u.call(e,t),t===T&&n()},e.afterSubscriptionRemove=function(t){l&&l.call(e,t),t!==T||e.hasSubscriptionsForEvent(T)||(i.dispose(),o=!1)},e.cacheDiffForKnownOperation=function(e,t,n){function r(e,t,n){return i[i.length]={status:e,value:t,index:n}}if(o&&!s){var i=[],u=e.length,l=n.length,c=0;switch(t){case"push":c=u;case"unshift":for(var p=0;p0){if("function"!=typeof i)throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return i.apply(o.evaluatorFunctionTarget,arguments),this}return v.dependencyDetection.registerDependency(r),(o.isStale||o.isSleeping&&r.haveDependenciesChanged())&&r.evaluateImmediate(),o.latestValue}if("object"==typeof e?n=e:(n=n||{},e&&(n.read=e)),"function"!=typeof n.read)throw Error("Pass a function that returns the value of the ko.computed");var i=n.write,o={latestValue:s,isStale:!0,isBeingEvaluated:!1,suppressDisposalUntilDisposeWhenReturnsFalse:!1,isDisposed:!1,pure:!1,isSleeping:!1,readFunction:n.read,evaluatorFunctionTarget:t||n.owner,disposeWhenNodeIsRemoved:n.disposeWhenNodeIsRemoved||n.disposeWhenNodeIsRemoved||null,disposeWhen:n.disposeWhen||n.disposeWhen,domNodeDisposalCallback:null,dependencyTracking:{},dependenciesCount:0,evaluationTimeoutInstance:null};return r[S]=o,r.hasWriteFunction="function"==typeof i,v.utils.canSetPrototype||v.utils.extend(r,v.subscribable.fn),v.subscribable.fn.init(r),v.utils.setPrototypeOfOrExtend(r,k),n.pure?(o.pure=!0,o.isSleeping=!0,v.utils.extend(r,E)):n.deferEvaluation&&v.utils.extend(r,R),v.options.deferUpdates&&v.extenders.deferred(r,!0),a&&(r._options=n),o.disposeWhenNodeIsRemoved&&(o.suppressDisposalUntilDisposeWhenReturnsFalse=!0,o.disposeWhenNodeIsRemoved.nodeType||(o.disposeWhenNodeIsRemoved=null)),o.isSleeping||n.deferEvaluation||r.evaluateImmediate(),o.disposeWhenNodeIsRemoved&&r.isActive()&&v.utils.domNodeDisposal.addDisposeCallback(o.disposeWhenNodeIsRemoved,o.domNodeDisposalCallback=function(){r.dispose()}),r};var k={equalityComparer:n,getDependenciesCount:function(){return this[S].dependenciesCount},addDependencyTracking:function(e,t,n){if(this[S].pure&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].dependencyTracking[e]=n,n._order=this[S].dependenciesCount++,n._version=t.getVersion()},haveDependenciesChanged:function(){var e,t,n=this[S].dependencyTracking;for(e in n)if(n.hasOwnProperty(e)&&(t=n[e],t._target.hasChanged(t._version)))return!0},markDirty:function(){this._evalDelayed&&!this[S].isBeingEvaluated&&this._evalDelayed()},isActive:function(){return this[S].isStale||this[S].dependenciesCount>0},respondToChange:function(){this._notificationIsPending||this.evaluatePossiblyAsync()},subscribeToDependency:function(e){if(e._deferUpdates&&!this[S].disposeWhenNodeIsRemoved){var t=e.subscribe(this.markDirty,this,"dirty"),n=e.subscribe(this.respondToChange,this);return{_target:e,dispose:function(){t.dispose(),n.dispose()}}}return e.subscribe(this.evaluatePossiblyAsync,this)},evaluatePossiblyAsync:function(){var e=this,t=e.throttleEvaluation;t&&t>=0?(clearTimeout(this[S].evaluationTimeoutInstance),this[S].evaluationTimeoutInstance=v.utils.setTimeout(function(){e.evaluateImmediate(!0)},t)):e._evalDelayed?e._evalDelayed():e.evaluateImmediate(!0)},evaluateImmediate:function(e){var t=this,n=t[S],r=n.disposeWhen;if(!n.isBeingEvaluated&&!n.isDisposed){if(n.disposeWhenNodeIsRemoved&&!v.utils.domNodeIsAttachedToDocument(n.disposeWhenNodeIsRemoved)||r&&r()){if(!n.suppressDisposalUntilDisposeWhenReturnsFalse)return void t.dispose()}else n.suppressDisposalUntilDisposeWhenReturnsFalse=!1;n.isBeingEvaluated=!0;try{this.evaluateImmediate_CallReadWithDependencyDetection(e)}finally{n.isBeingEvaluated=!1}n.dependenciesCount||t.dispose()}},evaluateImmediate_CallReadWithDependencyDetection:function(e){var t=this,n=t[S],r=n.pure?s:!n.dependenciesCount,i={computedObservable:t,disposalCandidates:n.dependencyTracking,disposalCount:n.dependenciesCount};v.dependencyDetection.begin({callbackTarget:i,callback:m,computed:t,isInitial:r}),n.dependencyTracking={},n.dependenciesCount=0;var o=this.evaluateImmediate_CallReadThenEndDependencyDetection(n,i);t.isDifferent(n.latestValue,o)&&(n.isSleeping||t.notifySubscribers(n.latestValue,"beforeChange"),n.latestValue=o,n.isSleeping?t.updateVersion():e&&t.notifySubscribers(n.latestValue)),r&&t.notifySubscribers(n.latestValue,"awake")},evaluateImmediate_CallReadThenEndDependencyDetection:function(e,t){try{var n=e.readFunction;return e.evaluatorFunctionTarget?n.call(e.evaluatorFunctionTarget):n()}finally{v.dependencyDetection.end(),t.disposalCount&&!e.isSleeping&&v.utils.objectForEach(t.disposalCandidates,f),e.isStale=!1}},peek:function(){var e=this[S];return(e.isStale&&!e.dependenciesCount||e.isSleeping&&this.haveDependenciesChanged())&&this.evaluateImmediate(),e.latestValue},limit:function(e){v.subscribable.fn.limit.call(this,e),this._evalDelayed=function(){this._limitBeforeChange(this[S].latestValue),this[S].isStale=!0,this._limitChange(this)}},dispose:function(){var e=this[S];!e.isSleeping&&e.dependencyTracking&&v.utils.objectForEach(e.dependencyTracking,function(e,t){t.dispose&&t.dispose()}),e.disposeWhenNodeIsRemoved&&e.domNodeDisposalCallback&&v.utils.domNodeDisposal.removeDisposeCallback(e.disposeWhenNodeIsRemoved,e.domNodeDisposalCallback),e.dependencyTracking=null,e.dependenciesCount=0,e.isDisposed=!0,e.isStale=!1,e.isSleeping=!1,e.disposeWhenNodeIsRemoved=null}},E={beforeSubscriptionAdd:function(e){var t=this,n=t[S];if(!n.isDisposed&&n.isSleeping&&"change"==e){if(n.isSleeping=!1,n.isStale||t.haveDependenciesChanged())n.dependencyTracking=null,n.dependenciesCount=0,n.isStale=!0,t.evaluateImmediate();else{var r=[];v.utils.objectForEach(n.dependencyTracking,function(e,t){r[t._order]=e}),v.utils.arrayForEach(r,function(e,r){var i=n.dependencyTracking[e],o=t.subscribeToDependency(i._target);o._order=r,o._version=i._version,n.dependencyTracking[e]=o})}n.isDisposed||t.notifySubscribers(n.latestValue,"awake")}},afterSubscriptionRemove:function(e){var t=this[S];t.isDisposed||"change"!=e||this.hasSubscriptionsForEvent("change")||(v.utils.objectForEach(t.dependencyTracking,function(e,n){n.dispose&&(t.dependencyTracking[e]={_target:n._target,_order:n._order,_version:n._version},n.dispose())}),t.isSleeping=!0,this.notifySubscribers(s,"asleep"))},getVersion:function(){var e=this[S];return e.isSleeping&&(e.isStale||this.haveDependenciesChanged())&&this.evaluateImmediate(),v.subscribable.fn.getVersion.call(this)}},R={beforeSubscriptionAdd:function(e){"change"!=e&&"beforeChange"!=e||this.peek()}};v.utils.canSetPrototype&&v.utils.setPrototypeOf(k,v.subscribable.fn);var O=v.observable.protoProperty;v.computed[O]=v.observable,k[O]=v.computed,v.isComputed=function(e){return v.hasPrototype(e,v.computed)},v.isPureComputed=function(e){return v.hasPrototype(e,v.computed)&&e[S]&&e[S].pure},v.exportSymbol("computed",v.computed),v.exportSymbol("dependentObservable",v.computed),v.exportSymbol("isComputed",v.isComputed),v.exportSymbol("isPureComputed",v.isPureComputed),v.exportSymbol("computed.fn",k),v.exportProperty(k,"peek",k.peek),v.exportProperty(k,"dispose",k.dispose),v.exportProperty(k,"isActive",k.isActive),v.exportProperty(k,"getDependenciesCount",k.getDependenciesCount),v.pureComputed=function(e,t){return"function"==typeof e?v.computed(e,t,{pure:!0}):(e=v.utils.extend({},e),e.pure=!0,v.computed(e,t))},v.exportSymbol("pureComputed",v.pureComputed),function(){function e(r,i,o){if(o=o||new n,!!("object"!=typeof(r=i(r))||null===r||r===s||r instanceof RegExp||r instanceof Date||r instanceof String||r instanceof Number||r instanceof Boolean))return r;var a=r instanceof Array?[]:{};return o.save(r,a),t(r,function(t){var n=i(r[t]);switch(typeof n){case"boolean":case"number":case"string":case"function":a[t]=n;break;case"object":case"undefined":var u=o.get(n);a[t]=u!==s?u:e(n,i,o)}}),a}function t(e,t){if(e instanceof Array){for(var n=0;n=0?this.values[n]=t:(this.keys.push(e),this.values.push(t))},get:function(e){var t=v.utils.arrayIndexOf(this.keys,e);return t>=0?this.values[t]:s}}}(),v.exportSymbol("toJS",v.toJS),v.exportSymbol("toJSON",v.toJSON),function(){var e="__ko__hasDomDataOptionValue__";v.selectExtensions={readValue:function(t){switch(v.utils.tagNameLower(t)){case"option":return!0===t[e]?v.utils.domData.get(t,v.bindingHandlers.options.optionValueDomDataKey):v.utils.ieVersion<=7?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return t.selectedIndex>=0?v.selectExtensions.readValue(t.options[t.selectedIndex]):s;default:return t.value}},writeValue:function(t,n,r){switch(v.utils.tagNameLower(t)){case"option":switch(typeof n){case"string":v.utils.domData.set(t,v.bindingHandlers.options.optionValueDomDataKey,s),e in t&&delete t[e],t.value=n;break;default:v.utils.domData.set(t,v.bindingHandlers.options.optionValueDomDataKey,n),t[e]=!0,t.value="number"==typeof n?n:""}break;case"select":""!==n&&null!==n||(n=s);for(var i,o=-1,a=0,u=t.options.length;a=0||n===s&&t.size>1)&&(t.selectedIndex=o);break;default:null!==n&&n!==s||(n=""),t.value=n}}}}(),v.exportSymbol("selectExtensions",v.selectExtensions),v.exportSymbol("selectExtensions.readValue",v.selectExtensions.readValue),v.exportSymbol("selectExtensions.writeValue",v.selectExtensions.writeValue),v.expressionRewriting=function(){function e(e){if(v.utils.arrayIndexOf(r,e)>=0)return!1;var t=e.match(i);return null!==t&&(t[1]?"Object("+t[1]+")"+t[2]:e)}function t(e){var t=v.utils.stringTrim(e);123===t.charCodeAt(0)&&(t=t.slice(1,-1));var n,r=[],i=t.match(p),o=[],a=0;if(i){i.push(",");for(var s,u=0;s=i[u];++u){var l=s.charCodeAt(0);if(44===l){if(a<=0){r.push(n&&o.length?{key:n,value:o.join("")}:{unknown:n||o.join("")}),n=a=0,o=[];continue}}else if(58===l){if(!a&&!n&&1===o.length){n=o.pop();continue}}else if(47===l&&u&&s.length>1){var c=i[u-1].match(d);c&&!h[c[0]]&&(t=t.substr(t.indexOf(s)+1),i=t.match(p),i.push(","),u=-1,s="/")}else 40===l||123===l||91===l?++a:41===l||125===l||93===l?--a:n||o.length||34!==l&&39!==l||(s=s.slice(1,-1));o.push(s)}}return r}function n(n,r){function i(t,n){function r(e){return!e||!e.preprocess||(n=e.preprocess(n,t,i))}var l;if(!u){if(!r(v.getBindingHandler(t)))return;f[t]&&(l=e(n))&&a.push("'"+t+"':function(_z){"+l+"=_z}")}s&&(n="function(){return "+n+" }"),o.push("'"+t+"':"+n)}r=r||{};var o=[],a=[],s=r.valueAccessors,u=r.bindingParams,l="string"==typeof n?t(n):n;return v.utils.arrayForEach(l,function(e){i(e.key||e.unknown,e.value)}),a.length&&i("_ko_property_writers","{"+a.join(",")+" }"),o.join(",")}var r=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,o='"(?:[^"\\\\]|\\\\.)*"',a="'(?:[^'\\\\]|\\\\.)*'",s="/(?:[^/\\\\]|\\\\.)*/w*",u=",\"'{}()/:[\\]",l="[^\\s:,/][^"+u+"]*[^\\s"+u+"]",c="[^\\s]",p=RegExp(o+"|"+a+"|"+s+"|"+l+"|"+c,"g"),d=/[\])"'A-Za-z0-9_$]+$/,h={in:1,return:1,typeof:1},f={};return{bindingRewriteValidators:[],twoWayBindings:f,parseObjectLiteral:t,preProcessBindings:n,keyValueArrayContainsKey:function(e,t){for(var n=0;n0?r[r.length-1].nextSibling:e.nextSibling:null}function i(n){var i=n.firstChild,o=null;if(i)do{if(o)o.push(i);else if(e(i)){var a=r(i,!0);a?i=a:o=[i]}else t(i)&&(o=[i])}while(i=i.nextSibling);return o}var o=l&&"\x3c!--test--\x3e"===l.createComment("test").text,a=o?/^$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^$/:/^\s*\/ko\s*$/,u={ul:!0,ol:!0};v.virtualElements={allowedBindings:{},childNodes:function(t){return e(t)?n(t):t.childNodes},emptyNode:function(t){if(e(t))for(var n=v.virtualElements.childNodes(t),r=0,i=n.length;r=0:a?n:o()===n}var o=v.pureComputed(function(){return n.has("checkedValue")?v.utils.unwrapObservable(n.get("checkedValue")):n.has("value")?v.utils.unwrapObservable(n.get("value")):e.value}),a="checkbox"==e.type,u="radio"==e.type;if(a||u){var l=t(),c=a&&v.utils.unwrapObservable(l)instanceof Array,p=!(c&&l.push&&l.splice),d=c?o():s,h=u||c;u&&!e.name&&v.bindingHandlers.uniqueName.init(e,function(){return!0}),v.computed(r,null,{disposeWhenNodeIsRemoved:e}),v.utils.registerEventHandler(e,"click",r),v.computed(i,null,{disposeWhenNodeIsRemoved:e}),l=s}}},v.expressionRewriting.twoWayBindings.checked=!0,v.bindingHandlers.checkedValue={update:function(e,t){e.value=v.utils.unwrapObservable(t())}}}();var _="__ko__cssValue";v.bindingHandlers.css={update:function(e,t){var n=v.utils.unwrapObservable(t());null!==n&&"object"==typeof n?v.utils.objectForEach(n,function(t,n){n=v.utils.unwrapObservable(n),v.utils.toggleDomNodeCssClass(e,t,n)}):(n=v.utils.stringTrim(String(n||"")),v.utils.toggleDomNodeCssClass(e,e[_],!1),e[_]=n,v.utils.toggleDomNodeCssClass(e,n,!0))}},v.bindingHandlers.enable={update:function(e,t){var n=v.utils.unwrapObservable(t());n&&e.disabled?e.removeAttribute("disabled"):n||e.disabled||(e.disabled=!0)}},v.bindingHandlers.disable={update:function(e,t){v.bindingHandlers.enable.update(e,function(){return!v.utils.unwrapObservable(t())})}},v.bindingHandlers.event={init:function(e,t,n,r,i){var o=t()||{};v.utils.objectForEach(o,function(o){"string"==typeof o&&v.utils.registerEventHandler(e,o,function(e){var a,s=t()[o];if(s){try{var u=v.utils.makeArray(arguments);r=i.$data,u.unshift(r),a=s.apply(r,u)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1!==n.get(o+"Bubble")||(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},v.bindingHandlers.foreach={makeTemplateValueAccessor:function(e){return function(){var t=e(),n=v.utils.peekObservable(t);return n&&"number"!=typeof n.length?(v.utils.unwrapObservable(t),{foreach:n.data,as:n.as,includeDestroyed:n.includeDestroyed,afterAdd:n.afterAdd,beforeRemove:n.beforeRemove,afterRender:n.afterRender,beforeMove:n.beforeMove,afterMove:n.afterMove,templateEngine:v.nativeTemplateEngine.instance}):{foreach:t,templateEngine:v.nativeTemplateEngine.instance}}},init:function(e,t,n,r,i){return v.bindingHandlers.template.init(e,v.bindingHandlers.foreach.makeTemplateValueAccessor(t))},update:function(e,t,n,r,i){return v.bindingHandlers.template.update(e,v.bindingHandlers.foreach.makeTemplateValueAccessor(t),n,r,i)}},v.expressionRewriting.bindingRewriteValidators.foreach=!1,v.virtualElements.allowedBindings.foreach=!0;var I="__ko_hasfocusUpdating",D="__ko_hasfocusLastValue";v.bindingHandlers.hasfocus={init:function(e,t,n){var r=function(r){e[I]=!0;var i=e.ownerDocument;if("activeElement"in i){var o;try{o=i.activeElement}catch(e){o=i.body}r=o===e}var a=t();v.expressionRewriting.writeValueToProperty(a,n,"hasfocus",r,!0),e[D]=r,e[I]=!1},i=r.bind(null,!0),o=r.bind(null,!1);v.utils.registerEventHandler(e,"focus",i),v.utils.registerEventHandler(e,"focusin",i),v.utils.registerEventHandler(e,"blur",o),v.utils.registerEventHandler(e,"focusout",o)},update:function(e,t){var n=!!v.utils.unwrapObservable(t());e[I]||e[D]===n||(n?e.focus():e.blur(),!n&&e[D]&&e.ownerDocument.body.focus(),v.dependencyDetection.ignore(v.utils.triggerEvent,null,[e,n?"focusin":"focusout"]))}},v.expressionRewriting.twoWayBindings.hasfocus=!0,v.bindingHandlers.hasFocus=v.bindingHandlers.hasfocus,v.expressionRewriting.twoWayBindings.hasFocus=!0,v.bindingHandlers.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){v.utils.setHtml(e,t())}},y("if"),y("ifnot",!1,!0),y("with",!0,!1,function(e,t){return e.createChildContext(t)});var N={};v.bindingHandlers.options={init:function(e){if("select"!==v.utils.tagNameLower(e))throw new Error("options binding applies only to SELECT elements");for(;e.length>0;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(e,t,n){function r(){return v.utils.arrayFilter(e.options,function(e){return e.selected})}function i(e,t,n){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:n}function o(t,r,o){o.length&&(y=!f&&o[0].selected?[v.selectExtensions.readValue(o[0])]:[],b=!0);var a=e.ownerDocument.createElement("option");if(t===N)v.utils.setTextContent(a,n.get("optionsCaption")),v.selectExtensions.writeValue(a,s);else{var u=i(t,n.get("optionsValue"),t);v.selectExtensions.writeValue(a,v.utils.unwrapObservable(u));var l=i(t,n.get("optionsText"),u);v.utils.setTextContent(a,l)}return[a]}function a(t,r){if(b&&f)v.selectExtensions.writeValue(e,v.utils.unwrapObservable(n.get("value")),!0);else if(y.length){var i=v.utils.arrayIndexOf(y,v.selectExtensions.readValue(r[0]))>=0;v.utils.setOptionNodeSelectionState(r[0],i),b&&!i&&v.dependencyDetection.ignore(v.utils.triggerEvent,null,[e,"change"])}}var u,l,c=0==e.length,p=e.multiple,d=!c&&p?e.scrollTop:null,h=v.utils.unwrapObservable(t()),f=n.get("valueAllowUnset")&&n.has("value"),m=n.get("optionsIncludeDestroyed"),g={},y=[];f||(p?y=v.utils.arrayMap(r(),v.selectExtensions.readValue):e.selectedIndex>=0&&y.push(v.selectExtensions.readValue(e.options[e.selectedIndex]))),h&&(void 0===h.length&&(h=[h]),l=v.utils.arrayFilter(h,function(e){return m||e===s||null===e||!v.utils.unwrapObservable(e._destroy)}),n.has("optionsCaption")&&null!==(u=v.utils.unwrapObservable(n.get("optionsCaption")))&&u!==s&&l.unshift(N));var b=!1;g.beforeRemove=function(t){e.removeChild(t)};var x=a;n.has("optionsAfterRender")&&"function"==typeof n.get("optionsAfterRender")&&(x=function(e,t){a(e,t),v.dependencyDetection.ignore(n.get("optionsAfterRender"),null,[t[0],e!==N?e:s])}),v.utils.setDomNodeChildrenFromArrayMapping(e,l,o,g,x),v.dependencyDetection.ignore(function(){if(f)v.selectExtensions.writeValue(e,v.utils.unwrapObservable(n.get("value")),!0);else{var t;t=p?y.length&&r().length=0?v.selectExtensions.readValue(e.options[e.selectedIndex])!==y[0]:y.length||e.selectedIndex>=0,t&&v.utils.triggerEvent(e,"change")}}),v.utils.ensureSelectElementIsRenderedCorrectly(e),d&&Math.abs(d-e.scrollTop)>20&&(e.scrollTop=d)}},v.bindingHandlers.options.optionValueDomDataKey=v.utils.domData.nextKey(),v.bindingHandlers.selectedOptions={after:["options","foreach"],init:function(e,t,n){v.utils.registerEventHandler(e,"change",function(){var r=t(),i=[];v.utils.arrayForEach(e.getElementsByTagName("option"),function(e){e.selected&&i.push(v.selectExtensions.readValue(e))}),v.expressionRewriting.writeValueToProperty(r,n,"selectedOptions",i)})},update:function(e,t){if("select"!=v.utils.tagNameLower(e))throw new Error("values binding applies only to SELECT elements");var n=v.utils.unwrapObservable(t()),r=e.scrollTop;n&&"number"==typeof n.length&&v.utils.arrayForEach(e.getElementsByTagName("option"),function(e){var t=v.utils.arrayIndexOf(n,v.selectExtensions.readValue(e))>=0;e.selected!=t&&v.utils.setOptionNodeSelectionState(e,t)}),e.scrollTop=r}},v.expressionRewriting.twoWayBindings.selectedOptions=!0,v.bindingHandlers.style={update:function(e,t){var n=v.utils.unwrapObservable(t()||{});v.utils.objectForEach(n,function(t,n){n=v.utils.unwrapObservable(n),null!==n&&n!==s&&!1!==n||(n=""),e.style[t]=n})}},v.bindingHandlers.submit={init:function(e,t,n,r,i){if("function"!=typeof t())throw new Error("The value for a submit binding must be a function");v.utils.registerEventHandler(e,"submit",function(n){var r,o=t();try{r=o.call(i.$data,e)}finally{!0!==r&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}})}},v.bindingHandlers.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){v.utils.setTextContent(e,t())}},v.virtualElements.allowedBindings.text=!0,function(){if(u&&u.navigator)var e=function(e){if(e)return parseFloat(e[1])},t=u.opera&&u.opera.version&&parseInt(u.opera.version()),n=u.navigator.userAgent,r=e(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),i=e(n.match(/Firefox\/([^ ]*)/));if(v.utils.ieVersion<10)var o=v.utils.domData.nextKey(),l=v.utils.domData.nextKey(),c=function(e){var t=this.activeElement,n=t&&v.utils.domData.get(t,l);n&&n(e)},p=function(e,t){var n=e.ownerDocument;v.utils.domData.get(n,o)||(v.utils.domData.set(n,o,!0),v.utils.registerEventHandler(n,"selectionchange",c)),v.utils.domData.set(e,l,t)};v.bindingHandlers.textInput={init:function(e,n,o){var u,l,c=e.value,d=function(t){clearTimeout(u),l=u=s;var r=e.value;c!==r&&(a&&t&&(e._ko_textInputProcessedEvent=t.type),c=r,v.expressionRewriting.writeValueToProperty(n(),o,"textInput",r))},h=function(t){if(!u){l=e.value;var n=a?d.bind(e,{type:t.type}):d;u=v.utils.setTimeout(n,4)}},f=9==v.utils.ieVersion?h:d,m=function(){var t=v.utils.unwrapObservable(n());if(null!==t&&t!==s||(t=""),l!==s&&t===l)return void v.utils.setTimeout(m,4);e.value!==t&&(c=t,e.value=t)},g=function(t,n){v.utils.registerEventHandler(e,t,n)};a&&v.bindingHandlers.textInput._forceUpdateOn?v.utils.arrayForEach(v.bindingHandlers.textInput._forceUpdateOn,function(e){"after"==e.slice(0,5)?g(e.slice(5),h):g(e,d)}):v.utils.ieVersion<10?(g("propertychange",function(e){"value"===e.propertyName&&f(e)}),8==v.utils.ieVersion&&(g("keyup",d),g("keydown",d)),v.utils.ieVersion>=8&&(p(e,f),g("dragend",h))):(g("input",d),r<5&&"textarea"===v.utils.tagNameLower(e)?(g("keydown",h),g("paste",h),g("cut",h)):t<11?g("keydown",h):i<4&&(g("DOMAutoComplete",d),g("dragdrop",d),g("drop",d))),g("change",d),v.computed(m,null,{disposeWhenNodeIsRemoved:e})}},v.expressionRewriting.twoWayBindings.textInput=!0,v.bindingHandlers.textinput={preprocess:function(e,t,n){n("textInput",e)}}}(),v.bindingHandlers.uniqueName={init:function(e,t){if(t()){var n="ko_unique_"+ ++v.bindingHandlers.uniqueName.currentIndex;v.utils.setElementName(e,n)}}},v.bindingHandlers.uniqueName.currentIndex=0,v.bindingHandlers.value={after:["options","foreach"],init:function(e,t,n){if("input"==e.tagName.toLowerCase()&&("checkbox"==e.type||"radio"==e.type))return void v.applyBindingAccessorsToNode(e,{checkedValue:t});var r=["change"],i=n.get("valueUpdate"),o=!1,a=null;i&&("string"==typeof i&&(i=[i]),v.utils.arrayPushAll(r,i),r=v.utils.arrayGetDistinctValues(r));var s=function(){a=null,o=!1;var r=t(),i=v.selectExtensions.readValue(e);v.expressionRewriting.writeValueToProperty(r,n,"value",i)};v.utils.ieVersion&&"input"==e.tagName.toLowerCase()&&"text"==e.type&&"off"!=e.autocomplete&&(!e.form||"off"!=e.form.autocomplete)&&-1==v.utils.arrayIndexOf(r,"propertychange")&&(v.utils.registerEventHandler(e,"propertychange",function(){o=!0}),v.utils.registerEventHandler(e,"focus",function(){o=!1}),v.utils.registerEventHandler(e,"blur",function(){o&&s()})),v.utils.arrayForEach(r,function(t){var n=s;v.utils.stringStartsWith(t,"after")&&(n=function(){a=v.selectExtensions.readValue(e),v.utils.setTimeout(s,0)},t=t.substring("after".length)),v.utils.registerEventHandler(e,t,n)});var u=function(){var r=v.utils.unwrapObservable(t()),i=v.selectExtensions.readValue(e);if(null!==a&&r===a)return void v.utils.setTimeout(u,0);if(r!==i)if("select"===v.utils.tagNameLower(e)){var o=n.get("valueAllowUnset"),s=function(){v.selectExtensions.writeValue(e,r,o)};s(),o||r===v.selectExtensions.readValue(e)?v.utils.setTimeout(s,0):v.dependencyDetection.ignore(v.utils.triggerEvent,null,[e,"change"])}else v.selectExtensions.writeValue(e,r)};v.computed(u,null,{disposeWhenNodeIsRemoved:e})},update:function(){}},v.expressionRewriting.twoWayBindings.value=!0,v.bindingHandlers.visible={update:function(e,t){var n=v.utils.unwrapObservable(t()),r=!("none"==e.style.display);n&&!r?e.style.display="":!n&&r&&(e.style.display="none")}},g("click"),v.templateEngine=function(){},v.templateEngine.prototype.renderTemplateSource=function(e,t,n,r){throw new Error("Override renderTemplateSource")},v.templateEngine.prototype.createJavaScriptEvaluatorBlock=function(e){throw new Error("Override createJavaScriptEvaluatorBlock")},v.templateEngine.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||l;var n=t.getElementById(e);if(!n)throw new Error("Cannot find template with ID "+e);return new v.templateSources.domElement(n)}if(1==e.nodeType||8==e.nodeType)return new v.templateSources.anonymousTemplate(e);throw new Error("Unknown template type: "+e)},v.templateEngine.prototype.renderTemplate=function(e,t,n,r){var i=this.makeTemplateSource(e,r);return this.renderTemplateSource(i,t,n,r)},v.templateEngine.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},v.templateEngine.prototype.rewriteTemplate=function(e,t,n){var r=this.makeTemplateSource(e,n),i=t(r.text());r.text(i),r.data("isRewritten",!0)},v.exportSymbol("templateEngine",v.templateEngine),v.templateRewriting=function(){function e(e){for(var t=v.expressionRewriting.bindingRewriteValidators,n=0;n]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,r=//g;return{ensureTemplateIsRewritten:function(e,t,n){t.isTemplateRewritten(e,n)||t.rewriteTemplate(e,function(e){return v.templateRewriting.memoizeBindingAttributeSyntax(e,t)},n)},memoizeBindingAttributeSyntax:function(e,i){return e.replace(n,function(){return t(arguments[4],arguments[1],arguments[2],i)}).replace(r,function(){return t(arguments[1],"\x3c!-- ko --\x3e","#comment",i)})},applyMemoizedBindingsToNextSibling:function(e,t){return v.memoization.memoize(function(n,r){var i=n.nextSibling;i&&i.nodeName.toLowerCase()===t&&v.applyBindingAccessorsToNode(i,e,r)})}}}(),v.exportSymbol("__tr_ambtns",v.templateRewriting.applyMemoizedBindingsToNextSibling),function(){function e(e){return v.utils.domData.get(e,u)||{}}function t(e,t){v.utils.domData.set(e,u,t)}v.templateSources={};var n=1,r=2,i=3,o=4;v.templateSources.domElement=function(e){if(this.domElement=e,e){var t=v.utils.tagNameLower(e);this.templateType="script"===t?n:"textarea"===t?r:"template"==t&&e.content&&11===e.content.nodeType?i:o}},v.templateSources.domElement.prototype.text=function(){var e=this.templateType===n?"text":this.templateType===r?"value":"innerHTML";if(0==arguments.length)return this.domElement[e];var t=arguments[0];"innerHTML"===e?v.utils.setHtml(this.domElement,t):this.domElement[e]=t};var a=v.utils.domData.nextKey()+"_";v.templateSources.domElement.prototype.data=function(e){if(1===arguments.length)return v.utils.domData.get(this.domElement,a+e);v.utils.domData.set(this.domElement,a+e,arguments[1])};var u=v.utils.domData.nextKey();v.templateSources.domElement.prototype.nodes=function(){var n=this.domElement;if(0==arguments.length){return e(n).containerData||(this.templateType===i?n.content:this.templateType===o?n:s)}t(n,{containerData:arguments[0]})},v.templateSources.anonymousTemplate=function(e){this.domElement=e},v.templateSources.anonymousTemplate.prototype=new v.templateSources.domElement,v.templateSources.anonymousTemplate.prototype.constructor=v.templateSources.anonymousTemplate,v.templateSources.anonymousTemplate.prototype.text=function(){if(0==arguments.length){var n=e(this.domElement);return n.textData===s&&n.containerData&&(n.textData=n.containerData.innerHTML),n.textData}var r=arguments[0];t(this.domElement,{textData:r})},v.exportSymbol("templateSources",v.templateSources),v.exportSymbol("templateSources.domElement",v.templateSources.domElement),v.exportSymbol("templateSources.anonymousTemplate",v.templateSources.anonymousTemplate)}(),function(){function e(e,t,n){for(var r,i=e,o=v.virtualElements.nextSibling(t);i&&(r=i)!==o;)i=v.virtualElements.nextSibling(r),n(r,i)}function t(t,n){if(t.length){var r=t[0],i=t[t.length-1],o=r.parentNode,a=v.bindingProvider.instance,s=a.preprocessNode;if(s){if(e(r,i,function(e,t){var n=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===i&&(i=o[o.length-1]||n))}),t.length=0,!r)return;r===i?t.push(r):(t.push(r,i),v.utils.fixUpContinuousNodeArray(t,o))}e(r,i,function(e){1!==e.nodeType&&8!==e.nodeType||v.applyBindings(n,e)}),e(r,i,function(e){1!==e.nodeType&&8!==e.nodeType||v.memoization.unmemoizeDomNodeAndDescendants(e,[n])}),v.utils.fixUpContinuousNodeArray(t,o)}}function n(e){return e.nodeType?e:e.length>0?e[0]:null}function r(e,r,i,o,s){s=s||{};var u=e&&n(e),l=(u||i||{}).ownerDocument,c=s.templateEngine||a;v.templateRewriting.ensureTemplateIsRewritten(i,c,l);var p=c.renderTemplate(i,o,s,l);if("number"!=typeof p.length||p.length>0&&"number"!=typeof p[0].nodeType)throw new Error("Template engine must return an array of DOM nodes");var d=!1;switch(r){case"replaceChildren":v.virtualElements.setDomNodeChildren(e,p),d=!0;break;case"replaceNode":v.utils.replaceDomNodes(e,p),d=!0;break;case"ignoreTargetNode":break;default:throw new Error("Unknown renderMode: "+r)}return d&&(t(p,o),s.afterRender&&v.dependencyDetection.ignore(s.afterRender,null,[p,o.$data])),p}function i(e,t,n){return v.isObservable(e)?e():"function"==typeof e?e(t,n):e}function o(e,t){var n=v.utils.domData.get(e,u);n&&"function"==typeof n.dispose&&n.dispose(),v.utils.domData.set(e,u,t&&t.isActive()?t:s)}var a;v.setTemplateEngine=function(e){if(e!=s&&!(e instanceof v.templateEngine))throw new Error("templateEngine must inherit from ko.templateEngine");a=e},v.renderTemplate=function(e,t,o,u,l){if(o=o||{},(o.templateEngine||a)==s)throw new Error("Set a template engine before calling renderTemplate");if(l=l||"replaceChildren",u){var c=n(u),p=function(){return!c||!v.utils.domNodeIsAttachedToDocument(c)},d=c&&"replaceNode"==l?c.parentNode:c;return v.dependentObservable(function(){var a=t&&t instanceof v.bindingContext?t:new v.bindingContext(v.utils.unwrapObservable(t)),s=i(e,a.$data,a),p=r(u,l,s,a,o);"replaceNode"==l&&(u=p,c=n(u))},null,{disposeWhen:p,disposeWhenNodeIsRemoved:d})}return v.memoization.memoize(function(n){v.renderTemplate(e,t,o,n,"replaceNode")})},v.renderTemplateForEach=function(e,n,o,a,u){var l,c=function(t,n){return l=u.createChildContext(t,o.as,function(e){e.$index=n}),r(null,"ignoreTargetNode",i(e,t,l),l,o)},p=function(e,n,r){t(n,l),o.afterRender&&o.afterRender(n,e),l=null};return v.dependentObservable(function(){var e=v.utils.unwrapObservable(n)||[];void 0===e.length&&(e=[e]);var t=v.utils.arrayFilter(e,function(e){return o.includeDestroyed||e===s||null===e||!v.utils.unwrapObservable(e._destroy)});v.dependencyDetection.ignore(v.utils.setDomNodeChildrenFromArrayMapping,null,[a,t,c,o,p])},null,{disposeWhenNodeIsRemoved:a})};var u=v.utils.domData.nextKey();v.bindingHandlers.template={init:function(e,t){var n=v.utils.unwrapObservable(t());if("string"==typeof n||n.name)v.virtualElements.emptyNode(e);else if("nodes"in n){var r=n.nodes||[];if(v.isObservable(r))throw new Error('The "nodes" option must be a plain, non-observable array.');var i=v.utils.moveCleanedNodesToContainerElement(r);new v.templateSources.anonymousTemplate(e).nodes(i)}else{var o=v.virtualElements.childNodes(e),i=v.utils.moveCleanedNodesToContainerElement(o);new v.templateSources.anonymousTemplate(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(e,t,n,r,i){var a,s,u=t(),l=v.utils.unwrapObservable(u),c=!0,p=null;if("string"==typeof l?(s=u,l={}):(s=l.name,"if"in l&&(c=v.utils.unwrapObservable(l.if)),c&&"ifnot"in l&&(c=!v.utils.unwrapObservable(l.ifnot)),a=v.utils.unwrapObservable(l.data)),"foreach"in l){var d=c&&l.foreach||[];p=v.renderTemplateForEach(s||e,d,l,e,i)}else if(c){var h="data"in l?i.createChildContext(a,l.as):i;p=v.renderTemplate(s||e,h,l,e)}else v.virtualElements.emptyNode(e);o(e,p)}},v.expressionRewriting.bindingRewriteValidators.template=function(e){var t=v.expressionRewriting.parseObjectLiteral(e);return 1==t.length&&t[0].unknown?null:v.expressionRewriting.keyValueArrayContainsKey(t,"name")?null:"This template engine does not support anonymous templates nested within its templates"},v.virtualElements.allowedBindings.template=!0}(),v.exportSymbol("setTemplateEngine",v.setTemplateEngine),v.exportSymbol("renderTemplate",v.renderTemplate),v.utils.findMovesInArrayComparison=function(e,t,n){if(e.length&&t.length){var r,i,o,a,s;for(r=i=0;(!n||r0&&(v.utils.replaceDomNodes(o,a),r&&v.dependencyDetection.ignore(r,null,[n,a,i])),o.length=0,v.utils.arrayPushAll(o,a)},null,{disposeWhenNodeIsRemoved:e,disposeWhen:function(){return!v.utils.anyDomNodeIsAttachedToDocument(o)}});return{mappedNodes:o,dependentObservable:a.isActive()?a:s}}var t=v.utils.domData.nextKey(),n=v.utils.domData.nextKey();v.utils.setDomNodeChildrenFromArrayMapping=function(r,i,o,a,u){function l(e,t){p=m[t],C!==t&&(T[e]=p),p.indexObservable(C++),v.utils.fixUpContinuousNodeArray(p.mappedNodes,r),b.push(p),P.push(p)}function c(e,t){if(e)for(var n=0,r=t.length;n=0)return 2}catch(e){}return 1}();this.renderTemplateSource=function(n,r,i,o){o=o||l,i=i||{},e();var a=n.data("precompiled");if(!a){var s=n.text()||"";s="{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}",a=p.template(null,s),n.data("precompiled",a)}var u=[r.$data],c=p.extend({koBindingContext:r},i.templateOptions),d=t(a,u,c);return d.appendTo(o.createElement("div")),p.fragments={},d},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){l.write("