@wavemaker/app-runtime-wm-build 11.4.0-next.25704 → 11.4.0-next.25707
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.
- app-runtime-wm-build/package.json +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.js +2 -0
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +28 -21
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +2 -2
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +2 -0
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +28 -21
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +2 -2
|
@@ -727,7 +727,7 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
727
727
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
728
728
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
729
729
|
PERFORMANCE OF THIS SOFTWARE.
|
|
730
|
-
***************************************************************************** */var r=function(e,t){return(r=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)};Object.create;function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function l(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 c=function(){i.register("wm-login",new Map([["errormessage",i.PROP_STRING],["eventsource",i.PROP_ANY]]))},p={widgetType:"wm-login",hostClass:"app-login"},d=function(e){function t(t){var n=e.call(this,t,p)||this;return i.styler(n.nativeElement,n,i.APPLY_STYLES_TYPE.CONTAINER),n}return function(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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.onSuccessCB=function(){this.invokeEventCallback("success")},t.prototype.onErrorCB=function(e){this.loginMessage={type:"error",caption:this.errormessage||e||this.appLocale.LABEL_INVALID_USERNAME_OR_PASSWORD,show:!0},this.messageCmp.showMessage(this.loginMessage.caption,this.loginMessage.type),this.invokeEventCallback("error")},t.prototype.getLoginDetails=function(){return this.formCmp.dataoutput},t.prototype.doLogin=function(){this.eventsource?this.formCmp.ngform.valid&&this.eventsource.invoke({loginInfo:this.getLoginDetails()},this.onSuccessCB.bind(this),this.onErrorCB.bind(this)):console.warn('Default action "loginAction" does not exist. Either create the Action or assign an event to onSubmit of the login widget')},t.prototype.initLoginButtonActions=function(){var e=this;this.loginBtnCmp.getNativeElement().addEventListener("click",(function(t){e.nativeElement.hasAttribute("submit.event")||e.loginBtnCmp.getNativeElement().hasAttribute("click.event")||e.loginBtnCmp.getNativeElement().hasAttribute("tap.event")||e.doLogin()}))},t.prototype.ngAfterViewInit=function(){var t=this;e.prototype.ngAfterViewInit.call(this),this.formCmp.getNativeElement().addEventListener("submit",(function(e){return e.preventDefault()})),this.buttonComponents.forEach((function(e){if("loginButton"===e.getNativeElement().getAttribute("name")||_.includes(e.getNativeElement().classList,"app-login-button")){if(t.loginBtnCmp)return;t.loginBtnCmp=e,t.initLoginButtonActions()}}))},t}(i.StylableComponent);d.initializeProps=c(),d.decorators=[{type:t.Component,args:[{selector:"div[wmLogin]",template:'<p wmMessage class="app-login-message" #message show.bind="loginMessage.show" caption.bind="loginMessage.caption" type.bind="loginMessage.type"></p>\n<ng-content></ng-content>\n',providers:[i.provideAsWidgetRef(d)]}]}],d.ctorParameters=function(){return[{type:t.Injector}]},d.propDecorators={formCmp:[{type:t.ContentChild,args:[o.FormComponent]}],buttonComponents:[{type:t.ContentChildren,args:[a.ButtonComponent,{descendants:!0}]}],messageCmp:[{type:t.ViewChild,args:[i.MessageComponent,{static:!0}]}]};var u=[d],h=function(){};h.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:l([],s(u)),exports:l([],s(u)),entryComponents:[]}]}],e.LoginComponent=d,e.LoginModule=h,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@wavemaker/variables"),require("@wm/core"),require("angular2-websocket/angular2-websocket"),require("@metrichor/jmespath"),require("@angular/core"),require("@angular/router"),require("@wm/oAuth"),require("@wm/security"),require("@angular/common"),require("@angular/common/http"),require("ngx-toastr"),require("@wm/http")):"function"==typeof define&&define.amd?define("@wm/variables",["exports","@wavemaker/variables","@wm/core","angular2-websocket/angular2-websocket","@metrichor/jmespath","@angular/core","@angular/router","@wm/oAuth","@wm/security","@angular/common","@angular/common/http","ngx-toastr","@wm/http"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.variables={}),e.wm_common_variables,e.wm.core,e.angularWebSocket,e.jmespath,e.ng.core,e.ng.router,e.wm.oAuth,e.wm.security,e.ng.common,e.ng.common.http,e.ngxToastr,e.wm.http)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u){"use strict";var h={hasCordova:void 0!==window.cordova,isStudioMode:!1,isRunMode:!0,XSRF_COOKIE_NAME:"wm_xsrf_token",DEFAULT_TIMER_DELAY:500,WIDGET_DOESNT_EXIST:"The widget you're trying to navigate to doesn't exist on this page"},m={CATEGORY:{MODEL:"wm.Variable",LIVE:"wm.LiveVariable",CRUD:"wm.CrudVariable",SERVICE:"wm.ServiceVariable",WEBSOCKET:"wm.WebSocketVariable",NAVIGATION:"wm.NavigationVariable",NOTIFICATION:"wm.NotificationVariable",TIMER:"wm.TimerVariable",LOGIN:"wm.LoginVariable",LOGOUT:"wm.LogoutVariable",DEVICE:"wm.DeviceVariable"},EVENTS:["onBefore","onBeforeUpdate","onResult","onBeforeOpen","onOpen","onBeforeMessageSend","onMessageReceive","onProgress","onError","onBeforeDatasetReady","onCanUpdate","onClick","onHide","onOk","onCancel","onBeforeClose","onClose","onTimerFire","onSuccess","onOnline","onOffline"],EVENT:{CAN_UPDATE:"onCanUpdate",BEFORE:"onBefore",BEFORE_UPDATE:"onBeforeUpdate",PREPARE_SETDATA:"onBeforeDatasetReady",RESULT:"onResult",ERROR:"onError",ABORT:"onAbort",PROGRESS:"onProgress",CLICK:"onClick",HIDE:"onHide",OK:"onOk",CANCEL:"onCancel",CLOSE:"onClose",TIMER_FIRE:"onTimerFire",SUCCESS:"onSuccess",BEFORE_OPEN:"onBeforeOpen",OPEN:"onOpen",BEFORE_SEND:"onBeforeMessageSend",MESSAGE_RECEIVE:"onMessageReceive",BEFORE_CLOSE:"onBeforeClose"},OWNER:{APP:"App",PAGE:"Page"},REST_SUPPORTED_SERVICES:["JavaService","SoapService","FeedService","RestService","SecurityServiceType","DataService","WebSocketService","OpenAPIService"],PAGINATION_PARAMS:["page","size","sort"],REST_SERVICE:{BASE_PATH_KEY:"x-WM-BASE_PATH",RELATIVE_PATH_KEY:"x-WM-RELATIVE_PATH",OAUTH_PROVIDER_KEY:"x-WM-PROVIDER_ID",AUTH_HDR_KEY:"Authorization",SECURITY_DEFN:{BASIC:"basic",OAUTH2:"oauth2"},AUTH_TYPE:{BASIC:"BASIC",OAUTH:"OAUTH2",NONE:"NONE"},CONTENT_TYPE_KEY:"x-WM-CONTENT_TYPE",ACCESSTOKEN_PLACEHOLDER:{LEFT:"",RIGHT:".access_token"},ERR_TYPE:{NO_ACCESSTOKEN:"missing_accesstoken",NO_CREDENTIALS:"no_credentials",METADATA_MISSING:"metadata_missing",CRUD_OPERATION_MISSING:"crud_operation_missing",USER_UNAUTHORISED:"user_unauthorised",REQUIRED_FIELD_MISSING:"required_field_missing"},ERR_MSG:{NO_ACCESSTOKEN:"Access token missing",NO_CREDENTIALS:"No credentials present",METADATA_MISSING:'Metadata missing for "$variable"',USER_UNAUTHORISED:"Unauthorized User",CRUD_OPERATION_MISSING:'Operation "$operation" not allowed for "$variable"',REQUIRED_FIELD_MISSING:'Required field(s) missing: "${0}"'},UNCLOAKED_HEADERS:["CONTENT-TYPE","ACCEPT","CONTENT-LENGTH","ACCEPT-ENCODING","ACCEPT-LANGUAGE"],PREFIX:{AUTH_HDR_VAL:{BASIC:"Basic",OAUTH:"Bearer"},CLOAK_HEADER_KEY:"X-WM-"}},SERVICE_TYPE:{JAVA:"JavaService",REST:"RestService",SOAP:"SoapService",FEED:"FeedService",DATA:"DataService",SECURITY:"SecurityServiceType",WEBSOCKET:"WebSocketService",OPENAPI:"OpenAPIService"},CONTROLLER_TYPE:{QUERY:"QueryExecution",PROCEDURE:"ProcedureExecution"},HTTP_STATUS_CODE:{CORS_FAILURE:-1,UNAUTHORIZED:401,FORBIDDEN:403},EXPORT_TYPES_MAP:{EXCEL:".xlsx",CSV:".csv"},DEFAULT_VAR:{NOTIFICATION:"appNotification"}},f={NON_BODY_HTTP_METHODS:["GET","HEAD"],CONTENT_TYPES:{FORM_URL_ENCODED:"application/x-www-form-urlencoded",MULTIPART_FORMDATA:"multipart/form-data",OCTET_STREAM:"application/octet-stream"}},g={WM_DATA_JSON:"wm_data_json",WM_HTTP_JSON:"wm_httpRequestDetails"},v=t.$rootScope,y=function(e,t){return(y=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 b(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}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function P(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 O={EXCEL:".xlsx",CSV:".csv"};e.appManager=void 0,e.httpService=void 0,e.metadataService=void 0,e.navigationService=void 0,e.routerService=void 0,e.toasterService=void 0,e.oauthService=void 0,e.securityService=void 0,e.dialogService=void 0;var E=/^\[("|')[\w\W]*(\1)\]$/,R=new Map,A=new Map,T=function(e,t){var n,i,o=_.noop;A.has(e)&&(o=A.get(e).cancel),o(),n=_.debounce((function(){(i=e[t]())instanceof Promise&&i.catch(_.noop)}),100),A.set(e,n),n()},S=function(e,t,n,i,o){switch(i.category){case m.CATEGORY.LIVE:"read"===i.operation?("dataBinding"===e?_.forEach(t,(function(e,t){i.filterFields[t]={value:e}})):i.filterFields[e]={value:t,type:n},i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.listRecords)&&!o&&T(i,"listRecords")):("dataBinding"===e?i.inputFields=t:i.inputFields[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i[i.operation+"Record"])&&!o&&T(i,i.operation+"Record"));break;case m.CATEGORY.CRUD:"list"===i.operationType&&i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&T(i,"invoke");break;case m.CATEGORY.SERVICE:case m.CATEGORY.LOGIN:i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&T(i,"invoke");break;case m.CATEGORY.DEVICE:i[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&T(i,"invoke")}},C=function(t,n){switch(t){case"appManager":e.appManager=n;break;case"http":e.httpService=n;break;case"metadata":e.metadataService=n;break;case"navigationService":e.navigationService=n;break;case"router":e.routerService=n;break;case"toaster":e.toasterService=n;break;case"oAuth":e.oauthService=n;break;case"security":e.securityService=n;break;case"dialog":e.dialogService=n}},I=function(e,t,i,o,a){var r,s=t[e],l=t._context;e!==m.EVENT.ERROR||a||s||(r=l.Actions[m.DEFAULT_VAR.NOTIFICATION])&&(i=r.getMessage()||i,i=_.isString(i)?i:"An error has occured. Please check the app logs.",r.invoke({message:i},void 0,void 0));var c=n.$parseEvent(t[e]);return e===m.EVENT.BEFORE_UPDATE?"wm.LiveVariable"===t.category&&"read"===t.operation?c(t._context,{variable:t,dataFilter:i,options:o}):c(t._context,{variable:t,inputData:i,options:o}):c(t._context,{variable:t,data:i,options:o})},D=function(e){setTimeout((function(){n.triggerFn(e)}),500)},x=function(e,t,i,o){var a,r,s,l,c,p="",d=t.get("Content-Disposition");if(d&&-1!==d.indexOf("attachment")&&null!==(a=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(d))&&a[1]&&(p=a[1].replace(/['"]/g,"")),r=t.get("Content-Type"),s=new Blob([e],{type:r}),void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(s,p)?D(i):n.triggerFn(o);else{if(l=window.URL||window.webkitURL,c=l.createObjectURL(s),p){var u,h=document.createElement("a");void 0===h.download?((u=new FileReader).onloadend=function(){var e=u.result.replace(/^data:[^;]*;/,"data:attachment/file;");window.open(e,"_blank")||(window.location.href=e)},u.onload=D.bind(void 0,i),u.onerror=o,u.readAsDataURL(s)):(h.href=c,h.download=p,document.body.appendChild(h),h.click(),D(i))}else window.open(c,"_blank")||(window.location.href=c),D(i);setTimeout((function(){l.revokeObjectURL(c)}),100)}},N=function(e,t){e=_.split(e,"&"),_.forEach(e,(function(e){e=_.split(e,"="),t[e[0]]=decodeURIComponent(_.join(_.slice(e,1),"="))}))},k=function(e,t){"/"===e.url[1]&&"/"===e.url[2]&&(e.url=e.url.slice(0,1)+e.url.slice(2));var i,o,a,r="",s="fileDownloadIFrame",l="fileDownloadForm",c="Content-Type",p=e.url,d=_.get(e.headers,c),u=_.pickBy(e.headers,(function(e,t){return t!==c}));(i=$("#"+s)).length&&i.first().remove(),i=$('<iframe id="'+s+'" name="'+s+'" class="ng-hide"></iframe>'),(o=$('<form id="'+l+'" name="'+l+'"></form>')).attr({target:i.attr("name"),action:p,method:e.method,enctype:d}),r+=-1!==p.indexOf("?")?p.substring(p.indexOf("?")+1):"",r+=d===f.CONTENT_TYPES.FORM_URL_ENCODED?(r?"&":"")+e.dataParams:"",_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(e.method))&&N(r,u),N(e.data,u),_.forEach(u,(function(e,t){(a=$('<input type="hidden">')).attr({name:t,value:e}),o.append(a)})),$("body").append(i),setTimeout((function(){i.contents().find("body").append(o),o.submit(),n.triggerFn(t)}),100)},M=function(t,i,o){var a=t.url,r=t.method,s=t.dataParams||t.data,l=t.headers;l["Content-Type"]=l["Content-Type"]||"application/x-www-form-urlencoded",e.httpService.send({target:"WebService",action:"invokeRuntimeRestCall",method:r,url:a,headers:l,data:s,responseType:"arraybuffer"}).then((function(e){setTimeout((function(){x(e.body,e.headers,i,o)}),900)}),(function(e){n.triggerFn(o,e)}))},L=function(){return!!h.hasCordova&&localStorage.getItem(h.XSRF_COOKIE_NAME)},F=function(e,t,i){var o,a=e.target,r=i[t];return E.test(a)?o=r:(a=a.substr(0,a.lastIndexOf(".")),o=e.target===t?i:a?n.findValueOf(r,a,!0):r),o},j=function(e){return E.test(e)?e.replace(/^(\[["'])|(["']\])$/g,""):e.split(".").pop()},B=function(e,t,n,i,o,a){var r=j(e),s=F(t,n,i);o=_.isUndefined(o)?t.value:o,s&&(s[r]=o),S(r,o,t.type,i,a)},G=function(e,t,n){var i,o=_.keys(_.get(R.get(n),[n.name,t])),a=j(e);(i=_.filter(o,(function(e){return e!==a&&_.includes(e,a)||(a===t||"dataBinding"===a)&&e!==a}))).length&&_.forEach(i,(function(e){B(e,{target:e},t,n,_.get(R.get(n),[n.name,t,e]))}))},V=function(e,t,i,o){var a=e.target,r=F(e,i,o),s=j(a),l=t.registerDestroyListener?t.registerDestroyListener.bind(t):_.noop;if(n.stringStartsWith(e.value,"bind:")){l(n.$watch(e.value.replace("bind:",""),t,{},(function(t,l){t===l&&_.isUndefined(t)||!(!_.isUndefined(t)||_.isUndefined(l)&&_.isUndefined(r[s]))||(_.includes(["blob","file"],e.type)||(t=n.getClonedObject(t)),B(a,e,i,o,t),R.has(o)||R.set(o,{}),_.set(R.get(o),[o.name,i,a],t),_.isObject(t)&&G(a,i,o))}),void 0,void 0,void 0,(function(){return o.isMuted})))}else _.isUndefined(e.value)||(B(a,e,i,o,e.value,!0),i!==s&&(R.has(o)||R.set(o,{}),_.set(R.get(o),[o.name,i,a],e.value)))},W=function(e,t,n,i){i=i||"dataBinding";var o=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=o,o&&_.isArray(o)&&o.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),V(n,t,i,e)}))},U=function(t,n,i,o,a){if(h.hasCordova){var r=void 0;i&&(r=O[i]),e.appManager.notify("device-file-download",{url:t.url,name:n,extension:r,headers:t.headers,successCb:o,errorCb:a})}else!_.isEmpty(t.headers)||L()?M(t,o,a):k(t,o)},q=function(){return window.File&&window.FileReader&&window.FileList&&window.Blob},z=T,H=function(e){return n.DEFAULT_FORMATS[_.toUpper(e)]},Y=function(t,i){var o;return _.isDate(t)?o=t.getTime():(isNaN(t)||(t=parseInt(t,10)),o=t&&moment(t).valueOf()),isNaN(o)&&i!==n.DataType.TIME||i===n.DataType.TIMESTAMP?o:(i!==n.DataType.TIME||o||(o=moment((new Date).toDateString()+" "+t).valueOf()),t&&e.appManager.getPipe("date").transform(o,H(i)))},K=function(e,t){return _.includes(t,".")&&(t=_.toLower(n.extractType(t))),_.isArray(e)?_.map(e,(function(e){return Y(e,t)})):Y(e,t)};var Q=function(){function t(){}return t.prototype.initBinding=function(e,t,n){W(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i})},t}(),Z=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.invoke=function(t,i){!function(t,i){var o;t.dataSet=i&&i.data||t.dataSet;var a=t.dataBinding.pageName||t.pageName,r=t.operation,s=_.clone(t.dataSet),l=_.isNil(null==i?void 0:i.cacheable)?t.cacheable:i.cacheable;switch(i=i||{},_.isNil(l)||n.isString(l)&&""===l.trim()||(s._cache_page=l),r){case"goToPreviousPage":e.navigationService.goToPrevious();break;case"gotoPage":e.navigationService.goToPage(a,{transition:t.pageTransitions,$event:i.$event,urlParams:s,cacheable:t.cacheable});break;case"gotoView":o=t.dataBinding&&t.dataBinding.viewName||t.viewName;break;case"gotoTab":o=t.dataBinding&&t.dataBinding.tabName||t.tabName;break;case"gotoAccordion":o=t.dataBinding&&t.dataBinding.accordionName||t.accordionName;break;case"gotoSegment":o=t.dataBinding&&t.dataBinding.segmentName||t.segmentName}o&&e.navigationService.goToView(o,{pageName:a,transition:t.pageTransitions,$event:i.$event,urlParams:s},t)}(t,i)},i}(Q),J=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return b(n,t),n.prototype.onToasterClick=function(e){I("onClick",e,"")},n.prototype.onToasterHide=function(e){I("onHide",e,"")},n.prototype.notifyViaToaster=function(t,n){var i,o=(n.class||t.dataBinding.class||"info").toLowerCase(),a=n.message||t.dataBinding.text,r=n.title,s="toast-"+(n.position||t.dataBinding.toasterPosition||"bottom right").replace(" ","-"),l=t.dataBinding.page,c=parseInt(n.duration||t.dataBinding.duration,null);c||(c=0!==c&&"success"===o?3e3:0),i=t.dataBinding.content&&"page"===t.dataBinding.content&&l?e.toasterService.showCustom(l,{positionClass:s,timeOut:c,partialParams:t._binddataSet,context:t._context}):e.toasterService.show(o,r,a||null,{positionClass:s,timeOut:c,enableHtml:!0}),t.onClick&&i.onTap.subscribe(this.onToasterClick.bind(this,t)),t.onHide&&i.onHidden.subscribe(this.onToasterHide.bind(this,t))},n.prototype.notifyViaDialog=function(t,n){var i="Common"+_.capitalize(t.operation)+"Dialog",o=function(){return I("onOk",t,n.data)};e.dialogService.open(i,void 0,{notification:{title:n.title||t.dataBinding.title,text:n.message||t.dataBinding.text,okButtonText:n.okButtonText||t.dataBinding.okButtonText||"OK",cancelButtonText:n.cancelButtonText||t.dataBinding.cancelButtonText||"CANCEL",alerttype:n.alerttype||t.dataBinding.alerttype||"information",onOk:function(){e.dialogService.close(i,void 0,o)},onCancel:function(){I("onCancel",t,n.data),e.dialogService.close(i,void 0)},onClose:function(){I("onClose",t,n.data)}}})},n.prototype.notify=function(e,t,n,i){t=t||{},"toast"===e.operation?this.notifyViaToaster(e,t):this.notifyViaDialog(e,t)},n.prototype.getMessage=function(e){return e.dataBinding.text},n.prototype.setMessage=function(e,t){return _.isString(t)&&(e.dataBinding.text=t),e.dataBinding.text},n.prototype.getOkButtonText=function(e){return e.dataBinding.okButtonText},n.prototype.setOkButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.okButtonText=t),e.dataBinding.okButtonText},n.prototype.getToasterDuration=function(e){return e.dataBinding.duration},n.prototype.setToasterDuration=function(e,t){return e.dataBinding.duration=t,e.dataBinding.duration},n.prototype.getToasterClass=function(e){return e.dataBinding.class},n.prototype.setToasterClass=function(e,t){return _.isString(t)&&(e.dataBinding.class=t),e.dataBinding.class},n.prototype.getToasterPosition=function(e){return e.dataBinding.class},n.prototype.setToasterPosition=function(e,t){return _.isString(t)&&(e.dataBinding.position=t),e.dataBinding.position},n.prototype.getAlertType=function(e){return e.dataBinding.alerttype},n.prototype.setAlertType=function(e,t){return _.isString(t)&&(e.dataBinding.alerttype=t),e.dataBinding.alerttype},n.prototype.getCancelButtonText=function(e){return e.dataBinding.cancelButtonText},n.prototype.setCancelButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.cancelButtonText=t),e.dataBinding.cancelButtonText},n}(Q),X=function(){function t(){}return t.prototype.initBinding=function(e,t,n){W(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i,o){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i,options:o})},t.prototype.setRequestTrackId=function(e,t){var n,i=null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.get("x-wm-request-track-id");i&&(t._requestTrackId=i)},t.prototype.httpCall=function(t,n,i){var o=this;return new Promise((function(a,r){n._observable=e.httpService.sendCallAsObservable(t,i).subscribe((function(e){e&&e.type&&(o.setRequestTrackId(e,n),a(e))}),(function(t){o.setRequestTrackId(t,n),e.httpService.isPlatformSessionTimeout(t)?(o.notifyInflight(n,!1,t),t._401Subscriber.asObservable().subscribe((function(e){return a(e)}),(function(e){return r(e)}))):r(t)}))}))},t.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&_.extend(n,t),n},t}(),ee=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.validate=function(e){var t,n,i;for(n in["rememberme","remembermecheck"].forEach((function(t){_.isBoolean(e[t])&&(i=t)})),e[i=i||"j_rememberme"]=!!_.isBoolean(e[i])&&e[i],e)if(e.hasOwnProperty(n)&&(""===e[n]||void 0===e[n])){t="Please provide required credentials";break}return t},i.prototype.migrateOldParams=function(e){var t={},n={usernametext:"j_username",username:"j_username",passwordtext:"j_password",password:"j_password",remembermecheck:"j_rememberme",rememberme:"j_rememberme"};return _.each(e,(function(e,i){n[i]?t[n[i]]=e:t[i]=e})),t},i.prototype.redirectToAppBasePath=function(){e.routerService.navigate(["/"]).then((function(e){e&&window.location.reload()}))},i.prototype.login=function(t,i,o,a){var r,s=this,l=(i=i||{}).loginInfo||i.input||t.dataBinding,c=this.validate(l);if(c)return n.triggerFn(a,c),void I("onError",t,c);var p=n.getClonedObject(l),d=I(m.EVENT.BEFORE_UPDATE,t,p);if(_.isObject(d))p=d;else if(!1===d)return void n.triggerFn(a);p=this.migrateOldParams(p);var u=_.get(e.securityService.get(),"userInfo.userName");this.notifyInflight(t,!0),t.promise=e.securityService.appLogin(p,(function(i){e.dialogService.close("CommonLoginDialog"),e.appManager.reloadAppData().then((function(a){I(m.EVENT.RESULT,t,_.get(a,"userInfo")),(r=I(m.EVENT.PREPARE_SETDATA,t,_.get(a,"userInfo")))&&_.set(a,"userInfo",r),s.notifyInflight(t,!1,i),n.triggerFn(o),setTimeout((function(){if(I(m.EVENT.SUCCESS,t,_.get(a,"userInfo")),t.useDefaultSuccessHandler){var n=u===p.j_username;u&&!n||e.appManager.executeSessionFailureRequests();var i=e.securityService.getCurrentRouteQueryParam("redirectTo"),o=e.appManager.noRedirect(),r=e.securityService.getRedirectedRouteQueryParams();if(r.redirectTo&&delete r.redirectTo,e.appManager.noRedirect(!1),u)if(_.isEmpty(i)){var l=e.securityService.get(),c=_.get(l,"loginConfig.sessionTimeout.type")||"PAGE";n&&"DIALOG"===c||s.redirectToAppBasePath()}else u===p.j_username?e.routerService.navigate(["/"+i],{queryParams:r}):s.redirectToAppBasePath();else _.isEmpty(i)?o||e.routerService.navigate(["/"]):e.routerService.navigate(["/"+i],{queryParams:r})}I(m.EVENT.CAN_UPDATE,t,_.get(a,"userInfo"))}))}))}),(function(e){I(m.EVENT.RESULT,t,e),s.notifyInflight(t,!1,e);var i=e.error||"Invalid credentials.",o=e.details;h.isRunMode&&I("onError",t,i,o,!0),n.triggerFn(a,i,o),I(m.EVENT.CAN_UPDATE,t,e)}))},i}(Q),te=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.logout=function(t,i,o,a){var r,s,l,c=this;r=function(e,i,o){h.isStudioMode||I("onError",t,e,o),n.triggerFn(a,e,o)},!1!==I(m.EVENT.BEFORE_UPDATE,t,null)?e.securityService.isAuthenticated((function(i){i?(c.notifyInflight(t,!0),t.promise=e.securityService.appLogout((function(i){var a=i.body;a=n.getValidJSON(a),e.appManager.reloadAppData().then((function(){c.notifyInflight(t,!1,a),I(m.EVENT.RESULT,t,a),(l=I(m.EVENT.PREPARE_SETDATA,t,a))&&(a=l),setTimeout((function(){I(m.EVENT.SUCCESS,t,a),I(m.EVENT.CAN_UPDATE,t,a)}))})),a&&a.result?window.location.href=a.result:t.useDefaultSuccessHandler&&((s=t.redirectTo)&&"login.html"!==s&&"index.html"!==s||(s=""),e.routerService.navigate(["/"+s]),window.cordova||setTimeout((function(){window.location.reload()}))),n.triggerFn(o)}),r)):r("No authenticated user to logout.")}),(function(e){c.notifyInflight(t,!1,e),r(e)})):n.triggerFn(a)},i}(Q),ne=function(e){function t(){var t=e.apply(this,P([],w(arguments)))||this;return t.serviceRegistry=new Map,t}return b(t,e),t.prototype.invoke=function(e,t){var n=this,i=this.serviceRegistry.get(e.service);return null==i?(I("onError",e,null),Promise.reject("Could not find service '"+i+"'")):(this.notifyInflight(e,!0),i.invoke(e,t).then((function(t){return n.notifyInflight(e,!1,t),t}),(function(t){return n.notifyInflight(e,!1,t),Promise.reject(t)})))},t.prototype.registerService=function(e){this.serviceRegistry.set(e.name,e)},t}(X),ie=function(){function e(){}return e.setPaginationQueryParams=function(e,t,n){t.parameters.forEach((function(t){var i;i="offset"===n.type||n.input.offset?"offset":"page",t.name===n.input[i].split(".")[0]?t.sampleValue=e.pagination.page:t.name===n.input.size.split(".")[0]&&(t.sampleValue=e.pagination.size)}))},e.setVariablePagination=function(e,t,n){e.pagination||(e.pagination={empty:!1}),e.pagination.size=t.size,e.pagination.page=t.page||0,e.pagination.totalElements=t.totalElements,e.pagination.numberOfElements=e.pagination.size,e.pagination.number=n.page?n.page-1:0,e.pagination.totalPages=e.pagination.totalElements/e.pagination.size,e.pagination.totalElements%e.pagination.size==0?e.pagination.totalPages=parseInt(e.pagination.totalPages):e.pagination.totalPages=parseInt(e.pagination.totalPages)+1,t.next?(e.pagination.next=t.next,e.pagination.prev=t.prev,e.pagination.last=!t.next,e.pagination.first=!t.prev):(e.pagination.first=e.pagination.page<=1,e.pagination.last=""===t.hasMoreItems?!(e.pagination.page<e.pagination.totalPages):!t.hasMoreItems)},e.setPaginationItems=function(e,t,n,i,a){var r;if(_.startsWith(e,"$body")){var s=e.replace("$body.","");try{n[i]=o.jmespath.search(t,s)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}else if(_.startsWith(e,"$header")){var l=e.replace("$header.",""),c=Object.fromEntries(a.headers),p=l.split(".");try{n[i]=o.jmespath.search(c,p[0].toLowerCase())}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}if(null===(r=n[i])||void 0===r?void 0:r.length){var d=n[i].join();if(1===p.length)n[i]=d;else{var u=p.slice(1).join("."),h=JSON.parse(d);/[!@#$%^&*()+\=\[\]{};':"\\|,<>\/?]+/.test(u)&&(u="headerResp."+u);try{n[i]=o.jmespath.search(h,u)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}}}},e.getPaginationInfo=function(e,t){return(null==e?void 0:e.paginationInfo)?e.paginationInfo:t._paginationConfig},e.checkPaginationAtQuery=function(e,t,n){var i,o=this.getPaginationInfo(e,t);if(n&&n.page&&(null==o?void 0:o.input.size)&&t.pagination){var a;a="offset"===o.type||o.input.offset?"offset":"page";var r=o.input[a].split(".")[0],s=_.find(e.parameters,(function(e){return e.name===r}));!_.isEmpty(t.dataBinding)&&s&&"query"===s.parameterType&&((null===(i=o.output)||void 0===i?void 0:i.page)||"offset"===o.type?t.pagination.page=this.getOffsetInfo(t,n):t.pagination.page=n.page,this.setPaginationQueryParams(t,e,o))}},e.getOffsetInfo=function(e,t){return e.pagination.size*(t.page?t.page-1:1)},e.setPaginationAtReq=function(e,t,n,i,o,a,r){var s,l={},c={};s="offset"===e.type||e.input.offset?"offset":"page";var p=e.input[s].split(".")[0],d=_.find(t.parameters,(function(e){return e.name===p}));if("header"===(null==d?void 0:d.parameterType))_.set(l,e.input[s],n.pagination.page),_.set(l,e.input.size,n.pagination.size),i[p]=JSON.stringify(l[p]),c.headers=i;else if("body"===(null==d?void 0:d.parameterType)){var u=JSON.parse(d.sampleValue),h=e.input[s].split(".")[1];if(u&&u[h]){var m=e.input[s].split(".").splice(1).join(".");"offset"!==s?_.set(l,m,n.pagination.page):_.set(l,m,this.getOffsetInfo(n,r)),_.set(l,e.input.size.split(".").splice(1).join("."),n.pagination.size),u[h]=l[h],o=JSON.stringify(u),c.requestBody=o}}else if(n.pagination.next&&d)if("path"===d.parameterType){var f=t.relativePath.split("/"),g="{"+d.name+"}",v=f.indexOf(g),y=void 0;y=n.pagination.isNext?n.pagination.next.split("/"):n.pagination.prev.split("/");var b=void 0,w=void 0;t.directPath?((b=(w=new URL(a)).pathname.split("/"))[v]=y[v],w.pathname=b.join("/"),a=w.href,c.url=a):((b=a.split("/"))[v+1]=y[v],a=b.join("/"),c.url=a)}else if("query"===d.parameterType){f=a.split("?"),y=void 0;y=n.pagination.isNext?n.pagination.next.split("?"):n.pagination.prev.split("?"),f[1]=y[1],a=f.join("?"),c.url=a}return c},e.setParameterVal=function(e,t,n,i){var o=this.getPaginationInfo(n,i).input[e].split(".")[0],a=_.find(n.parameters,(function(e){return e.name===o}));t[e]=_.result(a,"sampleValue")},e.generatePaginationRes=function(e,t,n,i,o,a){var r={},s=t.output;if(null==s?void 0:s.next)s&&(this.setPaginationItems(s.next,n,r,"next",i),this.setPaginationItems(s.prev,n,r,"prev",i));else{if((null==s?void 0:s.size)?this.setPaginationItems(s.size,n,r,"size",i):this.setParameterVal("size",r,e,a),(null==s?void 0:s.page)?this.setPaginationItems(s.page,n,r,"page",i):"offset"!==t.type&&this.setParameterVal("page",r,e,a),_.startsWith(null==s?void 0:s.totalElements,"$minValue")){var l=s.totalElements.replace("$minValue=",""),c=r.page?r.page:o.page,p=r.size*c;!a.pagination||a.pagination.totalElements>p?r.totalElements=parseInt(l):r.totalElements=p+1}else(null==s?void 0:s.totalElements)?this.setPaginationItems(s.totalElements,n,r,"totalElements",i):"offset"===t.type||t.input.offset?r.totalElements=r.size*(o.page?o.page:1)+1:r.totalElements=r.size*r.page+1;(null==s?void 0:s.hasMoreItems)?this.setPaginationItems(s.hasMoreItems,n,r,"hasMoreItems",i):r.hasMoreItems=""}return r},e}(),oe=function(e){return _.includes(["QueryExecution","ProcedureExecution"],e.controller)&&_.includes(["put","post"],e.operationType)},ae=function(e,t){return e===m.CONTROLLER_TYPE.QUERY&&t===m.SERVICE_TYPE.DATA},re=function(e,t,i){var o=_.toLower(n.extractType(_.get(t,"items.type")||t.type)),a=h.isStudioMode?t["x-WM-CONTENT_TYPE"]:t.contentType;if(q())return"file"===o||"string"!==a&&a?_.isArray(i)&&"file"===o?_.forEach(i,(function(i){e.append(t.name,i&&i.content||n.getBlob(i),i.name)})):e.append(t.name,n.getBlob(i,a),i&&i.name):(_.isObject(i)&&(i=JSON.stringify(i)),e.append(t.name,i)),e},se=function(e,t){var i,o={},a=[];return _.forEach(t,(function(t){i=_.get(e,t.name),_.isUndefined(i)||""===i||null===i||t.readOnly?t.required&&a.push(t.name||t.id):(i=n.isDateTimeType(t.type)?K(i,t.type):i,_.isArray(i)&&"string"===_.toLower(n.extractType(t.type))&&(i=_.join(i,",")),o[t.name]=i)})),{requestBody:o,missingParams:a}},le=function(e){var t={},n=m.REST_SERVICE.UNCLOAKED_HEADERS,i=m.REST_SERVICE.PREFIX.CLOAK_HEADER_KEY;return _.forEach(e,(function(e,o){_.includes(n,o.toUpperCase())?t[o]=e:t[i+o]=e})),t},ce=function(){function t(){}return t.constructRequestParams=function(t,i,o,a){if(t=t||{},null===i)return{error:{type:m.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED,message:m.REST_SERVICE.ERR_MSG.USER_UNAUTHORISED,field:"_wmServiceOperationInfo"}};if(_.isEmpty(i))return{error:{type:m.REST_SERVICE.ERR_TYPE.METADATA_MISSING,message:m.REST_SERVICE.ERR_MSG.METADATA_MISSING,field:"_wmServiceOperationInfo"}};if(i&&i.invalid)return{error:{type:m.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING,message:m.REST_SERVICE.ERR_MSG.CRUD_OPERATION_MISSING,field:"_wmServiceOperationInfo"}};var r,s,l,c,p,d,u,y,b,w,P,O,E,R,A,T,S,C=i.directPath||"",I=i.basePath?i.basePath+i.relativePath:i.relativePath,D=oe(t),x="",N={},k=[],M=null;function L(){return b||(b=new FormData)}if(E=_.get(i.securityDefinitions,"0"))switch(E.type){case m.REST_SERVICE.SECURITY_DEFN.OAUTH2:if(T=E[m.REST_SERVICE.OAUTH_PROVIDER_KEY],S=null,!(R=e.oauthService.getAccessToken(T,S)))return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN,message:m.REST_SERVICE.ERR_MSG.NO_ACCESSTOKEN},securityDefnObj:E};N[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.OAUTH+" "+R;break;case m.REST_SERVICE.SECURITY_DEFN.BASIC:if(d=o.wm_auth_username,u=o.wm_auth_password,!d||!u)return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_CREDENTIALS,message:m.REST_SERVICE.ERR_MSG.NO_CREDENTIALS},securityDefnObj:E};N[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.BASIC+" "+btoa(d+":"+u),M={type:m.REST_SERVICE.AUTH_TYPE.BASIC}}if(ie.checkPaginationAtQuery(i,t,a),i.proxySettings=i.proxySettings||{web:!0,mobile:!1},y=i.httpMethod||i.methodType,w=h.hasCordova?i.proxySettings.mobile:i.proxySettings.web,A=i.proxySettings.withCredentials,l=w?I:C,_.forEach(i.parameters,(function(e){function a(){o?(P=o[e.name]&&_.isObject(o[e.name])?o[e.name]:o,O=_.get(i,["definitions",e.type])):(P=c||{},O=e.children)}var c=e.sampleValue;if(n.isDefined(c)&&null!==c&&""!==c||D&&"file"!==e.type)switch(t.serviceType===m.SERVICE_TYPE.DATA&&n.isDateTimeType(e.type)&&(c=K(c,e.type)),_.isArray(c)&&"string"===_.toLower(n.extractType(e.type))&&t.serviceType===m.SERVICE_TYPE.DATA&&(c=_.join(c,",")),e.parameterType.toUpperCase()){case"QUERY":if(_.isNull(c)&&ae(t.controller,t.serviceType))break;x?x+="&"+e.name+"="+encodeURIComponent(c):x="?"+e.name+"="+encodeURIComponent(c);break;case"PATH":p=new RegExp("\\s*\\{\\s*"+e.name+"(:\\.\\+)?\\s*\\}\\s*"),l=l.replace(p,c);break;case"HEADER":N[e.name]=c;break;case"BODY":D?(a(),r=se(P,O),s=r.requestBody,k=_.concat(k,r.missingParams)):s=c;break;case"FORMDATA":D&&e.name===g.WM_DATA_JSON?(a(),r=se(P,O),s=re(L(),e,r.requestBody),k=_.concat(k,r.missingParams)):s=re(L(),e,c)}else e.required&&k.push(e.name||e.id)})),k.length)return{error:{type:m.REST_SERVICE.ERR_TYPE.REQUIRED_FIELD_MISSING,field:k.join(","),message:n.replace(m.REST_SERVICE.ERR_MSG.REQUIRED_FIELD_MISSING,[k.join(",")]),skipDefaultNotification:!0}};_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(y))||i.consumes&&i.consumes[0]===f.CONTENT_TYPES.MULTIPART_FORMDATA||(N["Content-Type"]=i.consumes&&i.consumes[0]||"application/json"),_.includes(i.consumes,f.CONTENT_TYPES.FORM_URL_ENCODED)&&!_.includes(f.NON_BODY_HTTP_METHODS,(y||"").toUpperCase())?(x&&(s=(s?s+"&":"")+x.substring(1)),N["Content-Type"]=f.CONTENT_TYPES.FORM_URL_ENCODED):l+=x,w&&(N=t.serviceType!==m.SERVICE_TYPE.REST&&t.serviceType!==m.SERVICE_TYPE.OPENAPI||i.skipCloakHeaders?N:le(N),t.getPrefabName()&&-1!==m.REST_SUPPORTED_SERVICES.indexOf(t.serviceType)?(l="prefabs/"+t.getPrefabName()+l,c="invokePrefabRestService"):t.getPrefabName()||(l="services"+l),l=v.project.deployedUrl+l);var F=ie.getPaginationInfo(i,t);if(F&&t.pagination){var j=ie.setPaginationAtReq(F,i,t,N,s,l,a);j&&(j.headers?N=j.headers:j.requestBody?s=j.requestBody:j.url&&(l=j.url))}return{projectID:v.project.id,url:l,target:c,method:y,headers:N,data:s,authDetails:M,isDirectCall:!w,isExtURL:t.serviceType===m.SERVICE_TYPE.REST,withCredentials:A}},t.isFileUploadRequest=function(e){return"FileService"===e.service&&"uploadFile"===e.operation},t.excludePaginationParams=function(e){return _.map(_.reject(e,(function(e){return _.includes(m.PAGINATION_PARAMS,e.name)})),(function(e){return e.name}))},t}(),pe=function(t){function o(){var e=t.apply(this,P([],w(arguments)))||this;return e.scope_var_socket_map=new Map,e.PROPERTY={SERVICE:"service",DATA_UPDATE_STRATEGY:"dataUpdateStrategy",DATA_LIMIT:"dataLimit"},e.DATA_UPDATE_STRATEGY={REFRESH:"refresh",PREPEND:"prepend",APPEND:"append"},e}return b(o,t),o.prototype.shouldAppendData=function(e){return(e=e||this)[this.PROPERTY.DATA_UPDATE_STRATEGY]!==this.DATA_UPDATE_STRATEGY.REFRESH},o.prototype.shouldAppendLast=function(e){return e[this.PROPERTY.DATA_UPDATE_STRATEGY]===this.DATA_UPDATE_STRATEGY.APPEND},o.prototype.getDataLimit=function(e){return e.dataLimit},o.prototype.getURL=function(t){var n,i=t.getPrefabName(),o=i?_.get(e.metadataService.getByOperationId(t.operationId,i),"wmServiceOperationInfo"):_.get(e.metadataService.getByOperationId(t.operationId),"wmServiceOperationInfo"),a=t.dataBinding;if(_.forEach(o.parameters,(function(e){e.sampleValue=a[e.name]})),$.extend(o,{skipCloakHeaders:!0}),!(n=ce.constructRequestParams(t,o,a)).error||!n.error.message)return n.url;this._onSocketError(t,{data:n.error.message})},o.prototype._onSocketMessage=function(e,t){var i,o,a,r,s,l=_.get(t,"data");l=n.getValidJSON(l)||n.xmlToJson(l)||l,i=I(m.EVENT.MESSAGE_RECEIVE,e,l,t),l=n.isDefined(i)?i:l,this.shouldAppendData(e)?(e.dataSet=e.dataSet||[],o=e.dataSet.length,a=this.getDataLimit(e),r=this.shouldAppendLast(e),a&&o>=a&&(r?e.dataSet.shift():e.dataSet.pop()),s=r?o:0,e.dataSet.splice(s,0,l)):e.dataSet=n.isDefined(i)?i:l},o.prototype._onBeforeSend=function(e,t){return I(m.EVENT.BEFORE_SEND,e,t)},o.prototype._onBeforeSocketClose=function(e,t){return I(m.EVENT.BEFORE_CLOSE,e,_.get(t,"data"),t)},o.prototype._onBeforeSocketOpen=function(e,t){return I(m.EVENT.BEFORE_OPEN,e,_.get(t,"data"),t)},o.prototype._onSocketOpen=function(e,t){e._socketConnected=!0,I(m.EVENT.OPEN,e,_.get(t,"data"),t)},o.prototype.freeSocket=function(e){this.scope_var_socket_map.set(e,void 0)},o.prototype._onSocketClose=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.CLOSE,e,_.get(t,"data"),t)},o.prototype._onSocketError=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.ERROR,e,_.get(t,"data")||"Error while connecting with "+e.service,t)},o.prototype.getSocket=function(e){var t=this.getURL(e),o=this.scope_var_socket_map.get(e);return o||(h.hasCordova||!n.isInsecureContentRequest(t)?((o=new i.$WebSocket(t)).onOpen(this._onSocketOpen.bind(this,e)),o.onError(this._onSocketError.bind(this,e)),o.onMessage(this._onSocketMessage.bind(this,e)),o.onClose(this._onSocketClose.bind(this,e)),this.scope_var_socket_map.set(e,o),e._socket=o,o):void n.triggerFn(this._onSocketError.bind(this,e)))},o.prototype.open=function(e,t,i){var o;if(!1!==this._onBeforeSocketOpen(e))return o=this.getSocket(e),n.triggerFn(t),o;n.triggerFn(i)},o.prototype.close=function(e){var t=this._onBeforeSocketClose(e),n=this.getSocket(e);!1!==t&&n.close()},o.prototype.send=function(e,t){var i,o=this.getSocket(e);t=t||_.get(e,"dataBinding.RequestBody"),!1!==(i=this._onBeforeSend(e,t))&&(t=n.isDefined(i)?i:t,t=n.isObject(t)?JSON.stringify(t):t,o.send(t,0))},o}(X),de=new Map,ue={Variable:X,Action:Q,"wm.NavigationVariable":Z,"wm.NotificationVariable":J,"wm.LoginVariable":ee,"wm.LogoutVariable":te,"wm.DeviceVariable":ne,"wm.WebSocketVariable":pe},he=function(){function e(){}return e.get=function(e){return de.has(e)?de.get(e):de.set(e,new ue[e]).get(e)},e}(),me=function(){function e(){}return e.prototype.invoke=function(e,t){var i=this.operations.find((function(t){return t.name===e.operation}));if(null==i)return I(m.EVENT.ERROR,e,null),Promise.reject("Could not find operation '"+e.operation+"' in service '"+this.name+"'");if(n.hasCordova()){var o=new Map;return void 0!==e.dataBinding&&(Object.entries(e).forEach((function(e){o.set(e[0],e[1])})),Object.entries(e.dataBinding).forEach((function(e){o.set(e[0],e[1])}))),i.invoke(e,t,o).then((function(t){return e.dataSet=t,n.$invokeWatchers(!0),I(m.EVENT.SUCCESS,e,t),t}),(function(t){return e.dataSet={},n.$invokeWatchers(!0),I(m.EVENT.ERROR,e,null),t}))}return Promise.resolve().then((function(){return I(m.EVENT.SUCCESS,e,i.model),i.model}))},e}(),fe=function(){return he.get(m.CATEGORY.DEVICE)},ge=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.init=function(){fe().initBinding(this)},t.prototype.invoke=function(e,t,n){fe().invoke(this,e).then(t,n)},t}(t.ApiAwareVariable),ve=function(){return he.get(m.CATEGORY.NAVIGATION)},ye=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.invoke=function(e){ve().invoke(this,e)},t.prototype.navigate=function(e){this.invoke(e)},t.prototype.init=function(){ve().initBinding(this,"dataBinding","dataBinding"),ve().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),be=function(){return he.get(m.CATEGORY.NOTIFICATION)},we=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.execute=function(t,i){var o=this,a=e.prototype.execute.call(this,t,i);return n.isDefined(a)?a:new Promise((function(e,a){switch(t){case n.DataSource.Operation.INVOKE:o.invoke(i,e,a);break;case n.DataSource.Operation.NOTIFY:o.notify(i,e,a);break;default:a(t+" operation is not supported on this data source")}}))},t.prototype.notify=function(e,t,n){be().notify(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.notify(e,t,n)},t.prototype.getMessage=function(){return be().getMessage(this)},t.prototype.setMessage=function(e){return be().setMessage(this,e)},t.prototype.clearMessage=function(){return be().setMessage(this,"")},t.prototype.getOkButtonText=function(){return be().getOkButtonText(this)},t.prototype.setOkButtonText=function(e){return be().setOkButtonText(this,e)},t.prototype.getToasterDuration=function(){return be().getToasterDuration(this)},t.prototype.setToasterDuration=function(e){return be().setToasterDuration(this,e)},t.prototype.getToasterClass=function(){return be().getToasterClass(this)},t.prototype.setToasterClass=function(e){return be().setToasterClass(this,e)},t.prototype.getToasterPosition=function(){return be().getToasterPosition(this)},t.prototype.setToasterPosition=function(e){return be().setToasterPosition(this,e)},t.prototype.getAlertType=function(){return be().getAlertType(this)},t.prototype.setAlertType=function(e){return be().setAlertType(this,e)},t.prototype.getCancelButtonText=function(){return be().getCancelButtonText(this)},t.prototype.setCancelButtonText=function(e){return be().setCancelButtonText(this,e)},t.prototype.init=function(){be().initBinding(this,"dataBinding","dataBinding"),be().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),Pe=function(){return he.get(m.CATEGORY.LOGIN)},_e=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.login=function(e,t,n){return Pe().login(this,e,t,n)},t.prototype.invoke=function(e,t,n){return this.login(e,t,n)},t.prototype.cancel=function(){},t.prototype.init=function(){Pe().initBinding(this,"dataBinding","dataBinding")},t}(t.BaseAction),Oe=function(){return he.get(m.CATEGORY.LOGOUT)},Ee=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.logout=function(e,t,n){Oe().logout(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.logout(e,t,n)},t.prototype.cancel=function(){},t}(t.BaseAction),Re=function(){return he.get(m.CATEGORY.WEBSOCKET)},Ae=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.open=function(e,t){return Re().open(this,e,t)},t.prototype.close=function(){return Re().close(this)},t.prototype.update=function(){return Re().update(this)},t.prototype.send=function(e){return Re().send(this,e)},t.prototype.cancel=function(){return this.close()},t.prototype.invoke=function(e,t,n){this.open(t,n)},t.prototype.init=function(){Re().initBinding(this)},t}(t.ApiAwareVariable),Te=function(){function e(){}return e.create=function(e,n){var i;switch(e.category){case t.VARIABLE_CONSTANTS.CATEGORY.MODEL:i=new t.ModelVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.SERVICE:i=new t.ServiceVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LIVE:i=new t.LiveVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.CRUD:i=new t.CrudVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.DEVICE:i=new ge(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NAVIGATION:i=new ye(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NOTIFICATION:i=new we(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGIN:i=new _e(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGOUT:i=new Ee(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.TIMER:i=new t.TimerAction(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.WEBSOCKET:i=new Ae(e)}return i._context=n,i.__cloneable__=!1,i},e}(),Se=function(){function e(e){this.$http=e,this.CONTEXT_APP="app"}return e.prototype.isLoaded=function(){return!!this.metadataMap&&this.metadataMap.has(this.CONTEXT_APP)},e.prototype.load=function(e){var t,i=this;return t=n.hasCordova()?"metadata/"+(e?"prefabs/"+e+"/":"app/")+"service-definitions.json":"./services/"+(e?"prefabs/"+e+"/":"")+"servicedefs",new Promise((function(n,o){i.$http.send({url:t,method:"GET"}).then((function(t){i.metadataMap=i.metadataMap||new Map,i.providerMap=i.providerMap||new Map,t.body=t.body||{},i.metadataMap.set(e||i.CONTEXT_APP,t.body.serviceDefs),t.body.securityDefinitions&&i.providerMap.set(e||i.CONTEXT_APP,t.body.securityDefinitions.oauthProvider),n(t.body.serviceDefs)}),o)}))},e.prototype.getByOperationId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t);return n&&n[e]},e.prototype.getByProviderId=function(e,t){t=t||this.CONTEXT_APP;var n=this.providerMap.get(t);return n&&n[e]},e.prototype.getByCrudId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t),i=[];for(var o in n)n[o]&&n[o].crudOperationId===e&&i.push(n[o]);return i},e}();Se.decorators=[{type:a.Injectable}],Se.ctorParameters=function(){return[{type:n.AbstractHttpService}]};var Ce=function(){function t(){}return t.prototype.format=function(t,n){return e.appManager.getPipe("date").transform(t,n)},t}(),Ie=function(){function e(e,n,i,o,a,r,s,l){this.httpService=e,this.metadataService=n,this.navigationService=i,this.routerService=o,this.toasterService=a,this.oAuthService=r,this.securityService=s,this.dialogService=l,C("http",this.httpService),C("metadata",this.metadataService),C("navigationService",this.navigationService),C("router",this.routerService),C("toaster",this.toasterService),C("oAuth",this.oAuthService),C("security",this.securityService),C("dialog",this.dialogService),t.wmSetDependency("oAuth",this.oAuthService),t.wmSetDependency("security",this.securityService),t.wmSetDependency("metadata",this.metadataService)}return e.prototype.bulkCancel=function(e){Object.keys(e).forEach((function(t){var n=e[t];_.isFunction(n.cancel)&&n.cancel()}))},e.prototype.triggerStartUpdate=function(e){return Promise.all(Object.keys(e).map((function(t){return e[t]})).filter((function(e){return(null==e?void 0:e.startUpdate)&&e.invoke})).map((function(e){return e.invoke()})))},e.prototype.processBindExp=function(e,i,o){var a=t.getTarget(o),r=t.getTargetNodeKey(e.target),s=_.isArray(e.value)?e.value[0]:e.value;return s&&(s.startsWith&&s.startsWith("bind:")?s=n.$watch(s.replace("bind:",""),i,{},o.invokeOnParamChange.bind(o,e),void 0,void 0,void 0,(function(){return o.isMuted})):_.isUndefined(e.value)||(t.setValueToNode(e.target,e,a,o,e.value,!0),a!==r&&(t.internalBoundNodeMap.has(o)||t.internalBoundNodeMap.set(o,{}),_.set(t.internalBoundNodeMap.get(o),[o.name,a,e.target],e.value)))),{name:e.target,value:s}},e.prototype.processBinding=function(e,t,n,i){var o=this;i=i||"dataBinding";var a=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=a,a&&_.isArray(a)&&a.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),o.processBindExp(n,t,e)}))},e.prototype.isVariableSeperated=function(e,t){return"wm.Variable"===e[t].category||"wm.ServiceVariable"===e[t].category||"wm.LiveVariable"===e[t].category||"wm.CrudVariable"===e[t].category},e.prototype.getBindSourceTarget=function(e){return"wm.LiveVariable"===e.category?"read"===e.operation?"filterFields":"inputFields":"wm.ModelVariable"===e.category?"dataSet":"dataBinding"},e.prototype.register=function(e,i,o){var a,r=this,s={Variables:{},Actions:{},callback:this.triggerStartUpdate};for(var l in i){if((a=Te.create(i[l],o)).init(),this.isVariableSeperated(i,l)&&(this.processBinding(a,o,"dataBinding",this.getBindSourceTarget(a)),a.httpService=this.httpService,a.dateFormatter=new Ce,a.subscribe("afterInvoke",(function(){return n.$invokeWatchers(!0)})),"wm.LiveVariable"===a.category&&"read"===a.operation&&n.processFilterExpBindNode(a._context,a.filterExpressions,a),"wm.CrudVariable"!==a.category&&"wm.ServiceVariable"!==a.category||(a.simulateFileDownload=U)),this.isVariableSeperated(i,l)||"wm.TimerVariable"===i[l].category)for(var c in m.EVENT)a[m.EVENT[c]]&&(a[m.EVENT[c]]=n.$parseEvent(a[m.EVENT[c]]));a instanceof t.BaseAction?s.Actions[l]=a:s.Variables[l]=a}return o.registerDestroyListener&&o.registerDestroyListener((function(){r.bulkCancel(s.Variables),r.bulkCancel(s.Actions)})),s},e.prototype.destroy=function(){},e.prototype.registerDependency=function(e,n){C(e,n),t.wmSetDependency(e,n)},e}();Ie.decorators=[{type:a.Injectable}],Ie.ctorParameters=function(){return[{type:n.AbstractHttpService},{type:Se},{type:n.AbstractNavigationService},{type:r.Router},{type:n.AbstractToasterService},{type:s.OAuthService},{type:l.SecurityService},{type:n.AbstractDialogService}]};var De=d.ToastrModule.forRoot({maxOpened:1,autoDismiss:!0}),xe=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[Ie,Se,c.Location,{provide:c.LocationStrategy,useClass:c.HashLocationStrategy}]}},e}();xe.decorators=[{type:a.NgModule,args:[{imports:[c.CommonModule,De,p.HttpClientModule,u.HttpServiceModule,s.OAuthModule,l.SecurityModule],declarations:[]}]}],e.$rootScope=v,e.CONSTANTS=h,e.DB_CONSTANTS={DATABASE_MATCH_MODES:{like:"LIKE",start:"STARTING_WITH",startignorecase:"STARTING_WITH_IGNORECASE",end:"ENDING_WITH",endignorecase:"ENDING_WITH_IGNORECASE",anywhere:"CONTAINING",anywhereignorecase:"CONTAINING_IGNORECASE",nowhere:"DOES_NOT_CONTAIN",nowhereignorecase:"DOES_NOT_CONTAIN_IGNORECASE",exact:"EQUALS",exactignorecase:"EQUALS_IGNORECASE",notequals:"NOT_EQUALS",notequalsignorecase:"NOT_EQUALS_IGNORECASE",between:"BETWEEN",in:"IN",notin:"NOTIN",lessthan:"LESS_THAN",lessthanequal:"LESS_THAN_OR_EQUALS",greaterthan:"GREATER_THAN",greaterthanequal:"GREATER_THAN_OR_EQUALS",null:"NULL",isnotnull:"IS_NOT_NULL",empty:"EMPTY",isnotempty:"IS_NOT_EMPTY",nullorempty:"NULL_OR_EMPTY"},DATABASE_EMPTY_MATCH_MODES:["NULL","IS_NOT_NULL","EMPTY","IS_NOT_EMPTY","NULL_OR_EMPTY"],DATABASE_RANGE_MATCH_MODES:["IN","NOTIN","BETWEEN","LESS_THAN","LESS_THAN_OR_EQUALS","GREATER_THAN","GREATER_THAN_OR_EQUALS","NOT_EQUALS"],DATABASE_NULL_EMPTY_MATCH:{NULL:"NULL",IS_NOT_NULL:"IS_NOT_NULL",EMPTY:"NULL",IS_NOT_EMPTY:"IS_NOT_NULL",NULL_OR_EMPTY:"NULL"},DATABASE_MATCH_MODES_WITH_QUERY:{LIKE:"${0} like ${1}",STARTING_WITH:"${0} like ${1}",STARTING_WITH_IGNORECASE:"${0} like ${1}",ENDING_WITH:"${0} like ${1}",ENDING_WITH_IGNORECASE:"${0} like ${1}",CONTAINING:"${0} like ${1}",CONTAINING_IGNORECASE:"${0} like ${1}",DOES_NOT_CONTAIN:"${0} not like ${1}",DOES_NOT_CONTAIN_IGNORECASE:"${0} not like ${1}",EQUALS:"${0}=${1}",EQUALS_IGNORECASE:"${0}=${1}",NOT_EQUALS:"${0}!=${1}",NOT_EQUALS_IGNORECASE:"${0}!=${1}",BETWEEN:"${0} between ${1}",IN:"${0} in ${1}",NOTIN:"${0} not in ${1}",LESS_THAN:"${0}<${1}",LESS_THAN_OR_EQUALS:"${0}<=${1}",GREATER_THAN:"${0}>${1}",GREATER_THAN_OR_EQUALS:"${0}>=${1}",NULL:"${0} is null",IS_NOT_NULL:"${0} is not null",EMPTY:"${0}=''",IS_NOT_EMPTY:"${0}<>''",NULL_OR_EMPTY:"${0} is null or ${0}=''"},DATABASE_STRING_MODES:["LIKE","STARTING_WITH","STARTING_WITH_IGNORECASE","ENDING_WITH","ENDING_WITH_IGNORECASE","CONTAINING","CONTAINING_IGNORECASE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_IGNORECASE","EQUALS","EQUALS_IGNORECASE","NOT_EQUALS","NOT_EQUALS_IGNORECASE"]},e.DeviceVariableManager=ne,e.DeviceVariableService=me,e.Formatter=Ce,e.MetadataService=Se,e.SWAGGER_CONSTANTS=g,e.VARIABLE_CONSTANTS=m,e.VARIABLE_URLS={DATABASE:{searchTableData:{url:"/:service/:dataModelName/:entityName/search?page=:page&size=:size&:sort",method:"POST"},searchTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/filter?page=:page&size=:size&:sort",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}},readTableData:{url:"/:service/:dataModelName/:entityName?page=:page&size=:size&:sort",method:"GET"},insertTableData:{url:"/:service/:dataModelName/:entityName",method:"POST"},insertMultiPartTableData:{url:"/:service/:dataModelName/:entityName",method:"POST",headers:{}},updateTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"PUT"},updateMultiPartTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"POST",headers:{}},deleteTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"DELETE"},updateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"PUT"},periodUpdateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"PUT"},updateMultiPartCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"POST",headers:{}},deleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"DELETE"},periodDeleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"DELETE"},getDistinctDataByFields:{url:"/:service/:dataModelName/:entityName/aggregations?page=:page&size=:size&:sort",method:"POST"},exportTableData:{url:"/services/:dataModelName/:entityName/export?:sort",method:"POST"},readTableRelatedData:{url:"/:service/:dataModelName/:entityName/:id/:relatedFieldName?page=:page&size=:size&:sort",method:"GET"},executeNamedQuery:{url:"/:service/:dataModelName/queryExecutor/queries/:queryName?page=:page&size=:size&:queryParams",method:"GET"},executeCustomQuery:{url:"/:service/:dataModelName/queries/execute?page=:page&size=:size",method:"POST"},executeAggregateQuery:{url:"/services/:dataModelName/:entityName/aggregations?page=:page&size=:size&sort=:sort",method:"POST"},executeNamedProcedure:{url:"/:service/:dataModelName/procedureExecutor/procedure/execute/:procedureName?page=:page&size=:size&:procedureParams",method:"GET"},countTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/count?:queryParams",method:"GET"}},oauthConfiguration:{getAuthorizationUrl:{url:"services/oauth2/:providerId/authorizationUrl",method:"GET"}}},e.VariableManagerFactory=he,e.VariablesModule=xe,e.VariablesService=Ie,e.WS_CONSTANTS=f,e.debounceVariableCall=z,e.formatDate=K,e.formatExportExpression=function(e){return _.forEach(e,(function(e){e.expression&&(e.expression="${"+e.expression+"}")})),e},e.getEvaluatedOrderBy=function(e,t){var n,i;return!t||_.isEmpty(t)?e:e?(e=_.split(e,","),t=_.split(t,","),n=_.map(t,(function(e){return _.split(_.trim(e)," ")[0]})),_.remove(e,(function(e){return _.includes(n,_.split(_.trim(e)," ")[0])})),i=e.length?","+_.join(e,","):"",_.join(t,",")+i):t},e.initiateCallback=I,e.isFileUploadSupported=q,e.processBinding=W,e.setDependency=C,e.setInput=function(e,t,i,o){e=e||{};var a,r,s={};if(_.isObject(o))switch(o.type){case"file":i=n.getBlob(i,o.contentType);break;case"number":i=_.isNumber(i)?i:parseInt(i,10)}return _.isObject(t)?s=t:t.indexOf(".")>-1?(r=(a=t.split(".")).pop(),e=n.findValueOf(e,a.join("."),!0),s[t=r]=i):s[t]=i,_.forEach(s,(function(t,n){e[n]=t})),e},e.simulateFileDownload=U,e.toastrModule=De,e["\u0275a"]=X,e["\u0275b"]=Q,e["\u0275c"]=Z,e["\u0275d"]=J,e["\u0275e"]=ee,e["\u0275f"]=te,e["\u0275g"]=pe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@wm/mobile/runtime",["exports","@angular/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.runtime={}),e.ng.core)}(this,(function(e,t){"use strict";var n=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();n.decorators=[{type:t.NgModule,args:[{}]}],e.MobileRuntimeModule=n,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@wm/mobile/runtime/dynamic",["exports","@angular/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.runtime=e.wm.mobile.runtime||{},e.wm.mobile.runtime.dynamic={}),e.ng.core)}(this,(function(e,t){"use strict";var n=function(){};n.decorators=[{type:t.NgModule,args:[{}]}],e.MOBILE_COMPONENT_MODULES_FOR_ROOT=[],e.MobileRuntimeDynamicModule=n,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/router"),require("@angular/common"),require("@wm/core"),require("@wm/security"),require("@wm/variables"),require("@wm/components/page"),require("rxjs"),require("@wm/components/base"),require("@wm/components/prefab"),require("@angular/common/http"),require("@angular/platform-browser"),require("ngx-toastr"),require("@wm/components/dialogs"),require("@wm/components/dialogs/confirm-dialog"),require("@wm/components/dialogs/design-dialog"),require("@wm/mobile/runtime"),require("@wm/http"),require("@wm/oAuth"),require("ngx-bootstrap/chronos"),require("ngx-bootstrap/datepicker"),require("ngx-bootstrap/utils"),require("rxjs/operators"),require("@wm/transpiler"),require("@wm/build-task")):"function"==typeof define&&define.amd?define("@wm/runtime/base",["exports","@angular/core","@angular/router","@angular/common","@wm/core","@wm/security","@wm/variables","@wm/components/page","rxjs","@wm/components/base","@wm/components/prefab","@angular/common/http","@angular/platform-browser","ngx-toastr","@wm/components/dialogs","@wm/components/dialogs/confirm-dialog","@wm/components/dialogs/design-dialog","@wm/mobile/runtime","@wm/http","@wm/oAuth","ngx-bootstrap/chronos","ngx-bootstrap/datepicker","ngx-bootstrap/utils","rxjs/operators","@wm/transpiler","@wm/build-task"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.runtime=e.wm.runtime||{},e.wm.runtime.base={}),e.ng.core,e.ng.router,e.ng.common,e.wm.core,e.wm.security,e.wm.variables,e.wm.components.page,e.rxjs,e.wm.components.base,e.wm.components.prefab,e.ng.common.http,e.ng.platformBrowser,e.ngxToastr,e.wm.components.dialogs,e.wm.components.dialogs.confirmdialog,e.wm.components.dialogs.designdialog,e.wm.mobile.runtime,e.wm.http,e.wm.oAuth,e["ngx-bootstrap"].chronos,e["ngx-bootstrap"].datepicker,e["ngx-bootstrap"].utils,e.rxjs.operators,e.wm.transpiler,e.wm.buildTask)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u,h,m,f,g,v,y,b,w,P,O,E,R,A){"use strict";function T(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var S,C=T(t),I=T(o),D=T(u);e.ComponentType=void 0,(S=e.ComponentType||(e.ComponentType={}))[S.PAGE=0]="PAGE",S[S.PREFAB=1]="PREFAB",S[S.PARTIAL=2]="PARTIAL";var x,N=function(){function e(){}return e.prototype.clearComponentFactoryRefCache=function(){},e}(),k=function(){},M=function(){},L=function(){},F=function(){};!function(e){e.HIDE_TEMPLATES_SHOW_CASE="hide-templates-show-case",e.SHOW_TEMPLATES_SHOW_CASE="show-templates-show-case",e.UPDATE_LOCATION="update-location-path",e.SELECT_TEMPLATE="select-template",e.TEMPLATEBUNDLE_CONFIG="template-bundle-config",e.ON_LOAD="on-load"}(x||(x={}));var j=function(){function e(e,t,n,i,o,a,r,s,l,c){var p=this;this.$http=e,this.$security=t,this.$dialog=n,this.$router=i,this.$app=o,this.$variables=a,this.$metadata=r,this.$spinner=s,this.$i18n=l,this.$datePipe=c,this.appVariablesLoaded=!1,this.appVariablesFired=!1,this._noRedirect=!1,this.$http.registerOnSessionTimeout(this.handle401.bind(this)),this.$variables.registerDependency("appManager",this),this.$app.subscribe("toggle-variable-state",(function(e){var t,n=e.variable,i=e.active;if(!_.isEmpty(_.trim(n.spinnerContext)))if(i){if(n._spinnerId&&n._spinnerId.length&&_.forEach(n._spinnerId,(function(e){e.slice(0,e.lastIndexOf("_"))!==n._id||!p.$spinner.messagesByContext||!p.$spinner.messagesByContext[n.spinnerContext]||n.spinnerMessage!==p.$spinner.messagesByContext[n.spinnerContext].finalMessage&&n.spinnerMessage!==p.$spinner.messagesByContext[n.spinnerContext][e]||(t=!0)})),!t){n._spinnerId=n._spinnerId||[];var o=p.$spinner.show(n.spinnerMessage,n._id+"_"+Date.now(),n.spinnerclass,n.spinnerContext);n._spinnerId.push(o)}}else p.$spinner.hide(n._spinnerId.shift())})),this.$app.subscribe("userLoggedIn",(function(){p.setLandingPage(),p.lastLoggedUserId&&p.$security.getConfig((function(e){e&&e.userInfo.userId!==p.lastLoggedUserId&&p.$app.clearPageCache()}),null)})),this.$app.subscribe("userLoggedOut",(function(){return p.setLandingPage().then((function(){p.$app.clearPageCache()}))})),this.$app.subscribe("http401",(function(e){return void 0===e&&(e={}),p.handle401(e.page,e.options)}))}return e.prototype.showLoginDialog=function(){this.$spinner.hide("globalSpinner"),this.$dialog.open("CommonLoginDialog"),o.$appDigest()},e.prototype.loadAppJS=function(){},e.prototype.loadCommonPage=function(){},e.prototype.loadSecurityConfig=function(e){var t=this;return this.$security.load(e).then((function(e){return t.$app.landingPageName||t.setLandingPage(),e}))},e.prototype.loadMetadata=function(){return this.$metadata.load()},e.prototype.loadAppVariables=function(e){var t=this;if(this.appVariablesLoaded)return Promise.resolve();var n=function(e){var n=t.$variables.register("app",e,t.$app);_.extend(t.$app.Variables,n.Variables),_.extend(t.$app.Actions,n.Actions),t.updateLoggedInUserVariable(),t.updateSupportedLocaleVariable(),t.appVariablesLoaded=!0,t.appVariablesFired=!1};return o.isDefined(e)?(n(e),Promise.resolve()):this.$http.get("./app.variables.json").then((function(e){return n(e)}))},e.prototype.isAppVariablesFired=function(e){return o.isDefined(e)&&(this.appVariablesFired=e),this.appVariablesFired},e.prototype.clearLoggedInUserVariable=function(e){e.isAuthenticated=!1,e.roles=[],e.name=void 0,e.id=void 0,e.tenantId=void 0},e.prototype.updateLoggedInUserVariable=function(){var e=this,t=_.get(this.$app,"Variables.loggedInUser.dataSet");if(t)return this.$security.load().then((function(){var n=e.$security.get();if(!(n&&n.securityEnabled&&n.authenticated))throw e.clearLoggedInUserVariable(t),t.isSecurityEnabled=n&&n.securityEnabled,null;return t.isAuthenticated=n.authenticated,t.roles=n.userInfo.userRoles,t.name=n.userInfo.userName,t.id=n.userInfo.userId,t.tenantId=n.userInfo.tenantId,t.userAttributes=n.userInfo.userAttributes,n})).catch((function(e){t.isAuthenticated=!1,t.roles=[],t.name=void 0,t.id=void 0,t.tenantId=void 0,t.userAttributes={}}))},e.prototype.updateSupportedLocaleVariable=function(){_.get(this.$app,"Variables.supportedLocale")},e.prototype.handleSSOLogin=function(e){var t,n,i=this;if(t=this.$security.getRedirectPage(e),r.CONSTANTS.hasCordova){var o=_.get(this.$security.get(),"userInfo.userName");this.$security.authInBrowser().then((function(){return i.reloadAppData()})).then((function(){var e=_.get(i.$security.get(),"userInfo.userName");e&&e===o?r.routerService.navigate([t]):r.routerService.navigate(["/"])}))}else{t=t?"?redirectPage="+encodeURIComponent(t):"",n=(n=this.$security.getQueryString(this.$security.getRedirectedRouteQueryParams()))?"?"+n:"",document.body.textContent=_.get(this.getAppLocale(),["MESSAGE_LOGIN_REDIRECTION"])||"Redirecting to sso login...";var a=this.getDeployedURL()+"services/security/ssologin"+t+n;window.self!==window.top&&"WM_PREVIEW_WINDOW"===window.parent.name?(window.parent.location.href=window.self.location.href,window.parent.name=""):window.location.href=a}},e.prototype.handle401=function(e,t){var n,i,o="DIALOG",a="PAGE",r="SSO",s=this.$security.get(),l={};if(i=s.loginConfig,this.lastLoggedUserId=s.userInfo&&s.userInfo.userId,s.userInfo&&s.userInfo.userName){switch(s.authenticated=!1,(n=i.sessionTimeout||{type:o}).type.toUpperCase()){case o:this.showLoginDialog();break;case a:e||(e=this.$security.getCurrentRoutePage()),l.redirectTo=e,l=_.merge(l,this.$security.getRedirectedRouteQueryParams()),e!==n.pageName&&this.$router.navigate([n.pageName],{queryParams:l});break;case r:this.handleSSOLogin(s)}this.setLandingPage()}else switch(i.type.toUpperCase()){case o:this.noRedirect(!0),this.showLoginDialog();break;case a:e=this.$security.getRedirectPage(s,e),l.redirectTo=e;var c=t&&t.queryParams||this.$security.getRedirectedRouteQueryParams();l=_.merge(l,c),this.$router.navigate([i.pageName],{queryParams:l}),this.$app.landingPageName=i.pageName;break;case r:this.handleSSOLogin(s)}},e.prototype.reloadAppData=function(){var e=this;return this.loadSecurityConfig(!0).then((function(){return e.loadMetadata().then((function(){return e.updateLoggedInUserVariable()}))}))},e.prototype.noRedirect=function(e){return _.isUndefined(e)||(this._noRedirect=e),this._noRedirect},e.prototype.executeSessionFailureRequests=function(){this.$http.executeSessionFailureRequests()},e.prototype.pushToSessionFailureRequests=function(e){this.$http.pushToSessionFailureQueue(e)},e.prototype.getDeployedURL=function(){return this.$app.deployedUrl?this.$app.deployedUrl:r.$rootScope.project.deployedUrl},e.prototype.getCustomUrlScheme=function(){return this.$app.customUrlScheme},e.prototype.notify=function(e,t){this.$app.notify(e,t)},e.prototype.subscribe=function(e,t){return this.$app.subscribe(e,t)},e.prototype.getActivePage=function(){return this.$app.activePage},e.prototype.getAppLocale=function(){return this.$app.appLocale},e.prototype.getSelectedLocale=function(){return this.$i18n.getSelectedLocale()},e.prototype.notifyApp=function(e,t,n){this.$app.notifyApp(e,t,n)},e.prototype.appOnBeforeServiceCall=function(e){return o.triggerFn(this.$app.onBeforeServiceCall,e)},e.prototype.appOnServiceSuccess=function(e,t){return o.triggerFn(this.$app.onServiceSuccess,e,t)},e.prototype.appOnServiceError=function(e,t){return o.triggerFn(this.$app.onServiceError,e,t)},e.prototype.appVariablesReady=function(){o.triggerFn(this.$app.onAppVariablesReady)},e.prototype.beforeAppReady=function(){o.triggerFn(this.$app.onBeforeAppReady)},e.prototype.getPipe=function(e){if("date"===e)return this.$datePipe},e.prototype.setLandingPage=function(){var e=this;return this.$security.getPageByLoggedInUser().then((function(t){return e.$app.landingPageName=t}))},e.prototype.isPrefabType=function(){return this.$app.isPrefabType},e.prototype.isTemplateBundleType=function(){return this.$app.isTemplateBundleType},e.prototype.postMessage=function(e){window.top.postMessage(e,"*")},e.prototype.showTemplate=function(e){var t=this.templates[e];this.$router.navigate([t.id])},e.prototype.postTemplateBundleInfo=function(){var e=this;return window.onmessage=function(t){var n=t.data;if(_.isObject(n))switch(n.key){case x.HIDE_TEMPLATES_SHOW_CASE:break;case x.SELECT_TEMPLATE:e.showTemplate(n.templateIndex)}},setTimeout((function(){e.postMessage({key:x.ON_LOAD})})),o.fetchContent("json","./config.json",!0,(function(t){e.templates=[],t.error||(e.templates=t.templates,e.postMessage({key:x.TEMPLATEBUNDLE_CONFIG,config:t}))}))},e.prototype.postAppTypeInfo=function(){if(this.isTemplateBundleType())return this.postTemplateBundleInfo()},e}();j.SERVICE_NAME="AppManagerService",j.decorators=[{type:t.Injectable}],j.ctorParameters=function(){return[{type:o.AbstractHttpService},{type:a.SecurityService},{type:o.AbstractDialogService},{type:n.Router},{type:o.App},{type:r.VariablesService},{type:r.MetadataService},{type:o.AbstractSpinnerService},{type:o.AbstractI18nService},{type:i.DatePipe}]};var B=function(e){return"__self__"===e},G=function(e){return B(e)?".":"app/prefabs/"+e},V=new Set,W=new Map,U=new Set,q=function(e,t){var n=e;return o.stringStartsWith(e,"http://|https://|//")||(n=(t+n).replace("//","/")),n},z=q,H=function(){function e(e,t){this.$metadata=e,this.prefabConfigProvider=t}return e.prototype.getConfig=function(e){return this.prefabConfigProvider.getConfig(e)},e.prototype.loadServiceDefs=function(e){return B(e)?Promise.resolve():this.$metadata.load(e)},e.prototype.loadStyles=function(e,t){var n=(void 0===t?{resources:{styles:[]}}:t).resources.styles,i=G(e),a=n.map((function(e){if(!_.endsWith(e,"/pages/Main/Main.css"))return q(e,i)})).filter((function(e){return!!e}));return o.loadStyleSheets(a),Promise.resolve()},e.prototype.loadScripts=function(e,t){var n=(void 0===t?{resources:{scripts:[]}}:t).resources.scripts,i=G(e),a=(n=n.filter((function(e){return!e.startsWith("npm://")}))).map((function(e){return q(e,i)}));return o.loadScripts(a,!0)},e.prototype.setInProgress=function(e){var t,n,i=new Promise((function(e,i){t=e,n=i}));i.resolve=t,i.reject=n,W.set(e,i)},e.prototype.resolveInProgress=function(e){W.get(e)&&(W.get(e).resolve(),W.delete(e))},e.prototype.loadDependencies=function(e){var t=this;return U.has(e)?Promise.resolve():V.has(e)?Promise.reject(""):W.get(e)?W.get(e):(this.setInProgress(e),this.getConfig(e).then((function(n){return Promise.all([t.loadStyles(e,n),t.loadScripts(e,n),t.loadServiceDefs(e)]).then((function(){t.resolveInProgress(e),U.add(e)}))})))},e}();H.decorators=[{type:t.Injectable}],H.ctorParameters=function(){return[{type:r.MetadataService},{type:k}]};
|
|
730
|
+
***************************************************************************** */var r=function(e,t){return(r=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)};Object.create;function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function l(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 c=function(){i.register("wm-login",new Map([["errormessage",i.PROP_STRING],["eventsource",i.PROP_ANY]]))},p={widgetType:"wm-login",hostClass:"app-login"},d=function(e){function t(t){var n=e.call(this,t,p)||this;return i.styler(n.nativeElement,n,i.APPLY_STYLES_TYPE.CONTAINER),n}return function(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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.onSuccessCB=function(){this.invokeEventCallback("success")},t.prototype.onErrorCB=function(e){this.loginMessage={type:"error",caption:this.errormessage||e||this.appLocale.LABEL_INVALID_USERNAME_OR_PASSWORD,show:!0},this.messageCmp.showMessage(this.loginMessage.caption,this.loginMessage.type),this.invokeEventCallback("error")},t.prototype.getLoginDetails=function(){return this.formCmp.dataoutput},t.prototype.doLogin=function(){this.eventsource?this.formCmp.ngform.valid&&this.eventsource.invoke({loginInfo:this.getLoginDetails()},this.onSuccessCB.bind(this),this.onErrorCB.bind(this)):console.warn('Default action "loginAction" does not exist. Either create the Action or assign an event to onSubmit of the login widget')},t.prototype.initLoginButtonActions=function(){var e=this;this.loginBtnCmp.getNativeElement().addEventListener("click",(function(t){e.nativeElement.hasAttribute("submit.event")||e.loginBtnCmp.getNativeElement().hasAttribute("click.event")||e.loginBtnCmp.getNativeElement().hasAttribute("tap.event")||e.doLogin()}))},t.prototype.ngAfterViewInit=function(){var t=this;e.prototype.ngAfterViewInit.call(this),this.formCmp.getNativeElement().addEventListener("submit",(function(e){return e.preventDefault()})),this.buttonComponents.forEach((function(e){if("loginButton"===e.getNativeElement().getAttribute("name")||_.includes(e.getNativeElement().classList,"app-login-button")){if(t.loginBtnCmp)return;t.loginBtnCmp=e,t.initLoginButtonActions()}}))},t}(i.StylableComponent);d.initializeProps=c(),d.decorators=[{type:t.Component,args:[{selector:"div[wmLogin]",template:'<p wmMessage class="app-login-message" #message show.bind="loginMessage.show" caption.bind="loginMessage.caption" type.bind="loginMessage.type"></p>\n<ng-content></ng-content>\n',providers:[i.provideAsWidgetRef(d)]}]}],d.ctorParameters=function(){return[{type:t.Injector}]},d.propDecorators={formCmp:[{type:t.ContentChild,args:[o.FormComponent]}],buttonComponents:[{type:t.ContentChildren,args:[a.ButtonComponent,{descendants:!0}]}],messageCmp:[{type:t.ViewChild,args:[i.MessageComponent,{static:!0}]}]};var u=[d],h=function(){};h.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.WmComponentsModule],declarations:l([],s(u)),exports:l([],s(u)),entryComponents:[]}]}],e.LoginComponent=d,e.LoginModule=h,e["\u0275a"]=c,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@wavemaker/variables"),require("@wm/core"),require("angular2-websocket/angular2-websocket"),require("@metrichor/jmespath"),require("@angular/core"),require("@angular/router"),require("@wm/oAuth"),require("@wm/security"),require("@angular/common"),require("@angular/common/http"),require("ngx-toastr"),require("@wm/http")):"function"==typeof define&&define.amd?define("@wm/variables",["exports","@wavemaker/variables","@wm/core","angular2-websocket/angular2-websocket","@metrichor/jmespath","@angular/core","@angular/router","@wm/oAuth","@wm/security","@angular/common","@angular/common/http","ngx-toastr","@wm/http"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.variables={}),e.wm_common_variables,e.wm.core,e.angularWebSocket,e.jmespath,e.ng.core,e.ng.router,e.wm.oAuth,e.wm.security,e.ng.common,e.ng.common.http,e.ngxToastr,e.wm.http)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u){"use strict";var h={hasCordova:void 0!==window.cordova,isStudioMode:!1,isRunMode:!0,XSRF_COOKIE_NAME:"wm_xsrf_token",DEFAULT_TIMER_DELAY:500,WIDGET_DOESNT_EXIST:"The widget you're trying to navigate to doesn't exist on this page"},m={CATEGORY:{MODEL:"wm.Variable",LIVE:"wm.LiveVariable",CRUD:"wm.CrudVariable",SERVICE:"wm.ServiceVariable",WEBSOCKET:"wm.WebSocketVariable",NAVIGATION:"wm.NavigationVariable",NOTIFICATION:"wm.NotificationVariable",TIMER:"wm.TimerVariable",LOGIN:"wm.LoginVariable",LOGOUT:"wm.LogoutVariable",DEVICE:"wm.DeviceVariable"},EVENTS:["onBefore","onBeforeUpdate","onResult","onBeforeOpen","onOpen","onBeforeMessageSend","onMessageReceive","onProgress","onError","onBeforeDatasetReady","onCanUpdate","onClick","onHide","onOk","onCancel","onBeforeClose","onClose","onTimerFire","onSuccess","onOnline","onOffline"],EVENT:{CAN_UPDATE:"onCanUpdate",BEFORE:"onBefore",BEFORE_UPDATE:"onBeforeUpdate",PREPARE_SETDATA:"onBeforeDatasetReady",RESULT:"onResult",ERROR:"onError",ABORT:"onAbort",PROGRESS:"onProgress",CLICK:"onClick",HIDE:"onHide",OK:"onOk",CANCEL:"onCancel",CLOSE:"onClose",TIMER_FIRE:"onTimerFire",SUCCESS:"onSuccess",BEFORE_OPEN:"onBeforeOpen",OPEN:"onOpen",BEFORE_SEND:"onBeforeMessageSend",MESSAGE_RECEIVE:"onMessageReceive",BEFORE_CLOSE:"onBeforeClose"},OWNER:{APP:"App",PAGE:"Page"},REST_SUPPORTED_SERVICES:["JavaService","SoapService","FeedService","RestService","SecurityServiceType","DataService","WebSocketService","OpenAPIService"],PAGINATION_PARAMS:["page","size","sort"],REST_SERVICE:{BASE_PATH_KEY:"x-WM-BASE_PATH",RELATIVE_PATH_KEY:"x-WM-RELATIVE_PATH",OAUTH_PROVIDER_KEY:"x-WM-PROVIDER_ID",AUTH_HDR_KEY:"Authorization",SECURITY_DEFN:{BASIC:"basic",OAUTH2:"oauth2"},AUTH_TYPE:{BASIC:"BASIC",OAUTH:"OAUTH2",NONE:"NONE"},CONTENT_TYPE_KEY:"x-WM-CONTENT_TYPE",ACCESSTOKEN_PLACEHOLDER:{LEFT:"",RIGHT:".access_token"},ERR_TYPE:{NO_ACCESSTOKEN:"missing_accesstoken",NO_CREDENTIALS:"no_credentials",METADATA_MISSING:"metadata_missing",CRUD_OPERATION_MISSING:"crud_operation_missing",USER_UNAUTHORISED:"user_unauthorised",REQUIRED_FIELD_MISSING:"required_field_missing"},ERR_MSG:{NO_ACCESSTOKEN:"Access token missing",NO_CREDENTIALS:"No credentials present",METADATA_MISSING:'Metadata missing for "$variable"',USER_UNAUTHORISED:"Unauthorized User",CRUD_OPERATION_MISSING:'Operation "$operation" not allowed for "$variable"',REQUIRED_FIELD_MISSING:'Required field(s) missing: "${0}"'},UNCLOAKED_HEADERS:["CONTENT-TYPE","ACCEPT","CONTENT-LENGTH","ACCEPT-ENCODING","ACCEPT-LANGUAGE"],PREFIX:{AUTH_HDR_VAL:{BASIC:"Basic",OAUTH:"Bearer"},CLOAK_HEADER_KEY:"X-WM-"}},SERVICE_TYPE:{JAVA:"JavaService",REST:"RestService",SOAP:"SoapService",FEED:"FeedService",DATA:"DataService",SECURITY:"SecurityServiceType",WEBSOCKET:"WebSocketService",OPENAPI:"OpenAPIService"},CONTROLLER_TYPE:{QUERY:"QueryExecution",PROCEDURE:"ProcedureExecution"},HTTP_STATUS_CODE:{CORS_FAILURE:-1,UNAUTHORIZED:401,FORBIDDEN:403},EXPORT_TYPES_MAP:{EXCEL:".xlsx",CSV:".csv"},DEFAULT_VAR:{NOTIFICATION:"appNotification"}},f={NON_BODY_HTTP_METHODS:["GET","HEAD"],CONTENT_TYPES:{FORM_URL_ENCODED:"application/x-www-form-urlencoded",MULTIPART_FORMDATA:"multipart/form-data",OCTET_STREAM:"application/octet-stream"}},g={WM_DATA_JSON:"wm_data_json",WM_HTTP_JSON:"wm_httpRequestDetails"},v=t.$rootScope,y=function(e,t){return(y=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 b(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}y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function P(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 O={EXCEL:".xlsx",CSV:".csv"};e.appManager=void 0,e.httpService=void 0,e.metadataService=void 0,e.navigationService=void 0,e.routerService=void 0,e.toasterService=void 0,e.oauthService=void 0,e.securityService=void 0,e.dialogService=void 0;var E=/^\[("|')[\w\W]*(\1)\]$/,R=new Map,A=new Map,T=function(e,t){var n,i,o=_.noop;A.has(e)&&(o=A.get(e).cancel),o(),n=_.debounce((function(){(i=e[t]())instanceof Promise&&i.catch(_.noop)}),100),A.set(e,n),n()},S=function(e,t,n,i,o){switch(i.category){case m.CATEGORY.LIVE:"read"===i.operation?("dataBinding"===e?_.forEach(t,(function(e,t){i.filterFields[t]={value:e}})):i.filterFields[e]={value:t,type:n},i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.listRecords)&&!o&&T(i,"listRecords")):("dataBinding"===e?i.inputFields=t:i.inputFields[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i[i.operation+"Record"])&&!o&&T(i,i.operation+"Record"));break;case m.CATEGORY.CRUD:"list"===i.operationType&&i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&T(i,"invoke");break;case m.CATEGORY.SERVICE:case m.CATEGORY.LOGIN:i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&T(i,"invoke");break;case m.CATEGORY.DEVICE:i[e]=t,i.autoUpdate&&!_.isUndefined(t)&&_.isFunction(i.invoke)&&!o&&T(i,"invoke")}},C=function(t,n){switch(t){case"appManager":e.appManager=n;break;case"http":e.httpService=n;break;case"metadata":e.metadataService=n;break;case"navigationService":e.navigationService=n;break;case"router":e.routerService=n;break;case"toaster":e.toasterService=n;break;case"oAuth":e.oauthService=n;break;case"security":e.securityService=n;break;case"dialog":e.dialogService=n}},I=function(e,t,i,o,a){var r,s=t[e],l=t._context;e!==m.EVENT.ERROR||a||s||(r=l.Actions[m.DEFAULT_VAR.NOTIFICATION])&&(i=r.getMessage()||i,i=_.isString(i)?i:"An error has occured. Please check the app logs.",r.invoke({message:i},void 0,void 0));var c=n.$parseEvent(t[e]);return e===m.EVENT.BEFORE_UPDATE?"wm.LiveVariable"===t.category&&"read"===t.operation?c(t._context,{variable:t,dataFilter:i,options:o}):c(t._context,{variable:t,inputData:i,options:o}):c(t._context,{variable:t,data:i,options:o})},D=function(e){setTimeout((function(){n.triggerFn(e)}),500)},x=function(e,t,i,o){var a,r,s,l,c,p="",d=t.get("Content-Disposition");if(d&&-1!==d.indexOf("attachment")&&null!==(a=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(d))&&a[1]&&(p=a[1].replace(/['"]/g,"")),r=t.get("Content-Type"),s=new Blob([e],{type:r}),void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(s,p)?D(i):n.triggerFn(o);else{if(l=window.URL||window.webkitURL,c=l.createObjectURL(s),p){var u,h=document.createElement("a");void 0===h.download?((u=new FileReader).onloadend=function(){var e=u.result.replace(/^data:[^;]*;/,"data:attachment/file;");window.open(e,"_blank")||(window.location.href=e)},u.onload=D.bind(void 0,i),u.onerror=o,u.readAsDataURL(s)):(h.href=c,h.download=p,document.body.appendChild(h),h.click(),D(i))}else window.open(c,"_blank")||(window.location.href=c),D(i);setTimeout((function(){l.revokeObjectURL(c)}),100)}},N=function(e,t){e=_.split(e,"&"),_.forEach(e,(function(e){e=_.split(e,"="),t[e[0]]=decodeURIComponent(_.join(_.slice(e,1),"="))}))},k=function(e,t){"/"===e.url[1]&&"/"===e.url[2]&&(e.url=e.url.slice(0,1)+e.url.slice(2));var i,o,a,r="",s="fileDownloadIFrame",l="fileDownloadForm",c="Content-Type",p=e.url,d=_.get(e.headers,c),u=_.pickBy(e.headers,(function(e,t){return t!==c}));(i=$("#"+s)).length&&i.first().remove(),i=$('<iframe id="'+s+'" name="'+s+'" class="ng-hide"></iframe>'),(o=$('<form id="'+l+'" name="'+l+'"></form>')).attr({target:i.attr("name"),action:p,method:e.method,enctype:d}),r+=-1!==p.indexOf("?")?p.substring(p.indexOf("?")+1):"",r+=d===f.CONTENT_TYPES.FORM_URL_ENCODED?(r?"&":"")+e.dataParams:"",_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(e.method))&&N(r,u),N(e.data,u),_.forEach(u,(function(e,t){(a=$('<input type="hidden">')).attr({name:t,value:e}),o.append(a)})),$("body").append(i),setTimeout((function(){i.contents().find("body").append(o),o.submit(),n.triggerFn(t)}),100)},M=function(t,i,o){var a=t.url,r=t.method,s=t.dataParams||t.data,l=t.headers;l["Content-Type"]=l["Content-Type"]||"application/x-www-form-urlencoded",e.httpService.send({target:"WebService",action:"invokeRuntimeRestCall",method:r,url:a,headers:l,data:s,responseType:"arraybuffer"}).then((function(e){setTimeout((function(){x(e.body,e.headers,i,o)}),900)}),(function(e){n.triggerFn(o,e)}))},L=function(){return!!h.hasCordova&&localStorage.getItem(h.XSRF_COOKIE_NAME)},F=function(e,t,i){var o,a=e.target,r=i[t];return E.test(a)?o=r:(a=a.substr(0,a.lastIndexOf(".")),o=e.target===t?i:a?n.findValueOf(r,a,!0):r),o},j=function(e){return E.test(e)?e.replace(/^(\[["'])|(["']\])$/g,""):e.split(".").pop()},B=function(e,t,n,i,o,a){var r=j(e),s=F(t,n,i);o=_.isUndefined(o)?t.value:o,s&&(s[r]=o),S(r,o,t.type,i,a)},G=function(e,t,n){var i,o=_.keys(_.get(R.get(n),[n.name,t])),a=j(e);(i=_.filter(o,(function(e){return e!==a&&_.includes(e,a)||(a===t||"dataBinding"===a)&&e!==a}))).length&&_.forEach(i,(function(e){B(e,{target:e},t,n,_.get(R.get(n),[n.name,t,e]))}))},V=function(e,t,i,o){var a=e.target,r=F(e,i,o),s=j(a),l=t.registerDestroyListener?t.registerDestroyListener.bind(t):_.noop;if(n.stringStartsWith(e.value,"bind:")){l(n.$watch(e.value.replace("bind:",""),t,{},(function(t,l){t===l&&_.isUndefined(t)||!(!_.isUndefined(t)||_.isUndefined(l)&&_.isUndefined(r[s]))||(_.includes(["blob","file"],e.type)||(t=n.getClonedObject(t)),B(a,e,i,o,t),R.has(o)||R.set(o,{}),_.set(R.get(o),[o.name,i,a],t),_.isObject(t)&&G(a,i,o))}),void 0,void 0,void 0,(function(){return o.isMuted})))}else _.isUndefined(e.value)||(B(a,e,i,o,e.value,!0),i!==s&&(R.has(o)||R.set(o,{}),_.set(R.get(o),[o.name,i,a],e.value)))},W=function(e,t,n,i){i=i||"dataBinding";var o=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=o,o&&_.isArray(o)&&o.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),V(n,t,i,e)}))},U=function(t,n,i,o,a){if(h.hasCordova){var r=void 0;i&&(r=O[i]),e.appManager.notify("device-file-download",{url:t.url,name:n,extension:r,headers:t.headers,successCb:o,errorCb:a})}else!_.isEmpty(t.headers)||L()?M(t,o,a):k(t,o)},q=function(){return window.File&&window.FileReader&&window.FileList&&window.Blob},z=T,H=function(e){return n.DEFAULT_FORMATS[_.toUpper(e)]},Y=function(t,i){var o;return _.isDate(t)?o=t.getTime():(isNaN(t)||(t=parseInt(t,10)),o=t&&moment(t).valueOf()),isNaN(o)&&i!==n.DataType.TIME||i===n.DataType.TIMESTAMP?o:(i!==n.DataType.TIME||o||(o=moment((new Date).toDateString()+" "+t).valueOf()),t&&e.appManager.getPipe("date").transform(o,H(i)))},K=function(e,t){return _.includes(t,".")&&(t=_.toLower(n.extractType(t))),_.isArray(e)?_.map(e,(function(e){return Y(e,t)})):Y(e,t)};var Q=function(){function t(){}return t.prototype.initBinding=function(e,t,n){W(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i})},t}(),Z=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.invoke=function(t,i){!function(t,i){var o;t.dataSet=i&&i.data||t.dataSet;var a=t.dataBinding.pageName||t.pageName,r=t.operation,s=_.clone(t.dataSet),l=_.isNil(null==i?void 0:i.cacheable)?t.cacheable:i.cacheable;switch(i=i||{},_.isNil(l)||n.isString(l)&&""===l.trim()||(s._cache_page=l),r){case"goToPreviousPage":e.navigationService.goToPrevious();break;case"gotoPage":e.navigationService.goToPage(a,{transition:t.pageTransitions,$event:i.$event,urlParams:s,cacheable:t.cacheable});break;case"gotoView":o=t.dataBinding&&t.dataBinding.viewName||t.viewName;break;case"gotoTab":o=t.dataBinding&&t.dataBinding.tabName||t.tabName;break;case"gotoAccordion":o=t.dataBinding&&t.dataBinding.accordionName||t.accordionName;break;case"gotoSegment":o=t.dataBinding&&t.dataBinding.segmentName||t.segmentName}o&&e.navigationService.goToView(o,{pageName:a,transition:t.pageTransitions,$event:i.$event,urlParams:s},t)}(t,i)},i}(Q),J=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.onToasterClick=function(e){I("onClick",e,"")},i.prototype.onToasterHide=function(e){I("onHide",e,"")},i.prototype.notifyViaToaster=function(t,n){var i,o=(n.class||t.dataBinding.class||"info").toLowerCase(),a=n.message||t.dataBinding.text,r=n.title,s="toast-"+(n.position||t.dataBinding.toasterPosition||"bottom right").replace(" ","-"),l=t.dataBinding.page,c=parseInt(n.duration||t.dataBinding.duration,null);c||(c=0!==c&&"success"===o?3e3:0),i=t.dataBinding.content&&"page"===t.dataBinding.content&&l?e.toasterService.showCustom(l,{positionClass:s,timeOut:c,partialParams:t._binddataSet,context:t._context}):e.toasterService.show(o,r,a||null,{positionClass:s,timeOut:c,enableHtml:!0}),t.onClick&&i.onTap.subscribe(this.onToasterClick.bind(this,t)),t.onHide&&i.onHidden.subscribe(this.onToasterHide.bind(this,t))},i.prototype.getDialogConfig=function(t,n,i,o){return{title:n.title||t.dataBinding.title,text:n.message||t.dataBinding.text,okButtonText:n.okButtonText||t.dataBinding.okButtonText||"OK",cancelButtonText:n.cancelButtonText||t.dataBinding.cancelButtonText||"CANCEL",alerttype:n.alerttype||t.dataBinding.alerttype||"information",onOk:function(){e.dialogService.close(i,void 0,o)},onCancel:function(){I("onCancel",t,n.data),e.dialogService.close(i,void 0)},onClose:function(){I("onClose",t,n.data)}}},i.prototype.notifyViaDialog=function(t,i){var o="PREFAB"===n.getWmProjectProperties().type,a=(o?"Prefab":"Common")+_.capitalize(t.operation)+"Dialog",r=this.getDialogConfig(t,i,a,(function(){return I("onOk",t,i.data)}));r=o?r:{notification:r},e.dialogService.open(a,void 0,r)},i.prototype.notify=function(e,t,n,i){t=t||{},"toast"===e.operation?this.notifyViaToaster(e,t):this.notifyViaDialog(e,t)},i.prototype.getMessage=function(e){return e.dataBinding.text},i.prototype.setMessage=function(e,t){return _.isString(t)&&(e.dataBinding.text=t),e.dataBinding.text},i.prototype.getOkButtonText=function(e){return e.dataBinding.okButtonText},i.prototype.setOkButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.okButtonText=t),e.dataBinding.okButtonText},i.prototype.getToasterDuration=function(e){return e.dataBinding.duration},i.prototype.setToasterDuration=function(e,t){return e.dataBinding.duration=t,e.dataBinding.duration},i.prototype.getToasterClass=function(e){return e.dataBinding.class},i.prototype.setToasterClass=function(e,t){return _.isString(t)&&(e.dataBinding.class=t),e.dataBinding.class},i.prototype.getToasterPosition=function(e){return e.dataBinding.class},i.prototype.setToasterPosition=function(e,t){return _.isString(t)&&(e.dataBinding.position=t),e.dataBinding.position},i.prototype.getAlertType=function(e){return e.dataBinding.alerttype},i.prototype.setAlertType=function(e,t){return _.isString(t)&&(e.dataBinding.alerttype=t),e.dataBinding.alerttype},i.prototype.getCancelButtonText=function(e){return e.dataBinding.cancelButtonText},i.prototype.setCancelButtonText=function(e,t){return _.isString(t)&&(e.dataBinding.cancelButtonText=t),e.dataBinding.cancelButtonText},i}(Q),X=function(){function t(){}return t.prototype.initBinding=function(e,t,n){W(e,e._context,t,n)},t.prototype.notifyInflight=function(t,n,i,o){e.appManager.notify("toggle-variable-state",{variable:t,active:n,data:i,options:o})},t.prototype.setRequestTrackId=function(e,t){var n,i=null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.get("x-wm-request-track-id");i&&(t._requestTrackId=i)},t.prototype.httpCall=function(t,n,i){var o=this;return new Promise((function(a,r){n._observable=e.httpService.sendCallAsObservable(t,i).subscribe((function(e){e&&e.type&&(o.setRequestTrackId(e,n),a(e))}),(function(t){o.setRequestTrackId(t,n),e.httpService.isPlatformSessionTimeout(t)?(o.notifyInflight(n,!1,t),t._401Subscriber.asObservable().subscribe((function(e){return a(e)}),(function(e){return r(e)}))):r(t)}))}))},t.prototype.prepareCallbackOptions=function(e,t){var n={};return n.xhrObj=e,t&&_.extend(n,t),n},t}(),ee=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.validate=function(e){var t,n,i;for(n in["rememberme","remembermecheck"].forEach((function(t){_.isBoolean(e[t])&&(i=t)})),e[i=i||"j_rememberme"]=!!_.isBoolean(e[i])&&e[i],e)if(e.hasOwnProperty(n)&&(""===e[n]||void 0===e[n])){t="Please provide required credentials";break}return t},i.prototype.migrateOldParams=function(e){var t={},n={usernametext:"j_username",username:"j_username",passwordtext:"j_password",password:"j_password",remembermecheck:"j_rememberme",rememberme:"j_rememberme"};return _.each(e,(function(e,i){n[i]?t[n[i]]=e:t[i]=e})),t},i.prototype.redirectToAppBasePath=function(){e.routerService.navigate(["/"]).then((function(e){e&&window.location.reload()}))},i.prototype.login=function(t,i,o,a){var r,s=this,l=(i=i||{}).loginInfo||i.input||t.dataBinding,c=this.validate(l);if(c)return n.triggerFn(a,c),void I("onError",t,c);var p=n.getClonedObject(l),d=I(m.EVENT.BEFORE_UPDATE,t,p);if(_.isObject(d))p=d;else if(!1===d)return void n.triggerFn(a);p=this.migrateOldParams(p);var u=_.get(e.securityService.get(),"userInfo.userName");this.notifyInflight(t,!0),t.promise=e.securityService.appLogin(p,(function(i){e.dialogService.close("CommonLoginDialog"),e.appManager.reloadAppData().then((function(a){I(m.EVENT.RESULT,t,_.get(a,"userInfo")),(r=I(m.EVENT.PREPARE_SETDATA,t,_.get(a,"userInfo")))&&_.set(a,"userInfo",r),s.notifyInflight(t,!1,i),n.triggerFn(o),setTimeout((function(){if(I(m.EVENT.SUCCESS,t,_.get(a,"userInfo")),t.useDefaultSuccessHandler){var n=u===p.j_username;u&&!n||e.appManager.executeSessionFailureRequests();var i=e.securityService.getCurrentRouteQueryParam("redirectTo"),o=e.appManager.noRedirect(),r=e.securityService.getRedirectedRouteQueryParams();if(r.redirectTo&&delete r.redirectTo,e.appManager.noRedirect(!1),u)if(_.isEmpty(i)){var l=e.securityService.get(),c=_.get(l,"loginConfig.sessionTimeout.type")||"PAGE";n&&"DIALOG"===c||s.redirectToAppBasePath()}else u===p.j_username?e.routerService.navigate(["/"+i],{queryParams:r}):s.redirectToAppBasePath();else _.isEmpty(i)?o||e.routerService.navigate(["/"]):e.routerService.navigate(["/"+i],{queryParams:r})}I(m.EVENT.CAN_UPDATE,t,_.get(a,"userInfo"))}))}))}),(function(e){I(m.EVENT.RESULT,t,e),s.notifyInflight(t,!1,e);var i=e.error||"Invalid credentials.",o=e.details;h.isRunMode&&I("onError",t,i,o,!0),n.triggerFn(a,i,o),I(m.EVENT.CAN_UPDATE,t,e)}))},i}(Q),te=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return b(i,t),i.prototype.logout=function(t,i,o,a){var r,s,l,c=this;r=function(e,i,o){h.isStudioMode||I("onError",t,e,o),n.triggerFn(a,e,o)},!1!==I(m.EVENT.BEFORE_UPDATE,t,null)?e.securityService.isAuthenticated((function(i){i?(c.notifyInflight(t,!0),t.promise=e.securityService.appLogout((function(i){var a=i.body;a=n.getValidJSON(a),e.appManager.reloadAppData().then((function(){c.notifyInflight(t,!1,a),I(m.EVENT.RESULT,t,a),(l=I(m.EVENT.PREPARE_SETDATA,t,a))&&(a=l),setTimeout((function(){I(m.EVENT.SUCCESS,t,a),I(m.EVENT.CAN_UPDATE,t,a)}))})),a&&a.result?window.location.href=a.result:t.useDefaultSuccessHandler&&((s=t.redirectTo)&&"login.html"!==s&&"index.html"!==s||(s=""),e.routerService.navigate(["/"+s]),window.cordova||setTimeout((function(){window.location.reload()}))),n.triggerFn(o)}),r)):r("No authenticated user to logout.")}),(function(e){c.notifyInflight(t,!1,e),r(e)})):n.triggerFn(a)},i}(Q),ne=function(e){function t(){var t=e.apply(this,P([],w(arguments)))||this;return t.serviceRegistry=new Map,t}return b(t,e),t.prototype.invoke=function(e,t){var n=this,i=this.serviceRegistry.get(e.service);return null==i?(I("onError",e,null),Promise.reject("Could not find service '"+i+"'")):(this.notifyInflight(e,!0),i.invoke(e,t).then((function(t){return n.notifyInflight(e,!1,t),t}),(function(t){return n.notifyInflight(e,!1,t),Promise.reject(t)})))},t.prototype.registerService=function(e){this.serviceRegistry.set(e.name,e)},t}(X),ie=function(){function e(){}return e.setPaginationQueryParams=function(e,t,n){t.parameters.forEach((function(t){var i;i="offset"===n.type||n.input.offset?"offset":"page",t.name===n.input[i].split(".")[0]?t.sampleValue=e.pagination.page:t.name===n.input.size.split(".")[0]&&(t.sampleValue=e.pagination.size)}))},e.setVariablePagination=function(e,t,n){e.pagination||(e.pagination={empty:!1}),e.pagination.size=t.size,e.pagination.page=t.page||0,e.pagination.totalElements=t.totalElements,e.pagination.numberOfElements=e.pagination.size,e.pagination.number=n.page?n.page-1:0,e.pagination.totalPages=e.pagination.totalElements/e.pagination.size,e.pagination.totalElements%e.pagination.size==0?e.pagination.totalPages=parseInt(e.pagination.totalPages):e.pagination.totalPages=parseInt(e.pagination.totalPages)+1,t.next?(e.pagination.next=t.next,e.pagination.prev=t.prev,e.pagination.last=!t.next,e.pagination.first=!t.prev):(e.pagination.first=e.pagination.page<=1,e.pagination.last=""===t.hasMoreItems?!(e.pagination.page<e.pagination.totalPages):!t.hasMoreItems)},e.setPaginationItems=function(e,t,n,i,a){var r;if(_.startsWith(e,"$body")){var s=e.replace("$body.","");try{n[i]=o.jmespath.search(t,s)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}else if(_.startsWith(e,"$header")){var l=e.replace("$header.",""),c=Object.fromEntries(a.headers),p=l.split(".");try{n[i]=o.jmespath.search(c,p[0].toLowerCase())}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}if(null===(r=n[i])||void 0===r?void 0:r.length){var d=n[i].join();if(1===p.length)n[i]=d;else{var u=p.slice(1).join("."),h=JSON.parse(d);/[!@#$%^&*()+\=\[\]{};':"\\|,<>\/?]+/.test(u)&&(u="headerResp."+u);try{n[i]=o.jmespath.search(h,u)}catch(t){console.warn(e+" expression needs to be corrected as per JMES guidelines")}}}}},e.getPaginationInfo=function(e,t){return(null==e?void 0:e.paginationInfo)?e.paginationInfo:t._paginationConfig},e.checkPaginationAtQuery=function(e,t,n){var i,o=this.getPaginationInfo(e,t);if(n&&n.page&&(null==o?void 0:o.input.size)&&t.pagination){var a;a="offset"===o.type||o.input.offset?"offset":"page";var r=o.input[a].split(".")[0],s=_.find(e.parameters,(function(e){return e.name===r}));!_.isEmpty(t.dataBinding)&&s&&"query"===s.parameterType&&((null===(i=o.output)||void 0===i?void 0:i.page)||"offset"===o.type?t.pagination.page=this.getOffsetInfo(t,n):t.pagination.page=n.page,this.setPaginationQueryParams(t,e,o))}},e.getOffsetInfo=function(e,t){return e.pagination.size*(t.page?t.page-1:1)},e.setPaginationAtReq=function(e,t,n,i,o,a,r){var s,l={},c={};s="offset"===e.type||e.input.offset?"offset":"page";var p=e.input[s].split(".")[0],d=_.find(t.parameters,(function(e){return e.name===p}));if("header"===(null==d?void 0:d.parameterType))_.set(l,e.input[s],n.pagination.page),_.set(l,e.input.size,n.pagination.size),i[p]=JSON.stringify(l[p]),c.headers=i;else if("body"===(null==d?void 0:d.parameterType)){var u=JSON.parse(d.sampleValue),h=e.input[s].split(".")[1];if(u&&u[h]){var m=e.input[s].split(".").splice(1).join(".");"offset"!==s?_.set(l,m,n.pagination.page):_.set(l,m,this.getOffsetInfo(n,r)),_.set(l,e.input.size.split(".").splice(1).join("."),n.pagination.size),u[h]=l[h],o=JSON.stringify(u),c.requestBody=o}}else if(n.pagination.next&&d)if("path"===d.parameterType){var f=t.relativePath.split("/"),g="{"+d.name+"}",v=f.indexOf(g),y=void 0;y=n.pagination.isNext?n.pagination.next.split("/"):n.pagination.prev.split("/");var b=void 0,w=void 0;t.directPath?((b=(w=new URL(a)).pathname.split("/"))[v]=y[v],w.pathname=b.join("/"),a=w.href,c.url=a):((b=a.split("/"))[v+1]=y[v],a=b.join("/"),c.url=a)}else if("query"===d.parameterType){f=a.split("?"),y=void 0;y=n.pagination.isNext?n.pagination.next.split("?"):n.pagination.prev.split("?"),f[1]=y[1],a=f.join("?"),c.url=a}return c},e.setParameterVal=function(e,t,n,i){var o=this.getPaginationInfo(n,i).input[e].split(".")[0],a=_.find(n.parameters,(function(e){return e.name===o}));t[e]=_.result(a,"sampleValue")},e.generatePaginationRes=function(e,t,n,i,o,a){var r={},s=t.output;if(null==s?void 0:s.next)s&&(this.setPaginationItems(s.next,n,r,"next",i),this.setPaginationItems(s.prev,n,r,"prev",i));else{if((null==s?void 0:s.size)?this.setPaginationItems(s.size,n,r,"size",i):this.setParameterVal("size",r,e,a),(null==s?void 0:s.page)?this.setPaginationItems(s.page,n,r,"page",i):"offset"!==t.type&&this.setParameterVal("page",r,e,a),_.startsWith(null==s?void 0:s.totalElements,"$minValue")){var l=s.totalElements.replace("$minValue=",""),c=r.page?r.page:o.page,p=r.size*c;!a.pagination||a.pagination.totalElements>p?r.totalElements=parseInt(l):r.totalElements=p+1}else(null==s?void 0:s.totalElements)?this.setPaginationItems(s.totalElements,n,r,"totalElements",i):"offset"===t.type||t.input.offset?r.totalElements=r.size*(o.page?o.page:1)+1:r.totalElements=r.size*r.page+1;(null==s?void 0:s.hasMoreItems)?this.setPaginationItems(s.hasMoreItems,n,r,"hasMoreItems",i):r.hasMoreItems=""}return r},e}(),oe=function(e){return _.includes(["QueryExecution","ProcedureExecution"],e.controller)&&_.includes(["put","post"],e.operationType)},ae=function(e,t){return e===m.CONTROLLER_TYPE.QUERY&&t===m.SERVICE_TYPE.DATA},re=function(e,t,i){var o=_.toLower(n.extractType(_.get(t,"items.type")||t.type)),a=h.isStudioMode?t["x-WM-CONTENT_TYPE"]:t.contentType;if(q())return"file"===o||"string"!==a&&a?_.isArray(i)&&"file"===o?_.forEach(i,(function(i){e.append(t.name,i&&i.content||n.getBlob(i),i.name)})):e.append(t.name,n.getBlob(i,a),i&&i.name):(_.isObject(i)&&(i=JSON.stringify(i)),e.append(t.name,i)),e},se=function(e,t){var i,o={},a=[];return _.forEach(t,(function(t){i=_.get(e,t.name),_.isUndefined(i)||""===i||null===i||t.readOnly?t.required&&a.push(t.name||t.id):(i=n.isDateTimeType(t.type)?K(i,t.type):i,_.isArray(i)&&"string"===_.toLower(n.extractType(t.type))&&(i=_.join(i,",")),o[t.name]=i)})),{requestBody:o,missingParams:a}},le=function(e){var t={},n=m.REST_SERVICE.UNCLOAKED_HEADERS,i=m.REST_SERVICE.PREFIX.CLOAK_HEADER_KEY;return _.forEach(e,(function(e,o){_.includes(n,o.toUpperCase())?t[o]=e:t[i+o]=e})),t},ce=function(){function t(){}return t.constructRequestParams=function(t,i,o,a){if(t=t||{},null===i)return{error:{type:m.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED,message:m.REST_SERVICE.ERR_MSG.USER_UNAUTHORISED,field:"_wmServiceOperationInfo"}};if(_.isEmpty(i))return{error:{type:m.REST_SERVICE.ERR_TYPE.METADATA_MISSING,message:m.REST_SERVICE.ERR_MSG.METADATA_MISSING,field:"_wmServiceOperationInfo"}};if(i&&i.invalid)return{error:{type:m.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING,message:m.REST_SERVICE.ERR_MSG.CRUD_OPERATION_MISSING,field:"_wmServiceOperationInfo"}};var r,s,l,c,p,d,u,y,b,w,P,O,E,R,A,T,S,C=i.directPath||"",I=i.basePath?i.basePath+i.relativePath:i.relativePath,D=oe(t),x="",N={},k=[],M=null;function L(){return b||(b=new FormData)}if(E=_.get(i.securityDefinitions,"0"))switch(E.type){case m.REST_SERVICE.SECURITY_DEFN.OAUTH2:if(T=E[m.REST_SERVICE.OAUTH_PROVIDER_KEY],S=null,!(R=e.oauthService.getAccessToken(T,S)))return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN,message:m.REST_SERVICE.ERR_MSG.NO_ACCESSTOKEN},securityDefnObj:E};N[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.OAUTH+" "+R;break;case m.REST_SERVICE.SECURITY_DEFN.BASIC:if(d=o.wm_auth_username,u=o.wm_auth_password,!d||!u)return{error:{type:m.REST_SERVICE.ERR_TYPE.NO_CREDENTIALS,message:m.REST_SERVICE.ERR_MSG.NO_CREDENTIALS},securityDefnObj:E};N[m.REST_SERVICE.AUTH_HDR_KEY]=m.REST_SERVICE.PREFIX.AUTH_HDR_VAL.BASIC+" "+btoa(d+":"+u),M={type:m.REST_SERVICE.AUTH_TYPE.BASIC}}if(ie.checkPaginationAtQuery(i,t,a),i.proxySettings=i.proxySettings||{web:!0,mobile:!1},y=i.httpMethod||i.methodType,w=h.hasCordova?i.proxySettings.mobile:i.proxySettings.web,A=i.proxySettings.withCredentials,l=w?I:C,_.forEach(i.parameters,(function(e){function a(){o?(P=o[e.name]&&_.isObject(o[e.name])?o[e.name]:o,O=_.get(i,["definitions",e.type])):(P=c||{},O=e.children)}var c=e.sampleValue;if(n.isDefined(c)&&null!==c&&""!==c||D&&"file"!==e.type)switch(t.serviceType===m.SERVICE_TYPE.DATA&&n.isDateTimeType(e.type)&&(c=K(c,e.type)),_.isArray(c)&&"string"===_.toLower(n.extractType(e.type))&&t.serviceType===m.SERVICE_TYPE.DATA&&(c=_.join(c,",")),e.parameterType.toUpperCase()){case"QUERY":if(_.isNull(c)&&ae(t.controller,t.serviceType))break;x?x+="&"+e.name+"="+encodeURIComponent(c):x="?"+e.name+"="+encodeURIComponent(c);break;case"PATH":p=new RegExp("\\s*\\{\\s*"+e.name+"(:\\.\\+)?\\s*\\}\\s*"),l=l.replace(p,c);break;case"HEADER":N[e.name]=c;break;case"BODY":D?(a(),r=se(P,O),s=r.requestBody,k=_.concat(k,r.missingParams)):s=c;break;case"FORMDATA":D&&e.name===g.WM_DATA_JSON?(a(),r=se(P,O),s=re(L(),e,r.requestBody),k=_.concat(k,r.missingParams)):s=re(L(),e,c)}else e.required&&k.push(e.name||e.id)})),k.length)return{error:{type:m.REST_SERVICE.ERR_TYPE.REQUIRED_FIELD_MISSING,field:k.join(","),message:n.replace(m.REST_SERVICE.ERR_MSG.REQUIRED_FIELD_MISSING,[k.join(",")]),skipDefaultNotification:!0}};_.includes(f.NON_BODY_HTTP_METHODS,_.toUpper(y))||i.consumes&&i.consumes[0]===f.CONTENT_TYPES.MULTIPART_FORMDATA||(N["Content-Type"]=i.consumes&&i.consumes[0]||"application/json"),_.includes(i.consumes,f.CONTENT_TYPES.FORM_URL_ENCODED)&&!_.includes(f.NON_BODY_HTTP_METHODS,(y||"").toUpperCase())?(x&&(s=(s?s+"&":"")+x.substring(1)),N["Content-Type"]=f.CONTENT_TYPES.FORM_URL_ENCODED):l+=x,w&&(N=t.serviceType!==m.SERVICE_TYPE.REST&&t.serviceType!==m.SERVICE_TYPE.OPENAPI||i.skipCloakHeaders?N:le(N),t.getPrefabName()&&-1!==m.REST_SUPPORTED_SERVICES.indexOf(t.serviceType)?(l="prefabs/"+t.getPrefabName()+l,c="invokePrefabRestService"):t.getPrefabName()||(l="services"+l),l=v.project.deployedUrl+l);var F=ie.getPaginationInfo(i,t);if(F&&t.pagination){var j=ie.setPaginationAtReq(F,i,t,N,s,l,a);j&&(j.headers?N=j.headers:j.requestBody?s=j.requestBody:j.url&&(l=j.url))}return{projectID:v.project.id,url:l,target:c,method:y,headers:N,data:s,authDetails:M,isDirectCall:!w,isExtURL:t.serviceType===m.SERVICE_TYPE.REST,withCredentials:A}},t.isFileUploadRequest=function(e){return"FileService"===e.service&&"uploadFile"===e.operation},t.excludePaginationParams=function(e){return _.map(_.reject(e,(function(e){return _.includes(m.PAGINATION_PARAMS,e.name)})),(function(e){return e.name}))},t}(),pe=function(t){function o(){var e=t.apply(this,P([],w(arguments)))||this;return e.scope_var_socket_map=new Map,e.PROPERTY={SERVICE:"service",DATA_UPDATE_STRATEGY:"dataUpdateStrategy",DATA_LIMIT:"dataLimit"},e.DATA_UPDATE_STRATEGY={REFRESH:"refresh",PREPEND:"prepend",APPEND:"append"},e}return b(o,t),o.prototype.shouldAppendData=function(e){return(e=e||this)[this.PROPERTY.DATA_UPDATE_STRATEGY]!==this.DATA_UPDATE_STRATEGY.REFRESH},o.prototype.shouldAppendLast=function(e){return e[this.PROPERTY.DATA_UPDATE_STRATEGY]===this.DATA_UPDATE_STRATEGY.APPEND},o.prototype.getDataLimit=function(e){return e.dataLimit},o.prototype.getURL=function(t){var n,i=t.getPrefabName(),o=i?_.get(e.metadataService.getByOperationId(t.operationId,i),"wmServiceOperationInfo"):_.get(e.metadataService.getByOperationId(t.operationId),"wmServiceOperationInfo"),a=t.dataBinding;if(_.forEach(o.parameters,(function(e){e.sampleValue=a[e.name]})),$.extend(o,{skipCloakHeaders:!0}),!(n=ce.constructRequestParams(t,o,a)).error||!n.error.message)return n.url;this._onSocketError(t,{data:n.error.message})},o.prototype._onSocketMessage=function(e,t){var i,o,a,r,s,l=_.get(t,"data");l=n.getValidJSON(l)||n.xmlToJson(l)||l,i=I(m.EVENT.MESSAGE_RECEIVE,e,l,t),l=n.isDefined(i)?i:l,this.shouldAppendData(e)?(e.dataSet=e.dataSet||[],o=e.dataSet.length,a=this.getDataLimit(e),r=this.shouldAppendLast(e),a&&o>=a&&(r?e.dataSet.shift():e.dataSet.pop()),s=r?o:0,e.dataSet.splice(s,0,l)):e.dataSet=n.isDefined(i)?i:l},o.prototype._onBeforeSend=function(e,t){return I(m.EVENT.BEFORE_SEND,e,t)},o.prototype._onBeforeSocketClose=function(e,t){return I(m.EVENT.BEFORE_CLOSE,e,_.get(t,"data"),t)},o.prototype._onBeforeSocketOpen=function(e,t){return I(m.EVENT.BEFORE_OPEN,e,_.get(t,"data"),t)},o.prototype._onSocketOpen=function(e,t){e._socketConnected=!0,I(m.EVENT.OPEN,e,_.get(t,"data"),t)},o.prototype.freeSocket=function(e){this.scope_var_socket_map.set(e,void 0)},o.prototype._onSocketClose=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.CLOSE,e,_.get(t,"data"),t)},o.prototype._onSocketError=function(e,t){e._socketConnected=!1,this.freeSocket(e),I(m.EVENT.ERROR,e,_.get(t,"data")||"Error while connecting with "+e.service,t)},o.prototype.getSocket=function(e){var t=this.getURL(e),o=this.scope_var_socket_map.get(e);return o||(h.hasCordova||!n.isInsecureContentRequest(t)?((o=new i.$WebSocket(t)).onOpen(this._onSocketOpen.bind(this,e)),o.onError(this._onSocketError.bind(this,e)),o.onMessage(this._onSocketMessage.bind(this,e)),o.onClose(this._onSocketClose.bind(this,e)),this.scope_var_socket_map.set(e,o),e._socket=o,o):void n.triggerFn(this._onSocketError.bind(this,e)))},o.prototype.open=function(e,t,i){var o;if(!1!==this._onBeforeSocketOpen(e))return o=this.getSocket(e),n.triggerFn(t),o;n.triggerFn(i)},o.prototype.close=function(e){var t=this._onBeforeSocketClose(e),n=this.getSocket(e);!1!==t&&n.close()},o.prototype.send=function(e,t){var i,o=this.getSocket(e);t=t||_.get(e,"dataBinding.RequestBody"),!1!==(i=this._onBeforeSend(e,t))&&(t=n.isDefined(i)?i:t,t=n.isObject(t)?JSON.stringify(t):t,o.send(t,0))},o}(X),de=new Map,ue={Variable:X,Action:Q,"wm.NavigationVariable":Z,"wm.NotificationVariable":J,"wm.LoginVariable":ee,"wm.LogoutVariable":te,"wm.DeviceVariable":ne,"wm.WebSocketVariable":pe},he=function(){function e(){}return e.get=function(e){return de.has(e)?de.get(e):de.set(e,new ue[e]).get(e)},e}(),me=function(){function e(){}return e.prototype.invoke=function(e,t){var i=this.operations.find((function(t){return t.name===e.operation}));if(null==i)return I(m.EVENT.ERROR,e,null),Promise.reject("Could not find operation '"+e.operation+"' in service '"+this.name+"'");if(n.hasCordova()){var o=new Map;return void 0!==e.dataBinding&&(Object.entries(e).forEach((function(e){o.set(e[0],e[1])})),Object.entries(e.dataBinding).forEach((function(e){o.set(e[0],e[1])}))),i.invoke(e,t,o).then((function(t){return e.dataSet=t,n.$invokeWatchers(!0),I(m.EVENT.SUCCESS,e,t),t}),(function(t){return e.dataSet={},n.$invokeWatchers(!0),I(m.EVENT.ERROR,e,null),t}))}return Promise.resolve().then((function(){return I(m.EVENT.SUCCESS,e,i.model),i.model}))},e}(),fe=function(){return he.get(m.CATEGORY.DEVICE)},ge=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.init=function(){fe().initBinding(this)},t.prototype.invoke=function(e,t,n){fe().invoke(this,e).then(t,n)},t}(t.ApiAwareVariable),ve=function(){return he.get(m.CATEGORY.NAVIGATION)},ye=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.invoke=function(e){ve().invoke(this,e)},t.prototype.navigate=function(e){this.invoke(e)},t.prototype.init=function(){ve().initBinding(this,"dataBinding","dataBinding"),ve().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),be=function(){return he.get(m.CATEGORY.NOTIFICATION)},we=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.execute=function(t,i){var o=this,a=e.prototype.execute.call(this,t,i);return n.isDefined(a)?a:new Promise((function(e,a){switch(t){case n.DataSource.Operation.INVOKE:o.invoke(i,e,a);break;case n.DataSource.Operation.NOTIFY:o.notify(i,e,a);break;default:a(t+" operation is not supported on this data source")}}))},t.prototype.notify=function(e,t,n){be().notify(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.notify(e,t,n)},t.prototype.getMessage=function(){return be().getMessage(this)},t.prototype.setMessage=function(e){return be().setMessage(this,e)},t.prototype.clearMessage=function(){return be().setMessage(this,"")},t.prototype.getOkButtonText=function(){return be().getOkButtonText(this)},t.prototype.setOkButtonText=function(e){return be().setOkButtonText(this,e)},t.prototype.getToasterDuration=function(){return be().getToasterDuration(this)},t.prototype.setToasterDuration=function(e){return be().setToasterDuration(this,e)},t.prototype.getToasterClass=function(){return be().getToasterClass(this)},t.prototype.setToasterClass=function(e){return be().setToasterClass(this,e)},t.prototype.getToasterPosition=function(){return be().getToasterPosition(this)},t.prototype.setToasterPosition=function(e){return be().setToasterPosition(this,e)},t.prototype.getAlertType=function(){return be().getAlertType(this)},t.prototype.setAlertType=function(e){return be().setAlertType(this,e)},t.prototype.getCancelButtonText=function(){return be().getCancelButtonText(this)},t.prototype.setCancelButtonText=function(e){return be().setCancelButtonText(this,e)},t.prototype.init=function(){be().initBinding(this,"dataBinding","dataBinding"),be().initBinding(this,"dataSet","dataSet")},t}(t.BaseAction),Pe=function(){return he.get(m.CATEGORY.LOGIN)},_e=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.login=function(e,t,n){return Pe().login(this,e,t,n)},t.prototype.invoke=function(e,t,n){return this.login(e,t,n)},t.prototype.cancel=function(){},t.prototype.init=function(){Pe().initBinding(this,"dataBinding","dataBinding")},t}(t.BaseAction),Oe=function(){return he.get(m.CATEGORY.LOGOUT)},Ee=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.logout=function(e,t,n){Oe().logout(this,e,t,n)},t.prototype.invoke=function(e,t,n){this.logout(e,t,n)},t.prototype.cancel=function(){},t}(t.BaseAction),Re=function(){return he.get(m.CATEGORY.WEBSOCKET)},Ae=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return b(t,e),t.prototype.open=function(e,t){return Re().open(this,e,t)},t.prototype.close=function(){return Re().close(this)},t.prototype.update=function(){return Re().update(this)},t.prototype.send=function(e){return Re().send(this,e)},t.prototype.cancel=function(){return this.close()},t.prototype.invoke=function(e,t,n){this.open(t,n)},t.prototype.init=function(){Re().initBinding(this)},t}(t.ApiAwareVariable),Te=function(){function e(){}return e.create=function(e,n){var i;switch(e.category){case t.VARIABLE_CONSTANTS.CATEGORY.MODEL:i=new t.ModelVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.SERVICE:i=new t.ServiceVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LIVE:i=new t.LiveVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.CRUD:i=new t.CrudVariable(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.DEVICE:i=new ge(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NAVIGATION:i=new ye(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.NOTIFICATION:i=new we(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGIN:i=new _e(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.LOGOUT:i=new Ee(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.TIMER:i=new t.TimerAction(e);break;case t.VARIABLE_CONSTANTS.CATEGORY.WEBSOCKET:i=new Ae(e)}return i._context=n,i.__cloneable__=!1,i},e}(),Se=function(){function e(e){this.$http=e,this.CONTEXT_APP="app"}return e.prototype.isLoaded=function(){return!!this.metadataMap&&this.metadataMap.has(this.CONTEXT_APP)},e.prototype.load=function(e){var t,i=this;return t=n.hasCordova()?"metadata/"+(e?"prefabs/"+e+"/":"app/")+"service-definitions.json":"./services/"+(e?"prefabs/"+e+"/":"")+"servicedefs",new Promise((function(n,o){i.$http.send({url:t,method:"GET"}).then((function(t){i.metadataMap=i.metadataMap||new Map,i.providerMap=i.providerMap||new Map,t.body=t.body||{},i.metadataMap.set(e||i.CONTEXT_APP,t.body.serviceDefs),t.body.securityDefinitions&&i.providerMap.set(e||i.CONTEXT_APP,t.body.securityDefinitions.oauthProvider),n(t.body.serviceDefs)}),o)}))},e.prototype.getByOperationId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t);return n&&n[e]},e.prototype.getByProviderId=function(e,t){t=t||this.CONTEXT_APP;var n=this.providerMap.get(t);return n&&n[e]},e.prototype.getByCrudId=function(e,t){t=t||this.CONTEXT_APP;var n=this.metadataMap.get(t),i=[];for(var o in n)n[o]&&n[o].crudOperationId===e&&i.push(n[o]);return i},e}();Se.decorators=[{type:a.Injectable}],Se.ctorParameters=function(){return[{type:n.AbstractHttpService}]};var Ce=function(){function t(){}return t.prototype.format=function(t,n){return e.appManager.getPipe("date").transform(t,n)},t}(),Ie=function(){function e(e,n,i,o,a,r,s,l){this.httpService=e,this.metadataService=n,this.navigationService=i,this.routerService=o,this.toasterService=a,this.oAuthService=r,this.securityService=s,this.dialogService=l,C("http",this.httpService),C("metadata",this.metadataService),C("navigationService",this.navigationService),C("router",this.routerService),C("toaster",this.toasterService),C("oAuth",this.oAuthService),C("security",this.securityService),C("dialog",this.dialogService),t.wmSetDependency("oAuth",this.oAuthService),t.wmSetDependency("security",this.securityService),t.wmSetDependency("metadata",this.metadataService)}return e.prototype.bulkCancel=function(e){Object.keys(e).forEach((function(t){var n=e[t];_.isFunction(n.cancel)&&n.cancel()}))},e.prototype.triggerStartUpdate=function(e){return Promise.all(Object.keys(e).map((function(t){return e[t]})).filter((function(e){return(null==e?void 0:e.startUpdate)&&e.invoke})).map((function(e){return e.invoke()})))},e.prototype.processBindExp=function(e,i,o){var a=t.getTarget(o),r=t.getTargetNodeKey(e.target),s=_.isArray(e.value)?e.value[0]:e.value;return s&&(s.startsWith&&s.startsWith("bind:")?s=n.$watch(s.replace("bind:",""),i,{},o.invokeOnParamChange.bind(o,e),void 0,void 0,void 0,(function(){return o.isMuted})):_.isUndefined(e.value)||(t.setValueToNode(e.target,e,a,o,e.value,!0),a!==r&&(t.internalBoundNodeMap.has(o)||t.internalBoundNodeMap.set(o,{}),_.set(t.internalBoundNodeMap.get(o),[o.name,a,e.target],e.value)))),{name:e.target,value:s}},e.prototype.processBinding=function(e,t,n,i){var o=this;i=i||"dataBinding";var a=e[n=n||"dataBinding"];e[n]={},e["_bind"+n]=a,a&&_.isArray(a)&&a.forEach((function(n){"wm.Variable"===e.category&&"dataBinding"===n.target&&(n.target="dataSet"),o.processBindExp(n,t,e)}))},e.prototype.isVariableSeperated=function(e,t){return"wm.Variable"===e[t].category||"wm.ServiceVariable"===e[t].category||"wm.LiveVariable"===e[t].category||"wm.CrudVariable"===e[t].category},e.prototype.getBindSourceTarget=function(e){return"wm.LiveVariable"===e.category?"read"===e.operation?"filterFields":"inputFields":"wm.ModelVariable"===e.category?"dataSet":"dataBinding"},e.prototype.register=function(e,i,o){var a,r=this,s={Variables:{},Actions:{},callback:this.triggerStartUpdate};for(var l in i){if((a=Te.create(i[l],o)).init(),this.isVariableSeperated(i,l)&&(this.processBinding(a,o,"dataBinding",this.getBindSourceTarget(a)),a.httpService=this.httpService,a.dateFormatter=new Ce,a.subscribe("afterInvoke",(function(){return n.$invokeWatchers(!0)})),"wm.LiveVariable"===a.category&&"read"===a.operation&&n.processFilterExpBindNode(a._context,a.filterExpressions,a),"wm.CrudVariable"!==a.category&&"wm.ServiceVariable"!==a.category||(a.simulateFileDownload=U)),this.isVariableSeperated(i,l)||"wm.TimerVariable"===i[l].category)for(var c in m.EVENT)a[m.EVENT[c]]&&(a[m.EVENT[c]]=n.$parseEvent(a[m.EVENT[c]]));a instanceof t.BaseAction?s.Actions[l]=a:s.Variables[l]=a}return o.registerDestroyListener&&o.registerDestroyListener((function(){r.bulkCancel(s.Variables),r.bulkCancel(s.Actions)})),s},e.prototype.destroy=function(){},e.prototype.registerDependency=function(e,n){C(e,n),t.wmSetDependency(e,n)},e}();Ie.decorators=[{type:a.Injectable}],Ie.ctorParameters=function(){return[{type:n.AbstractHttpService},{type:Se},{type:n.AbstractNavigationService},{type:r.Router},{type:n.AbstractToasterService},{type:s.OAuthService},{type:l.SecurityService},{type:n.AbstractDialogService}]};var De=d.ToastrModule.forRoot({maxOpened:1,autoDismiss:!0}),xe=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[Ie,Se,c.Location,{provide:c.LocationStrategy,useClass:c.HashLocationStrategy}]}},e}();xe.decorators=[{type:a.NgModule,args:[{imports:[c.CommonModule,De,p.HttpClientModule,u.HttpServiceModule,s.OAuthModule,l.SecurityModule],declarations:[]}]}],e.$rootScope=v,e.CONSTANTS=h,e.DB_CONSTANTS={DATABASE_MATCH_MODES:{like:"LIKE",start:"STARTING_WITH",startignorecase:"STARTING_WITH_IGNORECASE",end:"ENDING_WITH",endignorecase:"ENDING_WITH_IGNORECASE",anywhere:"CONTAINING",anywhereignorecase:"CONTAINING_IGNORECASE",nowhere:"DOES_NOT_CONTAIN",nowhereignorecase:"DOES_NOT_CONTAIN_IGNORECASE",exact:"EQUALS",exactignorecase:"EQUALS_IGNORECASE",notequals:"NOT_EQUALS",notequalsignorecase:"NOT_EQUALS_IGNORECASE",between:"BETWEEN",in:"IN",notin:"NOTIN",lessthan:"LESS_THAN",lessthanequal:"LESS_THAN_OR_EQUALS",greaterthan:"GREATER_THAN",greaterthanequal:"GREATER_THAN_OR_EQUALS",null:"NULL",isnotnull:"IS_NOT_NULL",empty:"EMPTY",isnotempty:"IS_NOT_EMPTY",nullorempty:"NULL_OR_EMPTY"},DATABASE_EMPTY_MATCH_MODES:["NULL","IS_NOT_NULL","EMPTY","IS_NOT_EMPTY","NULL_OR_EMPTY"],DATABASE_RANGE_MATCH_MODES:["IN","NOTIN","BETWEEN","LESS_THAN","LESS_THAN_OR_EQUALS","GREATER_THAN","GREATER_THAN_OR_EQUALS","NOT_EQUALS"],DATABASE_NULL_EMPTY_MATCH:{NULL:"NULL",IS_NOT_NULL:"IS_NOT_NULL",EMPTY:"NULL",IS_NOT_EMPTY:"IS_NOT_NULL",NULL_OR_EMPTY:"NULL"},DATABASE_MATCH_MODES_WITH_QUERY:{LIKE:"${0} like ${1}",STARTING_WITH:"${0} like ${1}",STARTING_WITH_IGNORECASE:"${0} like ${1}",ENDING_WITH:"${0} like ${1}",ENDING_WITH_IGNORECASE:"${0} like ${1}",CONTAINING:"${0} like ${1}",CONTAINING_IGNORECASE:"${0} like ${1}",DOES_NOT_CONTAIN:"${0} not like ${1}",DOES_NOT_CONTAIN_IGNORECASE:"${0} not like ${1}",EQUALS:"${0}=${1}",EQUALS_IGNORECASE:"${0}=${1}",NOT_EQUALS:"${0}!=${1}",NOT_EQUALS_IGNORECASE:"${0}!=${1}",BETWEEN:"${0} between ${1}",IN:"${0} in ${1}",NOTIN:"${0} not in ${1}",LESS_THAN:"${0}<${1}",LESS_THAN_OR_EQUALS:"${0}<=${1}",GREATER_THAN:"${0}>${1}",GREATER_THAN_OR_EQUALS:"${0}>=${1}",NULL:"${0} is null",IS_NOT_NULL:"${0} is not null",EMPTY:"${0}=''",IS_NOT_EMPTY:"${0}<>''",NULL_OR_EMPTY:"${0} is null or ${0}=''"},DATABASE_STRING_MODES:["LIKE","STARTING_WITH","STARTING_WITH_IGNORECASE","ENDING_WITH","ENDING_WITH_IGNORECASE","CONTAINING","CONTAINING_IGNORECASE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_IGNORECASE","EQUALS","EQUALS_IGNORECASE","NOT_EQUALS","NOT_EQUALS_IGNORECASE"]},e.DeviceVariableManager=ne,e.DeviceVariableService=me,e.Formatter=Ce,e.MetadataService=Se,e.SWAGGER_CONSTANTS=g,e.VARIABLE_CONSTANTS=m,e.VARIABLE_URLS={DATABASE:{searchTableData:{url:"/:service/:dataModelName/:entityName/search?page=:page&size=:size&:sort",method:"POST"},searchTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/filter?page=:page&size=:size&:sort",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}},readTableData:{url:"/:service/:dataModelName/:entityName?page=:page&size=:size&:sort",method:"GET"},insertTableData:{url:"/:service/:dataModelName/:entityName",method:"POST"},insertMultiPartTableData:{url:"/:service/:dataModelName/:entityName",method:"POST",headers:{}},updateTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"PUT"},updateMultiPartTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"POST",headers:{}},deleteTableData:{url:"/:service/:dataModelName/:entityName/:id",method:"DELETE"},updateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"PUT"},periodUpdateCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"PUT"},updateMultiPartCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"POST",headers:{}},deleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id?:id",method:"DELETE"},periodDeleteCompositeTableData:{url:"/:service/:dataModelName/:entityName/composite-id/periods?:id",method:"DELETE"},getDistinctDataByFields:{url:"/:service/:dataModelName/:entityName/aggregations?page=:page&size=:size&:sort",method:"POST"},exportTableData:{url:"/services/:dataModelName/:entityName/export?:sort",method:"POST"},readTableRelatedData:{url:"/:service/:dataModelName/:entityName/:id/:relatedFieldName?page=:page&size=:size&:sort",method:"GET"},executeNamedQuery:{url:"/:service/:dataModelName/queryExecutor/queries/:queryName?page=:page&size=:size&:queryParams",method:"GET"},executeCustomQuery:{url:"/:service/:dataModelName/queries/execute?page=:page&size=:size",method:"POST"},executeAggregateQuery:{url:"/services/:dataModelName/:entityName/aggregations?page=:page&size=:size&sort=:sort",method:"POST"},executeNamedProcedure:{url:"/:service/:dataModelName/procedureExecutor/procedure/execute/:procedureName?page=:page&size=:size&:procedureParams",method:"GET"},countTableDataWithQuery:{url:"/:service/:dataModelName/:entityName/count?:queryParams",method:"GET"}},oauthConfiguration:{getAuthorizationUrl:{url:"services/oauth2/:providerId/authorizationUrl",method:"GET"}}},e.VariableManagerFactory=he,e.VariablesModule=xe,e.VariablesService=Ie,e.WS_CONSTANTS=f,e.debounceVariableCall=z,e.formatDate=K,e.formatExportExpression=function(e){return _.forEach(e,(function(e){e.expression&&(e.expression="${"+e.expression+"}")})),e},e.getEvaluatedOrderBy=function(e,t){var n,i;return!t||_.isEmpty(t)?e:e?(e=_.split(e,","),t=_.split(t,","),n=_.map(t,(function(e){return _.split(_.trim(e)," ")[0]})),_.remove(e,(function(e){return _.includes(n,_.split(_.trim(e)," ")[0])})),i=e.length?","+_.join(e,","):"",_.join(t,",")+i):t},e.initiateCallback=I,e.isFileUploadSupported=q,e.processBinding=W,e.setDependency=C,e.setInput=function(e,t,i,o){e=e||{};var a,r,s={};if(_.isObject(o))switch(o.type){case"file":i=n.getBlob(i,o.contentType);break;case"number":i=_.isNumber(i)?i:parseInt(i,10)}return _.isObject(t)?s=t:t.indexOf(".")>-1?(r=(a=t.split(".")).pop(),e=n.findValueOf(e,a.join("."),!0),s[t=r]=i):s[t]=i,_.forEach(s,(function(t,n){e[n]=t})),e},e.simulateFileDownload=U,e.toastrModule=De,e["\u0275a"]=X,e["\u0275b"]=Q,e["\u0275c"]=Z,e["\u0275d"]=J,e["\u0275e"]=ee,e["\u0275f"]=te,e["\u0275g"]=pe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@wm/mobile/runtime",["exports","@angular/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.runtime={}),e.ng.core)}(this,(function(e,t){"use strict";var n=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();n.decorators=[{type:t.NgModule,args:[{}]}],e.MobileRuntimeModule=n,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("@wm/mobile/runtime/dynamic",["exports","@angular/core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.mobile=e.wm.mobile||{},e.wm.mobile.runtime=e.wm.mobile.runtime||{},e.wm.mobile.runtime.dynamic={}),e.ng.core)}(this,(function(e,t){"use strict";var n=function(){};n.decorators=[{type:t.NgModule,args:[{}]}],e.MOBILE_COMPONENT_MODULES_FOR_ROOT=[],e.MobileRuntimeDynamicModule=n,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/router"),require("@angular/common"),require("@wm/core"),require("@wm/security"),require("@wm/variables"),require("@wm/components/page"),require("rxjs"),require("@wm/components/base"),require("@wm/components/prefab"),require("@angular/common/http"),require("@angular/platform-browser"),require("ngx-toastr"),require("@wm/components/dialogs"),require("@wm/components/dialogs/confirm-dialog"),require("@wm/components/dialogs/design-dialog"),require("@wm/mobile/runtime"),require("@wm/http"),require("@wm/oAuth"),require("ngx-bootstrap/chronos"),require("ngx-bootstrap/datepicker"),require("ngx-bootstrap/utils"),require("rxjs/operators"),require("@wm/transpiler"),require("@wm/build-task")):"function"==typeof define&&define.amd?define("@wm/runtime/base",["exports","@angular/core","@angular/router","@angular/common","@wm/core","@wm/security","@wm/variables","@wm/components/page","rxjs","@wm/components/base","@wm/components/prefab","@angular/common/http","@angular/platform-browser","ngx-toastr","@wm/components/dialogs","@wm/components/dialogs/confirm-dialog","@wm/components/dialogs/design-dialog","@wm/mobile/runtime","@wm/http","@wm/oAuth","ngx-bootstrap/chronos","ngx-bootstrap/datepicker","ngx-bootstrap/utils","rxjs/operators","@wm/transpiler","@wm/build-task"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.runtime=e.wm.runtime||{},e.wm.runtime.base={}),e.ng.core,e.ng.router,e.ng.common,e.wm.core,e.wm.security,e.wm.variables,e.wm.components.page,e.rxjs,e.wm.components.base,e.wm.components.prefab,e.ng.common.http,e.ng.platformBrowser,e.ngxToastr,e.wm.components.dialogs,e.wm.components.dialogs.confirmdialog,e.wm.components.dialogs.designdialog,e.wm.mobile.runtime,e.wm.http,e.wm.oAuth,e["ngx-bootstrap"].chronos,e["ngx-bootstrap"].datepicker,e["ngx-bootstrap"].utils,e.rxjs.operators,e.wm.transpiler,e.wm.buildTask)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u,h,m,f,g,v,y,b,w,P,O,E,R,A){"use strict";function T(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var S,C=T(t),I=T(o),D=T(u);e.ComponentType=void 0,(S=e.ComponentType||(e.ComponentType={}))[S.PAGE=0]="PAGE",S[S.PREFAB=1]="PREFAB",S[S.PARTIAL=2]="PARTIAL";var x,N=function(){function e(){}return e.prototype.clearComponentFactoryRefCache=function(){},e}(),k=function(){},M=function(){},L=function(){},F=function(){};!function(e){e.HIDE_TEMPLATES_SHOW_CASE="hide-templates-show-case",e.SHOW_TEMPLATES_SHOW_CASE="show-templates-show-case",e.UPDATE_LOCATION="update-location-path",e.SELECT_TEMPLATE="select-template",e.TEMPLATEBUNDLE_CONFIG="template-bundle-config",e.ON_LOAD="on-load"}(x||(x={}));var j=function(){function e(e,t,n,i,o,a,r,s,l,c){var p=this;this.$http=e,this.$security=t,this.$dialog=n,this.$router=i,this.$app=o,this.$variables=a,this.$metadata=r,this.$spinner=s,this.$i18n=l,this.$datePipe=c,this.appVariablesLoaded=!1,this.appVariablesFired=!1,this._noRedirect=!1,this.$http.registerOnSessionTimeout(this.handle401.bind(this)),this.$variables.registerDependency("appManager",this),this.$app.subscribe("toggle-variable-state",(function(e){var t,n=e.variable,i=e.active;if(!_.isEmpty(_.trim(n.spinnerContext)))if(i){if(n._spinnerId&&n._spinnerId.length&&_.forEach(n._spinnerId,(function(e){e.slice(0,e.lastIndexOf("_"))!==n._id||!p.$spinner.messagesByContext||!p.$spinner.messagesByContext[n.spinnerContext]||n.spinnerMessage!==p.$spinner.messagesByContext[n.spinnerContext].finalMessage&&n.spinnerMessage!==p.$spinner.messagesByContext[n.spinnerContext][e]||(t=!0)})),!t){n._spinnerId=n._spinnerId||[];var o=p.$spinner.show(n.spinnerMessage,n._id+"_"+Date.now(),n.spinnerclass,n.spinnerContext);n._spinnerId.push(o)}}else p.$spinner.hide(n._spinnerId.shift())})),this.$app.subscribe("userLoggedIn",(function(){p.setLandingPage(),p.lastLoggedUserId&&p.$security.getConfig((function(e){e&&e.userInfo.userId!==p.lastLoggedUserId&&p.$app.clearPageCache()}),null)})),this.$app.subscribe("userLoggedOut",(function(){return p.setLandingPage().then((function(){p.$app.clearPageCache()}))})),this.$app.subscribe("http401",(function(e){return void 0===e&&(e={}),p.handle401(e.page,e.options)}))}return e.prototype.showLoginDialog=function(){this.$spinner.hide("globalSpinner"),this.$dialog.open("CommonLoginDialog"),o.$appDigest()},e.prototype.loadAppJS=function(){},e.prototype.loadCommonPage=function(){},e.prototype.loadSecurityConfig=function(e){var t=this;return this.$security.load(e).then((function(e){return t.$app.landingPageName||t.setLandingPage(),e}))},e.prototype.loadMetadata=function(){return this.$metadata.load()},e.prototype.loadAppVariables=function(e){var t=this;if(this.appVariablesLoaded)return Promise.resolve();var n=function(e){var n=t.$variables.register("app",e,t.$app);_.extend(t.$app.Variables,n.Variables),_.extend(t.$app.Actions,n.Actions),t.updateLoggedInUserVariable(),t.updateSupportedLocaleVariable(),t.appVariablesLoaded=!0,t.appVariablesFired=!1};return o.isDefined(e)?(n(e),Promise.resolve()):this.$http.get("./app.variables.json").then((function(e){return n(e)}))},e.prototype.isAppVariablesFired=function(e){return o.isDefined(e)&&(this.appVariablesFired=e),this.appVariablesFired},e.prototype.clearLoggedInUserVariable=function(e){e.isAuthenticated=!1,e.roles=[],e.name=void 0,e.id=void 0,e.tenantId=void 0},e.prototype.updateLoggedInUserVariable=function(){var e=this,t=_.get(this.$app,"Variables.loggedInUser.dataSet");if(t)return this.$security.load().then((function(){var n=e.$security.get();if(!(n&&n.securityEnabled&&n.authenticated))throw e.clearLoggedInUserVariable(t),t.isSecurityEnabled=n&&n.securityEnabled,null;return t.isAuthenticated=n.authenticated,t.roles=n.userInfo.userRoles,t.name=n.userInfo.userName,t.id=n.userInfo.userId,t.tenantId=n.userInfo.tenantId,t.userAttributes=n.userInfo.userAttributes,n})).catch((function(e){t.isAuthenticated=!1,t.roles=[],t.name=void 0,t.id=void 0,t.tenantId=void 0,t.userAttributes={}}))},e.prototype.updateSupportedLocaleVariable=function(){_.get(this.$app,"Variables.supportedLocale")},e.prototype.handleSSOLogin=function(e){var t,n,i=this;if(t=this.$security.getRedirectPage(e),r.CONSTANTS.hasCordova){var o=_.get(this.$security.get(),"userInfo.userName");this.$security.authInBrowser().then((function(){return i.reloadAppData()})).then((function(){var e=_.get(i.$security.get(),"userInfo.userName");e&&e===o?r.routerService.navigate([t]):r.routerService.navigate(["/"])}))}else{t=t?"?redirectPage="+encodeURIComponent(t):"",n=(n=this.$security.getQueryString(this.$security.getRedirectedRouteQueryParams()))?"?"+n:"",document.body.textContent=_.get(this.getAppLocale(),["MESSAGE_LOGIN_REDIRECTION"])||"Redirecting to sso login...";var a=this.getDeployedURL()+"services/security/ssologin"+t+n;window.self!==window.top&&"WM_PREVIEW_WINDOW"===window.parent.name?(window.parent.location.href=window.self.location.href,window.parent.name=""):window.location.href=a}},e.prototype.handle401=function(e,t){var n,i,o="DIALOG",a="PAGE",r="SSO",s=this.$security.get(),l={};if(i=s.loginConfig,this.lastLoggedUserId=s.userInfo&&s.userInfo.userId,s.userInfo&&s.userInfo.userName){switch(s.authenticated=!1,(n=i.sessionTimeout||{type:o}).type.toUpperCase()){case o:this.showLoginDialog();break;case a:e||(e=this.$security.getCurrentRoutePage()),l.redirectTo=e,l=_.merge(l,this.$security.getRedirectedRouteQueryParams()),e!==n.pageName&&this.$router.navigate([n.pageName],{queryParams:l});break;case r:this.handleSSOLogin(s)}this.setLandingPage()}else switch(i.type.toUpperCase()){case o:this.noRedirect(!0),this.showLoginDialog();break;case a:e=this.$security.getRedirectPage(s,e),l.redirectTo=e;var c=t&&t.queryParams||this.$security.getRedirectedRouteQueryParams();l=_.merge(l,c),this.$router.navigate([i.pageName],{queryParams:l}),this.$app.landingPageName=i.pageName;break;case r:this.handleSSOLogin(s)}},e.prototype.reloadAppData=function(){var e=this;return this.loadSecurityConfig(!0).then((function(){return e.loadMetadata().then((function(){return e.updateLoggedInUserVariable()}))}))},e.prototype.noRedirect=function(e){return _.isUndefined(e)||(this._noRedirect=e),this._noRedirect},e.prototype.executeSessionFailureRequests=function(){this.$http.executeSessionFailureRequests()},e.prototype.pushToSessionFailureRequests=function(e){this.$http.pushToSessionFailureQueue(e)},e.prototype.getDeployedURL=function(){return this.$app.deployedUrl?this.$app.deployedUrl:r.$rootScope.project.deployedUrl},e.prototype.getCustomUrlScheme=function(){return this.$app.customUrlScheme},e.prototype.notify=function(e,t){this.$app.notify(e,t)},e.prototype.subscribe=function(e,t){return this.$app.subscribe(e,t)},e.prototype.getActivePage=function(){return this.$app.activePage},e.prototype.getAppLocale=function(){return this.$app.appLocale},e.prototype.getSelectedLocale=function(){return this.$i18n.getSelectedLocale()},e.prototype.notifyApp=function(e,t,n){this.$app.notifyApp(e,t,n)},e.prototype.appOnBeforeServiceCall=function(e){return o.triggerFn(this.$app.onBeforeServiceCall,e)},e.prototype.appOnServiceSuccess=function(e,t){return o.triggerFn(this.$app.onServiceSuccess,e,t)},e.prototype.appOnServiceError=function(e,t){return o.triggerFn(this.$app.onServiceError,e,t)},e.prototype.appVariablesReady=function(){o.triggerFn(this.$app.onAppVariablesReady)},e.prototype.beforeAppReady=function(){o.triggerFn(this.$app.onBeforeAppReady)},e.prototype.getPipe=function(e){if("date"===e)return this.$datePipe},e.prototype.setLandingPage=function(){var e=this;return this.$security.getPageByLoggedInUser().then((function(t){return e.$app.landingPageName=t}))},e.prototype.isPrefabType=function(){return this.$app.isPrefabType},e.prototype.isTemplateBundleType=function(){return this.$app.isTemplateBundleType},e.prototype.postMessage=function(e){window.top.postMessage(e,"*")},e.prototype.showTemplate=function(e){var t=this.templates[e];this.$router.navigate([t.id])},e.prototype.postTemplateBundleInfo=function(){var e=this;return window.onmessage=function(t){var n=t.data;if(_.isObject(n))switch(n.key){case x.HIDE_TEMPLATES_SHOW_CASE:break;case x.SELECT_TEMPLATE:e.showTemplate(n.templateIndex)}},setTimeout((function(){e.postMessage({key:x.ON_LOAD})})),o.fetchContent("json","./config.json",!0,(function(t){e.templates=[],t.error||(e.templates=t.templates,e.postMessage({key:x.TEMPLATEBUNDLE_CONFIG,config:t}))}))},e.prototype.postAppTypeInfo=function(){if(this.isTemplateBundleType())return this.postTemplateBundleInfo()},e}();j.SERVICE_NAME="AppManagerService",j.decorators=[{type:t.Injectable}],j.ctorParameters=function(){return[{type:o.AbstractHttpService},{type:a.SecurityService},{type:o.AbstractDialogService},{type:n.Router},{type:o.App},{type:r.VariablesService},{type:r.MetadataService},{type:o.AbstractSpinnerService},{type:o.AbstractI18nService},{type:i.DatePipe}]};var B=function(e){return"__self__"===e},G=function(e){return B(e)?".":"app/prefabs/"+e},V=new Set,W=new Map,U=new Set,q=function(e,t){var n=e;return o.stringStartsWith(e,"http://|https://|//")||(n=(t+n).replace("//","/")),n},z=q,H=function(){function e(e,t){this.$metadata=e,this.prefabConfigProvider=t}return e.prototype.getConfig=function(e){return this.prefabConfigProvider.getConfig(e)},e.prototype.loadServiceDefs=function(e){return B(e)?Promise.resolve():this.$metadata.load(e)},e.prototype.loadStyles=function(e,t){var n=(void 0===t?{resources:{styles:[]}}:t).resources.styles,i=G(e),a=n.map((function(e){if(!_.endsWith(e,"/pages/Main/Main.css"))return q(e,i)})).filter((function(e){return!!e}));return o.loadStyleSheets(a),Promise.resolve()},e.prototype.loadScripts=function(e,t){var n=(void 0===t?{resources:{scripts:[]}}:t).resources.scripts,i=G(e),a=(n=n.filter((function(e){return!e.startsWith("npm://")}))).map((function(e){return q(e,i)}));return o.loadScripts(a,!0)},e.prototype.setInProgress=function(e){var t,n,i=new Promise((function(e,i){t=e,n=i}));i.resolve=t,i.reject=n,W.set(e,i)},e.prototype.resolveInProgress=function(e){W.get(e)&&(W.get(e).resolve(),W.delete(e))},e.prototype.loadDependencies=function(e){var t=this;return U.has(e)?Promise.resolve():V.has(e)?Promise.reject(""):W.get(e)?W.get(e):(this.setInProgress(e),this.getConfig(e).then((function(n){return Promise.all([t.loadStyles(e,n),t.loadScripts(e,n),t.loadServiceDefs(e)]).then((function(){t.resolveInProgress(e),U.add(e)}))})))},e}();H.decorators=[{type:t.Injectable}],H.ctorParameters=function(){return[{type:r.MetadataService},{type:k}]};
|
|
731
731
|
/*! *****************************************************************************
|
|
732
732
|
Copyright (c) Microsoft Corporation.
|
|
733
733
|
|
|
@@ -742,4 +742,4 @@ var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
742
742
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
743
743
|
PERFORMANCE OF THIS SOFTWARE.
|
|
744
744
|
***************************************************************************** */
|
|
745
|
-
var Y=function(e,t){return(Y=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 K(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}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Q(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(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(r,s)}l((i=i.apply(e,t||[])).next())}))}function Z(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function J(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function X(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function ee(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 te=function(){function e(){this.fragments=0,this.fragmentsLoaded$=new l.Subject}return e.prototype.init=function(){var e=this;this.viewInit$.subscribe(o.noop,o.noop,(function(){e.isViewInitialized=!0,e.isReady()}))},e.prototype.registerFragment=function(){this.fragments++},e.prototype.resolveFragment=function(){this.fragments--,this.isReady()},e.prototype.isReady=function(){this.isViewInitialized&&!this.fragments&&(this.registerFragment=o.noop,this.resolveFragment=o.noop,this.fragmentsLoaded$.complete())},e}();te.decorators=[{type:t.Directive}],te.ctorParameters=function(){return[]};var ne={},ie=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.activePageName=this.App.activePageName,this.registerPageParams(),this.defineI18nProps(),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.pageParams=t.containerWidget.partialParams})),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){"Common"===this.partialName?this.Widgets=ne:this.Widgets=Object.create(ne),this.containerWidget.Widgets=this.Widgets},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.initUserScript=function(){try{this.getContainerWidgetInjector().view.component.prefabName&&(this.getContainerWidgetInjector().view.component.Prefab?this.Prefab=this.getContainerWidgetInjector().view.component.Prefab:this.Prefab=this.getContainerWidgetInjector().view.component),this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating partial ("+this.partialName+") script\n",e)}},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.partialName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){o.$invokeWatchers(!0,!0),t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.registerPageParams=function(){this.pageParams=this.containerWidget.partialParams},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.invokeOnReady=function(){var e;this.containerWidget.userComponentParams&&(e=this.containerWidget.userComponentParams),this.onReady(e),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment()},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.partialDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.onReady=function(e){},t}(te);ie.decorators=[{type:t.Directive}],ie.propDecorators={partialDirective:[{type:t.ViewChild,args:[c.PartialDirective]}]};var oe="_cache_page",ae="REUSE_ROUTE_STRATEGY.MAX_CACHE_SIZE",re="REUSE_ROUTE_STRATEGY.MAX_CACHE_AGE",se=function(){function e(e,t){var n=this;this.maxCacheSize=e,this.maxCacheAge=t,this.paramsToIgnore=["wm_state",oe],this.getSize=function(e){return e?Object.keys(e).length:0},this.cache=new o.LRUCache(e,t,(function(e,t){n.currentRouteKey===e?n.cache.set(e,t):t.componentRef.destroy()}))}return e.prototype.getKey=function(e){var t=this,n=_.chain(e.queryParams).keys().filter((function(e){return!_.includes(t.paramsToIgnore,e)})).orderBy().map((function(t){return t+"="+e.queryParams[t]})).value().join("&"),i=e.params.pageName;return e.data.pageName&&""===e.routeConfig.path&&(i=e.data.pageName),i&&i+(n?"?"+n:"")},e.prototype.isSameQueryParams=function(e,t){try{var n=e.queryParams,i=t.queryParams,o=n?this.getSize(n):0,a=i?this.getSize(i):0;return 0===o&&0===a||o===a&&JSON.stringify(n)===JSON.stringify(i)}catch(e){return!1}},e.prototype.isCacheEnabled=function(e,t){var n=e.queryParams._cache_page;return _.isNil(n)?t:"true"===n||!0===n},e.prototype.shouldDetach=function(e){var t=this.getKey(e);return!!this.isCacheEnabled(e,!!e.data._cache_page)||(this.cache.delete(t),!1)},e.prototype.shouldAttach=function(e){var t=this.getKey(e);this.currentRouteKey=t;var n=this.cache.get(t);return!(!n||!this.isCacheEnabled(e,!!n._cache_page))||(this.cache.delete(t),!1)},e.prototype.store=function(e,t){if(t){var n=this.getKey(e);t._cache_page=!!e.data._cache_page,this.cache.set(n,t)}},e.prototype.retrieve=function(e){var t=this.getKey(e);return this.cache.get(t)},e.prototype.reset=function(e){var t,n,i=this;if(!e)return this.cache.clear();this.cache.delete(e);var o=e+="?",a=[];try{for(var r=J(this.cache.keys()),s=r.next();!s.done;s=r.next()){var l=s.value;l.startsWith(o)&&a.push(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}a.forEach((function(e){return i.cache.delete(e)}))},e}(),le=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){if(e.routeConfig&&"prefab-preview"===e.routeConfig.path)return!1;var n=e.params,i=t.params,o=this.getSize(n),a=this.getSize(i);return 0===o&&0===a||o===a&&(n.pageName===i.pageName&&this.isSameQueryParams(e,t))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);le.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var ce=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){return!e.routeConfig&&!t.routeConfig||e.routeConfig===t.routeConfig&&(e.routeConfig!==t.routeConfig||(!(!e.data.layoutName||!t.data.layoutName)||this.isSameQueryParams(e,t)))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);ce.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var pe=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.pageDirective&&e.pageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.pageDirective&&(this.$page=this.pageDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.pageDirective||!this.pageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.pageDirective&&this.pageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})}))},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);pe.lastPageSnapShot=null,pe.decorators=[{type:t.Directive}],pe.propDecorators={pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]};var de=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.prefabMngr=this.injector.get(H),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.registerProps(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets={},this.Widgets={},this.containerWidget.Widgets=this.Widgets},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating prefab ("+this.prefabName+") script\n",e)}},t.prototype.registerChangeListeners=function(){this.containerWidget.registerPropertyChangeListener(this.onPropertyChange),this.containerWidget.registerStyleChangeListener(this.onPropertyChange)},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getPrefabLocaleBundle(this.prefabName)},t.prototype.registerProps=function(){var e=this;this.prefabMngr.getConfig(this.prefabName).then((function(t){t&&(e.displayName=t.displayName,Object.entries(t.properties||{}).forEach((function(t){var n,i=X(t,2),a=i[0],r=i[1],s=_.trim(r.value);_.startsWith(s,"bind:")&&(n=s.replace("bind:","")),Object.defineProperty(e,a,{get:function(){return e.containerWidget[a]},set:function(t){return e.containerWidget.widget[a]=t}}),n&&e.registerDestroyListener(o.$watch(n,e,{},(function(t){return e.containerWidget.widget[a]=t})))})),Object.entries(t.events||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=i.substr(2).toLowerCase();e.containerWidget.invokeEventCallback(o,{$event:t[0],$data:t[1]})}})),Object.entries(t.methods||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e.containerWidget[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if(e[i])return e[i].apply(e,t)}catch(t){console.warn("error in executing prefab-"+e.prefabName+" method-"+i)}}}))),e.containerWidget.setProps(t),o.isIE()&&(e.containerWidget.widget=e.containerWidget.createProxy())}))},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.prefabName,this.getVariables(),this);this.Variables={},this.Actions={},this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.invokeOnReady=function(){o.$invokeWatchers(!0,!0),this.onReady(),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment(),this.containerWidget.invokeEventCallback("load")},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.prefabContainerDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,e.registerChangeListeners(),setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.onPropertyChange=function(){},t.prototype.onReady=function(){},t}(te);de.decorators=[{type:t.Directive}],de.propDecorators={prefabContainerDirective:[{type:t.ViewChild,args:[p.PrefabContainerDirective]}]};var ue=function(){function e(){}return e.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;setTimeout((function(){e.overrideRouterOutlet()}),10)},e.prototype.init=function(){this.App=this.injector.get(o.App),this.App.activeLayoutName=this.layoutName,this.App.layoutPages=this.layoutPages,this.registerExpressions()},e.prototype.ngOnDestroy=function(){},e.prototype.canReuse=function(){},e.prototype.ngOnAttach=function(){},e.prototype.ngOnDetach=function(){},e.prototype.onActivate=function(e){_.extend(this,e)},e}();ue.decorators=[{type:t.Directive}],ue.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}]};var he,me=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.layoutDirective=this.injector.get(s.LayoutDirective),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("highlightActiveLink",{pageName:this.pageName}),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.spaPageDirective&&e.spaPageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.layoutDirective&&(this.$page=this.layoutDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.spaPageDirective||!this.spaPageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.spaPageDirective&&this.spaPageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})})),this.appManager.notify("highlightActiveLink",{pageName:this.pageName})},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);me.lastPageSnapShot=null,me.decorators=[{type:t.Directive}],me.propDecorators={spaPageDirective:[{type:t.ViewChild,args:[s.SpaPageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]},function(e){e.EVERYONE="Everyone",e.ANONYMOUS="Anonymous",e.AUTHENTICATED="Authenticated"}(he||(he={}));var fe=function(){function e(e,t,n,i){this.templateRef=e,this.viewContainerRef=t,this.securityService=n,this.inj=i,this.processed=!1;var o=this.securityService.get();this.securityEnabled=_.get(o,"securityEnabled"),this.isUserAuthenticated=_.get(o,"authenticated"),this.userRoles=_.get(o,"userInfo.userRoles")}return e.prototype.getWidgetRolesArrayFromStr=function(e){var t=/,/g;return""===(e=e||"")?[]:_.split(e,",").map((function(e){return _.trim(e).replace(t,",")}))},e.prototype.matchRoles=function(e,t){return e.some((function(e){return _.includes(t,e)}))},e.prototype.hasAccessToWidget=function(e,t){return!!_.includes(e,he.EVERYONE)||(!(!_.includes(e,he.ANONYMOUS)||this.isUserAuthenticated)||(!(!_.includes(e,he.AUTHENTICATED)||!this.isUserAuthenticated)||this.isUserAuthenticated&&this.matchRoles(e,t)))},Object.defineProperty(e.prototype,"accessroles",{set:function(e){if(!this.processed){this.processed=!0;var t=this.getWidgetRolesArrayFromStr(e);!this.securityEnabled||this.hasAccessToWidget(t,this.userRoles)?this.viewContainerRef.createEmbeddedView(this.templateRef,this.inj.view.context):this.viewContainerRef.clear()}},enumerable:!1,configurable:!0}),e}();fe.decorators=[{type:t.Directive,args:[{selector:"[accessroles]"}]}],fe.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:a.SecurityService},{type:t.Injector}]},fe.propDecorators={accessroles:[{type:t.Input}]};var ge=function(){};ge.decorators=[{type:t.Component,args:[{selector:"app-spinner",template:'\n <div class="app-spinner" [ngClass]="classname" *ngIf="show">\n <div class="spinner-message">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p *ngFor="let value of spinnermessages" [textContent]="value"></p>\n </div>\n </div>\n </div>\n '}]}],ge.ctorParameters=function(){return[]},ge.propDecorators={show:[{type:t.Input}],spinnermessages:[{type:t.Input}],classname:[{type:t.Input}],arialabel:[{type:t.Input}]};var ve=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.toastrService=t,i.toastPackage=n,i.watchers=[],i.params={},i.pagename=i.message||"",i.generateParams(),i}return K(t,e),t.prototype.generateParams=function(){var e=this;_.forEach(this.options.partialParams,(function(t){_.isString(t.value)&&0===t.value.indexOf("bind:")?e.watchers.push(o.$watch(t.value.substr(5),e.options.context,{},(function(n){e.params[t.name]=n,o.$appDigest()}))):e.params[t.name]=t.value}))},t.prototype.generateDynamicComponent=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){return e=$(".parent-custom-toast"),this.customToastRef.clear(),e[0].appendChild(this.customToastRef.createEmbeddedView(this.customToastTmpl).rootNodes[0]),[2]}))}))},t.prototype.ngAfterViewInit=function(){this.generateDynamicComponent()},t.prototype.ngOnDestroy=function(){_.forEach(this.watchers,(function(e){return e()})),e.prototype.ngOnDestroy.call(this)},t}(h.Toast);ve.decorators=[{type:t.Component,args:[{selector:"[custom-toaster-component]",template:'\n <div class="parent-custom-toast"></div>\n <ng-container #customToast></ng-container>\n <ng-template #customToastTmpl>\n <div wmContainer partialContainer content.bind="pagename">\n <div *ngFor="let param of params | keyvalue" wmParam hidden\n [name]="param.key" [value]="param.value"></div>\n </div>\n </ng-template>',preserveWhitespaces:!1}]}],ve.ctorParameters=function(){return[{type:h.ToastrService},{type:h.ToastPackage}]},ve.propDecorators={customToastRef:[{type:t.ViewChild,args:["customToast",{static:!0,read:t.ViewContainerRef}]}],customToastTmpl:[{type:t.ViewChild,args:["customToastTmpl"]}]};var ye=function(){function e(e,t,n,i,o){this.route=e,this.securityService=t,this.router=n,this.app=i,this.appManger=o}return e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.router.navigate(["prefab-preview"]):this.app.isApplicationType?this.securityService.getPageByLoggedInUser().then((function(t){e.router.navigate([t])})):(this.router.navigate([o.getWmProjectProperties().homePage]),this.appManger.postAppTypeInfo())},e}();ye.decorators=[{type:t.Component,args:[{selector:"app-empty-page",template:"<div></div>"}]}],ye.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:a.SecurityService},{type:n.Router},{type:o.App},{type:j}]};var be=function(t,n,i,o,a,r,s){var l=this;this.componentInstance=t,this.vcRef=n,this.elRef=i,this.prefabMngr=o,this.resolver=a,this.injector=r,this.componentRefProvider=s;var c=this.componentInstance.prefabName;this.prefabMngr.loadDependencies(c).then((function(){return Q(l,void 0,void 0,(function(){var t,n;return Z(this,(function(i){switch(i.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(c,e.ComponentType.PREFAB)];case 1:return(t=i.sent())&&(n=this.vcRef.createComponent(t,0,r),this.elRef.nativeElement.appendChild(n.location.nativeElement)),[2]}}))}))}))};be.decorators=[{type:t.Directive,args:[{selector:"[wmPrefab][prefabname]"}]}],be.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[c.WidgetRef]}]},{type:t.ViewContainerRef},{type:t.ElementRef},{type:H},{type:t.ComponentFactoryResolver},{type:t.Injector},{type:N}]};var we={DialogService:o.AbstractDialogService,i18nService:o.AbstractI18nService,statePersistence:o.StatePersistence,SpinnerService:o.AbstractSpinnerService,StatePersistenceService:o.StatePersistence,Viewport:o.Viewport,ToasterService:o.AbstractToasterService,Utils:o.UtilsService,CONSTANTS:o.ConstantService,FIELD_TYPE:o.FieldTypeService,FIELD_WIDGET:o.FieldWidgetService,DynamicComponentService:o.DynamicComponentRefProvider},Pe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},_e=function(){var e=this.httpService,t=function(t,n){var i=Array.from(arguments).slice(1);return Promise.resolve(e[t].apply(e,i))},n=function(){return t.apply(void 0,ee(["send"],X(Array.from(arguments))))};return["get","post","head","put","delete","jsonp","patch"].forEach((function(e){return n[e]=t.bind(void 0,e)})),n},Oe=function(){function e(e,t,n,i,a,r){this.inj=e,this.i18nService=t,this.statePersistence=n,this.httpService=i,this.securityService=a,this.routeReuseStrategy=r,this.Variables={},this.Actions={},this.onAppVariablesReady=Pe,this.onBeforeAppReady=Pe,this.onSessionTimeout=Pe,this.onPageReady=Pe,this.onBeforePageLeave=Pe,this.onBeforeServiceCall=Pe,this.onServiceSuccess=Pe,this.onServiceError=Pe,this.dynamicComponentContainerRef={},this.changeLocale=this.i18nService.setSelectedLocale.bind(this.i18nService),this.getSelectedLocale=this.i18nService.getSelectedLocale.bind(this.i18nService),this.setTimezone=this.i18nService.setTimezone.bind(this.i18nService),this.setwidgetLocale=this.i18nService.setwidgetLocale.bind(this.i18nService),this._eventNotifier=new o.EventNotifier,this.landingPageName=o.getWmProjectProperties().homePage;var s=o.getWmProjectProperties();this.projectName=s.name,this.isPrefabType="PREFAB"===s.type,this.isApplicationType="APPLICATION"===s.type,this.isTemplateBundleType="TEMPLATEBUNDLE"===s.type,this.targetPlatform=s.platformType,this.httpService.registerOnSessionTimeout(this.on401.bind(this)),this.appLocale=this.i18nService.getAppLocale(),this.httpService.setLocale(this.appLocale)}return e.prototype.reload=function(){window.location.reload()},e.prototype.clearPageCache=function(e){this.routeReuseStrategy instanceof se&&this.routeReuseStrategy.reset(e)},e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._eventNotifier.notify.apply(this._eventNotifier,arguments)},e.prototype.getDependency=function(e){if(o.isString(e)){if("HttpService"===e)return _e.call(this);var t=we[e]&&this.inj.get(we[e]);return!t&&this.inj._providers&&_.forEach(this.inj._providers,(function(n){if(_.isObject(n)&&n.__proto__.constructor.SERVICE_NAME===e)return t=n,!1})),t}return this.inj.get(e)},e.prototype.on401=function(){var e=_.get(this.securityService.get(),"userInfo");_.isEmpty(e)||this.onSessionTimeout()},e.prototype.subscribe=function(e,t){return this._eventNotifier.subscribe(e,t)},e.prototype.notifyApp=function(e,t,n){var i=_.get(this,"Actions.appNotification"),a=-1!==["PROCESS_REJECTED_IN_QUEUE"].indexOf(e);if(i){if(a)return void console.warn("App Error",e);t=t||"success",e=i.getMessage()||e,i.invoke({message:e,title:o.isDefined(n)?n:t.toUpperCase(),class:t,duration:"ERROR"===t.toUpperCase()?0:void 0})}else console.warn('The default Action "appNotification" doesn\'t exist in the app. App notified following error:\n',e)},e.prototype.registerExpressions=function(e){_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e}();Oe.decorators=[{type:t.Injectable}],Oe.ctorParameters=function(){return[{type:t.Injector},{type:o.AbstractI18nService},{type:o.StatePersistence},{type:o.AbstractHttpService},{type:a.SecurityService},{type:n.RouteReuseStrategy}]};var Ee=function(e){function t(t){var n=e.call(this)||this;return n.toaster=t,n}return K(t,e),t.prototype._showToaster=function(e,t,n,i){if(_.isNumber(i)&&(i={timeOut:i}),(i=i||{}).timeOut=o.isDefined(i.timeOut)?i.timeOut:0,i.enableHtml=o.isDefined(i.enableHtml),i.positionClass=i.positionClass||"toast-bottom-right",i.toastClass="toast",t||n){!i.bodyOutputType&&_.isObject(n)&&(n=JSON.stringify(n));var a=this.toaster[e];if(a)return a.call(this.toaster,n,t,i)}},t.prototype.success=function(e,t){return this._showToaster("success",e,t,{timeOut:5e3})},t.prototype.error=function(e,t){return this._showToaster("error",e,t,{timeOut:0})},t.prototype.info=function(e,t){return this._showToaster("info",e,t,{timeOut:0})},t.prototype.warn=function(e,t){return this._showToaster("warning",e,t,{timeOut:0})},t.prototype.show=function(e,t,n,i){return this._showToaster(e,t,n,i)},t.prototype.hide=function(e){e?this.toaster.clear(e.toastId):this.toaster.clear()},t.prototype.showCustom=function(e,t){if(e)return(t=t||{}).toastComponent=ve,t.toastClass="custom-toaster",t.timeOut=o.isDefined(t.timeOut)?t.timeOut:0,t.enableHtml=o.isDefined(t.enableHtml),t.positionClass=t.positionClass||"toast-bottom-right",t.toastClass="toast",this.toaster.show(e,"",t)},t.prototype.setToasterConfig=function(e){_.isObject(e)?_.merge(this.toaster.toastrConfig,e):console.warn("Please pass a valid options object, For Example : {maxOpened: 1, autoDismiss: true}")},t}(o.AbstractToasterService);Ee.decorators=[{type:t.Injectable}],Ee.ctorParameters=function(){return[{type:h.ToastrService}]};var Re=["ar","ar-001","ar-ae","ar-bh","ar-dz","ar-eg","ar-iq","ar-jo","ar-kw","ar-lb","ar-ly","ar-ma","ar-om","ar-qa","ar-sa","ar-sd","ar-sy","ar-tn","ar-ye","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","pnb","ps","sd","ug","ur","yi"],Ae=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.$http=t,a.bsLocaleService=n,a.appDefaults=i,a.inj=o,a.defaultSupportedLocale="en",a._isAngularLocaleLoaded=!1,a.formatsByLocale={timezone:"",number:""},a.appLocale={},a.prefabLocale=new Map,a}return K(t,e),Object.defineProperty(t.prototype,"app",{get:function(){return this.inj.get(o.App)},enumerable:!1,configurable:!0}),t.prototype.updateLocaleDirection=function(){var e="ltr";Re.includes(this.selectedLocale)&&(e="rtl"),o.setCSS(document.body,"direction",e)},t.prototype.init=function(){this.messages={},Object.setPrototypeOf(this.appLocale,this.messages)},t.prototype.getSelectedLocale=function(){return this.selectedLocale},t.prototype.getDefaultSupportedLocale=function(){return this.defaultSupportedLocale},t.prototype.getAppLocale=function(){return this.appLocale},t.prototype.getPrefabLocaleBundle=function(e){return this.prefabLocale.has(e)||this.prefabLocale.set(e,Object.create(this.appLocale)),this.prefabLocale.get(e)},t.prototype.extendPrefabMessages=function(e){var t=this;e.prefabMessages&&Object.keys(e.prefabMessages).forEach((function(n){var i=t.prefabLocale.get(n);i||(i=Object.create(t.appLocale),t.prefabLocale.set(n,i)),Object.assign(i,e.prefabMessages[n])}))},t.prototype.extendMessages=function(e){Object.assign(this.messages,e)},t.prototype.loadResource=function(e){return this.$http.get(e).toPromise().catch((function(){console.warn("error loading locale resource from "+e),Promise.resolve({})}))},t.prototype.loadAppLocaleBundle=function(){var e=this;this.loadResource("resources/i18n/"+this.selectedLocale+".json").then((function(t){e.extendMessages(t.messages),e.extendPrefabMessages(t),e.appDefaults.setFormats(t.formats)}))},t.prototype.loadMomentLocaleBundle=function(e){var t=this,n=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(this.selectedLocale!==this.defaultSupportedLocale){var i=n+"locales/moment/"+e+".js";o.loadScripts([i],!0).then((function(){moment.locale(t.selectedLocale);var n=moment.localeData(e);n=n&&n._config,w.defineLocale(t.selectedLocale,n),t.bsLocaleService.use(t.getSelectedLocale()||t.defaultSupportedLocale)}))}else moment.locale(this.defaultSupportedLocale)},t.prototype.loadAngularLocaleBundle=function(e){var t=this;return new Promise((function(n){var i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(t.selectedLocale!==t.defaultSupportedLocale){var a=i+"locales/angular/global/"+e+".js";o.loadScripts([a],!0).then((function(){t._isAngularLocaleLoaded=!0,n()}),n)}else n()}))},t.prototype.loadCalendarLocaleBundle=function(e,t){void 0===t&&(t=!1);var n,i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;return e?(n=i+"locales/fullcalendar/"+e+".js",t||!o.isMobile()&&!o.isMobileApp()&&this.selectedLocale!==this.defaultSupportedLocale?o.loadScripts([n],!0):void 0):Promise.resolve()},t.prototype.loadMomentTimeZoneBundle=function(e,t){var n=this;return new Promise((function(i){var a=(o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest)+"locales/moment-timezone/moment-timezone-with-data.js";o.loadScripts([a],!0).then((function(){var o=e,a=(e=o.timezone).indexOf("+");a>-1&&(a>0&&(e=e.substr(a)),o.timezone=_.find(moment.tz.names(),(function(t){return e===moment.tz(t).format("Z")})));var r=t&&t.formatsByLocale?t.formatsByLocale:n.formatsByLocale;Object.assign(r,o),i()}),i)}))},t.prototype.loadLocaleBundles=function(e){return e.moment&&this.loadMomentLocaleBundle(e.moment),e.fullCalendar&&window.FullCalendar&&this.loadCalendarLocaleBundle(e.fullCalendar),e.angular&&this.loadAppLocaleBundle(),this.loadAngularLocaleBundle(e.angular)},t.prototype.setTimezone=function(e,t){this.loadMomentTimeZoneBundle(e,t)},t.prototype.getTimezone=function(e){var t=_.get(this.app,"activePage.formatsByLocale.timezone"),n=_.get(e,"formatsByLocale.timezone");return n||(t||this.formatsByLocale.timezone)},t.prototype.getFormatsByLocale=function(){return this.formatsByLocale},t.prototype.setSelectedLocale=function(e){var t=this;_.isObject(e)&&(e=e.datavalue);var n=o.getWmProjectProperties().supportedLanguages[e],i=Object.keys(o.getWmProjectProperties().supportedLanguages);return _.includes(i,e)&&e&&e!==this.selectedLocale?(o.setSessionStorageItem("selectedLocale",e),this.selectedLocale=e,this.init(),this.loadLocaleBundles(n).then((function(){return t.updateLocaleDirection()}))):Promise.resolve()},t.prototype.deduceAppLocale=function(){var e=this.getAcceptedLanguages(),t=o.getWmProjectProperties().defaultLanguage;e.push(t);var n=o.getWmProjectProperties().preferBrowserLang;n=!n||("true"===n||!0===n);var i,a=Object.keys(o.getWmProjectProperties().supportedLanguages)||[this.defaultSupportedLocale],s=n?void 0:t;if(r.CONSTANTS.hasCordova){var l=[];_.forEach(e,(function(e){var t=_.find(a,(function(t){return e===t}))||_.find(a,(function(t){return e.startsWith(t)}));t&&l.push(t)})),i=l[0]}var c=o.getSessionStorageItem("selectedLocale")||s||i||_.intersection(e,a)[0]||this.defaultSupportedLocale;return a=a||[c],c||a[0]},t.prototype.loadDefaultLocale=function(){var e=this.deduceAppLocale();return this.setSelectedLocale(e)},t.prototype.getLocalizedMessage=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return o.replace(this.appLocale[e],t)},t.prototype.getAcceptedLanguages=function(){var e;return e=r.CONSTANTS.hasCordova?navigator.languages||[navigator.language]:(e=decodeURIComponent(o.getWmProjectProperties().preferredLanguage||"")).split(",").map((function(e){return e.split(";")[0]})),_.map(e,_.toLower)},t.prototype.initCalendarLocale=function(){return"en"!==this.selectedLocale?this.loadCalendarLocaleBundle(this.selectedLocale,!0):Promise.resolve()},t.prototype.isAngularLocaleLoaded=function(){return this._isAngularLocaleLoaded},t.prototype.setwidgetLocale=function(e){this.formatsByLocale.number=e.number},t.prototype.getwidgetLocale=function(){return this.formatsByLocale},t}(o.AbstractI18nService);Ae.decorators=[{type:t.Injectable}],Ae.ctorParameters=function(){return[{type:d.HttpClient},{type:P.BsLocaleService},{type:o.AppDefaults},{type:t.Injector}]};var Te=function(e){function t(){var t=e.call(this)||this;return t.spinnerId=0,t.messageSource=new l.Subject,t.messagesByContext={},t}return K(t,e),t.prototype.getMessageSource=function(){return this.messageSource},t.prototype.showContextSpinner=function(e,t,n){var i=$('[name="'+e+'"]');if(this.messagesByContext[e]=this.messagesByContext[e]||{},0!==Object.keys(this.messagesByContext[e]).length)this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e].finalMessage+" "+this.messagesByContext[e][n],i.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage);else{var o=$('<div class="app-spinner">\n <div class="spinner-message" aria-label="loading gif">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p class="spinner-messages-container"></p>\n </div>\n </div>\n </div>');this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e][n],o.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage),i.prepend(o)}return n},t.prototype.showAppSpinner=function(e,t){this.messagesByContext.page=this.messagesByContext.page||{},this.messagesByContext.page[t]=e,this.messageSource.next({show:!0,message:e,messages:_.values(this.messagesByContext.page)})},t.prototype.hideContextSpinner=function(e,t){delete this.messagesByContext[e][t],1===Object.keys(this.messagesByContext[e]).length&&(this.messagesByContext[e]={}),$('[name="'+e+'"]').find(".app-spinner").remove()},t.prototype.show=function(e,t,n,i,o){return t=t||++this.spinnerId,i&&"page"!==i?this.showContextSpinner(i,e,t):(this.showAppSpinner(e,t),t)},t.prototype.hide=function(e){var t=_.findKey(this.messagesByContext,(function(t){return _.includes(_.keys(t),e)}))||"page";if("page"===t)if(e){delete this.messagesByContext[t][e];var n=_.values(this.messagesByContext[t]);this.messageSource.next({show:!!n.length,messages:_.values(this.messagesByContext[t])})}else this.messagesByContext[t]={};else this.hideContextSpinner(t,e)},t}(o.AbstractSpinnerService);Te.decorators=[{type:t.Injectable}],Te.ctorParameters=function(){return[]};var Se="body >app-root",Ce=function(){function e(e,t,i){var o=this;this.app=e,this.router=t,this.zone=i,this.history=new De,this.isPageAddedToHistory=!1,this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url,i={},a=void 0;o.isPageAddedToHistory||(o.isPageAddedToHistory=!1,t.indexOf("?")>0?(t.substr(t.indexOf("?")+1).split("&").forEach((function(e){var t=e.split("=");i[t[0]]=t[1]})),a=t.substr(0,t.indexOf("?"))):a=t,"/"===a[0]&&(a=a.substr(1)),a&&(delete i.name,o.history.push(new Ie(a,i,o.transition))))}}))}return e.prototype.getPageTransition=function(){return _.isEmpty(this.transition)||_.isEqual("none",this.transition)?null:this.transition},e.prototype.goToPage=function(e,t){var n=this;this.transition=t.transition||"",this.history.getCurrentPage()&&(this.isPageAddedToHistory=!0),this.history.push(new Ie(e,t.urlParams,this.transition)),this.zone.run((function(){return n.router.navigate(["/"+e],{queryParams:t.urlParams})}))},e.prototype.goToPrevious=function(){this.history.getPagesCount()&&(this.transition=this.history.getCurrentPage().transition,_.isEmpty(this.transition)||(this.transition+="-exit"),this.history.pop(),this.isPageAddedToHistory=!0,window.history.back())},e.prototype.goToView=function(e,t,n){var i=this,o=(t=t||{}).pageName,a=t.transition||"",s=t.$event,l=this.app.activePage,c=n&&n._context&&n._context.prefabName;if(this.app.isPrefabType)this.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n);else if(o===l.activePageName||c)c&&this.isPrefabWithNameExists(c)?this.goToElementView($('[prefabName="'+c+'"]').find('[name="'+e+'"]'),e,o,n):o&&o!==l.activePageName?this.app.notifyApp(r.CONSTANTS.WIDGET_DOESNT_EXIST,"error"):this.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n);else if(this.isPartialWithNameExists(o))this.goToElementView($('[partialcontainer][content="'+o+'"]').find('[name="'+e+'"]'),e,o,n);else{this.goToPage(o,{viewName:e,$event:s,transition:a,urlParams:t.urlParams});var p=this.app.subscribe("pageReady",(function(t){i.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n),p()}))}},e.prototype.goToElementView=function(e,t,n,i){var o,a,r=this,s=this.app.activePage;if(e.length)switch(this.app.isPrefabType||n!==s.activePageName||(e=this.getViewElementInActivePage(e)),(o=e[0].widget).widgetType){case"wm-accordionpane":this.showAncestors(e,i),o.expand();break;case"wm-tabpane":this.showAncestors(e,i),o.select();break;case"wm-segment-content":this.showAncestors(e,i),o.navigate();break;case"wm-panel":o.expanded=!0}else a=this.showAncestorDialog(t),setTimeout((function(){a&&r.goToElementView($('[name="'+t+'"]'),t,n,i)}))},e.prototype.getViewElementInActivePage=function(e){var t;return e.length>1&&(t=_.filter(e,(function(e){if(_.isEmpty($(e).closest('[data-role = "partial"]'))&&_.isEmpty($(e).closest("[wmprefabcontainer]")))return e})))&&(e=$(t)),e},e.prototype.isPartialWithNameExists=function(e){return $('[partialcontainer][content="'+e+'"]').length},e.prototype.isPrefabWithNameExists=function(e){return $('[prefabName="'+e+'"]').length},e.prototype.showAncestors=function(e,t){e.parents('[wm-navigable-element="true"]').toArray().reverse().forEach((function(e){var t=e.widget;switch(t.widgetType){case"wm-accordionpane":t.expand();break;case"wm-tabpane":t.select();break;case"wm-segment-content":t.navigate();break;case"wm-panel":t.expanded=!0}}))},e.prototype.showAncestorDialog=function(e){var t;return $("app-root [dialogtype]").each((function(){var n=$(this);if($(n.html()).find('[name="'+e+'"]').length)return t=n.attr("name"),!1})),t},e}();Ce.decorators=[{type:t.Injectable}],Ce.ctorParameters=function(){return[{type:o.App},{type:n.Router},{type:t.NgZone}]};var Ie=function(){function e(e,t,n){this.name=e,this.urlParams=t,this.transition=n,this.transition=_.isEmpty(this.transition)?null:this.transition}return e.prototype.isEqual=function(e){return e&&e.name===this.name&&_.isEqual(e.urlParams,this.urlParams)},e}(),De=function(){function e(){this.stack=[]}return e.prototype.getCurrentPage=function(){return this.currentPage},e.prototype.getPagesCount=function(){return this.stack.length},e.prototype.isLastVisitedPage=function(e){return this.getLastPage().isEqual(e)},e.prototype.push=function(e){this.currentPage&&this.stack.push(this.currentPage),this.currentPage=e},e.prototype.pop=function(){return this.currentPage=this.stack.pop(),this.currentPage},e.prototype.getLastPage=function(){return this.stack.length>0?this.stack[this.stack.length-1]:void 0},e}(),xe=function(){function e(){}return e.prototype.setFormats=function(e){var t=e.date,n=e.time,i=t&&n?t+" "+n:void 0,o=e.currency;this.dateFormat=t,this.timeFormat=n,this.dateTimeFormat=i,this.currencyCode=o},e}();xe.decorators=[{type:t.Injectable}],xe.ctorParameters=function(){return[]};var Ne=!1,ke=function(){function e(e,t){this.securityService=e,this.appManager=t}return e.prototype.loadSecurityConfig=function(){return Ne?Promise.resolve(!0):this.appManager.loadSecurityConfig().then((function(){return Ne=!0}))},e.prototype.isAuthenticated=function(){var e=this;return this.loadSecurityConfig().then((function(){return new Promise((function(t,n){e.securityService.isAuthenticated(t,n)}))}))},e.prototype.canActivate=function(e){var t=this;return this.isAuthenticated().then((function(n){return n?Promise.resolve(!0):(t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1))}))},e}();ke.decorators=[{type:t.Injectable}],ke.ctorParameters=function(){return[{type:a.SecurityService},{type:j}]};var Me=function(){function e(e,t,n,i,o){this.securityService=e,this.authGuard=t,this.toasterService=n,this.app=i,this.appManager=o}return e.prototype.canActivate=function(e){var t=this,n=e.data.allowedRoles;return this.authGuard.isAuthenticated().then((function(i){if(i){var o=t.securityService.get().userInfo.userRoles;return _.intersection(n,o).length>0?Promise.resolve(!0):(t.appManager.notifyApp(t.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied","error"),Promise.resolve(!1))}return t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1)}))},e}();Me.decorators=[{type:t.Injectable}],Me.ctorParameters=function(){return[{type:a.SecurityService},{type:ke},{type:o.AbstractToasterService},{type:o.App},{type:j}]};var Le=function(){function e(e,t){this.app=e,this.appManager=t}return e.prototype.canActivate=function(e){return this.appManager.notifyApp(this.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available","error"),Promise.resolve(!1)},e}();Le.decorators=[{type:t.Injectable}],Le.ctorParameters=function(){return[{type:o.App},{type:j}]};var Fe=!1,je=function(){function e(e,t,n,i){this.inj=e,this.app=t,this.utilService=n,this.appJsProvider=i,this.appManager=this.inj.get(j)}return e.prototype.resolve=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){switch(t.label){case 0:if(Fe)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.appJsProvider.getAppScriptFn()];case 2:return t.sent()(this.app,this.utilService,this.inj),[3,4];case 3:return e=t.sent(),console.warn("Error in executing app.js",e),[3,4];case 4:return Fe=!0,[2,!0]}}))}))},e}();je.decorators=[{type:t.Injectable}],je.ctorParameters=function(){return[{type:t.Injector},{type:o.App},{type:o.UtilsService},{type:M}]};var Be=!1,Ge=function(){function e(e,t,n){this.appManager=e,this.appJsProvider=t,this.customPipeManager=n}return e.prototype.resolve=function(){return!(!this.appManager.isPrefabType()&&!this.appManager.isTemplateBundleType())||(Be||(this.appJsProvider.loadFormatterConfigScript(this.loadedFormatterScript.bind(this)),Be=!0),Be)},e.prototype.loadedFormatterScript=function(e){try{var t=e;for(var n in t||console.warn("Please return valid formatter object"),t)this.customPipeManager.setCustomPipe(n,t[n])}catch(e){console.warn("Error in reading formatters.js",e)}},e}();Ge.decorators=[{type:t.Injectable}],Ge.ctorParameters=function(){return[{type:j},{type:F},{type:o.CustomPipeManager}]};var $e=function(){function e(e){this.i18nService=e}return e.prototype.resolve=function(){return this.i18nService.loadDefaultLocale()},e}();$e.decorators=[{type:t.Injectable}],$e.ctorParameters=function(){return[{type:o.AbstractI18nService}]};var Ve=function(){function e(e,n,a,r){var s,l=this;this.compiler=e,this.injector=n,this.domSanitizer=a,this.i18service=r,this._locale=o.getSessionStorageItem("selectedLocale")||"en",this.formatsByLocale=null===(s=this.i18service)||void 0===s?void 0:s.getwidgetLocale(),this.preparePipeMeta=function(e,t,n,i){return void 0===i&&(i=[]),{type:{reference:e,diDeps:i},name:t,pure:n}},this._pipeData=[this.preparePipeMeta(i.AsyncPipe,"async",!1,[t.ChangeDetectorRef]),this.preparePipeMeta(i.SlicePipe,"slice",!1),this.preparePipeMeta(i.PercentPipe,"percent",!0,[this._locale]),this.preparePipeMeta(i.I18nPluralPipe,"i18nPlural",!0,[i.NgLocalization]),this.preparePipeMeta(i.I18nSelectPipe,"i18nSelect",!0),this.preparePipeMeta(i.KeyValuePipe,"keyvalue",!1,[t.KeyValueDiffers]),this.preparePipeMeta(c.FileIconClassPipe,"fileIconClass",!0),this.preparePipeMeta(c.FileExtensionFromMimePipe,"fileExtensionFromMime",!0),this.preparePipeMeta(c.StateClassPipe,"stateClass",!0),this.preparePipeMeta(c.FileSizePipe,"filesize",!0),this.preparePipeMeta(c.FilterPipe,"filter",!0),this.preparePipeMeta(i.UpperCasePipe,"uppercase",!0),this.preparePipeMeta(i.LowerCasePipe,"lowercase",!0),this.preparePipeMeta(i.JsonPipe,"json",!1),this.preparePipeMeta(i.DecimalPipe,"number",!0,[this._locale]),this.preparePipeMeta(i.TitleCasePipe,"titlecase",!0),this.preparePipeMeta(i.CurrencyPipe,"currency",!0,[this._locale]),this.preparePipeMeta(i.DatePipe,"date",!0,[this._locale]),this.preparePipeMeta(c.ToDatePipe,"toDate",!0,[new i.DatePipe(this._locale)]),this.preparePipeMeta(c.ToNumberPipe,"toNumber",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.ToCurrencyPipe,"toCurrency",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.PrefixPipe,"prefix",!0),this.preparePipeMeta(c.SuffixPipe,"suffix",!0),this.preparePipeMeta(c.TimeFromNowPipe,"timeFromNow",!0),this.preparePipeMeta(c.NumberToStringPipe,"numberToString",!0,[new i.DecimalPipe(this._locale)]),this.preparePipeMeta(c.StringToNumberPipe,"stringToNumber",!0),this.preparePipeMeta(c.CustomPipe,"custom",!0,[this.injector.get(o.CustomPipeManager)]),this.preparePipeMeta(c.TrustAsPipe,"trustAs",!0,[this.domSanitizer]),this.preparePipeMeta(c.SanitizePipe,"sanitize",!0,[this.domSanitizer])],this._pipeMeta=new Map,this._pipeData.forEach((function(e){l._pipeMeta.set(e.name,e)}))}return e.prototype.unknownPipe=function(e){throw Error("The pipe '"+e+"' could not be found")},e.prototype.meta=function(e){var t=this._pipeMeta.get(e);return t||this.unknownPipe(e),t},e.prototype.getPipeNameVsIsPureMap=function(){var e=new Map;return this._pipeMeta.forEach((function(t,n){e.set(n,t.pure)})),e},e.prototype.resolveDep=function(e){return this.injector.get(e.token.identifier.reference)},e.prototype.getInstance=function(e){var t,n,i=this.meta(e).type,o=i.reference,a=i.diDeps;if(o||this.unknownPipe(e),a.length){var r=[];try{for(var s=J(a),l=s.next();!l.done;l=s.next()){var c=l.value;r.push(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return new(o.bind.apply(o,ee([void 0],X(r))))}return new o},e}();Ve.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Ve(C.\u0275\u0275inject(C.Compiler),C.\u0275\u0275inject(C.INJECTOR),C.\u0275\u0275inject(D.DomSanitizer),C.\u0275\u0275inject(I.AbstractI18nService))},token:Ve,providedIn:"root"}),Ve.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ve.ctorParameters=function(){return[{type:t.Compiler},{type:t.Injector},{type:u.DomSanitizer},{type:o.AbstractI18nService}]};var We=function(){function e(e,t,i,a,r,s,l,c,p,d){var u,h=this;this.elRef=i,this.oAuthService=a,this.dialogService=r,this.spinnerService=s,this.router=c,this.app=p,this.appManager=d,this.startApp=!1,this.isApplicationType=!1,this.spinner={show:!1,messages:[],arialabel:""},this.isOAuthDialogOpen=!1,o.setPipeProvider(e),o.setNgZone(l),o.setAppRef(t),this.isApplicationType="APPLICATION"===o.getWmProjectProperties().type,this.appManager.beforeAppReady(),a.getOAuthProvidersAsObservable().subscribe((function(e){h.providersConfig=e,e.length?h.showOAuthDialog():h.closeOAuthDialog()})),this.spinnerService.getMessageSource().asObservable().subscribe((function(e){setTimeout((function(){h.spinner.show=e.show,h.spinner.messages=e.messages,h.spinner.arialabel=e.messages.toString()}))})),O.setTheme("bs3");var m=o.noop;this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url.split("?")[0];(t=t.substring(1))||(h.app.activeLayoutName="",h.app.layoutPages=[]),u=h.app.activeLayoutName&&h.app.layoutPages&&h.app.layoutPages.length&&h.app.layoutPages.includes(t)?h.spinnerService.show("","wmRouterOutlet","","wmRouterOutlet"):h.spinnerService.show("","globalSpinner");var i=document.querySelector("app-page-outlet");i&&o.addClass(i,"page-load-in-progress");var a=Date.now();m=function(){h.spinnerService.hide(u);var e=document.querySelector("app-page-outlet");e&&o.removeClass(e,"page-load-in-progress"),m=o.noop,h.app.activePageLoadTime=Date.now()-a}}else(e instanceof n.NavigationEnd||e instanceof n.NavigationCancel||e instanceof n.NavigationError)&&setTimeout((function(){m()}),1e3)})),this.appManager.subscribe("pageReady",(function(){m()})),this.appManager.subscribe("pageAttach",(function(){m()}))}return e.prototype.showOAuthDialog=function(){this.isOAuthDialogOpen||(this.isOAuthDialogOpen=!0,this.dialogService.open("oAuthLoginDialog",this))},e.prototype.closeOAuthDialog=function(){this.isOAuthDialogOpen&&(this.isOAuthDialogOpen=!1,this.dialogService.close("oAuthLoginDialog",this))},e.prototype.start=function(){var e=this;setTimeout((function(){e.startApp=!0})),setTimeout((function(){e.app.dynamicComponentContainerRef=e.dynamicComponentContainerRef,e.overrideRouterOutlet()}),10)},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return e.app.activePage.ngOnDetach(),n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;o.hasCordova()&&!window.wmDeviceReady?document.addEventListener("wmDeviceReady",(function(){return e.start()})):this.start()},e.prototype.ngDoCheck=function(){o.$invokeWatchers()},e}();We.decorators=[{type:t.Component,args:[{selector:"app-root",template:'<ng-container *ngIf="startApp">\n <router-outlet></router-outlet>\n <div wmContainer partialContainer content="Common" hidden class="ng-hide" *ngIf="isApplicationType"></div>\n <app-spinner name="globalspinner" classname="global-spinner" role="alert" aria-live="assertive" [attr.aria-label]="spinner.arialabel || \'Loading\'" [show]="spinner.show" [spinnermessages]="spinner.messages"></app-spinner>\n <div wmDialog name="oAuthLoginDialog" title="Application is requesting you to sign in with"\n close.event="closeOAuthDialog()">\n <ng-template #dialogBody>\n <ul class="list-items">\n <li class="list-item" *ngFor="let provider of providersConfig">\n <button class="btn" (click)="provider.invoke()">{{provider.name}}</button>\n </li>\n </ul>\n </ng-template>\n </div>\n <div wmConfirmDialog name="_app-confirm-dialog" title.bind="title" message.bind="message" oktext.bind="oktext"\n canceltext.bind="canceltext" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div wmAppExt></div>\n <i id="wm-mobile-display"></i>\n</ng-container>\n\x3c!--Dummy container to create the component dynamically--\x3e\n<ng-container #dynamicComponent></ng-container>\n',encapsulation:t.ViewEncapsulation.None}]}],We.ctorParameters=function(){return[{type:Ve},{type:t.ApplicationRef},{type:t.ElementRef},{type:b.OAuthService},{type:o.AbstractDialogService},{type:o.AbstractSpinnerService},{type:t.NgZone},{type:n.Router},{type:o.App},{type:j}]},We.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],dynamicComponentContainerRef:[{type:t.ViewChild,args:["dynamicComponent",{read:t.ViewContainerRef}]}]};var Ue=function(){function e(){this.wmHttpRequest=new y.WmHttpRequest,this.wmHttpResponse=new y.WmHttpResponse}return e.prototype.createSubject=function(){return new l.Subject},e.prototype.intercept=function(e,t){var n,i,o=this;if(r.appManager&&r.appManager.appOnBeforeServiceCall){var a=this.wmHttpRequest.angularToWmRequest(e);(n=r.appManager.appOnBeforeServiceCall(a))&&(n=this.wmHttpRequest.wmToAngularRequest(n),e=n)}return t.handle(e).pipe(E.tap((function(e){if(e&&4===e.type&&r.appManager&&r.appManager.appOnServiceSuccess){var t=o.wmHttpResponse.angularToWmResponse(e);(i=r.appManager.appOnServiceSuccess(t.body,t))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(e,i))}}),(function(t){if(t._401Subscriber=o.createSubject(),r.httpService.isPlatformSessionTimeout(t)&&r.httpService.handleSessionTimeout(e,t._401Subscriber),r.appManager&&r.appManager.appOnServiceError){var n=o.wmHttpResponse.angularToWmResponse(t);(i=r.appManager.appOnServiceError(n.message,n))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(t,i))}})))},e}();Ue.decorators=[{type:t.Injectable}],Ue.ctorParameters=function(){return[]};var qe="PREFAB",ze=function(){function e(e){var t=this;this.prefabManager=e,window.addEventListener("message",(function(e){if((e.data&&e.data.context)===qe){var n=e.data.action,i=e.data.payload;"init"===n?t.init():"set-property"===n?t.setProperty(i):"get-outbound-properties"===n?t.getOutboundProps():"invoke-script"===n&&t.invokeScript(i)}}))}return e.prototype.postMessage=function(e,t){var n={context:qe,action:e,payload:t};window.top.postMessage(n,"*")},e.prototype.setupEventListeners=function(){var e=this;this.prefabInstance.invokeEventCallback=function(t,n){void 0===n&&(n={}),e.postMessage("event-log",{name:t,data:n})}},e.prototype.init=function(){var e=this;this.previewMode=!0,this.prefabInstance.readyState.subscribe((function(){}),(function(){}),(function(){e.prefabManager.getConfig("__self__").then((function(t){e.config=t,e.postMessage("config",t),e.setupEventListeners()}))}))},e.prototype.setProperty=function(e){this.prefabInstance.widget[e.name]=e.value},e.prototype.isOutBoundProp=function(e){return"out-bound"===e.bindable||"in-out-bound"===e.bindable},e.prototype.getOutboundProps=function(){var e,t,n={};try{for(var i=J(Object.entries(this.config.properties||{})),o=i.next();!o.done;o=i.next()){var a=X(o.value,2),r=a[0],s=a[1];this.isOutBoundProp(s)&&(n[r]=this.prefabInstance.widget[r])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.postMessage("outbound-properties",n)},e.prototype.invokeScript=function(e){var t="\n return "+e.script+";",n=new Function("Prefab",t)(this.prefabInstance);this.postMessage("method-output",{methodName:e.methodName,output:n})},e.prototype.ngAfterViewInit=function(){this.setupEventListeners(),this.postMessage("init")},e}();ze.decorators=[{type:t.Component,args:[{selector:"wm-prefab-preview",template:'\n <div class="prefab-preview row">\n <section wmPrefab name="prefab-preview" prefabname="__self__"></section>\n </div>\n '}]}],ze.ctorParameters=function(){return[{type:H}]},ze.propDecorators={prefabInstance:[{type:t.ViewChild,args:[p.PrefabDirective,{static:!0}]}]},A.initComponentsBuildTask();var He=new Map,Ye=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[wt],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Ke=function(e,n,i){void 0===i&&(i="");var o={template:n,styles:[i],encapsulation:t.ViewEncapsulation.None},a=function(){};return a.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},o),{selector:e})]}],a},Qe=function(){function e(e,t,n){this.app=e,this.appManager=t,this.compiler=n,this.counter=1}return e.prototype.getComponentFactoryRef=function(e,t,n){return void 0===n&&(n={}),Q(this,void 0,void 0,(function(){var i,o,a;return Z(this,(function(r){return i=He.get(e),t=n.transpile?R.transpile(t).markup:t,i&&!n.noCache||(o=Ke(e,t,n.styles),a=Ye(o),i=this.compiler.compileModuleAndAllComponentsSync(a).componentFactories.filter((function(e){return e.componentType===o}))[0],He.set(e,i)),[2,i]}))}))},e.prototype.addComponent=function(e,t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),Q(this,void 0,void 0,(function(){var a,r;return Z(this,(function(s){switch(s.label){case 0:return i.transpile=!o.isDefined(i.transpile)||i.transpile,i.noCache=!o.isDefined(i.noCache)||i.noCache,i.selector=o.isDefined(i.selector)?i.selector:"wm-dynamic-component-"+this.counter++,[4,this.getComponentFactoryRef(i.selector,t,i)];case 1:return a=s.sent(),r=this.app.dynamicComponentContainerRef.createComponent(a,0,_.get(i,"inj")),o.extendProto(r.instance,n),e.appendChild(r.location.nativeElement),[2]}}))}))},e}();Qe.decorators=[{type:t.Injectable}],Qe.ctorParameters=function(){return[{type:o.App},{type:j},{type:t.Compiler}]};var Ze=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return function(){var e;return!1!==(e=this.app.activePage&&this.app.activePage.onBeforePageLeave())&&(e=(this.app.onBeforePageLeave||o.noop)(this.app.activePageName,this.app.activePage)),void 0===e||e}.apply(e)},e}();Ze.decorators=[{type:t.Injectable}];var Je=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return!e.canDeactivate||e.canDeactivate()},e}();Je.decorators=[{type:t.Injectable}];var Xe=function(){function e(){this._stylesSet=new Set}return e.prototype.addStyles=function(e){var t=this,n=new Set;e.forEach((function(e){t._stylesSet.has(e)||(t._stylesSet.add(e),n.add(e))})),this.onStylesAdded(n)},e.prototype.onStylesAdded=function(e){},e.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},e}();Xe.decorators=[{type:t.Injectable}];var et=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n._hostNodes=new Map,n._hostNodes.set(t.head,[]),n}return K(t,e),t.prototype._addStylesToHost=function(e,t,n){var i,o=this,a=(null===(i=document.querySelector('meta[name="CSP-NONCE"]'))||void 0===i?void 0:i.getAttribute("content"))||"wm-csp-nonce";e.forEach((function(e){var i=o._doc.createElement("style");i.textContent=e,i.setAttribute("nonce",a),n.push(t.appendChild(i))}))},t.prototype.addHost=function(e){var t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)},t.prototype.removeHost=function(e){var t=this._hostNodes.get(e);t&&t.forEach(tt),this._hostNodes.delete(e)},t.prototype.onStylesAdded=function(e){var t=this;this._hostNodes.forEach((function(n,i){t._addStylesToHost(e,i,n)}))},t.prototype.ngOnDestroy=function(){this._hostNodes.forEach((function(e){return e.forEach(tt)}))},t}(Xe);function tt(e){i["\u0275getDOM"]().remove(e)}et.decorators=[{type:t.Injectable}],et.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[i.DOCUMENT]}]}]};var nt={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},it=/%COMP%/g,ot="_nghost-%COMP%",at="_ngcontent-%COMP%";function rt(e,t,n){for(var i=0;i<t.length;i++){var o=t[i];Array.isArray(o)?rt(e,o,n):(o=o.replace(it,e),n.push(o))}return n}function st(e){return function(t){if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}var lt=function(){function e(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new ct(e)}return e.prototype.createRenderer=function(e,n){if(!e||!n)return this.defaultRenderer;switch(n.encapsulation){case t.ViewEncapsulation.Emulated:var i=this.rendererByCompId.get(n.id);return i||(i=new ut(this.eventManager,this.sharedStylesHost,n,this.appId),this.rendererByCompId.set(n.id,i)),i.applyToHost(e),i;case 1:case t.ViewEncapsulation.ShadowDom:return new ht(this.eventManager,this.sharedStylesHost,e,n);default:if(!this.rendererByCompId.has(n.id)){var o=rt(n.id,n.styles,[]);this.sharedStylesHost.addStyles(o),this.rendererByCompId.set(n.id,this.defaultRenderer)}return this.defaultRenderer}},e.prototype.begin=function(){},e.prototype.end=function(){},e}();lt.decorators=[{type:t.Injectable}],lt.ctorParameters=function(){return[{type:u.EventManager},{type:u["\u0275DomSharedStylesHost"]},{type:String,decorators:[{type:t.Inject,args:[t.APP_ID]}]}]};var ct=function(){function e(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}return e.prototype.destroy=function(){},e.prototype.createElement=function(e,t){return t?document.createElementNS(nt[t]||t,e):document.createElement(e)},e.prototype.createComment=function(e){return document.createComment(e)},e.prototype.createText=function(e){return document.createTextNode(e)},e.prototype.appendChild=function(e,t){(pt(e)?e.content:e).appendChild(t)},e.prototype.insertBefore=function(e,t,n){e&&(pt(e)?e.content:e).insertBefore(t,n)},e.prototype.removeChild=function(e,t){e&&e.removeChild(t)},e.prototype.selectRootElement=function(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error('The selector "'+e+'" did not match any elements');return t||(n.textContent=""),n},e.prototype.parentNode=function(e){return e.parentNode},e.prototype.nextSibling=function(e){return e.nextSibling},e.prototype.resetStyles=function(e){[].slice.call(e).forEach((function(t){e.style.removeProperty(t)}))},e.prototype.applyStyles=function(e,t){if(t)return t.split(";").forEach((function(t){var n,i,o=t.split(":");2===o.length&&(n=o[0].trim(),i=o[1].trim(),e.style[n]=i)})),t},e.prototype.setAttribute=function(e,t,n,i){if(i){t=i+":"+t;var o=nt[i];o?e.setAttributeNS(o,t,n):e.setAttribute(t,n)}else"style"===t?(this.resetStyles(e),this.applyStyles(e,n)):e.setAttribute(t,n)},e.prototype.removeAttribute=function(e,t,n){if(n){var i=nt[n];i?e.removeAttributeNS(i,t):e.removeAttribute(n+":"+t)}else e.removeAttribute(t)},e.prototype.addClass=function(e,t){e.classList.add(t)},e.prototype.removeClass=function(e,t){e.classList.remove(t)},e.prototype.setStyle=function(e,n,i,o){o&(t.RendererStyleFlags2.DashCase|t.RendererStyleFlags2.Important)?e.style.setProperty(n,i,o&t.RendererStyleFlags2.Important?"important":""):e.style[n]=i},e.prototype.removeStyle=function(e,n,i){i&t.RendererStyleFlags2.DashCase?e.style.removeProperty(n):e.style[n]=""},e.prototype.setProperty=function(e,t,n){e[t]=n},e.prototype.setValue=function(e,t){e.nodeValue=t},e.prototype.listen=function(e,t,n){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,st(n)):this.eventManager.addEventListener(e,t,st(n))},e}();"@".charCodeAt(0);function pt(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}var dt,ut=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.component=i;var r,s=rt(o+"-"+i.id,i.styles,[]);return n.addStyles(s),a.contentAttr=(r=o+"-"+i.id,at.replace(it,r)),a.hostAttr=function(e){return ot.replace(it,e)}(o+"-"+i.id),a}return K(t,e),t.prototype.applyToHost=function(t){e.prototype.setAttribute.call(this,t,this.hostAttr,"")},t.prototype.createElement=function(t,n){var i=e.prototype.createElement.call(this,t,n);return e.prototype.setAttribute.call(this,i,this.contentAttr,""),i},t}(ct),ht=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.sharedStylesHost=n,a.hostEl=i,a.shadowRoot=i.attachShadow({mode:"open"}),a.sharedStylesHost.addHost(a.shadowRoot);for(var r=rt(o.id,o.styles,[]),s=0;s<r.length;s++){var l=document.createElement("style");l.textContent=r[s],a.shadowRoot.appendChild(l)}return a}return K(t,e),t.prototype.nodeOrShadowRoot=function(e){return e===this.hostEl?this.shadowRoot:e},t.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},t.prototype.appendChild=function(t,n){return e.prototype.appendChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.insertBefore=function(t,n,i){return e.prototype.insertBefore.call(this,this.nodeOrShadowRoot(t),n,i)},t.prototype.removeChild=function(t,n){return e.prototype.removeChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.parentNode=function(t){return this.nodeOrShadowRoot(e.prototype.parentNode.call(this,this.nodeOrShadowRoot(t)))},t}(ct),mt=function(){o._WM_APP_PROJECT.id=o.hasCordova()?_WM_APP_PROPERTIES.displayName:location.href.split("/")[3],o._WM_APP_PROJECT.cdnUrl=document.querySelector('[name="cdnUrl"]')&&document.querySelector('[name="cdnUrl"]').getAttribute("content"),o._WM_APP_PROJECT.ngDest="ng-bundle/"};function ft(e,t){return{provide:e,useValue:t}}function gt(e,t){var n=this;return function(){return Q(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return mt(),[4,t.resolve()];case 1:return n.sent(),[2,e.loadDefaultLocale()]}}))}))}}function vt(e){return mt(),e.deduceAppLocale()}!function(e){e.IOS="ios",e.ANDROID="android"}(dt||(dt={}));var yt=[fe,ge,ve,be,We,ze,ye],bt=[f.ConfirmDialogModule,g.DesignDialogModule,m.DialogModule];$.fn.swipeAnimation.expressionEvaluator=o.$parseExpr;var wt=function(){function e(t,n,i){e.addCustomEventPolyfill(),this.getDeviceDetails().then((function(e){n.selectedViewPort={os:e.os,category:e.selectedDeviceCategory},i.update(e),n.notify("on-viewport-details",e.os)}))}return e.addCustomEventPolyfill=function(){if("function"==typeof window.CustomEvent)return!1;var e=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n};e.prototype=window.Event.prototype,window.CustomEvent=e},e.forRoot=function(){return{ngModule:e,providers:[{provide:o.App,useClass:Oe},{provide:o.AbstractToasterService,useClass:Ee},{provide:o.AbstractI18nService,useClass:Ae},{provide:o.AbstractSpinnerService,useClass:Te},{provide:o.AbstractNavigationService,useClass:Ce},{provide:o.AppDefaults,useClass:xe},{provide:o.DynamicComponentRefProvider,useClass:Qe},{provide:t.APP_INITIALIZER,useFactory:gt,deps:[o.AbstractI18nService,je],multi:!0},{provide:t.LOCALE_ID,useFactory:vt,deps:[o.AbstractI18nService]},{provide:d.HTTP_INTERCEPTORS,useClass:Ue,multi:!0},i.DecimalPipe,i.DatePipe,j,H,ke,Me,Le,Ze,je,Ge,$e,ft(ae,10),ft(re,1800)]}},e.prototype.getDeviceDetails=function(){return new Promise((function(e,t){window.top!==window?(window.top.postMessage({key:"on-load"},"*"),window.onmessage=function(t){var n=t.data;o.isObject(n)&&"switch-device"===n.key&&e(n.device)}):o.isIphone()||o.isIpod()||o.isIpad()?e({os:dt.IOS}):e({os:dt.ANDROID})}))},e}();wt.decorators=[{type:t.NgModule,args:[{declarations:yt,imports:[i.CommonModule,n.RouterModule,d.HttpClientModule,h.ToastrModule,c.WmComponentsModule,p.PrefabModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,bt],exports:[yt,i.CommonModule,c.WmComponentsModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,bt],providers:[{provide:u["\u0275DomSharedStylesHost"],useClass:et},{provide:u["\u0275DomRendererFactory2"],useClass:lt}],entryComponents:[ve]}]}],wt.ctorParameters=function(){return[{type:v.MobileRuntimeModule},{type:o.App},{type:o.Viewport}]};var Pt=[c.WmComponentsModule.forRoot(),v.MobileRuntimeModule.forRoot(),o.CoreModule.forRoot(),a.SecurityModule.forRoot(),b.OAuthModule.forRoot(),r.VariablesModule.forRoot(),y.HttpServiceModule.forRoot(),wt.forRoot()],_t=!1,Ot=function(){function e(e,t){this.appManager=e,this.appVariablesProvider=t}return e.prototype.resolve=function(){var e=this;return!!_t||Promise.all([this.appManager.loadSecurityConfig(),this.appManager.loadMetadata(),this.appVariablesProvider.getAppVariables()]).then((function(t){return e.appManager.loadAppVariables(t[2])})).then((function(){return _t=!0}))},e}();Ot.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Ot(C.\u0275\u0275inject(j),C.\u0275\u0275inject(L))},token:Ot,providedIn:"root"}),Ot.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ot.ctorParameters=function(){return[{type:j},{type:L}]};var Et=!1,Rt=function(){function e(e){this.appManager=e}return e.prototype.resolve=function(){return Et||this.appManager.loadMetadata().then((function(){return Et=!0}))},e}();Rt.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Rt(C.\u0275\u0275inject(j))},token:Rt,providedIn:"root"}),Rt.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Rt.ctorParameters=function(){return[{type:j}]};var At=function(){function e(e){this.appManager=e,o.isMobileApp()||(this.loaded=this.appManager.isPrefabType()||this.appManager.isTemplateBundleType()||!o.getWmProjectProperties().securityEnabled)}return e.prototype.resolve=function(){var e=this;return this.loaded||this.appManager.loadSecurityConfig().then((function(){e.loaded=!0}))},e}();At.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new At(C.\u0275\u0275inject(j))},token:At,providedIn:"root"}),At.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],At.ctorParameters=function(){return[{type:j}]},e.AccessrolesDirective=fe,e.AppComponent=We,e.AppDefaultsService=xe,e.AppExtensionJSResolve=Ge,e.AppExtensionProvider=F,e.AppJSProvider=M,e.AppJSResolve=je,e.AppManagerService=j,e.AppRef=Oe,e.AppSpinnerComponent=ge,e.AppVariablesProvider=L,e.AppVariablesResolve=Ot,e.AuthGuard=ke,e.BaseLayoutComponent=ue,e.BasePageComponent=pe,e.BasePartialComponent=ie,e.BasePrefabComponent=de,e.BaseSpaPageComponent=me,e.CACHE_PAGE=oe,e.CanDeactivateNgPageGuard=Je,e.CanDeactivatePageGuard=Ze,e.ComponentRefProvider=N,e.CustomToasterComponent=ve,e.DynamicComponentRefProviderService=Qe,e.EmptyPageComponent=ye,e.FragmentMonitor=te,e.HttpCallInterceptor=Ue,e.I18nResolve=$e,e.I18nServiceImpl=Ae,e.InitializeApp=gt,e.MAX_CACHE_AGE=re,e.MAX_CACHE_SIZE=ae,e.MetadataResolve=Rt,e.NavigationServiceImpl=Ce,e.PageNotFoundGaurd=Le,e.PipeProvider=Ve,e.PrefabConfigProvider=k,e.PrefabDirective=be,e.PrefabManagerService=H,e.PrefabPreviewComponent=ze,e.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS=bt,e.RoleGuard=Me,e.RuntimeBaseModule=wt,e.SecurityConfigResolve=At,e.SpinnerServiceImpl=Te,e.ToasterServiceImpl=Ee,e.WM_MODULES_FOR_ROOT=Pt,e.WmDefaultRouteReuseStrategy=se,e.WmNgRouteReuseStrategy=ce,e.WmRouteReuseStrategy=le,e.commonPartialWidgets=ne,e.getPrefabBaseUrl=G,e.getPrefabConfigUrl=function(e){return G(e)+"/config.json"},e.getPrefabMinJsonUrl=function(e){return G(e)+"/pages/Main/page.min.json"},e.getPrefabPartialJsonUrl=function(e,t){return G(e)+"/pages/"+t+"/page.min.json"},e.isPrefabInPreview=B,e.setAngularLocale=vt,e["\u02750"]=z,e["\u0275a"]=ft,e["\u0275b"]=Xe,e["\u0275c"]=et,e["\u0275d"]=lt,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/platform-browser-dynamic"),require("@angular/platform-browser"),require("@angular/common"),require("@angular/router"),require("@angular/common/http"),require("@angular/forms"),require("ngx-bootstrap/typeahead"),require("ngx-bootstrap/timepicker"),require("ngx-bootstrap/progressbar"),require("ngx-bootstrap/pagination"),require("ngx-bootstrap/modal"),require("ngx-bootstrap/tooltip"),require("ngx-bootstrap/datepicker"),require("ngx-bootstrap/dropdown"),require("ngx-bootstrap/popover"),require("ng-circle-progress"),require("ngx-toastr"),require("ngx-bootstrap/carousel"),require("@wm/core"),require("@wm/components/basic"),require("@wm/components/basic/progress"),require("@wm/components/basic/rich-text-editor"),require("@wm/components/basic/search"),require("@wm/components/basic/tree"),require("@wm/components/input"),require("@wm/components/input/calendar"),require("@wm/components/input/chips"),require("@wm/components/input/color-picker"),require("@wm/components/input/currency"),require("@wm/components/input/epoch"),require("@wm/components/input/file-upload"),require("@wm/components/input/rating"),require("@wm/components/input/slider"),require("@wm/mobile/runtime/dynamic"),require("@wm/components/data/card"),require("@wm/components/data/form"),require("@wm/components/data/list"),require("@wm/components/data/live-table"),require("@wm/components/data/pagination"),require("@wm/components/data/table"),require("@wm/components/chart"),require("@wm/components/containers/accordion"),require("@wm/components/containers/linear-layout"),require("@wm/components/containers/layout-grid"),require("@wm/components/containers/panel"),require("@wm/components/containers/tabs"),require("@wm/components/containers/tile"),require("@wm/components/containers/wizard"),require("@wm/components/dialogs/alert-dialog"),require("@wm/components/dialogs/iframe-dialog"),require("@wm/components/dialogs/login-dialog"),require("@wm/components/dialogs/partial-dialog"),require("@wm/components/navigation/breadcrumb"),require("@wm/components/navigation/menu"),require("@wm/components/navigation/navbar"),require("@wm/components/navigation/popover"),require("@wm/components/advanced/carousel"),require("@wm/components/advanced/login"),require("@wm/components/advanced/marquee"),require("@wm/components/page"),require("@wm/components/page/footer"),require("@wm/components/page/header"),require("@wm/components/page/left-panel"),require("@wm/components/page/right-panel"),require("@wm/components/page/top-nav"),require("@wm/components/prefab"),require("@wm/runtime/base"),require("@wm/variables"),require("@wm/security"),require("@wm/transpiler"),require("@angular/platform-browser/animations")):"function"==typeof define&&define.amd?define("@wm/runtime/dynamic",["exports","@angular/core","@angular/platform-browser-dynamic","@angular/platform-browser","@angular/common","@angular/router","@angular/common/http","@angular/forms","ngx-bootstrap/typeahead","ngx-bootstrap/timepicker","ngx-bootstrap/progressbar","ngx-bootstrap/pagination","ngx-bootstrap/modal","ngx-bootstrap/tooltip","ngx-bootstrap/datepicker","ngx-bootstrap/dropdown","ngx-bootstrap/popover","ng-circle-progress","ngx-toastr","ngx-bootstrap/carousel","@wm/core","@wm/components/basic","@wm/components/basic/progress","@wm/components/basic/rich-text-editor","@wm/components/basic/search","@wm/components/basic/tree","@wm/components/input","@wm/components/input/calendar","@wm/components/input/chips","@wm/components/input/color-picker","@wm/components/input/currency","@wm/components/input/epoch","@wm/components/input/file-upload","@wm/components/input/rating","@wm/components/input/slider","@wm/mobile/runtime/dynamic","@wm/components/data/card","@wm/components/data/form","@wm/components/data/list","@wm/components/data/live-table","@wm/components/data/pagination","@wm/components/data/table","@wm/components/chart","@wm/components/containers/accordion","@wm/components/containers/linear-layout","@wm/components/containers/layout-grid","@wm/components/containers/panel","@wm/components/containers/tabs","@wm/components/containers/tile","@wm/components/containers/wizard","@wm/components/dialogs/alert-dialog","@wm/components/dialogs/iframe-dialog","@wm/components/dialogs/login-dialog","@wm/components/dialogs/partial-dialog","@wm/components/navigation/breadcrumb","@wm/components/navigation/menu","@wm/components/navigation/navbar","@wm/components/navigation/popover","@wm/components/advanced/carousel","@wm/components/advanced/login","@wm/components/advanced/marquee","@wm/components/page","@wm/components/page/footer","@wm/components/page/header","@wm/components/page/left-panel","@wm/components/page/right-panel","@wm/components/page/top-nav","@wm/components/prefab","@wm/runtime/base","@wm/variables","@wm/security","@wm/transpiler","@angular/platform-browser/animations"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.runtime=e.wm.runtime||{},e.wm.runtime.dynamic={}),e.ng.core,e.ng.platformBrowserDynamic,e.ng.platformBrowser,e.ng.common,e.ng.router,e.ng.common.http,e.ng.forms,e["ngx-bootstrap"].typeahead,e["ngx-bootstrap"].timepicker,e["ngx-bootstrap"].progressbar,e["ngx-bootstrap"].pagination,e["ngx-bootstrap"].modal,e["ngx-bootstrap"].tooltip,e["ngx-bootstrap"].datepicker,e["ngx-bootstrap"].dropdown,e["ngx-bootstrap"].popover,e.ngCircleProgress,e.ngxToastr,e["ngx-bootstrap"].carousel,e.wm.core,e.wm.components.basic,e.wm.components.basic.progress,e.wm.components.basic.richtexteditor,e.wm.components.basic.search,e.wm.components.basic.tree,e.wm.components.input,e.wm.components.input.calendar,e.wm.components.input.chips,e.wm.components.input.colorpicker,e.wm.components.input.currency,e.wm.components.input.epoch,e.wm.components.input.fileupload,e.wm.components.input.rating,e.wm.components.input.slider,e.wm.mobile.runtime.dynamic,e.wm.components.data.card,e.wm.components.data.form,e.wm.components.data.list,e.wm.components.data.livetable,e.wm.components.data.pagination,e.wm.components.data.table,e.wm.components.chart,e.wm.components.containers.accordion,e.wm.components.containers.linearlayout,e.wm.components.containers.layoutgrid,e.wm.components.containers.panel,e.wm.components.containers.tabs,e.wm.components.containers.tile,e.wm.components.containers.wizard,e.wm.components.dialogs.alertdialog,e.wm.components.dialogs.iframedialog,e.wm.components.dialogs.logindialog,e.wm.components.dialogs.partialdialog,e.wm.components.navigation.breadcrumb,e.wm.components.navigation.menu,e.wm.components.navigation.navbar,e.wm.components.navigation.popover,e.wm.components.advanced.carousel,e.wm.components.advanced.login,e.wm.components.advanced.marquee,e.wm.components.page,e.wm.components.page.footer,e.wm.components.page.header,e.wm.components.page.leftpanel,e.wm.components.page.rightpanel,e.wm.components.page.topnav,e.wm.components.prefab,e.wm.runtime.base,e.wm.variables,e.wm.security,e.wm.transpiler,e.ng.platformBrowser.animations)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u,h,m,f,g,v,y,b,w,P,O,E,R,A,T,S,C,I,D,x,N,k,M,L,F,j,B,G,V,W,U,q,z,H,Y,K,Q,Z,J,X,ee,te,ne,ie,oe,ae,re,se,le,ce,pe,de,ue,he,me,fe,ge,ve,ye,be,we){"use strict";function Pe(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var _e=Pe(t),Oe=Pe(r),Ee=function(e,t){return(Ee=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 Re(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}Ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Ae(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(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(r,s)}l((i=i.apply(e,t||[])).next())}))}function Te(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function Se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function Ce(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 Ie=function(){function e(e,t,n,i,o,a,r,s,l,c,p,d,u){this.injector=e,this.route=t,this.vcRef=n,this.appRef=i,this.metadataService=o,this.securityService=a,this.appManager=r,this.app=s,this.ngZone=l,this.elRef=c,this.spinnerService=p,this.componentRefProvider=d,this.router=u}return e.prototype.getTargetNode=function(){return this.elRef.nativeElement},e.prototype.resetViewContainer=function(){this.vcRef.clear(),this.getTargetNode().innerHTML=""},e.prototype.renderPage=function(e){var t=this,n=this.getTargetNode();this.appManager.loadAppVariables().then((function(){return Ae(t,void 0,void 0,(function(){var t,i;return Te(this,(function(o){switch(o.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(e,ge.ComponentType.PAGE)];case 1:return(t=o.sent())?(i=this.vcRef.createComponent(t,0,this.injector),this.instance=i.instance,n.appendChild(i.location.nativeElement)):ge.BasePageComponent.clear(),this.vcRef.length>1&&this.vcRef.remove(1),[2]}}))}))}))},e.prototype.renderPrefabPreviewPage=function(){this.router.navigate(["prefab-preview"])},e.prototype.loadPage=function(e){var t=this;this.ngZone.run((function(){e&&t.renderPage(e)}))},e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.renderPrefabPreviewPage():($(this.getTargetNode()).find(">div").first().remove(),this.subscription=this.route.params.subscribe((function(t){var n=t.pageName;e.loadPage(n)})))},e.prototype.ngOnDestroy=function(){this.vcRef.clear(),this.subscription&&this.subscription.unsubscribe()},e.prototype.ngOnAttach=function(){this.getTargetNode().appendChild(this.instance.$page[0]),this.instance.ngOnAttach()},e.prototype.ngOnDetach=function(){this.instance.ngOnDetach()},e}();Ie.decorators=[{type:t.Component,args:[{selector:"app-page-outlet",template:"<div></div>"}]}],Ie.ctorParameters=function(){return[{type:t.Injector},{type:a.ActivatedRoute},{type:t.ViewContainerRef},{type:t.ApplicationRef},{type:ve.MetadataService},{type:ye.SecurityService},{type:ge.AppManagerService},{type:w.App},{type:t.NgZone},{type:t.ElementRef},{type:w.AbstractSpinnerService},{type:ge.ComponentRefProvider},{type:a.Router}]};var De={securityConfig:ge.SecurityConfigResolve,metadata:ge.MetadataResolve,appMetaConfig:ge.AppExtensionJSResolve},xe=[{path:"",pathMatch:"full",resolve:De,component:ge.EmptyPageComponent},{path:"prefab-preview",pathMatch:"full",resolve:De,component:ge.PrefabPreviewComponent},{path:":pageName",pathMatch:"full",resolve:De,component:Ie,canDeactivate:[ge.CanDeactivatePageGuard]}],Ne=function(e){function t(t){var n=e.call(this)||this;return n.$http=t,n}return Re(t,e),t.prototype.getAppScriptFn=function(){return this.$http.get("./app.js",{responseType:"text"}).toPromise().then((function(e){return new Function("App","Utils","Injector",e)}))},t}(ge.AppJSProvider);Ne.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Ne(_e.\u0275\u0275inject(Oe.HttpClient))},token:Ne,providedIn:"root"}),Ne.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ne.ctorParameters=function(){return[{type:r.HttpClient}]};var ke=new Map,Me=function(){function e(e){this.$http=e}return e.prototype.get=function(e,t){var n=ke.get(e);return n?Promise.resolve(n):this.$http.get(e).then((function(n){return t&&ke.set(e,n),n}))},e.prototype.clearCache=function(){ke.clear()},e}();Me.decorators=[{type:t.Injectable}],Me.ctorParameters=function(){return[{type:w.AbstractHttpService}]};var Le=function(e){function t(t){var n=e.call(this)||this;return n.resourceManager=t,n}return Re(t,e),t.prototype.getAppVariables=function(){return Ae(this,void 0,void 0,(function(){return Te(this,(function(e){return[2,this.resourceManager.get("./app.variables.json")]}))}))},t}(ge.AppVariablesProvider);Le.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Le(_e.\u0275\u0275inject(Me))},token:Le,providedIn:"root"}),Le.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Le.ctorParameters=function(){return[{type:Me}]};var Fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Re(t,e),t.prototype.loadFormatterConfigScript=function(e){try{w.appendScriptToHead(e)}catch(e){console.warn("Error while loading the formatters.js file")}},t}(ge.AppExtensionProvider);Fe.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Fe},token:Fe,providedIn:"root"}),Fe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var je=new Map;window.resourceCache=je;var Be=new Map;Be.set(ge.ComponentType.PAGE,new Map),Be.set(ge.ComponentType.PARTIAL,new Map),Be.set(ge.ComponentType.PREFAB,new Map);var Ge=function(e){return decodeURIComponent(e.replace(/\+/g," "))},$e=Ge,Ve=function(e,t,n){return t===ge.ComponentType.PAGE||t===ge.ComponentType.PARTIAL?n&&n.prefab?ge.getPrefabPartialJsonUrl(n.prefab,e):"./pages/"+e+"/page.min.json":t===ge.ComponentType.PREFAB?ge.getPrefabMinJsonUrl(e):void 0},We=Ve,Ue=new Map,qe=function(e,t,n,i,o,a){var r=Ue.get(t);("Partial"!==n||_.isUndefined(i.Prefab))&&r||(r=new Function(n,"App","Utils",e),Ue.set(t,r)),r(i,o,a)},ze=qe,He=function(){function e(){}return e.prototype.init=function(){},e}(),Ye=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[ge.RuntimeBaseModule],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Ke=Ye,Qe=function(e,n,i,o,a,r){var s={template:i,styles:[o],encapsulation:t.ViewEncapsulation.None},l=He,c="",p="";switch(n){case ge.ComponentType.PAGE:l=ge.BasePageComponent,c="app-page-"+e,p="Page";break;case ge.ComponentType.PARTIAL:l=ge.BasePartialComponent,c="app-partial-"+e,p="Partial";break;case ge.ComponentType.PREFAB:l=ge.BasePrefabComponent,c="app-prefab-"+e,p="Prefab"}var d=function(t){function i(i){var o=t.call(this)||this;switch(o.injector=i,n){case ge.ComponentType.PAGE:o.pageName=e;break;case ge.ComponentType.PARTIAL:o.partialName=e;break;case ge.ComponentType.PREFAB:o.prefabName=e}return t.prototype.init.call(o),o}return Re(i,t),i.prototype.evalUserScript=function(e,t,n){qe(a,c,p,e,t,n)},i.prototype.getVariables=function(){return JSON.parse(r)},i.prototype.getExpressions=function(){return{}},i}(l);return d.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},s),{selector:c,providers:[{provide:w.UserDefinedExecutionContext,useExisting:d}]})]}],d.ctorParameters=function(){return[{type:t.Injector}]},d},Ze=Qe,Je=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.resouceMngr=t,a.app=n,a.appManager=i,a.compiler=o,a}return Re(t,e),t.prototype.loadResourcesOfFragment=function(e,t,n){var i=this,o=Ve(e,t,n),a=je.get(o);return a?Promise.resolve(a):this.resouceMngr.get(o,!0).then((function(n){var i=n.markup,a=n.script,r=n.styles,s=n.variables,l={markup:be.transpile(Ge(i)).markup,script:Ge(a),styles:be.scopeComponentStyles(e,t,Ge(r)),variables:w.getValidJSON(Ge(s))};return je.set(o,l),l}),(function(e){var t=e.details.status,n={404:i.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available",403:i.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied"};return Promise.reject(n[t])}))},t.prototype.getComponentFactoryRef=function(e,t,n){return Ae(this,void 0,void 0,(function(){var i,o,a,r=this;return Te(this,(function(s){return(i=Be.get(t))&&(a=n&&n.prefab?n.prefab+e:e,o=i.get(a))?[2,o]:[2,this.loadResourcesOfFragment(e,t,n).then((function(i){var a=i.markup,s=i.script,l=i.styles,c=i.variables,p=Qe(e,t,a,l,s,JSON.stringify(c)),d=Ye(p);o=r.compiler.compileModuleAndAllComponentsSync(d).componentFactories.filter((function(e){return e.componentType===p}))[0];var u=n&&n.prefab?n.prefab+e:e;return Be.get(t).set(u,o),o}),(function(e){if(e){var t="Error while loading page";console.log(t,e),r.appManager.notifyApp(_.isString(e)?e:t+", check browser console for error details","error")}}))]}))}))},t.prototype.clearComponentFactoryRefCache=function(){this.resouceMngr.clearCache(),je.clear(),Be.forEach((function(e){e.clear()}))},t}(ge.ComponentRefProvider);Je.decorators=[{type:t.Injectable}],Je.ctorParameters=function(){return[{type:Me},{type:w.App},{type:ge.AppManagerService},{type:t.Compiler}]};var Xe=new Map,et=function(e){function t(t){var n=e.call(this)||this;return n.resourceMngr=t,n}return Re(t,e),t.prototype.getConfig=function(e){var t=Xe.get(e);return t?Promise.resolve(t):this.resourceMngr.get(ge.getPrefabConfigUrl(e)).then((function(t){return Xe.set(e,t),t}))},t}(ge.PrefabConfigProvider);et.decorators=[{type:t.Injectable}],et.ctorParameters=function(){return[{type:Me}]};var tt=a.RouterModule.forRoot(xe,{useHash:!0,scrollPositionRestoration:"top"}),nt=y.ToastNoAnimationModule.forRoot({maxOpened:1,autoDismiss:!0}),it=r.HttpClientXsrfModule.withOptions({cookieName:"wm_xsrf_token",headerName:w.getWmProjectProperties().xsrf_header_name}),ot=u.ModalModule.forRoot(),at=m.BsDatepickerModule.forRoot(),rt=m.DatepickerModule.forRoot(),st=c.TimepickerModule.forRoot(),lt=f.BsDropdownModule.forRoot(),ct=d.PaginationModule.forRoot(),pt=l.TypeaheadModule.forRoot(),dt=p.ProgressbarModule.forRoot(),ut=b.CarouselModule.forRoot(),ht=g.PopoverModule.forRoot(),mt=v.NgCircleProgressModule.forRoot({}),ft=h.TooltipModule.forRoot(),gt=[m.BsDatepickerModule,m.DatepickerModule,c.TimepickerModule,f.BsDropdownModule,d.PaginationModule,l.TypeaheadModule,p.ProgressbarModule,b.CarouselModule,g.PopoverModule,v.NgCircleProgressModule,h.TooltipModule,P.BasicModule,O.ProgressModule,E.RichTextEditorModule,R.SearchModule,A.TreeModule,S.CalendarModule,C.ChipsModule,I.ColorPickerModule,D.CurrencyModule,x.EpochModule,N.FileUploadModule,T.InputModule,k.RatingModule,M.SliderModule,F.CardModule,j.FormModule,B.ListModule,G.LiveTableModule,V.PaginationModule,W.TableModule,U.ChartModule,q.AccordionModule,z.LinearLayoutModule,H.LayoutGridModule,Y.PanelModule,K.TabsModule,Q.TileModule,Z.WizardModule,J.AlertDialogModule,X.IframeDialogModule,ee.LoginDialogModule,te.PartialDialogModule,ne.BreadcrumbModule,ie.MenuModule,oe.NavbarModule,ae.PopoverModule,re.CarouselModule,se.LoginModule,le.MarqueeModule,ce.PageModule,pe.FooterModule,de.HeaderModule,ue.LeftPanelModule,he.RightPanelModule,me.TopNavModule,fe.PrefabModule];ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(gt))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(L.MOBILE_COMPONENT_MODULES_FOR_ROOT))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push(s.FormsModule,s.ReactiveFormsModule);var vt=function(e,t,n){this.app=e,this.inj=t,this.componentRefProvider=n,window.cordova&&this.app.subscribe("userLoggedOut",this.componentRefProvider.clearComponentFactoryRefCache.bind(this.componentRefProvider))};vt.decorators=[{type:t.NgModule,args:[{declarations:[Ie],imports:[i.BrowserModule,we.BrowserAnimationsModule,o.CommonModule,a.RouterModule,r.HttpClientModule,ot,at,rt,st,lt,ct,pt,ft,dt,ut,ht,mt,tt,nt,it,L.MobileRuntimeDynamicModule,ge.WM_MODULES_FOR_ROOT],providers:[Me,{provide:ge.AppJSProvider,useClass:Ne},{provide:ge.AppVariablesProvider,useClass:Le},{provide:ge.AppExtensionProvider,useClass:Fe},{provide:ge.ComponentRefProvider,useClass:Je},{provide:w.PartialRefProvider,useClass:Je},{provide:ge.PrefabConfigProvider,useClass:et},{provide:a.RouteReuseStrategy,useClass:ge.WmRouteReuseStrategy}],bootstrap:[ge.AppComponent]}]}],vt.ctorParameters=function(){return[{type:w.App},{type:t.Injector},{type:ge.ComponentRefProvider}]};var yt="debugMode";"true"!==sessionStorage.getItem(yt)&&t.enableProdMode(),console.time("bootstrap"),document.addEventListener("DOMContentLoaded",(function(){new Promise((function(e){window.cordova?document.addEventListener("deviceready",e):e()})).then((function(){return n.platformBrowserDynamic().bootstrapModule(vt)})).then((function(e){var n=e.injector.get(t.ApplicationRef);window.addEventListener("unload",(function(){n.components.map((function(e){return e&&e.destroy()}))})),console.timeEnd("bootstrap")}),(function(e){return console.log(e)}))})),window.debugMode=function(e){_.isEmpty(e)&&(e=!0);var t=e?"true":"false";sessionStorage.getItem(yt)!==t&&(sessionStorage.setItem(yt,t),window.location.reload())};e.AppExtensionProviderService=Fe,e.AppJSProviderService=Ne,e.AppModule=vt,e.AppResourceManagerService=Me,e.AppVariablesProviderService=Le,e.ComponentRefProviderService=Je,e.PageWrapperComponent=Ie,e.PrefabConfigProviderService=et,e.bsDatePickerModule=at,e.bsDropdownModule=lt,e.carouselModule=ut,e.datepickerModule=rt,e.httpClientXsrfModule=it,e.modalModule=ot,e.ngCircleProgressModule=mt,e.paginationModule=ct,e.popoverModule=ht,e.progressbarModule=dt,e.routerModule=tt,e.timepickerModule=st,e.toastrModule=nt,e.tooltipModule=ft,e.typeaheadModule=pt,e["\u02750"]=$e,e["\u02751"]=We,e["\u02752"]=ze,e["\u02753"]=Ke,e["\u02754"]=Ze,e["\u0275a"]=xe,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
745
|
+
var Y=function(e,t){return(Y=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 K(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}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Q(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(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(r,s)}l((i=i.apply(e,t||[])).next())}))}function Z(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function J(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function X(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function ee(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 te=function(){function e(){this.fragments=0,this.fragmentsLoaded$=new l.Subject}return e.prototype.init=function(){var e=this;this.viewInit$.subscribe(o.noop,o.noop,(function(){e.isViewInitialized=!0,e.isReady()}))},e.prototype.registerFragment=function(){this.fragments++},e.prototype.resolveFragment=function(){this.fragments--,this.isReady()},e.prototype.isReady=function(){this.isViewInitialized&&!this.fragments&&(this.registerFragment=o.noop,this.resolveFragment=o.noop,this.fragmentsLoaded$.complete())},e}();te.decorators=[{type:t.Directive}],te.ctorParameters=function(){return[]};var ne={},ie=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.activePageName=this.App.activePageName,this.registerPageParams(),this.defineI18nProps(),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.pageParams=t.containerWidget.partialParams})),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){"Common"===this.partialName?this.Widgets=ne:this.Widgets=Object.create(ne),this.containerWidget.Widgets=this.Widgets},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.initUserScript=function(){try{this.getContainerWidgetInjector().view.component.prefabName&&(this.getContainerWidgetInjector().view.component.Prefab?this.Prefab=this.getContainerWidgetInjector().view.component.Prefab:this.Prefab=this.getContainerWidgetInjector().view.component),this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating partial ("+this.partialName+") script\n",e)}},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.partialName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){o.$invokeWatchers(!0,!0),t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.registerPageParams=function(){this.pageParams=this.containerWidget.partialParams},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.invokeOnReady=function(){var e;this.containerWidget.userComponentParams&&(e=this.containerWidget.userComponentParams),this.onReady(e),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment()},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.partialDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.onReady=function(e){},t}(te);ie.decorators=[{type:t.Directive}],ie.propDecorators={partialDirective:[{type:t.ViewChild,args:[c.PartialDirective]}]};var oe="_cache_page",ae="REUSE_ROUTE_STRATEGY.MAX_CACHE_SIZE",re="REUSE_ROUTE_STRATEGY.MAX_CACHE_AGE",se=function(){function e(e,t){var n=this;this.maxCacheSize=e,this.maxCacheAge=t,this.paramsToIgnore=["wm_state",oe],this.getSize=function(e){return e?Object.keys(e).length:0},this.cache=new o.LRUCache(e,t,(function(e,t){n.currentRouteKey===e?n.cache.set(e,t):t.componentRef.destroy()}))}return e.prototype.getKey=function(e){var t=this,n=_.chain(e.queryParams).keys().filter((function(e){return!_.includes(t.paramsToIgnore,e)})).orderBy().map((function(t){return t+"="+e.queryParams[t]})).value().join("&"),i=e.params.pageName;return e.data.pageName&&""===e.routeConfig.path&&(i=e.data.pageName),i&&i+(n?"?"+n:"")},e.prototype.isSameQueryParams=function(e,t){try{var n=e.queryParams,i=t.queryParams,o=n?this.getSize(n):0,a=i?this.getSize(i):0;return 0===o&&0===a||o===a&&JSON.stringify(n)===JSON.stringify(i)}catch(e){return!1}},e.prototype.isCacheEnabled=function(e,t){var n=e.queryParams._cache_page;return _.isNil(n)?t:"true"===n||!0===n},e.prototype.shouldDetach=function(e){var t=this.getKey(e);return!!this.isCacheEnabled(e,!!e.data._cache_page)||(this.cache.delete(t),!1)},e.prototype.shouldAttach=function(e){var t=this.getKey(e);this.currentRouteKey=t;var n=this.cache.get(t);return!(!n||!this.isCacheEnabled(e,!!n._cache_page))||(this.cache.delete(t),!1)},e.prototype.store=function(e,t){if(t){var n=this.getKey(e);t._cache_page=!!e.data._cache_page,this.cache.set(n,t)}},e.prototype.retrieve=function(e){var t=this.getKey(e);return this.cache.get(t)},e.prototype.reset=function(e){var t,n,i=this;if(!e)return this.cache.clear();this.cache.delete(e);var o=e+="?",a=[];try{for(var r=J(this.cache.keys()),s=r.next();!s.done;s=r.next()){var l=s.value;l.startsWith(o)&&a.push(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}a.forEach((function(e){return i.cache.delete(e)}))},e}(),le=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){if(e.routeConfig&&"prefab-preview"===e.routeConfig.path)return!1;var n=e.params,i=t.params,o=this.getSize(n),a=this.getSize(i);return 0===o&&0===a||o===a&&(n.pageName===i.pageName&&this.isSameQueryParams(e,t))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);le.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var ce=function(e){function t(t,n){return e.call(this,t,n)||this}return K(t,e),t.prototype.isSameRoute=function(e,t){return!e.routeConfig&&!t.routeConfig||e.routeConfig===t.routeConfig&&(e.routeConfig!==t.routeConfig||(!(!e.data.layoutName||!t.data.layoutName)||this.isSameQueryParams(e,t)))},t.prototype.shouldReuseRoute=function(e,t){return this.isSameRoute(e,t)},t}(se);ce.ctorParameters=function(){return[{type:Number,decorators:[{type:t.Inject,args:[ae]}]},{type:Number,decorators:[{type:t.Inject,args:[re]}]}]};var pe=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.pageDirective&&e.pageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.pageDirective&&(this.$page=this.pageDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.pageDirective||!this.pageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.pageDirective&&this.pageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})}))},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);pe.lastPageSnapShot=null,pe.decorators=[{type:t.Directive}],pe.propDecorators={pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]};var de=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.compileContent=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t}return K(t,e),t.prototype.getContainerWidgetInjector=function(){return this.containerWidget.inj||this.containerWidget.injector},t.prototype.init=function(){var t=this;this.App=this.injector.get(o.App),this.containerWidget=this.injector.get(c.WidgetRef),this.prefabMngr=this.injector.get(H),this.i18nService=this.injector.get(o.AbstractI18nService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.Viewport=this.injector.get(o.Viewport),this.getContainerWidgetInjector().view.component.registerFragment&&this.getContainerWidgetInjector().view.component.registerFragment(),this.spa?this.pageDirective=this.injector.get(s.SpaPageDirective,null):this.pageDirective=this.injector.get(s.PageDirective,null),this.pageDirective&&(this.registerDestroyListener(this.pageDirective.subscribe("attach",(function(e){return t.ngOnAttach(e.refreshData)}))),this.registerDestroyListener(this.pageDirective.subscribe("detach",(function(){return t.ngOnDetach()})))),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.registerProps(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets={},this.Widgets={},this.containerWidget.Widgets=this.Widgets},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating prefab ("+this.prefabName+") script\n",e)}},t.prototype.registerChangeListeners=function(){this.containerWidget.registerPropertyChangeListener(this.onPropertyChange),this.containerWidget.registerStyleChangeListener(this.onPropertyChange)},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getPrefabLocaleBundle(this.prefabName)},t.prototype.registerProps=function(){var e=this;this.prefabMngr.getConfig(this.prefabName).then((function(t){t&&(e.displayName=t.displayName,Object.entries(t.properties||{}).forEach((function(t){var n,i=X(t,2),a=i[0],r=i[1],s=_.trim(r.value);_.startsWith(s,"bind:")&&(n=s.replace("bind:","")),Object.defineProperty(e,a,{get:function(){return e.containerWidget[a]},set:function(t){return e.containerWidget.widget[a]=t}}),n&&e.registerDestroyListener(o.$watch(n,e,{},(function(t){return e.containerWidget.widget[a]=t})))})),Object.entries(t.events||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=i.substr(2).toLowerCase();e.containerWidget.invokeEventCallback(o,{$event:t[0],$data:t[1]})}})),Object.entries(t.methods||{}).forEach((function(t){var n=X(t,2),i=n[0];n[1];e.containerWidget[i]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if(e[i])return e[i].apply(e,t)}catch(t){console.warn("error in executing prefab-"+e.prefabName+" method-"+i)}}}))),e.containerWidget.setProps(t),o.isIE()&&(e.containerWidget.widget=e.containerWidget.createProxy())}))},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.prefabName,this.getVariables(),this);this.Variables={},this.Actions={},this.containerWidget.Variables=this.Variables,this.containerWidget.Actions=this.Actions,Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o})),this.viewInit$.subscribe(o.noop,o.noop,(function(){t.callback(t.Variables).catch(o.noop),t.callback(t.Actions)}))},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.invokeOnReady=function(){o.$invokeWatchers(!0,!0),this.onReady(),this.getContainerWidgetInjector().view.component.resolveFragment&&this.getContainerWidgetInjector().view.component.resolveFragment(),this.containerWidget.invokeEventCallback("load")},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.prefabContainerDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(){var e=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.ngOnAttach=function(e){if(this.unmute(),e){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}_.each(this.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()}))},t.prototype.ngOnDetach=function(){this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()}))},t.prototype.ngAfterViewInit=function(){var e=this;this.loadScripts().then((function(){e.compileContent=!0,e.registerChangeListeners(),setTimeout((function(){e.viewInit$.complete(),e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){return e.invokeOnReady()}))}),100)}))},t.prototype.ngOnDestroy=function(){this.destroy$.complete()},t.prototype.onPropertyChange=function(){},t.prototype.onReady=function(){},t}(te);de.decorators=[{type:t.Directive}],de.propDecorators={prefabContainerDirective:[{type:t.ViewChild,args:[p.PrefabContainerDirective]}]};var ue=function(){function e(){}return e.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;setTimeout((function(){e.overrideRouterOutlet()}),10)},e.prototype.init=function(){this.App=this.injector.get(o.App),this.App.activeLayoutName=this.layoutName,this.App.layoutPages=this.layoutPages,this.registerExpressions()},e.prototype.ngOnDestroy=function(){},e.prototype.canReuse=function(){},e.prototype.ngOnAttach=function(){},e.prototype.ngOnDetach=function(){},e.prototype.onActivate=function(e){_.extend(this,e)},e}();ue.decorators=[{type:t.Directive}],ue.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],pageDirective:[{type:t.ViewChild,args:[s.PageDirective]}]};var he,me=function(e){function t(){var t=e.apply(this,ee([],X(arguments)))||this;return t.startupVariablesLoaded=!1,t.pageTransitionCompleted=!1,t.destroy$=new l.Subject,t.viewInit$=new l.Subject,t.formatsByLocale={timezone:""},t}return K(t,e),t.prototype.init=function(){o.muteWatchers(),this.App=this.injector.get(o.App),this.route=this.injector.get(n.ActivatedRoute),this.appManager=this.injector.get(j),this.navigationService=this.injector.get(o.AbstractNavigationService),this.scriptLoaderService=this.injector.get(o.ScriptLoaderService),this.i18nService=this.injector.get(o.AbstractI18nService),this.router=this.injector.get(n.Router),this.Viewport=this.injector.get(o.Viewport),this.layoutDirective=this.injector.get(s.LayoutDirective),this.registerExpressions(),this.initUserScript(),this.registerWidgets(),this.initVariables(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.registerPageParams(),this.defineI18nProps(),e.prototype.init.call(this)},t.prototype.registerWidgets=function(){this.Widgets=Object.create(ne),this.App.Widgets=Object.create(this.Widgets)},t.prototype.initUserScript=function(){try{this.evalUserScript(this,this.App,this.injector.get(o.UtilsService))}catch(e){console.error("Error in evaluating page ("+this.pageName+") script\n",e)}},t.prototype.registerPageParams=function(){var e=this,t=this.route.queryParams.subscribe((function(t){return e.pageParams=e.App.pageParams=_.extend({},t)}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.registerDestroyListener=function(e){this.destroy$.subscribe(o.noop,o.noop,(function(){return e()}))},t.prototype.defineI18nProps=function(){this.appLocale=this.i18nService.getAppLocale()},t.prototype.initVariables=function(){var e=this,t=this.injector.get(r.VariablesService).register(this.pageName,this.getVariables(),this);this.Variables=Object.create(this.App.Variables),this.Actions=Object.create(this.App.Actions),Object.entries(t.Variables).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Variables[i]=o})),Object.entries(t.Actions).forEach((function(t){var n=X(t,2),i=n[0],o=n[1];return e.Actions[i]=o}));var n=this.viewInit$.subscribe(o.noop,o.noop,(function(){e.appManager.isAppVariablesFired()||(t.callback(e.App.Variables).catch(o.noop).then((function(){e.appManager.notify("app-variables-data-loaded",{pageName:e.pageName})})),t.callback(e.App.Actions),e.appManager.appVariablesReady(),e.appManager.isAppVariablesFired(!0)),t.callback(t.Variables).catch(o.noop).then((function(){e.appManager.notify("page-variables-data-loaded",{pageName:e.pageName}),e.startupVariablesLoaded=!0,setTimeout((function(){e.showPageContent=!0}),100)})),t.callback(t.Actions),n.unsubscribe()}))},t.prototype.setTimezone=function(e){this.i18nService.setTimezone(e,this)},t.prototype.registerExpressions=function(){var e=this.getExpressions();_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},t.prototype.runPageTransition=function(e){var n=this;e=e||this.navigationService.getPageTransition();var i=t.lastPageSnapShot;return new Promise((function(t){if(e&&!e.startsWith("none")&&i){var o=i.parent(),a=function(n){!t||n&&n.pseudoElement||(o.off("animationend",a),o.removeClass(e),o.children().first().remove(),t(),t=null)};e="page-transition page-transition-"+e,i.addClass("page-exit"),n.$page.addClass("page-entry"),o.addClass(e),o.on("animationend",a),setTimeout(a,1e3)}else t()})).then((function(){n.$page&&n.$page.removeClass("page-entry"),i&&(i.remove(),t.lastPageSnapShot=null),n.pageTransitionCompleted=!0}))},t.prototype.invokeOnReady=function(){this.onReady(),this.appManager.notify("highlightActiveLink",{pageName:this.pageName}),this.appManager.notify("pageReady",{name:this.pageName,instance:this}),(this.App.onPageReady||o.noop)(this.pageName,this)},t.prototype.loadScripts=function(){var e=this;return new Promise((function(t){var n,i=e.spaPageDirective&&e.spaPageDirective.$element.attr("scripts-to-load");i?(n=e.scriptLoaderService).load.apply(n,ee([],X(i.split(",")))).then(t):t()}))},t.prototype.restoreLastPageSnapshot=function(){o.isMobileApp()&&t.lastPageSnapShot&&this.$page&&this.$page.parent().prepend(t.lastPageSnapShot)},t.prototype.savePageSnapShot=function(){t.lastPageSnapShot&&t.lastPageSnapShot.remove(),o.isMobileApp()&&this.$page&&(t.lastPageSnapShot=this.$page.clone(),this.$page.parents("app-root").prepend(t.lastPageSnapShot))},t.prototype.saveScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t),i&&t.children().each((function(t,i){return e($(i),n)}));var a=o.scrollLeft(),r=o.scrollTop();(a>0||r>0)&&t.attr(n,a+","+r)};e(this.$page,"data-scroll-position"),this.$page.attr("data-window-scroll-position",window.scrollX+","+window.scrollY)},t.prototype.restoreScrollPosition=function(){var e=function(t,n,i,o){void 0===i&&(i=!0),void 0===o&&(o=t);var a=(t.attr(n)||"").split(",");a.length>1&&(o.scrollLeft(a[0]),o.scrollTop(a[1])),t.removeAttr(n),i&&t.children().each((function(t,i){return e($(i),n)}))};e(this.$page,"data-scroll-position"),e(this.$page,"data-window-scroll-position",!1,$(window))},t.prototype.canDeactivate=function(){var e;return!1!==(e=this.onBeforePageLeave())&&(e=(this.App.onBeforePageLeave||o.noop)(this.App.activePageName,this.App.activePage)),void 0===e||e},t.prototype.ngAfterViewInit=function(){var e=this;this.route.snapshot.data._cache_page=this.canReuse(),this.layoutDirective&&(this.$page=this.layoutDirective.$element.parent(),o.isIos()&&this.$page.addClass("ios-page"),o.isAndroid()&&this.$page.addClass("android-page")),this.restoreLastPageSnapshot(),this.loadScripts().then((function(){e.runPageTransition().then((function(){e.compilePageContent=!0,setTimeout((function(){e.onPageContentReady=function(){e.fragmentsLoaded$.subscribe(o.noop,o.noop,(function(){e.invokeOnReady()})),o.unMuteWatchers(),e.viewInit$.complete(),e.onPageContentReady=o.noop}}),0)}))}))},t.prototype.ngOnDestroy=function(){this.savePageSnapShot(),this.destroy$.complete()},t.prototype.onReady=function(){},t.prototype.onBeforePageReady=function(){},t.prototype.onBeforePageLeave=function(){},t.prototype.onPageContentReady=function(){},t.prototype.canReuse=function(){return!(!this.spaPageDirective||!this.spaPageDirective.cache)},t.prototype.mute=function(){var e=function(e){e&&e.mute&&e.mute()};_.each(this.Widgets,e),_.each(this.Variables,e),_.each(this.Actions,e)},t.prototype.unmute=function(e){void 0===e&&(e=this);var t=function(e){e&&e.unmute&&e.unmute()};_.each(this.Widgets,t),_.each(this.Variables,t),_.each(this.Actions,t)},t.prototype.ngOnAttach=function(){var e=this;if(this.route.snapshot.data._cache_page=this.canReuse(),this.registerPageParams(),this.App.lastActivePageName=this.App.activePageName,this.App.activePageName=this.pageName,this.App.activePage=this,this.activePageName=this.pageName,this.restoreLastPageSnapshot(),this.unmute(),this.App.Widgets=Object.create(this.Widgets),this.spaPageDirective&&this.spaPageDirective.refreshdataonattach){var t=function(e){e&&e.startUpdate&&e.invoke&&e.invoke()};_.each(this.Variables,t),_.each(this.Actions,t)}this.runPageTransition().then((function(){setTimeout((function(){return e.restoreScrollPosition()}),100),_.each(e.Widgets,(function(e){return e&&e.ngOnAttach&&e.ngOnAttach()})),e.appManager.notify("pageAttach",{name:e.pageName,instance:e})})),this.appManager.notify("highlightActiveLink",{pageName:this.pageName})},t.prototype.ngOnDetach=function(){this.saveScrollPosition(),this.savePageSnapShot(),this.mute(),_.each(this.Widgets,(function(e){return e&&e.ngOnDetach&&e.ngOnDetach()})),this.appManager.notify("pageDetach",{name:this.pageName,instance:this})},t.prototype.ngAfterContentInit=function(){this.onBeforePageReady()},t.clear=function(){t.lastPageSnapShot&&(t.lastPageSnapShot.remove(),t.lastPageSnapShot=null)},t}(te);me.lastPageSnapShot=null,me.decorators=[{type:t.Directive}],me.propDecorators={spaPageDirective:[{type:t.ViewChild,args:[s.SpaPageDirective]}],canDeactivate:[{type:t.HostListener,args:["window:beforeunload"]}]},function(e){e.EVERYONE="Everyone",e.ANONYMOUS="Anonymous",e.AUTHENTICATED="Authenticated"}(he||(he={}));var fe=function(){function e(e,t,n,i){this.templateRef=e,this.viewContainerRef=t,this.securityService=n,this.inj=i,this.processed=!1;var o=this.securityService.get();this.securityEnabled=_.get(o,"securityEnabled"),this.isUserAuthenticated=_.get(o,"authenticated"),this.userRoles=_.get(o,"userInfo.userRoles")}return e.prototype.getWidgetRolesArrayFromStr=function(e){var t=/,/g;return""===(e=e||"")?[]:_.split(e,",").map((function(e){return _.trim(e).replace(t,",")}))},e.prototype.matchRoles=function(e,t){return e.some((function(e){return _.includes(t,e)}))},e.prototype.hasAccessToWidget=function(e,t){return!!_.includes(e,he.EVERYONE)||(!(!_.includes(e,he.ANONYMOUS)||this.isUserAuthenticated)||(!(!_.includes(e,he.AUTHENTICATED)||!this.isUserAuthenticated)||this.isUserAuthenticated&&this.matchRoles(e,t)))},Object.defineProperty(e.prototype,"accessroles",{set:function(e){if(!this.processed){this.processed=!0;var t=this.getWidgetRolesArrayFromStr(e);!this.securityEnabled||this.hasAccessToWidget(t,this.userRoles)?this.viewContainerRef.createEmbeddedView(this.templateRef,this.inj.view.context):this.viewContainerRef.clear()}},enumerable:!1,configurable:!0}),e}();fe.decorators=[{type:t.Directive,args:[{selector:"[accessroles]"}]}],fe.ctorParameters=function(){return[{type:t.TemplateRef},{type:t.ViewContainerRef},{type:a.SecurityService},{type:t.Injector}]},fe.propDecorators={accessroles:[{type:t.Input}]};var ge=function(){};ge.decorators=[{type:t.Component,args:[{selector:"app-spinner",template:'\n <div class="app-spinner" [ngClass]="classname" *ngIf="show">\n <div class="spinner-message">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p *ngFor="let value of spinnermessages" [textContent]="value"></p>\n </div>\n </div>\n </div>\n '}]}],ge.ctorParameters=function(){return[]},ge.propDecorators={show:[{type:t.Input}],spinnermessages:[{type:t.Input}],classname:[{type:t.Input}],arialabel:[{type:t.Input}]};var ve=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.toastrService=t,i.toastPackage=n,i.watchers=[],i.params={},i.pagename=i.message||"",i.generateParams(),i}return K(t,e),t.prototype.generateParams=function(){var e=this;_.forEach(this.options.partialParams,(function(t){_.isString(t.value)&&0===t.value.indexOf("bind:")?e.watchers.push(o.$watch(t.value.substr(5),e.options.context,{},(function(n){e.params[t.name]=n,o.$appDigest()}))):e.params[t.name]=t.value}))},t.prototype.generateDynamicComponent=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){return e=$(".parent-custom-toast"),this.customToastRef.clear(),e[0].appendChild(this.customToastRef.createEmbeddedView(this.customToastTmpl).rootNodes[0]),[2]}))}))},t.prototype.ngAfterViewInit=function(){this.generateDynamicComponent()},t.prototype.ngOnDestroy=function(){_.forEach(this.watchers,(function(e){return e()})),e.prototype.ngOnDestroy.call(this)},t}(h.Toast);ve.decorators=[{type:t.Component,args:[{selector:"[custom-toaster-component]",template:'\n <div class="parent-custom-toast"></div>\n <ng-container #customToast></ng-container>\n <ng-template #customToastTmpl>\n <div wmContainer partialContainer content.bind="pagename">\n <div *ngFor="let param of params | keyvalue" wmParam hidden\n [name]="param.key" [value]="param.value"></div>\n </div>\n </ng-template>',preserveWhitespaces:!1}]}],ve.ctorParameters=function(){return[{type:h.ToastrService},{type:h.ToastPackage}]},ve.propDecorators={customToastRef:[{type:t.ViewChild,args:["customToast",{static:!0,read:t.ViewContainerRef}]}],customToastTmpl:[{type:t.ViewChild,args:["customToastTmpl"]}]};var ye=function(){function e(e,t,n,i,o){this.route=e,this.securityService=t,this.router=n,this.app=i,this.appManger=o}return e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.router.navigate(["prefab-preview"]):this.app.isApplicationType?this.securityService.getPageByLoggedInUser().then((function(t){e.router.navigate([t])})):(this.router.navigate([o.getWmProjectProperties().homePage]),this.appManger.postAppTypeInfo())},e}();ye.decorators=[{type:t.Component,args:[{selector:"app-empty-page",template:"<div></div>"}]}],ye.ctorParameters=function(){return[{type:n.ActivatedRoute},{type:a.SecurityService},{type:n.Router},{type:o.App},{type:j}]};var be=function(t,n,i,o,a,r,s){var l=this;this.componentInstance=t,this.vcRef=n,this.elRef=i,this.prefabMngr=o,this.resolver=a,this.injector=r,this.componentRefProvider=s;var c=this.componentInstance.prefabName;this.prefabMngr.loadDependencies(c).then((function(){return Q(l,void 0,void 0,(function(){var t,n;return Z(this,(function(i){switch(i.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(c,e.ComponentType.PREFAB)];case 1:return(t=i.sent())&&(n=this.vcRef.createComponent(t,0,r),this.elRef.nativeElement.appendChild(n.location.nativeElement)),[2]}}))}))}))};be.decorators=[{type:t.Directive,args:[{selector:"[wmPrefab][prefabname]"}]}],be.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Self},{type:t.Inject,args:[c.WidgetRef]}]},{type:t.ViewContainerRef},{type:t.ElementRef},{type:H},{type:t.ComponentFactoryResolver},{type:t.Injector},{type:N}]};var we={DialogService:o.AbstractDialogService,i18nService:o.AbstractI18nService,statePersistence:o.StatePersistence,SpinnerService:o.AbstractSpinnerService,StatePersistenceService:o.StatePersistence,Viewport:o.Viewport,ToasterService:o.AbstractToasterService,Utils:o.UtilsService,CONSTANTS:o.ConstantService,FIELD_TYPE:o.FieldTypeService,FIELD_WIDGET:o.FieldWidgetService,DynamicComponentService:o.DynamicComponentRefProvider},Pe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},_e=function(){var e=this.httpService,t=function(t,n){var i=Array.from(arguments).slice(1);return Promise.resolve(e[t].apply(e,i))},n=function(){return t.apply(void 0,ee(["send"],X(Array.from(arguments))))};return["get","post","head","put","delete","jsonp","patch"].forEach((function(e){return n[e]=t.bind(void 0,e)})),n},Oe=function(){function e(e,t,n,i,a,r){this.inj=e,this.i18nService=t,this.statePersistence=n,this.httpService=i,this.securityService=a,this.routeReuseStrategy=r,this.Variables={},this.Actions={},this.onAppVariablesReady=Pe,this.onBeforeAppReady=Pe,this.onSessionTimeout=Pe,this.onPageReady=Pe,this.onBeforePageLeave=Pe,this.onBeforeServiceCall=Pe,this.onServiceSuccess=Pe,this.onServiceError=Pe,this.dynamicComponentContainerRef={},this.changeLocale=this.i18nService.setSelectedLocale.bind(this.i18nService),this.getSelectedLocale=this.i18nService.getSelectedLocale.bind(this.i18nService),this.setTimezone=this.i18nService.setTimezone.bind(this.i18nService),this.setwidgetLocale=this.i18nService.setwidgetLocale.bind(this.i18nService),this._eventNotifier=new o.EventNotifier,this.landingPageName=o.getWmProjectProperties().homePage;var s=o.getWmProjectProperties();this.projectName=s.name,this.isPrefabType="PREFAB"===s.type,this.isApplicationType="APPLICATION"===s.type,this.isTemplateBundleType="TEMPLATEBUNDLE"===s.type,this.targetPlatform=s.platformType,this.httpService.registerOnSessionTimeout(this.on401.bind(this)),this.appLocale=this.i18nService.getAppLocale(),this.httpService.setLocale(this.appLocale)}return e.prototype.reload=function(){window.location.reload()},e.prototype.clearPageCache=function(e){this.routeReuseStrategy instanceof se&&this.routeReuseStrategy.reset(e)},e.prototype.notify=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this._eventNotifier.notify.apply(this._eventNotifier,arguments)},e.prototype.getDependency=function(e){if(o.isString(e)){if("HttpService"===e)return _e.call(this);var t=we[e]&&this.inj.get(we[e]);return!t&&this.inj._providers&&_.forEach(this.inj._providers,(function(n){if(_.isObject(n)&&n.__proto__.constructor.SERVICE_NAME===e)return t=n,!1})),t}return this.inj.get(e)},e.prototype.on401=function(){var e=_.get(this.securityService.get(),"userInfo");_.isEmpty(e)||this.onSessionTimeout()},e.prototype.subscribe=function(e,t){return this._eventNotifier.subscribe(e,t)},e.prototype.notifyApp=function(e,t,n){var i=_.get(this,"Actions.appNotification"),a=-1!==["PROCESS_REJECTED_IN_QUEUE"].indexOf(e);if(i){if(a)return void console.warn("App Error",e);t=t||"success",e=i.getMessage()||e,i.invoke({message:e,title:o.isDefined(n)?n:t.toUpperCase(),class:t,duration:"ERROR"===t.toUpperCase()?0:void 0})}else console.warn('The default Action "appNotification" doesn\'t exist in the app. App notified following error:\n',e)},e.prototype.registerExpressions=function(e){_.each(e,(function(e,t){o.registerFnByExpr(t,e[0],e[1])}))},e}();Oe.decorators=[{type:t.Injectable}],Oe.ctorParameters=function(){return[{type:t.Injector},{type:o.AbstractI18nService},{type:o.StatePersistence},{type:o.AbstractHttpService},{type:a.SecurityService},{type:n.RouteReuseStrategy}]};var Ee=function(e){function t(t){var n=e.call(this)||this;return n.toaster=t,n}return K(t,e),t.prototype._showToaster=function(e,t,n,i){if(_.isNumber(i)&&(i={timeOut:i}),(i=i||{}).timeOut=o.isDefined(i.timeOut)?i.timeOut:0,i.enableHtml=o.isDefined(i.enableHtml),i.positionClass=i.positionClass||"toast-bottom-right",i.toastClass="toast",t||n){!i.bodyOutputType&&_.isObject(n)&&(n=JSON.stringify(n));var a=this.toaster[e];if(a)return a.call(this.toaster,n,t,i)}},t.prototype.success=function(e,t){return this._showToaster("success",e,t,{timeOut:5e3})},t.prototype.error=function(e,t){return this._showToaster("error",e,t,{timeOut:0})},t.prototype.info=function(e,t){return this._showToaster("info",e,t,{timeOut:0})},t.prototype.warn=function(e,t){return this._showToaster("warning",e,t,{timeOut:0})},t.prototype.show=function(e,t,n,i){return this._showToaster(e,t,n,i)},t.prototype.hide=function(e){e?this.toaster.clear(e.toastId):this.toaster.clear()},t.prototype.showCustom=function(e,t){if(e)return(t=t||{}).toastComponent=ve,t.toastClass="custom-toaster",t.timeOut=o.isDefined(t.timeOut)?t.timeOut:0,t.enableHtml=o.isDefined(t.enableHtml),t.positionClass=t.positionClass||"toast-bottom-right",t.toastClass="toast",this.toaster.show(e,"",t)},t.prototype.setToasterConfig=function(e){_.isObject(e)?_.merge(this.toaster.toastrConfig,e):console.warn("Please pass a valid options object, For Example : {maxOpened: 1, autoDismiss: true}")},t}(o.AbstractToasterService);Ee.decorators=[{type:t.Injectable}],Ee.ctorParameters=function(){return[{type:h.ToastrService}]};var Re=["ar","ar-001","ar-ae","ar-bh","ar-dz","ar-eg","ar-iq","ar-jo","ar-kw","ar-lb","ar-ly","ar-ma","ar-om","ar-qa","ar-sa","ar-sd","ar-sy","ar-tn","ar-ye","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","pnb","ps","sd","ug","ur","yi"],Ae=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.$http=t,a.bsLocaleService=n,a.appDefaults=i,a.inj=o,a.defaultSupportedLocale="en",a._isAngularLocaleLoaded=!1,a.formatsByLocale={timezone:"",number:""},a.appLocale={},a.prefabLocale=new Map,a}return K(t,e),Object.defineProperty(t.prototype,"app",{get:function(){return this.inj.get(o.App)},enumerable:!1,configurable:!0}),t.prototype.updateLocaleDirection=function(){var e="ltr";Re.includes(this.selectedLocale)&&(e="rtl"),o.setCSS(document.body,"direction",e)},t.prototype.init=function(){this.messages={},Object.setPrototypeOf(this.appLocale,this.messages)},t.prototype.getSelectedLocale=function(){return this.selectedLocale},t.prototype.getDefaultSupportedLocale=function(){return this.defaultSupportedLocale},t.prototype.getAppLocale=function(){return this.appLocale},t.prototype.getPrefabLocaleBundle=function(e){return this.prefabLocale.has(e)||this.prefabLocale.set(e,Object.create(this.appLocale)),this.prefabLocale.get(e)},t.prototype.extendPrefabMessages=function(e){var t=this;e.prefabMessages&&Object.keys(e.prefabMessages).forEach((function(n){var i=t.prefabLocale.get(n);i||(i=Object.create(t.appLocale),t.prefabLocale.set(n,i)),Object.assign(i,e.prefabMessages[n])}))},t.prototype.extendMessages=function(e){Object.assign(this.messages,e)},t.prototype.loadResource=function(e){return this.$http.get(e).toPromise().catch((function(){console.warn("error loading locale resource from "+e),Promise.resolve({})}))},t.prototype.loadAppLocaleBundle=function(){var e=this;this.loadResource("resources/i18n/"+this.selectedLocale+".json").then((function(t){e.extendMessages(t.messages),e.extendPrefabMessages(t),e.appDefaults.setFormats(t.formats)}))},t.prototype.loadMomentLocaleBundle=function(e){var t=this,n=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(this.selectedLocale!==this.defaultSupportedLocale){var i=n+"locales/moment/"+e+".js";o.loadScripts([i],!0).then((function(){moment.locale(t.selectedLocale);var n=moment.localeData(e);n=n&&n._config,w.defineLocale(t.selectedLocale,n),t.bsLocaleService.use(t.getSelectedLocale()||t.defaultSupportedLocale)}))}else moment.locale(this.defaultSupportedLocale)},t.prototype.loadAngularLocaleBundle=function(e){var t=this;return new Promise((function(n){var i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;if(t.selectedLocale!==t.defaultSupportedLocale){var a=i+"locales/angular/global/"+e+".js";o.loadScripts([a],!0).then((function(){t._isAngularLocaleLoaded=!0,n()}),n)}else n()}))},t.prototype.loadCalendarLocaleBundle=function(e,t){void 0===t&&(t=!1);var n,i=o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest;return e?(n=i+"locales/fullcalendar/"+e+".js",t||!o.isMobile()&&!o.isMobileApp()&&this.selectedLocale!==this.defaultSupportedLocale?o.loadScripts([n],!0):void 0):Promise.resolve()},t.prototype.loadMomentTimeZoneBundle=function(e,t){var n=this;return new Promise((function(i){var a=(o._WM_APP_PROJECT.cdnUrl||o._WM_APP_PROJECT.ngDest)+"locales/moment-timezone/moment-timezone-with-data.js";o.loadScripts([a],!0).then((function(){var o=e,a=(e=o.timezone).indexOf("+");a>-1&&(a>0&&(e=e.substr(a)),o.timezone=_.find(moment.tz.names(),(function(t){return e===moment.tz(t).format("Z")})));var r=t&&t.formatsByLocale?t.formatsByLocale:n.formatsByLocale;Object.assign(r,o),i()}),i)}))},t.prototype.loadLocaleBundles=function(e){return e.moment&&this.loadMomentLocaleBundle(e.moment),e.fullCalendar&&window.FullCalendar&&this.loadCalendarLocaleBundle(e.fullCalendar),e.angular&&this.loadAppLocaleBundle(),this.loadAngularLocaleBundle(e.angular)},t.prototype.setTimezone=function(e,t){this.loadMomentTimeZoneBundle(e,t)},t.prototype.getTimezone=function(e){var t=_.get(this.app,"activePage.formatsByLocale.timezone"),n=_.get(e,"formatsByLocale.timezone");return n||(t||this.formatsByLocale.timezone)},t.prototype.getFormatsByLocale=function(){return this.formatsByLocale},t.prototype.setSelectedLocale=function(e){var t=this;_.isObject(e)&&(e=e.datavalue);var n=o.getWmProjectProperties().supportedLanguages[e],i=Object.keys(o.getWmProjectProperties().supportedLanguages);return _.includes(i,e)&&e&&e!==this.selectedLocale?(o.setSessionStorageItem("selectedLocale",e),this.selectedLocale=e,this.init(),this.loadLocaleBundles(n).then((function(){return t.updateLocaleDirection()}))):Promise.resolve()},t.prototype.deduceAppLocale=function(){var e=this.getAcceptedLanguages(),t=o.getWmProjectProperties().defaultLanguage;e.push(t);var n=o.getWmProjectProperties().preferBrowserLang;n=!n||("true"===n||!0===n);var i,a=Object.keys(o.getWmProjectProperties().supportedLanguages)||[this.defaultSupportedLocale],s=n?void 0:t;if(r.CONSTANTS.hasCordova){var l=[];_.forEach(e,(function(e){var t=_.find(a,(function(t){return e===t}))||_.find(a,(function(t){return e.startsWith(t)}));t&&l.push(t)})),i=l[0]}var c=o.getSessionStorageItem("selectedLocale")||s||i||_.intersection(e,a)[0]||this.defaultSupportedLocale;return a=a||[c],c||a[0]},t.prototype.loadDefaultLocale=function(){var e=this.deduceAppLocale();return this.setSelectedLocale(e)},t.prototype.getLocalizedMessage=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return o.replace(this.appLocale[e],t)},t.prototype.getAcceptedLanguages=function(){var e;return e=r.CONSTANTS.hasCordova?navigator.languages||[navigator.language]:(e=decodeURIComponent(o.getWmProjectProperties().preferredLanguage||"")).split(",").map((function(e){return e.split(";")[0]})),_.map(e,_.toLower)},t.prototype.initCalendarLocale=function(){return"en"!==this.selectedLocale?this.loadCalendarLocaleBundle(this.selectedLocale,!0):Promise.resolve()},t.prototype.isAngularLocaleLoaded=function(){return this._isAngularLocaleLoaded},t.prototype.setwidgetLocale=function(e){this.formatsByLocale.number=e.number},t.prototype.getwidgetLocale=function(){return this.formatsByLocale},t}(o.AbstractI18nService);Ae.decorators=[{type:t.Injectable}],Ae.ctorParameters=function(){return[{type:d.HttpClient},{type:P.BsLocaleService},{type:o.AppDefaults},{type:t.Injector}]};var Te=function(e){function t(){var t=e.call(this)||this;return t.spinnerId=0,t.messageSource=new l.Subject,t.messagesByContext={},t}return K(t,e),t.prototype.getMessageSource=function(){return this.messageSource},t.prototype.showContextSpinner=function(e,t,n){var i=$('[name="'+e+'"]');if(this.messagesByContext[e]=this.messagesByContext[e]||{},0!==Object.keys(this.messagesByContext[e]).length)this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e].finalMessage+" "+this.messagesByContext[e][n],i.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage);else{var o=$('<div class="app-spinner">\n <div class="spinner-message" aria-label="loading gif">\n <i class="spinner-image animated infinite fa fa-circle-o-notch fa-spin"></i>\n <div class="spinner-messages">\n <p class="spinner-messages-container"></p>\n </div>\n </div>\n </div>');this.messagesByContext[e][n]=t,this.messagesByContext[e].finalMessage=this.messagesByContext[e][n],o.find(".spinner-messages-container").html(this.messagesByContext[e].finalMessage),i.prepend(o)}return n},t.prototype.showAppSpinner=function(e,t){this.messagesByContext.page=this.messagesByContext.page||{},this.messagesByContext.page[t]=e,this.messageSource.next({show:!0,message:e,messages:_.values(this.messagesByContext.page)})},t.prototype.hideContextSpinner=function(e,t){delete this.messagesByContext[e][t],1===Object.keys(this.messagesByContext[e]).length&&(this.messagesByContext[e]={}),$('[name="'+e+'"]').find(".app-spinner").remove()},t.prototype.show=function(e,t,n,i,o){return t=t||++this.spinnerId,i&&"page"!==i?this.showContextSpinner(i,e,t):(this.showAppSpinner(e,t),t)},t.prototype.hide=function(e){var t=_.findKey(this.messagesByContext,(function(t){return _.includes(_.keys(t),e)}))||"page";if("page"===t)if(e){delete this.messagesByContext[t][e];var n=_.values(this.messagesByContext[t]);this.messageSource.next({show:!!n.length,messages:_.values(this.messagesByContext[t])})}else this.messagesByContext[t]={};else this.hideContextSpinner(t,e)},t}(o.AbstractSpinnerService);Te.decorators=[{type:t.Injectable}],Te.ctorParameters=function(){return[]};var Se="body >app-root",Ce=function(){function e(e,t,i){var o=this;this.app=e,this.router=t,this.zone=i,this.history=new De,this.isPageAddedToHistory=!1,this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url,i={},a=void 0;o.isPageAddedToHistory||(o.isPageAddedToHistory=!1,t.indexOf("?")>0?(t.substr(t.indexOf("?")+1).split("&").forEach((function(e){var t=e.split("=");i[t[0]]=t[1]})),a=t.substr(0,t.indexOf("?"))):a=t,"/"===a[0]&&(a=a.substr(1)),a&&(delete i.name,o.history.push(new Ie(a,i,o.transition))))}}))}return e.prototype.getPageTransition=function(){return _.isEmpty(this.transition)||_.isEqual("none",this.transition)?null:this.transition},e.prototype.goToPage=function(e,t){var n=this;this.transition=t.transition||"",this.history.getCurrentPage()&&(this.isPageAddedToHistory=!0),this.history.push(new Ie(e,t.urlParams,this.transition)),this.zone.run((function(){return n.router.navigate(["/"+e],{queryParams:t.urlParams})}))},e.prototype.goToPrevious=function(){this.history.getPagesCount()&&(this.transition=this.history.getCurrentPage().transition,_.isEmpty(this.transition)||(this.transition+="-exit"),this.history.pop(),this.isPageAddedToHistory=!0,window.history.back())},e.prototype.goToView=function(e,t,n){var i=this,o=(t=t||{}).pageName,a=t.transition||"",s=t.$event,l=this.app.activePage,c=n&&n._context&&n._context.prefabName;if(this.app.isPrefabType)this.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n);else if(o===l.activePageName||c)c&&this.isPrefabWithNameExists(c)?this.goToElementView($('[prefabName="'+c+'"]').find('[name="'+e+'"]'),e,o,n):o&&o!==l.activePageName?this.app.notifyApp(r.CONSTANTS.WIDGET_DOESNT_EXIST,"error"):this.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n);else if(this.isPartialWithNameExists(o))this.goToElementView($('[partialcontainer][content="'+o+'"]').find('[name="'+e+'"]'),e,o,n);else{this.goToPage(o,{viewName:e,$event:s,transition:a,urlParams:t.urlParams});var p=this.app.subscribe("pageReady",(function(t){i.goToElementView($(Se).find('[name="'+e+'"]'),e,o,n),p()}))}},e.prototype.goToElementView=function(e,t,n,i){var o,a,r=this,s=this.app.activePage;if(e.length)switch(this.app.isPrefabType||n!==s.activePageName||(e=this.getViewElementInActivePage(e)),(o=e[0].widget).widgetType){case"wm-accordionpane":this.showAncestors(e,i),o.expand();break;case"wm-tabpane":this.showAncestors(e,i),o.select();break;case"wm-segment-content":this.showAncestors(e,i),o.navigate();break;case"wm-panel":o.expanded=!0}else a=this.showAncestorDialog(t),setTimeout((function(){a&&r.goToElementView($('[name="'+t+'"]'),t,n,i)}))},e.prototype.getViewElementInActivePage=function(e){var t;return e.length>1&&(t=_.filter(e,(function(e){if(_.isEmpty($(e).closest('[data-role = "partial"]'))&&_.isEmpty($(e).closest("[wmprefabcontainer]")))return e})))&&(e=$(t)),e},e.prototype.isPartialWithNameExists=function(e){return $('[partialcontainer][content="'+e+'"]').length},e.prototype.isPrefabWithNameExists=function(e){return $('[prefabName="'+e+'"]').length},e.prototype.showAncestors=function(e,t){e.parents('[wm-navigable-element="true"]').toArray().reverse().forEach((function(e){var t=e.widget;switch(t.widgetType){case"wm-accordionpane":t.expand();break;case"wm-tabpane":t.select();break;case"wm-segment-content":t.navigate();break;case"wm-panel":t.expanded=!0}}))},e.prototype.showAncestorDialog=function(e){var t;return $("app-root [dialogtype]").each((function(){var n=$(this);if($(n.html()).find('[name="'+e+'"]').length)return t=n.attr("name"),!1})),t},e}();Ce.decorators=[{type:t.Injectable}],Ce.ctorParameters=function(){return[{type:o.App},{type:n.Router},{type:t.NgZone}]};var Ie=function(){function e(e,t,n){this.name=e,this.urlParams=t,this.transition=n,this.transition=_.isEmpty(this.transition)?null:this.transition}return e.prototype.isEqual=function(e){return e&&e.name===this.name&&_.isEqual(e.urlParams,this.urlParams)},e}(),De=function(){function e(){this.stack=[]}return e.prototype.getCurrentPage=function(){return this.currentPage},e.prototype.getPagesCount=function(){return this.stack.length},e.prototype.isLastVisitedPage=function(e){return this.getLastPage().isEqual(e)},e.prototype.push=function(e){this.currentPage&&this.stack.push(this.currentPage),this.currentPage=e},e.prototype.pop=function(){return this.currentPage=this.stack.pop(),this.currentPage},e.prototype.getLastPage=function(){return this.stack.length>0?this.stack[this.stack.length-1]:void 0},e}(),xe=function(){function e(){}return e.prototype.setFormats=function(e){var t=e.date,n=e.time,i=t&&n?t+" "+n:void 0,o=e.currency;this.dateFormat=t,this.timeFormat=n,this.dateTimeFormat=i,this.currencyCode=o},e}();xe.decorators=[{type:t.Injectable}],xe.ctorParameters=function(){return[]};var Ne=!1,ke=function(){function e(e,t){this.securityService=e,this.appManager=t}return e.prototype.loadSecurityConfig=function(){return Ne?Promise.resolve(!0):this.appManager.loadSecurityConfig().then((function(){return Ne=!0}))},e.prototype.isAuthenticated=function(){var e=this;return this.loadSecurityConfig().then((function(){return new Promise((function(t,n){e.securityService.isAuthenticated(t,n)}))}))},e.prototype.canActivate=function(e){var t=this;return this.isAuthenticated().then((function(n){return n?Promise.resolve(!0):(t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1))}))},e}();ke.decorators=[{type:t.Injectable}],ke.ctorParameters=function(){return[{type:a.SecurityService},{type:j}]};var Me=function(){function e(e,t,n,i,o){this.securityService=e,this.authGuard=t,this.toasterService=n,this.app=i,this.appManager=o}return e.prototype.canActivate=function(e){var t=this,n=e.data.allowedRoles;return this.authGuard.isAuthenticated().then((function(i){if(i){var o=t.securityService.get().userInfo.userRoles;return _.intersection(n,o).length>0?Promise.resolve(!0):(t.appManager.notifyApp(t.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied","error"),Promise.resolve(!1))}return t.appManager.handle401(e.routeConfig.path,{queryParams:e.queryParams}),Promise.resolve(!1)}))},e}();Me.decorators=[{type:t.Injectable}],Me.ctorParameters=function(){return[{type:a.SecurityService},{type:ke},{type:o.AbstractToasterService},{type:o.App},{type:j}]};var Le=function(){function e(e,t){this.app=e,this.appManager=t}return e.prototype.canActivate=function(e){return this.appManager.notifyApp(this.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available","error"),Promise.resolve(!1)},e}();Le.decorators=[{type:t.Injectable}],Le.ctorParameters=function(){return[{type:o.App},{type:j}]};var Fe=!1,je=function(){function e(e,t,n,i){this.inj=e,this.app=t,this.utilService=n,this.appJsProvider=i,this.appManager=this.inj.get(j)}return e.prototype.resolve=function(){return Q(this,void 0,void 0,(function(){var e;return Z(this,(function(t){switch(t.label){case 0:if(Fe)return[2,!0];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.appJsProvider.getAppScriptFn()];case 2:return t.sent()(this.app,this.utilService,this.inj),[3,4];case 3:return e=t.sent(),console.warn("Error in executing app.js",e),[3,4];case 4:return Fe=!0,[2,!0]}}))}))},e}();je.decorators=[{type:t.Injectable}],je.ctorParameters=function(){return[{type:t.Injector},{type:o.App},{type:o.UtilsService},{type:M}]};var Be=!1,Ge=function(){function e(e,t,n){this.appManager=e,this.appJsProvider=t,this.customPipeManager=n}return e.prototype.resolve=function(){return!(!this.appManager.isPrefabType()&&!this.appManager.isTemplateBundleType())||(Be||(this.appJsProvider.loadFormatterConfigScript(this.loadedFormatterScript.bind(this)),Be=!0),Be)},e.prototype.loadedFormatterScript=function(e){try{var t=e;for(var n in t||console.warn("Please return valid formatter object"),t)this.customPipeManager.setCustomPipe(n,t[n])}catch(e){console.warn("Error in reading formatters.js",e)}},e}();Ge.decorators=[{type:t.Injectable}],Ge.ctorParameters=function(){return[{type:j},{type:F},{type:o.CustomPipeManager}]};var $e=function(){function e(e){this.i18nService=e}return e.prototype.resolve=function(){return this.i18nService.loadDefaultLocale()},e}();$e.decorators=[{type:t.Injectable}],$e.ctorParameters=function(){return[{type:o.AbstractI18nService}]};var Ve=function(){function e(e,n,a,r){var s,l=this;this.compiler=e,this.injector=n,this.domSanitizer=a,this.i18service=r,this._locale=o.getSessionStorageItem("selectedLocale")||"en",this.formatsByLocale=null===(s=this.i18service)||void 0===s?void 0:s.getwidgetLocale(),this.preparePipeMeta=function(e,t,n,i){return void 0===i&&(i=[]),{type:{reference:e,diDeps:i},name:t,pure:n}},this._pipeData=[this.preparePipeMeta(i.AsyncPipe,"async",!1,[t.ChangeDetectorRef]),this.preparePipeMeta(i.SlicePipe,"slice",!1),this.preparePipeMeta(i.PercentPipe,"percent",!0,[this._locale]),this.preparePipeMeta(i.I18nPluralPipe,"i18nPlural",!0,[i.NgLocalization]),this.preparePipeMeta(i.I18nSelectPipe,"i18nSelect",!0),this.preparePipeMeta(i.KeyValuePipe,"keyvalue",!1,[t.KeyValueDiffers]),this.preparePipeMeta(c.FileIconClassPipe,"fileIconClass",!0),this.preparePipeMeta(c.FileExtensionFromMimePipe,"fileExtensionFromMime",!0),this.preparePipeMeta(c.StateClassPipe,"stateClass",!0),this.preparePipeMeta(c.FileSizePipe,"filesize",!0),this.preparePipeMeta(c.FilterPipe,"filter",!0),this.preparePipeMeta(i.UpperCasePipe,"uppercase",!0),this.preparePipeMeta(i.LowerCasePipe,"lowercase",!0),this.preparePipeMeta(i.JsonPipe,"json",!1),this.preparePipeMeta(i.DecimalPipe,"number",!0,[this._locale]),this.preparePipeMeta(i.TitleCasePipe,"titlecase",!0),this.preparePipeMeta(i.CurrencyPipe,"currency",!0,[this._locale]),this.preparePipeMeta(i.DatePipe,"date",!0,[this._locale]),this.preparePipeMeta(c.ToDatePipe,"toDate",!0,[new i.DatePipe(this._locale)]),this.preparePipeMeta(c.ToNumberPipe,"toNumber",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.ToCurrencyPipe,"toCurrency",!0,[new i.DecimalPipe(this._locale),this.i18service]),this.preparePipeMeta(c.PrefixPipe,"prefix",!0),this.preparePipeMeta(c.SuffixPipe,"suffix",!0),this.preparePipeMeta(c.TimeFromNowPipe,"timeFromNow",!0),this.preparePipeMeta(c.NumberToStringPipe,"numberToString",!0,[new i.DecimalPipe(this._locale)]),this.preparePipeMeta(c.StringToNumberPipe,"stringToNumber",!0),this.preparePipeMeta(c.CustomPipe,"custom",!0,[this.injector.get(o.CustomPipeManager)]),this.preparePipeMeta(c.TrustAsPipe,"trustAs",!0,[this.domSanitizer]),this.preparePipeMeta(c.SanitizePipe,"sanitize",!0,[this.domSanitizer])],this._pipeMeta=new Map,this._pipeData.forEach((function(e){l._pipeMeta.set(e.name,e)}))}return e.prototype.unknownPipe=function(e){throw Error("The pipe '"+e+"' could not be found")},e.prototype.meta=function(e){var t=this._pipeMeta.get(e);return t||this.unknownPipe(e),t},e.prototype.getPipeNameVsIsPureMap=function(){var e=new Map;return this._pipeMeta.forEach((function(t,n){e.set(n,t.pure)})),e},e.prototype.resolveDep=function(e){return this.injector.get(e.token.identifier.reference)},e.prototype.getInstance=function(e){var t,n,i=this.meta(e).type,o=i.reference,a=i.diDeps;if(o||this.unknownPipe(e),a.length){var r=[];try{for(var s=J(a),l=s.next();!l.done;l=s.next()){var c=l.value;r.push(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return new(o.bind.apply(o,ee([void 0],X(r))))}return new o},e}();Ve.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Ve(C.\u0275\u0275inject(C.Compiler),C.\u0275\u0275inject(C.INJECTOR),C.\u0275\u0275inject(D.DomSanitizer),C.\u0275\u0275inject(I.AbstractI18nService))},token:Ve,providedIn:"root"}),Ve.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ve.ctorParameters=function(){return[{type:t.Compiler},{type:t.Injector},{type:u.DomSanitizer},{type:o.AbstractI18nService}]};var We=function(){function e(e,t,i,a,r,s,l,c,p,d){var u,h=this;this.elRef=i,this.oAuthService=a,this.dialogService=r,this.spinnerService=s,this.router=c,this.app=p,this.appManager=d,this.startApp=!1,this.isApplicationType=!1,this.spinner={show:!1,messages:[],arialabel:""},this.isOAuthDialogOpen=!1,o.setPipeProvider(e),o.setNgZone(l),o.setAppRef(t),this.isApplicationType="APPLICATION"===o.getWmProjectProperties().type,this.appManager.beforeAppReady(),a.getOAuthProvidersAsObservable().subscribe((function(e){h.providersConfig=e,e.length?h.showOAuthDialog():h.closeOAuthDialog()})),this.spinnerService.getMessageSource().asObservable().subscribe((function(e){setTimeout((function(){h.spinner.show=e.show,h.spinner.messages=e.messages,h.spinner.arialabel=e.messages.toString()}))})),O.setTheme("bs3");var m=o.noop;this.router.events.subscribe((function(e){if(e instanceof n.NavigationStart){var t=e.url.split("?")[0];(t=t.substring(1))||(h.app.activeLayoutName="",h.app.layoutPages=[]),u=h.app.activeLayoutName&&h.app.layoutPages&&h.app.layoutPages.length&&h.app.layoutPages.includes(t)?h.spinnerService.show("","wmRouterOutlet","","wmRouterOutlet"):h.spinnerService.show("","globalSpinner");var i=document.querySelector("app-page-outlet");i&&o.addClass(i,"page-load-in-progress");var a=Date.now();m=function(){h.spinnerService.hide(u);var e=document.querySelector("app-page-outlet");e&&o.removeClass(e,"page-load-in-progress"),m=o.noop,h.app.activePageLoadTime=Date.now()-a}}else(e instanceof n.NavigationEnd||e instanceof n.NavigationCancel||e instanceof n.NavigationError)&&setTimeout((function(){m()}),1e3)})),this.appManager.subscribe("pageReady",(function(){m()})),this.appManager.subscribe("pageAttach",(function(){m()}))}return e.prototype.showOAuthDialog=function(){this.isOAuthDialogOpen||(this.isOAuthDialogOpen=!0,this.dialogService.open("oAuthLoginDialog",this))},e.prototype.closeOAuthDialog=function(){this.isOAuthDialogOpen&&(this.isOAuthDialogOpen=!1,this.dialogService.close("oAuthLoginDialog",this))},e.prototype.start=function(){var e=this;setTimeout((function(){e.startApp=!0})),setTimeout((function(){e.app.dynamicComponentContainerRef=e.dynamicComponentContainerRef,e.overrideRouterOutlet()}),10)},e.prototype.overrideRouterOutlet=function(){var e=this,t=this.routerOutlet.attach,n=this.routerOutlet.detach;this.routerOutlet.attach=function(n){t.call(e.routerOutlet,n),n.instance.ngOnAttach()},this.routerOutlet.detach=function(){return e.app.activePage.ngOnDetach(),n.call(e.routerOutlet)}},e.prototype.ngAfterViewInit=function(){var e=this;o.hasCordova()&&!window.wmDeviceReady?document.addEventListener("wmDeviceReady",(function(){return e.start()})):this.start()},e.prototype.ngDoCheck=function(){o.$invokeWatchers()},e}();We.decorators=[{type:t.Component,args:[{selector:"app-root",template:'<ng-container *ngIf="startApp">\n <router-outlet></router-outlet>\n <div wmContainer partialContainer content="Common" hidden class="ng-hide" *ngIf="isApplicationType"></div>\n <app-spinner name="globalspinner" classname="global-spinner" role="alert" aria-live="assertive" [attr.aria-label]="spinner.arialabel || \'Loading\'" [show]="spinner.show" [spinnermessages]="spinner.messages"></app-spinner>\n <div wmDialog name="oAuthLoginDialog" title="Application is requesting you to sign in with"\n close.event="closeOAuthDialog()">\n <ng-template #dialogBody>\n <ul class="list-items">\n <li class="list-item" *ngFor="let provider of providersConfig">\n <button class="btn" (click)="provider.invoke()">{{provider.name}}</button>\n </li>\n </ul>\n </ng-template>\n </div>\n <div wmConfirmDialog name="_app-confirm-dialog" title.bind="title" message.bind="message" oktext.bind="oktext"\n canceltext.bind="canceltext" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div *ngIf="!isApplicationType" wmConfirmDialog name="PrefabConfirmDialog" title.bind="title" message.bind="text" oktext.bind="okButtonText"\n canceltext.bind="cancelButtonText" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div *ngIf="!isApplicationType" wmAlertDialog name="PrefabAlertDialog" title.bind="title" message.bind="text" oktext.bind="okButtonText"\n canceltext.bind="cancelButtonText" closable="false" iconclass.bind="iconclass"\n escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>\n <div wmAppExt></div>\n <i id="wm-mobile-display"></i>\n</ng-container>\n\x3c!--Dummy container to create the component dynamically--\x3e\n<ng-container #dynamicComponent></ng-container>\n',encapsulation:t.ViewEncapsulation.None}]}],We.ctorParameters=function(){return[{type:Ve},{type:t.ApplicationRef},{type:t.ElementRef},{type:b.OAuthService},{type:o.AbstractDialogService},{type:o.AbstractSpinnerService},{type:t.NgZone},{type:n.Router},{type:o.App},{type:j}]},We.propDecorators={routerOutlet:[{type:t.ViewChild,args:[n.RouterOutlet]}],dynamicComponentContainerRef:[{type:t.ViewChild,args:["dynamicComponent",{read:t.ViewContainerRef}]}]};var Ue=function(){function e(){this.wmHttpRequest=new y.WmHttpRequest,this.wmHttpResponse=new y.WmHttpResponse}return e.prototype.createSubject=function(){return new l.Subject},e.prototype.intercept=function(e,t){var n,i,o=this;if(r.appManager&&r.appManager.appOnBeforeServiceCall){var a=this.wmHttpRequest.angularToWmRequest(e);(n=r.appManager.appOnBeforeServiceCall(a))&&(n=this.wmHttpRequest.wmToAngularRequest(n),e=n)}return t.handle(e).pipe(E.tap((function(e){if(e&&4===e.type&&r.appManager&&r.appManager.appOnServiceSuccess){var t=o.wmHttpResponse.angularToWmResponse(e);(i=r.appManager.appOnServiceSuccess(t.body,t))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(e,i))}}),(function(t){if(t._401Subscriber=o.createSubject(),r.httpService.isPlatformSessionTimeout(t)&&r.httpService.handleSessionTimeout(e,t._401Subscriber),r.appManager&&r.appManager.appOnServiceError){var n=o.wmHttpResponse.angularToWmResponse(t);(i=r.appManager.appOnServiceError(n.message,n))&&(i=o.wmHttpResponse.wmToAngularResponse(i),_.extend(t,i))}})))},e}();Ue.decorators=[{type:t.Injectable}],Ue.ctorParameters=function(){return[]};var qe="PREFAB",ze=function(){function e(e){var t=this;this.prefabManager=e,window.addEventListener("message",(function(e){if((e.data&&e.data.context)===qe){var n=e.data.action,i=e.data.payload;"init"===n?t.init():"set-property"===n?t.setProperty(i):"get-outbound-properties"===n?t.getOutboundProps():"invoke-script"===n&&t.invokeScript(i)}}))}return e.prototype.postMessage=function(e,t){var n={context:qe,action:e,payload:t};window.top.postMessage(n,"*")},e.prototype.setupEventListeners=function(){var e=this;this.prefabInstance.invokeEventCallback=function(t,n){void 0===n&&(n={}),e.postMessage("event-log",{name:t,data:n})}},e.prototype.init=function(){var e=this;this.previewMode=!0,this.prefabInstance.readyState.subscribe((function(){}),(function(){}),(function(){e.prefabManager.getConfig("__self__").then((function(t){e.config=t,e.postMessage("config",t),e.setupEventListeners()}))}))},e.prototype.setProperty=function(e){this.prefabInstance.widget[e.name]=e.value},e.prototype.isOutBoundProp=function(e){return"out-bound"===e.bindable||"in-out-bound"===e.bindable},e.prototype.getOutboundProps=function(){var e,t,n={};try{for(var i=J(Object.entries(this.config.properties||{})),o=i.next();!o.done;o=i.next()){var a=X(o.value,2),r=a[0],s=a[1];this.isOutBoundProp(s)&&(n[r]=this.prefabInstance.widget[r])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.postMessage("outbound-properties",n)},e.prototype.invokeScript=function(e){var t="\n return "+e.script+";",n=new Function("Prefab",t)(this.prefabInstance);this.postMessage("method-output",{methodName:e.methodName,output:n})},e.prototype.ngAfterViewInit=function(){this.setupEventListeners(),this.postMessage("init")},e}();ze.decorators=[{type:t.Component,args:[{selector:"wm-prefab-preview",template:'\n <div class="prefab-preview row">\n <section wmPrefab name="prefab-preview" prefabname="__self__"></section>\n </div>\n '}]}],ze.ctorParameters=function(){return[{type:H}]},ze.propDecorators={prefabInstance:[{type:t.ViewChild,args:[p.PrefabDirective,{static:!0}]}]},A.initComponentsBuildTask();var He=new Map,Ye=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[wt],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Ke=function(e,n,i){void 0===i&&(i="");var o={template:n,styles:[i],encapsulation:t.ViewEncapsulation.None},a=function(){};return a.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},o),{selector:e})]}],a},Qe=function(){function e(e,t,n){this.app=e,this.appManager=t,this.compiler=n,this.counter=1}return e.prototype.getComponentFactoryRef=function(e,t,n){return void 0===n&&(n={}),Q(this,void 0,void 0,(function(){var i,o,a;return Z(this,(function(r){return i=He.get(e),t=n.transpile?R.transpile(t).markup:t,i&&!n.noCache||(o=Ke(e,t,n.styles),a=Ye(o),i=this.compiler.compileModuleAndAllComponentsSync(a).componentFactories.filter((function(e){return e.componentType===o}))[0],He.set(e,i)),[2,i]}))}))},e.prototype.addComponent=function(e,t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),Q(this,void 0,void 0,(function(){var a,r;return Z(this,(function(s){switch(s.label){case 0:return i.transpile=!o.isDefined(i.transpile)||i.transpile,i.noCache=!o.isDefined(i.noCache)||i.noCache,i.selector=o.isDefined(i.selector)?i.selector:"wm-dynamic-component-"+this.counter++,[4,this.getComponentFactoryRef(i.selector,t,i)];case 1:return a=s.sent(),r=this.app.dynamicComponentContainerRef.createComponent(a,0,_.get(i,"inj")),o.extendProto(r.instance,n),e.appendChild(r.location.nativeElement),[2]}}))}))},e}();Qe.decorators=[{type:t.Injectable}],Qe.ctorParameters=function(){return[{type:o.App},{type:j},{type:t.Compiler}]};var Ze=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return function(){var e;return!1!==(e=this.app.activePage&&this.app.activePage.onBeforePageLeave())&&(e=(this.app.onBeforePageLeave||o.noop)(this.app.activePageName,this.app.activePage)),void 0===e||e}.apply(e)},e}();Ze.decorators=[{type:t.Injectable}];var Je=function(){function e(){}return e.prototype.canDeactivate=function(e,t,n){return!e.canDeactivate||e.canDeactivate()},e}();Je.decorators=[{type:t.Injectable}];var Xe=function(){function e(){this._stylesSet=new Set}return e.prototype.addStyles=function(e){var t=this,n=new Set;e.forEach((function(e){t._stylesSet.has(e)||(t._stylesSet.add(e),n.add(e))})),this.onStylesAdded(n)},e.prototype.onStylesAdded=function(e){},e.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},e}();Xe.decorators=[{type:t.Injectable}];var et=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n._hostNodes=new Map,n._hostNodes.set(t.head,[]),n}return K(t,e),t.prototype._addStylesToHost=function(e,t,n){var i,o=this,a=(null===(i=document.querySelector('meta[name="CSP-NONCE"]'))||void 0===i?void 0:i.getAttribute("content"))||"wm-csp-nonce";e.forEach((function(e){var i=o._doc.createElement("style");i.textContent=e,i.setAttribute("nonce",a),n.push(t.appendChild(i))}))},t.prototype.addHost=function(e){var t=[];this._addStylesToHost(this._stylesSet,e,t),this._hostNodes.set(e,t)},t.prototype.removeHost=function(e){var t=this._hostNodes.get(e);t&&t.forEach(tt),this._hostNodes.delete(e)},t.prototype.onStylesAdded=function(e){var t=this;this._hostNodes.forEach((function(n,i){t._addStylesToHost(e,i,n)}))},t.prototype.ngOnDestroy=function(){this._hostNodes.forEach((function(e){return e.forEach(tt)}))},t}(Xe);function tt(e){i["\u0275getDOM"]().remove(e)}et.decorators=[{type:t.Injectable}],et.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[i.DOCUMENT]}]}]};var nt={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/MathML/"},it=/%COMP%/g,ot="_nghost-%COMP%",at="_ngcontent-%COMP%";function rt(e,t,n){for(var i=0;i<t.length;i++){var o=t[i];Array.isArray(o)?rt(e,o,n):(o=o.replace(it,e),n.push(o))}return n}function st(e){return function(t){if("__ngUnwrap__"===t)return e;!1===e(t)&&(t.preventDefault(),t.returnValue=!1)}}var lt=function(){function e(e,t,n){this.eventManager=e,this.sharedStylesHost=t,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new ct(e)}return e.prototype.createRenderer=function(e,n){if(!e||!n)return this.defaultRenderer;switch(n.encapsulation){case t.ViewEncapsulation.Emulated:var i=this.rendererByCompId.get(n.id);return i||(i=new ut(this.eventManager,this.sharedStylesHost,n,this.appId),this.rendererByCompId.set(n.id,i)),i.applyToHost(e),i;case 1:case t.ViewEncapsulation.ShadowDom:return new ht(this.eventManager,this.sharedStylesHost,e,n);default:if(!this.rendererByCompId.has(n.id)){var o=rt(n.id,n.styles,[]);this.sharedStylesHost.addStyles(o),this.rendererByCompId.set(n.id,this.defaultRenderer)}return this.defaultRenderer}},e.prototype.begin=function(){},e.prototype.end=function(){},e}();lt.decorators=[{type:t.Injectable}],lt.ctorParameters=function(){return[{type:u.EventManager},{type:u["\u0275DomSharedStylesHost"]},{type:String,decorators:[{type:t.Inject,args:[t.APP_ID]}]}]};var ct=function(){function e(e){this.eventManager=e,this.data=Object.create(null),this.destroyNode=null}return e.prototype.destroy=function(){},e.prototype.createElement=function(e,t){return t?document.createElementNS(nt[t]||t,e):document.createElement(e)},e.prototype.createComment=function(e){return document.createComment(e)},e.prototype.createText=function(e){return document.createTextNode(e)},e.prototype.appendChild=function(e,t){(pt(e)?e.content:e).appendChild(t)},e.prototype.insertBefore=function(e,t,n){e&&(pt(e)?e.content:e).insertBefore(t,n)},e.prototype.removeChild=function(e,t){e&&e.removeChild(t)},e.prototype.selectRootElement=function(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!n)throw new Error('The selector "'+e+'" did not match any elements');return t||(n.textContent=""),n},e.prototype.parentNode=function(e){return e.parentNode},e.prototype.nextSibling=function(e){return e.nextSibling},e.prototype.resetStyles=function(e){[].slice.call(e).forEach((function(t){e.style.removeProperty(t)}))},e.prototype.applyStyles=function(e,t){if(t)return t.split(";").forEach((function(t){var n,i,o=t.split(":");2===o.length&&(n=o[0].trim(),i=o[1].trim(),e.style[n]=i)})),t},e.prototype.setAttribute=function(e,t,n,i){if(i){t=i+":"+t;var o=nt[i];o?e.setAttributeNS(o,t,n):e.setAttribute(t,n)}else"style"===t?(this.resetStyles(e),this.applyStyles(e,n)):e.setAttribute(t,n)},e.prototype.removeAttribute=function(e,t,n){if(n){var i=nt[n];i?e.removeAttributeNS(i,t):e.removeAttribute(n+":"+t)}else e.removeAttribute(t)},e.prototype.addClass=function(e,t){e.classList.add(t)},e.prototype.removeClass=function(e,t){e.classList.remove(t)},e.prototype.setStyle=function(e,n,i,o){o&(t.RendererStyleFlags2.DashCase|t.RendererStyleFlags2.Important)?e.style.setProperty(n,i,o&t.RendererStyleFlags2.Important?"important":""):e.style[n]=i},e.prototype.removeStyle=function(e,n,i){i&t.RendererStyleFlags2.DashCase?e.style.removeProperty(n):e.style[n]=""},e.prototype.setProperty=function(e,t,n){e[t]=n},e.prototype.setValue=function(e,t){e.nodeValue=t},e.prototype.listen=function(e,t,n){return"string"==typeof e?this.eventManager.addGlobalEventListener(e,t,st(n)):this.eventManager.addEventListener(e,t,st(n))},e}();"@".charCodeAt(0);function pt(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}var dt,ut=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.component=i;var r,s=rt(o+"-"+i.id,i.styles,[]);return n.addStyles(s),a.contentAttr=(r=o+"-"+i.id,at.replace(it,r)),a.hostAttr=function(e){return ot.replace(it,e)}(o+"-"+i.id),a}return K(t,e),t.prototype.applyToHost=function(t){e.prototype.setAttribute.call(this,t,this.hostAttr,"")},t.prototype.createElement=function(t,n){var i=e.prototype.createElement.call(this,t,n);return e.prototype.setAttribute.call(this,i,this.contentAttr,""),i},t}(ct),ht=function(e){function t(t,n,i,o){var a=e.call(this,t)||this;a.sharedStylesHost=n,a.hostEl=i,a.shadowRoot=i.attachShadow({mode:"open"}),a.sharedStylesHost.addHost(a.shadowRoot);for(var r=rt(o.id,o.styles,[]),s=0;s<r.length;s++){var l=document.createElement("style");l.textContent=r[s],a.shadowRoot.appendChild(l)}return a}return K(t,e),t.prototype.nodeOrShadowRoot=function(e){return e===this.hostEl?this.shadowRoot:e},t.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},t.prototype.appendChild=function(t,n){return e.prototype.appendChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.insertBefore=function(t,n,i){return e.prototype.insertBefore.call(this,this.nodeOrShadowRoot(t),n,i)},t.prototype.removeChild=function(t,n){return e.prototype.removeChild.call(this,this.nodeOrShadowRoot(t),n)},t.prototype.parentNode=function(t){return this.nodeOrShadowRoot(e.prototype.parentNode.call(this,this.nodeOrShadowRoot(t)))},t}(ct),mt=function(){o._WM_APP_PROJECT.id=o.hasCordova()?_WM_APP_PROPERTIES.displayName:location.href.split("/")[3],o._WM_APP_PROJECT.cdnUrl=document.querySelector('[name="cdnUrl"]')&&document.querySelector('[name="cdnUrl"]').getAttribute("content"),o._WM_APP_PROJECT.ngDest="ng-bundle/"};function ft(e,t){return{provide:e,useValue:t}}function gt(e,t){var n=this;return function(){return Q(n,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return mt(),[4,t.resolve()];case 1:return n.sent(),[2,e.loadDefaultLocale()]}}))}))}}function vt(e){return mt(),e.deduceAppLocale()}!function(e){e.IOS="ios",e.ANDROID="android"}(dt||(dt={}));var yt=[fe,ge,ve,be,We,ze,ye],bt=[f.ConfirmDialogModule,g.DesignDialogModule,m.DialogModule];$.fn.swipeAnimation.expressionEvaluator=o.$parseExpr;var wt=function(){function e(t,n,i){e.addCustomEventPolyfill(),this.getDeviceDetails().then((function(e){n.selectedViewPort={os:e.os,category:e.selectedDeviceCategory},i.update(e),n.notify("on-viewport-details",e.os)}))}return e.addCustomEventPolyfill=function(){if("function"==typeof window.CustomEvent)return!1;var e=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n};e.prototype=window.Event.prototype,window.CustomEvent=e},e.forRoot=function(){return{ngModule:e,providers:[{provide:o.App,useClass:Oe},{provide:o.AbstractToasterService,useClass:Ee},{provide:o.AbstractI18nService,useClass:Ae},{provide:o.AbstractSpinnerService,useClass:Te},{provide:o.AbstractNavigationService,useClass:Ce},{provide:o.AppDefaults,useClass:xe},{provide:o.DynamicComponentRefProvider,useClass:Qe},{provide:t.APP_INITIALIZER,useFactory:gt,deps:[o.AbstractI18nService,je],multi:!0},{provide:t.LOCALE_ID,useFactory:vt,deps:[o.AbstractI18nService]},{provide:d.HTTP_INTERCEPTORS,useClass:Ue,multi:!0},i.DecimalPipe,i.DatePipe,j,H,ke,Me,Le,Ze,je,Ge,$e,ft(ae,10),ft(re,1800)]}},e.prototype.getDeviceDetails=function(){return new Promise((function(e,t){window.top!==window?(window.top.postMessage({key:"on-load"},"*"),window.onmessage=function(t){var n=t.data;o.isObject(n)&&"switch-device"===n.key&&e(n.device)}):o.isIphone()||o.isIpod()||o.isIpad()?e({os:dt.IOS}):e({os:dt.ANDROID})}))},e}();wt.decorators=[{type:t.NgModule,args:[{declarations:yt,imports:[i.CommonModule,n.RouterModule,d.HttpClientModule,h.ToastrModule,c.WmComponentsModule,p.PrefabModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,bt],exports:[yt,i.CommonModule,c.WmComponentsModule,v.MobileRuntimeModule,o.CoreModule,a.SecurityModule,b.OAuthModule,r.VariablesModule,y.HttpServiceModule,bt],providers:[{provide:u["\u0275DomSharedStylesHost"],useClass:et},{provide:u["\u0275DomRendererFactory2"],useClass:lt}],entryComponents:[ve]}]}],wt.ctorParameters=function(){return[{type:v.MobileRuntimeModule},{type:o.App},{type:o.Viewport}]};var Pt=[c.WmComponentsModule.forRoot(),v.MobileRuntimeModule.forRoot(),o.CoreModule.forRoot(),a.SecurityModule.forRoot(),b.OAuthModule.forRoot(),r.VariablesModule.forRoot(),y.HttpServiceModule.forRoot(),wt.forRoot()],_t=!1,Ot=function(){function e(e,t){this.appManager=e,this.appVariablesProvider=t}return e.prototype.resolve=function(){var e=this;return!!_t||Promise.all([this.appManager.loadSecurityConfig(),this.appManager.loadMetadata(),this.appVariablesProvider.getAppVariables()]).then((function(t){return e.appManager.loadAppVariables(t[2])})).then((function(){return _t=!0}))},e}();Ot.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Ot(C.\u0275\u0275inject(j),C.\u0275\u0275inject(L))},token:Ot,providedIn:"root"}),Ot.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ot.ctorParameters=function(){return[{type:j},{type:L}]};var Et=!1,Rt=function(){function e(e){this.appManager=e}return e.prototype.resolve=function(){return Et||this.appManager.loadMetadata().then((function(){return Et=!0}))},e}();Rt.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new Rt(C.\u0275\u0275inject(j))},token:Rt,providedIn:"root"}),Rt.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Rt.ctorParameters=function(){return[{type:j}]};var At=function(){function e(e){this.appManager=e,o.isMobileApp()||(this.loaded=this.appManager.isPrefabType()||this.appManager.isTemplateBundleType()||!o.getWmProjectProperties().securityEnabled)}return e.prototype.resolve=function(){var e=this;return this.loaded||this.appManager.loadSecurityConfig().then((function(){e.loaded=!0}))},e}();At.\u0275prov=C.\u0275\u0275defineInjectable({factory:function(){return new At(C.\u0275\u0275inject(j))},token:At,providedIn:"root"}),At.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],At.ctorParameters=function(){return[{type:j}]},e.AccessrolesDirective=fe,e.AppComponent=We,e.AppDefaultsService=xe,e.AppExtensionJSResolve=Ge,e.AppExtensionProvider=F,e.AppJSProvider=M,e.AppJSResolve=je,e.AppManagerService=j,e.AppRef=Oe,e.AppSpinnerComponent=ge,e.AppVariablesProvider=L,e.AppVariablesResolve=Ot,e.AuthGuard=ke,e.BaseLayoutComponent=ue,e.BasePageComponent=pe,e.BasePartialComponent=ie,e.BasePrefabComponent=de,e.BaseSpaPageComponent=me,e.CACHE_PAGE=oe,e.CanDeactivateNgPageGuard=Je,e.CanDeactivatePageGuard=Ze,e.ComponentRefProvider=N,e.CustomToasterComponent=ve,e.DynamicComponentRefProviderService=Qe,e.EmptyPageComponent=ye,e.FragmentMonitor=te,e.HttpCallInterceptor=Ue,e.I18nResolve=$e,e.I18nServiceImpl=Ae,e.InitializeApp=gt,e.MAX_CACHE_AGE=re,e.MAX_CACHE_SIZE=ae,e.MetadataResolve=Rt,e.NavigationServiceImpl=Ce,e.PageNotFoundGaurd=Le,e.PipeProvider=Ve,e.PrefabConfigProvider=k,e.PrefabDirective=be,e.PrefabManagerService=H,e.PrefabPreviewComponent=ze,e.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS=bt,e.RoleGuard=Me,e.RuntimeBaseModule=wt,e.SecurityConfigResolve=At,e.SpinnerServiceImpl=Te,e.ToasterServiceImpl=Ee,e.WM_MODULES_FOR_ROOT=Pt,e.WmDefaultRouteReuseStrategy=se,e.WmNgRouteReuseStrategy=ce,e.WmRouteReuseStrategy=le,e.commonPartialWidgets=ne,e.getPrefabBaseUrl=G,e.getPrefabConfigUrl=function(e){return G(e)+"/config.json"},e.getPrefabMinJsonUrl=function(e){return G(e)+"/pages/Main/page.min.json"},e.getPrefabPartialJsonUrl=function(e,t){return G(e)+"/pages/"+t+"/page.min.json"},e.isPrefabInPreview=B,e.setAngularLocale=vt,e["\u02750"]=z,e["\u0275a"]=ft,e["\u0275b"]=Xe,e["\u0275c"]=et,e["\u0275d"]=lt,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/platform-browser-dynamic"),require("@angular/platform-browser"),require("@angular/common"),require("@angular/router"),require("@angular/common/http"),require("@angular/forms"),require("ngx-bootstrap/typeahead"),require("ngx-bootstrap/timepicker"),require("ngx-bootstrap/progressbar"),require("ngx-bootstrap/pagination"),require("ngx-bootstrap/modal"),require("ngx-bootstrap/tooltip"),require("ngx-bootstrap/datepicker"),require("ngx-bootstrap/dropdown"),require("ngx-bootstrap/popover"),require("ng-circle-progress"),require("ngx-toastr"),require("ngx-bootstrap/carousel"),require("@wm/core"),require("@wm/components/basic"),require("@wm/components/basic/progress"),require("@wm/components/basic/rich-text-editor"),require("@wm/components/basic/search"),require("@wm/components/basic/tree"),require("@wm/components/input"),require("@wm/components/input/calendar"),require("@wm/components/input/chips"),require("@wm/components/input/color-picker"),require("@wm/components/input/currency"),require("@wm/components/input/epoch"),require("@wm/components/input/file-upload"),require("@wm/components/input/rating"),require("@wm/components/input/slider"),require("@wm/mobile/runtime/dynamic"),require("@wm/components/data/card"),require("@wm/components/data/form"),require("@wm/components/data/list"),require("@wm/components/data/live-table"),require("@wm/components/data/pagination"),require("@wm/components/data/table"),require("@wm/components/chart"),require("@wm/components/containers/accordion"),require("@wm/components/containers/linear-layout"),require("@wm/components/containers/layout-grid"),require("@wm/components/containers/panel"),require("@wm/components/containers/tabs"),require("@wm/components/containers/tile"),require("@wm/components/containers/wizard"),require("@wm/components/dialogs/alert-dialog"),require("@wm/components/dialogs/iframe-dialog"),require("@wm/components/dialogs/login-dialog"),require("@wm/components/dialogs/partial-dialog"),require("@wm/components/navigation/breadcrumb"),require("@wm/components/navigation/menu"),require("@wm/components/navigation/navbar"),require("@wm/components/navigation/popover"),require("@wm/components/advanced/carousel"),require("@wm/components/advanced/login"),require("@wm/components/advanced/marquee"),require("@wm/components/page"),require("@wm/components/page/footer"),require("@wm/components/page/header"),require("@wm/components/page/left-panel"),require("@wm/components/page/right-panel"),require("@wm/components/page/top-nav"),require("@wm/components/prefab"),require("@wm/runtime/base"),require("@wm/variables"),require("@wm/security"),require("@wm/transpiler"),require("@angular/platform-browser/animations")):"function"==typeof define&&define.amd?define("@wm/runtime/dynamic",["exports","@angular/core","@angular/platform-browser-dynamic","@angular/platform-browser","@angular/common","@angular/router","@angular/common/http","@angular/forms","ngx-bootstrap/typeahead","ngx-bootstrap/timepicker","ngx-bootstrap/progressbar","ngx-bootstrap/pagination","ngx-bootstrap/modal","ngx-bootstrap/tooltip","ngx-bootstrap/datepicker","ngx-bootstrap/dropdown","ngx-bootstrap/popover","ng-circle-progress","ngx-toastr","ngx-bootstrap/carousel","@wm/core","@wm/components/basic","@wm/components/basic/progress","@wm/components/basic/rich-text-editor","@wm/components/basic/search","@wm/components/basic/tree","@wm/components/input","@wm/components/input/calendar","@wm/components/input/chips","@wm/components/input/color-picker","@wm/components/input/currency","@wm/components/input/epoch","@wm/components/input/file-upload","@wm/components/input/rating","@wm/components/input/slider","@wm/mobile/runtime/dynamic","@wm/components/data/card","@wm/components/data/form","@wm/components/data/list","@wm/components/data/live-table","@wm/components/data/pagination","@wm/components/data/table","@wm/components/chart","@wm/components/containers/accordion","@wm/components/containers/linear-layout","@wm/components/containers/layout-grid","@wm/components/containers/panel","@wm/components/containers/tabs","@wm/components/containers/tile","@wm/components/containers/wizard","@wm/components/dialogs/alert-dialog","@wm/components/dialogs/iframe-dialog","@wm/components/dialogs/login-dialog","@wm/components/dialogs/partial-dialog","@wm/components/navigation/breadcrumb","@wm/components/navigation/menu","@wm/components/navigation/navbar","@wm/components/navigation/popover","@wm/components/advanced/carousel","@wm/components/advanced/login","@wm/components/advanced/marquee","@wm/components/page","@wm/components/page/footer","@wm/components/page/header","@wm/components/page/left-panel","@wm/components/page/right-panel","@wm/components/page/top-nav","@wm/components/prefab","@wm/runtime/base","@wm/variables","@wm/security","@wm/transpiler","@angular/platform-browser/animations"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.runtime=e.wm.runtime||{},e.wm.runtime.dynamic={}),e.ng.core,e.ng.platformBrowserDynamic,e.ng.platformBrowser,e.ng.common,e.ng.router,e.ng.common.http,e.ng.forms,e["ngx-bootstrap"].typeahead,e["ngx-bootstrap"].timepicker,e["ngx-bootstrap"].progressbar,e["ngx-bootstrap"].pagination,e["ngx-bootstrap"].modal,e["ngx-bootstrap"].tooltip,e["ngx-bootstrap"].datepicker,e["ngx-bootstrap"].dropdown,e["ngx-bootstrap"].popover,e.ngCircleProgress,e.ngxToastr,e["ngx-bootstrap"].carousel,e.wm.core,e.wm.components.basic,e.wm.components.basic.progress,e.wm.components.basic.richtexteditor,e.wm.components.basic.search,e.wm.components.basic.tree,e.wm.components.input,e.wm.components.input.calendar,e.wm.components.input.chips,e.wm.components.input.colorpicker,e.wm.components.input.currency,e.wm.components.input.epoch,e.wm.components.input.fileupload,e.wm.components.input.rating,e.wm.components.input.slider,e.wm.mobile.runtime.dynamic,e.wm.components.data.card,e.wm.components.data.form,e.wm.components.data.list,e.wm.components.data.livetable,e.wm.components.data.pagination,e.wm.components.data.table,e.wm.components.chart,e.wm.components.containers.accordion,e.wm.components.containers.linearlayout,e.wm.components.containers.layoutgrid,e.wm.components.containers.panel,e.wm.components.containers.tabs,e.wm.components.containers.tile,e.wm.components.containers.wizard,e.wm.components.dialogs.alertdialog,e.wm.components.dialogs.iframedialog,e.wm.components.dialogs.logindialog,e.wm.components.dialogs.partialdialog,e.wm.components.navigation.breadcrumb,e.wm.components.navigation.menu,e.wm.components.navigation.navbar,e.wm.components.navigation.popover,e.wm.components.advanced.carousel,e.wm.components.advanced.login,e.wm.components.advanced.marquee,e.wm.components.page,e.wm.components.page.footer,e.wm.components.page.header,e.wm.components.page.leftpanel,e.wm.components.page.rightpanel,e.wm.components.page.topnav,e.wm.components.prefab,e.wm.runtime.base,e.wm.variables,e.wm.security,e.wm.transpiler,e.ng.platformBrowser.animations)}(this,(function(e,t,n,i,o,a,r,s,l,c,p,d,u,h,m,f,g,v,y,b,w,P,O,E,R,A,T,S,C,I,D,x,N,k,M,L,F,j,B,G,V,W,U,q,z,H,Y,K,Q,Z,J,X,ee,te,ne,ie,oe,ae,re,se,le,ce,pe,de,ue,he,me,fe,ge,ve,ye,be,we){"use strict";function Pe(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var _e=Pe(t),Oe=Pe(r),Ee=function(e,t){return(Ee=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 Re(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}Ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Ae(e,t,n,i){return new(n||(n=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(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(r,s)}l((i=i.apply(e,t||[])).next())}))}function Te(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}Object.create;function Se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function Ce(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;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 Ie=function(){function e(e,t,n,i,o,a,r,s,l,c,p,d,u){this.injector=e,this.route=t,this.vcRef=n,this.appRef=i,this.metadataService=o,this.securityService=a,this.appManager=r,this.app=s,this.ngZone=l,this.elRef=c,this.spinnerService=p,this.componentRefProvider=d,this.router=u}return e.prototype.getTargetNode=function(){return this.elRef.nativeElement},e.prototype.resetViewContainer=function(){this.vcRef.clear(),this.getTargetNode().innerHTML=""},e.prototype.renderPage=function(e){var t=this,n=this.getTargetNode();this.appManager.loadAppVariables().then((function(){return Ae(t,void 0,void 0,(function(){var t,i;return Te(this,(function(o){switch(o.label){case 0:return[4,this.componentRefProvider.getComponentFactoryRef(e,ge.ComponentType.PAGE)];case 1:return(t=o.sent())?(i=this.vcRef.createComponent(t,0,this.injector),this.instance=i.instance,n.appendChild(i.location.nativeElement)):ge.BasePageComponent.clear(),this.vcRef.length>1&&this.vcRef.remove(1),[2]}}))}))}))},e.prototype.renderPrefabPreviewPage=function(){this.router.navigate(["prefab-preview"])},e.prototype.loadPage=function(e){var t=this;this.ngZone.run((function(){e&&t.renderPage(e)}))},e.prototype.ngOnInit=function(){var e=this;this.app.isPrefabType?this.renderPrefabPreviewPage():($(this.getTargetNode()).find(">div").first().remove(),this.subscription=this.route.params.subscribe((function(t){var n=t.pageName;e.loadPage(n)})))},e.prototype.ngOnDestroy=function(){this.vcRef.clear(),this.subscription&&this.subscription.unsubscribe()},e.prototype.ngOnAttach=function(){this.getTargetNode().appendChild(this.instance.$page[0]),this.instance.ngOnAttach()},e.prototype.ngOnDetach=function(){this.instance.ngOnDetach()},e}();Ie.decorators=[{type:t.Component,args:[{selector:"app-page-outlet",template:"<div></div>"}]}],Ie.ctorParameters=function(){return[{type:t.Injector},{type:a.ActivatedRoute},{type:t.ViewContainerRef},{type:t.ApplicationRef},{type:ve.MetadataService},{type:ye.SecurityService},{type:ge.AppManagerService},{type:w.App},{type:t.NgZone},{type:t.ElementRef},{type:w.AbstractSpinnerService},{type:ge.ComponentRefProvider},{type:a.Router}]};var De={securityConfig:ge.SecurityConfigResolve,metadata:ge.MetadataResolve,appMetaConfig:ge.AppExtensionJSResolve},xe=[{path:"",pathMatch:"full",resolve:De,component:ge.EmptyPageComponent},{path:"prefab-preview",pathMatch:"full",resolve:De,component:ge.PrefabPreviewComponent},{path:":pageName",pathMatch:"full",resolve:De,component:Ie,canDeactivate:[ge.CanDeactivatePageGuard]}],Ne=function(e){function t(t){var n=e.call(this)||this;return n.$http=t,n}return Re(t,e),t.prototype.getAppScriptFn=function(){return this.$http.get("./app.js",{responseType:"text"}).toPromise().then((function(e){return new Function("App","Utils","Injector",e)}))},t}(ge.AppJSProvider);Ne.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Ne(_e.\u0275\u0275inject(Oe.HttpClient))},token:Ne,providedIn:"root"}),Ne.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Ne.ctorParameters=function(){return[{type:r.HttpClient}]};var ke=new Map,Me=function(){function e(e){this.$http=e}return e.prototype.get=function(e,t){var n=ke.get(e);return n?Promise.resolve(n):this.$http.get(e).then((function(n){return t&&ke.set(e,n),n}))},e.prototype.clearCache=function(){ke.clear()},e}();Me.decorators=[{type:t.Injectable}],Me.ctorParameters=function(){return[{type:w.AbstractHttpService}]};var Le=function(e){function t(t){var n=e.call(this)||this;return n.resourceManager=t,n}return Re(t,e),t.prototype.getAppVariables=function(){return Ae(this,void 0,void 0,(function(){return Te(this,(function(e){return[2,this.resourceManager.get("./app.variables.json")]}))}))},t}(ge.AppVariablesProvider);Le.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Le(_e.\u0275\u0275inject(Me))},token:Le,providedIn:"root"}),Le.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Le.ctorParameters=function(){return[{type:Me}]};var Fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Re(t,e),t.prototype.loadFormatterConfigScript=function(e){try{w.appendScriptToHead(e)}catch(e){console.warn("Error while loading the formatters.js file")}},t}(ge.AppExtensionProvider);Fe.\u0275prov=_e.\u0275\u0275defineInjectable({factory:function(){return new Fe},token:Fe,providedIn:"root"}),Fe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];var je=new Map;window.resourceCache=je;var Be=new Map;Be.set(ge.ComponentType.PAGE,new Map),Be.set(ge.ComponentType.PARTIAL,new Map),Be.set(ge.ComponentType.PREFAB,new Map);var Ge=function(e){return decodeURIComponent(e.replace(/\+/g," "))},$e=Ge,Ve=function(e,t,n){return t===ge.ComponentType.PAGE||t===ge.ComponentType.PARTIAL?n&&n.prefab?ge.getPrefabPartialJsonUrl(n.prefab,e):"./pages/"+e+"/page.min.json":t===ge.ComponentType.PREFAB?ge.getPrefabMinJsonUrl(e):void 0},We=Ve,Ue=new Map,qe=function(e,t,n,i,o,a){var r=Ue.get(t);("Partial"!==n||_.isUndefined(i.Prefab))&&r||(r=new Function(n,"App","Utils",e),Ue.set(t,r)),r(i,o,a)},ze=qe,He=function(){function e(){}return e.prototype.init=function(){},e}(),Ye=function(e){var n=function(){};return n.decorators=[{type:t.NgModule,args:[{declarations:[e],imports:[ge.RuntimeBaseModule],schemas:[t.CUSTOM_ELEMENTS_SCHEMA,t.NO_ERRORS_SCHEMA]}]}],n},Ke=Ye,Qe=function(e,n,i,o,a,r){var s={template:i,styles:[o],encapsulation:t.ViewEncapsulation.None},l=He,c="",p="";switch(n){case ge.ComponentType.PAGE:l=ge.BasePageComponent,c="app-page-"+e,p="Page";break;case ge.ComponentType.PARTIAL:l=ge.BasePartialComponent,c="app-partial-"+e,p="Partial";break;case ge.ComponentType.PREFAB:l=ge.BasePrefabComponent,c="app-prefab-"+e,p="Prefab"}var d=function(t){function i(i){var o=t.call(this)||this;switch(o.injector=i,n){case ge.ComponentType.PAGE:o.pageName=e;break;case ge.ComponentType.PARTIAL:o.partialName=e;break;case ge.ComponentType.PREFAB:o.prefabName=e}return t.prototype.init.call(o),o}return Re(i,t),i.prototype.evalUserScript=function(e,t,n){qe(a,c,p,e,t,n)},i.prototype.getVariables=function(){return JSON.parse(r)},i.prototype.getExpressions=function(){return{}},i}(l);return d.decorators=[{type:t.Component,args:[Object.assign(Object.assign({},s),{selector:c,providers:[{provide:w.UserDefinedExecutionContext,useExisting:d}]})]}],d.ctorParameters=function(){return[{type:t.Injector}]},d},Ze=Qe,Je=function(e){function t(t,n,i,o){var a=e.call(this)||this;return a.resouceMngr=t,a.app=n,a.appManager=i,a.compiler=o,a}return Re(t,e),t.prototype.loadResourcesOfFragment=function(e,t,n){var i=this,o=Ve(e,t,n),a=je.get(o);return a?Promise.resolve(a):this.resouceMngr.get(o,!0).then((function(n){var i=n.markup,a=n.script,r=n.styles,s=n.variables,l={markup:be.transpile(Ge(i)).markup,script:Ge(a),styles:be.scopeComponentStyles(e,t,Ge(r)),variables:w.getValidJSON(Ge(s))};return je.set(o,l),l}),(function(e){var t=e.details.status,n={404:i.app.appLocale.MESSAGE_PAGE_NOT_FOUND||"The page you are trying to reach is not available",403:i.app.appLocale.LABEL_ACCESS_DENIED||"Access Denied"};return Promise.reject(n[t])}))},t.prototype.getComponentFactoryRef=function(e,t,n){return Ae(this,void 0,void 0,(function(){var i,o,a,r=this;return Te(this,(function(s){return(i=Be.get(t))&&(a=n&&n.prefab?n.prefab+e:e,o=i.get(a))?[2,o]:[2,this.loadResourcesOfFragment(e,t,n).then((function(i){var a=i.markup,s=i.script,l=i.styles,c=i.variables,p=Qe(e,t,a,l,s,JSON.stringify(c)),d=Ye(p);o=r.compiler.compileModuleAndAllComponentsSync(d).componentFactories.filter((function(e){return e.componentType===p}))[0];var u=n&&n.prefab?n.prefab+e:e;return Be.get(t).set(u,o),o}),(function(e){if(e){var t="Error while loading page";console.log(t,e),r.appManager.notifyApp(_.isString(e)?e:t+", check browser console for error details","error")}}))]}))}))},t.prototype.clearComponentFactoryRefCache=function(){this.resouceMngr.clearCache(),je.clear(),Be.forEach((function(e){e.clear()}))},t}(ge.ComponentRefProvider);Je.decorators=[{type:t.Injectable}],Je.ctorParameters=function(){return[{type:Me},{type:w.App},{type:ge.AppManagerService},{type:t.Compiler}]};var Xe=new Map,et=function(e){function t(t){var n=e.call(this)||this;return n.resourceMngr=t,n}return Re(t,e),t.prototype.getConfig=function(e){var t=Xe.get(e);return t?Promise.resolve(t):this.resourceMngr.get(ge.getPrefabConfigUrl(e)).then((function(t){return Xe.set(e,t),t}))},t}(ge.PrefabConfigProvider);et.decorators=[{type:t.Injectable}],et.ctorParameters=function(){return[{type:Me}]};var tt=a.RouterModule.forRoot(xe,{useHash:!0,scrollPositionRestoration:"top"}),nt=y.ToastNoAnimationModule.forRoot({maxOpened:1,autoDismiss:!0}),it=r.HttpClientXsrfModule.withOptions({cookieName:"wm_xsrf_token",headerName:w.getWmProjectProperties().xsrf_header_name}),ot=u.ModalModule.forRoot(),at=m.BsDatepickerModule.forRoot(),rt=m.DatepickerModule.forRoot(),st=c.TimepickerModule.forRoot(),lt=f.BsDropdownModule.forRoot(),ct=d.PaginationModule.forRoot(),pt=l.TypeaheadModule.forRoot(),dt=p.ProgressbarModule.forRoot(),ut=b.CarouselModule.forRoot(),ht=g.PopoverModule.forRoot(),mt=v.NgCircleProgressModule.forRoot({}),ft=h.TooltipModule.forRoot(),gt=[m.BsDatepickerModule,m.DatepickerModule,c.TimepickerModule,f.BsDropdownModule,d.PaginationModule,l.TypeaheadModule,p.ProgressbarModule,b.CarouselModule,g.PopoverModule,v.NgCircleProgressModule,h.TooltipModule,P.BasicModule,O.ProgressModule,E.RichTextEditorModule,R.SearchModule,A.TreeModule,S.CalendarModule,C.ChipsModule,I.ColorPickerModule,D.CurrencyModule,x.EpochModule,N.FileUploadModule,T.InputModule,k.RatingModule,M.SliderModule,F.CardModule,j.FormModule,B.ListModule,G.LiveTableModule,V.PaginationModule,W.TableModule,U.ChartModule,q.AccordionModule,z.LinearLayoutModule,H.LayoutGridModule,Y.PanelModule,K.TabsModule,Q.TileModule,Z.WizardModule,J.AlertDialogModule,X.IframeDialogModule,ee.LoginDialogModule,te.PartialDialogModule,ne.BreadcrumbModule,ie.MenuModule,oe.NavbarModule,ae.PopoverModule,re.CarouselModule,se.LoginModule,le.MarqueeModule,ce.PageModule,pe.FooterModule,de.HeaderModule,ue.LeftPanelModule,he.RightPanelModule,me.TopNavModule,fe.PrefabModule];ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(gt))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push.apply(ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS,Ce([],Se(L.MOBILE_COMPONENT_MODULES_FOR_ROOT))),ge.REQUIRED_MODULES_FOR_DYNAMIC_COMPONENTS.push(s.FormsModule,s.ReactiveFormsModule);var vt=function(e,t,n){this.app=e,this.inj=t,this.componentRefProvider=n,window.cordova&&this.app.subscribe("userLoggedOut",this.componentRefProvider.clearComponentFactoryRefCache.bind(this.componentRefProvider))};vt.decorators=[{type:t.NgModule,args:[{declarations:[Ie],imports:[i.BrowserModule,we.BrowserAnimationsModule,o.CommonModule,a.RouterModule,r.HttpClientModule,ot,at,rt,st,lt,ct,pt,ft,dt,ut,ht,mt,tt,nt,it,L.MobileRuntimeDynamicModule,ge.WM_MODULES_FOR_ROOT],providers:[Me,{provide:ge.AppJSProvider,useClass:Ne},{provide:ge.AppVariablesProvider,useClass:Le},{provide:ge.AppExtensionProvider,useClass:Fe},{provide:ge.ComponentRefProvider,useClass:Je},{provide:w.PartialRefProvider,useClass:Je},{provide:ge.PrefabConfigProvider,useClass:et},{provide:a.RouteReuseStrategy,useClass:ge.WmRouteReuseStrategy}],bootstrap:[ge.AppComponent]}]}],vt.ctorParameters=function(){return[{type:w.App},{type:t.Injector},{type:ge.ComponentRefProvider}]};var yt="debugMode";"true"!==sessionStorage.getItem(yt)&&t.enableProdMode(),console.time("bootstrap"),document.addEventListener("DOMContentLoaded",(function(){new Promise((function(e){window.cordova?document.addEventListener("deviceready",e):e()})).then((function(){return n.platformBrowserDynamic().bootstrapModule(vt)})).then((function(e){var n=e.injector.get(t.ApplicationRef);window.addEventListener("unload",(function(){n.components.map((function(e){return e&&e.destroy()}))})),console.timeEnd("bootstrap")}),(function(e){return console.log(e)}))})),window.debugMode=function(e){_.isEmpty(e)&&(e=!0);var t=e?"true":"false";sessionStorage.getItem(yt)!==t&&(sessionStorage.setItem(yt,t),window.location.reload())};e.AppExtensionProviderService=Fe,e.AppJSProviderService=Ne,e.AppModule=vt,e.AppResourceManagerService=Me,e.AppVariablesProviderService=Le,e.ComponentRefProviderService=Je,e.PageWrapperComponent=Ie,e.PrefabConfigProviderService=et,e.bsDatePickerModule=at,e.bsDropdownModule=lt,e.carouselModule=ut,e.datepickerModule=rt,e.httpClientXsrfModule=it,e.modalModule=ot,e.ngCircleProgressModule=mt,e.paginationModule=ct,e.popoverModule=ht,e.progressbarModule=dt,e.routerModule=tt,e.timepickerModule=st,e.toastrModule=nt,e.tooltipModule=ft,e.typeaheadModule=pt,e["\u02750"]=$e,e["\u02751"]=We,e["\u02752"]=ze,e["\u02753"]=Ke,e["\u02754"]=Ze,e["\u0275a"]=xe,Object.defineProperty(e,"__esModule",{value:!0})}));
|