@syncfusion/ej2-popups
Version:
A package of Essential JS 2 popup components such as Dialog and Tooltip that is used to display information or messages in separate pop-ups.
10 lines • 113 kB
JavaScript
/*!
* filename: ej2-popups.min.js
* version : 31.1.17
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("SyncfusionBase"),require("SyncfusionButtons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionButtons"],e):"object"==typeof exports?exports.SyncfusionPopups=e(require("SyncfusionBase"),require("SyncfusionButtons")):t.SyncfusionPopups=e(t.SyncfusionBase,t.SyncfusionButtons)}(self,((t,e)=>(()=>{"use strict";var i={766:e=>{e.exports=t},741:t=>{t.exports=e}},o={};function n(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return i[t](s,s.exports,n),s.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};return(()=>{n.r(s),n.d(s,{Animation:()=>Ie,AnimationSettings:()=>Gt,ButtonProps:()=>Zt,Dialog:()=>ye,DialogUtility:()=>Wt,Popup:()=>$,PositionData:()=>Z,Spinner:()=>gi,Tooltip:()=>Ye,calculatePosition:()=>p,calculateRelativeBasedPosition:()=>d,createSpinner:()=>yi,destroy:()=>q,fit:()=>O,flip:()=>N,getMaxZindex:()=>it,getScrollableParent:()=>tt,getTransformElement:()=>T,getZindexPartial:()=>et,getZoomValue:()=>P,hideSpinner:()=>ki,isCollide:()=>w,setSpinner:()=>Mi,showSpinner:()=>Bi});var t,e,i,o,l,r,a=n(766),h=!1;function d(t,e){var i=!1,o={left:0,top:0},n=t;if(!t||!e)return o;for((0,a.isNullOrUndefined)(e.offsetParent)&&"fixed"===e.style.position&&(i=!0);(e.offsetParent||i)&&t&&e.offsetParent!==t;)o.left+=t.offsetLeft,o.top+=t.offsetTop,t=t.offsetParent;for(t=n;(e.offsetParent||i)&&t&&e.offsetParent!==t;)o.left-=t.scrollLeft,o.top-=t.scrollTop,t=t.parentElement;return o}function p(n,s,l,r,a){if(e=void 0,e=a,h=!!r,!n)return{left:0,top:0};s||(s="left"),l||(l="top"),o=n.ownerDocument,i=n;return function(e,o,n){switch(t=i.getBoundingClientRect(),o+e){case"topcenter":c(C(),n),u(v(),n);break;case"topright":c(E(),n),u(v(),n);break;case"centercenter":c(C(),n),u(y(),n);break;case"centerright":c(E(),n),u(y(),n);break;case"centerleft":c(b(),n),u(y(),n);break;case"bottomcenter":c(C(),n),u(g(),n);break;case"bottomright":c(E(),n),u(g(),n);break;case"bottomleft":c(b(),n),u(g(),n);break;default:c(b(),n),u(v(),n)}return i=null,n}(s.toLowerCase(),l.toLowerCase(),{left:0,top:0})}function c(t,e){e.left=t}function u(t,e){e.top=t}function f(){return o.documentElement.scrollTop||o.body.scrollTop}function m(){return o.documentElement.scrollLeft||o.body.scrollLeft}function g(){return h?t.bottom:t.bottom+f()}function y(){return v()+t.height/2}function v(){return h?t.top:t.top+f()}function b(){return t.left+m()}function E(){var o=i&&((i.classList.contains("e-date-wrapper")||i.classList.contains("e-datetime-wrapper"))&&i.classList.contains("e-rtl")||i.classList.contains("e-ddl")&&i.classList.contains("e-rtl")||i.classList.contains("e-date-range-wrapper"))?e?e.width:0:e&&t.width>=e.width?e.width:0;return i&&i.classList.contains("e-rtl")&&i.classList.contains("e-multiselect")&&(o=e.width),t.right+m()-o}function C(){return b()+t.width/2}function O(t,e,i,o){if(void 0===e&&(e=null),void 0===i&&(i={X:!1,Y:!1}),!i.Y&&!i.X)return{left:0,top:0};var n=t.getBoundingClientRect();if(r=e,l=t.ownerDocument,o||(o=p(t,"left","top")),i.X){var s=r?k():F(),a=A(),h=I(),d=a-o.left,c=o.left+n.width-h;n.width>s?o.left=d>0&&c<=0?h-n.width:c>0&&d<=0?a:d>c?h-n.width:a:d>0?o.left+=d:c>0&&(o.left-=c)}if(i.Y){var u=r?M():j(),f=z(),m=Y(),g=f-o.top,y=o.top+n.height-m;n.height>u?o.top=g>0&&y<=0?m-n.height:y>0&&g<=0?f:g>y?m-n.height:f:g>0?o.top+=g:y>0&&(o.top-=y)}return o}function w(t,e,i,o){void 0===e&&(e=null);var n=p(t,"left","top");i&&(n.left=i),o&&(n.top=o);var s=[];r=e,l=t.ownerDocument;var a=t.getBoundingClientRect(),h=n.top,d=n.left,c=n.left+a.width,u=H(h,n.top+a.height),f=x(d,c);return u.topSide&&s.push("top"),f.rightSide&&s.push("right"),f.leftSide&&s.push("left"),u.bottomSide&&s.push("bottom"),s}function N(t,e,i,o,n,s,a,h,d){if(void 0===a&&(a=null),void 0===h&&(h={X:!0,Y:!0}),e&&t&&n&&s&&(h.X||h.Y)){var c,u={TL:null,TR:null,BL:null,BR:null},f={TL:null,TR:null,BL:null,BR:null};if("none"===window.getComputedStyle(t).display){var m=t.style.visibility;t.style.visibility="hidden",t.style.display="block",c=t.getBoundingClientRect(),t.style.removeProperty("display"),t.style.visibility=m}else c=t.getBoundingClientRect();var g={posX:n,posY:s,offsetX:i,offsetY:o,position:{left:0,top:0}};r=a,l=e.ownerDocument,function(t,e,i,o,n){i.position=p(t,i.posX,i.posY,o,n),e.TL=p(t,"left","top",o,n),e.TR=p(t,"right","top",o,n),e.BR=p(t,"left","bottom",o,n),e.BL=p(t,"right","bottom",o,n)}(e,u,g,d,c),S(f,g,c),h.X&&U(e,f,u,g,c,!0),h.Y&&u.TL.top>-1&&B(e,f,u,g,c,!0),function(t,e,i){var o=0,n=0;if(null!=t.offsetParent&&("absolute"===getComputedStyle(t.offsetParent).position||"relative"===getComputedStyle(t.offsetParent).position)){var s=p(t.offsetParent,"left","top",!1,i);o=s.left,n=s.top}var l=1,r=1,a=T(t);if(a){var h=getComputedStyle(a).transform;if("none"!==h){var d=new DOMMatrix(h);l=d.a,r=d.d}if("none"!==getComputedStyle(a).zoom){var c=P(document.body);l*=c,r*=c}}t.style.top=e.position.top/r+e.offsetY-n/r+"px",t.style.left=e.position.left/l+e.offsetX-o/l+"px"}(t,g,c)}}function P(t){var e=getComputedStyle(t).zoom;return parseFloat(e)||1}function T(t){for(;t;){var e=window.getComputedStyle(t).transform,i=P(document.body);if(e&&"none"!==e||i&&1!==i)return t;if(t===document.body)return null;t=t.offsetParent||t.parentElement}return null}function S(t,e,i){t.TL={top:e.position.top+e.offsetY,left:e.position.left+e.offsetX},t.TR={top:t.TL.top,left:t.TL.left+i.width},t.BL={top:t.TL.top+i.height,left:t.TL.left},t.BR={top:t.TL.top+i.height,left:t.TL.left+i.width}}function x(t,e){var i=!1,o=!1;return t-X()<A()&&(i=!0),e>I()&&(o=!0),{leftSide:i,rightSide:o}}function U(t,e,i,o,n,s){var l=x(e.TL.left,e.TR.left);i.TL.left-X()<=A()&&(l.leftSide=!1),i.TR.left>I()&&(l.rightSide=!1),(l.leftSide&&!l.rightSide||!l.leftSide&&l.rightSide)&&("right"===o.posX?o.posX="left":o.posX="right",o.offsetX=o.offsetX+n.width,o.offsetX=-1*o.offsetX,o.position=p(t,o.posX,o.posY,!1),S(e,o,n),s&&U(t,e,i,o,n,!1))}function B(t,e,i,o,n,s){var l=H(e.TL.top,e.BL.top);i.TL.top-D()<=z()&&(l.topSide=!1),i.BL.top>=Y()&&t.getBoundingClientRect().bottom<window.innerHeight&&(l.bottomSide=!1),(l.topSide&&!l.bottomSide||!l.topSide&&l.bottomSide)&&("top"===o.posY?o.posY="bottom":o.posY="top",o.offsetY=o.offsetY+n.height,o.offsetY=-1*o.offsetY,o.position=p(t,o.posX,o.posY,!1,n),S(e,o,n),s&&B(t,e,i,o,n,!1))}function H(t,e){var i=!1,o=!1;return t-D()<z()&&(i=!0),e>Y()&&(o=!0),{topSide:i,bottomSide:o}}function k(){return r.getBoundingClientRect().width}function M(){return r.getBoundingClientRect().height}function L(){return r.getBoundingClientRect().left}function R(){return r.getBoundingClientRect().top}function z(){return r?R():0}function A(){return r?L():0}function I(){return r?X()+L()+k():X()+F()}function Y(){return r?D()+R()+M():D()+j()}function D(){return l.documentElement.scrollTop||l.body.scrollTop}function X(){return l.documentElement.scrollLeft||l.body.scrollLeft}function j(){return window.innerHeight}function F(){var t=window.innerWidth,e=document.documentElement.getBoundingClientRect();return t-(t-((0,a.isNullOrUndefined)(document.documentElement)?0:e.width))}function q(){r=null,l=null}var W,V=(W=function(t,e){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},W(t,e)},function(t,e){function i(){this.constructor=t}W(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),_=function(t,e,i,o){var n,s=arguments.length,l=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(l=(s<3?n(l):s>3?n(e,i,l):n(e,i))||l);return s>3&&l&&Object.defineProperty(e,i,l),l},Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),_([(0,a.Property)("left")],e.prototype,"X",void 0),_([(0,a.Property)("top")],e.prototype,"Y",void 0),e}(a.ChildProperty),G="e-popup",K="e-rtl",J="e-popup-open",Q="e-popup-close",$=function(t){function e(e,i){return t.call(this,i,e)||this}return V(e,t),e.prototype.onPropertyChanged=function(t,e){for(var i=0,o=Object.keys(t);i<o.length;i++){switch(o[i]){case"width":(0,a.setStyleAttribute)(this.element,{width:(0,a.formatUnit)(t.width)});break;case"height":(0,a.setStyleAttribute)(this.element,{height:(0,a.formatUnit)(t.height)});break;case"zIndex":(0,a.setStyleAttribute)(this.element,{zIndex:t.zIndex});break;case"enableRtl":this.setEnableRtl();break;case"position":case"relateTo":this.refreshPosition();break;case"offsetX":var n=t.offsetX-e.offsetX;this.element.style.left=(parseInt(this.element.style.left,10)+n).toString()+"px";break;case"offsetY":var s=t.offsetY-e.offsetY;this.element.style.top=(parseInt(this.element.style.top,10)+s).toString()+"px";break;case"content":this.setContent();break;case"actionOnScroll":"none"!==t.actionOnScroll?this.wireScrollEvents():this.unwireScrollEvents()}}},e.prototype.getModuleName=function(){return"popup"},e.prototype.resolveCollision=function(){this.checkCollision()},e.prototype.getPersistData=function(){return this.addOnPersist([])},e.prototype.destroy=function(){this.element.classList.contains("e-popup-open")&&this.unwireEvents(),this.element.classList.remove(G,K,J,Q),this.content=null,this.relateTo=null,q(),t.prototype.destroy.call(this)},e.prototype.render=function(){this.element.classList.add(G);var t={};1e3!==this.zIndex&&(t.zIndex=this.zIndex),"auto"!==this.width&&(t.width=(0,a.formatUnit)(this.width)),"auto"!==this.height&&(t.height=(0,a.formatUnit)(this.height)),(0,a.setStyleAttribute)(this.element,t),this.fixedParent=!1,this.setEnableRtl(),this.setContent()},e.prototype.wireEvents=function(){a.Browser.isDevice&&a.EventHandler.add(window,"orientationchange",this.orientationOnChange,this),"none"!==this.actionOnScroll&&this.wireScrollEvents()},e.prototype.wireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,e=this.getScrollableParent(this.getRelateToElement());t<e.length;t++){var i=e[t];a.EventHandler.add(i,"scroll",this.scrollRefresh,this)}},e.prototype.unwireEvents=function(){a.Browser.isDevice&&a.EventHandler.remove(window,"orientationchange",this.orientationOnChange),"none"!==this.actionOnScroll&&this.unwireScrollEvents()},e.prototype.unwireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,e=this.getScrollableParent(this.getRelateToElement());t<e.length;t++){var i=e[t];a.EventHandler.remove(i,"scroll",this.scrollRefresh)}},e.prototype.getRelateToElement=function(){var t=""===this.relateTo||(0,a.isNullOrUndefined)(this.relateTo)?document.body:this.relateTo;return this.setProperties({relateTo:t},!0),"string"==typeof this.relateTo?document.querySelector(this.relateTo):this.relateTo},e.prototype.scrollRefresh=function(t){if("reposition"===this.actionOnScroll?(0,a.isNullOrUndefined)(this.element)||this.element.offsetParent===t.target||this.element.offsetParent&&"BODY"===this.element.offsetParent.tagName&&null==t.target.parentElement||this.refreshPosition():"hide"===this.actionOnScroll&&this.hide(),"none"!==this.actionOnScroll&&this.getRelateToElement()){var e=this.isElementOnViewport(this.getRelateToElement(),t.target);e||this.targetInvisibleStatus?e&&(this.targetInvisibleStatus=!1):(this.trigger("targetExitViewport"),this.targetInvisibleStatus=!0)}},e.prototype.isElementOnViewport=function(t,e){for(var i=this.getScrollableParent(t),o=0;o<i.length;o++)if(!this.isElementVisible(t,i[o]))return!1;return!0},e.prototype.isElementVisible=function(t,e){var i=this.checkGetBoundingClientRect(t);if(!i.height||!i.width)return!1;if((0,a.isNullOrUndefined)(this.checkGetBoundingClientRect(e))){var o=window,n={top:o.scrollY,left:o.scrollX,right:o.scrollX+o.outerWidth,bottom:o.scrollY+o.outerHeight},s=p(t),l={top:s.top,left:s.left,right:s.left+i.width,bottom:s.top+i.height},r={top:n.bottom-l.top,left:n.right-l.left,bottom:l.bottom-n.top,right:l.right-n.left};return r.top>0&&r.left>0&&r.right>0&&r.bottom>0}var h=e.getBoundingClientRect();return!(i.bottom<h.top||i.bottom>h.bottom||i.right>h.right||i.left<h.left)},e.prototype.preRender=function(){},e.prototype.setEnableRtl=function(){this.reposition(),this.enableRtl?this.element.classList.add(K):this.element.classList.remove(K)},e.prototype.setContent=function(){if(!(0,a.isNullOrUndefined)(this.content))if(this.element.innerHTML="","string"==typeof this.content)this.element.textContent=this.content;else{var t=this.getRelateToElement(),e=this.content.props;t.classList.contains("e-dropdown-btn")&&!(0,a.isNullOrUndefined)(e)||this.element.appendChild(this.content)}},e.prototype.orientationOnChange=function(){var t=this;setTimeout((function(){t.refreshPosition()}),200)},e.prototype.refreshPosition=function(t,e){(0,a.isNullOrUndefined)(t)||this.checkFixedParent(t),this.reposition(),e||this.checkCollision()},e.prototype.reposition=function(){var t,e,i=this.getRelateToElement();if("number"==typeof this.position.X&&"number"==typeof this.position.Y)t={left:this.position.X,top:this.position.Y};else if("string"==typeof this.position.X&&"number"==typeof this.position.Y||"number"==typeof this.position.X&&"string"==typeof this.position.Y){var o=void 0,n=this.element.style.display;this.element.style.display="block",this.element.classList.contains("e-dlg-modal")&&(o=this.element.parentElement.style.display,this.element.parentElement.style.display="block"),e=this.getAnchorPosition(i,this.element,this.position,this.offsetX,this.offsetY),t="string"==typeof this.position.X?{left:e.left,top:this.position.Y}:{left:this.position.X,top:e.top},this.element.style.display=n,this.element.classList.contains("e-dlg-modal")&&(this.element.parentElement.style.display=o)}else if(i){var s=this.element.clientHeight;n=this.element.style.display;this.element.style.display="block",t=this.getAnchorPosition(i,this.element,this.position,this.offsetX,this.offsetY,s),this.element.style.display=n}else t={left:0,top:0};(0,a.isNullOrUndefined)(t)||(this.element.style.left=t.left+"px",this.element.style.top=t.top+"px")},e.prototype.checkGetBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(t){return null}},e.prototype.getAnchorPosition=function(t,e,i,o,n,s){void 0===s&&(s=0);var l=this.checkGetBoundingClientRect(e),r=this.checkGetBoundingClientRect(t);if((0,a.isNullOrUndefined)(l)||(0,a.isNullOrUndefined)(r))return null;var h=t,c={left:0,top:0};switch(e.offsetParent&&"BODY"===e.offsetParent.tagName&&"BODY"===t.tagName?c=p(t):(e.classList.contains("e-dlg-modal")&&"BODY"!==h.tagName&&(e=e.parentElement),c=d(h,e)),i.X){default:case"left":break;case"center":e.classList.contains("e-dlg-modal")&&"BODY"===h.tagName&&"container"===this.targetType?c.left+=window.innerWidth/2-l.width/2:"container"===this.targetType?c.left+=r.width/2-l.width/2:c.left+=r.width/2;break;case"right":if(e.classList.contains("e-dlg-modal")&&"BODY"===h.tagName&&"container"===this.targetType)c.left+=window.innerWidth-l.width;else if("container"===this.targetType){var u=1,f=T(e);if(f){var m=getComputedStyle(f).transform;if("none"!==m)u=new DOMMatrix(m).a;if("none"!==getComputedStyle(f).zoom)u*=P(document.body)}c.left+=(r.width-l.width)/u}else c.left+=r.width}switch(i.Y){default:case"top":break;case"center":e.classList.contains("e-dlg-modal")&&"BODY"===h.tagName&&"container"===this.targetType?c.top+=window.innerHeight/2-l.height/2:"container"===this.targetType?c.top+=r.height/2-l.height/2:c.top+=r.height/2;break;case"bottom":e.classList.contains("e-dlg-modal")&&"BODY"===h.tagName&&"container"===this.targetType?c.top+=window.innerHeight-l.height:"container"!==this.targetType||e.classList.contains("e-dialog")?"container"===this.targetType&&e.classList.contains("e-dialog")?c.top+=r.height-s:c.top+=r.height:c.top+=r.height-l.height}return c.left+=o,c.top+=n,c},e.prototype.callFlip=function(t){var e=this.getRelateToElement();N(this.element,e,this.offsetX,this.offsetY,this.position.X,this.position.Y,this.viewPortElement,t,this.fixedParent)},e.prototype.callFit=function(t){if(0!==w(this.element,this.viewPortElement).length)if((0,a.isNullOrUndefined)(this.viewPortElement)){var e=O(this.element,this.viewPortElement,t);t.X&&(this.element.style.left=e.left+"px"),t.Y&&(this.element.style.top=e.top+"px")}else{var i=this.checkGetBoundingClientRect(this.element),o=this.checkGetBoundingClientRect(this.viewPortElement);if((0,a.isNullOrUndefined)(i)||(0,a.isNullOrUndefined)(o))return null;t&&!0===t.Y&&(o.top>i.top?this.element.style.top="0px":o.bottom<i.bottom&&(this.element.style.top=parseInt(this.element.style.top,10)-(i.bottom-o.bottom)+"px")),t&&!0===t.X&&(o.right<i.right?this.element.style.left=parseInt(this.element.style.left,10)-(i.right-o.right)+"px":o.left>i.left&&(this.element.style.left=parseInt(this.element.style.left,10)+(o.left-i.left)+"px"))}},e.prototype.checkCollision=function(){var t=this.collision.X,e=this.collision.Y;"none"===t&&"none"===e||("flip"===t&&"flip"===e?this.callFlip({X:!0,Y:!0}):"fit"===t&&"fit"===e?this.callFit({X:!0,Y:!0}):("flip"===t?this.callFlip({X:!0,Y:!1}):"flip"===e&&this.callFlip({Y:!0,X:!1}),"fit"===t?this.callFit({X:!0,Y:!1}):"fit"===e&&this.callFit({X:!1,Y:!0})))},e.prototype.show=function(t,e){var i=this;if(this.wireEvents(),this.getRelateToElement(),1e3===this.zIndex||!(0,a.isNullOrUndefined)(e)){var o=(0,a.isNullOrUndefined)(e)?this.element:e;this.zIndex=et(o),(0,a.setStyleAttribute)(this.element,{zIndex:this.zIndex})}t=(0,a.isNullOrUndefined)(t)||"object"!=typeof t?this.showAnimation:t,"none"===this.collision.X&&"none"===this.collision.Y||((0,a.removeClass)([this.element],Q),(0,a.addClass)([this.element],J),this.checkCollision(),(0,a.removeClass)([this.element],J),(0,a.addClass)([this.element],Q)),(0,a.isNullOrUndefined)(t)?((0,a.removeClass)([this.element],Q),(0,a.addClass)([this.element],J),this.trigger("open")):(t.begin=function(){i.isDestroyed||((0,a.removeClass)([i.element],Q),(0,a.addClass)([i.element],J))},t.end=function(){i.isDestroyed||i.trigger("open")},new a.Animation(t).animate(this.element))},e.prototype.hide=function(t){var e=this;t=(0,a.isNullOrUndefined)(t)||"object"!=typeof t?this.hideAnimation:t,(0,a.isNullOrUndefined)(t)?((0,a.removeClass)([this.element],J),(0,a.addClass)([this.element],Q),this.trigger("close")):(t.end=function(){e.isDestroyed||((0,a.removeClass)([e.element],J),(0,a.addClass)([e.element],Q),e.trigger("close"))},new a.Animation(t).animate(this.element)),this.unwireEvents()},e.prototype.getScrollableParent=function(t){return this.checkFixedParent(t),tt(t,this.fixedParent)},e.prototype.checkFixedParent=function(t){for(var e=t.parentElement;e&&"HTML"!==e.tagName;){var i=getComputedStyle(e);"fixed"!==i.position&&"sticky"!==i.position||(0,a.isNullOrUndefined)(this.element)||!this.element.offsetParent||"BODY"!==this.element.offsetParent.tagName||"hidden"===getComputedStyle(this.element.offsetParent).overflow||(this.element.style.top=window.scrollY>parseInt(this.element.style.top,10)?(0,a.formatUnit)(window.scrollY-parseInt(this.element.style.top,10)):(0,a.formatUnit)(parseInt(this.element.style.top,10)-window.scrollY),this.element.style.position="fixed",this.fixedParent=!0),e=e.parentElement,!(0,a.isNullOrUndefined)(this.element)&&(0,a.isNullOrUndefined)(this.element.offsetParent)&&"fixed"===i.position&&"fixed"===this.element.style.position&&(this.fixedParent=!0)}},_([(0,a.Property)("auto")],e.prototype,"height",void 0),_([(0,a.Property)("auto")],e.prototype,"width",void 0),_([(0,a.Property)(null)],e.prototype,"content",void 0),_([(0,a.Property)("container")],e.prototype,"targetType",void 0),_([(0,a.Property)(null)],e.prototype,"viewPortElement",void 0),_([(0,a.Property)({X:"none",Y:"none"})],e.prototype,"collision",void 0),_([(0,a.Property)("")],e.prototype,"relateTo",void 0),_([(0,a.Complex)({},Z)],e.prototype,"position",void 0),_([(0,a.Property)(0)],e.prototype,"offsetX",void 0),_([(0,a.Property)(0)],e.prototype,"offsetY",void 0),_([(0,a.Property)(1e3)],e.prototype,"zIndex",void 0),_([(0,a.Property)(!1)],e.prototype,"enableRtl",void 0),_([(0,a.Property)("reposition")],e.prototype,"actionOnScroll",void 0),_([(0,a.Property)(null)],e.prototype,"showAnimation",void 0),_([(0,a.Property)(null)],e.prototype,"hideAnimation",void 0),_([(0,a.Event)()],e.prototype,"open",void 0),_([(0,a.Event)()],e.prototype,"close",void 0),_([(0,a.Event)()],e.prototype,"targetExitViewport",void 0),e=_([a.NotifyPropertyChanges],e)}(a.Component);function tt(t,e){for(var i=getComputedStyle(t),o=[],n=/(auto|scroll)/,s=t.parentElement;s&&"HTML"!==s.tagName;){var l=getComputedStyle(s);"absolute"===i.position&&"static"===l.position||!n.test(l.overflow+l.overflowY+l.overflowX)||o.push(s),s=s.parentElement}return e||o.push(document),o}function et(t){for(var e=t.parentElement,i=[];e&&"BODY"!==e.tagName;){var o=document.defaultView.getComputedStyle(e,null).getPropertyValue("z-index"),n=document.defaultView.getComputedStyle(e,null).getPropertyValue("position");"auto"!==o&&"static"!==n&&i.push(o),e=e.parentElement}for(var s=[],l=0;l<document.body.children.length;l++)if(!t.isEqualNode(document.body.children[l])){o=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("z-index"),n=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("position");"auto"!==o&&"static"!==n&&s.push(o)}s.push("999");var r=[];if(!(0,a.isNullOrUndefined)(t.parentElement)&&"BODY"!==t.parentElement.tagName){var h=[].slice.call(t.parentElement.children);for(l=0;l<h.length;l++)if(!t.isEqualNode(h[l])){o=document.defaultView.getComputedStyle(h[l],null).getPropertyValue("z-index"),n=document.defaultView.getComputedStyle(h[l],null).getPropertyValue("position");"auto"!==o&&"static"!==n&&r.push(o)}}var d=i.concat(s,r),p=Math.max.apply(Math,d)+1;return p>2147483647?2147483647:p}function it(t){void 0===t&&(t=["*"]);for(var e=[],i=0;i<t.length;i++)for(var o=document.getElementsByTagName(t[i]),n=0;n<o.length;n++){var s=document.defaultView.getComputedStyle(o[n],null).getPropertyValue("z-index"),l=document.defaultView.getComputedStyle(o[n],null).getPropertyValue("position");"auto"!==s&&"static"!==l&&e.push(s)}var r=Math.max.apply(Math,e)+1;return r>2147483647?2147483647:r}var ot,nt,st,lt,rt,at,ht,dt,pt=n(741),ct=["north-west","north","north-east","west","east","south-west","south","south-east"],ut="e-resize-handle",ft="e-focused-handle",mt=["e-restrict-left"],gt="e-resize-viewport",yt=["north","west","east","south"],vt=0,bt=0,Et=0,Ct=0,Ot=0,wt=0,Nt=null,Pt=null,Tt=null,St=!0,xt=0,Ut=!0;function Bt(t){zt();var e=(0,a.createElement)("span",{attrs:{unselectable:"on",contenteditable:"false"}});e.setAttribute("class","e-dialog-border-resize e-"+t),"south"===t&&(e.style.height="2px",e.style.width="100%",e.style.bottom="0px",e.style.left="0px"),"north"===t&&(e.style.height="2px",e.style.width="100%",e.style.top="0px",e.style.left="0px"),"east"===t&&(e.style.height="100%",e.style.width="2px",e.style.right="0px",e.style.top="0px"),"west"===t&&(e.style.height="100%",e.style.width="2px",e.style.left="0px",e.style.top="0px"),ot.appendChild(e)}function Ht(t){var e;return(0,a.isNullOrUndefined)(t)||(e="string"==typeof t?document.querySelector(t):t),e}function kt(t){for(var e=t||this,i=ot.querySelectorAll("."+ut),o=0;o<i.length;o++){nt=i[o],a.EventHandler.add(nt,"mousedown",Lt,e);var n="msie"===a.Browser.info.name?"pointerdown":"touchstart";a.EventHandler.add(nt,n,At,e)}var s=ot.querySelectorAll(".e-dialog-border-resize");if(!(0,a.isNullOrUndefined)(s))for(o=0;o<s.length;o++){nt=s[o],a.EventHandler.add(nt,"mousedown",Lt,e);n="msie"===a.Browser.info.name?"pointerdown":"touchstart";a.EventHandler.add(nt,n,At,e)}}function Mt(t){return t.indexOf("mouse")>-1?"mouse":"touch"}function Lt(t){if(t.preventDefault(),ot=t.target.parentElement,zt(),Ot=t.pageX,wt=t.pageY,t.target.classList.add(ft),!(0,a.isNullOrUndefined)(Nt)){if(!0===Nt(t,this))return}this.targetEle&&ot&&ot.querySelector(".e-dlg-resizable")&&(ht="body"===this.target?null:this.targetEle,at=this.targetEle.clientWidth,lt=this.targetEle.clientHeight);var e=(0,a.isNullOrUndefined)(ht)?document:ht;a.EventHandler.add(e,"mousemove",It,this),a.EventHandler.add(document,"mouseup",Rt,this);for(var i=0;i<mt.length;i++)St=!ot.classList.contains(mt[i])}function Rt(t){var e="msie"===a.Browser.info.name?"pointermove":"touchmove",i="msie"===a.Browser.info.name?"pointerup":"touchend",o=(0,a.isNullOrUndefined)(ht)?document:ht,n="msie"===a.Browser.info.name?"pointerdown":"touchstart";if(a.EventHandler.remove(o,"mousemove",It),a.EventHandler.remove(o,e,It),a.EventHandler.remove(o,n,It),(0,a.isNullOrUndefined)(document.body.querySelector("."+ft))||document.body.querySelector("."+ft).classList.remove(ft),!(0,a.isNullOrUndefined)(Tt)){Tt(t,this)}a.EventHandler.remove(document,"mouseup",Rt),a.EventHandler.remove(document,i,Rt)}function zt(){vt=parseFloat(getComputedStyle(ot,null).getPropertyValue("width").replace("px","")),bt=parseFloat(getComputedStyle(ot,null).getPropertyValue("height").replace("px","")),Et=ot.getBoundingClientRect().left,Ct=ot.getBoundingClientRect().top}function At(t){ot=t.target.parentElement,zt();var e=ot.classList.contains("e-dialog");(t.target.classList.contains(ut)||t.target.classList.contains("e-dialog-border-resize"))&&e&&t.target.classList.add(ft);var i=t.touches?t.changedTouches[0]:t;if(Ot=i.pageX,wt=i.pageY,!(0,a.isNullOrUndefined)(Nt)){if(!0===Nt(t,this))return}var o="msie"===a.Browser.info.name?"pointermove":"touchmove",n="msie"===a.Browser.info.name?"pointerup":"touchend",s=(0,a.isNullOrUndefined)(ht)?document:ht;a.EventHandler.add(s,o,It,this),a.EventHandler.add(document,n,Rt,this)}function It(t){if(t.target.classList.contains(ut)&&t.target.classList.contains(ft)?nt=t.target:(0,a.isNullOrUndefined)(document.body.querySelector("."+ft))||(nt=document.body.querySelector("."+ft)),!(0,a.isNullOrUndefined)(nt)){for(var e="",i=0;i<ct.length;i++)nt.classList.contains("e-"+ct[i])&&(e=ct[i]);if(!(0,a.isNullOrUndefined)(Pt)){Pt(t,this)}switch(e){case"south":Dt(t);break;case"north":Xt(t);break;case"west":jt(t);break;case"east":Ft(t);break;case"south-east":Dt(t),Ft(t);break;case"south-west":Dt(t),jt(t);break;case"north-east":Xt(t),Ft(t);break;case"north-west":Xt(t),jt(t)}}}function Yt(t){return t.getBoundingClientRect()}function Dt(t){var e,i=document.documentElement.clientHeight,o=!1,n=(t.touches?t.changedTouches[0]:t).pageY,s=Yt(ot);(0,a.isNullOrUndefined)(ht)||(e=Yt(ht)),(0,a.isNullOrUndefined)(ht)?(0,a.isNullOrUndefined)(ht)&&(i-n>=0||s.top<0)&&(o=!0):o=!0;var l=bt+(n-wt);l=l>st?l:st;var r=0;(0,a.isNullOrUndefined)(ht)||(r=e.top);var h=(0,a.isNullOrUndefined)(ht)?0:ht.offsetHeight-ht.clientHeight,d=s.top-r-h/2;if(d=d<0?0:d,s.top>0&&d+l>lt){if(o=!1,ot.classList.contains(gt))return;ot.style.height=lt-parseInt(d.toString(),10)+"px"}else{var p=0;if(o){s.top<0&&i+(s.height+s.top)>0&&l+(p=s.top)<=30&&(l=s.height-(s.height+s.top)+30),l+s.top>=lt&&(ot.style.height=s.height+(i-(s.height+s.top))+"px");var c=(0,a.isNullOrUndefined)(ht)?p:d;l>=st&&l+c<=lt&&(ot.style.height=l+"px")}}}function Xt(t){var e,i=!1,o="mouse"===Mt(t.type)?t.pageY:t.touches[0].pageY,n=Yt(ot),s=(0,a.isNullOrUndefined)(ht)?0:ht.offsetHeight-ht.clientHeight;(0,a.isNullOrUndefined)(ht)||(e=Yt(ht)),(!(0,a.isNullOrUndefined)(ht)&&n.top-e.top>0||(0,a.isNullOrUndefined)(ht)&&o>0||!(0,a.isNullOrUndefined)(ht)&&Math.floor(n.top-e.top+n.height+(e.bottom-n.bottom))-s<=lt)&&(i=!0);var l=bt-(o-wt);if(i&&l>=st&&l<=lt){var r=0;(0,a.isNullOrUndefined)(ht)||(r=e.top);var h=Ct-r+(o-wt);h=h>0?h:1,ot.style.height=l+"px",ot.style.top=h+"px"}}function jt(t){var e,i=document.documentElement.clientWidth,o=!1;(0,a.isNullOrUndefined)(ht)||(e=Yt(ht));var n="mouse"===Mt(t.type)?t.pageX:t.touches[0].pageX,s=Yt(ot),l=(0,a.isNullOrUndefined)(ht)?0:ht.offsetWidth-ht.clientWidth,r=(0,a.isNullOrUndefined)(ht)?0:e.left,h=(0,a.isNullOrUndefined)(ht)?0:e.width;(0,a.isNullOrUndefined)(dt)&&((0,a.isNullOrUndefined)(ht)?dt=i:(dt=s.left-r-l/2+s.width,dt+=h-l-dt)),(!(0,a.isNullOrUndefined)(ht)&&Math.floor(s.left-e.left+s.width+(e.right-s.right))-l<=at||(0,a.isNullOrUndefined)(ht)&&n>=0)&&(o=!0);var d=vt-(n-Ot);if(St&&(d=d>dt?dt:d),o&&d>=rt&&d<=at){var p=0;(0,a.isNullOrUndefined)(ht)||(p=e.left);var c=Et-p+(n-Ot);c=c>0?c:1,d!==xt&&Ut&&(ot.style.width=d+"px"),St&&(ot.style.left=c+"px",Ut=1!==c)}xt=d}function Ft(t){var e,i=document.documentElement.clientWidth,o=!1;(0,a.isNullOrUndefined)(ht)||(e=Yt(ht));var n=(t.touches?t.changedTouches[0]:t).pageX,s=Yt(ot);(!(0,a.isNullOrUndefined)(ht)&&(s.left-e.left+s.width<=at||s.right-e.left>=s.width)||(0,a.isNullOrUndefined)(ht)&&i-n>0)&&(o=!0);var l=vt+(n-Ot),r=0;if((0,a.isNullOrUndefined)(ht)||(r=e.left),s.left-r+l>at){if(o=!1,ot.classList.contains(gt))return;ot.style.width=at-(s.left-r)+"px"}o&&l>=rt&&l<=at&&(ot.style.width=l+"px")}function qt(){for(var t=ot.querySelectorAll("."+ut),e=0;e<t.length;e++)(0,a.detach)(t[e]);var i=ot.querySelectorAll(".e-dialog-border-resize");if(!(0,a.isNullOrUndefined)(i))for(e=0;e<i.length;e++)(0,a.detach)(i[e])}var Wt,Vt=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},t(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_t=function(t,e,i,o){var n,s=arguments.length,l=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(l=(s<3?n(l):s>3?n(e,i,l):n(e,i))||l);return s>3&&l&&Object.defineProperty(e,i,l),l},Zt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Vt(e,t),_t([(0,a.Property)(!0)],e.prototype,"isFlat",void 0),_t([(0,a.Property)()],e.prototype,"buttonModel",void 0),_t([(0,a.Property)("Button")],e.prototype,"type",void 0),_t([(0,a.Event)()],e.prototype,"click",void 0),e}(a.ChildProperty),Gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Vt(e,t),_t([(0,a.Property)("Fade")],e.prototype,"effect",void 0),_t([(0,a.Property)(400)],e.prototype,"duration",void 0),_t([(0,a.Property)(0)],e.prototype,"delay",void 0),e}(a.ChildProperty),Kt="e-dialog",Jt="e-rtl",Qt="e-dlg-header-content",$t="e-dlg-header",te="e-footer-content",ee="e-dlg-modal",ie="e-icon-dlg-close",oe="e-dlg-target",ne="e-scroll-disabled",se="e-device",le="e-dlg-fullscreen",re="e-dlg-closeicon-btn",ae="e-popup-open",he="Information",de="e-scroll-disabled",pe="e-alert-dialog",ce="e-confirm-dialog",ue="e-dlg-resizable",fe="e-restrict-left",me="e-resize-viewport",ge="user action",ye=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o.needsID=!0,o}return Vt(e,t),e.prototype.render=function(){this.initialize(),this.initRender(),this.wireEvents(),"100%"===this.width&&(this.element.style.width=""),""!==this.minHeight&&(this.element.style.minHeight=(0,a.formatUnit)(this.minHeight)),this.enableResize&&(this.setResize(),this.isModal&&(this.isModelResize=!0),"None"===this.animationSettings.effect&&this.getMinHeight()),this.renderComplete()},e.prototype.initializeValue=function(){this.dlgClosedBy=ge},e.prototype.preRender=function(){var t=this;this.initializeValue(),this.headerContent=null,this.allowMaxHeight=!0,this.preventVisibility=!0,this.clonedEle=this.element.cloneNode(!0),this.closeIconClickEventHandler=function(e){t.dlgClosedBy="close icon",t.hide(e)},this.dlgOverlayClickEventHandler=function(e){t.dlgClosedBy="overlayClick",e.preventFocus=!1,t.trigger("overlayClick",e,(function(e){e.preventFocus||t.focusContent(),t.dlgClosedBy=ge}))};if(this.l10n=new a.L10n("dialog",{close:"Close"},this.locale),this.checkPositionData(),(0,a.isNullOrUndefined)(this.target)){var e=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.target=document.body,this.isProtectedOnChange=e}},e.prototype.updatePersistData=function(){this.enablePersistence&&this.setProperties({width:parseFloat(this.element.style.width),height:parseFloat(this.element.style.height),position:{X:parseFloat(this.dragObj.element.style.left),Y:parseFloat(this.dragObj.element.style.top)}},!0)},e.prototype.isNumberValue=function(t){return/^[-+]?\d*\.?\d+$/.test(t)},e.prototype.checkPositionData=function(){if(!(0,a.isNullOrUndefined)(this.position)){if(!(0,a.isNullOrUndefined)(this.position.X)&&"number"!=typeof this.position.X)if(this.isNumberValue(this.position.X)){var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.position.X=parseFloat(this.position.X),this.isProtectedOnChange=t}if(!(0,a.isNullOrUndefined)(this.position.Y)&&"number"!=typeof this.position.Y)if(this.isNumberValue(this.position.Y)){t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.position.Y=parseFloat(this.position.Y),this.isProtectedOnChange=t}}},e.prototype.getEle=function(t,e){for(var i=void 0,o=0;o<t.length;o++)if(t[o].classList.contains(e)){i=t[o];break}return i},e.prototype.getMinHeight=function(){var t="0px",e="0px";(0,a.isNullOrUndefined)(this.element.querySelector("."+Qt))||(t=getComputedStyle(this.headerContent).height);var i=this.getEle(this.element.children,te);(0,a.isNullOrUndefined)(i)||(e=getComputedStyle(i).height);var o,n=parseInt(t.slice(0,t.indexOf("p")),10),s=parseInt(e.slice(0,e.indexOf("p")),10);return o=n+30+(isNaN(s)?0:s),st=o,n+30+s},e.prototype.onResizeStart=function(t,e){if(e.trigger("resizeStart",t),!t.cancel&&this.isModelResize&&!(0,a.isNullOrUndefined)(this.dlgContainer)&&this.dlgContainer.classList.contains("e-dlg-"+this.position.X+"-"+this.position.Y)){this.setPopupPosition(),this.dlgContainer.classList.remove("e-dlg-"+this.position.X+"-"+this.position.Y);var i=this.getTargetContainer(this.target);if(i instanceof Element)"rtl"===window.getComputedStyle(i).getPropertyValue("direction")?this.element.style.position="absolute":this.element.style.position="relative";else this.element.style.position="relative";this.element.classList.contains(fe)&&this.element.classList.remove(fe),this.isModelResize=!1}return t.cancel},e.prototype.onResizing=function(t,e){e.trigger("resizing",t)},e.prototype.onResizeComplete=function(t,e){e.trigger("resizeStop",t),this.updatePersistData()},e.prototype.setResize=function(){if(this.enableResize){this.element.classList.add(ue);for(var t=getComputedStyle(this.element).minHeight,e=getComputedStyle(this.element).minWidth,i="",o=0;o<this.resizeHandles.length;o++){if("All"===this.resizeHandles[o]){i="south north east west north-east north-west south-east south-west";break}var n="";switch(this.resizeHandles[o].toString()){case"SouthEast":n="south-east";break;case"SouthWest":n="south-west";break;case"NorthEast":n="north-east";break;case"NorthWest":n="north-west";break;default:n=this.resizeHandles[o].toString()}i+=n.toLocaleLowerCase()+" "}this.enableRtl&&"south-east"===i.trim()?i="south-west":this.enableRtl&&"south-west"===i.trim()&&(i="south-east"),this.isModal&&this.enableRtl?this.element.classList.add(fe):this.isModal&&this.target===document.body&&this.element.classList.add(me),function(t){Nt=t.resizeBegin,Pt=t.resizing,Tt=t.resizeComplete,ot=Ht(t.element),ht=Ht(t.boundary);for(var e=t.direction.split(" "),i=0;i<e.length;i++)if(yt.indexOf(e[i])>=0&&e[i])Bt(e[i]);else if(""!==e[i].trim()){var o=(0,a.createElement)("div",{className:"e-icons "+ut+" e-"+e[i]});ot.appendChild(o)}st=t.minHeight,rt=t.minWidth,at=t.maxWidth,lt=t.maxHeight,t.proxy&&t.proxy.element&&t.proxy.element.classList.contains("e-dialog")?kt(t.proxy):kt()}({element:this.element,direction:i,minHeight:parseInt(t.slice(0,e.indexOf("p")),10),maxHeight:this.targetEle.clientHeight,minWidth:parseInt(e.slice(0,e.indexOf("p")),10),maxWidth:this.targetEle.clientWidth,boundary:this.target===document.body?null:this.targetEle,resizeBegin:this.onResizeStart.bind(this),resizeComplete:this.onResizeComplete.bind(this),resizing:this.onResizing.bind(this),proxy:this}),this.wireWindowResizeEvent()}else qt(),this.unWireWindowResizeEvent(),this.isModal?this.element.classList.remove(fe):this.element.classList.remove(me),this.element.classList.remove(ue)},e.prototype.getFocusElement=function(t){var e=t.querySelectorAll('input,select,textarea,button:enabled,a,[contenteditable="true"],[tabindex]');return{element:e[e.length-1]}},e.prototype.keyDown=function(t){var e=this;if(9===t.keyCode&&this.isModal){var i=void 0;(0,a.isNullOrUndefined)(this.btnObj)||(i=this.btnObj[this.btnObj.length-1]),(0,a.isNullOrUndefined)(this.btnObj)&&!(0,a.isNullOrUndefined)(this.ftrTemplateContent)&&(i=this.getFocusElement(this.ftrTemplateContent)),(0,a.isNullOrUndefined)(this.btnObj)&&(0,a.isNullOrUndefined)(this.ftrTemplateContent)&&!(0,a.isNullOrUndefined)(this.contentEle)&&(i=this.getFocusElement(this.contentEle)),(0,a.isNullOrUndefined)(i)||document.activeElement!==i.element||t.shiftKey||(t.preventDefault(),this.focusableElements(this.element).focus()),document.activeElement===this.focusableElements(this.element)&&t.shiftKey&&(t.preventDefault(),(0,a.isNullOrUndefined)(i)||i.element.focus())}var o,n=document.activeElement,s=["input","textarea"].indexOf(n.tagName.toLowerCase())>-1,l=!1;if(s||(l=n.hasAttribute("contenteditable")&&"true"===n.getAttribute("contenteditable")),27===t.keyCode&&this.closeOnEscape){this.dlgClosedBy="escape";var r=document.querySelector(".e-popup-open:not(.e-dialog)");((0,a.isNullOrUndefined)(r)||r.classList.contains("e-toolbar-pop")||r.classList.contains("e-slider-tooltip"))&&this.hide(t)}(13===t.keyCode&&!t.ctrlKey&&"textarea"!==n.tagName.toLowerCase()&&s&&!(0,a.isNullOrUndefined)(this.primaryButtonEle)||13===t.keyCode&&t.ctrlKey&&("textarea"===n.tagName.toLowerCase()||l)&&!(0,a.isNullOrUndefined)(this.primaryButtonEle))&&(this.buttons.some((function(t,e){o=e;var i=t.buttonModel;return!(0,a.isNullOrUndefined)(i)&&!0===i.isPrimary}))&&"function"==typeof this.buttons[o].click&&!this.primaryButtonEle.disabled&&setTimeout((function(){e.buttons[o].click.call(e,t)})))},e.prototype.initialize=function(){(0,a.isNullOrUndefined)(this.target)||(this.targetEle="string"==typeof this.target?document.querySelector(this.target):this.target),this.isBlazorServerRender()||(0,a.addClass)([this.element],Kt),a.Browser.isDevice&&(0,a.addClass)([this.element],se),this.isBlazorServerRender()||this.setCSSClass(),this.setMaxHeight()},e.prototype.initRender=function(){var t=this;if(this.initialRender=!0,this.isBlazorServerRender()||(0,a.attributes)(this.element,{role:"dialog"}),1e3===this.zIndex?(this.setzIndex(this.element,!1),this.calculatezIndex=!0):this.calculatezIndex=!1,this.setTargetContent(),""===this.header||(0,a.isNullOrUndefined)(this.header)||this.setHeader(),this.renderCloseIcon(),this.setContent(),""===this.footerTemplate||(0,a.isNullOrUndefined)(this.footerTemplate)?(0,a.isNullOrUndefined)(this.buttons[0])||(0,a.isNullOrUndefined)(this.buttons[0].buttonModel)||this.setButton():this.setFooterTemplate(),this.allowDragging&&!(0,a.isNullOrUndefined)(this.headerContent)&&this.setAllowDragging(),(0,a.attributes)(this.element,{"aria-modal":this.isModal?"true":"false"}),this.isModal&&this.setIsModal(),!0!==this.element.classList.contains(pe)&&!0!==this.element.classList.contains(ce)&&!(0,a.isNullOrUndefined)(this.element.parentElement)){var e=this.isModal?this.dlgContainer.parentElement:this.element.parentElement;this.refElement=this.createElement("div",{className:"e-dlg-ref-element"}),e.insertBefore(this.refElement,this.isModal?this.dlgContainer:this.element)}if((0,a.isNullOrUndefined)(this.targetEle)||(this.isModal?this.targetEle.appendChild(this.dlgContainer):this.targetEle.appendChild(this.element)),this.popupObj=new $(this.element,{height:this.height,width:this.width,zIndex:this.zIndex,relateTo:this.target,actionOnScroll:"none",enableRtl:this.enableRtl,open:function(e){var i={container:t.isModal?t.dlgContainer:t.element,element:t.element,target:t.target,preventFocus:!1};t.enableResize&&t.resetResizeIcon(),t.trigger("open",i,(function(e){e.preventFocus||t.focusContent()}))},close:function(e){t.isModal&&(0,a.addClass)([t.dlgOverlay],"e-fade"),t.unBindEvent(t.element),t.isModal&&(t.dlgContainer.style.display="none"),t.trigger("close",t.closeArgs);var i=document.activeElement;(0,a.isNullOrUndefined)(i)||(0,a.isNullOrUndefined)(i.blur)||i.blur(),(0,a.isNullOrUndefined)(t.storeActiveElement)||(0,a.isNullOrUndefined)(t.storeActiveElement.focus)||t.storeActiveElement.focus()}}),this.positionChange(),this.setEnableRTL(),this.isBlazorServerRender()||((0,a.addClass)([this.element],"e-popup-close"),this.isModal&&this.setOverlayZindex()),this.visible){if(this.show(),this.isModal){var i=this.getTargetContainer(this.target);if(i instanceof Element)"rtl"===window.getComputedStyle(i).getPropertyValue("direction")&&this.setPopupPosition()}}else this.isModal&&(this.dlgOverlay.style.display="none");this.initialRender=!1},e.prototype.getTargetContainer=function(t){var e=null;if("string"==typeof t)if(t.startsWith("#"))e=document.getElementById(t.substring(1));else if(t.startsWith(".")){var i=document.getElementsByClassName(t.substring(1));e=i.length>0?i[0]:null}else t instanceof HTMLElement||t===document.body||(e=document.querySelector(t));else t instanceof HTMLElement&&(e=t);return e},e.prototype.resetResizeIcon=function(){var t=this.getMinHeight();if(this.targetEle.offsetHeight<t){var e=this.enableRtl?"e-south-west":"e-south-east",i=this.element.querySelector("."+e);(0,a.isNullOrUndefined)(i)||(i.style.bottom="-"+t.toString()+"px")}},e.prototype.setOverlayZindex=function(t){var e;e=(0,a.isNullOrUndefined)(t)?parseInt(this.element.style.zIndex,10)?parseInt(this.element.style.zIndex,10):this.zIndex:t,this.dlgOverlay.style.zIndex=(e-1).toString(),this.dlgContainer.style.zIndex=e.toString()},e.prototype.positionChange=function(){this.isModal&&(isNaN(parseFloat(this.position.X))||isNaN(parseFloat(this.position.Y)))?!isNaN(parseFloat(this.position.X))&&isNaN(parseFloat(this.position.Y))||isNaN(parseFloat(this.position.X))&&!isNaN(parseFloat(this.position.Y))?this.setPopupPosition():(this.element.style.top="0px",this.element.style.left="0px",this.dlgContainer.classList.add("e-dlg-"+this.position.X+"-"+this.position.Y)):this.setPopupPosition()},e.prototype.setPopupPosition=function(){this.popupObj.setProperties({position:{X:this.position.X,Y:this.position.Y}})},e.prototype.setAllowDragging=function(){var t=this,e="."+Qt;this.element.classList.contains("e-draggable")||(this.dragObj=new a.Draggable(this.element,{clone:!1,isDragScroll:!0,abort:".e-dlg-closeicon-btn",handle:e,dragStart:function(e){t.trigger("dragStart",e,(function(t){(0,a.isBlazor)()&&t.bindEvents(e.dragElement)}))},dragStop:function(e){if(t.isModal){t.IsDragStop=!0,(0,a.isNullOrUndefined)(t.position)||t.dlgContainer.classList.remove("e-dlg-"+t.position.X+"-"+t.position.Y);var i=t.getTargetContainer(t.target);if(i instanceof Element)"rtl"===window.getComputedStyle(i).getPropertyValue("direction")?t.element.style.position="absolute":t.element.style.position="relative";else t.element.style.position="relative"}t.trigger("dragStop",e),t.isModelResize=!1,t.element.classList.remove(fe),t.updatePersistData()},drag:function(e){t.trigger("drag",e)}}),(0,a.isNullOrUndefined)(this.targetEle)||(this.dragObj.dragArea=this.targetEle))},e.prototype.setButton=function(){if(!this.isBlazorServerRender()){this.buttonContent=[],this.btnObj=[];for(var t=0;t<this.buttons.length;t++)if(!(0,a.isNullOrUndefined)(this.buttons[t].buttonModel)){var e=(0,a.isNullOrUndefined)(this.buttons[t].type)?"button":this.buttons[t].type.toLowerCase(),i=this.createElement("button",{className:this.cssClass,attrs:{type:e,tabindex:"0"}});this.buttonContent.push(i.outerHTML)}this.setFooterTemplate()}t=0;for(var o,n=this.element.children;t<n.length;t++)n[t].classList.contains(te)&&(o=n[t].querySelectorAll("button"));for(t=0;t<this.buttons.length;t++)(0,a.isNullOrUndefined)(this.buttons[t].buttonModel)||(this.isBlazorServerRender()||(this.btnObj[t]=new pt.Button(this.buttons[t].buttonModel)),!(0,a.isNullOrUndefined)(this.ftrTemplateContent)&&o.length>0&&("function"==typeof this.buttons[t].click&&a.EventHandler.add(o[t],"click",this.buttons[t].click,this),"object"==typeof this.buttons[t].click&&a.EventHandler.add(o[t],"click",this.buttonClickHandler.bind(this,t),this)),this.isBlazorServerRender()||(0,a.isNullOrUndefined)(this.ftrTemplateContent)||(this.btnObj[t].appendTo(this.ftrTemplateContent.children[t]),this.buttons[t].isFlat&&this.btnObj[t].element.classList.add("e-flat"),this.primaryButtonEle=this.element.getElementsByClassName("e-primary")[0]))},e.prototype.buttonClickHandler=function(t){this.trigger("buttons["+t+"].click",{})},e.prototype.setContent=function(){this.contentEle=this.createElement("div",{className:"e-dlg-content",id:this.element.id+"_dialog-content"}),this.headerEle?(0,a.attributes)(this.element,{"aria-describedby":this.element.id+"_title "+this.element.id+"_dialog-content"}):(0,a.attributes)(this.element,{"aria-describedby":this.element.id+"_dialog-content"}),this.innerContentElement?this.contentEle.appendChild(this.innerContentElement):((0,a.isNullOrUndefined)(this.content)||""===this.content)&&this.initialRender||(("string"!=typeof this.content||(0,a.isBlazor)())&&this.content instanceof HTMLElement?this.contentEle.appendChild(this.content):this.setTemplate(this.content,this.contentEle,"content")),(0,a.isNullOrUndefined)(this.headerContent)?this.element.insertBefore(this.contentEle,this.element.children[0]):this.element.insertBefore(this.contentEle,this.element.children[1]),"auto"===this.height&&(this.isBlazorServerRender()||!a.Browser.isIE||""!==this.element.style.width||(0,a.isNullOrUndefined)(this.width)||(this.element.style.width=(0,a.formatUnit)(this.width)),this.setMaxHeight())},e.prototype.setTemplate=function(t,e,i){var o,n,s;n=e.classList.contains($t)?this.element.id+"header":e.classList.contains(te)?this.element.id+"footerTemplate":this.element.id+"content",(0,a.isNullOrUndefined)(t.outerHTML)?("string"==typeof t||"string"!=typeof t||(0,a.isBlazor)()&&!this.isStringTemplate)&&("string"==typeof t&&(t=this.sanitizeHelper(t)),this.isVue||"string"!=typeof t?(o=(0,a.compile)(t),s=t):e.innerHTML=t):e.appendChild(t);var l=[];if(!(0,a.isNullOrUndefined)(o)){for(var r=0,h=o({},this,i,n,!((0,a.isBlazor)()&&!this.isStringTemplate&&0===s.indexOf("<div>Blazor"))||this.isStringTemplate);r<h.length;r++){var d=h[r];l.push(d)}(0,a.append)([].slice.call(l),e)}},e.prototype.sanitizeHelper=function(t){if(this.enableHtmlSanitizer){var e=a.SanitizeHtmlHelper.beforeSanitize();(0,a.extend)(e,e,{cancel:!1,helper:null}),this.trigger("beforeSanitizeHtml",e),e.cancel&&!(0,a.isNullOrUndefined)(e.helper)?t=e.helper(t):e.cancel||(t=a.SanitizeHtmlHelper.serializeValue(e,t))}return t},e.prototype.setMaxHeight=function(){if(this.allowMaxHeight){var t=this.element.style.display;this.element.style.display="none",this.element.style.maxHeight=!(0,a.isNullOrUndefined)(this.target)&&this.targetEle.offsetHeight<window.innerHeight?this.targetEle.offsetHeight-20+"px":window.innerHeight-20+"px",this.element.style.display=t,a.Browser.isIE&&"auto"===this.height&&!(0,a.isNullOrUndefined)(this.contentEle)&&this.element.offsetHeight<this.contentEle.offsetHeight&&(this.element.style.height="inherit")}},e.prototype.setEnableRTL=function(){this.isBlazorServerRender()||(this.enableRtl?(0,a.addClass)([this.element],Jt):(0,a.removeClass)([this.element],Jt)),(0,a.isNullOrUndefined)(this.element.querySelector(".e-resize-handle"))||(qt(),this.setResize())},e.prototype.setTargetContent=function(){var t=this;if((0,a.isNullOrUndefined)(this.content)||""===this.content){var e=""!==this.element.innerHTML.replace(/\s|<(\/?|\/?)(!--!--)>/g,"");(this.element.children.length>0||e)&&(this.innerContentElement=document.createDocumentFragment(),[].slice.call(this.element.childNodes).forEach((function(e){8!==e.nodeType&&t.innerContentElement.appendChild(e)})))}},e.prototype.setHeader=function(){this.headerEle?this.headerEle.innerHTML="":this.headerEle=this.createElement("div",{id:this.element.id+"_title",className:$t}),this.createHeaderContent(),this.headerContent.appendChild(this.headerEle),this.setTemplate(this.header,this.headerEle,"header"),(0,a.attributes)(this.element,{"aria-describedby":this.element.id+"_title"}),(0,a.attributes)(this.element,{"aria-labelledby":this.element.id+"_dialog-header"}),this.element.insertBefore(this.headerContent,this.element.children[0]),this.allowDragging&&!(0,a.isNullOrUndefined)(this.headerContent)&&this.setAllowDragging()},e.prototype.setFooterTemplate=function(){this.ftrTemplateContent?this.ftrTemplateContent.innerHTML="":this.ftrTemplateContent=this.createElement("div",{className:te}),""===this.footerTemplate||(0,a.isNullOrUndefined)(this.footerTemplate)?this.ftrTemplateContent.innerHTML=this.buttonContent.join(""):this.setTemplate(this.footerTemplate,this.ftrTemplateContent,"footerTemplate"),this.element.appendChild(this.ftrTemplateContent)},e.prototype.createHeaderContent=function(){(0,a.isNullOrUndefined)(this.headerContent)&&(this.headerContent=this.createElement("div",{id:this.element.id+"_dialog-header",className:Qt}))},e.prototype.renderCloseIcon=function(){this.showCloseIcon&&(this.closeIcon=this.createElement("button",{className:re,attrs:{type:"button"}}),this.closeIconBtnObj=new pt.Button({cssClass:"e-flat",iconCss:ie+" e-icons"}),this.closeIconTitle(),(0,a.isNullOrUnde