ner("resize", this._onResize); } disconnectedCallback() { super.disconnectedCallback(); if (this._onResize) { window.removeEventListener("resize", this._onResize); } } show() { this.passwordRulesEl.showPopover(); this.positionPopover(); } hide() { this.passwordRulesEl.hidePopover(); } positionPopover() { const anchorRect = this.getBoundingClientRect(); const popover = this.passwordRulesEl; const isWideViewport = window.innerWidth >= 1200; const isRTL = document.dir === "rtl"; // Calculate top position const topPos = isWideViewport ? anchorRect.top + anchorRect.height / 2 : anchorRect.bottom; popover.style.top = `${topPos}px`; popover.style.right = isRTL ? "auto" : "inherit"; popover.style.left = isRTL ? "inherit" : "auto"; } _onBeforeToggle(e) { this.open = e.newState == "open"; } render() { return html` `; } } customElements.define("password-rules-tooltip", PasswordRulesTooltip); PK