!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js"],t);else{var o="object"==typeof exports?t(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js")):t(e.lit,e["lit/decorators.js"],e["lit/directives/class-map.js"]);for(var s in o)("object"==typeof exports?exports:e)[s]=o[s]}}(self,(e,t,o)=>(()=>{"use strict";var s,i={9613(e,t,o){o.r(t),o.d(t,{Tooltip:()=>y,tooltipPlacement:()=>f,tooltipStrategy:()=>m});var s=o(6142),i=o(2900),n=o(7704),r=o(9609),l=o(2050),p=o(4084),a=o(7161),d=o(429),c=o(5125),h=o(6343),u=function(e,t,o,s){var i,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,s);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(r=(n<3?i(r):n>3?i(t,o,r):i(t,o))||r);return n>3&&r&&Object.defineProperty(t,o,r),r};const f=s.W,m=["fixed","absolute"];var y;!function(e){let t=class extends((0,n.UM)((0,n.yC)(a.LitElement))){constructor(){super(...arguments),this.message="",this.placement="auto",this.disabled=!1,this.opened=!1,this.slotToTooltip=!1,this.slotContent=null,this._keyDownListener=e=>{this.handleKeyDown(e)},this._wheelListener=e=>{this.opened&&this.notifyTooltipDestroy()}}hasMessage(){return this.message&&this.message.trim().length>0}hasSlotContent(){return this.slotContent&&this.slotContent.length>0}get hasTooltipContent(){return this.hasMessage()||this.hasSlotContent()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._keyDownListener),window.addEventListener("wheel",this._wheelListener,{passive:!0})}disconnectedCallback(){this.notifyTooltipDisconnected(),super.disconnectedCallback(),document.removeEventListener("keydown",this._keyDownListener),window.removeEventListener("wheel",this._wheelListener)}handleResize(e){var t;null===(t=super.handleResize)||void 0===t||t.call(this,e),(0,l.sg)(()=>{this.slotToTooltip&&(this.disabled=this.reference&&!this.isContentTruncated(this.reference))},100)()}handleFocusIn(e){super.handleFocusIn&&super.handleFocusIn(e),this.notifyTooltipCreate()}handleFocusOut(e){super.handleFocusOut&&super.handleFocusOut(e),this.notifyTooltipDestroy()}openTooltip(){this.dispatchEvent(new CustomEvent("tooltip-create",{bubbles:!0,composed:!0,detail:Object.assign({placement:this.placement,reference:this.reference,popper:this.popper},!this.message&&{slotContent:this.slotContent})}))}notifyTooltipDisconnected(){document.dispatchEvent(new CustomEvent("tooltip-disconnected",{bubbles:!0,composed:!0,detail:{}}))}closeTooltip(){this.dispatchEvent(new CustomEvent("tooltip-destroy",{bubbles:!0,composed:!0,detail:{placement:this.placement,reference:this.reference,popper:this.popper}}))}changeMessage(){this.dispatchEvent(new CustomEvent("tooltip-message",{bubbles:!0,composed:!0,detail:{placement:this.placement,reference:this.reference,popper:this.popper}}))}changeSlotContent(e){this.dispatchEvent(new CustomEvent("tooltip-slot",{bubbles:!0,composed:!0,detail:{placement:this.placement,reference:this.reference,popper:this.popper,slotContent:e}}))}notifyTooltipCreate(){!this.disabled&&this.hasTooltipContent&&(this.opened=!0)}notifyTooltipDestroy(){this.disabled||(this.opened=!1)}handleKeyDown(e){e.code===i.Uz.Escape&&this.notifyTooltipDestroy()}handleSlotContentChange(e){const t=e.target;if(t){const e=t.assignedElements({flatten:!0});e.length&&(this.slotContent&&this.changeSlotContent(e),this.slotContent=e)}}updated(e){super.updated(e),e.has("opened")&&(this.opened?this.openTooltip():this.closeTooltip()),e.has("message")&&this.changeMessage(),e.has("disabled")&&this.opened&&(this.opened=!1)}handleSlotChanged(e){const t=e.target;if(this.slotToTooltip&&t){const e=t.assignedNodes({flatten:!0}).map(e=>e.textContent).join(" ").trim();this.message=e,this.disabled=this.reference&&!this.isContentTruncated(this.reference)}}isContentTruncated(e){return e.scrollWidth>e.clientWidth}get tooltipClassMap(){return{"md-tooltip--disabled":this.disabled}}render(){return a.html`
        <div class="md-tooltip ${(0,c.classMap)(this.tooltipClassMap)}">
          <div class="md-tooltip__popper" role="tooltip" part="tooltip-popper">
            <div id="md-tooltip__content" class="md-tooltip__content" part="tooltip-content">
              ${this.message||a.html` <slot name="tooltip-content" @slotchange=${this.handleSlotContentChange}></slot> `}
            </div>
            <div id="arrow" class="md-tooltip__arrow" data-popper-arrow></div>
          </div>
          <div
            class="md-tooltip__reference"
            part="tooltip_reference"
            @mouseenter=${()=>this.notifyTooltipCreate()}
            @mouseleave=${()=>this.notifyTooltipDestroy()}
            @focusin=${e=>this.handleFocusIn(e)}
            @focusout=${e=>this.handleFocusOut(e)}
            @keydown=${e=>this.handleKeyDown(e)}
            aria-describedby="md-tooltip__content"
          >
            <slot @slotchange=${this.handleSlotChanged}></slot>
          </div>
        </div>
      `}static get styles(){return[p.A,h.A]}};u([(0,d.property)({type:String})],t.prototype,"message",void 0),u([(0,d.property)({type:String,reflect:!0})],t.prototype,"placement",void 0),u([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",void 0),u([(0,d.property)({type:Boolean,reflect:!0})],t.prototype,"opened",void 0),u([(0,d.property)({type:Boolean,reflect:!0,attribute:"slot-to-tooltip"})],t.prototype,"slotToTooltip",void 0),u([(0,d.query)(".md-tooltip__popper")],t.prototype,"popper",void 0),u([(0,d.query)(".md-tooltip__reference")],t.prototype,"reference",void 0),t=u([(0,r.w)("md-tooltip")],t),e.ELEMENT=t}(y||(y={}))},7161(t){t.exports=e},429(e){e.exports=t},5125(e){e.exports=o}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return i[e](o,o.exports,r),o.exports}r.m=i,s=[],r.O=(e,t,o,i)=>{if(!t){var n=1/0;for(d=0;d<s.length;d++){for(var[t,o,i]=s[d],l=!0,p=0;p<t.length;p++)(!1&i||n>=i)&&Object.keys(r.O).every(e=>r.O[e](t[p]))?t.splice(p--,1):(l=!1,i<n&&(n=i));if(l){s.splice(d--,1);var a=o();void 0!==a&&(e=a)}}return e}i=i||0;for(var d=s.length;d>0&&s[d-1][2]>i;d--)s[d]=s[d-1];s[d]=[t,o,i]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={3943:0,9613:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var s,i,[n,l,p]=o,a=0;if(n.some(t=>0!==e[t])){for(s in l)r.o(l,s)&&(r.m[s]=l[s]);if(p)var d=p(r)}for(t&&t(o);a<n.length;a++)i=n[a],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(d)},o=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var l=r.O(void 0,[9609,4084,2364,9938,4781,5584,8227,2900,2050,6343,7582,5323,6142],()=>r(9613));return r.O(l)})());