var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var o,e=1,s=arguments.length;e<s;e++){o=arguments[e];for(var n in o)if(Object.prototype.hasOwnProperty.call(o,n))t[n]=o[n]}return t};return __assign.apply(this,arguments)};import{h,c as Host,r as registerInstance}from"./index-38ad4957.js";import{n as h$1}from"./dom-context-hooks.module-50442785.js";import{B}from"./index.module-b23fdad8.js";import{g as getProps}from"./utils-334c1e34.js";var PopupContainerView=function(t){var o=t.states,e=t.callbacks;var s=o.styles;return h(Host,{class:"squatch-container"},h("div",{style:{padding:t.states.styles.padding},part:"sqm-base"},s.closeButton&&h("span",{part:"sqm-close-button",class:"close squatch-header-close","data-close-panel":"#squatch-panel",onClick:function(){return e.closePopup()}},s.closeButtonText),h("slot",null),s.poweredBy?h("a",{class:"sqh-attribution",href:"https://impact.com/advocate/",target:"_blank"},s.poweredByText):""))};function usePopupContainer(t){var o=B();function e(){var t;if(B()==="POPUP"){(t=window.frameElement["squatchJsApi"])===null||t===void 0?void 0:t.close()}}var s=t.popupPadding?t.popupPadding==="none"?"0":"var(--sl-spacing-"+t.popupPadding+")":"var(--sl-spacing-medium)";var n=t.embedPadding?t.embedPadding==="none"?"0":"var(--sl-spacing-"+t.embedPadding+")":"0";var a=B()==="POPUP"?s:n;return{states:{showCloseButton:t.closeButton&&o==="POPUP",styles:__assign(__assign({},t),{padding:a,closeButtonText:t.closeButtonText?t.closeButtonText:"X",poweredByText:t.poweredByText})},data:{},callbacks:{closePopup:e}}}var sqmPopupContainerCss=".squatch-header-close{position:absolute;right:20px;top:10px;cursor:pointer}.squatch-container{background-color:var(--widget-background-color);display:block}";var PopupContainer=function(){function t(t){registerInstance(this,t);this.poweredByText="Powered By";h$1(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=getProps(this);return h(PopupContainerView,Object.assign({},usePopupContainer(t)))};return t}();PopupContainer.style=sqmPopupContainerCss;export{PopupContainer as sqm_popup_container};