"use strict";(self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[]).push([[3639],{3639(t,e,i){i(5983);var s,a=i(9609),d=i(878),r=i(2050),o=i(4084),n=i(7161),h=i(429),c=i(5125),l=i(291),p=i(3842),y=function(t,e,i,s){var a,d=arguments.length,r=d<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(d<3?a(r):d>3?a(e,i,r):a(e,i))||r);return d>3&&r&&Object.defineProperty(e,i,r),r};!function(t){let e=class extends n.LitElement{constructor(){super(...arguments),this.focused=!1,this.selected=!1,this.disabled=!1,this.day=(0,d.tB)(),this.viewAnchorMonth=void 0,this.filterParams=void 0,this.datePickerProps=void 0,this.isOutsideMonth=!1,this.isToday=!1,this.parentRangePicker=null,this.dateIsInRange=!1,this.handleClick=t=>{this.dispatchEvent(new CustomEvent("day-select",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))},this.isDateInRange=()=>{var t;const e=this.parentRangePicker,i=null==e?void 0:e.startDate,s=null==e?void 0:e.endDate;if(!i||!s)return!1;const a=(null===(t=this.day)||void 0===t?void 0:t.isValid)?this.day.toSQLDate():null;if(!a)return!1;const d=a>i&&a<s,r=a===i,o=a===s;return!this.isPrimarySelection()&&(d||r||o)},this.handleKeyDown=t=>{this.dispatchEvent(new CustomEvent("day-key-event",{bubbles:!0,composed:!0,detail:{date:this.day,sourceEvent:t}}))}}connectedCallback(){super.connectedCallback(),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.parentRangePicker=(0,r.QZ)("md-date-range-picker",this)}updated(t){var e,i;super.updated(t),this.disabled=this.filterParams&&(0,d.t_)(this.day,this.filterParams)||!1,this.isOutsideMonth=this.day.month!==this.viewAnchorMonth,this.isToday=(0,d.ro)(this.day,(0,d.tB)()),this.selected=this.datePickerProps&&(0,d.ro)(this.datePickerProps.selected,this.day)||!1,this.focused=this.datePickerProps&&(0,d.ro)(this.datePickerProps.focused,this.day)||!1,this.focused&&this.button&&(null===(i=null===(e=this.button.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===i||i.focus()),this.parentRangePicker&&(this.dateIsInRange=this.isDateInRange())}isPrimarySelection(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)&&void 0===this.parentRangePicker.endDate}isLeadingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.firstElementChild)}isEndingRangeEdge(){var t;return this===(null===(t=this.parentNode)||void 0===t?void 0:t.lastElementChild)}isStartDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.startDate)===this.day.toSQLDate()&&!this.isPrimarySelection()}isEndDate(){var t;return(null===(t=this.parentRangePicker)||void 0===t?void 0:t.endDate)===this.day.toSQLDate()}get getDayClassMap(){return{"md-datepicker__day--selected":this.selected,"md-datepicker__day--focus":this.focused,"md-datepicker__day--today":this.isToday,"md-datepicker__day--outside-month":this.isOutsideMonth,"md-datepicker__day--in-range":this.dateIsInRange,"md-datepicker__day--week-first":this.isLeadingRangeEdge(),"md-datepicker__day--week-last":this.isEndingRangeEdge(),"md-datepicker__day--start-date":this.isStartDate(),"md-datepicker__day--end-date":this.isEndDate()}}static get styles(){return[o.A,p.A]}render(){var t;const e=(0,d.WV)(this.day,(null===(t=this.datePickerProps)||void 0===t?void 0:t.locale)||"en").toFormat("dd MMMM yyyy"),i=this.selected||this.isStartDate()||this.isEndDate()?`${e}, selected`:e;return n.html`
        <md-button
          circle
          size=${32}
          color=${"color-none"}
          ?disabled=${this.disabled}
          class="md-datepicker__day ${(0,c.classMap)(this.getDayClassMap)}"
          @click=${t=>{this.disabled||this.handleClick(t)}}
          @keydown=${t=>this.handleKeyDown(t)}
          ariaLabel=${i}
          aria-selected=${(0,l.ifDefined)(this.selected)}
          tab-index=${this.focused?"0":"-1"}
        >
          ${this.day&&(0,d.pp)(this.day)}
        </md-button>
      `}};y([(0,h.property)({type:Boolean,reflect:!0})],e.prototype,"focused",void 0),y([(0,h.property)({type:Boolean,reflect:!0})],e.prototype,"selected",void 0),y([(0,h.property)({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0),y([(0,h.property)({attribute:!1})],e.prototype,"day",void 0),y([(0,h.property)({attribute:!1})],e.prototype,"viewAnchorMonth",void 0),y([(0,h.property)({attribute:!1})],e.prototype,"filterParams",void 0),y([(0,h.property)({attribute:!1})],e.prototype,"datePickerProps",void 0),y([(0,h.state)()],e.prototype,"isOutsideMonth",void 0),y([(0,h.state)()],e.prototype,"isToday",void 0),y([(0,h.state)()],e.prototype,"parentRangePicker",void 0),y([(0,h.state)()],e.prototype,"dateIsInRange",void 0),y([(0,h.query)("md-button")],e.prototype,"button",void 0),e=y([(0,a.w)("md-datepicker-day")],e),t.ELEMENT=e}(s||(s={}))}}]);