System.register(["./p-DYlgS5d7.system.js"],(function(t){"use strict";var e,o,r,n;return{setters:[function(t){e=t.r;o=t.h;r=t.H;n=t.a}],execute:function(){var s="pds-modal-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;width:100%}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-none){border:0}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-both){-webkit-border-after:1px solid var(--pine-color-border-subtle);border-block-end:1px solid var(--pine-color-border-subtle);-webkit-border-before:1px solid var(--pine-color-border-subtle);border-block-start:1px solid var(--pine-color-border-subtle)}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-top){-webkit-border-before:1px solid var(--pine-color-border-subtle);border-block-start:1px solid var(--pine-color-border-subtle)}pds-modal-content:has(.pds-modal-content.pds-modal-content--border-bottom){-webkit-border-after:1px solid var(--pine-color-border-subtle);border-block-end:1px solid var(--pine-color-border-subtle)}.pds-modal-content{display:block;-ms-flex:1 1 auto;flex:1 1 auto;min-height:0;width:100%}";var i=t("pds_modal_content",function(){function t(t){e(this,t);this.border="none";this.contentMaxHeight="none";this.userSetBorder=false}t.prototype.componentWillLoad=function(){var t=this.el.getAttribute("border");var e=t!==null;this.userSetBorder=e||this.border!=="none"};t.prototype.componentDidLoad=function(){var t=this;this.calculateMaxHeight();window.addEventListener("resize",this.handleResize.bind(this));if(!this.userSetBorder){setTimeout((function(){t.el.addEventListener("scroll",t.handleScroll.bind(t));setTimeout((function(){return t.updateBorders()}),100)}),100)}};t.prototype.disconnectedCallback=function(){window.removeEventListener("resize",this.handleResize.bind(this));if(!this.userSetBorder){this.el.removeEventListener("scroll",this.handleScroll.bind(this))}if(this.mutationObserver){this.mutationObserver.disconnect()}};t.prototype.handleScroll=function(){this.updateBorders()};t.prototype.handleResize=function(){var t=this;this.calculateMaxHeight();setTimeout((function(){return t.updateBorders()}),50)};t.prototype.updateBorders=function(){if(this.userSetBorder){return}var t=this.el.closest("pds-modal");if(!t)return;var e=t.scrollable!==false;if(!e){this.border="none";return}var o=this.el;var r=o.scrollHeight>o.clientHeight;if(!r){this.border="none";return}var n=o.scrollTop,s=o.scrollHeight,i=o.clientHeight;var d=n+i;var a=3;var l=n<=a;var c=d>=s-a;if(l&&c){this.border="none"}else if(l&&!c){this.border="bottom"}else if(!l&&c){this.border="top"}else{this.border="both"}};t.prototype.calculateMaxHeight=function(){var t=this;var e=this.el.closest("pds-modal");if(!e)return;var o=e.scrollable!==false;setTimeout((function(){if(!o){t.contentMaxHeight="none";var r=t.el.querySelector(".pds-modal-content");if(r){r.style.maxHeight="none"}return}var n=e.querySelector("pds-modal-header");var s=e.querySelector("pds-modal-footer");var i=n?n.offsetHeight:0;var d=s?s.offsetHeight:0;if(i>0||d>0){var a=Math.round(window.innerHeight*.06);var l=i+d+48+a+50;t.contentMaxHeight="calc(100vh - ".concat(l,"px)");var r=t.el.querySelector(".pds-modal-content");if(r){r.style.maxHeight=t.contentMaxHeight}}else{t.contentMaxHeight="none"}setTimeout((function(){return t.updateBorders()}),150)}),100);if(!this.mutationObserver&&e){this.mutationObserver=new MutationObserver((function(){t.calculateMaxHeight()}));this.mutationObserver.observe(e,{childList:true,subtree:true,attributes:true,attributeFilter:["style","class"]})}};t.prototype.render=function(){var t;var e=this.contentMaxHeight!=="none"?{maxHeight:this.contentMaxHeight}:{};return o(r,{key:"fae42c1fc151e4855cd2c731802c15851473be79"},o("div",{key:"feb61d6a7227d8113b931df6280358cd9b4fe583",class:(t={"pds-modal-content":true},t["pds-modal-content--border-".concat(this.border)]=true,t),style:e,tabindex:"-1"},o("slot",{key:"1c9e55ecd1ad353699e5a4590ee04c9005719f6d"})))};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());i.style=s}}}));
//# sourceMappingURL=p-a695ff4c.system.entry.js.map