@wavemaker/app-runtime-wm-build 11.4.2-next.25744 → 11.4.2-next.25746

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.
@@ -194,7 +194,7 @@
194
194
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
195
195
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
196
196
  PERFORMANCE OF THIS SOFTWARE.
197
- ***************************************************************************** */var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var g=function(){function e(e,n){this.inj=e,this.bsModalService=n,this.isDateOpen=!0,this.isTimeOpen=!1,this.mode="DATE_TIME",this.placement="MODAL",this.change=new t.EventEmitter,this._value=new Date,this.changedValue=null,this.appLocale=e.get(c.App).appLocale||{}}return Object.defineProperty(e.prototype,"value",{set:function(e){e=e||new Date,this._value=e,this.changedValue=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsDatepickerConfig",{get:function(){return this._bsDatepickerConfig},set:function(e){this._bsDatepickerConfig=e,this._bsDatepickerConfig.showClearButton=!1,this._bsDatepickerConfig.showTodayButton=!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excludedDaysToDisable",{set:function(e){this._bsDatepickerConfig.daysDisabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){if(this._displayFormat)return this._displayFormat},set:function(e){e&&(this._displayFormat=e.replace(/y/g,"Y").replace(/d/g,"D").replace("a","A"))},enumerable:!1,configurable:!0}),e.prototype.validateSelectedDate=function(){var e,t,n,i,o;if(!this.changedValue)return!0;var r=moment(this.changedValue),a=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(a&&("DATE"===this.mode&&moment(a).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&a>this.changedValue))return!1;if(s&&("DATE"===this.mode&&moment(s).endOf("day").toDate()<this.changedValue||"DATE"!==this.mode&&s<this.changedValue))return!1;if((null===(i=null===(n=this._bsDatepickerConfig)||void 0===n?void 0:n.daysDisabled)||void 0===i?void 0:i.indexOf(r.day()))>=0)return!1;var l=r.startOf("day").toDate().getTime();return!(null===(o=this.excludedDatesToDisable)||void 0===o?void 0:o.find((function(e){return e.getTime()===l})))},e.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("body>modal-container .date-picker-modal span:contains("+e+")").not(".is-other-month,.current-date"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},e.prototype.hideOnClick=function(){var e=this;$("body>modal-container .date-picker-modal .app-datetime-picker").click((function(e){return e.stopPropagation()})),$("body>modal-container .date-picker-modal").click((function(){return e.onCancelClick()}))},e.prototype.getDateLabel=function(){return moment(this.changedValue).format(this.displayFormat)},e.prototype.openDatePicker=function(){this.isTimeOpen=!1,this.isDateOpen=!0},e.prototype.openTimePicker=function(){this.isTimeOpen=!0,this.isDateOpen=!1},e.prototype.onDateUpdate=function(e){var t=this.changedValue;"DATE"===this.mode?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)):t&&e&&(e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds())),this.changedValue=e,"DATE"===this.mode&&t!==e&&this.validateSelectedDate()&&this.onOkClick()},e.prototype.onTimeUpdate=function(e){this.changedValue=e},e.prototype.show=function(){var e=this;this.reset(),this.modalRef=this.bsModalService.show(this.datetimepickerTemplate,{animated:!0,backdrop:"static",class:"date-picker-modal modal-dialog-centered"}),setTimeout((function(){e.hideOnClick()}),500)},e.prototype.clear=function(){this.changedValue=null,this.triggerChange(),this.hideModal()},e.prototype.setToday=function(){var e=moment().startOf("day").toDate();this.onDateUpdate(e)},e.prototype.reset=function(){this.changedValue=this._value},e.prototype.hideModal=function(){var e;(null===(e=this.modalRef)||void 0===e?void 0:e.id)&&this.bsModalService.hide(this.modalRef.id)},e.prototype.onCancelClick=function(){this.changedValue=this._value,this.hideModal()},e.prototype.onOkClick=function(){this.validateSelectedDate()&&this.triggerChange(),this.hideModal()},e.prototype.triggerChange=function(){this.value!==this.changedValue&&this.change.emit(this.changedValue)},e.prototype.ngAfterViewInit=function(){},e.prototype.ngOnDestroy=function(){this.hideModal()},e}();g.decorators=[{type:t.Component,args:[{selector:"wm-datetimepicker",template:' \n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n \n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.MESSAGE_DATE_PICKER_TODAY || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.MESSAGE_DATE_PICKER_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.MESSAGE_DATE_PICKER_CLEAR || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:u.BsModalService}]},g.propDecorators={datetimepickerTemplate:[{type:t.ViewChild,args:["datetimepickerTemplate",{static:!0}]}],mode:[{type:t.Input}],placement:[{type:t.Input}],_bsDatepickerConfig:[{type:t.Input,args:["config"]}],minTime:[{type:t.Input}],maxTime:[{type:t.Input}],_displayFormat:[{type:t.Input}],change:[{type:t.Output}],excludedDatesToDisable:[{type:t.Input}],value:[{type:t.Input}],bsDatepickerConfig:[{type:t.Input,args:["config"]}],excludedDaysToDisable:[{type:t.Input}],displayFormat:[{type:t.Input}]};var v=function(){function e(e){this.inj=e,this.options={hour:[],minute:[],second:[],meridian:["AM","PM"]},this.value=new Date,this.min=null,this.max=null,this.change=new t.EventEmitter,this.options.hour=this.populateNumbers(0,23),this.options.minute=this.populateNumbers(0,59),this.options.second=this.populateNumbers(0,59)}return e.prototype.populateNumbers=function(e,t){for(var n=[],i=e;i<=t;i++)n.push({label:(i<10?"0":"")+i,value:i});return n},e.prototype.set=function(e,t){e.index;var n=e.value;"HOUR"===t?this.value=moment(this.value).hour(parseInt(n)).toDate():"MINUTE"===t?this.value=moment(this.value).minute(parseInt(n)).toDate():"SECOND"===t?this.value=moment(this.value).second(parseInt(n)).toDate():"MERIDIAN"===t&&(this.value=moment(this.value).minute(n).toDate()),this.min&&this.value<this.min&&(this.value=this.min),this.max&&this.value>this.max&&(this.value=this.max),this.change.emit(this.value)},Object.defineProperty(e.prototype,"hour",{get:function(){return moment(this.value).hour()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minute",{get:function(){return moment(this.value).minute()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"second",{get:function(){return moment(this.value).second()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"meridian",{get:function(){return"AM"},enumerable:!1,configurable:!0}),e.prototype.onDateUpdate=function(e){},e.prototype.ngAfterViewInit=function(){},e}();v.decorators=[{type:t.Component,args:[{selector:"wm-timepicker",template:' \n <wm-pickergroup>\n <wm-picker \n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker \n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker \n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],change:[{type:t.Output}]};var y="CURRENT_DATE",b=["January","February","March","April","May","June","July","August","September","October","November","December"],w="default",P="default";function O(e){return Object.assign(new a.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var S=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.isReadOnly=!1,r.clicked=!1,r.formatsByLocale={timezone:""},r._dateOptions=new o.BsDatepickerConfig,r.i18nService=r.inj.get(c.AbstractI18nService),r.invokeEventCallback("beforeload"),r.datePipe=r.inj.get(s.ToDatePipe),r.selectedLocale=r.i18nService.getSelectedLocale(),r._dateOptions.todayPosition="left",r._dateOptions.clearPosition="right",r.meridians=n.getLocaleDayPeriods(r.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),r.loadNativeDateInput=c.isMobile()&&!r.showcustompicker,r}return h(t,e),Object.defineProperty(t.prototype,"timeZone",{get:function(){return this.inj.get(c.AbstractI18nService).getTimezone(this)},enumerable:!1,configurable:!0}),t.prototype.isDropDownDisplayEnabledOnInput=function(e){return e===w},t.prototype.isDataEntryModeEnabledOnInput=function(e){return e===P},t.prototype.showValidation=function(e,t,n,i){if(n)return console.warn("min max date validation failed ",i),$(e.target).val(t)},t.prototype.resetDisplayInput=function(){$(this.nativeElement).find(".display-input").val("")},t.prototype.validate=function(e){return this.invalidDateTimeFormat?{invalidDateTimeFormat:{valid:!1}}:!_.isUndefined(this.dateNotInRange)&&this.dateNotInRange?{dateNotInRange:{valid:!1}}:!_.isUndefined(this.timeNotInRange)&&this.timeNotInRange?{timeNotInRange:{valid:!1}}:this.show&&this.required?e.value?null:{required:!0}:(this.validateType="",null)},t.prototype.formatValidation=function(e,t,n){var i=this.datepattern||this.timepattern,o=this.timeZone,r=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1}else if(n&&(t=c.getFormattedDate(this.datePipe,t,i,o)),t!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1;return!0},t.prototype.minDateMaxDateValidationOnInput=function(e,t,n,i){var o=this;if(e){var r=e;e=moment(e).startOf("day").toDate();var a=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<a){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,a,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="mindate",this.showValidation(t,n,i,l))}if(this.maxdate&&e>s){l=this.appLocale.LABEL_MAXDATE_VALIDATION_MESSAGE+" "+this.maxdate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,s,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="maxdate",this.showValidation(t,n,i,l))}if(this.excludedates){if((c.isString(this.excludedates)?_.split(this.excludedates,","):this.excludedates).map((function(e){return c.getFormattedDate(o.datePipe,e,o.datepattern,o.timeZone,null,null,o)})).indexOf(c.getFormattedDate(this.datePipe,r,this.datepattern,this.timeZone,null,null,this))>-1)return this.dateNotInRange=!0,this.validateType="excludedates",void this.invokeOnChange(this.datavalue,void 0,!1)}if(this.excludedays){var p=_.split(this.excludedays,","),u=_.get(r,"getDay")?r.getDay():r;if(p.indexOf(u.toString())>-1)return this.dateNotInRange=!0,this.validateType="excludedays",void this.invokeOnChange(this.datavalue,void 0,!1)}}i||(this.dateNotInRange=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("span:contains("+e+")").not(".is-other-month"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},t.prototype.isOtheryear=function(e){return 0===e.getMonth()&&11===this.activeDate.getMonth()||11===e.getMonth()&&0===this.activeDate.getMonth()},t.prototype.setActiveDateFocus=function(e,t){var n=this;this.setNextData(e);var i=this.activeDate.getMonth();t||(e.getMonth()<i?this.isOtheryear(e)?this.goToOtherMonthOryear("next","days"):this.goToOtherMonthOryear("previous","days"):e.getMonth()>i&&(this.isOtheryear(e)?this.goToOtherMonthOryear("previous","days"):this.goToOtherMonthOryear("next","days"))),setTimeout((function(){var t=e.getDate().toString();_.filter($("span:contains("+t+")").not(".is-other-month"),(function(i){$(i).text()===t&&($(i).hasClass("selected")&&$(i).parent().attr("aria-selected","true"),$(i).attr("aria-label",moment(e).format("dddd, MMMM Do YYYY")),$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","-1"),$(i).attr("tabindex","0"),$(i).focus(),n.activeDate=e)})),e.getMonth()===(new Date).getMonth()&&e.getFullYear()===(new Date).getFullYear()&&n.hightlightToday()}))},t.prototype.goToOtherMonthOryear=function(e,t){var n=$(".bs-datepicker-head ."+e);n.attr("disabled")||(n.trigger("click"),"days"===t?this.loadDays():"month"===t?this.loadMonths():"year"===t&&this.loadYears())},t.prototype.getMonth=function(e,t){var n=new Date(e),i=n.getMonth(),o=n.getFullYear(),r=new Date(o,i+=t),a=r.toLocaleString("en-US",{month:"long"});return{date:r,fullMonth:a}},t.prototype.addDatepickerMouseEvents=function(){var e=this,t=$(".bs-datepicker-head");t.find(".previous").click((function(t){e.next=e.getMonth(e.activeDate,0),e.prev=e.getMonth(e.activeDate,-2),e.clicked=!0,t.originalEvent&&e.setFocusForDate(-1),setTimeout((function(){$(".bs-datepicker-head .previous").focus()}))})),t.find(".next").click((function(t){e.next=e.getMonth(e.activeDate,2),e.prev=e.getMonth(e.activeDate,0),e.clicked=!0,t.originalEvent&&e.setFocusForDate(1),setTimeout((function(){$(".bs-datepicker-head .next").focus()}))})),t.find(".current").click((function(t){t.originalEvent&&e.setFocusForCurrentMonthOryear()})),$(".bs-datepicker-body, .bs-datepicker-action-buttons").click((function(t){t.stopPropagation(),t.originalEvent&&e.setFocusForMonthOrDay()})),t.find(".next").attr("aria-label","Next Month, "+this.next.fullMonth+" "+this.next.date.getFullYear()),t.find(".previous").attr("aria-label","Previous Month, "+this.prev.fullMonth+" "+this.prev.date.getFullYear()),setTimeout((function(){var n=t.find(".current span");t.find(".current").attr("aria-live","assertive").attr("aria-atomic","false"),e.clicked&&($(n[0]).text()&&t.find(".ng-star-inserted").prepend('<div class="sr-only">Changed to month </div>'),$(n[1]).text()&&t.find(".current").last().prepend('<div class="sr-only"> and year </div>'))}))},t.prototype.setFocusForMonthOrDay=function(){var e=$(".bs-datepicker-head .current").first().text(),t=$(".bs-datepicker-body");if(t.find("table.months").length>0){_.parseInt(e)!==this.activeDate.getFullYear()&&this.loadMonths();var n=new Date(_.parseInt(e),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.days").length>0){var i=b.indexOf(e);i!==this.activeDate.getMonth()&&this.loadDays();n=new Date(this.activeDate.getFullYear(),i,1);this.setActiveDateFocus(n,!0)}},t.prototype.setFocusForCurrentMonthOryear=function(){var e=$(".bs-datepicker-body");e.find("table.months").length>0?(this.loadMonths(),this.setActiveMonthFocus(this.activeDate,!0)):e.find("table.years").length>0&&(this.loadYears(),this.setActiveYearFocus(this.activeDate,!0))},t.prototype.setFocusForDate=function(e){var t=$(".bs-datepicker-body");if(t.find("table.months").length>0){this.loadMonths();var n=new Date(this.activeDate.getFullYear()+e,0,this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.years").length>0){this.loadYears();var i=t.find("table.years span").first().text();n=new Date(_.parseInt(i),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveYearFocus(n,!0)}else if(t.find("table.days").length>0){this.loadDays();n=new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+e,1);this.setActiveDateFocus(n,!0)}},t.prototype.addDatepickerKeyboardEvents=function(e,t){var n=this;this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e;var i=document.querySelector("."+e.dateContainerCls);c.setAttr(i,"tabindex","0"),i.onkeydown=function(e){if("escape"===n.keyEventPluginInstance.getEventFullKey(e)){n.elementScope.hideDatepickerDropdown();var t=n.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return t.focus()}))}},this.loadDays(),this.setActiveDateFocus(this.activeDate)},t.prototype.setNextData=function(e){this.next=this.getMonth(e,1),this.prev=this.getMonth(e,-1)},t.prototype.loadDays=function(){var e=this;setTimeout((function(){$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","0"),e.addKeyBoardEventsForDays(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForDays=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"days").toDate(),e.setActiveDateFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"days").toDate(),e.setActiveDateFocus(n);else if("pageup"===i)t.preventDefault(),n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveDateFocus(n);else if("pagedown"===i)t.preventDefault(),n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveDateFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate);else if("enter"===i){if($(document.activeElement).hasClass("disabled"))return;$(document.activeElement).click(),e.elementScope.hideDatepickerDropdown();var o=e.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return o.focus()}))}})),this.focusBlurDatePickerHeadButtons()},t.prototype.focusBlurDatePickerHeadButtons=function(){var e=$(".bs-datepicker-head button");e.on("focus",(function(){$(this).css("background-color","#9AA0A3")})),e.on("blur",(function(){$(this).css("background-color","")}))},t.prototype.loadMonths=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForMonths(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForMonths=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveMonthFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadYears(),e.setActiveYearFocus(e.activeDate);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadDays();var o=new Date(e.activeDate.getFullYear(),e.activeDate.getMonth(),1);e.setActiveDateFocus(o)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.loadYears=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForYears(),e.addDatepickerMouseEvents()}))},t.prototype.setActiveMonthFocus=function(e,t){var n=this;this.setNextData(e);var i=b[e.getMonth()];t||(e.getFullYear()<this.activeDate.getFullYear()?this.goToOtherMonthOryear("previous","month"):e.getFullYear()>this.activeDate.getFullYear()&&this.goToOtherMonthOryear("next","month")),setTimeout((function(){$(".bs-datepicker-body table.months span").attr("tabindex","-1"),$(".bs-datepicker-body table.months span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.months span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.addKeyBoardEventsForYears=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"year").toDate(),e.setActiveYearFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"year").toDate(),e.setActiveYearFocus(n);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.setActiveYearFocus=function(e,t){var n=this,i=e.getFullYear(),o=$(".bs-datepicker-body table.years span"),r=o.first().text(),a=o.last().text();t||(e.getFullYear()<_.parseInt(r)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(a)&&this.goToOtherMonthOryear("next","year")),setTimeout((function(){$(".bs-datepicker-body table.years span").attr("tabindex","-1"),$(".bs-datepicker-body table.years span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.years span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.focusTimePickerPopover=function(e){this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e,this.elementScope.ngZone.runOutsideAngular((function(){setTimeout((function(){$("timepicker .form-group").first().find("> input.form-control").focus()}))}))},t.prototype.bindTimePickerKeyboardEvents=function(){var e=this;setTimeout((function(){var t=$("body").find("> bs-dropdown-container timepicker");t.attr("tabindex",0),e.addEventsOnTimePicker(t)}))},t.prototype.focusOnInputEl=function(){var e=this;$(this.nativeElement).closest(".caption-floating").length>0&&setTimeout((function(){$(e.nativeElement).find(".app-textbox").focus()}),100)},t.prototype.isValidDate=function(e){return e&&e instanceof Date&&!isNaN(e.getTime())},t.prototype.timeFormatValidation=function(){var e=$(this.nativeElement).find("input").val(),t=c.getNativeDateObject(e,{meridians:this.meridians,pattern:this.datepattern});this.formatValidation(t,e)&&(this.invalidDateTimeFormat=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.updateTimeValue=function(e,t){var n=this;e.length<2?setTimeout((function(){"minutes"===t?n.bsTimePicker.updateMinutes("00"):n.bsTimePicker.updateSeconds("00")}),500):"minutes"===t?this.bsTimePicker.updateMinutes("00"):this.bsTimePicker.updateSeconds("00")},t.prototype.addEventsOnTimePicker=function(e){var t=this,n=e.find(".bs-timepicker-field");n.first().on("keyup",(function(e){var i=e.target.value;_.forEach(n,(function(n,o){if(e.target!==n&&""===n.value&&i.length){var r=1===o?"minutes":"seconds";t.updateTimeValue(i,r)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),r=o.parent(),a=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&a.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(r.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):r.is(":last-child")||r.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),a.mintime&&a.maxtime&&!t.isValidDate(a.bsTimeValue)&&("arrowdown"===s?a.bsTimeValue=a.maxTime:"arrowup"===s&&(a.bsTimeValue=a.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(a.datePipe,a.bsTimeValue,l,t.timeZone,null,null,t)===a.displayValue&&$(t.nativeElement).find(".display-input").val(a.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus()))})),e.find("a").on("click",(function(e){var n=t.elementScope,i=$(e.target);n.mintime&&n.maxtime&&!t.isValidDate(n.bsTimeValue)&&(i.find("span").hasClass("bs-chevron-down")?n.bsTimeValue=n.maxTime:i.find("span").hasClass("bs-chevron-up")&&(n.bsTimeValue=n.minTime)),t.timeFormatValidation()}))},t.prototype.updateFormat=function(e){"datepattern"===e?(this._dateOptions.dateInputFormat=this.datepattern,this.showseconds=_.includes(this.datepattern,"s"),this.ismeridian=_.includes(this.datepattern,"h")):"timepattern"===e&&(this.showseconds=_.includes(this.timepattern,"s"),this.ismeridian=_.includes(this.timepattern,"h"))},t.prototype.getMobileInput=function(){return this.nativeElement.querySelector(".mobile-input")},t.prototype.onDateTimeInputBlur=function(){var e=this.getMobileInput();if(e&&!c.hasCordova()){for(var t=this.nativeElement.children,n=0;n<t.length;n++)t[n].classList.remove("add-opacity");e.classList.remove("remove-opacity")}},t.prototype.onDateTimeInputFocus=function(e){if(void 0===e&&(e=!1),this.loadNativeDateInput){var t=this.getMobileInput();if(!e||c.hasCordova())t&&this._triggeredByUser&&(t.focus(),t.click());else{for(var n=this.nativeElement.children,i=0;i<n.length;i++)n[i].classList.add("add-opacity");t.classList.add("remove-opacity")}}},t.prototype.getCordovaPluginDatePickerApi=function(){if(c.isIos())return _.get(window,"cordova.wavemaker.datePicker.selectDate")},t.prototype.showDatePickerModal=function(){this.datetimepickerComponent.show()},t.prototype.blurDateInput=function(e){var t=this.nativeElement.querySelector(".display-input");e&&setTimeout((function(){return t.blur()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"datepattern"===t?this.updateFormat(t):"showweeks"===t?this._dateOptions.showWeekNumbers=n:"mindate"===t?(this._dateOptions.minDate=n===y?this.mindate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"maxdate"===t?(this._dateOptions.maxDate=n===y?this.maxdate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"excludedates"===t||"excludedays"===t?(this.excludedays&&(this.excludedDaysToDisable=_.split(this.excludedays,",").map((function(e){return+e}))),this.excludedates&&(this.excludedDatesToDisable=this.excludedates,c.isString(this.excludedates)&&(this.excludedDatesToDisable=_.split(this.excludedates,",")),this.excludedDatesToDisable=this.excludedDatesToDisable.map((function(e){return c.getDateObj(e)}))),this.minDateMaxDateValidationOnInput(this.datavalue)):"selectfromothermonth"===t?this._dateOptions.selectFromOtherMonth=n:"todaybutton"===t?this._dateOptions.showTodayButton=n:"clearbutton"===t?this._dateOptions.showClearButton=n:"todaybuttonlabel"===t?this._dateOptions.todayButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"clearbuttonlabel"===t?this._dateOptions.clearButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"showcustompicker"===t?this.loadNativeDateInput=c.isMobile()&&!this.showcustompicker:"adaptiveposition"===t?this._dateOptions.adaptivePosition=n:e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.containerTarget=s.getContainerTargetClass(this.nativeElement),this.isReadOnly="undefined"!=this.dataentrymode&&!this.isDataEntryModeEnabledOnInput(this.dataentrymode);var t=this.getMobileInput();t&&setTimeout((function(){t.style.width="100%",t.style.height="100%"}))},t.prototype.ngOnDestroy=function(){this.dateOnShowSubscription&&this.dateOnShowSubscription.unsubscribe(),e.prototype.ngOnDestroy.call(this)},t.prototype.ngOnDetach=function(){var e;null===(e=this.datetimepickerComponent)||void 0===e||e.hideModal()},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t}(p.BaseFormCustomComponent);S.decorators=[{type:t.Directive}],S.ctorParameters=function(){return[{type:t.Injector},null]},S.propDecorators={bsDropdown:[{type:t.ViewChild,args:[r.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[a.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var E=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["name",s.PROP_STRING],["outputformat",Object.assign({value:"yyyy-MM-dd"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select Date"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",Object.assign({value:!0},s.PROP_BOOLEAN)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",Object.assign({value:!1},s.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),T=function(){s.register("wm-date",E),s.registerFormWidget(c.FormWidgetType.DATE,new Map(E))},R={widgetType:"wm-date",hostClass:"app-date input-group"},A=function(e){function t(t,n,i,o){var r=e.call(this,t,R)||this;return r.cdRef=n,r.appDefaults=i,r.isOpen=!1,r.isEnterPressedOnDateInput=!1,s.styler(r.nativeElement,r),r.keyEventPlugin=o[1],r.dateContainerCls="app-date-"+r.widgetId,r._dateOptions.containerClass="app-date "+r.dateContainerCls,r._dateOptions.showWeekNumbers=!1,r._bsDefaultLoadCheck=!0,r.datepattern=r.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),r.updateFormat("datepattern"),r}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsDataValue?this.bsDataValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-dd"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,"yyyy-MM-dd",this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.outputformat,this.timeZone,null,this.isCurrentDate,this)||""},set:function(e){"CURRENT_DATE"===e?(this.bsDataValue=this.timeZone?c.getMomentLocaleObject(this.timeZone):new Date,this.isCurrentDate=!0):(this.bsDataValue=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.isCurrentDate=!1),this.invokeOnChange(this.datavalue,void 0,!0),this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.onDisplayDateChange=function(e,t){if(void 0===t&&(t=!1),this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=c.getDateObj(e.target.value,{pattern:this.datepattern,isNativePicker:t});this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||this.setDataValue(n))}},t.prototype.setDataValue=function(e){this.invalidDateTimeFormat=!1,this.minDateMaxDateValidationOnInput(e),c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue),this.bsDataValue=e||void 0,this.invokeOnChange(this.datavalue,{},!0)},t.prototype.onDatePickerOpen=function(){this.isOpen=!0,this.bsDataValue?this.activeDate=this.bsDataValue:this.activeDate=new Date,this.bsDataValue||this.hightlightToday(),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.addDatepickerKeyboardEvents(this,!1),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker),c.adjustContainerRightEdges($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.hideDatepickerDropdown=function(){var e;this.invokeOnTouched(),this.isOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.isEnterPressedOnDateInput=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.blurDateInput(this.isOpen)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput&&(t||this.onDateTimeInputFocus()),"click"===e.type&&(this.invokeEventCallback("click",{$event:e}),this.focusOnInputEl()),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.isOpen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon))if(e.stopPropagation(),"enter"===this.keyEventPlugin.constructor.getEventFullKey(e)){var t=c.getDateObj(e.target.value,{pattern:this.datepattern});e.preventDefault();var n=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this),i=e.target.value.trim();i&&"timestamp"===this.datepattern?_.isNaN(i)||_.parseInt(i)===n||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):i&&i!==n?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=e.target.value?t:""),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown();else this.hideDatepickerDropdown()},t.prototype.onDateChange=function(e){this._bsDefaultLoadCheck?this._bsDefaultLoadCheck=!1:this.setDataValue(e)},t}(S);A.initializeProps=T(),A.decorators=[{type:t.Component,args:[{selector:"[wmDate]",template:' <input class="form-control app-textbox app-dateinput display-input"\n focus-target\n type="text"\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n [disabled]="disabled || readonly"\n [autofocus]="autofocus"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n (change)="onDisplayDateChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event);">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isOpen"\n #datepicker="bsDatepicker"\n bsDatepicker\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n placement="bottom right"\n [isDisabled]="disabled || readonly"\n [bsValue]="bsDataValue"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n (bsValueChange)="onDateChange($event)">\n</div>\n\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="DATE"\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDataValue"\n (change)="onDateChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event);"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n [attr.aria-label]="displayValue ? \'Change Date\' + displayValue : \'Choose Date\'"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(A,i.NG_VALUE_ACCESSOR,!0),s.provideAs(A,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},A.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var C=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"timestamp"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select date time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",s.PROP_BOOLEAN],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",s.PROP_BOOLEAN],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timestamp",s.PROP_STRING],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),I=function(){s.register("wm-datetime",C),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(C)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(C))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},N="CURRENT_DATE",x=O,k=function(e){function t(t,n,i,o,r,a){var l=e.call(this,t,D)||this;return l.ngZone=n,l.cdRef=i,l.appDefaults=o,l.isEnterPressedOnDateInput=!1,l.isTimeOpen=!1,l.isDateOpen=!1,l.isCurrentDate=!1,l._debouncedOnChange=_.debounce(l.invokeOnChange,10),l.registerDestroyListener((function(){return l.clearTimeInterval()})),s.styler(l.nativeElement,l),l.app=r,l.keyEventPlugin=a[1],l.dateContainerCls="app-date-"+l.widgetId,l._dateOptions.containerClass="app-date "+l.dateContainerCls,l._dateOptions.showWeekNumbers=!1,l.datepattern=l.appDefaults.dateTimeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATETIME),l.updateFormat("datepattern"),l}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.proxyModel?this.proxyModel.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-ddTHH:mm:ss"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,"yyyy-MM-ddTHH:mm:ss",this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentDate&&!this.proxyModel?N:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===N?(this.isCurrentDate=!0,this.setTimeInterval()):(this.proxyModel=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.clearTimeInterval(),this.isCurrentDate=!1),this.bsTimeValue=this.bsDateValue=this.proxyModel,this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;e.onModelUpdate(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.toggleTimePicker=function(e,t){this.loadNativeDateInput?this.onDateTimeInputFocus():(this.isTimeOpen=e,t&&"click"===t.type&&this.invokeEventCallback("click",{$event:t}),this.addTimepickerClickListener(this.isTimeOpen))},t.prototype.addTimepickerClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterTimepickeEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.toggleTimePicker(!1)}),0,!0)}),350)}},t.prototype.setIsTimeOpen=function(e){this.isTimeOpen=e},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.toggleTimePicker(!1),this.deregisterTimepickeEventListener&&this.deregisterTimepickeEventListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e})},t.prototype.onTimepickerOpen=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.bsDatePickerDirective.hide(),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu")),c.adjustContainerRightEdges($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.onDatePickerOpen=function(){this.isDateOpen=!this.isDateOpen,this.toggleTimePicker(!1),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.bsDateValue?this.activeDate=this.bsDateValue:this.activeDate=new Date,this.bsDateValue||this.hightlightToday(),this.addDatepickerKeyboardEvents(this,!0),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onModelUpdate=function(e,t){if("date"===t&&(this.invalidDateTimeFormat=!1,c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue)),this.minDateMaxDateValidationOnInput(e),!e)return this.bsDateValue&&this.bsTimePicker&&(""===this.bsTimePicker.hours||""===this.bsTimePicker.minutes||""===this.bsTimePicker.seconds)?this.bsDateValue=this.bsTimeValue=this.proxyModel=moment(this.bsDateValue).startOf("day").toDate():this.bsDateValue=this.bsTimeValue=this.proxyModel=void 0,void((e!==this.datavalue||!this.datavalue&&this.prevDatavalue)&&this._debouncedOnChange(this.datavalue,{},!0));"date"===t&&this.isDateOpen&&this.toggleTimePicker(!0),this.proxyModel=e,this.proxyModel&&(this.bsDateValue=this.bsTimeValue=e),this._debouncedOnChange(this.datavalue,{},!0),this.cdRef.detectChanges();var n=$(".bs-timepicker-field");if(this.timeZone&&"datetimestamp"===this.key&&n.length){var i=c.getFormattedDate(this.datePipe,e,this.getTimePattern(),this.timeZone,this.key,null,this);this.updateTimepickerFields(i,n)}},t.prototype.getTimePattern=function(){var e,t=this.datepattern.toLowerCase().indexOf("h"),n=this.datepattern.toLowerCase().indexOf(":ss");(n>-1||(n=this.datepattern.toLowerCase().indexOf(":mm"))>-1)&&(n+=3);var i=this.datepattern.toLowerCase().indexOf("a");return e=this.datepattern.substr(t,n),i>-1&&(e+=" a"),e},t.prototype.updateTimepickerFields=function(e,t){for(var n,i=$("timepicker button.text-center"),o=e.split(" "),r=o[0].split(":"),a=0;a<t.length;a++)t[a].value=r[a];(null===(n=null==i?void 0:i.html())||void 0===n?void 0:n.trim())!==o[1]&&i.text(o[1])},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation()},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&(this.invokeEventCallback("click",{$event:e}),this.focusOnInputEl()),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen)))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterDatepickerEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.bsDatePickerDirective.hide()}),0,!0)}),350)}},t.prototype.hideDatepickerDropdown=function(){var e;this.isDateOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.invokeOnTouched(),this.bsDatePickerDirective.hide(),this.bsDateValue&&this.toggleTimePicker(!0),this.isEnterPressedOnDateInput=!1,this.deregisterDatepickerEventListener&&this.deregisterDatepickerEventListener();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t}),this.blurDateInput(this.isDateOpen)},t.prototype.onDateChange=function(e,t){if(this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=e.target.value.trim();n=n?c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput}):void 0,this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||(this.invalidDateTimeFormat=!1,this.onModelUpdate(n)))}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=e.target.value.trim(),n=this.keyEventPlugin.constructor.getEventFullKey(e);if("enter"===n||"arrowdown"===n){t=t?c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians}):void 0,e.preventDefault();var i=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this),o=e.target.value.trim();o&&"timestamp"===this.datepattern?_.isNaN(o)||_.parseInt(o)===i||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):o&&o!==i?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=t),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t}(S);k.initializeProps=I(),k.decorators=[{type:t.Component,args:[{selector:"[wmDateTime]",template:' <div dropdown\n [isOpen]="isTimeOpen"\n autoClose="false"\n [container]="\'body\'"\n (onShown)="onTimepickerOpen()"\n style="display: inherit;">\n <input class="form-control app-textbox display-input"\n [attr.aria-label]="hint"\n focus-target\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n type="text"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDateChange($event)"\n [autofocus]="autofocus"\n [disabled]="disabled || readonly || isCurrentDate"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-date"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n aria-label="Select time"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleTimePicker(!isTimeOpen, $event)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-time"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n focus-target\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isDateOpen"\n placement="bottom right"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n #datepicker=bsDatepicker\n bsDatepicker\n [isDisabled]="disabled || readonly || isCurrentDate"\n [bsValue]="bsDateValue"\n (bsValueChange)="onModelUpdate($event, \'date\')">\n </div>\n <div *dropdownMenu\n class="dropdown-menu"\n aria-label="timepicker dropdown"\n aria-controls="time"\n (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="disabled || readonly || isCurrentDate"\n [(ngModel)]="bsTimeValue"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds"\n (ngModelChange)="onModelUpdate($event, \'time\')"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDateValue"\n (change)="onModelUpdate($event, \'date\')">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event)"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(k,i.NG_VALUE_ACCESSOR,!0),s.provideAs(k,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(k),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:x}]}]}],k.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},k.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var M=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxtime",s.PROP_STRING],["mintime",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"HH:mm:ss"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timepattern",s.PROP_STRING],["timestamp",s.PROP_STRING]]),L=function(){s.register("wm-time",M),s.registerFormWidget(c.FormWidgetType.TIME,new Map(M))},F="CURRENT_TIME",j={widgetType:"wm-time",hostClass:"input-group app-timeinput"},B=O,G=function(e){function t(t,n,i,o,r){var a=e.call(this,t,j)||this;return a.ngZone=n,a.appDefaults=i,a.status={isopen:!1},a.keyEventPlugin=r[1],s.styler(a.nativeElement,a),a.registerDestroyListener((function(){return a.clearTimeInterval()})),a.timepattern=a.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),a.updateFormat("timepattern"),a.app=o,a}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsTimeValue?this.bsTimeValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentTime&&!this.bsTimeValue?F:c.getFormattedDate(this.datePipe,this.bsTimeValue,this.outputformat,this.timeZone,null,null,this)||""},set:function(e){e?e===F?(this.isCurrentTime=!0,this.setTimeInterval()):(this.clearTimeInterval(),this.bsTimeValue=c.getNativeDateObject(e,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.isCurrentTime=!1,this.mintimeMaxtimeValidation()):(this.bsTimeValue=void 0,this.clearTimeInterval(),this.isCurrentTime=!1),this.invokeOnChange(this.datavalue),c.$appDigest()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,this.timepattern,this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,"HH:mm:ss",this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("timepattern"===t&&this.updateFormat("timepattern"),"mintime"===t?(this.minTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):"maxtime"===t?(this.maxTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setValidateType=function(e,t,n){this.timeNotInRange&&(n<e?this.validateType="mintime":n>t&&(this.validateType="maxtime"))},t.prototype.mintimeMaxtimeValidation=function(){this.timeNotInRange=this.minTime&&this.maxTime&&(this.bsTimeValue<this.minTime||this.bsTimeValue>this.maxTime),this.setValidateType(this.minTime,this.maxTime,this.bsTimeValue),this.invokeOnChange(this.datavalue,void 0,!1)},t.prototype.toggleDropdown=function(e,t){var n=this;void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&(this.invokeEventCallback("click",{$event:e}),this.focusOnInputEl()),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)||(this.ngZone.run((function(){n.status.isopen=!n.status.isopen})),this.addBodyClickListener(this.status.isopen)))},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t})},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.status.isopen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=this.keyEventPlugin.constructor.getEventFullKey(e);"enter"===t||"arrowdown"===t?(e.preventDefault(),this.toggleDropdown(e)):this.hideTimepickerDropdown()}else this.hideTimepickerDropdown()},t.prototype.onDisplayTimeChange=function(e){var t=c.getNativeDateObject(e.target.value,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});this.formatValidation(t,e.target.value)&&(this.invalidDateTimeFormat=!1,this.onTimeChange(t))},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("bs-timepicker-field")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.onTimeChange=function(e,t){var n,i,o;t&&(e=c.getNativeDateObject(e.target.value,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput})),e?(this.bsTimeValue=e,this.timeNotInRange=this.minTime&&this.maxTime&&(e<this.minTime||e>this.maxTime),this.setValidateType(this.minTime,this.maxTime,e)):(this.bsTimePicker&&this.bsTimePicker.min&&this.bsTimePicker.max&&(o=moment(new Date(this.bsTimePicker.min)).format("A"),moment(new Date(this.bsTimePicker.max)).format("A"),n=this.bsTimePicker.hours+":"+(this.bsTimePicker.minutes||0)+":"+(this.bsTimePicker.seconds||0)+(this.bsTimePicker.showMeridian?" "+o:""),i=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.bsTimePicker.meridian=o,this.timeNotInRange=this.bsTimePicker.min>i||this.bsTimePicker.max<i,this.setValidateType(this.bsTimePicker.min,this.bsTimePicker.max,i)),this.bsTimeValue=i),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,{},!0)},t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;t.setSeconds(t.getSeconds()+1),e.datavalue=F,e.onTimeChange(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.setIsTimeOpen=function(e){this.status.isopen=e},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.status.isopen=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.removeKeyupListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e}),this.blurDateInput(!0)},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.onShown=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.assignModel=function(){this.displayInputElem||(this.displayInputElem=this.getMobileInput()),this.displayInputElem.value=_.get(this,"nativeDisplayValue")},t}(S);G.initializeProps=L(),G.decorators=[{type:t.Component,args:[{selector:"[wmTime]",template:' <div dropdown [isOpen]="status.isopen" (onShown)="onShown()" (onHidden)="hideTimepickerDropdown()" [container]="\'body\'" style="display: inherit">\n <input class="form-control app-textbox display-input" [attr.aria-label]="hint"\n focus-target\n [tabindex]="tabindex"\n [name]="name"\n type="text"\n role="timer"\n [value]="displayValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [autofocus]="autofocus"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-atomic]="isCurrentTime ? \'true\' : \'false\'"\n [required]="required"\n [readOnly]="isReadOnly"\n (click)="toggleDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDisplayTimeChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n <span class="input-group-btn dropdown-toggle">\n <button type="button" class="btn btn-default btn-date" [tabindex]="tabindex" [disabled]="disabled || readonly || isCurrentTime" aria-label="Select time" aria-haspopup="true" aria-expanded="false" (click)="toggleDropdown($event, false)"><i aria-hidden="true" class="app-icon wm-sl-l sl-time"></i></button>\n </span>\n <div *dropdownMenu class="dropdown-menu" (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="isDisabled"\n [(ngModel)]="bsTimeValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds" (ngModelChange)="onTimeChange($event)"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="TIME"\n [minTime]="minTime"\n [maxTime]="maxTime"\n [placement]="modal"\n [displayFormat]="timepattern"\n [value]="bsTimeValue"\n (change)="onTimeChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n tabindex="1000000"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event); assignModel()"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentTime) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(G,i.NG_VALUE_ACCESSOR,!0),s.provideAs(G,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(G),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:B}]}]}],G.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]};var V=function(){};V.decorators=[{type:t.Component,args:[{selector:"wm-pickergroup",template:'\n <div class="app-picker-group">\n <ng-content></ng-content>\n </div>\n '}]}];var U=function(){function e(e){this.inj=e,this.change=new t.EventEmitter,this._selectedIndex=0,this._options=[],this.noOfEmptyElements=2,this.$el=$(e.get(t.ElementRef).nativeElement)}return Object.defineProperty(e.prototype,"selectedValue",{get:function(){return this._selectedValue},set:function(e){this._selectedValue=e,this.reRender()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e.map((function(e){return{label:e.label,value:void 0!==e.value?e.value:e.label}})),this.reRender()},enumerable:!1,configurable:!0}),e.prototype.reRender=function(){var e,t=this;this._selectedIndex=this.options.findIndex((function(e){return e.value===t.selectedValue})),null===(e=this.pickerAnimator)||void 0===e||e.select(this._selectedIndex+this.noOfEmptyElements)},Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){this._selectedIndex=e,this._selectedValue=this.options[e].value,this.change.emit(this.options[e])},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.pickerAnimator=new W(this)},e}();U.decorators=[{type:t.Component,args:[{selector:"wm-picker",template:'\n <div class="app-picker">\n <div class="app-picker-option-container">\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div *ngFor="let option of options; index as i;" class="app-picker-option">\n {{option.label}}\n </div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n </div>\n <div class="app-picker-ruler"></div>\n </div>\n '}]}],U.ctorParameters=function(){return[{type:t.Injector}]},U.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var W=function(){function e(e){var t=this;this.picker=e;var n=e.selectedIndex+e.noOfEmptyElements,i=function(e){return n+Math.floor(e/16)};this.select(n),this.getElement().swipey({direction:$.fn.swipey.DIRECTIONS.VERTICAL,threshold:10,target:e.$el,onSwipe:function(e,n){t.select(i(-1*n.length))},onSwipeEnd:function(o,r){var a=i(-1*r.length);t.select(a),n=e.selectedIndex+e.noOfEmptyElements}})}return e.prototype.getElement=function(){return this.picker.$el.find(".app-picker-option-container:first")},e.prototype.getOptionElements=function(){return this.getElement().find(".app-picker-option")},e.prototype.select=function(e){var t=this.getOptionElements();if(!(e<this.picker.noOfEmptyElements||e>=t.length-this.picker.noOfEmptyElements)){this.getElement().find(".app-picker-option.app-picker-option-selected").removeClass("app-picker-option-selected"),t.eq(e).addClass("app-picker-option-selected"),this.picker.selectedIndex=e-this.picker.noOfEmptyElements;var n=e-this.picker.noOfEmptyElements,i=e+this.picker.noOfEmptyElements;t.each((function(t,o){if(t>=n&&t<=i){var r=30*(t-e),a=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+r+"deg)",opacity:a}).show()}else $(o).hide()}))}},e}(),q=[A,k,G,g,v,U,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,r.BsDropdownModule,i.FormsModule,a.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=A,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=x,e["\u0275a"]=O,e["\u0275b"]=S,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=T,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=U,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("rxjs"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/input/file-upload",["exports","@angular/core","@angular/common","@wm/components/base","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.fileupload={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs,e.wm.core)}(this,(function(e,t,n,i,o,r){"use strict";
197
+ ***************************************************************************** */var d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var g=function(){function e(e,n){this.inj=e,this.bsModalService=n,this.isDateOpen=!0,this.isTimeOpen=!1,this.mode="DATE_TIME",this.placement="MODAL",this.change=new t.EventEmitter,this._value=new Date,this.changedValue=null,this.appLocale=e.get(c.App).appLocale||{}}return Object.defineProperty(e.prototype,"value",{set:function(e){e=e||new Date,this._value=e,this.changedValue=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bsDatepickerConfig",{get:function(){return this._bsDatepickerConfig},set:function(e){this._bsDatepickerConfig=e,this._bsDatepickerConfig.showClearButton=!1,this._bsDatepickerConfig.showTodayButton=!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"excludedDaysToDisable",{set:function(e){this._bsDatepickerConfig.daysDisabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"displayFormat",{get:function(){if(this._displayFormat)return this._displayFormat},set:function(e){e&&(this._displayFormat=e.replace(/y/g,"Y").replace(/d/g,"D").replace("a","A"))},enumerable:!1,configurable:!0}),e.prototype.validateSelectedDate=function(){var e,t,n,i,o;if(!this.changedValue)return!0;var r=moment(this.changedValue),a=null===(e=this._bsDatepickerConfig)||void 0===e?void 0:e.minDate,s=null===(t=this._bsDatepickerConfig)||void 0===t?void 0:t.maxDate;if(a&&("DATE"===this.mode&&moment(a).startOf("day").toDate()>this.changedValue||"DATE"!==this.mode&&a>this.changedValue))return!1;if(s&&("DATE"===this.mode&&moment(s).endOf("day").toDate()<this.changedValue||"DATE"!==this.mode&&s<this.changedValue))return!1;if((null===(i=null===(n=this._bsDatepickerConfig)||void 0===n?void 0:n.daysDisabled)||void 0===i?void 0:i.indexOf(r.day()))>=0)return!1;var l=r.startOf("day").toDate().getTime();return!(null===(o=this.excludedDatesToDisable)||void 0===o?void 0:o.find((function(e){return e.getTime()===l})))},e.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("body>modal-container .date-picker-modal span:contains("+e+")").not(".is-other-month,.current-date"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},e.prototype.hideOnClick=function(){var e=this;$("body>modal-container .date-picker-modal .app-datetime-picker").click((function(e){return e.stopPropagation()})),$("body>modal-container .date-picker-modal").click((function(){return e.onCancelClick()}))},e.prototype.getDateLabel=function(){return moment(this.changedValue).format(this.displayFormat)},e.prototype.openDatePicker=function(){this.isTimeOpen=!1,this.isDateOpen=!0},e.prototype.openTimePicker=function(){this.isTimeOpen=!0,this.isDateOpen=!1},e.prototype.onDateUpdate=function(e){var t=this.changedValue;"DATE"===this.mode?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)):t&&e&&(e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds())),this.changedValue=e,"DATE"===this.mode&&t!==e&&this.validateSelectedDate()&&this.onOkClick()},e.prototype.onTimeUpdate=function(e){this.changedValue=e},e.prototype.show=function(){var e=this;this.reset(),this.modalRef=this.bsModalService.show(this.datetimepickerTemplate,{animated:!0,backdrop:"static",class:"date-picker-modal modal-dialog-centered"}),setTimeout((function(){e.hideOnClick()}),500)},e.prototype.clear=function(){this.changedValue=null,this.triggerChange(),this.hideModal()},e.prototype.setToday=function(){var e=moment().startOf("day").toDate();this.onDateUpdate(e)},e.prototype.reset=function(){this.changedValue=this._value},e.prototype.hideModal=function(){var e;(null===(e=this.modalRef)||void 0===e?void 0:e.id)&&this.bsModalService.hide(this.modalRef.id)},e.prototype.onCancelClick=function(){this.changedValue=this._value,this.hideModal()},e.prototype.onOkClick=function(){this.validateSelectedDate()&&this.triggerChange(),this.hideModal()},e.prototype.triggerChange=function(){this.value!==this.changedValue&&this.change.emit(this.changedValue)},e.prototype.ngAfterViewInit=function(){},e.prototype.ngOnDestroy=function(){this.hideModal()},e}();g.decorators=[{type:t.Component,args:[{selector:"wm-datetimepicker",template:' \n <ng-template #datetimepickerTemplate>\n <div class="app-datetime-picker">\n <div class="modal-body">\n <div class="mobile-datetime-picker-options">\n \n </div>\n <bs-datepicker-inline\n [bsConfig]="bsDatepickerConfig"\n [datesDisabled]="excludedDatesToDisable"\n bsDatepicker\n [bsValue]="changedValue"\n (bsValueChange)="onDateUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'">\n </bs-datepicker-inline>\n <wm-timepicker\n [value]="changedValue"\n [min]="minTime"\n [max]="maxTime"\n (change)="onTimeUpdate($event)"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"></wm-timepicker>\n <span class="text-primary date-picker-value">\n {{getDateLabel()}}\n </span>\n </div>\n <div class="modal-footer">\n <button\n *ngIf="mode === \'DATE_TIME\' || mode === \'DATE\'"\n class="btn btn-secondary today-btn"\n (click)="setToday()">{{appLocale.MESSAGE_DATE_PICKER_TODAY || "Today" }}</button>\n <button\n class="btn btn-primary pull-right ok-btn"\n *ngIf="mode === \'DATE_TIME\' || mode === \'TIME\'"\n (click)="onOkClick()">{{appLocale.MESSAGE_DATE_PICKER_OK || "Ok" }}</button>\n <button\n class="btn btn-secondary pull-right clear-btn"\n (click)="clear()">{{appLocale.MESSAGE_DATE_PICKER_CLEAR || "Clear" }}</button>\n </div>\n </div>\n </ng-template>\n '}]}],g.ctorParameters=function(){return[{type:t.Injector},{type:u.BsModalService}]},g.propDecorators={datetimepickerTemplate:[{type:t.ViewChild,args:["datetimepickerTemplate",{static:!0}]}],mode:[{type:t.Input}],placement:[{type:t.Input}],_bsDatepickerConfig:[{type:t.Input,args:["config"]}],minTime:[{type:t.Input}],maxTime:[{type:t.Input}],_displayFormat:[{type:t.Input}],change:[{type:t.Output}],excludedDatesToDisable:[{type:t.Input}],value:[{type:t.Input}],bsDatepickerConfig:[{type:t.Input,args:["config"]}],excludedDaysToDisable:[{type:t.Input}],displayFormat:[{type:t.Input}]};var v=function(){function e(e){this.inj=e,this.options={hour:[],minute:[],second:[],meridian:["AM","PM"]},this.value=new Date,this.min=null,this.max=null,this.change=new t.EventEmitter,this.options.hour=this.populateNumbers(0,23),this.options.minute=this.populateNumbers(0,59),this.options.second=this.populateNumbers(0,59)}return e.prototype.populateNumbers=function(e,t){for(var n=[],i=e;i<=t;i++)n.push({label:(i<10?"0":"")+i,value:i});return n},e.prototype.set=function(e,t){e.index;var n=e.value;"HOUR"===t?this.value=moment(this.value).hour(parseInt(n)).toDate():"MINUTE"===t?this.value=moment(this.value).minute(parseInt(n)).toDate():"SECOND"===t?this.value=moment(this.value).second(parseInt(n)).toDate():"MERIDIAN"===t&&(this.value=moment(this.value).minute(n).toDate()),this.min&&this.value<this.min&&(this.value=this.min),this.max&&this.value>this.max&&(this.value=this.max),this.change.emit(this.value)},Object.defineProperty(e.prototype,"hour",{get:function(){return moment(this.value).hour()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minute",{get:function(){return moment(this.value).minute()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"second",{get:function(){return moment(this.value).second()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"meridian",{get:function(){return"AM"},enumerable:!1,configurable:!0}),e.prototype.onDateUpdate=function(e){},e.prototype.ngAfterViewInit=function(){},e}();v.decorators=[{type:t.Component,args:[{selector:"wm-timepicker",template:' \n <wm-pickergroup>\n <wm-picker \n [options]="options.hour"\n [selectedValue]="hour"\n (change)="set($event, \'HOUR\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker \n [options]="options.minute"\n [selectedValue]="minute"\n (change)="set($event, \'MINUTE\')"></wm-picker>\n <span class="app-time-separator">:</span>\n <wm-picker \n [options]="options.minute"\n [selectedValue]="second"\n (change)="set($event, \'SECOND\')"></wm-picker>\n </wm-pickergroup>\n '}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={value:[{type:t.Input}],min:[{type:t.Input}],max:[{type:t.Input}],change:[{type:t.Output}]};var y="CURRENT_DATE",b=["January","February","March","April","May","June","July","August","September","October","November","December"],w="default",P="default";function O(e){return Object.assign(new a.TimepickerConfig,{meridians:n.getLocaleDayPeriods(e.getSelectedLocale(),n.FormStyle.Format,n.TranslationWidth.Abbreviated)})}var S=function(e){function t(t,i){var r=e.call(this,t,i)||this;return r.isReadOnly=!1,r.clicked=!1,r.formatsByLocale={timezone:""},r._dateOptions=new o.BsDatepickerConfig,r.i18nService=r.inj.get(c.AbstractI18nService),r.invokeEventCallback("beforeload"),r.datePipe=r.inj.get(s.ToDatePipe),r.selectedLocale=r.i18nService.getSelectedLocale(),r._dateOptions.todayPosition="left",r._dateOptions.clearPosition="right",r.meridians=n.getLocaleDayPeriods(r.selectedLocale,n.FormStyle.Format,n.TranslationWidth.Abbreviated),r.loadNativeDateInput=c.isMobile()&&!r.showcustompicker,r}return h(t,e),Object.defineProperty(t.prototype,"timeZone",{get:function(){return this.inj.get(c.AbstractI18nService).getTimezone(this)},enumerable:!1,configurable:!0}),t.prototype.isDropDownDisplayEnabledOnInput=function(e){return e===w},t.prototype.isDataEntryModeEnabledOnInput=function(e){return e===P},t.prototype.showValidation=function(e,t,n,i){if(n)return console.warn("min max date validation failed ",i),$(e.target).val(t)},t.prototype.resetDisplayInput=function(){$(this.nativeElement).find(".display-input").val("")},t.prototype.validate=function(e){return this.invalidDateTimeFormat?{invalidDateTimeFormat:{valid:!1}}:!_.isUndefined(this.dateNotInRange)&&this.dateNotInRange?{dateNotInRange:{valid:!1}}:!_.isUndefined(this.timeNotInRange)&&this.timeNotInRange?{timeNotInRange:{valid:!1}}:this.show&&this.required?e.value?null:{required:!0}:(this.validateType="",null)},t.prototype.formatValidation=function(e,t,n){var i=this.datepattern||this.timepattern,o=this.timeZone,r=c.getFormattedDate(this.datePipe,e,i,o,null,null,this);if(t=t.trim())if("timestamp"===i){if(!_.isNaN(t)&&_.parseInt(t)!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1}else if(n&&(t=c.getFormattedDate(this.datePipe,t,i,o)),t!==r)return this.invalidDateTimeFormat=!0,this.validateType="incorrectformat",this.invokeOnChange(this.datavalue,void 0,!1),!1;return!0},t.prototype.minDateMaxDateValidationOnInput=function(e,t,n,i){var o=this;if(e){var r=e;e=moment(e).startOf("day").toDate();var a=moment(c.getDateObj(this.mindate)).startOf("day").toDate(),s=moment(c.getDateObj(this.maxdate)).startOf("day").toDate();if(this.mindate&&e<a){var l=this.appLocale.LABEL_MINDATE_VALIDATION_MESSAGE+" "+this.mindate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,a,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="mindate",this.showValidation(t,n,i,l))}if(this.maxdate&&e>s){l=this.appLocale.LABEL_MAXDATE_VALIDATION_MESSAGE+" "+this.maxdate+".";return this.invokeOnChange(this.datavalue,void 0,!1),i&&c.getFormattedDate(this.datePipe,s,this.datepattern,this.timeZone,null,null,this)===n?$(t.target).val(n):(this.dateNotInRange=!0,this.validateType="maxdate",this.showValidation(t,n,i,l))}if(this.excludedates){if((c.isString(this.excludedates)?_.split(this.excludedates,","):this.excludedates).map((function(e){return c.getFormattedDate(o.datePipe,e,o.datepattern,o.timeZone,null,null,o)})).indexOf(c.getFormattedDate(this.datePipe,r,this.datepattern,this.timeZone,null,null,this))>-1)return this.dateNotInRange=!0,this.validateType="excludedates",void this.invokeOnChange(this.datavalue,void 0,!1)}if(this.excludedays){var p=_.split(this.excludedays,","),u=_.get(r,"getDay")?r.getDay():r;if(p.indexOf(u.toString())>-1)return this.dateNotInRange=!0,this.validateType="excludedays",void this.invokeOnChange(this.datavalue,void 0,!1)}}i||(this.dateNotInRange=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.hightlightToday=function(){var e=(new Date).getDate().toString();_.filter($("span:contains("+e+")").not(".is-other-month"),(function(t){$(t).text()===e&&$(t).addClass("current-date text-info")}))},t.prototype.isOtheryear=function(e){return 0===e.getMonth()&&11===this.activeDate.getMonth()||11===e.getMonth()&&0===this.activeDate.getMonth()},t.prototype.setActiveDateFocus=function(e,t){var n=this;this.setNextData(e);var i=this.activeDate.getMonth();t||(e.getMonth()<i?this.isOtheryear(e)?this.goToOtherMonthOryear("next","days"):this.goToOtherMonthOryear("previous","days"):e.getMonth()>i&&(this.isOtheryear(e)?this.goToOtherMonthOryear("previous","days"):this.goToOtherMonthOryear("next","days"))),setTimeout((function(){var t=e.getDate().toString();_.filter($("span:contains("+t+")").not(".is-other-month"),(function(i){$(i).text()===t&&($(i).hasClass("selected")&&$(i).parent().attr("aria-selected","true"),$(i).attr("aria-label",moment(e).format("dddd, MMMM Do YYYY")),$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","-1"),$(i).attr("tabindex","0"),$(i).focus(),n.activeDate=e)})),e.getMonth()===(new Date).getMonth()&&e.getFullYear()===(new Date).getFullYear()&&n.hightlightToday()}))},t.prototype.goToOtherMonthOryear=function(e,t){var n=$(".bs-datepicker-head ."+e);n.attr("disabled")||(n.trigger("click"),"days"===t?this.loadDays():"month"===t?this.loadMonths():"year"===t&&this.loadYears())},t.prototype.getMonth=function(e,t){var n=new Date(e),i=n.getMonth(),o=n.getFullYear(),r=new Date(o,i+=t),a=r.toLocaleString("en-US",{month:"long"});return{date:r,fullMonth:a}},t.prototype.addDatepickerMouseEvents=function(){var e=this,t=$(".bs-datepicker-head");t.find(".previous").click((function(t){e.next=e.getMonth(e.activeDate,0),e.prev=e.getMonth(e.activeDate,-2),e.clicked=!0,t.originalEvent&&e.setFocusForDate(-1),setTimeout((function(){$(".bs-datepicker-head .previous").focus()}))})),t.find(".next").click((function(t){e.next=e.getMonth(e.activeDate,2),e.prev=e.getMonth(e.activeDate,0),e.clicked=!0,t.originalEvent&&e.setFocusForDate(1),setTimeout((function(){$(".bs-datepicker-head .next").focus()}))})),t.find(".current").click((function(t){t.originalEvent&&e.setFocusForCurrentMonthOryear()})),$(".bs-datepicker-body, .bs-datepicker-action-buttons").click((function(t){t.stopPropagation(),t.originalEvent&&e.setFocusForMonthOrDay()})),t.find(".next").attr("aria-label","Next Month, "+this.next.fullMonth+" "+this.next.date.getFullYear()),t.find(".previous").attr("aria-label","Previous Month, "+this.prev.fullMonth+" "+this.prev.date.getFullYear()),setTimeout((function(){var n=t.find(".current span");t.find(".current").attr("aria-live","assertive").attr("aria-atomic","false"),e.clicked&&($(n[0]).text()&&t.find(".ng-star-inserted").prepend('<div class="sr-only">Changed to month </div>'),$(n[1]).text()&&t.find(".current").last().prepend('<div class="sr-only"> and year </div>'))}))},t.prototype.setFocusForMonthOrDay=function(){var e=$(".bs-datepicker-head .current").first().text(),t=$(".bs-datepicker-body");if(t.find("table.months").length>0){_.parseInt(e)!==this.activeDate.getFullYear()&&this.loadMonths();var n=new Date(_.parseInt(e),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.days").length>0){var i=b.indexOf(e);i!==this.activeDate.getMonth()&&this.loadDays();n=new Date(this.activeDate.getFullYear(),i,1);this.setActiveDateFocus(n,!0)}},t.prototype.setFocusForCurrentMonthOryear=function(){var e=$(".bs-datepicker-body");e.find("table.months").length>0?(this.loadMonths(),this.setActiveMonthFocus(this.activeDate,!0)):e.find("table.years").length>0&&(this.loadYears(),this.setActiveYearFocus(this.activeDate,!0))},t.prototype.setFocusForDate=function(e){var t=$(".bs-datepicker-body");if(t.find("table.months").length>0){this.loadMonths();var n=new Date(this.activeDate.getFullYear()+e,0,this.activeDate.getDate());this.setActiveMonthFocus(n,!0)}else if(t.find("table.years").length>0){this.loadYears();var i=t.find("table.years span").first().text();n=new Date(_.parseInt(i),this.activeDate.getMonth(),this.activeDate.getDate());this.setActiveYearFocus(n,!0)}else if(t.find("table.days").length>0){this.loadDays();n=new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+e,1);this.setActiveDateFocus(n,!0)}},t.prototype.addDatepickerKeyboardEvents=function(e,t){var n=this;this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e;var i=document.querySelector("."+e.dateContainerCls);c.setAttr(i,"tabindex","0"),i.onkeydown=function(e){if("escape"===n.keyEventPluginInstance.getEventFullKey(e)){n.elementScope.hideDatepickerDropdown();var t=n.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return t.focus()}))}},this.loadDays(),this.setActiveDateFocus(this.activeDate)},t.prototype.setNextData=function(e){this.next=this.getMonth(e,1),this.prev=this.getMonth(e,-1)},t.prototype.loadDays=function(){var e=this;setTimeout((function(){$("[bsdatepickerdaydecorator]").not(".is-other-month").attr("tabindex","0"),e.addKeyBoardEventsForDays(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForDays=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-7,"days").toDate(),e.setActiveDateFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"days").toDate(),e.setActiveDateFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"days").toDate(),e.setActiveDateFocus(n);else if("pageup"===i)t.preventDefault(),n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveDateFocus(n);else if("pagedown"===i)t.preventDefault(),n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveDateFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate);else if("enter"===i){if($(document.activeElement).hasClass("disabled"))return;$(document.activeElement).click(),e.elementScope.hideDatepickerDropdown();var o=e.elementScope.nativeElement.querySelector(".display-input");setTimeout((function(){return o.focus()}))}})),this.focusBlurDatePickerHeadButtons()},t.prototype.focusBlurDatePickerHeadButtons=function(){var e=$(".bs-datepicker-head button");e.on("focus",(function(){$(this).css("background-color","#9AA0A3")})),e.on("blur",(function(){$(this).css("background-color","")}))},t.prototype.loadMonths=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForMonths(),e.addDatepickerMouseEvents()}))},t.prototype.addKeyBoardEventsForMonths=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-3,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"month").toDate(),e.setActiveMonthFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"month").toDate(),e.setActiveMonthFocus(n);else if("control.arrowup"===i)$(".bs-datepicker-head .current").first().click(),e.loadYears(),e.setActiveYearFocus(e.activeDate);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadDays();var o=new Date(e.activeDate.getFullYear(),e.activeDate.getMonth(),1);e.setActiveDateFocus(o)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.loadYears=function(){var e=this;setTimeout((function(){e.addKeyBoardEventsForYears(),e.addDatepickerMouseEvents()}))},t.prototype.setActiveMonthFocus=function(e,t){var n=this;this.setNextData(e);var i=b[e.getMonth()];t||(e.getFullYear()<this.activeDate.getFullYear()?this.goToOtherMonthOryear("previous","month"):e.getFullYear()>this.activeDate.getFullYear()&&this.goToOtherMonthOryear("next","month")),setTimeout((function(){$(".bs-datepicker-body table.months span").attr("tabindex","-1"),$(".bs-datepicker-body table.months span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.months span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.addKeyBoardEventsForYears=function(){var e=this;$(".bs-datepicker-body").keydown((function(t){var n,i=e.keyEventPluginInstance.getEventFullKey(t);if("arrowdown"===i)t.preventDefault(),n=moment(e.activeDate).add(4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowup"===i)t.preventDefault(),n=moment(e.activeDate).add(-4,"year").toDate(),e.setActiveYearFocus(n);else if("arrowleft"===i)n=moment(e.activeDate).add(-1,"year").toDate(),e.setActiveYearFocus(n);else if("arrowright"===i)n=moment(e.activeDate).add(1,"year").toDate(),e.setActiveYearFocus(n);else if("control.arrowdown"===i||"enter"===i){if($(document.activeElement).parent().hasClass("disabled"))return;$(document.activeElement).click(),e.loadMonths(),e.setActiveMonthFocus(e.activeDate)}})),this.focusBlurDatePickerHeadButtons()},t.prototype.setActiveYearFocus=function(e,t){var n=this,i=e.getFullYear(),o=$(".bs-datepicker-body table.years span"),r=o.first().text(),a=o.last().text();t||(e.getFullYear()<_.parseInt(r)?this.goToOtherMonthOryear("previous","year"):e.getFullYear()>_.parseInt(a)&&this.goToOtherMonthOryear("next","year")),setTimeout((function(){$(".bs-datepicker-body table.years span").attr("tabindex","-1"),$(".bs-datepicker-body table.years span:contains("+i+")").attr("tabindex","0"),$(".bs-datepicker-body table.years span:contains("+i+")").focus(),n.activeDate=e}))},t.prototype.focusTimePickerPopover=function(e){this.keyEventPluginInstance=e.keyEventPlugin.constructor,this.elementScope=e,this.elementScope.ngZone.runOutsideAngular((function(){setTimeout((function(){$("timepicker .form-group").first().find("> input.form-control").focus()}))}))},t.prototype.bindTimePickerKeyboardEvents=function(){var e=this;setTimeout((function(){var t=$("body").find("> bs-dropdown-container timepicker");t.attr("tabindex",0),e.addEventsOnTimePicker(t)}))},t.prototype.focusOnInputEl=function(){var e=this;$(this.nativeElement).closest(".caption-floating").length>0&&setTimeout((function(){$(e.nativeElement).find(".app-textbox").focus()}),100)},t.prototype.isValidDate=function(e){return e&&e instanceof Date&&!isNaN(e.getTime())},t.prototype.timeFormatValidation=function(){var e=$(this.nativeElement).find("input").val(),t=c.getNativeDateObject(e,{meridians:this.meridians,pattern:this.datepattern});this.formatValidation(t,e)&&(this.invalidDateTimeFormat=!1,this.invokeOnChange(this.datavalue,void 0,!1))},t.prototype.updateTimeValue=function(e,t){var n=this;e.length<2?setTimeout((function(){"minutes"===t?n.bsTimePicker.updateMinutes("00"):n.bsTimePicker.updateSeconds("00")}),500):"minutes"===t?this.bsTimePicker.updateMinutes("00"):this.bsTimePicker.updateSeconds("00")},t.prototype.addEventsOnTimePicker=function(e){var t=this,n=e.find(".bs-timepicker-field");n.first().on("keyup",(function(e){var i=e.target.value;_.forEach(n,(function(n,o){if(e.target!==n&&""===n.value&&i.length){var r=1===o?"minutes":"seconds";t.updateTimeValue(i,r)}}))})),this.removeKeyupListener=function(){n.first().off("keyup")},e.on("keydown",(function(e){var n,i,o=$(e.target),r=o.parent(),a=t.elementScope,s=t.keyEventPluginInstance.getEventFullKey(e);if("escape"===s&&a.hideTimepickerDropdown(),o.hasClass("bs-timepicker-field")){if(r.is(":first-child")?"shift.tab"!==s&&"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):r.is(":last-child")||r.next().next().find("button.disabled").length?"tab"!==s&&"escape"!==s&&"enter"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0):"enter"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus(),n=!0,i=!0),n&&e.stopPropagation(),i&&e.preventDefault(),a.mintime&&a.maxtime&&!t.isValidDate(a.bsTimeValue)&&("arrowdown"===s?a.bsTimeValue=a.maxTime:"arrowup"===s&&(a.bsTimeValue=a.minTime)),"tab"===s){t.invalidDateTimeFormat=!1,t.invokeOnChange(t.datavalue,void 0,!1);var l=t.datepattern||t.timepattern;c.getFormattedDate(a.datePipe,a.bsTimeValue,l,t.timeZone,null,null,t)===a.displayValue&&$(t.nativeElement).find(".display-input").val(a.displayValue)}"arrowdown"!==s&&"arrowup"!==s||t.timeFormatValidation()}else o.hasClass("btn-default")&&("tab"!==s&&"escape"!==s||(a.setIsTimeOpen(!1),t.focus()))})),e.find("a").on("click",(function(e){var n=t.elementScope,i=$(e.target);n.mintime&&n.maxtime&&!t.isValidDate(n.bsTimeValue)&&(i.find("span").hasClass("bs-chevron-down")?n.bsTimeValue=n.maxTime:i.find("span").hasClass("bs-chevron-up")&&(n.bsTimeValue=n.minTime)),t.timeFormatValidation()}))},t.prototype.updateFormat=function(e){"datepattern"===e?(this._dateOptions.dateInputFormat=this.datepattern,this.showseconds=_.includes(this.datepattern,"s"),this.ismeridian=_.includes(this.datepattern,"h")):"timepattern"===e&&(this.showseconds=_.includes(this.timepattern,"s"),this.ismeridian=_.includes(this.timepattern,"h"))},t.prototype.getMobileInput=function(){return this.nativeElement.querySelector(".mobile-input")},t.prototype.onDateTimeInputBlur=function(){var e=this.getMobileInput();if(e&&!c.hasCordova()){for(var t=this.nativeElement.children,n=0;n<t.length;n++)t[n].classList.remove("add-opacity");e.classList.remove("remove-opacity")}},t.prototype.onDateTimeInputFocus=function(e){if(void 0===e&&(e=!1),this.loadNativeDateInput){var t=this.getMobileInput();if(!e||c.hasCordova())t&&this._triggeredByUser&&(t.focus(),t.click());else{for(var n=this.nativeElement.children,i=0;i<n.length;i++)n[i].classList.add("add-opacity");t.classList.add("remove-opacity")}}},t.prototype.getCordovaPluginDatePickerApi=function(){if(c.isIos())return _.get(window,"cordova.wavemaker.datePicker.selectDate")},t.prototype.showDatePickerModal=function(){this.datetimepickerComponent.show()},t.prototype.blurDateInput=function(e){var t=this.nativeElement.querySelector(".display-input");e&&setTimeout((function(){return t.blur()}))},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"datepattern"===t?this.updateFormat(t):"showweeks"===t?this._dateOptions.showWeekNumbers=n:"mindate"===t?(this._dateOptions.minDate=n===y?this.mindate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"maxdate"===t?(this._dateOptions.maxDate=n===y?this.maxdate=new Date:c.getDateObj(n),this.minDateMaxDateValidationOnInput(this.datavalue)):"excludedates"===t||"excludedays"===t?(this.excludedays&&(this.excludedDaysToDisable=_.split(this.excludedays,",").map((function(e){return+e}))),this.excludedates&&(this.excludedDatesToDisable=this.excludedates,c.isString(this.excludedates)&&(this.excludedDatesToDisable=_.split(this.excludedates,",")),this.excludedDatesToDisable=this.excludedDatesToDisable.map((function(e){return c.getDateObj(e)}))),this.minDateMaxDateValidationOnInput(this.datavalue)):"selectfromothermonth"===t?this._dateOptions.selectFromOtherMonth=n:"todaybutton"===t?this._dateOptions.showTodayButton=n:"clearbutton"===t?this._dateOptions.showClearButton=n:"todaybuttonlabel"===t?this._dateOptions.todayButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"clearbuttonlabel"===t?this._dateOptions.clearButtonLabel=this.i18nService.getLocalizedMessage(n)||n:"showcustompicker"===t?this.loadNativeDateInput=c.isMobile()&&!this.showcustompicker:"adaptiveposition"===t?this._dateOptions.adaptivePosition=n:e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.containerTarget=s.getContainerTargetClass(this.nativeElement),this.isReadOnly="undefined"!=this.dataentrymode&&!this.isDataEntryModeEnabledOnInput(this.dataentrymode);var t=this.getMobileInput();t&&setTimeout((function(){t.style.width="100%",t.style.height="100%"}))},t.prototype.ngOnDestroy=function(){this.dateOnShowSubscription&&this.dateOnShowSubscription.unsubscribe(),e.prototype.ngOnDestroy.call(this)},t.prototype.ngOnDetach=function(){var e;null===(e=this.datetimepickerComponent)||void 0===e||e.hideModal()},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t}(p.BaseFormCustomComponent);S.decorators=[{type:t.Directive}],S.ctorParameters=function(){return[{type:t.Injector},null]},S.propDecorators={bsDropdown:[{type:t.ViewChild,args:[r.BsDropdownDirective]}],bsTimePicker:[{type:t.ViewChild,args:[a.TimepickerComponent]}],datetimepickerComponent:[{type:t.ViewChild,args:[g]}]};var E=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["name",s.PROP_STRING],["outputformat",Object.assign({value:"yyyy-MM-dd"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select Date"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",Object.assign({value:!0},s.PROP_BOOLEAN)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",Object.assign({value:!1},s.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),T=function(){s.register("wm-date",E),s.registerFormWidget(c.FormWidgetType.DATE,new Map(E))},R={widgetType:"wm-date",hostClass:"app-date input-group"},A=function(e){function t(t,n,i,o){var r=e.call(this,t,R)||this;return r.cdRef=n,r.appDefaults=i,r.isOpen=!1,r.isEnterPressedOnDateInput=!1,s.styler(r.nativeElement,r),r.keyEventPlugin=o[1],r.dateContainerCls="app-date-"+r.widgetId,r._dateOptions.containerClass="app-date "+r.dateContainerCls,r._dateOptions.showWeekNumbers=!1,r._bsDefaultLoadCheck=!0,r.datepattern=r.appDefaults.dateFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATE),r.updateFormat("datepattern"),r}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsDataValue?this.bsDataValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-dd"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,"yyyy-MM-dd",this.timeZone,null,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsDataValue,this.outputformat,this.timeZone,null,this.isCurrentDate,this)||""},set:function(e){var t=this;"CURRENT_DATE"===e?(setTimeout((function(){t.bsDataValue=t.timeZone?c.getMomentLocaleObject(t.timeZone):new Date}),50),this.isCurrentDate=!0):(this.bsDataValue=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.isCurrentDate=!1),this.invokeOnChange(this.datavalue,void 0,!0),this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.onDisplayDateChange=function(e,t){if(void 0===t&&(t=!1),this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=c.getDateObj(e.target.value,{pattern:this.datepattern,isNativePicker:t});this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||this.setDataValue(n))}},t.prototype.setDataValue=function(e){this.invalidDateTimeFormat=!1,this.minDateMaxDateValidationOnInput(e),c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue),this.bsDataValue=e||void 0,this.invokeOnChange(this.datavalue,{},!0)},t.prototype.onDatePickerOpen=function(){this.isOpen=!0,this.bsDataValue?this.activeDate=this.bsDataValue:this.activeDate=new Date,this.bsDataValue||this.hightlightToday(),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.addDatepickerKeyboardEvents(this,!1),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker),c.adjustContainerRightEdges($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.hideDatepickerDropdown=function(){var e;this.invokeOnTouched(),this.isOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.isEnterPressedOnDateInput=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.blurDateInput(this.isOpen)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput&&(t||this.onDateTimeInputFocus()),"click"===e.type&&(this.invokeEventCallback("click",{$event:e}),this.focusOnInputEl()),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.isOpen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon))if(e.stopPropagation(),"enter"===this.keyEventPlugin.constructor.getEventFullKey(e)){var t=c.getDateObj(e.target.value,{pattern:this.datepattern});e.preventDefault();var n=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,null,this.isCurrentDate,this),i=e.target.value.trim();i&&"timestamp"===this.datepattern?_.isNaN(i)||_.parseInt(i)===n||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):i&&i!==n?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=e.target.value?t:""),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown();else this.hideDatepickerDropdown()},t.prototype.onDateChange=function(e){this._bsDefaultLoadCheck?this._bsDefaultLoadCheck=!1:this.setDataValue(e)},t}(S);A.initializeProps=T(),A.decorators=[{type:t.Component,args:[{selector:"[wmDate]",template:' <input class="form-control app-textbox app-dateinput display-input"\n focus-target\n type="text"\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n [disabled]="disabled || readonly"\n [autofocus]="autofocus"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n (change)="onDisplayDateChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event);">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isOpen"\n #datepicker="bsDatepicker"\n bsDatepicker\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n placement="bottom right"\n [isDisabled]="disabled || readonly"\n [bsValue]="bsDataValue"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n (bsValueChange)="onDateChange($event)">\n</div>\n\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="DATE"\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDataValue"\n (change)="onDateChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event);"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n [attr.aria-label]="displayValue ? \'Change Date\' + displayValue : \'Choose Date\'"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(A,i.NG_VALUE_ACCESSOR,!0),s.provideAs(A,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(A)]}]}],A.ctorParameters=function(){return[{type:t.Injector},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},A.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var C=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["datepattern",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["excludedays",s.PROP_STRING],["excludedates",s.PROP_STRING],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxdate",s.PROP_STRING],["mindate",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"timestamp"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select date time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showbuttonbar",s.PROP_BOOLEAN],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},s.PROP_STRING)],["showweeks",s.PROP_BOOLEAN],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timestamp",s.PROP_STRING],["selectfromothermonth",Object.assign({value:!0},s.PROP_BOOLEAN)],["todaybutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["clearbutton",Object.assign({value:!0},s.PROP_BOOLEAN)],["adaptiveposition",Object.assign({value:!1},s.PROP_BOOLEAN)],["todaybuttonlabel",Object.assign({value:"LABEL_TODAY_DATE"},s.PROP_STRING)],["clearbuttonlabel",Object.assign({value:"LABEL_CLEAR_DATE"},s.PROP_STRING)]]),I=function(){s.register("wm-datetime",C),s.registerFormWidget(c.FormWidgetType.DATETIME,new Map(C)),s.registerFormWidget(c.FormWidgetType.TIMESTAMP,new Map(C))},D={widgetType:"wm-datetime",hostClass:"app-datetime input-group"},N="CURRENT_DATE",x=O,k=function(e){function t(t,n,i,o,r,a){var l=e.call(this,t,D)||this;return l.ngZone=n,l.cdRef=i,l.appDefaults=o,l.isEnterPressedOnDateInput=!1,l.isTimeOpen=!1,l.isDateOpen=!1,l.isCurrentDate=!1,l._debouncedOnChange=_.debounce(l.invokeOnChange,10),l.registerDestroyListener((function(){return l.clearTimeInterval()})),s.styler(l.nativeElement,l),l.app=r,l.keyEventPlugin=a[1],l.dateContainerCls="app-date-"+l.widgetId,l._dateOptions.containerClass="app-date "+l.dateContainerCls,l._dateOptions.showWeekNumbers=!1,l.datepattern=l.appDefaults.dateTimeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.DATETIME),l.updateFormat("datepattern"),l}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.proxyModel?this.proxyModel.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dateInputFormat",{get:function(){return this._dateOptions.dateInputFormat||"yyyy-MM-ddTHH:mm:ss"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.proxyModel,"yyyy-MM-ddTHH:mm:ss",this.timeZone,this.key,this.isCurrentDate,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentDate&&!this.proxyModel?N:c.getFormattedDate(this.datePipe,this.proxyModel,this.outputformat,this.timeZone,null,null,this)},set:function(e){e===N?(this.isCurrentDate=!0,this.setTimeInterval()):(this.proxyModel=e?c.getDateObj(e,{isNativePicker:this.loadNativeDateInput},this.timeZone):void 0,this.clearTimeInterval(),this.isCurrentDate=!1),this.bsTimeValue=this.bsDateValue=this.proxyModel,this.cdRef.detectChanges()},enumerable:!1,configurable:!0}),t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;e.onModelUpdate(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.toggleTimePicker=function(e,t){this.loadNativeDateInput?this.onDateTimeInputFocus():(this.isTimeOpen=e,t&&"click"===t.type&&this.invokeEventCallback("click",{$event:t}),this.addTimepickerClickListener(this.isTimeOpen))},t.prototype.addTimepickerClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterTimepickeEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.toggleTimePicker(!1)}),0,!0)}),350)}},t.prototype.setIsTimeOpen=function(e){this.isTimeOpen=e},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.toggleTimePicker(!1),this.deregisterTimepickeEventListener&&this.deregisterTimepickeEventListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e})},t.prototype.onTimepickerOpen=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.bsDatePickerDirective.hide(),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu")),c.adjustContainerRightEdges($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.onDatePickerOpen=function(){this.isDateOpen=!this.isDateOpen,this.toggleTimePicker(!1),this.$element.find(".model-holder").width("1px"),$("bs-datepicker-container").attr("aria-label","Use Arrow keys to navigate dates, Choose Date from datepicker"),$(".bs-calendar-container").removeAttr("role");var e=$(".bs-datepicker-container")[0];this.focusTrap=s.setFocusTrap(e,!0),this.focusTrap.activate(),this.bsDateValue?this.activeDate=this.bsDateValue:this.activeDate=new Date,this.bsDateValue||this.hightlightToday(),this.addDatepickerKeyboardEvents(this,!0),c.adjustContainerPosition($("bs-datepicker-container"),this.nativeElement,this.bsDatePickerDirective._datepicker)},t.prototype.onModelUpdate=function(e,t){if("date"===t&&(this.invalidDateTimeFormat=!1,c.getFormattedDate(this.datePipe,e,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this)===this.displayValue&&$(this.nativeElement).find(".display-input").val(this.displayValue)),this.minDateMaxDateValidationOnInput(e),!e)return this.bsDateValue&&this.bsTimePicker&&(""===this.bsTimePicker.hours||""===this.bsTimePicker.minutes||""===this.bsTimePicker.seconds)?this.bsDateValue=this.bsTimeValue=this.proxyModel=moment(this.bsDateValue).startOf("day").toDate():this.bsDateValue=this.bsTimeValue=this.proxyModel=void 0,void((e!==this.datavalue||!this.datavalue&&this.prevDatavalue)&&this._debouncedOnChange(this.datavalue,{},!0));"date"===t&&this.isDateOpen&&this.toggleTimePicker(!0),this.proxyModel=e,this.proxyModel&&(this.bsDateValue=this.bsTimeValue=e),this._debouncedOnChange(this.datavalue,{},!0),this.cdRef.detectChanges();var n=$(".bs-timepicker-field");if(this.timeZone&&"datetimestamp"===this.key&&n.length){var i=c.getFormattedDate(this.datePipe,e,this.getTimePattern(),this.timeZone,this.key,null,this);this.updateTimepickerFields(i,n)}},t.prototype.getTimePattern=function(){var e,t=this.datepattern.toLowerCase().indexOf("h"),n=this.datepattern.toLowerCase().indexOf(":ss");(n>-1||(n=this.datepattern.toLowerCase().indexOf(":mm"))>-1)&&(n+=3);var i=this.datepattern.toLowerCase().indexOf("a");return e=this.datepattern.substr(t,n),i>-1&&(e+=" a"),e},t.prototype.updateTimepickerFields=function(e,t){for(var n,i=$("timepicker button.text-center"),o=e.split(" "),r=o[0].split(":"),a=0;a<t.length;a++)t[a].value=r[a];(null===(n=null==i?void 0:i.html())||void 0===n?void 0:n.trim())!==o[1]&&i.text(o[1])},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation()},t.prototype.toggleDpDropdown=function(e,t){void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&(this.invokeEventCallback("click",{$event:e}),this.focusOnInputEl()),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)?e.stopPropagation():(this.bsDatePickerDirective.toggle(),this.addBodyClickListener(this.bsDatePickerDirective.isOpen)))},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=n.querySelector("."+t.dateContainerCls);t.deregisterDatepickerEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.bsDatePickerDirective.hide()}),0,!0)}),350)}},t.prototype.hideDatepickerDropdown=function(){var e;this.isDateOpen=!1,null===(e=this.focusTrap)||void 0===e||e.deactivate(),this.invokeOnTouched(),this.bsDatePickerDirective.hide(),this.bsDateValue&&this.toggleTimePicker(!0),this.isEnterPressedOnDateInput=!1,this.deregisterDatepickerEventListener&&this.deregisterDatepickerEventListener();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t}),this.blurDateInput(this.isDateOpen)},t.prototype.onDateChange=function(e,t){if(this.isEnterPressedOnDateInput)this.isEnterPressedOnDateInput=!1;else{var n=e.target.value.trim();n=n?c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput}):void 0,this.formatValidation(n,e.target.value,t)&&(t&&this.minDateMaxDateValidationOnInput(n,e,this.displayValue,t)||(this.invalidDateTimeFormat=!1,this.onModelUpdate(n)))}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=e.target.value.trim(),n=this.keyEventPlugin.constructor.getEventFullKey(e);if("enter"===n||"arrowdown"===n){t=t?c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians}):void 0,e.preventDefault();var i=c.getFormattedDate(this.datePipe,t,this.dateInputFormat,this.timeZone,this.key,this.isCurrentDate,this),o=e.target.value.trim();o&&"timestamp"===this.datepattern?_.isNaN(o)||_.parseInt(o)===i||(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):o&&o!==i?(this.invalidDateTimeFormat=!0,this.invokeOnChange(this.datavalue,e,!1)):(this.invalidDateTimeFormat=!1,this.isEnterPressedOnDateInput=!0,this.bsDatePickerDirective.bsValue=t),this.toggleDpDropdown(e)}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()}else this.hideDatepickerDropdown(),this.hideTimepickerDropdown()},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{pattern:this.loadNativeDateInput?this.outputformat:this.datepattern,meridians:this.meridians,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("current-date")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t}(S);k.initializeProps=I(),k.decorators=[{type:t.Component,args:[{selector:"[wmDateTime]",template:' <div dropdown\n [isOpen]="isTimeOpen"\n autoClose="false"\n [container]="\'body\'"\n (onShown)="onTimepickerOpen()"\n style="display: inherit;">\n <input class="form-control app-textbox display-input"\n [attr.aria-label]="hint"\n focus-target\n [name]="name"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n type="text"\n [value]="displayValue"\n (click)="toggleDpDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDateChange($event)"\n [autofocus]="autofocus"\n [disabled]="disabled || readonly || isCurrentDate"\n [required]="required"\n [readOnly]="isReadOnly"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n\n <span class="input-group-btn">\n <button type="button"\n class="btn btn-default btn-date"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n [attr.aria-label]="displayValue ? \'Change Date \' + displayValue : \'Choose date by pressing enter\'"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleDpDropdown($event, false)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-calendar"></i>\n </button>\n <button type="button"\n class="btn btn-default btn-time"\n [tabindex]="loadNativeDateInput ? \'-1\' : tabindex"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [disabled]="disabled || readonly || isCurrentDate"\n aria-label="Select time"\n aria-haspopup="true"\n aria-expanded="false"\n (click)="toggleTimePicker(!isTimeOpen, $event)">\n <i aria-hidden="true"\n class="app-icon wm-sl-l sl-time"></i>\n </button>\n </span>\n <div style="width: 0;display: inline-block;">\n <input class="model-holder"\n aria-label="datepicker dropdownmenu"\n aria-controls="date"\n focus-target\n [tabindex]="-1"\n [attr.aria-hidden]="!!loadNativeDateInput"\n [container]="containerTarget || \'body\'"\n [bsConfig]="_dateOptions"\n [isOpen]="isDateOpen"\n placement="bottom right"\n (onShown)="onDatePickerOpen()"\n (onHidden)="hideDatepickerDropdown()"\n [daysDisabled]="excludedDaysToDisable"\n [datesDisabled]="excludedDatesToDisable"\n #datepicker=bsDatepicker\n bsDatepicker\n [isDisabled]="disabled || readonly || isCurrentDate"\n [bsValue]="bsDateValue"\n (bsValueChange)="onModelUpdate($event, \'date\')">\n </div>\n <div *dropdownMenu\n class="dropdown-menu"\n aria-label="timepicker dropdown"\n aria-controls="time"\n (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="disabled || readonly || isCurrentDate"\n [(ngModel)]="bsTimeValue"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds"\n (ngModelChange)="onModelUpdate($event, \'time\')"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n [config]="_dateOptions"\n [placement]="modal"\n [excludedDaysToDisable]="excludedDaysToDisable"\n [excludedDatesToDisable]="excludedDatesToDisable"\n [displayFormat]="dateInputFormat"\n [value]="bsDateValue"\n (change)="onModelUpdate($event, \'date\')">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n [tabindex]="tabindex || 0"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event)"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentDate) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(k,i.NG_VALUE_ACCESSOR,!0),s.provideAs(k,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(k),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:x}]}]}],k.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]},k.propDecorators={bsDatePickerDirective:[{type:t.ViewChild,args:[o.BsDatepickerDirective]}]};var M=new Map([["autofocus",s.PROP_BOOLEAN],["class",s.PROP_STRING],["dataentrymode",Object.assign({value:"default"},s.PROP_STRING)],["datavaluesource",s.PROP_ANY],["datavalue",s.PROP_STRING],["disabled",s.PROP_BOOLEAN],["hint",s.PROP_STRING],["hourstep",Object.assign({value:1},s.PROP_NUMBER)],["maxtime",s.PROP_STRING],["mintime",s.PROP_STRING],["minutestep",Object.assign({value:15},s.PROP_NUMBER)],["name",s.PROP_STRING],["outputformat",Object.assign({value:"HH:mm:ss"},s.PROP_STRING)],["placeholder",Object.assign({value:"Select time"},s.PROP_STRING)],["readonly",s.PROP_BOOLEAN],["required",s.PROP_BOOLEAN],["shortcutkey",s.PROP_STRING],["show",Object.assign({value:!0},s.PROP_BOOLEAN)],["showdropdownon",Object.assign({value:"default"},s.PROP_STRING)],["showcustompicker",Object.assign({value:!1},s.PROP_BOOLEAN)],["secondsstep",Object.assign({value:1},s.PROP_NUMBER)],["tabindex",Object.assign({value:0},s.PROP_NUMBER)],["timepattern",s.PROP_STRING],["timestamp",s.PROP_STRING]]),L=function(){s.register("wm-time",M),s.registerFormWidget(c.FormWidgetType.TIME,new Map(M))},F="CURRENT_TIME",j={widgetType:"wm-time",hostClass:"input-group app-timeinput"},B=O,G=function(e){function t(t,n,i,o,r){var a=e.call(this,t,j)||this;return a.ngZone=n,a.appDefaults=i,a.status={isopen:!1},a.keyEventPlugin=r[1],s.styler(a.nativeElement,a),a.registerDestroyListener((function(){return a.clearTimeInterval()})),a.timepattern=a.appDefaults.timeFormat||c.getDisplayDateTimeFormat(c.FormWidgetType.TIME),a.updateFormat("timepattern"),a.app=o,a}return h(t,e),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.bsTimeValue?this.bsTimeValue.valueOf():void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.isCurrentTime&&!this.bsTimeValue?F:c.getFormattedDate(this.datePipe,this.bsTimeValue,this.outputformat,this.timeZone,null,null,this)||""},set:function(e){e?e===F?(this.isCurrentTime=!0,this.setTimeInterval()):(this.clearTimeInterval(),this.bsTimeValue=c.getNativeDateObject(e,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.isCurrentTime=!1,this.mintimeMaxtimeValidation()):(this.bsTimeValue=void 0,this.clearTimeInterval(),this.isCurrentTime=!1),this.invokeOnChange(this.datavalue),c.$appDigest()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,this.timepattern,this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nativeDisplayValue",{get:function(){return c.getFormattedDate(this.datePipe,this.bsTimeValue,"HH:mm:ss",this.timeZone,null,null,this)||""},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("timepattern"===t&&this.updateFormat("timepattern"),"mintime"===t?(this.minTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):"maxtime"===t?(this.maxTime=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.mintimeMaxtimeValidation()):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.setValidateType=function(e,t,n){this.timeNotInRange&&(n<e?this.validateType="mintime":n>t&&(this.validateType="maxtime"))},t.prototype.mintimeMaxtimeValidation=function(){this.timeNotInRange=this.minTime&&this.maxTime&&(this.bsTimeValue<this.minTime||this.bsTimeValue>this.maxTime),this.setValidateType(this.minTime,this.maxTime,this.bsTimeValue),this.invokeOnChange(this.datavalue,void 0,!1)},t.prototype.toggleDropdown=function(e,t){var n=this;void 0===t&&(t=!1),this.loadNativeDateInput?t||this.onDateTimeInputFocus():("click"===e.type&&(this.invokeEventCallback("click",{$event:e}),this.focusOnInputEl()),e.target&&$(e.target).is("input")&&!this.isDropDownDisplayEnabledOnInput(this.showdropdownon)||(this.ngZone.run((function(){n.status.isopen=!n.status.isopen})),this.addBodyClickListener(this.status.isopen)))},t.prototype.preventTpClose=function(e){e.stopImmediatePropagation();var t=$(this.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:t})},t.prototype.addBodyClickListener=function(e){var t=this;if(e){var n=document.querySelector("body");setTimeout((function(){var e=$(n).find(">bs-dropdown-container .dropdown-menu").get(0);t.deregisterEventListener=c.addEventListenerOnElement(n,e,t.nativeElement,"click",t.isDropDownDisplayEnabledOnInput(t.showdropdownon),(function(){t.status.isopen=!1}),0,!0)}),350)}},t.prototype.onDisplayKeydown=function(e){if(this.isDropDownDisplayEnabledOnInput(this.showdropdownon)){e.stopPropagation();var t=this.keyEventPlugin.constructor.getEventFullKey(e);"enter"===t||"arrowdown"===t?(e.preventDefault(),this.toggleDropdown(e)):this.hideTimepickerDropdown()}else this.hideTimepickerDropdown()},t.prototype.onDisplayTimeChange=function(e){var t=c.getNativeDateObject(e.target.value,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});this.formatValidation(t,e.target.value)&&(this.invalidDateTimeFormat=!1,this.onTimeChange(t))},t.prototype.onInputBlur=function(e){$(e.relatedTarget).hasClass("bs-timepicker-field")||(this.invokeOnTouched(),this.invokeEventCallback("blur",{$event:e}))},t.prototype.onTimeChange=function(e,t){var n,i,o;t&&(e=c.getNativeDateObject(e.target.value,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput})),e?(this.bsTimeValue=e,this.timeNotInRange=this.minTime&&this.maxTime&&(e<this.minTime||e>this.maxTime),this.setValidateType(this.minTime,this.maxTime,e)):(this.bsTimePicker&&this.bsTimePicker.min&&this.bsTimePicker.max&&(o=moment(new Date(this.bsTimePicker.min)).format("A"),moment(new Date(this.bsTimePicker.max)).format("A"),n=this.bsTimePicker.hours+":"+(this.bsTimePicker.minutes||0)+":"+(this.bsTimePicker.seconds||0)+(this.bsTimePicker.showMeridian?" "+o:""),i=c.getNativeDateObject(n,{pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput}),this.bsTimePicker.meridian=o,this.timeNotInRange=this.bsTimePicker.min>i||this.bsTimePicker.max<i,this.setValidateType(this.bsTimePicker.min,this.bsTimePicker.max,i)),this.bsTimeValue=i),this.invokeOnTouched(),this.invokeOnChange(this.datavalue,{},!0)},t.prototype.setTimeInterval=function(){var e=this;this.timeinterval||(this.timeinterval=setInterval((function(){var t=e.timeZone?c.getMomentLocaleObject(e.timeZone):new Date;t.setSeconds(t.getSeconds()+1),e.datavalue=F,e.onTimeChange(t)}),1e3))},t.prototype.clearTimeInterval=function(){this.timeinterval&&(clearInterval(this.timeinterval),this.timeinterval=null)},t.prototype.setIsTimeOpen=function(e){this.status.isopen=e},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","focus","change","click"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.hideTimepickerDropdown=function(){this.invokeOnTouched(),this.status.isopen=!1,this.deregisterEventListener&&this.deregisterEventListener(),this.removeKeyupListener();var e=$(this.nativeElement).closest(".app-composite-widget.caption-floating");e.length>0&&this.app.notify("captionPositionAnimate",{displayVal:this.displayValue,nativeEl:e}),this.blurDateInput(!0)},t.prototype.isValid=function(e){if(!e){var t=$(this.nativeElement).find("input").val(),n=c.getNativeDateObject(t,{meridians:this.meridians,pattern:this.loadNativeDateInput?this.outputformat:void 0,isNativePicker:this.loadNativeDateInput});if(!this.formatValidation(n,t))return}},t.prototype.onShown=function(){var e=document.querySelectorAll("timepicker");_.forEach(e,(function(e){c.addClass(e.parentElement,"app-datetime",!0)})),this.focusTimePickerPopover(this),this.bindTimePickerKeyboardEvents(),c.adjustContainerPosition($("bs-dropdown-container"),this.nativeElement,this.bsDropdown._dropdown,$("bs-dropdown-container .dropdown-menu"))},t.prototype.assignModel=function(){this.displayInputElem||(this.displayInputElem=this.getMobileInput()),this.displayInputElem.value=_.get(this,"nativeDisplayValue")},t}(S);G.initializeProps=L(),G.decorators=[{type:t.Component,args:[{selector:"[wmTime]",template:' <div dropdown [isOpen]="status.isopen" (onShown)="onShown()" (onHidden)="hideTimepickerDropdown()" [container]="\'body\'" style="display: inherit">\n <input class="form-control app-textbox display-input" [attr.aria-label]="hint"\n focus-target\n [tabindex]="tabindex"\n [name]="name"\n type="text"\n role="timer"\n [value]="displayValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [autofocus]="autofocus"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-atomic]="isCurrentTime ? \'true\' : \'false\'"\n [required]="required"\n [readOnly]="isReadOnly"\n (click)="toggleDropdown($event, true)"\n (focus)="onDateTimeInputFocus(); invokeOnFocus($event);"\n (blur)="onInputBlur($event)"\n (change)="onDisplayTimeChange($event)"\n (keydown)="this._triggeredByUser = true; onDisplayKeydown($event)">\n <span class="input-group-btn dropdown-toggle">\n <button type="button" class="btn btn-default btn-date" [tabindex]="tabindex" [disabled]="disabled || readonly || isCurrentTime" aria-label="Select time" aria-haspopup="true" aria-expanded="false" (click)="toggleDropdown($event, false)"><i aria-hidden="true" class="app-icon wm-sl-l sl-time"></i></button>\n </span>\n <div *dropdownMenu class="dropdown-menu" (click)="preventTpClose($event)">\n <timepicker class="model-holder"\n [showMeridian]="ismeridian"\n [readonlyInput]="isDisabled"\n [(ngModel)]="bsTimeValue"\n [disabled]="disabled || readonly || isCurrentTime"\n [min]="minTime"\n [max]="maxTime"\n [hourStep]="hourstep"\n [minuteStep]="minutestep"\n [secondsStep]="secondsstep"\n [mousewheel]="true"\n [arrowkeys]="true"\n (isValid)="isValid($event)"\n [showSeconds]="showseconds" (ngModelChange)="onTimeChange($event)"></timepicker>\n </div>\n </div>\n<ng-template [ngIf]="loadNativeDateInput">\n <wm-datetimepicker\n dateTimePicker\n mode="TIME"\n [minTime]="minTime"\n [maxTime]="maxTime"\n [placement]="modal"\n [displayFormat]="timepattern"\n [value]="bsTimeValue"\n (change)="onTimeChange($event)">\n </wm-datetimepicker>\n <div class="mobile-input mobile-datepicker-container"\n tabindex="1000000"\n (focus)="onDateTimeInputFocus(true); invokeOnFocus($event); assignModel()"\n (blur)="onDateTimeInputBlur(); invokeOnTouched($event)"\n (click)="!(disabled || readonly || isCurrentTime) && showDatePickerModal()">\n </div>\n</ng-template>\n',providers:[s.provideAs(G,i.NG_VALUE_ACCESSOR,!0),s.provideAs(G,i.NG_VALIDATORS,!0),s.provideAsWidgetRef(G),{provide:a.TimepickerConfig,deps:[c.AbstractI18nService],useFactory:B}]}]}],G.ctorParameters=function(){return[{type:t.Injector},{type:t.NgZone},{type:c.AppDefaults},{type:c.App},{type:void 0,decorators:[{type:t.Inject,args:[l.EVENT_MANAGER_PLUGINS]}]}]};var V=function(){};V.decorators=[{type:t.Component,args:[{selector:"wm-pickergroup",template:'\n <div class="app-picker-group">\n <ng-content></ng-content>\n </div>\n '}]}];var U=function(){function e(e){this.inj=e,this.change=new t.EventEmitter,this._selectedIndex=0,this._options=[],this.noOfEmptyElements=2,this.$el=$(e.get(t.ElementRef).nativeElement)}return Object.defineProperty(e.prototype,"selectedValue",{get:function(){return this._selectedValue},set:function(e){this._selectedValue=e,this.reRender()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(e){this._options=e.map((function(e){return{label:e.label,value:void 0!==e.value?e.value:e.label}})),this.reRender()},enumerable:!1,configurable:!0}),e.prototype.reRender=function(){var e,t=this;this._selectedIndex=this.options.findIndex((function(e){return e.value===t.selectedValue})),null===(e=this.pickerAnimator)||void 0===e||e.select(this._selectedIndex+this.noOfEmptyElements)},Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){this._selectedIndex=e,this._selectedValue=this.options[e].value,this.change.emit(this.options[e])},enumerable:!1,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.pickerAnimator=new W(this)},e}();U.decorators=[{type:t.Component,args:[{selector:"wm-picker",template:'\n <div class="app-picker">\n <div class="app-picker-option-container">\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div *ngFor="let option of options; index as i;" class="app-picker-option">\n {{option.label}}\n </div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n <div class="app-picker-option app-picker-empty-option">E</div>\n </div>\n <div class="app-picker-ruler"></div>\n </div>\n '}]}],U.ctorParameters=function(){return[{type:t.Injector}]},U.propDecorators={change:[{type:t.Output}],selectedValue:[{type:t.Input}],options:[{type:t.Input}]};var W=function(){function e(e){var t=this;this.picker=e;var n=e.selectedIndex+e.noOfEmptyElements,i=function(e){return n+Math.floor(e/16)};this.select(n),this.getElement().swipey({direction:$.fn.swipey.DIRECTIONS.VERTICAL,threshold:10,target:e.$el,onSwipe:function(e,n){t.select(i(-1*n.length))},onSwipeEnd:function(o,r){var a=i(-1*r.length);t.select(a),n=e.selectedIndex+e.noOfEmptyElements}})}return e.prototype.getElement=function(){return this.picker.$el.find(".app-picker-option-container:first")},e.prototype.getOptionElements=function(){return this.getElement().find(".app-picker-option")},e.prototype.select=function(e){var t=this.getOptionElements();if(!(e<this.picker.noOfEmptyElements||e>=t.length-this.picker.noOfEmptyElements)){this.getElement().find(".app-picker-option.app-picker-option-selected").removeClass("app-picker-option-selected"),t.eq(e).addClass("app-picker-option-selected"),this.picker.selectedIndex=e-this.picker.noOfEmptyElements;var n=e-this.picker.noOfEmptyElements,i=e+this.picker.noOfEmptyElements;t.each((function(t,o){if(t>=n&&t<=i){var r=30*(t-e),a=1-.3*Math.abs(t-e);$(o).css({transform:"perspective(500px) rotateX("+r+"deg)",opacity:a}).show()}else $(o).hide()}))}},e}(),q=[A,k,G,g,v,U,V],z=function(){};z.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,o.BsDatepickerModule,r.BsDropdownModule,i.FormsModule,a.TimepickerModule,s.WmComponentsModule],declarations:f([],m(q)),exports:f([],m(q)),entryComponents:[]}]}],e.DateComponent=A,e.DatetimeComponent=k,e.EpochModule=z,e.TimeComponent=G,e["\u02750"]=x,e["\u0275a"]=O,e["\u0275b"]=S,e["\u0275c"]=g,e["\u0275d"]=v,e["\u0275e"]=T,e["\u0275f"]=I,e["\u0275g"]=L,e["\u0275h"]=V,e["\u0275i"]=U,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("rxjs"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/input/file-upload",["exports","@angular/core","@angular/common","@wm/components/base","rxjs","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.input=e.wm.components.input||{},e.wm.components.input.fileupload={}),e.ng.core,e.ng.common,e.wm.components.base,e.rxjs,e.wm.core)}(this,(function(e,t,n,i,o,r){"use strict";
198
198
  /*! *****************************************************************************
199
199
  Copyright (c) Microsoft Corporation.
200
200
 
@@ -545,7 +545,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
545
545
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
546
546
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
547
547
  PERFORMANCE OF THIS SOFTWARE.
548
- ***************************************************************************** */var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function g(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function v(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function b(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var w=new Map([["autocomplete",Object.assign({value:!1},i.PROP_BOOLEAN)],["captionalign",Object.assign({value:"left"},i.PROP_STRING)],["captionposition",Object.assign({value:"left"},i.PROP_STRING)],["captionsize",i.PROP_STRING],["captionwidth",Object.assign({value:"xs-12 sm-3 md-3 lg-3"},i.PROP_STRING)],["class",i.PROP_STRING],["collapsible",i.PROP_BOOLEAN],["dataset",i.PROP_ANY],["datasource",i.PROP_STRING],["expanded",Object.assign({value:!0},i.PROP_BOOLEAN)],["formdatasource",i.PROP_STRING],["name",i.PROP_STRING],["numberOfFields",i.PROP_NUMBER],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},i.PROP_STRING)],["subheading",i.PROP_STRING],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["title",i.PROP_STRING]]),P=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("action",i.PROP_STRING),e.set("defaultmode",Object.assign({value:"Edit"},i.PROP_STRING)),e.set("metadata",i.PROP_STRING),e.set("method",i.PROP_STRING),e.set("postmessage",Object.assign({value:"Data posted successfully"},i.PROP_STRING)),e.set("target",i.PROP_STRING),e.set("enctype",i.PROP_STRING),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Inline"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-form",e)},O=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("defaultmode",Object.assign({value:"View"},i.PROP_STRING)),e.set("formlayout",Object.assign({value:"inline"},i.PROP_STRING)),e.set("insertmessage",Object.assign({value:"Record added successfully"},i.PROP_STRING)),e.set("updatemessage",Object.assign({value:"Record updated successfully"},i.PROP_STRING)),e.set("deletemessage",Object.assign({value:"Record deleted successfully"},i.PROP_STRING)),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Toaster"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-liveform",e)},S=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("autoupdate",i.PROP_BOOLEAN),e.set("enableemptyfilter",Object.assign({value:" "},i.PROP_STRING)),e.set("pagesize",Object.assign({value:20},i.PROP_NUMBER)),e.set("iconclass",Object.assign({value:"wi wi-filter-list"},i.PROP_STRING)),i.register("wm-livefilter",e)},E={widgetType:"wm-form",hostClass:"panel app-panel app-form"},T={widgetType:"wm-form",hostClass:"app-form app-login-form"},R={widgetType:"wm-liveform",hostClass:"panel app-panel app-liveform liveform-inline"},A={widgetType:"wm-livefilter",hostClass:"panel app-panel app-livefilter clearfix liveform-inline"},C=function(e,t,n){var i=E;return null!==e?i=R:null!==t?i=A:"app-login"===n&&(i=T),i},I=function(e,t){var n="";return _.forEach(e,(function(e,t){n=n+" "+t+'="'+e+'"'})),'<wm-gridcolumn columnwidth="'+t+'">\n <wm-form-field '+n+"></wm-form-field>\n </wm-gridcolumn>"},D=function(e,t){var n=e.find("form.ng-invalid:visible, [formControlName].ng-invalid:visible").first(),i=t;return n.is("form")&&(i=t&&t.controls[n.attr("formControlName")||n.attr("name")])?D(n,i):{ngForm:i,$ele:n}},N=function(e,t,n){var i,o;if(!t.valid)if(t.controls)_.forEach(t.controls,(function(t,n){N(e,t,n)}));else{var r=e.$element.find('[wmformfield][key="'+n+'"]');r.length&&(r[0].setAttribute("__errormsg",r[0].getAttribute("__validationId")),null===(i=r[0].querySelector("input"))||void 0===i||i.setAttribute("aria-invalid",t.invalid),null===(o=r[0].querySelector("input"))||void 0===o||o.setAttribute("aria-describedby",r[0].getAttribute("__validationId"))),t.markAsTouched()}},x=function(e){function t(t,n,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w,P,O){var S=e.call(this,t,C(y,b,w))||this;S.fb=n,S.app=o,S.dialogService=r,S.dynamicComponentProvider=a,S.ngZone=s,S.parentList=c,S.parentForm=p,S.parentPrefab=u,S.parentPartial=d,S.onBeforeSubmitEvt=h,S.onSubmitEvt=m,S.onBeforeRenderEvt=f,S.binddataset=g,S.bindformdata=v,S._widgetClass="",S._captionClass="",S.formFields=[],S.formfields={},S.formWidgets={},S.filterWidgets={},S.buttonArray=[],S.dataoutput={},S.formdata={},S.statusMessage={caption:"",type:""},S.primaryKey=[],S._debouncedUpdateFieldSource=_.debounce(S.updateFieldSource,350),S.validationMessages=[],S._debouncedSubmitForm=l.debounce((function(e){S.ngZone.run((function(){S.submitForm(e)}))}),250),i.styler(S.nativeElement,S),l.removeAttr(S.nativeElement,"title"),S.isUpdateMode=!0,S.dialogId=S.nativeElement.getAttribute("dialogId"),S.ngform=n.group({}),S.bindingValue=P||O;var E=S.ngform.valueChanges.subscribe(S.updateDataOutput.bind(S));return S.registerDestroyListener((function(){return E.unsubscribe()})),S.elScope=S,S.addEventsToContext(S.context),S}return f(t,e),Object.defineProperty(t.prototype,"isLayoutDialog",{get:function(){return this._isLayoutDialog},set:function(e){e&&l.removeClass(this.nativeElement,"panel app-panel liveform-inline"),this._isLayoutDialog=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUpdateMode",{get:function(){return this._isUpdateMode},set:function(e){this._isUpdateMode=e,this.formFields.forEach((function(t){t.setReadOnlyState(e)}))},enumerable:!1,configurable:!0}),t.prototype.submit=function(e){this._debouncedSubmitForm(e)},t.prototype.onReset=function(){this.reset()},t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},Object.defineProperty(t.prototype,"parentFormArray",{get:function(){return this.parentForm&&this.isParentList&&this.parentForm.ngform.get(this.parentList.name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isParentList",{get:function(){if(this.parentList&&this.parentForm&&!l.isDefined(this._formIsInList)){var e=this.$element.closest('.app-livelist[name="'+this.parentList.name+'"]');e.length&&(this._formIsInList=!e.find('form[widget-id="'+this.parentForm.widgetId+'"]').length)}return l.isDefined(this._formIsInList)?this._formIsInList:this.parentList},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){e.componentRefs.forEach((function(t){t.name&&(e.formWidgets[t.name]=t)}))}),250)},t.prototype.ngAfterViewInit=function(){this.parentForm&&this.parentForm.ngform&&this.isParentList&&(_.get(this.parentForm.ngform.controls,this.parentList.name)||this.parentForm.ngform.setControl(this.parentList.name,new s.FormArray([])),this.parentFormArray.push(this.ngform),this.formArrayIndex=this.parentFormArray.length-1),this.addInnerNgFormToForm(this.bindingValue)},t.prototype.findOperationType=function(){},t.prototype.addInnerNgFormToForm=function(e){if(this.parentForm&&this.parentForm.ngform){if(this.isParentList)return;var t=this.parentPrefab||this.parentPartial;if(t){var n=(this.parentPrefab?t.$element.find("[wmprefabcontainer]"):t.$element).find("form").first();_.get(n[0],"widget.widgetId")===this.widgetId&&(n.isParentList||n.siblings("form").length||(e=_.get(t,"name")))}for(var i=1,o=e;this.parentForm.ngform.controls.hasOwnProperty(o);)o=e+"_"+i,i++;this.formGroupName=o,this.parentForm.ngform.addControl(o,this.ngform)}},t.prototype.addEventsToContext=function(e){var t=this;e.cancel=function(){return t.cancel()},e.reset=function(){return t.reset()},e.save=function(e){return t.save(e)},e.saveAndNew=function(){return t.saveAndNew()},e.saveAndView=function(){return t.saveAndView()},e.delete=function(){return t.delete()},e.new=function(){return t.new()},e.edit=function(){return t.edit()},e.highlightInvalidFields=function(){return t.highlightInvalidFields()},e.filter=function(){return t.filter()},e.clearFilter=function(){return t.clearFilter()},e.submit=function(e){return t.submit(e)}},t.prototype.setValidationOnInnerForms=function(e){var t=this,n=this.getNativeElement().querySelectorAll(".app-form");_.forEach(n,(function(n){var i=n.widget,o=_.get(i,"formGroupName")||i.name;l.isDefined(i.formArrayIndex)&&(o=o+"["+i.formArrayIndex+"]");for(var r=i;_.get(r,"parentForm");){var a=r.parentForm.formGroupName||r.parentForm.name;r.parentForm.parentFormArray&&(a=a+"["+r.parentForm.formArrayIndex+"]"),o=a+"."+o,r=r.parentForm}t.setValidationOnFields(i,o,e)}))},t.prototype.setValidationOnFields=function(e,t,n){var i=this,o=e.ngform.controls,r=e.formFields;r&&_.forEach(o,(function(o,a){var s,l=r.find((function(e){return e.key===a}));!l||n&&!o.touched||(null===(s=l.nativeElement.querySelector("input"))||void 0===s||s.setAttribute("aria-invalid",o.invalid),i.prepareValidationObj(o,a,l,t),i.prepareValidationObj.call(e,o,a,l,t))}))},t.prototype.prepareValidationObj=function(e,t,n,i){var o=this.validationMessages.findIndex((function(e){return e.field===t&&e.fullyQualifiedFormName===i}));e.invalid?-1===o?this.validationMessages.push({field:t,value:n.value,errorType:_.keys(e.errors),message:n.validationmessage||"",getElement:function(){return n.$element.find("[focus-target]")},formName:_.last(i.split(".")),fullyQualifiedFormName:i}):(this.validationMessages[o].value=n.value,this.validationMessages[o].errorType=_.keys(e.errors)):e.valid&&o>-1&&this.validationMessages.splice(o,1)},t.prototype.setValidationMsgs=function(e){!this.formFields.length&&_.isEmpty(this.ngform.controls)||(this.setValidationOnFields(this,this.name,e),this.setValidationOnInnerForms(e))},t.prototype.handleEvent=function(t,n,i,o){"submit"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.updateFieldSource=function(){var e=this;this.formdatasource&&this.formdatasource.execute(l.DataSource.Operation.IS_API_AWARE)||this.formdatasource&&!this.formdatasource.twoWayBinding||this.formFields.forEach((function(t){t.setFormWidget("datavaluesource",e.formdatasource),t.setFormWidget("binddatavalue",e.bindformdata+"."+t.key)}))},t.prototype.highlightInvalidFields=function(){N(this,this.ngform,"")},t.prototype.validateFieldsOnSubmit=function(){if(this.setValidationMsgs(),"delete"!==this.operationType&&("html"===this.validationtype||"default"===this.validationtype)&&this.ngform&&this.ngform.invalid){if(this.ngform.invalid){"default"===this.validationtype&&this.highlightInvalidFields();var e=D(this.$element,this.ngform),t=e.ngForm,n=e.$ele;if((n=n.parent().find("[focus-target]")).length){n.hasClass("app-search-input")||n.focus();var i=t&&t.controls[n.attr("formControlName")||n.attr("name")];return i&&i.markAsTouched&&i.markAsTouched(),l.$appDigest(),!0}return!0}return!1}return!1},t.prototype.onPropertyChange=function(t,n,i){switch(t){case"captionalign":this.captionAlignClass="align-"+n;break;case"captionposition":case"captionwidth":this.setLayoutConfig();break;case"captionsize":this.captionsize=n;break;case"novalidate":this.widget.validationtype=!0===n||"true"===n?"none":"default";break;case"formdata":if(_.isEqual(n,i))break;_.isArray(n)?this.setFormData(_.last(n)):this.setFormData(n),!this.isDataSourceUpdated&&this.datasource&&this.onDataSourceChange();break;case"defaultmode":this.isLayoutDialog||(this.updateMode=!(!n||"Edit"!==n),this.isUpdateMode=this.updateMode);break;case"datasource":this.onDataSourceChange();break;case"formdatasource":this.onFormDataSourceChange();break;case"metadata":this.generateFormFields();break;case"dataset":this.getFormFields().forEach((function(e){!e.isDataSetBound&&_.get(e.formWidget,"dataset$")&&e.formWidget.dataset$.next()}));break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onResultCb=function(e,t,n){var i={$event:n,$data:e,$operation:this.operationType};this.invokeEventCallback("result",i),t?this.invokeEventCallback("success",i):this.invokeEventCallback("error",i)},t.prototype.toggleMessage=function(e,t,n,i){var o;e&&t?(o="error"===n&&this.errormessage?this.errormessage:t,"Inline"===this.messagelayout?(o=this.checkAppServiceErrorMsg(n)||o,this.statusMessage={caption:o||"",type:n},this.messageRef&&this.messageRef.showMessage(this.statusMessage.caption,this.statusMessage.type),l.isElementInViewport(this.$element[0])||l.scrollToElement(this.$element[0])):this.app.notifyApp(o,n,i)):this.statusMessage.caption=""},t.prototype.checkAppServiceErrorMsg=function(e){var t=_.get(this.app,"Actions.appNotification");if(t&&"error"===e)return t.getMessage()},t.prototype.clearMessage=function(){this.toggleMessage(!1)},t.prototype.setLayoutConfig=function(){var e;e=i.getFieldLayoutConfig(this.captionwidth,this.captionposition,_.get(this.app.selectedViewPort,"os")),this._widgetClass=e.widgetCls,this._captionClass=e.captionCls,l.$appDigest()},t.prototype.registerFormWidget=function(e){var t=e.name||e.key;this.formWidgets[t]=e},t.prototype.registerFormFields=function(e){var t=this.formFields.push(e);this.formfields[e.key]=e,this.registerFormWidget(e),this._debouncedUpdateFieldSource(),this.parentForm&&(this.parentForm.formFields.push(e),this.parentForm.formfields[e.key]=e,this.parentForm.setFormData(this.parentForm.formdata,this.formFields,this.formdata||{})),t!==this.numberOfFields||_.isEmpty(this.formdata)||(this.onDataSourceChange(),_.isArray(this.formdata)?this.setFormData(_.last(this.formdata)):this.setFormData(this.formdata))},t.prototype.registerActions=function(e){this.buttonArray.push(e)},t.prototype.updateFormDataOutput=function(e){var t=this;_.forEach(this.ngform.value,(function(n,i){_.find(t.formFields,{key:i})||(e[i]=n)})),this.dataoutput=e},t.prototype.constructDataObject=function(){var e=this,t={};return this.getFormFields().forEach((function(n){var i,o;if(o=null===(o=n.datavalue||n._control.value)||""===o?void 0:o,"file"===n.type&&(o=l.getFiles(e.name,n.key+"_formWidget",n.multiple)),i=n.key||n.target||n.name,n.form.widgetId!==e.widgetId&&n.form.formGroupName)(r=_.get(t,n.form.formGroupName,{}))[i]=o,_.set(t,n.form.formGroupName,r);else if(n.form.isParentList){var r;(r=_.get(t,n.form.parentList.name,[]))[n.form.formArrayIndex]=r[n.form.formArrayIndex]||{},r[n.form.formArrayIndex][i]=o,_.set(t,n.form.parentList.name,r)}else _.set(t,i,o)})),this.updateFormDataOutput(t),this.dataoutput},t.prototype.updateDataOutput=function(){this.constructDataObject(),this.ngform.touched&&this.setValidationMsgs(!0)},t.prototype.getFormFields=function(){var e=this;return _.filter(this.formFields,(function(t){return t.form.name===e.name}))},t.prototype.setFieldValue=function(e,t,n){var i=e.key||e.name,o=n||t;o&&((o.hasOwnProperty(i)||_.includes(i,".")&&o.hasOwnProperty(_.split(i,".")[0]))&&(e.value=_.get(o,i)),this.dirty&&!this._triggeredByUser&&this.markAsPristine());var r=e.form.formGroupName;r&&_.get(t,r)&&this.setFormData.call(e.form,t[r]),_.get(e.form,"parentFormArray")&&this.setFormDataFromParentFormData.call(e.form,t)},t.prototype.setFormData=function(e,t,n){var i=this;(t||this.formFields).forEach((function(t){i.setFieldValue(t,e,n),t.fieldValidations&&t.fieldValidations.setCustomValidationMessage()})),this.constructDataObject()},t.prototype.resetFormState=function(){this.validationMessages.length&&(this.validationMessages=[]),this.ngform&&(this.ngform.markAsUntouched(),this.ngform.markAsPristine())},t.prototype.reset=function(){var e=this;this.resetFormState(),this.formFields.forEach((function(t){var n;t.value="","upload"!==t.widgettype&&t.type!==l.DataType.BLOB||e.resetFileUploadWidget(t,!0),null===(n=t.nativeElement.querySelector("input"))||void 0===n||n.removeAttribute("aria-invalid")})),this.constructDataObject(),this.clearMessage()},t.prototype.savePrevformFields=function(){this.prevformFields=l.getClonedObject(this.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},t.prototype.savePrevDataValues=function(){this.prevDataValues=this.formFields.map((function(e){return{key:e.key,value:e.value}}))},t.prototype.setReadonlyFields=function(){this.formFields.forEach((function(e){e.setReadOnlyState()}))},t.prototype.resetFileUploadWidget=function(e,t){this.$element.find('[name="'+e.key+'_formWidget"]').val(""),e._control.reset(),t||(e.href="",e.value=null)},t.prototype.emptyDataModel=function(){var e=this;this.formFields.forEach((function(t){l.isDefined(t)&&(t.type===l.DataType.BLOB?e.resetFileUploadWidget(t):t.datavalue="")}))},t.prototype.setDefaultValues=function(){var e=this;this.formFields.forEach((function(t){e.onFieldDefaultValueChange(t,t.defaultvalue)}))},t.prototype.setOperationType=function(e){this.operationType=e||"insert"},t.prototype.new=function(){var e=this;this.resetFormState(),this.operationType=i.Live_Operations.INSERT,this.clearMessage(),this.isSelected&&this.savePrevformFields(),this.emptyDataModel(),setTimeout((function(){e.setDefaultValues(),e.savePrevDataValues(),e.constructDataObject()})),this.isUpdateMode=!0},t.prototype.edit=function(){this.resetFormState(),this.clearMessage(),this.operationType=i.Live_Operations.UPDATE,this.isSelected&&(this.savePrevformFields(),this.savePrevDataValues()),this.prevDataObject=l.getClonedObject(this.formdata||{}),this.setReadonlyFields(),this.isUpdateMode=!0,l.$appDigest()},t.prototype.triggerWMEvent=function(e){var t=this.nativeElement.getAttribute("dependson");t&&(l.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:t}))},t.prototype.submitForm=function(e){var t,n,o,r=this,a=this.datasource;if(!this.validateFieldsOnSubmit()){n=l.getClonedObject(this.constructDataObject());var s=function(){return{$event:e,$formData:n,$data:n}};if(this.onBeforeSubmitEvt){if(!1===this.invokeEventCallback("beforesubmit",s()))return;this.resetFormState()}else this.resetFormState();if(this.onSubmitEvt||a)if(a){var c=a.pagination&&a.pagination.number+1,p=this.operationType?this.operationType:"insert";i.performDataOperation(a,n,{operationType:p}).then((function(e){return"wm.CrudVariable"===a.category&&(r.triggerWMEvent("resetEditMode"),r.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:c,preventMissingOpMsg:!0}),r.dialogId&&r.closeDialog()),l.isDefined(e.body)?(o=l.getValidJSON(e.body),o=l.isDefined(o)?o:e.body):o=e,{result:o,status:!0,message:r.postmessage,type:"success"}}),(function(e){return t=r.errormessage||e.error||e,l.$appDigest(),{result:_.get(e,"error")||e,status:!1,message:t,type:"error"}})).then((function(t){("error"===t.type&&!r.onError||"success"===t.type&&!r.onSuccess)&&r.toggleMessage(!0,t.message,t.type),r.invokeEventCallback("submit",s()),r.onResultCb(t.result,t.status,e)}))}else this.invokeEventCallback("submit",s()),this.onResultCb({},!0,e);else this.onResultCb({},!0,e)}},t.prototype.closeDialog=function(){this.dialogService.close(this.dialogId)},t.prototype.showButtons=function(e){var t=this;return _.some(this.buttonArray,(function(n){return _.includes(n.position,e)&&n.updateMode===t.isUpdateMode}))},t.prototype.expandCollapsePanel=function(){this.collapsible&&(this.expanded=!this.expanded)},t.prototype.onDataSourceUpdate=function(e,t,n){t?this.new():(this.setFormData(e),this.closeDialog()),this.isUpdateMode=!l.isDefined(n)||n},t.prototype.getNearestParentFormData=function(e){return e.parentForm?e.bindformdata||!_.get(e.parentForm,"formdata")||_.isEmpty(e.parentForm.formdata)?this.getNearestParentFormData(e.parentForm):e.parentForm.formdata:{}},t.prototype.setFormDataFromParentFormData=function(e){if(_.isEmpty(this.formdata)&&this.parentForm&&e)if(this.parentFormArray){var t=_.get(e,this.parentList.name);if(t)_.isArray(t)||(t=[t]),this.parentFormArray.patchValue(t),this.bindformdata||(this.formdata=t[this.formArrayIndex]),this.setFormData(this.formdata);else if(this.isParentList&&this.parentForm.formGroupName){var n=_.get(e,this.parentForm.formGroupName);this.setFormDataFromParentFormData(n)}}else this.setFormData(e)},t.prototype.onDataSourceChange=function(){if(_.get(this.formFields,"length")&&!this.bindformdata){this.isDataSourceUpdated=!0;var e=this.getNearestParentFormData(this);this.setFormDataFromParentFormData(e)}},t.prototype.onFormDataSourceChange=function(){this.updateFieldSource()},t.prototype.onFieldDefaultValueChange=function(e,t){e.value=i.parseValueByType(t,void 0,e.widgettype,e.trailingzero),this.dirty&&!this._triggeredByUser&&this.markAsPristine()},t.prototype.onFieldValueChange=function(){},t.prototype.generateFormFields=function(){return g(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s,c,p,u;return v(this,(function(d){switch(d.label){case 0:if(_.isUndefined(this._isGridLayoutPresent)&&(this._isGridLayoutPresent=this.$element.find(".panel-body [wmlayoutgrid]").length>0),this._isGridLayoutPresent?(t=this.$element.find(".form-elements [wmlayoutgrid]").first(),e=Number(t.attr("columns"))||1):((t=this.$element.find(".form-elements .dynamic-form-container")).length||(this.$element.find(".form-elements").prepend('<div class="dynamic-form-container"></div>'),t=this.$element.find(".form-elements .dynamic-form-container")),e=1),n=12/e,i="",o=0,s=this.metadata?this.metadata.data||this.metadata:[],this.formFields=[],_.isEmpty(s))return[2];if(this.onBeforeRenderEvt&&(a=this.invokeEventCallback("beforerender",{$metadata:s}))&&(s=a),!_.isArray(s))return[2];for(;s[o];){for(c="",r=0;r<e;r++)s[o]&&(c+=I(s[o],n)),o++;i+="<wm-gridrow>"+c+"</wm-gridrow>"}return this._isGridLayoutPresent||(i="<wm-layoutgrid>"+i+"</wm-layoutgrid>"),this.dynamicFormRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext.form=this),[4,this.dynamicComponentProvider.getComponentFactoryRef("app-form-dynamic-"+this.widgetId,i,{noCache:!0,transpile:!0})];case 1:return p=d.sent(),u=this.dynamicFormRef.createComponent(p,0,this.inj),l.extendProto(u.instance,this._dynamicContext),t[0].appendChild(u.location.nativeElement),this.setFormData(this.formdata),[2]}}))}))},Object.defineProperty(t.prototype,"mode",{get:function(){return this.operationType||this.findOperationType()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.ngform&&this.ngform.dirty},enumerable:!1,configurable:!0}),t.prototype.markAsPristine=function(e){void 0===e&&(e=!1),this.ngform.markAsPristine({onlySelf:e})},t.prototype.markAsDirty=function(e){void 0===e&&(e=!1),this.ngform.markAsDirty({onlySelf:e})},Object.defineProperty(t.prototype,"invalid",{get:function(){return this.ngform&&this.ngform.invalid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.ngform&&this.ngform.touched},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.ngform&&this.ngform.valid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.ngform&&this.ngform.pristine},enumerable:!1,configurable:!0}),t.prototype.markAsTouched=function(e){void 0===e&&(e=!1),this.ngform.markAsTouched({onlySelf:e})},t.prototype.markAsUntouched=function(e){void 0===e&&(e=!1),this.ngform.markAsUntouched({onlySelf:e})},t.prototype.invokeActionEvent=function(e,t){l.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.ngOnDestroy=function(){var t=this.parentForm&&_.get(this.parentForm,"ngform.controls");t&&(_.get(this.parentList,"name")&&t.hasOwnProperty(this.parentList.name)&&this.parentForm.ngform.removeControl(this.parentList.name),this.formGroupName&&t.hasOwnProperty(this.formGroupName)?this.parentForm.ngform.removeControl(this.formGroupName):this.parentForm.ngform.removeControl(this.name)),e.prototype.ngOnDestroy.call(this)},t}(i.StylableComponent);x.initializeProps=P(),x.decorators=[{type:t.Component,args:[{selector:"form[wmForm]",template:'<ng-template #content><ng-content></ng-content></ng-template>\n\n<ng-container *ngIf="formlayout === \'page\'; then pageLayoutTemplate else defaultTemplate">\n</ng-container>\n\n<ng-template #defaultTemplate>\n <div class="panel-heading" *ngIf="!isLayoutDialog && (title || subheading || iconclass || showButtons(\'header\'))">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon" aria-hidden="true" [ngClass]="iconclass" *ngIf="iconclass"></i>\n </div>\n <div class="pull-left">\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" [innerHTML]="subheading"></div>\n </div>\n <div class="form-action panel-actions basic-btn-grp">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'header\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <button type="button" class="app-icon wi panel-action" *ngIf="collapsible" title="Collapse/Expand"\n [ngClass]="expanded ? \'wi-minus\': \'wi-plus\'" (click)="expandCollapsePanel();"></button>\n </div>\n </h3>\n </div>\n <div class="panel-body" [ngClass]="{\'form-elements\': isLayoutDialog, \'form-body\': !isLayoutDialog}" [class.hidden]="!expanded">\n <p wmMessage [hidden]="!statusMessage.caption.toString()" [attr.aria-hidden]="!statusMessage.caption" [attr.aria-label]="statusMessage.caption" caption.bind="statusMessage.caption" type.bind="statusMessage.type"></p>\n <div [ngClass]="{\'form-elements\': !isLayoutDialog, \'form-content\': isLayoutDialog}">\n <ng-container *ngTemplateOutlet="content"></ng-container>\n </div>\n <div class="basic-btn-grp form-action panel-footer clearfix" [ngClass]="{\'modal-footer\': isLayoutDialog}" [class.hidden]="!expanded || !showButtons(\'footer\')">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'footer\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #pageLayoutTemplate>\n <ng-container *ngTemplateOutlet="content"></ng-container>\n</ng-template>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" type.bind="btn.type" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey" disabled.bind="ngform.status === \'PENDING\' || btn.disabled"\n tabindex.bind="btn.tabindex" [attr.aria-label]="btn.displayName" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target"\n tabindex.bind="btn.tabindex" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></a>\n</ng-template>\n\n<ng-container #dynamicForm></ng-container>\n',providers:[i.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector},{type:s.FormBuilder},{type:l.App},{type:l.AbstractDialogService},{type:l.DynamicComponentRefProvider},{type:t.NgZone},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:x,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:c.PrefabDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:i.PartialDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforesubmit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["submit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforerender.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["formdata.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveForm"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveFilter"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["data-role"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]}]},x.propDecorators={dynamicFormRef:[{type:t.ViewChild,args:["dynamicForm",{static:!0,read:t.ViewContainerRef}]}],messageRef:[{type:t.ViewChild,args:[i.MessageComponent]}],componentRefs:[{type:t.ContentChildren,args:[i.WidgetRef,{descendants:!0}]}],action:[{type:t.HostBinding,args:["action"]}],submit:[{type:t.HostListener,args:["submit",["$event"]]}],onReset:[{type:t.HostListener,args:["reset"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var k=function(){function e(e,t,n,i,o,r){var a=this;this.componentInstance=n,this.name=o,this.key=r,this.fb=i,this.parent=e||t,this.ngform=this.parent.ngform,this.componentInstance.registerPropertyChangeListener((function(e,t){"datavalue"===e&&a._control?a._control.setValue(t):"name"!==e||a._control||a.addControl(a.key||t)}))}return Object.defineProperty(e.prototype,"_control",{get:function(){var e=this.key||this.name;if(e)return this.ngform&&this.ngform.controls[e]},enumerable:!1,configurable:!0}),e.prototype.addControl=function(e){this.ngform.addControl(e,this.createControl())},e.prototype.createControl=function(){return this.fb.control(this.componentInstance.datavalue)},e.prototype.ngOnInit=function(){var e=this.key||this.name;e&&!this._control&&(this.addControl(e),this.parent.registerFormWidget(this.componentInstance))},e}();k.decorators=[{type:t.Directive,args:[{selector:"[wmFormWidget]"}]}],k.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[x]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[u.TableComponent]}]},{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[i.WidgetRef]}]},{type:s.FormBuilder},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]}]};var M=function(){i.register("wm-form-action",new Map([["accessroles",i.PROP_STRING],["action",i.PROP_STRING],["class",i.PROP_STRING],["binding",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["display-name",i.PROP_STRING],["hyperlink",i.PROP_STRING],["iconclass",i.PROP_STRING],["iconname",i.PROP_STRING],["key",i.PROP_STRING],["position",Object.assign({value:"footer"},i.PROP_STRING)],["shortcutkey",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["target",i.PROP_STRING],["title",i.PROP_STRING],["type",Object.assign({value:"button"},i.PROP_STRING)],["update-mode",Object.assign({value:!0},i.PROP_BOOLEAN)],["widget-type",Object.assign({value:"button"},i.PROP_STRING)]]))},L={widgetType:"wm-form-action",hostClass:""},F=function(e){function t(t,n){var i=e.call(this,t,L)||this;return i.form=n,i}return f(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key||this.binding,displayName:this["display-name"],show:this.show,class:this.class?this.class:"button"===this["widget-type"]?"btn-secondary":"",iconclass:this.iconclass||"",title:_.isUndefined(this.title)?this["display-name"]||"":this.title,action:this.action,accessroles:this.accessroles,shortcutkey:this.shortcutkey,disabled:this.disabled,tabindex:this.tabindex,iconname:this.iconname,type:this.type,updateMode:this["update-mode"],position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.form.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t,n){if(this._propsInitialized)switch(e){case"display-name":this.buttonDef.displayName=t;default:this.buttonDef[e]=t}},t}(i.BaseComponent);F.initializeProps=M(),F.decorators=[{type:t.Directive,args:[{selector:"[wmFormAction]",providers:[i.provideAsWidgetRef(F)]}]}],F.ctorParameters=function(){return[{type:t.Injector},{type:x,decorators:[{type:t.Optional}]}]};var j=function(){var e=new Map([["dataentrymode",Object.assign({value:"default"},i.PROP_STRING)],["debouncetime",Object.assign({value:250},i.PROP_NUMBER)],["defaultvalue",i.PROP_STRING],["displayname",i.PROP_STRING],["display-name",i.PROP_STRING],["field",i.PROP_STRING],["filterexpressions",i.PROP_STRING],["filter-on",i.PROP_STRING],["generator",i.PROP_STRING],["hint",i.PROP_STRING],["inputtype",i.PROP_STRING],["is-primary-key",i.PROP_BOOLEAN],["is-range",i.PROP_BOOLEAN],["is-related",i.PROP_BOOLEAN],["isformfield",{value:!0}],["key",i.PROP_STRING],["limit",i.PROP_NUMBER],["lookup-type",i.PROP_STRING],["lookup-field",i.PROP_STRING],["name",i.PROP_STRING],["matchmode",i.PROP_STRING],["maxdefaultvalue",i.PROP_STRING],["maxplaceholder",i.PROP_STRING],["mobile-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["period",i.PROP_BOOLEAN],["pc-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["placeholder",i.PROP_STRING],["primary-key",i.PROP_BOOLEAN],["related-entity-name",i.PROP_STRING],["required",i.PROP_BOOLEAN],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tablet-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["type",i.PROP_STRING],["validationmessage",i.PROP_STRING],["viewmodewidget",i.PROP_STRING],["widgettype",i.PROP_STRING]]),t=function(t){var n="wm-form-field-"+l.FormWidgetType[t],o=i.getWidgetPropsByType(n);e.forEach((function(e,t){null==o.get(t)&&o.set(t,e)}))};for(var n in l.FormWidgetType)t(n)},B=function(){return{custom:!0}},G={image:"image/*",video:"video/*",audio:"audio/*"},V=function(e){function t(t,n,i,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w){var P=this,_={widgetType:"wm-form-field",hostClass:"",widgetSubType:"wm-form-field-"+(d||l.FormWidgetType.TEXT).trim()},O=l.noop;return(P=e.call(this,t,_,new Promise((function(e){return O=e})))||this)._initPropsRes=O,P.app=r,P.fieldDefConfig={},P.class="",P.binddataset=c,P.binddisplayimagesrc=m,P.binddisplayexpression=p,P.bindChipclass=s,P.binddisplaylabel=u,P.form=n,P.fb=i,P.viewport=o,P._fieldName=f||h,P.isRange=g,P.excludeProps=new Set(["type","name"]),P.widgettype=d,P.parentList=a,P.notifyForFields=[],(P.binddataset||P.$element.attr("dataset"))&&(P.isDataSetBound=!0),w[0]._onFocusField=P._onFocusField.bind(P),w[0]._onBlurField=P._onBlurField.bind(P),P._debounceSetUpValidators=l.debounce((function(){return P.setUpValidators()}),500),P}return f(t,e),t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},t.prototype.handleClick=function(e){this._clicktriggeredByUser=!0},t.prototype._onFocusField=function(e){this._activeField=!0,$(e.target).closest(".live-field").addClass("active")},t.prototype._onBlurField=function(e){var t,n,i,o;$(e.target).closest(".live-field").removeClass("active");this.nativeElement.querySelector("p.text-danger");this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",""+this.ngform.controls[this._fieldName].invalid),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this._activeField=!1,this._triggeredByUser=!1,this._clicktriggeredByUser=!1},t.prototype.evaluateExpr=function(e,t,n){if(n&&t||(t=Object.keys(e)[0]))return i.getEvaluatedData(e,{field:t,expression:n},this.viewParent)},t.prototype.getDisplayExpr=function(){var e=this,t=[],n=this.value,i=this.displayfield||this.displaylabel,o=this.displayexpression;return _.isObject(n)?(_.isArray(n)?_.forEach(n,(function(n){_.isObject(n)&&t.push(e.evaluateExpr(n,i,o))})):t.push(this.evaluateExpr(n,i,o)),_.join(t,",")):null==n?"":this.value},t.prototype.getCaption=function(){return void 0===this.value||null===this.value?_.get(this.form.dataoutput,this._fieldName)||"":this.value},t.prototype.notifyChanges=function(){_.forEach(this.notifyForFields,(function(e){e.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.fieldValidations.observeOn(e,"formfields")},t.prototype.setUpValidators=function(e){this.fieldValidations.setUpValidators(e)},t.prototype.setAsyncValidators=function(e){this.fieldValidations.setAsyncValidators(e)},t.prototype.setValidators=function(e){this.fieldValidations.setValidators(e)},t.prototype.setFormWidget=function(e,t){this.formWidget&&this.formWidget.widget&&(this.formWidget.widget[e]=t)},t.prototype.boundFn=function(e){return e()},t.prototype.setMaxFormWidget=function(e,t){this.formWidgetMax&&(this.formWidgetMax.widget[e]=t)},t.prototype.onPropertyChange=function(t,n,i){var o=this.form.dirty;if("tabindex"!==t&&e.prototype.onPropertyChange.call(this,t,n,i),!this.excludeProps.has(t)){if(this.widgettype===l.FormWidgetType.UPLOAD)return"required"===t&&this._debounceSetUpValidators(),void e.prototype.onPropertyChange.call(this,t,n,i);switch(this.setFormWidget(t,n),"placeholder"!==t&&this.setMaxFormWidget(t,n),t){case"defaultvalue":this.form.onFieldDefaultValueChange(this,n);break;case"maxdefaultvalue":this.maxValue=n,this.setMaxFormWidget("datavalue",n),this.form.onMaxDefaultValueChange();break;case"maxplaceholder":this.setMaxFormWidget("placeholder",n);break;case"required":o!==this.form.dirty&&this.form.markAsPristine();case"maxchars":case"minvalue":case"maxvalue":case"regexp":case"show":this._debounceSetUpValidators();break;case"primary-key":n&&this.form.setPrimaryKey(this._fieldName);break;case"display-name":this.displayname=n;break;case"readonly":this.setReadOnlyState()}}},t.prototype.onStyleChange=function(t,n,i){this.setFormWidget(t,n),this.setMaxFormWidget(t,n),e.prototype.onStyleChange.call(this,t,n,i)},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.formWidget&&this.formWidget.datavalue},set:function(e){this._control&&this.widgettype!==l.FormWidgetType.UPLOAD&&this._control.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.datavalue},set:function(e){this.datavalue=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.formWidgetMax&&this.formWidgetMax.datavalue},set:function(e){this._maxControl&&this._maxControl.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minValue",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_control",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_maxControl",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName+"_max"]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.formWidget&&this.formWidget.displayValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.formWidget&&this.formWidget.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"charlength",{get:function(){return this.formWidget&&this.formWidget.charlength},enumerable:!1,configurable:!0}),t.prototype.createControl=function(){return this.fb.control(void 0,{validators:this._validators})},t.prototype.onValueChange=function(e){var t,n,i,o;if(!this.isDestroyed){var r=$(this.nativeElement).find(".caption-floating");if(r.length>0){var a=l.isDefined(e)&&""!==e&&null!==e||r.find("input").val()||r.find("input:-webkit-autofill").length;this.app.notify("captionPositionAnimate",{displayVal:a,nativeEl:r,isSelectMultiple:this.formWidget&&this.formWidget.multiple,isFocused:this._activeField})}this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",this._triggeredByUser&&this.ngform.controls[this._fieldName].invalid?"true":"false"),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this.form.onFieldValueChange(this,e),this.notifyChanges(),(this.$element.find(".active").length>0||this.form.touched)&&((this._triggeredByUser||l.isMobile()&&this._clicktriggeredByUser&&l.isDateTimeType(this.widgettype))&&this.ngform.controls[this._fieldName].markAsTouched(),this.fieldValidations.setCustomValidationMessage())}},t.prototype.onStatusChange=function(e){this.isDestroyed||(this.showPendingSpinner="PENDING"===e,"PENDING"===e?this.formWidget.disabled=!0:this.formWidget.disabled!==this.disabled&&(this.formWidget.disabled=this.disabled))},t.prototype.setValidationMessage=function(e){var t=this;setTimeout((function(){t.validationmessage=e,t.setUpValidators(B)}))},t.prototype.setReadOnlyState=function(){var e;e=!this.form.isUpdateMode||(!this["primary-key"]||this["is-related"]||this.period?this.readonly:!("assigned"===this.generator&&"update"!==this.form.operationType)),this.setFormWidget("readonly",e)},t.prototype.resetDisplayInput=function(){l.isDefined(this.value)&&""!==this.value||this.formWidget&&this.formWidget.resetDisplayInput&&this.formWidget.resetDisplayInput()},t.prototype.triggerUploadEvent=function(e,t){var n={$event:e};"change"===t&&(n.newVal=e.target.files,n.oldVal=this._oldUploadVal,this._oldUploadVal=n.newVal),this.invokeEventCallback(t,n)},t.prototype.registerFormField=function(){var e=this._fieldName;if(this.parentList&&this.form.parentList!==this.parentList){for(var t=1,n=e;this.ngform.controls.hasOwnProperty(n);)n=e+"_"+t,t++;this.ngform.addControl(n,this.createControl()),this._fieldName=n}else this.ngform.addControl(e,this.createControl());var i=this._control.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return i.unsubscribe()}));var o=this._control.statusChanges.pipe(d.debounceTime(100)).subscribe(this.onStatusChange.bind(this));if(this.registerDestroyListener((function(){return o.unsubscribe()})),"true"===this.isRange){this.ngform.addControl(e+"_max",this.createControl());var r=this._maxControl.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return r.unsubscribe()}))}this.value=_.get(this.form.formdata,this._fieldName)},t.prototype.ngOnInit=function(){this.ngform=this.form.ngform,this.registerFormField(),this.fieldValidations=new i.BaseFieldValidations(this,this.formWidget,this.widgettype,this._control,this.form),e.prototype.ngOnInit.call(this)},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.formWidget&&(this._initPropsRes(),this.setFormWidget("binddisplaylabel",this.binddisplaylabel),this.setFormWidget("binddisplayexpression",this.binddisplayexpression),this.setFormWidget("binddisplayimagesrc",this.binddisplayimagesrc),this.setFormWidget("bindChipclass",this.bindChipclass),this.setFormWidget("binddataset",this.binddataset)),this.registerReadyStateListener((function(){if(t.key=t._fieldName||t.target||t.binding,t.viewmodewidget=t.viewmodewidget||i.getDefaultViewModeWidget(t.widgettype),t.widgettype===l.FormWidgetType.UPLOAD){var e;e=t.filetype?G[t.filetype]:"",t.permitted=e+(t.extensions?(e?",":"")+t.extensions:"")}l.isMobile()&&t.viewport.isMobileType?t["mobile-display"]||(t.widget.show=!1):t.viewport.isTabletType?t["tablet-display"]||(t.widget.show=!1):t["pc-display"]||(t.widget.show=!1),t.fieldDefConfig.displaname=t.displayname,t.fieldDefConfig.show=t.show,t.fieldDefConfig.isRelated=t["is-related"],t.fieldDefConfig.inputtype=t.inputtype,t.fieldDefConfig.generator=t.generator,t.fieldDefConfig.placeholder=t.placeholder,t.fieldDefConfig.primaryKey=t["primary-key"],t.fieldDefConfig.required=t.required,t.fieldDefConfig._readonly=t.readonly,t.fieldDefConfig.regexp=t.regexp,t.fieldDefConfig.type=t.type,t.fieldDefConfig.key=t.key,t.fieldDefConfig.mobileDisplay=t["mobile-display"],t.fieldDefConfig.name=t.name,t.fieldDefConfig.pcDisplay=t["pc-display"],t.fieldDefConfig.tabletDisplay=t["tablet-display"],t.fieldDefConfig.validationmessage=t.validationmessage,t.fieldDefConfig.viewmodewidget=t.viewmodewidget,t.fieldDefConfig.widget=t.widgettype,t.form.registerFormFields(t.widget),l.addForIdAttributes(t.nativeElement),t.setReadOnlyState()}))},t}(i.StylableComponent);V.initializeProps=j(),V.decorators=[{type:t.Directive,args:[{selector:"[wmFormField]",exportAs:"wmFormField",providers:[i.provideAsWidgetRef(V),i.provideAs(V,s.NG_VALUE_ACCESSOR,!0),{provide:i.Context,useValue:{},multi:!0}]}]}],V.ctorParameters=function(){return[{type:t.Injector},{type:x},{type:s.FormBuilder},{type:l.Viewport},{type:l.App},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["chipclass.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayexpression.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displaylabel.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["widgettype"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayimagesrc.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["is-range"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["pc-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["mobile-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["tablet-display"]}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[i.Context]}]}]},V.propDecorators={formWidget:[{type:t.ContentChild,args:["formWidget",{static:!0}]}],formWidgetMax:[{type:t.ContentChild,args:["formWidgetMax"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var U=function(){function e(e,t,n){this.subscribedWidget=e,this.app=t,this.dialogService=n,e.addRow=this.addRow.bind(this),e.updateRow=this.updateRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.call=this.call.bind(this)}return e.prototype.addRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.INSERT,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.updateRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.UPDATE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.deleteRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.DELETE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.successHandler=function(e,t){l.triggerFn(e.success,t)},e.prototype.errorHandler=function(e,t){this.app.notifyApp(t,"error","ERROR"),l.triggerFn(e.error,t)},e.prototype.getRecords=function(e,t){var n,o,r=this;"None"!==this.subscribedWidget.navigation&&this.subscribedWidget.dataNavigator?(o=this.subscribedWidget.dataNavigator,t===i.Live_Operations.DELETE?(o.dataSize-=1,o.calculatePagingValues(),n=o.pageCount<o.dn.currentPage?"prev":void 0):("last"===(n=t===i.Live_Operations.INSERT?"last":"current")&&(o.dataSize+=1),o.calculatePagingValues()),o.navigatePage(n,null,!0,(function(t){r.successHandler(e,t)}))):this.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(t){r.successHandler(e,t)}),(function(t){r.errorHandler(e,t)}))},e.prototype.performCUDOperation=function(e,t,n){var o=this;i.performDataOperation(this.subscribedWidget.datasource,e,{operationType:t}).then((function(e){e.error?o.errorHandler(n,e.error):("wm.CrudVariable"===o.subscribedWidget.datasource.category&&"delete"===t?o.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(e){o.successHandler(n,e)}),(function(e){o.errorHandler(n,e)})):o.getRecords(n,t),"delete"===t&&o.app.notifyApp(o.app.appLocale.MESSAGE_DELETE_RECORD_SUCCESS,"success"))}),(function(e){o.errorHandler(n,e)}))},e.prototype.insertRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.updateRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.deleteRecord=function(e,t,n){var i=this;this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.subscribedWidget.confirmdelete||"Are you sure you want to delete this?",oktext:this.subscribedWidget.deleteoktext||"Ok",canceltext:this.subscribedWidget.deletecanceltext||"Cancel",onOk:function(){i.performCUDOperation(e,t,n),i.dialogService.closeAppConfirmDialog()},onCancel:function(){l.triggerFn(n.cancelDeleteCallback),i.dialogService.closeAppConfirmDialog()}})},e.prototype.performOperation=function(e,t){var n={row:t.row,prevData:{},rowData:{},transform:!0,skipNotification:!0};switch(e===i.Live_Operations.UPDATE&&(n.rowData=t.rowData,n.prevData=t.prevData),e){case i.Live_Operations.INSERT:this.insertRecord(n,e,t);break;case i.Live_Operations.UPDATE:this.updateRecord(n,e,t);break;case i.Live_Operations.DELETE:this.deleteRecord(n,e,t);break;case i.Live_Operations.READ:this.getRecords(t,e)}},e.prototype.call=function(e,t,n,i){t.success=n,t.error=i,this.performOperation(e,t)},e}();U.decorators=[{type:t.Directive,args:[{selector:"[wmLiveActions]"}]}],U.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[p.ListComponent]}]},{type:l.App},{type:l.AbstractDialogService}]};var W=function(){function e(e,t,n,i){this.dialogService=n,this.app=i,e&&(this.isLayoutDialog=!0,this.dialogId=e),this.dependson=t,this.eventSubscription=this.app.subscribe("wm-event",this.handleEvent.bind(this))}return e.prototype.openFormDialog=function(){this.dialogService.open(this.dialogId)},e.prototype.onUpdate=function(e,t,n){this.editMode=n||this.editMode,this.form.operationType=i.Live_Operations.UPDATE,this.form.isSelected=!0;var o=this.currentFormData;e&&t&&(o=t.multiselect?e[0]:e[e.length-1]),this.form.setFormData(o),this.form.edit(),this.editMode||(this.form.isUpdateMode=!1)},e.prototype.onInsert=function(){this.form.operationType=i.Live_Operations.INSERT,this.form.isSelected=!0,this.form.setFormData({}),this.form.new()},e.prototype.handleEvent=function(e){if(this.dependson===e.widgetName)switch(this.currentOp=e.eventName,e.eventName){case i.Live_Operations.UPDATE:this.currentFormData=e.row,this.isLayoutDialog?this.openFormDialog():this.onUpdate(void 0,void 0,!0);break;case i.Live_Operations.INSERT:this.isLayoutDialog?this.openFormDialog():this.onInsert();break;case i.Live_Operations.DELETE:this.app.Widgets[this.dependson].call("delete",{row:e.row});break;case i.Live_Operations.READ:this.isLayoutDialog||(this.form.isUpdateMode=!1);break;case"rerender":e.dataSource&&e.dataSource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list"});break;case"selectedItemChange":e.table&&this.onUpdate(e.row,e.table);break;case"resetEditMode":this.editMode=!1}},e.prototype.onFormRender=function(){var e=this;this.form&&this.isLayoutDialog&&(this.form.isLayoutDialog=!0,setTimeout((function(){e.currentOp===i.Live_Operations.UPDATE?e.onUpdate(void 0,void 0,!0):e.currentOp===i.Live_Operations.INSERT&&e.onInsert()}),250))},e.prototype.ngAfterContentInit=function(){var e=this;this.formChildren.first?this.form=this.formChildren.first:this.formSubscription=this.formChildren.changes.subscribe((function(t){e.form=t.first,e.onFormRender()})),this.app.notify("setup-cud-listener",this.dependson)},e.prototype.ngOnDestroy=function(){this.formSubscription&&this.formSubscription.unsubscribe(),this.eventSubscription&&this.eventSubscription()},e}();W.decorators=[{type:t.Directive,args:[{selector:"[dependson]"}]}],W.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["dialogid"]}]},{type:String,decorators:[{type:t.Attribute,args:["dependson"]}]},{type:l.AbstractDialogService},{type:l.App}]},W.propDecorators={formChildren:[{type:t.ContentChildren,args:[x,{descendants:!0}]}]};var q="EMPTY_NULL_FILTER",z=function(){function e(e){var t=this;this.form=e,this._filter=l.debounce((function(e){t.filter(e)}),250),e.clearFilter=this.clearFilter.bind(this),e.applyFilter=this.applyFilter.bind(this),e.filter=this.filter.bind(this),e.filterOnDefault=this.filterOnDefault.bind(this),e.execute=this.execute.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onMaxDefaultValueChange=this.onMaxDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.registerFormWidget=this.registerFormWidget.bind(this)}return e.prototype.execute=function(e,t){return e===l.DataSource.Operation.LIST_RECORDS||e===l.DataSource.Operation.DOWNLOAD?this.applyFilter(t):e===l.DataSource.Operation.GET_OPTIONS?this._options||{}:e===l.DataSource.Operation.GET_PAGING_OPTIONS?this.form.pagination:this.form.datasource?e===l.DataSource.Operation.FETCH_DISTINCT_VALUES?i.fetchDistinctValues(this.form.datasource,this.form.formFields,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter,EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}):this.form.datasource.execute(e,t):{}},e.prototype.onFieldDefaultValueChange=function(e,t){e.minValue=t,e.value=t,this.filterOnDefault()},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t,{EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}),this.form.autoupdate&&l.isDefined(t)&&this._filter()},e.prototype.onMaxDefaultValueChange=function(){var e=this;setTimeout((function(){e.filterOnDefault()}))},e.prototype.onDataSourceChange=function(){var e=this,t=this.form.datasource;t&&(this.form.formFields.forEach((function(n){i.isDataSetWidget(n.widgettype)&&(i.getDistinctValuesForField(t,n.widget,{widget:"widgettype",enableemptyfilter:e.form.enableemptyfilter,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}),i.applyFilterOnField(t,n.widget,e.form.formFields,n.value,{isFirst:!0,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}))})),this._filter(this._options))},e.prototype.clearFilter=function(){var e=this;this.form.resetFormState(),this.form.formFields.forEach((function(t){!t.readonly&&t.show&&(t.widgettype!==l.FormWidgetType.AUTOCOMPLETE&&t.widgettype!==l.FormWidgetType.TYPEAHEAD||e.form.$element.find("div[name="+t.name+"] input").val(""),t["is-range"]?(t.minValue="",t.maxValue=""):(t.value="",t.resetDisplayInput()))})),setTimeout((function(){e._filter()}))},e.prototype.submitForm=function(){this.filter()},e.prototype.applyFilter=function(e){return(e=e?e.data||e:{}).page=e.page||1,e.orderBy=l.isDefined(e.orderBy)?e.orderBy:this.orderBy,this.filter(e)},e.prototype.filter=function(e){var t=this;if(this.form.datasource){var n,o,r={},a={},s=1;s=(e=e||{}).page||s,n=l.isDefined(e.orderBy)?e.orderBy:this.orderBy||"",this.orderBy=n,this.form.formFields.forEach((function(e){var n,i="div[name="+e.name+"] input",o=t.form.$element;if((e.widgettype===l.FormWidgetType.AUTOCOMPLETE||e.widgettype===l.FormWidgetType.TYPEAHEAD)&&o)return n=o.find(i),void(e["is-range"]?a[e.field]={minValue:l.isDefined(e.minValue)?e.minValue:n.first().val(),maxValue:l.isDefined(e.maxValue)?e.maxValue:n.last().val()}:a[e.field]={value:l.isDefined(e.value)?e.value:n.val()});e["is-range"]?a[e.field]={minValue:e.minValue,maxValue:e.maxValue}:a[e.field]={value:e.value}}));try{if(!1===(o=this.form.invokeEventCallback("beforeservicecall",{$data:a})))return;if(o&&o.error)return void this.form.toggleMessage(!0,o.error,"error","ERROR");this.form.formFields.forEach((function(e){e["is-range"]?(e._minValue=a[e.field].minValue,e._maxValue=a[e.field].maxValue):e._value=a[e.field].value}))}catch(e){if("Abort"===e.message)return}return this.form.formFields.forEach((function(e){var n,o,a=e.field,s=e._minValue,c=e._maxValue;if(e["is-related"]&&(a+="."+e["lookup-field"]),e["is-range"])n=i.getRangeFieldValue(s,c),o=i.getRangeMatchMode(s,c),l.isDefined(n)&&(r[a]={value:n,matchMode:o,logicalOp:"AND"});else{switch(e.widgettype){case l.FormWidgetType.SELECT:case l.FormWidgetType.RADIOSET:i.getEnableEmptyFilter(t.form.enableemptyfilter)&&e._value===q?(o=i.getEmptyMatchMode(t.form.enableemptyfilter),n=e._value):e.type===l.DataType.BOOLEAN?l.isDefined(e._value)&&""!==e._value&&(n=JSON.parse(e._value)):n=e._value;break;case l.FormWidgetType.CHECKBOXSET:case l.FormWidgetType.CHIPS:e._value&&e._value.length&&(n=e._value);break;case l.FormWidgetType.CHECKBOX:case l.FormWidgetType.TOGGLE:l.isDefined(e._value)&&""!==e._value&&(n=e.type===l.DataType.BOOLEAN?JSON.parse(e._value):e._value);break;default:n=e._value}l.isDefined(n)&&""!==n&&null!==n&&(r[a]={},o?(r[a].matchMode=o,n=void 0):(e.type===l.DataType.STRING||e.isRelated)&&(r[a].matchMode=o||e.matchmode||t.form.datasource.execute(l.DataSource.Operation.GET_MATCH_MODE)),r[a].value=n,r[a].logicalOp="AND",r[a].type=e.type)}})),e.exportType?this.form.datasource.execute(l.DataSource.Operation.DOWNLOAD,{data:{matchMode:"anywhereignorecase",filterFields:r,orderBy:n,exportType:e.exportType,logicalOp:"AND",exportSize:e.exportSize,fields:e.fields,fileName:e.fileName}}):this.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{filterFields:r,orderBy:n,page:s,pagesize:this.form.pagesize||20,skipDataSetUpdate:!0,inFlightBehavior:"executeAll"}).then((function(e){var i=e.data;return t.form.pagination=e.pagination,i.error?(t.form.toggleMessage(!0,i.error,"error","ERROR"),t.form.onResultCb(i,!1)):(t._options={page:s,orderBy:n},t.form.result=l.getClonedObject(i),t.form.onResultCb(i,!0)),l.$appDigest(),t.form.result}),(function(e){return t.form.toggleMessage(!0,e,"error","ERROR"),t.form.onResultCb(e,!1),e}))}},e.prototype.filterOnDefault=function(){_.find(this.form.formFields,(function(e){return l.isDefined(e.value)||l.isDefined(e.minValue)||l.isDefined(e.maxValue)}))&&this._filter(this._options)},e.prototype.registerFormWidget=function(e){var t=e.key||e.name;this.form.filterWidgets[t]=e},e}();z.initializeProps=S(),z.decorators=[{type:t.Directive,args:[{selector:"[wmLiveFilter]"}]}],z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]}]};var H=function(e){return e.widgettype===l.DataType.TIME||e.type===l.DataType.TIME&&!e.widgettype},Y=H,K=function(e){if(e){var t=(new Date).toDateString();return new Date(t+" "+e).getTime()}},Q=K,X=function(){function e(e,t,n,i,o){var r=this;this.form=e,this.datePipe=n,this.dialogService=i,this._debouncedSavePrevDataValues=l.debounce((function(){r.savePrevDataValues()}),250),t&&!this.form.parentForm?(this.form._liveTableParent=t,this.form.isLayoutDialog=t.isLayoutDialog,t.onFormReady(this.form)):this.form.isLayoutDialog="dialog"===o,e.cancel=this.cancel.bind(this),e.reset=this.reset.bind(this),e.delete=this.delete.bind(this),e.save=this.save.bind(this),e.saveAndNew=this.saveAndNew.bind(this),e.saveAndView=this.saveAndView.bind(this),e.setPrimaryKey=this.setPrimaryKey.bind(this),e.constructDataObject=this.constructDataObject.bind(this),e.changeDataObject=this.setFormData.bind(this),e.setFormData=this.setFormData.bind(this),e.findOperationType=this.findOperationType.bind(this),e.clearData=this.clearData.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.form_registerFormFields=e.registerFormFields,e.registerFormFields=this.registerFormFields.bind(this)}return e.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},e.prototype.registerFormFields=function(e){var t=this.form.getFormFields();this.form.form_registerFormFields(e),this.form.isDataSourceUpdated&&this._updateFieldOnDataSourceChange(e,t)},e.prototype._updateFieldOnDataSourceChange=function(e,t){!e.isDataSetBound&&i.isDataSetWidget(e.widgettype)&&(e["is-related"]?(e.isDataSetBound=!0,i.fetchRelatedFieldData(this.form.datasource,e.widget,{relatedField:e.key,datafield:i.ALLFIELDS,widget:"widgettype"})):(i.getDistinctValuesForField(this.form.datasource,e.widget,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter}),i.applyFilterOnField(this.form.datasource,e.widget,t,e.value,{isFirst:!0})))},e.prototype.onDataSourceChange=function(){var e=this;_.get(this.form.formFields,"length")&&(this.form.isDataSourceUpdated=!0);var t=this.form.getFormFields();t.forEach((function(n){e._updateFieldOnDataSourceChange(n,t)}))},e.prototype.onFieldDefaultValueChange=function(e,t){"update"!==this.form.operationType&&(l.isDefined(t)&&null!==t&&""!==t&&"null"!==t?e.value=i.parseValueByType(t,e.type,e.widgettype,e.trailingzero):e.value=void 0,this.form.dirty&&!this._triggeredByUser&&this.form.markAsPristine(),this._debouncedSavePrevDataValues())},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t)},e.prototype.getBlobURL=function(e,t,n){var i,o="";return null!=n&&this.form.datasource?(i=e[(this.form.datasource.execute(l.DataSource.Operation.GET_PRIMARY_KEY)||[])[0]],o+=this.form.datasource.execute(l.DataSource.Operation.GET_BLOB_URL,{primaryValue:i,columnName:t}),o+="?"+Math.random()):o},e.prototype.setFormData=function(e,t){var n=this;e&&((t=t||this.form.formFields).forEach((function(t){var i=_.get(e,t.key||t.name);H(t)?t.value=K(i):t.type===l.DataType.BLOB?(n.form.resetFileUploadWidget(t,!0),t.href=n.getBlobURL(e,t.key,i),t.value=_.isString(i)?"":i):n.form.setFieldValue(t,e)})),this.savePrevDataValues(),this.form.constructDataObject())},e.prototype.onDataSourceUpdate=function(e,t,n){t?this.form.new():(this.form.setFormData(e),this.closeDialog()),this.form.isUpdateMode=!l.isDefined(n)||n},e.prototype.savePrevformFields=function(){this.form.prevformFields=l.getClonedObject(this.form.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},e.prototype.getPrevformFields=function(){var e=this;this.form.formFields.map((function(t){var n=e.form.prevformFields.find((function(e){return e.key===t.key}));t.value=n.value}))},e.prototype.getDataObject=function(){return this.form.operationType===i.Live_Operations.INSERT?{}:l.isDefined(this.form.prevDataObject)&&!l.isEmptyObject(this.form.prevDataObject)?l.getClonedObject(this.form.prevDataObject):l.getClonedObject(this.form.formdata||{})},e.prototype.constructDataObject=function(e){var t=this,n=this.getDataObject(),i=this.form.name;return(e?this.form.prevformFields:this.form.getFormFields()).forEach((function(e){var o,r,a=_.split(e.key,"."),s=a[0]||e.key;e.widgettype&&l.isDateTimeType(e.widgettype)||l.isDateTimeType(e.type)?e.value?(o=l.getValidDateObject(e.value),r=e.outputformat===l.DataType.TIMESTAMP||e.type===l.DataType.TIMESTAMP?e.value?o:null:e.outputformat?t.datePipe.transform(o,e.outputformat):e.value):r=void 0:r=e.type===l.DataType.BLOB?l.getFiles(i,s+"_formWidget",e.multiple):e.type===l.DataType.LIST?e.value||void 0:null===e.value||""===e.value?void 0:e.value,1===a.length?n[s]=r:(n[s]=n[s]||{},n[s][a[1]]=r)})),e?n:(this.form.updateFormDataOutput(n),this.form.dataoutput)},e.prototype.setPrimaryKey=function(e){this.form.primaryKey=this.form.primaryKey||[],-1===this.form.primaryKey.indexOf(e)&&this.form.primaryKey.push(e)},e.prototype.findOperationType=function(){var e,t=this,n=!1,o=this.form.datasource&&this.form.datasource.execute(l.DataSource.Operation.GET_OPERATION_TYPE);return o&&"read"!==o?o:(this.form.primaryKey&&!_.isEmpty(this.form.formdata)&&(1===this.form.primaryKey.length?this.form.formdata[this.form.primaryKey[0]]&&(e=i.Live_Operations.UPDATE):0===this.form.primaryKey.length?(_.forEach(this.form.formdata,(function(e){e&&(n=!0)})),n&&(e=i.Live_Operations.UPDATE)):(n=_.some(this.form.primaryKey,(function(e){if(t.form.formdata[e])return!0})))&&(e=i.Live_Operations.UPDATE)),e||i.Live_Operations.INSERT)},e.prototype.getPrevDataValues=function(){var e=_.fromPairs(_.map(this.form.prevDataValues,(function(e){return[e.key,e.value]})));return this.form.formFields.forEach((function(t){t.value=e[t.key]||"",t.resetDisplayInput()})),e},e.prototype.savePrevDataValues=function(){this.form.prevDataValues=this.form.formFields.map((function(e){return{key:e.key,value:e.value}}))},e.prototype.clearData=function(){this.form.toggleMessage(!1),this.form.emptyDataModel()},e.prototype.setReadonlyFields=function(){this.form.formFields.forEach((function(e){e.setReadOnlyState()}))},e.prototype.reset=function(){var e,t=this;this.form.resetFormState(),e=this.getPrevDataValues(),this.form.formFields.forEach((function(n){var i;n.type!==l.DataType.BLOB&&"upload"!==n.widgettype||(t.form.resetFileUploadWidget(n,!0),n.href=t.getBlobURL(e,n.key,n.value)),null===(i=n.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid")})),this.form.constructDataObject()},e.prototype.closeDialog=function(){this.form.isLayoutDialog&&this.dialogService.close(this.form.dialogId)},e.prototype.cancel=function(){this.form.clearMessage(),this.form.isUpdateMode=!1,this.form.reset(),this.form.isSelected&&this.getPrevformFields(),this.form.isUpdateMode=!1,this.form._liveTableParent?this.form._liveTableParent.onCancel():this.closeDialog(),l.$appDigest()},e.prototype.delete=function(e){this.form.resetFormState(),this.form.operationType=i.Live_Operations.DELETE,this.form.prevDataObject=l.getClonedObject(this.form.formdata||{}),this.form.save(void 0,void 0,void 0,e)},e.prototype.saveAndNew=function(){this.save(void 0,!0,!0)},e.prototype.saveAndView=function(){this.save(void 0,!1)},e.prototype.submitForm=function(e){this.save(e)},e.prototype.save=function(e,t,n){var o=this;if(this.form.datasource){var r,a,s,c,p={};if(s=this.form.operationType=this.form.operationType||this.findOperationType(),!this.form.validateFieldsOnSubmit()){r=l.getClonedObject(this.form.constructDataObject()),a=this.form.prevformFields?this.form.constructDataObject(!0):r;try{if(!1===(c=this.form.invokeEventCallback("beforeservicecall",{$event:e,$operation:this.form.operationType,$data:r,options:p})))return;if(c&&c.error)return void this.form.toggleMessage(!0,c.error,"error")}catch(e){if("Abort"===e.message)return}if(this.form.operationType===i.Live_Operations.UPDATE&&this.form.ngform&&this.form.ngform.pristine&&this.form.isSelected&&_.isEqual(r,a))return this.form.toggleMessage(!0,this.form.appLocale.MESSAGE_NO_CHANGES,"info",""),void l.$appDigest();p.row=r,p.transform=!0,p.skipNotification=!0,s===i.Live_Operations.UPDATE&&(p.rowData=this.form.formdata,p.prevData=a),i.performDataOperation(this.form.datasource,p,{operationType:s}).then((function(e){var r,a=s===i.Live_Operations.INSERT?o.form.insertmessage:s===i.Live_Operations.UPDATE?o.form.updatemessage:o.form.deletemessage;return s===i.Live_Operations.DELETE?(r=p.row,o.form.emptyDataModel(),o.form.prevDataValues=[],o.form.isSelected=!1):r=e,o.form.onSuccess||o.form.toggleMessage(!0,a,"success"),o.form._liveTableParent?o.form._liveTableParent.onResult(s,e,n,t):(o.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}),o.onDataSourceUpdate(e,n,t)),{result:r,status:!0}}),(function(e){return o.form.onError||o.form.toggleMessage(!0,e,"error"),l.$appDigest(),{result:e,status:!1}})).then((function(t){o.form.resetFormState(),o.form.onResultCb(t.result,t.status,e)}))}}},e}();X.initializeProps=O(),X.decorators=[{type:t.Directive,args:[{selector:"[wmLiveForm]"}]}],X.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]},{type:h.LiveTableComponent,decorators:[{type:t.Optional}]},{type:i.ToDatePipe},{type:l.AbstractDialogService},{type:String,decorators:[{type:t.Attribute,args:["formlayout"]}]}]},X.propDecorators={onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var J=[x,k,F,V,U,W,z,X],Z=function(){};Z.decorators=[{type:t.NgModule,args:[{imports:[o.BasicModule,n.CommonModule,a.DesignDialogModule,r.InputModule,i.WmComponentsModule],declarations:b([],y(J)),exports:b([],y(J)),entryComponents:[]}]}],e.DependsonDirective=W,e.FormActionDirective=F,e.FormComponent=x,e.FormFieldDirective=V,e.FormModule=Z,e.FormWidgetDirective=k,e.LiveActionsDirective=U,e.LiveFilterDirective=z,e.LiveFormDirective=X,e["\u02750"]=Y,e["\u02751"]=Q,e["\u0275a"]=P,e["\u0275b"]=O,e["\u0275c"]=S,e["\u0275d"]=M,e["\u0275e"]=j,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/dialogs"),require("@wm/components/input"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/dialogs/iframe-dialog",["exports","@angular/core","@angular/common","@wm/components/base","@wm/components/basic","@wm/components/dialogs","@wm/components/input","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.dialogs=e.wm.components.dialogs||{},e.wm.components.dialogs.iframedialog={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.components.basic,e.wm.components.dialogs,e.wm.components.input,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
548
+ ***************************************************************************** */var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function g(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function v(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function b(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var w=new Map([["autocomplete",Object.assign({value:!1},i.PROP_BOOLEAN)],["captionalign",Object.assign({value:"left"},i.PROP_STRING)],["captionposition",Object.assign({value:"left"},i.PROP_STRING)],["captionsize",i.PROP_STRING],["captionwidth",Object.assign({value:"xs-12 sm-3 md-3 lg-3"},i.PROP_STRING)],["class",i.PROP_STRING],["collapsible",i.PROP_BOOLEAN],["dataset",i.PROP_ANY],["datasource",i.PROP_STRING],["expanded",Object.assign({value:!0},i.PROP_BOOLEAN)],["formdatasource",i.PROP_STRING],["name",i.PROP_STRING],["numberOfFields",i.PROP_NUMBER],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["showindevice",Object.assign({displayType:"inline-block",value:"all"},i.PROP_STRING)],["subheading",i.PROP_STRING],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["title",i.PROP_STRING]]),P=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("action",i.PROP_STRING),e.set("defaultmode",Object.assign({value:"Edit"},i.PROP_STRING)),e.set("metadata",i.PROP_STRING),e.set("method",i.PROP_STRING),e.set("postmessage",Object.assign({value:"Data posted successfully"},i.PROP_STRING)),e.set("target",i.PROP_STRING),e.set("enctype",i.PROP_STRING),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Inline"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-form",e)},O=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("defaultmode",Object.assign({value:"View"},i.PROP_STRING)),e.set("formlayout",Object.assign({value:"inline"},i.PROP_STRING)),e.set("insertmessage",Object.assign({value:"Record added successfully"},i.PROP_STRING)),e.set("updatemessage",Object.assign({value:"Record updated successfully"},i.PROP_STRING)),e.set("deletemessage",Object.assign({value:"Record deleted successfully"},i.PROP_STRING)),e.set("errormessage",Object.assign({value:"An error occured. Please try again!"},i.PROP_STRING)),e.set("messagelayout",Object.assign({value:"Toaster"},i.PROP_STRING)),e.set("formdata",i.PROP_STRING),e.set("novalidate",i.PROP_BOOLEAN),e.set("validationtype",Object.assign({value:"default"},i.PROP_STRING)),e.set("iconclass",i.PROP_STRING),i.register("wm-liveform",e)},S=function(){l.isMobileApp()&&w.set("captionwidth",Object.assign({value:"xs-4 sm-4 md-4 lg-4"},i.PROP_STRING));var e=new Map(w);e.set("autoupdate",i.PROP_BOOLEAN),e.set("enableemptyfilter",Object.assign({value:" "},i.PROP_STRING)),e.set("pagesize",Object.assign({value:20},i.PROP_NUMBER)),e.set("iconclass",Object.assign({value:"wi wi-filter-list"},i.PROP_STRING)),i.register("wm-livefilter",e)},E={widgetType:"wm-form",hostClass:"panel app-panel app-form"},T={widgetType:"wm-form",hostClass:"app-form app-login-form"},R={widgetType:"wm-liveform",hostClass:"panel app-panel app-liveform liveform-inline"},A={widgetType:"wm-livefilter",hostClass:"panel app-panel app-livefilter clearfix liveform-inline"},C=function(e,t,n){var i=E;return null!==e?i=R:null!==t?i=A:"app-login"===n&&(i=T),i},I=function(e,t){var n="";return _.forEach(e,(function(e,t){n=n+" "+t+'="'+e+'"'})),'<wm-gridcolumn columnwidth="'+t+'">\n <wm-form-field '+n+"></wm-form-field>\n </wm-gridcolumn>"},D=function(e,t){var n=e.find("form.ng-invalid:visible, [formControlName].ng-invalid:visible").first(),i=t;return n.is("form")&&(i=t&&t.controls[n.attr("formControlName")||n.attr("name")])?D(n,i):{ngForm:i,$ele:n}},N=function(e,t,n){var i,o;if(!t.valid)if(t.controls)_.forEach(t.controls,(function(t,n){N(e,t,n)}));else{var r=e.$element.find('[wmformfield][key="'+n+'"]');r.length||(r=e.$element.find('[wmformfield][name="'+n+'"]')),r.length&&(r[0].setAttribute("__errormsg",r[0].getAttribute("__validationId")),null===(i=r[0].querySelector("input"))||void 0===i||i.setAttribute("aria-invalid",t.invalid),null===(o=r[0].querySelector("input"))||void 0===o||o.setAttribute("aria-describedby",r[0].getAttribute("__validationId"))),t.markAsTouched()}},x=function(e){function t(t,n,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w,P,O){var S=e.call(this,t,C(y,b,w))||this;S.fb=n,S.app=o,S.dialogService=r,S.dynamicComponentProvider=a,S.ngZone=s,S.parentList=c,S.parentForm=p,S.parentPrefab=u,S.parentPartial=d,S.onBeforeSubmitEvt=h,S.onSubmitEvt=m,S.onBeforeRenderEvt=f,S.binddataset=g,S.bindformdata=v,S._widgetClass="",S._captionClass="",S.formFields=[],S.formfields={},S.formWidgets={},S.filterWidgets={},S.buttonArray=[],S.dataoutput={},S.formdata={},S.statusMessage={caption:"",type:""},S.primaryKey=[],S._debouncedUpdateFieldSource=_.debounce(S.updateFieldSource,350),S.validationMessages=[],S._debouncedSubmitForm=l.debounce((function(e){S.ngZone.run((function(){S.submitForm(e)}))}),250),i.styler(S.nativeElement,S),l.removeAttr(S.nativeElement,"title"),S.isUpdateMode=!0,S.dialogId=S.nativeElement.getAttribute("dialogId"),S.ngform=n.group({}),S.bindingValue=P||O;var E=S.ngform.valueChanges.subscribe(S.updateDataOutput.bind(S));return S.registerDestroyListener((function(){return E.unsubscribe()})),S.elScope=S,S.addEventsToContext(S.context),S}return f(t,e),Object.defineProperty(t.prototype,"isLayoutDialog",{get:function(){return this._isLayoutDialog},set:function(e){e&&l.removeClass(this.nativeElement,"panel app-panel liveform-inline"),this._isLayoutDialog=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUpdateMode",{get:function(){return this._isUpdateMode},set:function(e){this._isUpdateMode=e,this.formFields.forEach((function(t){t.setReadOnlyState(e)}))},enumerable:!1,configurable:!0}),t.prototype.submit=function(e){this._debouncedSubmitForm(e)},t.prototype.onReset=function(){this.reset()},t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},Object.defineProperty(t.prototype,"parentFormArray",{get:function(){return this.parentForm&&this.isParentList&&this.parentForm.ngform.get(this.parentList.name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isParentList",{get:function(){if(this.parentList&&this.parentForm&&!l.isDefined(this._formIsInList)){var e=this.$element.closest('.app-livelist[name="'+this.parentList.name+'"]');e.length&&(this._formIsInList=!e.find('form[widget-id="'+this.parentForm.widgetId+'"]').length)}return l.isDefined(this._formIsInList)?this._formIsInList:this.parentList},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var e=this;setTimeout((function(){e.componentRefs.forEach((function(t){t.name&&(e.formWidgets[t.name]=t)}))}),250)},t.prototype.ngAfterViewInit=function(){this.parentForm&&this.parentForm.ngform&&this.isParentList&&(_.get(this.parentForm.ngform.controls,this.parentList.name)||this.parentForm.ngform.setControl(this.parentList.name,new s.FormArray([])),this.parentFormArray.push(this.ngform),this.formArrayIndex=this.parentFormArray.length-1),this.addInnerNgFormToForm(this.bindingValue)},t.prototype.findOperationType=function(){},t.prototype.addInnerNgFormToForm=function(e){if(this.parentForm&&this.parentForm.ngform){if(this.isParentList)return;var t=this.parentPrefab||this.parentPartial;if(t){var n=(this.parentPrefab?t.$element.find("[wmprefabcontainer]"):t.$element).find("form").first();_.get(n[0],"widget.widgetId")===this.widgetId&&(n.isParentList||n.siblings("form").length||(e=_.get(t,"name")))}for(var i=1,o=e;this.parentForm.ngform.controls.hasOwnProperty(o);)o=e+"_"+i,i++;this.formGroupName=o,this.parentForm.ngform.addControl(o,this.ngform)}},t.prototype.addEventsToContext=function(e){var t=this;e.cancel=function(){return t.cancel()},e.reset=function(){return t.reset()},e.save=function(e){return t.save(e)},e.saveAndNew=function(){return t.saveAndNew()},e.saveAndView=function(){return t.saveAndView()},e.delete=function(){return t.delete()},e.new=function(){return t.new()},e.edit=function(){return t.edit()},e.highlightInvalidFields=function(){return t.highlightInvalidFields()},e.filter=function(){return t.filter()},e.clearFilter=function(){return t.clearFilter()},e.submit=function(e){return t.submit(e)}},t.prototype.setValidationOnInnerForms=function(e){var t=this,n=this.getNativeElement().querySelectorAll(".app-form");_.forEach(n,(function(n){var i=n.widget,o=_.get(i,"formGroupName")||i.name;l.isDefined(i.formArrayIndex)&&(o=o+"["+i.formArrayIndex+"]");for(var r=i;_.get(r,"parentForm");){var a=r.parentForm.formGroupName||r.parentForm.name;r.parentForm.parentFormArray&&(a=a+"["+r.parentForm.formArrayIndex+"]"),o=a+"."+o,r=r.parentForm}t.setValidationOnFields(i,o,e)}))},t.prototype.setValidationOnFields=function(e,t,n){var i=this,o=e.ngform.controls,r=e.formFields;r&&_.forEach(o,(function(o,a){var s,l=r.find((function(e){return e.key===a}));!l||n&&!o.touched||(null===(s=l.nativeElement.querySelector("input"))||void 0===s||s.setAttribute("aria-invalid",o.invalid),i.prepareValidationObj(o,a,l,t),i.prepareValidationObj.call(e,o,a,l,t))}))},t.prototype.prepareValidationObj=function(e,t,n,i){var o=this.validationMessages.findIndex((function(e){return e.field===t&&e.fullyQualifiedFormName===i}));e.invalid?-1===o?this.validationMessages.push({field:t,value:n.value,errorType:_.keys(e.errors),message:n.validationmessage||"",getElement:function(){return n.$element.find("[focus-target]")},formName:_.last(i.split(".")),fullyQualifiedFormName:i}):(this.validationMessages[o].value=n.value,this.validationMessages[o].errorType=_.keys(e.errors)):e.valid&&o>-1&&this.validationMessages.splice(o,1)},t.prototype.setValidationMsgs=function(e){!this.formFields.length&&_.isEmpty(this.ngform.controls)||(this.setValidationOnFields(this,this.name,e),this.setValidationOnInnerForms(e))},t.prototype.handleEvent=function(t,n,i,o){"submit"!==n&&e.prototype.handleEvent.call(this,this.nativeElement,n,i,o)},t.prototype.updateFieldSource=function(){var e=this;this.formdatasource&&this.formdatasource.execute(l.DataSource.Operation.IS_API_AWARE)||this.formdatasource&&!this.formdatasource.twoWayBinding||this.formFields.forEach((function(t){t.setFormWidget("datavaluesource",e.formdatasource),t.setFormWidget("binddatavalue",e.bindformdata+"."+t.key)}))},t.prototype.highlightInvalidFields=function(){N(this,this.ngform,"")},t.prototype.validateFieldsOnSubmit=function(){if(this.setValidationMsgs(),"delete"!==this.operationType&&("html"===this.validationtype||"default"===this.validationtype)&&this.ngform&&this.ngform.invalid){if(this.ngform.invalid){"default"===this.validationtype&&this.highlightInvalidFields();var e=D(this.$element,this.ngform),t=e.ngForm,n=e.$ele;if((n=n.parent().find("[focus-target]")).length){n.hasClass("app-search-input")||n.focus();var i=t&&t.controls[n.attr("formControlName")||n.attr("name")];return i&&i.markAsTouched&&i.markAsTouched(),l.$appDigest(),!0}return!0}return!1}return!1},t.prototype.onPropertyChange=function(t,n,i){switch(t){case"captionalign":this.captionAlignClass="align-"+n;break;case"captionposition":case"captionwidth":this.setLayoutConfig();break;case"captionsize":this.captionsize=n;break;case"novalidate":this.widget.validationtype=!0===n||"true"===n?"none":"default";break;case"formdata":if(_.isEqual(n,i))break;_.isArray(n)?this.setFormData(_.last(n)):this.setFormData(n),!this.isDataSourceUpdated&&this.datasource&&this.onDataSourceChange();break;case"defaultmode":this.isLayoutDialog||(this.updateMode=!(!n||"Edit"!==n),this.isUpdateMode=this.updateMode);break;case"datasource":this.onDataSourceChange();break;case"formdatasource":this.onFormDataSourceChange();break;case"metadata":this.generateFormFields();break;case"dataset":this.getFormFields().forEach((function(e){!e.isDataSetBound&&_.get(e.formWidget,"dataset$")&&e.formWidget.dataset$.next()}));break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},t.prototype.onResultCb=function(e,t,n){var i={$event:n,$data:e,$operation:this.operationType};this.invokeEventCallback("result",i),t?this.invokeEventCallback("success",i):this.invokeEventCallback("error",i)},t.prototype.toggleMessage=function(e,t,n,i){var o;e&&t?(o="error"===n&&this.errormessage?this.errormessage:t,"Inline"===this.messagelayout?(o=this.checkAppServiceErrorMsg(n)||o,this.statusMessage={caption:o||"",type:n},this.messageRef&&this.messageRef.showMessage(this.statusMessage.caption,this.statusMessage.type),l.isElementInViewport(this.$element[0])||l.scrollToElement(this.$element[0])):this.app.notifyApp(o,n,i)):this.statusMessage.caption=""},t.prototype.checkAppServiceErrorMsg=function(e){var t=_.get(this.app,"Actions.appNotification");if(t&&"error"===e)return t.getMessage()},t.prototype.clearMessage=function(){this.toggleMessage(!1)},t.prototype.setLayoutConfig=function(){var e;e=i.getFieldLayoutConfig(this.captionwidth,this.captionposition,_.get(this.app.selectedViewPort,"os")),this._widgetClass=e.widgetCls,this._captionClass=e.captionCls,l.$appDigest()},t.prototype.registerFormWidget=function(e){var t=e.name||e.key;this.formWidgets[t]=e},t.prototype.registerFormFields=function(e){var t=this.formFields.push(e);this.formfields[e.key]=e,this.registerFormWidget(e),this._debouncedUpdateFieldSource(),this.parentForm&&(this.parentForm.formFields.push(e),this.parentForm.formfields[e.key]=e,this.parentForm.setFormData(this.parentForm.formdata,this.formFields,this.formdata||{})),t!==this.numberOfFields||_.isEmpty(this.formdata)||(this.onDataSourceChange(),_.isArray(this.formdata)?this.setFormData(_.last(this.formdata)):this.setFormData(this.formdata))},t.prototype.registerActions=function(e){this.buttonArray.push(e)},t.prototype.updateFormDataOutput=function(e){var t=this;_.forEach(this.ngform.value,(function(n,i){_.find(t.formFields,{key:i})||(e[i]=n)})),this.dataoutput=e},t.prototype.constructDataObject=function(){var e=this,t={};return this.getFormFields().forEach((function(n){var i,o;if(o=null===(o=n.datavalue||n._control.value)||""===o?void 0:o,"file"===n.type&&(o=l.getFiles(e.name,n.key+"_formWidget",n.multiple)),i=n.key||n.target||n.name,n.form.widgetId!==e.widgetId&&n.form.formGroupName)(r=_.get(t,n.form.formGroupName,{}))[i]=o,_.set(t,n.form.formGroupName,r);else if(n.form.isParentList){var r;(r=_.get(t,n.form.parentList.name,[]))[n.form.formArrayIndex]=r[n.form.formArrayIndex]||{},r[n.form.formArrayIndex][i]=o,_.set(t,n.form.parentList.name,r)}else _.set(t,i,o)})),this.updateFormDataOutput(t),this.dataoutput},t.prototype.updateDataOutput=function(){this.constructDataObject(),this.ngform.touched&&this.setValidationMsgs(!0)},t.prototype.getFormFields=function(){var e=this;return _.filter(this.formFields,(function(t){return t.form.name===e.name}))},t.prototype.setFieldValue=function(e,t,n){var i=e.key||e.name,o=n||t;o&&((o.hasOwnProperty(i)||_.includes(i,".")&&o.hasOwnProperty(_.split(i,".")[0]))&&(e.value=_.get(o,i)),this.dirty&&!this._triggeredByUser&&this.markAsPristine());var r=e.form.formGroupName;r&&_.get(t,r)&&this.setFormData.call(e.form,t[r]),_.get(e.form,"parentFormArray")&&this.setFormDataFromParentFormData.call(e.form,t)},t.prototype.setFormData=function(e,t,n){var i=this;(t||this.formFields).forEach((function(t){i.setFieldValue(t,e,n),t.fieldValidations&&t.fieldValidations.setCustomValidationMessage()})),this.constructDataObject()},t.prototype.resetFormState=function(){this.validationMessages.length&&(this.validationMessages=[]),this.ngform&&(this.ngform.markAsUntouched(),this.ngform.markAsPristine())},t.prototype.reset=function(){var e=this;this.resetFormState(),this.formFields.forEach((function(t){var n;t.value="","upload"!==t.widgettype&&t.type!==l.DataType.BLOB||e.resetFileUploadWidget(t,!0),null===(n=t.nativeElement.querySelector("input"))||void 0===n||n.removeAttribute("aria-invalid")})),this.constructDataObject(),this.clearMessage()},t.prototype.savePrevformFields=function(){this.prevformFields=l.getClonedObject(this.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},t.prototype.savePrevDataValues=function(){this.prevDataValues=this.formFields.map((function(e){return{key:e.key,value:e.value}}))},t.prototype.setReadonlyFields=function(){this.formFields.forEach((function(e){e.setReadOnlyState()}))},t.prototype.resetFileUploadWidget=function(e,t){this.$element.find('[name="'+e.key+'_formWidget"]').val(""),e._control.reset(),t||(e.href="",e.value=null)},t.prototype.emptyDataModel=function(){var e=this;this.formFields.forEach((function(t){l.isDefined(t)&&(t.type===l.DataType.BLOB?e.resetFileUploadWidget(t):t.datavalue="")}))},t.prototype.setDefaultValues=function(){var e=this;this.formFields.forEach((function(t){e.onFieldDefaultValueChange(t,t.defaultvalue)}))},t.prototype.setOperationType=function(e){this.operationType=e||"insert"},t.prototype.new=function(){var e=this;this.resetFormState(),this.operationType=i.Live_Operations.INSERT,this.clearMessage(),this.isSelected&&this.savePrevformFields(),this.emptyDataModel(),setTimeout((function(){e.setDefaultValues(),e.savePrevDataValues(),e.constructDataObject()})),this.isUpdateMode=!0},t.prototype.edit=function(){this.resetFormState(),this.clearMessage(),this.operationType=i.Live_Operations.UPDATE,this.isSelected&&(this.savePrevformFields(),this.savePrevDataValues()),this.prevDataObject=l.getClonedObject(this.formdata||{}),this.setReadonlyFields(),this.isUpdateMode=!0,l.$appDigest()},t.prototype.triggerWMEvent=function(e){var t=this.nativeElement.getAttribute("dependson");t&&(l.$invokeWatchers(!0),this.app.notify("wm-event",{eventName:e,widgetName:t}))},t.prototype.submitForm=function(e){var t,n,o,r=this,a=this.datasource;if(!this.validateFieldsOnSubmit()){n=l.getClonedObject(this.constructDataObject());var s=function(){return{$event:e,$formData:n,$data:n}};if(this.onBeforeSubmitEvt){if(!1===this.invokeEventCallback("beforesubmit",s()))return;this.resetFormState()}else this.resetFormState();if(this.onSubmitEvt||a)if(a){var c=a.pagination&&a.pagination.number+1,p=this.operationType?this.operationType:"insert";i.performDataOperation(a,n,{operationType:p}).then((function(e){return"wm.CrudVariable"===a.category&&(r.triggerWMEvent("resetEditMode"),r.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list",page:c,preventMissingOpMsg:!0}),r.dialogId&&r.closeDialog()),l.isDefined(e.body)?(o=l.getValidJSON(e.body),o=l.isDefined(o)?o:e.body):o=e,{result:o,status:!0,message:r.postmessage,type:"success"}}),(function(e){return t=r.errormessage||e.error||e,l.$appDigest(),{result:_.get(e,"error")||e,status:!1,message:t,type:"error"}})).then((function(t){("error"===t.type&&!r.onError||"success"===t.type&&!r.onSuccess)&&r.toggleMessage(!0,t.message,t.type),r.invokeEventCallback("submit",s()),r.onResultCb(t.result,t.status,e)}))}else this.invokeEventCallback("submit",s()),this.onResultCb({},!0,e);else this.onResultCb({},!0,e)}},t.prototype.closeDialog=function(){this.dialogService.close(this.dialogId)},t.prototype.showButtons=function(e){var t=this;return _.some(this.buttonArray,(function(n){return _.includes(n.position,e)&&n.updateMode===t.isUpdateMode}))},t.prototype.expandCollapsePanel=function(){this.collapsible&&(this.expanded=!this.expanded)},t.prototype.onDataSourceUpdate=function(e,t,n){t?this.new():(this.setFormData(e),this.closeDialog()),this.isUpdateMode=!l.isDefined(n)||n},t.prototype.getNearestParentFormData=function(e){return e.parentForm?e.bindformdata||!_.get(e.parentForm,"formdata")||_.isEmpty(e.parentForm.formdata)?this.getNearestParentFormData(e.parentForm):e.parentForm.formdata:{}},t.prototype.setFormDataFromParentFormData=function(e){if(_.isEmpty(this.formdata)&&this.parentForm&&e)if(this.parentFormArray){var t=_.get(e,this.parentList.name);if(t)_.isArray(t)||(t=[t]),this.parentFormArray.patchValue(t),this.bindformdata||(this.formdata=t[this.formArrayIndex]),this.setFormData(this.formdata);else if(this.isParentList&&this.parentForm.formGroupName){var n=_.get(e,this.parentForm.formGroupName);this.setFormDataFromParentFormData(n)}}else this.setFormData(e)},t.prototype.onDataSourceChange=function(){if(_.get(this.formFields,"length")&&!this.bindformdata){this.isDataSourceUpdated=!0;var e=this.getNearestParentFormData(this);this.setFormDataFromParentFormData(e)}},t.prototype.onFormDataSourceChange=function(){this.updateFieldSource()},t.prototype.onFieldDefaultValueChange=function(e,t){e.value=i.parseValueByType(t,void 0,e.widgettype,e.trailingzero),this.dirty&&!this._triggeredByUser&&this.markAsPristine()},t.prototype.onFieldValueChange=function(){},t.prototype.generateFormFields=function(){return g(this,void 0,void 0,(function(){var e,t,n,i,o,r,a,s,c,p,u;return v(this,(function(d){switch(d.label){case 0:if(_.isUndefined(this._isGridLayoutPresent)&&(this._isGridLayoutPresent=this.$element.find(".panel-body [wmlayoutgrid]").length>0),this._isGridLayoutPresent?(t=this.$element.find(".form-elements [wmlayoutgrid]").first(),e=Number(t.attr("columns"))||1):((t=this.$element.find(".form-elements .dynamic-form-container")).length||(this.$element.find(".form-elements").prepend('<div class="dynamic-form-container"></div>'),t=this.$element.find(".form-elements .dynamic-form-container")),e=1),n=12/e,i="",o=0,s=this.metadata?this.metadata.data||this.metadata:[],this.formFields=[],_.isEmpty(s))return[2];if(this.onBeforeRenderEvt&&(a=this.invokeEventCallback("beforerender",{$metadata:s}))&&(s=a),!_.isArray(s))return[2];for(;s[o];){for(c="",r=0;r<e;r++)s[o]&&(c+=I(s[o],n)),o++;i+="<wm-gridrow>"+c+"</wm-gridrow>"}return this._isGridLayoutPresent||(i="<wm-layoutgrid>"+i+"</wm-layoutgrid>"),this.dynamicFormRef.clear(),this._dynamicContext||(this._dynamicContext=Object.create(this.viewParent),this._dynamicContext.form=this),[4,this.dynamicComponentProvider.getComponentFactoryRef("app-form-dynamic-"+this.widgetId,i,{noCache:!0,transpile:!0})];case 1:return p=d.sent(),u=this.dynamicFormRef.createComponent(p,0,this.inj),l.extendProto(u.instance,this._dynamicContext),t[0].appendChild(u.location.nativeElement),this.setFormData(this.formdata),[2]}}))}))},Object.defineProperty(t.prototype,"mode",{get:function(){return this.operationType||this.findOperationType()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.ngform&&this.ngform.dirty},enumerable:!1,configurable:!0}),t.prototype.markAsPristine=function(e){void 0===e&&(e=!1),this.ngform.markAsPristine({onlySelf:e})},t.prototype.markAsDirty=function(e){void 0===e&&(e=!1),this.ngform.markAsDirty({onlySelf:e})},Object.defineProperty(t.prototype,"invalid",{get:function(){return this.ngform&&this.ngform.invalid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.ngform&&this.ngform.touched},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.ngform&&this.ngform.valid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.ngform&&this.ngform.pristine},enumerable:!1,configurable:!0}),t.prototype.markAsTouched=function(e){void 0===e&&(e=!1),this.ngform.markAsTouched({onlySelf:e})},t.prototype.markAsUntouched=function(e){void 0===e&&(e=!1),this.ngform.markAsUntouched({onlySelf:e})},t.prototype.invokeActionEvent=function(e,t){l.$parseEvent(t)(this.viewParent,Object.assign(this.context,{$event:e}))},t.prototype.ngOnDestroy=function(){var t=this.parentForm&&_.get(this.parentForm,"ngform.controls");t&&(_.get(this.parentList,"name")&&t.hasOwnProperty(this.parentList.name)&&this.parentForm.ngform.removeControl(this.parentList.name),this.formGroupName&&t.hasOwnProperty(this.formGroupName)?this.parentForm.ngform.removeControl(this.formGroupName):this.parentForm.ngform.removeControl(this.name)),e.prototype.ngOnDestroy.call(this)},t}(i.StylableComponent);x.initializeProps=P(),x.decorators=[{type:t.Component,args:[{selector:"form[wmForm]",template:'<ng-template #content><ng-content></ng-content></ng-template>\n\n<ng-container *ngIf="formlayout === \'page\'; then pageLayoutTemplate else defaultTemplate">\n</ng-container>\n\n<ng-template #defaultTemplate>\n <div class="panel-heading" *ngIf="!isLayoutDialog && (title || subheading || iconclass || showButtons(\'header\'))">\n <h3 class="panel-title">\n <div class="pull-left">\n <i class="app-icon panel-icon" aria-hidden="true" [ngClass]="iconclass" *ngIf="iconclass"></i>\n </div>\n <div class="pull-left">\n <div class="heading" [innerHTML]="title"></div>\n <div class="description" [innerHTML]="subheading"></div>\n </div>\n <div class="form-action panel-actions basic-btn-grp">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'header\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n <button type="button" class="app-icon wi panel-action" *ngIf="collapsible" title="Collapse/Expand"\n [ngClass]="expanded ? \'wi-minus\': \'wi-plus\'" (click)="expandCollapsePanel();"></button>\n </div>\n </h3>\n </div>\n <div class="panel-body" [ngClass]="{\'form-elements\': isLayoutDialog, \'form-body\': !isLayoutDialog}" [class.hidden]="!expanded">\n <p wmMessage [hidden]="!statusMessage.caption.toString()" [attr.aria-hidden]="!statusMessage.caption" [attr.aria-label]="statusMessage.caption" caption.bind="statusMessage.caption" type.bind="statusMessage.type"></p>\n <div [ngClass]="{\'form-elements\': !isLayoutDialog, \'form-content\': isLayoutDialog}">\n <ng-container *ngTemplateOutlet="content"></ng-container>\n </div>\n <div class="basic-btn-grp form-action panel-footer clearfix" [ngClass]="{\'modal-footer\': isLayoutDialog}" [class.hidden]="!expanded || !showButtons(\'footer\')">\n <ng-container *ngFor="let btn of buttonArray | filter : \'position\' : \'footer\'"\n [ngTemplateOutlet]="btn.widgetType === \'button\' ? buttonRef : anchorRef" [ngTemplateOutletContext]="{btn:btn}">\n </ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #pageLayoutTemplate>\n <ng-container *ngTemplateOutlet="content"></ng-container>\n</ng-template>\n\n<ng-template #buttonRef let-btn="btn">\n <button wmButton name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" type.bind="btn.type" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey" disabled.bind="ngform.status === \'PENDING\' || btn.disabled"\n tabindex.bind="btn.tabindex" [attr.aria-label]="btn.displayName" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></button>\n</ng-template>\n\n<ng-template #anchorRef let-btn="btn">\n <a wmAnchor name="{{btn.key}}" caption.bind="btn.displayName" class.bind="btn.class" iconclass.bind="btn.iconclass" show.bind="btn.show"\n (click)="invokeActionEvent($event, btn.action)" hint.bind="btn.title" shortcutkey.bind="btn.shortcutkey"\n hyperlink.bind="btn.hyperlink" target.bind="btn.target"\n tabindex.bind="btn.tabindex" [class.hidden]="btn.updateMode ? !isUpdateMode : isUpdateMode"></a>\n</ng-template>\n\n<ng-container #dynamicForm></ng-container>\n',providers:[i.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector},{type:s.FormBuilder},{type:l.App},{type:l.AbstractDialogService},{type:l.DynamicComponentRefProvider},{type:t.NgZone},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:x,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:c.PrefabDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:i.PartialDirective,decorators:[{type:t.SkipSelf},{type:t.Optional}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforesubmit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["submit.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["beforerender.event"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["formdata.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveForm"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["wmLiveFilter"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["data-role"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]}]},x.propDecorators={dynamicFormRef:[{type:t.ViewChild,args:["dynamicForm",{static:!0,read:t.ViewContainerRef}]}],messageRef:[{type:t.ViewChild,args:[i.MessageComponent]}],componentRefs:[{type:t.ContentChildren,args:[i.WidgetRef,{descendants:!0}]}],action:[{type:t.HostBinding,args:["action"]}],submit:[{type:t.HostListener,args:["submit",["$event"]]}],onReset:[{type:t.HostListener,args:["reset"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var k=function(){function e(e,t,n,i,o,r){var a=this;this.componentInstance=n,this.name=o,this.key=r,this.fb=i,this.parent=e||t,this.ngform=this.parent.ngform,this.componentInstance.registerPropertyChangeListener((function(e,t){"datavalue"===e&&a._control?a._control.setValue(t):"name"!==e||a._control||a.addControl(a.key||t)}))}return Object.defineProperty(e.prototype,"_control",{get:function(){var e=this.key||this.name;if(e)return this.ngform&&this.ngform.controls[e]},enumerable:!1,configurable:!0}),e.prototype.addControl=function(e){this.ngform.addControl(e,this.createControl())},e.prototype.createControl=function(){return this.fb.control(this.componentInstance.datavalue)},e.prototype.ngOnInit=function(){var e=this.key||this.name;e&&!this._control&&(this.addControl(e),this.parent.registerFormWidget(this.componentInstance))},e}();k.decorators=[{type:t.Directive,args:[{selector:"[wmFormWidget]"}]}],k.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[x]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[u.TableComponent]}]},{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[i.WidgetRef]}]},{type:s.FormBuilder},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]}]};var M=function(){i.register("wm-form-action",new Map([["accessroles",i.PROP_STRING],["action",i.PROP_STRING],["class",i.PROP_STRING],["binding",i.PROP_STRING],["disabled",i.PROP_BOOLEAN],["display-name",i.PROP_STRING],["hyperlink",i.PROP_STRING],["iconclass",i.PROP_STRING],["iconname",i.PROP_STRING],["key",i.PROP_STRING],["position",Object.assign({value:"footer"},i.PROP_STRING)],["shortcutkey",i.PROP_STRING],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},i.PROP_NUMBER)],["target",i.PROP_STRING],["title",i.PROP_STRING],["type",Object.assign({value:"button"},i.PROP_STRING)],["update-mode",Object.assign({value:!0},i.PROP_BOOLEAN)],["widget-type",Object.assign({value:"button"},i.PROP_STRING)]]))},L={widgetType:"wm-form-action",hostClass:""},F=function(e){function t(t,n){var i=e.call(this,t,L)||this;return i.form=n,i}return f(t,e),t.prototype.populateAction=function(){this.buttonDef={key:this.key||this.binding,displayName:this["display-name"],show:this.show,class:this.class?this.class:"button"===this["widget-type"]?"btn-secondary":"",iconclass:this.iconclass||"",title:_.isUndefined(this.title)?this["display-name"]||"":this.title,action:this.action,accessroles:this.accessroles,shortcutkey:this.shortcutkey,disabled:this.disabled,tabindex:this.tabindex,iconname:this.iconname,type:this.type,updateMode:this["update-mode"],position:this.position,widgetType:this["widget-type"],hyperlink:this.hyperlink,target:this.target},this._propsInitialized=!0},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.populateAction(),this.form.registerActions(this.buttonDef)},t.prototype.onPropertyChange=function(e,t,n){if(this._propsInitialized)switch(e){case"display-name":this.buttonDef.displayName=t;default:this.buttonDef[e]=t}},t}(i.BaseComponent);F.initializeProps=M(),F.decorators=[{type:t.Directive,args:[{selector:"[wmFormAction]",providers:[i.provideAsWidgetRef(F)]}]}],F.ctorParameters=function(){return[{type:t.Injector},{type:x,decorators:[{type:t.Optional}]}]};var j=function(){var e=new Map([["dataentrymode",Object.assign({value:"default"},i.PROP_STRING)],["debouncetime",Object.assign({value:250},i.PROP_NUMBER)],["defaultvalue",i.PROP_STRING],["displayname",i.PROP_STRING],["display-name",i.PROP_STRING],["field",i.PROP_STRING],["filterexpressions",i.PROP_STRING],["filter-on",i.PROP_STRING],["generator",i.PROP_STRING],["hint",i.PROP_STRING],["inputtype",i.PROP_STRING],["is-primary-key",i.PROP_BOOLEAN],["is-range",i.PROP_BOOLEAN],["is-related",i.PROP_BOOLEAN],["isformfield",{value:!0}],["key",i.PROP_STRING],["limit",i.PROP_NUMBER],["lookup-type",i.PROP_STRING],["lookup-field",i.PROP_STRING],["name",i.PROP_STRING],["matchmode",i.PROP_STRING],["maxdefaultvalue",i.PROP_STRING],["maxplaceholder",i.PROP_STRING],["mobile-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["period",i.PROP_BOOLEAN],["pc-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["placeholder",i.PROP_STRING],["primary-key",i.PROP_BOOLEAN],["related-entity-name",i.PROP_STRING],["required",i.PROP_BOOLEAN],["show",Object.assign({value:!0},i.PROP_BOOLEAN)],["tablet-display",Object.assign({value:!0},i.PROP_BOOLEAN)],["type",i.PROP_STRING],["validationmessage",i.PROP_STRING],["viewmodewidget",i.PROP_STRING],["widgettype",i.PROP_STRING]]),t=function(t){var n="wm-form-field-"+l.FormWidgetType[t],o=i.getWidgetPropsByType(n);e.forEach((function(e,t){null==o.get(t)&&o.set(t,e)}))};for(var n in l.FormWidgetType)t(n)},B=function(){return{custom:!0}},G={image:"image/*",video:"video/*",audio:"audio/*"},V=function(e){function t(t,n,i,o,r,a,s,c,p,u,d,h,m,f,g,v,y,b,w){var P=this,_={widgetType:"wm-form-field",hostClass:"",widgetSubType:"wm-form-field-"+(d||l.FormWidgetType.TEXT).trim()},O=l.noop;return(P=e.call(this,t,_,new Promise((function(e){return O=e})))||this)._initPropsRes=O,P.app=r,P.fieldDefConfig={},P.class="",P.binddataset=c,P.binddisplayimagesrc=m,P.binddisplayexpression=p,P.bindChipclass=s,P.binddisplaylabel=u,P.form=n,P.fb=i,P.viewport=o,P._fieldName=f||h,P.isRange=g,P.excludeProps=new Set(["type","name"]),P.widgettype=d,P.parentList=a,P.notifyForFields=[],(P.binddataset||P.$element.attr("dataset"))&&(P.isDataSetBound=!0),w[0]._onFocusField=P._onFocusField.bind(P),w[0]._onBlurField=P._onBlurField.bind(P),P._debounceSetUpValidators=l.debounce((function(){return P.setUpValidators()}),500),P}return f(t,e),t.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},t.prototype.handleClick=function(e){this._clicktriggeredByUser=!0},t.prototype._onFocusField=function(e){this._activeField=!0,$(e.target).closest(".live-field").addClass("active")},t.prototype._onBlurField=function(e){var t,n,i,o;$(e.target).closest(".live-field").removeClass("active");this.nativeElement.querySelector("p.text-danger");this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",""+this.ngform.controls[this._fieldName].invalid),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this._activeField=!1,this._triggeredByUser=!1,this._clicktriggeredByUser=!1},t.prototype.evaluateExpr=function(e,t,n){if(n&&t||(t=Object.keys(e)[0]))return i.getEvaluatedData(e,{field:t,expression:n},this.viewParent)},t.prototype.getDisplayExpr=function(){var e=this,t=[],n=this.value,i=this.displayfield||this.displaylabel,o=this.displayexpression;return _.isObject(n)?(_.isArray(n)?_.forEach(n,(function(n){_.isObject(n)&&t.push(e.evaluateExpr(n,i,o))})):t.push(this.evaluateExpr(n,i,o)),_.join(t,",")):null==n?"":this.value},t.prototype.getCaption=function(){return void 0===this.value||null===this.value?_.get(this.form.dataoutput,this._fieldName)||"":this.value},t.prototype.notifyChanges=function(){_.forEach(this.notifyForFields,(function(e){e.fieldValidations.validate()}))},t.prototype.observeOn=function(e){this.fieldValidations.observeOn(e,"formfields")},t.prototype.setUpValidators=function(e){this.fieldValidations.setUpValidators(e)},t.prototype.setAsyncValidators=function(e){this.fieldValidations.setAsyncValidators(e)},t.prototype.setValidators=function(e){this.fieldValidations.setValidators(e)},t.prototype.setFormWidget=function(e,t){this.formWidget&&this.formWidget.widget&&(this.formWidget.widget[e]=t)},t.prototype.boundFn=function(e){return e()},t.prototype.setMaxFormWidget=function(e,t){this.formWidgetMax&&(this.formWidgetMax.widget[e]=t)},t.prototype.onPropertyChange=function(t,n,i){var o=this.form.dirty;if("tabindex"!==t&&e.prototype.onPropertyChange.call(this,t,n,i),!this.excludeProps.has(t)){if(this.widgettype===l.FormWidgetType.UPLOAD)return"required"===t&&this._debounceSetUpValidators(),void e.prototype.onPropertyChange.call(this,t,n,i);switch(this.setFormWidget(t,n),"placeholder"!==t&&this.setMaxFormWidget(t,n),t){case"defaultvalue":this.form.onFieldDefaultValueChange(this,n);break;case"maxdefaultvalue":this.maxValue=n,this.setMaxFormWidget("datavalue",n),this.form.onMaxDefaultValueChange();break;case"maxplaceholder":this.setMaxFormWidget("placeholder",n);break;case"required":o!==this.form.dirty&&this.form.markAsPristine();case"maxchars":case"minvalue":case"maxvalue":case"regexp":case"show":this._debounceSetUpValidators();break;case"primary-key":n&&this.form.setPrimaryKey(this._fieldName);break;case"display-name":this.displayname=n;break;case"readonly":this.setReadOnlyState()}}},t.prototype.onStyleChange=function(t,n,i){this.setFormWidget(t,n),this.setMaxFormWidget(t,n),e.prototype.onStyleChange.call(this,t,n,i)},Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.formWidget&&this.formWidget.datavalue},set:function(e){this._control&&this.widgettype!==l.FormWidgetType.UPLOAD&&this._control.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.datavalue},set:function(e){this.datavalue=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.formWidgetMax&&this.formWidgetMax.datavalue},set:function(e){this._maxControl&&this._maxControl.setValue(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minValue",{get:function(){return this.value},set:function(e){this.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_control",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_maxControl",{get:function(){return this.ngform&&this.ngform.controls[this._fieldName+"_max"]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayValue",{get:function(){return this.formWidget&&this.formWidget.displayValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this.formWidget&&this.formWidget.timestamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"charlength",{get:function(){return this.formWidget&&this.formWidget.charlength},enumerable:!1,configurable:!0}),t.prototype.createControl=function(){return this.fb.control(void 0,{validators:this._validators})},t.prototype.onValueChange=function(e){var t,n,i,o;if(!this.isDestroyed){var r=$(this.nativeElement).find(".caption-floating");if(r.length>0){var a=l.isDefined(e)&&""!==e&&null!==e||r.find("input").val()||r.find("input:-webkit-autofill").length;this.app.notify("captionPositionAnimate",{displayVal:a,nativeEl:r,isSelectMultiple:this.formWidget&&this.formWidget.multiple,isFocused:this._activeField})}this.ngform.controls[this._fieldName].invalid&&this.ngform.controls[this._fieldName].touched&&this.form.isUpdateMode?(this.nativeElement.setAttribute("__errormsg",""+this.nativeElement.getAttribute("__validationId")),null===(t=this.nativeElement.querySelector("input"))||void 0===t||t.setAttribute("aria-invalid",this._triggeredByUser&&this.ngform.controls[this._fieldName].invalid?"true":"false"),null===(n=this.nativeElement.querySelector("input"))||void 0===n||n.setAttribute("aria-describedby",""+this.nativeElement.getAttribute("__validationId"))):(this.nativeElement.removeAttribute("__errormsg"),null===(i=this.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid"),null===(o=this.nativeElement.querySelector("input"))||void 0===o||o.removeAttribute("aria-describedby")),this.form.onFieldValueChange(this,e),this.notifyChanges(),(this.$element.find(".active").length>0||this.form.touched)&&((this._triggeredByUser||l.isMobile()&&this._clicktriggeredByUser&&l.isDateTimeType(this.widgettype))&&this.ngform.controls[this._fieldName].markAsTouched(),this.fieldValidations.setCustomValidationMessage())}},t.prototype.onStatusChange=function(e){this.isDestroyed||(this.showPendingSpinner="PENDING"===e,"PENDING"===e?this.formWidget.disabled=!0:this.formWidget.disabled!==this.disabled&&(this.formWidget.disabled=this.disabled))},t.prototype.setValidationMessage=function(e){var t=this;setTimeout((function(){t.validationmessage=e,t.setUpValidators(B)}))},t.prototype.setReadOnlyState=function(){var e;e=!this.form.isUpdateMode||(!this["primary-key"]||this["is-related"]||this.period?this.readonly:!("assigned"===this.generator&&"update"!==this.form.operationType)),this.setFormWidget("readonly",e)},t.prototype.resetDisplayInput=function(){l.isDefined(this.value)&&""!==this.value||this.formWidget&&this.formWidget.resetDisplayInput&&this.formWidget.resetDisplayInput()},t.prototype.triggerUploadEvent=function(e,t){var n={$event:e};"change"===t&&(n.newVal=e.target.files,n.oldVal=this._oldUploadVal,this._oldUploadVal=n.newVal),this.invokeEventCallback(t,n)},t.prototype.registerFormField=function(){var e=this._fieldName;if(this.parentList&&this.form.parentList!==this.parentList){for(var t=1,n=e;this.ngform.controls.hasOwnProperty(n);)n=e+"_"+t,t++;this.ngform.addControl(n,this.createControl()),this._fieldName=n}else this.ngform.addControl(e,this.createControl());var i=this._control.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return i.unsubscribe()}));var o=this._control.statusChanges.pipe(d.debounceTime(100)).subscribe(this.onStatusChange.bind(this));if(this.registerDestroyListener((function(){return o.unsubscribe()})),"true"===this.isRange){this.ngform.addControl(e+"_max",this.createControl());var r=this._maxControl.valueChanges.pipe(d.debounceTime(200)).subscribe(this.onValueChange.bind(this));this.registerDestroyListener((function(){return r.unsubscribe()}))}this.value=_.get(this.form.formdata,this._fieldName)},t.prototype.ngOnInit=function(){this.ngform=this.form.ngform,this.registerFormField(),this.fieldValidations=new i.BaseFieldValidations(this,this.formWidget,this.widgettype,this._control,this.form),e.prototype.ngOnInit.call(this)},t.prototype.ngAfterContentInit=function(){var t=this;e.prototype.ngAfterContentInit.call(this),this.formWidget&&(this._initPropsRes(),this.setFormWidget("binddisplaylabel",this.binddisplaylabel),this.setFormWidget("binddisplayexpression",this.binddisplayexpression),this.setFormWidget("binddisplayimagesrc",this.binddisplayimagesrc),this.setFormWidget("bindChipclass",this.bindChipclass),this.setFormWidget("binddataset",this.binddataset)),this.registerReadyStateListener((function(){if(t.key=t._fieldName||t.target||t.binding,t.viewmodewidget=t.viewmodewidget||i.getDefaultViewModeWidget(t.widgettype),t.widgettype===l.FormWidgetType.UPLOAD){var e;e=t.filetype?G[t.filetype]:"",t.permitted=e+(t.extensions?(e?",":"")+t.extensions:"")}l.isMobile()&&t.viewport.isMobileType?t["mobile-display"]||(t.widget.show=!1):t.viewport.isTabletType?t["tablet-display"]||(t.widget.show=!1):t["pc-display"]||(t.widget.show=!1),t.fieldDefConfig.displaname=t.displayname,t.fieldDefConfig.show=t.show,t.fieldDefConfig.isRelated=t["is-related"],t.fieldDefConfig.inputtype=t.inputtype,t.fieldDefConfig.generator=t.generator,t.fieldDefConfig.placeholder=t.placeholder,t.fieldDefConfig.primaryKey=t["primary-key"],t.fieldDefConfig.required=t.required,t.fieldDefConfig._readonly=t.readonly,t.fieldDefConfig.regexp=t.regexp,t.fieldDefConfig.type=t.type,t.fieldDefConfig.key=t.key,t.fieldDefConfig.mobileDisplay=t["mobile-display"],t.fieldDefConfig.name=t.name,t.fieldDefConfig.pcDisplay=t["pc-display"],t.fieldDefConfig.tabletDisplay=t["tablet-display"],t.fieldDefConfig.validationmessage=t.validationmessage,t.fieldDefConfig.viewmodewidget=t.viewmodewidget,t.fieldDefConfig.widget=t.widgettype,t.form.registerFormFields(t.widget),l.addForIdAttributes(t.nativeElement),t.setReadOnlyState()}))},t}(i.StylableComponent);V.initializeProps=j(),V.decorators=[{type:t.Directive,args:[{selector:"[wmFormField]",exportAs:"wmFormField",providers:[i.provideAsWidgetRef(V),i.provideAs(V,s.NG_VALUE_ACCESSOR,!0),{provide:i.Context,useValue:{},multi:!0}]}]}],V.ctorParameters=function(){return[{type:t.Injector},{type:x},{type:s.FormBuilder},{type:l.Viewport},{type:l.App},{type:p.ListComponent,decorators:[{type:t.Optional}]},{type:String,decorators:[{type:t.Attribute,args:["chipclass.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["dataset.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayexpression.bind"]}]},{type:String,decorators:[{type:t.Attribute,args:["displaylabel.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["widgettype"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["name"]}]},{type:String,decorators:[{type:t.Attribute,args:["displayimagesrc.bind"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["key"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["is-range"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["pc-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["mobile-display"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["tablet-display"]}]},{type:Array,decorators:[{type:t.Self},{type:t.Inject,args:[i.Context]}]}]},V.propDecorators={formWidget:[{type:t.ContentChild,args:["formWidget",{static:!0}]}],formWidgetMax:[{type:t.ContentChild,args:["formWidgetMax"]}],onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var U=function(){function e(e,t,n){this.subscribedWidget=e,this.app=t,this.dialogService=n,e.addRow=this.addRow.bind(this),e.updateRow=this.updateRow.bind(this),e.deleteRow=this.deleteRow.bind(this),e.call=this.call.bind(this)}return e.prototype.addRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.INSERT,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.updateRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.UPDATE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.deleteRow=function(){this.app.notify("wm-event",{eventName:i.Live_Operations.DELETE,widgetName:this.subscribedWidget.name,row:this.subscribedWidget.selecteditem})},e.prototype.successHandler=function(e,t){l.triggerFn(e.success,t)},e.prototype.errorHandler=function(e,t){this.app.notifyApp(t,"error","ERROR"),l.triggerFn(e.error,t)},e.prototype.getRecords=function(e,t){var n,o,r=this;"None"!==this.subscribedWidget.navigation&&this.subscribedWidget.dataNavigator?(o=this.subscribedWidget.dataNavigator,t===i.Live_Operations.DELETE?(o.dataSize-=1,o.calculatePagingValues(),n=o.pageCount<o.dn.currentPage?"prev":void 0):("last"===(n=t===i.Live_Operations.INSERT?"last":"current")&&(o.dataSize+=1),o.calculatePagingValues()),o.navigatePage(n,null,!0,(function(t){r.successHandler(e,t)}))):this.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(t){r.successHandler(e,t)}),(function(t){r.errorHandler(e,t)}))},e.prototype.performCUDOperation=function(e,t,n){var o=this;i.performDataOperation(this.subscribedWidget.datasource,e,{operationType:t}).then((function(e){e.error?o.errorHandler(n,e.error):("wm.CrudVariable"===o.subscribedWidget.datasource.category&&"delete"===t?o.subscribedWidget.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}).then((function(e){o.successHandler(n,e)}),(function(e){o.errorHandler(n,e)})):o.getRecords(n,t),"delete"===t&&o.app.notifyApp(o.app.appLocale.MESSAGE_DELETE_RECORD_SUCCESS,"success"))}),(function(e){o.errorHandler(n,e)}))},e.prototype.insertRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.updateRecord=function(e,t,n){this.performCUDOperation(e,t,n)},e.prototype.deleteRecord=function(e,t,n){var i=this;this.dialogService.showAppConfirmDialog({title:this.app.appLocale.MESSAGE_DELETE_RECORD||"Delete Record",iconclass:"wi wi-delete fa-lg",message:this.subscribedWidget.confirmdelete||"Are you sure you want to delete this?",oktext:this.subscribedWidget.deleteoktext||"Ok",canceltext:this.subscribedWidget.deletecanceltext||"Cancel",onOk:function(){i.performCUDOperation(e,t,n),i.dialogService.closeAppConfirmDialog()},onCancel:function(){l.triggerFn(n.cancelDeleteCallback),i.dialogService.closeAppConfirmDialog()}})},e.prototype.performOperation=function(e,t){var n={row:t.row,prevData:{},rowData:{},transform:!0,skipNotification:!0};switch(e===i.Live_Operations.UPDATE&&(n.rowData=t.rowData,n.prevData=t.prevData),e){case i.Live_Operations.INSERT:this.insertRecord(n,e,t);break;case i.Live_Operations.UPDATE:this.updateRecord(n,e,t);break;case i.Live_Operations.DELETE:this.deleteRecord(n,e,t);break;case i.Live_Operations.READ:this.getRecords(t,e)}},e.prototype.call=function(e,t,n,i){t.success=n,t.error=i,this.performOperation(e,t)},e}();U.decorators=[{type:t.Directive,args:[{selector:"[wmLiveActions]"}]}],U.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[p.ListComponent]}]},{type:l.App},{type:l.AbstractDialogService}]};var W=function(){function e(e,t,n,i){this.dialogService=n,this.app=i,e&&(this.isLayoutDialog=!0,this.dialogId=e),this.dependson=t,this.eventSubscription=this.app.subscribe("wm-event",this.handleEvent.bind(this))}return e.prototype.openFormDialog=function(){this.dialogService.open(this.dialogId)},e.prototype.onUpdate=function(e,t,n){this.editMode=n||this.editMode,this.form.operationType=i.Live_Operations.UPDATE,this.form.isSelected=!0;var o=this.currentFormData;e&&t&&(o=t.multiselect?e[0]:e[e.length-1]),this.form.setFormData(o),this.form.edit(),this.editMode||(this.form.isUpdateMode=!1)},e.prototype.onInsert=function(){this.form.operationType=i.Live_Operations.INSERT,this.form.isSelected=!0,this.form.setFormData({}),this.form.new()},e.prototype.handleEvent=function(e){if(this.dependson===e.widgetName)switch(this.currentOp=e.eventName,e.eventName){case i.Live_Operations.UPDATE:this.currentFormData=e.row,this.isLayoutDialog?this.openFormDialog():this.onUpdate(void 0,void 0,!0);break;case i.Live_Operations.INSERT:this.isLayoutDialog?this.openFormDialog():this.onInsert();break;case i.Live_Operations.DELETE:this.app.Widgets[this.dependson].call("delete",{row:e.row});break;case i.Live_Operations.READ:this.isLayoutDialog||(this.form.isUpdateMode=!1);break;case"rerender":e.dataSource&&e.dataSource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0,operation:"list"});break;case"selectedItemChange":e.table&&this.onUpdate(e.row,e.table);break;case"resetEditMode":this.editMode=!1}},e.prototype.onFormRender=function(){var e=this;this.form&&this.isLayoutDialog&&(this.form.isLayoutDialog=!0,setTimeout((function(){e.currentOp===i.Live_Operations.UPDATE?e.onUpdate(void 0,void 0,!0):e.currentOp===i.Live_Operations.INSERT&&e.onInsert()}),250))},e.prototype.ngAfterContentInit=function(){var e=this;this.formChildren.first?this.form=this.formChildren.first:this.formSubscription=this.formChildren.changes.subscribe((function(t){e.form=t.first,e.onFormRender()})),this.app.notify("setup-cud-listener",this.dependson)},e.prototype.ngOnDestroy=function(){this.formSubscription&&this.formSubscription.unsubscribe(),this.eventSubscription&&this.eventSubscription()},e}();W.decorators=[{type:t.Directive,args:[{selector:"[dependson]"}]}],W.ctorParameters=function(){return[{type:String,decorators:[{type:t.Attribute,args:["dialogid"]}]},{type:String,decorators:[{type:t.Attribute,args:["dependson"]}]},{type:l.AbstractDialogService},{type:l.App}]},W.propDecorators={formChildren:[{type:t.ContentChildren,args:[x,{descendants:!0}]}]};var q="EMPTY_NULL_FILTER",z=function(){function e(e){var t=this;this.form=e,this._filter=l.debounce((function(e){t.filter(e)}),250),e.clearFilter=this.clearFilter.bind(this),e.applyFilter=this.applyFilter.bind(this),e.filter=this.filter.bind(this),e.filterOnDefault=this.filterOnDefault.bind(this),e.execute=this.execute.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onMaxDefaultValueChange=this.onMaxDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.registerFormWidget=this.registerFormWidget.bind(this)}return e.prototype.execute=function(e,t){return e===l.DataSource.Operation.LIST_RECORDS||e===l.DataSource.Operation.DOWNLOAD?this.applyFilter(t):e===l.DataSource.Operation.GET_OPTIONS?this._options||{}:e===l.DataSource.Operation.GET_PAGING_OPTIONS?this.form.pagination:this.form.datasource?e===l.DataSource.Operation.FETCH_DISTINCT_VALUES?i.fetchDistinctValues(this.form.datasource,this.form.formFields,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter,EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}):this.form.datasource.execute(e,t):{}},e.prototype.onFieldDefaultValueChange=function(e,t){e.minValue=t,e.value=t,this.filterOnDefault()},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t,{EMPTY_VALUE:this.form.appLocale.LABEL_NO_VALUE}),this.form.autoupdate&&l.isDefined(t)&&this._filter()},e.prototype.onMaxDefaultValueChange=function(){var e=this;setTimeout((function(){e.filterOnDefault()}))},e.prototype.onDataSourceChange=function(){var e=this,t=this.form.datasource;t&&(this.form.formFields.forEach((function(n){i.isDataSetWidget(n.widgettype)&&(i.getDistinctValuesForField(t,n.widget,{widget:"widgettype",enableemptyfilter:e.form.enableemptyfilter,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}),i.applyFilterOnField(t,n.widget,e.form.formFields,n.value,{isFirst:!0,EMPTY_VALUE:e.form.appLocale.LABEL_NO_VALUE}))})),this._filter(this._options))},e.prototype.clearFilter=function(){var e=this;this.form.resetFormState(),this.form.formFields.forEach((function(t){!t.readonly&&t.show&&(t.widgettype!==l.FormWidgetType.AUTOCOMPLETE&&t.widgettype!==l.FormWidgetType.TYPEAHEAD||e.form.$element.find("div[name="+t.name+"] input").val(""),t["is-range"]?(t.minValue="",t.maxValue=""):(t.value="",t.resetDisplayInput()))})),setTimeout((function(){e._filter()}))},e.prototype.submitForm=function(){this.filter()},e.prototype.applyFilter=function(e){return(e=e?e.data||e:{}).page=e.page||1,e.orderBy=l.isDefined(e.orderBy)?e.orderBy:this.orderBy,this.filter(e)},e.prototype.filter=function(e){var t=this;if(this.form.datasource){var n,o,r={},a={},s=1;s=(e=e||{}).page||s,n=l.isDefined(e.orderBy)?e.orderBy:this.orderBy||"",this.orderBy=n,this.form.formFields.forEach((function(e){var n,i="div[name="+e.name+"] input",o=t.form.$element;if((e.widgettype===l.FormWidgetType.AUTOCOMPLETE||e.widgettype===l.FormWidgetType.TYPEAHEAD)&&o)return n=o.find(i),void(e["is-range"]?a[e.field]={minValue:l.isDefined(e.minValue)?e.minValue:n.first().val(),maxValue:l.isDefined(e.maxValue)?e.maxValue:n.last().val()}:a[e.field]={value:l.isDefined(e.value)?e.value:n.val()});e["is-range"]?a[e.field]={minValue:e.minValue,maxValue:e.maxValue}:a[e.field]={value:e.value}}));try{if(!1===(o=this.form.invokeEventCallback("beforeservicecall",{$data:a})))return;if(o&&o.error)return void this.form.toggleMessage(!0,o.error,"error","ERROR");this.form.formFields.forEach((function(e){e["is-range"]?(e._minValue=a[e.field].minValue,e._maxValue=a[e.field].maxValue):e._value=a[e.field].value}))}catch(e){if("Abort"===e.message)return}return this.form.formFields.forEach((function(e){var n,o,a=e.field,s=e._minValue,c=e._maxValue;if(e["is-related"]&&(a+="."+e["lookup-field"]),e["is-range"])n=i.getRangeFieldValue(s,c),o=i.getRangeMatchMode(s,c),l.isDefined(n)&&(r[a]={value:n,matchMode:o,logicalOp:"AND"});else{switch(e.widgettype){case l.FormWidgetType.SELECT:case l.FormWidgetType.RADIOSET:i.getEnableEmptyFilter(t.form.enableemptyfilter)&&e._value===q?(o=i.getEmptyMatchMode(t.form.enableemptyfilter),n=e._value):e.type===l.DataType.BOOLEAN?l.isDefined(e._value)&&""!==e._value&&(n=JSON.parse(e._value)):n=e._value;break;case l.FormWidgetType.CHECKBOXSET:case l.FormWidgetType.CHIPS:e._value&&e._value.length&&(n=e._value);break;case l.FormWidgetType.CHECKBOX:case l.FormWidgetType.TOGGLE:l.isDefined(e._value)&&""!==e._value&&(n=e.type===l.DataType.BOOLEAN?JSON.parse(e._value):e._value);break;default:n=e._value}l.isDefined(n)&&""!==n&&null!==n&&(r[a]={},o?(r[a].matchMode=o,n=void 0):(e.type===l.DataType.STRING||e.isRelated)&&(r[a].matchMode=o||e.matchmode||t.form.datasource.execute(l.DataSource.Operation.GET_MATCH_MODE)),r[a].value=n,r[a].logicalOp="AND",r[a].type=e.type)}})),e.exportType?this.form.datasource.execute(l.DataSource.Operation.DOWNLOAD,{data:{matchMode:"anywhereignorecase",filterFields:r,orderBy:n,exportType:e.exportType,logicalOp:"AND",exportSize:e.exportSize,fields:e.fields,fileName:e.fileName}}):this.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{filterFields:r,orderBy:n,page:s,pagesize:this.form.pagesize||20,skipDataSetUpdate:!0,inFlightBehavior:"executeAll"}).then((function(e){var i=e.data;return t.form.pagination=e.pagination,i.error?(t.form.toggleMessage(!0,i.error,"error","ERROR"),t.form.onResultCb(i,!1)):(t._options={page:s,orderBy:n},t.form.result=l.getClonedObject(i),t.form.onResultCb(i,!0)),l.$appDigest(),t.form.result}),(function(e){return t.form.toggleMessage(!0,e,"error","ERROR"),t.form.onResultCb(e,!1),e}))}},e.prototype.filterOnDefault=function(){_.find(this.form.formFields,(function(e){return l.isDefined(e.value)||l.isDefined(e.minValue)||l.isDefined(e.maxValue)}))&&this._filter(this._options)},e.prototype.registerFormWidget=function(e){var t=e.key||e.name;this.form.filterWidgets[t]=e},e}();z.initializeProps=S(),z.decorators=[{type:t.Directive,args:[{selector:"[wmLiveFilter]"}]}],z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]}]};var H=function(e){return e.widgettype===l.DataType.TIME||e.type===l.DataType.TIME&&!e.widgettype},Y=H,K=function(e){if(e){var t=(new Date).toDateString();return new Date(t+" "+e).getTime()}},Q=K,X=function(){function e(e,t,n,i,o){var r=this;this.form=e,this.datePipe=n,this.dialogService=i,this._debouncedSavePrevDataValues=l.debounce((function(){r.savePrevDataValues()}),250),t&&!this.form.parentForm?(this.form._liveTableParent=t,this.form.isLayoutDialog=t.isLayoutDialog,t.onFormReady(this.form)):this.form.isLayoutDialog="dialog"===o,e.cancel=this.cancel.bind(this),e.reset=this.reset.bind(this),e.delete=this.delete.bind(this),e.save=this.save.bind(this),e.saveAndNew=this.saveAndNew.bind(this),e.saveAndView=this.saveAndView.bind(this),e.setPrimaryKey=this.setPrimaryKey.bind(this),e.constructDataObject=this.constructDataObject.bind(this),e.changeDataObject=this.setFormData.bind(this),e.setFormData=this.setFormData.bind(this),e.findOperationType=this.findOperationType.bind(this),e.clearData=this.clearData.bind(this),e.onFieldDefaultValueChange=this.onFieldDefaultValueChange.bind(this),e.onDataSourceChange=this.onDataSourceChange.bind(this),e.onFieldValueChange=this.onFieldValueChange.bind(this),e.submitForm=this.submitForm.bind(this),e.form_registerFormFields=e.registerFormFields,e.registerFormFields=this.registerFormFields.bind(this)}return e.prototype.onKeydownHandler=function(e){this._triggeredByUser=!0},e.prototype.registerFormFields=function(e){var t=this.form.getFormFields();this.form.form_registerFormFields(e),this.form.isDataSourceUpdated&&this._updateFieldOnDataSourceChange(e,t)},e.prototype._updateFieldOnDataSourceChange=function(e,t){!e.isDataSetBound&&i.isDataSetWidget(e.widgettype)&&(e["is-related"]?(e.isDataSetBound=!0,i.fetchRelatedFieldData(this.form.datasource,e.widget,{relatedField:e.key,datafield:i.ALLFIELDS,widget:"widgettype"})):(i.getDistinctValuesForField(this.form.datasource,e.widget,{widget:"widgettype",enableemptyfilter:this.form.enableemptyfilter}),i.applyFilterOnField(this.form.datasource,e.widget,t,e.value,{isFirst:!0})))},e.prototype.onDataSourceChange=function(){var e=this;_.get(this.form.formFields,"length")&&(this.form.isDataSourceUpdated=!0);var t=this.form.getFormFields();t.forEach((function(n){e._updateFieldOnDataSourceChange(n,t)}))},e.prototype.onFieldDefaultValueChange=function(e,t){"update"!==this.form.operationType&&(l.isDefined(t)&&null!==t&&""!==t&&"null"!==t?e.value=i.parseValueByType(t,e.type,e.widgettype,e.trailingzero):e.value=void 0,this.form.dirty&&!this._triggeredByUser&&this.form.markAsPristine(),this._debouncedSavePrevDataValues())},e.prototype.onFieldValueChange=function(e,t){i.applyFilterOnField(this.form.datasource,e.widget,this.form.formFields,t)},e.prototype.getBlobURL=function(e,t,n){var i,o="";return null!=n&&this.form.datasource?(i=e[(this.form.datasource.execute(l.DataSource.Operation.GET_PRIMARY_KEY)||[])[0]],o+=this.form.datasource.execute(l.DataSource.Operation.GET_BLOB_URL,{primaryValue:i,columnName:t}),o+="?"+Math.random()):o},e.prototype.setFormData=function(e,t){var n=this;e&&((t=t||this.form.formFields).forEach((function(t){var i=_.get(e,t.key||t.name);H(t)?t.value=K(i):t.type===l.DataType.BLOB?(n.form.resetFileUploadWidget(t,!0),t.href=n.getBlobURL(e,t.key,i),t.value=_.isString(i)?"":i):n.form.setFieldValue(t,e)})),this.savePrevDataValues(),this.form.constructDataObject())},e.prototype.onDataSourceUpdate=function(e,t,n){t?this.form.new():(this.form.setFormData(e),this.closeDialog()),this.form.isUpdateMode=!l.isDefined(n)||n},e.prototype.savePrevformFields=function(){this.form.prevformFields=l.getClonedObject(this.form.formFields.map((function(e){return{key:e.key,type:e.type,widgettype:e.widgettype,outputformat:e.outputformat,value:e.value}})))},e.prototype.getPrevformFields=function(){var e=this;this.form.formFields.map((function(t){var n=e.form.prevformFields.find((function(e){return e.key===t.key}));t.value=n.value}))},e.prototype.getDataObject=function(){return this.form.operationType===i.Live_Operations.INSERT?{}:l.isDefined(this.form.prevDataObject)&&!l.isEmptyObject(this.form.prevDataObject)?l.getClonedObject(this.form.prevDataObject):l.getClonedObject(this.form.formdata||{})},e.prototype.constructDataObject=function(e){var t=this,n=this.getDataObject(),i=this.form.name;return(e?this.form.prevformFields:this.form.getFormFields()).forEach((function(e){var o,r,a=_.split(e.key,"."),s=a[0]||e.key;e.widgettype&&l.isDateTimeType(e.widgettype)||l.isDateTimeType(e.type)?e.value?(o=l.getValidDateObject(e.value),r=e.outputformat===l.DataType.TIMESTAMP||e.type===l.DataType.TIMESTAMP?e.value?o:null:e.outputformat?t.datePipe.transform(o,e.outputformat):e.value):r=void 0:r=e.type===l.DataType.BLOB?l.getFiles(i,s+"_formWidget",e.multiple):e.type===l.DataType.LIST?e.value||void 0:null===e.value||""===e.value?void 0:e.value,1===a.length?n[s]=r:(n[s]=n[s]||{},n[s][a[1]]=r)})),e?n:(this.form.updateFormDataOutput(n),this.form.dataoutput)},e.prototype.setPrimaryKey=function(e){this.form.primaryKey=this.form.primaryKey||[],-1===this.form.primaryKey.indexOf(e)&&this.form.primaryKey.push(e)},e.prototype.findOperationType=function(){var e,t=this,n=!1,o=this.form.datasource&&this.form.datasource.execute(l.DataSource.Operation.GET_OPERATION_TYPE);return o&&"read"!==o?o:(this.form.primaryKey&&!_.isEmpty(this.form.formdata)&&(1===this.form.primaryKey.length?this.form.formdata[this.form.primaryKey[0]]&&(e=i.Live_Operations.UPDATE):0===this.form.primaryKey.length?(_.forEach(this.form.formdata,(function(e){e&&(n=!0)})),n&&(e=i.Live_Operations.UPDATE)):(n=_.some(this.form.primaryKey,(function(e){if(t.form.formdata[e])return!0})))&&(e=i.Live_Operations.UPDATE)),e||i.Live_Operations.INSERT)},e.prototype.getPrevDataValues=function(){var e=_.fromPairs(_.map(this.form.prevDataValues,(function(e){return[e.key,e.value]})));return this.form.formFields.forEach((function(t){t.value=e[t.key]||"",t.resetDisplayInput()})),e},e.prototype.savePrevDataValues=function(){this.form.prevDataValues=this.form.formFields.map((function(e){return{key:e.key,value:e.value}}))},e.prototype.clearData=function(){this.form.toggleMessage(!1),this.form.emptyDataModel()},e.prototype.setReadonlyFields=function(){this.form.formFields.forEach((function(e){e.setReadOnlyState()}))},e.prototype.reset=function(){var e,t=this;this.form.resetFormState(),e=this.getPrevDataValues(),this.form.formFields.forEach((function(n){var i;n.type!==l.DataType.BLOB&&"upload"!==n.widgettype||(t.form.resetFileUploadWidget(n,!0),n.href=t.getBlobURL(e,n.key,n.value)),null===(i=n.nativeElement.querySelector("input"))||void 0===i||i.removeAttribute("aria-invalid")})),this.form.constructDataObject()},e.prototype.closeDialog=function(){this.form.isLayoutDialog&&this.dialogService.close(this.form.dialogId)},e.prototype.cancel=function(){this.form.clearMessage(),this.form.isUpdateMode=!1,this.form.reset(),this.form.isSelected&&this.getPrevformFields(),this.form.isUpdateMode=!1,this.form._liveTableParent?this.form._liveTableParent.onCancel():this.closeDialog(),l.$appDigest()},e.prototype.delete=function(e){this.form.resetFormState(),this.form.operationType=i.Live_Operations.DELETE,this.form.prevDataObject=l.getClonedObject(this.form.formdata||{}),this.form.save(void 0,void 0,void 0,e)},e.prototype.saveAndNew=function(){this.save(void 0,!0,!0)},e.prototype.saveAndView=function(){this.save(void 0,!1)},e.prototype.submitForm=function(e){this.save(e)},e.prototype.save=function(e,t,n){var o=this;if(this.form.datasource){var r,a,s,c,p={};if(s=this.form.operationType=this.form.operationType||this.findOperationType(),!this.form.validateFieldsOnSubmit()){r=l.getClonedObject(this.form.constructDataObject()),a=this.form.prevformFields?this.form.constructDataObject(!0):r;try{if(!1===(c=this.form.invokeEventCallback("beforeservicecall",{$event:e,$operation:this.form.operationType,$data:r,options:p})))return;if(c&&c.error)return void this.form.toggleMessage(!0,c.error,"error")}catch(e){if("Abort"===e.message)return}if(this.form.operationType===i.Live_Operations.UPDATE&&this.form.ngform&&this.form.ngform.pristine&&this.form.isSelected&&_.isEqual(r,a))return this.form.toggleMessage(!0,this.form.appLocale.MESSAGE_NO_CHANGES,"info",""),void l.$appDigest();p.row=r,p.transform=!0,p.skipNotification=!0,s===i.Live_Operations.UPDATE&&(p.rowData=this.form.formdata,p.prevData=a),i.performDataOperation(this.form.datasource,p,{operationType:s}).then((function(e){var r,a=s===i.Live_Operations.INSERT?o.form.insertmessage:s===i.Live_Operations.UPDATE?o.form.updatemessage:o.form.deletemessage;return s===i.Live_Operations.DELETE?(r=p.row,o.form.emptyDataModel(),o.form.prevDataValues=[],o.form.isSelected=!1):r=e,o.form.onSuccess||o.form.toggleMessage(!0,a,"success"),o.form._liveTableParent?o.form._liveTableParent.onResult(s,e,n,t):(o.form.datasource.execute(l.DataSource.Operation.LIST_RECORDS,{skipToggleState:!0}),o.onDataSourceUpdate(e,n,t)),{result:r,status:!0}}),(function(e){return o.form.onError||o.form.toggleMessage(!0,e,"error"),l.$appDigest(),{result:e,status:!1}})).then((function(t){o.form.resetFormState(),o.form.onResultCb(t.result,t.status,e)}))}}},e}();X.initializeProps=O(),X.decorators=[{type:t.Directive,args:[{selector:"[wmLiveForm]"}]}],X.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[x]}]},{type:h.LiveTableComponent,decorators:[{type:t.Optional}]},{type:i.ToDatePipe},{type:l.AbstractDialogService},{type:String,decorators:[{type:t.Attribute,args:["formlayout"]}]}]},X.propDecorators={onKeydownHandler:[{type:t.HostListener,args:["keydown",["$event"]]}]};var J=[x,k,F,V,U,W,z,X],Z=function(){};Z.decorators=[{type:t.NgModule,args:[{imports:[o.BasicModule,n.CommonModule,a.DesignDialogModule,r.InputModule,i.WmComponentsModule],declarations:b([],y(J)),exports:b([],y(J)),entryComponents:[]}]}],e.DependsonDirective=W,e.FormActionDirective=F,e.FormComponent=x,e.FormFieldDirective=V,e.FormModule=Z,e.FormWidgetDirective=k,e.LiveActionsDirective=U,e.LiveFilterDirective=z,e.LiveFormDirective=X,e["\u02750"]=Y,e["\u02751"]=Q,e["\u0275a"]=P,e["\u0275b"]=O,e["\u0275c"]=S,e["\u0275d"]=M,e["\u0275e"]=j,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@wm/components/base"),require("@wm/components/basic"),require("@wm/components/dialogs"),require("@wm/components/input"),require("@wm/core")):"function"==typeof define&&define.amd?define("@wm/components/dialogs/iframe-dialog",["exports","@angular/core","@angular/common","@wm/components/base","@wm/components/basic","@wm/components/dialogs","@wm/components/input","@wm/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.dialogs=e.wm.components.dialogs||{},e.wm.components.dialogs.iframedialog={}),e.ng.core,e.ng.common,e.wm.components.base,e.wm.components.basic,e.wm.components.dialogs,e.wm.components.input,e.wm.core)}(this,(function(e,t,n,i,o,r,a,s){"use strict";
549
549
  /*! *****************************************************************************
550
550
  Copyright (c) Microsoft Corporation.
551
551