@syncfusion/ej2-form-renderer 34.2.3 → 34.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,2 @@
1
- /*!
2
- * filename: ej2-form-renderer.umd.min.js
3
- * version : 34.2.3
4
- * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-image-editor"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-grids")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-navigations","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-notifications","@syncfusion/ej2-image-editor","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-data","@syncfusion/ej2-grids"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Navigations,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Splitbuttons,e.ej2Dropdowns,e.ej2Calendars,e.ej2Notifications,e.ej2ImageEditor,e.ej2Richtexteditor,e.ej2Data,e.ej2Grids)}(this,function(e,_,N,S,q,z,Q,W,H,X,ee,G,h,r){"use strict";t.evaluateCondition=function(e,t){try{return"field"in e&&"operator"in e&&"value"in e?this.evaluateSimpleRule(e,t):"condition"in e&&"rules"in e&&this.evaluateCompositeRule(e,t)}catch(e){return!1}},t.evaluateSimpleRule=function(e,t){try{var n=t[e.field],a=e.operator.toLowerCase();if(void 0===n)if(-1===["equal","equals","notequal","notequals","isempty","isnotempty"].indexOf(a))return!1;var i=Array.isArray(n),r=new _.Internationalization;switch(a){case"equal":case"equals":return n===e.value;case"notequal":case"notequals":return n!==e.value;case"startswith":return n.startsWith(e.value);case"doesnotstartswith":return!n.startsWith(e.value);case"greaterthan":case"lessthan":case"greaterthanorequal":case"lessthanorequal":var o=Number(n),s=Number(e.value);return Number.isNaN(o)||Number.isNaN(s)?!1:"greaterthan"===a?s<o:"lessthan"===a?o<s:"greaterthanorequal"===a?s<=o:o<=s;case"dategreaterthan":case"datelessthan":var l=r.parseDate(n,{format:"MM/dd/yyyy"}),c=r.parseDate(e.value,{format:"MM/dd/yyyy"});return null!==l&&null!==c?"dategreaterthan"===a?c<l:"datelessthan"===a?l<c:l<=c:!1;case"timegreaterthan":case"timelessthan":var d=r.parseDate(n,{format:"hh:mm a",type:"time"}),u=r.parseDate(e.value,{format:"hh:mm a",type:"time"});if(null!==d&&null!==u){if("timegreaterthan"===a)return u<d;if("timelessthan"===a)return d<u}return!1;case"datetimegreaterthan":case"datetimelessthan":var p=r.parseDate(n,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"}),h=r.parseDate(e.value,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"});if(null!==p&&null!==h){if("datetimegreaterthan"===a)return h<p;if("datetimelessthan"===a)return p<h}return!1;case"contains":return i?"string"==typeof e.value&&-1!==e.value.indexOf(",")?e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1!==n.indexOf(e.value):-1!==String(n).indexOf(String(e.value));case"notcontains":return i?"string"==typeof e.value&&-1!==e.value.indexOf(",")?!e.value.split(",").map(function(e){return e.trim()}).some(function(e){return-1!==n.indexOf(e)}):-1===n.indexOf(e.value):-1===String(n).indexOf(String(e.value));case"isempty":return i?0===n.length:!n||0===String(n).length;case"isnotempty":return i?0<n.length:!!n&&0<String(n).length;default:return!1}}catch(e){return!1}},t.evaluateCompositeRule=function(e,t){var n,a=this;try{return Array.isArray(e.rules)&&0!==e.rules.length?"and"===(n=e.condition.toLowerCase())?e.rules.every(function(e){return a.evaluateCondition(e,t)}):"or"===n&&e.rules.some(function(e){return a.evaluateCondition(e,t)}):!1}catch(e){return!1}},t.isFieldVisible=function(e,t){try{return e&&e.visibleWhen?this.evaluateCondition(e.visibleWhen,t):!0}catch(e){return!0}},t.isFieldReadOnly=function(e,t){try{return e&&e.readOnlyWhen?this.evaluateCondition(e.readOnlyWhen,t):!1}catch(e){return!1}},t.isFieldDisabled=function(e,t){try{return e&&e.disabledWhen?this.evaluateCondition(e.disabledWhen,t):!1}catch(e){return!1}},t.isFieldHidden=function(e,t){try{return e&&e.hideWhen?this.evaluateCondition(e.hideWhen,t):!1}catch(e){return!1}},t.isFieldRequired=function(e,t){try{return e&&e.requiredWhen?this.evaluateCondition(e.requiredWhen,t):!1}catch(e){return!1}},t.getConditionalValue=function(e,t){try{return e&&e.setValueWhen?this.evaluateCondition(e.setValueWhen.condition,t)?e.setValueWhen.value:void 0:void 0}catch(e){}},t.evaluateConditionalDataRules=function(e,t){if(e&&Array.isArray(e))for(var n=0;n<e.length;n++){var a=e[n];if(this.evaluateCondition(a.condition,t))return n}return-1},t.getChoiceBasedOptions=function(e,t,n,a){try{var i,r=n&&n[a];return null==r?e.showAllWhenNotMapped?t:[]:(i=String(r))in e.choiceMapping?e.choiceMapping[i].filter(function(e){return-1!==t.indexOf(e)}):e.showAllWhenNotMapped?t:[]}catch(e){return t}};var $=t;function t(){}var c=function(){return(c=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},d=function(e){return e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random())};function E(t){for(var o=new Map,e=0,n=Object.keys(t.properties);e<n.length;e++){var a=n[e];o.set(a,t.properties[a])}function s(e){for(var r=[],t=function(e){if("field"===e.type){var t=e;if(l.has(t.propertyId))return"continue";l.add(t.propertyId);var n=o.get(t.propertyId);n?r.push(T(n)):(n={id:t.propertyId||d("textbox"),name:""+"_"+Math.floor(1e3*Math.random()),type:"textbox",label:"Unknown Field",_configured:!0},r.push(n))}else{var a,i;"table"===e.type?(a=c({id:(t=e).id||d("table"),name:t.name,type:"table",label:t.label||"Table",cssClass:t.cssClass,hideBorders:t.hideBorders,rows:t.rows,columns:t.cols,columnWidths:t.columnWidths,tableCells:[],_configured:!0},t.conditions?{conditions:t.conditions}:{}),t.cells.forEach(function(e){var t=[];e.forEach(function(e){e=s(e.children);t.push(e)}),a.tableCells.push(t)}),r.push(a)):"panel"===e.type?(t=c({id:(n=e).id||d("panel"),type:"panel",name:n.name,cssClass:n.cssClass,hideBorders:n.hideBorders,hideLabel:n.hideLabel,label:n.label||"Panel",children:s(n.children),_configured:!0},n.conditions?{conditions:n.conditions}:{}),r.push(t)):"tabs"===e.type?(i=c({id:(n=e).id||d("tabs"),type:"tabs",name:n.name,label:n.label||"Tabs",cssClass:n.cssClass,tabOptions:n.tabOptions,tabItems:[],_configured:!0},n.conditions?{conditions:n.conditions}:{}),n.tabs.forEach(function(e){i.tabItems.push({header:e.header,content:s(e.children)})}),r.push(i)):"card"===e.type&&(n=c({id:(t=e).id||d("card"),type:"card",name:t.name,label:t.label||"Card",cssClass:t.cssClass,hideLabel:t.hideLabel,children:s(t.children),_configured:!0},t.conditions?{conditions:t.conditions}:{}),void 0!==t.cardTitle&&(n.cardTitle=t.cardTitle),void 0!==t.cardSubtitle&&(n.cardSubtitle=t.cardSubtitle),r.push(n))}},n=0,a=e;n<a.length;n++)t(a[n]);return r}var i,l=new Set;return i=t.layout&&0!==t.layout.length?s(t.layout):Object.keys(t.properties).map(function(e){return T(t.properties[e])}),c({version:t.version,components:i},t.settings?{settings:t.settings}:{})}function T(t){var e=void 0!==t.options&&0<t.options.length,n={id:t.id||d(t.widget||A(t.type,t.format,e)),name:t.name,type:t.widget||A(t.type,t.format,e),label:t.label||t.id},a=new Set(["id","type","name","label","format","widget","defaultValue","required","options","expressionValue","minLength","maxLength","minimum","maximum","minValue","maxValue","minDate","maxDate","minTime","maxTime","regex","pattern","content","buttonType","textboxType"]);return Object.keys(t).forEach(function(e){a.has(e)||"id"===e||"name"===e||"type"===e||"label"===e||(n[e]=t[e])}),void 0!==t.defaultValue&&(n.defaultValue=t.defaultValue),void 0!==t.expressionValue&&(n.expressionValue=t.expressionValue),void 0!==t.required&&(n.required=t.required),void 0!==t.content&&(n.content=t.content),void 0!==t.buttonType&&(n.buttonType=t.buttonType),void 0!==t.textboxType&&(n.textboxType=t.textboxType),void 0!==t.options&&(n.options=t.options),void 0!==t.minLength&&(n.minLength=t.minLength),void 0!==t.maxLength&&(n.maxLength=t.maxLength),void 0!==t.minValue&&(n.minValue=t.minValue),void 0!==t.maxValue&&(n.maxValue=t.maxValue),void 0!==t.minDate&&(n.minDate=t.minDate),void 0!==t.maxDate&&(n.maxDate=t.maxDate),void 0!==t.minTime&&(n.minTime=t.minTime),void 0!==t.maxTime&&(n.maxTime=t.maxTime),void 0!==t.pattern&&(n.regex=t.pattern),n}function A(e,t,n){return"string"===e?"date"===t?"date":"date-time"===t?"dateTime":"time"===t?"time":"email"===t?"email":"url"===t?"url":n?"dropdown":"textbox":"number"===e?"number":"boolean"===e?"checkbox":"array"===e?"multiselect":"button"===e?"button":"message"===e?"message":"sign"===e?"signature":"image"===e?"imageEditor":"file"===e?"fileUpload":"color"===e?"colorPicker":"grid"===e?"dataGrid":"textbox"}n.prototype.setAvailableFields=function(e){var t=this;this.availableFields.clear(),e.forEach(function(e){t.availableFields.set(e.name,e)})},n.prototype.validateFieldOperations=function(e){var t=[];if(0!==this.availableFields.size)for(var n=["-","*","/","%","^"],a=["-","*","/","%","^","+"],i=new Set,r=/(\{[^}]+\})/g;null!==(u=r.exec(e));){var o,s,l,c,d,u,p,h,m=u[0],f=m.slice(1,-1),y=this.availableFields.get(f);y&&(m=(u=u.index)+m.length,p=e.substring(Math.max(0,u-10),u),o=e.substring(m,Math.min(e.length,m+10)),s=p.replace(/\s+$/,"").slice(-1),l=o.replace(/^\s+/,"").charAt(0),c=p.replace(/\s+$/,""),d=o.replace(/^\s+/,""),u=u-(p.length-c.length)-1,p=m+(o.length-d.length),"string"!==y.type||y.format||(s&&-1!==n.indexOf(s)&&!i.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on string field '{"+f+"}'"),i.add(h)),!l)||-1===n.indexOf(l)||i.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on string field '{"+f+"}'"),i.add(h)),"date"!==y.format&&"date-time"!==y.format&&"time"!==y.format||(s&&-1!==a.indexOf(s)&&!i.has(h=u+":"+s)&&(t.push("Cannot perform '"+s+"' operation on date field '{"+f+"}'"),i.add(h)),!l)||-1===a.indexOf(l)||i.has(h=p+":"+l)||(t.push("Cannot perform '"+l+"' operation on date field '{"+f+"}'"),i.add(h)))}return t},n.prototype.validate=function(e){var t=[];if(!e||""===e.trim())return{valid:!0,errors:[]};(e.match(/\{/g)||[]).length!==(e.match(/\}/g)||[]).length&&t.push("Unbalanced braces in expression");(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length&&t.push("Unbalanced parentheses in expression");for(var n=/(\w+)\s*\(/g;null!==(a=n.exec(e));){var a=a[1].toUpperCase();a===a.toUpperCase()&&-1===this.supportedFunctions.indexOf(a)&&t.push("Unknown function: "+a)}var i=this.validateFieldOperations(e);return t.push.apply(t,i),{valid:0===t.length,errors:t}},n.prototype.compile=function(e,t){void 0===t&&(t={});try{var n;return t.availableFields&&Array.isArray(t.availableFields)&&this.setAvailableFields(t.availableFields),this.validate(e).valid?(n=e,n=this.compileFieldReferences(e),n=t.isCustomValidation?this.compileInputReferences(n):n,n=this.compileBareFunctionCalls(n),n=this.compileMatrixExpressions(n),function(e){try{return new Function("context","\n try {\n return "+n+";\n } catch (e) {\n return null;\n }\n ")(e)}catch(e){return null}}):function(){return null}}catch(e){return function(){return null}}},n.prototype.compileMatrixExpressions=function(e){var a=["PI","TRUE","FALSE","NULL","UNDEFINED","Math"],i=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"];return e.replace(/\$?\{([^}]+)\}/g,function(e,t){var n=t;return i.forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),a.forEach(function(e){var t=new RegExp("\\b"+e+"\\b","g");n=n.replace(t,"context."+e)}),"("+n+")"})},n.prototype.compileBareFunctionCalls=function(e){var n=e;return["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"].forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");n=n.replace(t,"context."+e)}),n},n.prototype.compileFieldReferences=function(e){return e.replace(/\{([^{}]+)\}/g,function(e,t){return t.startsWith("\\")&&t.endsWith("\\")?e:"context['"+t.replace(/\./g,"'].[")+"']"})},n.prototype.compileInputReferences=function(e){var t=[],n=e=(e=(e=e.replace(/(['"`])(?:(?=(\\?))\2.)*?\1/g,function(e){return t.push(e),"__STRING_"+(t.length-1)+"__"})).replace(/(?<!context\[')\binput\./g,"context['input'].")).replace(/(?<!context\[')\binput\b(?!\s*[(\.])/g,"context['input']");return t.forEach(function(e,t){n=n.replace("__STRING_"+t+"__",e)}),n};var D=n;function n(){this.supportedFunctions=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS","INCLUDES","CONTAINS","ISNAN","SUPPORTEDVALUESOF","TOSTRING","DATE","GETTIME","EVERY","SOME"],this.availableFields=new Map}a.prototype.extractFieldReferences=function(e){if(!e)return[];for(var t,n=new Set,a=e.replace(this.escapedBracePattern,""),i=/\{([^{}]+)\}/g;null!==(t=i.exec(a));){var r=t[1].trim();this.isFunctionCall(r)||this.isOperator(r)||(r=r.split(/[.\[\]]/)[0].trim())&&!this.isKeyword(r)&&n.add(r)}for(var o=/\$\{([^}]+)\}/g;null!==(t=o.exec(a));)for(var s=t[1],l=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b(?!\s*[(\.])/g;null!==(c=l.exec(s));){var c=c[1];this.isKeyword(c)||"Math"===c||n.add(c)}return Array.from(n)},a.prototype.buildGraph=function(e){for(var t={},n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],r=this.extractFieldReferences(e[i]);t[i]=r}return t},a.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,c=[],d=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,a=o[e]||[];n<a.length;n++){var i,r=a[n];s.has(r)?l.has(r)&&(i=t.indexOf(r),c.push(t.slice(i).concat([r]))):d(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||d(n,[])}return c},a.prototype.getTopologicalOrder=function(i){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=i[e]||[];t<n.length;t++){var a=n[t];i[a]&&s(a)}o.push(e)}},e=0,t=Object.keys(i);e<t.length;e++){var n=t[e];s(n)}return o},a.prototype.isFunctionCall=function(e){return/^\w+\s*\(/.test(e)},a.prototype.isOperator=function(e){return/^[+\-*/()=!<>&|]/.test(e)},a.prototype.isKeyword=function(e){return-1!==["PI","TRUE","FALSE","NULL","UNDEFINED","and","or","in"].indexOf(e.toUpperCase())};var V=a;function a(){this.escapedBracePattern=/\\{.*?\\}/g}var O=function(){return(O=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=(o.prototype.evaluate=function(e,t,n,a){void 0===n&&(n={}),void 0===a&&(a=!1);try{if(!e||""===e.trim())return null;var i=n.timeout,r=void 0===i?5e3:i,o=n.maxDepth,s=void 0===o?10:o,l=n.locale,c=void 0===l?"en-US":l,d=n.throwOnError,u=void 0!==d&&d,p=this.getCacheKey(e,t);if(!a&&this.evaluationCache.has(p))return this.evaluationCache.get(p);var h=this.compiledFunctions.get(e),m=(h||(h=this.parser.compile(e,{timeout:r,maxDepth:s,locale:c,isCustomValidation:a}),this.compiledFunctions.set(e,h)),this.buildContext(t)),f=Date.now(),y=h(m);if(Date.now()-f>r){var v=new Error("Expression evaluation exceeded timeout of "+r+"ms");if(u)throw v;return null}return this.evaluationCache.set(p,y),y}catch(v){if(n.throwOnError)throw v;return null}},o.prototype.extractDependencies=function(e){return e?this.dependencyTracker.extractFieldReferences(e):[]},o.prototype.buildDependencyGraph=function(e){var n=this,a={};return e.forEach(function(e){var t;e.expressionValue&&(t=n.extractDependencies(e.expressionValue),a[e.name]=t)}),a},o.prototype.detectCircularDependencies=function(o){for(var s=new Set,l=new Set,c=[],d=function(e,t){s.add(e),l.add(e),t.push(e);for(var n=0,a=o[e]||[];n<a.length;n++){var i,r=a[n];s.has(r)?l.has(r)&&(i=t.indexOf(r),c.push(t.slice(i).concat([r]))):d(r,t.slice())}l.delete(e)},e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];s.has(n)||d(n,[])}return c},o.prototype.getTopologicalOrder=function(i){for(var r=new Set,o=[],s=function(e){if(!r.has(e)){r.add(e);for(var t=0,n=i[e]||[];t<n.length;t++){var a=n[t];s(a)}o.push(e)}},e=0,t=Object.keys(i);e<t.length;e++){var n=t[e];s(n)}return o},o.prototype.clearCache=function(){this.evaluationCache.clear(),this.compiledFunctions.clear()},o.prototype.getCacheKey=function(e,t){return e+":"+JSON.stringify(t)},o.prototype.buildContext=function(e){var n=new _.Internationalization,a=n.getDateFormat({format:"MM/dd/yyyy",type:"date"});return O({},e,{PI:Math.PI,TRUE:!0,FALSE:!1,NULL:null,UNDEFINED:void 0,Math:Math,SUM:function(e){return Array.isArray(e)?e.reduce(function(e,t){return Number(e)+Number(t)},0):0},AVG:function(e){return Array.isArray(e)&&0!==e.length?e.reduce(function(e,t){return Number(e)+Number(t)},0)/e.length:0},MIN:function(e){return Array.isArray(e)&&0<e.length?Math.min.apply(Math,e.map(Number)):0},MAX:function(e){return Array.isArray(e)&&0<e.length?Math.max.apply(Math,e.map(Number)):0},COUNT:function(e){return Array.isArray(e)?e.length:0},ROUND:function(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},FLOOR:Math.floor,CEIL:Math.ceil,ABS:Math.abs,SQRT:Math.sqrt,UPPER:function(e){return String(e).toUpperCase()},LOWER:function(e){return String(e).toLowerCase()},CONCAT:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map(String).join("")},LENGTH:function(e){return String(e).length},TRIM:function(e){return String(e).trim()},SUBSTRING:function(e,t,n){return void 0!==n?String(e).substr(t,n):String(e).substr(t)},TODAY:function(){return a(new Date)},AGE:function(e){var e="string"==typeof e?new Date(e):e,t=new Date,n=t.getFullYear()-e.getFullYear(),a=t.getMonth()-e.getMonth();return(a<0||0==a&&t.getDate()<e.getDate())&&n--,n},DATEFORMAT:function(e,t){e="string"==typeof e?new Date(e):e;return n.getDateFormat({format:t,type:"date"})(e)},DATEDIFF:function(e,t){e="string"==typeof e?new Date(e):e,t="string"==typeof t?new Date(t):t;return Math.floor((t.getTime()-e.getTime())/864e5)},ADDDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()+Number(t)),a(e)},SUBDAYS:function(e,t){e=new Date(e);return e.setDate(e.getDate()-Number(t)),a(e)}})},o);function o(){this.evaluationCache=new Map,this.compiledFunctions=new Map,this.parser=new D,this.dependencyTracker=new V}function te(e){return{primary:"e-primary",flat:"e-flat",information:"e-info",error:"e-danger",success:"e-success",warning:"e-warning"}[e||"primary"]||"e-primary"}function ne(e){return"submit"===e||"reset"===e?e:"button"}function ae(e){return{Left:"flex-start",Right:"flex-end",Center:"center"}[e||"Left"]||"flex-start"}var u={EMAIL:/^(?!.*\.\.)[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,URL:/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/[^\s]*)?$/,DATE_ISO:/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/,DIGITS:/^[0-9]*$/,PHONE:/^[+]?[0-9]{9,13}$/,CREDIT_CARD:/^\d{13,16}$/};function I(t,e){function n(e){e.forEach(function(e){e.name&&e.id in t&&(a[e.name]=t[e.id]),e.children&&n(e.children),e.tabItems&&e.tabItems.forEach(function(e){return e.content&&n(e.content)}),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(n)})})}var a={};return n(e),a}function R(t,e,n){if("string"!=typeof t||!/{[^}]+}/.test(t))return t;n=n?I(e,n):e;try{var a=M.evaluate(t,n);return null!=a?String(a):""}catch(e){return t}}function J(e,t,n){return e&&"object"==typeof e&&!Array.isArray(e)&&"lookup"===e.type&&n?n&&0<n.length?n:[]:e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type?0<t.length?t:[]:Array.isArray(e)?e:e&&"object"==typeof e&&!Array.isArray(e)&&"raw"===e.type&&Array.isArray(e.data)?e.data:[]}var M=new i;j.fetch=function(e,c,d,u){var p;return e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type&&e.url?(p=e,new Promise(function(t){try{var e,n,a,i={},r=(p.headers&&Array.isArray(p.headers)&&p.headers.forEach(function(e){e.key&&e.key.trim()&&(i[e.key]=e.value)}),new h.DataManager({url:p.url,adaptor:function(e){switch(e){case"WebApiAdaptor":return new h.WebApiAdaptor;case"ODataV4Adaptor":return new h.ODataV4Adaptor;default:return new h.UrlAdaptor}}(p.adaptorType),headers:Object.keys(i).length?i:void 0})),o=new h.Query,s=(p.search&&p.search.enabled&&p.search.fields&&0<p.search.fields.length&&(e=p.search.key||"search",n=d?R(e,d,u):/[{}]/.test(e)?"":e,o=o.search(n,p.search.fields)),p.sort&&p.sort.enabled&&p.sort.field&&(a="descending"===p.sort.direction?"descending":"ascending",o=o.sortBy(p.sort.field,a)),p.filters&&Array.isArray(p.filters)&&0<p.filters.length&&p.filters.forEach(function(e){var t;e.field&&e.operator&&void 0!==e.value&&""!==e.value&&""!==(t=d?R(e.value,d,u):/[{}]/.test(e.value)?"":e.value)&&(o=o.where(e.field,e.operator,t))}),p.queryParams&&Object.keys(p.queryParams).forEach(function(e){o=o.addParams(e,p.queryParams[e])}),p.skip&&(o=o.skip(p.skip)),p.take&&(o=o.take(p.take)),!1),l=setTimeout(function(){s=!0,t({id:c,options:[]})},15e3);r.executeQuery(o).then(function(e){s||(clearTimeout(l),e=e.result,p.dataPath&&(e=function(e,t){if(!t||null==e)return e;for(var n=e,a=0,i=t.split(/\.(?![^\[]*\])/);a<i.length;a++){var r=i[a];if(null==n)return null;var o,s=r.match(/^(\w*)\[(\d+)\]$/);n=s?(o=s[1],s=parseInt(s[2]),o?n[o]&&n[o][s]:n[s]):n[r]}return n}(e,p.dataPath)),e=Array.isArray(e)?e:"string"==typeof e?[e]:[],t({id:c,options:e}))}).catch(function(e){s||(clearTimeout(l),t({id:c,options:[]}))})}catch(e){t({id:c,options:[]})}})):Promise.resolve({id:c,options:[]})};var Y=j;function j(){}s.prototype.getSelectedItems=function(){var e=this.formState?this.formState.values[this.component.id]:_.isNullOrUndefined(this.valueProp())?this.component.defaultValue:this.valueProp();return Array.isArray(e)?e:[]},s.prototype.valueProp=function(){return this._value},s.prototype.setValue=function(e){this._value=e},s.prototype.handleCheckboxChange=function(t,e){var n=this.getSelectedItems(),e=e?n.concat([t]):n.filter(function(e){return e!==t});this.formState&&this.onChangeCb(e)},Object.defineProperty(s.prototype,"sizeCssClass",{get:function(){return(this.component.cssClass||"")+("Small"===this.component.size?" e-small":"Bigger"===this.component.size?" e-bigger":"")},enumerable:!0,configurable:!0}),s.prototype.render=function(e){var i=this,r=this.component,t=r.label&&r.required?r.label+" *":r.label||"",e=e||this.target,n=document.createElement("div"),o=(n.className=("checkbox-group "+(r.cssClass||"")).trim(),n.setAttribute("role","group"),n.setAttribute("aria-label",t),n.title=r.tooltip||"",(t=r.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{}),t=(Object.keys(o).forEach(function(e){"class"!==e&&"className"!==e&&"style"!==e&&n.setAttribute(e,String(o[e]))}),"display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";gap:"+(r.gap||"8px")+";align-items:flex-start;"),s=(n.setAttribute("style",t),document.createElement("div")),t=(s.className="checkbox-group-items","display:flex;flex-direction:"+("row"===r.layoutDirection?"row":"column")+";flex-wrap:wrap;gap:"+(r.gap||"2px")+";width:100%;"),t=(s.setAttribute("style",t),Array.isArray(r.options)?r.options:["Option 1"]),l=this.getSelectedItems();return t.forEach(function(e,t){var n="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,e="string"==typeof e?e:null!=e.label?e.label:null!=e.value?e.value:String(n),a=document.createElement("input"),e=(s.appendChild(a),new z.CheckBox({label:e,enableRtl:i.enableRtl,checked:-1!==l.indexOf(n),disabled:!!r.disabled,labelPosition:r.checkboxLabelPosition||"After",cssClass:i.sizeCssClass.trim(),htmlAttributes:o,change:function(e){i.handleCheckboxChange(n,e.checked)}})),a=(e.appendTo(a),i.ref(e,t),a.querySelector('input[type="checkbox"]'));a&&(a.id=i.component.id+"_"+t),i.optionRef&&i.optionRef(e,t),i.checkboxes.push(e)}),n.appendChild(s),e&&e.appendChild(n),this.container=n,this.itemsContainer=s,n},s.prototype.refreshSelection=function(){var n=this,a=this.getSelectedItems();(Array.isArray(this.component.options)?this.component.options:["Option 1"]).forEach(function(e,t){e="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,t=n.checkboxes[t];t&&(t.checked=-1!==a.indexOf(e))})},s.prototype.destroy=function(){for(var e=0,t=this.checkboxes;e<t.length;e++){var n=t[e];try{n.destroy()}catch(e){}}this.checkboxes=[],this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.itemsContainer=null},s.prototype.setOptions=function(e){var i=this;if(this.component.options=e,this.itemsContainer){for(var t=0,n=this.checkboxes;t<n.length;t++){var a=n[t];try{a.destroy()}catch(e){}}for(this.checkboxes=[];this.itemsContainer.firstChild;)this.itemsContainer.removeChild(this.itemsContainer.firstChild);var r=this.getSelectedItems();e.forEach(function(e,t){var n="string"==typeof e?e:e.value||e.label||e.key,e="string"==typeof e?e:e.label||e.value||String(n),a=document.createElement("input"),e=(i.itemsContainer.appendChild(a),new z.CheckBox({label:e,enableRtl:i.enableRtl,checked:-1!==r.indexOf(n),disabled:!!i.component.disabled,labelPosition:i.component.checkboxLabelPosition||"After",cssClass:i.sizeCssClass.trim(),change:function(e){i.handleCheckboxChange(n,e.checked)}})),a=(e.appendTo(a),i.ref(e,t),a.querySelector('input[type="checkbox"]'));a&&(a.id=i.component.id+"_"+t),i.optionRef&&i.optionRef(e,t),i.checkboxes.push(e)})}};var ie=s;function s(e){this.checkboxes=[],this.component=e.component,this.formState=e.formState,this.onChangeCb=e.onChange,this.optionRef=e.optionRef,this.enableRtl=e.enableRtl,this.target=e.target,this.container=null,this.itemsContainer=null,this.ref=e.ref}var L=function(){return(L=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},P=(l.prototype.parseColumnValue=function(e,t){var n;return null==e||""===e?e:"number"===t?(n=parseFloat(String(e)),isNaN(n)?0:n):"boolean"!==t||"boolean"==typeof e?e:"true"===e||"1"===e||1===e||!0===e},l.prototype.evaluateRowExpressions=function(e,a){for(var i=this,r=L({},e),e=a.filter(function(e){return e.expression&&e.expression.toString().trim()}),o=this,t=0,n=e;t<n.length;t++)!function(t){if(!t.expression)return;try{var n={},e=(a.forEach(function(e){var t=r[e.field];n[e.field]=i.parseColumnValue(t,e.type)}),o.engine.evaluate(t.expression,n,{throwOnError:!1}));r[t.field]=e}catch(e){r[t.field]=null}}(n[t]);return r},l.prototype.extractCalculatedColumns=function(e){return e.filter(function(e){return e.expression&&e.expression.toString().trim()})},l.prototype.getEngine=function(){return this.engine},l);function l(){this.engine=new i}var B=function(){return(B=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},U=(p.prototype.validate=function(e,t,n){if(!e||""===e.trim())return!0;try{var a,i,r=B({},n,{input:t,valid:!0}),o=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*['"](.+?)['"]\s*$/);return o?(a=o[1].trim(),i=o[2],!0===this.expressionEngine.evaluate(a,r,{throwOnError:!1},!0)||i):"Invalid validation expression format"}catch(e){return"Validation expression error"}},p.prototype.extractDependencies=function(e){var t;return e?(t=(t=e.match(/valid\s*=\s*(.+)/))?t[1]:e,this.expressionEngine.extractDependencies(t).filter(function(e){return"input"!==e})):[]},p.prototype.validateConditionSyntax=function(e,t){if(!e||""===e.trim())return["Condition cannot be empty"];var n=[],a=(e.match(/\(/g)||[]).length,i=(e.match(/\)/g)||[]).length,a=(a!==i&&n.push("Unbalanced parentheses ("+a+" open, "+i+" close)"),(e.match(/\{/g)||[]).length),i=(e.match(/\}/g)||[]).length;a!==i&&n.push("Unbalanced braces ("+a+" open, "+i+" close)");a=this.extractDependencies(e).filter(function(e){return-1===t.indexOf(e)});return 0<a.length&&n.push("Unknown field references: "+a.join(", ")),n},p.prototype.buildExpression=function(e,t){return"valid = "+e.trim()+" ? true : '"+t.replace(/'/g,"\\'")+"'"},p.prototype.parseExpression=function(e){e=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*'(.+)'/);return e?{condition:e[1].trim(),errorMessage:e[2].replace(/\\'/g,"'")}:null},p);function p(){this.expressionEngine=new i}var m=function(){return(m=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},re=(Object.defineProperty(f.prototype,"calculatedColumns",{get:function(){return this.gridExpressions.extractCalculatedColumns(this.columns)},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"hasExpressions",{get:function(){return 0<this.calculatedColumns.length},enumerable:!0,configurable:!0}),f.prototype.buildToolbar=function(){var e=[];return this.allowAdding&&e.push("Add"),this.allowEditing&&e.push("Edit"),this.allowDeleting&&e.push("Delete"),e.push("Update","Cancel"),e},f.prototype.mapColumn=function(e){var t,n=e.validationRules?m({},e.validationRules):{},a=this.mapCustomValidationToSyncfusion(e);return a&&(t=e.customValidation&&e.customValidation[0]&&e.customValidation[0].expression&&(this.validationEngine.parseExpression?this.validationEngine.parseExpression(e.customValidation[0].expression).errorMessage:"Validation failed")||"Validation failed",n.required=[!0,t],n.custom=[a,t]),{field:e.field,headerText:e.headerText,type:e.type||"string",isPrimaryKey:e.isPrimaryKey||!1,width:e.width,format:"date"===e.type?e.format||"MM/dd/yyyy":e.format,editType:e.editType,allowEditing:!1!==e.allowEditing&&!e.expression,validationRules:n,edit:this.createEditParams(e)}},f.prototype.render=function(e){var n=this,t=Array.isArray(this.dataSource)?this.dataSource:[],t=(this.hasExpressions&&0<t.length?this.currentData=t.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return m({},e,t)}):this.currentData=t,document.createElement("div")),a=(t.className="datagrid-wrapper",t.style.width="string"==typeof this.width?this.width:this.width+"px",t.style.height="auto",document.createElement("div")),i=(a.className="datagrid-grid",t.appendChild(a),this.id&&(a.id=this.id),new r.Grid({dataSource:this.currentData,allowPaging:this.allowPaging,filterSettings:{mode:"Immediate"},pageSettings:{pageSize:this.pageSize},editSettings:{allowEditing:this.allowEditing,allowAdding:this.allowAdding,allowDeleting:this.allowDeleting,mode:"Normal"},enableRtl:this.enableRtl,locale:this.locale||"en-US",cssClass:this.cssClass,toolbar:this.buildToolbar(),actionComplete:this.handleActionComplete,height:"string"==typeof this.height?this.height:this.height+"px",width:"string"==typeof this.width?this.width:this.width+"px",allowSorting:!0,allowFiltering:this.allowFiltering,allowSelection:!0,columns:(this.columns||[]).map(function(e){return n.mapColumn(e)})}));return i.appendTo(a),this.ref(i),this.grid=i,e&&e.appendChild(t),this.wrapper=t},f.prototype.getRef=function(){var e=this;return{getGridData:function(){return e.currentData},gridRef:{current:this.grid}}},f.prototype.getGridData=function(){return this.currentData},f.prototype.setDataSource=function(e){var n=this;this.grid&&(e=Array.isArray(e)?e:[],this.hasExpressions&&0<e.length?this.currentData=e.map(function(e){var t=n.gridExpressions.evaluateRowExpressions(e,n.columns);return m({},e,t)}):this.currentData=e,this.grid.dataSource=this.currentData,this.grid.refreshBatchData?this.grid.setProperties({dataSource:this.currentData},!0):this.grid.dataSource=this.currentData,this.grid.refresh)&&this.grid.refresh()},f.prototype.setColumns=function(e){this.grid&&(e&&0!==e.length?0===this.grid.columns.length&&e&&1===e.length&&(this.grid.columns=e):this.grid.columns=[],this.columns=e,this.grid.refresh)&&!this.isPreviewMode&&(this.dataSource&&Array.isArray(this.dataSource)&&0<this.dataSource.length&&!this.hasExpressions&&(this.grid.dataSource=this.dataSource),this.grid.refresh())},f.prototype.destroy=function(){if(this.grid){try{this.grid.destroy()}catch(e){}this.grid=null}this.wrapper&&this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper),this.wrapper=null,this.gridExpressions=null,this.validationEngine=null,this.currentData=[],this.columns=[],this.dataSource=[]},f);function f(e){var l=this;this.grid=null,this.wrapper=null,this.mapCustomValidationToSyncfusion=function(s){if(s.customValidation&&0!==s.customValidation.length)return function(e){var n=l.grid&&l.grid.editModule?l.grid.editModule.formObj:null;if(n){var a={};(l.columns||[]).forEach(function(e){var t=n.getInputElement(e.field);t&&(t=t.value,a[e.field]="number"===e.type?parseInt(t,10):t)});for(var t=0,i=s.customValidation;t<i.length;t++){var r,o=i[t];if(o.expression)return r="number"===s.type?parseInt(e.value,10):e.value,!0===l.validationEngine.validate(o.expression,r,a)}}return!0}},this.createEditParams=function(t){if(l.hasExpressions){var n=l.calculatedColumns;if(n.some(function(e){return!!e.expression&&-1!==e.expression.indexOf("{"+t.field+"}")}))return{params:{change:function(){var e,o;l.grid&&l.grid.element&&(e=l.grid.element.querySelector("form"))&&e.ej2_instances&&e.ej2_instances[0]&&(o=e.ej2_instances[0],n.forEach(function(e){var t=o.getInputElement(e.field);if(t)try{var n={};l.columns.forEach(function(e){var t=o.getInputElement(e.field);t&&(n[e.field]=t.value)});var a,i,r=l.gridExpressions.evaluateRowExpressions(n,l.columns)[e.field];null!=r&&("boolean"===e.type?t.checked=!!r:"number"===e.type?(i=(a=t.closest(".e-control-wrapper"))?a.querySelector('input.e-control:not([type="hidden"])'):null)&&i.ej2_instances&&i.ej2_instances[0]?i.ej2_instances[0].value=r:t.value=r:"date"===e.type?t.ej2_instances[0].value=new Date(r):t.value=r)}catch(e){}}))}}}}},this.handleActionComplete=function(e){var t;if(l.grid)switch(e.requestType){case"save":case"delete":case"add":l.grid.dataSource&&(t=Array.isArray(l.grid.dataSource)?l.grid.dataSource:[],l.currentData=t,l.onDataChange)&&l.onDataChange(t)}},this.id=e.id,this.columns=e.columns||[],this.dataSource=Array.isArray(e.dataSource)?e.dataSource:[],this.height=null!=e.height?e.height:"200px",this.width=null!=e.width?e.width:"100%",this.locale=e.locale,this.cssClass=e.cssClass,this.pageSize=null!=e.pageSize?e.pageSize:6,this.allowPaging=!1!==e.allowPaging,this.allowAdding=!1!==e.allowAdding,this.allowEditing=!1!==e.allowEditing,this.allowDeleting=!1!==e.allowDeleting,this.allowFiltering=!0===e.allowFiltering,this.onDataChange=e.onDataChange,this.isPreviewMode=e.isPreviewMode,this.enableRtl=e.enableRtl,this.ref=e.ref,this.currentData=Array.isArray(this.dataSource)?this.dataSource:[],this.gridExpressions=new P,this.validationEngine=new U}r.Grid.Inject(r.Edit,r.Toolbar,r.Page,r.Resize,r.Sort,r.Filter);function Z(e,t){e&&t&&e.setAttribute("id",t)}function F(r){function e(t){var e=o.validateOn||"Change",n={};return e&&"Change"!==e||(n.change=function(e){return l(t(e))},n.blur=function(){a&&a()}),"Blur"===e&&(n.change=function(e){return l(t(e))},n.blur=function(){a&&a()}),n}var t,o=r.component,s=r.value,l=r.onChange,a=r.onBlur,c=r.onClick,n=void 0!==(n=r.hasError)&&n,d=r.locale,i=r.formState,u=r.settings,p=r.components,h=r.enableRtl,m=r.ref,j=r.l10n,L=r.initializedGrids||new Set,f=r.target,y={floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled},v=(t=o.htmlAttributes)?Array.isArray(t)?t.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):t:{},P=(o.required&&(v["aria-required"]="true"),n?"e-error":""),g=((o.cssClass||"")+" "+P+" "+("Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"")).trim();switch(o.type){case"textbox":var b=new q.TextBox(K({id:o.name,type:o.multiline?"hidden":o.textboxType||"text",name:o.id,enableRtl:h,locale:d,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",multiline:o.multiline,showClearButton:o.showClearButton,autocomplete:!1===o.autocomplete||void 0===o.autocomplete?"off":"on",readonly:o.readOnly||!1,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"textarea":b=new q.TextArea(K({id:o.name,name:o.id,enableRtl:h,locale:d,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:o.defaultValue||"",cols:o.cols||200,rows:o.textareaRows||4,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,maxLength:o.maxLength||255,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix,resizeMode:"Vertical"},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"number":b=""===s?void 0:s,b=new q.NumericTextBox({locale:d,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==b?b:o.defaultValue||void 0,decimals:o.decimals||2,currency:o.currency,format:o.numberFormat||"n2",step:o.step||1,min:o.minValue||void 0,max:o.maxValue||void 0,readonly:o.readOnly||!1,showClearButton:o.showClearButton||!1,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),b.appendTo(f)),m(b),b;case"checkbox":b=o.label&&o.required?o.label+" *":o.label,b=new z.CheckBox({locale:d,name:o.id,enableRtl:h,label:b,labelPosition:o.checkboxLabelPosition,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,indeterminate:o.indeterminate||!1,disabled:o.disabled,cssClass:g,htmlAttributes:v,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),m(b),b;case"checkboxGroup":var x=[],b=(Y.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(x.push.apply(x,e.options),C.setOptions(x))}).catch(function(){}),J(o.options,x)),b=0<b.length?b:o.options||["Option 1"],C=new ie({component:K({},o,{options:b}),formState:i,value:s,enableRtl:h,onChange:function(e){return l(e)},optionRef:r.ref,target:f,ref:m});return f&&Z(f,o.name),C.render(f),C;case"radio":var b=Array.isArray(o.options)?o.options:["Option 1"],B=_.createElement("div",{id:o.name+"-group",className:"e-radio-group "+P});return b.forEach(function(e,t){var n=e,a=_.createElement("div"),i=(a.style.marginBottom="8px",B.appendChild(a),_.createElement("input",{id:o.name+"_"+t+"_"+n,attrs:{type:"radio"}})),a=(a.appendChild(i),new z.RadioButton({name:o.id,label:e,enableRtl:h,locale:d,disabled:o.disabled,value:n,htmlAttributes:v,labelPosition:o.fieldLabelPosition,checked:o.defaultValue===n||s===n,cssClass:g,change:function(e){e.value===n&&l(n)}}));a.appendTo(i),m(a,t),r.ref&&"function"==typeof r.ref&&r.ref(a,t)}),f&&f.appendChild(B),[];case"dropdown":var w=[],b=(Y.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(w.push.apply(w,e.options),S.dataSource=w)}).catch(function(){}),J(o.options,w)),b=0<b.length?b:o.options||["Option 1"],S=(o.conditions&&o.conditions.choiceBasedField&&0<(b=$.getChoiceBasedOptions(o.conditions.choiceBasedField,b,i?i.values:void 0,o.conditions.choiceBasedField.primaryFieldId)).length&&null!=s&&-1===b.indexOf(s)&&i&&(i.values[o.id]=null),new W.DropDownList(K({id:o.name,name:o.id,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:d,enableRtl:h,cssClass:g,dataSource:b,value:void 0!==i.values[o.id]?i.values[o.id]:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",htmlAttributes:v},e(function(e){return e.value||""}))));return W.DropDownList.Inject(W.VirtualScroll),f&&S.appendTo(f),m(S),S;case"multiselect":var E=[],b=(Y.fetch(o.options,o.id,i?i.values:void 0,p).then(function(e){e.id===o.id&&0<e.options.length&&(E.push.apply(E,e.options),T.dataSource=E)}).catch(function(){}),J(o.options,E)),b=0<b.length?b:o.options||["Option 1"],T=new W.MultiSelect(K({name:o.id,enableRtl:h,locale:d,floatLabelType:y.floatLabelType,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,placeholder:o.placeholder,dataSource:b,fields:{text:"text",value:"value"},showClearButton:o.showClearButton||!1,readonly:o.readOnly||!1,allowCustomValue:o.allowCustomValue||!1,addTagOnBlur:o.addTagOnBlur||!1,delimiterChar:o.delimiterChar||",",showSelectAll:o.showSelectAll||!1,mode:o.showSelectAll?"CheckBox":o.visualMode||void 0,selectAllText:o.selectAllText,unSelectAllText:o.unSelectAllText,showDropDownIcon:!1!==o.showDropDownIcon,enableVirtualization:o.enableVirtualization||!1,popupHeight:o.popupHeight||"300px",popupWidth:o.popupWidth||"100%",cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return W.MultiSelect.Inject(W.CheckBoxSelection,W.VirtualScroll),f&&T.appendTo(f),m(T),T;case"date":b=new H.DatePicker(K({floatLabelType:y.floatLabelType,id:o.name,name:o.id,enableRtl:h,locale:d,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy",readOnly:o.readOnly||!1,showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,calendarMode:o.calendarMode||"Gregorian",dayHeaderFormat:o.dayHeaderFormat||"Short",depth:o.depth||"Month",start:o.start||"Month",firstDayOfWeek:o.firstDayOfWeek||0,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return H.DatePicker.Inject(H.Islamic),f&&b.appendTo(f),m(b),b;case"dateTime":b=new H.DateTimePicker(K({id:o.name,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,locale:d,enableRtl:h,name:o.id,dayHeaderFormat:o.dayHeaderFormat||"Short",value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"MM/dd/yyyy hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,showTodayButton:!1!==o.showTodayButton,depth:o.depth||"Month",start:o.start||"Month",step:o.step||1,readonly:o.readOnly||!1,min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,minTime:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,maxTime:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return H.DateTimePicker.Inject(H.Islamic),f&&b.appendTo(f),m(b),b;case"time":b=new H.TimePicker(K({id:o.name,locale:d,name:o.id,enableRtl:h,floatLabelType:y.floatLabelType,placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,format:o.format||"hh:mm a",showClearButton:void 0!==o.showClearButton&&o.showClearButton,step:o.step||30,readonly:o.readOnly||!1,min:o.minTime?new Date("2000-01-01 "+o.minTime):void 0,max:o.maxTime?new Date("2000-01-01 "+o.maxTime):void 0,enableMask:!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"dateRange":b=new H.DateRangePicker(K({id:o.name,locale:d,enableRtl:h,name:o.id,floatLabelType:y.floatLabelType,dayHeaderFormat:o.dayHeaderFormat||"Short",placeholder:y.placeholder,enabled:y.enabled,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:null,depth:o.depth||"Month",start:o.start||"Month",min:o.minDate?new Date(o.minDate):void 0,max:o.maxDate?new Date(o.maxDate):void 0,format:o.format||"MM/dd/yyyy",separator:o.separator||" - ",showClearButton:void 0!==o.showClearButton&&o.showClearButton,readonly:o.readOnly||!1,cssClass:g,htmlAttributes:v},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"switch":b=new z.Switch({locale:d,enableRtl:h,value:o.defaultValue,name:o.id,checked:void 0!==o.checked&&null!==o.checked&&o.checked||null!=s&&s,disabled:o.disabled,onLabel:o.onLabel||"",offLabel:o.offLabel||"",cssClass:g,htmlAttributes:v,change:function(e){return l(e.checked)}});return f&&(Z(f,o.name),b.appendTo(f)),m(b),b;case"button":var A,D,b=o.buttonsGroups||o.buttons||[];return b&&0<b.length?(I={display:"flex",flexWrap:"wrap",alignItems:"center",gap:o.gap||"8px",justifyContent:ae(o.position),width:o.width||void 0},A=_.createElement("div",{id:o.name,attrs:{role:"group","aria-label":o.label||"Button Group",className:g+" "+(h?"e-rtl":"")}}),Object.assign(A.style,I),D=[],b.forEach(function(e,t){var n=o.name+"_"+t,a=[te(e.style)].filter(Boolean).join(" "),i=(a+="Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":"",ne(e.type)),n=_.createElement("button",{id:String(n),attrs:{name:String(n),type:i}}),i=(A.appendChild(n),new z.Button({locale:d,enableRtl:h,cssClass:a,disabled:e.disabled||!1,content:e.label||"Button "+(t+1),iconCss:e.iconCss,iconPosition:e.iconPosition}));i.appendTo(n),i.element.onclick=function(e){c&&c(e)},m(i,t),D.push(i),r.ref&&"function"==typeof r.ref&&r.ref(i,t)}),f&&f.appendChild(A),D):(I=ne(o.buttonType),b=[te(o.style),"submit"===I?"submit-btn form-submit-type":"","reset"===I?"form-reset-type":"",o.cssClass||"e-primary","Small"===o.size?" e-small":"Bigger"===o.size?" e-bigger":""].filter(Boolean).join(" ")||"e-primary",V={display:"flex",justifyContent:ae(o.position),width:o.width||"100%"},O=_.createElement("div",{id:o.name+"-container"}),Object.assign(O.style,V),V=_.createElement("button",{id:o.name,attrs:{type:I}}),O.appendChild(V),(I=new z.Button({enableRtl:h,locale:d,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition,content:o.label})).appendTo(V),m(I),I.element.onclick=function(e){c&&c(e)},f&&f.appendChild(O),I);case"splitButton":var b=["primary"===o.style?"e-primary":"",(o.style,""),"information"===o.style?"e-info":"","error"===o.style?"e-danger":"","success"===o.style?"e-success":"","warning"===o.style?"e-warning":"",o.cssClass||""].filter(Boolean).join(" ")||void 0,V={display:"flex",justifyContent:ae(o.position)},O=_.createElement("div",{id:o.name+"-container",attrs:{"aria-label":"Splitbutton"}}),I=(Object.assign(O.style,V),o.options&&0<o.options.length?o.options.map(function(e,t){return{text:e,id:o.id+"_option_"+t}}):[{text:"Option 1",id:o.id+"_option_0"}]),V=_.createElement("button",{id:o.name}),I=(O.appendChild(V),new Q.SplitButton({locale:d,enableRtl:h,content:o.label||"Split Button",items:I,cssClass:b,disabled:o.disabled,iconCss:o.iconCss,iconPosition:o.iconPosition||"Left",click:function(e){c&&c(K({},e))},select:function(e){c&&c(K({},e,{selectedItem:e.item.text}))}}));return I.appendTo(V),f&&f.appendChild(O),m(I),I;case"signature":b=_.createElement("canvas",{id:o.name}),V=new q.Signature({enableRtl:h,locale:d,backgroundColor:o.backgroundColor||"",strokeColor:o.strokeColor||"",maxStrokeWidth:o.maxValue,minStrokeWidth:o.minValue,velocity:o.velocity,disabled:o.disabled,change:function(){return l(o.name)}});return f&&(V.appendTo(b),f.appendChild(b)),m(V),V;case"rating":O=new q.Rating({enableRtl:h,locale:d,value:void 0!==s?s:o.defaultValue||0,disabled:o.disabled,cssClass:g,allowReset:o.allowReset,itemsCount:o.itemsCount,min:o.minValue,precision:o.precision,readOnly:o.readOnly,showTooltip:o.showRatingTooltip||!1,showLabel:o.showRatingLabel,labelPosition:o.showRatingLabel?o.ratingLabelPosition:void 0,valueChanged:function(e){return l(e.value)}});return f&&(Z(f,o.name),f.setAttribute("name",o.id),O.appendTo(f)),m(O),O;case"colorPicker":I=new q.ColorPicker({enableRtl:h,locale:d,value:void 0!==s?s:o.defaultValue||"",disabled:o.disabled,enableOpacity:o.enableOpacity,showButtons:o.showButtons,showRecentColors:o.showRecentColors,noColor:o.showNoColor,cssClass:g,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),I.appendTo(f)),m(I),I;case"inputMask":b=new q.MaskedTextBox(K({id:o.name,name:o.id,enableRtl:h,floatLabelType:o.floatLabelType||"Never",placeholder:o.placeholder||"",enabled:!o.disabled,locale:d,value:void 0!==s?s:o.defaultValue||"",mask:o.mask||"000-000-0000",promptChar:o.promptChar||"_",customCharacters:o.customCharacters,readOnly:o.readOnly||!1,showClearButton:!1!==o.showClearButton,cssClass:g,htmlAttributes:v,appendTemplate:o.suffix,prependTemplate:o.prefix},e(function(e){return e.value||""})));return f&&b.appendTo(f),m(b),b;case"rangeSlider":V=new q.Slider({enableRtl:h,locale:d,value:void 0!==s?s:void 0!==o.defaultValue&&null!==o.defaultValue?o.defaultValue:0,min:o.minValue||0,max:o.maxValue||100,step:o.step||1,cssClass:g,enabled:!o.disabled,readonly:o.readOnly,showButtons:o.showButtons,change:function(e){return l(e.value)}});return f&&(Z(f,o.name),V.appendTo(f)),m(V),V;case"fileUpload":O=new q.Uploader({enableRtl:h,locale:d,type:"file",enabled:!o.disabled,allowedExtensions:o.allowExtensions,asyncSettings:{saveUrl:o.saveUrl,removeUrl:o.removeUrl},buttons:o.buttons||{browse:"Choose File",clear:"Clear All",upload:"Upload All"},maxFileSize:o.maxValue,minFileSize:o.minValue,multiple:!!o.allowMultiple,showFileList:o.showFileList,htmlAttributes:v,cssClass:g,change:function(e){return l(e.file)}});return f&&(Z(f,o.name),O.appendTo(f)),m(O),O;case"imageEditor":var R,I=_.createElement("div",{id:o.name,attrs:{"data-field":o.id}});return setTimeout(function(){R=new ee.ImageEditor({locale:d,enableRtl:h,disabled:o.disabled,cssClass:g,height:(null!=o.height?o.height:"350px").toString(),width:(null!=o.width?o.width:"100%").toString(),editComplete:function(){return l(o.name)},fileOpened:function(){return l(o.name)}},"#"+o.name)},100),f&&f.appendChild(I),m(R),R;case"message":var F=new X.Message({locale:d,enableRtl:h,severity:o.severity||o.messageType||"info",variant:o.variant,content:o.content||"Message",showCloseIcon:o.showCloseIcon,showIcon:void 0!==o.showIcon&&o.showIcon||!1,cssClass:g});return f&&(Z(f,o.name),F.appendTo(f)),m(F),F;case"dataGrid":var k=o,b=function(e,t){if(e&&e.conditionalData&&Array.isArray(e.conditionalData))for(var n=0,a=e.conditionalData;n<a.length;n++){var i=a[n];if($.evaluateCondition(i.condition,t))return{dataSource:i.dataSource,columns:i.columns&&0<i.columns.length?i.columns:void 0}}}(k.conditions,i&&i.values||{}),N=b?b.dataSource:void 0,V=b?b.columns:void 0,O=(N||k.dataSource,[]),U=(Y.fetch(N||k.dataSource,k.id,i&&i.values,p).then(function(e){e.id===k.id&&0<e.options.length&&(e=J(N||k.dataSource,e.options,U),M.setDataSource(e))}),[]),I=J(N||k.dataSource,O,U),b=0<I.length?I:void 0!==k.dataSource&&null!==k.dataSource?k.dataSource:[],O=V&&0<V.length?V:void 0!==k.columns&&null!==k.columns?k.columns:[],I=f||_.createElement("div",{id:k.name,className:k.cssClass}),M=(f&&Z(f,o.name),new re({locale:d,name:k.name||"",columns:O,enableRtl:h,dataSource:void 0!==b&&0<b.length?b:s,height:null!=k.height?k.height:"200px",width:null!=k.width?k.width:"100%",pageSize:k.pageSize||6,allowPaging:!1!==k.allowPaging,allowFiltering:k.allowFiltering,allowAdding:!1!==k.allowAdding,allowEditing:!1!==k.allowEditing,allowDeleting:!1!==k.allowDeleting,onDataChange:function(e){return l(e)},cssClass:g,target:I,ref:m}));return M.render(I),!L.has(o.id)&&i&&Array.isArray(b)&&(i.values[o.id]=b,M.isInitialized=!0,L.add(o.id)),"function"==typeof r.ref?r.ref(M):r.ref&&(r.ref.current=M),f||I;case"richTextEditor":V={items:["Undo","Redo","|","Bold","Italic","Underline","StrikeThrough","InlineCode","|","CreateLink","Image","CreateTable","CodeBlock","HorizontalLine","Blockquote","EmojiPicker","|","LineHeight","Formats","Alignments","|","BulletFormatList","NumberFormatList","Checklist","|","Outdent","Indent","|","FontColor","BackgroundColor","FontName","FontSize","|","LowerCase","UpperCase","SuperScript","SubScript","|","SourceCode","|"]},O=(o.enableImportFromWord&&o.enableImportFromWord.enabled&&V.items.push("ImportWord"),o.enableExportToWord&&o.enableExportToWord.enabled&&V.items.push("ExportWord"),o.enableExportToPdf&&o.enableExportToPdf.enabled&&V.items.push("ExportPdf"),V.items.push("Print"),function(e){return!!e&&e.enabled&&"string"==typeof e.serviceUrl&&""!==e.serviceUrl.trim()}),b=O(o.enableImportFromWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"")?o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableImportFromWord?o.enableImportFromWord.serviceUrl:"").replace(/^\/+/,"")}:void 0,I=O(o.enableExportToWord)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToWord?o.enableExportToWord.serviceUrl:"")?o.enableExportToWord?o.enableExportToWord.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToWord?o.enableExportToWord.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.docx",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,O=O(o.enableExportToPdf)?{serviceUrl:/^(https?:)?\/\//i.test(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"")?o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"":(u&&u.hostUrl?u.hostUrl:"").replace(/\/+$/,"")+"/"+(o.enableExportToPdf?o.enableExportToPdf.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.pdf",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,V=new G.RichTextEditor({locale:d,toolbarSettings:V,enableRtl:h,value:void 0!==s?s:o.defaultValue||"",placeholder:o.placeholder||"",enabled:!o.disabled,readonly:o.readOnly||!1,maxLength:o.maxLength||void 0,cssClass:g||void 0,height:o.height||"300px",width:o.width||"100%",htmlAttributes:v,importWord:b,exportPdf:O,exportWord:I,change:function(e){return l(e.value)}});return G.RichTextEditor.Inject(G.Toolbar,G.Link,G.HtmlEditor,G.QuickToolbar,G.Image,G.Count,G.Table,G.EmojiPicker,G.PasteCleanup,G.SlashMenu,G.CodeBlock,G.ClipBoardCleanup,G.AutoFormat,G.ImportExport),V.appendTo(f),m(V),V;default:F=new X.Message({locale:d,enableRtl:h,severity:"Warning",content:j.getConstant("unsupportedComponent")+" : "+o.type,cssClass:g});return f&&(Z(f,o.name),F.appendTo(f)),m(F),F}}var K=function(){return(K=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},y=function(){return(y=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},oe={strict:!1,maxInputSize:5242880,defaultTextType:"textbox",inferTypeFromValue:!0,generateIds:!0,includeMetadata:!0,customTypeMap:{},validateUnknownFields:!1},se=(v.prototype.parse=function(e){var t=[],n=[];if("string"==typeof e){if(e.length>this.config.maxInputSize)return this.formatError(t,n,"Input exceeds maximum size of "+this.config.maxInputSize+" bytes");var a=le(e);if(!a.valid)return this.formatError(t,n,a.errors&&a.errors[0]||"Invalid JSON");try{e=JSON.parse(e)}catch(e){return this.formatError(t,n,"Failed to parse JSON: "+e.message)}}var a=this.detectFormat(e),i=(a.ambiguousFormats&&0<a.ambiguousFormats.length&&(n.push("Ambiguous format detected."),n.push("Using "+a.format+" format ("+("json-schema"===a.format?"properties priority":"pages priority")+")")),[]);switch(a.format){case"configured-schema":i=e.properties||[];break;case"json-schema":var r=this.parseJsonSchema(e),i=r.components;r.warnings&&n.push.apply(n,r.warnings);break;case"surveyjs":i=this.parseSurveyJS(e);break;case"openapi":i=this.parseOpenAPI(e);break;case"data-inference":0<(i=this.parseDataInference(e)).length&&n.push("Field types inferred from data; please verify");break;default:t.push("Could not determine input format")}0===i.length&&t.push("No form fields could be extracted from input");!i.some(function(e){return"button"===e.type&&"submit"===e.buttonType})&&0<i.length&&i.push({id:this.generateComponentId("button"),type:"button",label:"Submit",style:"primary",buttonType:"submit"});var o={version:e.version||"0.1.0",components:i},s=ce(o),s=(!s.valid&&s.errors&&t.push.apply(t,s.errors),s.warnings&&n.push.apply(n,s.warnings),this.config.strict&&0<n.length&&(t.push.apply(t,n),n.length=0),de(o));return{success:0===t.length,schema:s,errors:t,warnings:n,metadata:{detectedFormat:a.format,confidence:a.confidence,sourceHints:a.hints}}},v.prototype.formatError=function(e,t,n){return e.push(n),{success:!1,schema:null,errors:e,warnings:t,metadata:{detectedFormat:"unknown",confidence:"low",sourceHints:[]}}},v.prototype.detectFormat=function(e){var t,n,a,i=[],r=[];return e&&"object"==typeof e?e.$schema&&"string"==typeof e.$schema&&e.$schema.includes("json-schema")?(i.push("$schema property detected"),{format:"json-schema",confidence:"high",hints:i}):(t=e.properties&&"object"==typeof e.properties,n=e.pages&&Array.isArray(e.pages),a=e.elements&&Array.isArray(e.elements),t&&n?(i.push("Multiple format patterns detected"),i.push("Selected based on priority rules"),r.push("properties format","pages format"),{format:"json-schema",confidence:"medium",hints:i,ambiguousFormats:r}):n?(i.push("pages array detected"),e.pages[0]&&e.pages[0].elements&&i.push("elements structure matched"),{format:"surveyjs",confidence:"high",hints:i}):a&&!t?(i.push("elements array at root level"),{format:"surveyjs",confidence:"medium",hints:i}):t?(i.push("properties object detected"),"object"===e.type&&i.push("type: object matched"),e.required&&Array.isArray(e.required)&&i.push("required array found"),this.hasExampleFields(e.properties)?(i.push("example fields detected (API schema pattern)"),{format:"openapi",confidence:"high",hints:i}):{format:"json-schema",confidence:"high",hints:i}):this.isDataInferenceCandidate(e)?(i.push("Simple object with primitive values"),i.push("No schema indicators found"),{format:"data-inference",confidence:"medium",hints:i}):{format:"unknown",confidence:"low",hints:["Could not identify format"]}):{format:"unknown",confidence:"low",hints:["Input is not a valid object"]}},v.prototype.hasExampleFields=function(e){if(e&&"object"==typeof e)for(var t=0,n=Object.keys(e);t<n.length;t++){var a=e[n[t]];if(a&&"example"in a)return!0}return!1},v.prototype.isDataInferenceCandidate=function(t){return!(!t||"object"!=typeof t||t.$schema||t.properties||t.pages||t.elements)&&Object.keys(t).every(function(e){e=t[e];return null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||!!Array.isArray(e)&&e.every(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e})})},v.prototype.inferComponentType=function(e,t){var t=this.inferTypeFromValue(e,t);return t.type?y({},t,{confidence:"high",method:"value-type"}):(t=this.matchFieldNamePattern(e)).type?y({},t,{confidence:"high",method:"name-pattern"}):{type:this.config.defaultTextType,confidence:"low",method:"fallback"}},v.prototype.inferTypeFromValue=function(e,t){return this.config.inferTypeFromValue?null==t?this.matchFieldNamePattern(e):"string"==typeof t?t.includes("@")&&t.includes(".")?{type:"textbox",textboxType:"email"}:/^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}/.test(t)?{type:"textbox",textboxType:"url"}:/^\d{4}-\d{2}-\d{2}/.test(t)?{type:"date"}:"textbox"!==(e=this.matchFieldNamePattern(e)).type||e.textboxType?e:{type:this.config.defaultTextType}:"number"==typeof t?{type:"number"}:"boolean"==typeof t?{type:"checkbox"}:Array.isArray(t)?{type:"multiselect"}:{type:"textbox"}:{type:"textbox"}},v.prototype.matchFieldNamePattern=function(e){if(this.config.customTypeMap){var t=this.config.customTypeMap[e.toLowerCase()];if(t)return{type:t}}t=e.toLowerCase().replace(/[_\-\s]+/g," ");return/email|mail|e-?mail/.test(t)?{type:"textbox",textboxType:"email"}:/date|birth|birthday|dob|created|updated/.test(t)?{type:"date"}:/phone|tel|mobile|cell|cellphone|msisdn/.test(t)?{type:"textbox",textboxType:"number"}:/url|link|uri|website/.test(t)?{type:"textbox",textboxType:"url"}:/password|pwd|pass|security|secret|key|token/.test(t)?{type:"textbox",textboxType:"password"}:/\b(?:age|count|qty|quantity|amount|price|cost|salary|fee|rate|number|num)\b/.test(t)?{type:"number"}:/active|enabled|visible|deleted|archived|approved|confirmed/.test(t)?{type:"checkbox"}:/select|choice|option|type|status|category|kind/.test(t)?{type:"dropdown"}:/description|comment|note|bio|biography|about|message|content|summary|details/.test(t)?{type:"textarea"}:{type:"textbox"}},v.prototype.parseJsonSchema=function(e){var t=[],n=[];if(e.properties&&"object"==typeof e.properties)for(var a=this.flattenNestedProperties(e.properties,"",n),i=0,r=Object.keys(a);i<r.length;i++){var o=r[i],s=a[o],l=this.mapJsonSchemaType(s),c=-1!==(e.required||[]).indexOf(o);t.push(this.createComponent(o,s,l,{required:c}))}return{components:t,warnings:n}},v.prototype.flattenNestedProperties=function(e,t,n){for(var a={},i=!1,r=0,o=Object.keys(e);r<o.length;r++){var s,l=o[r],c=t?t+"_"+l:l;"object"===(d=e[l]).type&&d.properties&&"object"==typeof d.properties?(i=!0,s=this.flattenNestedProperties(d.properties,c,n),Object.assign(a,s)):a[c]=d}if(i&&!t){n.push("NESTED_OBJECTS_FLATTENED: Nested objects converted to flat structure");for(var d,u=0,p=Object.keys(e);u<p.length;u++)"object"===(d=e[l=p[u]]).type&&d.properties&&this.collectFlattenedFieldNames(d.properties,l,n)}return a},v.prototype.collectFlattenedFieldNames=function(e,t,n){for(var a=0,i=Object.keys(e);a<i.length;a++){var r=i[a],o=e[r],s=t+"_"+r;n.push("Field '"+t+"."+r+"' flattened to '"+s+"'"),"object"===o.type&&o.properties&&this.collectFlattenedFieldNames(o.properties,s,n)}},v.prototype.parseSurveyJS=function(e){var t=this,n=[];return e.pages&&Array.isArray(e.pages)&&e.pages.forEach(function(e){e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))})}),!n.length&&e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))}),n},v.prototype.createComponentFromSurveyJS=function(e){var t=this.mapSurveyJSType(e.type||"text"),n={},a=(!0===e.isRequired&&(n.required=!0),e.validators&&Array.isArray(e.validators)&&e.validators.forEach(function(e){"numeric"===e.type&&(void 0!==e.minValue&&(n.minValue=e.minValue),void 0!==e.maxValue)&&(n.maxValue=e.maxValue),"text"===e.type&&(void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength)&&(n.maxLength=e.maxLength)}),y({id:this.generateComponentId(t),type:t,label:e.title||e.label||this.humanizeFieldName(e.name),defaultValue:e.defaultValue,expressionValue:e.expressionValue},0<Object.keys(n).length?n:void 0));return"dropdown"!==t&&"multiselect"!==t&&"radio"!==t&&"splitButton"!==t||e.choices&&Array.isArray(e.choices)&&(a.options=e.choices),a},v.prototype.mapSurveyJSType=function(e){return{text:"textbox",email:"email",number:"number",checkbox:"checkbox",radiogroup:"radio",dropdown:"dropdown",tagbox:"multiselect",multiselect:"multiselect",rating:"number",comment:"textarea",date:"date"}[e]||"textbox"},v.prototype.parseOpenAPI=function(e){var t=[];if(e.properties&&"object"==typeof e.properties)for(var n=Object.keys(e.properties),a=e.required||[],i=0,r=n;i<r.length;i++){var o=r[i],s=e.properties[o],l=this.mapJsonSchemaType(s),c=-1!==a.indexOf(o);t.push(this.createComponent(o,s,l,{required:c}))}return t},v.prototype.parseDataInference=function(e){for(var t=[],n=0,a=Object.keys(e);n<a.length;n++){var i=a[n],r=e[i],o=this.inferComponentType(i,r),i={id:this.generateComponentId(o.type),type:o.type,label:this.humanizeFieldName(i),defaultValue:r,expressionValue:void 0};o.textboxType&&(i.textboxType=o.textboxType,"email"===o.textboxType?i.regex=u.EMAIL:"url"===o.textboxType&&(i.regex=u.URL)),"date"===o.type&&null!=i.defaultValue&&(o=this.formatDateTimeValue(i.defaultValue))&&(i.defaultValue=o),Array.isArray(r)&&0<r.length&&(i.options=r),t.push(i)}return t},v.prototype.createComponent=function(e,t,n,a){var i={},a=(!0===(void 0!==t.required?t:a).required&&(i.required=!0),t.minLength&&(i.minLength=t.minLength),t.maxLength&&(i.maxLength=t.maxLength),t.minDate&&(i.minDate=t.minDate),t.maxDate&&(i.maxDate=t.maxDate),t.minTime&&(i.minTime=t.minTime),t.minValue&&(i.minValue=t.minValue),t.maxValue&&(i.maxValue=t.maxValue),t.pattern&&(i.pattern=t.pattern),t.id||this.generateComponentId(n.type)),r=(a=a,r="string"==typeof(r=this.generateComponentId(n.type))&&r?r:"field_"+Date.now()+"_"+Math.floor(1e3*Math.random()),null==a||!(a=String(a).trim())||"__proto__"===a||"prototype"===a||"constructor"===a||(a=a.replace(/[^A-Za-z0-9_-]/g,"_"),"__proto__"===(a=100<(a=/^[A-Za-z_]/.test(a)?a:"f_"+a).length?a.slice(0,100):a))||"prototype"===a||"constructor"===a?r:a),a=y({id:r,name:t.name,type:n.type,label:t.title||t.label||this.humanizeFieldName(e),defaultValue:t.default||t.defaultValue||void 0,expressionValue:t.expressionValue||void 0,content:t.content,buttonType:t.buttonType,textboxType:t.textboxType},0<Object.keys(i).length?i:void 0);return n.textboxType&&(a.textboxType=n.textboxType,"email"===n.textboxType?i.pattern||(i.regex="^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",i.validationMessage="Please enter a valid email address"):"url"!==n.textboxType||i.pattern||(i.regex="^(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$",i.validationMessage="Please enter a valid URL")),"date"===n.type&&void 0!==a.defaultValue&&null!==a.defaultValue&&(r=this.formatDateTimeValue(a.defaultValue))&&(a.defaultValue=r),"splitButton"!==n.type&&"dropdown"!==n.type&&"multiselect"!==n.type&&"radio"!==n.type||!t.enum&&!t.options||(a.options=t.enum||t.options),a},v.prototype.parseDateFromValue=function(e){if(null!=e){if("number"==typeof e)return e<1e12?new Date(1e3*e):new Date(e);if("string"==typeof e){var e=e.trim(),t=new Date(e);if(!isNaN(t.getTime()))return t;t=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0));t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2})(?:[:](\d{2}))?)?/);if(t)return new Date(Number(t[3]),Number(t[1])-1,Number(t[2]),Number(t[4]||0),Number(t[5]||0),Number(t[6]||0))}}return null},v.prototype.formatDate=function(e){var t=e.getMonth()+1,n=e.getDate();return(t<10?"0"+t:String(t))+"/"+(n<10?"0"+n:String(n))+"/"+e.getFullYear()},v.prototype.formatDateTimeValue=function(e){var t,n=this.parseDateFromValue(e);if(n)return t=this.formatDate(n),0!==n.getHours()||0!==n.getMinutes()||/\dT\d{2}:\d{2}/.test(String(e))?""+t:t},v.prototype.mapJsonSchemaType=function(e){var t,n,a=e.type;return"string"===a?(t=(e.format||"").toString().toLowerCase(),n=((e.title||e.label||"")+" "+(e.description||"")).toLowerCase(),/email|mail|e-?mail/.test(t)||/email|mail|e-?mail/.test(n)?{type:"textbox",textboxType:"email"}:/uri|url|link|website/.test(t)||/uri|url|link|website/.test(n)?{type:"textbox",textboxType:"url"}:/phone|tel|mobile|cell|msisdn/.test(t)||/phone|tel|mobile|cell|msisdn/.test(n)?{type:"textbox",textboxType:"number"}:/password|pwd|pass|security|secret|key/.test(t)||/password|pwd|pass|security|secret|key/.test(n)?{type:"textbox",textboxType:"password"}:"date"===t||"date-time"===t||/date|birthday|dob/.test(n)?{type:"date"}:e.enum||e.options?{type:"dropdown"}:{type:this.config.defaultTextType}):"number"===a||"integer"===a?{type:"number"}:"boolean"===a?{type:"checkbox"}:"array"===a?{type:"multiselect"}:"message"===a?{type:"message"}:"button"===a?{type:"button"}:"signature"===a||"sign"===a?{type:"signature"}:"image"===a||"imageEditor"===a?{type:"imageEditor"}:"file"===a||"fileUpload"===a?{type:"fileUpload"}:"color"===a||"colorPicker"===a?{type:"colorPicker"}:"splitButton"===a?{type:"splitButton"}:{type:this.config.defaultTextType}},v.prototype.generateComponentId=function(e){return this.config.generateIds?e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random()):""},v.prototype.humanizeFieldName=function(e){return e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2")},v);function v(e){this.config=y({},oe,e)}var le=function(e){try{return JSON.parse(e),{valid:!0}}catch(e){return{valid:!1,errors:["Invalid JSON syntax: "+e.message]}}},ce=function(e){var t,r,n=[],a=[];return e.components?Array.isArray(e.components)||n.push('Property "components" must be an array'):n.push("Missing required property: components"),Array.isArray(e.components)&&(t=new Set,r=function(e,i){void 0===i&&(i="root"),e.id?(t.has(e.id)&&n.push("Duplicate component ID found: "+e.id),t.add(e.id)):n.push("Component at "+i+' is missing "id" property'),e.type||n.push('Component "'+(e.id||"unknown")+'" is missing "type" property'),e.children&&Array.isArray(e.children)&&e.children.forEach(function(e,t){r(e,i+".children["+t+"]")}),e.tabItems&&Array.isArray(e.tabItems)&&e.tabItems.forEach(function(e,n){e.content&&Array.isArray(e.content)&&e.content.forEach(function(e,t){r(e,i+".tabItems["+n+"].content["+t+"]")})}),e.tableCells&&Array.isArray(e.tableCells)&&e.tableCells.forEach(function(e,a){Array.isArray(e)&&e.forEach(function(e,n){Array.isArray(e)&&e.forEach(function(e,t){r(e,i+".tableCells["+a+"]["+n+"]["+t+"]")})})})},e.components.forEach(function(e,t){r(e,"components["+t+"]")})),{valid:0===n.length,errors:0<n.length?n:void 0,warnings:0<a.length?a:void 0}},de=function(e){function n(e){var t=y({},e,{_configured:!0});return e.children&&Array.isArray(e.children)&&(t.children=e.children.map(n)),e.tabItems&&Array.isArray(e.tabItems)&&(t.tabItems=e.tabItems.map(function(e){return y({},e,{content:e.content?e.content.map(n):[]})})),e.tableCells&&Array.isArray(e.tableCells)&&(t.tableCells=e.tableCells.map(function(e){return e.map(function(e){return Array.isArray(e)?e.map(n):[]})})),t}e={version:e.version||"0.1.0",components:e.components||[]};return e.components=e.components.map(n),e},ue=(g.prototype.resolveHtml=function(e){try{return this.enableHtmlSanitizer?_.SanitizeHtmlHelper.sanitize(e):e}catch(e){return""}},g.prototype.render=function(){var e=document.createElement("div");return this.id&&(e.id=this.id),e.innerHTML=this.resolveHtml(this.content),this.el=e},g.prototype.update=function(e){this.content=e,this.el&&(this.el.innerHTML=this.resolveHtml(this.content))},g.prototype.getElement=function(){return this.el},g.prototype.destroy=function(){this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,this.content="",this.enableHtmlSanitizer=!1,this.id=void 0},g);function g(e){this.content=e.content,this.id=e.id,this.enableHtmlSanitizer=!!_.isNullOrUndefined(e.enableHtmlSanitizer)||e.enableHtmlSanitizer,this.el=e.target||null}b.getConstraints=function(e,t,n){var a,i,r=this;return void 0===n&&(n="number"),e&&0!==e.length?(a=e.find(function(e){return!1===e.enabled}))?(i=this.resolveValue(a.minValue,{}),a=this.resolveValue(a.maxValue,{}),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:i,maxDate:a,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:i,maxTime:a}:{minValue:i,maxValue:a,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):0===(i=e.filter(function(e){return!0===e.enabled})).length||0===(a=i.map(function(e){return{min:r.resolveValue(e.minValue,t),max:r.resolveValue(e.maxValue,t)}}).filter(function(e){return void 0!==e.min||void 0!==e.max})).length?this.getEmptyConstraints(n):(e=this.getPermissiveMin(a,n),i=this.getPermissiveMax(a,n),"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:e,maxDate:i,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:e,maxTime:i}:{minValue:e,maxValue:i,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}):this.getEmptyConstraints(n)},b.resolveValue=function(e,t){return"number"==typeof e||"string"==typeof e?e:e&&"object"==typeof e&&e.field&&void 0!==(t=t[e.field])?t:void 0},b.getPermissiveMin=function(e,t){var a=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=a.convertToISO(e),a.convertToISO(t.min)<n))?t.min:e},void 0):"time"===t?e.reduce(function(e,t){var n;return t.min&&(!e||(n=a.convertTimeTo24Hour(e),a.convertTimeTo24Hour(t.min)<n))?t.min:e},void 0):0<(t=e.map(function(e){return e.min}).filter(function(e){return void 0!==e})).length?Math.min.apply(Math,t):void 0},b.getPermissiveMax=function(e,t){var n=this;if(0!==e.length)return"date"===t||"dateRange"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertToISO(e)<n.convertToISO(t.max))?t.max:e},void 0):"time"===t?e.reduce(function(e,t){return t.max&&(!e||n.convertTimeTo24Hour(e)<n.convertTimeTo24Hour(t.max))?t.max:e},void 0):0<(t=e.map(function(e){return e.max}).filter(function(e){return void 0!==e})).length?Math.max.apply(Math,t):void 0},b.convertToISO=function(e){var t,n,a;return e?(!e.includes("-")||10!==e.length)&&-1!==e.indexOf("/")&&(t=(a=e.split("/"))[0],n=a[1],a=a[2],t)&&n&&a?a+"-"+(t.length<2?"0"+t:t)+"-"+(n.length<2?"0"+n:n):e:""},b.convertTimeTo24Hour=function(e){var t,n,a,i;return e?(i=/PM/i.test(e),((t=/AM/i.test(e))||i)&&(a=(n=e.replace(/\s*(AM|PM)/i,"").trim().split(":"))[0],n=n[1],a)&&n?(a=parseInt(a,10),i&&12!==a?a+=12:t&&12===a&&(a=0),((i=String(a)).length<2?"0"+i:i)+":"+n):e):""},b.getEmptyConstraints=function(e){return{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}},b.validateValue=function(e,t,n){if(null!=e&&""!==e)if("date"===n||"dateRange"===n){if(t.minDate){var a=this.convertToISO(t.minDate);if(this.convertToISO(e)<a)return{isValid:!1,error:"Date must be on or after "+t.minDate}}if(t.maxDate)if(this.convertToISO(t.maxDate)<this.convertToISO(e))return{isValid:!1,error:"Date must be on or before "+t.maxDate}}else if("time"===n){if(t.minTime&&e<t.minTime)return{isValid:!1,error:"Time must be on or after "+t.minTime};if(t.maxTime&&e>t.maxTime)return{isValid:!1,error:"Time must be on or before "+t.maxTime}}else{a=Number(e);if(void 0!==t.minValue)if(a<Number(t.minValue))return{isValid:!1,error:"Value must be at least "+t.minValue};if(void 0!==t.maxValue)if(Number(t.maxValue)<a)return{isValid:!1,error:"Value must be at most "+t.maxValue}}return{isValid:!0}};var pe=b;function b(){}he=function(e,t){return(he=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var he,x,me,fe=function(e,t){function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},k=function(){return(k=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},C=function(e,t,n,a){var i,r=arguments.length,o=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;0<=s;s--)(i=e[s])&&(o=(r<3?i(o):3<r?i(t,n,o):i(t,n))||o);return 3<r&&o&&Object.defineProperty(t,n,o),o},ye=["textbox","number","checkbox","dropdown","multiselect","date","dateTime","time","dateRange","switch","rating","colorPicker","inputMask","fileUpload"],ve={unsupportedComponent:"Unsupported Component type"},fe=(x=_.Component,fe(w,x),(me=w).prototype.getModuleName=function(){return"form-renderer"},w.prototype.getPersistData=function(){return this.addOnPersist(["formState",JSON.stringify(this.formState)])},w.prototype.preRender=function(){_.enableRipple(!0),this.createdFired=!1,this.expressionEngine=new i},w.prototype.render=function(){var a=this;if(this.clearEngineCaches(),this.removePreviousRoot(),this.normalizeSchema(),this.element.classList.add("form-renderer-container"),this.className&&_.addClass([this.element],this.className.replace(/\s+/g," ").trim().split(" ")),this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl"),this.hasLayoutComponentsCache=this.computeHasLayoutComponents(),this.idToLabelCache=this.computeIdToLabel(),this.initialValuesCache=this.buildInitialValues(),this.buildValidationRulesAndBridge(),this.isInitialized||(this.isInitialized=!0),this.formState&&this.initialValuesCache)for(var e=0,t=Object.keys(this.initialValuesCache);e<t.length;e++){var n=t[e],i=this.initialValuesCache[n];this.formState.values[n]||(this.formState.values[n]=i)}this.currentFormValues=k({},this.formState?this.formState.values:{}),this.initExpressionEngine(),this.buildConditionalDependencyMap();var r=_.createElement("form",{className:"form-renderer "+this.layoutClass,attrs:{role:"region","aria-label":this.processedSchemaCache.settings&&this.processedSchemaCache.settings.name||"Form"}});this.element.appendChild(r),this.inputRefs={},(this.processedSchemaCache.components||[]).forEach(function(e){var t,n=a.renderComponent(e);n&&r.appendChild(n),"richTextEditor"===e.type&&(t=n.querySelector(".e-richtexteditor"),_.getComponent(t,"richtexteditor").refreshUI()),"dataGrid"===e.type&&(t=n.querySelector(".e-control.e-toolbar"),_.getComponent(t,"toolbar").refresh()),"tabs"===e.type&&(t=n.querySelector(".e-control.e-tab"),_.getComponent(t,"tab").refreshOverflow())}),this.created&&!this.createdFired&&setTimeout(function(){0<Object.keys(a.inputRefs).length&&(a.createdFired=!0,a.trigger("created",{}))},0)},w.prototype.normalizeSchema=function(){var e=this.schema;try{if(e){var t,n=e;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){return this.failure&&this.trigger("failure",{error:e}),void(this.processedSchemaCache={version:"1.0.0",components:[]})}n&&"object"==typeof n&&n.properties&&Array.isArray(n.layout)?this.processedSchemaCache=E(n):(t=(new se).parse("string"==typeof e?e:JSON.stringify(e))).success&&t.schema?this.processedSchemaCache=t.schema:(this.failure&&this.trigger("failure",{error:t.errors}),this.processedSchemaCache={version:"1.0.0",components:[]})}else this.processedSchemaCache={version:"1.0.0",components:[]}}catch(e){this.failure&&this.trigger("failure",{error:e}),this.processedSchemaCache={version:"1.0.0",components:[]}}},w.prototype.computeHasLayoutComponents=function(){var p;return!!this.processedSchemaCache.components&&(p=function(e){for(var t=0,n=e;t<n.length;t++){var a=n[t];if(-1!==["table","tabs","panel","card"].indexOf(a.type))return!0;if(a.children&&p(a.children))return!0;if(a.tableCells)for(var i=0,r=a.tableCells;i<r.length;i++)for(var o=0,s=r[i];o<s.length;o++){var l=s[o];if(p(l))return!0}if(a.tabItems)for(var c=0,d=a.tabItems;c<d.length;c++){var u=d[c];if(u.content&&p(u.content))return!0}}return!1})(this.processedSchemaCache.components)},Object.defineProperty(w.prototype,"layoutClass",{get:function(){if(this.hasLayoutComponentsCache)return"";switch(this.layout){case"TwoColumn":return"twolayout";case"ThreeColumn":return"threelayout";case"FourColumn":return"fourlayout";default:return""}},enumerable:!0,configurable:!0}),w.prototype.collectAllComponents=function(e){function t(e){e.forEach(function(e){n.push(e),e.children&&0<e.children.length&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n=[];return t(e),n},w.prototype.computeIdToLabel=function(){function t(e){e.forEach(function(e){e.label&&-1===["panel","table","tabs","card","button","message","splitButton"].indexOf(e.type)&&(e.name?n[e.id]=e.name:e.label&&(n[e.id]=e.label)),e.children&&t(e.children),e.tableCells&&e.tableCells.forEach(function(e){return e.forEach(t)}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&t(e.content)})})}var n={};return t(this.processedSchemaCache.components),n},w.prototype.buildValidationRulesAndBridge=function(){function s(e,o){void 0===o&&(o=!0),e.forEach(function(p){var e,t,n,h,a,i,r,m;p&&(e={},t=o&&!1!==p.visible&&$.isFieldVisible(p.conditions,d),n=o&&$.isFieldHidden(p.conditions,d),t)&&!n&&(a=$.isFieldRequired(p.conditions,d),i=$.isFieldDisabled(p.conditions,d),r=$.isFieldReadOnly(p.conditions,d),h=!!p.required||a,a=!!p.disabled||i,i=!!p.readOnly||r,p.customValidation&&Array.isArray(p.customValidation)&&0<p.customValidation.length&&!a&&!i&&(r=((r=p.customValidation&&p.customValidation[0]&&p.customValidation[0].expression)&&r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)?r.match(/\?\s*true\s*:\s*['"](.+?)['"]/)[1]:void 0)||p.validationMessage||(p.label||p.id)+" is invalid",m=l,e.customValidation=[function(e){var t=e.value;if(!h||""!==t&&null!=t){for(var n={},a=(m.collectAllComponents(m.processedSchemaCache.components).forEach(function(e){e.name&&(n[e.id]=e.name)}),k({},m.currentFormValues||{})),i=0,r=Object.keys(k({},a));i<r.length;i++){var o=r[i],s=a[o],l=n[o];l&&(a[l]=s,delete a[o])}for(var c=0,d=p.customValidation;c<d.length;c++){var u=d[c];if(!m.customValidationEngine)return!0;if(!0!==m.customValidationEngine.validate(u.expression,t,a))return!1}}return!0},r]),!h||a||i||(e.required=[!0,p.validationMessage||p.label+" is required"]),!p.minLength||a||i||(e.minLength=[p.minLength,"Minimum "+p.minLength+" characters allowed"]),!p.maxLength||a||i||(e.maxLength=[p.maxLength,"Maximum "+p.maxLength+" characters allowed"]),"textbox"!==p.type||!p.textboxType||p.regex||e.regex||a||i||("email"===p.textboxType?e.regex=[u.EMAIL,p.validationMessage||"Invalid format"]:"url"===p.textboxType&&(e.regex=[u.URL,p.validationMessage||"Invalid format"])),!p.regex||a||i||(e.regex=[p.regex,p.validationMessage||"Invalid format"]),0<Object.keys(e).length&&(c[p.id]=e),p.children&&s(p.children,t&&!n),p.tableCells&&p.tableCells.forEach(function(e){return e.forEach(function(e){return s(e,t&&!n)})}),p.tabItems)&&p.tabItems.forEach(function(e){e.content&&s(e.content,t&&!n)})})}var l=this,c={},d=this.formState&&this.formState.values||{},n=(s(this.processedSchemaCache.components),this.formState?k({},this.formState.values):k({},this.initialValuesCache));if(this.formState={values:Object.assign(Object.create(null),this.initialValuesCache,n),errors:this.enablePersistence?this.formState.errors:Object.create(null)},n&&Object.keys(n).forEach(function(e){e in l.formState.values||(l.formState.values[e]=n[e])}),this.validator){try{this.validator.refresh(),this.validator.destroy()}catch(e){}this.validator=null}var a=this;this.validator=new q.FormValidator(this.element,{rules:c,locale:this.locale,ignore:"e-hidden",errorClass:"e-error",validClass:"e-valid",errorElement:"div",errorContainer:"div",customPlacement:function(e,t){var n=e.getAttribute("name");if(n){var a=document.getElementById("error-"+n);if(a){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(t),a.style.display="block"}else e.parentElement&&e.parentElement.appendChild(t)}else e.parentElement&&e.parentElement.appendChild(t)},validationComplete:function(e){if(a.syncFormStateErrors(),e&&e.inputName){var t=document.getElementById("error-"+e.inputName);if(t)if("success"===e.status){for(;t.firstChild;)t.removeChild(t.firstChild);t.style.display="none"}else"failure"===e.status&&(t.style.display="block")}},submit:function(e){a.validator&&(a.validator.validate()&&a.handleSubmitData(k({},a.formState.values)),e)&&"function"==typeof e.preventDefault&&e.preventDefault()},reset:function(){}}),n&&Object.keys(n).forEach(function(e){var t=l.validator.getInputElement(e);if(t&&void 0!==n[e]&&null!==n[e])try{t.value=String(n[e])}catch(e){}})},w.prototype.syncFormStateErrors=function(){var e={};if(this.validator)for(var t=0,n=this.validator.errorRules||[];t<n.length;t++){var a=n[t];a&&a.name&&(e[a.name]=a.message)}this.formState.errors=e},w.prototype.buildInitialValues=function(){var t=this,n={},e=this.collectAllComponents(this.processedSchemaCache.components),a=new Set;return e.forEach(function(e){if("staticHtml"!==e.type)if("dataGrid"===e.type&&(n[e.id]=Array.isArray(e.dataSource)?e.dataSource:[]),void 0!==e.defaultValue)n[e.id]=e.defaultValue;else switch(e.type){case"checkbox":case"switch":n[e.id]=!1}a.add(e.id)}),this.formState&&Object.keys(this.formState.values).filter(function(e){return!a.has(e)}).forEach(function(e){delete t.formState.values[e]}),n},w.prototype.initExpressionEngine=function(){if(this.processedSchemaCache.components&&0!==this.processedSchemaCache.components.length)try{var e=this.expressionEngine,t=this.collectAllComponents(this.processedSchemaCache.components),n=e.buildDependencyGraph(t),a=(e.detectCircularDependencies(n).length,this.expressionDependencyGraph=n,new Set);t.forEach(function(e){e.expressionValue&&a.add(e.id)}),this.computedFieldNames=a}catch(e){this.failure&&this.trigger("failure",{error:e})}},w.prototype.disposeTooltipInstance=function(e){var t=this.tooltipRefs[e]||null;if(t){try{t.destroy()}catch(e){this.trigger("failure",{error:e})}this.renderedInstances=this.renderedInstances.filter(function(e){return e!==t}),this.tooltipRefs[e]=null}},w.prototype.renderField=function(r){var o=this,s=this.formState,e=s?s.values:{};if(-1!==["panel","table","tabs","card","message","button","splitButton","staticHtml"].indexOf(r.type))return null;var t=$.isFieldReadOnly(r.conditions,e),n=$.isFieldDisabled(r.conditions,e),a=$.isFieldRequired(r.conditions,e),i=$.getConditionalValue(r.conditions,e),t=!!r.readOnly||t,n=!!r.disabled||n,a=!!r.required||a,l=pe.getConstraints(r.minMaxRange,e,r.type),c=("dateTime"===r.type&&(c=pe.getConstraints(r.minMaxRange,e,"date"),e=pe.getConstraints(r.minMaxTimeRange,e,"time"),l={minValue:void 0,maxValue:void 0,minDate:c.minDate,maxDate:c.maxDate,minTime:e.minTime,maxTime:e.maxTime}),r.labelPosition||"top"),e=r.labelWidth||"auto",d=!r.hideLabel&&!!r.label&&-1===["checkbox","button","staticHtml"].indexOf(r.type),u=!(!s||!s.errors[r.id]),p=u&&!(!s||-1===s.errors[r.id].indexOf("required")),u=u&&!(p&&!a),p=void 0!==i,h=this.conditionalValueApplied[r.id]||!1,i=(s&&(p&&!h?(s.values[r.id]=i,this.conditionalValueApplied[r.id]=!0):!p&&h&&(this.conditionalValueApplied[r.id]=!1)),_.createElement("div",{className:"form-group",attrs:{"data-field-id":r.id,"data-fr-field":r.id}})),p=_.createElement("div",{className:"field-wrapper label-"+c.toLowerCase()}),c=(d&&(h=_.createElement("label",{className:"field-label"}),-1===ye.indexOf(r.type)&&"textarea"!==r.type||h.setAttribute("for",_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name),h.style.width="left"===c.toLowerCase()?e+"%":"auto",(d=_.createElement("span")).textContent=r.label,h.appendChild(d),a&&((c=_.createElement("span",{className:"required-asterisk"})).textContent="*",h.appendChild(c)),this.disposeTooltipInstance(r.id),r.tooltip&&((e=_.createElement("span",{className:"e-msg-icon e-icons e-circle-info tooltip-icon",attrs:{"aria-label":r.tooltip,title:r.tooltip,tabindex:"0",role:"button","aria-haspopup":"true"}})).style.cursor="pointer",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.flexShrink="0",h.appendChild(e),(d=new S.Tooltip({content:r.tooltip,enableRtl:this.enableRtl})).appendTo(e),this.tooltipRefs[r.id]=d,this.renderedInstances.push(d)),p.appendChild(h)),_.createElement("div",{className:"field-input"})),e=("radio"===r.type||"checkboxGroup"===r.type)&&Array.isArray(r.options)?function(e,t){e&&"number"==typeof t&&(o.inputRefs[r.name+"_"+t]=e)}:function(e){e&&(o.inputRefs[r.name]=e)},d=k({},r,{readOnly:t,disabled:n,required:a},void 0!==l.minValue&&{minValue:l.minValue},void 0!==l.maxValue&&{maxValue:l.maxValue},void 0!==l.minDate&&{minDate:l.minDate},void 0!==l.maxDate&&{maxDate:l.maxDate},void 0!==l.minTime&&{minTime:l.minTime},void 0!==l.maxTime&&{maxTime:l.maxTime}),h=-1!==ye.indexOf(r.type)?"input":"textarea"===r.type?"textarea":"div",t=_.createElement(h,{attrs:{"aria-label":r.label+" "+r.type}}),m=("radio"===r.type||"checkboxGroup"===r.type?((n=_.createElement("input")).id=_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name,n.setAttribute("name",r.id),n.style.display="none",n.setAttribute("aria-hidden","true"),t.appendChild(n)):(t.id=_.isNullOrUndefined(this.element.id)?r.name:this.element.id+"-"+r.name,t.setAttribute("name",r.id)),c.appendChild(t),F({component:d,value:s?s.values[r.id]:void 0,onChange:function(e){var t,n,a,i;"staticHtml"!==r.type&&("signature"===r.type&&(e=o.inputRefs[e].getSignature()),"imageEditor"===r.type&&(n=o.inputRefs[e].getImageData(),(a=document.createElement("canvas")).width=n.width,a.height=n.height,(t=a.getContext("2d"))&&t.putImageData(n,0,0),e=a.toDataURL()),"radio"!==r.type&&"checkboxGroup"!==r.type||(o.validator.getInputElement(r.id).value=e),t=r,n=e,a=new _.Internationalization,i=a.getDateFormat({format:"MM/dd/yyyy",type:"date"}),"date"===t.type&&(n=i(new Date(n))),"time"===t.type&&(n=(i=a.getDateFormat({format:"hh:mm a",type:"time"}))(new Date(n))),"dateTime"===t.type&&(n=(i=a.getDateFormat({format:"MM/dd/yyyy hh:mm a",type:"dateTime"}))(new Date(n))),e=n="dateRange"===t.type&&Array.isArray(n)?n.map(function(e){return e?i(new Date(e)):null}):n,o.formState&&s&&(o.formState.values[r.id]=e,s.values[r.id]=e),o.trigger("change",{fieldName:r.name,label:r.label||r.id,value:e}),o.afterValueChange(r.id))},formState:s,settings:this.processedSchemaCache.settings,onBlur:function(){if(s&&"staticHtml"!==r.type&&o.validator){try{o.beforeValidate(r.id),o.validator.validate(r.id)}catch(e){}o.syncFormStateErrors()}},ref:e,hasError:u,locale:this.locale,components:this.collectAllComponents(this.processedSchemaCache.components),enableRtl:this.enableRtl,target:t,l10n:this.l10n}));if(Array.isArray(m))m.forEach(function(e){if(e&&"function"==typeof e.destroy)o.renderedInstances.push(e);else if(e instanceof HTMLElement)for(var t=0,n=Object.keys(o.inputRefs);t<n.length;t++){var a=n[t],a=o.inputRefs[a],i=a&&(a.element||a.target||a.hostElement&&a.hostElement());i&&(i===e||e.contains(i))&&o.renderedInstances.push(a)}});else if(m)if("function"==typeof m.destroy)this.renderedInstances.push(m);else if(m instanceof HTMLElement)for(var f=0,y=Object.keys(this.inputRefs);f<y.length;f++){var v=y[f],v=this.inputRefs[v],g=v&&(v.element||v.target||v.hostElement&&v.hostElement());g&&(g===m||m.contains(g))&&this.renderedInstances.push(v)}a=_.createElement("div",{id:"error-"+(r.id||r.name||r.label),className:"e-error-message",attrs:{role:"alert","aria-live":"assertive"}});return a.style.display="none",u&&s&&s.errors[r.id]&&(a.textContent=s.errors[r.id],a.classList.add("e-error"),a.style.display="block"),c.appendChild(a),p.appendChild(c),i.appendChild(p),r.description&&((l=_.createElement("div",{className:"field-description",attrs:{"aria-describedby":"description-"+r.label}})).textContent=r.description,i.appendChild(l)),i},w.prototype.renderComponent=function(s){var n,a,i,l=this,e=this.formState,t=e?e.values:{},r=!1!==s.visible&&$.isFieldVisible(s.conditions,t),o=$.isFieldHidden(s.conditions,t);if(!r||o)return e&&void 0!==e.values[s.id]&&null!==e.values[s.id]&&(e.values[s.id]=null),null;if(me.PRESERVABLE_TYPES.has(s.type)&&this.preservedFields.has(s.id)){r=this.preservedFields.get(s.id);if(r)return this.preservedFields.delete(s.id),r}switch(s.type){case"panel":(I=_.createElement("fieldset",{className:"form-panel-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",s.label&&!s.hideLabel&&((c=_.createElement("legend",{className:s.hideBorders?"":"panel-legend"})).textContent=s.label,I.appendChild(c));var c,d=_.createElement("div",{className:"panel-content"});return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&d.appendChild(e)}),I.appendChild(d),I;case"table":for(var u=s.rows||(s.tableCells?s.tableCells.length:2),p=s.columns||(s.tableCells&&s.tableCells[0]?s.tableCells[0].length:2),h=Math.floor(12/p),m=s.columnWidths,f=m?(c=m.widths,c=(i=c.map(function(e){return null===e?NaN:Number(e)})).reduce(function(e,t){return e+(isNaN(t)?0:t)},0),c=Math.max(0,Math.round(100-c)),C=i.map(function(e,t){return isNaN(e)?t:-1}).filter(function(e){return 0<=e}),0===(x=C.length)?i.map(function(e){return Math.round(e)}):(n=Math.floor(c/x),a=c-n*x,C.forEach(function(e){var t=0<a?n+1:n;i[e]=t,a=Math.max(0,a-1)}),i.map(function(e){return isNaN(e)?0:Math.round(e)}))):[],y=_.createElement("div",{className:"form-table-renderer "+(s.hideBorders?"":"table-border")+" "+(s.cssClass||""),attrs:{role:"group","aria-label":s.label||"Table Layout"}}),v=0;v<u;v++){for(var g=_.createElement("div",{className:"e-form-table-row"}),b=(s.hideBorders&&(g.style.display="flex",g.style.gap="1.5rem"),0);b<p;b++)!function(e){var t=s.tableCells&&s.tableCells[v]&&s.tableCells[v][e]||[],n=h,e=f[e],a=1===p?{width:"100%"}:e?{width:e+"%"}:{},i=!m||Array.isArray(m.widths)&&m.widths.every(function(e){return null===e}),r=0===v,o=_.createElement("div",{className:"e-form-table-cell "+(!e&&i?"col-"+n:"")});s.hideBorders?Object.assign(o.style,a,{padding:r?"0":"12px 0 0 0"}):Object.assign(o.style,a),t.forEach(function(e){e=l.renderComponent(e);e&&o.appendChild(e)}),g.appendChild(o)}(b);y.appendChild(g)}return y;case"tabs":var x=_.createElement("div",{className:"form-tabs-renderer "+(s.cssClass||"")}),C=_.createElement("div",{className:"e-tab"}),w=(C.id=s.id,_.createElement("div",{className:"e-tab-header"})),S=_.createElement("div",{className:"e-content"}),E=(C.appendChild(w),C.appendChild(S),x.appendChild(C),(s.tabItems||[]).forEach(function(e){var t=_.createElement("div"),t=(t.textContent=e.header,w.appendChild(t),_.createElement("div")),n=_.createElement("div",{className:"tab-content-renderer"});(e.content||[]).forEach(function(e){e=l.renderComponent(e);e&&n.appendChild(e)}),t.appendChild(n),S.appendChild(t)}),new N.Tab({enableRtl:this.enableRtl,cssClass:s.cssClass,enablePersistence:!0,animation:{previous:{effect:"None"},next:{effect:"None"}},selected:function(e){if("undefined"==typeof window)return null;try{window.localStorage.setItem("tab"+s.id,JSON.stringify({selectedItem:e.selectedIndex}))}catch(e){}}}));return E.appendTo(C),this.renderedInstances.push(E),x;case"card":(I=_.createElement("fieldset",{className:"e-card form-card-renderer "+(s.cssClass||"")})).style.minInlineSize="unset",I.style.padding="0";var E=_.createElement("div",{className:"e-card-header"}),T=_.createElement("div",{className:"e-card-header-caption"}),A=_.createElement("div",{className:"e-card-title"}),D=(A.textContent=s.cardTitle||s.label||"Card Title",T.appendChild(A),s.cardSubtitle&&((A=_.createElement("div",{className:"e-card-sub-title"})).textContent=s.cardSubtitle,T.appendChild(A)),E.appendChild(T),I.appendChild(E),_.createElement("div",{className:"e-card-content card-content"}));return(s.children||[]).forEach(function(e){e=l.renderComponent(e);e&&D.appendChild(e)}),I.appendChild(D),I;case"staticHtml":A=new ue({content:s.defaultValue||"<p>HTML content</p>",id:s.id,enableHtmlSanitizer:s.enableHtmlSanitizer}),T=A.render();return this.renderedInstances.push(A),T;case"message":var V=_.createElement("div",{className:"form-group"}),O=((R=_.createElement("div")).id=s.name,R.setAttribute("name",s.id),V.appendChild(R),F({component:s,locale:this.locale,value:void 0,onChange:function(){},enableRtl:this.enableRtl,target:R,ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e}}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;case"button":var E=$.isFieldDisabled(s.conditions,t),I=!!s.disabled||E,V=_.createElement("div",{className:"form-group"}),O=((R=_.createElement("div")).id=s.name,R.setAttribute("name",s.id),V.appendChild(R),F({component:k({},s,{disabled:I}),value:void 0,onChange:function(){},locale:this.locale,onClick:function(e){l.buttonClick&&(t=s.buttonsGroups?e.target&&e.target.ej2_instances?e.target.ej2_instances[0].content:"":s.label||"",l.trigger("buttonClick",{fieldName:s.name,label:t,event:e}));var t=e.target;t.type&&"reset"===t.type&&((e=t.closest("form"))&&(e.querySelectorAll('input[type="checkbox"]').forEach(function(e){e.ej2_instances[0].checked=!1}),e.querySelectorAll(".e-control.e-multiselect.e-lib").forEach(function(e){e.ej2_instances[0].value=[]})),l.formState.values={},e.reset(),l.rerenderForm(),l.validator.destroy())},ref:function(e,t){void 0!==t?l.inputRefs[s.name+"_"+t]=e:l.inputRefs[s.name]=e},enableRtl:this.enableRtl,target:R}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;case"splitButton":var R,A=$.isFieldDisabled(s.conditions,t),T=!!s.disabled||A,V=_.createElement("div",{className:"form-group"}),O=((R=_.createElement("div")).id=s.name,R.setAttribute("name",s.id),V.appendChild(R),F({component:k({},s,{disabled:T}),value:void 0,locale:this.locale,onChange:function(){},onClick:function(e){l.buttonClick&&l.trigger("buttonClick",{fieldName:s.name,label:s.label||"",event:e})},ref:function(e){e&&(l.inputRefs[s.name]=e)},enableRtl:this.enableRtl,target:R}));return Array.isArray(O)?O.forEach(function(e){e&&l.renderedInstances.push(e)}):O&&this.renderedInstances.push(O),V;default:return this.renderField(s)}},w.prototype.afterValueChange=function(e){this.formState&&(this.currentFormValues=k({},this.formState.values),this.evaluateExpressions(),this.retriggerCustomValidation(),this.beforeValidate(e),this.validator.validate(e),this.syncFormStateErrors(),e)&&this.isConditionalTrigger(e)&&this.scheduleRerender(e)},w.prototype.beforeValidate=function(e){var t=this.element.querySelector("#"+e+"-info"),t=(t&&t.classList.contains("e-error")&&t.classList.remove("e-error"),this.getInputElementByName(e)),e=t.parentElement,n=e.parentElement;(e.classList.contains("e-control-wrapper")||e.classList.contains("e-wrapper")||t.classList.contains("e-input")&&e.classList.contains("e-input-group")?e:null!=n&&(n.classList.contains("e-control-wrapper")||n.classList.contains("e-wrapper"))?n:t).classList.remove("e-error"),this.validator&&(this.validator.errorRules=[])},w.prototype.scheduleRerender=function(e){var t=this;e&&this.pendingChangedFieldIds.add(e),this.rerenderScheduled||(this.rerenderScheduled=!0,Promise.resolve().then(function(){t.rerenderScheduled=!1;var e=new Set(t.pendingChangedFieldIds);t.pendingChangedFieldIds.clear(),t.rerenderForm(e)}))},w.prototype.collectConditionFieldIds=function(e,t){if(e)if("string"==typeof e.field)t.add(e.field);else if(Array.isArray(e.rules))for(var n=0,a=e.rules;n<a.length;n++){var i=a[n];this.collectConditionFieldIds(i,t)}},w.prototype.collectDataSourceReferenceIds=function(e,n,a){if("string"==typeof e){e=e.match(/\{([^}]+)\}/g);if(e)for(var t=0,i=e;t<i.length;t++)!function(e){var t=e.slice(1,-1),e=n.find(function(e){return e.name===t});e&&e.id&&a.add(e.id)}(i[t])}},w.prototype.buildConditionalDependencyMap=function(){for(var C=new Set,w=new Map,S=this.collectAllComponents(this.processedSchemaCache.components),e=function(e){var n=new Set,t=(w.set(e.id,n),e.conditions);if(t){for(var a=0,i=["visibleWhen","hideWhen","disabledWhen","requiredWhen","readOnlyWhen","choiceBasedField","conditionalData"];a<i.length;a++){var r=i[a];t[r]&&(E.collectConditionFieldIds(t[r],C),E.collectConditionFieldIds(t[r],n))}if(Array.isArray(t.conditionalData))for(var o=0,s=t.conditionalData;o<s.length;o++){var l=s[o];if(l&&l.condition&&(E.collectConditionFieldIds(l.condition,C),E.collectConditionFieldIds(l.condition,n)),l&&Array.isArray(l.conditions))for(var c=0,d=l.conditions;c<d.length;c++){var u=d[c];E.collectConditionFieldIds(u,C),E.collectConditionFieldIds(u,n)}}t.setValueWhen&&t.setValueWhen.condition&&(E.collectConditionFieldIds(t.setValueWhen.condition,C),E.collectConditionFieldIds(t.setValueWhen.condition,n)),t.choiceBasedField&&"string"==typeof t.choiceBasedField.primaryFieldId&&(C.add(t.choiceBasedField.primaryFieldId),n.add(t.choiceBasedField.primaryFieldId))}function p(e){var t;e&&!0===e.enabled&&((t=function(e){e&&"object"==typeof e&&"string"==typeof e.field&&(C.add(e.field),n.add(e.field))})(e.minValue),t(e.maxValue))}var h=e.minMaxRange;if(Array.isArray(h))for(var m=0,f=h;m<f.length;m++)p(f[m]);h=e.minMaxTimeRange;if(Array.isArray(h))for(var y=0,v=h;y<v.length;y++)p(v[y]);h=e.dataSource;if("dataGrid"===e.type&&h&&"url"===h.type&&(h.search&&"string"==typeof h.search.key&&(E.collectDataSourceReferenceIds(h.search.key,S,C),E.collectDataSourceReferenceIds(h.search.key,S,n)),Array.isArray(h.filters)))for(var g=0,b=h.filters;g<b.length;g++){var x=b[g];"string"==typeof x.value&&(E.collectDataSourceReferenceIds(x.value,S,C),E.collectDataSourceReferenceIds(x.value,S,n))}},E=this,t=0,n=S;t<n.length;t++)e(n[t]);this.conditionalTriggerFieldIds=C,this.consumerDependencyMap=w},w.prototype.isConditionalTrigger=function(e){return this.conditionalTriggerFieldIds.has(e)},w.prototype.rerenderForm=function(e){var n=this,i=e||new Set,e=document.activeElement,t=e&&e.getAttribute?e.getAttribute("name"):null,a=null,r=null;if(t&&e&&void 0!==e.selectionStart)try{a=e.selectionStart,r=e.selectionEnd}catch(e){}for(var o,e=this.element.scrollTop,s=this.element.scrollLeft,l=window.scrollX,c=window.scrollY,d=(this.preservedFields.clear(),this.collectAllComponents(this.processedSchemaCache.components)),u=this,p=0,h=d;p<h.length;p++)!function(e){var t,n,a;!me.PRESERVABLE_TYPES.has(e.type)||(t=u.consumerDependencyMap.get(e.id),n=!1,t&&i.forEach(function(e){t.has(e)&&(n=!0)}),n)||(a=u.element.querySelector('[data-field-id="'+e.id+'"]'))&&a.parentElement&&(a.parentElement.removeChild(a),u.preservedFields.set(e.id,a))}(h[p]);this.refreshing=!0,this.destroyRenderedExcludingPreserved(),this.removePreviousRoot(),this.validator&&this.validator.destroy(),this.render(),this.refreshing=!1;try{this.element.scrollTop=e,this.element.scrollLeft=s,window.scrollTo(l,c)}catch(e){}if(t){d=this.getInputElementByName(t);if(d&&"function"==typeof d.focus)try{if(d.focus(),null!==a&&null!==r&&"function"==typeof d.setSelectionRange)try{d.setSelectionRange(a,r)}catch(e){}}catch(e){}}0<this.preservedFields.size&&(o=[],this.preservedFields.forEach(function(e,t){if(n.element.contains(e)||document.body.contains(e))o.push(t);else{n.destroyPreservedSubtree(e);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){}n.preservedFields.delete(t)}}),o.forEach(function(e){return n.preservedFields.delete(e)}))},w.prototype.removePreviousRoot=function(){if(this.element)for(;0<this.element.childNodes.length;)this.element.removeChild(this.element.firstChild)},w.prototype.destroyRenderedInstance=function(e){if(e&&"function"==typeof e.destroy){var t=e;if(!(t.isDestroyed||t.destroyed||t.disposed)){var n=e.element||e.target||(e.hostElement&&"function"==typeof e.hostElement?e.hostElement():void 0);try{t.isDestroyed=!0,t.destroyed=!0,t.disposed=!0,e.destroy()}catch(e){console.warn("FormRenderer: failed to destroy child instance.",e)}finally{if(n&&n.parentNode)try{n.parentNode.removeChild(n)}catch(e){}}}}},w.prototype.destroyRenderedExcludingPreserved=function(){for(var n=[],a=Array.from(this.preservedFields.values()),i=this,e=0,t=this.renderedInstances;e<t.length;e++)!function(e){var t=e&&(e.element||e.target||e.hostElement&&e.hostElement());!!t&&a.some(function(e){return e===t||e.contains(t)})?n.push(e):i.destroyRenderedInstance(e)}(t[e]);this.renderedInstances=n;for(var r=Object.keys(this.inputRefs),o=this,s=0,l=r;s<l.length;s++)!function(e){var t=o.inputRefs[e],n=t&&(t.element||t.target||t.hostElement&&t.hostElement());!!n&&a.some(function(e){return e===n||e.contains(n)})||delete o.inputRefs[e]}(l[s]);this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set},w.prototype.destroyPreservedSubtree=function(e){for(var t=[],n=0,a=this.renderedInstances;n<a.length;n++){var i=a[n],r=i&&(i.element||i.target||i.hostElement&&i.hostElement());r&&(r===e||e.contains(r))?this.destroyRenderedInstance(i):t.push(i)}this.renderedInstances=t},w.prototype.getInputElementByName=function(e){e=this.element.querySelector('[name="'+e+'"]');if(!e)return null;if(!e.classList.contains("e-control")){var t=e.parentElement?e.parentElement.querySelector(".e-control"):null;if(t)return t}return e},w.prototype.evaluateExpressions=function(){if(this.formState&&this.expressionEngine&&!this.expressionEvaluationInProgress)try{this.expressionEvaluationInProgress=!0;for(var p=this.expressionEngine,e=this.expressionDependencyGraph,h=this.formState.values||{},m=this.collectAllComponents(this.processedSchemaCache.components),t=this.previousFormValues,f=this.computedFieldNames,y={},n=(m.forEach(function(e){e.name&&(y[e.id]=e.name)}),{}),a=Object.keys(h),i=0,r=a;i<r.length;i++){var o=r[i],s=h[o];(g=y[o])&&(n[g]=s)}for(var l=k({},t),c=(Object.assign(t,n),new Set),d=Object.keys(n),u=0,v=d;u<v.length;u++)!function(t){var e=Object.keys(y).find(function(e){return y[e]===t});e&&n[t]!==l[t]&&!f.has(e)&&c.add(t)}(g=v[u]);if(0!==c.size){for(var g,b=p.getTopologicalOrder(e),x=this,C=0,w=b;C<w.length;C++)!function(t){var e=m.find(function(e){return e.name===t});if(e&&e.expressionValue){f.add(e.id);try{if(!1!==e.visible&&$.isFieldVisible(e.conditions,h)){for(var n={},a=Object.keys(h),i=0,r=a;i<r.length;i++){var o=r[i],s=h[o],l=y[o];l&&(n[l]=s)}if(null!=(d="string"==typeof(d=p.evaluate(e.expressionValue,n))&&-1!==d.indexOf("undefined")?d.replace(/undefined/g,""):d)&&""!==d)switch(e.type){case"number":var c=Number(d),d=isNaN(c)?0:c;break;case"checkbox":case"switch":d=Boolean(d);break;case"textbox":case"textarea":d=String(d);break;case"dateRange":case"checkboxGroup":case"multiselect":break;default:d=String(d)}if(null!=d&&d!==h[e.id]&&x.formState&&(x.formState.values[e.id]=d,x.validator)){var u=x.getInputElementByName(e.id);if(u)try{u.ej2_instances[0]?u.ej2_instances[0].value=d:u.value=String(d)}catch(e){}}}}catch(e){x.failure&&x.trigger("failure",{error:e})}}}(g=w[C]);Object.assign(t,n)}}finally{this.expressionEvaluationInProgress=!1}},w.prototype.retriggerCustomValidation=function(){var t=this;if(this.formState&&this.customValidationEngine)try{var a,i=this.collectAllComponents(this.processedSchemaCache.components),n=this.formState.values||{},r=this.previousFormValues,o=new Set;Object.keys(n).forEach(function(e){n[e]!==r[e]&&o.add(e)}),0!==o.size&&(a=new Set,o.forEach(function(t){var e=i.find(function(e){return e.id===t});e&&e.customValidation&&Array.isArray(e.customValidation)&&a.add(t)}),i.forEach(function(n){n.customValidation&&Array.isArray(n.customValidation)&&n.customValidation.forEach(function(e){t.customValidationEngine.extractDependencies(e.expression).forEach(function(t){var e=i.find(function(e){return e.id===t||e.name===t});e&&o.has(e.id)&&a.add(n.id)})})}),this.previousFormValues=k({},n))}catch(e){this.failure&&this.trigger("failure",{error:e})}},w.prototype.handleSubmitData=function(e){for(var t=this.formState,n=!(!t||!t.errors)&&0===Object.keys(t.errors).length,a={},i=t?t.values:{},r=new Set(["button","message","panel","table","tabs"]),t=this.collectAllComponents(this.processedSchemaCache.components||[]),o=new Set(t.filter(function(e){return r.has(e.type)}).map(function(e){return e.id})),s=new Set(t.filter(function(e){return!1===e.visible||!(!e.conditions||!e.conditions.visibleWhen||$.isFieldVisible(e.conditions,i))||!!(e.conditions&&e.conditions.hideWhen&&$.isFieldHidden(e.conditions,i))}).map(function(e){return e.id})),l=new Set(t.filter(function(e){return!!e.disabled||!(!e.conditions||!e.conditions.disabledWhen)&&$.isFieldDisabled(e.conditions,i)}).map(function(e){return e.id})),c=0,d=Object.keys(e);c<d.length;c++){var u=d[c],p=e[u];if(o.has(u)||s.has(u)||l.has(u))return;a[this.idToLabelCache[u]||u]=p}this.submit&&this.trigger("submit",{data:a,isValid:n})},w.prototype.getComponent=function(e){return this.inputRefs[e]||null},w.prototype.onPropertyChanged=function(e,t){var n=!1;e.schema!==t.schema&&(n=!0),e.locale!==t.locale&&(n=!0),e.enableRtl!==t.enableRtl&&(n=!0),e.layout!==t.layout&&(n=!0),(n=e.locale!==t.locale?!0:n)&&(this.refreshing=!0,this.destroyRendered(),this.removePreviousRoot(),this.isInitialized=!1,this.render(),this.refreshing=!1)},w.prototype.destroyRendered=function(){var t=this;if(this.validator){try{this.validator.destroy()}catch(e){this.trigger("failure",{error:e})}this.validator=null}this.renderedInstances.forEach(function(e){t.destroyRenderedInstance(e)}),this.renderedInstances=[],this.removePreviousRoot(),this.inputRefs={},this.tooltipRefs={},this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set,this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.pendingChangedFieldIds=new Set},w.prototype.clearPersistedTabSelections=function(){if("undefined"==typeof window)return null;try{var e=this.processedSchemaCache&&this.processedSchemaCache.components?this.processedSchemaCache.components:[];this.collectAllComponents(e).forEach(function(e){"tabs"===e.type&&e.id&&window.localStorage.removeItem("tab"+e.id)})}catch(e){}},w.prototype.destroy=function(){this.destroyRendered(),this.formState={values:{},errors:{}},this.expressionEngine=null,this.customValidationEngine=null,this.clearEngineCaches(),this.clearPersistedTabSelections(),this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.conditionalTriggerFieldIds=new Set,x.prototype.destroy.call(this)},w.prototype.clearEngineCaches=function(){if(this.expressionEngine)try{this.expressionEngine.clearCache()}catch(e){}if(this.customValidationEngine){var e=this.customValidationEngine.expressionEngine;if(e&&"function"==typeof e.clearCache)try{e.clearCache()}catch(e){}}},w.PRESERVABLE_TYPES=new Set(["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"]),C([_.Property(null)],w.prototype,"schema",void 0),C([_.Property("SingleColumn")],w.prototype,"layout",void 0),C([_.Property("")],w.prototype,"className",void 0),C([_.Event()],w.prototype,"submit",void 0),C([_.Event()],w.prototype,"change",void 0),C([_.Event()],w.prototype,"buttonClick",void 0),C([_.Event()],w.prototype,"failure",void 0),C([_.Event()],w.prototype,"created",void 0),me=C([_.NotifyPropertyChanges],w));function w(e,t){e=x.call(this,e,t)||this;return e.processedSchemaCache={version:"1.0.0",components:[]},e.l10n=new _.L10n("form-renderer",ve,e.locale),e.formState={values:Object.create(null),errors:Object.create(null)},e.validator=null,e.inputRefs={},e.conditionalValueApplied={},e.expressionEngine=null,e.expressionDependencyGraph={},e.expressionEvaluationInProgress=!1,e.previousFormValues={},e.computedFieldNames=new Set,e.customValidationEngine=new U,e.currentFormValues={},e.isInitialized=!1,e.hasLayoutComponentsCache=!1,e.idToLabelCache={},e.initialValuesCache={},e.renderedInstances=[],e.tooltipRefs={},e.createdFired=!1,e.rerenderScheduled=!1,e.conditionalTriggerFieldIds=new Set,e.preservedFields=new Map,e.consumerDependencyMap=new Map,e.pendingChangedFieldIds=new Set,e}(C=e.FormLayout||(e.FormLayout={})).SingleColumn="SingleColumn",C.TwoColumn="TwoColumn",C.ThreeColumn="ThreeColumn",C.FourColumn="FourColumn";e.FORM_COMPONENT_TYPES=["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"],e.FormRenderer=fe,e.defaultLocale=ve,Object.defineProperty(e,"__esModule",{value:!0})});
11
2
  //# sourceMappingURL=ej2-form-renderer.umd.min.js.map
@@ -1,11 +1,2 @@
1
- /*!
2
- * filename: ej2-form-renderer.min.js
3
- * version : 34.2.3
4
- * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  this.ej=this.ej||{},this.ej.formrenderer=function(e,t,n,r,a,i,o,s,l,d,c,u,p,h){"use strict";function m(e){for(var t=new Map,n=0,r=Object.keys(e.properties);n<r.length;n++){var a=r[n];t.set(a,e.properties[a])}var i,o=new Set,s=function(e){for(var n=[],r=0,a=e;r<a.length;r++)!function(e){if("field"===e.type){var r=e;if(o.has(r.propertyId))return"continue";o.add(r.propertyId);var a=t.get(r.propertyId);if(a)n.push(f(a));else{var i={id:r.propertyId||w("textbox"),name:S(""),type:"textbox",label:"Unknown Field",_configured:!0};n.push(i)}}else if("table"===e.type){var l=e,d=C({id:l.id||w("table"),name:l.name,type:"table",label:l.label||"Table",cssClass:l.cssClass,hideBorders:l.hideBorders,rows:l.rows,columns:l.cols,columnWidths:l.columnWidths,tableCells:[],_configured:!0},l.conditions?{conditions:l.conditions}:{});l.cells.forEach(function(e){var t=[];e.forEach(function(e){var n=s(e.children);t.push(n)}),d.tableCells.push(t)}),n.push(d)}else if("panel"===e.type){var c=e,u=C({id:c.id||w("panel"),type:"panel",name:c.name,cssClass:c.cssClass,hideBorders:c.hideBorders,hideLabel:c.hideLabel,label:c.label||"Panel",children:s(c.children),_configured:!0},c.conditions?{conditions:c.conditions}:{});n.push(u)}else if("tabs"===e.type){var p=e,h=C({id:p.id||w("tabs"),type:"tabs",name:p.name,label:p.label||"Tabs",cssClass:p.cssClass,tabOptions:p.tabOptions,tabItems:[],_configured:!0},p.conditions?{conditions:p.conditions}:{});p.tabs.forEach(function(e){h.tabItems.push({header:e.header,content:s(e.children)})}),n.push(h)}else if("card"===e.type){var m=e,v=C({id:m.id||w("card"),type:"card",name:m.name,label:m.label||"Card",cssClass:m.cssClass,hideLabel:m.hideLabel,children:s(m.children),_configured:!0},m.conditions?{conditions:m.conditions}:{});void 0!==m.cardTitle&&(v.cardTitle=m.cardTitle),void 0!==m.cardSubtitle&&(v.cardSubtitle=m.cardSubtitle),n.push(v)}}(a[r]);return n};return i=e.layout&&0!==e.layout.length?s(e.layout):Object.keys(e.properties).map(function(t){return f(e.properties[t])}),C({version:e.version,components:i},e.settings?{settings:e.settings}:{})}function f(e){var t=void 0!==e.options&&e.options.length>0,n={id:e.id||w(e.widget||v(e.type,e.format,t)),name:e.name,type:e.widget||v(e.type,e.format,t),label:e.label||e.id},r=new Set(["id","type","name","label","format","widget","defaultValue","required","options","expressionValue","minLength","maxLength","minimum","maximum","minValue","maxValue","minDate","maxDate","minTime","maxTime","regex","pattern","content","buttonType","textboxType"]);return Object.keys(e).forEach(function(t){r.has(t)||"id"===t||"name"===t||"type"===t||"label"===t||(n[t]=e[t])}),void 0!==e.defaultValue&&(n.defaultValue=e.defaultValue),void 0!==e.expressionValue&&(n.expressionValue=e.expressionValue),void 0!==e.required&&(n.required=e.required),void 0!==e.content&&(n.content=e.content),void 0!==e.buttonType&&(n.buttonType=e.buttonType),void 0!==e.textboxType&&(n.textboxType=e.textboxType),void 0!==e.options&&(n.options=e.options),void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength&&(n.maxLength=e.maxLength),void 0!==e.minValue&&(n.minValue=e.minValue),void 0!==e.maxValue&&(n.maxValue=e.maxValue),void 0!==e.minDate&&(n.minDate=e.minDate),void 0!==e.maxDate&&(n.maxDate=e.maxDate),void 0!==e.minTime&&(n.minTime=e.minTime),void 0!==e.maxTime&&(n.maxTime=e.maxTime),void 0!==e.pattern&&(n.regex=e.pattern),n}function v(e,t,n){return"string"===e?"date"===t?"date":"date-time"===t?"dateTime":"time"===t?"time":"email"===t?"email":"url"===t?"url":n?"dropdown":"textbox":"number"===e?"number":"boolean"===e?"checkbox":"array"===e?"multiselect":"button"===e?"button":"message"===e?"message":"sign"===e?"signature":"image"===e?"imageEditor":"file"===e?"fileUpload":"color"===e?"colorPicker":"grid"===e?"dataGrid":"textbox"}function y(e){var t=e.map(function(e){return null===e?NaN:Number(e)}),n=t.reduce(function(e,t){return e+(isNaN(t)?0:t)},0),r=Math.max(0,Math.round(100-n)),a=t.map(function(e,t){return isNaN(e)?t:-1}).filter(function(e){return e>=0}),i=a.length;if(0===i)return t.map(function(e){return Math.round(e)});var o=Math.floor(r/i),s=r-o*i;return a.forEach(function(e){var n=s>0?o+1:o;t[e]=n,s=Math.max(0,s-1)}),t.map(function(e){return isNaN(e)?0:Math.round(e)})}function g(e,n){var r=new t.Internationalization,a=r.getDateFormat({format:"MM/dd/yyyy",type:"date"});return"date"===e.type&&(n=a(new Date(n))),"time"===e.type&&(n=(a=r.getDateFormat({format:"hh:mm a",type:"time"}))(new Date(n))),"dateTime"===e.type&&(n=(a=r.getDateFormat({format:"MM/dd/yyyy hh:mm a",type:"dateTime"}))(new Date(n))),"dateRange"===e.type&&Array.isArray(n)&&(n=n.map(function(e){return e?a(new Date(e)):null})),n}function b(e,t){var n="string"==typeof t&&t?t:"field_"+Date.now()+"_"+Math.floor(1e3*Math.random());if(null===e||void 0===e)return n;var r=String(e).trim();return r&&"__proto__"!==r&&"prototype"!==r&&"constructor"!==r?(r=r.replace(/[^A-Za-z0-9_-]/g,"_"),/^[A-Za-z_]/.test(r)||(r="f_"+r),r.length>100&&(r=r.slice(0,100)),"__proto__"===r||"prototype"===r||"constructor"===r?n:r):n}var x=function(){function e(){}return e.evaluateCondition=function(e,t){try{return"field"in e&&"operator"in e&&"value"in e?this.evaluateSimpleRule(e,t):"condition"in e&&"rules"in e&&this.evaluateCompositeRule(e,t)}catch(e){return!1}},e.evaluateSimpleRule=function(e,n){try{var r=n[e.field],a=e.operator.toLowerCase();if(void 0===r&&-1===["equal","equals","notequal","notequals","isempty","isnotempty"].indexOf(a))return!1;var i=Array.isArray(r),o=new t.Internationalization;switch(a){case"equal":case"equals":return r===e.value;case"notequal":case"notequals":return r!==e.value;case"startswith":return r.startsWith(e.value);case"doesnotstartswith":return!r.startsWith(e.value);case"greaterthan":case"lessthan":case"greaterthanorequal":case"lessthanorequal":var s=Number(r),l=Number(e.value);return!Number.isNaN(s)&&!Number.isNaN(l)&&("greaterthan"===a?s>l:"lessthan"===a?s<l:"greaterthanorequal"===a?s>=l:s<=l);case"dategreaterthan":case"datelessthan":var d=o.parseDate(r,{format:"MM/dd/yyyy"}),c=o.parseDate(e.value,{format:"MM/dd/yyyy"});return null!==d&&null!==c&&("dategreaterthan"===a?d>c:"datelessthan"===a?d<c:d<=c);case"timegreaterthan":case"timelessthan":var u=o.parseDate(r,{format:"hh:mm a",type:"time"}),p=o.parseDate(e.value,{format:"hh:mm a",type:"time"});if(null!==u&&null!==p){if("timegreaterthan"===a)return u>p;if("timelessthan"===a)return u<p}return!1;case"datetimegreaterthan":case"datetimelessthan":var h=o.parseDate(r,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"}),m=o.parseDate(e.value,{format:"MM/dd/yyyy hh:mm a",type:"dateTime"});if(null!==h&&null!==m){if("datetimegreaterthan"===a)return h>m;if("datetimelessthan"===a)return h<m}return!1;case"contains":return i?"string"==typeof e.value&&-1!==e.value.indexOf(",")?(f=e.value.split(",").map(function(e){return e.trim()})).some(function(e){return-1!==r.indexOf(e)}):-1!==r.indexOf(e.value):-1!==String(r).indexOf(String(e.value));case"notcontains":if(i){if("string"==typeof e.value&&-1!==e.value.indexOf(",")){var f=e.value.split(",").map(function(e){return e.trim()});return!f.some(function(e){return-1!==r.indexOf(e)})}return-1===r.indexOf(e.value)}return-1===String(r).indexOf(String(e.value));case"isempty":return i?0===r.length:!r||0===String(r).length;case"isnotempty":return i?r.length>0:!!r&&String(r).length>0;default:return!1}}catch(e){return!1}},e.evaluateCompositeRule=function(e,t){var n=this;try{if(!Array.isArray(e.rules)||0===e.rules.length)return!1;var r=e.condition.toLowerCase();return"and"===r?e.rules.every(function(e){return n.evaluateCondition(e,t)}):"or"===r&&e.rules.some(function(e){return n.evaluateCondition(e,t)})}catch(e){return!1}},e.isFieldVisible=function(e,t){try{return!e||!e.visibleWhen||this.evaluateCondition(e.visibleWhen,t)}catch(e){return!0}},e.isFieldReadOnly=function(e,t){try{return!(!e||!e.readOnlyWhen)&&this.evaluateCondition(e.readOnlyWhen,t)}catch(e){return!1}},e.isFieldDisabled=function(e,t){try{return!(!e||!e.disabledWhen)&&this.evaluateCondition(e.disabledWhen,t)}catch(e){return!1}},e.isFieldHidden=function(e,t){try{return!(!e||!e.hideWhen)&&this.evaluateCondition(e.hideWhen,t)}catch(e){return!1}},e.isFieldRequired=function(e,t){try{return!(!e||!e.requiredWhen)&&this.evaluateCondition(e.requiredWhen,t)}catch(e){return!1}},e.getConditionalValue=function(e,t){try{if(!e||!e.setValueWhen)return;if(this.evaluateCondition(e.setValueWhen.condition,t))return e.setValueWhen.value;return}catch(e){return}},e.evaluateConditionalDataRules=function(e,t){if(!e||!Array.isArray(e))return-1;for(var n=0;n<e.length;n++){var r=e[n];if(this.evaluateCondition(r.condition,t))return n}return-1},e.getChoiceBasedOptions=function(e,t,n,r){try{var a=n&&n[r];if(null===a||void 0===a)return e.showAllWhenNotMapped?t:[];var i=String(a);return i in e.choiceMapping?e.choiceMapping[i].filter(function(e){return-1!==t.indexOf(e)}):e.showAllWhenNotMapped?t:[]}catch(e){return t}},e}(),C=function(){return(C=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},w=function(e){return e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random())},S=function(e){return e+"_"+Math.floor(1e3*Math.random())},E=function(){function e(){this.supportedFunctions=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS","INCLUDES","CONTAINS","ISNAN","SUPPORTEDVALUESOF","TOSTRING","DATE","GETTIME","EVERY","SOME"],this.availableFields=new Map}return e.prototype.setAvailableFields=function(e){var t=this;this.availableFields.clear(),e.forEach(function(e){t.availableFields.set(e.name,e)})},e.prototype.validateFieldOperations=function(e){var t=[];if(0===this.availableFields.size)return t;for(var n,r=["-","*","/","%","^"],a=["-","*","/","%","^","+"],i=new Set,o=/(\{[^}]+\})/g;null!==(n=o.exec(e));){var s=n[0],l=s.slice(1,-1),d=this.availableFields.get(l);if(d){var c=n.index,u=c+s.length,p=e.substring(Math.max(0,c-10),c),h=e.substring(u,Math.min(e.length,u+10)),m=p.replace(/\s+$/,"").slice(-1),f=h.replace(/^\s+/,"").charAt(0),v=p.replace(/\s+$/,""),y=h.replace(/^\s+/,""),g=c-(p.length-v.length)-1,b=u+(h.length-y.length);if("string"===d.type&&!d.format){if(m&&-1!==r.indexOf(m)){x=g+":"+m;i.has(x)||(t.push("Cannot perform '"+m+"' operation on string field '{"+l+"}'"),i.add(x))}if(f&&-1!==r.indexOf(f)){x=b+":"+f;i.has(x)||(t.push("Cannot perform '"+f+"' operation on string field '{"+l+"}'"),i.add(x))}}if("date"===d.format||"date-time"===d.format||"time"===d.format){if(m&&-1!==a.indexOf(m)){x=g+":"+m;i.has(x)||(t.push("Cannot perform '"+m+"' operation on date field '{"+l+"}'"),i.add(x))}if(f&&-1!==a.indexOf(f)){var x=b+":"+f;i.has(x)||(t.push("Cannot perform '"+f+"' operation on date field '{"+l+"}'"),i.add(x))}}}}return t},e.prototype.validate=function(e){var t=[];if(!e||""===e.trim())return{valid:!0,errors:[]};(e.match(/\{/g)||[]).length!==(e.match(/\}/g)||[]).length&&t.push("Unbalanced braces in expression"),(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length&&t.push("Unbalanced parentheses in expression");for(var n,r=/(\w+)\s*\(/g;null!==(n=r.exec(e));){var a=n[1].toUpperCase();a===a.toUpperCase()&&-1===this.supportedFunctions.indexOf(a)&&t.push("Unknown function: "+a)}var i=this.validateFieldOperations(e);return t.push.apply(t,i),{valid:0===t.length,errors:t}},e.prototype.compile=function(e,t){void 0===t&&(t={});try{if(t.availableFields&&Array.isArray(t.availableFields)&&this.setAvailableFields(t.availableFields),!this.validate(e).valid)return function(){return null};var n=e;return n=this.compileFieldReferences(n),n=t.isCustomValidation?this.compileInputReferences(n):n,n=this.compileBareFunctionCalls(n),n=this.compileMatrixExpressions(n),function(e){try{return new Function("context","\n try {\n return "+n+";\n } catch (e) {\n return null;\n }\n ")(e)}catch(e){return null}}}catch(e){return function(){return null}}},e.prototype.compileMatrixExpressions=function(e){var t=e,n=["PI","TRUE","FALSE","NULL","UNDEFINED","Math"],r=["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"];return t=t.replace(/\$?\{([^}]+)\}/g,function(e,t){var a=t;return r.forEach(function(e){var t=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");a=a.replace(t,"context."+e)}),n.forEach(function(e){var t=new RegExp("\\b"+e+"\\b","g");a=a.replace(t,"context."+e)}),"("+a+")"})},e.prototype.compileBareFunctionCalls=function(e){var t=e;return["SUM","AVG","MIN","MAX","COUNT","ROUND","FLOOR","CEIL","ABS","SQRT","UPPER","LOWER","CONCAT","LENGTH","TRIM","SUBSTRING","TODAY","AGE","DATEFORMAT","DATEDIFF","ADDDAYS","SUBDAYS"].forEach(function(e){var n=new RegExp("(?<!context\\.)\\b"+e+"\\b(?=\\s*\\()","g");t=t.replace(n,"context."+e)}),t},e.prototype.compileFieldReferences=function(e){var t=e;return t=t.replace(/\{([^{}]+)\}/g,function(e,t){return t.startsWith("\\")&&t.endsWith("\\")?e:"context['"+t.replace(/\./g,"'].[")+"']"})},e.prototype.compileInputReferences=function(e){var t=[],n=e,r=n=(n=(n=n.replace(/(['"`])(?:(?=(\\?))\2.)*?\1/g,function(e){return t.push(e),"__STRING_"+(t.length-1)+"__"})).replace(/(?<!context\[')\binput\./g,"context['input'].")).replace(/(?<!context\[')\binput\b(?!\s*[(\.])/g,"context['input']");return t.forEach(function(e,t){r=r.replace("__STRING_"+t+"__",e)}),r},e}(),T=function(){function e(){this.escapedBracePattern=/\\{.*?\\}/g}return e.prototype.extractFieldReferences=function(e){if(!e)return[];for(var t,n=new Set,r=e.replace(this.escapedBracePattern,""),a=/\{([^{}]+)\}/g;null!==(t=a.exec(r));){var i=t[1].trim();if(!this.isFunctionCall(i)&&!this.isOperator(i)){var o=i.split(/[.\[\]]/)[0].trim();o&&!this.isKeyword(o)&&n.add(o)}}for(var s=/\$\{([^}]+)\}/g;null!==(t=s.exec(r));)for(var l=t[1],d=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b(?!\s*[(\.])/g,c=void 0;null!==(c=d.exec(l));){var u=c[1];this.isKeyword(u)||"Math"===u||n.add(u)}return Array.from(n)},e.prototype.buildGraph=function(e){for(var t={},n=0,r=Object.keys(e);n<r.length;n++){var a=r[n],i=this.extractFieldReferences(e[a]);t[a]=i}return t},e.prototype.detectCircularDependencies=function(e){for(var t=new Set,n=new Set,r=[],a=function(i,o){t.add(i),n.add(i),o.push(i);for(var s=0,l=e[i]||[];s<l.length;s++){var d=l[s];if(t.has(d)){if(n.has(d)){var c=o.indexOf(d);r.push(o.slice(c).concat([d]))}}else a(d,o.slice())}n.delete(i)},i=0,o=Object.keys(e);i<o.length;i++){var s=o[i];t.has(s)||a(s,[])}return r},e.prototype.getTopologicalOrder=function(e){for(var t=new Set,n=[],r=function(a){if(!t.has(a)){t.add(a);for(var i=0,o=e[a]||[];i<o.length;i++){var s=o[i];e[s]&&r(s)}n.push(a)}},a=0,i=Object.keys(e);a<i.length;a++){var o=i[a];r(o)}return n},e.prototype.isFunctionCall=function(e){return/^\w+\s*\(/.test(e)},e.prototype.isOperator=function(e){return/^[+\-*/()=!<>&|]/.test(e)},e.prototype.isKeyword=function(e){return-1!==["PI","TRUE","FALSE","NULL","UNDEFINED","and","or","in"].indexOf(e.toUpperCase())},e}(),A=function(){return(A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},D=function(){function e(){this.evaluationCache=new Map,this.compiledFunctions=new Map,this.parser=new E,this.dependencyTracker=new T}return e.prototype.evaluate=function(e,t,n,r){void 0===n&&(n={}),void 0===r&&(r=!1);try{if(!e||""===e.trim())return null;var a=n.timeout,i=void 0===a?5e3:a,o=n.maxDepth,s=void 0===o?10:o,l=n.locale,d=void 0===l?"en-US":l,c=n.throwOnError,u=void 0!==c&&c,p=this.getCacheKey(e,t);if(!r&&this.evaluationCache.has(p))return this.evaluationCache.get(p);var h=this.compiledFunctions.get(e);h||(h=this.parser.compile(e,{timeout:i,maxDepth:s,locale:d,isCustomValidation:r}),this.compiledFunctions.set(e,h));var m=this.buildContext(t),f=Date.now(),v=h(m);if(Date.now()-f>i){var y=new Error("Expression evaluation exceeded timeout of "+i+"ms");if(u)throw y;return null}return this.evaluationCache.set(p,v),v}catch(y){if(n.throwOnError)throw y;return null}},e.prototype.extractDependencies=function(e){return e?this.dependencyTracker.extractFieldReferences(e):[]},e.prototype.buildDependencyGraph=function(e){var t=this,n={};return e.forEach(function(e){if(e.expressionValue){var r=t.extractDependencies(e.expressionValue);n[e.name]=r}}),n},e.prototype.detectCircularDependencies=function(e){for(var t=new Set,n=new Set,r=[],a=function(i,o){t.add(i),n.add(i),o.push(i);for(var s=0,l=e[i]||[];s<l.length;s++){var d=l[s];if(t.has(d)){if(n.has(d)){var c=o.indexOf(d);r.push(o.slice(c).concat([d]))}}else a(d,o.slice())}n.delete(i)},i=0,o=Object.keys(e);i<o.length;i++){var s=o[i];t.has(s)||a(s,[])}return r},e.prototype.getTopologicalOrder=function(e){for(var t=new Set,n=[],r=function(a){if(!t.has(a)){t.add(a);for(var i=0,o=e[a]||[];i<o.length;i++)r(o[i]);n.push(a)}},a=0,i=Object.keys(e);a<i.length;a++){var o=i[a];r(o)}return n},e.prototype.clearCache=function(){this.evaluationCache.clear(),this.compiledFunctions.clear()},e.prototype.getCacheKey=function(e,t){return e+":"+JSON.stringify(t)},e.prototype.buildContext=function(e){var n=new t.Internationalization,r=n.getDateFormat({format:"MM/dd/yyyy",type:"date"});return A({},e,{PI:Math.PI,TRUE:!0,FALSE:!1,NULL:null,UNDEFINED:void 0,Math:Math,SUM:function(e){return Array.isArray(e)?e.reduce(function(e,t){return Number(e)+Number(t)},0):0},AVG:function(e){return Array.isArray(e)&&0!==e.length?e.reduce(function(e,t){return Number(e)+Number(t)},0)/e.length:0},MIN:function(e){return Array.isArray(e)&&e.length>0?Math.min.apply(Math,e.map(Number)):0},MAX:function(e){return Array.isArray(e)&&e.length>0?Math.max.apply(Math,e.map(Number)):0},COUNT:function(e){return Array.isArray(e)?e.length:0},ROUND:function(e,t){return void 0===t&&(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},FLOOR:Math.floor,CEIL:Math.ceil,ABS:Math.abs,SQRT:Math.sqrt,UPPER:function(e){return String(e).toUpperCase()},LOWER:function(e){return String(e).toLowerCase()},CONCAT:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map(String).join("")},LENGTH:function(e){return String(e).length},TRIM:function(e){return String(e).trim()},SUBSTRING:function(e,t,n){return void 0!==n?String(e).substr(t,n):String(e).substr(t)},TODAY:function(){return r(new Date)},AGE:function(e){var t="string"==typeof e?new Date(e):e,n=new Date,r=n.getFullYear()-t.getFullYear(),a=n.getMonth()-t.getMonth();return(a<0||0===a&&n.getDate()<t.getDate())&&r--,r},DATEFORMAT:function(e,t){var r="string"==typeof e?new Date(e):e;return n.getDateFormat({format:t,type:"date"})(r)},DATEDIFF:function(e,t){var n="string"==typeof e?new Date(e):e,r="string"==typeof t?new Date(t):t;return Math.floor((r.getTime()-n.getTime())/864e5)},ADDDAYS:function(e,t){var n=new Date(e);return n.setDate(n.getDate()+Number(t)),r(n)},SUBDAYS:function(e,t){var n=new Date(e);return n.setDate(n.getDate()-Number(t)),r(n)}})},e}(),V={EMAIL:/^(?!.*\.\.)[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,URL:/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/[^\s]*)?$/,DATE_ISO:/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/,DIGITS:/^[0-9]*$/,PHONE:/^[+]?[0-9]{9,13}$/,CREDIT_CARD:/^\d{13,16}$/},O=function(e){return{primary:"e-primary",flat:"e-flat",information:"e-info",error:"e-danger",success:"e-success",warning:"e-warning"}[e||"primary"]||"e-primary"},I=function(e){return"submit"===e||"reset"===e?e:"button"},R=function(e){return{Left:"flex-start",Right:"flex-end",Center:"center"}[e||"Left"]||"flex-start"},F=function(e){switch(e){case"WebApiAdaptor":return new p.WebApiAdaptor;case"ODataV4Adaptor":return new p.ODataV4Adaptor;case"UrlAdaptor":default:return new p.UrlAdaptor}},k=function(e,t){if(!t||null===e||void 0===e)return e;for(var n=e,r=0,a=t.split(/\.(?![^\[]*\])/);r<a.length;r++){var i=a[r];if(null===n||void 0===n)return null;var o=i.match(/^(\w*)\[(\d+)\]$/);if(o){var s=o[1],l=parseInt(o[2]);n=s?n[s]&&n[s][l]:n[l]}else n=n[i]}return n},N=function(e,t){var n={},r=function(t){t.forEach(function(t){t.name&&t.id in e&&(n[t.name]=e[t.id]),t.children&&r(t.children),t.tabItems&&t.tabItems.forEach(function(e){return e.content&&r(e.content)}),t.tableCells&&t.tableCells.forEach(function(e){return e.forEach(function(e){return r(e)})})})};return r(t),n},M=new D,L=function(e,t,n){if("string"!=typeof e||!/{[^}]+}/.test(e))return e;var r=n?N(t,n):t;try{var a=M.evaluate(e,r);return null!==a&&void 0!==a?String(a):""}catch(t){return e}},P=function(e,t,n){return e&&"object"==typeof e&&!Array.isArray(e)&&"lookup"===e.type&&n?n&&n.length>0?n:[]:e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type?t.length>0?t:[]:Array.isArray(e)?e:e&&"object"==typeof e&&!Array.isArray(e)&&"raw"===e.type&&Array.isArray(e.data)?e.data:[]},j=function(e,t){if(e&&e.conditionalData&&Array.isArray(e.conditionalData))for(var n=0,r=e.conditionalData;n<r.length;n++){var a=r[n];if(x.evaluateCondition(a.condition,t))return{dataSource:a.dataSource,columns:a.columns&&a.columns.length>0?a.columns:void 0}}},B=function(){function e(){}return e.fetch=function(e,t,n,r){if(!(e&&"object"==typeof e&&!Array.isArray(e)&&"url"===e.type&&e.url))return Promise.resolve({id:t,options:[]});var a=e;return new Promise(function(e){try{var i={};a.headers&&Array.isArray(a.headers)&&a.headers.forEach(function(e){e.key&&e.key.trim()&&(i[e.key]=e.value)});var o=new p.DataManager({url:a.url,adaptor:F(a.adaptorType),headers:Object.keys(i).length?i:void 0}),s=new p.Query;if(a.search&&a.search.enabled&&a.search.fields&&a.search.fields.length>0){var l=a.search.key||"search",d=n?L(l,n,r):/[{}]/.test(l)?"":l;s=s.search(d,a.search.fields)}if(a.sort&&a.sort.enabled&&a.sort.field){var c="descending"===a.sort.direction?"descending":"ascending";s=s.sortBy(a.sort.field,c)}a.filters&&Array.isArray(a.filters)&&a.filters.length>0&&a.filters.forEach(function(e){if(e.field&&e.operator&&void 0!==e.value&&""!==e.value){var t=n?L(e.value,n,r):/[{}]/.test(e.value)?"":e.value;""!==t&&(s=s.where(e.field,e.operator,t))}}),a.queryParams&&Object.keys(a.queryParams).forEach(function(e){s=s.addParams(e,a.queryParams[e])}),a.skip&&(s=s.skip(a.skip)),a.take&&(s=s.take(a.take));var u=!1,h=setTimeout(function(){u=!0,e({id:t,options:[]})},15e3);o.executeQuery(s).then(function(n){if(!u){clearTimeout(h);var r=n.result;a.dataPath&&(r=k(r,a.dataPath));var i;i=Array.isArray(r)?r:"string"==typeof r?[r]:[],e({id:t,options:i})}}).catch(function(n){u||(clearTimeout(h),e({id:t,options:[]}))})}catch(n){e({id:t,options:[]})}})},e}(),U=function(e){return e?Array.isArray(e)?e.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):e:{}},_=function(){function e(e){this.checkboxes=[],this.component=e.component,this.formState=e.formState,this.onChangeCb=e.onChange,this.optionRef=e.optionRef,this.enableRtl=e.enableRtl,this.target=e.target,this.container=null,this.itemsContainer=null,this.ref=e.ref}return e.prototype.getSelectedItems=function(){var e=this.formState?this.formState.values[this.component.id]:t.isNullOrUndefined(this.valueProp())?this.component.defaultValue:this.valueProp();return Array.isArray(e)?e:[]},e.prototype.valueProp=function(){return this._value},e.prototype.setValue=function(e){this._value=e},e.prototype.handleCheckboxChange=function(e,t){var n=this.getSelectedItems(),r=t?n.concat([e]):n.filter(function(t){return t!==e});this.formState&&this.onChangeCb(r)},Object.defineProperty(e.prototype,"sizeCssClass",{get:function(){return""+(this.component.cssClass||"")+("Small"===this.component.size?" e-small":"Bigger"===this.component.size?" e-bigger":"")},enumerable:!0,configurable:!0}),e.prototype.render=function(e){var t=this,n=this.component,r=n.label&&n.required?n.label+" *":n.label||"",a=e||this.target,o=document.createElement("div");o.className=("checkbox-group "+(n.cssClass||"")).trim(),o.setAttribute("role","group"),o.setAttribute("aria-label",r),o.title=n.tooltip||"";var s=U(n.htmlAttributes);Object.keys(s).forEach(function(e){"class"!==e&&"className"!==e&&"style"!==e&&o.setAttribute(e,String(s[e]))});var l="display:flex;flex-direction:"+("row"===n.layoutDirection?"row":"column")+";gap:"+(n.gap||"8px")+";align-items:flex-start;";o.setAttribute("style",l);var d=document.createElement("div");d.className="checkbox-group-items";var c="display:flex;flex-direction:"+("row"===n.layoutDirection?"row":"column")+";flex-wrap:wrap;gap:"+(n.gap||"2px")+";width:100%;";d.setAttribute("style",c);var u=Array.isArray(n.options)?n.options:["Option 1"],p=this.getSelectedItems();return u.forEach(function(e,r){var a="string"==typeof e?e:null!=e.value?e.value:null!=e.label?e.label:e.key,o="string"==typeof e?e:null!=e.label?e.label:null!=e.value?e.value:String(a),l=document.createElement("input");d.appendChild(l);var c=new i.CheckBox({label:o,enableRtl:t.enableRtl,checked:-1!==p.indexOf(a),disabled:!!n.disabled,labelPosition:n.checkboxLabelPosition||"After",cssClass:t.sizeCssClass.trim(),htmlAttributes:s,change:function(e){t.handleCheckboxChange(a,e.checked)}});c.appendTo(l),t.ref(c,r);var u=l.querySelector('input[type="checkbox"]');u&&(u.id=t.component.id+"_"+r),t.optionRef&&t.optionRef(c,r),t.checkboxes.push(c)}),o.appendChild(d),a&&a.appendChild(o),this.container=o,this.itemsContainer=d,o},e.prototype.refreshSelection=function(){var e=this,t=this.getSelectedItems();(Array.isArray(this.component.options)?this.component.options:["Option 1"]).forEach(function(n,r){var a="string"==typeof n?n:null!=n.value?n.value:null!=n.label?n.label:n.key,i=e.checkboxes[r];i&&(i.checked=-1!==t.indexOf(a))})},e.prototype.destroy=function(){for(var e=0,t=this.checkboxes;e<t.length;e++){var n=t[e];try{n.destroy()}catch(e){}}this.checkboxes=[],this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.itemsContainer=null},e.prototype.setOptions=function(e){var t=this;if(this.component.options=e,this.itemsContainer){for(var n=0,r=this.checkboxes;n<r.length;n++){var a=r[n];try{a.destroy()}catch(e){}}for(this.checkboxes=[];this.itemsContainer.firstChild;)this.itemsContainer.removeChild(this.itemsContainer.firstChild);var o=this.getSelectedItems();e.forEach(function(e,n){var r="string"==typeof e?e:e.value||e.label||e.key,a="string"==typeof e?e:e.label||e.value||String(r),s=document.createElement("input");t.itemsContainer.appendChild(s);var l=new i.CheckBox({label:a,enableRtl:t.enableRtl,checked:-1!==o.indexOf(r),disabled:!!t.component.disabled,labelPosition:t.component.checkboxLabelPosition||"After",cssClass:t.sizeCssClass.trim(),change:function(e){t.handleCheckboxChange(r,e.checked)}});l.appendTo(s),t.ref(l,n);var d=s.querySelector('input[type="checkbox"]');d&&(d.id=t.component.id+"_"+n),t.optionRef&&t.optionRef(l,n),t.checkboxes.push(l)})}},e}(),z=function(){return(z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},W=function(){function e(){this.engine=new D}return e.prototype.parseColumnValue=function(e,t){if(null===e||void 0===e||""===e)return e;if("number"===t){var n=parseFloat(String(e));return isNaN(n)?0:n}return"boolean"===t?"boolean"==typeof e?e:"true"===e||"1"===e||1===e||!0===e:e},e.prototype.evaluateRowExpressions=function(e,t){for(var n=this,r=z({},e),a=this,i=0,o=t.filter(function(e){return e.expression&&e.expression.toString().trim()});i<o.length;i++)!function(e){if(!e.expression)return"continue";try{var i={};t.forEach(function(e){var t=r[e.field];i[e.field]=n.parseColumnValue(t,e.type)});var o=a.engine.evaluate(e.expression,i,{throwOnError:!1});r[e.field]=o}catch(t){r[e.field]=null}}(o[i]);return r},e.prototype.extractCalculatedColumns=function(e){return e.filter(function(e){return e.expression&&e.expression.toString().trim()})},e.prototype.getEngine=function(){return this.engine},e}(),q=function(){return(q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},H=function(){function e(){this.expressionEngine=new D}return e.prototype.validate=function(e,t,n){if(!e||""===e.trim())return!0;try{var r=q({},n,{input:t,valid:!0}),a=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*['"](.+?)['"]\s*$/);if(!a)return"Invalid validation expression format";var i=a[1].trim(),o=a[2];return!0===this.expressionEngine.evaluate(i,r,{throwOnError:!1},!0)||o}catch(e){return"Validation expression error"}},e.prototype.extractDependencies=function(e){if(!e)return[];var t=e.match(/valid\s*=\s*(.+)/),n=t?t[1]:e;return this.expressionEngine.extractDependencies(n).filter(function(e){return"input"!==e})},e.prototype.validateConditionSyntax=function(e,t){if(!e||""===e.trim())return["Condition cannot be empty"];var n=[],r=(e.match(/\(/g)||[]).length,a=(e.match(/\)/g)||[]).length;r!==a&&n.push("Unbalanced parentheses ("+r+" open, "+a+" close)");var i=(e.match(/\{/g)||[]).length,o=(e.match(/\}/g)||[]).length;i!==o&&n.push("Unbalanced braces ("+i+" open, "+o+" close)");var s=this.extractDependencies(e).filter(function(e){return-1===t.indexOf(e)});return s.length>0&&n.push("Unknown field references: "+s.join(", ")),n},e.prototype.buildExpression=function(e,t){return"valid = "+e.trim()+" ? true : '"+t.replace(/'/g,"\\'")+"'"},e.prototype.parseExpression=function(e){var t=e.match(/valid\s*=\s*(.+?)\s*\?\s*true\s*:\s*'(.+)'/);return t?{condition:t[1].trim(),errorMessage:t[2].replace(/\\'/g,"'")}:null},e}(),G=function(){return(G=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},$=function(){function e(e){var t=this;this.grid=null,this.wrapper=null,this.mapCustomValidationToSyncfusion=function(e){if(e.customValidation&&0!==e.customValidation.length)return function(n){var r=t.grid&&t.grid.editModule?t.grid.editModule.formObj:null;if(!r)return!0;var a={};(t.columns||[]).forEach(function(e){var t=r.getInputElement(e.field);if(t){var n=t.value;a[e.field]="number"===e.type?parseInt(n,10):n}});for(var i=0,o=e.customValidation;i<o.length;i++){var s=o[i];if(s.expression){var l="number"===e.type?parseInt(n.value,10):n.value;return!0===t.validationEngine.validate(s.expression,l,a)}}return!0}},this.createEditParams=function(e){if(t.hasExpressions){var n=t.calculatedColumns;if(n.some(function(t){return!!t.expression&&-1!==t.expression.indexOf("{"+e.field+"}")}))return{params:{change:function(){if(t.grid&&t.grid.element){var e=t.grid.element.querySelector("form");if(e&&e.ej2_instances&&e.ej2_instances[0]){var r=e.ej2_instances[0];n.forEach(function(e){var n=r.getInputElement(e.field);if(n)try{var a={};t.columns.forEach(function(e){var t=r.getInputElement(e.field);t&&(a[e.field]=t.value)});var i=t.gridExpressions.evaluateRowExpressions(a,t.columns)[e.field];if(void 0!==i&&null!==i)if("boolean"===e.type)n.checked=!!i;else if("number"===e.type){var o=n.closest(".e-control-wrapper"),s=o?o.querySelector('input.e-control:not([type="hidden"])'):null;s&&s.ej2_instances&&s.ej2_instances[0]?s.ej2_instances[0].value=i:n.value=i}else"date"===e.type?n.ej2_instances[0].value=new Date(i):n.value=i}catch(e){}})}}}}}}},this.handleActionComplete=function(e){if(t.grid)switch(e.requestType){case"save":case"delete":case"add":if(t.grid.dataSource){var n=Array.isArray(t.grid.dataSource)?t.grid.dataSource:[];t.currentData=n,t.onDataChange&&t.onDataChange(n)}}},this.id=e.id,this.columns=e.columns||[],this.dataSource=Array.isArray(e.dataSource)?e.dataSource:[],this.height=null!=e.height?e.height:"200px",this.width=null!=e.width?e.width:"100%",this.locale=e.locale,this.cssClass=e.cssClass,this.pageSize=null!=e.pageSize?e.pageSize:6,this.allowPaging=!1!==e.allowPaging,this.allowAdding=!1!==e.allowAdding,this.allowEditing=!1!==e.allowEditing,this.allowDeleting=!1!==e.allowDeleting,this.allowFiltering=!0===e.allowFiltering,this.onDataChange=e.onDataChange,this.isPreviewMode=e.isPreviewMode,this.enableRtl=e.enableRtl,this.ref=e.ref,this.currentData=Array.isArray(this.dataSource)?this.dataSource:[],this.gridExpressions=new W,this.validationEngine=new H}return Object.defineProperty(e.prototype,"calculatedColumns",{get:function(){return this.gridExpressions.extractCalculatedColumns(this.columns)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasExpressions",{get:function(){return this.calculatedColumns.length>0},enumerable:!0,configurable:!0}),e.prototype.buildToolbar=function(){var e=[];return this.allowAdding&&e.push("Add"),this.allowEditing&&e.push("Edit"),this.allowDeleting&&e.push("Delete"),e.push("Update","Cancel"),e},e.prototype.mapColumn=function(e){var t=e.validationRules?G({},e.validationRules):{},n=this.mapCustomValidationToSyncfusion(e);if(n){var r=e.customValidation&&e.customValidation[0]&&e.customValidation[0].expression?(this.validationEngine.parseExpression?this.validationEngine.parseExpression(e.customValidation[0].expression).errorMessage:"Validation failed")||"Validation failed":"Validation failed";t.required=[!0,r],t.custom=[n,r]}return{field:e.field,headerText:e.headerText,type:e.type||"string",isPrimaryKey:e.isPrimaryKey||!1,width:e.width,format:"date"===e.type?e.format||"MM/dd/yyyy":e.format,editType:e.editType,allowEditing:!1!==e.allowEditing&&!e.expression,validationRules:t,edit:this.createEditParams(e)}},e.prototype.render=function(e){var t=this,n=Array.isArray(this.dataSource)?this.dataSource:[];this.hasExpressions&&n.length>0?this.currentData=n.map(function(e){var n=t.gridExpressions.evaluateRowExpressions(e,t.columns);return G({},e,n)}):this.currentData=n;var r=document.createElement("div");r.className="datagrid-wrapper",r.style.width="string"==typeof this.width?this.width:this.width+"px",r.style.height="auto";var a=document.createElement("div");a.className="datagrid-grid",r.appendChild(a),this.id&&(a.id=this.id);var i=new h.Grid({dataSource:this.currentData,allowPaging:this.allowPaging,filterSettings:{mode:"Immediate"},pageSettings:{pageSize:this.pageSize},editSettings:{allowEditing:this.allowEditing,allowAdding:this.allowAdding,allowDeleting:this.allowDeleting,mode:"Normal"},enableRtl:this.enableRtl,locale:this.locale||"en-US",cssClass:this.cssClass,toolbar:this.buildToolbar(),actionComplete:this.handleActionComplete,height:"string"==typeof this.height?this.height:this.height+"px",width:"string"==typeof this.width?this.width:this.width+"px",allowSorting:!0,allowFiltering:this.allowFiltering,allowSelection:!0,columns:(this.columns||[]).map(function(e){return t.mapColumn(e)})});return i.appendTo(a),this.ref(i),this.grid=i,e&&e.appendChild(r),this.wrapper=r,r},e.prototype.getRef=function(){var e=this;return{getGridData:function(){return e.currentData},gridRef:{current:this.grid}}},e.prototype.getGridData=function(){return this.currentData},e.prototype.setDataSource=function(e){var t=this;if(this.grid){var n=Array.isArray(e)?e:[];this.hasExpressions&&n.length>0?this.currentData=n.map(function(e){var n=t.gridExpressions.evaluateRowExpressions(e,t.columns);return G({},e,n)}):this.currentData=n,this.grid.dataSource=this.currentData,this.grid.refreshBatchData?this.grid.setProperties({dataSource:this.currentData},!0):this.grid.dataSource=this.currentData,this.grid.refresh&&this.grid.refresh()}},e.prototype.setColumns=function(e){this.grid&&(e&&0!==e.length?0===this.grid.columns.length&&e&&1===e.length&&(this.grid.columns=e):this.grid.columns=[],this.columns=e,this.grid.refresh&&!this.isPreviewMode&&(this.dataSource&&Array.isArray(this.dataSource)&&this.dataSource.length>0&&!this.hasExpressions&&(this.grid.dataSource=this.dataSource),this.grid.refresh()))},e.prototype.destroy=function(){if(this.grid){try{this.grid.destroy()}catch(e){}this.grid=null}this.wrapper&&this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper),this.wrapper=null,this.gridExpressions=null,this.validationEngine=null,this.currentData=[],this.columns=[],this.dataSource=[]},e}();h.Grid.Inject(h.Edit,h.Toolbar,h.Page,h.Resize,h.Sort,h.Filter);var J=function(){return(J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},Y=function(e){return e?Array.isArray(e)?e.reduce(function(e,t){return t&&t.key&&void 0!==t.value&&(e[t.key]=t.value),e},{}):e:{}},Z=function(e,t){e&&t&&e.setAttribute("id",t)},K=function(e){var n=e.component,r=e.value,p=e.onChange,h=e.onBlur,m=e.onClick,f=e.hasError,v=void 0!==f&&f,y=e.locale,g=e.formState,b=e.settings,C=e.components,w=e.enableRtl,S=e.ref,E=e.l10n,T=e.initializedGrids||new Set,A=e.target,D={floatLabelType:n.floatLabelType||"Never",placeholder:n.placeholder||"",enabled:!n.disabled},V=function(e){var t=n.validateOn||"Change",r={};return t&&"Change"!==t||(r.change=function(t){return p(e(t))},r.blur=function(){h&&h()}),"Blur"===t&&(r.change=function(t){return p(e(t))},r.blur=function(){h&&h()}),r},F=Y(n.htmlAttributes);n.required&&(F["aria-required"]="true");var k=v?"e-error":"",N=((n.cssClass||"")+" "+k+" "+("Small"===n.size?" e-small":"Bigger"===n.size?" e-bigger":"")).trim();switch(n.type){case"textbox":var M=new a.TextBox(J({id:n.name,type:n.multiline?"hidden":n.textboxType?n.textboxType:"text",name:n.id,enableRtl:w,locale:y,floatLabelType:D.floatLabelType,placeholder:D.placeholder,enabled:D.enabled,value:void 0!==r?r:n.defaultValue||"",multiline:n.multiline,showClearButton:n.showClearButton,autocomplete:!1===n.autocomplete||void 0===n.autocomplete?"off":"on",readonly:n.readOnly||!1,cssClass:N,htmlAttributes:F,appendTemplate:n.suffix,prependTemplate:n.prefix},V(function(e){return e.value||""})));return A&&M.appendTo(A),S(M),M;case"textarea":var L=new a.TextArea(J({id:n.name,name:n.id,enableRtl:w,locale:y,floatLabelType:D.floatLabelType,placeholder:D.placeholder,enabled:D.enabled,value:void 0!==r?r:n.defaultValue||"",cols:n.cols||200,rows:n.textareaRows||4,showClearButton:n.showClearButton||!1,readonly:n.readOnly||!1,maxLength:n.maxLength||255,cssClass:N,htmlAttributes:F,appendTemplate:n.suffix,prependTemplate:n.prefix,resizeMode:"Vertical"},V(function(e){return e.value||""})));return A&&L.appendTo(A),S(L),L;case"number":var U=""===r?void 0:r,z=new a.NumericTextBox({locale:y,enableRtl:w,floatLabelType:D.floatLabelType,placeholder:D.placeholder,enabled:D.enabled,value:void 0!==U?U:n.defaultValue||void 0,decimals:n.decimals||2,currency:n.currency,format:n.numberFormat||"n2",step:n.step||1,min:n.minValue||void 0,max:n.maxValue||void 0,readonly:n.readOnly||!1,showClearButton:n.showClearButton||!1,cssClass:N,htmlAttributes:F,appendTemplate:n.suffix,prependTemplate:n.prefix,change:function(e){return p(e.value)}});return A&&(Z(A,n.name),A.setAttribute("name",n.id),z.appendTo(A)),S(z),z;case"checkbox":var W=n.label&&n.required?n.label+" *":n.label,q=new i.CheckBox({locale:y,name:n.id,enableRtl:w,label:W,labelPosition:n.checkboxLabelPosition,checked:void 0!==n.checked&&null!==n.checked&&n.checked||void 0!==r&&null!==r&&r,indeterminate:n.indeterminate||!1,disabled:n.disabled,cssClass:N,htmlAttributes:F,change:function(e){return p(e.checked)}});return A&&(Z(A,n.name),q.appendTo(A)),S(q),q;case"checkboxGroup":var H=[];B.fetch(n.options,n.id,g?g.values:void 0,C).then(function(e){e.id===n.id&&e.options.length>0&&(H.push.apply(H,e.options),Q.setOptions(H))}).catch(function(){});var G=P(n.options,H),K=G.length>0?G:n.options||["Option 1"],Q=new _({component:J({},n,{options:K}),formState:g,value:r,enableRtl:w,onChange:function(e){return p(e)},optionRef:e.ref,target:A,ref:S});return A&&Z(A,n.name),Q.render(A),Q;case"radio":var X=Array.isArray(n.options)?n.options:["Option 1"],ee=t.createElement("div",{id:n.name+"-group",className:"e-radio-group "+k}),te=[];return X.forEach(function(a,o){var s=a,l=a,d=t.createElement("div");d.style.marginBottom="8px",ee.appendChild(d);var c=t.createElement("input",{id:n.name+"_"+o+"_"+s,attrs:{type:"radio"}});d.appendChild(c);var u=new i.RadioButton({name:n.id,label:l,enableRtl:w,locale:y,disabled:n.disabled,value:s,htmlAttributes:F,labelPosition:n.fieldLabelPosition,checked:n.defaultValue===s||r===s,cssClass:N,change:function(e){e.value===s&&p(s)}});u.appendTo(c),S(u,o),e.ref&&"function"==typeof e.ref&&e.ref(u,o)}),A&&A.appendChild(ee),te;case"dropdown":var ne=[];B.fetch(n.options,n.id,g?g.values:void 0,C).then(function(e){e.id===n.id&&e.options.length>0&&(ne.push.apply(ne,e.options),ie.dataSource=ne)}).catch(function(){});var re=P(n.options,ne),ae=re.length>0?re:n.options||["Option 1"];n.conditions&&n.conditions.choiceBasedField&&(ae=x.getChoiceBasedOptions(n.conditions.choiceBasedField,ae,g?g.values:void 0,n.conditions.choiceBasedField.primaryFieldId)).length>0&&null!=r&&-1===ae.indexOf(r)&&g&&(g.values[n.id]=null);var ie=new s.DropDownList(J({id:n.name,name:n.id,floatLabelType:D.floatLabelType,placeholder:D.placeholder,enabled:D.enabled,locale:y,enableRtl:w,cssClass:N,dataSource:ae,value:void 0!==g.values[n.id]?g.values[n.id]:void 0!==n.defaultValue&&null!==n.defaultValue?n.defaultValue:null,showClearButton:n.showClearButton||!1,readonly:n.readOnly||!1,enableVirtualization:n.enableVirtualization||!1,popupHeight:n.popupHeight||"300px",popupWidth:n.popupWidth||"100%",htmlAttributes:F},V(function(e){return e.value||""})));return s.DropDownList.Inject(s.VirtualScroll),A&&ie.appendTo(A),S(ie),ie;case"multiselect":var oe=[];B.fetch(n.options,n.id,g?g.values:void 0,C).then(function(e){e.id===n.id&&e.options.length>0&&(oe.push.apply(oe,e.options),de.dataSource=oe)}).catch(function(){});var se=P(n.options,oe),le=se.length>0?se:n.options||["Option 1"],de=new s.MultiSelect(J({name:n.id,enableRtl:w,locale:y,floatLabelType:D.floatLabelType,enabled:D.enabled,value:void 0!==r?r:void 0!==n.defaultValue&&null!==n.defaultValue?n.defaultValue:null,placeholder:n.placeholder,dataSource:le,fields:{text:"text",value:"value"},showClearButton:n.showClearButton||!1,readonly:n.readOnly||!1,allowCustomValue:n.allowCustomValue||!1,addTagOnBlur:n.addTagOnBlur||!1,delimiterChar:n.delimiterChar||",",showSelectAll:n.showSelectAll||!1,mode:n.showSelectAll?"CheckBox":n.visualMode?n.visualMode:void 0,selectAllText:n.selectAllText,unSelectAllText:n.unSelectAllText,showDropDownIcon:!1!==n.showDropDownIcon,enableVirtualization:n.enableVirtualization||!1,popupHeight:n.popupHeight||"300px",popupWidth:n.popupWidth||"100%",cssClass:N,htmlAttributes:F},V(function(e){return e.value||""})));return s.MultiSelect.Inject(s.CheckBoxSelection,s.VirtualScroll),A&&de.appendTo(A),S(de),de;case"date":var ce=new l.DatePicker(J({floatLabelType:D.floatLabelType,id:n.name,name:n.id,enableRtl:w,locale:y,placeholder:D.placeholder,enabled:D.enabled,value:void 0!==r?r:void 0!==n.defaultValue&&null!==n.defaultValue?n.defaultValue:null,format:n.format||"MM/dd/yyyy",readOnly:n.readOnly||!1,showClearButton:void 0!==n.showClearButton&&n.showClearButton,showTodayButton:!1!==n.showTodayButton,calendarMode:n.calendarMode||"Gregorian",dayHeaderFormat:n.dayHeaderFormat||"Short",depth:n.depth||"Month",start:n.start||"Month",firstDayOfWeek:n.firstDayOfWeek||0,min:n.minDate?new Date(n.minDate):void 0,max:n.maxDate?new Date(n.maxDate):void 0,cssClass:N,htmlAttributes:F},V(function(e){return e.value||""})));return l.DatePicker.Inject(l.Islamic),A&&ce.appendTo(A),S(ce),ce;case"dateTime":var ue=new l.DateTimePicker(J({id:n.name,floatLabelType:D.floatLabelType,placeholder:D.placeholder,enabled:D.enabled,locale:y,enableRtl:w,name:n.id,dayHeaderFormat:n.dayHeaderFormat||"Short",value:void 0!==r?r:void 0!==n.defaultValue&&null!==n.defaultValue?n.defaultValue:null,format:n.format||"MM/dd/yyyy hh:mm a",showClearButton:void 0!==n.showClearButton&&n.showClearButton,showTodayButton:!1!==n.showTodayButton,depth:n.depth||"Month",start:n.start||"Month",step:n.step||1,readonly:n.readOnly||!1,min:n.minDate?new Date(n.minDate):void 0,max:n.maxDate?new Date(n.maxDate):void 0,minTime:n.minTime?new Date("2000-01-01 "+n.minTime):void 0,maxTime:n.maxTime?new Date("2000-01-01 "+n.maxTime):void 0,enableMask:!1,cssClass:N,htmlAttributes:F},V(function(e){return e.value||""})));return l.DateTimePicker.Inject(l.Islamic),A&&ue.appendTo(A),S(ue),ue;case"time":var pe=new l.TimePicker(J({id:n.name,locale:y,name:n.id,enableRtl:w,floatLabelType:D.floatLabelType,placeholder:D.placeholder,enabled:D.enabled,value:void 0!==r?r:void 0!==n.defaultValue&&null!==n.defaultValue?n.defaultValue:null,format:n.format||"hh:mm a",showClearButton:void 0!==n.showClearButton&&n.showClearButton,step:n.step||30,readonly:n.readOnly||!1,min:n.minTime?new Date("2000-01-01 "+n.minTime):void 0,max:n.maxTime?new Date("2000-01-01 "+n.maxTime):void 0,enableMask:!1,cssClass:N,htmlAttributes:F},V(function(e){return e.value||""})));return A&&pe.appendTo(A),S(pe),pe;case"dateRange":var he=new l.DateRangePicker(J({id:n.name,locale:y,enableRtl:w,name:n.id,floatLabelType:D.floatLabelType,dayHeaderFormat:n.dayHeaderFormat||"Short",placeholder:D.placeholder,enabled:D.enabled,value:void 0!==r?r:void 0!==n.defaultValue&&null!==n.defaultValue?n.defaultValue:null,depth:n.depth||"Month",start:n.start||"Month",min:n.minDate?new Date(n.minDate):void 0,max:n.maxDate?new Date(n.maxDate):void 0,format:n.format||"MM/dd/yyyy",separator:n.separator||" - ",showClearButton:void 0!==n.showClearButton&&n.showClearButton,readonly:n.readOnly||!1,cssClass:N,htmlAttributes:F},V(function(e){return e.value||""})));return A&&he.appendTo(A),S(he),he;case"switch":var me=new i.Switch({locale:y,enableRtl:w,value:n.defaultValue,name:n.id,checked:void 0!==n.checked&&null!==n.checked&&n.checked||void 0!==r&&null!==r&&r,disabled:n.disabled,onLabel:n.onLabel||"",offLabel:n.offLabel||"",cssClass:N,htmlAttributes:F,change:function(e){return p(e.checked)}});return A&&(Z(A,n.name),me.appendTo(A)),S(me),me;case"button":var fe=n.buttonsGroups||n.buttons||[];if(fe&&fe.length>0){var ve={display:"flex",flexWrap:"wrap",alignItems:"center",gap:n.gap||"8px",justifyContent:R(n.position),width:n.width||void 0},ye=t.createElement("div",{id:n.name,attrs:{role:"group","aria-label":n.label||"Button Group",className:N+" "+(w?"e-rtl":"")}});Object.assign(ye.style,ve);var ge=[];return fe.forEach(function(r,a){var o=n.name+"_"+a,s=[O(r.style)].filter(Boolean).join(" ");s+="Small"===n.size?" e-small":"Bigger"===n.size?" e-bigger":"";var l=I(r.type),d=t.createElement("button",{id:String(o),attrs:{name:String(o),type:l}});ye.appendChild(d);var c=new i.Button({locale:y,enableRtl:w,cssClass:s,disabled:r.disabled||!1,content:r.label||"Button "+(a+1),iconCss:r.iconCss,iconPosition:r.iconPosition});c.appendTo(d),c.element.onclick=function(e){m&&m(e)},S(c,a),ge.push(c),e.ref&&"function"==typeof e.ref&&e.ref(c,a)}),A&&A.appendChild(ye),ge}var be=I(n.buttonType),xe=[O(n.style),"submit"===be?"submit-btn form-submit-type":"","reset"===be?"form-reset-type":"",n.cssClass||"e-primary","Small"===n.size?" e-small":"Bigger"===n.size?" e-bigger":""].filter(Boolean).join(" ")||"e-primary",Ce={display:"flex",justifyContent:R(n.position),width:n.width||"100%"},we=t.createElement("div",{id:n.name+"-container"});Object.assign(we.style,Ce);var Se=t.createElement("button",{id:n.name,attrs:{type:be}});we.appendChild(Se);var Ee=new i.Button({enableRtl:w,locale:y,cssClass:xe,disabled:n.disabled,iconCss:n.iconCss,iconPosition:n.iconPosition,content:n.label});return Ee.appendTo(Se),S(Ee),Ee.element.onclick=function(e){m&&m(e)},A&&A.appendChild(we),Ee;case"splitButton":var Te=["primary"===n.style?"e-primary":"",(n.style,""),"information"===n.style?"e-info":"","error"===n.style?"e-danger":"","success"===n.style?"e-success":"","warning"===n.style?"e-warning":"",n.cssClass||""].filter(Boolean).join(" ")||void 0,Ae={display:"flex",justifyContent:R(n.position)},we=t.createElement("div",{id:n.name+"-container",attrs:{"aria-label":"Splitbutton"}});Object.assign(we.style,Ae);var De=n.options&&n.options.length>0?n.options.map(function(e,t){return{text:e,id:n.id+"_option_"+t}}):[{text:"Option 1",id:n.id+"_option_0"}],Ve=t.createElement("button",{id:n.name});we.appendChild(Ve);var Oe=new o.SplitButton({locale:y,enableRtl:w,content:n.label||"Split Button",items:De,cssClass:Te,disabled:n.disabled,iconCss:n.iconCss,iconPosition:n.iconPosition||"Left",click:function(e){m&&m(J({},e))},select:function(e){m&&m(J({},e,{selectedItem:e.item.text}))}});return Oe.appendTo(Ve),A&&A.appendChild(we),S(Oe),Oe;case"signature":var Ie=t.createElement("canvas",{id:n.name}),Re=new a.Signature({enableRtl:w,locale:y,backgroundColor:n.backgroundColor||"",strokeColor:n.strokeColor||"",maxStrokeWidth:n.maxValue,minStrokeWidth:n.minValue,velocity:n.velocity,disabled:n.disabled,change:function(){return p(n.name)}});return A&&(Re.appendTo(Ie),A.appendChild(Ie)),S(Re),Re;case"rating":var Fe=new a.Rating({enableRtl:w,locale:y,value:void 0!==r?r:n.defaultValue||0,disabled:n.disabled,cssClass:N,allowReset:n.allowReset,itemsCount:n.itemsCount,min:n.minValue,precision:n.precision,readOnly:n.readOnly,showTooltip:n.showRatingTooltip||!1,showLabel:n.showRatingLabel,labelPosition:n.showRatingLabel?n.ratingLabelPosition:void 0,valueChanged:function(e){return p(e.value)}});return A&&(Z(A,n.name),A.setAttribute("name",n.id),Fe.appendTo(A)),S(Fe),Fe;case"colorPicker":var ke=new a.ColorPicker({enableRtl:w,locale:y,value:void 0!==r?r:n.defaultValue||"",disabled:n.disabled,enableOpacity:n.enableOpacity,showButtons:n.showButtons,showRecentColors:n.showRecentColors,noColor:n.showNoColor,cssClass:N,change:function(e){return p(e.value)}});return A&&(Z(A,n.name),ke.appendTo(A)),S(ke),ke;case"inputMask":var Ne=new a.MaskedTextBox(J({id:n.name,name:n.id,enableRtl:w,floatLabelType:n.floatLabelType||"Never",placeholder:n.placeholder||"",enabled:!n.disabled,locale:y,value:void 0!==r?r:n.defaultValue||"",mask:n.mask||"000-000-0000",promptChar:n.promptChar||"_",customCharacters:n.customCharacters,readOnly:n.readOnly||!1,showClearButton:!1!==n.showClearButton,cssClass:N,htmlAttributes:F,appendTemplate:n.suffix,prependTemplate:n.prefix},V(function(e){return e.value||""})));return A&&Ne.appendTo(A),S(Ne),Ne;case"rangeSlider":var Me=new a.Slider({enableRtl:w,locale:y,value:void 0!==r?r:void 0!==n.defaultValue&&null!==n.defaultValue?n.defaultValue:0,min:n.minValue||0,max:n.maxValue||100,step:n.step||1,cssClass:N,enabled:!n.disabled,readonly:n.readOnly,showButtons:n.showButtons,change:function(e){return p(e.value)}});return A&&(Z(A,n.name),Me.appendTo(A)),S(Me),Me;case"fileUpload":var Le=new a.Uploader({enableRtl:w,locale:y,type:"file",enabled:!n.disabled,allowedExtensions:n.allowExtensions,asyncSettings:{saveUrl:n.saveUrl,removeUrl:n.removeUrl},buttons:n.buttons||{browse:"Choose File",clear:"Clear All",upload:"Upload All"},maxFileSize:n.maxValue,minFileSize:n.minValue,multiple:!!n.allowMultiple,showFileList:n.showFileList,htmlAttributes:F,cssClass:N,change:function(e){return p(e.file)}});return A&&(Z(A,n.name),Le.appendTo(A)),S(Le),Le;case"imageEditor":var Pe,je=t.createElement("div",{id:n.name,attrs:{"data-field":n.id}});return setTimeout(function(){Pe=new c.ImageEditor({locale:y,enableRtl:w,disabled:n.disabled,cssClass:N,height:(null!=n.height?n.height:"350px").toString(),width:(null!=n.width?n.width:"100%").toString(),editComplete:function(){return p(n.name)},fileOpened:function(){return p(n.name)}},"#"+n.name)},100),A&&A.appendChild(je),S(Pe),Pe;case"message":nt=new d.Message({locale:y,enableRtl:w,severity:n.severity||n.messageType||"info",variant:n.variant,content:n.content||"Message",showCloseIcon:n.showCloseIcon,showIcon:void 0!==n.showIcon&&n.showIcon||!1,cssClass:N});return A&&(Z(A,n.name),nt.appendTo(A)),S(nt),nt;case"dataGrid":var Be=n,Ue=j(Be.conditions,g&&g.values||{}),_e=Ue?Ue.dataSource:void 0,ze=Ue?Ue.columns:void 0,We=(_e||Be.dataSource,[]);B.fetch(_e||Be.dataSource,Be.id,g&&g.values,C).then(function(e){if(e.id===Be.id&&e.options.length>0){var t=P(_e||Be.dataSource,e.options,qe);Ye.setDataSource(t)}});var qe=[],He=_e?P(_e,We,qe):P(Be.dataSource,We,qe),Ge=He.length>0?He:void 0!==Be.dataSource&&null!==Be.dataSource?Be.dataSource:[],$e=ze&&ze.length>0?ze:void 0!==Be.columns&&null!==Be.columns?Be.columns:[],Je=A||t.createElement("div",{id:Be.name,className:Be.cssClass});A&&Z(A,n.name);var Ye=new $({locale:y,name:Be.name||"",columns:$e,enableRtl:w,dataSource:void 0!==Ge&&Ge.length>0?Ge:r,height:null!=Be.height?Be.height:"200px",width:null!=Be.width?Be.width:"100%",pageSize:Be.pageSize||6,allowPaging:!1!==Be.allowPaging,allowFiltering:Be.allowFiltering,allowAdding:!1!==Be.allowAdding,allowEditing:!1!==Be.allowEditing,allowDeleting:!1!==Be.allowDeleting,onDataChange:function(e){return p(e)},cssClass:N,target:Je,ref:S});return Ye.render(Je),!T.has(n.id)&&g&&Array.isArray(Ge)&&(g.values[n.id]=Ge,Ye.isInitialized=!0,T.add(n.id)),"function"==typeof e.ref?e.ref(Ye):e.ref&&(e.ref.current=Ye),A||Je;case"richTextEditor":var Ze={items:["Undo","Redo","|","Bold","Italic","Underline","StrikeThrough","InlineCode","|","CreateLink","Image","CreateTable","CodeBlock","HorizontalLine","Blockquote","EmojiPicker","|","LineHeight","Formats","Alignments","|","BulletFormatList","NumberFormatList","Checklist","|","Outdent","Indent","|","FontColor","BackgroundColor","FontName","FontSize","|","LowerCase","UpperCase","SuperScript","SubScript","|","SourceCode","|"]};n.enableImportFromWord&&n.enableImportFromWord.enabled&&Ze.items.push("ImportWord"),n.enableExportToWord&&n.enableExportToWord.enabled&&Ze.items.push("ExportWord"),n.enableExportToPdf&&n.enableExportToPdf.enabled&&Ze.items.push("ExportPdf"),Ze.items.push("Print");var Ke=function(e){return!!e&&e.enabled&&"string"==typeof e.serviceUrl&&""!==e.serviceUrl.trim()},Qe=Ke(n.enableImportFromWord)?{serviceUrl:/^(https?:)?\/\//i.test(n.enableImportFromWord?n.enableImportFromWord.serviceUrl:"")?n.enableImportFromWord?n.enableImportFromWord.serviceUrl:"":(b&&b.hostUrl?b.hostUrl:"").replace(/\/+$/,"")+"/"+(n.enableImportFromWord?n.enableImportFromWord.serviceUrl:"").replace(/^\/+/,"")}:void 0,Xe=Ke(n.enableExportToWord)?{serviceUrl:/^(https?:)?\/\//i.test(n.enableExportToWord?n.enableExportToWord.serviceUrl:"")?n.enableExportToWord?n.enableExportToWord.serviceUrl:"":(b&&b.hostUrl?b.hostUrl:"").replace(/\/+$/,"")+"/"+(n.enableExportToWord?n.enableExportToWord.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.docx",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,et=Ke(n.enableExportToPdf)?{serviceUrl:/^(https?:)?\/\//i.test(n.enableExportToPdf?n.enableExportToPdf.serviceUrl:"")?n.enableExportToPdf?n.enableExportToPdf.serviceUrl:"":(b&&b.hostUrl?b.hostUrl:"").replace(/\/+$/,"")+"/"+(n.enableExportToPdf?n.enableExportToPdf.serviceUrl:"").replace(/^\/+/,""),fileName:"RichTextEditor.pdf",stylesheet:"\n .e-rte-content {\n font-size: 1em;\n font-weight: 400;\n margin: 0;\n }\n "}:void 0,tt=new u.RichTextEditor({locale:y,toolbarSettings:Ze,enableRtl:w,value:void 0!==r?r:n.defaultValue||"",placeholder:n.placeholder||"",enabled:!n.disabled,readonly:n.readOnly||!1,maxLength:n.maxLength||void 0,cssClass:N||void 0,height:n.height||"300px",width:n.width||"100%",htmlAttributes:F,importWord:Qe,exportPdf:et,exportWord:Xe,change:function(e){return p(e.value)}});return u.RichTextEditor.Inject(u.Toolbar,u.Link,u.HtmlEditor,u.QuickToolbar,u.Image,u.Count,u.Table,u.EmojiPicker,u.PasteCleanup,u.SlashMenu,u.CodeBlock,u.ClipBoardCleanup,u.AutoFormat,u.ImportExport),tt.appendTo(A),S(tt),tt;default:var nt=new d.Message({locale:y,enableRtl:w,severity:"Warning",content:E.getConstant("unsupportedComponent")+" : "+n.type,cssClass:N});return A&&(Z(A,n.name),nt.appendTo(A)),S(nt),nt}},Q=function(){return(Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},X={strict:!1,maxInputSize:5242880,defaultTextType:"textbox",inferTypeFromValue:!0,generateIds:!0,includeMetadata:!0,customTypeMap:{},validateUnknownFields:!1},ee=function(){function e(e){this.config=Q({},X,e)}return e.prototype.parse=function(e){var t=[],n=[];if("string"==typeof e){if(e.length>this.config.maxInputSize)return this.formatError(t,n,"Input exceeds maximum size of "+this.config.maxInputSize+" bytes");var r=te(e);if(!r.valid)return this.formatError(t,n,r.errors&&r.errors[0]||"Invalid JSON");try{e=JSON.parse(e)}catch(e){return this.formatError(t,n,"Failed to parse JSON: "+e.message)}}var a=this.detectFormat(e);a.ambiguousFormats&&a.ambiguousFormats.length>0&&(n.push("Ambiguous format detected."),n.push("Using "+a.format+" format ("+("json-schema"===a.format?"properties priority":"pages priority")+")"));var i=[];switch(a.format){case"configured-schema":i=e.properties||[];break;case"json-schema":var o=this.parseJsonSchema(e);i=o.components,o.warnings&&n.push.apply(n,o.warnings);break;case"surveyjs":i=this.parseSurveyJS(e);break;case"openapi":i=this.parseOpenAPI(e);break;case"data-inference":(i=this.parseDataInference(e)).length>0&&n.push("Field types inferred from data; please verify");break;default:t.push("Could not determine input format")}0===i.length&&t.push("No form fields could be extracted from input"),!i.some(function(e){return"button"===e.type&&"submit"===e.buttonType})&&i.length>0&&i.push({id:this.generateComponentId("button"),type:"button",label:"Submit",style:"primary",buttonType:"submit"});var s={version:e.version||"0.1.0",components:i},l=ne(s);!l.valid&&l.errors&&t.push.apply(t,l.errors),l.warnings&&n.push.apply(n,l.warnings),this.config.strict&&n.length>0&&(t.push.apply(t,n),n.length=0);var d=re(s);return{success:0===t.length,schema:d,errors:t,warnings:n,metadata:{detectedFormat:a.format,confidence:a.confidence,sourceHints:a.hints}}},e.prototype.formatError=function(e,t,n){return e.push(n),{success:!1,schema:null,errors:e,warnings:t,metadata:{detectedFormat:"unknown",confidence:"low",sourceHints:[]}}},e.prototype.detectFormat=function(e){var t=[],n=[];if(!e||"object"!=typeof e)return{format:"unknown",confidence:"low",hints:["Input is not a valid object"]};if(e.$schema&&"string"==typeof e.$schema&&e.$schema.includes("json-schema"))return t.push("$schema property detected"),{format:"json-schema",confidence:"high",hints:t};var r=e.properties&&"object"==typeof e.properties,a=e.pages&&Array.isArray(e.pages),i=e.elements&&Array.isArray(e.elements);return r&&a?(t.push("Multiple format patterns detected"),t.push("Selected based on priority rules"),n.push("properties format","pages format"),{format:"json-schema",confidence:"medium",hints:t,ambiguousFormats:n}):a?(t.push("pages array detected"),e.pages[0]&&e.pages[0].elements&&t.push("elements structure matched"),{format:"surveyjs",confidence:"high",hints:t}):i&&!r?(t.push("elements array at root level"),{format:"surveyjs",confidence:"medium",hints:t}):r?(t.push("properties object detected"),"object"===e.type&&t.push("type: object matched"),e.required&&Array.isArray(e.required)&&t.push("required array found"),this.hasExampleFields(e.properties)?(t.push("example fields detected (API schema pattern)"),{format:"openapi",confidence:"high",hints:t}):{format:"json-schema",confidence:"high",hints:t}):this.isDataInferenceCandidate(e)?(t.push("Simple object with primitive values"),t.push("No schema indicators found"),{format:"data-inference",confidence:"medium",hints:t}):{format:"unknown",confidence:"low",hints:["Could not identify format"]}},e.prototype.hasExampleFields=function(e){if(!e||"object"!=typeof e)return!1;for(var t=0,n=Object.keys(e);t<n.length;t++){var r=e[n[t]];if(r&&"example"in r)return!0}return!1},e.prototype.isDataInferenceCandidate=function(e){return!(!e||"object"!=typeof e)&&(!(e.$schema||e.properties||e.pages||e.elements)&&Object.keys(e).every(function(t){var n=e[t];return null===n||void 0===n||("string"==typeof n||"number"==typeof n||"boolean"==typeof n||!!Array.isArray(n)&&n.every(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}))}))},e.prototype.inferComponentType=function(e,t){var n=this.inferTypeFromValue(e,t);if(n.type)return Q({},n,{confidence:"high",method:"value-type"});var r=this.matchFieldNamePattern(e);return r.type?Q({},r,{confidence:"high",method:"name-pattern"}):{type:this.config.defaultTextType,confidence:"low",method:"fallback"}},e.prototype.inferTypeFromValue=function(e,t){if(!this.config.inferTypeFromValue)return{type:"textbox"};if(null===t||void 0===t)return this.matchFieldNamePattern(e);if("string"==typeof t){if(t.includes("@")&&t.includes("."))return{type:"textbox",textboxType:"email"};if(/^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}/.test(t))return{type:"textbox",textboxType:"url"};if(/^\d{4}-\d{2}-\d{2}/.test(t))return{type:"date"};var n=this.matchFieldNamePattern(e);return"textbox"!==n.type||n.textboxType?n:{type:this.config.defaultTextType}}return"number"==typeof t?{type:"number"}:"boolean"==typeof t?{type:"checkbox"}:Array.isArray(t)?{type:"multiselect"}:{type:"textbox"}},e.prototype.matchFieldNamePattern=function(e){if(this.config.customTypeMap){var t=this.config.customTypeMap[e.toLowerCase()];if(t)return{type:t}}var n=e.toLowerCase().replace(/[_\-\s]+/g," ");return/email|mail|e-?mail/.test(n)?{type:"textbox",textboxType:"email"}:/date|birth|birthday|dob|created|updated/.test(n)?{type:"date"}:/phone|tel|mobile|cell|cellphone|msisdn/.test(n)?{type:"textbox",textboxType:"number"}:/url|link|uri|website/.test(n)?{type:"textbox",textboxType:"url"}:/password|pwd|pass|security|secret|key|token/.test(n)?{type:"textbox",textboxType:"password"}:/\b(?:age|count|qty|quantity|amount|price|cost|salary|fee|rate|number|num)\b/.test(n)?{type:"number"}:/active|enabled|visible|deleted|archived|approved|confirmed/.test(n)?{type:"checkbox"}:/select|choice|option|type|status|category|kind/.test(n)?{type:"dropdown"}:/description|comment|note|bio|biography|about|message|content|summary|details/.test(n)?{type:"textarea"}:{type:"textbox"}},e.prototype.parseJsonSchema=function(e){var t=[],n=[];if(!e.properties||"object"!=typeof e.properties)return{components:t,warnings:n};for(var r=this.flattenNestedProperties(e.properties,"",n),a=0,i=Object.keys(r);a<i.length;a++){var o=i[a],s=r[o],l=this.mapJsonSchemaType(s),d=-1!==(e.required||[]).indexOf(o);t.push(this.createComponent(o,s,l,{required:d}))}return{components:t,warnings:n}},e.prototype.flattenNestedProperties=function(e,t,n){for(var r={},a=!1,i=0,o=Object.keys(e);i<o.length;i++){var s=e[p=o[i]],l=t?t+"_"+p:p;if("object"===s.type&&s.properties&&"object"==typeof s.properties){a=!0;var d=this.flattenNestedProperties(s.properties,l,n);Object.assign(r,d)}else r[l]=s}if(a&&!t){n.push("NESTED_OBJECTS_FLATTENED: Nested objects converted to flat structure");for(var c=0,u=Object.keys(e);c<u.length;c++){var p=u[c];"object"===(s=e[p]).type&&s.properties&&this.collectFlattenedFieldNames(s.properties,p,n)}}return r},e.prototype.collectFlattenedFieldNames=function(e,t,n){for(var r=0,a=Object.keys(e);r<a.length;r++){var i=a[r],o=e[i],s=t+"_"+i;n.push("Field '"+t+"."+i+"' flattened to '"+s+"'"),"object"===o.type&&o.properties&&this.collectFlattenedFieldNames(o.properties,s,n)}},e.prototype.parseSurveyJS=function(e){var t=this,n=[];return e.pages&&Array.isArray(e.pages)&&e.pages.forEach(function(e){e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))})}),!n.length&&e.elements&&Array.isArray(e.elements)&&e.elements.forEach(function(e){n.push(t.createComponentFromSurveyJS(e))}),n},e.prototype.createComponentFromSurveyJS=function(e){var t=this.mapSurveyJSType(e.type||"text"),n={};!0===e.isRequired&&(n.required=!0),e.validators&&Array.isArray(e.validators)&&e.validators.forEach(function(e){"numeric"===e.type&&(void 0!==e.minValue&&(n.minValue=e.minValue),void 0!==e.maxValue&&(n.maxValue=e.maxValue)),"text"===e.type&&(void 0!==e.minLength&&(n.minLength=e.minLength),void 0!==e.maxLength&&(n.maxLength=e.maxLength))});var r=Q({id:this.generateComponentId(t),type:t,label:e.title||e.label||this.humanizeFieldName(e.name),defaultValue:e.defaultValue,expressionValue:e.expressionValue},Object.keys(n).length>0?n:void 0);return"dropdown"!==t&&"multiselect"!==t&&"radio"!==t&&"splitButton"!==t||e.choices&&Array.isArray(e.choices)&&(r.options=e.choices),r},e.prototype.mapSurveyJSType=function(e){return{text:"textbox",email:"email",number:"number",checkbox:"checkbox",radiogroup:"radio",dropdown:"dropdown",tagbox:"multiselect",multiselect:"multiselect",rating:"number",comment:"textarea",date:"date"}[e]||"textbox"},e.prototype.parseOpenAPI=function(e){var t=[];if(!e.properties||"object"!=typeof e.properties)return t;for(var n=Object.keys(e.properties),r=e.required||[],a=0,i=n;a<i.length;a++){var o=i[a],s=e.properties[o],l=this.mapJsonSchemaType(s),d=-1!==r.indexOf(o);t.push(this.createComponent(o,s,l,{required:d}))}return t},e.prototype.parseDataInference=function(e){for(var t=[],n=0,r=Object.keys(e);n<r.length;n++){var a=r[n],i=e[a],o=this.inferComponentType(a,i),s={id:this.generateComponentId(o.type),type:o.type,label:this.humanizeFieldName(a),defaultValue:i,expressionValue:void 0};if(o.textboxType&&(s.textboxType=o.textboxType,"email"===o.textboxType?s.regex=V.EMAIL:"url"===o.textboxType&&(s.regex=V.URL)),"date"===o.type&&void 0!==s.defaultValue&&null!==s.defaultValue){var l=this.formatDateTimeValue(s.defaultValue);l&&(s.defaultValue=l)}Array.isArray(i)&&i.length>0&&(s.options=i),t.push(s)}return t},e.prototype.createComponent=function(e,t,n,r){var a={};!0===(void 0!==t.required?t.required:r.required)&&(a.required=!0),t.minLength&&(a.minLength=t.minLength),t.maxLength&&(a.maxLength=t.maxLength),t.minDate&&(a.minDate=t.minDate),t.maxDate&&(a.maxDate=t.maxDate),t.minTime&&(a.minTime=t.minTime),t.minValue&&(a.minValue=t.minValue),t.maxValue&&(a.maxValue=t.maxValue),t.pattern&&(a.pattern=t.pattern);var i=b(t.id||this.generateComponentId(n.type),this.generateComponentId(n.type)),o=Q({id:i,name:t.name,type:n.type,label:t.title||t.label||this.humanizeFieldName(e),defaultValue:t.default||t.defaultValue||void 0,expressionValue:t.expressionValue||void 0,content:t.content,buttonType:t.buttonType,textboxType:t.textboxType},Object.keys(a).length>0?a:void 0);if(n.textboxType&&(o.textboxType=n.textboxType,"email"===n.textboxType?a.pattern||(a.regex="^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",a.validationMessage="Please enter a valid email address"):"url"===n.textboxType&&(a.pattern||(a.regex="^(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$",a.validationMessage="Please enter a valid URL"))),"date"===n.type&&void 0!==o.defaultValue&&null!==o.defaultValue){var s=this.formatDateTimeValue(o.defaultValue);s&&(o.defaultValue=s)}return"splitButton"!==n.type&&"dropdown"!==n.type&&"multiselect"!==n.type&&"radio"!==n.type||!t.enum&&!t.options||(o.options=t.enum||t.options),o},e.prototype.parseDateFromValue=function(e){if(null==e)return null;if("number"==typeof e)return e<1e12?new Date(1e3*e):new Date(e);if("string"==typeof e){var t=e.trim(),n=new Date(t);if(!isNaN(n.getTime()))return n;var r=t.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/);if(r)return new Date(Number(r[1]),Number(r[2])-1,Number(r[3]),Number(r[4]||0),Number(r[5]||0),Number(r[6]||0));var a=t.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T](\d{1,2}):(\d{2})(?:[:](\d{2}))?)?/);if(a)return new Date(Number(a[3]),Number(a[1])-1,Number(a[2]),Number(a[4]||0),Number(a[5]||0),Number(a[6]||0))}return null},e.prototype.formatDate=function(e){var t=e.getMonth()+1,n=e.getDate();return(t<10?"0"+t:String(t))+"/"+(n<10?"0"+n:String(n))+"/"+e.getFullYear()},e.prototype.formatDateTimeValue=function(e){var t=this.parseDateFromValue(e);if(t){var n=this.formatDate(t);return 0!==t.getHours()||0!==t.getMinutes()||/\dT\d{2}:\d{2}/.test(String(e))?""+n:n}},e.prototype.mapJsonSchemaType=function(e){var t=e.type;if("string"===t){var n=(e.format||"").toString().toLowerCase(),r=((e.title||e.label||"")+" "+(e.description||"")).toLowerCase();return/email|mail|e-?mail/.test(n)||/email|mail|e-?mail/.test(r)?{type:"textbox",textboxType:"email"}:/uri|url|link|website/.test(n)||/uri|url|link|website/.test(r)?{type:"textbox",textboxType:"url"}:/phone|tel|mobile|cell|msisdn/.test(n)||/phone|tel|mobile|cell|msisdn/.test(r)?{type:"textbox",textboxType:"number"}:/password|pwd|pass|security|secret|key/.test(n)||/password|pwd|pass|security|secret|key/.test(r)?{type:"textbox",textboxType:"password"}:"date"===n||"date-time"===n||/date|birthday|dob/.test(r)?{type:"date"}:e.enum?{type:"dropdown"}:e.options?{type:"dropdown"}:{type:this.config.defaultTextType}}return"number"===t||"integer"===t?{type:"number"}:"boolean"===t?{type:"checkbox"}:"array"===t?{type:"multiselect"}:"message"===t?{type:"message"}:"button"===t?{type:"button"}:"signature"===t||"sign"===t?{type:"signature"}:"image"===t||"imageEditor"===t?{type:"imageEditor"}:"file"===t||"fileUpload"===t?{type:"fileUpload"}:"color"===t||"colorPicker"===t?{type:"colorPicker"}:"splitButton"===t?{type:"splitButton"}:{type:this.config.defaultTextType}},e.prototype.generateComponentId=function(e){return this.config.generateIds?e+"_"+Date.now()+"_"+Math.floor(1e3*Math.random()):""},e.prototype.humanizeFieldName=function(e){var t=e.replace(/_/g," ");return t=t.replace(/([a-z])([A-Z])/g,"$1 $2")},e}(),te=function(e){try{return JSON.parse(e),{valid:!0}}catch(e){return{valid:!1,errors:["Invalid JSON syntax: "+e.message]}}},ne=function(e){var t=[],n=[];if(e.components?Array.isArray(e.components)||t.push('Property "components" must be an array'):t.push("Missing required property: components"),Array.isArray(e.components)){var r=new Set,a=function(e,n){void 0===n&&(n="root"),e.id?(r.has(e.id)&&t.push("Duplicate component ID found: "+e.id),r.add(e.id)):t.push("Component at "+n+' is missing "id" property'),e.type||t.push('Component "'+(e.id||"unknown")+'" is missing "type" property'),e.children&&Array.isArray(e.children)&&e.children.forEach(function(e,t){a(e,n+".children["+t+"]")}),e.tabItems&&Array.isArray(e.tabItems)&&e.tabItems.forEach(function(e,t){e.content&&Array.isArray(e.content)&&e.content.forEach(function(e,r){a(e,n+".tabItems["+t+"].content["+r+"]")})}),e.tableCells&&Array.isArray(e.tableCells)&&e.tableCells.forEach(function(e,t){Array.isArray(e)&&e.forEach(function(e,r){Array.isArray(e)&&e.forEach(function(e,i){a(e,n+".tableCells["+t+"]["+r+"]["+i+"]")})})})};e.components.forEach(function(e,t){a(e,"components["+t+"]")})}return{valid:0===t.length,errors:t.length>0?t:void 0,warnings:n.length>0?n:void 0}},re=function(e){var t={version:e.version||"0.1.0",components:e.components||[]},n=function(e){var t=Q({},e,{_configured:!0});return e.children&&Array.isArray(e.children)&&(t.children=e.children.map(n)),e.tabItems&&Array.isArray(e.tabItems)&&(t.tabItems=e.tabItems.map(function(e){return Q({},e,{content:e.content?e.content.map(n):[]})})),e.tableCells&&Array.isArray(e.tableCells)&&(t.tableCells=e.tableCells.map(function(e){return e.map(function(e){return Array.isArray(e)?e.map(n):[]})})),t};return t.components=t.components.map(n),t},ae=function(){function e(e){this.content=e.content,this.id=e.id,this.enableHtmlSanitizer=!!t.isNullOrUndefined(e.enableHtmlSanitizer)||e.enableHtmlSanitizer,this.el=e.target||null}return e.prototype.resolveHtml=function(e){try{return this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e}catch(e){return""}},e.prototype.render=function(){var e=document.createElement("div");return this.id&&(e.id=this.id),e.innerHTML=this.resolveHtml(this.content),this.el=e,e},e.prototype.update=function(e){this.content=e,this.el&&(this.el.innerHTML=this.resolveHtml(this.content))},e.prototype.getElement=function(){return this.el},e.prototype.destroy=function(){this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,this.content="",this.enableHtmlSanitizer=!1,this.id=void 0},e}(),ie=function(){function e(){}return e.getConstraints=function(e,t,n){var r=this;if(void 0===n&&(n="number"),!e||0===e.length)return this.getEmptyConstraints(n);var a=e.find(function(e){return!1===e.enabled});if(a){var i=this.resolveValue(a.minValue,{}),o=this.resolveValue(a.maxValue,{});return"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:i,maxDate:o,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:i,maxTime:o}:{minValue:i,maxValue:o,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}}var s=e.filter(function(e){return!0===e.enabled});if(0===s.length)return this.getEmptyConstraints(n);var l=s.map(function(e){return{min:r.resolveValue(e.minValue,t),max:r.resolveValue(e.maxValue,t)}}).filter(function(e){return void 0!==e.min||void 0!==e.max});if(0===l.length)return this.getEmptyConstraints(n);var d=this.getPermissiveMin(l,n),c=this.getPermissiveMax(l,n);return"date"===n||"dateRange"===n?{minValue:void 0,maxValue:void 0,minDate:d,maxDate:c,minTime:void 0,maxTime:void 0}:"time"===n?{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:d,maxTime:c}:{minValue:d,maxValue:c,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}},e.resolveValue=function(e,t){if("number"==typeof e)return e;if("string"==typeof e)return e;if(e&&"object"==typeof e&&e.field){var n=t[e.field];return void 0!==n?n:void 0}},e.getPermissiveMin=function(e,t){var n=this;if(0!==e.length){if("date"===t||"dateRange"===t)return e.reduce(function(e,t){if(!t.min)return e;if(!e)return t.min;var r=n.convertToISO(e);return n.convertToISO(t.min)<r?t.min:e},void 0);if("time"===t)return e.reduce(function(e,t){if(!t.min)return e;if(!e)return t.min;var r=n.convertTimeTo24Hour(e);return n.convertTimeTo24Hour(t.min)<r?t.min:e},void 0);var r=e.map(function(e){return e.min}).filter(function(e){return void 0!==e});return r.length>0?Math.min.apply(Math,r):void 0}},e.getPermissiveMax=function(e,t){var n=this;if(0!==e.length){if("date"===t||"dateRange"===t)return e.reduce(function(e,t){if(!t.max)return e;if(!e)return t.max;var r=n.convertToISO(e);return n.convertToISO(t.max)>r?t.max:e},void 0);if("time"===t)return e.reduce(function(e,t){if(!t.max)return e;if(!e)return t.max;var r=n.convertTimeTo24Hour(e);return n.convertTimeTo24Hour(t.max)>r?t.max:e},void 0);var r=e.map(function(e){return e.max}).filter(function(e){return void 0!==e});return r.length>0?Math.max.apply(Math,r):void 0}},e.convertToISO=function(e){if(!e)return"";if(e.includes("-")&&10===e.length)return e;if(-1!==e.indexOf("/")){var t=e.split("/"),n=t[0],r=t[1],a=t[2];return n&&r&&a?a+"-"+(n.length<2?"0"+n:n)+"-"+(r.length<2?"0"+r:r):e}return e},e.convertTimeTo24Hour=function(e){if(!e)return"";var t=/PM/i.test(e),n=/AM/i.test(e);if(n||t){var r=e.replace(/\s*(AM|PM)/i,"").trim().split(":"),a=r[0],i=r[1];if(!a||!i)return e;var o=parseInt(a,10);t&&12!==o?o+=12:n&&12===o&&(o=0);var s=String(o);return(s.length<2?"0"+s:s)+":"+i}return e},e.getEmptyConstraints=function(e){return{minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,minTime:void 0,maxTime:void 0}},e.validateValue=function(e,t,n){if(void 0===e||null===e||""===e)return{isValid:!0};if("date"===n||"dateRange"===n){if(t.minDate){var r=this.convertToISO(t.minDate);if((i=this.convertToISO(e))<r)return{isValid:!1,error:"Date must be on or after "+t.minDate}}if(t.maxDate){var a=this.convertToISO(t.maxDate),i=this.convertToISO(e);if(i>a)return{isValid:!1,error:"Date must be on or before "+t.maxDate}}}else if("time"===n){if(t.minTime&&e<t.minTime)return{isValid:!1,error:"Time must be on or after "+t.minTime};if(t.maxTime&&e>t.maxTime)return{isValid:!1,error:"Time must be on or before "+t.maxTime}}else{var o=Number(e);if(void 0!==t.minValue&&o<Number(t.minValue))return{isValid:!1,error:"Value must be at least "+t.minValue};if(void 0!==t.maxValue&&o>Number(t.maxValue))return{isValid:!1,error:"Value must be at most "+t.maxValue}}return{isValid:!0}},e}(),oe=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),se=function(){return(se=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)},le=function(e,t,n,r){var a,i=arguments.length,o=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},de=["textbox","number","checkbox","dropdown","multiselect","date","dateTime","time","dateRange","switch","rating","colorPicker","inputMask","fileUpload"],ce={unsupportedComponent:"Unsupported Component type"},ue=function(e){function i(n,r){var a=e.call(this,n,r)||this;return a.processedSchemaCache={version:"1.0.0",components:[]},a.l10n=new t.L10n("form-renderer",ce,a.locale),a.formState={values:Object.create(null),errors:Object.create(null)},a.validator=null,a.inputRefs={},a.conditionalValueApplied={},a.expressionEngine=null,a.expressionDependencyGraph={},a.expressionEvaluationInProgress=!1,a.previousFormValues={},a.computedFieldNames=new Set,a.customValidationEngine=new H,a.currentFormValues={},a.isInitialized=!1,a.hasLayoutComponentsCache=!1,a.idToLabelCache={},a.initialValuesCache={},a.renderedInstances=[],a.tooltipRefs={},a.createdFired=!1,a.rerenderScheduled=!1,a.conditionalTriggerFieldIds=new Set,a.preservedFields=new Map,a.consumerDependencyMap=new Map,a.pendingChangedFieldIds=new Set,a}oe(i,e),o=i,i.prototype.getModuleName=function(){return"form-renderer"},i.prototype.getPersistData=function(){return this.addOnPersist(["formState",JSON.stringify(this.formState)])},i.prototype.preRender=function(){t.enableRipple(!0),this.createdFired=!1,this.expressionEngine=new D},i.prototype.render=function(){var e=this;if(this.clearEngineCaches(),this.removePreviousRoot(),this.normalizeSchema(),this.element.classList.add("form-renderer-container"),this.className&&t.addClass([this.element],this.className.replace(/\s+/g," ").trim().split(" ")),this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl"),this.hasLayoutComponentsCache=this.computeHasLayoutComponents(),this.idToLabelCache=this.computeIdToLabel(),this.initialValuesCache=this.buildInitialValues(),this.buildValidationRulesAndBridge(),this.isInitialized||(this.isInitialized=!0),this.formState&&this.initialValuesCache)for(var n=0,r=Object.keys(this.initialValuesCache);n<r.length;n++){var a=r[n],i=this.initialValuesCache[a];this.formState.values[a]||(this.formState.values[a]=i)}this.currentFormValues=se({},this.formState?this.formState.values:{}),this.initExpressionEngine(),this.buildConditionalDependencyMap();var o=t.createElement("form",{className:"form-renderer "+this.layoutClass,attrs:{role:"region","aria-label":this.processedSchemaCache.settings?this.processedSchemaCache.settings.name||"Form":"Form"}});this.element.appendChild(o),this.inputRefs={},(this.processedSchemaCache.components||[]).forEach(function(n){var r=e.renderComponent(n);if(r&&o.appendChild(r),"richTextEditor"===n.type){var a=r.querySelector(".e-richtexteditor");(s=t.getComponent(a,"richtexteditor")).refreshUI()}if("dataGrid"===n.type){var i=r.querySelector(".e-control.e-toolbar"),s=t.getComponent(i,"toolbar");s.refresh()}if("tabs"===n.type){var l=r.querySelector(".e-control.e-tab");t.getComponent(l,"tab").refreshOverflow()}}),this.created&&!this.createdFired&&setTimeout(function(){Object.keys(e.inputRefs).length>0&&(e.createdFired=!0,e.trigger("created",{}))},0)},i.prototype.normalizeSchema=function(){var e=this.schema;try{if(!e)return void(this.processedSchemaCache={version:"1.0.0",components:[]});var t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){return this.failure&&this.trigger("failure",{error:e}),void(this.processedSchemaCache={version:"1.0.0",components:[]})}if(t&&"object"==typeof t&&t.properties&&Array.isArray(t.layout))this.processedSchemaCache=m(t);else{var n=(new ee).parse("string"==typeof e?e:JSON.stringify(e));n.success&&n.schema?this.processedSchemaCache=n.schema:(this.failure&&this.trigger("failure",{error:n.errors}),this.processedSchemaCache={version:"1.0.0",components:[]})}}catch(e){this.failure&&this.trigger("failure",{error:e}),this.processedSchemaCache={version:"1.0.0",components:[]}}},i.prototype.computeHasLayoutComponents=function(){if(!this.processedSchemaCache.components)return!1;var e=function(t){for(var n=0,r=t;n<r.length;n++){var a=r[n];if(-1!==["table","tabs","panel","card"].indexOf(a.type))return!0;if(a.children&&e(a.children))return!0;if(a.tableCells)for(var i=0,o=a.tableCells;i<o.length;i++)for(var s=0,l=o[i];s<l.length;s++){var d=l[s];if(e(d))return!0}if(a.tabItems)for(var c=0,u=a.tabItems;c<u.length;c++){var p=u[c];if(p.content&&e(p.content))return!0}}return!1};return e(this.processedSchemaCache.components)},Object.defineProperty(i.prototype,"layoutClass",{get:function(){if(this.hasLayoutComponentsCache)return"";switch(this.layout){case"TwoColumn":return"twolayout";case"ThreeColumn":return"threelayout";case"FourColumn":return"fourlayout";case"SingleColumn":default:return""}},enumerable:!0,configurable:!0}),i.prototype.collectAllComponents=function(e){var t=[],n=function(e){e.forEach(function(e){t.push(e),e.children&&e.children.length>0&&n(e.children),e.tableCells&&e.tableCells.forEach(function(e){e.forEach(function(e){return n(e)})}),e.tabItems&&e.tabItems.forEach(function(e){e.content&&n(e.content)})})};return n(e),t},i.prototype.computeIdToLabel=function(){var e={},t=function(n){n.forEach(function(n){n.label&&-1===["panel","table","tabs","card","button","message","splitButton"].indexOf(n.type)&&(n.name?e[n.id]=n.name:n.label&&(e[n.id]=n.label)),n.children&&t(n.children),n.tableCells&&n.tableCells.forEach(function(e){return e.forEach(function(e){return t(e)})}),n.tabItems&&n.tabItems.forEach(function(e){e.content&&t(e.content)})})};return t(this.processedSchemaCache.components),e},i.prototype.buildValidationRulesAndBridge=function(){var e=this,t={},n=this.formState&&this.formState.values||{},r=function(a,i){void 0===i&&(i=!0),a.forEach(function(a){if(a){var o={},s=i&&!1!==a.visible&&x.isFieldVisible(a.conditions,n),l=i&&x.isFieldHidden(a.conditions,n);if(s&&!l){var d=x.isFieldRequired(a.conditions,n),c=x.isFieldDisabled(a.conditions,n),u=x.isFieldReadOnly(a.conditions,n),p=!!a.required||d,h=!!a.disabled||c,m=!!a.readOnly||u;if(a.customValidation&&Array.isArray(a.customValidation)&&a.customValidation.length>0&&!h&&!m){var f=a.customValidation&&a.customValidation[0]&&a.customValidation[0].expression,v=(f&&f.match(/\?\s*true\s*:\s*['"](.+?)['"]/)?f.match(/\?\s*true\s*:\s*['"](.+?)['"]/)[1]:void 0)||a.validationMessage||(a.label||a.id)+" is invalid",y=e;o.customValidation=[function(e){var t=e.value;if(p&&(""===t||null===t||void 0===t))return!0;var n={};y.collectAllComponents(y.processedSchemaCache.components).forEach(function(e){e.name&&(n[e.id]=e.name)});for(var r=se({},y.currentFormValues||{}),i=0,o=Object.keys(se({},r));i<o.length;i++){var s=o[i],l=r[s],d=n[s];d&&(r[d]=l,delete r[s])}for(var c=0,u=a.customValidation;c<u.length;c++){var h=u[c];if(!y.customValidationEngine)return!0;if(!0!==y.customValidationEngine.validate(h.expression,t,r))return!1}return!0},v]}!p||h||m||(o.required=[!0,a.validationMessage||a.label+" is required"]),!a.minLength||h||m||(o.minLength=[a.minLength,"Minimum "+a.minLength+" characters allowed"]),!a.maxLength||h||m||(o.maxLength=[a.maxLength,"Maximum "+a.maxLength+" characters allowed"]),"textbox"!==a.type||!a.textboxType||a.regex||o.regex||h||m||("email"===a.textboxType?o.regex=[V.EMAIL,a.validationMessage||"Invalid format"]:"url"===a.textboxType&&(o.regex=[V.URL,a.validationMessage||"Invalid format"])),!a.regex||h||m||(o.regex=[a.regex,a.validationMessage||"Invalid format"]),Object.keys(o).length>0&&(t[a.id]=o),a.children&&r(a.children,s&&!l),a.tableCells&&a.tableCells.forEach(function(e){return e.forEach(function(e){return r(e,s&&!l)})}),a.tabItems&&a.tabItems.forEach(function(e){e.content&&r(e.content,s&&!l)})}}})};r(this.processedSchemaCache.components);var i=this.formState?se({},this.formState.values):se({},this.initialValuesCache);if(this.formState={values:Object.assign(Object.create(null),this.initialValuesCache,i),errors:this.enablePersistence?this.formState.errors:Object.create(null)},i&&Object.keys(i).forEach(function(t){t in e.formState.values||(e.formState.values[t]=i[t])}),this.validator){try{this.validator.refresh(),this.validator.destroy()}catch(e){}this.validator=null}var o=this;this.validator=new a.FormValidator(this.element,{rules:t,locale:this.locale,ignore:"e-hidden",errorClass:"e-error",validClass:"e-valid",errorElement:"div",errorContainer:"div",customPlacement:function(e,t){var n=e.getAttribute("name");if(!n)return void(e.parentElement&&e.parentElement.appendChild(t));var r=document.getElementById("error-"+n);if(r){for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(t),r.style.display="block"}else e.parentElement&&e.parentElement.appendChild(t)},validationComplete:function(e){if(o.syncFormStateErrors(),e&&e.inputName){var t=document.getElementById("error-"+e.inputName);if(t)if("success"===e.status){for(;t.firstChild;)t.removeChild(t.firstChild);t.style.display="none"}else"failure"===e.status&&(t.style.display="block")}},submit:function(e){if(o.validator){if(!o.validator.validate())return void(e&&"function"==typeof e.preventDefault&&e.preventDefault());o.handleSubmitData(se({},o.formState.values)),e&&"function"==typeof e.preventDefault&&e.preventDefault()}},reset:function(){}}),i&&Object.keys(i).forEach(function(t){var n=e.validator.getInputElement(t);if(n&&void 0!==i[t]&&null!==i[t])try{n.value=String(i[t])}catch(e){}})},i.prototype.syncFormStateErrors=function(){var e={};if(this.validator)for(var t=0,n=this.validator.errorRules||[];t<n.length;t++){var r=n[t];r&&r.name&&(e[r.name]=r.message)}this.formState.errors=e},i.prototype.buildInitialValues=function(){var e=this,t={},n=this.collectAllComponents(this.processedSchemaCache.components),r=new Set;return n.forEach(function(e){if("staticHtml"===e.type)return void r.add(e.id);if("dataGrid"===e.type&&(t[e.id]=Array.isArray(e.dataSource)?e.dataSource:[]),void 0!==e.defaultValue)t[e.id]=e.defaultValue;else switch(e.type){case"checkbox":case"switch":t[e.id]=!1}r.add(e.id)}),this.formState&&Object.keys(this.formState.values).filter(function(e){return!r.has(e)}).forEach(function(t){delete e.formState.values[t]}),t},i.prototype.initExpressionEngine=function(){if(this.processedSchemaCache.components&&0!==this.processedSchemaCache.components.length)try{var e=this.expressionEngine,t=this.collectAllComponents(this.processedSchemaCache.components),n=e.buildDependencyGraph(t);e.detectCircularDependencies(n).length,this.expressionDependencyGraph=n;var r=new Set;t.forEach(function(e){e.expressionValue&&r.add(e.id)}),this.computedFieldNames=r}catch(e){this.failure&&this.trigger("failure",{error:e})}},i.prototype.disposeTooltipInstance=function(e){var t=this.tooltipRefs[e]||null;if(t){try{t.destroy()}catch(e){this.trigger("failure",{error:e})}this.renderedInstances=this.renderedInstances.filter(function(e){return e!==t}),this.tooltipRefs[e]=null}},i.prototype.renderField=function(e){var n=this,a=this.formState,i=a?a.values:{};if(-1!==["panel","table","tabs","card","message","button","splitButton","staticHtml"].indexOf(e.type))return null;var o=x.isFieldReadOnly(e.conditions,i),s=x.isFieldDisabled(e.conditions,i),l=x.isFieldRequired(e.conditions,i),d=x.getConditionalValue(e.conditions,i),c=!!e.readOnly||o,u=!!e.disabled||s,p=!!e.required||l,h=ie.getConstraints(e.minMaxRange,i,e.type);if("dateTime"===e.type){var m=ie.getConstraints(e.minMaxRange,i,"date"),f=ie.getConstraints(e.minMaxTimeRange,i,"time");h={minValue:void 0,maxValue:void 0,minDate:m.minDate,maxDate:m.maxDate,minTime:f.minTime,maxTime:f.maxTime}}var v=e.labelPosition||"top",y=e.labelWidth||"auto",b=!e.hideLabel&&!!e.label&&-1===["checkbox","button","staticHtml"].indexOf(e.type),C=!(!a||!a.errors[e.id]),w=C&&!(!a||-1===a.errors[e.id].indexOf("required")),S=C&&!(w&&!p),E=void 0!==d,T=this.conditionalValueApplied[e.id]||!1;a&&(E&&!T?(a.values[e.id]=d,this.conditionalValueApplied[e.id]=!0):!E&&T&&(this.conditionalValueApplied[e.id]=!1));var A=t.createElement("div",{className:"form-group",attrs:{"data-field-id":e.id,"data-fr-field":e.id}}),D=t.createElement("div",{className:"field-wrapper label-"+v.toLowerCase()});if(b){var V=t.createElement("label",{className:"field-label"});-1===de.indexOf(e.type)&&"textarea"!==e.type||V.setAttribute("for",t.isNullOrUndefined(this.element.id)?e.name:this.element.id+"-"+e.name),V.style.width="left"===v.toLowerCase()?y+"%":"auto";var O=t.createElement("span");if(O.textContent=e.label,V.appendChild(O),p){var I=t.createElement("span",{className:"required-asterisk"});I.textContent="*",V.appendChild(I)}if(this.disposeTooltipInstance(e.id),e.tooltip){var R=t.createElement("span",{className:"e-msg-icon e-icons e-circle-info tooltip-icon",attrs:{"aria-label":e.tooltip,title:e.tooltip,tabindex:"0",role:"button","aria-haspopup":"true"}});R.style.cursor="pointer",R.style.display="flex",R.style.alignItems="center",R.style.justifyContent="center",R.style.flexShrink="0",V.appendChild(R);var F=new r.Tooltip({content:e.tooltip,enableRtl:this.enableRtl});F.appendTo(R),this.tooltipRefs[e.id]=F,this.renderedInstances.push(F)}D.appendChild(V)}var k=t.createElement("div",{className:"field-input"}),N=("radio"===e.type||"checkboxGroup"===e.type)&&Array.isArray(e.options)?function(t,r){t&&"number"==typeof r&&(n.inputRefs[e.name+"_"+r]=t)}:function(t){t&&(n.inputRefs[e.name]=t)},M=se({},e,{readOnly:c,disabled:u,required:p},void 0!==h.minValue&&{minValue:h.minValue},void 0!==h.maxValue&&{maxValue:h.maxValue},void 0!==h.minDate&&{minDate:h.minDate},void 0!==h.maxDate&&{maxDate:h.maxDate},void 0!==h.minTime&&{minTime:h.minTime},void 0!==h.maxTime&&{maxTime:h.maxTime}),L=function(t){if("staticHtml"!==e.type){if("signature"===e.type&&(t=(r=n.inputRefs[t]).getSignature()),"imageEditor"===e.type){var r=n.inputRefs[t],i=r.getImageData(),o=document.createElement("canvas");o.width=i.width,o.height=i.height;var s=o.getContext("2d");s&&s.putImageData(i,0,0),t=o.toDataURL()}"radio"!==e.type&&"checkboxGroup"!==e.type||(n.validator.getInputElement(e.id).value=t),t=g(e,t),n.formState&&a&&(n.formState.values[e.id]=t,a.values[e.id]=t),n.trigger("change",{fieldName:e.name,label:e.label||e.id,value:t}),n.afterValueChange(e.id)}},P=-1!==de.indexOf(e.type)?"input":"textarea"===e.type?"textarea":"div",j=t.createElement(P,{attrs:{"aria-label":e.label+" "+e.type}});if("radio"===e.type||"checkboxGroup"===e.type){var B=t.createElement("input");B.id=t.isNullOrUndefined(this.element.id)?e.name:this.element.id+"-"+e.name,B.setAttribute("name",e.id),B.style.display="none",B.setAttribute("aria-hidden","true"),j.appendChild(B)}else j.id=t.isNullOrUndefined(this.element.id)?e.name:this.element.id+"-"+e.name,j.setAttribute("name",e.id);k.appendChild(j);var U=K({component:M,value:a?a.values[e.id]:void 0,onChange:L,formState:a,settings:this.processedSchemaCache.settings,onBlur:function(){if(a&&"staticHtml"!==e.type&&n.validator){try{n.beforeValidate(e.id),n.validator.validate(e.id)}catch(e){}n.syncFormStateErrors()}},ref:N,hasError:S,locale:this.locale,components:this.collectAllComponents(this.processedSchemaCache.components),enableRtl:this.enableRtl,target:j,l10n:this.l10n});if(Array.isArray(U))U.forEach(function(e){if(e&&"function"==typeof e.destroy)n.renderedInstances.push(e);else if(e instanceof HTMLElement)for(var t=0,r=Object.keys(n.inputRefs);t<r.length;t++){var a=r[t],i=n.inputRefs[a],o=i&&(i.element||i.target||i.hostElement&&i.hostElement());o&&(o===e||e.contains(o))&&n.renderedInstances.push(i)}});else if(U)if("function"==typeof U.destroy)this.renderedInstances.push(U);else if(U instanceof HTMLElement)for(var _=0,z=Object.keys(this.inputRefs);_<z.length;_++){var W=z[_],q=this.inputRefs[W],H=q&&(q.element||q.target||q.hostElement&&q.hostElement());H&&(H===U||U.contains(H))&&this.renderedInstances.push(q)}var G=t.createElement("div",{id:"error-"+(e.id||e.name||e.label),className:"e-error-message",attrs:{role:"alert","aria-live":"assertive"}});if(G.style.display="none",S&&a&&a.errors[e.id]&&(G.textContent=a.errors[e.id],G.classList.add("e-error"),G.style.display="block"),k.appendChild(G),D.appendChild(k),A.appendChild(D),e.description){var $=t.createElement("div",{className:"field-description",attrs:{"aria-describedby":"description-"+e.label}});$.textContent=e.description,A.appendChild($)}return A},i.prototype.renderComponent=function(e){var r=this,a=this.formState,i=a?a.values:{},s=!1!==e.visible&&x.isFieldVisible(e.conditions,i),l=x.isFieldHidden(e.conditions,i);if(!s||l)return a&&void 0!==a.values[e.id]&&null!==a.values[e.id]&&(a.values[e.id]=null),null;if(o.PRESERVABLE_TYPES.has(e.type)&&this.preservedFields.has(e.id)){var d=this.preservedFields.get(e.id);if(d)return this.preservedFields.delete(e.id),d}switch(e.type){case"panel":if((V=t.createElement("fieldset",{className:"form-panel-renderer "+(e.cssClass||"")})).style.minInlineSize="unset",e.label&&!e.hideLabel){var c=t.createElement("legend",{className:e.hideBorders?"":"panel-legend"});c.textContent=e.label,V.appendChild(c)}var u=t.createElement("div",{className:"panel-content"});return(e.children||[]).forEach(function(e){var t=r.renderComponent(e);t&&u.appendChild(t)}),V.appendChild(u),V;case"table":for(var p=e.rows||(e.tableCells?e.tableCells.length:2),h=e.columns||(e.tableCells&&e.tableCells[0]?e.tableCells[0].length:2),m=Math.floor(12/h),f=e.columnWidths,v=f?y(f.widths):[],g=t.createElement("div",{className:"form-table-renderer "+(e.hideBorders?"":"table-border")+" "+(e.cssClass||""),attrs:{role:"group","aria-label":e.label||"Table Layout"}}),b=0;b<p;b++){var C=t.createElement("div",{className:"e-form-table-row"});e.hideBorders&&(C.style.display="flex",C.style.gap="1.5rem");for(var w=0;w<h;w++)!function(n){var a=e.tableCells&&e.tableCells[b]&&e.tableCells[b][n]||[],i=m,o=v[n],s=1===h?{width:"100%"}:o?{width:o+"%"}:{},l=!f||Array.isArray(f.widths)&&f.widths.every(function(e){return null===e}),d=0===b,c=t.createElement("div",{className:"e-form-table-cell "+(o?"":l?"col-"+i:"")});e.hideBorders?Object.assign(c.style,s,{padding:d?"0":"12px 0 0 0"}):Object.assign(c.style,s),a.forEach(function(e){var t=r.renderComponent(e);t&&c.appendChild(t)}),C.appendChild(c)}(w);g.appendChild(C)}return g;case"tabs":var S=t.createElement("div",{className:"form-tabs-renderer "+(e.cssClass||"")}),E=t.createElement("div",{className:"e-tab"});E.id=e.id;var T=t.createElement("div",{className:"e-tab-header"}),A=t.createElement("div",{className:"e-content"});E.appendChild(T),E.appendChild(A),S.appendChild(E),(e.tabItems||[]).forEach(function(e){var n=t.createElement("div");n.textContent=e.header,T.appendChild(n);var a=t.createElement("div"),i=t.createElement("div",{className:"tab-content-renderer"});(e.content||[]).forEach(function(e){var t=r.renderComponent(e);t&&i.appendChild(t)}),a.appendChild(i),A.appendChild(a)});var D=new n.Tab({enableRtl:this.enableRtl,cssClass:e.cssClass,enablePersistence:!0,animation:{previous:{effect:"None"},next:{effect:"None"}},selected:function(t){if("undefined"==typeof window)return null;try{window.localStorage.setItem("tab"+e.id,JSON.stringify({selectedItem:t.selectedIndex}))}catch(e){}}});return D.appendTo(E),this.renderedInstances.push(D),S;case"card":var V=t.createElement("fieldset",{className:"e-card form-card-renderer "+(e.cssClass||"")});V.style.minInlineSize="unset",V.style.padding="0";var O=t.createElement("div",{className:"e-card-header"}),I=t.createElement("div",{className:"e-card-header-caption"}),R=t.createElement("div",{className:"e-card-title"});if(R.textContent=e.cardTitle||e.label||"Card Title",I.appendChild(R),e.cardSubtitle){var F=t.createElement("div",{className:"e-card-sub-title"});F.textContent=e.cardSubtitle,I.appendChild(F)}O.appendChild(I),V.appendChild(O);var k=t.createElement("div",{className:"e-card-content card-content"});return(e.children||[]).forEach(function(e){var t=r.renderComponent(e);t&&k.appendChild(t)}),V.appendChild(k),V;case"staticHtml":var N=new ae({content:e.defaultValue||"<p>HTML content</p>",id:e.id,enableHtmlSanitizer:e.enableHtmlSanitizer}),M=N.render();return this.renderedInstances.push(N),M;case"message":j=t.createElement("div",{className:"form-group"});(W=t.createElement("div")).id=e.name,W.setAttribute("name",e.id),j.appendChild(W);U=K({component:e,locale:this.locale,value:void 0,onChange:function(){},enableRtl:this.enableRtl,target:W,ref:function(t,n){void 0!==n?r.inputRefs[e.name+"_"+n]=t:r.inputRefs[e.name]=t}});return Array.isArray(U)?U.forEach(function(e){e&&r.renderedInstances.push(e)}):U&&this.renderedInstances.push(U),j;case"button":var L=x.isFieldDisabled(e.conditions,i),P=!!e.disabled||L,j=t.createElement("div",{className:"form-group"});(W=t.createElement("div")).id=e.name,W.setAttribute("name",e.id),j.appendChild(W);var B=function(t){if(r.buttonClick){var n=e.buttonsGroups?t.target&&t.target.ej2_instances?t.target.ej2_instances[0].content:"":e.label||"";r.trigger("buttonClick",{fieldName:e.name,label:n,event:t})}var a=t.target;if(a.type&&"reset"===a.type){var i=a.closest("form");i&&(i.querySelectorAll('input[type="checkbox"]').forEach(function(e){e.ej2_instances[0].checked=!1}),i.querySelectorAll(".e-control.e-multiselect.e-lib").forEach(function(e){e.ej2_instances[0].value=[]})),r.formState.values={},i.reset(),r.rerenderForm(),r.validator.destroy()}},U=K({component:se({},e,{disabled:P}),value:void 0,onChange:function(){},locale:this.locale,onClick:B,ref:function(t,n){void 0!==n?r.inputRefs[e.name+"_"+n]=t:r.inputRefs[e.name]=t},enableRtl:this.enableRtl,target:W});return Array.isArray(U)?U.forEach(function(e){e&&r.renderedInstances.push(e)}):U&&this.renderedInstances.push(U),j;case"splitButton":var _=x.isFieldDisabled(e.conditions,i),z=!!e.disabled||_,j=t.createElement("div",{className:"form-group"}),W=t.createElement("div");W.id=e.name,W.setAttribute("name",e.id),j.appendChild(W);var q=function(t){r.buttonClick&&r.trigger("buttonClick",{fieldName:e.name,label:e.label||"",event:t})},U=K({component:se({},e,{disabled:z}),value:void 0,locale:this.locale,onChange:function(){},onClick:q,ref:function(t){t&&(r.inputRefs[e.name]=t)},enableRtl:this.enableRtl,target:W});return Array.isArray(U)?U.forEach(function(e){e&&r.renderedInstances.push(e)}):U&&this.renderedInstances.push(U),j;default:return this.renderField(e)}},i.prototype.afterValueChange=function(e){this.formState&&(this.currentFormValues=se({},this.formState.values),this.evaluateExpressions(),this.retriggerCustomValidation(),this.beforeValidate(e),this.validator.validate(e),this.syncFormStateErrors(),e&&this.isConditionalTrigger(e)&&this.scheduleRerender(e))},i.prototype.beforeValidate=function(e){var t=this.element.querySelector("#"+e+"-info");t&&t.classList.contains("e-error")&&t.classList.remove("e-error");var n=this.getInputElementByName(e),r=n.parentElement,a=r.parentElement;r.classList.contains("e-control-wrapper")||r.classList.contains("e-wrapper")||n.classList.contains("e-input")&&r.classList.contains("e-input-group")?r.classList.remove("e-error"):null!=a&&(a.classList.contains("e-control-wrapper")||a.classList.contains("e-wrapper"))?a.classList.remove("e-error"):n.classList.remove("e-error"),this.validator&&(this.validator.errorRules=[])},i.prototype.scheduleRerender=function(e){var t=this;e&&this.pendingChangedFieldIds.add(e),this.rerenderScheduled||(this.rerenderScheduled=!0,Promise.resolve().then(function(){t.rerenderScheduled=!1;var e=new Set(t.pendingChangedFieldIds);t.pendingChangedFieldIds.clear(),t.rerenderForm(e)}))},i.prototype.collectConditionFieldIds=function(e,t){if(e)if("string"==typeof e.field)t.add(e.field);else if(Array.isArray(e.rules))for(var n=0,r=e.rules;n<r.length;n++){var a=r[n];this.collectConditionFieldIds(a,t)}},i.prototype.collectDataSourceReferenceIds=function(e,t,n){if("string"==typeof e){var r=e.match(/\{([^}]+)\}/g);if(r)for(var a=0,i=r;a<i.length;a++)!function(e){var r=e.slice(1,-1),a=t.find(function(e){return e.name===r});a&&a.id&&n.add(a.id)}(i[a])}},i.prototype.buildConditionalDependencyMap=function(){for(var e=new Set,t=new Map,n=this.collectAllComponents(this.processedSchemaCache.components),r=this,a=0,i=n;a<i.length;a++)!function(a){var i=new Set;t.set(a.id,i);var o=a.conditions;if(o){for(var s=0,l=["visibleWhen","hideWhen","disabledWhen","requiredWhen","readOnlyWhen","choiceBasedField","conditionalData"];s<l.length;s++){var d=l[s];o[d]&&(r.collectConditionFieldIds(o[d],e),r.collectConditionFieldIds(o[d],i))}if(Array.isArray(o.conditionalData))for(var c=0,u=o.conditionalData;c<u.length;c++){var p=u[c];if(p&&p.condition&&(r.collectConditionFieldIds(p.condition,e),r.collectConditionFieldIds(p.condition,i)),p&&Array.isArray(p.conditions))for(var h=0,m=p.conditions;h<m.length;h++){var f=m[h];r.collectConditionFieldIds(f,e),r.collectConditionFieldIds(f,i)}}o.setValueWhen&&o.setValueWhen.condition&&(r.collectConditionFieldIds(o.setValueWhen.condition,e),r.collectConditionFieldIds(o.setValueWhen.condition,i)),o.choiceBasedField&&"string"==typeof o.choiceBasedField.primaryFieldId&&(e.add(o.choiceBasedField.primaryFieldId),i.add(o.choiceBasedField.primaryFieldId))}var v=function(t){if(t&&!0===t.enabled){var n=function(t){t&&"object"==typeof t&&"string"==typeof t.field&&(e.add(t.field),i.add(t.field))};n(t.minValue),n(t.maxValue)}},y=a.minMaxRange;if(Array.isArray(y))for(var g=0,b=y;g<b.length;g++)v(S=b[g]);var x=a.minMaxTimeRange;if(Array.isArray(x))for(var C=0,w=x;C<w.length;C++){var S=w[C];v(S)}var E=a.dataSource;if("dataGrid"===a.type&&E&&"url"===E.type&&(E.search&&"string"==typeof E.search.key&&(r.collectDataSourceReferenceIds(E.search.key,n,e),r.collectDataSourceReferenceIds(E.search.key,n,i)),Array.isArray(E.filters)))for(var T=0,A=E.filters;T<A.length;T++){var D=A[T];"string"==typeof D.value&&(r.collectDataSourceReferenceIds(D.value,n,e),r.collectDataSourceReferenceIds(D.value,n,i))}}(i[a]);this.conditionalTriggerFieldIds=e,this.consumerDependencyMap=t},i.prototype.isConditionalTrigger=function(e){return this.conditionalTriggerFieldIds.has(e)},i.prototype.rerenderForm=function(e){var t=this,n=e||new Set,r=document.activeElement,a=r&&r.getAttribute?r.getAttribute("name"):null,i=null,s=null;if(a&&r&&void 0!==r.selectionStart)try{i=r.selectionStart,s=r.selectionEnd}catch(e){}var l=this.element.scrollTop,d=this.element.scrollLeft,c=window.scrollX,u=window.scrollY;this.preservedFields.clear();for(var p=this,h=0,m=this.collectAllComponents(this.processedSchemaCache.components);h<m.length;h++)!function(e){if(!o.PRESERVABLE_TYPES.has(e.type))return"continue";var t=p.consumerDependencyMap.get(e.id),r=!1;if(t&&n.forEach(function(e){t.has(e)&&(r=!0)}),r)return"continue";var a=p.element.querySelector('[data-field-id="'+e.id+'"]');a&&a.parentElement&&(a.parentElement.removeChild(a),p.preservedFields.set(e.id,a))}(m[h]);this.refreshing=!0,this.destroyRenderedExcludingPreserved(),this.removePreviousRoot(),this.validator&&this.validator.destroy(),this.render(),this.refreshing=!1;try{this.element.scrollTop=l,this.element.scrollLeft=d,window.scrollTo(c,u)}catch(e){}if(a){var f=this.getInputElementByName(a);if(f&&"function"==typeof f.focus)try{if(f.focus(),null!==i&&null!==s&&"function"==typeof f.setSelectionRange)try{f.setSelectionRange(i,s)}catch(e){}}catch(e){}}if(this.preservedFields.size>0){var v=[];this.preservedFields.forEach(function(e,n){if(t.element.contains(e)||document.body.contains(e))v.push(n);else{t.destroyPreservedSubtree(e);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){}t.preservedFields.delete(n)}}),v.forEach(function(e){return t.preservedFields.delete(e)})}},i.prototype.removePreviousRoot=function(){if(this.element)for(;this.element.childNodes.length>0;)this.element.removeChild(this.element.firstChild)},i.prototype.destroyRenderedInstance=function(e){if(e&&"function"==typeof e.destroy){var t=e;if(!(t.isDestroyed||t.destroyed||t.disposed)){var n=e.element||e.target||(e.hostElement&&"function"==typeof e.hostElement?e.hostElement():void 0);try{t.isDestroyed=!0,t.destroyed=!0,t.disposed=!0,e.destroy()}catch(e){console.warn("FormRenderer: failed to destroy child instance.",e)}finally{if(n&&n.parentNode)try{n.parentNode.removeChild(n)}catch(e){}}}}},i.prototype.destroyRenderedExcludingPreserved=function(){for(var e=[],t=Array.from(this.preservedFields.values()),n=this,r=0,a=this.renderedInstances;r<a.length;r++)!function(r){var a=r&&(r.element||r.target||r.hostElement&&r.hostElement());!!a&&t.some(function(e){return e===a||e.contains(a)})?e.push(r):n.destroyRenderedInstance(r)}(a[r]);this.renderedInstances=e;for(var i=this,o=0,s=Object.keys(this.inputRefs);o<s.length;o++)!function(e){var n=i.inputRefs[e],r=n&&(n.element||n.target||n.hostElement&&n.hostElement());!!r&&t.some(function(e){return e===r||e.contains(r)})||delete i.inputRefs[e]}(s[o]);this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set},i.prototype.destroyPreservedSubtree=function(e){for(var t=[],n=0,r=this.renderedInstances;n<r.length;n++){var a=r[n],i=a&&(a.element||a.target||a.hostElement&&a.hostElement());i&&(i===e||e.contains(i))?this.destroyRenderedInstance(a):t.push(a)}this.renderedInstances=t},i.prototype.getInputElementByName=function(e){var t=this.element.querySelector('[name="'+e+'"]');if(!t)return null;if(!t.classList.contains("e-control")){var n=t.parentElement?t.parentElement.querySelector(".e-control"):null;if(n)return n}return t},i.prototype.evaluateExpressions=function(){if(this.formState&&this.expressionEngine&&!this.expressionEvaluationInProgress)try{this.expressionEvaluationInProgress=!0;var e=this.expressionEngine,t=this.expressionDependencyGraph,n=this.formState.values||{},r=this.collectAllComponents(this.processedSchemaCache.components),a=this.previousFormValues,i=this.computedFieldNames,o={};r.forEach(function(e){e.name&&(o[e.id]=e.name)});for(var s={},l=0,d=Object.keys(n);l<d.length;l++){var c=d[l],u=n[c];(b=o[c])&&(s[b]=u)}var p=se({},a);Object.assign(a,s);for(var h=new Set,m=0,f=Object.keys(s);m<f.length;m++)!function(e){var t=Object.keys(o).find(function(t){return o[t]===e});t&&s[e]!==p[e]&&!i.has(t)&&h.add(e)}(b=f[m]);if(0===h.size)return;for(var v=this,y=0,g=e.getTopologicalOrder(t);y<g.length;y++){var b=g[y];!function(t){var a=r.find(function(e){return e.name===t});if(a&&a.expressionValue){i.add(a.id);try{if(!1!==a.visible&&x.isFieldVisible(a.conditions,n)){for(var s={},l=0,d=Object.keys(n);l<d.length;l++){var c=d[l],u=n[c],p=o[c];p&&(s[p]=u)}var h=e.evaluate(a.expressionValue,s);if(null!==(h="string"==typeof h&&-1!==h.indexOf("undefined")?h.replace(/undefined/g,""):h)&&void 0!==h&&""!==h)switch(a.type){case"number":var m=Number(h);h=isNaN(m)?0:m;break;case"checkbox":case"switch":h=Boolean(h);break;case"textbox":case"textarea":h=String(h);break;case"dateRange":case"checkboxGroup":case"multiselect":break;default:h=String(h)}if(null!==h&&void 0!==h&&h!==n[a.id]&&v.formState&&(v.formState.values[a.id]=h,v.validator)){var f=v.getInputElementByName(a.id);if(f)try{f.ej2_instances[0]?f.ej2_instances[0].value=h:f.value=String(h)}catch(e){}}}}catch(e){v.failure&&v.trigger("failure",{error:e})}}}(b)}Object.assign(a,s)}finally{this.expressionEvaluationInProgress=!1}},i.prototype.retriggerCustomValidation=function(){var e=this;if(this.formState&&this.customValidationEngine)try{var t=this.collectAllComponents(this.processedSchemaCache.components),n=this.formState.values||{},r=this.previousFormValues,a=new Set;if(Object.keys(n).forEach(function(e){n[e]!==r[e]&&a.add(e)}),0===a.size)return;var i=new Set;a.forEach(function(e){var n=t.find(function(t){return t.id===e});n&&n.customValidation&&Array.isArray(n.customValidation)&&i.add(e)}),t.forEach(function(n){n.customValidation&&Array.isArray(n.customValidation)&&n.customValidation.forEach(function(r){e.customValidationEngine.extractDependencies(r.expression).forEach(function(e){var r=t.find(function(t){return t.id===e||t.name===e});r&&a.has(r.id)&&i.add(n.id)})})}),this.previousFormValues=se({},n)}catch(e){this.failure&&this.trigger("failure",{error:e})}},i.prototype.handleSubmitData=function(e){for(var t=this.formState,n=!(!t||!t.errors)&&0===Object.keys(t.errors).length,r={},a=t?t.values:{},i=new Set(["button","message","panel","table","tabs"]),o=this.collectAllComponents(this.processedSchemaCache.components||[]),s=new Set(o.filter(function(e){return i.has(e.type)}).map(function(e){return e.id})),l=new Set(o.filter(function(e){return!1===e.visible||(!(!e.conditions||!e.conditions.visibleWhen||x.isFieldVisible(e.conditions,a))||!!(e.conditions&&e.conditions.hideWhen&&x.isFieldHidden(e.conditions,a)))}).map(function(e){return e.id})),d=new Set(o.filter(function(e){return!!e.disabled||!(!e.conditions||!e.conditions.disabledWhen)&&x.isFieldDisabled(e.conditions,a)}).map(function(e){return e.id})),c=0,u=Object.keys(e);c<u.length;c++){var p=u[c],h=e[p];if(s.has(p)||l.has(p)||d.has(p))return;r[this.idToLabelCache[p]||p]=h}this.submit&&this.trigger("submit",{data:r,isValid:n})},i.prototype.getComponent=function(e){return this.inputRefs[e]||null},i.prototype.onPropertyChanged=function(e,t){var n=!1;e.schema!==t.schema&&(n=!0),e.locale!==t.locale&&(n=!0),e.enableRtl!==t.enableRtl&&(n=!0),e.layout!==t.layout&&(n=!0),e.locale!==t.locale&&(n=!0),n&&(this.refreshing=!0,this.destroyRendered(),this.removePreviousRoot(),this.isInitialized=!1,this.render(),this.refreshing=!1)},i.prototype.destroyRendered=function(){var e=this;if(this.validator){try{this.validator.destroy()}catch(e){this.trigger("failure",{error:e})}this.validator=null}this.renderedInstances.forEach(function(t){e.destroyRenderedInstance(t)}),this.renderedInstances=[],this.removePreviousRoot(),this.inputRefs={},this.tooltipRefs={},this.conditionalValueApplied={},this.expressionDependencyGraph={},this.computedFieldNames=new Set,this.previousFormValues={},this.conditionalTriggerFieldIds=new Set,this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.pendingChangedFieldIds=new Set},i.prototype.clearPersistedTabSelections=function(){if("undefined"==typeof window)return null;try{var e=this.processedSchemaCache&&this.processedSchemaCache.components?this.processedSchemaCache.components:[];this.collectAllComponents(e).forEach(function(e){"tabs"===e.type&&e.id&&window.localStorage.removeItem("tab"+e.id)})}catch(e){}},i.prototype.destroy=function(){this.destroyRendered(),this.formState={values:{},errors:{}},this.expressionEngine=null,this.customValidationEngine=null,this.clearEngineCaches(),this.clearPersistedTabSelections(),this.consumerDependencyMap=new Map,this.preservedFields=new Map,this.conditionalTriggerFieldIds=new Set,e.prototype.destroy.call(this)},i.prototype.clearEngineCaches=function(){if(this.expressionEngine)try{this.expressionEngine.clearCache()}catch(e){}if(this.customValidationEngine){var e=this.customValidationEngine.expressionEngine;if(e&&"function"==typeof e.clearCache)try{e.clearCache()}catch(e){}}};var o;return i.PRESERVABLE_TYPES=new Set(["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"]),le([t.Property(null)],i.prototype,"schema",void 0),le([t.Property("SingleColumn")],i.prototype,"layout",void 0),le([t.Property("")],i.prototype,"className",void 0),le([t.Event()],i.prototype,"submit",void 0),le([t.Event()],i.prototype,"change",void 0),le([t.Event()],i.prototype,"buttonClick",void 0),le([t.Event()],i.prototype,"failure",void 0),le([t.Event()],i.prototype,"created",void 0),i=o=le([t.NotifyPropertyChanges],i)}(t.Component);!function(e){e.SingleColumn="SingleColumn",e.TwoColumn="TwoColumn",e.ThreeColumn="ThreeColumn",e.FourColumn="FourColumn"}(e.FormLayout||(e.FormLayout={}));var pe=["textbox","textarea","number","checkbox","checkboxGroup","radio","dropdown","multiselect","button","date","dateTime","time","dateRange","switch","signature","rating","imageEditor","fileUpload","rangeSlider","colorPicker","inputMask","message","panel","table","tabs","dataGrid","staticHtml","card","splitButton","richTextEditor"];return e.FORM_COMPONENT_TYPES=pe,e.FormRenderer=ue,e.defaultLocale=ce,e}({},ej.base,ej.navigations,ej.popups,ej.inputs,ej.buttons,ej.splitbuttons,ej.dropdowns,ej.calendars,ej.notifications,ej2ImageEditor,ej.richtexteditor,ej.data,ej.grids),this.ejs=ej;
11
2
  //# sourceMappingURL=ej2-form-renderer.min.js.map
@@ -1,12 +1,3 @@
1
- /*!
2
- * filename: index.d.ts
3
- * version : 34.2.3
4
- * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  import * as _formrenderer from '@syncfusion/ej2-form-renderer';
11
2
 
12
3
  export declare namespace ej {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-form-renderer",
3
- "version": "34.2.3",
3
+ "version": "34.2.5",
4
4
  "description": "A package of Essential JS 2 Form Renderer which can render feature-rich Syncfusion components as a form.",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -9,14 +9,14 @@
9
9
  "es2015": "./dist/es6/ej2-form-renderer.es5.js",
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-buttons": "~34.2.2",
12
- "@syncfusion/ej2-calendars": "~34.2.3",
13
- "@syncfusion/ej2-dropdowns": "~34.2.3",
14
- "@syncfusion/ej2-grids": "~34.2.3",
15
- "@syncfusion/ej2-image-editor": "~34.2.2",
12
+ "@syncfusion/ej2-calendars": "~34.2.5",
13
+ "@syncfusion/ej2-dropdowns": "~34.2.5",
14
+ "@syncfusion/ej2-grids": "~34.2.5",
15
+ "@syncfusion/ej2-image-editor": "~34.2.5",
16
16
  "@syncfusion/ej2-inputs": "~34.2.2",
17
- "@syncfusion/ej2-navigations": "~34.2.3",
17
+ "@syncfusion/ej2-navigations": "~34.2.5",
18
18
  "@syncfusion/ej2-notifications": "~34.2.2",
19
- "@syncfusion/ej2-richtexteditor": "~34.2.3",
19
+ "@syncfusion/ej2-richtexteditor": "~34.2.5",
20
20
  "@syncfusion/ej2-splitbuttons": "~34.2.2"
21
21
  },
22
22
  "devDependencies": {},