smart-webcomponents-react 11.0.55 → 12.0.0

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.
Files changed (251) hide show
  1. package/index.d.ts +34 -0
  2. package/kanban/kanban.d.ts +16 -0
  3. package/kanban/kanban.esm.js +50 -1
  4. package/kanban/kanban.umd.js +50 -1
  5. package/package.json +1 -1
  6. package/source/modules/smart.accordion.js +1 -1
  7. package/source/modules/smart.array.js +1 -1
  8. package/source/modules/smart.breadcrumb.js +1 -1
  9. package/source/modules/smart.button.js +1 -1
  10. package/source/modules/smart.buttongroup.js +1 -1
  11. package/source/modules/smart.calendar.js +3 -3
  12. package/source/modules/smart.card.js +1 -1
  13. package/source/modules/smart.cardview.js +6 -6
  14. package/source/modules/smart.carousel.js +1 -1
  15. package/source/modules/smart.chart.js +3 -3
  16. package/source/modules/smart.checkbox.js +1 -1
  17. package/source/modules/smart.checkinput.js +2 -2
  18. package/source/modules/smart.chip.js +1 -1
  19. package/source/modules/smart.colorinput.js +2 -2
  20. package/source/modules/smart.colorpanel.js +1 -1
  21. package/source/modules/smart.colorpicker.js +1 -1
  22. package/source/modules/smart.combobox.js +1 -1
  23. package/source/modules/smart.common.js +4 -4
  24. package/source/modules/smart.countryinput.js +2 -2
  25. package/source/modules/smart.dateinput.js +3 -3
  26. package/source/modules/smart.daterangeinput.js +3 -3
  27. package/source/modules/smart.datetimepicker.js +3 -3
  28. package/source/modules/smart.dockinglayout.js +1 -1
  29. package/source/modules/smart.dropdownbutton.js +1 -1
  30. package/source/modules/smart.dropdownlist.js +1 -1
  31. package/source/modules/smart.editor.js +3 -3
  32. package/source/modules/smart.element.js +1 -1
  33. package/source/modules/smart.fileupload.js +1 -1
  34. package/source/modules/smart.form.js +2 -2
  35. package/source/modules/smart.formulaparser.js +1 -1
  36. package/source/modules/smart.ganttchart.js +7 -7
  37. package/source/modules/smart.gauge.js +2 -2
  38. package/source/modules/smart.grid.js +18 -18
  39. package/source/modules/smart.gridpanel.js +6 -6
  40. package/source/modules/smart.input.js +2 -2
  41. package/source/modules/smart.kanban.js +9 -9
  42. package/source/modules/smart.layout.js +1 -1
  43. package/source/modules/smart.led.js +1 -1
  44. package/source/modules/smart.listbox.js +1 -1
  45. package/source/modules/smart.listmenu.js +1 -1
  46. package/source/modules/smart.map.js +1 -1
  47. package/source/modules/smart.maskedtextbox.js +2 -2
  48. package/source/modules/smart.menu.js +1 -1
  49. package/source/modules/smart.multicomboinput.js +3 -3
  50. package/source/modules/smart.multiinput.js +2 -2
  51. package/source/modules/smart.multilinetextbox.js +1 -1
  52. package/source/modules/smart.multisplitbutton.js +1 -1
  53. package/source/modules/smart.numberinput.js +2 -2
  54. package/source/modules/smart.numerictextbox.js +1 -1
  55. package/source/modules/smart.pager.js +2 -2
  56. package/source/modules/smart.passwordinput.js +2 -2
  57. package/source/modules/smart.passwordtextbox.js +2 -2
  58. package/source/modules/smart.path.js +1 -1
  59. package/source/modules/smart.phoneinput.js +2 -2
  60. package/source/modules/smart.pivottable.js +6 -6
  61. package/source/modules/smart.progressbar.js +1 -1
  62. package/source/modules/smart.querybuilder.js +4 -4
  63. package/source/modules/smart.radiobutton.js +1 -1
  64. package/source/modules/smart.rating.js +1 -1
  65. package/source/modules/smart.router.js +2 -2
  66. package/source/modules/smart.scheduler.js +6 -6
  67. package/source/modules/smart.scrollbar.js +1 -1
  68. package/source/modules/smart.slider.js +2 -2
  69. package/source/modules/smart.sortable.js +1 -1
  70. package/source/modules/smart.splitter.js +1 -1
  71. package/source/modules/smart.switchbutton.js +1 -1
  72. package/source/modules/smart.table.js +6 -6
  73. package/source/modules/smart.tabs.js +1 -1
  74. package/source/modules/smart.tank.js +2 -2
  75. package/source/modules/smart.textarea.js +2 -2
  76. package/source/modules/smart.textbox.js +1 -1
  77. package/source/modules/smart.timeinput.js +2 -2
  78. package/source/modules/smart.timepicker.js +1 -1
  79. package/source/modules/smart.toast.js +1 -1
  80. package/source/modules/smart.tooltip.js +1 -1
  81. package/source/modules/smart.tree.js +1 -1
  82. package/source/modules/smart.validator.js +1 -1
  83. package/source/modules/smart.window.js +1 -1
  84. package/source/smart.accordion.js +1 -1
  85. package/source/smart.ajax.js +1 -1
  86. package/source/smart.array.js +1 -1
  87. package/source/smart.bootstrap.js +1 -1
  88. package/source/smart.breadcrumb.js +1 -1
  89. package/source/smart.button.js +1 -1
  90. package/source/smart.buttongroup.js +1 -1
  91. package/source/smart.calendar.js +1 -1
  92. package/source/smart.card.js +1 -1
  93. package/source/smart.cardview.js +1 -1
  94. package/source/smart.carousel.js +1 -1
  95. package/source/smart.chart.annotations.js +1 -1
  96. package/source/smart.chart.api.js +1 -1
  97. package/source/smart.chart.core.js +1 -1
  98. package/source/smart.chart.js +1 -1
  99. package/source/smart.chart.rangeselector.js +1 -1
  100. package/source/smart.chart.waterfall.js +1 -1
  101. package/source/smart.checkbox.js +1 -1
  102. package/source/smart.checkinput.js +1 -1
  103. package/source/smart.chip.js +1 -1
  104. package/source/smart.colorinput.js +1 -1
  105. package/source/smart.colorpanel.js +1 -1
  106. package/source/smart.colorpicker.js +1 -1
  107. package/source/smart.combobox.js +1 -1
  108. package/source/smart.complex.js +1 -1
  109. package/source/smart.core.js +1 -1
  110. package/source/smart.countryinput.js +1 -1
  111. package/source/smart.data.js +2 -2
  112. package/source/smart.date.js +2 -2
  113. package/source/smart.dateformatpanel.js +1 -1
  114. package/source/smart.dateinput.js +1 -1
  115. package/source/smart.daterangeinput.js +1 -1
  116. package/source/smart.datetimepicker.js +2 -2
  117. package/source/smart.dockinglayout.js +1 -1
  118. package/source/smart.draw.js +1 -1
  119. package/source/smart.dropdownbutton.js +1 -1
  120. package/source/smart.dropdownlist.js +1 -1
  121. package/source/smart.editor.js +1 -1
  122. package/source/smart.element.js +1 -1
  123. package/source/smart.elements.js +18 -18
  124. package/source/smart.export.js +2 -2
  125. package/source/smart.fileupload.js +1 -1
  126. package/source/smart.filter.js +1 -1
  127. package/source/smart.filterbuilder.js +1 -1
  128. package/source/smart.filterpanel.js +1 -1
  129. package/source/smart.form.js +1 -1
  130. package/source/smart.format.js +1 -1
  131. package/source/smart.formulaparser.js +1 -1
  132. package/source/smart.ganttchart.js +1 -1
  133. package/source/smart.gauge.js +1 -1
  134. package/source/smart.grid.cell.js +2 -2
  135. package/source/smart.grid.chart.js +1 -1
  136. package/source/smart.grid.column.js +2 -2
  137. package/source/smart.grid.core.js +2 -2
  138. package/source/smart.grid.dialog.js +2 -2
  139. package/source/smart.grid.edit.js +2 -2
  140. package/source/smart.grid.export.js +1 -1
  141. package/source/smart.grid.filter.js +1 -1
  142. package/source/smart.grid.group.js +1 -1
  143. package/source/smart.grid.js +1 -1
  144. package/source/smart.grid.menu.js +1 -1
  145. package/source/smart.grid.pager.js +1 -1
  146. package/source/smart.grid.reorder.js +1 -1
  147. package/source/smart.grid.resize.js +2 -2
  148. package/source/smart.grid.row.js +2 -2
  149. package/source/smart.grid.select.js +2 -2
  150. package/source/smart.grid.sort.js +1 -1
  151. package/source/smart.grid.toolbar.js +2 -2
  152. package/source/smart.grid.tree.js +1 -1
  153. package/source/smart.grid.view.js +2 -2
  154. package/source/smart.gridpanel.js +2 -2
  155. package/source/smart.input.js +2 -2
  156. package/source/smart.kanban.js +2 -2
  157. package/source/smart.layout.js +1 -1
  158. package/source/smart.led.js +1 -1
  159. package/source/smart.listbox.js +1 -1
  160. package/source/smart.listmenu.js +1 -1
  161. package/source/smart.map.js +1 -1
  162. package/source/smart.maskedtextbox.js +1 -1
  163. package/source/smart.math.js +1 -1
  164. package/source/smart.menu.js +1 -1
  165. package/source/smart.multicomboinput.js +2 -2
  166. package/source/smart.multiinput.js +1 -1
  167. package/source/smart.multilinetextbox.js +1 -1
  168. package/source/smart.multisplitbutton.js +1 -1
  169. package/source/smart.numberformatpanel.js +1 -1
  170. package/source/smart.numberinput.js +1 -1
  171. package/source/smart.numeric.js +1 -1
  172. package/source/smart.numerictextbox.js +1 -1
  173. package/source/smart.pager.js +1 -1
  174. package/source/smart.passwordinput.js +1 -1
  175. package/source/smart.passwordtextbox.js +1 -1
  176. package/source/smart.path.js +1 -1
  177. package/source/smart.phoneinput.js +1 -1
  178. package/source/smart.pivottable.js +1 -1
  179. package/source/smart.powerbutton.js +1 -1
  180. package/source/smart.progressbar.js +1 -1
  181. package/source/smart.radiobutton.js +1 -1
  182. package/source/smart.rating.js +1 -1
  183. package/source/smart.router.js +1 -1
  184. package/source/smart.scheduler.js +1 -1
  185. package/source/smart.scrollbar.js +1 -1
  186. package/source/smart.slider.js +1 -1
  187. package/source/smart.sortable.js +1 -1
  188. package/source/smart.splitter.js +1 -1
  189. package/source/smart.switchbutton.js +1 -1
  190. package/source/smart.table.js +1 -1
  191. package/source/smart.tabs.js +1 -1
  192. package/source/smart.tank.js +1 -1
  193. package/source/smart.textarea.js +1 -1
  194. package/source/smart.textbox.js +1 -1
  195. package/source/smart.tickintervalhandler.js +1 -1
  196. package/source/smart.timeinput.js +1 -1
  197. package/source/smart.timepicker.js +1 -1
  198. package/source/smart.toast.js +1 -1
  199. package/source/smart.tooltip.js +1 -1
  200. package/source/smart.tree.js +1 -1
  201. package/source/smart.validationpanel.js +1 -1
  202. package/source/smart.validator.js +1 -1
  203. package/source/smart.window.js +1 -1
  204. package/source/styles/components/smart.array.css +1 -1
  205. package/source/styles/components/smart.calendar.css +1 -1
  206. package/source/styles/components/smart.cardview.css +1 -1
  207. package/source/styles/components/smart.checkinput.css +1 -1
  208. package/source/styles/components/smart.colorinput.css +1 -1
  209. package/source/styles/components/smart.columnpanel.css +1 -1
  210. package/source/styles/components/smart.countryinput.css +1 -1
  211. package/source/styles/components/smart.dateinput.css +1 -1
  212. package/source/styles/components/smart.daterangeinput.css +1 -1
  213. package/source/styles/components/smart.datetimeformatpanel.css +1 -1
  214. package/source/styles/components/smart.editor.css +1 -1
  215. package/source/styles/components/smart.filterbuilder.css +1 -1
  216. package/source/styles/components/smart.filterpanel.css +1 -1
  217. package/source/styles/components/smart.ganttchart.css +1 -1
  218. package/source/styles/components/smart.grid.css +2 -2
  219. package/source/styles/components/smart.gridpanel.css +1 -1
  220. package/source/styles/components/smart.input.css +1 -1
  221. package/source/styles/components/smart.kanban.css +2 -2
  222. package/source/styles/components/smart.maskedtextbox.css +1 -1
  223. package/source/styles/components/smart.multicolumnfilterpanel.css +1 -1
  224. package/source/styles/components/smart.multicomboinput.css +1 -1
  225. package/source/styles/components/smart.multiinput.css +1 -1
  226. package/source/styles/components/smart.multilinetextbox.css +1 -1
  227. package/source/styles/components/smart.numberformatpanel.css +1 -1
  228. package/source/styles/components/smart.numberinput.css +1 -1
  229. package/source/styles/components/smart.pager.css +1 -1
  230. package/source/styles/components/smart.passwordinput.css +1 -1
  231. package/source/styles/components/smart.passwordtextbox.css +1 -1
  232. package/source/styles/components/smart.phoneinput.css +1 -1
  233. package/source/styles/components/smart.pivottable.css +1 -1
  234. package/source/styles/components/smart.querybuilder.css +1 -1
  235. package/source/styles/components/smart.scheduler.css +1 -1
  236. package/source/styles/components/smart.sortpanel.css +1 -1
  237. package/source/styles/components/smart.table.css +1 -1
  238. package/source/styles/components/smart.textarea.css +1 -1
  239. package/source/styles/components/smart.textbox.css +1 -1
  240. package/source/styles/components/smart.timeinput.css +1 -1
  241. package/source/styles/components/smart.validationpanel.css +1 -1
  242. package/source/styles/components/smart.window.css +1 -1
  243. package/source/styles/default/scss/smart.grid.scss +97 -36
  244. package/source/styles/default/scss/smart.kanban.scss +22 -0
  245. package/source/styles/default/scss/textbox/_multi-combo-input.scss +42 -1
  246. package/source/styles/default/smart.grid.css +77 -26
  247. package/source/styles/default/smart.kanban.css +18 -0
  248. package/source/styles/default/smart.textbox.css +28 -1
  249. package/source/styles/smart.default.css +3 -3
  250. package/source/typescript/smart.elements.d.ts +34 -0
  251. package/source/typescript/smart.kanban.d.ts +34 -0
@@ -814,21 +814,21 @@ Smart.Utilities.Assign("Complex",class{constructor(r,a){if("string"==typeof r)th
814
814
  /***/ 6057:
815
815
  /***/ (() => {
816
816
 
817
- (()=>{Smart.DataAdapter=window.smartDataAdapter=class{constructor(e){e||(e={});const t=Object.assign(this,e);t.key=(65536*(1+Math.random())|0).toString(16).substring(1),t.$document=Smart.Utilities.Extend(document),t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],void 0===t.allowAdd&&(t.allowAdd=!0),void 0===t.allowRemove&&(t.allowRemove=!0),void 0===t.allowUpdate&&(t.allowUpdate=!0),void 0===t.mapChar&&(t.mapChar="."),void 0!==e.observable||t.virtualDataSource?t.observable=!1:t.observable=!0,void 0===t.sanitizeHTML&&(t.sanitizeHTML="blackList"),t._expandedRowIds=[],e.dataSource||(t.dataSource=[]),e.dataFields||(t.dataFields=[]),e.dataSourceType||(t.dataSourceType="array"),e.id||(t.id=null),e.autoFetch||(t.autoFetch=!0),e.dataFields&&(t.dataFields=e.dataFields),Object.defineProperty(t,"groupBy",{configurable:!1,enumerable:!0,get:()=>t._groupBy?t._groupBy:[],set(e){const a=()=>{t.boundHierarchy=null,t.refreshHierarchy(),t.onGroup&&t.onGroup()};t._groupBy=new Smart.ObservableArray(e),t._groupBy.notify((function(){a()})),t.isInitialized&&a()}}),e.groupBy?e.groupBy.toArray?t.groupBy=e.groupBy.toArray():t.groupBy=e.groupBy:t.groupBy=[],e&&!1!==e.autoBind&&t.dataBind(),t.isInitialized=!0}beginUpdate(){this.isUpdating=!0}endUpdate(){const e=this;e.isUpdating=!1,e.refreshIndexes(),e.refreshHierarchy()}get expandHierarchy(){return void 0===this._expandHierarchy&&(this._expandHierarchy=!1),this._expandHierarchy}set expandHierarchy(e){const t=this;t._expandHierarchy=e,t.isInitialized&&t.refreshHierarchy()}_getDataField(e){switch(e.name){case"leaf":case"parent":case"expanded":case"checked":case"selected":case"level":case"icon":case"data":case"group":case"children":case"items":e.map?e.map=e.map.replace(e.name,"$"+e.name):e.map=e.name,e.name="$"+e.name}}get dataFields(){return this._dataFields}set dataFields(e){const t=this;return t._dataFields=t._getDataFieldObjects(e),t._dataFields}_getDataFieldObjects(e){const t=this;let a=[];if("number"==typeof e){const t="A".charCodeAt(0);let n="",r=0;for(let i=0;i<e;i++){const e=String.fromCharCode(t+r);r++;const i=n+e;a.push({name:i,dataType:"string"}),r>=26&&(r=0,n+="A")}}else if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){const e=r.split(":"),t=e[0].trim(),n=e.length>1?e[1].trim():"string";a.push({name:t,dataType:n})}else a.push(r);t._getDataField(a[a.length-1])}return a}get dataSource(){const e=this;return e._dataSource||(e._dataSource=[]),e._dataSource}set dataSource(e){const t=this;t._dataSource=e,t.isInitialized&&(t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],t.bindingCompleted=!1,t.dataBind(),t.refreshIndexes())}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){const e=this;return!1===e.observable?e.boundSource:e.boundSource.toArray()}dataBind(){const t=this;t.bindingCompleted=!1,t.clear();const a=()=>{t.observable&&(t.boundSource.notify||(t.boundSource=new Smart.ObservableArray),t.boundSource.notify((function(e){if("update"===e.action&&e.path&&e.path.indexOf(".")>=0&&-1===e.path.indexOf("children")&&-1===e.path.indexOf("loaded")&&-1===e.path.indexOf("level")&&-1===e.path.indexOf("leaf")&&-1===e.path.indexOf("expanded")){let a=!1;for(let n=0;n<t.dataFields.length;n++){const r=t.dataFields[n].name;e.path.indexOf(r)>=0&&(a=!0)}t._notify&&a&&t._notify({action:"update",data:e.target,index:e.index})}}))),t._onBindingComplete()};"string"==typeof t.dataSource&&(t.dataSource.indexOf(".json")>=0||"json"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="json",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xml")>=0?(t.url=t.dataSource,t.dataSourceType="xml",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xlsx")>=0?(t.url=t.dataSource,t.dataSourceType="xlsx",new e(t,(e=>{if(!e[0])return e=[],t._bindToArray(),void a();const n=Object.keys(e[0]),r={},i=[];if(!1!==t.exportHeader){let a=0;for(let e in n){r[n[e]]=t.dataFields[a++].name}for(let t=1;t<e.length;t++){const a=e[t],o={};for(let e in n){const t=n[e];o[r[t]]=a[t]}i.push(o)}t.dataSource=i}t._bindToArray(),a()}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".csv")>=0?(t.url=t.dataSource,t.dataSourceType="csv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".tsv")>=0?(t.url=t.dataSource,t.dataSourceType="tsv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf(".ics")>=0||t.dataSource.indexOf(".php")>=0&&"ics"===t.dataSourceType||t.dataSource.indexOf(".txt")>=0&&"ics"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="ics",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf("BEGIN:VCALENDAR")>=0||"ics"===t.dataSourceType)?(t._bindToICS(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf("<?xml")>=0||"xml"===t.dataSourceType)?(t._bindToXML(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf(" ")>=0||t.dataSource.indexOf(",")>=0||"tsv"===t.dataSourceType||"csv"===t.dataSourceType||"tab"===t.dataSourceType)?(t._bindToCSV(),a()):"array"===t.dataSourceType?(t._bindToArray(),a()):"json"===t.dataSourceType&&(t._bindToJSON(),a())}_bindToXML(){const e=this;let t=null,a=null;window.DOMParser&&(t=new DOMParser,a=t.parseFromString(e.dataSource,"text/xml")),void 0===e.root&&(e.root=""),void 0===e.record&&(e.record="");const n=a.querySelectorAll(e.root+" "+e.record),r=n.length,i=[];let o=e.dataFields?e.dataFields.length:0;if(0===o){const t=n[0],a=new Array;for(let e in t){const t=e;a[a.length]={name:t}}e.dataFields=a,o=a.length}for(let t=0;t<r;t++){const a=n[t],r={};if(void 0===a)break;if(e.id){const t=a.querySelector(e.id);r[e.id]=t.textContent}for(let t=0;t<o;t++){const n=e.dataFields[t],i=a.querySelector(n.map||n.name);r[n.name]=i.textContent}i[t]=r}e.canNotify=!1,e.dataSource=i,e.canNotify=!0,e._bindToArray()}_bindToCSV(){const e=this,t=""+e.dataSource,a=-1===t.indexOf(",")?"\t":",",n=t.split("\r"),r=new Array;let i=t.split("\n"),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=e.dataFields.length>0;for(let t=0;t<o;t++){const n=i[t],o={},l=i[t].split(a);for(let a=0;a<l.length;a++){let r=e.dataFields[a],i=l[a];if(r||(e.dataFields.push({name:i.trim()}),r=e.dataFields[e.dataFields.length-1]),r.map&&(i=n[r.map]),i=i.trim(),1!==t||d)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}o[r.map||r.name||a.toString()]=i}(d||t>0)&&r.push(o)}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_onBindingComplete(){const e=this;e._buildHierarchy(),e.onBindingComplete&&e.onBindingComplete({data:e.boundSource}),e._notify&&e._notify({action:"bindingComplete",data:e.boundSource}),e.bindingCompleted=!0}refreshHierarchy(){this.isUpdating||this._buildHierarchy()}find(){return this.boundSource.find.apply(this.boundSource,arguments)}onVirtualDataSourceRequested(e,t){const a=this;let n=t?t.first:1/0,r=t?t.last:1/0,i=t?t.row:null;if(void 0===n&&(n=1/0),void 0===r&&(r=1/0),a.virtualFirstIndex=n,a.virtualLastIndex=r,a.virtualDataSource){const o=function(r){void 0!==r.virtualDataSourceLength&&(a.virtualDataSourceLength=r.virtualDataSourceLength),new Smart.DataAdapter({dataSource:r.dataSource,dataFields:r.dataFields||a.dataFields,data:t,keyDataField:r.keyDataField,parentDataField:r.parentDataField,observable:!1,id:r.id||a.id,onBindingComplete(r){if(void 0===t.result&&(t.result=!0),a.virtualDataSourceOnExpand&&i)return a.groupBy.length>0?r.data&&r.data.length>0&&a.add(r.data):r.data&&r.data.length>0?a.add(r.data,i.$.id):i.leaf=!0,a.onFilter&&a.onFilter(),void e(t);n===1/0&&"scroll"===t.action?r.data&&r.data.length&&a.add(r.data):"filter"===t.action||"group"===t.action?(a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0):("add"===t.action||"update"===t.action||t.action,a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0),a.onFilter&&a.onFilter(),e(t)}})};let d={};if(t.sorting&&t.sorting.length>0){let e=[];for(let a in t.sorting)e.push(a+" "+t.sorting[a].sortOrder.toUpperCase());const a=" ORDER BY "+e.join(", ");d.orderBy=a}else d.orderBy="";if(void 0===n||void 0===r||0===n&&0===r)d.limit="";else{const e=r-n,t=" LIMIT "+e+" OFFSET "+n;d.limit=t,isNaN(e)&&(d.limit="")}if(t.grouping&&t.grouping.length>0){const e=" GROUP BY "+t.grouping[0];d.groupBy=e}else d.groupBy="";if(t.filtering&&t.filtering.length>0){const e=(e,t)=>{switch(t.condition){case"EMPTY":return e+" = ''";case"NOT_EMPTY":return e+" != ''";case"EQUAL":return e+" = '"+t.value+"'";case"NOT_EQUAL":return e+" != '"+t.value+"'";case"CONTAINS_CASE_SENSITIVE":case"CONTAINS":return e+" LIKE '%"+t.value+"%'";case"DOES_NOT_CONTAIN_CASE_SENSITIVE":case"DOES_NOT_CONTAIN":return e+" NOT LIKE '%"+t.value+"%'";case"STARTS_WITH_CASE_SENSITIVE":case"STARTS_WITH":return e+" LIKE '"+t.value+"%'";case"ENDS_WITH_CASE_SENSITIVE":case"ENDS_WITH":return e+" LIKE '%"+t.value+"'";case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL"}},a=(e,t)=>{switch(t.condition){case"EQUAL":return e+" = "+t.value;case"NOT_EQUAL":return e+" != "+t.value;case"GREATER_THAN":return e+" > "+t.value;case"GREATER_THAN_OR_EQUAL":return e+" >= "+t.value;case"LESS_THAN":return e+" < "+t.value;case"LESS_THAN_OR_EQUAL":return e+" <= "+t.value;case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL";case"RANGE":return"("+e+" >= "+t.value+" and "+e+" <= "+t.valueTo+")"}},n=(e,t,a)=>{if(a.operator){var n=e(t,a.condition1),r=e(t,a.condition2);return"("+n+" "+a.operator+" "+r+")"}return e(t,a)};let r=[];for(let i in t.filtering){const o=t.filtering[i];let d=o.filters,l=[],s=" AND ";for(let t=0;t<d.length;t++){const r=d[t];switch(r.type){case"stringFilter":l.push(n(e,i,r));break;case"numericFilter":case"dateFilter":case"booleanFilter":l.push(n(a,i,r))}1===o.logicalOperators[t]&&(s=" OR ")}r.push("("+l.join(s)+")")}if(r.length>0){let e=" AND ";t.filterOperator&&"or"===t.filterOperator.toLowerCase()&&(e=" OR "),d.where=" WHERE "+r.join(e)}else d.where=""}else d.where="";if("dataBind"===t.action&&a.virtualDataSourceOnExpand&&a.keyDataField&&a.parentDataField&&(d.where?d.where+=" AND "+a.parentDataField+" IS NULL":d.where=" WHERE "+a.parentDataField+" IS NULL"),"update"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+"='"+t.edit.row[n]+"'");d.update=" SET "+e.join(", ")+" WHERE "+a.id+"="+t.edit.row[a.id]}if("remove"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+" = '"+t.edit.row[n]+"'");d.remove=" WHERE "+a.id+"="+t.edit.row[a.id]}if("add"===t.action){const e=[],a=[];for(let n in t.edit.row)"$"!==n&&(a.push(n),e.push("'"+t.edit.row[n]+"'"));d.add=" ("+a.join(", ")+") VALUES ("+e.join(", ")+")"}"expand"===t.action?(a.groupDataField?d.where?d.where+=" AND "+a.groupDataField+" = '"+i[a.groupDataField]+"'":d.where=" WHERE "+a.groupDataField+" = '"+i[a.groupDataField]+"'":a.keyDataField&&a.parentDataField?d.where?d.where+=" AND "+a.parentDataField+" = "+i[a.keyDataField]:d.where=" WHERE "+a.parentDataField+" = "+i[a.keyDataField]:d.where?d.where+=" AND "+i.groupDataField+" = '"+i.label+"'":d.where=" WHERE "+i.groupDataField+" = '"+i.label+"'",d.limit="",d.groupBy="",a.virtualDataSourceOnExpand(o,{first:n,last:r,row:t.row,sorting:t.sorting,filtering:t.filtering,grouping:t.grouping,action:t.action,query:d})):a.virtualDataSource(o,{first:n,last:r,sorting:t.sorting,filtering:t.filtering,filterOperator:t.filterOperator||"and",grouping:t.grouping,action:t.action,query:d})}else e()}add(e,t){const a=this;if(!e)return;let n=!0;const r=function(e){const r=a._getDataItem(e,a.boundSource.length);if(a.dataItemById[r.$.id])return void 0!==t&&(r.$.parentId=t),null;a[a.boundSource.length]=r,a.dataItemById[r.$.id]=r;const i=a.boundSource.push(r);return void 0!==t&&(r.$.parentId=t),i||(n=!1),r};if(e.length){let t=[];for(let a=0;a<e.length;a++){const n=r(e[a]);n&&t.push(n)}a._notify({action:"add",data:t})}else{const t=r(e);a._notify({action:"add",data:t})}return a.refreshHierarchy(),n}refreshIndexes(){const e=this;for(let t=0;t<e.boundSource.length;t++)e[t]=e.boundSource[t],e[t].$.index=t,e.dataItemById[e[t].$.id]=e[t];let t=e.boundSource.length;for(;e[t];)delete e[t],t++}removeLast(){const e=this;delete e[e.boundSource.length-1];const t=e.boundSource.pop();return delete e.dataItemById[t.$.id],e._notify({action:"removeLast",data:t}),e.refreshHierarchy(),t}remove(e){const t=this;let a=t.indexOf(e);-1===a&&e&&e.$&&(a=t.indexOf(t.dataItemById[e.$.id])),t.removeAt(a)}removeAt(e){const t=this,a=t.boundSource[e];if(!a)throw new Error("Invalid Item Index");t.boundSource.splice(e,1),delete t.dataItemById[a.$.id],t.refreshIndexes(),t._notify({action:"remove",index:e,data:a}),t.refreshHierarchy()}update(e,t){const a=this;if(Smart.Utilities.Types.isArray(e)&&Smart.Utilities.Types.isArray(t)&&0===e.length&&0===t.length)return void a.refreshHierarchy();if(t.length&&e.length){let n=[];for(let r=0;r<e.length;r++){const i=a._getDataItem(t[r],e[r]),o=e[r];n.push(i),a.boundSource[o]=i,a[o]=a.boundSource[o],a.dataItemById[i.$.id]=a[o]}return a._notify({action:"update",index:e,data:n}),void a.refreshHierarchy()}const n=a._getDataItem(t,e),r=a.boundSource[e].$.id;return n.$.id=r,a.boundSource[e]=n,a[e]=a.boundSource[e],a.dataItemById[n.$.id]=a[e],a._notify({action:"update",index:e,data:n}),a.refreshHierarchy(),n}insert(e,t){const a=this;if(t.length){const n=[];for(let r=0;r<t.length;r++){const i=a._getDataItem(t[r],e+r);n.push(i)}t=n}else t=a._getDataItem(t,e);const n=a.boundSource.splice(e,0,t);return a.refreshIndexes(),a._notify({action:"insert",index:e,data:t}),a.refreshHierarchy(),n}move(e,t){if(t>e&&t-e==1||e===t)return;const a=this,n=a.boundSource.splice(e,1)[0];t>e?(t--,a.boundSource.splice(t,0,n)):a.boundSource.splice(t,0,n),a.refreshIndexes(),a._notify({action:"move",index:t,data:a.boundSource[t]}),a.refreshHierarchy()}indexOf(e){return this.boundSource.indexOf(e)}get length(){const e=this;return void 0!==e.virtualDataSourceLength?e.virtualDataSourceLength:e.dataSourceLength?e.dataSourceLength:"number"==typeof e.dataSource?e.dataSource:e.bindingCompleted?e.boundSource.length:e.dataSource&&"string"!=typeof e.dataSource&&e.dataSource.length?e.dataSource.length:e.boundSource.length}clear(){const e=this;if(!e.isInitialized)return e._cachedValues=[],void(e.dataItemById=[]);for(let t=0;t<e.boundSource.length;t++)delete e[t];e._expandedRowIds=[],e._cachedValues=[],e.boundSource=e.observable?new Smart.ObservableArray:[],e.dataItemById=[],e.refreshHierarchy()}_getId(e,t,a){if(null===e||void 0===e.name||!e.name||!t.getAttribute){if(e&&e.toString().length>0&&t.getAttribute){let a=t.getAttribute(e);if(null!==a&&a.toString().length>0)return a.trim().split(" ").join("").replace(/([ #;?%&,.+*~\':'!^$[\]()=>|\/@])/g,"");{let a=e.split(this.mapChar);if(a.length>1){let e=t;for(let t=0;t<a.length;t++)void 0!==e&&(e=e[a[t]]);if(void 0!==e)return e}else if(void 0!==t[e])return t[e]}}return a}{let n=t.getAttribute(e.name);if(null!==n&&n.toString().length>0)return n;if(e.map)try{let a=t.getAttribute(e.map);if(null!==a&&a.toString().length>0)return a}catch(e){return a}}}_buildHierarchy(){const e=this;if(e.reservedNames){const t=e.reservedNames;t.leaf||(t.leaf="leaf"),t.parent||(t.parent="parent"),t.expanded||(t.expanded="expanded"),t.checked||(t.checked="checked"),t.selected||(t.selected="selected"),t.level||(t.level="level"),t.data||(t.data="data")}else e.reservedNames={leaf:"leaf",parent:"parent",expanded:"expanded",checked:"checked",selected:"selected",level:"level",icon:"icon",data:"data"};const t=e.reservedNames;if(e.childrenDataField){const a=[];for(let n=0;n<e.boundSource.length;n++){const r=Object.assign({},e.boundSource[n]);if(!r)continue;a.push(r);const i=function(a){const n=e.childrenDataField.split(e.mapChar);let r=null;if(n.length>1){let e=a;for(let t=0;t<n.length;t++)void 0!==e&&(e=e[n[t]]);r=e}else r=a.children;a.children=r,(null===a.children||void 0===a.children||a.children&&0===a.children.length)&&(a[t.leaf]=!0)};i(r),r[t.level]=0,r.$||(r.$={}),r[t.parent]=null,r[t.data]=r,void 0===r[t.expanded]&&(r[t.expanded]=!1,e.expandHierarchy&&(r[t.expanded]=!0));const o=function(a,n){if(n)for(let r=0;r<n.length;r++){let d=e._getDataItem(n[r],r);if(d){if(i(d),!e.id){const e=function(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()};d.$.id=e()}d[t.level]=a[t.level]+1,d[t.parent]=a,d[t.data]=Object.assign({},d),a&&(a.children[r]=d),void 0===d[t.expanded]&&(d[t.expanded]=!1,e.expandHierarchy&&(d[t.expanded]=!0)),o(d,d.children)}}else a.children=new Array};o(r,r.children)}if(e.boundHierarchy=a,!e._boundSourceUpdate){for(let t=0;t<e.boundHierarchy.length;t++){const a=e.boundHierarchy[t];if(a.children){const t=function(a){if(e.dataItemById[a.$.id]||(e.boundSource.canNotify=!1,e.dataItemById[a.$.id]=a,e.boundSource.canNotify=!0),a.children)for(let e=0;e<a.children.length;e++){const n=a.children[e];n.children&&t(n)}};t(a)}}e._boundSourceUpdate=!0}}if(e.xmlRoot&&"xml"===e.dataSourceType&&(e.boundHierarchy=this._getHierarchy("uid","_parentuid","children",null,e.boundSource)),e.keyDataField&&e.parentDataField)return["keyDataField","parentDataField"].forEach((t=>{switch(e[t]){case"parent":e[t]="$"+e[t]}})),void(e.boundHierarchy=this._getHierarchy(e.keyDataField,e.parentDataField,"children",null,e.boundSource));e.groupBy&&e.groupBy.length>0?e.boundHierarchy=this._getGroupHierarchy(e.groupBy,"children","label",null,"data",null,"parent",e.boundSource):e.virtualDataSourceOnExpand&&(e.boundHierarchy=this._getHierarchy("id","parentId","children",null,e.boundSource))}_getGroupHierarchy(e,t,a,n,r,i,o,d,l){let s=this;l||(l=0);let c=s.reservedNames;const u=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};let f=new Array;for(let t=0;t<e.length;t++)f[t]=u();t||(t="children"),a||(a="group"),r||(r="item"),o||(o="parent"),void 0===i&&(i="value");const h=new Array,p=new Array;let g=0;const S=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};let y=!1;for(let n=0;n<d.length;n++){let m=Object.assign({},S(d[n]));m[c.leaf]=!1;let T=new Array,b=0;for(let t=0;t<e.length;t++){const a=e[t],n=m[a];null!=n?((""===n||void 0===n&&0===t)&&(y=!0),T[b++]={value:n,group:a,hash:f[t]}):(T[b++]={value:null,group:a,hash:f[t]},0===t&&(y=!0))}if(T.length!==e.length)break;let v=null,E="";for(let e=0;e<T.length;e++){const n=T[e].value,d=T[e].group;if(E=E+"_"+T[e].hash+"_"+n,void 0===p[E]||null===p[E]){if(null===v){v={$:{}},v[c.level]=0,v[c.leaf]=!1,v[o]=null,v[a]=n,v[r]=m,v.groupDataField=d,v[d]||(v[d]=v.data[d]),void 0!==m[c.expanded]?v[c.expanded]=m[c.expanded]:(v[c.expanded]=!1,s.expandHierarchy&&(v[c.expanded]=!0)),i&&(v[i]=m[i]),v[t]=new Array;let e=h.length+l;this.id&&"number"!=typeof m.$.id&&!isFinite(m.$.id)||(e="Item"+e),void 0===v.$.id&&(v.$.id=e),s._expandedRowIds[v.$.id]&&(v[c.expanded]=!0),h[g++]=v}else{const e={$:{}};e[c.level]=v[c.level]+1,e[o]=v,e[a]=n,e[t]=new Array,e[r]=m,e.groupDataField=d,e[c.leaf]=!1,e[d]||(e[d]=e.data[d]),void 0!==m[c.expanded]?e[c.expanded]=m[c.expanded]:(e[c.expanded]=!1,s.expandHierarchy&&(e[c.expanded]=!0)),i&&(e[i]=m[i]),void 0===e.$.id&&(e.$.id=v.$.id+"_"+v[t].length),s._expandedRowIds[e.$.id]&&(e[c.expanded]=!0),v[t][v[t].length]=e,v=e}p[E]=v}else v=p[E]}m&&(m[c.leaf]=!0),null!==v?(null===this.id?void 0===m.$.id&&(m.$.id=v.$.id+"_"+v[t].length):void 0===m.$.id&&-1===m.$.id.toString().indexOf(v.$.id)&&(m.$.id=v.$.id+"_"+m.$.id),m[o]=v,m[c.level]=v[c.level]+1,v[t][v[t].length]=m):void 0===m.$.id&&(m.$.id=u())}if(y){let e=null,t=!1;for(let a=0;a<h.length;a++){const n=h[a];if(!n[n.groupDataField]){e=n,e.$.id.toString().startsWith("Item")&&(t=!0),h.splice(a,1);break}}if(e&&(h.push(e),t))for(let e=0;e<h.length;e++){h[e].$.id="Item"+e}}return h}_getHierarchy(e,t,a,n,r){const i=this,o=new Array;let d=this.boundSource;if(r&&(d=r),0===this.boundSource.length)return null;const l=null!==a?a:"children";let s=new Array,c=d,u=c.length,f=i.reservedNames;const h=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};for(let a=0;a<u;a++){let n=c[a],r=n[t],o=n[e];"parentId"===t&&(r=n.$.parentId),"id"===e&&(o=n.$.id),n[l]=new Array,i.expandHierarchy&&void 0===n[f.expanded]&&(n[f.expanded]=i.expandHierarchy),s[o]={parentId:r,item:n}}for(let a=0;a<u;a++){const n=c[a];let r=n[t],i=n[e];if("parentId"===t&&(r=n.$.parentId),"id"===e&&(i=n.$.id),void 0!==s[r]){let e={parentId:r,item:s[i].item},t=s[r].item;t[l]||(t[l]=new Array);let a=t[l].length;e=e.item,f?e[f.parent]=t:e.parent=t;const n=h(e);t[l][a]=n,s[r].item=t,s[i].item=e}else{let e=s[i].item;f?void 0===e[f.parent]&&(e[f.parent]=null):void 0===e.parent&&(e.parent=null);const t=h(e);f?t[f.level]=0:t.level=0,o[o.length]=t}}if(0!==o.length){let e=function(t,a){for(let n=0;n<a.length;n++){const r=a[n];f?r[f.level]=t:r.level=t;const o=r[l];o&&o.length>0?(r.leaf=!1,e(t+1,o)):i.virtualDataSourceOnExpand?void 0===r.leaf&&(r.leaf=!1):f?r[f.leaf]=!0:r.leaf=!0}};e(0,o)}return o}summarize(e,t){const a=this;Array.isArray(e)||(e=[e]);let n=[];for(let t=0;t<e.length;t++){const a=e[t];for(let e in a){const t=a[e];n.push({dataField:e,functions:t})}}e=n;let r={},i=new Array;t||(t=a.boundSource);let o=t.length,d=0;if(0!==o&&void 0!==o){for(let a=0;a<o;a++){let n=t[a];if((!n||!n.$||!1!==n.$.filtered)&&n){d++;for(let t=0;t<e.length;t++){const o=e[t];let d=n[o.dataField];if(o.functions&&o.functions.length>0){r[o.dataField]=r[o.dataField]||{},i[o.dataField]=i[o.dataField]||0,i[o.dataField]++;const e=function(e){for(let t in e){let a=r[o.dataField][t];null==a&&(r[o.dataField][t]=0,a=0),"function"==typeof e[t]&&(a=e[t](a,d,o.dataField,n)),r[o.dataField][t]=a}};let t=parseFloat(d);t=!isNaN(t),"string"==typeof d&&d.startsWith("+")&&(t=!1),t&&(d=parseFloat(d)),"number"==typeof d&&isFinite(d)?o.functions.forEach((function(t){let n=r[o.dataField][t];if(null==n&&(n=0,"min"===t&&(n=9999999999999),"max"===t&&(n=-9999999999999),"median"===t&&(n=[])),"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t)n+=parseFloat(d);else if("product"===t)0===a?n=parseFloat(d):n*=parseFloat(d);else if("min"===t)n=Math.min(n,parseFloat(d));else if("max"===t)n=Math.max(n,parseFloat(d));else if("count"===t)n++;else if("median"===t)n.push(parseFloat(d));else if("object"==typeof t)return void e(t);r[o.dataField][t]=n})):o.functions.forEach((function(t){if("min"===t||"max"===t||"count"===t||"product"===t||"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t){if(null===d)return!0;let e=r[o.dataField][t];return null==e&&(e=0),r[o.dataField][t]=e,!0}if("blank"===t){let e=r[o.dataField][t];null==e&&(e=0),d||e++,r[o.dataField][t]=e}else if("filled"===t){let e=r[o.dataField][t];null==e&&(e=0),d&&e++,r[o.dataField][t]=e}else if("unique"===t){let e=r[o.dataField][t];null==e&&(e=[]),-1===e.indexOf(d)&&e.push(d),r[o.dataField][t]=e}"object"==typeof t&&e(t)}))}}}}for(let a=0;a<e.length;a++){const n=e[a];if(n.functions&&(!n.functions||0!==n.functions.length)){if(r[n.dataField]||(r[n.dataField]={},n.functions.forEach((function(e){r[n.dataField][e]=0}))),void 0!==r[n.dataField].avg){const e=r[n.dataField].avg,t=i[n.dataField];r[n.dataField].avg=0===t||void 0===t?0:e/t}else void 0!==r[n.dataField].count&&(r[n.dataField].count=d);if(void 0!==r[n.dataField].unique){const e=r[n.dataField].unique;r[n.dataField].unique=e.length}if(void 0!==r[n.dataField].median){let e=r[n.dataField].median;e.sort((function(e,t){return e-t})),r[n.dataField].median=.5*(e[Math.floor((e.length+1)/2)-1]+e[Math.ceil((e.length+1)/2)-1])}(r[n.dataField].stdev||r[n.dataField].stdevp||r[n.dataField].var||r[n.dataField].varp)&&n.functions.forEach((function(e){if("stdev"===e||"var"===e||"varp"===e||"stdevp"===e){const a=r[n.dataField][e],i=o,d=a/o;let l=0;for(let e=0;e<o;e++){let a=t[e][n.dataField];l+=(a-d)*(a-d)}let s="stdevp"===e||"varp"===e?i:i-1;0===s&&(s=1),"var"===e||"varp"===e?r[n.dataField][e]=l/s:"stdevp"!==e&&"stdev"!==e||(r[n.dataField][e]=Math.sqrt(l/s))}}))}}return r}}_getDataItem(e,t){const a=this,n={},r="number"==typeof a.dataSource||a.dataSourceLength;if(!e)return{$:{id:t,isEmpty:!0,index:t}};if("string"==typeof e&&(e={"":e}),r){for(let e=0;e<a.dataFields.length;e++){n[(a.dataFields?a.dataFields[e]:{}).name]=""}return n.$={},n.$.id=t,n.$.index=t,n}const i=e;if(void 0!==i.expanded&&(n.expanded=i.expanded,"true"===i.expanded||!0===i.expanded||1===i.expanded?n.expanded=!0:n.expanded=!1),a.childrenDataField?void 0!==i[a.childrenDataField]&&(n.children=i[a.childrenDataField]):void 0!==i.children?n.children=i.children:void 0!==i.items&&(n.children=i.items),void 0!==i.leaf&&(n.leaf=i.leaf),void 0!==i.level&&(n.level=i.level),a.keyDataField&&void 0!==i[a.keyDataField]&&(n[a.keyDataField]=i[a.keyDataField]),a.parentDataField&&void 0!==i[a.parentDataField]&&(n[a.parentDataField]=i[a.parentDataField]),0===a.dataFields.length){const t=Object.getOwnPropertyNames(e);for(let e=0;e<t.length;e++)"$"!==t[e]&&a.dataFields.push({name:t[e],dataType:"string"})}for(let t=0;t<a.dataFields.length;t++){const r=a.dataFields?a.dataFields[t]:{};let o="";if(null==r)continue;if(e.length&&(o=e[t]),r.map){let e=r.map.split(a.mapChar);if(e.length>0){let t=i;for(let a=0;a<e.length;a++)i&&(t=t[e[a]]);o=t}else o=i[r.map]}null!=o?o=o.toString():void 0===o&&null!==o&&(o="");let d=!1;""===o&&(d=!0,o=e[r.name],void 0===r.dataType&&(r.dataType="any"),null!=o?"array"!==r.dataType&&("any"===r.dataType?o=Array.isArray(e[r.name])?[...e[r.name]]:"object"==typeof e[r.name]?Object.assign({},e[r.name]):e[r.name]:"date"!==r.dataType&&(o=o.toString())):o=void 0===o&&"any"===r.dataType?null:""),"[object Object]"===o&&r.map&&d&&(o=""),a._cachedValues[o+"_"+r.dataType]?o=a._cachedValues[o+"_"+r.dataType]:("bool"===r.dataType||"boolean"===r.dataType?"true"===o||"1"===o?o=!0:"false"!==o&&"0"!==o||(o=!1):"number"===r.dataType?(-1===o.indexOf(".")&&o.indexOf(",")>=0&&o.substring(1+o.indexOf(",")).length<3&&(o=o.replace(",",".")),o=a.$document.deserialize(""+o,r.dataType,!0)):"any"!==r.dataType&&(o=a.$document.deserialize(""+o,r.dataType,!0)),"any"!==r.dataType&&(a._cachedValues[o+"_"+r.dataType]=o)),"string"!==r.dataType&&"boolean"!==r.dataType&&"bool"!==r.dataType&&"any"!==r.dataType&&(isNaN(o)||o===-1/0||o===1/0)&&(o=0),"parent"!==r.name&&"group"!==r.name&&"leaf"!==r.name&&"level"!==r.name?("string"===r.dataType&&/<.+?>/.test(o)&&o.replace&&("all"===a.sanitizeHTML?o=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===a.sanitizeHTML&&(o=window.Smart.Utilities.Core.sanitizeHTML(o))),n[r.name]=o):n.$[r.name]=o}let o=t;if(a.id)o=i[a.id],"object"==typeof o&&(o=t),i.$&&void 0!==i.$.id&&(o=i.$.id);else if(!a.virtualDataSource&&a.dataItemById&&a.dataItemById[o])for(o=a.length;a.dataItemById[o];)o++;return n.$||(n.$={}),n.$.id=o,n.$.index=t,new Object(n)}_bindToArray(){const e=this,t="number"==typeof e.dataSource||e.dataSourceLength,a=[];e.boundSource.canNotify=!1;const n=t?"number"==typeof e.dataSource?e.dataSource:e.dataSource.length:e.observable?e.length:e.dataSource.length;for(let r=0;r<n;r++){const n=t?{}:e.dataSource[r],i=e._getDataItem(n,r);a.push(i)}if(t&&e.dataSourceLength&&e.dataSource.length>0)for(let t=0;t<e.dataSource.length;t++){const n=e.dataSource[t].cell,r=e.dataSource[t].value,i=n.replace(/[^0-9]/g,""),o=n.replace(/[0-9]/g,"");a[i-1][o]=r}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(a),e.observable&&(e.boundSource=new Smart.ObservableArray(a));for(let t=0;t<n;t++)e.observable?e[t]=e.boundSource[t]:e[t]=a[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=a),e.boundSource.canNotify=!0}_bindToICS(){const e=this,t=""+e.dataSource,a=e.rowDelimiter||"\n",n=t.split("\r"),r=[];let i=t.split(a),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=function(e,t){var a=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z)?$/.exec(e);if(!a)throw new Error("Invalid UNTIL value: "+e);return t?new Date(a[1],a[2]-1,a[3],0,0,0,0):new Date(Date.UTC(a[1],a[2]-1,a[3],a[5]||0,a[6]||0,a[7]||0))};for(let e=0;e<o;e++){const t=i[e].trim();if(t.indexOf("BEGIN:VEVENT")>=0)var l={};else if(l)if(t.indexOf("BEGIN:VALARM")>=0)var s={};else{if(s){if(t.indexOf("ACTION")>=0){s.ACTION=t.substring(t.indexOf("ACTION")+7);continue}if(t.indexOf("DESCRIPTION")>=0){s.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);continue}if(t.indexOf("TRIGGER")>=0){s.TRIGGER=t.substring(t.indexOf("TRIGGER")+8);continue}if(t.indexOf("END:VALARM")>=0){l.ALARM||(l.ALARM=[]),l.ALARM.push(s),s=void 0;continue}}if(t.indexOf("SUMMARY")>=0)l.SUMMARY=t.substring(t.indexOf("SUMMARY")+8);else if(t.indexOf("LOCATION")>=0)l.LOCATION=t.substring(t.indexOf("LOCATION")+9);else if(t.indexOf("DESCRIPTION")>=0)l.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);else if(t.indexOf("RRULE")>=0)l.RRULE=t.substring(t.indexOf("RRULE")+6);else if(t.indexOf("RECURRENCE-ID")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID")+14);else if(t.indexOf("RECURRENCE-ID;VALUE=DATE")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID;VALUE=DATE")+25);else if(t.indexOf("EXDATE;VALUE=DATE")>=0){const e=t.substring(t.indexOf("EXDATE;VALUE=DATE")+20);l.EXDATE=e}else if(t.indexOf("EXDATE")>=0){const e=t.substring(t.indexOf("EXDATE")+7);l.EXDATE=e}else t.indexOf("DTEND;VALUE=DATE")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND;VALUE=DATE")+17),!0):t.indexOf("DTEND")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND")+6)):t.indexOf("DTSTART;VALUE=DATE")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART;VALUE=DATE")+19),!0):t.indexOf("DTSTART")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART")+8)):t.indexOf("UID")>=0?l.uid=l.UID=t.substring(t.indexOf("UID")+4):t.indexOf("STATUS")>=0?l.STATUS=t.substring(t.indexOf("STATUS")+7):t.indexOf("TITLE")>=0?l.TITLE=t.substring(t.indexOf("TITLE")+6):t.indexOf("CATEGORIES")>=0?l.CATEGORIES=t.substring(t.indexOf("CATEGORIES")+11):t.indexOf("END:VEVENT")>=0&&(r.push(l),l.ALARM&&(l.ALARM=JSON.stringify(l.ALARM)),s=void 0)}}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_bindToJSON(){const e=this,t=[],a=e.dataSource.length?e.dataSource:Object.entries(e.dataSource);e.boundSource.canNotify=!1;for(let n=0;n<a.length;n++){const r=a[n],i=e._getDataItem(r,n);t.push(i)}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(t);for(let t=0;t<e.length;t++)e[t]=e.boundSource[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=t),e.boundSource.canNotify=!0}sortBy(e,t,a){const n=this;if(!t)for(let a=0;a<n.dataFields.length;a++){const r=n.dataFields[a];if(r.name===e){t=r.dataType;break}}if(n.boundHierarchy){if((!e||0===e.length)&&n.groupBy.length>0)return void n.refreshHierarchy();const r=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(n.boundHierarchy);if(r){r.find((e=>{if(e.summaryRow)return e}))&&n.refreshHierarchy()}const i=function(r){n._sort(r,e,a,t);for(let n=0;n<r.length;n++){const o=r[n];o.children&&i(o.children,e,a,t)}};i(n.boundHierarchy)}else n._sort(n.boundSource,e,a,t)}_createFilter(e,t){const a={"=":"EQUAL","<>":"NOT_EQUAL","!=":"NOT_EQUAL",not_like:"DOES_NOT_CONTAIN",like:"CONTAINS","<":"LESS_THAN",">":"GREATER_THAN","<=":"LESS_THAN_OR_EQUAL",">=":"GREATER_THAN_OR_EQUAL",equal:"EQUAL","not equal":"NOT_EQUAL","less than":"LESS_THAN","greater than":"GREATER_THAN","greater than or equal":"GREATER_THAN_OR_EQUAL","less than or equal":"LESS_THAN_OR_EQUAL","starts with":"STARTS_WITH","ends with":"ENDS_WITH",notEqual:"NOT_EQUAL",not_equal:"NOT_EQUAL",lessThan:"LESS_THAN",greaterThan:"GREATER_THAN",greaterThanOrEqual:"GREATER_THAN_OR_EQUAL",lessThanOrEqual:"LESS_THAN_OR_EQUAL",less_than:"LESS_THAN",greater_than:"GREATER_THAN",greater_than_or_equal:"GREATER_THAN_OR_EQUAL",less_than_or_equal:"LESS_THAN_OR_EQUAL",null:"null","":"EMPTY",isblank:"EMPTY",isnotblank:"NOT_EMPTY",isBlank:"EMPTY",isNotBlank:"NOT_EMPTY",contains:"CONTAINS",does_not_contain:"DOES_NOT_CONTAIN","not contains":"DOES_NOT_CONTAIN",notcontains:"DOES_NOT_CONTAIN",notContains:"DOES_NOT_CONTAIN",startswith:"STARTS_WITH",endswith:"ENDS_WITH",starts_with:"STARTS_WITH",ends_with:"ENDS_WITH",startsWith:"STARTS_WITH",endsWith:"ENDS_WITH",NULL:"NULL",NOT_NULL:"NOT_NULL"};let n=[];for(let e=0;e<t.length;e++){const a=t[e],r=-1===a.indexOf('"')?a.split(" "):a.split('"');let i=[];for(let e=0;e<r.length;e++){const t=r[e];""!==t&&i.push(t.trim())}n.push(i)}const r=new Smart.FilterGroup,i=[],o=[];for(let t=0;t<n.length;t++){const r=n[t];if(r.length>1){const t=new Smart.FilterGroup;let n="and",i=0;for(let o=0;o<r.length;o++){const d=r[o];if("and"!==d&&"or"!==d){if(i++,2===i){const l=t.createFilter(e,d,a[r[o-1]]);i=0,n&&t.addFilter(n,l)}}else n=d}o.push(t)}else{const e=r[0];if("and"!==e&&"or"!==e)throw new Error('Filter Exprresion expects "AND" or "OR", but the token is: '+e);i.push(e)}}let d=0;if(1===o.length)return o[0];for(let e=0;e<o.length;e++){let t=i[d];(e+1)%2==0&&d++,t||(t="and"),r.addFilter(t,o[e])}return r}filterBy(e,...t){const a=this,n=(()=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}})(),r=a._createFilter(n,t);return a.boundSource.filter((t=>r.evaluate(t[e])))}_filter(e,t="and"){const a=this,n=[],r=[];if(0===e.length)return void a.clearFilter();const i=e=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}};let o,d;"and"===t?(o=!0,d=function(e,t,a){return e&&t.evaluate(a[t.dataField])}):(o=!1,d=function(e,t,a){return e||t.evaluate(a[t.dataField])});for(let t=0;t<e.length;t++){const o=e[t],d=o[0];let l=null;l=o[1]instanceof Smart.FilterGroup?o[1]:a._createFilter(i(d),o.splice(1)),l&&(r.push(d),l.dataField=d,n.push(l))}if(a.boundHierarchy){const e=function(e){let t=o;for(let a=0;a<n.length;a++){const r=n[a];t=d(t,r,e)}return e.$.filtered=t,t},t=function(n,r,i){let o=0;for(let a=0;a<n.length;a++){const i=n[a];e(i),i.$.filtered&&o++,i.children&&t(i.children,i,r)}o>0&&a.groupBy.length>0&&r?(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0)):o>0&&o!==n.length&&r?(r.$.filtered=null,i&&!i.$.filtered&&(i.$.filtered=null)):o>0&&o===n.length&&r&&(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0))};t(a.boundHierarchy,null,null)}else for(let e=0;e<a.boundSource.length;e++){const t=a.boundSource[e];let r=o;for(let e=0;e<n.length;e++){const a=n[e];r=d(r,a,t)}t.$.filtered=r}a.onFilter&&a.onFilter()}clearGroup(){const e=this;e.groupBy=[],e.boundHierarchy=null,e.refreshHierarchy(),e.onGroup&&e.onGroup()}clearFilter(){const e=this;for(let t=0;t<e.boundSource.length;t++){e.boundSource[t].$.filtered=!0}if(e.boundHierarchy){const t=function(e,a,n){for(let n=0;n<e.length;n++){const r=e[n];r.$.filtered=!0,r.$.filtered,r.children&&t(r.children,r,a)}a&&(a.$.filtered=!0,n&&!n.$.filtered&&(n.$.filtered=!0))};t(e.boundHierarchy,null,null)}e.onFilter&&e.onFilter()}clearSort(){this._sort(this.boundSource,[],[],[])}_sort(e,t,a,n,r,i){const o=this;let d=!1;if(0===e.length)return;if(e&&e.constructor&&e instanceof Smart.ObservableArray&&(d=!0),(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)&&!d&&!o.boundHierarchy)throw new Error("sort: Missing or Invalid arguments!");"string"==typeof t&&(t=[t]);const l=[],s=[];void 0===a&&(a=[]);const c=function(e,t){let a;switch(t||typeof e){case"string":a=(new Intl.Collator).compare;break;case"number":case"int":case"bigInt":case"float":case"double":a=function(e,t){return e-t};break;case"boolean":case"bool":a=function(e,t){return e===t?0:!1===e?-1:1};break;case"date":case"time":case"dateTime":a=e instanceof Date?function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0}:e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber?function(e,t){return e.compare(t)}:function(e,t){return e-t};break;case"object":if(e instanceof Date)a=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)a=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;a=function(t,a){return e.compareComplexNumbers(t,a)}}}return a};for(let r=0;r<t.length;r++){void 0===a[r]||"asc"===a[r]||"ascending"===a[r]?l[r]=1:l[r]=-1;let o=e[0][t[r]];if(void 0===o&&e[0]&&e[0].children&&e[0].data&&(o=e[0].data[t[r]]),i&&i){const e=t[r];if(i[e]){s[r]=i[e];continue}}s[r]=c(o,n[r])}t.length>0&&r?r(e,t,a,s):e.sort((function(e,a){for(let n=0;n<t.length;n++){const r=s[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e.$.index?(e.$.index-a.$.index)*l[n]:0}return r*l[n]}if(0===t.length)return e.$.index<a.$.index?-1:e.$.index>a.$.index?1:0}));for(let t=0;t<e.length;t++)o[t]=e[t]}static Filter(e,t,a,n,r="and"){let i,o;"and"===r?(i=!0,o=function(e,t,a,r){return n?e&&n(t,a,r):e&&r.evaluate(t[a])}):(i=!1,o=function(e,t,a,r){return n?e||n(t,a,r):e||r.evaluate(t[a])});return e.filter((e=>{let n=i;for(let r=0;r<a.length;r++){const i=a[r],d=t[r];n=o(n,e,d,i)}return n}))}filter(e,t,a){Smart.DataAdapter.Filter(this.boundSource,e,t,a)}sort(e,t,a){Smart.DataAdapter.Sort(this.boundSource,e,t,a)}static Sort(e,t,a,n){const r=function(e){let t;switch(typeof e){case"string":if(e.indexOf("-")>=0||e.indexOf("/")>=0){const t=new Date(e);if(t&&"Invalid Date"!==t.toString()){return function(e,t){const a=new Date(e),n=new Date(t);return a||n?a?n?a.getTime()-n.getTime():1:-1:0}}}t=(new Intl.Collator).compare;break;case"number":t=function(e,t){return e-t};break;case"boolean":t=function(e,t){return e===t?0:!1===e?-1:1};break;case"object":if(e instanceof Date)t=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof BigNumberNG)t=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;t=function(t,a){return e.compareComplexNumbers(t,a)}}}return t};if(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)return;"string"==typeof t&&(t=[t]);const i=[],o=[];void 0===a&&(a=[]);for(let n=0;n<t.length;n++)void 0===a[n]||"asc"===a[n]||"ascending"===a[n]?i[n]=1:i[n]=-1,o[n]=r(e[0][t[n]]);if(n)return void n(e,t,a,o);const d=e.slice(0);return d.sort((function(e,a){for(let n=0;n<t.length;n++){const r=o[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e._index?(e._index-a._index)*i[n]:0}return r*i[n]}})),d}};class e{constructor(e,t){const a=this;a.config=e,a.callback=t,!1!==e.autoFetch&&a.call(e)}call(e){const t=this;e||(e=t.config);let a="GET",n=e.url,r=null,i=!0;if(e.type&&(a=e.type),e.data)if("GET"===a){n+="?";for(let t in e.data)Object.prototype.hasOwnProperty.call(e.data,t)&&(n+=encodeURI(t+"="+e.data[t]+"&"));"&"===n.charAt(n.length-1)&&(n=n.slice(0,n.length-1))}else"POST"===a&&(r=JSON.stringify(e.data));e&&!1===e.async&&"xlsx"!==e.dataSourceType&&(i=!1),void 0!==window.fetch&&i?t.ajaxFetch(e,a,n,r):t.ajaxXMLHttpRequest(e,a,n,r,i)}ajaxFetch(e,t,a,n){const r=this,i={method:t};let o,d,l,s;switch(e.dataSourceType){case"json":o="json";break;case"xlsx":o="arrayBuffer";break;default:o="text"}if(e&&e.contentType&&(i.headers=new Headers({"Content-Type":e.contentType})),null!==n&&(i.body=n),e.timeout&&(l=setTimeout((function(){s=!0}),e.timeout)),e.beforeSend){if(!1===e.beforeSend(i,e))return}fetch(a,i).then((function(e){if(s)throw d=408,new Error("timeout");if(l&&clearTimeout(l),d=e.status,!e.ok)throw new Error(e.statusText);return e[o]()})).then((function(t){if("arrayBuffer"===o)return JSZip.loadAsync(t).then((function(t){return t.files["xl/worksheets/sheet1.xml"].async("text").then((function(a){return t.files["xl/sharedStrings.xml"].async("text").then((function(t){const n=r.parseXLSXData(a,t);r.ajaxComplete(e,n,d)}))}))}));r.ajaxComplete(e,t,d)})).catch((function(t){"JSZip is not defined"===t.message&&(t.message="JSZip is not defined. Please include a reference to JSZip to be able to load data from XLSX files."),e&&e.loadError&&e.loadError(d,t),r.callback&&r.callback(t,d)}))}ajaxXMLHttpRequest(e,t,a,n,r){const i=new XMLHttpRequest,o=this;if(i.open(t,a,r),i.ontimeout=function(){e&&e.loadError&&e.loadError(408,"timeout")},i.onload=function(){if(4===i.readyState){const t=i.status;let a=i.response;t>=200&&t<=299?("json"===e.dataSourceType&&(a=JSON.parse(a)),o.ajaxComplete(e,a,t)):e&&e.loadError&&e.loadError(t,a)}},i.onerror=function(){e&&e.loadError&&e.loadError(i.status,i.response)},e&&e.contentType&&i.setRequestHeader("Content-Type",e.contentType),r&&e.timeout&&(i.timeout=e.timeout),e.beforeSend){if(!1===e.beforeSend(i,e))return}i.send(n)}ajaxComplete(e,t,a){if(e){if(e.beforeLoadComplete){const a=e.beforeLoadComplete(t);a&&(t=a)}e.loadComplete&&e.loadComplete(t,a),this.callback&&this.callback(t,a)}}parseXLSXData(e,t){const a=new DOMParser,n=a.parseFromString(t,"text/xml"),r=Array.from(n.getElementsByTagName("si")),i=[],o=a.parseFromString(e,"text/xml"),d=Array.from(o.getElementsByTagName("row")),l=[];return r.forEach((function(e){let t=e.getElementsByTagName("t");if(1===t.length)i.push(t[0].innerHTML);else{let e="";t=Array.from(t),t.forEach((function(t){e+=t.innerHTML})),i.push(e)}})),d.forEach((function(e){const t={};Array.from(e.getElementsByTagName("c")).forEach((function(e){const a=e.getAttribute("r").match(/\D+/)[0],n=e.getAttribute("t"),r=e.getElementsByTagName("v")[0].innerHTML;let o;switch(n){case"s":o=i[parseFloat(r)];break;case"b":o=1===parseFloat(r);break;default:o=parseFloat(r)}t[a]=o})),l.push(t)})),l}}Smart.Ajax=window.Ajax=e})();
817
+ (()=>{Smart.DataAdapter=window.smartDataAdapter=class{constructor(e){e||(e={});const t=Object.assign(this,e);t.key=(65536*(1+Math.random())|0).toString(16).substring(1),t.$document=Smart.Utilities.Extend(document),t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],void 0===t.allowAdd&&(t.allowAdd=!0),void 0===t.allowRemove&&(t.allowRemove=!0),void 0===t.allowUpdate&&(t.allowUpdate=!0),void 0===t.mapChar&&(t.mapChar="."),void 0!==e.observable||t.virtualDataSource?t.observable=!1:t.observable=!0,void 0===t.sanitizeHTML&&(t.sanitizeHTML="blackList"),t._expandedRowIds=[],e.dataSource||(t.dataSource=[]),e.dataFields||(t.dataFields=[]),e.dataSourceType||(t.dataSourceType="array"),e.id||(t.id=null),e.autoFetch||(t.autoFetch=!0),e.dataFields&&(t.dataFields=e.dataFields),Object.defineProperty(t,"groupBy",{configurable:!1,enumerable:!0,get:()=>t._groupBy?t._groupBy:[],set(e){const a=()=>{t.boundHierarchy=null,t.refreshHierarchy(),t.onGroup&&t.onGroup()};t._groupBy=new Smart.ObservableArray(e),t._groupBy.notify((function(){a()})),t.isInitialized&&a()}}),e.groupBy?e.groupBy.toArray?t.groupBy=e.groupBy.toArray():t.groupBy=e.groupBy:t.groupBy=[],e&&!1!==e.autoBind&&t.dataBind(),t.isInitialized=!0}beginUpdate(){this.isUpdating=!0}endUpdate(){const e=this;e.isUpdating=!1,e.refreshIndexes(),e.refreshHierarchy()}get expandHierarchy(){return void 0===this._expandHierarchy&&(this._expandHierarchy=!1),this._expandHierarchy}set expandHierarchy(e){const t=this;t._expandHierarchy=e,t.isInitialized&&t.refreshHierarchy()}_getDataField(e){switch(e.name){case"leaf":case"parent":case"expanded":case"checked":case"selected":case"level":case"icon":case"data":case"group":case"children":case"items":e.map?e.map=e.map.replace(e.name,"$"+e.name):e.map=e.name,e.name="$"+e.name}}get dataFields(){return this._dataFields}set dataFields(e){const t=this;return t._dataFields=t._getDataFieldObjects(e),t._dataFields}_getDataFieldObjects(e){const t=this;let a=[];if("number"==typeof e){const t="A".charCodeAt(0);let n="",r=0;for(let i=0;i<e;i++){const e=String.fromCharCode(t+r);r++;const i=n+e;a.push({name:i,dataType:"string"}),r>=26&&(r=0,n+="A")}}else if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){const e=r.split(":"),t=e[0].trim(),n=e.length>1?e[1].trim():"string";a.push({name:t,dataType:n})}else a.push(r);t._getDataField(a[a.length-1])}return a}get dataSource(){const e=this;return e._dataSource||(e._dataSource=[]),e._dataSource}set dataSource(e){const t=this;t._dataSource=e,t.isInitialized&&(t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],t.bindingCompleted=!1,t.dataBind(),t.refreshIndexes())}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){const e=this;return!1===e.observable?e.boundSource:e.boundSource.toArray()}dataBind(){const t=this;t.bindingCompleted=!1,t.clear();const a=()=>{t.observable&&(t.boundSource.notify||(t.boundSource=new Smart.ObservableArray),t.boundSource.notify((function(e){if("update"===e.action&&e.path&&e.path.indexOf(".")>=0&&-1===e.path.indexOf("children")&&-1===e.path.indexOf("loaded")&&-1===e.path.indexOf("level")&&-1===e.path.indexOf("leaf")&&-1===e.path.indexOf("expanded")){let a=!1;for(let n=0;n<t.dataFields.length;n++){const r=t.dataFields[n].name;e.path.indexOf(r)>=0&&(a=!0)}t._notify&&a&&t._notify({action:"update",data:e.target,index:e.index})}}))),t._onBindingComplete()};"string"==typeof t.dataSource&&(t.dataSource.indexOf(".json")>=0||"json"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="json",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xml")>=0?(t.url=t.dataSource,t.dataSourceType="xml",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xlsx")>=0?(t.url=t.dataSource,t.dataSourceType="xlsx",new e(t,(e=>{if(!e[0])return e=[],t._bindToArray(),void a();const n=Object.keys(e[0]),r={},i=[];if(!1!==t.exportHeader){let a=0;for(let e in n){r[n[e]]=t.dataFields[a++].name}for(let t=1;t<e.length;t++){const a=e[t],o={};for(let e in n){const t=n[e];o[r[t]]=a[t]}i.push(o)}t.dataSource=i}t._bindToArray(),a()}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".csv")>=0?(t.url=t.dataSource,t.dataSourceType="csv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".tsv")>=0?(t.url=t.dataSource,t.dataSourceType="tsv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf(".ics")>=0||t.dataSource.indexOf(".php")>=0&&"ics"===t.dataSourceType||t.dataSource.indexOf(".txt")>=0&&"ics"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="ics",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf("BEGIN:VCALENDAR")>=0||"ics"===t.dataSourceType)?(t._bindToICS(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf("<?xml")>=0||"xml"===t.dataSourceType)?(t._bindToXML(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf(" ")>=0||t.dataSource.indexOf(",")>=0||"tsv"===t.dataSourceType||"csv"===t.dataSourceType||"tab"===t.dataSourceType)?(t._bindToCSV(),a()):"array"===t.dataSourceType?(t._bindToArray(),a()):"json"===t.dataSourceType&&(t._bindToJSON(),a())}_bindToXML(){const e=this;let t=null,a=null;window.DOMParser&&(t=new DOMParser,a=t.parseFromString(e.dataSource,"text/xml")),void 0===e.root&&(e.root=""),void 0===e.record&&(e.record="");const n=a.querySelectorAll(e.root+" "+e.record),r=n.length,i=[];let o=e.dataFields?e.dataFields.length:0;if(0===o){const t=n[0],a=new Array;for(let e in t){const t=e;a[a.length]={name:t}}e.dataFields=a,o=a.length}for(let t=0;t<r;t++){const a=n[t],r={};if(void 0===a)break;if(e.id){const t=a.querySelector(e.id);r[e.id]=t.textContent}for(let t=0;t<o;t++){const n=e.dataFields[t],i=a.querySelector(n.map||n.name);r[n.name]=i.textContent}i[t]=r}e.canNotify=!1,e.dataSource=i,e.canNotify=!0,e._bindToArray()}_bindToCSV(){const e=this,t=""+e.dataSource,a=-1===t.indexOf(",")?"\t":",",n=t.split("\r"),r=new Array;let i=t.split("\n"),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=e.dataFields.length>0;for(let t=0;t<o;t++){const n=i[t],o={},l=i[t].split(a);for(let a=0;a<l.length;a++){let r=e.dataFields[a],i=l[a];if(r||(e.dataFields.push({name:i.trim()}),r=e.dataFields[e.dataFields.length-1]),r.map&&(i=n[r.map]),i=i.trim(),1!==t||d)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}o[r.map||r.name||a.toString()]=i}(d||t>0)&&r.push(o)}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_onBindingComplete(){const e=this;e._buildHierarchy(),e.onBindingComplete&&e.onBindingComplete({data:e.boundSource}),e._notify&&e._notify({action:"bindingComplete",data:e.boundSource}),e.bindingCompleted=!0}refreshHierarchy(){this.isUpdating||this._buildHierarchy()}find(){return this.boundSource.find.apply(this.boundSource,arguments)}onVirtualDataSourceRequested(e,t){const a=this;let n=t?t.first:1/0,r=t?t.last:1/0,i=t?t.row:null;if(void 0===n&&(n=1/0),void 0===r&&(r=1/0),a.virtualFirstIndex=n,a.virtualLastIndex=r,a.virtualDataSource){const o=function(r){void 0!==r.virtualDataSourceLength&&(a.virtualDataSourceLength=r.virtualDataSourceLength),new Smart.DataAdapter({dataSource:r.dataSource,dataFields:r.dataFields||a.dataFields,data:t,keyDataField:r.keyDataField,parentDataField:r.parentDataField,observable:!1,id:r.id||a.id,onBindingComplete(r){if(void 0===t.result&&(t.result=!0),a.virtualDataSourceOnExpand&&i)return a.groupBy.length>0?r.data&&r.data.length>0&&a.add(r.data):r.data&&r.data.length>0?a.add(r.data,i.$.id):i.leaf=!0,a.onFilter&&a.onFilter(),void e(t);n===1/0&&"scroll"===t.action?r.data&&r.data.length&&a.add(r.data):"filter"===t.action||"group"===t.action?(a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0):("add"===t.action||"update"===t.action||t.action,a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0),a.onFilter&&a.onFilter(),e(t)}})};let d={};if(t.sorting&&t.sorting.length>0){let e=[];for(let a in t.sorting)e.push(a+" "+t.sorting[a].sortOrder.toUpperCase());const a=" ORDER BY "+e.join(", ");d.orderBy=a}else d.orderBy="";if(void 0===n||void 0===r||0===n&&0===r)d.limit="";else{const e=r-n,t=" LIMIT "+e+" OFFSET "+n;d.limit=t,isNaN(e)&&(d.limit="")}if(t.grouping&&t.grouping.length>0){const e=" GROUP BY "+t.grouping[0];d.groupBy=e}else d.groupBy="";if(t.filtering&&t.filtering.length>0){const e=(e,t)=>{switch(t.condition){case"EMPTY":return e+" = ''";case"NOT_EMPTY":return e+" != ''";case"EQUAL":return e+" = '"+t.value+"'";case"NOT_EQUAL":return e+" != '"+t.value+"'";case"CONTAINS_CASE_SENSITIVE":case"CONTAINS":return e+" LIKE '%"+t.value+"%'";case"DOES_NOT_CONTAIN_CASE_SENSITIVE":case"DOES_NOT_CONTAIN":return e+" NOT LIKE '%"+t.value+"%'";case"STARTS_WITH_CASE_SENSITIVE":case"STARTS_WITH":return e+" LIKE '"+t.value+"%'";case"ENDS_WITH_CASE_SENSITIVE":case"ENDS_WITH":return e+" LIKE '%"+t.value+"'";case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL"}},a=(e,t)=>{switch(t.condition){case"EQUAL":return e+" = "+t.value;case"NOT_EQUAL":return e+" != "+t.value;case"GREATER_THAN":return e+" > "+t.value;case"GREATER_THAN_OR_EQUAL":return e+" >= "+t.value;case"LESS_THAN":return e+" < "+t.value;case"LESS_THAN_OR_EQUAL":return e+" <= "+t.value;case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL";case"RANGE":return"("+e+" >= "+t.value+" and "+e+" <= "+t.valueTo+")"}},n=(e,t,a)=>{if(a.operator){var n=e(t,a.condition1),r=e(t,a.condition2);return"("+n+" "+a.operator+" "+r+")"}return e(t,a)};let r=[];for(let i in t.filtering){const o=t.filtering[i];let d=o.filters,l=[],s=" AND ";for(let t=0;t<d.length;t++){const r=d[t];switch(r.type){case"stringFilter":l.push(n(e,i,r));break;case"numericFilter":case"dateFilter":case"booleanFilter":l.push(n(a,i,r))}1===o.logicalOperators[t]&&(s=" OR ")}r.push("("+l.join(s)+")")}if(r.length>0){let e=" AND ";t.filterOperator&&"or"===t.filterOperator.toLowerCase()&&(e=" OR "),d.where=" WHERE "+r.join(e)}else d.where=""}else d.where="";if("dataBind"===t.action&&a.virtualDataSourceOnExpand&&a.keyDataField&&a.parentDataField&&(d.where?d.where+=" AND "+a.parentDataField+" IS NULL":d.where=" WHERE "+a.parentDataField+" IS NULL"),"update"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+"='"+t.edit.row[n]+"'");d.update=" SET "+e.join(", ")+" WHERE "+a.id+"="+t.edit.row[a.id]}if("remove"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+" = '"+t.edit.row[n]+"'");d.remove=" WHERE "+a.id+"="+t.edit.row[a.id]}if("add"===t.action){const e=[],a=[];for(let n in t.edit.row)"$"!==n&&(a.push(n),e.push("'"+t.edit.row[n]+"'"));d.add=" ("+a.join(", ")+") VALUES ("+e.join(", ")+")"}"expand"===t.action?(a.groupDataField?d.where?d.where+=" AND "+a.groupDataField+" = '"+i[a.groupDataField]+"'":d.where=" WHERE "+a.groupDataField+" = '"+i[a.groupDataField]+"'":a.keyDataField&&a.parentDataField?d.where?d.where+=" AND "+a.parentDataField+" = "+i[a.keyDataField]:d.where=" WHERE "+a.parentDataField+" = "+i[a.keyDataField]:d.where?d.where+=" AND "+i.groupDataField+" = '"+i.label+"'":d.where=" WHERE "+i.groupDataField+" = '"+i.label+"'",d.limit="",d.groupBy="",a.virtualDataSourceOnExpand(o,{first:n,last:r,row:t.row,sorting:t.sorting,filtering:t.filtering,grouping:t.grouping,action:t.action,query:d})):a.virtualDataSource(o,{first:n,last:r,sorting:t.sorting,filtering:t.filtering,filterOperator:t.filterOperator||"and",grouping:t.grouping,action:t.action,query:d})}else e()}add(e,t){const a=this;if(!e)return;let n=!0;const r=function(e){const r=a._getDataItem(e,a.boundSource.length);if(a.dataItemById[r.$.id])return void 0!==t&&(r.$.parentId=t),null;a[a.boundSource.length]=r,a.dataItemById[r.$.id]=r;const i=a.boundSource.push(r);return void 0!==t&&(r.$.parentId=t),i||(n=!1),r};if(e.length){let t=[];for(let a=0;a<e.length;a++){const n=r(e[a]);n&&t.push(n)}a._notify({action:"add",data:t})}else{const t=r(e);a._notify({action:"add",data:t})}return a.refreshHierarchy(),n}refreshIndexes(){const e=this;for(let t=0;t<e.boundSource.length;t++)e[t]=e.boundSource[t],e[t].$.index=t,e.dataItemById[e[t].$.id]=e[t];let t=e.boundSource.length;for(;e[t];)delete e[t],t++}removeLast(){const e=this;delete e[e.boundSource.length-1];const t=e.boundSource.pop();return delete e.dataItemById[t.$.id],e._notify({action:"removeLast",data:t}),e.refreshHierarchy(),t}remove(e){const t=this;let a=t.indexOf(e);-1===a&&e&&e.$&&(a=t.indexOf(t.dataItemById[e.$.id])),t.removeAt(a)}removeAt(e){const t=this,a=t.boundSource[e];if(!a)throw new Error("Invalid Item Index");t.boundSource.splice(e,1),delete t.dataItemById[a.$.id],t.refreshIndexes(),t._notify({action:"remove",index:e,data:a}),t.refreshHierarchy()}update(e,t){const a=this;if(Smart.Utilities.Types.isArray(e)&&Smart.Utilities.Types.isArray(t)&&0===e.length&&0===t.length)return void a.refreshHierarchy();if(t.length&&e.length){let n=[];for(let r=0;r<e.length;r++){const i=a._getDataItem(t[r],e[r]),o=e[r];n.push(i),a.boundSource[o]=i,a[o]=a.boundSource[o],a.dataItemById[i.$.id]=a[o]}return a._notify({action:"update",index:e,data:n}),void a.refreshHierarchy()}const n=a._getDataItem(t,e),r=a.boundSource[e].$.id;return n.$.id=r,a.boundSource[e]=n,a[e]=a.boundSource[e],a.dataItemById[n.$.id]=a[e],a._notify({action:"update",index:e,data:n}),a.refreshHierarchy(),n}insert(e,t){const a=this;if(t.length){const n=[];for(let r=0;r<t.length;r++){const i=a._getDataItem(t[r],e+r);n.push(i)}t=n}else t=a._getDataItem(t,e);const n=a.boundSource.splice(e,0,t);return a.refreshIndexes(),a._notify({action:"insert",index:e,data:t}),a.refreshHierarchy(),n}move(e,t){if(t>e&&t-e==1||e===t)return;const a=this,n=a.boundSource.splice(e,1)[0];t>e?(t--,a.boundSource.splice(t,0,n)):a.boundSource.splice(t,0,n),a.refreshIndexes(),a._notify({action:"move",index:t,data:a.boundSource[t]}),a.refreshHierarchy()}indexOf(e){return this.boundSource.indexOf(e)}get length(){const e=this;return void 0!==e.virtualDataSourceLength?e.virtualDataSourceLength:e.dataSourceLength?e.dataSourceLength:"number"==typeof e.dataSource?e.dataSource:e.bindingCompleted?e.boundSource.length:e.dataSource&&"string"!=typeof e.dataSource&&e.dataSource.length?e.dataSource.length:e.boundSource.length}clear(){const e=this;if(!e.isInitialized)return e._cachedValues=[],void(e.dataItemById=[]);for(let t=0;t<e.boundSource.length;t++)delete e[t];e._expandedRowIds=[],e._cachedValues=[],e.boundSource=e.observable?new Smart.ObservableArray:[],e.dataItemById=[],e.refreshHierarchy()}_getId(e,t,a){if(null===e||void 0===e.name||!e.name||!t.getAttribute){if(e&&e.toString().length>0&&t.getAttribute){let a=t.getAttribute(e);if(null!==a&&a.toString().length>0)return a.trim().split(" ").join("").replace(/([ #;?%&,.+*~\':'!^$[\]()=>|\/@])/g,"");{let a=e.split(this.mapChar);if(a.length>1){let e=t;for(let t=0;t<a.length;t++)void 0!==e&&(e=e[a[t]]);if(void 0!==e)return e}else if(void 0!==t[e])return t[e]}}return a}{let n=t.getAttribute(e.name);if(null!==n&&n.toString().length>0)return n;if(e.map)try{let a=t.getAttribute(e.map);if(null!==a&&a.toString().length>0)return a}catch(e){return a}}}_buildHierarchy(){const e=this;if(e.reservedNames){const t=e.reservedNames;t.leaf||(t.leaf="leaf"),t.parent||(t.parent="parent"),t.expanded||(t.expanded="expanded"),t.checked||(t.checked="checked"),t.selected||(t.selected="selected"),t.level||(t.level="level"),t.data||(t.data="data")}else e.reservedNames={leaf:"leaf",parent:"parent",expanded:"expanded",checked:"checked",selected:"selected",level:"level",icon:"icon",data:"data"};const t=e.reservedNames;if(e.childrenDataField){const a=[];for(let n=0;n<e.boundSource.length;n++){const r=Object.assign({},e.boundSource[n]);if(!r)continue;a.push(r);const i=function(a){const n=e.childrenDataField.split(e.mapChar);let r=null;if(n.length>1){let e=a;for(let t=0;t<n.length;t++)void 0!==e&&(e=e[n[t]]);r=e}else r=a.children;a.children=r,(null===a.children||void 0===a.children||a.children&&0===a.children.length)&&(a[t.leaf]=!0)};i(r),r[t.level]=0,r.$||(r.$={}),r[t.parent]=null,r[t.data]=r,void 0===r[t.expanded]&&(r[t.expanded]=!1,e.expandHierarchy&&(r[t.expanded]=!0));const o=function(a,n){if(n)for(let r=0;r<n.length;r++){let d=e._getDataItem(n[r],r);if(d){if(i(d),!e.id){const e=function(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()};d.$.id=e()}d[t.level]=a[t.level]+1,d[t.parent]=a,d[t.data]=Object.assign({},d),a&&(a.children[r]=d),void 0===d[t.expanded]&&(d[t.expanded]=!1,e.expandHierarchy&&(d[t.expanded]=!0)),o(d,d.children)}}else a.children=new Array};o(r,r.children)}if(e.boundHierarchy=a,!e._boundSourceUpdate){for(let t=0;t<e.boundHierarchy.length;t++){const a=e.boundHierarchy[t];if(a.children){const t=function(a){if(e.dataItemById[a.$.id]||(e.boundSource.canNotify=!1,e.dataItemById[a.$.id]=a,e.boundSource.canNotify=!0),a.children)for(let e=0;e<a.children.length;e++){const n=a.children[e];n.children&&t(n)}};t(a)}}e._boundSourceUpdate=!0}}if(e.xmlRoot&&"xml"===e.dataSourceType&&(e.boundHierarchy=this._getHierarchy("uid","_parentuid","children",null,e.boundSource)),e.keyDataField&&e.parentDataField)return["keyDataField","parentDataField"].forEach((t=>{switch(e[t]){case"parent":e[t]="$"+e[t]}})),void(e.boundHierarchy=this._getHierarchy(e.keyDataField,e.parentDataField,"children",null,e.boundSource));e.groupBy&&e.groupBy.length>0?e.boundHierarchy=this._getGroupHierarchy(e.groupBy,"children","label",null,"data",null,"parent",e.boundSource):e.virtualDataSourceOnExpand&&(e.boundHierarchy=this._getHierarchy("id","parentId","children",null,e.boundSource))}_getGroupHierarchy(e,t,a,n,r,i,o,d,l){let s=this;l||(l=0);let c=s.reservedNames;const u=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};let f=new Array;for(let t=0;t<e.length;t++)f[t]=u();t||(t="children"),a||(a="group"),r||(r="item"),o||(o="parent"),void 0===i&&(i="value");const h=new Array,p=new Array;let g=0;const S=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};let y=!1;for(let n=0;n<d.length;n++){let m=Object.assign({},S(d[n]));m[c.leaf]=!1;let T=new Array,b=0;for(let t=0;t<e.length;t++){const a=e[t],n=m[a];null!=n?((""===n||void 0===n&&0===t)&&(y=!0),T[b++]={value:n,group:a,hash:f[t]}):(T[b++]={value:null,group:a,hash:f[t]},0===t&&(y=!0))}if(T.length!==e.length)break;let v=null,E="";for(let e=0;e<T.length;e++){const n=T[e].value,d=T[e].group;if(E=E+"_"+T[e].hash+"_"+n,void 0===p[E]||null===p[E]){if(null===v){v={$:{}},v[c.level]=0,v[c.leaf]=!1,v[o]=null,v[a]=n,v[r]=m,v.groupDataField=d,v[d]||(v[d]=v.data[d]),void 0!==m[c.expanded]?v[c.expanded]=m[c.expanded]:(v[c.expanded]=!1,s.expandHierarchy&&(v[c.expanded]=!0)),i&&(v[i]=m[i]),v[t]=new Array;let e=h.length+l;this.id&&"number"!=typeof m.$.id&&!isFinite(m.$.id)||(e="Item"+e),void 0===v.$.id&&(v.$.id=e),s._expandedRowIds[v.$.id]&&(v[c.expanded]=!0),h[g++]=v}else{const e={$:{}};e[c.level]=v[c.level]+1,e[o]=v,e[a]=n,e[t]=new Array,e[r]=m,e.groupDataField=d,e[c.leaf]=!1,e[d]||(e[d]=e.data[d]),void 0!==m[c.expanded]?e[c.expanded]=m[c.expanded]:(e[c.expanded]=!1,s.expandHierarchy&&(e[c.expanded]=!0)),i&&(e[i]=m[i]),void 0===e.$.id&&(e.$.id=v.$.id+"_"+v[t].length),s._expandedRowIds[e.$.id]&&(e[c.expanded]=!0),v[t][v[t].length]=e,v=e}p[E]=v}else v=p[E]}m&&(m[c.leaf]=!0),null!==v?(null===this.id?void 0===m.$.id&&(m.$.id=v.$.id+"_"+v[t].length):void 0===m.$.id&&-1===m.$.id.toString().indexOf(v.$.id)&&(m.$.id=v.$.id+"_"+m.$.id),m[o]=v,m[c.level]=v[c.level]+1,v[t][v[t].length]=m):void 0===m.$.id&&(m.$.id=u())}if(y){let e=null,t=!1;for(let a=0;a<h.length;a++){const n=h[a];if(!n[n.groupDataField]){e=n,e.$.id.toString().startsWith("Item")&&(t=!0),h.splice(a,1);break}}if(e&&(h.push(e),t))for(let e=0;e<h.length;e++){h[e].$.id="Item"+e}}return h}_getHierarchy(e,t,a,n,r){const i=this,o=new Array;let d=this.boundSource;if(r&&(d=r),0===this.boundSource.length)return null;const l=null!==a?a:"children";let s=new Array,c=d,u=c.length,f=i.reservedNames;const h=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};for(let a=0;a<u;a++){let n=c[a],r=n[t],o=n[e];"parentId"===t&&(r=n.$.parentId),"id"===e&&(o=n.$.id),n[l]=new Array,i.expandHierarchy&&void 0===n[f.expanded]&&(n[f.expanded]=i.expandHierarchy),s[o]={parentId:r,item:n}}for(let a=0;a<u;a++){const n=c[a];let r=n[t],i=n[e];if("parentId"===t&&(r=n.$.parentId),"id"===e&&(i=n.$.id),void 0!==s[r]){let e={parentId:r,item:s[i].item},t=s[r].item;t[l]||(t[l]=new Array);let a=t[l].length;e=e.item,f?e[f.parent]=t:e.parent=t;const n=h(e);t[l][a]=n,s[r].item=t,s[i].item=e}else{let e=s[i].item;f?void 0===e[f.parent]&&(e[f.parent]=null):void 0===e.parent&&(e.parent=null);const t=h(e);f?t[f.level]=0:t.level=0,o[o.length]=t}}if(0!==o.length){let e=function(t,a){for(let n=0;n<a.length;n++){const r=a[n];f?r[f.level]=t:r.level=t;const o=r[l];o&&o.length>0?(r.leaf=!1,e(t+1,o)):i.virtualDataSourceOnExpand?void 0===r.leaf&&(r.leaf=!1):f?r[f.leaf]=!0:r.leaf=!0}};e(0,o)}return o}summarize(e,t){const a=this;Array.isArray(e)||(e=[e]);let n=[];for(let t=0;t<e.length;t++){const a=e[t];for(let e in a){const t=a[e];n.push({dataField:e,functions:t})}}e=n;let r={},i=new Array;t||(t=a.boundSource);let o=t.length,d=0;if(0!==o&&void 0!==o){for(let a=0;a<o;a++){let n=t[a];if((!n||!n.$||!1!==n.$.filtered)&&n){d++;for(let t=0;t<e.length;t++){const o=e[t];let d=n[o.dataField];if(o.functions&&o.functions.length>0){r[o.dataField]=r[o.dataField]||{},i[o.dataField]=i[o.dataField]||0,i[o.dataField]++;const e=function(e){for(let t in e){let a=r[o.dataField][t];null==a&&(r[o.dataField][t]=0,a=0),"function"==typeof e[t]&&(a=e[t](a,d,o.dataField,n)),r[o.dataField][t]=a}},t=d;let l=parseFloat(d);l=!isNaN(l),t&&t.toDate&&(l=!1),"string"==typeof d&&d.startsWith("+")&&(l=!1),l&&(d=parseFloat(d)),"number"==typeof d&&isFinite(d)?o.functions.forEach((function(t){let n=r[o.dataField][t];if(null==n&&(n=0,"min"===t&&(n=9999999999999),"max"===t&&(n=-9999999999999),"median"===t&&(n=[])),"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t)n+=parseFloat(d);else if("product"===t)0===a?n=parseFloat(d):n*=parseFloat(d);else if("min"===t)n=Math.min(n,parseFloat(d));else if("max"===t)n=Math.max(n,parseFloat(d));else if("count"===t)n++;else if("median"===t)n.push(parseFloat(d));else if("blank"===t)n=r[o.dataField][t],null==n&&(n=0),d||n++;else if("filled"===t)n=r[o.dataField][t],null==n&&(n=0),void 0!==d&&n++;else if("unique"===t)n=r[o.dataField][t],null==n&&(n=[]),-1===n.indexOf(d)&&n.push(d);else if("object"==typeof t)return void e(t);r[o.dataField][t]=n})):o.functions.forEach((function(t){if("min"===t||"max"===t||"count"===t||"product"===t||"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t){if(null===d)return!0;let e=r[o.dataField][t];return null==e&&(e=0),r[o.dataField][t]=e,!0}if("blank"===t){let e=r[o.dataField][t];null==e&&(e=0),d||e++,r[o.dataField][t]=e}else if("filled"===t){let e=r[o.dataField][t];null==e&&(e=0),d&&e++,r[o.dataField][t]=e}else if("unique"===t){let e=r[o.dataField][t];null==e&&(e=[]),-1===e.indexOf(d)&&e.push(d),r[o.dataField][t]=e}"object"==typeof t&&e(t)}))}}}}for(let a=0;a<e.length;a++){const n=e[a];if(n.functions&&(!n.functions||0!==n.functions.length)){if(r[n.dataField]||(r[n.dataField]={},n.functions.forEach((function(e){r[n.dataField][e]=0}))),void 0!==r[n.dataField].avg){const e=r[n.dataField].avg,t=i[n.dataField];r[n.dataField].avg=0===t||void 0===t?0:e/t}else void 0!==r[n.dataField].count&&(r[n.dataField].count=d);if(void 0!==r[n.dataField].unique){const e=r[n.dataField].unique;r[n.dataField].unique=e.length}if(void 0!==r[n.dataField].median){let e=r[n.dataField].median;e.sort((function(e,t){return e-t})),r[n.dataField].median=.5*(e[Math.floor((e.length+1)/2)-1]+e[Math.ceil((e.length+1)/2)-1])}(r[n.dataField].stdev||r[n.dataField].stdevp||r[n.dataField].var||r[n.dataField].varp)&&n.functions.forEach((function(e){if("stdev"===e||"var"===e||"varp"===e||"stdevp"===e){const a=r[n.dataField][e],i=o,d=a/o;let l=0;for(let e=0;e<o;e++){let a=t[e][n.dataField];l+=(a-d)*(a-d)}let s="stdevp"===e||"varp"===e?i:i-1;0===s&&(s=1),"var"===e||"varp"===e?r[n.dataField][e]=l/s:"stdevp"!==e&&"stdev"!==e||(r[n.dataField][e]=Math.sqrt(l/s))}}))}}return r}}_getDataItem(e,t){const a=this,n={},r="number"==typeof a.dataSource||a.dataSourceLength;if(!e)return{$:{id:t,isEmpty:!0,index:t}};if("string"==typeof e&&(e={"":e}),r){for(let e=0;e<a.dataFields.length;e++){n[(a.dataFields?a.dataFields[e]:{}).name]=""}return n.$={},n.$.id=t,n.$.index=t,n}const i=e;if(void 0!==i.expanded&&(n.expanded=i.expanded,"true"===i.expanded||!0===i.expanded||1===i.expanded?n.expanded=!0:n.expanded=!1),a.childrenDataField?void 0!==i[a.childrenDataField]&&(n.children=i[a.childrenDataField]):void 0!==i.children?n.children=i.children:void 0!==i.items&&(n.children=i.items),void 0!==i.leaf&&(n.leaf=i.leaf),void 0!==i.level&&(n.level=i.level),a.keyDataField&&void 0!==i[a.keyDataField]&&(n[a.keyDataField]=i[a.keyDataField]),a.parentDataField&&void 0!==i[a.parentDataField]&&(n[a.parentDataField]=i[a.parentDataField]),0===a.dataFields.length){const t=Object.getOwnPropertyNames(e);for(let e=0;e<t.length;e++)"$"!==t[e]&&a.dataFields.push({name:t[e],dataType:"string"})}for(let t=0;t<a.dataFields.length;t++){const r=a.dataFields?a.dataFields[t]:{};let o="";if(null==r)continue;if(e.length&&(o=e[t]),r.map){let e=r.map.split(a.mapChar);if(e.length>0){let t=i;for(let a=0;a<e.length;a++)i&&(t=t[e[a]]);o=t}else o=i[r.map]}null!=o?o=o.toString():void 0===o&&null!==o&&(o="");let d=!1;""===o&&(d=!0,o=e[r.name],void 0===r.dataType&&(r.dataType="any"),null!=o?"array"!==r.dataType&&("any"===r.dataType?o=Array.isArray(e[r.name])?[...e[r.name]]:"object"==typeof e[r.name]?Object.assign({},e[r.name]):e[r.name]:"date"!==r.dataType&&(o=o.toString())):o=void 0===o&&"any"===r.dataType?null:""),"[object Object]"===o&&r.map&&d&&(o=""),a._cachedValues[o+"_"+r.dataType]?o=a._cachedValues[o+"_"+r.dataType]:("bool"===r.dataType||"boolean"===r.dataType?"true"===o||"1"===o?o=!0:"false"!==o&&"0"!==o||(o=!1):"number"===r.dataType?(-1===o.indexOf(".")&&o.indexOf(",")>=0&&o.substring(1+o.indexOf(",")).length<3&&(o=o.replace(",",".")),o=a.$document.deserialize(""+o,r.dataType,!0)):"any"!==r.dataType&&(o=a.$document.deserialize(""+o,r.dataType,!0)),"any"!==r.dataType&&(a._cachedValues[o+"_"+r.dataType]=o)),"string"!==r.dataType&&"boolean"!==r.dataType&&"bool"!==r.dataType&&"any"!==r.dataType&&(isNaN(o)||o===-1/0||o===1/0)&&(o="date"===r.dataType||"number"===r.dataType?null:0),"parent"!==r.name&&"group"!==r.name&&"leaf"!==r.name&&"level"!==r.name?("string"===r.dataType&&/<.+?>/.test(o)&&o.replace&&("all"===a.sanitizeHTML?o=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===a.sanitizeHTML&&(o=window.Smart.Utilities.Core.sanitizeHTML(o))),n[r.name]=o):n.$[r.name]=o}let o=t;if(a.id)o=i[a.id],"object"==typeof o&&(o=t),i.$&&void 0!==i.$.id&&(o=i.$.id);else if(!a.virtualDataSource&&a.dataItemById&&a.dataItemById[o])for(o=a.length;a.dataItemById[o];)o++;return n.$||(n.$={}),n.$.id=o,n.$.index=t,new Object(n)}_bindToArray(){const e=this,t="number"==typeof e.dataSource||e.dataSourceLength,a=[];e.boundSource.canNotify=!1;const n=t?"number"==typeof e.dataSource?e.dataSource:e.dataSource.length:e.observable?e.length:e.dataSource.length;for(let r=0;r<n;r++){const n=t?{}:e.dataSource[r],i=e._getDataItem(n,r);a.push(i)}if(t&&e.dataSourceLength&&e.dataSource.length>0)for(let t=0;t<e.dataSource.length;t++){const n=e.dataSource[t].cell,r=e.dataSource[t].value,i=n.replace(/[^0-9]/g,""),o=n.replace(/[0-9]/g,"");a[i-1][o]=r}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(a),e.observable&&(e.boundSource=new Smart.ObservableArray(a));for(let t=0;t<n;t++)e.observable?e[t]=e.boundSource[t]:e[t]=a[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=a),e.boundSource.canNotify=!0}_bindToICS(){const e=this,t=""+e.dataSource,a=e.rowDelimiter||"\n",n=t.split("\r"),r=[];let i=t.split(a),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=function(e,t){var a=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z)?$/.exec(e);if(!a)throw new Error("Invalid UNTIL value: "+e);return t?new Date(a[1],a[2]-1,a[3],0,0,0,0):new Date(Date.UTC(a[1],a[2]-1,a[3],a[5]||0,a[6]||0,a[7]||0))};for(let e=0;e<o;e++){const t=i[e].trim();if(t.indexOf("BEGIN:VEVENT")>=0)var l={};else if(l)if(t.indexOf("BEGIN:VALARM")>=0)var s={};else{if(s){if(t.indexOf("ACTION")>=0){s.ACTION=t.substring(t.indexOf("ACTION")+7);continue}if(t.indexOf("DESCRIPTION")>=0){s.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);continue}if(t.indexOf("TRIGGER")>=0){s.TRIGGER=t.substring(t.indexOf("TRIGGER")+8);continue}if(t.indexOf("END:VALARM")>=0){l.ALARM||(l.ALARM=[]),l.ALARM.push(s),s=void 0;continue}}if(t.indexOf("SUMMARY")>=0)l.SUMMARY=t.substring(t.indexOf("SUMMARY")+8);else if(t.indexOf("LOCATION")>=0)l.LOCATION=t.substring(t.indexOf("LOCATION")+9);else if(t.indexOf("DESCRIPTION")>=0)l.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);else if(t.indexOf("RRULE")>=0)l.RRULE=t.substring(t.indexOf("RRULE")+6);else if(t.indexOf("RECURRENCE-ID")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID")+14);else if(t.indexOf("RECURRENCE-ID;VALUE=DATE")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID;VALUE=DATE")+25);else if(t.indexOf("EXDATE;VALUE=DATE")>=0){const e=t.substring(t.indexOf("EXDATE;VALUE=DATE")+20);l.EXDATE=e}else if(t.indexOf("EXDATE")>=0){const e=t.substring(t.indexOf("EXDATE")+7);l.EXDATE=e}else t.indexOf("DTEND;VALUE=DATE")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND;VALUE=DATE")+17),!0):t.indexOf("DTEND")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND")+6)):t.indexOf("DTSTART;VALUE=DATE")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART;VALUE=DATE")+19),!0):t.indexOf("DTSTART")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART")+8)):t.indexOf("UID")>=0?l.uid=l.UID=t.substring(t.indexOf("UID")+4):t.indexOf("STATUS")>=0?l.STATUS=t.substring(t.indexOf("STATUS")+7):t.indexOf("TITLE")>=0?l.TITLE=t.substring(t.indexOf("TITLE")+6):t.indexOf("CATEGORIES")>=0?l.CATEGORIES=t.substring(t.indexOf("CATEGORIES")+11):t.indexOf("END:VEVENT")>=0&&(r.push(l),l.ALARM&&(l.ALARM=JSON.stringify(l.ALARM)),s=void 0)}}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_bindToJSON(){const e=this,t=[],a=e.dataSource.length?e.dataSource:Object.entries(e.dataSource);e.boundSource.canNotify=!1;for(let n=0;n<a.length;n++){const r=a[n],i=e._getDataItem(r,n);t.push(i)}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(t);for(let t=0;t<e.length;t++)e[t]=e.boundSource[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=t),e.boundSource.canNotify=!0}sortBy(e,t,a){const n=this;if(!t)for(let a=0;a<n.dataFields.length;a++){const r=n.dataFields[a];if(r.name===e){t=r.dataType;break}}if(n.boundHierarchy){if((!e||0===e.length)&&n.groupBy.length>0)return void n.refreshHierarchy();const r=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(n.boundHierarchy);if(r){r.find((e=>{if(e.summaryRow)return e}))&&n.refreshHierarchy()}const i=function(r){n._sort(r,e,a,t);for(let n=0;n<r.length;n++){const o=r[n];o.children&&i(o.children,e,a,t)}};i(n.boundHierarchy)}else n._sort(n.boundSource,e,a,t)}_createFilter(e,t){const a={"=":"EQUAL","<>":"NOT_EQUAL","!=":"NOT_EQUAL",not_like:"DOES_NOT_CONTAIN",like:"CONTAINS","<":"LESS_THAN",">":"GREATER_THAN","<=":"LESS_THAN_OR_EQUAL",">=":"GREATER_THAN_OR_EQUAL",equal:"EQUAL","not equal":"NOT_EQUAL","less than":"LESS_THAN","greater than":"GREATER_THAN","greater than or equal":"GREATER_THAN_OR_EQUAL","less than or equal":"LESS_THAN_OR_EQUAL","starts with":"STARTS_WITH","ends with":"ENDS_WITH",notEqual:"NOT_EQUAL",not_equal:"NOT_EQUAL",lessThan:"LESS_THAN",greaterThan:"GREATER_THAN",greaterThanOrEqual:"GREATER_THAN_OR_EQUAL",lessThanOrEqual:"LESS_THAN_OR_EQUAL",less_than:"LESS_THAN",greater_than:"GREATER_THAN",greater_than_or_equal:"GREATER_THAN_OR_EQUAL",less_than_or_equal:"LESS_THAN_OR_EQUAL",null:"null","":"EMPTY",isblank:"EMPTY",isnotblank:"NOT_EMPTY",isBlank:"EMPTY",isNotBlank:"NOT_EMPTY",contains:"CONTAINS",does_not_contain:"DOES_NOT_CONTAIN","not contains":"DOES_NOT_CONTAIN",notcontains:"DOES_NOT_CONTAIN",notContains:"DOES_NOT_CONTAIN",startswith:"STARTS_WITH",endswith:"ENDS_WITH",starts_with:"STARTS_WITH",ends_with:"ENDS_WITH",startsWith:"STARTS_WITH",endsWith:"ENDS_WITH",NULL:"NULL",NOT_NULL:"NOT_NULL"};let n=[];for(let e=0;e<t.length;e++){const a=t[e],r=-1===a.indexOf('"')?a.split(" "):a.split('"');let i=[];for(let e=0;e<r.length;e++){const t=r[e];""!==t&&i.push(t.trim())}n.push(i)}const r=new Smart.FilterGroup,i=[],o=[];for(let t=0;t<n.length;t++){const r=n[t];if(r.length>1){const t=new Smart.FilterGroup;let n="and",i=0;for(let o=0;o<r.length;o++){const d=r[o];if("and"!==d&&"or"!==d){if(i++,2===i){const l=t.createFilter(e,d,a[r[o-1]]);i=0,n&&t.addFilter(n,l)}}else n=d}o.push(t)}else{const e=r[0];if("and"!==e&&"or"!==e)throw new Error('Filter Exprresion expects "AND" or "OR", but the token is: '+e);i.push(e)}}let d=0;if(1===o.length)return o[0];for(let e=0;e<o.length;e++){let t=i[d];(e+1)%2==0&&d++,t||(t="and"),r.addFilter(t,o[e])}return r}filterBy(e,...t){const a=this,n=(()=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}})(),r=a._createFilter(n,t);return a.boundSource.filter((t=>r.evaluate(t[e])))}_filter(e,t="and"){const a=this,n=[],r=[];if(0===e.length)return void a.clearFilter();const i=e=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}};let o,d;"and"===t?(o=!0,d=function(e,t,a){return e&&t.evaluate(a[t.dataField])}):(o=!1,d=function(e,t,a){return e||t.evaluate(a[t.dataField])});for(let t=0;t<e.length;t++){const o=e[t],d=o[0];let l=null;l=o[1]instanceof Smart.FilterGroup?o[1]:a._createFilter(i(d),o.splice(1)),l&&(r.push(d),l.dataField=d,n.push(l))}if(a.boundHierarchy){const e=function(e){let t=o;for(let a=0;a<n.length;a++){const r=n[a];t=d(t,r,e)}return e.$.filtered=t,t},t=function(n,r,i){let o=0;for(let a=0;a<n.length;a++){const i=n[a];e(i),i.$.filtered&&o++,i.children&&t(i.children,i,r)}o>0&&a.groupBy.length>0&&r?(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0)):o>0&&o!==n.length&&r?(r.$.filtered=null,i&&!i.$.filtered&&(i.$.filtered=null)):o>0&&o===n.length&&r&&(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0))};t(a.boundHierarchy,null,null)}else for(let e=0;e<a.boundSource.length;e++){const t=a.boundSource[e];let r=o;for(let e=0;e<n.length;e++){const a=n[e];r=d(r,a,t)}t.$.filtered=r}a.onFilter&&a.onFilter()}clearGroup(){const e=this;e.groupBy=[],e.boundHierarchy=null,e.refreshHierarchy(),e.onGroup&&e.onGroup()}clearFilter(){const e=this;for(let t=0;t<e.boundSource.length;t++){e.boundSource[t].$.filtered=!0}if(e.boundHierarchy){const t=function(e,a,n){for(let n=0;n<e.length;n++){const r=e[n];r.$.filtered=!0,r.$.filtered,r.children&&t(r.children,r,a)}a&&(a.$.filtered=!0,n&&!n.$.filtered&&(n.$.filtered=!0))};t(e.boundHierarchy,null,null)}e.onFilter&&e.onFilter()}clearSort(){this._sort(this.boundSource,[],[],[])}_sort(e,t,a,n,r,i){const o=this;let d=!1;if(0===e.length)return;if(e&&e.constructor&&e instanceof Smart.ObservableArray&&(d=!0),(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)&&!d&&!o.boundHierarchy)throw new Error("sort: Missing or Invalid arguments!");"string"==typeof t&&(t=[t]);const l=[],s=[];void 0===a&&(a=[]);const c=function(e,t){let a;switch(t||typeof e){case"string":a=(new Intl.Collator).compare;break;case"number":case"int":case"bigInt":case"float":case"double":a=function(e,t){return e-t};break;case"boolean":case"bool":a=function(e,t){return e===t?0:!1===e?-1:1};break;case"date":case"time":case"dateTime":a=e instanceof Date?function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0}:e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber?function(e,t){return e.compare(t)}:function(e,t){return e-t};break;case"object":if(e instanceof Date)a=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)a=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;a=function(t,a){return e.compareComplexNumbers(t,a)}}}return a};for(let r=0;r<t.length;r++){void 0===a[r]||"asc"===a[r]||"ascending"===a[r]?l[r]=1:l[r]=-1;let o=e[0][t[r]];if(void 0===o&&e[0]&&e[0].children&&e[0].data&&(o=e[0].data[t[r]]),i&&i){const e=t[r];if(i[e]){s[r]=i[e];continue}}s[r]=c(o,n[r])}t.length>0&&r?r(e,t,a,s):e.sort((function(e,a){for(let n=0;n<t.length;n++){const r=s[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e.$.index?(e.$.index-a.$.index)*l[n]:0}return r*l[n]}if(0===t.length)return e.$.index<a.$.index?-1:e.$.index>a.$.index?1:0}));for(let t=0;t<e.length;t++)o[t]=e[t]}static Filter(e,t,a,n,r="and"){let i,o;"and"===r?(i=!0,o=function(e,t,a,r){return n?e&&n(t,a,r):e&&r.evaluate(t[a])}):(i=!1,o=function(e,t,a,r){return n?e||n(t,a,r):e||r.evaluate(t[a])});return e.filter((e=>{let n=i;for(let r=0;r<a.length;r++){const i=a[r],d=t[r];n=o(n,e,d,i)}return n}))}filter(e,t,a){Smart.DataAdapter.Filter(this.boundSource,e,t,a)}sort(e,t,a){Smart.DataAdapter.Sort(this.boundSource,e,t,a)}static Sort(e,t,a,n){const r=function(e){let t;switch(typeof e){case"string":if(e.indexOf("-")>=0||e.indexOf("/")>=0){const t=new Date(e);if(t&&"Invalid Date"!==t.toString()){return function(e,t){const a=new Date(e),n=new Date(t);return a||n?a?n?a.getTime()-n.getTime():1:-1:0}}}t=(new Intl.Collator).compare;break;case"number":t=function(e,t){return e-t};break;case"boolean":t=function(e,t){return e===t?0:!1===e?-1:1};break;case"object":if(e instanceof Date)t=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof BigNumberNG)t=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;t=function(t,a){return e.compareComplexNumbers(t,a)}}}return t};if(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)return;"string"==typeof t&&(t=[t]);const i=[],o=[];void 0===a&&(a=[]);for(let n=0;n<t.length;n++)void 0===a[n]||"asc"===a[n]||"ascending"===a[n]?i[n]=1:i[n]=-1,o[n]=r(e[0][t[n]]);if(n)return void n(e,t,a,o);const d=e.slice(0);return d.sort((function(e,a){for(let n=0;n<t.length;n++){const r=o[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e._index?(e._index-a._index)*i[n]:0}return r*i[n]}})),d}};class e{constructor(e,t){const a=this;a.config=e,a.callback=t,!1!==e.autoFetch&&a.call(e)}call(e){const t=this;e||(e=t.config);let a="GET",n=e.url,r=null,i=!0;if(e.type&&(a=e.type),e.data)if("GET"===a){n+="?";for(let t in e.data)Object.prototype.hasOwnProperty.call(e.data,t)&&(n+=encodeURI(t+"="+e.data[t]+"&"));"&"===n.charAt(n.length-1)&&(n=n.slice(0,n.length-1))}else"POST"===a&&(r=JSON.stringify(e.data));e&&!1===e.async&&"xlsx"!==e.dataSourceType&&(i=!1),void 0!==window.fetch&&i?t.ajaxFetch(e,a,n,r):t.ajaxXMLHttpRequest(e,a,n,r,i)}ajaxFetch(e,t,a,n){const r=this,i={method:t};let o,d,l,s;switch(e.dataSourceType){case"json":o="json";break;case"xlsx":o="arrayBuffer";break;default:o="text"}if(e&&e.contentType&&(i.headers=new Headers({"Content-Type":e.contentType})),null!==n&&(i.body=n),e.timeout&&(l=setTimeout((function(){s=!0}),e.timeout)),e.beforeSend){if(!1===e.beforeSend(i,e))return}fetch(a,i).then((function(e){if(s)throw d=408,new Error("timeout");if(l&&clearTimeout(l),d=e.status,!e.ok)throw new Error(e.statusText);return e[o]()})).then((function(t){if("arrayBuffer"===o)return JSZip.loadAsync(t).then((function(t){return t.files["xl/worksheets/sheet1.xml"].async("text").then((function(a){return t.files["xl/sharedStrings.xml"].async("text").then((function(t){const n=r.parseXLSXData(a,t);r.ajaxComplete(e,n,d)}))}))}));r.ajaxComplete(e,t,d)})).catch((function(t){"JSZip is not defined"===t.message&&(t.message="JSZip is not defined. Please include a reference to JSZip to be able to load data from XLSX files."),e&&e.loadError&&e.loadError(d,t),r.callback&&r.callback(t,d)}))}ajaxXMLHttpRequest(e,t,a,n,r){const i=new XMLHttpRequest,o=this;if(i.open(t,a,r),i.ontimeout=function(){e&&e.loadError&&e.loadError(408,"timeout")},i.onload=function(){if(4===i.readyState){const t=i.status;let a=i.response;t>=200&&t<=299?("json"===e.dataSourceType&&(a=JSON.parse(a)),o.ajaxComplete(e,a,t)):e&&e.loadError&&e.loadError(t,a)}},i.onerror=function(){e&&e.loadError&&e.loadError(i.status,i.response)},e&&e.contentType&&i.setRequestHeader("Content-Type",e.contentType),r&&e.timeout&&(i.timeout=e.timeout),e.beforeSend){if(!1===e.beforeSend(i,e))return}i.send(n)}ajaxComplete(e,t,a){if(e){if(e.beforeLoadComplete){const a=e.beforeLoadComplete(t);a&&(t=a)}e.loadComplete&&e.loadComplete(t,a),this.callback&&this.callback(t,a)}}parseXLSXData(e,t){const a=new DOMParser,n=a.parseFromString(t,"text/xml"),r=Array.from(n.getElementsByTagName("si")),i=[],o=a.parseFromString(e,"text/xml"),d=Array.from(o.getElementsByTagName("row")),l=[];return r.forEach((function(e){let t=e.getElementsByTagName("t");if(1===t.length)i.push(t[0].innerHTML);else{let e="";t=Array.from(t),t.forEach((function(t){e+=t.innerHTML})),i.push(e)}})),d.forEach((function(e){const t={};Array.from(e.getElementsByTagName("c")).forEach((function(e){const a=e.getAttribute("r").match(/\D+/)[0],n=e.getAttribute("t"),r=e.getElementsByTagName("v")[0].innerHTML;let o;switch(n){case"s":o=i[parseFloat(r)];break;case"b":o=1===parseFloat(r);break;default:o=parseFloat(r)}t[a]=o})),l.push(t)})),l}}Smart.Ajax=window.Ajax=e})();
818
818
 
819
819
  /***/ }),
820
820
 
821
821
  /***/ 2052:
822
822
  /***/ (() => {
823
823
 
824
- (()=>{const e=-1*(new Date).getTimezoneOffset(),t=[{id:"Local",offset:e,offsetHours:e/60,displayName:"",supportsDaylightSavingTime:!1},{id:"Dateline Standard Time",offset:-720,offsetHours:-12,displayName:"(UTC-12:00) International Date Line West",supportsDaylightSavingTime:!1},{id:"UTC-11",offset:-660,offsetHours:-11,displayName:"(UTC-11:00) Coordinated Universal Time-11",supportsDaylightSavingTime:!1},{id:"Hawaiteratoran Standard Time",offset:-600,offsetHours:-10,displayName:"(UTC-10:00) Hawaiterator",supportsDaylightSavingTime:!1},{id:"Alaskan Standard Time",offset:-540,offsetHours:-9,displayName:"(UTC-09:00) Alaska",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time (Mexico)",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Baja California",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Pacific Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Arizona",supportsDaylightSavingTime:!1},{id:"Mountain Standard Time (Mexico)",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",supportsDaylightSavingTime:!0},{id:"Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Mountain Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central America Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central America",supportsDaylightSavingTime:!1},{id:"Canada Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Saskatchewan",supportsDaylightSavingTime:!1},{id:"Central Standard Time (Mexico)",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",supportsDaylightSavingTime:!0},{id:"SA Pacific Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Bogota, Lima, Quito, Rio Branco",supportsDaylightSavingTime:!1},{id:"Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Eastern Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Indiana (East)",supportsDaylightSavingTime:!0},{id:"Venezuela Standard Time",offset:-270,offsetHours:-4.5,displayName:"(UTC-04:30) Caracas",supportsDaylightSavingTime:!1},{id:"Atlantic Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Atlantic Time (Canada)",supportsDaylightSavingTime:!0},{id:"Paraguay Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Asuncion",supportsDaylightSavingTime:!0},{id:"Central Brazilian Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Cuiaba",supportsDaylightSavingTime:!0},{id:"Pacific SA Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Santiago",supportsDaylightSavingTime:!0},{id:"SA Western Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",supportsDaylightSavingTime:!1},{id:"Newfoundland Standard Time",offset:-210,offsetHours:-3.5,displayName:"(UTC-03:30) Newfoundland",supportsDaylightSavingTime:!0},{id:"SA Eastern Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Cayenne, Fortaleza",supportsDaylightSavingTime:!1},{id:"Argentina Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Buenos Aires",supportsDaylightSavingTime:!0},{id:"E. South America Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Brasilia",supportsDaylightSavingTime:!0},{id:"Bahia Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Salvador",supportsDaylightSavingTime:!0},{id:"Montevideo Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Montevideo",supportsDaylightSavingTime:!0},{id:"Greenland Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Greenland",supportsDaylightSavingTime:!0},{id:"UTC-02",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Coordinated Universal Time-02",supportsDaylightSavingTime:!1},{id:"Mid-Atlantic Standard Time",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Mid-Atlantic - Old",supportsDaylightSavingTime:!0},{id:"Azores Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Azores",supportsDaylightSavingTime:!0},{id:"Cape Verde Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Cape Verde Is.",supportsDaylightSavingTime:!1},{id:"Morocco Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Casablanca",supportsDaylightSavingTime:!0},{id:"UTC",offset:0,offsetHours:0,displayName:"(UTC) Coordinated Universal Time",supportsDaylightSavingTime:!1},{id:"GMT Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Dublin, Edinburgh, Lisbon, London",supportsDaylightSavingTime:!0},{id:"Greenwich Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Monrovia, Reykjavik",supportsDaylightSavingTime:!1},{id:"Central European Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",supportsDaylightSavingTime:!0},{id:"Namibia Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Windhoek",supportsDaylightSavingTime:!0},{id:"W. Central Africa Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) West Central Africa",supportsDaylightSavingTime:!1},{id:"W. Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",supportsDaylightSavingTime:!0},{id:"Central Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",supportsDaylightSavingTime:!0},{id:"Romance Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",supportsDaylightSavingTime:!0},{id:"FLE Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",supportsDaylightSavingTime:!0},{id:"South Africa Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Harare, Pretoria",supportsDaylightSavingTime:!1},{id:"Turkey Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Istanbul",supportsDaylightSavingTime:!0},{id:"GTB Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Athens, Bucharest",supportsDaylightSavingTime:!0},{id:"Libya Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Tripoli",supportsDaylightSavingTime:!0},{id:"E. Europe Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) E. Europe",supportsDaylightSavingTime:!0},{id:"Jordan Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Amman",supportsDaylightSavingTime:!0},{id:"Middle East Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Beirut",supportsDaylightSavingTime:!0},{id:"Egypt Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Cairo",supportsDaylightSavingTime:!0},{id:"Syria Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Damascus",supportsDaylightSavingTime:!0},{id:"Israel Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Jerusalem",supportsDaylightSavingTime:!0},{id:"Arab Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kuwait, Riyadh",supportsDaylightSavingTime:!1},{id:"E. Africa Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Nairobi",supportsDaylightSavingTime:!1},{id:"Arabic Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Baghdad",supportsDaylightSavingTime:!0},{id:"Kaliningrad Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kaliningrad, Minsk",supportsDaylightSavingTime:!0},{id:"Iran Standard Time",offset:210,offsetHours:3.5,displayName:"(UTC+03:30) Tehran",supportsDaylightSavingTime:!0},{id:"Mauritius Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Port Louis",supportsDaylightSavingTime:!0},{id:"Georgian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Tbilisi",supportsDaylightSavingTime:!1},{id:"Caucasus Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Yerevan",supportsDaylightSavingTime:!0},{id:"Arabian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Abu Dhabi, Muscat",supportsDaylightSavingTime:!1},{id:"Azerbaijan Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Baku",supportsDaylightSavingTime:!0},{id:"Russian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Moscow, St. Petersburg, Volgograd",supportsDaylightSavingTime:!0},{id:"Afghanistan Standard Time",offset:270,offsetHours:4.5,displayName:"(UTC+04:30) Kabul",supportsDaylightSavingTime:!1},{id:"Pakistan Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Islamabad, Karachi",supportsDaylightSavingTime:!0},{id:"West Asia Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Ashgabat, Tashkent",supportsDaylightSavingTime:!1},{id:"India Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",supportsDaylightSavingTime:!1},{id:"Sri Lanka Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Sri Jayawardenepura",supportsDaylightSavingTime:!1},{id:"Nepal Standard Time",offset:345,offsetHours:5.75,displayName:"(UTC+05:45) Kathmandu",supportsDaylightSavingTime:!1},{id:"Central Asia Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Astana",supportsDaylightSavingTime:!1},{id:"Bangladesh Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Dhaka",supportsDaylightSavingTime:!0},{id:"Ekaterinburg Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Ekaterinburg",supportsDaylightSavingTime:!0},{id:"Myanmar Standard Time",offset:390,offsetHours:6.5,displayName:"(UTC+06:30) Yangon (Rangoon)",supportsDaylightSavingTime:!1},{id:"SE Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Bangkok, Hanoi, Jakarta",supportsDaylightSavingTime:!1},{id:"N. Central Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Novosibirsk",supportsDaylightSavingTime:!0},{id:"Ulaanbaatar Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Ulaanbaatar",supportsDaylightSavingTime:!1},{id:"China Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",supportsDaylightSavingTime:!1},{id:"Singapore Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Kuala Lumpur, Singapore",supportsDaylightSavingTime:!1},{id:"North Asia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Krasnoyarsk",supportsDaylightSavingTime:!0},{id:"Taipei Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Taipei",supportsDaylightSavingTime:!1},{id:"W. Australia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Perth",supportsDaylightSavingTime:!0},{id:"Korea Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Seoul",supportsDaylightSavingTime:!1},{id:"North Asia East Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Irkutsk",supportsDaylightSavingTime:!0},{id:"Tokyo Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Osaka, Sapporo, Tokyo",supportsDaylightSavingTime:!1},{id:"AUS Central Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Darwin",supportsDaylightSavingTime:!1},{id:"Cen. Australia Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Adelaide",supportsDaylightSavingTime:!0},{id:"West Pacific Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Guam, Port Moresby",supportsDaylightSavingTime:!1},{id:"Tasmania Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Hobart",supportsDaylightSavingTime:!0},{id:"E. Australia Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Brisbane",supportsDaylightSavingTime:!1},{id:"AUS Eastern Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Canberra, Melbourne, Sydney",supportsDaylightSavingTime:!0},{id:"Yakutsk Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Yakutsk",supportsDaylightSavingTime:!0},{id:"Vladivostok Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Vladivostok",supportsDaylightSavingTime:!0},{id:"Central Pacific Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Solomon Is., New Caledonia",supportsDaylightSavingTime:!1},{id:"Magadan Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Magadan",supportsDaylightSavingTime:!0},{id:"Kamchatka Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",supportsDaylightSavingTime:!0},{id:"Fiji Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Fiji",supportsDaylightSavingTime:!0},{id:"New Zealand Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Auckland, Wellington",supportsDaylightSavingTime:!0},{id:"UTC+12",offset:720,offsetHours:12,displayName:"(UTC+12:00) Coordinated Universal Time+12",supportsDaylightSavingTime:!1},{id:"Tonga Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Nuku'alofa",supportsDaylightSavingTime:!1},{id:"Samoa Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Samoa",supportsDaylightSavingTime:!0}],a=[0,31,59,90,120,151,181,212,243,273,304,334,365],s=[0,31,60,91,121,152,182,213,244,274,305,335,366];Smart.Utilities.Assign("TimeSpan",class{constructor(){const e=this;if(e.ticksPerMillisecond=1e4,e.millisecondsPerTick=1e-4,e.ticksPerSecond=1e7,e.secondsPerTick=1e-7,e.ticksPerMinute=6e8,e.minutesPerTick=1/6e8,e.ticksPerHour=36e9,e.hoursPerTick=1/36e9,e.ticksPerDay=864e9,e.daysPerTick=1/864e9,e.millisPerSecond=1e3,e.millisPerMinute=6e4,e.millisPerHour=36e5,e.millisPerDay=864e5,e._ticks=0,1===arguments.length){if(isNaN(arguments[0]))throw new Error("Argument must be a number.");e._ticks=arguments[0]}else if(3===arguments.length)e._ticks=e.timeToMS(arguments[0],arguments[1],arguments[2],0);else if(4===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+0;e._ticks=t*e.ticksPerMillisecond}else if(5===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+arguments[4];e._ticks=t*e.ticksPerMillisecond}}ticks(){return this._ticks}days(){return parseInt(this._ticks/this.ticksPerDay)}timeToMS(e,t,a,s){return parseInt((3600*e+60*t+a+s/1e3)*this.ticksPerSecond)}hours(){return parseInt(this._ticks/this.ticksPerHour)%24}milliseconds(){return parseInt(this._ticks/this.ticksPerMillisecond)%1e3}minutes(){return parseInt(this._ticks/this.ticksPerMinute)%60}seconds(){return parseInt(this._ticks/this.ticksPerSecond)%60}totalDays(){return parseInt(this._ticks*this.daysPerTick)}totalHours(){return parseInt(this._ticks*this.hoursPerTick)}totalMilliseconds(){const e=this._ticks*this.millisecondsPerTick;return parseInt(e)}totalMinutes(){return parseInt(this._ticks*this.minutesPerTick)}totalSeconds(){return parseInt(this._ticks*this.secondsPerTick)}add(e){const t=this._ticks+e._ticks;return new Smart.Utilities.TimeSpan(t)}subtract(e){const t=this._ticks-e._ticks;return new Smart.Utilities.TimeSpan(t)}duration(){const e=this;return e._ticks>=0?new Smart.Utilities.TimeSpan(e._ticks):new Smart.Utilities.TimeSpan(-e._ticks)}equals(e){return this._ticks===e._ticks}valueOf(){return this._ticks}compare(e,t){return e._ticks>t._ticks?1:e._ticks<t._ticks?-1:0}interval(e,t){const a=e*t+(e>=0?.5:-.5);return new Smart.Utilities.TimeSpan(a*this.ticksPerMillisecond)}fromDays(e){return this.interval(e,this.millisPerDay)}fromHours(e){return this.interval(e,this.millisPerHour)}fromMilliseconds(e){return this.interval(e,1)}fromMinutes(e){return this.interval(e,this.millisPerMinute)}fromSeconds(e){return this.interval(e,this.millisPerSecond)}fromTicks(e){return new Smart.Utilities.TimeSpan(e)}toString(){return this.totalMilliseconds().toString()}negate(){return new Smart.Utilities.TimeSpan(-this._ticks)}}),Smart.Utilities.Assign("DateTime",class{constructor(){function e(e){const t=i.regexISOString.exec(e);n=new Smart.Utilities.DateTime(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),0,0,0,0,0,0,0,"UTC")}const i=this;let n;if(i.ticksPerMillisecond=1e4,i.millisecondsPerTick=1e-4,i.ticksPerSecond=1e7,i.secondsPerTick=1e-7,i.ticksPerMinute=6e8,i.minutesPerTick=1/6e8,i.ticksPerHour=36e9,i.hoursPerTick=1/36e9,i.ticksPerDay=864e9,i.daysPerTick=1/864e9,i.millisPerSecond=1e3,i.millisPerMinute=6e4,i.millisPerHour=36e5,i.millisPerDay=864e5,i.daysPerYear=365,i.daysPer4Years=1461,i.daysPer100Years=36524,i.daysPer400Years=146097,i.daysTo1601=584388,i.daysTo1899=693593,i.daysTo10000=3652059,i.minTicks=0,i.maxTicks=3155378976e9,i.maxMillis=3155378976e5,i.datePartYear=0,i.datePartDayOfYear=1,i.datePartMonth=2,i.datePartDay=3,i.daysToMonth365=a,i.daysToMonth366=s,i.minValue=new Date(0),i.maxValue=new Date(3155378976e9),i.ticksMask=0x4000000000000000,i.flagsMask=0xc000000000000000,i.localMask=0x8000000000000000,i.ticksCeiling=0x4000000000000000,i.kindUnspecified=0,i.kindUtc=0x4000000000000000,i.kindLocal=0x8000000000000000,i.kindLocalAmbiguousDst=0xc000000000000000,i.kindShift=62,i.regexTrim=/^\s+|\s+$/g,i.regexInfinity=/^[+-]?infinity$/i,i.regexHex=/^0x[a-f0-9]+$/i,i.regexParseFloat=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/,i.regexISOString=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/,i.calendar={"/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",FP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",FPA:"yyyy/MM/dd HH:mm:ss:fffuunnppeeaaxxoo",FPA2:"yyyy-MM-dd HH:mm:ss:fffuunnppeeaaxxoo",FT:"HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",PP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp",PT:"HH:mm:ss:fff:uu:nn:pp"},percentsymbol:"%",currencysymbol:"$",currencysymbolposition:"before",decimalseparator:".",thousandsseparator:","},i.dateData=0,i.timeZone=null,i.timeZones=t,i._codeToUnit={u:"_microsecond",uu:"_microsecond",n:"_nanosecond",nn:"_nanosecond",p:"_picosecond",pp:"_picosecond",e:"_femtosecond",ee:"_femtosecond",a:"_attosecond",aa:"_attosecond",x:"_zeptosecond",xx:"_zeptosecond",o:"_yoctosecond",oo:"_yoctosecond"},i._smallUnits=["_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"],i._microsecond=0,i._nanosecond=0,i._picosecond=0,i._femtosecond=0,i._attosecond=0,i._zeptosecond=0,i._yoctosecond=0,0===arguments.length){const e=new Date;i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else if(1===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}}else if(2===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}i.validateTimeZone(arguments[1])}else if(arguments.length>2)if("string"==typeof arguments[0]){const e=i.tryparseDate(arguments[0],arguments[2],arguments[1]);i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else{const e=arguments[0],t=arguments[7]||0,a=arguments[8]||0,s=arguments[9]||0,n=arguments[10]||0,r=arguments[11]||0,o=arguments[12]||0,d=arguments[13]||0,l=new Date(e,arguments[1]-1,arguments[2],arguments[3]||0,arguments[4]||0,arguments[5]||0,arguments[6]||0);e<1970&&l.setFullYear(e),i.dateData=i.dateToMS(l.getFullYear(),l.getMonth()+1,l.getDate())+i.timeToMS(l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()),i._microsecond=t,i._nanosecond=a,i._picosecond=s,i._femtosecond=n,i._attosecond=r,i._zeptosecond=o,i._yoctosecond=d,arguments[14]&&i.validateTimeZone(arguments[14])}if(i.timeZone||i.validateTimeZone("Local"),n){const e=n.toTimeZone(i.timeZone);i.dateData=e.dateData}}static validateDate(e,t,a){if(e instanceof Smart.Utilities.DateTime)return e;if(e instanceof Date)return new Smart.Utilities.DateTime(e);try{if(new RegExp(/^\d{1,2}\/\d{1,2}\/\d{4}(, \d{1,2}:\d{2}:\d{1,2} [A|P]M)?$/).test(e)){const t=new Date(e);if(!isNaN(t.getTime()))return new Smart.Utilities.DateTime(t)}if("string"==typeof e)return this.parseDateString(e,t,a);if("number"==typeof e)return new Smart.Utilities.DateTime(new Date(e))}catch(e){}return t}static parseDateString(e,t,a){const s=new Date(e);if(!isNaN(s.getTime()))return new Smart.Utilities.DateTime(s);const i=e.indexOf("Date("),n=e.indexOf("DateTime("),r=e.lastIndexOf(")");let o=e;if(-1===i&&-1===n||-1===r){const t=new Smart.Utilities.DateTime,s=t.parseDate(e,a);if(s)return o=new Smart.Utilities.DateTime(s),t.copySmallTimePartValues(o),o}else{if(o=-1!==i?e.slice(i+5,r):e.slice(n+9,r),o=o.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),""===o.trim())return new Smart.Utilities.DateTime;if(new RegExp(/(^(\d+)(\s*,\s*\d+)+(\s*,\s*[a-zA-Z ]+)?$)/g).test(o))return o=o.split(","),o.map((function(e,t){isNaN(o[t])?o[t]=e.trim():o[t]=parseInt(e)})),-1!==i&&o[1]++,o.unshift(null),o=new(Function.prototype.bind.apply(Smart.Utilities.DateTime,o)),o}if(""===o.trim())return t;if(!isNaN(o))return o=new Date(parseInt(o,10)),new Smart.Utilities.DateTime(o);try{const e=o.split(",");2===e.length?(e[1]=e[1].trim(),e.unshift(null),o=new(Function.prototype.bind.apply(Smart.Utilities.DateTime,e))):o=new Smart.Utilities.DateTime(o)}catch(e){o=t}return o}static fromFullTimeStamp(e){e=e.toString();const t=new Smart.Utilities.DateTime(parseFloat(e.slice(0,e.length-21)));let a=e.slice(e.length-21),s=0;for(;a.length>0;)t[t._smallUnits[s]]=parseInt(a.slice(0,3),10),a=a.slice(3),s++;return t}static getConstructorParameters(e){return[e.year(),e.month(),e.day(),e.hour(),e.minute(),e.second(),e.millisecond(),e._microsecond,e._nanosecond,e._picosecond,e._femtosecond,e._attosecond,e._zeptosecond,e._yoctosecond,e.timeZone]}static detectDisplayMode(e,t,a){if(e.calendar.patterns[t])return-1!==["d","D","M","Y","d1","d2"].indexOf(t)?"calendar":-1!==["t","T","FT","PT"].indexOf(t)?"timePicker":"default";const s=["d","M","y"],i=["h","H","m","s","t","f","u","n","p","e","a","x","o"],n=a.groups;let r=!1,o=!1;for(let e=0;e<n.length;e++){const t=n[e].charAt(0);if(-1!==s.indexOf(t)?r=!0:-1!==i.indexOf(t)&&(o=!0),r&&o)break}return r===o?"default":r?"calendar":"timePicker"}static getLocalizedNames(e){const t={names:[],namesAbbr:[],namesShort:[]},a={names:[],namesAbbr:[]};if(this[e])return this[e];for(let a=23;a<30;a++){const s=new Date(2017,6,a),i=s.toLocaleString(e,{weekday:"long"});t.names.push(i),t.namesAbbr.push(s.toLocaleString(e,{weekday:"short"})),t.namesShort.push(i.substring(0,2))}for(let t=0;t<12;t++){const s=new Date(2017,t,1).toLocaleString(e,{month:"long"});a.names.push(s),a.namesAbbr.push(s.substring(0,3))}return a.names.push(""),a.namesAbbr.push(""),this[e]={days:t,months:a},this[e]}internalMS(){return this.dateData}getDatePart(e){const t=this,a=t.internalMS();let s=parseInt(a/t.millisPerDay);const i=parseInt(s/t.daysPer400Years);s-=i*t.daysPer400Years;let n=parseInt(s/t.daysPer100Years);4===n&&(n=3),s-=n*t.daysPer100Years;const r=parseInt(s/t.daysPer4Years);s-=r*t.daysPer4Years;let o=parseInt(s/t.daysPerYear);if(4===o&&(o=3),e===t.datePartYear)return parseInt(400*i+100*n+4*r+o+1);if(s-=o*t.daysPerYear,e===t.datePartDayOfYear)return parseInt(s+1);const d=3===o&&(24!==r||3===n)?t.daysToMonth366:t.daysToMonth365;let l=s>>6;for(;s>=d[l];)l++;return e===t.datePartMonth?parseInt(l):parseInt(s-d[l-1]+1)}dayOfWeek(){const e=this.dateData;return parseInt(e/this.millisPerDay+1)%7}dayOfYear(){return this.getDatePart(this.datePartDayOfYear)}weekOfYear(e){const t=this.toDate(),a=e||this.calendar.firstDay,s=new Date(t.getFullYear(),0,1),i=Math.floor((t.getTime()-s.getTime()-6e4*(t.getTimezoneOffset()-s.getTimezoneOffset()))/864e5)+1;let n,r=s.getDay()-a;if(r=r>=0?r:r+7,r<4){if(n=Math.floor((i+r-1)/7)+1,n>52){let e=new Date(t.getFullYear()+1,0,1).getDay()-a;e=e>=0?e:e+7,n=e<4?1:53}}else n=Math.floor((i+r-1)/7);return n}subtract(e){const t=this;return new Smart.Utilities.TimeSpan(t.dateData*t.ticksPerMillisecond-e.dateData*t.ticksPerMillisecond)}dateToMS(e,t,a){const s=this;if(e>=1&&e<=9999&&t>=1&&t<=12){e=parseInt(e);const i=s.isLeapYear(e)?s.daysToMonth366:s.daysToMonth365;if(a>=1&&a<=i[t]-i[t-1]){const n=e-1;return(365*n+parseInt(n/4)-parseInt(n/100)+parseInt(n/400)+i[t-1]+a-1)*s.millisPerDay}}}isLeapYear(e){if(e<1||e>9999)throw new Error("Year out of Range");return e%4==0&&(e%100!=0||e%400==0)}timeToMS(e,t,a,s){const i=this;if(e>=0&&e<24&&t>=0&&t<60&&a>=0&&a<60){const n=parseInt(3600*e+60*t+a);return s>0&&s<1e3?n*i.millisPerSecond+s:n*i.millisPerSecond}}daysInMonth(e,t){if(t<1||t>12)throw new Error("Month out of Range");const a=this,s=a.isLeapYear(e)?a.daysToMonth366:a.daysToMonth365;return s[t]-s[t-1]}arrayIndexOf(e,t){return e.indexOf(t)}startsWith(e,t){return 0===e.indexOf(t)}endsWith(e,t){return e.substr(e.length-t.length)===t}trim(e){return(e+"").replace(this.regexTrim,"")}expandFormat(e,t){t=t||"F";let a,s=e.patterns,i=t.length;if(s[t])return s[t];if(1===i){if(a=s[t],!a)throw"Invalid date format string '"+t+"'.";t=a}else 2===i&&"%"===t.charAt(0)&&(t=t.charAt(1));return t}getEra(e,t){if(!t)return 0;if("string"==typeof e)return 0;let a,s=e.getTime();for(let e=0,i=t.length;e<i;e++)if(a=t[e].start,null===a||s>=a)return e;return 0}toUpper(e){return e.split(" ").join(" ").toUpperCase()}toUpperArray(e){const t=[];for(let a=0,s=e.length;a<s;a++)t[a]=this.toUpper(e[a]);return t}getEraYear(e,t,a,s){let i=e.getFullYear();return!s&&t.eras&&(i-=t.eras[a].offset),i}getDayIndex(e,t,a){const s=this,i=e.days;let n,r=e._upperDays;return r||(e._upperDays=r=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr),s.toUpperArray(i.namesShort)]),t=t.toUpperCase(),a?(n=s.arrayIndexOf(r[1],t),-1===n&&(n=s.arrayIndexOf(r[2],t))):n=s.arrayIndexOf(r[0],t),n}getMonthIndex(e,t,a){const s=this;let i=e.months,n=e.monthsGenitive||e.months,r=e._upperMonths,o=e._upperMonthsGen;r||(e._upperMonths=r=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr)],e._upperMonthsGen=o=[s.toUpperArray(n.names),s.toUpperArray(n.namesAbbr)]),t=s.toUpper(t);let d=s.arrayIndexOf(a?r[1]:r[0],t);return d<0&&(d=s.arrayIndexOf(a?o[1]:o[0],t)),d}appendPreOrPostMatch(e,t){let a=0,s=!1;for(let i=0,n=e.length;i<n;i++){const n=e.charAt(i);switch(n){case"'":s?t.push("'"):a++,s=!1;break;case"\\":s&&t.push("\\"),s=!s;break;default:t.push(n),s=!1}}return a}getTokenRegExp(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyyy|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|uu|u|nn|n|pp|p|ee|e|aa|a|xx|x|oo|o|i{1,24}|zzz|zz|z|gg|g/g}tryparseDate(e,t,a){const s=this;if(null==t&&(t=s.calendar),void 0!==a){if(Array.isArray(a))for(let i=0;i<a.length;i++){const n=s.parseDate(e,a[i],t);if(n)return n}const i=s.parseDate(e,a,t);if(i)return i}if(""===e)return null;if(null==e||e.substring||(e=e.toString()),null!=e&&"/Date("===e.substring(0,6)){const t=/^\/Date\((-?\d+)(\+|-)?(\d+)?\)\/$/;let a=new Date(+e.replace(/\/Date\((\d+)\)\//,"$1"));if("Invalid Date"===a){const t=e.match(/^\/Date\((\d+)([-+]\d\d)(\d\d)\)\/$/);a=null,t&&(a=new Date(1*t[1]+36e5*t[2]+6e4*t[3]))}if(null==a||"Invalid Date"===a||isNaN(a)){const a=t.exec(e);if(a){const e=new Date(parseInt(a[1]));if(a[2]){let t=parseInt(a[3]);"-"===a[2]&&(t=-t);const s=e.getUTCMinutes();e.setUTCMinutes(s-t)}if(!isNaN(e.valueOf()))return e}}return a}const i={smartdate:"yyyy-MM-dd HH:mm:ss",d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",d3:"MM-dd-yyyy",d4:"MM.dd.yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",iso:"yyyy-MM-ddTHH:mm:ssZ",iso_date1:"yyyy-MM-dd",iso_date2:"yyyy-MM-dd",iso_date3:"yyyy-ddd",iso_date4:"yyyy-MM-dd HH:mm",iso_date5:"yyyy-MM-dd HH:mm Z",iso_date6:"yyyy-MMM-dd",iso_date7:"yyyy-MM",iso_date8:"yyyy-MMM",iso_date9:"yyyy-MMMM",iso_date10:"yyyy-MMMM-dd",iso_time1:"HH:mm:ss.tttt",iso_time2:"HH:mm:ss",iso_time3:"HH:mm",iso_time4:"HH",iso_time5:"yyyyyy-MM-dd",iso_time6:"yyyyyy-MM-dd"};for(let a in i){const n=s.parseDate(e,i[a],t);if(n)return n}const n=t.patterns;for(let a in n){const i=s.parseDate(e,n[a],t);if(i){if("ISO"===a){const a=s.parseDate(e,n.ISO2,t);if(a)return a}return i}}let r;if("string"==typeof e){const a=[":","/","-"," ",","];let i="",n=e=function(e,t,a){return a.replace(new RegExp(e,"g"),t)}(", ",",",e=s.trim(e));e.indexOf(":")>=0?(i=e.substring(e.indexOf(":")-2),i=s.trim(i),n=e.substring(0,e.indexOf(":")-2)):e.toUpperCase().indexOf("AM")>=0?(i=e.substring(e.toUpperCase().indexOf("AM")-2),i=s.trim(i),n=e.substring(0,e.toUpperCase().indexOf("AM")-2)):e.toUpperCase().indexOf("PM")>=0&&(i=e.substring(e.toUpperCase().indexOf("PM")-2),i=s.trim(i),n=e.substring(0,e.toUpperCase().indexOf("PM")-2));let o=new Date,d=!1;if(n){for(let e=0;e<a.length;e++)if(n.indexOf(a[e])>=0){r=n.split(a[e]);break}if(!r)return null;let e=new Array,i=new Array,l=new Array,f=null,m=null;for(let a=0;a<r.length;a++){const i=r[a],n=s.parseDate(i,"d",t)||s.parseDate(i,"dd",t)||s.parseDate(i,"ddd",t)||s.parseDate(i,"dddd",t);if(n&&(e.push(n.getDate()),i.length>2)){f=a;break}}for(let e=0;e<r.length;e++){const a=r[e],n=s.parseDate(a,"M",t)||s.parseDate(a,"MM",t)||s.parseDate(a,"MMM",t)||s.parseDate(a,"MMMM",t);if(n){if(null!=f&&f===e)continue;if(i.push(n.getMonth()),a.length>2){m=e;break}}}for(let e=0;e<r.length;e++){const a=r[e],i=s.parseDate(a,"yyyy",t);if(i){if(null!=f&&f===e)continue;if(null!=m&&m===e)continue;l.push(i.getFullYear())}}const c=new Array;for(let t=e.length-1;t>=0;t--)for(let a=0;a<i.length;a++)for(let s=0;s<l.length;s++){const n=new Date(l[s],i[a],e[t]);l[s]<1970&&n.setFullYear(l[s]),isNaN(n.getTime())||c.push(n)}c.length>0&&(o=c[0],d=!0)}if(i){const e=i.indexOf(":")>=0?i.split(":"):i,a=s.parseDate(i,"h:mm tt",t)||s.parseDate(i,"HH:mm:ss.fff",t)||s.parseDate(i,"HH:mm:ss.ff",t)||s.parseDate(i,"h:mm:ss tt",t)||s.parseDate(i,"HH:mm:ss.tttt",t)||s.parseDate(i,"HH:mm:ss",t)||s.parseDate(i,"HH:mm",t)||s.parseDate(i,"HH",t);let n=0,r=0,l=0,f=0;a&&!isNaN(a.getTime())?(n=a.getHours(),r=a.getMinutes(),l=a.getSeconds(),f=a.getMilliseconds()):(1===e.length&&(n=parseInt(e[0])),2===e.length&&(n=parseInt(e[0]),r=parseInt(e[1])),3===e.length&&(n=parseInt(e[0]),r=parseInt(e[1]),e[2].indexOf(".")>=0?(l=parseInt(e[2].toString().split(".")[0]),f=parseInt(e[2].toString().split(".")[1])):l=parseInt(e[2])),4===e.length&&(n=parseInt(e[0]),r=parseInt(e[1]),l=parseInt(e[2]),f=parseInt(e[3]))),!o||isNaN(n)||isNaN(r)||isNaN(l)||isNaN(f)||(o.setHours(n,r,l,f),d=!0)}if(d)return o}if(null!=e){r=[":","/","-"];let t=!0;for(let a=0;a<r.length;a++)-1!==e.indexOf(r[a])&&(t=!1);if(t){const t=new Number(e);if(!isNaN(t))return new Date(t)}}return null}getParseRegExp(e,t){const a=this;let s=e._parseRegExp;if(s){const e=s[t];if(e)return e}else e._parseRegExp=s={};let i,n=a.expandFormat(e,t).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),r=["^"],o=[],d=0,l=0,f=a.getTokenRegExp();for(;null!==(i=f.exec(n));){const e=n.slice(d,i.index);if(d=f.lastIndex,l+=a.appendPreOrPostMatch(e,r),l%2){r.push(i[0]);continue}let t,s=i[0],m=s.length;switch(s){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":t="(\\D+)";break;case"tt":case"t":t="(\\D*)";break;case"yyyyy":t="(\\d{1,4})";break;case"yyyy":t="(\\d{"+m+"})";break;case"fff":case"ff":case"f":t="(\\d{1,"+m+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":t="(\\d\\d?)";break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":t="(\\d{1,3})";break;case"zzz":t="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":t="([+-]?\\d\\d?)";break;case"/":t="/";break;default:if(!/i{1,24}/.test(s))throw"Invalid date format pattern '"+s+"'.";t="(\\d{"+s.length+"})"}t&&r.push(t),"/"!==s&&o.push(i[0])}a.appendPreOrPostMatch(n.slice(d),r),r.push("$");const m={regExp:r.join("").replace(/\s+/g,"\\s+"),groups:o};return s[t]=m}outOfRange(e,t,a){return e<t||e>a}expandYear(e,t){const a=this,s=new Date,i=a.getEra(s);if(t<100){let n=e.twoDigitYearMax;n="string"==typeof n?(new Date).getFullYear()%100+parseInt(n,10):n;const r=a.getEraYear(s,e,i);(t+=r-r%100)>n&&(t-=100)}return t}padZeros(e,t){let a,s=e+"";return t>1&&s.length<t?(a=["0","00","000"][t-2]+s,a.substr(a.length-t,t)):(a=s,a)}parseDate(e,t,a){const s=this;null==a&&(a=s.calendar),e=s.trim(e);const i=a,n=s.getParseRegExp(i,t),r=new RegExp(n.regExp).exec(e);if(null===r)return null;let o,d=n.groups,l=null,f=null,m=null,c=null,u=null,p=0,y=0,g=0,h=0,T=null,S=!1;for(let e=0,t=d.length;e<t;e++){const t=r[e+1];if(t){const a=d[e],n=a.length,r=parseInt(t,10);switch(a){case"dd":case"d":if(c=r,s.outOfRange(c,1,31))return null;break;case"MMM":case"MMMM":case"MMMMM":case"MMMMMM":case"MMMMMMM":case"MMMMMMMM":if(m=s.getMonthIndex(i,t,3===n),s.outOfRange(m,0,11))return null;break;case"M":case"MM":if(m=r-1,s.outOfRange(m,0,11))return null;break;case"y":case"yy":case"yyyy":if(f=n<4?s.expandYear(i,r):r,s.outOfRange(f,0,9999))return null;break;case"h":case"hh":if(p=r,12===p&&(p=0),s.outOfRange(p,0,11))return null;break;case"H":case"HH":if(p=r,s.outOfRange(p,0,23))return null;break;case"m":case"mm":if(y=r,s.outOfRange(y,0,59))return null;break;case"s":case"ss":if(g=r,s.outOfRange(g,0,59))return null;break;case"tt":case"t":if(S=i.PM&&(t===i.PM[0]||t===i.PM[1]||t===i.PM[2]),!S&&(!i.AM||t!==i.AM[0]&&t!==i.AM[1]&&t!==i.AM[2]))return null;break;case"f":case"ff":case"fff":if(h=r*Math.pow(10,3-n),s.outOfRange(h,0,999))return null;break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":if(s.outOfRange(r,0,1e3))return null;s[s._codeToUnit[a]]=r;break;case"ddd":case"dddd":if(u=s.getDayIndex(i,t,3===n),s.outOfRange(u,0,6))return null;break;case"zzz":{const e=t.split(/:/);if(2!==e.length)return null;if(o=parseInt(e[0],10),s.outOfRange(o,-12,13))return null;const a=parseInt(e[1],10);if(s.outOfRange(a,0,59))return null;T=60*o+(s.startsWith(t,"-")?-a:a);break}case"z":case"zz":if(o=r,s.outOfRange(o,-12,13))return null;T=60*o;break;case"g":case"gg":{let e=t;if(!e||!i.eras)return null;e=this.trim(e.toLowerCase());for(let t=0,a=i.eras.length;t<a;t++)if(e===i.eras[t].nathat.toLowerCase()){l=t;break}if(null===l)return null;break}default:{let e=t;e.length%3==1?e+="00":e.length%3==2&&(e+="0"),h=parseInt(e.slice(0,3),10),e=e.slice(3);let a=0;for(;e.length>0;)s[s._smallUnits[a]]=parseInt(e.slice(0,3),10),e=e.slice(3),a++}}}}let M,D=new Date,H=i.convert;if(M=D.getFullYear(),null===f?f=M:i.eras&&(f+=i.eras[l||0].offset),null===m&&(m=0),null===c&&(c=1),H){if(D=H.toGregorian(f,m,c),null===D)return null}else{if(D.setFullYear(f,m,c),D.getDate()!==c)return null;if(null!==u&&D.getDay()!==u)return null}if(S&&p<12&&(p+=12),D.setHours(p,y,g,h),null!==T){const e=D.getMinutes()-(T+D.getTimezoneOffset());D.setHours(D.getHours()+parseInt(e/60,10),e%60)}return D}toString(e,t){const a=this;void 0===e&&(e="yyyy-MM-dd HH:mm:ss");const s=a.dateData.toString()+a.getFractionsOfSecondStamp()+e+(a.timeZone||"");if(Smart.Utilities.DateTime.cache&&Smart.Utilities.DateTime.cache[s])return Smart.Utilities.DateTime.cache[s];const i=a.toDate();if(null==t&&(t=a.calendar),"string"==typeof i)return i;if(!e||!e.length||"i"===e){let e;return e=a.formatDate(i,t.patterns.F,t),e}const n=t.eras,r="s"===e;e=a.expandFormat(t,e);const o=[];let d,l=0,f=a.getTokenRegExp();function m(e,t){if(void 0!==e.getMonth)switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate()}}for(;;){const s=f.lastIndex,c=f.exec(e),u=e.slice(s,c?c.index:e.length);if(l+=a.appendPreOrPostMatch(u,o),!c)break;if(l%2){o.push(c[0]);continue}const p=c[0],y=p.length;let g;if(/i{1,24}/.test(p))o.push(a.getFirstNDigitsOfPrecision(p.length));else switch(p){case"ddd":case"dddd":{const e=3===y?t.days.namesAbbr:t.days.names;o.push(e[i.getDay()]);break}case"d":case"dd":o.push(a.padZeros(m(i,2),y));break;case"MMM":case"MMMM":g=m(i,1),o.push(t.months[3===y?"namesAbbr":"names"][g]);break;case"M":case"MM":o.push(a.padZeros(m(i,1)+1,y));break;case"y":case"yy":case"yyyy":g=a.getEraYear(i,t,a.getEra(i,n),r),y<4&&(g%=100),o.push(a.padZeros(g,y));break;case"h":case"hh":d=i.getHours()%12,0===d&&(d=12),o.push(a.padZeros(d,y));break;case"H":case"HH":o.push(a.padZeros(i.getHours(),y));break;case"m":case"mm":o.push(a.padZeros(i.getMinutes(),y));break;case"s":case"ss":o.push(a.padZeros(i.getSeconds(),y));break;case"t":case"tt":g=i.getHours()<12?t.AM?t.AM[0]:" ":t.PM?t.PM[0]:" ",o.push(1===y?g.charAt(0):g);break;case"f":case"ff":case"fff":o.push(a.padZeros(i.getMilliseconds(),3).substr(0,y));break;case"u":case"n":case"p":case"e":case"a":case"x":case"o":o.push(a[a._codeToUnit[p]]);break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":o.push(a.padZeros(a[a._codeToUnit[p]],3));break;case"z":case"zz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),y));break;case"zzz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),2)+":"+a.padZeros(60*Math.abs(a.timeZoneOffsetHours%1),2));break;case"g":case"gg":t.eras&&o.push(t.eras[a.getEra(i,n)].name);break;case"/":o.push(t["/"]);break;default:throw"Invalid date format pattern '"+p+"'."}}let c=o.join("");return Smart.Utilities.DateTime.cache||(Smart.Utilities.DateTime.cache=new Array),a._today||(a._today=new Date),a.calendar&&a.calendar.today&&-1===e.indexOf(":")&&i.getFullYear()===a._today.getFullYear()&&i.getDate()===a._today.getDate()&&i.getMonth()===a._today.getMonth()&&(c=a.calendar.today),Smart.Utilities.DateTime.cache[s]=c,c}getFractionsOfSecondStamp(){const e=this;return e._microsecond.toString()+e._nanosecond+e._picosecond+e._femtosecond+e._attosecond+e._zeptosecond+e._yoctosecond}getFirstNDigitsOfPrecision(e,t){const a=this;return(""+(!0!==t?a.padZeros(a.millisecond(),3):"")+a.padZeros(a._microsecond,3)+a.padZeros(a._nanosecond,3)+a.padZeros(a._picosecond,3)+a.padZeros(a._femtosecond,3)+a.padZeros(a._attosecond,3)+a.padZeros(a._zeptosecond,3)+a.padZeros(a._yoctosecond,3)).slice(0,e)}copySmallTimePartValues(e){const t=this;e._microsecond=t._microsecond,e._nanosecond=t._nanosecond,e._picosecond=t._picosecond,e._femtosecond=t._femtosecond,e._attosecond=t._attosecond,e._zeptosecond=t._zeptosecond,e._yoctosecond=t._yoctosecond}add(e,t,a){const s=this,i=s.internalMS();if(void 0===t){if(!1===a)return s.dateData=i+parseInt(e._ticks/s.ticksPerMillisecond),s;const t=new Smart.Utilities.DateTime(i+parseInt(e._ticks/s.ticksPerMillisecond));return s.copyTimeZone(t),s.copySmallTimePartValues(t),t}const n=e*t;if(n<=-s.maxMillis||n>=s.maxMillis)throw new Error("Out of Range");if(!1===a)return s.dateData=i+n,s;const r=new Smart.Utilities.DateTime(i+n);return s.copyTimeZone(r),s.copySmallTimePartValues(r),r}addDays(e,t){return this.add(e,this.millisPerDay,t)}clone(){const e=this,t=new Smart.Utilities.DateTime(e.dateData);return e.copyTimeZone(t),e.copySmallTimePartValues(t),t}clearTime(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new Smart.Utilities.DateTime(a,t,s,0,0,0,0);return e.copyTimeZone(i),i}addHours(e,t){return this.add(e,this.millisPerHour,t)}addDeciseconds(e,t){return this.add(100*e,1,t)}addCentiseconds(e,t){return this.add(10*e,1,t)}addMilliseconds(e,t){return this.add(e,1,t)}addMinutes(e,t){return this.add(e,this.millisPerMinute,t)}addMonths(e,t){const a=this;if(e<-12e4||e>12e4)throw new Error("Invalid Months Value");let s=parseInt(a.getDatePart(a.datePartYear)),i=parseInt(a.getDatePart(a.datePartMonth)),n=parseInt(a.getDatePart(a.datePartDay));if(e%12==0)s+=e/12;else{const t=i-1+e;t>=0?(i=t%12+1,s+=t/12):(i=12+(t+1)%12,s+=(t-11)/12),s=parseInt(s)}if(s<1||s>9999)throw new Error("Year out of range");const r=a.daysInMonth(s,i);if(n>r&&(n=r),!1===t)return a.dateData=a.dateToMS(s,i,n)+a.internalMS()%a.millisPerDay,a;const o=new Smart.Utilities.DateTime(a.dateToMS(s,i,n)+a.internalMS()%a.millisPerDay);return a.copyTimeZone(o),a.copySmallTimePartValues(o),o}addSeconds(e,t){return this.add(e,this.millisPerSecond,t)}addYears(e,t){return this.addMonths(12*e,t)}addMicroseconds(e,t){if(0===e)return;const a=this;let s,i;e<0&&0===a.hour()&&0===a.minute()&&0===a.second()&&0===a.millisecond()&&0===a._microsecond&&(s=parseInt(e/1e3,10)-1,i=1e3+e%1e3);const n=1e3*a.timeToMS(a.hour(),a.minute(),a.second(),a.millisecond())+a._microsecond,r=n+e;let o;if(void 0===s&&(s=parseInt(r/1e3,10)-parseInt(n/1e3,10)),void 0===i&&(i=parseInt(r%1e3,10)),0!==s&&(o=a.addMilliseconds(s,t)),!1!==t)return o||(o=a.clone()),o._microsecond=i,o;a._microsecond=i}addFractionsOfSecond(e,t,a,s,i){if(0===e)return;const n=this,r=1e3*n[s]+n[a],o=e+r;let d,l=parseInt(o/1e3,10)-parseInt(r/1e3,10),f=parseInt(o%1e3,10);if(e<0&&o<0&&f<0&&(l--,f=1e3+f),0!==l&&(d=n[i](l,t)),!1!==t)return d||(d=n.clone()),d[a]=f,d;n[a]=f}addNanoseconds(e,t){return this.addFractionsOfSecond(e,t,"_nanosecond","_microsecond","addMicroseconds")}addPicoseconds(e,t){return this.addFractionsOfSecond(e,t,"_picosecond","_nanosecond","addNanoseconds")}addFemtoseconds(e,t){return this.addFractionsOfSecond(e,t,"_femtosecond","_picosecond","addPicoseconds")}addAttoseconds(e,t){return this.addFractionsOfSecond(e,t,"_attosecond","_femtosecond","addFemtoseconds")}addZeptoseconds(e,t){return this.addFractionsOfSecond(e,t,"_zeptosecond","_attosecond","addAttoseconds")}addYoctoseconds(e,t){return this.addFractionsOfSecond(e,t,"_yoctosecond","_zeptosecond","addZeptoseconds")}getTimeZoneOffset(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1),s=e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset());return{offset:-e.getTimezoneOffset()/60,dst:+s}}isInDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return this.date().getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset())}supportsDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return t.getTimezoneOffset()!==a.getTimezoneOffset()}date(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new Smart.Utilities.DateTime(a,t,s);return e.copyTimeZone(i),i}isWeekend(){return 0===this.dayOfWeek()||6===this.dayOfWeek()}toDate(e){const t=this,a=t.month(),s=t.year(),i=t.day(),n=t.hour(),r=t.minute(),o=t.second(),d=t.millisecond();let l=new Date(s,a-1,i);if(s<1970&&l.setFullYear(s),l.setHours(n,r,o,d),e){const a=t.timeZones.filter((function(t){return t.id===e}));if(a.length){let e=a[0].offset;const s=l.getTime();let i=60*l.getTimezoneOffset()*1e3;if(t.timeZone){const e=t.timeZones.filter((function(e){return e.id===t.timeZone}));e.length&&(i=60*-e[0].offset*1e3)}l=new Date(s+i+6e4*e)}}return l}toTimeZone(e){const t=this;let a=e;if(null==a&&(a="Local"),t.timeZone===a)return t.clone();const s=t.timeZones.filter((function(e){return e.id===a}));if(0===s.length)return t.clone();const i=this.toDate(a),n=new Smart.Utilities.DateTime(i);return n.timeZone=a,n.timeZoneOffset=s[0].offset,n.timeZoneOffsetHours=s[0].offsetHours,t.copySmallTimePartValues(n),n}day(){return this.getDatePart(this.datePartDay)}month(){return this.getDatePart(this.datePartMonth)}year(){return this.getDatePart(this.datePartYear)}millisecond(){return parseInt(this.internalMS()%1e3)}hour(){return parseInt(Math.floor(this.internalMS()/this.millisPerHour)%24)}minute(){return parseInt(this.internalMS()/this.millisPerMinute%60)}second(){return parseInt(this.internalMS()/this.millisPerSecond%60)}microsecond(){return this._microsecond}nanosecond(){return this._nanosecond}picosecond(){return this._picosecond}femtosecond(){return this._femtosecond}attosecond(){return this._attosecond}zeptosecond(){return this._zeptosecond}yoctosecond(){return this._yoctosecond}valueOf(){return this.dateData}equals(e){const t=this;return t.dateData===e.dateData&&t._microsecond===e._microsecond&&t._nanosecond===e._nanosecond&&t._picosecond===e._picosecond&&t._femtosecond===e._femtosecond&&t._attosecond===e._attosecond&&t._zeptosecond===e._zeptosecond&&t._yoctosecond===e._yoctosecond}equalDateParts(e){const t=this;return t.year()===e.year()&&t.month()===e.month()&&t.day()===e.day()}compare(e){const t=this;if(t.equals(e))return 0;const a=["dateData","_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"];for(let s=0;s<a.length;s++){const i=a[s];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}toDateString(){return this.toDate().toDateString()}toLocaleDateString(){return this.toDate().toLocaleDateString(this.calendar.locale)}toLocaleString(){return this.toDate().toLocaleString(this.calendar.locale)}toLocaleTimeString(){return this.toDate().toLocaleTimeString(this.calendar.locale)}validateTimeZone(e){const t=this;if("string"!=typeof e)return;const a=t.timeZones.filter((function(t){return t.id===e}));0!==a.length&&(t.timeZone=e,t.timeZoneOffset=a[0].offset,t.timeZoneOffsetHours=a[0].offsetHours)}copyTimeZone(e){const t=this;e.timeZone=t.timeZone,e.timeZoneOffset=t.timeZoneOffset,e.timeZoneOffsetHours=t.timeZoneOffsetHours}getTimeStamp(){return new Smart.Utilities.BigNumber(this.dateData.toString()+this.getFirstNDigitsOfPrecision(void 0,!0))}})})();
824
+ (()=>{const e=-1*(new Date).getTimezoneOffset(),t=[{id:"Local",offset:e,offsetHours:e/60,displayName:"",supportsDaylightSavingTime:!1},{id:"Dateline Standard Time",offset:-720,offsetHours:-12,displayName:"(UTC-12:00) International Date Line West",supportsDaylightSavingTime:!1},{id:"UTC-11",offset:-660,offsetHours:-11,displayName:"(UTC-11:00) Coordinated Universal Time-11",supportsDaylightSavingTime:!1},{id:"Hawaiteratoran Standard Time",offset:-600,offsetHours:-10,displayName:"(UTC-10:00) Hawaiterator",supportsDaylightSavingTime:!1},{id:"Alaskan Standard Time",offset:-540,offsetHours:-9,displayName:"(UTC-09:00) Alaska",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time (Mexico)",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Baja California",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Pacific Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Arizona",supportsDaylightSavingTime:!1},{id:"Mountain Standard Time (Mexico)",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",supportsDaylightSavingTime:!0},{id:"Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Mountain Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central America Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central America",supportsDaylightSavingTime:!1},{id:"Canada Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Saskatchewan",supportsDaylightSavingTime:!1},{id:"Central Standard Time (Mexico)",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",supportsDaylightSavingTime:!0},{id:"SA Pacific Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Bogota, Lima, Quito, Rio Branco",supportsDaylightSavingTime:!1},{id:"Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Eastern Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Indiana (East)",supportsDaylightSavingTime:!0},{id:"Venezuela Standard Time",offset:-270,offsetHours:-4.5,displayName:"(UTC-04:30) Caracas",supportsDaylightSavingTime:!1},{id:"Atlantic Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Atlantic Time (Canada)",supportsDaylightSavingTime:!0},{id:"Paraguay Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Asuncion",supportsDaylightSavingTime:!0},{id:"Central Brazilian Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Cuiaba",supportsDaylightSavingTime:!0},{id:"Pacific SA Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Santiago",supportsDaylightSavingTime:!0},{id:"SA Western Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",supportsDaylightSavingTime:!1},{id:"Newfoundland Standard Time",offset:-210,offsetHours:-3.5,displayName:"(UTC-03:30) Newfoundland",supportsDaylightSavingTime:!0},{id:"SA Eastern Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Cayenne, Fortaleza",supportsDaylightSavingTime:!1},{id:"Argentina Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Buenos Aires",supportsDaylightSavingTime:!0},{id:"E. South America Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Brasilia",supportsDaylightSavingTime:!0},{id:"Bahia Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Salvador",supportsDaylightSavingTime:!0},{id:"Montevideo Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Montevideo",supportsDaylightSavingTime:!0},{id:"Greenland Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Greenland",supportsDaylightSavingTime:!0},{id:"UTC-02",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Coordinated Universal Time-02",supportsDaylightSavingTime:!1},{id:"Mid-Atlantic Standard Time",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Mid-Atlantic - Old",supportsDaylightSavingTime:!0},{id:"Azores Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Azores",supportsDaylightSavingTime:!0},{id:"Cape Verde Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Cape Verde Is.",supportsDaylightSavingTime:!1},{id:"Morocco Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Casablanca",supportsDaylightSavingTime:!0},{id:"UTC",offset:0,offsetHours:0,displayName:"(UTC) Coordinated Universal Time",supportsDaylightSavingTime:!1},{id:"GMT Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Dublin, Edinburgh, Lisbon, London",supportsDaylightSavingTime:!0},{id:"Greenwich Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Monrovia, Reykjavik",supportsDaylightSavingTime:!1},{id:"Central European Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",supportsDaylightSavingTime:!0},{id:"Namibia Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Windhoek",supportsDaylightSavingTime:!0},{id:"W. Central Africa Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) West Central Africa",supportsDaylightSavingTime:!1},{id:"W. Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",supportsDaylightSavingTime:!0},{id:"Central Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",supportsDaylightSavingTime:!0},{id:"Romance Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",supportsDaylightSavingTime:!0},{id:"FLE Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",supportsDaylightSavingTime:!0},{id:"South Africa Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Harare, Pretoria",supportsDaylightSavingTime:!1},{id:"Turkey Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Istanbul",supportsDaylightSavingTime:!0},{id:"GTB Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Athens, Bucharest",supportsDaylightSavingTime:!0},{id:"Libya Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Tripoli",supportsDaylightSavingTime:!0},{id:"E. Europe Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) E. Europe",supportsDaylightSavingTime:!0},{id:"Jordan Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Amman",supportsDaylightSavingTime:!0},{id:"Middle East Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Beirut",supportsDaylightSavingTime:!0},{id:"Egypt Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Cairo",supportsDaylightSavingTime:!0},{id:"Syria Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Damascus",supportsDaylightSavingTime:!0},{id:"Israel Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Jerusalem",supportsDaylightSavingTime:!0},{id:"Arab Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kuwait, Riyadh",supportsDaylightSavingTime:!1},{id:"E. Africa Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Nairobi",supportsDaylightSavingTime:!1},{id:"Arabic Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Baghdad",supportsDaylightSavingTime:!0},{id:"Kaliningrad Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kaliningrad, Minsk",supportsDaylightSavingTime:!0},{id:"Iran Standard Time",offset:210,offsetHours:3.5,displayName:"(UTC+03:30) Tehran",supportsDaylightSavingTime:!0},{id:"Mauritius Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Port Louis",supportsDaylightSavingTime:!0},{id:"Georgian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Tbilisi",supportsDaylightSavingTime:!1},{id:"Caucasus Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Yerevan",supportsDaylightSavingTime:!0},{id:"Arabian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Abu Dhabi, Muscat",supportsDaylightSavingTime:!1},{id:"Azerbaijan Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Baku",supportsDaylightSavingTime:!0},{id:"Russian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Moscow, St. Petersburg, Volgograd",supportsDaylightSavingTime:!0},{id:"Afghanistan Standard Time",offset:270,offsetHours:4.5,displayName:"(UTC+04:30) Kabul",supportsDaylightSavingTime:!1},{id:"Pakistan Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Islamabad, Karachi",supportsDaylightSavingTime:!0},{id:"West Asia Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Ashgabat, Tashkent",supportsDaylightSavingTime:!1},{id:"India Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",supportsDaylightSavingTime:!1},{id:"Sri Lanka Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Sri Jayawardenepura",supportsDaylightSavingTime:!1},{id:"Nepal Standard Time",offset:345,offsetHours:5.75,displayName:"(UTC+05:45) Kathmandu",supportsDaylightSavingTime:!1},{id:"Central Asia Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Astana",supportsDaylightSavingTime:!1},{id:"Bangladesh Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Dhaka",supportsDaylightSavingTime:!0},{id:"Ekaterinburg Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Ekaterinburg",supportsDaylightSavingTime:!0},{id:"Myanmar Standard Time",offset:390,offsetHours:6.5,displayName:"(UTC+06:30) Yangon (Rangoon)",supportsDaylightSavingTime:!1},{id:"SE Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Bangkok, Hanoi, Jakarta",supportsDaylightSavingTime:!1},{id:"N. Central Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Novosibirsk",supportsDaylightSavingTime:!0},{id:"Ulaanbaatar Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Ulaanbaatar",supportsDaylightSavingTime:!1},{id:"China Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",supportsDaylightSavingTime:!1},{id:"Singapore Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Kuala Lumpur, Singapore",supportsDaylightSavingTime:!1},{id:"North Asia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Krasnoyarsk",supportsDaylightSavingTime:!0},{id:"Taipei Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Taipei",supportsDaylightSavingTime:!1},{id:"W. Australia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Perth",supportsDaylightSavingTime:!0},{id:"Korea Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Seoul",supportsDaylightSavingTime:!1},{id:"North Asia East Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Irkutsk",supportsDaylightSavingTime:!0},{id:"Tokyo Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Osaka, Sapporo, Tokyo",supportsDaylightSavingTime:!1},{id:"AUS Central Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Darwin",supportsDaylightSavingTime:!1},{id:"Cen. Australia Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Adelaide",supportsDaylightSavingTime:!0},{id:"West Pacific Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Guam, Port Moresby",supportsDaylightSavingTime:!1},{id:"Tasmania Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Hobart",supportsDaylightSavingTime:!0},{id:"E. Australia Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Brisbane",supportsDaylightSavingTime:!1},{id:"AUS Eastern Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Canberra, Melbourne, Sydney",supportsDaylightSavingTime:!0},{id:"Yakutsk Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Yakutsk",supportsDaylightSavingTime:!0},{id:"Vladivostok Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Vladivostok",supportsDaylightSavingTime:!0},{id:"Central Pacific Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Solomon Is., New Caledonia",supportsDaylightSavingTime:!1},{id:"Magadan Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Magadan",supportsDaylightSavingTime:!0},{id:"Kamchatka Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",supportsDaylightSavingTime:!0},{id:"Fiji Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Fiji",supportsDaylightSavingTime:!0},{id:"New Zealand Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Auckland, Wellington",supportsDaylightSavingTime:!0},{id:"UTC+12",offset:720,offsetHours:12,displayName:"(UTC+12:00) Coordinated Universal Time+12",supportsDaylightSavingTime:!1},{id:"Tonga Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Nuku'alofa",supportsDaylightSavingTime:!1},{id:"Samoa Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Samoa",supportsDaylightSavingTime:!0}],a=[0,31,59,90,120,151,181,212,243,273,304,334,365],s=[0,31,60,91,121,152,182,213,244,274,305,335,366];Smart.Utilities.Assign("TimeSpan",class{constructor(){const e=this;if(e.ticksPerMillisecond=1e4,e.millisecondsPerTick=1e-4,e.ticksPerSecond=1e7,e.secondsPerTick=1e-7,e.ticksPerMinute=6e8,e.minutesPerTick=1/6e8,e.ticksPerHour=36e9,e.hoursPerTick=1/36e9,e.ticksPerDay=864e9,e.daysPerTick=1/864e9,e.millisPerSecond=1e3,e.millisPerMinute=6e4,e.millisPerHour=36e5,e.millisPerDay=864e5,e._ticks=0,1===arguments.length){if(isNaN(arguments[0]))throw new Error("Argument must be a number.");e._ticks=arguments[0]}else if(3===arguments.length)e._ticks=e.timeToMS(arguments[0],arguments[1],arguments[2],0);else if(4===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+0;e._ticks=t*e.ticksPerMillisecond}else if(5===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+arguments[4];e._ticks=t*e.ticksPerMillisecond}}ticks(){return this._ticks}days(){return parseInt(this._ticks/this.ticksPerDay)}timeToMS(e,t,a,s){return parseInt((3600*e+60*t+a+s/1e3)*this.ticksPerSecond)}hours(){return parseInt(this._ticks/this.ticksPerHour)%24}milliseconds(){return parseInt(this._ticks/this.ticksPerMillisecond)%1e3}minutes(){return parseInt(this._ticks/this.ticksPerMinute)%60}seconds(){return parseInt(this._ticks/this.ticksPerSecond)%60}totalDays(){return parseInt(this._ticks*this.daysPerTick)}totalHours(){return parseInt(this._ticks*this.hoursPerTick)}totalMilliseconds(){const e=this._ticks*this.millisecondsPerTick;return parseInt(e)}totalMinutes(){return parseInt(this._ticks*this.minutesPerTick)}totalSeconds(){return parseInt(this._ticks*this.secondsPerTick)}add(e){const t=this._ticks+e._ticks;return new Smart.Utilities.TimeSpan(t)}subtract(e){const t=this._ticks-e._ticks;return new Smart.Utilities.TimeSpan(t)}duration(){const e=this;return e._ticks>=0?new Smart.Utilities.TimeSpan(e._ticks):new Smart.Utilities.TimeSpan(-e._ticks)}equals(e){return this._ticks===e._ticks}valueOf(){return this._ticks}compare(e,t){return e._ticks>t._ticks?1:e._ticks<t._ticks?-1:0}interval(e,t){const a=e*t+(e>=0?.5:-.5);return new Smart.Utilities.TimeSpan(a*this.ticksPerMillisecond)}fromDays(e){return this.interval(e,this.millisPerDay)}fromHours(e){return this.interval(e,this.millisPerHour)}fromMilliseconds(e){return this.interval(e,1)}fromMinutes(e){return this.interval(e,this.millisPerMinute)}fromSeconds(e){return this.interval(e,this.millisPerSecond)}fromTicks(e){return new Smart.Utilities.TimeSpan(e)}toString(){return this.totalMilliseconds().toString()}negate(){return new Smart.Utilities.TimeSpan(-this._ticks)}}),Smart.Utilities.Assign("DateTime",class{constructor(){function e(e){const t=i.regexISOString.exec(e);n=new Smart.Utilities.DateTime(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),0,0,0,0,0,0,0,"UTC")}const i=this;let n;if(i.ticksPerMillisecond=1e4,i.millisecondsPerTick=1e-4,i.ticksPerSecond=1e7,i.secondsPerTick=1e-7,i.ticksPerMinute=6e8,i.minutesPerTick=1/6e8,i.ticksPerHour=36e9,i.hoursPerTick=1/36e9,i.ticksPerDay=864e9,i.daysPerTick=1/864e9,i.millisPerSecond=1e3,i.millisPerMinute=6e4,i.millisPerHour=36e5,i.millisPerDay=864e5,i.daysPerYear=365,i.daysPer4Years=1461,i.daysPer100Years=36524,i.daysPer400Years=146097,i.daysTo1601=584388,i.daysTo1899=693593,i.daysTo10000=3652059,i.minTicks=0,i.maxTicks=3155378976e9,i.maxMillis=3155378976e5,i.datePartYear=0,i.datePartDayOfYear=1,i.datePartMonth=2,i.datePartDay=3,i.daysToMonth365=a,i.daysToMonth366=s,i.minValue=new Date(0),i.maxValue=new Date(3155378976e9),i.ticksMask=0x4000000000000000,i.flagsMask=0xc000000000000000,i.localMask=0x8000000000000000,i.ticksCeiling=0x4000000000000000,i.kindUnspecified=0,i.kindUtc=0x4000000000000000,i.kindLocal=0x8000000000000000,i.kindLocalAmbiguousDst=0xc000000000000000,i.kindShift=62,i.regexTrim=/^\s+|\s+$/g,i.regexInfinity=/^[+-]?infinity$/i,i.regexHex=/^0x[a-f0-9]+$/i,i.regexParseFloat=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/,i.regexISOString=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/,i.calendar={"/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",FP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",FPA:"yyyy/MM/dd HH:mm:ss:fffuunnppeeaaxxoo",FPA2:"yyyy-MM-dd HH:mm:ss:fffuunnppeeaaxxoo",FT:"HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",PP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp",PT:"HH:mm:ss:fff:uu:nn:pp"},percentsymbol:"%",currencysymbol:"$",currencysymbolposition:"before",decimalseparator:".",thousandsseparator:","},i.dateData=0,i.timeZone=null,i.timeZones=t,i._codeToUnit={u:"_microsecond",uu:"_microsecond",n:"_nanosecond",nn:"_nanosecond",p:"_picosecond",pp:"_picosecond",e:"_femtosecond",ee:"_femtosecond",a:"_attosecond",aa:"_attosecond",x:"_zeptosecond",xx:"_zeptosecond",o:"_yoctosecond",oo:"_yoctosecond"},i._smallUnits=["_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"],i._microsecond=0,i._nanosecond=0,i._picosecond=0,i._femtosecond=0,i._attosecond=0,i._zeptosecond=0,i._yoctosecond=0,0===arguments.length){const e=new Date;i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else if(1===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}}else if(2===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}i.validateTimeZone(arguments[1])}else if(arguments.length>2)if("string"==typeof arguments[0]){const e=i.tryparseDate(arguments[0],arguments[2],arguments[1]);i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else{const e=arguments[0],t=arguments[7]||0,a=arguments[8]||0,s=arguments[9]||0,n=arguments[10]||0,r=arguments[11]||0,o=arguments[12]||0,d=arguments[13]||0,l=new Date(e,arguments[1]-1,arguments[2],arguments[3]||0,arguments[4]||0,arguments[5]||0,arguments[6]||0);e<1970&&l.setFullYear(e),i.dateData=i.dateToMS(l.getFullYear(),l.getMonth()+1,l.getDate())+i.timeToMS(l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()),i._microsecond=t,i._nanosecond=a,i._picosecond=s,i._femtosecond=n,i._attosecond=r,i._zeptosecond=o,i._yoctosecond=d,arguments[14]&&i.validateTimeZone(arguments[14])}if(i.timeZone||i.validateTimeZone("Local"),n){const e=n.toTimeZone(i.timeZone);i.dateData=e.dateData}}static validateDate(e,t,a){if(e instanceof Smart.Utilities.DateTime)return e;if(e instanceof Date)return new Smart.Utilities.DateTime(e);try{if(new RegExp(/^\d{1,2}\/\d{1,2}\/\d{4}(, \d{1,2}:\d{2}:\d{1,2} [A|P]M)?$/).test(e)){const t=new Date(e);if(!isNaN(t.getTime()))return new Smart.Utilities.DateTime(t)}if("string"==typeof e)return this.parseDateString(e,t,a);if("number"==typeof e)return new Smart.Utilities.DateTime(new Date(e))}catch(e){}return t}static parseDateString(e,t,a){const s=new Date(e);if(!isNaN(s.getTime()))return e&&"string"==typeof e&&a?new Smart.Utilities.DateTime(e,a,null):new Smart.Utilities.DateTime(s);const i=e.indexOf("Date("),n=e.indexOf("DateTime("),r=e.lastIndexOf(")");let o=e;if(-1===i&&-1===n||-1===r){const t=new Smart.Utilities.DateTime,s=t.parseDate(e,a);if(s)return o=new Smart.Utilities.DateTime(s),t.copySmallTimePartValues(o),o}else{if(o=-1!==i?e.slice(i+5,r):e.slice(n+9,r),o=o.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),""===o.trim())return new Smart.Utilities.DateTime;if(new RegExp(/(^(\d+)(\s*,\s*\d+)+(\s*,\s*[a-zA-Z ]+)?$)/g).test(o))return o=o.split(","),o.map((function(e,t){isNaN(o[t])?o[t]=e.trim():o[t]=parseInt(e)})),-1!==i&&o[1]++,o.unshift(null),o=new(Function.prototype.bind.apply(Smart.Utilities.DateTime,o)),o}if(""===o.trim())return t;if(!isNaN(o))return o=new Date(parseInt(o,10)),new Smart.Utilities.DateTime(o);try{const e=o.split(",");2===e.length?(e[1]=e[1].trim(),e.unshift(null),o=new(Function.prototype.bind.apply(Smart.Utilities.DateTime,e))):o=new Smart.Utilities.DateTime(o)}catch(e){o=t}return o}static fromFullTimeStamp(e){e=e.toString();const t=new Smart.Utilities.DateTime(parseFloat(e.slice(0,e.length-21)));let a=e.slice(e.length-21),s=0;for(;a.length>0;)t[t._smallUnits[s]]=parseInt(a.slice(0,3),10),a=a.slice(3),s++;return t}static getConstructorParameters(e){return[e.year(),e.month(),e.day(),e.hour(),e.minute(),e.second(),e.millisecond(),e._microsecond,e._nanosecond,e._picosecond,e._femtosecond,e._attosecond,e._zeptosecond,e._yoctosecond,e.timeZone]}static detectDisplayMode(e,t,a){if(e.calendar.patterns[t])return-1!==["d","D","M","Y","d1","d2"].indexOf(t)?"calendar":-1!==["t","T","FT","PT"].indexOf(t)?"timePicker":"default";const s=["d","M","y"],i=["h","H","m","s","t","f","u","n","p","e","a","x","o"],n=a.groups;let r=!1,o=!1;for(let e=0;e<n.length;e++){const t=n[e].charAt(0);if(-1!==s.indexOf(t)?r=!0:-1!==i.indexOf(t)&&(o=!0),r&&o)break}return r===o?"default":r?"calendar":"timePicker"}static getLocalizedNames(e){const t={names:[],namesAbbr:[],namesShort:[]},a={names:[],namesAbbr:[]};if(this[e])return this[e];for(let a=23;a<30;a++){const s=new Date(2017,6,a),i=s.toLocaleString(e,{weekday:"long"});t.names.push(i),t.namesAbbr.push(s.toLocaleString(e,{weekday:"short"})),t.namesShort.push(i.substring(0,2))}for(let t=0;t<12;t++){const s=new Date(2017,t,1).toLocaleString(e,{month:"long"});a.names.push(s),a.namesAbbr.push(s.substring(0,3))}return a.names.push(""),a.namesAbbr.push(""),this[e]={days:t,months:a},this[e]}internalMS(){return this.dateData}getDatePart(e){const t=this,a=t.internalMS();let s=parseInt(a/t.millisPerDay);const i=parseInt(s/t.daysPer400Years);s-=i*t.daysPer400Years;let n=parseInt(s/t.daysPer100Years);4===n&&(n=3),s-=n*t.daysPer100Years;const r=parseInt(s/t.daysPer4Years);s-=r*t.daysPer4Years;let o=parseInt(s/t.daysPerYear);if(4===o&&(o=3),e===t.datePartYear)return parseInt(400*i+100*n+4*r+o+1);if(s-=o*t.daysPerYear,e===t.datePartDayOfYear)return parseInt(s+1);const d=3===o&&(24!==r||3===n)?t.daysToMonth366:t.daysToMonth365;let l=s>>6;for(;s>=d[l];)l++;return e===t.datePartMonth?parseInt(l):parseInt(s-d[l-1]+1)}dayOfWeek(){const e=this.dateData;return parseInt(e/this.millisPerDay+1)%7}dayOfYear(){return this.getDatePart(this.datePartDayOfYear)}weekOfYear(e){const t=this.toDate(),a=e||this.calendar.firstDay,s=new Date(t.getFullYear(),0,1),i=Math.floor((t.getTime()-s.getTime()-6e4*(t.getTimezoneOffset()-s.getTimezoneOffset()))/864e5)+1;let n,r=s.getDay()-a;if(r=r>=0?r:r+7,r<4){if(n=Math.floor((i+r-1)/7)+1,n>52){let e=new Date(t.getFullYear()+1,0,1).getDay()-a;e=e>=0?e:e+7,n=e<4?1:53}}else n=Math.floor((i+r-1)/7);return n}subtract(e){const t=this;return new Smart.Utilities.TimeSpan(t.dateData*t.ticksPerMillisecond-e.dateData*t.ticksPerMillisecond)}dateToMS(e,t,a){const s=this;if(e>=1&&e<=9999&&t>=1&&t<=12){e=parseInt(e);const i=s.isLeapYear(e)?s.daysToMonth366:s.daysToMonth365;if(a>=1&&a<=i[t]-i[t-1]){const n=e-1;return(365*n+parseInt(n/4)-parseInt(n/100)+parseInt(n/400)+i[t-1]+a-1)*s.millisPerDay}}}isLeapYear(e){if(e<1||e>9999)throw new Error("Year out of Range");return e%4==0&&(e%100!=0||e%400==0)}timeToMS(e,t,a,s){const i=this;if(e>=0&&e<24&&t>=0&&t<60&&a>=0&&a<60){const n=parseInt(3600*e+60*t+a);return s>0&&s<1e3?n*i.millisPerSecond+s:n*i.millisPerSecond}}daysInMonth(e,t){if(t<1||t>12)throw new Error("Month out of Range");const a=this,s=a.isLeapYear(e)?a.daysToMonth366:a.daysToMonth365;return s[t]-s[t-1]}arrayIndexOf(e,t){return e.indexOf(t)}startsWith(e,t){return 0===e.indexOf(t)}endsWith(e,t){return e.substr(e.length-t.length)===t}trim(e){return(e+"").replace(this.regexTrim,"")}expandFormat(e,t){t=t||"F";let a,s=e.patterns,i=t.length;if(s[t])return s[t];if(1===i){if(a=s[t],!a)throw"Invalid date format string '"+t+"'.";t=a}else 2===i&&"%"===t.charAt(0)&&(t=t.charAt(1));return t}getEra(e,t){if(!t)return 0;if("string"==typeof e)return 0;let a,s=e.getTime();for(let e=0,i=t.length;e<i;e++)if(a=t[e].start,null===a||s>=a)return e;return 0}toUpper(e){return e.split(" ").join(" ").toUpperCase()}toUpperArray(e){const t=[];for(let a=0,s=e.length;a<s;a++)t[a]=this.toUpper(e[a]);return t}getEraYear(e,t,a,s){let i=e.getFullYear();return!s&&t.eras&&(i-=t.eras[a].offset),i}getDayIndex(e,t,a){const s=this,i=e.days;let n,r=e._upperDays;return r||(e._upperDays=r=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr),s.toUpperArray(i.namesShort)]),t=t.toUpperCase(),a?(n=s.arrayIndexOf(r[1],t),-1===n&&(n=s.arrayIndexOf(r[2],t))):n=s.arrayIndexOf(r[0],t),n}getMonthIndex(e,t,a){const s=this;let i=e.months,n=e.monthsGenitive||e.months,r=e._upperMonths,o=e._upperMonthsGen;r||(e._upperMonths=r=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr)],e._upperMonthsGen=o=[s.toUpperArray(n.names),s.toUpperArray(n.namesAbbr)]),t=s.toUpper(t);let d=s.arrayIndexOf(a?r[1]:r[0],t);return d<0&&(d=s.arrayIndexOf(a?o[1]:o[0],t)),d}appendPreOrPostMatch(e,t){let a=0,s=!1;for(let i=0,n=e.length;i<n;i++){const n=e.charAt(i);switch(n){case"'":s?t.push("'"):a++,s=!1;break;case"\\":s&&t.push("\\"),s=!s;break;default:t.push(n),s=!1}}return a}getTokenRegExp(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyyy|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|uu|u|nn|n|pp|p|ee|e|aa|a|xx|x|oo|o|i{1,24}|zzz|zz|z|gg|g/g}tryparseDate(e,t,a){const s=this;if(null==t&&(t=s.calendar),void 0!==a){if(Array.isArray(a))for(let i=0;i<a.length;i++){const n=s.parseDate(e,a[i],t);if(n)return n}const i=s.parseDate(e,a,t);if(i)return i}if(""===e)return null;if(null==e||e.substring||(e=e.toString()),null!=e&&"/Date("===e.substring(0,6)){const t=/^\/Date\((-?\d+)(\+|-)?(\d+)?\)\/$/;let a=new Date(+e.replace(/\/Date\((\d+)\)\//,"$1"));if("Invalid Date"===a){const t=e.match(/^\/Date\((\d+)([-+]\d\d)(\d\d)\)\/$/);a=null,t&&(a=new Date(1*t[1]+36e5*t[2]+6e4*t[3]))}if(null==a||"Invalid Date"===a||isNaN(a)){const a=t.exec(e);if(a){const e=new Date(parseInt(a[1]));if(a[2]){let t=parseInt(a[3]);"-"===a[2]&&(t=-t);const s=e.getUTCMinutes();e.setUTCMinutes(s-t)}if(!isNaN(e.valueOf()))return e}}return a}const i={smartdate:"yyyy-MM-dd HH:mm:ss",d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",d3:"MM-dd-yyyy",d4:"MM.dd.yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",iso:"yyyy-MM-ddTHH:mm:ssZ",iso_date1:"yyyy-MM-dd",iso_date2:"yyyy-MM-dd",iso_date3:"yyyy-ddd",iso_date4:"yyyy-MM-dd HH:mm",iso_date5:"yyyy-MM-dd HH:mm Z",iso_date6:"yyyy-MMM-dd",iso_date7:"yyyy-MM",iso_date8:"yyyy-MMM",iso_date9:"yyyy-MMMM",iso_date10:"yyyy-MMMM-dd",iso_time1:"HH:mm:ss.tttt",iso_time2:"HH:mm:ss",iso_time3:"HH:mm",iso_time4:"HH",iso_time5:"yyyyyy-MM-dd",iso_time6:"yyyyyy-MM-dd"};for(let a in i){const n=s.parseDate(e,i[a],t);if(n)return n}const n=t.patterns;for(let a in n){const i=s.parseDate(e,n[a],t);if(i){if("ISO"===a){const a=s.parseDate(e,n.ISO2,t);if(a)return a}return i}}let r;if("string"==typeof e){const a=[":","/","-"," ",","];let i="",n=e=function(e,t,a){return a.replace(new RegExp(e,"g"),t)}(", ",",",e=s.trim(e));e.indexOf(":")>=0?(i=e.substring(e.indexOf(":")-2),i=s.trim(i),n=e.substring(0,e.indexOf(":")-2)):e.toUpperCase().indexOf("AM")>=0?(i=e.substring(e.toUpperCase().indexOf("AM")-2),i=s.trim(i),n=e.substring(0,e.toUpperCase().indexOf("AM")-2)):e.toUpperCase().indexOf("PM")>=0&&(i=e.substring(e.toUpperCase().indexOf("PM")-2),i=s.trim(i),n=e.substring(0,e.toUpperCase().indexOf("PM")-2));let o=new Date,d=!1;if(n){for(let e=0;e<a.length;e++)if(n.indexOf(a[e])>=0){r=n.split(a[e]);break}if(!r)return null;let e=new Array,i=new Array,l=new Array,f=null,m=null;for(let a=0;a<r.length;a++){const i=r[a],n=s.parseDate(i,"d",t)||s.parseDate(i,"dd",t)||s.parseDate(i,"ddd",t)||s.parseDate(i,"dddd",t);if(n&&(e.push(n.getDate()),i.length>2)){f=a;break}}for(let e=0;e<r.length;e++){const a=r[e],n=s.parseDate(a,"M",t)||s.parseDate(a,"MM",t)||s.parseDate(a,"MMM",t)||s.parseDate(a,"MMMM",t);if(n){if(null!=f&&f===e)continue;if(i.push(n.getMonth()),a.length>2){m=e;break}}}for(let e=0;e<r.length;e++){const a=r[e],i=s.parseDate(a,"yyyy",t);if(i){if(null!=f&&f===e)continue;if(null!=m&&m===e)continue;l.push(i.getFullYear())}}const c=new Array;for(let t=e.length-1;t>=0;t--)for(let a=0;a<i.length;a++)for(let s=0;s<l.length;s++){const n=new Date(l[s],i[a],e[t]);l[s]<1970&&n.setFullYear(l[s]),isNaN(n.getTime())||c.push(n)}c.length>0&&(o=c[0],d=!0)}if(i){const e=i.indexOf(":")>=0?i.split(":"):i,a=s.parseDate(i,"h:mm tt",t)||s.parseDate(i,"HH:mm:ss.fff",t)||s.parseDate(i,"HH:mm:ss.ff",t)||s.parseDate(i,"h:mm:ss tt",t)||s.parseDate(i,"HH:mm:ss.tttt",t)||s.parseDate(i,"HH:mm:ss",t)||s.parseDate(i,"HH:mm",t)||s.parseDate(i,"HH",t);let n=0,r=0,l=0,f=0;a&&!isNaN(a.getTime())?(n=a.getHours(),r=a.getMinutes(),l=a.getSeconds(),f=a.getMilliseconds()):(1===e.length&&(n=parseInt(e[0])),2===e.length&&(n=parseInt(e[0]),r=parseInt(e[1])),3===e.length&&(n=parseInt(e[0]),r=parseInt(e[1]),e[2].indexOf(".")>=0?(l=parseInt(e[2].toString().split(".")[0]),f=parseInt(e[2].toString().split(".")[1])):l=parseInt(e[2])),4===e.length&&(n=parseInt(e[0]),r=parseInt(e[1]),l=parseInt(e[2]),f=parseInt(e[3]))),!o||isNaN(n)||isNaN(r)||isNaN(l)||isNaN(f)||(o.setHours(n,r,l,f),d=!0)}if(d)return o}if(null!=e){r=[":","/","-"];let t=!0;for(let a=0;a<r.length;a++)-1!==e.indexOf(r[a])&&(t=!1);if(t){const t=new Number(e);if(!isNaN(t))return new Date(t)}}return null}getParseRegExp(e,t){const a=this;let s=e._parseRegExp;if(s){const e=s[t];if(e)return e}else e._parseRegExp=s={};let i,n=a.expandFormat(e,t).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),r=["^"],o=[],d=0,l=0,f=a.getTokenRegExp();for(;null!==(i=f.exec(n));){const e=n.slice(d,i.index);if(d=f.lastIndex,l+=a.appendPreOrPostMatch(e,r),l%2){r.push(i[0]);continue}let t,s=i[0],m=s.length;switch(s){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":t="(\\D+)";break;case"tt":case"t":t="(\\D*)";break;case"yyyyy":t="(\\d{1,4})";break;case"yyyy":t="(\\d{"+m+"})";break;case"fff":case"ff":case"f":t="(\\d{1,"+m+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":t="(\\d\\d?)";break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":t="(\\d{1,3})";break;case"zzz":t="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":t="([+-]?\\d\\d?)";break;case"/":t="/";break;default:if(!/i{1,24}/.test(s))throw"Invalid date format pattern '"+s+"'.";t="(\\d{"+s.length+"})"}t&&r.push(t),"/"!==s&&o.push(i[0])}a.appendPreOrPostMatch(n.slice(d),r),r.push("$");const m={regExp:r.join("").replace(/\s+/g,"\\s+"),groups:o};return s[t]=m}outOfRange(e,t,a){return e<t||e>a}expandYear(e,t){const a=this,s=new Date,i=a.getEra(s);if(t<100){let n=e.twoDigitYearMax;n="string"==typeof n?(new Date).getFullYear()%100+parseInt(n,10):n;const r=a.getEraYear(s,e,i);(t+=r-r%100)>n&&(t-=100)}return t}padZeros(e,t){let a,s=e+"";return t>1&&s.length<t?(a=["0","00","000"][t-2]+s,a.substr(a.length-t,t)):(a=s,a)}parseDate(e,t,a){const s=this;null==a&&(a=s.calendar),e=s.trim(e);const i=a,n=s.getParseRegExp(i,t),r=new RegExp(n.regExp).exec(e);if(null===r)return null;let o,d=n.groups,l=null,f=null,m=null,c=null,u=null,p=0,y=0,g=0,h=0,T=null,S=!1;for(let e=0,t=d.length;e<t;e++){const t=r[e+1];if(t){const a=d[e],n=a.length,r=parseInt(t,10);switch(a){case"dd":case"d":if(c=r,s.outOfRange(c,1,31))return null;break;case"MMM":case"MMMM":case"MMMMM":case"MMMMMM":case"MMMMMMM":case"MMMMMMMM":if(m=s.getMonthIndex(i,t,3===n),s.outOfRange(m,0,11))return null;break;case"M":case"MM":if(m=r-1,s.outOfRange(m,0,11))return null;break;case"y":case"yy":case"yyyy":if(f=n<4?s.expandYear(i,r):r,s.outOfRange(f,0,9999))return null;break;case"h":case"hh":if(p=r,12===p&&(p=0),s.outOfRange(p,0,11))return null;break;case"H":case"HH":if(p=r,s.outOfRange(p,0,23))return null;break;case"m":case"mm":if(y=r,s.outOfRange(y,0,59))return null;break;case"s":case"ss":if(g=r,s.outOfRange(g,0,59))return null;break;case"tt":case"t":if(S=i.PM&&(t===i.PM[0]||t===i.PM[1]||t===i.PM[2]),!S&&(!i.AM||t!==i.AM[0]&&t!==i.AM[1]&&t!==i.AM[2]))return null;break;case"f":case"ff":case"fff":if(h=r*Math.pow(10,3-n),s.outOfRange(h,0,999))return null;break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":if(s.outOfRange(r,0,1e3))return null;s[s._codeToUnit[a]]=r;break;case"ddd":case"dddd":if(u=s.getDayIndex(i,t,3===n),s.outOfRange(u,0,6))return null;break;case"zzz":{const e=t.split(/:/);if(2!==e.length)return null;if(o=parseInt(e[0],10),s.outOfRange(o,-12,13))return null;const a=parseInt(e[1],10);if(s.outOfRange(a,0,59))return null;T=60*o+(s.startsWith(t,"-")?-a:a);break}case"z":case"zz":if(o=r,s.outOfRange(o,-12,13))return null;T=60*o;break;case"g":case"gg":{let e=t;if(!e||!i.eras)return null;e=this.trim(e.toLowerCase());for(let t=0,a=i.eras.length;t<a;t++)if(e===i.eras[t].nathat.toLowerCase()){l=t;break}if(null===l)return null;break}default:{let e=t;e.length%3==1?e+="00":e.length%3==2&&(e+="0"),h=parseInt(e.slice(0,3),10),e=e.slice(3);let a=0;for(;e.length>0;)s[s._smallUnits[a]]=parseInt(e.slice(0,3),10),e=e.slice(3),a++}}}}let M,D=new Date,H=i.convert;if(M=D.getFullYear(),null===f?f=M:i.eras&&(f+=i.eras[l||0].offset),null===m&&(m=0),null===c&&(c=1),H){if(D=H.toGregorian(f,m,c),null===D)return null}else{if(D.setFullYear(f,m,c),D.getDate()!==c)return null;if(null!==u&&D.getDay()!==u)return null}if(S&&p<12&&(p+=12),D.setHours(p,y,g,h),null!==T){const e=D.getMinutes()-(T+D.getTimezoneOffset());D.setHours(D.getHours()+parseInt(e/60,10),e%60)}return D}toString(e,t){const a=this;void 0===e&&(e="yyyy-MM-dd HH:mm:ss");const s=a.dateData.toString()+a.getFractionsOfSecondStamp()+e+(a.timeZone||"");if(Smart.Utilities.DateTime.cache&&Smart.Utilities.DateTime.cache[s])return Smart.Utilities.DateTime.cache[s];const i=a.toDate();if(null==t&&(t=a.calendar),"string"==typeof i)return i;if(!e||!e.length||"i"===e){let e;return e=a.formatDate(i,t.patterns.F,t),e}const n=t.eras,r="s"===e;e=a.expandFormat(t,e);const o=[];let d,l=0,f=a.getTokenRegExp();function m(e,t){if(void 0!==e.getMonth)switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate()}}for(;;){const s=f.lastIndex,c=f.exec(e),u=e.slice(s,c?c.index:e.length);if(l+=a.appendPreOrPostMatch(u,o),!c)break;if(l%2){o.push(c[0]);continue}const p=c[0],y=p.length;let g;if(/i{1,24}/.test(p))o.push(a.getFirstNDigitsOfPrecision(p.length));else switch(p){case"ddd":case"dddd":{const e=3===y?t.days.namesAbbr:t.days.names;o.push(e[i.getDay()]);break}case"d":case"dd":o.push(a.padZeros(m(i,2),y));break;case"MMM":case"MMMM":g=m(i,1),o.push(t.months[3===y?"namesAbbr":"names"][g]);break;case"M":case"MM":o.push(a.padZeros(m(i,1)+1,y));break;case"y":case"yy":case"yyyy":g=a.getEraYear(i,t,a.getEra(i,n),r),y<4&&(g%=100),o.push(a.padZeros(g,y));break;case"h":case"hh":d=i.getHours()%12,0===d&&(d=12),o.push(a.padZeros(d,y));break;case"H":case"HH":o.push(a.padZeros(i.getHours(),y));break;case"m":case"mm":o.push(a.padZeros(i.getMinutes(),y));break;case"s":case"ss":o.push(a.padZeros(i.getSeconds(),y));break;case"t":case"tt":g=i.getHours()<12?t.AM?t.AM[0]:" ":t.PM?t.PM[0]:" ",o.push(1===y?g.charAt(0):g);break;case"f":case"ff":case"fff":o.push(a.padZeros(i.getMilliseconds(),3).substr(0,y));break;case"u":case"n":case"p":case"e":case"a":case"x":case"o":o.push(a[a._codeToUnit[p]]);break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":o.push(a.padZeros(a[a._codeToUnit[p]],3));break;case"z":case"zz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),y));break;case"zzz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),2)+":"+a.padZeros(60*Math.abs(a.timeZoneOffsetHours%1),2));break;case"g":case"gg":t.eras&&o.push(t.eras[a.getEra(i,n)].name);break;case"/":o.push(t["/"]);break;default:throw"Invalid date format pattern '"+p+"'."}}let c=o.join("");return Smart.Utilities.DateTime.cache||(Smart.Utilities.DateTime.cache=new Array),a._today||(a._today=new Date),a.calendar&&a.calendar.today&&-1===e.indexOf(":")&&i.getFullYear()===a._today.getFullYear()&&i.getDate()===a._today.getDate()&&i.getMonth()===a._today.getMonth()&&(c=a.calendar.today),Smart.Utilities.DateTime.cache[s]=c,c}getFractionsOfSecondStamp(){const e=this;return e._microsecond.toString()+e._nanosecond+e._picosecond+e._femtosecond+e._attosecond+e._zeptosecond+e._yoctosecond}getFirstNDigitsOfPrecision(e,t){const a=this;return(""+(!0!==t?a.padZeros(a.millisecond(),3):"")+a.padZeros(a._microsecond,3)+a.padZeros(a._nanosecond,3)+a.padZeros(a._picosecond,3)+a.padZeros(a._femtosecond,3)+a.padZeros(a._attosecond,3)+a.padZeros(a._zeptosecond,3)+a.padZeros(a._yoctosecond,3)).slice(0,e)}copySmallTimePartValues(e){const t=this;e._microsecond=t._microsecond,e._nanosecond=t._nanosecond,e._picosecond=t._picosecond,e._femtosecond=t._femtosecond,e._attosecond=t._attosecond,e._zeptosecond=t._zeptosecond,e._yoctosecond=t._yoctosecond}add(e,t,a){const s=this,i=s.internalMS();if(void 0===t){if(!1===a)return s.dateData=i+parseInt(e._ticks/s.ticksPerMillisecond),s;const t=new Smart.Utilities.DateTime(i+parseInt(e._ticks/s.ticksPerMillisecond));return s.copyTimeZone(t),s.copySmallTimePartValues(t),t}const n=e*t;if(n<=-s.maxMillis||n>=s.maxMillis)throw new Error("Out of Range");if(!1===a)return s.dateData=i+n,s;const r=new Smart.Utilities.DateTime(i+n);return s.copyTimeZone(r),s.copySmallTimePartValues(r),r}addDays(e,t){return this.add(e,this.millisPerDay,t)}clone(){const e=this,t=new Smart.Utilities.DateTime(e.dateData);return e.copyTimeZone(t),e.copySmallTimePartValues(t),t}clearTime(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new Smart.Utilities.DateTime(a,t,s,0,0,0,0);return e.copyTimeZone(i),i}addHours(e,t){return this.add(e,this.millisPerHour,t)}addDeciseconds(e,t){return this.add(100*e,1,t)}addCentiseconds(e,t){return this.add(10*e,1,t)}addMilliseconds(e,t){return this.add(e,1,t)}addMinutes(e,t){return this.add(e,this.millisPerMinute,t)}addMonths(e,t){const a=this;if(e<-12e4||e>12e4)throw new Error("Invalid Months Value");let s=parseInt(a.getDatePart(a.datePartYear)),i=parseInt(a.getDatePart(a.datePartMonth)),n=parseInt(a.getDatePart(a.datePartDay));if(e%12==0)s+=e/12;else{const t=i-1+e;t>=0?(i=t%12+1,s+=t/12):(i=12+(t+1)%12,s+=(t-11)/12),s=parseInt(s)}if(s<1||s>9999)throw new Error("Year out of range");const r=a.daysInMonth(s,i);if(n>r&&(n=r),!1===t)return a.dateData=a.dateToMS(s,i,n)+a.internalMS()%a.millisPerDay,a;const o=new Smart.Utilities.DateTime(a.dateToMS(s,i,n)+a.internalMS()%a.millisPerDay);return a.copyTimeZone(o),a.copySmallTimePartValues(o),o}addSeconds(e,t){return this.add(e,this.millisPerSecond,t)}addYears(e,t){return this.addMonths(12*e,t)}addMicroseconds(e,t){if(0===e)return;const a=this;let s,i;e<0&&0===a.hour()&&0===a.minute()&&0===a.second()&&0===a.millisecond()&&0===a._microsecond&&(s=parseInt(e/1e3,10)-1,i=1e3+e%1e3);const n=1e3*a.timeToMS(a.hour(),a.minute(),a.second(),a.millisecond())+a._microsecond,r=n+e;let o;if(void 0===s&&(s=parseInt(r/1e3,10)-parseInt(n/1e3,10)),void 0===i&&(i=parseInt(r%1e3,10)),0!==s&&(o=a.addMilliseconds(s,t)),!1!==t)return o||(o=a.clone()),o._microsecond=i,o;a._microsecond=i}addFractionsOfSecond(e,t,a,s,i){if(0===e)return;const n=this,r=1e3*n[s]+n[a],o=e+r;let d,l=parseInt(o/1e3,10)-parseInt(r/1e3,10),f=parseInt(o%1e3,10);if(e<0&&o<0&&f<0&&(l--,f=1e3+f),0!==l&&(d=n[i](l,t)),!1!==t)return d||(d=n.clone()),d[a]=f,d;n[a]=f}addNanoseconds(e,t){return this.addFractionsOfSecond(e,t,"_nanosecond","_microsecond","addMicroseconds")}addPicoseconds(e,t){return this.addFractionsOfSecond(e,t,"_picosecond","_nanosecond","addNanoseconds")}addFemtoseconds(e,t){return this.addFractionsOfSecond(e,t,"_femtosecond","_picosecond","addPicoseconds")}addAttoseconds(e,t){return this.addFractionsOfSecond(e,t,"_attosecond","_femtosecond","addFemtoseconds")}addZeptoseconds(e,t){return this.addFractionsOfSecond(e,t,"_zeptosecond","_attosecond","addAttoseconds")}addYoctoseconds(e,t){return this.addFractionsOfSecond(e,t,"_yoctosecond","_zeptosecond","addZeptoseconds")}getTimeZoneOffset(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1),s=e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset());return{offset:-e.getTimezoneOffset()/60,dst:+s}}isInDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return this.date().getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset())}supportsDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return t.getTimezoneOffset()!==a.getTimezoneOffset()}date(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new Smart.Utilities.DateTime(a,t,s);return e.copyTimeZone(i),i}isWeekend(){return 0===this.dayOfWeek()||6===this.dayOfWeek()}toDate(e){const t=this,a=t.month(),s=t.year(),i=t.day(),n=t.hour(),r=t.minute(),o=t.second(),d=t.millisecond();let l=new Date(s,a-1,i);if(s<1970&&l.setFullYear(s),l.setHours(n,r,o,d),e){const a=t.timeZones.filter((function(t){return t.id===e}));if(a.length){let e=a[0].offset;const s=l.getTime();let i=60*l.getTimezoneOffset()*1e3;if(t.timeZone){const e=t.timeZones.filter((function(e){return e.id===t.timeZone}));e.length&&(i=60*-e[0].offset*1e3)}l=new Date(s+i+6e4*e)}}return l}toTimeZone(e){const t=this;let a=e;if(null==a&&(a="Local"),t.timeZone===a)return t.clone();const s=t.timeZones.filter((function(e){return e.id===a}));if(0===s.length)return t.clone();const i=this.toDate(a),n=new Smart.Utilities.DateTime(i);return n.timeZone=a,n.timeZoneOffset=s[0].offset,n.timeZoneOffsetHours=s[0].offsetHours,t.copySmallTimePartValues(n),n}day(){return this.getDatePart(this.datePartDay)}month(){return this.getDatePart(this.datePartMonth)}year(){return this.getDatePart(this.datePartYear)}millisecond(){return parseInt(this.internalMS()%1e3)}hour(){return parseInt(Math.floor(this.internalMS()/this.millisPerHour)%24)}minute(){return parseInt(this.internalMS()/this.millisPerMinute%60)}second(){return parseInt(this.internalMS()/this.millisPerSecond%60)}microsecond(){return this._microsecond}nanosecond(){return this._nanosecond}picosecond(){return this._picosecond}femtosecond(){return this._femtosecond}attosecond(){return this._attosecond}zeptosecond(){return this._zeptosecond}yoctosecond(){return this._yoctosecond}valueOf(){return this.dateData}equals(e){const t=this;return t.dateData===e.dateData&&t._microsecond===e._microsecond&&t._nanosecond===e._nanosecond&&t._picosecond===e._picosecond&&t._femtosecond===e._femtosecond&&t._attosecond===e._attosecond&&t._zeptosecond===e._zeptosecond&&t._yoctosecond===e._yoctosecond}equalDateParts(e){const t=this;return t.year()===e.year()&&t.month()===e.month()&&t.day()===e.day()}compare(e){const t=this;if(t.equals(e))return 0;const a=["dateData","_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"];for(let s=0;s<a.length;s++){const i=a[s];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}toDateString(){return this.toDate().toDateString()}toLocaleDateString(){return this.toDate().toLocaleDateString(this.calendar.locale)}toLocaleString(){return this.toDate().toLocaleString(this.calendar.locale)}toLocaleTimeString(){return this.toDate().toLocaleTimeString(this.calendar.locale)}validateTimeZone(e){const t=this;if("string"!=typeof e)return;const a=t.timeZones.filter((function(t){return t.id===e}));0!==a.length&&(t.timeZone=e,t.timeZoneOffset=a[0].offset,t.timeZoneOffsetHours=a[0].offsetHours)}copyTimeZone(e){const t=this;e.timeZone=t.timeZone,e.timeZoneOffset=t.timeZoneOffset,e.timeZoneOffsetHours=t.timeZoneOffsetHours}getTimeStamp(){return new Smart.Utilities.BigNumber(this.dateData.toString()+this.getFirstNDigitsOfPrecision(void 0,!0))}})})();
825
825
 
826
826
  /***/ }),
827
827
 
828
828
  /***/ 7054:
829
829
  /***/ (() => {
830
830
 
831
- Smart("smart-date-time-picker",class extends Smart.BaseElement{static get properties(){return{animationSettings:{value:null,type:"object"},autoClose:{value:!1,type:"boolean"},autoCloseDelay:{value:0,type:"number"},calendarButton:{value:!1,type:"boolean"},calendarButtonPosition:{value:"right",allowedValues:["left","right"],type:"string"},calendarMode:{value:"default",allowedValues:["default","classic"],type:"string"},dayNameFormat:{value:"firstTwoLetters",allowedValues:["narrow","firstTwoLetters","long","short"],type:"string"},disableAutoNavigation:{value:!1,type:"boolean"},displayKind:{value:"unspecified",allowedValues:["UTC","local","unspecified"],type:"string"},displayModeView:{value:"table",allowedValues:["table","list"],type:"string"},displayMode:{allowedValues:["outlined","filled","underlined"],value:"outlined",type:"string"},dropDownAppendTo:{value:null,type:"any"},dropDownDisplayMode:{value:"default",allowedValues:["default","classic","calendar","timePicker","auto"],type:"string"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPosition:{value:"auto",allowedValues:["auto","bottom","overlay-top","overlay-center","overlay-bottom","top","center-bottom","center-top"],type:"string"},editMode:{value:"default",allowedValues:["default","full","partial"],type:"string"},enableMouseWheelAction:{value:!1,type:"boolean"},firstDayOfWeek:{value:0,type:"number"},footerTemplate:{value:null,type:"any"},footer:{value:!1,type:"boolean"},formatString:{value:"dd-MMM-yy HH:mm:ss.fff",type:"string"},headerTemplate:{value:null,type:"any"},hideDayNames:{value:!1,type:"boolean"},hideOtherMonthDays:{value:!1,type:"boolean"},hideTooltipArrow:{value:!1,type:"boolean"},hint:{value:"",type:"string"},importantDates:{value:[],type:"array"},importantDatesTemplate:{value:null,type:"any"},interval:{value:new Smart.Utilities.TimeSpan(0,0,1),type:"any"},label:{value:"",type:"string"},max:{value:new Smart.Utilities.DateTime(3001,1,1),type:"any"},messages:{value:{en:{now:"Now",dateTabLabel:"DATE",timeTabLabel:"TIME"}},type:"object",extend:!0},min:{value:new Smart.Utilities.DateTime(1600,1,1),type:"any"},name:{value:"",type:"string"},nullable:{value:!1,type:"boolean"},opened:{value:!1,type:"boolean"},placeholder:{value:"Enter date",type:"string"},restrictedDates:{value:[],type:"array"},spinButtons:{value:!1,type:"boolean"},spinButtonsDelay:{value:75,type:"number"},spinButtonsInitialDelay:{value:0,type:"number"},spinButtonsPosition:{value:"right",allowedValues:["left","right"],type:"string"},tooltip:{value:!1,type:"boolean"},tooltipDelay:{value:100,type:"number"},tooltipPosition:{value:"top",allowedValues:["bottom","top","left","right","absolute"],type:"string"},tooltipTemplate:{value:null,type:"any"},validation:{value:"strict",allowedValues:["strict","interaction"],type:"string"},value:{defaultReflectToAttribute:!0,value:new Smart.Utilities.DateTime,type:"any"},weekNumbers:{value:!1,type:"boolean"},weeks:{value:6,type:"number"},yearCutoff:{value:1926,type:"number"}}}static get listeners(){return{"container.mouseout":"_mouseoutHandler","container.mouseover":"_mouseoverHandler","calendarButton.click":"_calendarButtonClickHandler","calendarDropDown.change":"_calendarDropDownChangeHandler","calendarDropDown.click":"_calendarDropDownClickHandler","downButton.click":"_spinButtonsClickHandler","input.blur":"_inputBlurHandler","input.change":"_inputChangeHandler","input.dragstart":"_inputDragstartHandler","input.focus":"_inputFocusHandler","input.keydown":"_inputKeydownHandler","input.down":"_inputDownHandler","input.paste":"_inputPasteHandler","input.select":"_inputSelectHandler","input.up":"_inputUpHandler","input.wheel":"_inputWheelHandler","dropDownContainer.keydown":"_dropDownKeydownHandler","dropDownContainer.transitionend":"_dropDownTransitionendHandler","dropDownHeader.click":"_dropDownHeaderClickHandler","upButton.click":"_spinButtonsClickHandler","document.up":"_documentUpHandler"}}static get requires(){return{"Smart.Utilities.DateTime":"smart.date.js","Smart.Utilities.Draw":"smart.draw.js","Smart.Utilities.BigNumber":"smart.math.js","Smart.Utilities.NumericProcessor":"smart.numeric.js","Smart.RepeatButton":"smart.button.js","Smart.Calendar":"smart.calendar.js","Smart.TimePicker":"smart.timepicker.js"}}static get styleUrls(){return["smart.datetimepicker.css"]}template(){return'<div id="container" role="presentation">\n <span id="label" class="smart-label">[[label]]</span>\n <div id="content" class="smart-content">\n <input id="input" class="smart-input smart-date-time-input" type="text" readonly="[[readonly]]" disabled="[[disabled]]" placeholder="[[placeholder]]" name="[[name]]" aria-label="[[placeholder]]" />\n <div id="spinButtonsContainer" class="smart-spin-buttons-container" role="presentation">\n <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" animation="[[animation]]" delay="[[spinButtonsDelay]]" readonly="[[readonly]]" unfocusable id="upButton" right-to-left="[[rightToLeft]]" class="smart-spin-button" aria-label="Increment">\n <div class="smart-arrow smart-arrow-up" aria-hidden="true"></div>\n </smart-repeat-button>\n <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" animation="[[animation]]" delay="[[spinButtonsDelay]]" readonly="[[readonly]]" unfocusable id="downButton" right-to-left="[[rightToLeft]]" class="smart-spin-button" aria-label="Decrement">\n <div class="smart-arrow smart-arrow-down" aria-hidden="true"></div>\n </smart-repeat-button>\n </div>\n <div id="calendarButton" class="smart-drop-down-button smart-calendar-button" role="button" aria-haspopup="dialog" aria-label="Toggle popup"></div>\n <div id="dropDownContainer" class="smart-drop-down smart-date-time-drop-down smart-drop-down-container smart-visibility-hidden" role="dialog">\n <div id="dropDownHeader" class="smart-drop-down-header smart-hidden" role="heading" aria-level="1">\n <div id="selectDate" class="smart-selected" role="button"></div>\n <div id="selectTime" role="button"></div>\n </div>\n <div id="dropDownContent" class="smart-drop-down-content" role="presentation">\n <smart-calendar id="calendarDropDown" class="smart-hidden"\n animation="[[animation]]"\n animation-settings="[[animationSettings]]"\n calendar-mode="[[calendarMode]]"\n day-name-format="[[dayNameFormat]]"\n disable-auto-navigation="[[disableAutoNavigation]]"\n display-mode-view="[[displayModeView]]"\n first-day-of-week="[[firstDayOfWeek]]"\n header-template="[[headerTemplate]]"\n hide-day-names="[[hideDayNames]]"\n hide-other-month-days="[[hideOtherMonthDays]]"\n hide-tooltip-arrow="[[hideTooltipArrow]]"\n important-dates="[[importantDates]]"\n important-dates-template="[[importantDatesTemplate]]"\n locale="[[locale]]"\n right-to-left="[[rightToLeft]]"\n selection-mode="one"\n spin-buttons-delay="[[spinButtonsDelay]]"\n spin-buttons-initial-delay="[[spinButtonsInitialDelay]]"\n theme="[[theme]]"\n tooltip="[[tooltip]]"\n tooltip-delay="[[tooltipDelay]]"\n tooltip-position="[[tooltipPosition]]"\n tooltip-template="[[tooltipTemplate]]"\n unfocusable="[[unfocusable]]"\n view-sections=\'["header", "footer"]\'\n week-numbers="[[weekNumbers]]"\n weeks="[[weeks]]"></smart-calendar>\n </div>\n </div>\n </div>\n <span id="hint" class="smart-hint smart-hidden">[[hint]]</span>\n </div>'}attached(){const e=this;super.attached(),e.isCompleted&&(e._defaultFooterTemplateApplied&&e._addCalendarFooterListeners(),e.$.timePickerDropDown&&e._addTimePickerListener(),e._positionDetection&&e._positionDetection.dropDownAttached())}detached(){const e=this;if(super.detached(),e.close(),e._defaultFooterTemplateApplied){const t=e.$.calendarDropDown.$footer;t.unlisten("change"),t.unlisten("click"),t.unlisten("wheel")}e.$.timePickerDropDown&&e.$.timePickerDropDown.$.unlisten("change"),e._positionDetection&&e._positionDetection.dropDownDetached()}ready(){super.ready();const e=this;e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._iOS=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),e._edgeMacFF&&e.$dropDownContainer.addClass("not-in-view"),e._defaultFooterTemplate=document.createElement("template"),e._defaultFooterTemplate.innerHTML='<div class="smart-date-time-picker-footer">\n <div class="smart-footer-component smart-footer-component-hour" role="presentation">\n <input type="text" class="smart-hour-element" aria-label="Hours" />\n <span role="presentation">\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Increment hours">\n <span class="smart-arrow smart-arrow-up" aria-hidden="true"></span>\n </smart-repeat-button>\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Decrement hours">\n <span class="smart-arrow smart-arrow-down" aria-hidden="true"></span>\n </smart-repeat-button>\n </span>\n </div>\n <div class="smart-footer-component smart-footer-component-minute" role="presentation">\n <input class="smart-minute-element" aria-label="Minutes" />\n <span role="presentation">\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Increment minutes">\n <span class="smart-arrow smart-arrow-up" aria-hidden="true"></span>\n </smart-repeat-button>\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Decrement minutes">\n <span class="smart-arrow smart-arrow-down" aria-hidden="true"></span>\n </smart-repeat-button>\n </span>\n </div>\n <div class="smart-footer-component smart-footer-component-ampm" role="presentation">\n <input type="text" class="smart-am-pm-element" aria-label="AM/PM" />\n </div>\n <div class="smart-footer-component smart-footer-component-today" role="presentation">\n <div tabindex="-1" class="smart-today-element" role="button" aria-label="Now"></div>\n </div>\n </div>',e._codeToMethod={y:"addYears",yy:"addYears",yyyy:"addYears",yyyyy:"addYears",M:"addMonths",MM:"addMonths",MMM:"addMonths",MMMM:"addMonths",d:"addDays",dd:"addDays",ddd:"addDays",dddd:"addDays",H:"addHours",HH:"addHours",h:"addHours",hh:"addHours",m:"addMinutes",mm:"addMinutes",s:"addSeconds",ss:"addSeconds",f:"addDeciseconds",ff:"addCentiseconds",fff:"addMilliseconds",u:"addMicroseconds",uu:"addMicroseconds",n:"addNanoseconds",nn:"addNanoseconds",p:"addPicoseconds",pp:"addPicoseconds",e:"addFemtoseconds",ee:"addFemtoseconds",a:"addAttoseconds",aa:"addAttoseconds",x:"addZeptoseconds",xx:"addZeptoseconds",o:"addYoctoseconds",oo:"addYoctoseconds"},e._codeToIndex={y:0,yy:0,yyyy:0,yyyyy:0,M:1,MM:1,MMM:1,MMMM:1,d:2,dd:2,ddd:2,dddd:2,H:3,HH:3,h:3,hh:3,m:4,mm:4,s:5,ss:5,f:6,ff:6,fff:6,u:7,uu:7,n:8,nn:8,p:9,pp:9,e:10,ee:10,a:11,aa:11,x:12,xx:12,o:13,oo:13},e._getLocalizedNames(),e.checkLicense()}render(){const e=this;e.rightToLeft&&(e.calendarButtonPosition="right"===e.calendarButtonPosition?"left":"right"),e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.content,"close"),e._positionDetection.customPositionDropDown=e._positionExternalDropDown,e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e.$.dropDownContainer.style.left=null,e._positionDetection.handleAutoPositioning(),e._setIds(),e._validateInitialPropertyValues(),e._setFocusable(),e.setAttribute("role","presentation"),e.$.input.setAttribute("aria-describedby",e.$.hint.id),e.$.input.setAttribute("aria-labelledby",e.$.label.id),e.$.calendarButton.setAttribute("aria-owns",e.$.dropDownContainer.id),e.$.dropDownContainer.setAttribute("animation",e.animation),e.$.dropDownContainer.setAttribute("drop-down-display-mode",e.dropDownDisplayMode),super.render(),e.isInitialized=!0}close(){this.opened&&this._close()}focus(){this.$.input.focus()}select(){this.$.input.select()}open(){this.opened||this._open()}_handleFooter(){const e=this;if(e.footer){e.$.dropDownContainer.setAttribute("footer","");const t=e.$.calendarDropDown;"default"===e._dropDownDisplayMode?t.viewSections=["title","header","footer"]:"classic"===e._dropDownDisplayMode?t.viewSections=["header","footer"]:"calendar"===e._dropDownDisplayMode&&(t.viewSections=["title","header","footer"])}else e.$.dropDownContainer.removeAttribute("footer")}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":n.$.timePickerDropDown&&(n.$.timePickerDropDown[e]=a),"animation"===e&&(n.$.dropDownContainer.setAttribute("animation",n.animation),n._defaultFooterTemplateApplied&&Array.from(n.$.calendarDropDown.$.footer.getElementsByTagName("smart-repeat-button")).forEach((function(e){e.animation=a})));break;case"calendarButton":n.$.dropDownContainer.style.transition="none",a||n.close();break;case"calendarButtonPosition":n.$.dropDownContainer.style.transition="none",n.close(),"left"===a?n.$.content.insertBefore(n.$.calendarButton,n.$.content.firstElementChild):null===n._dropDownParent?n.$.content.insertBefore(n.$.calendarButton,n.$.dropDownContainer):n.$.content.appendChild(n.$.calendarButton);break;case"disabled":a?(n.close(),n.$.upButton.disabled=!0,n.$.downButton.disabled=!0):n._disableSpinButtons(),n._setFocusable(),n._positionDetection.handleAutoPositioning();break;case"displayKind":{const e=n._outputTimeZone;switch(a){case"unspecified":n._outputTimeZone=n._inputTimeZone;break;case"UTC":n._outputTimeZone="UTC";break;case"local":n._outputTimeZone="Local"}if(n._outputTimeZone===e)return;null!==n._value&&(n.close(),n._toSync=!0,n._value=n._value.toTimeZone(n._outputTimeZone),n._applyFormatString()),n.min=n.min.toTimeZone(n._outputTimeZone),n.max=n.max.toTimeZone(n._outputTimeZone);for(let e=0;e<n.restrictedDates.length;e++){let t=n.restrictedDates[e];t=t.toTimeZone(n._outputTimeZone)}break}case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownDisplayMode":n._changeDropDownDisplayMode();break;case"dropDownOverlay":a||n._positionDetection.removeOverlay();break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"footer":n._handleFooter();break;case"footerTemplate":if(null!==a){n._defaultFooterTemplateApplied=!1;const e=n.$.calendarDropDown.$footer;e.unlisten("change"),e.unlisten("click"),e.unlisten("wheel"),n.$.calendarDropDown.footerTemplate=a}else{n._setDefaultFooterTemplate();const e=n._value;n._hourElement.value=e.toString("hh"),n._minuteElement.value=e.toString("mm"),n._ampmElement.value=e.toString("tt")}n._handleFooter();break;case"formatString":""===a&&(n.formatString="dd-MMM-yy HH:mm:ss.fff"),n._getFormatStringRegExp(),n._applyFormatString(),"auto"===n.dropDownDisplayMode&&n._changeDropDownDisplayMode(),n._timePickerInitialized&&(n.$.timePickerDropDown.format=n._formatStringRegExp.groups.find((e=>-1!==e.indexOf("H")))?"24-hour":"12-hour");break;case"interval":n._validateInterval(t);break;case"locale":case"messages":if(n.$.selectDate.innerHTML=n.localize("dateTabLabel"),n.$.selectTime.innerHTML=n.localize("timeTabLabel"),n._defaultFooterTemplateApplied&&(n._todayElement.title=n.localize("now")),"messages"===e)return;n._getLocalizedNames(),n.min.calendar.days=n._localizedDays,n.min.calendar.months=n._localizedMonths,n.min.calendar.locale=n.locale,n.max.calendar.days=n._localizedDays,n.max.calendar.months=n._localizedMonths,n.max.calendar.locale=n.locale,null!==n.value&&(n._value.calendar.days=n._localizedDays,n._value.calendar.months=n._localizedMonths,n._value.calendar.locale=n.locale,n.value.calendar.days=n._localizedDays,n.value.calendar.months=n._localizedMonths,n.value.calendar.locale=n.locale),Smart.Utilities.DateTime.cache=[],n._applyFormatString();break;case"max":case"min":n._validateMinMax(e,t),"strict"===n.validation?n._validateValue():n._minMaxChanged=!0;break;case"nullable":!0===t&&null===n._value&&n._validateValue(n._now(),null);break;case"opened":a?n._open():n._close();break;case"readonly":case"unfocusable":a&&n.close(),"unfocusable"===e&&n._setFocusable();break;case"restrictedDates":n._validateRestrictedDates(),n._validateValue();break;case"spinButtonsPosition":"right"===a?n.$.content.insertBefore(n.$.spinButtonsContainer,n.$.input.nextElementSibling):n.$.content.insertBefore(n.$.spinButtonsContainer,n.$.input);break;case"validation":"strict"===a&&(delete n._minMaxChanged,n._validateValue());break;case"value":{let e;null!==a?(e=Smart.Utilities.DateTime.validateDate(a,n._now(),n.formatString),e=e.toTimeZone(n._outputTimeZone)):e=null,n._validateValue(e,n._value,void 0,!0);break}}}_addCalendarFooterListeners(){const e=this,t=e.$.calendarDropDown.$footer;t.listen("change",e._footerChangeHandler.bind(e)),t.listen("click",e._footerClickHandler.bind(e)),t.listen("wheel",e._footerWheelHandler.bind(e))}_addTimePickerListener(){const e=this;e.$.timePickerDropDown.$.listen("change",(function(t){const a=e.context,n=t.detail.value,i=Smart.Utilities.DateTime.getConstructorParameters(null!==e._value?e._value:e._now());e.context=e,i[3]=n.getHours(),i[4]=n.getMinutes(),e._timePickerInitiatedChange=!0,i.unshift(null),e._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,i))),e._timePickerInitiatedChange=!1,e.context=a}))}_applyFormatString(){const e=this;null!==e.value&&(e.$.input.value=e._value.toString(e.formatString))}_calendarButtonClickHandler(e){const t=this;t._highlightedTimePart=void 0,t.disabled||t.readonly||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t.$.calendarButton,e.pageX,e.pageY),t.opened?t._close():t._open())}_calendarDropDownChangeHandler(e){const t=this;if(e.stopPropagation(),t._disregardCalendarChangeEvent)t._disregardCalendarChangeEvent=!1;else if(this.$.calendarDropDown.selectedDates.length>0){const a=e.detail.value[0],n=null!==t._value?t._value:t._now(),i=Smart.Utilities.DateTime.getConstructorParameters(n);if(i[0]=a.getFullYear(),i[1]=a.getMonth()+1,i[2]=a.getDate(),t._calendarInitiatedChange=!0,i.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,i))),t._defaultFooterTemplateApplied){const e=t._value;""===t._hourElement.value&&(t._hourElement.value=e.toString("hh")),""===t._ampmElement.value&&(t._ampmElement.value=e.toString("tt")),""===t._minuteElement.value&&(t._minuteElement.value=e.toString("mm"))}t._calendarInitiatedChange=!1}else t._setNullValue()}_calendarDropDownClickHandler(e){const t=this;t.autoClose&&e.target.closest(".smart-calendar-cell")&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay))}_changeDropDownDisplayMode(){function e(e,a,n,i){t.$dropDownHeader[e]("smart-hidden"),t.$calendarDropDown[a]("smart-hidden"),t._timePickerInitialized&&t.$.timePickerDropDown.$[n]("smart-hidden"),i&&(t.opened?t.$.calendarDropDown._refreshTitle():t._toSync=!0)}const t=this,a=t._dropDownDisplayMode;t._detectDisplayMode(),t._dropDownDisplayMode!==a&&("default"===t._dropDownDisplayMode?(t.calendarMode="default",t.$.calendarDropDown.viewSections=["title","header"],t.$selectDate.addClass("smart-selected"),t.$selectTime.removeClass("smart-selected"),e("removeClass","removeClass","addClass",!0)):"classic"===t._dropDownDisplayMode?(t.calendarMode="classic",t.$.calendarDropDown.viewSections=["header","footer"],e("addClass","removeClass","addClass")):"calendar"===t._dropDownDisplayMode?(t.calendarMode="default",t.$.calendarDropDown.viewSections=["title","header"],e("addClass","removeClass","addClass",!0)):(t.calendarMode="default",e("addClass","addClass","removeClass"),t._timePickerInitialized||t._initializeTimePicker()),t.$.dropDownContainer.setAttribute("drop-down-display-mode",t.dropDownDisplayMode))}_cloneValue(){const e=this;return null!==e._value?e._value.clone():null}_close(){const e=this;if(e.$.fireEvent("closing").defaultPrevented)e.opened=!0;else{e.$.calendarDropDown.disabled=!0,e.$calendarButton.removeClass("smart-calendar-button-pressed"),e.$.calendarButton.removeAttribute("active"),e.$dropDownContainer.addClass("smart-visibility-hidden");const t=e.$.calendarDropDown.$.container.querySelector(".smart-calendar-cell[hover]");t&&t.removeAttribute("hover"),e.opened=!1,e._positionDetection.removeOverlay(!0),e.$.fireEvent("close"),e._edgeMacFF&&!e.hasAnimation&&(e.$.dropDownContainer.style.top=null,e.$.dropDownContainer.style.left=null,e.$dropDownContainer.addClass("not-in-view")),e.$.input.focus()}e.$.calendarButton.setAttribute("aria-expanded",e.opened)}_detectDisplayMode(){const e=this;"auto"!==e.dropDownDisplayMode?e._dropDownDisplayMode=e.dropDownDisplayMode:e._dropDownDisplayMode=Smart.Utilities.DateTime.detectDisplayMode(e.value||e.min,e.formatString,e._formatStringRegExp),"timePicker"===e._dropDownDisplayMode?(e.$calendarButton.addClass("time"),"Enter date"===e.placeholder&&(e.placeholder="Enter time")):(e.$calendarButton.removeClass("time"),"Enter time"===e.placeholder&&(e.placeholder="Enter date")),"default"===e._dropDownDisplayMode?e.$dropDownContent.removeClass("partial"):e.$dropDownContent.addClass("partial")}_disableSpinButtons(){const e=this;if(e.disabled)return;const t=null===e._value;e.$.upButton.disabled=t,e.$.downButton.disabled=t}_documentUpHandler(e){const t=this,a=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement,n=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;Smart.Utilities.Core.isMobile||a!==t.$.input||"partial"!==t.editMode||null===t._value||n===t.$.input&&t.$.input.selectionStart!==t.$.input.selectionEnd?n===t.$.calendarButton||t.$.dropDownContainer.contains(n)||t.$.dropDownContainer.contains(t._getRootShadowHost(n))||(t.close(),a===t.$.input||t.contains(n)||(t._highlightedTimePart=void 0)):(t._highlightedTimePartEdit=!1,t._validateValue(t.$.input.value,t._cloneValue(),!1),t._highlightTimePartBasedOnCursor()),t._mouseFocus=!1}_getRootShadowHost(e){const t=this;if(!t.shadowRoot&&!t.isInShadowDOM)return;let a,n=e.getRootNode().host;for(;n&&n!==t&&n!==document;)a=n,n=n.getRootNode().host;return a}_dropDownHeaderClickHandler(e){const t=this;if(e.target===t.$.selectDate){if(t.$selectDate.hasClass("smart-selected"))return;t.$selectDate.addClass("smart-selected"),t.$selectTime.removeClass("smart-selected"),t.$.timePickerDropDown.$.addClass("smart-hidden"),t.$calendarDropDown.removeClass("smart-hidden")}else{if(t.$selectTime.hasClass("smart-selected"))return;t.$selectDate.removeClass("smart-selected"),t.$selectTime.addClass("smart-selected"),t.$calendarDropDown.addClass("smart-hidden"),t._timePickerInitialized?t.$.timePickerDropDown.$.removeClass("smart-hidden"):t._initializeTimePicker()}}_dropDownKeydownHandler(e){const t=this,a=e.key,n=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;!t.$.dropDownHeader.contains(n)||"Enter"!==a&&" "!==a?"Escape"===a||e.altKey&&"ArrowUp"===a?(e.preventDefault(),t.close(),t.$.input.focus()):"Enter"!==a&&" "!==a||!n.classList.contains("smart-footer-component-today")?"Enter"===a&&(n===t.$.calendarDropDown.$.body&&t.$.calendarDropDown.querySelectorAll(".smart-calendar-cell[selected][focus]").length>0||t._timePickerInitialized&&n===t.$.timePickerDropDown.$.picker)&&(e.preventDefault(),t.close()):(e.preventDefault(),t._validateValue(t._now()),t.close()):(e.preventDefault(),t._dropDownHeaderClickHandler({target:n}))}_dropDownTransitionendHandler(){const e=this;if(e.hasAnimation)return e.opened&&e._toFocus?(e._toFocus.focus(),delete e._toFocus,void(e._timePickerInitialized&&!e.$.timePickerDropDown.classList.contains("smart-hidden")&&requestAnimationFrame((()=>e.$.timePickerDropDown._highlightLabel())))):e._edgeMacFF&&!e.opened?(e.$.dropDownContainer.style.top=null,e.$.dropDownContainer.style.left=null,void e.$dropDownContainer.addClass("not-in-view")):void 0}_footerChangeHandler(e){const t=this,a=t.context,n=e.target,i=null!==t._value?t._value:t._now();let o,l=n.value;if(t.context=t,e.stopPropagation(),n.classList.contains("smart-hour-element")){if(l=parseInt(l,10),isNaN(l)||l<0||l>12)return void(n.value=i.toString("hh"));l>0&&l<12&&"PM"===i.toString("tt")&&(l+=12),o="hh"}else{if(!n.classList.contains("smart-minute-element")){if(null===t._value)return void(n.value="");const e=i.toString("tt");return l=l.toLowerCase(),void("PM"===e&&("a"===l||"am"===l)||"AM"===e&&("p"===l||"pm"===l)?(t._incrementDecrement(void 0,"tt"),n.value=t._value.toString("tt")):n.value=e)}if(l=parseInt(l,10),isNaN(l)||l<0||l>59)return void(n.value=i.toString("mm"));o="mm"}const r=Smart.Utilities.DateTime.getConstructorParameters(i);r[t._codeToIndex[o]]=l,r.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,r))),n.value=t._value.toString(o),t.context=a}_footerClickHandler(e){const t=this,a=t.context,n=e.target;if(t.context=t,n.classList.contains("smart-today-element"))t._validateValue(t._now()),t.autoClose&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay));else{const e=n.closest("smart-repeat-button");if(null!==e){const a=e===e.parentElement.children[1],n=e.closest(".smart-footer-component").classList.contains("smart-footer-component-hour")?"hh":"mm";t._incrementDecrement(a,n)}}t.context=a}_footerWheelHandler(e){const t=this,a=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;if(t.enableMouseWheelAction&&e.target instanceof HTMLInputElement&&a===e.target){const a=t.context,n=e.target;t.context=t,n.classList.contains("smart-hour-element")?t._incrementDecrement(e.deltaY>0,"hh"):n.classList.contains("smart-minute-element")?t._incrementDecrement(e.deltaY>0,"mm"):t._incrementDecrement(void 0,"tt"),t.context=a,e.stopPropagation()}}_getAndHighlightTimePart(e,t,a){const n=this;n._programmaticSelection=!0,n.$.input.selectionStart!==e||n.$.input.selectionEnd!==t?n.$.input.setSelectionRange(e,t):setTimeout((function(){n.$.input.setSelectionRange(e,t)}),200),n._highlightedTimePart={code:n._formatStringRegExp.groups[a],index:a,from:e,to:t}}_getFormatStringRegExp(){const e=this;e._formatStringRegExp=e.min.getParseRegExp(e.min.calendar,e.formatString.replace(/y+/g,"yyyyy")),e._formatStringRegExp.regExp=new RegExp(e._formatStringRegExp.regExp)}_getLocalizedNames(){const e=this,t=Smart.Utilities.DateTime.getLocalizedNames(e.locale);e._localizedDays=t.days,e._localizedMonths=t.months,e.$.selectDate.innerHTML=e.localize("dateTabLabel"),e.$.selectTime.innerHTML=e.localize("timeTabLabel")}_handleManualTimePartEdit(e){const t=this,a=Smart.Utilities.DateTime.getConstructorParameters(t._value);if(e=e[t._highlightedTimePart.index+1],isNaN(e)){if(1===t._codeToIndex[t._highlightedTimePart.code]){let n=-1;if(e.length>1&&t._localizedMonths.names.some((function(t,a){if(-1!==t.toLowerCase().indexOf(e.toLowerCase()))return n=a,!0})),-1===n)return void t._applyFormatString();a[1]=n+1}}else{if("f"===t._highlightedTimePart.code)e=100*parseInt(e,10);else if("ff"===t._highlightedTimePart.code)e=10*parseInt(e,10);else if(-1!==t._highlightedTimePart.code.indexOf("y")&&e.length<3){const a=t.yearCutoff.toString(),n=parseInt(a.slice(2),10);let i=parseInt(a.slice(0,2),10);(e=parseInt(e,10))<n&&i++,e=e.toString(),e=i+""+"0".repeat(2-e.length)+e}else if(-1!==t._highlightedTimePart.code.indexOf("h")){const a=t._value.hour();e=parseInt(e,10),a>11&&e<=11&&(e+=12)}a[t._codeToIndex[t._highlightedTimePart.code]]=parseInt(e,10)}try{a.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,a)))}catch(e){t._applyFormatString()}}_highlightTimePartBasedOnCursor(e){const t=this,a=t.$.input.value,n=t._formatStringRegExp.regExp.exec(a);function i(){return void 0===e?t.$.input.selectionStart:e}if(null===n)return void(t._highlightedTimePart=void 0);t._iOS||void 0!==e||(e=t.$.input.selectionStart);let o,l=n.index;for(let e=1;e<n.length;e++){const r=n[e];if(o=a.indexOf(r,l),l=o+r.length,1===e&&i()<o){t._getAndHighlightTimePart(o,l,0);break}if(i()>=o&&i()<=l){t._getAndHighlightTimePart(o,l,e-1);break}const s=n[e+1];if(!s){t._programmaticSelection=!0,t.$.input.setSelectionRange(o,l),t._highlightedTimePart={code:t._formatStringRegExp.groups[e-1],index:e-1,from:o,to:l};break}{const n=a.indexOf(s,l);if(i()>l&&i()<n){i()-l<=n-i()?t._getAndHighlightTimePart(o,l,e-1):(t._formatStringRegExp.groups[e],t._programmaticSelection=!0,t.$.input.setSelectionRange(n,n+s.length));break}}}}_highlightTimePartBasedOnIndex(e){const t=this,a=t.$.input.value,n=t._formatStringRegExp.regExp.exec(a);if(null===n)return t._validateValue(void 0,t._cloneValue(),!1),void t._highlightTimePartBasedOnIndex(e);let i,o=n.index;const l=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;if(!(e<0||e>=n.length)){t.$.input!==l&&t.$.input.focus();for(let l=1;l<n.length;l++){const r=n[l];if(i=a.indexOf(r,o),o=i+r.length,e===l-1){t._getAndHighlightTimePart(i,o,e);break}}}}_incrementDecrement(e,t){const a=this,n=a._cloneValue();if(a._minMaxChanged&&(a._value=a._rangeValidation(a._value),delete a._minMaxChanged),void 0===t&&a._highlightedTimePart&&(t=a._highlightedTimePart.code),void 0!==t){if("z"===t||"zz"===t||"zzz"===t)return void a._highlightTimePartBasedOnIndex(a._highlightedTimePart.index);a._value="t"===t||"tt"===t?a._value.addHours(a._value.hour()<12?12:-12,!0):a._value[a._codeToMethod[t]](e?-1:1,!0),a._validateValue(void 0,n,!1),a._highlightedTimePart&&a._highlightTimePartBasedOnIndex(a._highlightedTimePart.index)}else a._value=a._value.add(e?a.interval.negate():a.interval,void 0,!0),a._validateValue(void 0,n,!1);0!==n.compare(a._value)&&a.isInitialized&&a.$.fireEvent("change",{oldValue:n.toTimeZone(a._inputTimeZone),value:a.value})}_initializeTimePicker(){const e=this,t=document.createElement("smart-time-picker");t.rightToLeft=e.rightToLeft,t.animation=e.animation,t.format=e._formatStringRegExp.groups.find((e=>-1!==e.indexOf("H")))?"24-hour":"12-hour",t.theme=e.theme,t.value=null!==e._value?e._value.toDate():e._now(),e.$.timePickerDropDown=t,t.$=Smart.Utilities.Extend(t),e.$.dropDownContent.appendChild(t),e._timePickerInitialized=!0,e._addTimePickerListener()}_inputBlurHandler(){const e=this;e.removeAttribute("focus"),e._fullEdit=!1,e._highlightedTimePartEdit=!1,e.$.fireEvent("blur")}_inputChangeHandler(e){const t=this;if(e&&e.stopPropagation(),""!==t.$.input.value){if(t._fullEdit||null===t._value)t._fullEdit=!1,t._validateValue(t.$.input.value),t._highlightTimePartBasedOnCursor();else if(t._highlightedTimePartEdit){t._highlightedTimePartEdit=!1;let e=t._formatStringRegExp.regExp.exec(t.$.input.value);null!==e?t._handleManualTimePartEdit(e):t._applyFormatString()}}else t._setNullValue()}_inputDragstartHandler(e){e.preventDefault()}_inputFocusHandler(){const e=this;if(e.setAttribute("focus",""),"full"!==e.editMode){const t=Smart.Utilities.Core.isMobile?10:0;setTimeout((function(){e._iOS?e._highlightTimePartBasedOnCursor():!0!==e._mouseFocus&&(void 0===e._highlightedTimePart?e._highlightTimePartBasedOnCursor(e._iOS?void 0:0):e._highlightTimePartBasedOnIndex(e._highlightedTimePart.index))}),t)}e.$.fireEvent("focus")}_inputKeydownHandler(e){const t=this,a=t.editMode,n=e.key;if("Tab"!==n){if(e.altKey&&"ArrowDown"===n)return e.preventDefault(),void t.open();if("Escape"===n||e.altKey&&"ArrowUp"===n)return e.preventDefault(),void t.close();if("full"!==a){if("partial"===a){if("Delete"===n)return void(null!==t._value&&(t._setNullValue(),e.preventDefault()));if(null===t._value&&(t._validateValue(t._now(),null,!1),t._highlightTimePartBasedOnIndex(0)),-1!==["/",".","-",","," "].indexOf(n))return t._inputChangeHandler(),t._navigateToNextTimePart(),void e.preventDefault();if("Backspace"===n)return t._resetTimePart(),t._highlightedTimePart.index>0?t._navigateToPreviousTimePart():t._highlightTimePartBasedOnIndex(0),void e.preventDefault()}else if(t._fullEdit||t._highlightedTimePartEdit||t.readonly||-1!==["Alt","Control","Shift"].indexOf(n)||e.altKey||e.ctrlKey)return;if(-1!==["End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].indexOf(n)){if(e.preventDefault(),"partial"===a&&t._highlightedTimePartEdit&&t._inputChangeHandler(),null!==t._value)switch(n){case"End":t._highlightTimePartBasedOnIndex(t._formatStringRegExp.groups.length-1);break;case"Home":t._highlightTimePartBasedOnIndex(0);break;case"ArrowLeft":t._navigateToPreviousTimePart();break;case"ArrowUp":t._incrementDecrement();break;case"ArrowRight":t._navigateToNextTimePart();break;case"ArrowDown":t._incrementDecrement(!0)}}else if(t._highlightedTimePart){if("partial"!==a&&t._highlightedTimePart.to-t._highlightedTimePart.from!=t.$.input.selectionEnd-t.$.input.selectionStart)return void(t._fullEdit=!0);const i=t._highlightedTimePart.code;if("ddd"===i||"dddd"===i||"z"===i||"zz"===i||"zzz"===i||"t"===i||"tt"===i)return void e.preventDefault();if("partial"===a&&"MMM"!==i&&"MMMM"!==i&&!1===new RegExp(/^\d+$/).test(n))return void((n.length<2||"F"!==n.charAt(0))&&e.preventDefault());t._highlightedTimePartEdit=!0}}else t._fullEdit=!0}}_inputDownHandler(){const e=this;e._fullEdit||e._highlightedTimePartEdit||"full"===e.editMode||Smart.Utilities.Core.isMobile||setTimeout((function(){e._mouseFocus=!0,e._highlightTimePartBasedOnCursor()}),0)}_inputPasteHandler(e){"partial"===this.editMode?e.preventDefault():this._fullEdit=!0}_inputSelectHandler(){const e=this,t=e.shadowRoot?e.shadowRoot.activeElement:document.activeElement;"partial"===e.editMode&&t===e.$.input&&(!0===e._programmaticSelection?e._programmaticSelection=!1:e._highlightedTimePart?e._highlightTimePartBasedOnIndex(e._highlightedTimePart.index):e._highlightTimePartBasedOnIndex(0))}_inputUpHandler(){const e=this;Smart.Utilities.Core.isMobile&&(e._iOS?(e._mouseFocus=!0,setTimeout((function(){document.activeElement===e.$.input&&e._highlightTimePartBasedOnCursor()}),50)):setTimeout((function(){e._mouseFocus=!0,e._highlightTimePartBasedOnCursor()}),10))}_inputWheelHandler(e){const t=this;(t.shadowRoot?t.shadowRoot.activeElement:document.activeElement)!==t.$.input||!t.enableMouseWheelAction||t.disabled||t.readonly||(e.preventDefault(),t._incrementDecrement(e.deltaY>0))}_isRestricted(e){const t=this.restrictedDates;let a=!1;for(let n=0;n<t.length;n++)if(e.equalDateParts(t[n])){a=!0;break}return a}_mouseoutHandler(e){const t=this,a=e.target;t.disabled||a!==t.$.input&&a!==t.$.calendarButton||(a.removeAttribute("hover"),t.removeAttribute("hover"))}_mouseoverHandler(e){const t=this,a=e.target;t.disabled||a!==t.$.input&&a!==t.$.calendarButton||(a.setAttribute("hover",""),t.setAttribute("hover",""))}_navigateToNextTimePart(){this._highlightTimePartBasedOnIndex(this._highlightedTimePart.index+1)}_navigateToPreviousTimePart(){this._highlightTimePartBasedOnIndex(this._highlightedTimePart.index-1)}_now(){const e=this,t=new Smart.Utilities.DateTime("today","Local");return"Local"!==e._outputTimeZone?t.toTimeZone(e._outputTimeZone):t}_open(e){const t=this;if(t.disabled||t.readonly)return t.opened=!1,void t.$.calendarButton.setAttribute("aria-expanded",!1);if(t.$.fireEvent("opening").defaultPrevented)return t.opened=!1,void t.$.calendarButton.setAttribute("aria-expanded",!1);t._edgeMacFF&&t.$dropDownContainer.removeClass("not-in-view");const a=t.$.dropDownContainer;a.style.marginLeft=null,e||(a.style.transition=""),t.$.calendarDropDown.disabled=!1,t.$calendarButton.addClass("smart-calendar-button-pressed"),t.$.calendarButton.setAttribute("active",""),("default"!==t._dropDownDisplayMode&&"timePicker"!==t._dropDownDisplayMode||!t._timePickerInitialized||t._timePickerInitialized&&t.$.timePickerDropDown.$.hasClass("smart-hidden"))&&t.$calendarDropDown.removeClass("smart-hidden"),t.opened=!0,t.$.calendarButton.setAttribute("aria-expanded",!0),t._positionDetection.placeOverlay(),t._positionDetection.checkBrowserBounds("vertically"),t._positionDetection.positionDropDown(),t.$dropDownContainer.removeClass("smart-visibility-hidden");const n=1===window.devicePixelRatio?document.documentElement.clientWidth:window.innerWidth,i=a.getBoundingClientRect();if(i.left<0?a.style.marginLeft=-1*i.left+"px":i.right>n&&(a.style.marginLeft=n-i.right+"px"),t.$.fireEvent("open"),t._toSync){const e=t._value;if(null!==e)t._disregardCalendarChangeEvent=!0,t.$.calendarDropDown.selectedDates=[e.toDate()],t._defaultFooterTemplateApplied&&(t._hourElement.value=e.toString("hh"),t._minuteElement.value=e.toString("mm"),t._ampmElement.value=e.toString("tt")),t._timePickerInitialized&&(t.$.timePickerDropDown.value=e.toDate());else{const e=t.$.calendarDropDown.context;t.$.calendarDropDown.context=t.$.calendarDropDown,t.$.calendarDropDown._clearSelection(!0),t.$.calendarDropDown.context=e,t._defaultFooterTemplateApplied&&(t._hourElement.value="",t._minuteElement.value="",t._ampmElement.value="")}t._toSync=!1}let o;switch(t._dropDownDisplayMode){case"default":o=t.$selectDate.hasClass("smart-selected")?t.$.calendarDropDown:t.$.timePickerDropDown.$.picker;break;case"classic":case"calendar":o=t.$.calendarDropDown;break;case"timePicker":o=t.$.timePickerDropDown.$.picker}t.hasAnimation?(t._toFocus=o,function e(){t._toFocus&&(0===t.$.dropDownContainer.getBoundingClientRect().height?requestAnimationFrame(e):t._dropDownTransitionendHandler())}()):o.focus()}_positionExternalDropDown(e){const t=this.context,a=!t.calendarButton||"right"===t.calendarButtonPosition,n=t._dropDownListPosition,i=t.$.dropDownContainer;let o,l=a?e.right-i.offsetWidth:e.left;switch(n){case"bottom":o=e.bottom;break;case"overlay-top":o=e.bottom-i.offsetHeight;break;case"overlay-center":o=e.top+e.height/2-i.offsetHeight/2;break;case"overlay-bottom":o=e.top;break;case"top":o=e.top-i.offsetHeight;break;case"center-bottom":case"center-top":o="center-bottom"===n?e.bottom+5:e.top-5-i.offsetHeight,l=a?e.right-i.offsetWidth/2-t.$.calendarButton.offsetWidth/2:e.left-i.offsetWidth/2+t.$.calendarButton.offsetWidth/2}return{left:l,top:o}}_rangeValidation(e){const t=this;return-1===e.compare(t.min)?t.min.clone():1===e.compare(t.max)?t.max.clone():e}_resetTimePart(){const e=this,t=e._highlightedTimePart.code,a=e._codeToIndex[t],n=Smart.Utilities.DateTime.getConstructorParameters(e._value);let i;i=a>2?0:a>0?1:e.min.year(),n[a]=i,n.unshift(null),e._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,n)))}_setIds(){const e=this;e.$.label.id||(e.$.label.id=e.id+"Label"),e.$.input.id||(e.$.input.id=e.id+"Input"),e.$.calendarButton.id||(e.$.calendarButton.id=e.id+"CalendarButton"),e.$.dropDownContainer.id||(e.$.dropDownContainer.id=e.id+"DropDownContainer"),e.$.hint.id||(e.$.hint.id=e.id+"Hint")}_setDefaultFooterTemplate(e){const t=this;t.$.calendarDropDown.footerTemplate=t._defaultFooterTemplate,e&&t.$.calendarDropDown._handleLayoutTemplate(t.$.calendarDropDown.$.footer,t._defaultFooterTemplate),t._hourElement=t.$.calendarDropDown.getElementsByClassName("smart-hour-element")[0],t._minuteElement=t.$.calendarDropDown.getElementsByClassName("smart-minute-element")[0],t._ampmElement=t.$.calendarDropDown.getElementsByClassName("smart-am-pm-element")[0],t._todayElement=t.$.calendarDropDown.getElementsByClassName("smart-today-element")[0],t._todayElement.title=t.localize("now"),Array.from(t.$.calendarDropDown.$.footer.getElementsByTagName("smart-repeat-button")).forEach((function(e){e.animation=t.animation})),t._addCalendarFooterListeners(),t._defaultFooterTemplateApplied=!0}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.$.input.tabIndex=-1,e.$.selectDate.removeAttribute("tabindex"),e.$.selectTime.removeAttribute("tabindex"),void(e._defaultFooterTemplateApplied&&(e._hourElement.tabIndex=-1,e._ampmElement.tabIndex=-1,e._minuteElement.tabIndex=-1));const t=e.tabIndex>0?e.tabIndex:0;e.$.input.removeAttribute("tabindex"),e.$.selectDate.tabIndex=t,e.$.selectTime.tabIndex=t,e._defaultFooterTemplateApplied&&(e._hourElement.removeAttribute("tabindex"),e._ampmElement.removeAttribute("tabindex"),e._minuteElement.removeAttribute("tabindex"),e.$.calendarDropDown.getElementsByClassName("smart-footer-component-today")[0].tabIndex=t)}_setNullValue(e){const t=this;if(void 0===e&&(e=t._cloneValue()),t.nullable){if(t._value=null,t.value=null,t._highlightedTimePart=void 0,t.$.input.value="",null!==e){if(t.opened){if(!t._calendarInitiatedChange){const e=t.$.calendarDropDown.context;t.$.calendarDropDown.context=t.$.calendarDropDown,t.$.calendarDropDown._clearSelection(!0),t.$.calendarDropDown.context=e}t._defaultFooterTemplateApplied&&(t._hourElement.value="",t._ampmElement.value="",t._minuteElement.value=""),t._toSync=!1}else t._toSync=!0;t.isInitialized&&t.$.fireEvent("change",{oldValue:e.toTimeZone(t._inputTimeZone),value:null})}t._disableSpinButtons()}else t._validateValue(t._now(),e)}_spinButtonsClickHandler(e){const t=this;null===t._value||t.disabled||t.readonly||t._incrementDecrement(t.$.downButton.contains(e.target))}_validateInitialPropertyValues(){const e=this,t=e.$.calendarDropDown;"left"===e.calendarButtonPosition&&e.$.content.insertBefore(e.$.calendarButton,e.$.input),"left"===e.spinButtonsPosition&&e.$.content.insertBefore(e.$.spinButtonsContainer,e.$.input),e.disabled&&(e.$.upButton.disabled=!0,e.$.downButton.disabled=!0),e.opened&&(e.disabled||e.readonly?e.opened=!1:(e.$.dropDownContainer.style.transition="none",e._open(!0))),e.$.calendarButton.setAttribute("aria-expanded",e.opened),null===e.footerTemplate?e._setDefaultFooterTemplate(!0):(t.footerTemplate=e.footerTemplate,t._handleLayoutTemplate(t.$.footer,e.footerTemplate)),""===e.formatString&&(e.formatString="dd-MMM-yy HH:mm:ss.fff");const a=e.displayKind;let n;if("UTC"===a?e._outputTimeZone="UTC":"local"===a&&(e._outputTimeZone="Local"),null!==e.value?(n=Smart.Utilities.DateTime.validateDate(e.value,new Smart.Utilities.DateTime,e.formatString),e._inputTimeZone=n.timeZone,"unspecified"!==a&&e._inputTimeZone!==e._outputTimeZone?n=n.toTimeZone(e._outputTimeZone):"unspecified"===a&&(e._outputTimeZone=e._inputTimeZone)):(n=null,e._inputTimeZone="Local"),e._validateRestrictedDates(),e._validateMinMax("both"),e._validateValue(n,e._now(),!1,!0),e._validateInterval(new Smart.Utilities.TimeSpan(0,0,1)),e._getFormatStringRegExp(),e._defaultFooterTemplateApplied&&""===e._hourElement.value&&null!==e.value){const t=e.value;e._hourElement.value=t.toString("hh"),e._ampmElement.value=t.toString("tt"),e._minuteElement.value=t.toString("mm")}e._detectDisplayMode();const i=e._dropDownDisplayMode;"default"===i||"calendar"===i?(t.viewSections=["title","header"],t.$title.hasClass("smart-hidden")&&t.propertyChangedHandler("viewSections",["header","footer"],["title","header"]),"default"===i&&e.$dropDownHeader.removeClass("smart-hidden")):"timePicker"===i&&(e.$calendarDropDown.addClass("smart-hidden"),e._initializeTimePicker()),e.footer&&e._handleFooter()}_validateInterval(e){const t=this,a=t.interval;let n=a;if(a instanceof Smart.Utilities.TimeSpan)n=a;else if("string"==typeof a){const i=a.indexOf("TimeSpan("),o=a.indexOf(")");if(-1!==i&&-1!==o&&(n=a.slice(i+9,o),n=n.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),new RegExp(/(^(\d+)(,\s*\d+)*$)/g).test(n)&&(n=n.replace(/\s/g,""),n=n.split(","),n.map((function(e,t){n[t]=parseInt(e)})),n.unshift(null),n=new(Function.prototype.bind.apply(Smart.Utilities.TimeSpan,n)))),n instanceof Smart.Utilities.TimeSpan==0){if(""===n.trim())return void(t.interval=e);isNaN(n)||(n=1e4*parseInt(n,10));try{n=new Smart.Utilities.TimeSpan(n)}catch(a){return void(t.interval=e)}}}else{if("number"!=typeof a)return void(t.interval=e);n=new Smart.Utilities.TimeSpan(a)}0===n._ticks?t.interval=e:t.interval=n}_validateMinMax(e,t){const a=this;let n=!1;"max"!==e&&(a.min=Smart.Utilities.DateTime.validateDate(a.min,t||new Smart.Utilities.DateTime(1600,1,1),a.formatString),a.min=a.min.toTimeZone(a._outputTimeZone),n=!0),"min"!==e&&(a.max=Smart.Utilities.DateTime.validateDate(a.max,t||new Smart.Utilities.DateTime(3001,1,1),a.formatString),a.max=a.max.toTimeZone(a._outputTimeZone),a.max.calendar.days=a._localizedDays,a.max.calendar.months=a._localizedMonths,a.max.calendar.locale=a.locale,a.$.calendarDropDown.max=a.max.toDate()),a.min.compare(a.max)>0&&(a.min=a.max.clone(),n=!0),n&&(a.min.calendar.days=a._localizedDays,a.min.calendar.months=a._localizedMonths,a.min.calendar.locale=a.locale,a.$.calendarDropDown.min=a.min.toDate())}_validateRestrictedDates(){const e=this,t=[],a=[];for(let n=0;n<e.restrictedDates.length;n++){const i=e.restrictedDates[n];let o=Smart.Utilities.DateTime.validateDate(i,"invalid",e.formatString);"invalid"!==o&&(o=o.toTimeZone(e._outputTimeZone),t.push(o),a.push(o.toDate()))}e.restrictedDates=t,e.$.calendarDropDown.restrictedDates=a}_validateValue(e,t,a,n){const i=this,o=void 0!==t?t:i._cloneValue();if(null===e||""===e)return void i._setNullValue(o);if(void 0!==e&&(i._value=Smart.Utilities.DateTime.validateDate(e,o,i.formatString)),null===i._value)return void i._setNullValue(o);let l=i._value;for(;!0===i._isRestricted(l);)l.addDays(1,!1);const r=i._rangeValidation(l);n&&"strict"!==i.validation?!1===l.equals(r)&&(i._minMaxChanged=!0):(i._value=r,delete i._minMaxChanged),i.value=i._value.toTimeZone(i._inputTimeZone);const s=i._value;if(s.calendar.days=i._localizedDays,s.calendar.months=i._localizedMonths,s.calendar.locale=i.locale,i._applyFormatString(),i._disableSpinButtons(),(null===o||null===s)&&o!==s||null!==o&&null!==s&&0!==o.compare(s)){if(!1!==a&&i.isInitialized&&i.$.fireEvent("change",{oldValue:null!==o?o.toTimeZone(i._inputTimeZone):null,value:i.value}),i._calendarInitiatedChange)return;i.opened?(null!==o&&0!==i.$.calendarDropDown.selectedDates.length&&o.year()===s.year()&&o.month()===s.month()&&o.day()===s.day()&&i.$.calendarDropDown._isDateInView(s.toDate())||(i._disregardCalendarChangeEvent=!0,i.$.calendarDropDown.selectedDates=[s.toDate()]),i._defaultFooterTemplateApplied&&(null!==o&&o.hour()===s.hour()||(i._hourElement.value=s.toString("hh"),i._ampmElement.value=s.toString("tt")),null!==o&&o.minute()===s.minute()||(i._minuteElement.value=s.toString("mm"))),i._timePickerInitialized&&!i._timePickerInitiatedChange&&(i.$.timePickerDropDown.value=s.toDate()),i._toSync=!1):i._toSync=!0}}});
831
+ Smart("smart-date-time-picker",class extends Smart.BaseElement{static get properties(){return{animationSettings:{value:null,type:"object"},autoClose:{value:!1,type:"boolean"},autoCloseDelay:{value:0,type:"number"},calendarButton:{value:!1,type:"boolean"},calendarButtonPosition:{value:"right",allowedValues:["left","right"],type:"string"},calendarMode:{value:"default",allowedValues:["default","classic"],type:"string"},dayNameFormat:{value:"firstTwoLetters",allowedValues:["narrow","firstTwoLetters","long","short"],type:"string"},disableAutoNavigation:{value:!1,type:"boolean"},displayKind:{value:"unspecified",allowedValues:["UTC","local","unspecified"],type:"string"},displayModeView:{value:"table",allowedValues:["table","list"],type:"string"},displayMode:{allowedValues:["outlined","filled","underlined"],value:"outlined",type:"string"},dropDownAppendTo:{value:null,type:"any"},dropDownDisplayMode:{value:"default",allowedValues:["default","classic","calendar","timePicker","auto"],type:"string"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPosition:{value:"auto",allowedValues:["auto","bottom","overlay-top","overlay-center","overlay-bottom","top","center-bottom","center-top"],type:"string"},editMode:{value:"default",allowedValues:["default","full","partial"],type:"string"},enableMouseWheelAction:{value:!1,type:"boolean"},firstDayOfWeek:{value:0,type:"number"},footerTemplate:{value:null,type:"any"},footer:{value:!1,type:"boolean"},formatString:{value:"dd-MMM-yy HH:mm:ss.fff",type:"string"},headerTemplate:{value:null,type:"any"},hideDayNames:{value:!1,type:"boolean"},hideOtherMonthDays:{value:!1,type:"boolean"},hideTooltipArrow:{value:!1,type:"boolean"},hint:{value:"",type:"string"},importantDates:{value:[],type:"array"},importantDatesTemplate:{value:null,type:"any"},interval:{value:new Smart.Utilities.TimeSpan(0,0,1),type:"any"},label:{value:"",type:"string"},max:{value:new Smart.Utilities.DateTime(3001,1,1),type:"any"},messages:{value:{en:{now:"Now",dateTabLabel:"DATE",timeTabLabel:"TIME"}},type:"object",extend:!0},min:{value:new Smart.Utilities.DateTime(1600,1,1),type:"any"},name:{value:"",type:"string"},nullable:{value:!1,type:"boolean"},opened:{value:!1,type:"boolean"},placeholder:{value:"Enter date",type:"string"},restrictedDates:{value:[],type:"array"},spinButtons:{value:!1,type:"boolean"},spinButtonsDelay:{value:75,type:"number"},spinButtonsInitialDelay:{value:0,type:"number"},spinButtonsPosition:{value:"right",allowedValues:["left","right"],type:"string"},tooltip:{value:!1,type:"boolean"},tooltipDelay:{value:100,type:"number"},tooltipPosition:{value:"top",allowedValues:["bottom","top","left","right","absolute"],type:"string"},tooltipTemplate:{value:null,type:"any"},validation:{value:"strict",allowedValues:["strict","interaction"],type:"string"},value:{defaultReflectToAttribute:!0,value:new Smart.Utilities.DateTime,type:"any"},weekNumbers:{value:!1,type:"boolean"},weeks:{value:6,type:"number"},yearCutoff:{value:1926,type:"number"}}}static get listeners(){return{"container.mouseout":"_mouseoutHandler","container.mouseover":"_mouseoverHandler","calendarButton.click":"_calendarButtonClickHandler","calendarDropDown.change":"_calendarDropDownChangeHandler","calendarDropDown.click":"_calendarDropDownClickHandler","downButton.click":"_spinButtonsClickHandler","input.blur":"_inputBlurHandler","input.change":"_inputChangeHandler","input.dragstart":"_inputDragstartHandler","input.focus":"_inputFocusHandler","input.keydown":"_inputKeydownHandler","input.down":"_inputDownHandler","input.paste":"_inputPasteHandler","input.select":"_inputSelectHandler","input.up":"_inputUpHandler","input.wheel":"_inputWheelHandler","dropDownContainer.keydown":"_dropDownKeydownHandler","dropDownContainer.transitionend":"_dropDownTransitionendHandler","dropDownHeader.click":"_dropDownHeaderClickHandler","upButton.click":"_spinButtonsClickHandler","document.up":"_documentUpHandler"}}static get requires(){return{"Smart.Utilities.DateTime":"smart.date.js","Smart.Utilities.Draw":"smart.draw.js","Smart.Utilities.BigNumber":"smart.math.js","Smart.Utilities.NumericProcessor":"smart.numeric.js","Smart.RepeatButton":"smart.button.js","Smart.Calendar":"smart.calendar.js","Smart.TimePicker":"smart.timepicker.js"}}static get styleUrls(){return["smart.datetimepicker.css"]}template(){return'<div id="container" role="presentation">\n <span id="label" class="smart-label">[[label]]</span>\n <div id="content" class="smart-content">\n <input id="input" class="smart-input smart-date-time-input" type="text" readonly="[[readonly]]" disabled="[[disabled]]" placeholder="[[placeholder]]" name="[[name]]" aria-label="[[placeholder]]" />\n <div id="spinButtonsContainer" class="smart-spin-buttons-container" role="presentation">\n <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" animation="[[animation]]" delay="[[spinButtonsDelay]]" readonly="[[readonly]]" unfocusable id="upButton" right-to-left="[[rightToLeft]]" class="smart-spin-button" aria-label="Increment">\n <div class="smart-arrow smart-arrow-up" aria-hidden="true"></div>\n </smart-repeat-button>\n <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" animation="[[animation]]" delay="[[spinButtonsDelay]]" readonly="[[readonly]]" unfocusable id="downButton" right-to-left="[[rightToLeft]]" class="smart-spin-button" aria-label="Decrement">\n <div class="smart-arrow smart-arrow-down" aria-hidden="true"></div>\n </smart-repeat-button>\n </div>\n <div id="calendarButton" class="smart-drop-down-button smart-calendar-button" role="button" aria-haspopup="dialog" aria-label="Toggle popup"></div>\n <div id="dropDownContainer" class="smart-drop-down smart-date-time-drop-down smart-drop-down-container smart-visibility-hidden" role="dialog">\n <div id="dropDownHeader" class="smart-drop-down-header smart-hidden" role="heading" aria-level="1">\n <div id="selectDate" class="smart-selected" role="button"></div>\n <div id="selectTime" role="button"></div>\n </div>\n <div id="dropDownContent" class="smart-drop-down-content" role="presentation">\n <smart-calendar id="calendarDropDown" class="smart-hidden"\n animation="[[animation]]"\n animation-settings="[[animationSettings]]"\n calendar-mode="[[calendarMode]]"\n day-name-format="[[dayNameFormat]]"\n disable-auto-navigation="[[disableAutoNavigation]]"\n display-mode-view="[[displayModeView]]"\n first-day-of-week="[[firstDayOfWeek]]"\n header-template="[[headerTemplate]]"\n hide-day-names="[[hideDayNames]]"\n hide-other-month-days="[[hideOtherMonthDays]]"\n hide-tooltip-arrow="[[hideTooltipArrow]]"\n important-dates="[[importantDates]]"\n important-dates-template="[[importantDatesTemplate]]"\n locale="[[locale]]"\n right-to-left="[[rightToLeft]]"\n selection-mode="one"\n spin-buttons-delay="[[spinButtonsDelay]]"\n spin-buttons-initial-delay="[[spinButtonsInitialDelay]]"\n theme="[[theme]]"\n tooltip="[[tooltip]]"\n tooltip-delay="[[tooltipDelay]]"\n tooltip-position="[[tooltipPosition]]"\n tooltip-template="[[tooltipTemplate]]"\n unfocusable="[[unfocusable]]"\n view-sections=\'["header", "footer"]\'\n week-numbers="[[weekNumbers]]"\n weeks="[[weeks]]"></smart-calendar>\n </div>\n </div>\n </div>\n <span id="hint" class="smart-hint smart-hidden">[[hint]]</span>\n </div>'}attached(){const e=this;super.attached(),e.isCompleted&&(e._defaultFooterTemplateApplied&&e._addCalendarFooterListeners(),e.$.timePickerDropDown&&e._addTimePickerListener(),e._positionDetection&&e._positionDetection.dropDownAttached())}detached(){const e=this;if(super.detached(),e.close(),e._defaultFooterTemplateApplied){const t=e.$.calendarDropDown.$footer;t.unlisten("change"),t.unlisten("click"),t.unlisten("wheel")}e.$.timePickerDropDown&&e.$.timePickerDropDown.$.unlisten("change"),e._positionDetection&&e._positionDetection.dropDownDetached()}ready(){super.ready();const e=this;e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._iOS=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),e._edgeMacFF&&e.$dropDownContainer.addClass("not-in-view"),e._defaultFooterTemplate=document.createElement("template"),e._defaultFooterTemplate.innerHTML='<div class="smart-date-time-picker-footer">\n <div class="smart-footer-component smart-footer-component-hour" role="presentation">\n <input type="text" class="smart-hour-element" aria-label="Hours" />\n <span role="presentation">\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Increment hours">\n <span class="smart-arrow smart-arrow-up" aria-hidden="true"></span>\n </smart-repeat-button>\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Decrement hours">\n <span class="smart-arrow smart-arrow-down" aria-hidden="true"></span>\n </smart-repeat-button>\n </span>\n </div>\n <div class="smart-footer-component smart-footer-component-minute" role="presentation">\n <input class="smart-minute-element" aria-label="Minutes" />\n <span role="presentation">\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Increment minutes">\n <span class="smart-arrow smart-arrow-up" aria-hidden="true"></span>\n </smart-repeat-button>\n <smart-repeat-button initial-delay="0" delay="75" aria-label="Decrement minutes">\n <span class="smart-arrow smart-arrow-down" aria-hidden="true"></span>\n </smart-repeat-button>\n </span>\n </div>\n <div class="smart-footer-component smart-footer-component-ampm" role="presentation">\n <input type="text" class="smart-am-pm-element" aria-label="AM/PM" />\n </div>\n <div class="smart-footer-component smart-footer-component-today" role="presentation">\n <div tabindex="-1" class="smart-today-element" role="button" aria-label="Now"></div>\n </div>\n </div>',e._codeToMethod={y:"addYears",yy:"addYears",yyyy:"addYears",yyyyy:"addYears",M:"addMonths",MM:"addMonths",MMM:"addMonths",MMMM:"addMonths",d:"addDays",dd:"addDays",ddd:"addDays",dddd:"addDays",H:"addHours",HH:"addHours",h:"addHours",hh:"addHours",m:"addMinutes",mm:"addMinutes",s:"addSeconds",ss:"addSeconds",f:"addDeciseconds",ff:"addCentiseconds",fff:"addMilliseconds",u:"addMicroseconds",uu:"addMicroseconds",n:"addNanoseconds",nn:"addNanoseconds",p:"addPicoseconds",pp:"addPicoseconds",e:"addFemtoseconds",ee:"addFemtoseconds",a:"addAttoseconds",aa:"addAttoseconds",x:"addZeptoseconds",xx:"addZeptoseconds",o:"addYoctoseconds",oo:"addYoctoseconds"},e._codeToIndex={y:0,yy:0,yyyy:0,yyyyy:0,M:1,MM:1,MMM:1,MMMM:1,d:2,dd:2,ddd:2,dddd:2,H:3,HH:3,h:3,hh:3,m:4,mm:4,s:5,ss:5,f:6,ff:6,fff:6,u:7,uu:7,n:8,nn:8,p:9,pp:9,e:10,ee:10,a:11,aa:11,x:12,xx:12,o:13,oo:13},e._getLocalizedNames(),e.checkLicense()}render(){const e=this;e.rightToLeft&&(e.calendarButtonPosition="right"===e.calendarButtonPosition?"left":"right"),e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.content,"close"),e._positionDetection.customPositionDropDown=e._positionExternalDropDown,e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e.$.dropDownContainer.style.left=null,e._positionDetection.handleAutoPositioning(),e._setIds(),e._validateInitialPropertyValues(),e._setFocusable(),e.setAttribute("role","presentation"),e.$.input.setAttribute("aria-describedby",e.$.hint.id),e.$.input.setAttribute("aria-labelledby",e.$.label.id),e.$.calendarButton.setAttribute("aria-owns",e.$.dropDownContainer.id),e.$.dropDownContainer.setAttribute("animation",e.animation),e.$.dropDownContainer.setAttribute("drop-down-display-mode",e.dropDownDisplayMode),super.render(),e.isInitialized=!0}close(){this.opened&&this._close()}focus(){this.$.input.focus()}select(){this.$.input.select()}open(){this.opened||this._open()}_handleFooter(){const e=this;if(e.footer){e.$.dropDownContainer.setAttribute("footer","");const t=e.$.calendarDropDown;"default"===e._dropDownDisplayMode?t.viewSections=["title","header","footer"]:"classic"===e._dropDownDisplayMode?t.viewSections=["header","footer"]:"calendar"===e._dropDownDisplayMode&&(t.viewSections=["title","header","footer"])}else e.$.dropDownContainer.removeAttribute("footer")}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":n.$.timePickerDropDown&&(n.$.timePickerDropDown[e]=a),"animation"===e&&(n.$.dropDownContainer.setAttribute("animation",n.animation),n._defaultFooterTemplateApplied&&Array.from(n.$.calendarDropDown.$.footer.getElementsByTagName("smart-repeat-button")).forEach((function(e){e.animation=a})));break;case"calendarButton":n.$.dropDownContainer.style.transition="none",a||n.close();break;case"calendarButtonPosition":n.$.dropDownContainer.style.transition="none",n.close(),"left"===a?n.$.content.insertBefore(n.$.calendarButton,n.$.content.firstElementChild):null===n._dropDownParent?n.$.content.insertBefore(n.$.calendarButton,n.$.dropDownContainer):n.$.content.appendChild(n.$.calendarButton);break;case"disabled":a?(n.close(),n.$.upButton.disabled=!0,n.$.downButton.disabled=!0):n._disableSpinButtons(),n._setFocusable(),n._positionDetection.handleAutoPositioning();break;case"displayKind":{const e=n._outputTimeZone;switch(a){case"unspecified":n._outputTimeZone=n._inputTimeZone;break;case"UTC":n._outputTimeZone="UTC";break;case"local":n._outputTimeZone="Local"}if(n._outputTimeZone===e)return;null!==n._value&&(n.close(),n._toSync=!0,n._value=n._value.toTimeZone(n._outputTimeZone),n._applyFormatString()),n.min=n.min.toTimeZone(n._outputTimeZone),n.max=n.max.toTimeZone(n._outputTimeZone);for(let e=0;e<n.restrictedDates.length;e++){let t=n.restrictedDates[e];t=t.toTimeZone(n._outputTimeZone)}break}case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownDisplayMode":n._changeDropDownDisplayMode();break;case"dropDownOverlay":a||n._positionDetection.removeOverlay();break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"footer":n._handleFooter();break;case"footerTemplate":if(null!==a){n._defaultFooterTemplateApplied=!1;const e=n.$.calendarDropDown.$footer;e.unlisten("change"),e.unlisten("click"),e.unlisten("wheel"),n.$.calendarDropDown.footerTemplate=a}else{n._setDefaultFooterTemplate();const e=n._value;n._hourElement.value=e.toString("hh"),n._minuteElement.value=e.toString("mm"),n._ampmElement.value=e.toString("tt")}n._handleFooter();break;case"formatString":""===a&&(n.formatString="dd-MMM-yy HH:mm:ss.fff"),n._getFormatStringRegExp(),n._applyFormatString(),"auto"===n.dropDownDisplayMode&&n._changeDropDownDisplayMode(),n._timePickerInitialized&&(n.$.timePickerDropDown.format=n._formatStringRegExp.groups.find((e=>-1!==e.indexOf("H")))?"24-hour":"12-hour");break;case"interval":n._validateInterval(t);break;case"locale":case"messages":if(n.$.selectDate.innerHTML=n.localize("dateTabLabel"),n.$.selectTime.innerHTML=n.localize("timeTabLabel"),n._defaultFooterTemplateApplied&&(n._todayElement.title=n.localize("now")),"messages"===e)return;n._getLocalizedNames(),n.min.calendar.days=n._localizedDays,n.min.calendar.months=n._localizedMonths,n.min.calendar.locale=n.locale,n.max.calendar.days=n._localizedDays,n.max.calendar.months=n._localizedMonths,n.max.calendar.locale=n.locale,null!==n.value&&(n._value.calendar.days=n._localizedDays,n._value.calendar.months=n._localizedMonths,n._value.calendar.locale=n.locale,n.value.calendar.days=n._localizedDays,n.value.calendar.months=n._localizedMonths,n.value.calendar.locale=n.locale),Smart.Utilities.DateTime.cache=[],n._applyFormatString();break;case"max":case"min":n._validateMinMax(e,t),"strict"===n.validation?n._validateValue():n._minMaxChanged=!0;break;case"nullable":!0===t&&null===n._value&&n._validateValue(n._now(),null);break;case"opened":a?n._open():n._close();break;case"readonly":case"unfocusable":a&&n.close(),"unfocusable"===e&&n._setFocusable();break;case"restrictedDates":n._validateRestrictedDates(),n._validateValue();break;case"spinButtonsPosition":"right"===a?n.$.content.insertBefore(n.$.spinButtonsContainer,n.$.input.nextElementSibling):n.$.content.insertBefore(n.$.spinButtonsContainer,n.$.input);break;case"validation":"strict"===a&&(delete n._minMaxChanged,n._validateValue());break;case"value":{let e;null!==a?(e=Smart.Utilities.DateTime.validateDate(a,n._now(),n.formatString),e=e.toTimeZone(n._outputTimeZone)):e=null,n._validateValue(e,n._value,void 0,!0);break}}}_addCalendarFooterListeners(){const e=this,t=e.$.calendarDropDown.$footer;t.listen("change",e._footerChangeHandler.bind(e)),t.listen("click",e._footerClickHandler.bind(e)),t.listen("wheel",e._footerWheelHandler.bind(e))}_addTimePickerListener(){const e=this;e.$.timePickerDropDown.$.listen("change",(function(t){const a=e.context,n=t.detail.value,i=Smart.Utilities.DateTime.getConstructorParameters(null!==e._value?e._value:e._now());e.context=e,i[3]=n.getHours(),i[4]=n.getMinutes(),e._timePickerInitiatedChange=!0,i.unshift(null),e._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,i))),e._timePickerInitiatedChange=!1,e.context=a}))}_applyFormatString(){const e=this;null!==e.value&&(e.$.input.value=e._value.toString(e.formatString))}_calendarButtonClickHandler(e){const t=this;t._highlightedTimePart=void 0,t.disabled||t.readonly||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t.$.calendarButton,e.pageX,e.pageY),t.opened?t._close():t._open())}_calendarDropDownChangeHandler(e){const t=this;if(e.stopPropagation(),t._disregardCalendarChangeEvent)t._disregardCalendarChangeEvent=!1;else if(this.$.calendarDropDown.selectedDates.length>0){const a=e.detail.value[0],n=null!==t._value?t._value:t._now(),i=Smart.Utilities.DateTime.getConstructorParameters(n);if(i[0]=a.getFullYear(),i[1]=a.getMonth()+1,i[2]=a.getDate(),t._calendarInitiatedChange=!0,i.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,i))),t._defaultFooterTemplateApplied){const e=t._value;""===t._hourElement.value&&(t._hourElement.value=e.toString("hh")),""===t._ampmElement.value&&(t._ampmElement.value=e.toString("tt")),""===t._minuteElement.value&&(t._minuteElement.value=e.toString("mm"))}t._calendarInitiatedChange=!1}else t._setNullValue()}_calendarDropDownClickHandler(e){const t=this;t.autoClose&&e.target.closest(".smart-calendar-cell")&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay))}_changeDropDownDisplayMode(){function e(e,a,n,i){t.$dropDownHeader[e]("smart-hidden"),t.$calendarDropDown[a]("smart-hidden"),t._timePickerInitialized&&t.$.timePickerDropDown.$[n]("smart-hidden"),i&&(t.opened?t.$.calendarDropDown._refreshTitle():t._toSync=!0)}const t=this,a=t._dropDownDisplayMode;t._detectDisplayMode(),t._dropDownDisplayMode!==a&&("default"===t._dropDownDisplayMode?(t.calendarMode="default",t.$.calendarDropDown.viewSections=["title","header"],t.$selectDate.addClass("smart-selected"),t.$selectTime.removeClass("smart-selected"),e("removeClass","removeClass","addClass",!0)):"classic"===t._dropDownDisplayMode?(t.calendarMode="classic",t.$.calendarDropDown.viewSections=["header","footer"],e("addClass","removeClass","addClass")):"calendar"===t._dropDownDisplayMode?(t.calendarMode="default",t.$.calendarDropDown.viewSections=["title","header"],e("addClass","removeClass","addClass",!0)):(t.calendarMode="default",e("addClass","addClass","removeClass"),t._timePickerInitialized||t._initializeTimePicker()),t.$.dropDownContainer.setAttribute("drop-down-display-mode",t.dropDownDisplayMode))}_cloneValue(){const e=this;return null!==e._value?e._value.clone():null}_close(){const e=this;if(e.$.fireEvent("closing").defaultPrevented)e.opened=!0;else{e.$.calendarDropDown.disabled=!0,e.$calendarButton.removeClass("smart-calendar-button-pressed"),e.$.calendarButton.removeAttribute("active"),e.$dropDownContainer.addClass("smart-visibility-hidden");const t=e.$.calendarDropDown.$.container.querySelector(".smart-calendar-cell[hover]");t&&t.removeAttribute("hover"),e.opened=!1,e._positionDetection.removeOverlay(!0),e.$.fireEvent("close"),e._edgeMacFF&&!e.hasAnimation&&(e.$.dropDownContainer.style.top=null,e.$.dropDownContainer.style.left=null,e.$dropDownContainer.addClass("not-in-view")),e.$.input.focus()}e.$.calendarButton.setAttribute("aria-expanded",e.opened)}_detectDisplayMode(){const e=this;"auto"!==e.dropDownDisplayMode?e._dropDownDisplayMode=e.dropDownDisplayMode:e._dropDownDisplayMode=Smart.Utilities.DateTime.detectDisplayMode(e.value||e.min,e.formatString,e._formatStringRegExp),"timePicker"===e._dropDownDisplayMode?(e.$calendarButton.addClass("time"),"Enter date"===e.placeholder&&(e.placeholder="Enter time")):(e.$calendarButton.removeClass("time"),"Enter time"===e.placeholder&&(e.placeholder="Enter date")),"default"===e._dropDownDisplayMode?e.$dropDownContent.removeClass("partial"):e.$dropDownContent.addClass("partial")}_disableSpinButtons(){const e=this;if(e.disabled)return;const t=null===e._value;e.$.upButton.disabled=t,e.$.downButton.disabled=t}_documentUpHandler(e){const t=this,a=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement,n=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;Smart.Utilities.Core.isMobile||a!==t.$.input||"partial"!==t.editMode||null===t._value||n===t.$.input&&t.$.input.selectionStart!==t.$.input.selectionEnd?n===t.$.calendarButton||t.$.dropDownContainer.contains(n)||t.$.dropDownContainer.contains(t._getRootShadowHost(n))||(t.close(),a===t.$.input||t.contains(n)||(t._highlightedTimePart=void 0)):(t._highlightedTimePartEdit=!1,t._validateValue(t.$.input.value,t._cloneValue(),!1),t._highlightTimePartBasedOnCursor()),t._mouseFocus=!1}_getRootShadowHost(e){const t=this;if(!t.shadowRoot&&!t.isInShadowDOM)return;let a,n=e.getRootNode().host;for(;n&&n!==t&&n!==document;)a=n,n=n.getRootNode().host;return a}_dropDownHeaderClickHandler(e){const t=this;if(e.target===t.$.selectDate){if(t.$selectDate.hasClass("smart-selected"))return;t.$selectDate.addClass("smart-selected"),t.$selectTime.removeClass("smart-selected"),t.$.timePickerDropDown.$.addClass("smart-hidden"),t.$calendarDropDown.removeClass("smart-hidden")}else{if(t.$selectTime.hasClass("smart-selected"))return;t.$selectDate.removeClass("smart-selected"),t.$selectTime.addClass("smart-selected"),t.$calendarDropDown.addClass("smart-hidden"),t._timePickerInitialized?t.$.timePickerDropDown.$.removeClass("smart-hidden"):t._initializeTimePicker()}}_dropDownKeydownHandler(e){const t=this,a=e.key,n=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;!t.$.dropDownHeader.contains(n)||"Enter"!==a&&" "!==a?"Escape"===a||e.altKey&&"ArrowUp"===a?(e.preventDefault(),t.close(),t.$.input.focus()):"Enter"!==a&&" "!==a||!n.classList.contains("smart-footer-component-today")?"Enter"===a&&(n===t.$.calendarDropDown.$.body&&t.$.calendarDropDown.querySelectorAll(".smart-calendar-cell[selected][focus]").length>0||t._timePickerInitialized&&n===t.$.timePickerDropDown.$.picker)&&(e.preventDefault(),t.close()):(e.preventDefault(),t._validateValue(t._now()),t.close()):(e.preventDefault(),t._dropDownHeaderClickHandler({target:n}))}_dropDownTransitionendHandler(){const e=this;if(e.hasAnimation)return e.opened&&e._toFocus?(e._toFocus.focus(),delete e._toFocus,void(e._timePickerInitialized&&!e.$.timePickerDropDown.classList.contains("smart-hidden")&&requestAnimationFrame((()=>e.$.timePickerDropDown._highlightLabel())))):e._edgeMacFF&&!e.opened?(e.$.dropDownContainer.style.top=null,e.$.dropDownContainer.style.left=null,void e.$dropDownContainer.addClass("not-in-view")):void 0}_footerChangeHandler(e){const t=this,a=t.context,n=e.target,i=null!==t._value?t._value:t._now();let o,l=n.value;if(t.context=t,e.stopPropagation(),n.classList.contains("smart-hour-element")){if(l=parseInt(l,10),isNaN(l)||l<0||l>12)return void(n.value=i.toString("hh"));l>0&&l<12&&"PM"===i.toString("tt")&&(l+=12),o="hh"}else{if(!n.classList.contains("smart-minute-element")){if(null===t._value)return void(n.value="");const e=i.toString("tt");return l=l.toLowerCase(),void("PM"===e&&("a"===l||"am"===l)||"AM"===e&&("p"===l||"pm"===l)?(t._incrementDecrement(void 0,"tt"),n.value=t._value.toString("tt")):n.value=e)}if(l=parseInt(l,10),isNaN(l)||l<0||l>59)return void(n.value=i.toString("mm"));o="mm"}const r=Smart.Utilities.DateTime.getConstructorParameters(i);r[t._codeToIndex[o]]=l,r.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,r))),n.value=t._value.toString(o),t.context=a}_footerClickHandler(e){const t=this,a=t.context,n=e.target;if(t.context=t,n.classList.contains("smart-today-element"))t._validateValue(t._now()),t.autoClose&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay));else{const e=n.closest("smart-repeat-button");if(null!==e){const a=e===e.parentElement.children[1],n=e.closest(".smart-footer-component").classList.contains("smart-footer-component-hour")?"hh":"mm";t._incrementDecrement(a,n)}}t.context=a}_footerWheelHandler(e){const t=this,a=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;if(t.enableMouseWheelAction&&e.target instanceof HTMLInputElement&&a===e.target){const a=t.context,n=e.target;t.context=t,n.classList.contains("smart-hour-element")?t._incrementDecrement(e.deltaY>0,"hh"):n.classList.contains("smart-minute-element")?t._incrementDecrement(e.deltaY>0,"mm"):t._incrementDecrement(void 0,"tt"),t.context=a,e.stopPropagation()}}_getAndHighlightTimePart(e,t,a){const n=this;n._programmaticSelection=!0,n.$.input.selectionStart!==e||n.$.input.selectionEnd!==t?n.$.input.setSelectionRange(e,t):setTimeout((function(){n.$.input.setSelectionRange(e,t)}),200),n._highlightedTimePart={code:n._formatStringRegExp.groups[a],index:a,from:e,to:t}}_getFormatStringRegExp(){const e=this;e._formatStringRegExp=e.min.getParseRegExp(e.min.calendar,e.formatString.replace(/y+/g,"yyyyy")),e._formatStringRegExp.regExp=new RegExp(e._formatStringRegExp.regExp)}_getLocalizedNames(){const e=this,t=Smart.Utilities.DateTime.getLocalizedNames(e.locale);e._localizedDays=t.days,e._localizedMonths=t.months,e.$.selectDate.innerHTML=e.localize("dateTabLabel"),e.$.selectTime.innerHTML=e.localize("timeTabLabel")}_handleManualTimePartEdit(e){const t=this,a=Smart.Utilities.DateTime.getConstructorParameters(t._value);if(e=e[t._highlightedTimePart.index+1],isNaN(e)){if(1===t._codeToIndex[t._highlightedTimePart.code]){let n=-1;if(e.length>1&&t._localizedMonths.names.some((function(t,a){if(-1!==t.toLowerCase().indexOf(e.toLowerCase()))return n=a,!0})),-1===n)return void t._applyFormatString();a[1]=n+1}}else{if("f"===t._highlightedTimePart.code)e=100*parseInt(e,10);else if("ff"===t._highlightedTimePart.code)e=10*parseInt(e,10);else if(-1!==t._highlightedTimePart.code.indexOf("y")&&e.length<3){const a=t.yearCutoff.toString(),n=parseInt(a.slice(2),10);let i=parseInt(a.slice(0,2),10);(e=parseInt(e,10))<n&&i++,e=e.toString(),e=i+""+"0".repeat(2-e.length)+e}else if(-1!==t._highlightedTimePart.code.indexOf("h")){const a=t._value.hour();e=parseInt(e,10),a>11&&e<=11&&(e+=12)}a[t._codeToIndex[t._highlightedTimePart.code]]=parseInt(e,10)}try{a.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,a)))}catch(e){t._applyFormatString()}}_highlightTimePartBasedOnCursor(e){const t=this,a=t.$.input.value,n=t._formatStringRegExp.regExp.exec(a);function i(){return void 0===e?t.$.input.selectionStart:e}if(null===n)return void(t._highlightedTimePart=void 0);t._iOS||void 0!==e||(e=t.$.input.selectionStart);let o,l=n.index;for(let e=1;e<n.length;e++){const r=n[e];if(o=a.indexOf(r,l),l=o+r.length,1===e&&i()<o){t._getAndHighlightTimePart(o,l,0);break}if(i()>=o&&i()<=l){t._getAndHighlightTimePart(o,l,e-1);break}const s=n[e+1];if(!s){t._programmaticSelection=!0,t.$.input.setSelectionRange(o,l),t._highlightedTimePart={code:t._formatStringRegExp.groups[e-1],index:e-1,from:o,to:l};break}{const n=a.indexOf(s,l);if(i()>l&&i()<n){i()-l<=n-i()?t._getAndHighlightTimePart(o,l,e-1):(t._formatStringRegExp.groups[e],t._programmaticSelection=!0,t.$.input.setSelectionRange(n,n+s.length));break}}}}_highlightTimePartBasedOnIndex(e){const t=this,a=t.$.input.value,n=t._formatStringRegExp.regExp.exec(a);if(null===n)return t._validateValue(void 0,t._cloneValue(),!1),void t._highlightTimePartBasedOnIndex(e);let i,o=n.index;const l=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;if(!(e<0||e>=n.length)){t.$.input!==l&&t.$.input.focus();for(let l=1;l<n.length;l++){const r=n[l];if(i=a.indexOf(r,o),o=i+r.length,e===l-1){t._getAndHighlightTimePart(i,o,e);break}}}}_incrementDecrement(e,t){const a=this,n=a._cloneValue();if(a._minMaxChanged&&(a._value=a._rangeValidation(a._value),delete a._minMaxChanged),void 0===t&&a._highlightedTimePart&&(t=a._highlightedTimePart.code),void 0!==t){if("z"===t||"zz"===t||"zzz"===t)return void a._highlightTimePartBasedOnIndex(a._highlightedTimePart.index);a._value="t"===t||"tt"===t?a._value.addHours(a._value.hour()<12?12:-12,!0):a._value[a._codeToMethod[t]](e?-1:1,!0),a._validateValue(void 0,n,!1),a._highlightedTimePart&&a._highlightTimePartBasedOnIndex(a._highlightedTimePart.index)}else a._value=a._value.add(e?a.interval.negate():a.interval,void 0,!0),a._validateValue(void 0,n,!1);0!==n.compare(a._value)&&a.isInitialized&&a.$.fireEvent("change",{oldValue:n.toTimeZone(a._inputTimeZone),value:a.value})}_initializeTimePicker(){const e=this,t=document.createElement("smart-time-picker");t.rightToLeft=e.rightToLeft,t.animation=e.animation,t.format=e._formatStringRegExp.groups.find((e=>-1!==e.indexOf("H")))?"24-hour":"12-hour",t.theme=e.theme,t.value=null!==e._value?e._value.toDate():e._now(),e.$.timePickerDropDown=t,t.$=Smart.Utilities.Extend(t),e.$.dropDownContent.appendChild(t),e._timePickerInitialized=!0,e._addTimePickerListener()}_inputBlurHandler(){const e=this;e.removeAttribute("focus"),e._fullEdit=!1,e._highlightedTimePartEdit=!1,e.$.fireEvent("blur")}_inputChangeHandler(e){const t=this;if(e&&e.stopPropagation(),""!==t.$.input.value){if(t._fullEdit||null===t._value)t._fullEdit=!1,t._validateValue(t.$.input.value),t._highlightTimePartBasedOnCursor();else if(t._highlightedTimePartEdit){t._highlightedTimePartEdit=!1;let e=t._formatStringRegExp.regExp.exec(t.$.input.value);null!==e?t._handleManualTimePartEdit(e):t._applyFormatString()}}else t._setNullValue()}_inputDragstartHandler(e){e.preventDefault()}_inputFocusHandler(){const e=this;if(e.setAttribute("focus",""),"full"!==e.editMode){const t=Smart.Utilities.Core.isMobile?10:0;setTimeout((function(){e._iOS?e._highlightTimePartBasedOnCursor():!0!==e._mouseFocus&&(void 0===e._highlightedTimePart?e._highlightTimePartBasedOnCursor(e._iOS?void 0:0):e._highlightTimePartBasedOnIndex(e._highlightedTimePart.index))}),t)}e.$.fireEvent("focus")}_inputKeydownHandler(e){const t=this,a=t.editMode,n=e.key;if("Tab"!==n){if(e.altKey&&"ArrowDown"===n)return e.preventDefault(),void t.open();if("Escape"===n||e.altKey&&"ArrowUp"===n)return e.preventDefault(),void t.close();if("full"!==a){if("partial"===a){if("Delete"===n)return void(null!==t._value&&(t._setNullValue(),e.preventDefault()));if(null===t._value&&(t._validateValue(t._now(),null,!1),t._highlightTimePartBasedOnIndex(0)),-1!==["/",".","-",","," "].indexOf(n))return t._inputChangeHandler(),t._navigateToNextTimePart(),void e.preventDefault();if("Backspace"===n)return t._resetTimePart(),t._highlightedTimePart.index>0?t._navigateToPreviousTimePart():t._highlightTimePartBasedOnIndex(0),void e.preventDefault()}else if(t._fullEdit||t._highlightedTimePartEdit||t.readonly||-1!==["Alt","Control","Shift"].indexOf(n)||e.altKey||e.ctrlKey)return;if(-1!==["End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].indexOf(n)){if(e.preventDefault(),"partial"===a&&t._highlightedTimePartEdit&&t._inputChangeHandler(),null!==t._value)switch(n){case"End":t._highlightTimePartBasedOnIndex(t._formatStringRegExp.groups.length-1);break;case"Home":t._highlightTimePartBasedOnIndex(0);break;case"ArrowLeft":t._navigateToPreviousTimePart();break;case"ArrowUp":t._incrementDecrement();break;case"ArrowRight":t._navigateToNextTimePart();break;case"ArrowDown":t._incrementDecrement(!0)}}else if(t._highlightedTimePart){if("partial"!==a&&t._highlightedTimePart.to-t._highlightedTimePart.from!=t.$.input.selectionEnd-t.$.input.selectionStart)return void(t._fullEdit=!0);const i=t._highlightedTimePart.code;if("ddd"===i||"dddd"===i||"z"===i||"zz"===i||"zzz"===i||"t"===i||"tt"===i)return void e.preventDefault();if("partial"===a&&"MMM"!==i&&"MMMM"!==i&&!1===new RegExp(/^\d+$/).test(n))return void((n.length<2||"F"!==n.charAt(0))&&e.preventDefault());t._highlightedTimePartEdit=!0}}else t._fullEdit=!0}}_inputDownHandler(){const e=this;e._fullEdit||e._highlightedTimePartEdit||"full"===e.editMode||Smart.Utilities.Core.isMobile||setTimeout((function(){e._mouseFocus=!0,e._highlightTimePartBasedOnCursor()}),0)}_inputPasteHandler(e){"partial"===this.editMode?e.preventDefault():this._fullEdit=!0}_inputSelectHandler(){const e=this,t=e.shadowRoot?e.shadowRoot.activeElement:document.activeElement;"partial"===e.editMode&&t===e.$.input&&(!0===e._programmaticSelection?e._programmaticSelection=!1:e._highlightedTimePart?e._highlightTimePartBasedOnIndex(e._highlightedTimePart.index):e._highlightTimePartBasedOnIndex(0))}_inputUpHandler(){const e=this;Smart.Utilities.Core.isMobile&&(e._iOS?(e._mouseFocus=!0,setTimeout((function(){document.activeElement===e.$.input&&e._highlightTimePartBasedOnCursor()}),50)):setTimeout((function(){e._mouseFocus=!0,e._highlightTimePartBasedOnCursor()}),10))}_inputWheelHandler(e){const t=this;(t.shadowRoot?t.shadowRoot.activeElement:document.activeElement)!==t.$.input||!t.enableMouseWheelAction||t.disabled||t.readonly||(e.preventDefault(),t._incrementDecrement(e.deltaY>0))}_isRestricted(e){const t=this.restrictedDates;let a=!1;for(let n=0;n<t.length;n++)if(e.equalDateParts(t[n])){a=!0;break}return a}_mouseoutHandler(e){const t=this,a=e.target;t.disabled||a!==t.$.input&&a!==t.$.calendarButton||(a.removeAttribute("hover"),t.removeAttribute("hover"))}_mouseoverHandler(e){const t=this,a=e.target;t.disabled||a!==t.$.input&&a!==t.$.calendarButton||(a.setAttribute("hover",""),t.setAttribute("hover",""))}_navigateToNextTimePart(){this._highlightTimePartBasedOnIndex(this._highlightedTimePart.index+1)}_navigateToPreviousTimePart(){this._highlightTimePartBasedOnIndex(this._highlightedTimePart.index-1)}_now(){const e=this,t=new Smart.Utilities.DateTime("today","Local");return"Local"!==e._outputTimeZone?t.toTimeZone(e._outputTimeZone):t}_open(e){const t=this;if(t.disabled||t.readonly)return t.opened=!1,void t.$.calendarButton.setAttribute("aria-expanded",!1);if(t.$.fireEvent("opening").defaultPrevented)return t.opened=!1,void t.$.calendarButton.setAttribute("aria-expanded",!1);t._edgeMacFF&&t.$dropDownContainer.removeClass("not-in-view");const a=t.$.dropDownContainer;a.style.marginLeft=null,e||(a.style.transition=""),t.$.calendarDropDown.disabled=!1,t.$calendarButton.addClass("smart-calendar-button-pressed"),t.$.calendarButton.setAttribute("active",""),("default"!==t._dropDownDisplayMode&&"timePicker"!==t._dropDownDisplayMode||!t._timePickerInitialized||t._timePickerInitialized&&t.$.timePickerDropDown.$.hasClass("smart-hidden"))&&t.$calendarDropDown.removeClass("smart-hidden"),t.opened=!0,t.$.calendarButton.setAttribute("aria-expanded",!0),t._positionDetection.placeOverlay(),t._positionDetection.checkBrowserBounds("vertically"),t._positionDetection.positionDropDown(),t.$dropDownContainer.removeClass("smart-visibility-hidden");const n=1===window.devicePixelRatio?document.documentElement.clientWidth:window.innerWidth,i=a.getBoundingClientRect();if(i.left<0?a.style.marginLeft=-1*i.left+"px":i.right>n&&(a.style.marginLeft=n-i.right+"px"),t.$.fireEvent("open"),t._toSync){const e=t._value;if(null!==e)t._disregardCalendarChangeEvent=!0,t.$.calendarDropDown.selectedDates=[e.toDate()],t._defaultFooterTemplateApplied&&(t._hourElement.value=e.toString("hh"),t._minuteElement.value=e.toString("mm"),t._ampmElement.value=e.toString("tt")),t._timePickerInitialized&&(t.$.timePickerDropDown.value=e.toDate()),t._disregardCalendarChangeEvent=!1;else{const e=t.$.calendarDropDown.context;t.$.calendarDropDown.context=t.$.calendarDropDown,t.$.calendarDropDown._clearSelection(!0),t.$.calendarDropDown.context=e,t._defaultFooterTemplateApplied&&(t._hourElement.value="",t._minuteElement.value="",t._ampmElement.value="")}t._toSync=!1}let o;switch(t._dropDownDisplayMode){case"default":o=t.$selectDate.hasClass("smart-selected")?t.$.calendarDropDown:t.$.timePickerDropDown.$.picker;break;case"classic":case"calendar":o=t.$.calendarDropDown;break;case"timePicker":o=t.$.timePickerDropDown.$.picker}t.hasAnimation?(t._toFocus=o,function e(){t._toFocus&&(0===t.$.dropDownContainer.getBoundingClientRect().height?requestAnimationFrame(e):t._dropDownTransitionendHandler())}()):o.focus()}_positionExternalDropDown(e){const t=this.context,a=!t.calendarButton||"right"===t.calendarButtonPosition,n=t._dropDownListPosition,i=t.$.dropDownContainer;let o,l=a?e.right-i.offsetWidth:e.left;switch(n){case"bottom":o=e.bottom;break;case"overlay-top":o=e.bottom-i.offsetHeight;break;case"overlay-center":o=e.top+e.height/2-i.offsetHeight/2;break;case"overlay-bottom":o=e.top;break;case"top":o=e.top-i.offsetHeight;break;case"center-bottom":case"center-top":o="center-bottom"===n?e.bottom+5:e.top-5-i.offsetHeight,l=a?e.right-i.offsetWidth/2-t.$.calendarButton.offsetWidth/2:e.left-i.offsetWidth/2+t.$.calendarButton.offsetWidth/2}return{left:l,top:o}}_rangeValidation(e){const t=this;return-1===e.compare(t.min)?t.min.clone():1===e.compare(t.max)?t.max.clone():e}_resetTimePart(){const e=this,t=e._highlightedTimePart.code,a=e._codeToIndex[t],n=Smart.Utilities.DateTime.getConstructorParameters(e._value);let i;i=a>2?0:a>0?1:e.min.year(),n[a]=i,n.unshift(null),e._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,n)))}_setIds(){const e=this;e.$.label.id||(e.$.label.id=e.id+"Label"),e.$.input.id||(e.$.input.id=e.id+"Input"),e.$.calendarButton.id||(e.$.calendarButton.id=e.id+"CalendarButton"),e.$.dropDownContainer.id||(e.$.dropDownContainer.id=e.id+"DropDownContainer"),e.$.hint.id||(e.$.hint.id=e.id+"Hint")}_setDefaultFooterTemplate(e){const t=this;t.$.calendarDropDown.footerTemplate=t._defaultFooterTemplate,e&&t.$.calendarDropDown._handleLayoutTemplate(t.$.calendarDropDown.$.footer,t._defaultFooterTemplate),t._hourElement=t.$.calendarDropDown.getElementsByClassName("smart-hour-element")[0],t._minuteElement=t.$.calendarDropDown.getElementsByClassName("smart-minute-element")[0],t._ampmElement=t.$.calendarDropDown.getElementsByClassName("smart-am-pm-element")[0],t._todayElement=t.$.calendarDropDown.getElementsByClassName("smart-today-element")[0],t._todayElement.title=t.localize("now"),Array.from(t.$.calendarDropDown.$.footer.getElementsByTagName("smart-repeat-button")).forEach((function(e){e.animation=t.animation})),t._addCalendarFooterListeners(),t._defaultFooterTemplateApplied=!0}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.$.input.tabIndex=-1,e.$.selectDate.removeAttribute("tabindex"),e.$.selectTime.removeAttribute("tabindex"),void(e._defaultFooterTemplateApplied&&(e._hourElement.tabIndex=-1,e._ampmElement.tabIndex=-1,e._minuteElement.tabIndex=-1));const t=e.tabIndex>0?e.tabIndex:0;e.$.input.removeAttribute("tabindex"),e.$.selectDate.tabIndex=t,e.$.selectTime.tabIndex=t,e._defaultFooterTemplateApplied&&(e._hourElement.removeAttribute("tabindex"),e._ampmElement.removeAttribute("tabindex"),e._minuteElement.removeAttribute("tabindex"),e.$.calendarDropDown.getElementsByClassName("smart-footer-component-today")[0].tabIndex=t)}_setNullValue(e){const t=this;if(void 0===e&&(e=t._cloneValue()),t.nullable){if(t._value=null,t.value=null,t._highlightedTimePart=void 0,t.$.input.value="",null!==e){if(t.opened){if(!t._calendarInitiatedChange){const e=t.$.calendarDropDown.context;t.$.calendarDropDown.context=t.$.calendarDropDown,t.$.calendarDropDown._clearSelection(!0),t.$.calendarDropDown.context=e}t._defaultFooterTemplateApplied&&(t._hourElement.value="",t._ampmElement.value="",t._minuteElement.value=""),t._toSync=!1}else t._toSync=!0;t.isInitialized&&t.$.fireEvent("change",{oldValue:e.toTimeZone(t._inputTimeZone),value:null})}t._disableSpinButtons()}else t._validateValue(t._now(),e)}_spinButtonsClickHandler(e){const t=this;null===t._value||t.disabled||t.readonly||t._incrementDecrement(t.$.downButton.contains(e.target))}_validateInitialPropertyValues(){const e=this,t=e.$.calendarDropDown;"left"===e.calendarButtonPosition&&e.$.content.insertBefore(e.$.calendarButton,e.$.input),"left"===e.spinButtonsPosition&&e.$.content.insertBefore(e.$.spinButtonsContainer,e.$.input),e.disabled&&(e.$.upButton.disabled=!0,e.$.downButton.disabled=!0),e.opened&&(e.disabled||e.readonly?e.opened=!1:(e.$.dropDownContainer.style.transition="none",e._open(!0))),e.$.calendarButton.setAttribute("aria-expanded",e.opened),null===e.footerTemplate?e._setDefaultFooterTemplate(!0):(t.footerTemplate=e.footerTemplate,t._handleLayoutTemplate(t.$.footer,e.footerTemplate)),""===e.formatString&&(e.formatString="dd-MMM-yy HH:mm:ss.fff");const a=e.displayKind;let n;if("UTC"===a?e._outputTimeZone="UTC":"local"===a&&(e._outputTimeZone="Local"),null!==e.value?(n=Smart.Utilities.DateTime.validateDate(e.value,new Smart.Utilities.DateTime,e.formatString),e._inputTimeZone=n.timeZone,"unspecified"!==a&&e._inputTimeZone!==e._outputTimeZone?n=n.toTimeZone(e._outputTimeZone):"unspecified"===a&&(e._outputTimeZone=e._inputTimeZone)):(n=null,e._inputTimeZone="Local"),e._validateRestrictedDates(),e._validateMinMax("both"),e._validateValue(n,e._now(),!1,!0),e._validateInterval(new Smart.Utilities.TimeSpan(0,0,1)),e._getFormatStringRegExp(),e._defaultFooterTemplateApplied&&""===e._hourElement.value&&null!==e.value){const t=e.value;e._hourElement.value=t.toString("hh"),e._ampmElement.value=t.toString("tt"),e._minuteElement.value=t.toString("mm")}e._detectDisplayMode();const i=e._dropDownDisplayMode;"default"===i||"calendar"===i?(t.viewSections=["title","header"],t.$title.hasClass("smart-hidden")&&t.propertyChangedHandler("viewSections",["header","footer"],["title","header"]),"default"===i&&e.$dropDownHeader.removeClass("smart-hidden")):"timePicker"===i&&(e.$calendarDropDown.addClass("smart-hidden"),e._initializeTimePicker()),e.footer&&e._handleFooter()}_validateInterval(e){const t=this,a=t.interval;let n=a;if(a instanceof Smart.Utilities.TimeSpan)n=a;else if("string"==typeof a){const i=a.indexOf("TimeSpan("),o=a.indexOf(")");if(-1!==i&&-1!==o&&(n=a.slice(i+9,o),n=n.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),new RegExp(/(^(\d+)(,\s*\d+)*$)/g).test(n)&&(n=n.replace(/\s/g,""),n=n.split(","),n.map((function(e,t){n[t]=parseInt(e)})),n.unshift(null),n=new(Function.prototype.bind.apply(Smart.Utilities.TimeSpan,n)))),n instanceof Smart.Utilities.TimeSpan==0){if(""===n.trim())return void(t.interval=e);isNaN(n)||(n=1e4*parseInt(n,10));try{n=new Smart.Utilities.TimeSpan(n)}catch(a){return void(t.interval=e)}}}else{if("number"!=typeof a)return void(t.interval=e);n=new Smart.Utilities.TimeSpan(a)}0===n._ticks?t.interval=e:t.interval=n}_validateMinMax(e,t){const a=this;let n=!1;"max"!==e&&(a.min=Smart.Utilities.DateTime.validateDate(a.min,t||new Smart.Utilities.DateTime(1600,1,1),a.formatString),a.min=a.min.toTimeZone(a._outputTimeZone),n=!0),"min"!==e&&(a.max=Smart.Utilities.DateTime.validateDate(a.max,t||new Smart.Utilities.DateTime(3001,1,1),a.formatString),a.max=a.max.toTimeZone(a._outputTimeZone),a.max.calendar.days=a._localizedDays,a.max.calendar.months=a._localizedMonths,a.max.calendar.locale=a.locale,a.$.calendarDropDown.max=a.max.toDate()),a.min.compare(a.max)>0&&(a.min=a.max.clone(),n=!0),n&&(a.min.calendar.days=a._localizedDays,a.min.calendar.months=a._localizedMonths,a.min.calendar.locale=a.locale,a.$.calendarDropDown.min=a.min.toDate())}_validateRestrictedDates(){const e=this,t=[],a=[];for(let n=0;n<e.restrictedDates.length;n++){const i=e.restrictedDates[n];let o=Smart.Utilities.DateTime.validateDate(i,"invalid",e.formatString);"invalid"!==o&&(o=o.toTimeZone(e._outputTimeZone),t.push(o),a.push(o.toDate()))}e.restrictedDates=t,e.$.calendarDropDown.restrictedDates=a}_validateValue(e,t,a,n){const i=this,o=void 0!==t?t:i._cloneValue();if(null===e||""===e)return void i._setNullValue(o);if(void 0!==e&&(i._value=Smart.Utilities.DateTime.validateDate(e,o,i.formatString)),null===i._value)return void i._setNullValue(o);let l=i._value;for(;!0===i._isRestricted(l);)l.addDays(1,!1);const r=i._rangeValidation(l);n&&"strict"!==i.validation?!1===l.equals(r)&&(i._minMaxChanged=!0):(i._value=r,delete i._minMaxChanged),i.value=i._value.toTimeZone(i._inputTimeZone);const s=i._value;if(s.calendar.days=i._localizedDays,s.calendar.months=i._localizedMonths,s.calendar.locale=i.locale,i._applyFormatString(),i._disableSpinButtons(),(null===o||null===s)&&o!==s||null!==o&&null!==s&&0!==o.compare(s)){if(!1!==a&&i.isInitialized&&i.$.fireEvent("change",{oldValue:null!==o?o.toTimeZone(i._inputTimeZone):null,value:i.value}),i._calendarInitiatedChange)return;i.opened?(null!==o&&0!==i.$.calendarDropDown.selectedDates.length&&o.year()===s.year()&&o.month()===s.month()&&o.day()===s.day()&&i.$.calendarDropDown._isDateInView(s.toDate())||(i._disregardCalendarChangeEvent=!0,i.$.calendarDropDown.selectedDates=[s.toDate()]),i._defaultFooterTemplateApplied&&(null!==o&&o.hour()===s.hour()||(i._hourElement.value=s.toString("hh"),i._ampmElement.value=s.toString("tt")),null!==o&&o.minute()===s.minute()||(i._minuteElement.value=s.toString("mm"))),i._timePickerInitialized&&!i._timePickerInitiatedChange&&(i.$.timePickerDropDown.value=s.toDate()),i._toSync=!1):i._toSync=!0}}});
832
832
 
833
833
  /***/ }),
834
834
 
@@ -863,14 +863,14 @@ Smart.Utilities.Assign("FilterGroup",class t{constructor(){const t=this;t.string
863
863
  /***/ 3176:
864
864
  /***/ (() => {
865
865
 
866
- Smart("smart-grid-panel",class extends Smart.BaseElement{static get properties(){return{closeButtonPosition:{value:"left",allowedValues:["left","right"],type:"string"},dataSource:{value:[],type:"array",reflectToAttribute:!1},messages:{value:{en:{apply:"Ok",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",dateFirst:"1",dateLast:"9",from:"from",numberFirst:"1",numberLast:"9",stringFirst:"A",stringLast:"Z",thenBy:"then by"}},type:"object",extend:!0}}}static get listeners(){return{change:"_changeHandler",click:"_clickHandler",keydown:"_keydownHandler","sortable.dragEnd":"_sortableDragEndHandler"}}static get requires(){return{"Smart.Input":"smart.input.js","Smart.Sortable":"smart.sortable.js"}}static get styleUrls(){return["smart.gridpanel.css"]}template(){return'<div id="container" role="presentation">\n <smart-sortable id="sortable" disable-mode="manual" animation="[[animation]]" disabled="[[readonly]]" right-to-left="[[rightToLeft]]"\n drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]">\n </smart-sortable>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <smart-input id="inputNotSorted" right-to-left="[[rightToLeft]]" animation="[[animation]]" readonly theme="[[theme]]"></smart-input>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),"right"===e.closeButtonPosition&&(e.$.sortable.handlePosition="left"),e._localize(),e._createSources(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":Array.from(n.$.sortable.getElementsByTagName("smart-input")).forEach((t=>t[e]=a));break;case"disabled":case"unfocusable":n._setFocusable();break;case"closeButtonPosition":"right"===n.closeButtonPosition?n.$.sortable.handlePosition="left":n.$.sortable.handlePosition="right";break;case"dataSource":n.$.sortable.$.container.innerHTML="",n._createSources();break;case"locale":case"messages":{const e=n.$.sortable._items;n._localize(),e.length&&(e[0].children[1].innerHTML=n.localize("firstBy"),e.forEach((function(e,t){0!==t&&(e.children[1].innerHTML=n.localize("thenBy"));const a=n._HTMLToSourceMap.get(e),l=n._ascDescTemplates[a.dataType]||n._ascDescTemplates.string;e.children[3].innerHTML=n.localize("from"),e.children[4].firstElementChild.innerHTML=l[0],e.children[4].children[1].innerHTML=l[1]})));break}case"maxLevel":if(null!=a)for(;n.$.sortable._items.length>0&&n.$.sortable._items.length>a;)n._interactionHandler(n.$.sortable._items[n.$.sortable._items.length-1].firstElementChild);n._disableItemAddition();break;case"rightToLeft":n.$.inputNotSorted.rightToLeft=a,n.$.inputNotSorted.dropDownButtonPosition=a?"left":"right",n.$.sortable._items.forEach((e=>{const t=e.querySelector("smart-input");t.rightToLeft=a,t.dropDownButtonPosition=a?"left":"right"}))}}_changeHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(t.$.inputNotSorted.contains(a)){const e=t.$.inputNotSorted.value,a=t._labelToSourceMap.get(e);return t._createSortItem(a,t.$.sortable._items.length),t.$.sortable.updateItems(),t._visibleLabels.push(e),t._updateHiddenSource(),t._disableItemAddition(),void(t.$.inputNotSorted.value="")}const n=a.closest("smart-input");if(!n)return;const l=n.parentElement.parentElement,o=l.children[4].firstElementChild,i=l.children[4].children[1],r=n.value,s=t._HTMLToSourceMap.get(l).label,d=t._labelToSourceMap.get(r),c=t._ascDescTemplates[d.dataType]||t._ascDescTemplates.string;t._HTMLToSourceMap.set(l,d),t._visibleLabels.splice(t._visibleLabels.indexOf(s),1,r),t._updateHiddenSource(),o.innerHTML=c[0],i.innerHTML=c[1],d.sortDirection&&-1===d.sortDirection.indexOf("asc")?(i.classList.add("selected"),o.classList.remove("selected")):(o.classList.add("selected"),i.classList.remove("selected"))}_updateHiddenSource(){const e=this;e._hiddenSource=e.dataSource.map((e=>({label:e.label,value:e.dataField,icon:e.icon}))).filter((t=>-1===e._visibleLabels.indexOf(t.label))),e.$.inputNotSorted.dataSource=e._hiddenSource,e.$.sortable._items.forEach((t=>t.getElementsByTagName("smart-input")[0].dataSource=e._hiddenSource)),e._disableItemAddition(),e.$.fireEvent("dataSourceChange")}_clickHandler(e){const t=this;t._interactionHandler(t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target,e)}_interactionHandler(e,t){const a=this;if(a.disabled||a.readonly)return!0;const n=e.closest(".smart-grid-panel-item");if(n){if(e===n.firstElementChild){const e=a._HTMLToSourceMap.get(n).label;a.$.sortable.$.container.removeChild(n),a.$.sortable.updateItems(),a._visibleLabels.splice(a._visibleLabels.indexOf(e),1),a._updateHiddenSource(),a._disableItemAddition(),a.$.sortable._items.length&&(a.$.sortable._items[0].children[1].innerHTML=a.localize("firstBy")),a.$.fireEvent("remove")}else if(n.children[4].contains(e)){const l=n.children[4].firstElementChild,o=n.children[4].children[1];"click"===t.type?e.classList.contains("selected")||(e===l?(o.classList.remove("selected"),l.classList.add("selected"),a._HTMLToSourceMap.get(n).sortDirection="ascending"):e===o&&(l.classList.remove("selected"),o.classList.add("selected"),a._HTMLToSourceMap.get(n).sortDirection="descending")):(l.classList.toggle("selected"),o.classList.toggle("selected"),a._HTMLToSourceMap.get(n).sortDirection=l.classList.contains("selected")?"ascending":"descending")}return!0}if(e===a.$.buttonsContainer.firstElementChild)return a.$.fireEvent("cancel"),!0;if(e===a.$.buttonsContainer.children[1]){const e=[],t={dataFields:[],dataTypes:[],orderBy:[]},n={value:e};return a.$.sortable._items.forEach((n=>{const l=a._HTMLToSourceMap.get(n);e.push({dataField:l.dataField,sortDirection:l.sortDirection}),t.dataFields.push(l.dataField),t.dataTypes.push(l.dataType),t.orderBy.push(l.sortDirection)})),(a instanceof Smart.SortPanel||a instanceof Smart.GroupPanel)&&(n.sortByInfo=t),a.$.fireEvent("apply",n),!0}}_keydownHandler(e){const t=this,a=e.key;" "!==a&&"Enter"!==a||(e.preventDefault(),t._interactionHandler((t.shadowRoot||t.getRootNode()).activeElement,e))}_sortableDragEndHandler(e){const t=this,a=e.detail.oldIndex,n=e.detail.newIndex,l=Math.max(a,n),o=t.$.sortable._items;0===(a&&n)&&(o[0].children[1].innerHTML=t.localize("firstBy"),o[1].children[1].innerHTML=t.localize("thenBy"),l>1&&(o[l].children[1].innerHTML=t.localize("thenBy")))}_localize(){const e=this;e.$.inputNotSorted.placeholder=e.localize("pickAnother"),e.$.buttonsContainer.firstElementChild.innerHTML=e.localize("cancel"),e.$.buttonsContainer.children[1].innerHTML=e.localize("apply"),e._ascDescTemplates={boolean:[e.localize("booleanFirst")+" → "+e.localize("booleanLast"),e.localize("booleanLast")+" → "+e.localize("booleanFirst")],date:[e.localize("dateFirst")+" → "+e.localize("dateLast"),e.localize("dateLast")+" → "+e.localize("dateFirst")],number:[e.localize("numberFirst")+" → "+e.localize("numberLast"),e.localize("numberLast")+" → "+e.localize("numberFirst")],string:[e.localize("stringFirst")+" → "+e.localize("stringLast"),e.localize("stringLast")+" → "+e.localize("stringFirst")]}}_createSources(){const e=this,t=(e instanceof Smart.SortPanel?"sort":"group")+"Index",a=[],n=[];if(e._HTMLToSourceMap=new Map,e._labelToSourceMap=new Map,e.dataSource.forEach((n=>{e._labelToSourceMap.set(n.label,n),-1!==n[t]&&void 0!==n[t]&&a.push(n)})),a.sort(((e,a)=>e[t]-a[t])),void 0!==e.maxLevel&&null!==e.maxLevel)for(;a.length>0&&a.length>e.maxLevel;)a.pop();e.$.inputNotSorted.dropDownButtonPosition=e.rightToLeft?"left":"right",e.$.inputNotSorted.dataSource&&e.$.inputNotSorted.dataSource.length<10&&e.$.inputNotSorted.dataSource.length>0?e.$.inputNotSorted.dropDownHeight="auto":e.$.inputNotSorted.dropDownHeight=250,a.forEach((e=>n.push(e.label))),e._visibleLabels=n,e._updateHiddenSource(),a.forEach(((t,a)=>{e._createSortItem(t,a)})),e.$.sortable.updateItems(),e._disableItemAddition(),e._setFocusable()}_createSortItem(e,t){const a=this,n=a.disabled||a.unfocusable?-1:0,l=document.createElement("div"),o=a._ascDescTemplates[e.dataType]||a._ascDescTemplates.string;l.className="smart-grid-panel-item",l.innerHTML=`<div class="smart-grid-panel-item-close-button" tabindex="${n}" role="button" aria-label="Close"></div>\n<div class="smart-grid-panel-label-by smart-unselectable" role="presentation">${a.localize(t>0?"thenBy":"firstBy")}</div>\n<div class="smart-grid-panel-field-container" role="presentation"><smart-input class="smart-grid-panel-field-selection" value="${e.label}" animation="${a.animation}" readonly theme="${a.theme}" aria-label="Field name"></smart-input></div>\n<div class="smart-grid-panel-from smart-unselectable" role="presentation">${a.localize("from")}</div >\n<div class="smart-grid-panel-direction smart-unselectable" tabindex="${n}" role="presentation">\n <div class="smart-grid-panel-asc" role="button" aria-label="Ascending">${o[0]}</div >\n <div class="smart-grid-panel-desc" role="button" aria-label="Descending">${o[1]}</div>\n</div>\n`;const i=l.querySelector("smart-input");i.dataSource=a._hiddenSource,i.rightToLeft=a.rightToLeft,i.dropDownButtonPosition=a.rightToLeft?"left":"right",i.dataSource&&i.dataSource.length<10?i.dropDownHeight="auto":i.dropDownHeight=250,a.$.sortable.$.container.appendChild(l),i.tabIndex=n,e.sortDirection&&-1===e.sortDirection.indexOf("asc")?l.children[4].children[1].classList.add("selected"):(e.sortDirection="ascending",l.children[4].firstElementChild.classList.add("selected")),a._HTMLToSourceMap.set(l,e)}_disableItemAddition(){const e=this,t=e.maxLevel,a=0===e._hiddenSource.length||null!=t&&Math.max(0,t)===e.$.sortable._items.length;e.$.inputNotSorted.disabled=a,a&&e.$.inputNotSorted.removeAttribute("focus")}_setFocusable(){const e=this,t=e.disabled||e.unfocusable?-1:0,a=Array.from(e.getElementsByClassName("smart-grid-panel-item-close-button")),n=Array.from(e.getElementsByClassName("smart-grid-panel-direction")),l=Array.from(e.getElementsByTagName("input")),o=a.concat(n).concat(l);e.$.buttonsContainer.firstElementChild.tabIndex=t,e.$.buttonsContainer.children[1].tabIndex=t,o.forEach((e=>e.tabIndex=t))}}),Smart("smart-sort-panel",class extends Smart.GridPanel{static get properties(){return{messages:{value:{en:{firstBy:"Sort by",noSorting:"No sorting applied",pickAnother:"Pick another field to sort by"}},type:"object",extend:!0}}}static get styleUrls(){return["smart.textbox.css"]}_localize(){super._localize(),this.$.sortable.$.container.setAttribute("no-sorting",this.localize("noSorting"))}}),Smart("smart-group-panel",class extends Smart.GridPanel{static get properties(){return{maxLevel:{value:8,type:"number?"},messages:{value:{en:{collapseAll:"Collapse all",expandAll:"Expand all",firstBy:"Group by",noGrouping:"No grouping",pickAnother:"Pick another field to group by"}},type:"object",extend:!0}}}template(){return'<div id="container" role="presentation">\n <smart-sortable disable-mode="manual" right-to-left="[[rightToLeft]]" id="sortable" animation="[[animation]]" disabled="[[readonly]]" drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]"></smart-sortable>\n <div id="expandCollapseContainer" class="smart-grid-panel-buttons-container smart-grid-panel-expand-collapse smart-unselectable" role="presentation">\n <span class="smart-group-panel-collapse-button" role="button"></span>\n <span class="smart-group-panel-expand-button" role="button"></span>\n </div>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <smart-input right-to-left="[[rightToLeft]]" id="inputNotSorted" animation="[[animation]]" readonly theme="[[theme]]"></smart-input>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}_interactionHandler(e,t){const a=this;super._interactionHandler(e,t)||(e===a.$.expandCollapseContainer.firstElementChild?a.$.fireEvent("collapseAll"):e===a.$.expandCollapseContainer.children[1]&&a.$.fireEvent("expandAll"))}_localize(){super._localize();const e=this;e.$.expandCollapseContainer.firstElementChild.innerHTML=e.localize("collapseAll"),e.$.expandCollapseContainer.children[1].innerHTML=e.localize("expandAll"),e.$.sortable.$.container.setAttribute("no-grouping",e.localize("noGrouping"))}_setFocusable(){super._setFocusable();const e=this,t=e.disabled||e.unfocusable?-1:0;e.$.expandCollapseContainer.firstElementChild.tabIndex=t,e.$.expandCollapseContainer.children[1].tabIndex=t}}),Smart("smart-multi-column-filter-panel",class extends Smart.BaseElement{static get properties(){return{closeButtonPosition:{value:"left",allowedValues:["left","right"],type:"string"},dataSource:{value:[],type:"array",reflectToAttribute:!1},editorCallback:{value:null,type:"function?",reflectToAttribute:!1},editorPlaceholder:{value:"Value",type:"string"},messages:{value:{en:{addFilter:"+ Add filter",and:"And",apply:"Ok",cancel:"Cancel",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",noFilters:"No filters applied",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",NULL:"null",or:"Or",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",where:"Where"}},type:"object",extend:!0},operator:{value:"and",allowedValues:["and","or"],type:"string"},value:{value:[],type:"array"}}}static get listeners(){return{change:"_changeHandler",click:"_interactionHandler",keydown:"_interactionHandler"}}static get requires(){return{"Smart.Button":"smart.button.js","Smart.CheckBox":"smart.checkbox.js","Smart.DateTimePicker":"smart.datetimepicker.js","Smart.FilterGroup":"smart.filter.js","Smart.Input":"smart.input.js","Smart.NumericTextBox":"smart.numerictextbox.js"}}static get styleUrls(){return["smart.gridpanel.css"]}template(){return'<div id="container" role="presentation">\n <div id="itemsContainer" class="smart-filter-panel-items-container smart-unselectable"></div>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <div id="addFilterButton" class="smart-filter-panel-add-filter-button smart-unselectable" role="button"></div>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),e._setFocusable(),e._localize(),e._applyValue(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":case"rightToLeft":Array.from(n.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input")).forEach((t=>{t[e]=a,"smart-input"===t.tagName.toLowerCase()&&"rightToLeft"===e&&"none"!==t.dropDownButtonPosition&&(t.dropDownButtonPosition=a?"left":"right")}));break;case"disabled":case"unfocusable":n._setFocusable(!0);break;case"dataSource":case"value":n._applyValue();break;case"editorPlaceholder":Array.from(n.$.itemsContainer.getElementsByClassName("editor")).forEach((e=>e.placeholder=a));break;case"locale":case"messages":n._localize(!0);break;case"operator":n._setOperator()}}_setOperator(){const e=this,t=e.localize(e.operator);for(let a=2;a<e._items.length;a++)e._items[a].children[1].innerHTML=t}_changeHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(a instanceof Smart.Input==0)return;const n=a.parentElement,l=n.children;if(a===l[1])t.operator=a.$.input.dataValue,t._setOperator();else if(a===l[2]){const a=t.dataSource.find((t=>t.dataField===e.detail.oldValue)).dataType,o=t.dataSource.find((t=>t.dataField===e.detail.value)),i=o.dataType;if("enum"!==i&&i===a)return void(t.editorCallback&&t.editorCallback(l[4],o));const r=l[3].value;let s,d;switch(i){case"date":s=t._numberAndDateConditions,d=document.createElement("smart-date-time-picker"),d.calendarButton=!0,d.dropDownAppendTo="body",d.dropDownDisplayMode="auto",d.formatString="M/d/yy H:mm";break;case"number":s=t._numberAndDateConditions,d=document.createElement("smart-numeric-text-box");break;case"boolean":s=t._booleanConditions,d=document.createElement("smart-check-box");break;case"enum":s=t._enumConditions,d=document.createElement("smart-input"),d.dataSource=o.options,d.readonly=!0,d.dropDownButtonPosition="right";break;default:s=t._stringConditions,d=document.createElement("smart-input")}d.rightToLeft=t.rightToLeft,d.animation=t.animation,d.theme=t.theme,d.unfocusable=t.disabled||t.unfocusable,d.classList.add("underlined"),d.dataSource&&d.dataSource.length<10?d.dropDownHeight="auto":d.dropDownHeight=250,"boolean"!==i&&(d.placeholder=t.editorPlaceholder),t.editorCallback&&t.editorCallback(d,o),l[4].remove(),n.appendChild(d),""===r||s.find((e=>e.label===r))||(l[3].value=""),l[3].dataSource=s,s.length>=10?l[3].dropDownHeight=250:l[3].dropDownHeight="auto",n.dataType=i}else if(a===l[3]){const e=l[4],t=a.$.input.dataValue;-1!==t.indexOf("NULL")||-1!==t.indexOf("EMPTY")?(e.value="",e.checked=!1,e.classList.add("smart-visibility-hidden")):e.classList.remove("smart-visibility-hidden"),a.condition=t}}_interactionHandler(e){const t=this;if(t.disabled||t.readonly)return;if("keydown"===e.type){if("Enter"!==e.key)return;e.preventDefault()}const a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target,n=a.closest(".smart-grid-panel-item");if(n){if(a===n.firstElementChild){const e=t._items.indexOf(n);let a;t._items.splice(e,1),n.remove(),t._items.length>0&&e<2&&(0===e&&(t._items[0].children[1].remove(),a=document.createElement("div"),a.innerHTML=t.localize("where"),t._items[0].insertBefore(a,t._items[0].children[1])),t._items.length>1&&(t._items[1].children[1].remove(),a=document.createElement("smart-input"),a.className="underlined",a.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],a.dropDownButtonPosition=t.rightToLeft?"left":"right",a.readonly=!0,a.value=t.localize(t.operator),a.animation=t.animation,a.theme=t.theme,a.rightToLeft=t.rightToLeft,a.unfocusable=t.disabled||t.unfocusable,t._items[1].insertBefore(a,t._items[1].children[1])))}}else if(a===t.$.addFilterButton&&t.dataSource.length>0)t.$.itemsContainer.appendChild(t._createItem(t.dataSource[0],"","",t._items.length));else if(a!==t.$.buttonsContainer.firstElementChild){if(a===t.$.buttonsContainer.children[1]){const e=t._stringConditions.concat(t._numberAndDateConditions),a=t.operator,n=[],l={},o=[];t._items.forEach((o=>{const i=t.dataSource.find((e=>e.label===o.children[2].value)),r=[];let s=o.children[3].value;if(""===s)return;let d=i.dataType;if(s=e.find((e=>e.label===s)).value,r.push(i.dataField,s),-1===s.indexOf("NULL")&&-1===s.indexOf("EMPTY"))if("boolean"===d)r.push(o.children[4].checked);else if("date"===d)r.push(o.children[4].value.toDate());else if("enum"===d){let e=o.children[4].$.input.dataValue;if(void 0===e){const t=i.options.find((e=>e.label===o.children[4].value));if(!t)return;e=t.value}d="string",r.push(e)}else r.push(o.children[4].value);let c=l[r[0]];void 0===c&&(c=new Smart.Utilities.FilterGroup,l[r[0]]=c);const u=c.createFilter(d,r[2],r[1]);c.addFilter(a,u),n.push(r)}));for(let e in l)o.push([e,l[e]]);t.value=n,t.$.fireEvent("apply",{filters:o,operator:a,value:n})}}else t.$.fireEvent("cancel")}_applyValue(){const e=this,t=document.createDocumentFragment();let a=0;for(e._items=[];e.$.itemsContainer.firstElementChild;)e.$.itemsContainer.firstElementChild.remove();0!==e.dataSource.length&&(e.value.forEach((n=>{if(!Array.isArray(n))return;const l=n[0],o=e.dataSource.find((e=>e.dataField===l));if(!o)return;const i=e._createItem(o,n[1],n[2],a);t.appendChild(i),a++})),e.$.itemsContainer.appendChild(t))}_createItem(e,t,a,n){const l=this,o=l.disabled||l.unfocusable?-1:0,i=document.createElement("div"),r=document.createDocumentFragment(),s=document.createElement("div"),d=document.createElement("smart-input"),c=document.createElement("smart-input");let u,p;return s.className="smart-grid-panel-item-close-button",s.tabIndex=o,s.setAttribute("role","button"),s.setAttribute("aria-label","button"),r.appendChild(s),0===n?(u=document.createElement("div"),u.innerHTML=l.localize("where"),u.setAttribute("role","presentation")):1===n?(u=document.createElement("smart-input"),u.className="underlined",u.dataSource=[{value:"and",label:l.localize("and")},{value:"or",label:l.localize("or")}],u.dropDownButtonPosition=l.rightToLeft?"left":"right",u.readonly=!0,u.value=l.localize(l.operator),u.animation=l.animation,u.theme=l.theme,u.rightToLeft=l.rightToLeft,u.unfocusable=l.disabled||l.unfocusable,u.setAttribute("aria-label","Operator")):(u=document.createElement("div"),u.innerHTML=l.localize(l.operator),u.setAttribute("role","presentation")),r.appendChild(u),d.className="underlined",d.dataSource=l.dataSource.map((e=>({value:e.dataField,label:e.label,icon:e.icon}))),d.dropDownButtonPosition=l.rightToLeft?"left":"right",d.readonly=!0,d.value=e.label,d.animation=l.animation,d.theme=l.theme,d.rightToLeft=l.rightToLeft,d.unfocusable=l.disabled||l.unfocusable,d.setAttribute("aria-label","Field"),d.dataSource&&d.dataSource.length<10?d.dropDownHeight="auto":d.dropDownHeight=250,r.appendChild(d),"boolean"===e.dataType?(c.dataSource=l._booleanConditions,p=document.createElement("smart-check-box"),p.checked="boolean"==typeof a&&a):"date"===e.dataType?(c.dataSource=l._numberAndDateConditions,p=document.createElement("smart-date-time-picker"),p.dropDownDisplayMode="auto",p.calendarButton=!0,p.dropDownAppendTo="body",p.formatString="M/d/yy H:mm",p.value=a):"number"===e.dataType?(c.dataSource=l._numberAndDateConditions,p=document.createElement("smart-numeric-text-box"),p.value="number"==typeof a||"string"==typeof a?a:0):"enum"===e.dataType?(c.dataSource=l._enumConditions,p=document.createElement("smart-input"),p.dataSource=e.options,p.readonly=!0,p.dropDownButtonPosition="right",p.value=a?e.options.find((e=>e.value===a)).label:""):(c.dataSource=l._stringConditions,p=document.createElement("smart-input"),p.value=null!=a?a.toString():""),c.className="underlined",c.dropDownButtonPosition=l.rightToLeft?"left":"right",c.readonly=!0,c.animation=l.animation,c.theme=l.theme,c.rightToLeft=l.rightToLeft,c.unfocusable=l.disabled||l.unfocusable,c.setAttribute("aria-label","Condition"),c.classList.add("smart-filter-panel-list"),c.dataSource.find((e=>e.value===t))?(c.value=l.localize(t),c.condition=t):(p.value="",p.checked=!1),void 0===t||-1===t.indexOf("NULL")&&-1===t.indexOf("EMPTY")||(p.value="",p.checked=!1,p.classList.add("smart-visibility-hidden")),c.dataSource&&c.dataSource.length<10?c.dropDownHeight="auto":c.dropDownHeight=250,p.animation=l.animation,p.classList.add("editor"),p.rightToLeft=l.rightToLeft,p.theme=l.theme,p.unfocusable=l.disabled||l.unfocusable,p.classList.add("underlined"),"boolean"!==e.dataType&&(p.placeholder=l.editorPlaceholder),l.editorCallback&&l.editorCallback(p,e),r.appendChild(c),r.appendChild(p),i.appendChild(r),i.className="smart-grid-panel-item",l._items.push(i),i.dataType=e.dataType,i}_localize(e){const t=this;t.$.addFilterButton.innerHTML=t.localize("addFilter"),t.$.buttonsContainer.firstElementChild.innerHTML=t.localize("cancel"),t.$.buttonsContainer.children[1].innerHTML=t.localize("apply"),t.$.itemsContainer.setAttribute("no-filters",t.localize("noFilters")),t._stringConditions=[{prefix:'<span class="smart-icon smart-icon-empty"></span>',value:"EMPTY",label:t.localize("EMPTY")},{prefix:'<span class="smart-icon smart-icon-not-empty"></span>',value:"NOT_EMPTY",label:t.localize("NOT_EMPTY")},{prefix:'<span class="smart-icon smart-icon-contains"></span>',value:"CONTAINS",label:t.localize("CONTAINS")},{prefix:'<span class="smart-icon smart-icon-does-not-contain"></span>',value:"DOES_NOT_CONTAIN",label:t.localize("DOES_NOT_CONTAIN")},{prefix:'<span class="smart-icon smart-icon-starts-with"></span>',value:"STARTS_WITH",label:t.localize("STARTS_WITH")},{prefix:'<span class="smart-icon smart-icon-ends-with"></span>',value:"ENDS_WITH",label:t.localize("ENDS_WITH")},{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._enumConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")}],t._numberAndDateConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-less-than"></span>',value:"LESS_THAN",label:t.localize("LESS_THAN")},{prefix:'<span class="smart-icon smart-icon-less-than-equal"></span>',value:"LESS_THAN_OR_EQUAL",label:t.localize("LESS_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-greater-than"></span>',value:"GREATER_THAN",label:t.localize("GREATER_THAN")},{prefix:'<span class="smart-icon smart-icon-greater-than-equal"></span>',value:"GREATER_THAN_OR_EQUAL",label:t.localize("GREATER_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._booleanConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],e&&t._items.forEach(((e,a)=>{const n=e.children[1],l=e.children[3];0===a?n.innerHTML=t.localize("where"):1===a?(n.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],n.value=t.localize(t.operator)):n.innerHTML=t.localize(t.operator),"string"===e.dataType?l.dataSource=t._stringConditions:"enum"===e.dataType?l.dataSource=t._enumConditions:"boolean"===e.dataType?l.dataSource=t._booleanConditions:l.dataSource=t._numberAndDateConditions,l.value=l.condition?t.localize(l.condition):""}))}_setFocusable(e){const t=this,a=t.disabled||t.unfocusable?-1:0;if(t.$.addFilterButton.tabIndex=a,t.$.buttonsContainer.firstElementChild.tabIndex=a,t.$.buttonsContainer.children[1].tabIndex=a,e){const e=Array.from(t.$.itemsContainer.getElementsByClassName("smart-grid-panel-item-close-button")),n=Array.from(t.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input"));e.forEach((e=>e.tabIndex=a)),n.forEach((e=>e.unfocusable=t.disabled||t.unfocusable))}}}),Smart("smart-column-panel",class extends Smart.BaseElement{static get properties(){return{dataSource:{value:[],type:"array",reflectToAttribute:!1},messages:{value:{en:{apply:"Ok",cancel:"Cancel",find:"Find a field",reset:"Reset",noResults:"No results"}},type:"object",extend:!0}}}static get listeners(){return{click:"_interactionHandler",keydown:"_interactionHandler","find.keyup":"_findKeyupHandler","sortable.dragEnd":"_sortableDragEndHandler"}}static get requires(){return{"Smart.Sortable":"smart.sortable.js"}}static get styleUrls(){return["smart.gridpanel.css"]}template(){return'<div id="container" role="presentation">\n <div class="smart-column-panel-find-container" role="search">\n <input id="find" readonly="[[readonly]]" role="searchbox" aria-label="Find a field"></input>\n <span id="clearButton" class="clear-button smart-hidden" role="button" aria-label="Clear"></span>\n </div>\n <smart-sortable id="sortable" disable-mode="manual" right-to-left="[[rightToLeft]]" animation="[[animation]]" disabled="[[readonly]]" drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]"></smart-sortable>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <span id="reset" class="smart-grid-panel-reset-button" role="button"></span>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),e._positionChanged=!1,e._localize(),e._moves=[],e._createSortItems(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"disabled":case"unfocusable":n._setFocusable();break;case"dataSource":{const e=n.$.sortable.$.container;for(;e.firstChild;)e.removeChild(e.firstChild);n._createSortItems(),n._positionChanged=!1,n.$.find.value="",n.$.clearButton.classList.add("smart-hidden");break}case"locale":case"messages":n._localize()}}_createSortItems(){const e=this,t=document.createDocumentFragment();e._HTMLToSourceMap=new Map,e.dataSource.forEach((a=>t.appendChild(e._createSortItem(a)))),e.$.sortable.$.container.appendChild(t),e.$.sortable.updateItems(),e._setFocusable()}_createSortItem(e){const t=document.createElement("div"),a=this.id+"Label"+e.dataField;return this._HTMLToSourceMap.set(t,e),t.className="smart-grid-panel-item",t.innerHTML=`<div class="toggle-visibility${!1!==e.visible?"":" hidden"}${e.disableToggle?" disable-toggle":""}" role="button" aria-controls="${a}" aria-label="Toggle visibility"></div>\n<span id="${a}" class="smart-column-panel-label smart-unselectable${e.icon?" icon "+e.icon:""}">${e.label}</span>`,1===e.level?t.classList.add("indent"):0===e.level&&t.classList.add("group"),e.disableDrag&&t.setAttribute("disable-drag",""),e.dataField&&t.setAttribute("data-field",e.dataField),e.parentDataField&&t.setAttribute("parent-data-field",e.parentDataField),!1===e.allowHide&&(t.style.pointerEvents="none",t.style.opacity=.8),t}_interactionHandler(e){const t=this;if(t.disabled||t.readonly||"keydown"===e.type&&-1===[" ","Enter"].indexOf(e.key))return;const a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(a.classList.contains("toggle-visibility")){a.classList.toggle("hidden");const e=a.closest(".smart-grid-panel-item");if(e.hasAttribute("data-field")){const n=e.getAttribute("data-field");if(e.hasAttribute("parent-data-field")){const a=e.getAttribute("parent-data-field"),n=t.$.sortable.querySelectorAll(".smart-grid-panel-item");let l=null;if(n.forEach((e=>{e.getAttribute("data-field")===a&&(l=e)})),l){let e=0,t=0;n.forEach((n=>{n.getAttribute("parent-data-field")===a&&(e++,n.firstElementChild.classList.contains("hidden")&&t++)})),t===e?l.firstElementChild.classList.add("hidden"):t<e&&l.firstElementChild.classList.remove("hidden")}}else t.$.sortable._items.forEach((e=>{if(e.hasAttribute("parent-data-field")){const t=e.getAttribute("parent-data-field"),l=e.firstElementChild;t===n&&(a.classList.contains("hidden")?l.classList.add("hidden"):l.classList.remove("hidden"))}}))}}else if(a.parentElement===t.$.buttonsContainer){if(a===t.$.buttonsContainer.firstElementChild)return t.$.fireEvent("cancel"),void(t._moves=[]);if(a===t.$.buttonsContainer.children[1]){const e=[];t.$.sortable._items.forEach((a=>{const n=Object.assign({},t._HTMLToSourceMap.get(a));n.visible=!a.firstElementChild.classList.contains("hidden"),e.push(n)})),t.$.fireEvent("apply",{value:e,positionChanged:t._positionChanged,moves:t._moves}),t._positionChanged=!1,t._moves=[]}}else if(a===t.$.reset){const e=[];t.$.sortable._items.forEach((a=>{const n=Object.assign({},t._HTMLToSourceMap.get(a));n.visible=!0,e.push(n)})),t.$.fireEvent("apply",{value:e,positionChanged:t._positionChanged,moves:t._moves}),t._positionChanged=!1,t._moves=[]}else a.classList.contains("clear-button")&&(t.$.find.value="",t._findKeyupHandler())}_findKeyupHandler(){const e=this;if(e.disabled||e.readonly)return;const t=e.$.find,a=t.value,n=e.$.sortable._items;if(void 0===e._disabledSortable&&(e._disabledSortable=e.$.sortable.disabled),""===a)return t.parentElement.classList.remove("no-results"),e.$.clearButton.classList.add("smart-hidden"),n.forEach((e=>e.classList.remove("smart-hidden"))),e.$.sortable.disabled=e._disabledSortable||e.readonly,void delete e._disabledSortable;let l=!0;e.$.clearButton.classList.remove("smart-hidden"),n.forEach((t=>{-1===e._HTMLToSourceMap.get(t).label.toLowerCase().indexOf(a.toLowerCase())?t.classList.add("smart-hidden"):(t.classList.remove("smart-hidden"),l=!1)})),e.$.sortable.disabled=l,l?t.parentElement.classList.add("no-results"):t.parentElement.classList.remove("no-results")}_sortableDragEndHandler(e){const t=e.detail;this._positionChanged=!0,this._moves.push({oldIndex:t.oldIndex,newIndex:t.newIndex})}_localize(){const e=this;e.$.find.placeholder=e.localize("find"),e.$.reset.innerHTML=e.localize("reset"),e.$.buttonsContainer.firstElementChild.innerHTML=e.localize("cancel"),e.$.buttonsContainer.children[1].innerHTML=e.localize("apply"),e.$.container.firstElementChild.setAttribute("no-results",e.localize("noResults"))}_setFocusable(){const e=this,t=e.disabled||e.unfocusable?-1:0,a=Array.from(e.$.sortable.getElementsByClassName("toggle-visibility"));e.$.find.tabIndex=t,e.$.clearButton.tabIndex=t,e.$.buttonsContainer.firstElementChild.tabIndex=t,e.$.buttonsContainer.children[1].tabIndex=t,a.forEach((e=>e.tabIndex=e.classList.contains("disable-toggle")?-1:t))}}),Smart("smart-formatting-panel",class extends Smart.BaseElement{static get properties(){return{columns:{value:[],type:"array",reflectToAttribute:!1},dataSource:{value:[],type:"any",reflectToAttribute:!1},items:{value:null,type:"array?",reflectToAttribute:!1},dropDownAppendTo:{value:null,type:"any",reflectToAttribute:!1},messages:{value:{en:{add:"Add condition",all:"All columns",apply:"Ok",between:"Between",cancel:"Cancel",close:"Close",column:"Column:",condition:"Condition:",equal:"Equal To",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",greaterThan:"Greater Than",highlight:"Highlight",lessThan:"Less Than",notEqual:"Not Equal To",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:"}},type:"object",extend:!0}}}static get listeners(){return{click:"_interactionHandler",keydown:"_interactionHandler",change:"_changeHandler","popup.change":"_changeHandler","popup.click":"_interactionHandler","popup.keydown":"_interactionHandler","document.down":"_documentDownHandler"}}template(){return'<div id="container" role="presentation">\n <div id="itemsContainer" class="smart-formatting-panel-items-container" role="presentation"></div>\n <div id="addNewButton" class="smart-add-new-button" role="button" aria-label="Add new condition"></div>\n <div id="popup" class="smart-formatting-panel-popup smart-hidden smart-visibility-hidden" role="dialog">\n <div id="popupHeader" class="header" role="presentation">\n <div id="text" class="selected" role="button" aria-label="Text color"></div>\n <div id="highlight" role="button" aria-label="Highlight color"></div>\n </div>\n <div id="colorCode" class="color-code"></div>\n <input id="colorInput" type="color" />\n <div id="colorsContainer" class="colors-container"></div>\n <smart-button id="apply" class="ok primary" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" unfocusable="[[unfocusable]]"></smart-button>\n <smart-button id="cancel" class="cancel" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" unfocusable="[[unfocusable]]"></smart-button>\n </div>\n </div>'}render(){const e=this,t=getComputedStyle(e);e.setAttribute("role","dialog"),e.$.popup.id=e.id+"Popup",e._basicColors=[[0,0,0],[68,68,68],[102,102,102],[153,153,153],[204,204,204],[238,238,238],[243,243,243],[255,255,255],[255,0,0],[255,153,0],[255,255,0],[0,255,0],[0,255,255],[0,0,255],[153,0,255],[255,0,255],[244,204,204],[252,229,205],[255,242,204],[217,234,211],[208,224,227],[207,226,243],[217,210,233],[234,209,220],[234,153,153],[249,203,156],[255,229,153],[182,215,168],[162,196,201],[159,197,232],[180,167,214],[213,166,189],[224,102,102],[246,178,107],[255,217,102],[147,196,125],[118,165,175],[111,168,220],[142,124,195],[194,123,160],[204,0,0],[230,145,56],[241,194,50],[106,168,79],[69,129,142],[61,133,198],[103,78,167],[166,77,121],[153,0,0],[180,95,6],[191,144,0],[56,118,29],[19,79,92],[11,83,148],[53,28,117],[116,27,71],[102,0,0],[120,63,4],[127,96,0],[39,78,19],[12,52,61],[7,55,99],[32,18,77],[76,17,48]],e._defaults={fontFamily:t.fontFamily,fontSize:t.fontSize,text:e._toHex(t.color),highlight:e._toHex(t.backgroundColor)},t.fontFamily.indexOf("-apple")>=0&&(e._defaults.fontFamily="Segoe UI"),e._localize(),e._setFocusable(),e._populatePopupWithColors(),e._processColumnsAndDataSource(),e._addDefaultItems(),super.render()}attached(){const e=this;super.attached(),e.isCompleted&&e._addDefaultItemsOnAttach&&e._addDefaultItems()}add(e,t){const a=this;if(e&&e.column&&"all"!==e.column&&!a.columns.find((t=>t.dataField===e.column)))return void a.items.splice(t,1);const n=document.createElement("div"),l=a._defaults,o=` animation="${a.animation}"${a.rightToLeft?" right-to-left":""} theme="${a.theme}"${a.unfocusable?" unfocusable":""}`,i=a.disabled||a.unfocusable?"":' tabindex="0"';e=Object.assign({column:"all",condition:"lessThan",firstValue:0,secondValue:1,fontFamily:l.fontFamily,fontSize:l.fontSize,text:l.text,highlight:l.highlight},e);const r=`\n<div class="value-label">${a.localize("value")}</div>\n<smart-input class="columns-input underlined" data-source='${JSON.stringify(a._columnsInputDataSource)}' placeholder="${a.localize("column")}" readonly value="${a._columnsInputDataSource.find((t=>t.value===e.column)).label}"${o}></smart-input>\n<smart-input class="condition-input underlined" data-source='${a._conditionsDataSource}' placeholder="${a.localize("condition")}" readonly value="${a.localize(e.condition)}"${o}></smart-input>\n<smart-input class="first-value underlined" type="number" placeholder="${a.localize("value")}" value="${e.firstValue}"${o}></smart-input>\n<div class="ampersand">&</div>\n<smart-input class="second-value underlined" type="number" placeholder="${a.localize("secondValue")}" value="${e.secondValue}"${o}></smart-input>\n<div class="close-button" title="${a.localize("close")}"${i} role="button" aria-label="Close"></div>\n<div class="format-label">${a.localize("format")}</div>\n<smart-input class="font-family-input underlined" drop-down-height="auto" placeholder="${a.localize("fontFamily")}" readonly${o}></smart-input>\n<smart-input class="font-size-input underlined" data-source='["8px", "9px", "10px", "11px", "12px", "13px", "14px", "15px", "16px"]' drop-down-height="auto" placeholder="${a.localize("fontSize")}" readonly value="${e.fontSize}"${o}></smart-input>\n<div class="popup-button smart-unselectable"${i} role="button" aria-haspopup="dialog" aria-label="Toggle pop-up">A</div>\n<div class="preview smart-unselectable">2.71828</div>`;n.classList.add("smart-formatting-panel-item"),n.classList.toggle("between","between"===e.condition),n.innerHTML=r,n.columnsInput=n.querySelector(".columns-input"),n.conditionInput=n.querySelector(".condition-input"),n.firstValue=n.querySelector(".first-value"),n.secondValue=n.querySelector(".second-value"),n.closeButton=n.querySelector(".close-button"),n.fontFamilyInput=n.querySelector(".font-family-input"),n.fontFamilyInput.dataSource=[l.fontFamily,"Arial","Verdana","Courier New","Georgia","Times New Roman"],n.fontFamilyInput.value=e.fontFamily,n.fontSizeInput=n.querySelector(".font-size-input"),n.popupButton=n.querySelector(".popup-button"),n.fontFamilyInput=n.querySelector(".font-family-input"),n.preview=n.querySelector(".preview"),n.popupButton.style.color=e.text,n.popupButton.style.backgroundColor=e.highlight,n.preview.style.fontFamily=e.fontFamily,n.preview.style.fontSize=e.fontSize,n.preview.style.color=e.text,n.preview.style.backgroundColor=e.highlight,n.data=e,a.$.itemsContainer.appendChild(n),n.columnsInput.$.input.dataValue="all",n.conditionInput.$.input.dataValue=e.condition,a._checkScrollBar()}apply(){const e=this,t=new Smart.Utilities.ConditionalFormatter(e.dataSource),a=Array.from(e.$.itemsContainer.children),n=[];let l;if(0===a.length)return;if(e.ownerElement&&"smart-pivot-table"===e.ownerElement.nodeName.toLowerCase()){const t=e.ownerElement._dynamicColumns;l=function(e){return"all"===e?t.map((e=>e.id)):t.filter((t=>t.dataFields[t.dataFields.length-1].dataField===e)).map((e=>e.id))}}else l=function(t){return"all"===t?e._columns.map((e=>e.value)):[t]};for(let e=0;e<a.length;e++){const o=a[e].data,i=l(o.column),r=o.condition;t.color=o.highlight,t.comparator=o.firstValue,t.min=o.firstValue,t.max=o.secondValue;const s=t.format(r,i);for(let e in s){const t=s[e];for(let e in t){const a=t[e];a.color=o.text,a.fontFamily=o.fontFamily,a.fontSize=o.fontSize}}n.push(s)}if(0===n.length)return n[0];const o={};for(let e=0;e<n.length;e++){const t=n[e];for(let e in t){const a=t[e];o[e]||(o[e]={});for(let t in a)o[e][t]=Object.assign({},o[e][t],a[t])}}return o}getItems(){return Array.from(this.$.itemsContainer.children).map((e=>e.data))}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":case"rightToLeft":if(Array.from(n.$.itemsContainer.querySelectorAll(".smart-element")).forEach((t=>t[e]=a)),null!==n.dropDownAppendTo&&(n.$.apply[e]=a,n.$.cancel[e]=a),"theme"===e){const e=getComputedStyle(n);n._defaults.text=n._toHex(e.color),n._defaults.highlight=n._toHex(e.backgroundColor)}break;case"columns":case"items":"columns"===e&&(n._processColumnsAndDataSource(),n.items=null),n.$.itemsContainer.innerHTML="",n._addDefaultItems();break;case"disabled":case"unfocusable":{const t=n.disabled||n.unfocusable,l=Array.from(n.$.itemsContainer.querySelectorAll(".close-button, .popup-button"));"disabled"===e?n._closePopup():null!==n.dropDownAppendTo&&(n.$.apply.unfocusable=a,n.$.cancel.unfocusable=a),n._setFocusable(),Array.from(n.$.itemsContainer.querySelectorAll(".smart-element")).forEach((e=>e.unfocusable=t)),t?l.forEach((e=>e.removeAttribute("tabindex"))):l.forEach((e=>e.setAttribute("tabindex",0)));break}case"dataSource":Smart.DataAdapter&&a instanceof Smart.DataAdapter&&(n.dataSource=a.toArray());break;case"locale":case"messages":n.items=n.getItems(),n.$.itemsContainer.innerHTML="",n._localize(),n._columnsInputDataSource=n._columns.concat([{label:n.localize("all"),value:"all"}]),n._addDefaultItems()}}_populatePopupWithColors(){const e=this,t=e._basicColors,a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const l=document.createElement("div"),o=t[n],i=`rgb(${o[0]}, ${o[1]}, ${o[2]})`,r=e._toHex(i);l.setAttribute("role","button"),l.setAttribute("aria-label","Select color "+r),l.index=n,l.value=r,l.style.backgroundColor=i,a.appendChild(l)}e.$.colorsContainer.appendChild(a)}_processColumnsAndDataSource(){const e=this,t=e.columns,a=e.dataSource,n=[];Smart.DataAdapter&&a instanceof Smart.DataAdapter&&(e.dataSource=a.toArray());for(let e=0;e<t.length;e++){const a=t[e];"number"===a.dataType&&n.push({label:a.label,value:a.dataField})}e._columns=n,e._columnsInputDataSource=n.concat([{label:e.localize("all"),value:"all"}])}_addDefaultItems(){const e=this,t=e.items,a=e.getRootNode();a===document||document.body.contains(a)?(t&&t.length>0?t.forEach(((t,a)=>e.add(t,a))):(e.add({condition:"greaterThan",firstValue:100}),e.add({condition:"lessThan",firstValue:0})),delete e._addDefaultItemsOnAttach):e._addDefaultItemsOnAttach=!0}_changeHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target,n=a.closest(".smart-formatting-panel-item");if(n)if(a!==n.columnsInput){if(a===n.conditionInput)return n.data.condition=a.$.input.dataValue,void n.classList.toggle("between","between"===a.$.input.dataValue);if(n.firstValue.contains(a))n.data.firstValue=parseFloat(a.value);else{if(!n.secondValue.contains(a))return a===n.fontFamilyInput?(n.data.fontFamily=a.value,void(n.preview.style.fontFamily=a.value)):void(a===n.fontSizeInput&&(n.data.fontSize=a.value,n.preview.style.fontSize=a.value));n.data.secondValue=parseFloat(a.value)}}else n.data.column=a.$.input.dataValue;else t.$.popup.contains(a)&&t._updateUI(a.value.toUpperCase())}_checkScrollBar(){this.classList.toggle("scroll",this.$.itemsContainer.offsetHeight<this.$.itemsContainer.scrollHeight)}_interactionHandler(e){const t=this;if(!t.dropDownAppendTo&&e.currentTarget===t.$.popup)return;if("keydown"===e.type){if(-1===[" ","Enter"].indexOf(e.key))return void(t.disabled||t.readonly||t._keydownHandler(e));e.preventDefault()}const a=t.isInShadowDOM?e.composedPath()[0]:e.target;if(a===t.$.addNewButton)return void t.add();const n=a.closest(".smart-formatting-panel-item");if(n)return void(a===n.closeButton?(n.remove(),this._checkScrollBar()):a===n.popupButton&&(t._togglePopup(n),t._activePopupButton=a));const l=t.$.popup;if(l.contains(a)){if(a.parentElement===t.$.colorsContainer)return void t._updateUI(a.value);if(a.parentElement===t.$.popupHeader)a.classList.add("selected"),a===t.$.text?(l.selection="currentText",t.$.highlight.classList.remove("selected")):(l.selection="currentHighlight",t.$.text.classList.remove("selected")),t._updateUI(l[l.selection]);else if(a.classList.contains("smart-button")){if(t.$.apply.contains(a)||a&&a.ownerElement&&a.ownerElement.classList.contains("ok")){const e=l.item;e.data.text=l.currentText,e.data.highlight=l.currentHighlight,e.popupButton.style.color=l.currentText,e.popupButton.style.backgroundColor=l.currentHighlight,e.preview.style.color=l.currentText,e.preview.style.backgroundColor=l.currentHighlight}t._closePopup()}}}_keydownHandler(e){const t=this,a=e.key;if(-1===["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Escape","Home","PageDown","PageUp"].indexOf(a))return;if(e.preventDefault(),"Escape"===a&&!t.$.popup.classList.contains("smart-hidden"))return void t._closePopup();if(t.getRootNode().activeElement!==t.$.colorsContainer)return;const n=Array.from(this.$.colorsContainer.children),l=this.$.colorsContainer.querySelector(".selected");let o,i="ArrowRight",r="ArrowLeft";if(t.rightToLeft&&(i="ArrowLeft",r="ArrowRight"),l){let e=l.index;switch(a){case r:e=Math.max(e-1,e-e%8);break;case i:e=Math.min(e+1,e+8-e%8-1);break;case"ArrowUp":e=Math.max(e-8,e%8);break;case"ArrowDown":e=Math.min(e+8,56+e%8);break;case"Home":e-=e%8;break;case"End":e=e+8-e%8-1;break;case"PageUp":e%=8;break;case"PageDown":e=56+e%8}o=n[e]}else o=n[0];t._updateUI(o.value,o)}_togglePopup(e){const t=this,a=t.$.popup;if(e===a.item)return void t._closePopup();if(a.setAttribute("animation",t.animation),a.setAttribute("theme",t.theme),t.rightToLeft&&a.setAttribute("right-to-left",""),a.classList.contains("smart-hidden")&&a.classList.remove("smart-hidden"),t.dropDownAppendTo)if("body"===t.dropDownAppendTo)document.body.appendChild(a);else{const e=document.querySelector(t.dropDownAppendTo);e&&e.appendChild(a)}const n=e.popupButton,l=n.getBoundingClientRect(),o=n.offsetLeft,i=n.offsetTop,r=a.offsetWidth,s=a.offsetHeight,d=t.$.itemsContainer.scrollTop,c=t._toHex(e.data.text),u=t._toHex(e.data.highlight);l.top>=s+5?a.style.top=i-(s+d+5)+"px":a.style.top=i+l.height-d+5+"px",a.style.left=o+l.width/2-r/2+"px",t.dropDownAppendTo&&(a.style.top=l.bottom+5+"px",a.style.left=l.left+l.width/2-r/2+"px"),t.$.text.classList.add("selected"),t.$.highlight.classList.remove("selected"),t.$.text.focus(),a.item=e,a.selection="currentText",a.currentText=c,a.currentHighlight=u,t._updateUI(c),a.controlledBy&&(a.controlledBy.removeAttribute("aria-controls"),a.controlledBy.removeAttribute("aria-expanded")),n.setAttribute("aria-controls",a.id),n.setAttribute("aria-expanded",!0),a.controlledBy=n,a.classList.remove("smart-visibility-hidden")}_closePopup(){const e=this,t=e.$.popup;"none"!==e.animation?(t.addEventListener("transitionend",(function e(){t.classList.add("smart-hidden"),t.removeEventListener("transitionend",e)})),t.classList.add("smart-visibility-hidden")):(t.classList.add("smart-visibility-hidden"),t.classList.add("smart-hidden")),delete t.item,e._activePopupButton&&e._activePopupButton.focus(),t.controlledBy&&(t.controlledBy.removeAttribute("aria-controls"),t.controlledBy.removeAttribute("aria-expanded"))}_toHex(e){if(-1!==e.indexOf("#"))return e;const t=/rgb\((\d+), (\d+), (\d+)\)/g.exec(e);return t?"#"+(parseFloat(t[1]).toString(16).padStart(2,"0")+parseFloat(t[2]).toString(16).padStart(2,"0")+parseFloat(t[3]).toString(16).padStart(2,"0")).toUpperCase():"#FFFFFF"}_updateUI(e,t){const a=this;a.$.colorInput.value=e,a.$.colorCode.innerHTML=e,a._selectColor(e,t)}_selectColor(e,t){const a=this.$.popup,n=Array.from(this.$.colorsContainer.children);n.forEach((e=>e.classList.remove("selected"))),(t=t||n.find((t=>t.value===e)))&&t.classList.add("selected"),a[a.selection]=e}_localize(){const e=this;e._conditionsDataSource=JSON.stringify([{label:e.localize("lessThan"),value:"lessThan"},{label:e.localize("greaterThan"),value:"greaterThan"},{label:e.localize("equal"),value:"equal"},{label:e.localize("notEqual"),value:"notEqual"},{label:e.localize("between"),value:"between"}]),e.$.text.innerHTML=e.localize("text"),e.$.highlight.innerHTML=e.localize("highlight"),e.$.apply.innerHTML=e.localize("apply"),e.$.cancel.innerHTML=e.localize("cancel"),e.$.addNewButton.title=e.localize("add")}_setFocusable(){const e=this,t=!e.disabled&&!e.unfocusable,a=[e.$.addNewButton,e.$.text,e.$.highlight,e.$.colorsContainer];t?(a.forEach((e=>e.setAttribute("tabindex",0))),e.$.colorInput.removeAttribute("tabindex")):(a.forEach((e=>e.removeAttribute("tabindex"))),e.$.colorInput.setAttribute("tabindex",-1))}_documentDownHandler(e){const t=this,a=t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target,n=t.$.popup;n.classList.contains("smart-hidden")||n.contains(a)||a.classList.contains("popup-button")||(delete t._activePopupButton,t._closePopup())}}),Smart("smart-data-view",class extends Smart.BaseElement{static get properties(){return{addNewButton:{value:!1,type:"boolean"},allowDrag:{value:!1,type:"boolean"},collapsible:{value:!1,type:"boolean"},columns:{value:[],type:"object",reflectToAttribute:!1},dataSource:{value:null,type:"object?",reflectToAttribute:!1},dataSourceSettings:{value:{autoGenerateColumns:{value:!1,type:"boolean"},sanitizeHTML:{value:"blackList",allowedValues:["all","blackList","none"],type:"string"},root:{value:"",type:"string"},record:{value:"",type:"string"},keyDataField:{value:"",type:"string"},parentDataField:{value:"",type:"string"},childrenDataField:{value:"",type:"string"},groupBy:{value:[],type:"array"},dataFields:{value:[],type:"array"},mapChar:{value:".",type:"string"},id:{value:"",type:"string"},virtualDataSource:{value:null,type:"any"},virtualDataSourceOnExpand:{value:null,type:"any"}},type:"object"},editable:{value:!1,type:"boolean"},headerPosition:{value:"none",allowedValues:["none","top","bottom"],type:"string"},messages:{value:{en:{addFilter:"+ Add filter",and:"And",apply:"Ok",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",dateFirst:"1",dateLast:"9",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",filter:"Filter",customize:"Customize Columns",filteredByMultiple:"{{n}} filters",filteredByOne:"1 filter",filterValuePlaceholder:"Value",find:"Find a field",findInView:"Find in view",firstBy:"Sort by",found:"{{nth}} of {{n}}",from:"from",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",noFilters:"No filters applied",noResults:"No results",noSorting:"No sorting applied",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",NULL:"null",numberFirst:"1",numberLast:"9",ok:"OK",or:"Or",pickAnother:"Pick another field to sort by",sort:"Sort",group:"Group",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",formatColumn:"Format Column",formating:"Conditional Formating",sortedByMultiple:"Sorted by {{n}} fields",sortedByOne:"Sorted by 1 field",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",stringFirst:"A",stringLast:"Z",thenBy:"then by",where:"Where",collapseAll:"Collapse all",expandAll:"Expand all",noGrouping:"No grouping",groupedByMultiple:"{{n}} groups",groupedByOne:"1 group",firstByGroup:"Group by",pickAnotherGroupBy:"Pick another field to group by",add:"Add condition",all:"All columns",between:"Between",close:"Close",column:"Column:",condition:"Condition:",equal:"Equal To",greaterThan:"Greater Than",highlight:"Highlight",lessThan:"Less Than",notEqual:"Not Equal To",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:",reset:"Reset"}}}}}static get listeners(){return{"header.apply":"_applyHandler","header.cancel":"closePanel","headerDropDown.transitionend":"_headerDropDownTransitionendHandler","searchInput.keyup":"_searchInputKeyupHandler",resize:"_resizeHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler"}}render(){const e=this;e.$.headerDropDown.id||(e.$.headerDropDown.id=e.id+"HeaderDropDown"),e.setAttribute("role","group"),e._isMobile=Smart.Utilities.Core.isMobile,super.render()}addFilter(e,t="and"){const a=this;if(!Array.isArray(e)||e.length>0&&!Array.isArray(e[0]))return;let n;a.closePanel(),arguments[2]?n={filters:arguments[2],operator:t}:(n={filters:[],operator:t},e.forEach((e=>{e[1].filters.forEach((t=>{n.filters.push([e[0],t.condition,t.value])}))}))),JSON.stringify(n)!==JSON.stringify(a._appliedFiltering)&&(n.filterGroups=e,a._appliedFiltering=n,a._applyFilter(e,t),a.$.fireEvent("filter"),a._refreshFilterButton())}_refreshFilterButton(){const e=this,t=e._appliedFiltering.filters?e._appliedFiltering.filters.length:0;if(0===t)return e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"),void e.$.filterButton.classList.remove("filtered");e.$.filterButton.firstElementChild.innerHTML=1===t?e.localize("filteredByOne"):e.localize("filteredByMultiple",{n:t}),e.$.filterButton.classList.add("filtered")}addSort(e,t){const a=this,n=a.dataSource,l=JSON.stringify(a._appliedSorting);let o;function i(e,l){if(a.columns.find((t=>t.dataField===e))){let a=Array.isArray(t)?t[l]:"string"==typeof t?t:"ascending";o.dataFields.push(e),o.dataTypes.push(n.dataFields.find((t=>t.name===e)).dataType),a=a&&-1!==a.indexOf("desc")?"descending":"ascending",o.orderBy.push(a)}}if(0!==arguments.length&&n&&0!==n.length){if(a.closePanel(),1===arguments.length&&"object"==typeof e)o=e;else if(o={dataFields:[],dataTypes:[],orderBy:[]},Array.isArray(e))e.forEach(i);else{if("string"!=typeof e)return;i(e,0)}a.closePanel(),a._appliedSorting=o,l!==JSON.stringify(a._appliedSorting)&&(a._applySort(),a.$.fireEvent("sort"),a._refreshSortButton())}}_refreshSortButton(){const e=this,t=e._appliedSorting.dataFields.length;if(0===t)return e.$.sortButton.firstElementChild.innerHTML=e.localize("sort"),void e.$.sortButton.classList.remove("sorted");e.$.sortButton.firstElementChild.innerHTML=1===t?e.localize("sortedByOne"):e.localize("sortedByMultiple",{n:t}),e.$.sortButton.classList.add("sorted")}closePanel(){const e=this.$.headerDropDown;e.classList.remove("open"),setTimeout((()=>{e.classList.add("smart-visibility-hidden")}),150),this._closeSearchPanel(),e.controlledBy&&(e.controlledBy.removeAttribute("aria-controls"),e.controlledBy.setAttribute("aria-expanded",!1),delete e.controlledBy)}_closeSearchPanel(){const e=this;e._searchInfo&&delete e._searchInfo}_closeDialog(){const e=this;e._editInfo&&e._editInfo.window.close()}openFormatPanel(){}openFilterPanel(e,t){const a=this,n=a.dataSource;if(!n||0===n.length&&!n.virtualDataSource||a.disabled||"none"===a.headerPosition)return;let l;a._editInfo&&a._editInfo.window.close(),a.$.headerDropDown.classList.add("filter-panel"),a.$.headerDropDown.classList.remove("customize-panel","sort-panel","search-panel","format-panel"),a.$.filter.classList.remove("smart-hidden"),a.$.customize.classList.add("smart-hidden"),a.$.sort.classList.add("smart-hidden"),a.$.format&&a.$.format.classList.add("smart-hidden"),a.$.group&&a.$.group.classList.add("smart-hidden"),a.$.search.classList.add("smart-hidden"),a._closeSearchPanel(),a._filterPartCreated?(l=a.$.filter.firstElementChild,l.set("dataSource",e),l.set("locale",a.locale),l.messages=a._innerElementMessages.multiColumnFilterPanel,l.operator=a._appliedFiltering.operator,l.editorPlaceholder=a.localize("filterValuePlaceholder"),l.set("operator",a._appliedFiltering.operator),l.set("value",a._appliedFiltering.filters),l._applyValue(),l.rightToLeft=a.rightToLeft):(l=document.createElement("smart-multi-column-filter-panel"),l.rightToLeft=a.rightToLeft,l.animation=a.animation,l.dataSource=e,l.locale=a.locale,l.messages=a._innerElementMessages.multiColumnFilterPanel,l.operator=a._appliedFiltering.operator,l.editorPlaceholder=a.localize("filterValuePlaceholder"),l.theme=a.theme,l.value=a._appliedFiltering.filters,l.editorCallback=t,a.$.filter.appendChild(l),a._filterPartCreated=!0),a._openHeaderDropDown(a.$.filterButton)}openSortPanel(e){const t=this,a=t.dataSource;if(!a||0===a.length&&!a.virtualDataSource||t.disabled||"none"===t.headerPosition)return;let n;t._closeDialog(),t.$.headerDropDown.classList.add("sort-panel"),t.$.headerDropDown.classList.remove("customize-panel","filter-panel","format-panel","search-panel"),t.$.sort.classList.remove("smart-hidden"),t.$.customize.classList.add("smart-hidden"),t.$.filter.classList.add("smart-hidden"),t.$.format&&t.$.format.classList.add("smart-hidden"),t.$.group&&t.$.group.classList.add("smart-hidden"),t.$.search.classList.add("smart-hidden"),t._closeSearchPanel(),t._sortPartCreated?(n=t.$.sort.firstElementChild,n.rightToLeft=t.rightToLeft,n.dataSource=e,n.locale=t.locale,n.messages=t._innerElementMessages.sortPanel,n.set("dataSource",e),n.propertyChangedHandler("dataSource",void 0,e)):(n=document.createElement("smart-sort-panel"),n.rightToLeft=t.rightToLeft,n.animation=t.animation,n.dataSource=e,n.locale=t.locale,n.messages=t._innerElementMessages.sortPanel,n.theme=t.theme,t.$.sort.appendChild(n),t._sortPartCreated=!0),t._openHeaderDropDown(t.$.sortButton)}removeFilter(){this.addFilter([])}removeSort(){this.addSort({dataFields:[],dataTypes:[],orderBy:[]})}_clearFilterAndSortUI(){const e=this;e._appliedFiltering={filterGroups:[],filters:[],operator:"and"},e._appliedSorting={dataFields:[],dataTypes:[],orderBy:[]},e._appliedGrouping={dataFields:[]},e.$.filterButton.classList.remove("filtered"),e.$.sortButton.classList.remove("sorted"),e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"),e.$.sortButton.firstElementChild.innerHTML=e.localize("sort")}_getInnerElementMessages(){const e=this,t=e.locale,a={columnPanel:{},groupPanel:{},multiColumnFilterPanel:{},sortPanel:{},formattingPanel:{},dateTimePicker:{}};a.formattingPanel[t]={add:e.localize("add"),all:e.localize("all"),apply:e.localize("apply"),between:e.localize("between"),cancel:e.localize("cancel"),close:e.localize("close"),column:e.localize("column"),condition:e.localize("condition"),equal:e.localize("equal"),fontFamily:e.localize("fontFamily"),fontSize:e.localize("fontSize"),format:e.localize("format"),greaterThan:e.localize("greaterThan"),highlight:e.localize("highlight"),lessThan:e.localize("lessThan"),notEqual:e.localize("notEqual"),remove:e.localize("remove"),secondValue:e.localize("secondValue"),text:e.localize("text"),value:e.localize("value")},a.columnPanel[t]={apply:e.localize("apply"),cancel:e.localize("cancel"),reset:e.localize("reset"),find:e.localize("find"),noResults:e.localize("noResults")},a.groupPanel[t]={apply:e.localize("apply"),cancel:e.localize("cancel"),collapseAll:e.localize("collapseAll"),expandAll:e.localize("expandAll"),firstBy:e.localize("firstByGroup"),noGrouping:e.localize("noGrouping"),pickAnother:e.localize("pickAnotherGroupBy"),stringFirst:e.localize("stringFirst"),stringLast:e.localize("stringLast"),thenBy:e.localize("thenBy"),from:e.localize("from"),booleanFirst:e.localize("booleanFirst"),booleanLast:e.localize("booleanLast"),dateFirst:e.localize("dateFirst"),dateLast:e.localize("dateLast"),numberFirst:e.localize("numberFirst"),numberLast:e.localize("numberLast")},a.multiColumnFilterPanel[t]={addFilter:e.localize("addFilter"),and:e.localize("and"),apply:e.localize("apply"),cancel:e.localize("cancel"),CONTAINS:e.localize("CONTAINS"),CONTAINS_CASE_SENSITIVE:e.localize("CONTAINS_CASE_SENSITIVE"),DOES_NOT_CONTAIN:e.localize("DOES_NOT_CONTAIN"),DOES_NOT_CONTAIN_CASE_SENSITIVE:e.localize("DOES_NOT_CONTAIN_CASE_SENSITIVE"),EMPTY:e.localize("EMPTY"),ENDS_WITH:e.localize("ENDS_WITH"),ENDS_WITH_CASE_SENSITIVE:e.localize("ENDS_WITH_CASE_SENSITIVE"),EQUAL:e.localize("EQUAL"),EQUAL_CASE_SENSITIVE:e.localize("EQUAL_CASE_SENSITIVE"),GREATER_THAN:e.localize("GREATER_THAN"),GREATER_THAN_OR_EQUAL:e.localize("GREATER_THAN_OR_EQUAL"),LESS_THAN:e.localize("LESS_THAN"),LESS_THAN_OR_EQUAL:e.localize("LESS_THAN_OR_EQUAL"),noFilters:e.localize("noFilters"),NOT_EMPTY:e.localize("NOT_EMPTY"),NOT_EQUAL:e.localize("NOT_EQUAL"),NOT_NULL:e.localize("NOT_NULL"),NULL:e.localize("NULL"),or:e.localize("or"),STARTS_WITH:e.localize("STARTS_WITH"),STARTS_WITH_CASE_SENSITIVE:e.localize("STARTS_WITH_CASE_SENSITIVE"),where:e.localize("where")},a.sortPanel[t]={apply:e.localize("apply"),booleanFirst:e.localize("booleanFirst"),booleanLast:e.localize("booleanLast"),cancel:e.localize("cancel"),dateFirst:e.localize("dateFirst"),dateLast:e.localize("dateLast"),firstBy:e.localize("firstBy"),from:e.localize("from"),numberFirst:e.localize("numberFirst"),numberLast:e.localize("numberLast"),noSorting:e.localize("noSorting"),pickAnother:e.localize("pickAnother"),stringFirst:e.localize("stringFirst"),stringLast:e.localize("stringLast"),thenBy:e.localize("thenBy")},a.dateTimePicker[t]={now:e.localize("now"),dateTabLabel:e.localize("dateTabLabel"),timeTabLabel:e.localize("timeTabLabel")},e._innerElementMessages=a}_handleHeaderPosition(e){const t=this,a=t.headerPosition,n=t.$.header;"none"!==a?(n.classList.remove("smart-hidden"),"top"===a&&n.nextElementSibling!==e?t.$.container.insertBefore(n,e):"bottom"===a&&n.previousElementSibling!==e&&t.$.container.insertBefore(n,t.$.loadingIndicatorContainer)):n.classList.add("smart-hidden")}_headerClickHandler(e){const t=this,a=t.$.headerDropDown;function n(e,n){a.classList.contains("smart-visibility-hidden")||e.classList.contains("smart-hidden")?t[n]():t.closePanel()}if(t.$.customizeButton.contains(e))n(t.$.customize,"openCustomizePanel");else if(t.$.filterButton.contains(e))n(t.$.filter,"openFilterPanel");else if(t.$.sortButton.contains(e))n(t.$.sort,"openSortPanel");else if(t.$.formatButton&&t.$.formatButton.contains(e))n(t.$.format,"openFormatPanel");else if(e===t.$.searchButton)n(t.$.search,"_openSearchPanel");else if(t.$.groupButton&&t.$.groupButton.contains(e))n(t.$.group,"openGroupPanel");else if(e===t.$.searchClose)t.closePanel();else if(e===t.$.searchPrev||e===t.$.searchNext){const a=t._searchInfo,n=a.foundIdsArray,l=e===t.$.searchNext,o=n.length;let i;if(void 0===a.highlighted)i=l?0:o-1;else{if(1===n.length)return;{const e=n.indexOf(a.highlighted);i=l?(e+1)%o:e-1>=0?e-1:o-1}}a.highlighted=n[i],t.grid?(t.grid.highlighted=a.highlighted,t.grid.ensureVisible(a.highlighted),t.grid._recycle(!1)):t.ensureVisible&&t.ensureVisible(a.highlighted),t.$.searchLabel.innerHTML=t.localize("found",{nth:i+1,n:n.length})}}_headerDropDownTransitionendHandler(e){const t=this,a=t.$.headerDropDown;e&&("visibility"!==e.propertyName||a.classList.contains("smart-visibility-hidden"))||(a.classList.contains("search-panel")?t.$.searchInput.focus():!1===t.unfocusable&&(!t._isMobile&&a.classList.contains("customize-panel")?a.querySelector("smart-column-panel").$.find.focus():a.classList.contains("filter-panel")?a.querySelector("smart-multi-column-filter-panel").$.addFilterButton.focus():a.classList.contains("sort-panel")&&a.querySelector("smart-sort-panel").$.inputNotSorted.focus()))}_localizeHeader(){const e=this;e.$.customizeButton.firstElementChild.innerHTML=e.localize("customize"),e.$.groupButton&&(e.$.groupButton.firstElementChild.innerHTML=e.localize("group")),0===e._appliedFiltering.filters.length?e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"):1===e._appliedFiltering.filters.length?e.$.filterButton.firstElementChild.innerHTML=e.localize("filteredByOne"):e.$.filterButton.firstElementChild.innerHTML=e.localize("filteredByMultiple",{n:e._appliedFiltering.filters.length}),0===e._appliedSorting.dataFields.length?e.$.sortButton.firstElementChild.innerHTML=e.localize("sort"):1===e._appliedSorting.dataFields.length?e.$.sortButton.firstElementChild.innerHTML=e.localize("sortedByOne"):e.$.sortButton.firstElementChild.innerHTML=e.localize("sortedByMultiple",{n:e._appliedSorting.dataFields.length}),e.$.formatButton&&(e.$.formatButton.firstElementChild.innerHTML=e.localize("formating")),e.$.searchInput.placeholder=e.localize("findInView")}_openHeaderDropDown(e){const t=this,a=t.$.headerDropDown;"top"===t.headerPosition?(a.style.bottom=null,a.style.top="100%"):(a.style.top=null,a.style.bottom="100%"),e!==t.$.searchButton?a.style.left=e.offsetLeft-(t.rightToLeft?a.offsetWidth-e.offsetWidth:0)+"px":a.style.left=(t.rightToLeft?e.offsetLeft:e.offsetLeft+Math.max(25,e.offsetWidth)-a.offsetWidth)+"px",a.classList.remove("smart-visibility-hidden"),a.classList.add("open"),a.controlledBy&&(a.controlledBy.removeAttribute("aria-controls"),a.controlledBy.setAttribute("aria-expanded",!1)),a.controlledBy=e,e.setAttribute("aria-controls",a.id),e.setAttribute("aria-expanded",!0),t._headerDropDownTransitionendHandler()}_searchInputKeyupHandler(){const e=this;function t(){e._searchInfo&&e.$.searchInput.value!==e._searchInfo.query&&e._search(e.$.searchInput.value)}if(clearTimeout(e._searchInputTimeout),"Enter"===event.key&&e._searchInfo.foundIdsArray&&e._searchInfo.foundIdsArray.length>1)return t(),void e._headerClickHandler(e.$.searchNext,e.$.cardContainer||e.$.body);e._searchInputTimeout=setTimeout(t,500)}});
866
+ Smart("smart-grid-panel",class extends Smart.BaseElement{static get properties(){return{closeButtonPosition:{value:"left",allowedValues:["left","right"],type:"string"},dataSource:{value:[],type:"array",reflectToAttribute:!1},messages:{value:{en:{apply:"Ok",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",dateFirst:"1",dateLast:"9",from:"from",numberFirst:"1",numberLast:"9",stringFirst:"A",stringLast:"Z",thenBy:"then by"}},type:"object",extend:!0}}}static get listeners(){return{change:"_changeHandler",click:"_clickHandler",keydown:"_keydownHandler","sortable.dragEnd":"_sortableDragEndHandler"}}static get requires(){return{"Smart.Input":"smart.input.js","Smart.Sortable":"smart.sortable.js"}}static get styleUrls(){return["smart.gridpanel.css"]}template(){return'<div id="container" role="presentation">\n <smart-sortable id="sortable" disable-mode="manual" animation="[[animation]]" disabled="[[readonly]]" right-to-left="[[rightToLeft]]"\n drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]">\n </smart-sortable>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <smart-input id="inputNotSorted" right-to-left="[[rightToLeft]]" animation="[[animation]]" readonly theme="[[theme]]"></smart-input>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),"right"===e.closeButtonPosition&&(e.$.sortable.handlePosition="left"),e._localize(),e._createSources(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":Array.from(n.$.sortable.getElementsByTagName("smart-input")).forEach((t=>t[e]=a));break;case"disabled":case"unfocusable":n._setFocusable();break;case"closeButtonPosition":"right"===n.closeButtonPosition?n.$.sortable.handlePosition="left":n.$.sortable.handlePosition="right";break;case"dataSource":n.$.sortable.$.container.innerHTML="",n._createSources();break;case"locale":case"messages":{const e=n.$.sortable._items;n._localize(),e.length&&(e[0].children[1].innerHTML=n.localize("firstBy"),e.forEach((function(e,t){0!==t&&(e.children[1].innerHTML=n.localize("thenBy"));const a=n._HTMLToSourceMap.get(e),l=n._ascDescTemplates[a.dataType]||n._ascDescTemplates.string;e.children[3].innerHTML=n.localize("from"),e.children[4].firstElementChild.innerHTML=l[0],e.children[4].children[1].innerHTML=l[1]})));break}case"maxLevel":if(null!=a)for(;n.$.sortable._items.length>0&&n.$.sortable._items.length>a;)n._interactionHandler(n.$.sortable._items[n.$.sortable._items.length-1].firstElementChild);n._disableItemAddition();break;case"rightToLeft":n.$.inputNotSorted.rightToLeft=a,n.$.inputNotSorted.dropDownButtonPosition=a?"left":"right",n.$.sortable._items.forEach((e=>{const t=e.querySelector("smart-input");t.rightToLeft=a,t.dropDownButtonPosition=a?"left":"right"}))}}_changeHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(t.$.inputNotSorted.contains(a)){const e=t.$.inputNotSorted.value,a=t._labelToSourceMap.get(e);return t._createSortItem(a,t.$.sortable._items.length),t.$.sortable.updateItems(),t._visibleLabels.push(e),t._updateHiddenSource(),t._disableItemAddition(),void(t.$.inputNotSorted.value="")}const n=a.closest("smart-input");if(!n)return;const l=n.parentElement.parentElement,o=l.children[4].firstElementChild,i=l.children[4].children[1],r=n.value,s=t._HTMLToSourceMap.get(l).label,d=t._labelToSourceMap.get(r),c=t._ascDescTemplates[d.dataType]||t._ascDescTemplates.string;t._HTMLToSourceMap.set(l,d),t._visibleLabels.splice(t._visibleLabels.indexOf(s),1,r),t._updateHiddenSource(),o.innerHTML=c[0],i.innerHTML=c[1],d.sortDirection&&-1===d.sortDirection.indexOf("asc")?(i.classList.add("selected"),o.classList.remove("selected")):(o.classList.add("selected"),i.classList.remove("selected"))}_updateHiddenSource(){const e=this;e._hiddenSource=e.dataSource.map((e=>({label:e.label,value:e.dataField,icon:e.icon}))).filter((t=>-1===e._visibleLabels.indexOf(t.label))),e.$.inputNotSorted.dataSource=e._hiddenSource,e.$.sortable._items.forEach((t=>t.getElementsByTagName("smart-input")[0].dataSource=e._hiddenSource)),e._disableItemAddition(),e.$.fireEvent("dataSourceChange")}_clickHandler(e){const t=this;t._interactionHandler(t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target,e)}_interactionHandler(e,t){const a=this;if(a.disabled||a.readonly)return!0;const n=e.closest(".smart-grid-panel-item");if(n){if(e===n.firstElementChild){const e=a._HTMLToSourceMap.get(n).label;a.$.sortable.$.container.removeChild(n),a.$.sortable.updateItems(),a._visibleLabels.splice(a._visibleLabels.indexOf(e),1),a._updateHiddenSource(),a._disableItemAddition(),a.$.sortable._items.length&&(a.$.sortable._items[0].children[1].innerHTML=a.localize("firstBy")),a.$.fireEvent("remove")}else if(n.children[4].contains(e)){const l=n.children[4].firstElementChild,o=n.children[4].children[1];"click"===t.type?e.classList.contains("selected")||(e===l?(o.classList.remove("selected"),l.classList.add("selected"),a._HTMLToSourceMap.get(n).sortDirection="ascending"):e===o&&(l.classList.remove("selected"),o.classList.add("selected"),a._HTMLToSourceMap.get(n).sortDirection="descending")):(l.classList.toggle("selected"),o.classList.toggle("selected"),a._HTMLToSourceMap.get(n).sortDirection=l.classList.contains("selected")?"ascending":"descending")}return!0}if(e===a.$.buttonsContainer.firstElementChild)return a.$.fireEvent("cancel"),!0;if(e===a.$.buttonsContainer.children[1]){const e=[],t={dataFields:[],dataTypes:[],orderBy:[]},n={value:e};return a.$.sortable._items.forEach((n=>{const l=a._HTMLToSourceMap.get(n);e.push({dataField:l.dataField,sortDirection:l.sortDirection}),t.dataFields.push(l.dataField),t.dataTypes.push(l.dataType),t.orderBy.push(l.sortDirection)})),(a instanceof Smart.SortPanel||a instanceof Smart.GroupPanel)&&(n.sortByInfo=t),a.$.fireEvent("apply",n),!0}}_keydownHandler(e){const t=this,a=e.key;" "!==a&&"Enter"!==a||(e.preventDefault(),t._interactionHandler((t.shadowRoot||t.getRootNode()).activeElement,e))}_sortableDragEndHandler(e){const t=this,a=e.detail.oldIndex,n=e.detail.newIndex,l=Math.max(a,n),o=t.$.sortable._items;0===(a&&n)&&(o[0].children[1].innerHTML=t.localize("firstBy"),o[1].children[1].innerHTML=t.localize("thenBy"),l>1&&(o[l].children[1].innerHTML=t.localize("thenBy")))}_localize(){const e=this;e.$.inputNotSorted.placeholder=e.localize("pickAnother"),e.$.buttonsContainer.firstElementChild.innerHTML=e.localize("cancel"),e.$.buttonsContainer.children[1].innerHTML=e.localize("apply"),e._ascDescTemplates={boolean:[e.localize("booleanFirst")+" → "+e.localize("booleanLast"),e.localize("booleanLast")+" → "+e.localize("booleanFirst")],date:[e.localize("dateFirst")+" → "+e.localize("dateLast"),e.localize("dateLast")+" → "+e.localize("dateFirst")],number:[e.localize("numberFirst")+" → "+e.localize("numberLast"),e.localize("numberLast")+" → "+e.localize("numberFirst")],string:[e.localize("stringFirst")+" → "+e.localize("stringLast"),e.localize("stringLast")+" → "+e.localize("stringFirst")]}}_createSources(){const e=this,t=(e instanceof Smart.SortPanel?"sort":"group")+"Index",a=[],n=[];if(e._HTMLToSourceMap=new Map,e._labelToSourceMap=new Map,e.dataSource.forEach((n=>{e._labelToSourceMap.set(n.label,n),-1!==n[t]&&void 0!==n[t]&&a.push(n)})),a.sort(((e,a)=>e[t]-a[t])),void 0!==e.maxLevel&&null!==e.maxLevel)for(;a.length>0&&a.length>e.maxLevel;)a.pop();e.$.inputNotSorted.dropDownButtonPosition=e.rightToLeft?"left":"right",e.$.inputNotSorted.dataSource&&e.$.inputNotSorted.dataSource.length<10&&e.$.inputNotSorted.dataSource.length>0?e.$.inputNotSorted.dropDownHeight="auto":e.$.inputNotSorted.dropDownHeight=250,a.forEach((e=>n.push(e.label))),e._visibleLabels=n,e._updateHiddenSource(),a.forEach(((t,a)=>{e._createSortItem(t,a)})),e.$.sortable.updateItems(),e._disableItemAddition(),e._setFocusable()}_createSortItem(e,t){const a=this,n=a.disabled||a.unfocusable?-1:0,l=document.createElement("div"),o=a._ascDescTemplates[e.dataType]||a._ascDescTemplates.string;l.className="smart-grid-panel-item",l.innerHTML=`<div class="smart-grid-panel-item-close-button" tabindex="${n}" role="button" aria-label="Close"></div>\n<div class="smart-grid-panel-label-by smart-unselectable" role="presentation">${a.localize(t>0?"thenBy":"firstBy")}</div>\n<div class="smart-grid-panel-field-container" role="presentation"><smart-input class="smart-grid-panel-field-selection" value="${e.label}" animation="${a.animation}" readonly theme="${a.theme}" aria-label="Field name"></smart-input></div>\n<div class="smart-grid-panel-from smart-unselectable" role="presentation">${a.localize("from")}</div >\n<div class="smart-grid-panel-direction smart-unselectable" tabindex="${n}" role="presentation">\n <div class="smart-grid-panel-asc" role="button" aria-label="Ascending">${o[0]}</div >\n <div class="smart-grid-panel-desc" role="button" aria-label="Descending">${o[1]}</div>\n</div>\n`;const i=l.querySelector("smart-input");i.dataSource=a._hiddenSource,i.rightToLeft=a.rightToLeft,i.dropDownButtonPosition=a.rightToLeft?"left":"right",i.dataSource&&i.dataSource.length<10?i.dropDownHeight="auto":i.dropDownHeight=250,a.$.sortable.$.container.appendChild(l),i.tabIndex=n,e.sortDirection&&-1===e.sortDirection.indexOf("asc")?l.children[4].children[1].classList.add("selected"):(e.sortDirection="ascending",l.children[4].firstElementChild.classList.add("selected")),a._HTMLToSourceMap.set(l,e)}_disableItemAddition(){const e=this,t=e.maxLevel,a=0===e._hiddenSource.length||null!=t&&Math.max(0,t)===e.$.sortable._items.length;e.$.inputNotSorted.disabled=a,a&&e.$.inputNotSorted.removeAttribute("focus")}_setFocusable(){const e=this,t=e.disabled||e.unfocusable?-1:0,a=Array.from(e.getElementsByClassName("smart-grid-panel-item-close-button")),n=Array.from(e.getElementsByClassName("smart-grid-panel-direction")),l=Array.from(e.getElementsByTagName("input")),o=a.concat(n).concat(l);e.$.buttonsContainer.firstElementChild.tabIndex=t,e.$.buttonsContainer.children[1].tabIndex=t,o.forEach((e=>e.tabIndex=t))}}),Smart("smart-sort-panel",class extends Smart.GridPanel{static get properties(){return{messages:{value:{en:{firstBy:"Sort by",noSorting:"No sorting applied",pickAnother:"Pick another field to sort by"}},type:"object",extend:!0}}}static get styleUrls(){return["smart.textbox.css"]}_localize(){super._localize(),this.$.sortable.$.container.setAttribute("no-sorting",this.localize("noSorting"))}}),Smart("smart-group-panel",class extends Smart.GridPanel{static get properties(){return{maxLevel:{value:8,type:"number?"},messages:{value:{en:{collapseAll:"Collapse all",expandAll:"Expand all",firstBy:"Group by",noGrouping:"No grouping",pickAnother:"Pick another field to group by"}},type:"object",extend:!0}}}template(){return'<div id="container" role="presentation">\n <smart-sortable disable-mode="manual" right-to-left="[[rightToLeft]]" id="sortable" animation="[[animation]]" disabled="[[readonly]]" drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]"></smart-sortable>\n <div id="expandCollapseContainer" class="smart-grid-panel-buttons-container smart-grid-panel-expand-collapse smart-unselectable" role="presentation">\n <span class="smart-group-panel-collapse-button" role="button"></span>\n <span class="smart-group-panel-expand-button" role="button"></span>\n </div>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <smart-input right-to-left="[[rightToLeft]]" id="inputNotSorted" animation="[[animation]]" readonly theme="[[theme]]"></smart-input>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}_interactionHandler(e,t){const a=this;super._interactionHandler(e,t)||(e===a.$.expandCollapseContainer.firstElementChild?a.$.fireEvent("collapseAll"):e===a.$.expandCollapseContainer.children[1]&&a.$.fireEvent("expandAll"))}_localize(){super._localize();const e=this;e.$.expandCollapseContainer.firstElementChild.innerHTML=e.localize("collapseAll"),e.$.expandCollapseContainer.children[1].innerHTML=e.localize("expandAll"),e.$.sortable.$.container.setAttribute("no-grouping",e.localize("noGrouping"))}_setFocusable(){super._setFocusable();const e=this,t=e.disabled||e.unfocusable?-1:0;e.$.expandCollapseContainer.firstElementChild.tabIndex=t,e.$.expandCollapseContainer.children[1].tabIndex=t}}),Smart("smart-multi-column-filter-panel",class extends Smart.BaseElement{static get properties(){return{closeButtonPosition:{value:"left",allowedValues:["left","right"],type:"string"},dataSource:{value:[],type:"array",reflectToAttribute:!1},editorCallback:{value:null,type:"function?",reflectToAttribute:!1},editorPlaceholder:{value:"Value",type:"string"},messages:{value:{en:{addFilter:"+ Add filter",and:"And",apply:"Ok",cancel:"Cancel",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",noFilters:"No filters applied",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",NULL:"null",or:"Or",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",where:"Where"}},type:"object",extend:!0},operator:{value:"and",allowedValues:["and","or"],type:"string"},value:{value:[],type:"array"}}}static get listeners(){return{change:"_changeHandler",click:"_interactionHandler",keydown:"_interactionHandler"}}static get requires(){return{"Smart.Button":"smart.button.js","Smart.CheckBox":"smart.checkbox.js","Smart.DateTimePicker":"smart.datetimepicker.js","Smart.FilterGroup":"smart.filter.js","Smart.Input":"smart.input.js","Smart.NumericTextBox":"smart.numerictextbox.js"}}static get styleUrls(){return["smart.gridpanel.css"]}template(){return'<div id="container" role="presentation">\n <div id="itemsContainer" class="smart-filter-panel-items-container smart-unselectable"></div>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <div id="addFilterButton" class="smart-filter-panel-add-filter-button smart-unselectable" role="button"></div>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),e._setFocusable(),e._localize(),e._applyValue(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":case"rightToLeft":Array.from(n.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input")).forEach((t=>{t[e]=a,"smart-input"===t.tagName.toLowerCase()&&"rightToLeft"===e&&"none"!==t.dropDownButtonPosition&&(t.dropDownButtonPosition=a?"left":"right")}));break;case"disabled":case"unfocusable":n._setFocusable(!0);break;case"dataSource":case"value":n._applyValue();break;case"editorPlaceholder":Array.from(n.$.itemsContainer.getElementsByClassName("editor")).forEach((e=>e.placeholder=a));break;case"locale":case"messages":n._localize(!0);break;case"operator":n._setOperator()}}_setOperator(){const e=this,t=e.localize(e.operator);for(let a=2;a<e._items.length;a++)e._items[a].children[1].innerHTML=t}_changeHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(a instanceof Smart.Input==0)return;const n=a.parentElement,l=n.children;if(a===l[1])t.operator=a.$.input.dataValue,t._setOperator();else if(a===l[2]){const a=t.dataSource.find((t=>t.dataField===e.detail.oldValue)).dataType,o=t.dataSource.find((t=>t.dataField===e.detail.value)),i=o.dataType;if("enum"!==i&&i===a)return void(t.editorCallback&&t.editorCallback(l[4],o));const r=l[3].value;let s,d;switch(i){case"date":s=t._numberAndDateConditions,d=document.createElement("smart-date-time-picker"),d.calendarButton=!0,d.dropDownAppendTo="body",d.dropDownDisplayMode="auto",d.formatString="M/d/yy H:mm";break;case"number":s=t._numberAndDateConditions,d=document.createElement("smart-numeric-text-box");break;case"boolean":s=t._booleanConditions,d=document.createElement("smart-check-box");break;case"enum":s=t._enumConditions,d=document.createElement("smart-input"),d.dataSource=o.options,d.readonly=!0,d.dropDownButtonPosition="right";break;default:s=t._stringConditions,d=document.createElement("smart-input")}d.rightToLeft=t.rightToLeft,d.animation=t.animation,d.theme=t.theme,d.unfocusable=t.disabled||t.unfocusable,d.classList.add("underlined"),d.dataSource&&d.dataSource.length<10?d.dropDownHeight="auto":d.dropDownHeight=250,"boolean"!==i&&(d.placeholder=t.editorPlaceholder),t.editorCallback&&t.editorCallback(d,o),l[4].remove(),n.appendChild(d),""===r||s.find((e=>e.label===r))||(l[3].value=""),l[3].dataSource=s,s.length>=10?l[3].dropDownHeight=250:l[3].dropDownHeight="auto",n.dataType=i}else if(a===l[3]){const e=l[4],t=a.$.input.dataValue;-1!==t.indexOf("NULL")||-1!==t.indexOf("EMPTY")?(e.value="",e.checked=!1,e.classList.add("smart-visibility-hidden")):e.classList.remove("smart-visibility-hidden"),a.condition=t}}_interactionHandler(e){const t=this;if(t.disabled||t.readonly)return;if("keydown"===e.type){if("Enter"!==e.key)return;e.preventDefault()}const a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target,n=a.closest(".smart-grid-panel-item");if(n){if(a===n.firstElementChild){const e=t._items.indexOf(n);let a;t._items.splice(e,1),n.remove(),t._items.length>0&&e<2&&(0===e&&(t._items[0].children[1].remove(),a=document.createElement("div"),a.innerHTML=t.localize("where"),t._items[0].insertBefore(a,t._items[0].children[1])),t._items.length>1&&(t._items[1].children[1].remove(),a=document.createElement("smart-input"),a.className="underlined",a.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],a.dropDownButtonPosition=t.rightToLeft?"left":"right",a.readonly=!0,a.value=t.localize(t.operator),a.animation=t.animation,a.theme=t.theme,a.rightToLeft=t.rightToLeft,a.unfocusable=t.disabled||t.unfocusable,t._items[1].insertBefore(a,t._items[1].children[1])))}}else if(a===t.$.addFilterButton&&t.dataSource.length>0)t.$.itemsContainer.appendChild(t._createItem(t.dataSource[0],"","",t._items.length));else if(a!==t.$.buttonsContainer.firstElementChild){if(a===t.$.buttonsContainer.children[1]){const e=t._stringConditions.concat(t._numberAndDateConditions),a=t.operator,n=[],l={},o=[];t._items.forEach((o=>{const i=t.dataSource.find((e=>e.label===o.children[2].value)),r=[];let s=o.children[3].value;if(""===s)return;let d=i.dataType;if(s=e.find((e=>e.label===s)).value,r.push(i.dataField,s),-1===s.indexOf("NULL")&&-1===s.indexOf("EMPTY"))if("boolean"===d)r.push(o.children[4].checked);else if("date"===d)r.push(o.children[4].value.toDate());else if("enum"===d){let e=o.children[4].$.input.dataValue;if(void 0===e){const t=i.options.find((e=>e.label===o.children[4].value));if(!t)return;e=t.value}d="string",r.push(e)}else r.push(o.children[4].value);let c=l[r[0]];void 0===c&&(c=new Smart.Utilities.FilterGroup,l[r[0]]=c);const u=c.createFilter(d,r[2],r[1]);c.addFilter(a,u),n.push(r)}));for(let e in l)o.push([e,l[e]]);t.value=n,t.$.fireEvent("apply",{filters:o,operator:a,value:n})}}else t.$.fireEvent("cancel")}_applyValue(){const e=this,t=document.createDocumentFragment();let a=0;for(e._items=[];e.$.itemsContainer.firstElementChild;)e.$.itemsContainer.firstElementChild.remove();0!==e.dataSource.length&&(e.value.forEach((n=>{if(!Array.isArray(n))return;const l=n[0],o=e.dataSource.find((e=>e.dataField===l));if(!o)return;const i=e._createItem(o,n[1],n[2],a);t.appendChild(i),a++})),e.$.itemsContainer.appendChild(t))}_createItem(e,t,a,n){const l=this,o=l.disabled||l.unfocusable?-1:0,i=document.createElement("div"),r=document.createDocumentFragment(),s=document.createElement("div"),d=document.createElement("smart-input"),c=document.createElement("smart-input");let u,p;return s.className="smart-grid-panel-item-close-button",s.tabIndex=o,s.setAttribute("role","button"),s.setAttribute("aria-label","button"),r.appendChild(s),0===n?(u=document.createElement("div"),u.innerHTML=l.localize("where"),u.setAttribute("role","presentation")):1===n?(u=document.createElement("smart-input"),u.className="underlined",u.dataSource=[{value:"and",label:l.localize("and")},{value:"or",label:l.localize("or")}],u.dropDownButtonPosition=l.rightToLeft?"left":"right",u.readonly=!0,u.value=l.localize(l.operator),u.animation=l.animation,u.theme=l.theme,u.rightToLeft=l.rightToLeft,u.unfocusable=l.disabled||l.unfocusable,u.setAttribute("aria-label","Operator")):(u=document.createElement("div"),u.innerHTML=l.localize(l.operator),u.setAttribute("role","presentation")),r.appendChild(u),d.className="underlined",d.dataSource=l.dataSource.map((e=>({value:e.dataField,label:e.label,icon:e.icon}))),d.dropDownButtonPosition=l.rightToLeft?"left":"right",d.readonly=!0,d.value=e.label,d.animation=l.animation,d.theme=l.theme,d.rightToLeft=l.rightToLeft,d.unfocusable=l.disabled||l.unfocusable,d.setAttribute("aria-label","Field"),d.dataSource&&d.dataSource.length<10?d.dropDownHeight="auto":d.dropDownHeight=250,r.appendChild(d),"boolean"===e.dataType?(c.dataSource=l._booleanConditions,p=document.createElement("smart-check-box"),p.checked="boolean"==typeof a&&a):"date"===e.dataType?(c.dataSource=l._numberAndDateConditions,p=document.createElement("smart-date-time-picker"),p.dropDownDisplayMode="auto",p.calendarButton=!0,p.dropDownAppendTo="body",p.formatString="M/d/yy H:mm",p.value=a):"number"===e.dataType?(c.dataSource=l._numberAndDateConditions,p=document.createElement("smart-numeric-text-box"),p.value="number"==typeof a||"string"==typeof a?a:0):"enum"===e.dataType?(c.dataSource=l._enumConditions,p=document.createElement("smart-input"),p.dataSource=e.options,p.readonly=!0,p.dropDownButtonPosition="right",p.value=a?e.options.find((e=>e.value===a)).label:""):(c.dataSource=l._stringConditions,p=document.createElement("smart-input"),p.value=null!=a?a.toString():""),c.className="underlined",c.dropDownButtonPosition=l.rightToLeft?"left":"right",c.readonly=!0,c.animation=l.animation,c.theme=l.theme,c.rightToLeft=l.rightToLeft,c.unfocusable=l.disabled||l.unfocusable,c.setAttribute("aria-label","Condition"),c.classList.add("smart-filter-panel-list"),c.dataSource.find((e=>e.value===t))?(c.value=l.localize(t),c.condition=t):(p.value="",p.checked=!1),void 0===t||-1===t.indexOf("NULL")&&-1===t.indexOf("EMPTY")||(p.value="",p.checked=!1,p.classList.add("smart-visibility-hidden")),c.dataSource&&c.dataSource.length<10?c.dropDownHeight="auto":c.dropDownHeight=250,p.animation=l.animation,p.classList.add("editor"),p.rightToLeft=l.rightToLeft,p.theme=l.theme,p.unfocusable=l.disabled||l.unfocusable,p.classList.add("underlined"),"boolean"!==e.dataType&&(p.placeholder=l.editorPlaceholder),l.editorCallback&&l.editorCallback(p,e),r.appendChild(c),r.appendChild(p),i.appendChild(r),i.className="smart-grid-panel-item",l._items.push(i),i.dataType=e.dataType,i}_localize(e){const t=this;t.$.addFilterButton.innerHTML=t.localize("addFilter"),t.$.buttonsContainer.firstElementChild.innerHTML=t.localize("cancel"),t.$.buttonsContainer.children[1].innerHTML=t.localize("apply"),t.$.itemsContainer.setAttribute("no-filters",t.localize("noFilters")),t._stringConditions=[{prefix:'<span class="smart-icon smart-icon-empty"></span>',value:"EMPTY",label:t.localize("EMPTY")},{prefix:'<span class="smart-icon smart-icon-not-empty"></span>',value:"NOT_EMPTY",label:t.localize("NOT_EMPTY")},{prefix:'<span class="smart-icon smart-icon-contains"></span>',value:"CONTAINS",label:t.localize("CONTAINS")},{prefix:'<span class="smart-icon smart-icon-does-not-contain"></span>',value:"DOES_NOT_CONTAIN",label:t.localize("DOES_NOT_CONTAIN")},{prefix:'<span class="smart-icon smart-icon-starts-with"></span>',value:"STARTS_WITH",label:t.localize("STARTS_WITH")},{prefix:'<span class="smart-icon smart-icon-ends-with"></span>',value:"ENDS_WITH",label:t.localize("ENDS_WITH")},{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._enumConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")}],t._numberAndDateConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-less-than"></span>',value:"LESS_THAN",label:t.localize("LESS_THAN")},{prefix:'<span class="smart-icon smart-icon-less-than-equal"></span>',value:"LESS_THAN_OR_EQUAL",label:t.localize("LESS_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-greater-than"></span>',value:"GREATER_THAN",label:t.localize("GREATER_THAN")},{prefix:'<span class="smart-icon smart-icon-greater-than-equal"></span>',value:"GREATER_THAN_OR_EQUAL",label:t.localize("GREATER_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._booleanConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],e&&t._items.forEach(((e,a)=>{const n=e.children[1],l=e.children[3];0===a?n.innerHTML=t.localize("where"):1===a?(n.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],n.value=t.localize(t.operator)):n.innerHTML=t.localize(t.operator),"string"===e.dataType?l.dataSource=t._stringConditions:"enum"===e.dataType?l.dataSource=t._enumConditions:"boolean"===e.dataType?l.dataSource=t._booleanConditions:l.dataSource=t._numberAndDateConditions,l.value=l.condition?t.localize(l.condition):""}))}_setFocusable(e){const t=this,a=t.disabled||t.unfocusable?-1:0;if(t.$.addFilterButton.tabIndex=a,t.$.buttonsContainer.firstElementChild.tabIndex=a,t.$.buttonsContainer.children[1].tabIndex=a,e){const e=Array.from(t.$.itemsContainer.getElementsByClassName("smart-grid-panel-item-close-button")),n=Array.from(t.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input"));e.forEach((e=>e.tabIndex=a)),n.forEach((e=>e.unfocusable=t.disabled||t.unfocusable))}}}),Smart("smart-column-panel",class extends Smart.BaseElement{static get properties(){return{dataSource:{value:[],type:"array",reflectToAttribute:!1},messages:{value:{en:{apply:"Ok",cancel:"Cancel",find:"Find a field",reset:"Reset",noResults:"No results"}},type:"object",extend:!0}}}static get listeners(){return{click:"_interactionHandler",keydown:"_interactionHandler","find.keyup":"_findKeyupHandler","sortable.dragEnd":"_sortableDragEndHandler"}}static get requires(){return{"Smart.Sortable":"smart.sortable.js"}}static get styleUrls(){return["smart.gridpanel.css"]}template(){return'<div id="container" role="presentation">\n <div class="smart-column-panel-find-container" role="search">\n <input id="find" readonly="[[readonly]]" role="searchbox" aria-label="Find a field"></input>\n <span id="clearButton" class="clear-button smart-hidden" role="button" aria-label="Clear"></span>\n </div>\n <smart-sortable id="sortable" disable-mode="manual" right-to-left="[[rightToLeft]]" animation="[[animation]]" disabled="[[readonly]]" drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]"></smart-sortable>\n <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n <span id="reset" class="smart-grid-panel-reset-button" role="button"></span>\n <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n <span class="smart-grid-panel-cancel-button" role="button"></span>\n <span class="smart-grid-panel-apply-button primary" role="button"></span>\n </div>\n </div>\n </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),e._positionChanged=!1,e._localize(),e._moves=[],e._createSortItems(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"disabled":case"unfocusable":n._setFocusable();break;case"dataSource":{const e=n.$.sortable.$.container;for(;e.firstChild;)e.removeChild(e.firstChild);n._createSortItems(),n._positionChanged=!1,n.$.find.value="",n.$.clearButton.classList.add("smart-hidden");break}case"locale":case"messages":n._localize()}}_createSortItems(){const e=this,t=document.createDocumentFragment();e._HTMLToSourceMap=new Map,e.dataSource.forEach((a=>t.appendChild(e._createSortItem(a)))),e.$.sortable.$.container.appendChild(t),e.$.sortable.updateItems(),e._setFocusable()}_createSortItem(e){const t=document.createElement("div"),a=this.id+"Label"+e.dataField;return this._HTMLToSourceMap.set(t,e),t.className="smart-grid-panel-item",t.innerHTML=`<div class="toggle-visibility${!1!==e.visible?"":" hidden"}${e.disableToggle?" disable-toggle":""}" role="button" aria-controls="${a}" aria-label="Toggle visibility"></div>\n<span id="${a}" class="smart-column-panel-label smart-unselectable${e.icon?" icon "+e.icon:""}">${e.label}</span>`,1===e.level?t.classList.add("indent"):0===e.level&&t.classList.add("group"),e.disableDrag&&t.setAttribute("disable-drag",""),e.dataField&&t.setAttribute("data-field",e.dataField),e.parentDataField&&t.setAttribute("parent-data-field",e.parentDataField),!1!==e.allowHide&&!0!==e.disableToggle||(t.style.pointerEvents="none",t.setAttribute("disabled",""),t.style.opacity=.8),t}_interactionHandler(e){const t=this;if(t.disabled||t.readonly||"keydown"===e.type&&-1===[" ","Enter"].indexOf(e.key))return;const a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(a.classList.contains("toggle-visibility")){a.classList.toggle("hidden");const e=a.closest(".smart-grid-panel-item");if(e.hasAttribute("data-field")){const n=e.getAttribute("data-field");if(e.hasAttribute("parent-data-field")||e.hasAttribute("disabled")){const a=e.getAttribute("parent-data-field"),n=t.$.sortable.querySelectorAll(".smart-grid-panel-item");let l=null;if(n.forEach((e=>{e.getAttribute("data-field")===a&&(l=e)})),l){let e=0,t=0;n.forEach((n=>{n.getAttribute("parent-data-field")===a&&(e++,n.firstElementChild.classList.contains("hidden")&&t++)})),t===e?l.firstElementChild.classList.add("hidden"):t<e&&l.firstElementChild.classList.remove("hidden")}}else t.$.sortable._items.forEach((e=>{if(e.hasAttribute("parent-data-field")&&!e.hasAttribute("disabled")){const t=e.getAttribute("parent-data-field"),l=e.firstElementChild;t===n&&(a.classList.contains("hidden")?l.classList.add("hidden"):l.classList.remove("hidden"))}}))}}else if(a.parentElement===t.$.buttonsContainer){if(a===t.$.buttonsContainer.firstElementChild)return t.$.fireEvent("cancel"),void(t._moves=[]);if(a===t.$.buttonsContainer.children[1]){const e=[];t.$.sortable._items.forEach((a=>{const n=Object.assign({},t._HTMLToSourceMap.get(a));n.visible=!a.firstElementChild.classList.contains("hidden"),e.push(n)})),t.$.fireEvent("apply",{value:e,positionChanged:t._positionChanged,moves:t._moves}),t._positionChanged=!1,t._moves=[]}}else if(a===t.$.reset){const e=[];t.$.sortable._items.forEach((a=>{const n=Object.assign({},t._HTMLToSourceMap.get(a));n.visible=!0,e.push(n)})),t.$.fireEvent("apply",{value:e,positionChanged:t._positionChanged,moves:t._moves}),t._positionChanged=!1,t._moves=[]}else a.classList.contains("clear-button")&&(t.$.find.value="",t._findKeyupHandler())}_findKeyupHandler(){const e=this;if(e.disabled||e.readonly)return;const t=e.$.find,a=t.value,n=e.$.sortable._items;if(void 0===e._disabledSortable&&(e._disabledSortable=e.$.sortable.disabled),""===a)return t.parentElement.classList.remove("no-results"),e.$.clearButton.classList.add("smart-hidden"),n.forEach((e=>e.classList.remove("smart-hidden"))),e.$.sortable.disabled=e._disabledSortable||e.readonly,void delete e._disabledSortable;let l=!0;e.$.clearButton.classList.remove("smart-hidden"),n.forEach((t=>{-1===e._HTMLToSourceMap.get(t).label.toLowerCase().indexOf(a.toLowerCase())?t.classList.add("smart-hidden"):(t.classList.remove("smart-hidden"),l=!1)})),e.$.sortable.disabled=l,l?t.parentElement.classList.add("no-results"):t.parentElement.classList.remove("no-results")}_sortableDragEndHandler(e){const t=e.detail;this._positionChanged=!0,this._moves.push({oldIndex:t.oldIndex,newIndex:t.newIndex})}_localize(){const e=this;e.$.find.placeholder=e.localize("find"),e.$.reset.innerHTML=e.localize("reset"),e.$.buttonsContainer.firstElementChild.innerHTML=e.localize("cancel"),e.$.buttonsContainer.children[1].innerHTML=e.localize("apply"),e.$.container.firstElementChild.setAttribute("no-results",e.localize("noResults"))}_setFocusable(){const e=this,t=e.disabled||e.unfocusable?-1:0,a=Array.from(e.$.sortable.getElementsByClassName("toggle-visibility"));e.$.find.tabIndex=t,e.$.clearButton.tabIndex=t,e.$.buttonsContainer.firstElementChild.tabIndex=t,e.$.buttonsContainer.children[1].tabIndex=t,a.forEach((e=>e.tabIndex=e.classList.contains("disable-toggle")?-1:t))}}),Smart("smart-formatting-panel",class extends Smart.BaseElement{static get properties(){return{columns:{value:[],type:"array",reflectToAttribute:!1},dataSource:{value:[],type:"any",reflectToAttribute:!1},items:{value:null,type:"array?",reflectToAttribute:!1},dropDownAppendTo:{value:null,type:"any",reflectToAttribute:!1},messages:{value:{en:{add:"Add condition",all:"All columns",apply:"Ok",between:"Between",cancel:"Cancel",close:"Close",column:"Column:",condition:"Condition:",equal:"Equal To",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",greaterThan:"Greater Than",highlight:"Highlight",lessThan:"Less Than",notEqual:"Not Equal To",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:"}},type:"object",extend:!0}}}static get listeners(){return{click:"_interactionHandler",keydown:"_interactionHandler",change:"_changeHandler","popup.change":"_changeHandler","popup.click":"_interactionHandler","popup.keydown":"_interactionHandler","document.down":"_documentDownHandler"}}template(){return'<div id="container" role="presentation">\n <div id="itemsContainer" class="smart-formatting-panel-items-container" role="presentation"></div>\n <div id="addNewButton" class="smart-add-new-button" role="button" aria-label="Add new condition"></div>\n <div id="popup" class="smart-formatting-panel-popup smart-hidden smart-visibility-hidden" role="dialog">\n <div id="popupHeader" class="header" role="presentation">\n <div id="text" class="selected" role="button" aria-label="Text color"></div>\n <div id="highlight" role="button" aria-label="Highlight color"></div>\n </div>\n <div id="colorCode" class="color-code"></div>\n <input id="colorInput" type="color" />\n <div id="colorsContainer" class="colors-container"></div>\n <smart-button id="apply" class="ok primary" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" unfocusable="[[unfocusable]]"></smart-button>\n <smart-button id="cancel" class="cancel" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" unfocusable="[[unfocusable]]"></smart-button>\n </div>\n </div>'}render(){const e=this,t=getComputedStyle(e);e.setAttribute("role","dialog"),e.$.popup.id=e.id+"Popup",e._basicColors=[[0,0,0],[68,68,68],[102,102,102],[153,153,153],[204,204,204],[238,238,238],[243,243,243],[255,255,255],[255,0,0],[255,153,0],[255,255,0],[0,255,0],[0,255,255],[0,0,255],[153,0,255],[255,0,255],[244,204,204],[252,229,205],[255,242,204],[217,234,211],[208,224,227],[207,226,243],[217,210,233],[234,209,220],[234,153,153],[249,203,156],[255,229,153],[182,215,168],[162,196,201],[159,197,232],[180,167,214],[213,166,189],[224,102,102],[246,178,107],[255,217,102],[147,196,125],[118,165,175],[111,168,220],[142,124,195],[194,123,160],[204,0,0],[230,145,56],[241,194,50],[106,168,79],[69,129,142],[61,133,198],[103,78,167],[166,77,121],[153,0,0],[180,95,6],[191,144,0],[56,118,29],[19,79,92],[11,83,148],[53,28,117],[116,27,71],[102,0,0],[120,63,4],[127,96,0],[39,78,19],[12,52,61],[7,55,99],[32,18,77],[76,17,48]],e._defaults={fontFamily:t.fontFamily,fontSize:t.fontSize,text:e._toHex(t.color),highlight:e._toHex(t.backgroundColor)},t.fontFamily.indexOf("-apple")>=0&&(e._defaults.fontFamily="Segoe UI"),e._localize(),e._setFocusable(),e._populatePopupWithColors(),e._processColumnsAndDataSource(),e._addDefaultItems(),super.render()}attached(){const e=this;super.attached(),e.isCompleted&&e._addDefaultItemsOnAttach&&e._addDefaultItems()}add(e,t){const a=this;if(e&&e.column&&"all"!==e.column&&!a.columns.find((t=>t.dataField===e.column)))return void a.items.splice(t,1);const n=document.createElement("div"),l=a._defaults,o=` animation="${a.animation}"${a.rightToLeft?" right-to-left":""} theme="${a.theme}"${a.unfocusable?" unfocusable":""}`,i=a.disabled||a.unfocusable?"":' tabindex="0"';e=Object.assign({column:"all",condition:"lessThan",firstValue:0,secondValue:1,fontFamily:l.fontFamily,fontSize:l.fontSize,text:l.text,highlight:l.highlight},e);const r=`\n<div class="value-label">${a.localize("value")}</div>\n<smart-input class="columns-input underlined" data-source='${JSON.stringify(a._columnsInputDataSource)}' placeholder="${a.localize("column")}" readonly value="${a._columnsInputDataSource.find((t=>t.value===e.column)).label}"${o}></smart-input>\n<smart-input class="condition-input underlined" data-source='${a._conditionsDataSource}' placeholder="${a.localize("condition")}" readonly value="${a.localize(e.condition)}"${o}></smart-input>\n<smart-input class="first-value underlined" type="number" placeholder="${a.localize("value")}" value="${e.firstValue}"${o}></smart-input>\n<div class="ampersand">&</div>\n<smart-input class="second-value underlined" type="number" placeholder="${a.localize("secondValue")}" value="${e.secondValue}"${o}></smart-input>\n<div class="close-button" title="${a.localize("close")}"${i} role="button" aria-label="Close"></div>\n<div class="format-label">${a.localize("format")}</div>\n<smart-input class="font-family-input underlined" drop-down-height="auto" placeholder="${a.localize("fontFamily")}" readonly${o}></smart-input>\n<smart-input class="font-size-input underlined" data-source='["8px", "9px", "10px", "11px", "12px", "13px", "14px", "15px", "16px"]' drop-down-height="auto" placeholder="${a.localize("fontSize")}" readonly value="${e.fontSize}"${o}></smart-input>\n<div class="popup-button smart-unselectable"${i} role="button" aria-haspopup="dialog" aria-label="Toggle pop-up">A</div>\n<div class="preview smart-unselectable">2.71828</div>`;n.classList.add("smart-formatting-panel-item"),n.classList.toggle("between","between"===e.condition),n.innerHTML=r,n.columnsInput=n.querySelector(".columns-input"),n.conditionInput=n.querySelector(".condition-input"),n.firstValue=n.querySelector(".first-value"),n.secondValue=n.querySelector(".second-value"),n.closeButton=n.querySelector(".close-button"),n.fontFamilyInput=n.querySelector(".font-family-input"),n.fontFamilyInput.dataSource=[l.fontFamily,"Arial","Verdana","Courier New","Georgia","Times New Roman"],n.fontFamilyInput.value=e.fontFamily,n.fontSizeInput=n.querySelector(".font-size-input"),n.popupButton=n.querySelector(".popup-button"),n.fontFamilyInput=n.querySelector(".font-family-input"),n.preview=n.querySelector(".preview"),n.popupButton.style.color=e.text,n.popupButton.style.backgroundColor=e.highlight,n.preview.style.fontFamily=e.fontFamily,n.preview.style.fontSize=e.fontSize,n.preview.style.color=e.text,n.preview.style.backgroundColor=e.highlight,n.data=e,a.$.itemsContainer.appendChild(n),n.columnsInput.$.input.dataValue="all",n.conditionInput.$.input.dataValue=e.condition,a._checkScrollBar()}apply(){const e=this,t=new Smart.Utilities.ConditionalFormatter(e.dataSource),a=Array.from(e.$.itemsContainer.children),n=[];let l;if(0===a.length)return;if(e.ownerElement&&"smart-pivot-table"===e.ownerElement.nodeName.toLowerCase()){const t=e.ownerElement._dynamicColumns;l=function(e){return"all"===e?t.map((e=>e.id)):t.filter((t=>t.dataFields[t.dataFields.length-1].dataField===e)).map((e=>e.id))}}else l=function(t){return"all"===t?e._columns.map((e=>e.value)):[t]};for(let e=0;e<a.length;e++){const o=a[e].data,i=l(o.column),r=o.condition;t.color=o.highlight,t.comparator=o.firstValue,t.min=o.firstValue,t.max=o.secondValue;const s=t.format(r,i);for(let e in s){const t=s[e];for(let e in t){const a=t[e];a.color=o.text,a.fontFamily=o.fontFamily,a.fontSize=o.fontSize}}n.push(s)}if(0===n.length)return n[0];const o={};for(let e=0;e<n.length;e++){const t=n[e];for(let e in t){const a=t[e];o[e]||(o[e]={});for(let t in a)o[e][t]=Object.assign({},o[e][t],a[t])}}return o}getItems(){return Array.from(this.$.itemsContainer.children).map((e=>e.data))}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":case"rightToLeft":if(Array.from(n.$.itemsContainer.querySelectorAll(".smart-element")).forEach((t=>t[e]=a)),null!==n.dropDownAppendTo&&(n.$.apply[e]=a,n.$.cancel[e]=a),"theme"===e){const e=getComputedStyle(n);n._defaults.text=n._toHex(e.color),n._defaults.highlight=n._toHex(e.backgroundColor)}break;case"columns":case"items":"columns"===e&&(n._processColumnsAndDataSource(),n.items=null),n.$.itemsContainer.innerHTML="",n._addDefaultItems();break;case"disabled":case"unfocusable":{const t=n.disabled||n.unfocusable,l=Array.from(n.$.itemsContainer.querySelectorAll(".close-button, .popup-button"));"disabled"===e?n._closePopup():null!==n.dropDownAppendTo&&(n.$.apply.unfocusable=a,n.$.cancel.unfocusable=a),n._setFocusable(),Array.from(n.$.itemsContainer.querySelectorAll(".smart-element")).forEach((e=>e.unfocusable=t)),t?l.forEach((e=>e.removeAttribute("tabindex"))):l.forEach((e=>e.setAttribute("tabindex",0)));break}case"dataSource":Smart.DataAdapter&&a instanceof Smart.DataAdapter&&(n.dataSource=a.toArray());break;case"locale":case"messages":n.items=n.getItems(),n.$.itemsContainer.innerHTML="",n._localize(),n._columnsInputDataSource=n._columns.concat([{label:n.localize("all"),value:"all"}]),n._addDefaultItems()}}_populatePopupWithColors(){const e=this,t=e._basicColors,a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const l=document.createElement("div"),o=t[n],i=`rgb(${o[0]}, ${o[1]}, ${o[2]})`,r=e._toHex(i);l.setAttribute("role","button"),l.setAttribute("aria-label","Select color "+r),l.index=n,l.value=r,l.style.backgroundColor=i,a.appendChild(l)}e.$.colorsContainer.appendChild(a)}_processColumnsAndDataSource(){const e=this,t=e.columns,a=e.dataSource,n=[];Smart.DataAdapter&&a instanceof Smart.DataAdapter&&(e.dataSource=a.toArray());for(let e=0;e<t.length;e++){const a=t[e];"number"===a.dataType&&n.push({label:a.label,value:a.dataField})}e._columns=n,e._columnsInputDataSource=n.concat([{label:e.localize("all"),value:"all"}])}_addDefaultItems(){const e=this,t=e.items,a=e.getRootNode();a===document||document.body.contains(a)?(t&&t.length>0?t.forEach(((t,a)=>e.add(t,a))):(e.add({condition:"greaterThan",firstValue:100}),e.add({condition:"lessThan",firstValue:0})),delete e._addDefaultItemsOnAttach):e._addDefaultItemsOnAttach=!0}_changeHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target,n=a.closest(".smart-formatting-panel-item");if(n)if(a!==n.columnsInput){if(a===n.conditionInput)return n.data.condition=a.$.input.dataValue,void n.classList.toggle("between","between"===a.$.input.dataValue);if(n.firstValue.contains(a))n.data.firstValue=parseFloat(a.value);else{if(!n.secondValue.contains(a))return a===n.fontFamilyInput?(n.data.fontFamily=a.value,void(n.preview.style.fontFamily=a.value)):void(a===n.fontSizeInput&&(n.data.fontSize=a.value,n.preview.style.fontSize=a.value));n.data.secondValue=parseFloat(a.value)}}else n.data.column=a.$.input.dataValue;else t.$.popup.contains(a)&&t._updateUI(a.value.toUpperCase())}_checkScrollBar(){this.classList.toggle("scroll",this.$.itemsContainer.offsetHeight<this.$.itemsContainer.scrollHeight)}_interactionHandler(e){const t=this;if(!t.dropDownAppendTo&&e.currentTarget===t.$.popup)return;if("keydown"===e.type){if(-1===[" ","Enter"].indexOf(e.key))return void(t.disabled||t.readonly||t._keydownHandler(e));e.preventDefault()}const a=t.isInShadowDOM?e.composedPath()[0]:e.target;if(a===t.$.addNewButton)return void t.add();const n=a.closest(".smart-formatting-panel-item");if(n)return void(a===n.closeButton?(n.remove(),this._checkScrollBar()):a===n.popupButton&&(t._togglePopup(n),t._activePopupButton=a));const l=t.$.popup;if(l.contains(a)){if(a.parentElement===t.$.colorsContainer)return void t._updateUI(a.value);if(a.parentElement===t.$.popupHeader)a.classList.add("selected"),a===t.$.text?(l.selection="currentText",t.$.highlight.classList.remove("selected")):(l.selection="currentHighlight",t.$.text.classList.remove("selected")),t._updateUI(l[l.selection]);else if(a.classList.contains("smart-button")){if(t.$.apply.contains(a)||a&&a.ownerElement&&a.ownerElement.classList.contains("ok")){const e=l.item;e.data.text=l.currentText,e.data.highlight=l.currentHighlight,e.popupButton.style.color=l.currentText,e.popupButton.style.backgroundColor=l.currentHighlight,e.preview.style.color=l.currentText,e.preview.style.backgroundColor=l.currentHighlight}t._closePopup()}}}_keydownHandler(e){const t=this,a=e.key;if(-1===["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Escape","Home","PageDown","PageUp"].indexOf(a))return;if(e.preventDefault(),"Escape"===a&&!t.$.popup.classList.contains("smart-hidden"))return void t._closePopup();if(t.getRootNode().activeElement!==t.$.colorsContainer)return;const n=Array.from(this.$.colorsContainer.children),l=this.$.colorsContainer.querySelector(".selected");let o,i="ArrowRight",r="ArrowLeft";if(t.rightToLeft&&(i="ArrowLeft",r="ArrowRight"),l){let e=l.index;switch(a){case r:e=Math.max(e-1,e-e%8);break;case i:e=Math.min(e+1,e+8-e%8-1);break;case"ArrowUp":e=Math.max(e-8,e%8);break;case"ArrowDown":e=Math.min(e+8,56+e%8);break;case"Home":e-=e%8;break;case"End":e=e+8-e%8-1;break;case"PageUp":e%=8;break;case"PageDown":e=56+e%8}o=n[e]}else o=n[0];t._updateUI(o.value,o)}_togglePopup(e){const t=this,a=t.$.popup;if(e===a.item)return void t._closePopup();if(a.setAttribute("animation",t.animation),a.setAttribute("theme",t.theme),t.rightToLeft&&a.setAttribute("right-to-left",""),a.classList.contains("smart-hidden")&&a.classList.remove("smart-hidden"),t.dropDownAppendTo)if("body"===t.dropDownAppendTo)document.body.appendChild(a);else{const e=document.querySelector(t.dropDownAppendTo);e&&e.appendChild(a)}const n=e.popupButton,l=n.getBoundingClientRect(),o=n.offsetLeft,i=n.offsetTop,r=a.offsetWidth,s=a.offsetHeight,d=t.$.itemsContainer.scrollTop,c=t._toHex(e.data.text),u=t._toHex(e.data.highlight);l.top>=s+5?a.style.top=i-(s+d+5)+"px":a.style.top=i+l.height-d+5+"px",a.style.left=o+l.width/2-r/2+"px",t.dropDownAppendTo&&(a.style.top=l.bottom+5+"px",a.style.left=l.left+l.width/2-r/2+"px"),t.$.text.classList.add("selected"),t.$.highlight.classList.remove("selected"),t.$.text.focus(),a.item=e,a.selection="currentText",a.currentText=c,a.currentHighlight=u,t._updateUI(c),a.controlledBy&&(a.controlledBy.removeAttribute("aria-controls"),a.controlledBy.removeAttribute("aria-expanded")),n.setAttribute("aria-controls",a.id),n.setAttribute("aria-expanded",!0),a.controlledBy=n,a.classList.remove("smart-visibility-hidden")}_closePopup(){const e=this,t=e.$.popup;"none"!==e.animation?(t.addEventListener("transitionend",(function e(){t.classList.add("smart-hidden"),t.removeEventListener("transitionend",e)})),t.classList.add("smart-visibility-hidden")):(t.classList.add("smart-visibility-hidden"),t.classList.add("smart-hidden")),delete t.item,e._activePopupButton&&e._activePopupButton.focus(),t.controlledBy&&(t.controlledBy.removeAttribute("aria-controls"),t.controlledBy.removeAttribute("aria-expanded"))}_toHex(e){if(-1!==e.indexOf("#"))return e;const t=/rgb\((\d+), (\d+), (\d+)\)/g.exec(e);return t?"#"+(parseFloat(t[1]).toString(16).padStart(2,"0")+parseFloat(t[2]).toString(16).padStart(2,"0")+parseFloat(t[3]).toString(16).padStart(2,"0")).toUpperCase():"#FFFFFF"}_updateUI(e,t){const a=this;a.$.colorInput.value=e,a.$.colorCode.innerHTML=e,a._selectColor(e,t)}_selectColor(e,t){const a=this.$.popup,n=Array.from(this.$.colorsContainer.children);n.forEach((e=>e.classList.remove("selected"))),(t=t||n.find((t=>t.value===e)))&&t.classList.add("selected"),a[a.selection]=e}_localize(){const e=this;e._conditionsDataSource=JSON.stringify([{label:e.localize("lessThan"),value:"lessThan"},{label:e.localize("greaterThan"),value:"greaterThan"},{label:e.localize("equal"),value:"equal"},{label:e.localize("notEqual"),value:"notEqual"},{label:e.localize("between"),value:"between"}]),e.$.text.innerHTML=e.localize("text"),e.$.highlight.innerHTML=e.localize("highlight"),e.$.apply.innerHTML=e.localize("apply"),e.$.cancel.innerHTML=e.localize("cancel"),e.$.addNewButton.title=e.localize("add")}_setFocusable(){const e=this,t=!e.disabled&&!e.unfocusable,a=[e.$.addNewButton,e.$.text,e.$.highlight,e.$.colorsContainer];t?(a.forEach((e=>e.setAttribute("tabindex",0))),e.$.colorInput.removeAttribute("tabindex")):(a.forEach((e=>e.removeAttribute("tabindex"))),e.$.colorInput.setAttribute("tabindex",-1))}_documentDownHandler(e){const t=this,a=t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target,n=t.$.popup;n.classList.contains("smart-hidden")||n.contains(a)||a.classList.contains("popup-button")||(delete t._activePopupButton,t._closePopup())}}),Smart("smart-data-view",class extends Smart.BaseElement{static get properties(){return{addNewButton:{value:!1,type:"boolean"},allowDrag:{value:!1,type:"boolean"},collapsible:{value:!1,type:"boolean"},columns:{value:[],type:"object",reflectToAttribute:!1},dataSource:{value:null,type:"object?",reflectToAttribute:!1},dataSourceSettings:{value:{autoGenerateColumns:{value:!1,type:"boolean"},sanitizeHTML:{value:"blackList",allowedValues:["all","blackList","none"],type:"string"},root:{value:"",type:"string"},record:{value:"",type:"string"},keyDataField:{value:"",type:"string"},parentDataField:{value:"",type:"string"},childrenDataField:{value:"",type:"string"},groupBy:{value:[],type:"array"},dataFields:{value:[],type:"array"},mapChar:{value:".",type:"string"},id:{value:"",type:"string"},virtualDataSource:{value:null,type:"any"},virtualDataSourceOnExpand:{value:null,type:"any"}},type:"object"},editable:{value:!1,type:"boolean"},headerPosition:{value:"none",allowedValues:["none","top","bottom"],type:"string"},messages:{value:{en:{addFilter:"+ Add filter",and:"And",apply:"Ok",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",dateFirst:"1",dateLast:"9",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",filter:"Filter",customize:"Customize Columns",filteredByMultiple:"{{n}} filters",filteredByOne:"1 filter",filterValuePlaceholder:"Value",find:"Find a field",findInView:"Find in view",firstBy:"Sort by",found:"{{nth}} of {{n}}",from:"from",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",noFilters:"No filters applied",noResults:"No results",noSorting:"No sorting applied",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",NULL:"null",numberFirst:"1",numberLast:"9",ok:"OK",or:"Or",pickAnother:"Pick another field to sort by",sort:"Sort",group:"Group",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",formatColumn:"Format Column",formating:"Conditional Formating",sortedByMultiple:"Sorted by {{n}} fields",sortedByOne:"Sorted by 1 field",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",stringFirst:"A",stringLast:"Z",thenBy:"then by",where:"Where",collapseAll:"Collapse all",expandAll:"Expand all",noGrouping:"No grouping",groupedByMultiple:"{{n}} groups",groupedByOne:"1 group",firstByGroup:"Group by",pickAnotherGroupBy:"Pick another field to group by",add:"Add condition",all:"All columns",between:"Between",close:"Close",column:"Column:",condition:"Condition:",equal:"Equal To",greaterThan:"Greater Than",highlight:"Highlight",lessThan:"Less Than",notEqual:"Not Equal To",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:",reset:"Reset"}}}}}static get listeners(){return{"header.apply":"_applyHandler","header.cancel":"closePanel","headerDropDown.transitionend":"_headerDropDownTransitionendHandler","searchInput.keyup":"_searchInputKeyupHandler",resize:"_resizeHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler"}}render(){const e=this;e.$.headerDropDown.id||(e.$.headerDropDown.id=e.id+"HeaderDropDown"),e.setAttribute("role","group"),e._isMobile=Smart.Utilities.Core.isMobile,super.render()}addFilter(e,t="and"){const a=this;if(!Array.isArray(e)||e.length>0&&!Array.isArray(e[0]))return;let n;a.closePanel(),arguments[2]?n={filters:arguments[2],operator:t}:(n={filters:[],operator:t},e.forEach((e=>{e[1].filters.forEach((t=>{n.filters.push([e[0],t.condition,t.value])}))}))),JSON.stringify(n)!==JSON.stringify(a._appliedFiltering)&&(n.filterGroups=e,a._appliedFiltering=n,a._applyFilter(e,t),a.$.fireEvent("filter"),a._refreshFilterButton())}_refreshFilterButton(){const e=this,t=e._appliedFiltering.filters?e._appliedFiltering.filters.length:0;if(0===t)return e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"),void e.$.filterButton.classList.remove("filtered");e.$.filterButton.firstElementChild.innerHTML=1===t?e.localize("filteredByOne"):e.localize("filteredByMultiple",{n:t}),e.$.filterButton.classList.add("filtered")}addSort(e,t){const a=this,n=a.dataSource,l=JSON.stringify(a._appliedSorting);let o;function i(e,l){if(a.columns.find((t=>t.dataField===e))){let a=Array.isArray(t)?t[l]:"string"==typeof t?t:"ascending";o.dataFields.push(e),o.dataTypes.push(n.dataFields.find((t=>t.name===e)).dataType),a=a&&-1!==a.indexOf("desc")?"descending":"ascending",o.orderBy.push(a)}}if(0!==arguments.length&&n&&0!==n.length){if(a.closePanel(),1===arguments.length&&"object"==typeof e)o=e;else if(o={dataFields:[],dataTypes:[],orderBy:[]},Array.isArray(e))e.forEach(i);else{if("string"!=typeof e)return;i(e,0)}a.closePanel(),a._appliedSorting=o,l!==JSON.stringify(a._appliedSorting)&&(a._applySort(),a.$.fireEvent("sort"),a._refreshSortButton())}}_refreshSortButton(){const e=this,t=e._appliedSorting.dataFields.length;if(0===t)return e.$.sortButton.firstElementChild.innerHTML=e.localize("sort"),void e.$.sortButton.classList.remove("sorted");e.$.sortButton.firstElementChild.innerHTML=1===t?e.localize("sortedByOne"):e.localize("sortedByMultiple",{n:t}),e.$.sortButton.classList.add("sorted")}closePanel(){const e=this.$.headerDropDown;e.classList.remove("open"),setTimeout((()=>{e.classList.add("smart-visibility-hidden")}),150),this._closeSearchPanel(),e.controlledBy&&(e.controlledBy.removeAttribute("aria-controls"),e.controlledBy.setAttribute("aria-expanded",!1),delete e.controlledBy)}_closeSearchPanel(){const e=this;e._searchInfo&&delete e._searchInfo}_closeDialog(){const e=this;e._editInfo&&e._editInfo.window.close()}openFormatPanel(){}openFilterPanel(e,t){const a=this,n=a.dataSource;if(!n||0===n.length&&!n.virtualDataSource||a.disabled||"none"===a.headerPosition)return;let l;a._editInfo&&a._editInfo.window.close(),a.$.headerDropDown.classList.add("filter-panel"),a.$.headerDropDown.classList.remove("customize-panel","sort-panel","search-panel","format-panel"),a.$.filter.classList.remove("smart-hidden"),a.$.customize.classList.add("smart-hidden"),a.$.sort.classList.add("smart-hidden"),a.$.format&&a.$.format.classList.add("smart-hidden"),a.$.group&&a.$.group.classList.add("smart-hidden"),a.$.search.classList.add("smart-hidden"),a._closeSearchPanel(),a._filterPartCreated?(l=a.$.filter.firstElementChild,l.set("dataSource",e),l.set("locale",a.locale),l.messages=a._innerElementMessages.multiColumnFilterPanel,l.operator=a._appliedFiltering.operator,l.editorPlaceholder=a.localize("filterValuePlaceholder"),l.set("operator",a._appliedFiltering.operator),l.set("value",a._appliedFiltering.filters),l._applyValue(),l.rightToLeft=a.rightToLeft):(l=document.createElement("smart-multi-column-filter-panel"),l.rightToLeft=a.rightToLeft,l.animation=a.animation,l.dataSource=e,l.locale=a.locale,l.messages=a._innerElementMessages.multiColumnFilterPanel,l.operator=a._appliedFiltering.operator,l.editorPlaceholder=a.localize("filterValuePlaceholder"),l.theme=a.theme,l.value=a._appliedFiltering.filters,l.editorCallback=t,a.$.filter.appendChild(l),a._filterPartCreated=!0),a._openHeaderDropDown(a.$.filterButton)}openSortPanel(e){const t=this,a=t.dataSource;if(!a||0===a.length&&!a.virtualDataSource||t.disabled||"none"===t.headerPosition)return;let n;t._closeDialog(),t.$.headerDropDown.classList.add("sort-panel"),t.$.headerDropDown.classList.remove("customize-panel","filter-panel","format-panel","search-panel"),t.$.sort.classList.remove("smart-hidden"),t.$.customize.classList.add("smart-hidden"),t.$.filter.classList.add("smart-hidden"),t.$.format&&t.$.format.classList.add("smart-hidden"),t.$.group&&t.$.group.classList.add("smart-hidden"),t.$.search.classList.add("smart-hidden"),t._closeSearchPanel(),t._sortPartCreated?(n=t.$.sort.firstElementChild,n.rightToLeft=t.rightToLeft,n.dataSource=e,n.locale=t.locale,n.messages=t._innerElementMessages.sortPanel,n.set("dataSource",e),n.propertyChangedHandler("dataSource",void 0,e)):(n=document.createElement("smart-sort-panel"),n.rightToLeft=t.rightToLeft,n.animation=t.animation,n.dataSource=e,n.locale=t.locale,n.messages=t._innerElementMessages.sortPanel,n.theme=t.theme,t.$.sort.appendChild(n),t._sortPartCreated=!0),t._openHeaderDropDown(t.$.sortButton)}removeFilter(){this.addFilter([])}removeSort(){this.addSort({dataFields:[],dataTypes:[],orderBy:[]})}_clearFilterAndSortUI(){const e=this;e._appliedFiltering={filterGroups:[],filters:[],operator:"and"},e._appliedSorting={dataFields:[],dataTypes:[],orderBy:[]},e._appliedGrouping={dataFields:[]},e.$.filterButton.classList.remove("filtered"),e.$.sortButton.classList.remove("sorted"),e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"),e.$.sortButton.firstElementChild.innerHTML=e.localize("sort")}_getInnerElementMessages(){const e=this,t=e.locale,a={columnPanel:{},groupPanel:{},multiColumnFilterPanel:{},sortPanel:{},formattingPanel:{},dateTimePicker:{}};a.formattingPanel[t]={add:e.localize("add"),all:e.localize("all"),apply:e.localize("apply"),between:e.localize("between"),cancel:e.localize("cancel"),close:e.localize("close"),column:e.localize("column"),condition:e.localize("condition"),equal:e.localize("equal"),fontFamily:e.localize("fontFamily"),fontSize:e.localize("fontSize"),format:e.localize("format"),greaterThan:e.localize("greaterThan"),highlight:e.localize("highlight"),lessThan:e.localize("lessThan"),notEqual:e.localize("notEqual"),remove:e.localize("remove"),secondValue:e.localize("secondValue"),text:e.localize("text"),value:e.localize("value")},a.columnPanel[t]={apply:e.localize("apply"),cancel:e.localize("cancel"),reset:e.localize("reset"),find:e.localize("find"),noResults:e.localize("noResults")},a.groupPanel[t]={apply:e.localize("apply"),cancel:e.localize("cancel"),collapseAll:e.localize("collapseAll"),expandAll:e.localize("expandAll"),firstBy:e.localize("firstByGroup"),noGrouping:e.localize("noGrouping"),pickAnother:e.localize("pickAnotherGroupBy"),stringFirst:e.localize("stringFirst"),stringLast:e.localize("stringLast"),thenBy:e.localize("thenBy"),from:e.localize("from"),booleanFirst:e.localize("booleanFirst"),booleanLast:e.localize("booleanLast"),dateFirst:e.localize("dateFirst"),dateLast:e.localize("dateLast"),numberFirst:e.localize("numberFirst"),numberLast:e.localize("numberLast")},a.multiColumnFilterPanel[t]={addFilter:e.localize("addFilter"),and:e.localize("and"),apply:e.localize("apply"),cancel:e.localize("cancel"),CONTAINS:e.localize("CONTAINS"),CONTAINS_CASE_SENSITIVE:e.localize("CONTAINS_CASE_SENSITIVE"),DOES_NOT_CONTAIN:e.localize("DOES_NOT_CONTAIN"),DOES_NOT_CONTAIN_CASE_SENSITIVE:e.localize("DOES_NOT_CONTAIN_CASE_SENSITIVE"),EMPTY:e.localize("EMPTY"),ENDS_WITH:e.localize("ENDS_WITH"),ENDS_WITH_CASE_SENSITIVE:e.localize("ENDS_WITH_CASE_SENSITIVE"),EQUAL:e.localize("EQUAL"),EQUAL_CASE_SENSITIVE:e.localize("EQUAL_CASE_SENSITIVE"),GREATER_THAN:e.localize("GREATER_THAN"),GREATER_THAN_OR_EQUAL:e.localize("GREATER_THAN_OR_EQUAL"),LESS_THAN:e.localize("LESS_THAN"),LESS_THAN_OR_EQUAL:e.localize("LESS_THAN_OR_EQUAL"),noFilters:e.localize("noFilters"),NOT_EMPTY:e.localize("NOT_EMPTY"),NOT_EQUAL:e.localize("NOT_EQUAL"),NOT_NULL:e.localize("NOT_NULL"),NULL:e.localize("NULL"),or:e.localize("or"),STARTS_WITH:e.localize("STARTS_WITH"),STARTS_WITH_CASE_SENSITIVE:e.localize("STARTS_WITH_CASE_SENSITIVE"),where:e.localize("where")},a.sortPanel[t]={apply:e.localize("apply"),booleanFirst:e.localize("booleanFirst"),booleanLast:e.localize("booleanLast"),cancel:e.localize("cancel"),dateFirst:e.localize("dateFirst"),dateLast:e.localize("dateLast"),firstBy:e.localize("firstBy"),from:e.localize("from"),numberFirst:e.localize("numberFirst"),numberLast:e.localize("numberLast"),noSorting:e.localize("noSorting"),pickAnother:e.localize("pickAnother"),stringFirst:e.localize("stringFirst"),stringLast:e.localize("stringLast"),thenBy:e.localize("thenBy")},a.dateTimePicker[t]={now:e.localize("now"),dateTabLabel:e.localize("dateTabLabel"),timeTabLabel:e.localize("timeTabLabel")},e._innerElementMessages=a}_handleHeaderPosition(e){const t=this,a=t.headerPosition,n=t.$.header;"none"!==a?(n.classList.remove("smart-hidden"),"top"===a&&n.nextElementSibling!==e?t.$.container.insertBefore(n,e):"bottom"===a&&n.previousElementSibling!==e&&t.$.container.insertBefore(n,t.$.loadingIndicatorContainer)):n.classList.add("smart-hidden")}_headerClickHandler(e){const t=this,a=t.$.headerDropDown;function n(e,n){a.classList.contains("smart-visibility-hidden")||e.classList.contains("smart-hidden")?t[n]():t.closePanel()}if(t.$.customizeButton.contains(e))n(t.$.customize,"openCustomizePanel");else if(t.$.filterButton.contains(e))n(t.$.filter,"openFilterPanel");else if(t.$.sortButton.contains(e))n(t.$.sort,"openSortPanel");else if(t.$.formatButton&&t.$.formatButton.contains(e))n(t.$.format,"openFormatPanel");else if(e===t.$.searchButton)n(t.$.search,"_openSearchPanel");else if(t.$.groupButton&&t.$.groupButton.contains(e))n(t.$.group,"openGroupPanel");else if(e===t.$.searchClose)t.closePanel();else if(e===t.$.searchPrev||e===t.$.searchNext){const a=t._searchInfo,n=a.foundIdsArray,l=e===t.$.searchNext,o=n.length;let i;if(void 0===a.highlighted)i=l?0:o-1;else{if(1===n.length)return;{const e=n.indexOf(a.highlighted);i=l?(e+1)%o:e-1>=0?e-1:o-1}}a.highlighted=n[i],t.grid?(t.grid.highlighted=a.highlighted,t.grid.ensureVisible(a.highlighted),t.grid._recycle(!1)):t.ensureVisible&&t.ensureVisible(a.highlighted),t.$.searchLabel.innerHTML=t.localize("found",{nth:i+1,n:n.length})}}_headerDropDownTransitionendHandler(e){const t=this,a=t.$.headerDropDown;e&&("visibility"!==e.propertyName||a.classList.contains("smart-visibility-hidden"))||(a.classList.contains("search-panel")?t.$.searchInput.focus():!1===t.unfocusable&&(!t._isMobile&&a.classList.contains("customize-panel")?a.querySelector("smart-column-panel").$.find.focus():a.classList.contains("filter-panel")?a.querySelector("smart-multi-column-filter-panel").$.addFilterButton.focus():a.classList.contains("sort-panel")&&a.querySelector("smart-sort-panel").$.inputNotSorted.focus()))}_localizeHeader(){const e=this;e.$.customizeButton.firstElementChild.innerHTML=e.localize("customize"),e.$.groupButton&&(e.$.groupButton.firstElementChild.innerHTML=e.localize("group")),0===e._appliedFiltering.filters.length?e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"):1===e._appliedFiltering.filters.length?e.$.filterButton.firstElementChild.innerHTML=e.localize("filteredByOne"):e.$.filterButton.firstElementChild.innerHTML=e.localize("filteredByMultiple",{n:e._appliedFiltering.filters.length}),0===e._appliedSorting.dataFields.length?e.$.sortButton.firstElementChild.innerHTML=e.localize("sort"):1===e._appliedSorting.dataFields.length?e.$.sortButton.firstElementChild.innerHTML=e.localize("sortedByOne"):e.$.sortButton.firstElementChild.innerHTML=e.localize("sortedByMultiple",{n:e._appliedSorting.dataFields.length}),e.$.formatButton&&(e.$.formatButton.firstElementChild.innerHTML=e.localize("formating")),e.$.searchInput.placeholder=e.localize("findInView")}_openHeaderDropDown(e){const t=this,a=t.$.headerDropDown;"top"===t.headerPosition?(a.style.bottom=null,a.style.top="100%"):(a.style.top=null,a.style.bottom="100%"),e!==t.$.searchButton?a.style.left=e.offsetLeft-(t.rightToLeft?a.offsetWidth-e.offsetWidth:0)+"px":a.style.left=(t.rightToLeft?e.offsetLeft:e.offsetLeft+Math.max(25,e.offsetWidth)-a.offsetWidth)+"px",a.classList.remove("smart-visibility-hidden"),a.classList.add("open"),a.controlledBy&&(a.controlledBy.removeAttribute("aria-controls"),a.controlledBy.setAttribute("aria-expanded",!1)),a.controlledBy=e,e.setAttribute("aria-controls",a.id),e.setAttribute("aria-expanded",!0),t._headerDropDownTransitionendHandler()}_searchInputKeyupHandler(){const e=this;function t(){e._searchInfo&&e.$.searchInput.value!==e._searchInfo.query&&e._search(e.$.searchInput.value)}if(clearTimeout(e._searchInputTimeout),"Enter"===event.key&&e._searchInfo.foundIdsArray&&e._searchInfo.foundIdsArray.length>1)return t(),void e._headerClickHandler(e.$.searchNext,e.$.cardContainer||e.$.body);e._searchInputTimeout=setTimeout(t,500)}});
867
867
 
868
868
  /***/ }),
869
869
 
870
870
  /***/ 8588:
871
871
  /***/ (() => {
872
872
 
873
- Smart("smart-input",class extends Smart.BaseElement{static get properties(){return{autoCompleteDelay:{value:100,type:"number"},dataSource:{type:"any",value:[],reflectToAttribute:!1},dropDownClassList:{value:[],type:"array",reflectToAttribute:!1},dropDownDataSource:{type:"any",value:[]},dropDownHeight:{type:"any",value:200},dropDownOpenMode:{allowedValues:["default","manual"],value:"default",type:"string"},dropDownWidth:{type:"any",value:null},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"none",type:"string"},dropDownOpenPosition:{allowedValues:["bottom","top"],value:"bottom",type:"string"},hint:{type:"string",value:""},inputPurpose:{type:"string",value:"off"},items:{type:"number",value:8},minLength:{type:"number",value:1},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},query:{type:"string",value:""},queryMode:{allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string",value:"containsIgnoreCase"},placeholder:{value:"",type:"string"},readonly:{type:"boolean",value:!1},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},selectedIndex:{type:"number",value:-1},selectedValues:{value:[],type:"array"},type:{type:"string"},value:{type:"string",value:""}}}static get styleUrls(){return["smart.textbox.css"]}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.paste":"_pasteHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}get selectedIndexes(){return this.isCompleted?[this.selectedIndex]:[]}set selectedIndexes(e){this.isCompleted&&(e&&e[0]?this.selectedIndex=e[0]:this.selectedIndex=-1)}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;o!==t&&o!==t.$.dropDownButton&&o!==t.$.input&&o!==t.$.arrow?t.$.scrollView.contains(o.shadowParent||o)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),"manual"===t.dropDownOpenMode||t._isPointerDown||t.close(),t._isPointerDown=!1):t._isPointerDown=!1}_focusHandler(){const e=this;e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?(e.$.fireEvent("focus"),delete e._preventLookup):e._lookup()}_blurHandler(){const e=this;e.opened||e.removeAttribute("focus"),e.opened||e.$.fireEvent("blur"),e._refreshSelectedIndex(),delete e._preventLookup}_pasteHandler(e){const t=this,o=t.$.input,r=o.value,n=o.selectionStart,a=o.selectionEnd;if(!e.clipboardData&&!window.clipboardData)return;const s=(e.clipboardData||window.clipboardData).getData("text");let l=r.slice(0,n)+s,i=l.length;l+=r.slice(a),e.preventDefault(),t.set("value",l),t.setAttribute("data-value",l),o.setSelectionRange(i,i),t._refreshSelectedIndex()}_refreshSelectedIndex(){const e=this;let t=e.dataSource;if(t){let o=-1;if(e.dataSource instanceof Promise)return;if("function"==typeof e.dataSource)return;"string"==typeof t&&(t=e.$.deserialize(t,"array"));for(let r=0;r<t.length;r++){let n=t[r];if("number"!=typeof n&&"boolean"!=typeof n||(n=""+n),"string"==typeof n){if(n===e.value){o=r;break}}else if(n&&n.label===e.value){o=r;break}}e.set("selectedIndex",o,!1),-1===e.selectedIndex&&(e.$.input.dataValue=null)}}selectItem(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),o)for(let r=0;r<o.length;r++){const n=o[r];if(t.set("selectedIndex",-1),t.set("value",""),t.$.input.dataValue=null,"string"==typeof n){if(n===e)return t.set("selectedIndex",r,!1),t.set("value",t.$.input.dataValue=e),void t.setAttribute("data-value",t.$.input.dataValue)}else if(n.value===e)return t.set("selectedIndex",r,!1),t.set("value",n.label),t.$.input.dataValue=e,void t.setAttribute("data-value",t.$.input.dataValue)}else t.set("value",t.$.input.dataValue=e),t.setAttribute("data-value",t.$.input.dataValue),t.set("selectedIndex",-1,!1)}getItem(e){const t=this;if(t.dataSource)for(let o=0;o<t.dataSource.length;o++){const r=t.dataSource[o];if(r.value===e)return r}return null}getSelectedItem(){const e=this;return{label:e.value,value:e.$.input.dataValue||e.value}}_refreshMenu(){const e=this;e.$.menu.classList.remove("scroll"),e.$.scrollView.computedVerticalScrollBarVisibility&&e.$.menu.classList.add("scroll")}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),o=t.getAttribute("data-label"),r=t.dataValue,n=e.value,a=e.$.input.dataValue;e.set("value",o),e.$.input.dataValue=r,e.setAttribute("data-value",r),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.close(),o===n&&r===a||e.$.fireEvent("change",{value:r,label:o,oldValue:a,oldLabel:n})}_open(){const e=this;if(e.opened)return;const t=window.scrollX,o=window.scrollY;let r=e.getBoundingClientRect(),n=0,a=0;if(e.timer&&clearTimeout(e.timer),e.getRootNode()&&e.getRootNode().host?e.getRootNode().host.shadowRoot.appendChild(e.$.scrollView):document.body.appendChild(e.$.scrollView),e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();n=e.left,a=e.top}e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.style.left=-3+r.left+t-n+"px",e.$.scrollView.classList.remove("open"),"bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=r.bottom+o-a+1+"px":e.$.scrollView.style.top=r.top-e.$.scrollView.offsetHeight+o-a+1+"px",e.opening=!0,e._positionTimer&&clearInterval(e._positionTimer),e._positionTimer=setInterval((()=>{const t=e.getBoundingClientRect();if(e.opening)e.opening=!1,r=t;else if(Math.abs(parseInt(t.top)-parseInt(r.top))>=10||Math.abs(parseInt(t.left)-parseInt(r.left))>=10){const o=window.scrollX,r=window.scrollY;return e.$.scrollView.style.left=-3+t.left+o-n+"px",void("bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=t.bottom+r-a+1+"px":e.$.scrollView.style.top=t.top-e.$.scrollView.offsetHeight+r-a+1+"px")}}),50),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const o=parseFloat(t)/100;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*o+"px")}else if("auto"!==t&&t)e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const o=e.$.menu.querySelectorAll("li");for(let t=0;t<o.length;t++)e._maxDropDownWidth=Math.max((o[t].firstElementChild||o[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>{e.$.scrollView._scrollView&&e.$.scrollView._scrollView.vScrollBar.refresh()}))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.set("opened",!0),e.setAttribute("aria-expanded",!0),e.$.fireEvent("open")}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e._positionTimer&&clearInterval(e._positionTimer),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.set("opened",!1),e.setAttribute("aria-expanded",!1),e.$.input.focus(),e.$.fireEvent("close"),!0)}refresh(){const e=this;e.$.scrollView.refresh&&e.$.scrollView.refresh(),e.close()}_lookup(e){const t=this;if(t.query=t.$.input.value,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength)return void t.close();const o=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const o=t.context;t.context=t,t._process(e),t.context=o}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,o):o(t.dataSource)}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){const t=this;return"manual"!==t.dropDownOpenMode&&t._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._isPointerDown=!0,!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;function t(t){e._process(t);const o=e.$.menu.querySelector(".active");if(o){const t=e.$.input.dataValue;for(let r=0;r<e.$.menu.children.length;r++){const n=e.$.menu.children[r],a=n.getAttribute("data-label"),s=n.dataValue;if(void 0!==t&&s===t||void 0===t&&a===e.$.input.value){o.classList.remove("active"),n.classList.add("active"),e._setActiveDescendant(n),e.$.input.dataValue=s,e.setAttribute("data-value",s);break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}e.dropDownDataSource&&(Array.isArray(e.dropDownDataSource)&&e.dropDownDataSource.length>0||"function"==typeof e.dropDownDataSource)?(e.query="","function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query,t):t(e.dropDownDataSource)):(e.query="","function"==typeof e.dataSource?e.dataSource(e.query,t):t(e.dataSource))}_process(e){const t=this;"string"==typeof e&&(e=t.$.deserialize(e,"array")),e=e.filter((function(e){return""===e||(t.matcher?t.matcher(e):t._matcher(e))})),e=t._sorter(e),t.sorted&&(e.sort(((e,t)=>void 0!==e.label?e.label.localeCompare(t.label):e.localeCompare(t))),"desc"===t.sortDirection&&e.reverse()),!e.length&&t.opened&&t.close(),0!==e.length&&(t.query.length>0?t._render(e.slice(0,t.items)):t._render(e),t._open(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._refreshMenu(),t.ensureVisible())}_matcher(e){const t=this.query;switch(null===e&&(e="null"),e=""+(e=e.label||e),this.queryMode){case"startsWith":return e.startsWith(t);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(t.toLowerCase());case"doesNotContain":return e.indexOf(t)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(t.toLowerCase())<0;case"contains":return e.indexOf(t)>-1;default:case"containsIgnoreCase":return~e.toLowerCase().indexOf(t.toLowerCase());case"equals":return 0===e.localeCompare(t);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(t.toLowerCase());case"endsWith":return e.endsWith(t);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(t.toLowerCase())}}_sorter(e){const t=this;let o,r=[],n=[],a=[];if(e&&""===e[0])return e;for(;o=e.shift();){let e=o.label||o;e=""+e,e.toLowerCase().indexOf(t.query.toLowerCase())?~e.indexOf(t.query)?n.push(o):a.push(o):r.push(o)}return r.concat(n,a)}_highlighter(e){const t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),(function(e,t){return"<strong>"+t+"</strong>"}))}_render(e){const t=this;let o=0;const r=e.map((function(e){let r=e,n=e;"object"==typeof e&&(r=e.label,n=void 0!==e.value?e.value:r),r=""+r;const a=document.createElement("li"),s=document.createElement("a");if(s.href="#",a.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),a.setAttribute("data-label",r),a.index=o++,a.dataValue=n,"string"==typeof n?a.setAttribute("value",n):a.setAttribute("value",JSON.stringify(n)),a.setAttribute("role","option"),a.setAttribute("aria-label",r),s.innerHTML=t.highlighter?t.highlighter(r):t._highlighter(r),s.setAttribute("aria-hidden",!0),e.icon&&(s.classList.add("icon"),s.classList.add(e.icon)),e.prefix){const t=document.createElement("span");t.innerHTML=e.prefix,s.classList.add("has-prefix"),s.innerHTML=t.innerHTML+s.innerHTML}if(e.suffix){const t=document.createElement("span");t.innerHTML=e.suffix,s.classList.add("has-suffix"),s.innerHTML=s.innerHTML+t.innerHTML}return a.appendChild(s),a}));function n(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}r.length>0&&(r[0].classList.add("active"),t._setActiveDescendant(r[0])),t.$.menu.innerHTML="";for(let e=0;e<r.length;e++){const o=r[e];t.$.menu.appendChild(o),o.onmouseenter=n,o.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},o.onclick=n}}ensureVisible(){const e=this,t=e.$.menu.querySelector(".active");t&&(t.offsetTop+t.offsetHeight>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight&&(e.$.scrollView.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.$.scrollView.scrollTop||t.offsetTop>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight)&&(e.$.scrollView.scrollTop=t.offsetTop),0===[...e.$.menu.children].indexOf(t)?e.$.scrollView.scrollTop=0:[...e.$.menu.children].indexOf(t)===e.$.menu.children.length-1&&(e.$.scrollView.scrollTop=e.$.scrollView.scrollHeight))}_next(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.nextElementSibling;o||(o=e.$.menu.firstElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.previousElementSibling;o||(o=e.$.menu.lastElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_move(e){const t=this;if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),t._prev();break;case 40:e.preventDefault(),t._next()}e.stopPropagation()}}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t._oldValue=t.$.input.value,e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey||this._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey&&"F2"!==e.key)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.fireEvent("changing",{value:t.$.input.value,oldValue:t._oldValue}),t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue)}}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const r=this;if("selectedIndex"===e)r._setSelection();else if("dataSource"===e)r._setSelection(!1);else if("dropDownClassList"===e){const e=r.$.scrollView;for(let o=0,r=t.length;o<r;o+=1)e.classList.remove(t[o]);for(let t=0,r=o.length;t<r;t+=1)e.classList.add(o[t])}else if("dropDownHeight"===e)"auto"!==r.dropDownHeight?r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",r.dropDownHeight+"px"):r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height","auto");else if("opened"===e)r.opened=t,o?r.open():r.close();else if("placeholder"===e){if(r.readonly){const e=r.getAttribute("aria-label");if(e&&e!==t)return;o?r.setAttribute("aria-label",o):r.removeAttribute("aria-label")}}else if("selectedValues"===e)if(null===o)r.$.input.value="",r.$.input.dataValue=o,r.setAttribute("data-value",o),r._refreshSelectedIndex();else{const e=o.join(","),t=r.value;r.value=e,r.propertyChangedHandler("value",t,r.value)}else"value"===e?(r.displayMember!==r.valueMember&&"string"!=typeof o?(r.set("value",o[r.displayMember]),r.$.input.dataValue=o[r.valueMember],r.setAttribute("data-value",r.$.input.dataValue)):(r.$.input.value=r.$.input.dataValue=o,r.setAttribute("data-value",o)),r._refreshSelectedIndex()):"readonly"===e?(r._setAriaRelations(),r._setInputPurpose()):"theme"===e||"rightToLeft"===e?r.$.scrollView[e]=o:"inputPurpose"===e?r._setInputPurpose():"inverted"===e?o?r.$.scrollView.setAttribute("inverted",""):r.$.scrollView.removeAttribute("inverted"):"disabled"!==e&&"unfocusable"!==e||r._setFocusable()}detached(){super.detached(),this.close(),this.removeAttribute("focus")}render(){const e=this,t=e.dropDownClassList;e._createElement&&e._createElement();const o=e.$.scrollView;for(let e=0,r=t.length;e<r;e+=1)o.classList.add(t[e]);e.opened&&(e.opened=!1,e.open());const r=e.$.menu;r&&(r.setAttribute("role","presentation"),o.appendChild(r)),"auto"!==e.dropDownHeight?o.style.setProperty("--smart-input-drop-down-menu-height",e.dropDownHeight+"px"):o.style.setProperty("--smart-input-drop-down-menu-height","auto"),o.classList.add("smart-input-drop-down-menu");for(let t=0;t<e.classList.length;t++){const r=e.classList[t];"smart-element"!==r&&"smart-input"!==r&&o.classList.add(r+"-drop-down-menu")}o.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),o.ownerElement=e,e._setAriaRelations(),e._setInputPurpose(),e._setSelection(),e.isInitialized=!0,super.render()}_setSelection(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),t.selectedIndex>=0&&o&&o.length>0){let r=o[t.selectedIndex];if("number"!=typeof r&&"boolean"!=typeof r||(r=""+r),"string"==typeof r){let e=t.$.input.dataValue,o=t.value;t.set("value",r),t.$.input.dataValue=r,t.$.input.setAttribute("data-value",r),t.selectedValues=[t.$.input.dataValue],t.isInitialized&&t.$.fireEvent("change",{value:t.value,label:t.label,oldValue:e,oldLabel:o})}else{let o=t.$.input.dataValue,n=t.value;r&&(void 0!==r.value?(t.set("value",void 0!==r.value?r.value+"":""),t.$.input.dataValue=r.value,t.$.input.setAttribute("data-value",r.value),t.selectedValues=[t.$.input.dataValue]):r.label&&(t.selectedValues=[r.value]),r.label&&t.set("value",r.label)),t.isInitialized&&!1!==e&&t.$.fireEvent("change",{value:t.$.input.dataValue,label:r.value,oldValue:o,oldLabel:n})}}}_createElement(){const e=this,t=document.createElement("ul"),o=document.createElement("smart-scroll-viewer");o.rightToLeft=e.rightToLeft,o.theme=e.theme,o.horizontalScrollBarVisibility="hidden",e.inverted?o.setAttribute("inverted",""):o.removeAttribute("inverted"),e.$.scrollView=o,e.$.menu=t,e._setFocusable(),e.$.menu.onclick=function(t){const o=t.target.closest("li");t.stopPropagation(),t.preventDefault(),e._performSelect(),o&&e.$.fireEvent("itemClick",{item:o,label:o.getAttribute("aria-label"),value:o.dataValue}),e.$.input.focus()}}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",e.$.scrollView.id),e.$.scrollView.setAttribute("role","listbox")}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}_setInputPurpose(){const e=this;e.readonly?e.$.input.removeAttribute("autocomplete"):e.$.input.setAttribute("autocomplete",e.inputPurpose)}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.setAttribute("tabindex",-1):e.$.input.removeAttribute("tabindex")}});
873
+ Smart("smart-input",class extends Smart.BaseElement{static get properties(){return{autoCompleteDelay:{value:100,type:"number"},dataSource:{type:"any",value:[],reflectToAttribute:!1},dropDownClassList:{value:[],type:"array",reflectToAttribute:!1},dropDownDataSource:{type:"any",value:[]},dropDownHeight:{type:"any",value:200},dropDownOpenMode:{allowedValues:["default","manual"],value:"default",type:"string"},dropDownWidth:{type:"any",value:null},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"none",type:"string"},dropDownOpenPosition:{allowedValues:["bottom","top"],value:"bottom",type:"string"},hint:{type:"string",value:""},inputPurpose:{type:"string",value:"off"},items:{type:"number",value:8},minLength:{type:"number",value:1},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},query:{type:"string",value:""},queryMode:{allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string",value:"containsIgnoreCase"},placeholder:{value:"",type:"string"},readonly:{type:"boolean",value:!1},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},selectedIndex:{type:"number",value:-1},selectedValues:{value:[],type:"array"},type:{type:"string"},value:{type:"string",value:""}}}static get styleUrls(){return["smart.textbox.css"]}template(){return'<div id="inputContainer" role="presentation"><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.paste":"_pasteHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}get selectedIndexes(){return this.isCompleted?[this.selectedIndex]:[]}set selectedIndexes(e){this.isCompleted&&(e&&void 0!==e[0]?this.selectedIndex=e[0]:this.selectedIndex=-1)}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;o!==t&&o!==t.$.dropDownButton&&o!==t.$.input&&o!==t.$.arrow?t.$.scrollView.contains(o.shadowParent||o)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),"manual"===t.dropDownOpenMode||t._isPointerDown||t.close(),t._isPointerDown=!1):t._isPointerDown=!1}_focusHandler(){const e=this;e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?(e.$.fireEvent("focus"),delete e._preventLookup):e._lookup()}_blurHandler(){const e=this;e.opened||e.removeAttribute("focus"),e.opened||e.$.fireEvent("blur"),e._refreshSelectedIndex(),delete e._preventLookup}_pasteHandler(e){const t=this,o=t.$.input,r=o.value,n=o.selectionStart,a=o.selectionEnd;if(!e.clipboardData&&!window.clipboardData)return;const s=(e.clipboardData||window.clipboardData).getData("text");let l=r.slice(0,n)+s,i=l.length;l+=r.slice(a),e.preventDefault(),t.set("value",l),t.setAttribute("data-value",l),o.setSelectionRange(i,i),t._refreshSelectedIndex()}_refreshSelectedIndex(){const e=this;let t=e.dataSource;if(t){let o=-1;if(e.dataSource instanceof Promise)return;if("function"==typeof e.dataSource)return;"string"==typeof t&&(t=e.$.deserialize(t,"array"));for(let r=0;r<t.length;r++){let n=t[r];if("number"!=typeof n&&"boolean"!=typeof n||(n=""+n),"string"==typeof n){if(n===e.value){o=r;break}}else if(n&&n.label===e.value){o=r;break}}e.set("selectedIndex",o,!1),-1===e.selectedIndex&&(e.$.input.dataValue=null)}}selectItem(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),o)for(let r=0;r<o.length;r++){const n=o[r];if(t.set("selectedIndex",-1),t.set("value",""),t.$.input.dataValue=null,"string"==typeof n){if(n===e)return t.set("selectedIndex",r,!1),t.set("value",t.$.input.dataValue=e),void t.setAttribute("data-value",t.$.input.dataValue)}else if(n.value===e)return t.set("selectedIndex",r,!1),t.set("value",n.label),t.$.input.dataValue=e,void t.setAttribute("data-value",t.$.input.dataValue)}else t.set("value",t.$.input.dataValue=e),t.setAttribute("data-value",t.$.input.dataValue),t.set("selectedIndex",-1,!1)}getItem(e){const t=this;if(t.dataSource)for(let o=0;o<t.dataSource.length;o++){const r=t.dataSource[o];if(r.value===e)return r}return null}getSelectedItem(){const e=this;return{label:e.value,value:e.$.input.dataValue||e.value}}_refreshMenu(){const e=this;e.$.menu.classList.remove("scroll"),e.$.scrollView.computedVerticalScrollBarVisibility&&e.$.menu.classList.add("scroll")}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),o=t.getAttribute("data-label"),r=t.dataValue,n=e.value,a=e.$.input.dataValue;e.set("value",o),e.$.input.dataValue=r,e.setAttribute("data-value",r),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.close(),o===n&&r===a||e.$.fireEvent("change",{value:r,label:o,oldValue:a,oldLabel:n})}_open(){const e=this;if(e.opened)return;const t=window.scrollX,o=window.scrollY;let r=e.getBoundingClientRect(),n=0,a=0;if(e.timer&&clearTimeout(e.timer),e.getRootNode()&&e.getRootNode().host?e.getRootNode().host.shadowRoot.appendChild(e.$.scrollView):document.body.appendChild(e.$.scrollView),e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();n=e.left,a=e.top}e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.style.left=-3+r.left+t-n+"px",e.$.scrollView.classList.remove("open"),"bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=r.bottom+o-a+1+"px":e.$.scrollView.style.top=r.top-e.$.scrollView.offsetHeight+o-a+1+"px",e.opening=!0,e._positionTimer&&clearInterval(e._positionTimer),e._positionTimer=setInterval((()=>{const t=e.getBoundingClientRect();if(e.opening)e.opening=!1,r=t;else if(Math.abs(parseInt(t.top)-parseInt(r.top))>=10||Math.abs(parseInt(t.left)-parseInt(r.left))>=10){const o=window.scrollX,r=window.scrollY;return e.$.scrollView.style.left=-3+t.left+o-n+"px",void("bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=t.bottom+r-a+1+"px":e.$.scrollView.style.top=t.top-e.$.scrollView.offsetHeight+r-a+1+"px")}}),50),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const o=parseFloat(t)/100;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*o+"px")}else if("auto"!==t&&t)e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const o=e.$.menu.querySelectorAll("li");for(let t=0;t<o.length;t++)e._maxDropDownWidth=Math.max((o[t].firstElementChild||o[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>{e.$.scrollView._scrollView&&e.$.scrollView._scrollView.vScrollBar.refresh()}))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.set("opened",!0),e.setAttribute("aria-expanded",!0),e.$.fireEvent("open")}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e._positionTimer&&clearInterval(e._positionTimer),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.set("opened",!1),e.setAttribute("aria-expanded",!1),e.$.input.focus(),e.$.fireEvent("close"),!0)}refresh(){const e=this;e.$.scrollView.refresh&&e.$.scrollView.refresh(),e.close()}_lookup(e){const t=this;if(t.query=t.$.input.value,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength)return void t.close();const o=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const o=t.context;t.context=t,t._process(e),t.context=o}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,o):o(t.dataSource)}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){const t=this;return"manual"!==t.dropDownOpenMode&&t._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._isPointerDown=!0,!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;function t(t){e._process(t);const o=e.$.menu.querySelector(".active");if(o){const t=e.$.input.dataValue;for(let r=0;r<e.$.menu.children.length;r++){const n=e.$.menu.children[r],a=n.getAttribute("data-label"),s=n.dataValue;if(void 0!==t&&s===t||void 0===t&&a===e.$.input.value){o.classList.remove("active"),n.classList.add("active"),e._setActiveDescendant(n),e.$.input.dataValue=s,e.setAttribute("data-value",s);break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}e.dropDownDataSource&&(Array.isArray(e.dropDownDataSource)&&e.dropDownDataSource.length>0||"function"==typeof e.dropDownDataSource)?(e.query="","function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query,t):t(e.dropDownDataSource)):(e.query="","function"==typeof e.dataSource?e.dataSource(e.query,t):t(e.dataSource))}_process(e){const t=this;"string"==typeof e&&(e=t.$.deserialize(e,"array")),e=e.filter((function(e){return""===e||(t.matcher?t.matcher(e):t._matcher(e))})),e=t._sorter(e),t.sorted&&(e.sort(((e,t)=>void 0!==e.label?e.label.localeCompare(t.label):e.localeCompare(t))),"desc"===t.sortDirection&&e.reverse()),!e.length&&t.opened&&t.close(),0===e.length&&!0!==t.allowItemsAdd||(t.query.length>0?t._render(e.slice(0,t.items)):t._render(e),t._open(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._refreshMenu(),t.ensureVisible())}_matcher(e){const t=this.query;switch(null===e&&(e="null"),e=""+(e=e.label||e),this.queryMode){case"startsWith":return e.startsWith(t);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(t.toLowerCase());case"doesNotContain":return e.indexOf(t)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(t.toLowerCase())<0;case"contains":return e.indexOf(t)>-1;default:case"containsIgnoreCase":return~e.toLowerCase().indexOf(t.toLowerCase());case"equals":return 0===e.localeCompare(t);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(t.toLowerCase());case"endsWith":return e.endsWith(t);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(t.toLowerCase())}}_sorter(e){const t=this;let o,r=[],n=[],a=[];if(e&&""===e[0])return e;for(;o=e.shift();){let e=o.label||o;e=""+e,e.toLowerCase().indexOf(t.query.toLowerCase())?~e.indexOf(t.query)?n.push(o):a.push(o):r.push(o)}return r.concat(n,a)}_highlighter(e){const t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),(function(e,t){return"<strong>"+t+"</strong>"}))}_render(e){const t=this;let o=0;const r=e.map((function(e){let r=e,n=e;"object"==typeof e&&(r=e.label,n=void 0!==e.value?e.value:r),r=""+r;const a=document.createElement("li"),s=document.createElement("a");if(s.href="#",a.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),a.setAttribute("data-label",r),a.index=o++,a.dataValue=n,"string"==typeof n?a.setAttribute("value",n):a.setAttribute("value",JSON.stringify(n)),a.setAttribute("role","option"),a.setAttribute("aria-label",r),s.innerHTML=t.highlighter?t.highlighter(r):t._highlighter(r),s.setAttribute("aria-hidden",!0),e.icon&&(s.classList.add("icon"),s.classList.add(e.icon)),e.prefix){const t=document.createElement("span");t.innerHTML=e.prefix,s.classList.add("has-prefix"),s.innerHTML=t.innerHTML+s.innerHTML}if(e.suffix){const t=document.createElement("span");t.innerHTML=e.suffix,s.classList.add("has-suffix"),s.innerHTML=s.innerHTML+t.innerHTML}return a.appendChild(s),a}));function n(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}r.length>0&&(r[0].classList.add("active"),t._setActiveDescendant(r[0])),t.$.menu.innerHTML="";for(let e=0;e<r.length;e++){const o=r[e];t.$.menu.appendChild(o),o.onmouseenter=n,o.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},o.onclick=n}}ensureVisible(){const e=this,t=e.$.menu.querySelector(".active");t&&(t.offsetTop+t.offsetHeight>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight&&(e.$.scrollView.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.$.scrollView.scrollTop||t.offsetTop>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight)&&(e.$.scrollView.scrollTop=t.offsetTop),0===[...e.$.menu.children].indexOf(t)?e.$.scrollView.scrollTop=0:[...e.$.menu.children].indexOf(t)===e.$.menu.children.length-1&&(e.$.scrollView.scrollTop=e.$.scrollView.scrollHeight))}_next(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.nextElementSibling;o||(o=e.$.menu.firstElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.previousElementSibling;o||(o=e.$.menu.lastElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_move(e){const t=this;if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),t._prev();break;case 40:e.preventDefault(),t._next()}e.stopPropagation()}}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t._oldValue=t.$.input.value,e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey||this._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey&&"F2"!==e.key)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.fireEvent("changing",{value:t.$.input.value,oldValue:t._oldValue}),t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue)}}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const r=this;if("selectedIndex"===e)r._setSelection();else if("dataSource"===e)r._setSelection(!1);else if("dropDownClassList"===e){const e=r.$.scrollView;for(let o=0,r=t.length;o<r;o+=1)e.classList.remove(t[o]);for(let t=0,r=o.length;t<r;t+=1)e.classList.add(o[t])}else if("dropDownHeight"===e)"auto"!==r.dropDownHeight?r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",r.dropDownHeight+"px"):r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height","auto");else if("opened"===e)r.opened=t,o?r.open():r.close();else if("placeholder"===e){if(r.readonly){const e=r.getAttribute("aria-label");if(e&&e!==t)return;o?r.setAttribute("aria-label",o):r.removeAttribute("aria-label")}}else if("selectedValues"===e)if(null===o)r.$.input.value="",r.$.input.dataValue=o,r.setAttribute("data-value",o),r._refreshSelectedIndex();else{const e=o.join(","),t=r.value;r.value=e,r.propertyChangedHandler("value",t,r.value)}else"value"===e?(r.displayMember!==r.valueMember&&"string"!=typeof o?(r.set("value",o[r.displayMember]),r.$.input.dataValue=o[r.valueMember],r.setAttribute("data-value",r.$.input.dataValue)):(r.$.input.value=r.$.input.dataValue=o,r.setAttribute("data-value",o)),r._refreshSelectedIndex()):"readonly"===e?(r._setAriaRelations(),r._setInputPurpose()):"theme"===e||"rightToLeft"===e?r.$.scrollView[e]=o:"inputPurpose"===e?r._setInputPurpose():"inverted"===e?o?r.$.scrollView.setAttribute("inverted",""):r.$.scrollView.removeAttribute("inverted"):"disabled"!==e&&"unfocusable"!==e||r._setFocusable()}detached(){super.detached(),this.close(),this.removeAttribute("focus")}render(){const e=this,t=e.dropDownClassList;e._createElement&&e._createElement();const o=e.$.scrollView;for(let e=0,r=t.length;e<r;e+=1)o.classList.add(t[e]);e.opened&&(e.opened=!1,e.open());const r=e.$.menu;r&&(r.setAttribute("role","presentation"),o.appendChild(r)),"auto"!==e.dropDownHeight?o.style.setProperty("--smart-input-drop-down-menu-height",e.dropDownHeight+"px"):o.style.setProperty("--smart-input-drop-down-menu-height","auto"),o.classList.add("smart-input-drop-down-menu");for(let t=0;t<e.classList.length;t++){const r=e.classList[t];"smart-element"!==r&&"smart-input"!==r&&o.classList.add(r+"-drop-down-menu")}o.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),o.ownerElement=e,e._setAriaRelations(),e._setInputPurpose(),e._setSelection(),e.isInitialized=!0,super.render()}_setSelection(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),t.selectedIndex>=0&&o&&o.length>0){let r=o[t.selectedIndex];if("number"!=typeof r&&"boolean"!=typeof r||(r=""+r),"string"==typeof r){let e=t.$.input.dataValue,o=t.value;t.set("value",r),t.$.input.dataValue=r,t.$.input.setAttribute("data-value",r),t.selectedValues=[t.$.input.dataValue],t.isInitialized&&t.$.fireEvent("change",{value:t.value,label:t.label,oldValue:e,oldLabel:o})}else{let o=t.$.input.dataValue,n=t.value;r&&(void 0!==r.value?(t.set("value",void 0!==r.value?r.value+"":""),t.$.input.dataValue=r.value,t.$.input.setAttribute("data-value",r.value),t.selectedValues=[t.$.input.dataValue]):r.label&&(t.selectedValues=[r.value]),r.label&&t.set("value",r.label)),t.isInitialized&&!1!==e&&t.$.fireEvent("change",{value:t.$.input.dataValue,label:r.value,oldValue:o,oldLabel:n})}}}_createElement(){const e=this,t=document.createElement("ul"),o=document.createElement("smart-scroll-viewer");o.rightToLeft=e.rightToLeft,o.theme=e.theme,o.horizontalScrollBarVisibility="hidden",e.inverted?o.setAttribute("inverted",""):o.removeAttribute("inverted"),e.$.scrollView=o,e.$.menu=t,e._setFocusable(),e.$.menu.onclick=function(t){const o=t.target.closest("li");t.stopPropagation(),t.preventDefault(),e._performSelect(),o&&e.$.fireEvent("itemClick",{item:o,label:o.getAttribute("aria-label"),value:o.dataValue}),e.$.input.focus()}}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",e.$.scrollView.id),e.$.scrollView.setAttribute("role","listbox")}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}_setInputPurpose(){const e=this;e.readonly?e.$.input.removeAttribute("autocomplete"):e.$.input.setAttribute("autocomplete",e.inputPurpose)}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.setAttribute("tabindex",-1):e.$.input.removeAttribute("tabindex")}});
874
874
 
875
875
  /***/ }),
876
876
 
@@ -1061,7 +1061,7 @@ var __webpack_exports__ = {};
1061
1061
  /* harmony import */ var _smart_cardview_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(1091);
1062
1062
  /* harmony import */ var _smart_cardview_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_smart_cardview_js__WEBPACK_IMPORTED_MODULE_26__);
1063
1063
 
1064
- /* Smart UI v11.0.54 (2022-01-09)
1064
+ /* Smart UI v12.0.0 (2022-01-16)
1065
1065
  Copyright (c) 2011-2021 jQWidgets.
1066
1066
  License: https://htmlelements.com/license/ */ //
1067
1067