!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("primeng/dom"),require("primeng/ripple"),require("@angular/router")):"function"==typeof define&&define.amd?define("primeng/contextmenu",["exports","@angular/core","@angular/common","primeng/dom","primeng/ripple","@angular/router"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.contextmenu={}),e.ng.core,e.ng.common,e.primeng.dom,e.primeng.ripple,e.ng.router)}(this,(function(e,t,n,i,o,l){"use strict";var r=function(){function e(e){this.contextMenu=e}return Object.defineProperty(e.prototype,"parentActive",{get:function(){return this._parentActive},set:function(e){this._parentActive=e,e||(this.activeItem=null)},enumerable:!1,configurable:!0}),e.prototype.onItemMouseEnter=function(e,t,n){if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),!n.disabled){this.activeItem=t;var o=t.children[0].nextElementSibling;if(o){var l=o.children[0];l.style.zIndex=++i.DomHandler.zindex,this.position(l,t)}}},e.prototype.itemClick=function(e,t){t.disabled?e.preventDefault():(t.command&&(t.command({originalEvent:e,item:t}),e.preventDefault()),t.items?e.preventDefault():this.contextMenu.hide())},e.prototype.listClick=function(e){this.activeItem=null},e.prototype.position=function(e,t){this.containerOffset=i.DomHandler.getOffset(t.parentElement);var n=i.DomHandler.getViewport(),o=e.offsetParent?e.offsetWidth:i.DomHandler.getHiddenElementOuterWidth(e),l=i.DomHandler.getOuterWidth(t.children[0]),r=i.DomHandler.getOuterHeight(t.children[0]),s=e.offsetHeight?e.offsetHeight:i.DomHandler.getHiddenElementOuterHeight(e);parseInt(this.containerOffset.top)+r+s>n.height-i.DomHandler.calculateScrollbarHeight()?(e.style.removeProperty("top"),e.style.bottom="0px"):(e.style.removeProperty("bottom"),e.style.top="0px"),parseInt(this.containerOffset.left)+l+o>n.width-i.DomHandler.calculateScrollbarWidth()?e.style.left=-o+"px":e.style.left=l+"px"},e}();r.decorators=[{type:t.Component,args:[{selector:"p-contextMenuSub",template:'\n \n ',encapsulation:t.ViewEncapsulation.None}]}],r.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return s}))]}]}]},r.propDecorators={item:[{type:t.Input}],root:[{type:t.Input}],parentActive:[{type:t.Input}]};var s=function(){function e(e,n,i){this.el=e,this.renderer=n,this.zone=i,this.autoZIndex=!0,this.baseZIndex=0,this.triggerEvent="contextmenu",this.onShow=new t.EventEmitter,this.onHide=new t.EventEmitter}return e.prototype.ngAfterViewInit=function(){var e=this;if(this.global){var t=this.el?this.el.nativeElement.ownerDocument:"document";this.triggerEventListener=this.renderer.listen(t,this.triggerEvent,(function(t){e.show(t),t.preventDefault()}))}else this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,(function(t){e.show(t),t.preventDefault(),t.stopPropagation()})));this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.containerViewChild.nativeElement):i.DomHandler.appendChild(this.containerViewChild.nativeElement,this.appendTo))},e.prototype.show=function(e){this.position(e),this.moveOnTop(),this.containerViewChild.nativeElement.style.display="block",this.parentActive=!0,i.DomHandler.fadeIn(this.containerViewChild.nativeElement,250),this.bindGlobalListeners(),e&&e.preventDefault(),this.onShow.emit()},e.prototype.hide=function(){this.containerViewChild.nativeElement.style.display="none",this.parentActive=!1,this.unbindGlobalListeners(),this.onHide.emit()},e.prototype.moveOnTop=function(){this.autoZIndex&&(this.containerViewChild.nativeElement.style.zIndex=String(this.baseZIndex+ ++i.DomHandler.zindex))},e.prototype.toggle=function(e){this.containerViewChild.nativeElement.offsetParent?this.hide():this.show(e)},e.prototype.position=function(e){if(e){var t=e.pageX+1,n=e.pageY+1,o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:i.DomHandler.getHiddenElementOuterWidth(this.containerViewChild.nativeElement),l=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:i.DomHandler.getHiddenElementOuterHeight(this.containerViewChild.nativeElement),r=i.DomHandler.getViewport();t+o-document.body.scrollLeft>r.width&&(t-=o),n+l-document.body.scrollTop>r.height&&(n-=l),t\n \n \n ',changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None,styles:[".p-contextmenu{display:none;position:absolute}.p-contextmenu ul{list-style:none;margin:0;padding:0}.p-contextmenu .p-submenu-list{display:none;min-width:100%;position:absolute;z-index:1}.p-contextmenu .p-menuitem-link{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;overflow:hidden;position:relative;text-decoration:none}.p-contextmenu .p-menuitem-text{line-height:1}.p-contextmenu .p-menuitem{position:relative}.p-contextmenu .p-menuitem-link .p-submenu-icon{margin-left:auto}.p-contextmenu .p-menuitem-active>p-contextmenusub>.p-submenu-list{display:block!important}"]}]}],s.ctorParameters=function(){return[{type:t.ElementRef},{type:t.Renderer2},{type:t.NgZone}]},s.propDecorators={model:[{type:t.Input}],global:[{type:t.Input}],target:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],appendTo:[{type:t.Input}],autoZIndex:[{type:t.Input}],baseZIndex:[{type:t.Input}],triggerEvent:[{type:t.Input}],onShow:[{type:t.Output}],onHide:[{type:t.Output}],containerViewChild:[{type:t.ViewChild,args:["container"]}]};var a=function(){};a.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,l.RouterModule,o.RippleModule],exports:[s,l.RouterModule],declarations:[s,r]}]}],e.ContextMenu=s,e.ContextMenuModule=a,e.ContextMenuSub=r,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=primeng-contextmenu.umd.min.js.map