var __awaiter=this&&this.__awaiter||function(i,n,t,e){function o(i){return i instanceof t?i:new t((function(n){n(i)}))}return new(t||(t=Promise))((function(t,a){function r(i){try{c(e.next(i))}catch(i){a(i)}}function s(i){try{c(e["throw"](i))}catch(i){a(i)}}function c(i){i.done?t(i.value):o(i.value).then(r,s)}c((e=e.apply(i,n||[])).next())}))};var __generator=this&&this.__generator||function(i,n){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,o,a,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(i){return function(n){return c([i,n])}}function c(s){if(e)throw new TypeError("Generator is already executing.");while(r&&(r=0,s[0]&&(t=0)),t)try{if(e=1,o&&(a=s[0]&2?o["return"]:s[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,s[1])).done)return a;if(o=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;o=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]0){this.durationTimeout=setTimeout((function(){return n.dismiss()}),this.duration+10)}i();return[2]}}))}))};i.prototype.dismiss=function(i,n){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(o){switch(o.label){case 0:return[4,this.lockController.lock()];case 1:t=o.sent();if(this.durationTimeout){clearTimeout(this.durationTimeout)}return[4,m(this,i,n,"loadingLeave",j,z)];case 2:e=o.sent();if(e){this.delegateController.removeViewFromDom()}t();return[2,e]}}))}))};i.prototype.onDidDismiss=function(){return b(this.el,"ionLoadingDidDismiss")};i.prototype.onWillDismiss=function(){return b(this.el,"ionLoadingWillDismiss")};i.prototype.renderLoadingMessage=function(i){var n=this,t=n.customHTMLEnabled,o=n.message;if(t){return e("div",{class:"loading-content",id:i,innerHTML:s(o)})}return e("div",{class:"loading-content",id:i},o)};i.prototype.render=function(){var i;var n=this,t=n.message,a=n.spinner,r=n.htmlAttributes,s=n.overlayIndex;var c=x(this);var d="loading-".concat(s,"-msg");var f=t!==undefined?d:null;return e(o,Object.assign({key:"7d4f3df4a869e66b59ce237b50b374cac4a296d3",role:"dialog","aria-modal":"true","aria-labelledby":f,tabindex:"-1"},r,{style:{zIndex:"".concat(4e4+this.overlayIndex)},onIonBackdropTap:this.onBackdropTap,class:Object.assign(Object.assign({},v(this.cssClass)),(i={},i[c]=true,i["overlay-hidden"]=true,i["loading-translucent"]=this.translucent,i))}),e("ion-backdrop",{key:"9d72026f73b56bc38a5317992caa17068f8402b5",visible:this.showBackdrop,tappable:this.backdropDismiss}),e("div",{key:"67848b3058d4875b55cef88ccc0b5160cc9f5d9d",tabindex:"0"}),e("div",{key:"c275700b6cd77d7a0404b59e89ea97a75a4a22e9",class:"loading-wrapper ion-overlay-wrapper"},a&&e("div",{class:"loading-spinner"},e("ion-spinner",{name:a,"aria-hidden":"true"})),t!==undefined&&this.renderLoadingMessage(d)),e("div",{key:"2333ff2f0d76bebe58cba85da0e5a38262ce33e7",tabindex:"0"}))};Object.defineProperty(i.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(i,"watchers",{get:function(){return{isOpen:["onIsOpenChange"],trigger:["triggerChanged"]}},enumerable:false,configurable:true});return i}());P.style={ios:L,md:T}}}}));