@everymatrix/lottery-ticket-controller 1.74.6 → 1.74.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./index-bf542936.js";const s=["ro","en","hr"],o={en:{deleteTicket:"Delete ticket"},ro:{deleteTicket:"Sterge biletul"},fr:{deleteTicket:"Supprimer le billet"},ar:{deleteTicket:"حذف التذكرة"},hr:{deleteTicket:"Izbriši listić"}},r=class{constructor(i){t(this,i),this.accordionEvent=e(this,"helperAccordionAction",7),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.ticketHistoryFlag=!1,this.headerTitle="",this.headerSubtitle="",this.description="",this.footer=!1,this.deleteTab=!1,this.postMessage=!1,this.eventName="helperAccordionAction",this.collapsed=!0,this.language="en",this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.showContent=void 0,this.limitStylingAppends=!1}connectedCallback(){this.showContent=!this.collapsed}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])o[e][i]=t[e][i]})))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}toggleContent(){this.showContent=!this.showContent}deleteAction(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.accordionEvent.emit()}render(){return i("div",{key:"2db19795aa22479f038d9fc7c936cf7403efa43e",class:"Wrapper",ref:t=>this.stylingContainer=t},i("div",{key:"6804e27dbd68e4f4182ab07beb665c53b54069b6",class:!0===this.ticketHistoryFlag?"HeaderTicketHistory":"Header",onClick:()=>this.toggleContent()},i("p",{key:"d1293990d39da1f50d36dff28e1abbe53259356b",class:"Title"},this.headerTitle),i("p",{key:"7632e3ddda5dea8e91d8a3935ff46c0f357c4397",class:"Subtitle"},this.headerSubtitle),i("p",{key:"1ab0dd4cc2625ef20c858738ee290e922e37dd21",class:"Subtitle Description"},this.description),i("span",{key:"3c7e3d3092aa97d24f62383e17a8a91646a78058",class:"Expand"},this.showContent?"<":">")),this.showContent&&i("div",{key:"ba970b8947e1986aedbdfd37b044e05f2b1c29fc"},i("div",{key:"7cfc0ca2b99d76d7647569f7105c29d1be8cf994",class:"Content"},i("slot",{key:"a2d866a914d33eac26b3b7e138e611be9f942c65",name:"accordionContent"}),this.footer&&this.showContent&&i("div",{key:"c44d54e98f712c921e7dd16faaaaa7cfb92e17c4"},this.deleteTab&&i("span",{key:"8c46aa94fcce959f370d07da69bd58509c143373",class:"ActionButton",onClick:()=>this.deleteAction()},(()=>{const t=this.language;return o[void 0!==t&&s.includes(t)?t:"en"].deleteTicket})())))))}};r.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Header{border-radius:5px;background:var(--emw--color-background, #009993);display:flex;gap:30px;border:1px solid var(--emw--color-typography, #009993);padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:var(--emw--color-background-secondary, #00ABA4)}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));text-transform:capitalize}.Header .Expand{margin-left:auto;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:var(--emw--color-gray-50, #F1F1F1);display:flex;gap:30px;border:1px solid var(--emw--color-typography, #009993);padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:var(--emw--color-secondary, #00ABA4)}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:var(--emw--button-text-color, #000)}.HeaderTicketHistory .Expand{margin-left:auto;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));border:1px solid var(--emw--button-border-color, #009993);padding:10px 15px;user-select:none;color:var(--emw--button-text-color, #000);margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:var(--emw--color-error, #FF3D00);border:1px solid var(--emw--color-error, #FF3D00);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.ActionButton:hover{background:var(--emw--color-secondary, #FF6536);border:1px solid var(--emw--color-error, #FF3D00)}';const n=class{constructor(i){t(this,i),this.bulletEvent=e(this,"lotteryBulletSelection",7),this.select=()=>{this.selectable&&(this.isSelected=!this.isSelected,this.bulletEvent.emit({value:this.value,selected:this.isSelected}))},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.value="0",this.selectable=!0,this.isSelected=!1,this.isBonus=!1,this.clientStyling="",this.clientStylingUrlContent="",this.limitStylingAppends=!1}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return i("div",{key:"a21cbee8f556bfbbe9f97be5f44bfc08b6f24dd6",class:"Circle "+(this.selectable?"":"Disabled")+(this.isSelected?"Selected":"")+(this.isBonus?" Bonus":""),onClick:()=>this.select(),ref:t=>this.stylingContainer=t},this.value)}};n.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:var(--emw--button-text-color, #000);display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:radial-gradient(circle at top, var(--emw--color-gray-transparency-100, rgb(255, 255, 255)) 0%, var(--emw--color-gray-transparency-100, rgb(255, 255, 255)) 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, var(--emw--color-gray-transparency-100, rgb(255, 255, 255)) 0%, var(--emw--color-gray-50, #F1F1F1) 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:var(--emw--color-primary, #9EC258);background:-webkit-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:-moz-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:radial-gradient(circle at top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));border:solid 2px var(--emw--button-border-color, #00958f)}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #F1F1F1);background:var(--emw--color-gray-100, #D4D4D4);border:solid 2px var(--emw--color-gray-100, #D4D4D4);cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #F1F1F1);background:var(--emw--color-primary, #9EC258);background:-webkit-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:-moz-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:radial-gradient(circle at top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));border:solid 2px var(--emw--color-gray-100, #D4D4D4);cursor:default}.Circle.Bonus{background:var(--emw--color-error, #FF3D00)}';const a=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.gridClearAllEvent=e(this,"gridClearAllEvent",7),this.selectedCounter=0,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.ticketId=void 0,this.totalNumbers=0,this.gameId=void 0,this.maximumAllowed=7,this.minimumAllowed=3,this.numberRange=void 0,this.selectable=!0,this.selectedNumbers="",this.secondaryNumbers="",this.displaySelected=!1,this.language="en",this.gridIndex=void 0,this.gridType="",this.clientStyling="",this.clientStylingUrlContent="",this.highNumber=47,this.lowNumber=1,this.selectionType="mainSelection",this.partialQuickpickAvailable=!1,this.numbers=[],this.bonusNumbers=[],this.limitStylingAppends=!1}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.secondaryNumbers.length>0&&(this.bonusNumbers=this.secondaryNumbers.split(",").map((t=>({number:t,selected:!0,selectable:this.selectable})))),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e)).map((t=>t.toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>({number:e.number,selected:e.number==t.detail.value?t.detail.selected:e.selected,selectable:e.selectable}))),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter>=this.minimumAllowed&&this.selectedCounter<=this.maximumAllowed&&(this.numbers=this.numbers.map((t=>this.selectedCounter===this.maximumAllowed?{number:t.number,selected:t.selected,selectable:!!t.selected}:{number:t.number,selected:t.selected,selectable:!0})),JSON.parse(this.numberRange).includes(this.selectedCounter)?this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter-=1,this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),0===this.selectedCounter&&this.gridClearAllEvent.emit(this.gridIndex),this.selectedCounter<this.minimumAllowed?this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async resetSelectionHandler(t){t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:[]}))}async autoSelectionHandler(t){if(t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex){this.resetSelectionHandler(t);let e=Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e));e=this.shuffleArray(e),e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:!!this.partialQuickpickAvailable&&e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.minimumAllowed}}render(){return i("div",{key:"8ad436904a126e6bee036c7372cf45c075022e5f",class:"GridContainer",ref:t=>this.stylingContainer=t},i("div",{key:"5a8818209485f0808a99978910f6f26473dd6f59",class:"ticket"===this.gridType?"Grid TicketGrid":"Grid"},this.numbers.map((t=>i("div",null,i("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))),this.bonusNumbers.length?this.bonusNumbers.map((t=>i("div",null,i("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"is-bonus":!0,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))):""))}};a.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}';const l=["ro","en","hr"],h={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},c=(t,e)=>{const i=e;return h[void 0!==i&&l.includes(i)?i:"en"][t]};var d=Object.defineProperty,u=Object.defineProperties,p=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,b=(t,e,i)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,g=(t,e)=>{for(var i in e||(e={}))v.call(e,i)&&b(t,i,e[i]);if(m)for(var i of m(e))f.call(e,i)&&b(t,i,e[i]);return t},y=(t,e)=>u(t,p(e)),w=(t,e,i)=>(b(t,"symbol"!=typeof e?e+"":e,i),i),x=(t,e,i)=>new Promise(((s,o)=>{var r=t=>{try{a(i.next(t))}catch(t){o(t)}},n=t=>{try{a(i.throw(t))}catch(t){o(t)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,n);a((i=i.apply(t,e)).next())}))
|
|
1
|
+
import{r as t,c as e,h as i}from"./index-bf542936.js";const s=["ro","en","hr"],o={en:{deleteTicket:"Delete ticket"},ro:{deleteTicket:"Sterge biletul"},fr:{deleteTicket:"Supprimer le billet"},ar:{deleteTicket:"حذف التذكرة"},hr:{deleteTicket:"Izbriši listić"}},r=class{constructor(i){t(this,i),this.accordionEvent=e(this,"helperAccordionAction",7),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.ticketHistoryFlag=!1,this.headerTitle="",this.headerSubtitle="",this.description="",this.footer=!1,this.deleteTab=!1,this.postMessage=!1,this.eventName="helperAccordionAction",this.collapsed=!0,this.language="en",this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.showContent=void 0,this.limitStylingAppends=!1}connectedCallback(){this.showContent=!this.collapsed}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])o[e][i]=t[e][i]})))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}toggleContent(){this.showContent=!this.showContent}deleteAction(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.accordionEvent.emit()}render(){return i("div",{key:"2db19795aa22479f038d9fc7c936cf7403efa43e",class:"Wrapper",ref:t=>this.stylingContainer=t},i("div",{key:"6804e27dbd68e4f4182ab07beb665c53b54069b6",class:!0===this.ticketHistoryFlag?"HeaderTicketHistory":"Header",onClick:()=>this.toggleContent()},i("p",{key:"d1293990d39da1f50d36dff28e1abbe53259356b",class:"Title"},this.headerTitle),i("p",{key:"7632e3ddda5dea8e91d8a3935ff46c0f357c4397",class:"Subtitle"},this.headerSubtitle),i("p",{key:"1ab0dd4cc2625ef20c858738ee290e922e37dd21",class:"Subtitle Description"},this.description),i("span",{key:"3c7e3d3092aa97d24f62383e17a8a91646a78058",class:"Expand"},this.showContent?"<":">")),this.showContent&&i("div",{key:"ba970b8947e1986aedbdfd37b044e05f2b1c29fc"},i("div",{key:"7cfc0ca2b99d76d7647569f7105c29d1be8cf994",class:"Content"},i("slot",{key:"a2d866a914d33eac26b3b7e138e611be9f942c65",name:"accordionContent"}),this.footer&&this.showContent&&i("div",{key:"c44d54e98f712c921e7dd16faaaaa7cfb92e17c4"},this.deleteTab&&i("span",{key:"8c46aa94fcce959f370d07da69bd58509c143373",class:"ActionButton",onClick:()=>this.deleteAction()},(()=>{const t=this.language;return o[void 0!==t&&s.includes(t)?t:"en"].deleteTicket})())))))}};r.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.Header{border-radius:5px;background:var(--emw--color-background, #009993);display:flex;gap:30px;border:1px solid var(--emw--color-typography, #009993);padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:var(--emw--color-background-secondary, #00ABA4)}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));text-transform:capitalize}.Header .Expand{margin-left:auto;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:var(--emw--color-gray-50, #F1F1F1);display:flex;gap:30px;border:1px solid var(--emw--color-typography, #009993);padding:8px 10px;user-select:none;margin-bottom:5px;cursor:pointer}.HeaderTicketHistory:hover{background:var(--emw--color-secondary, #00ABA4)}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:var(--emw--button-text-color, #000)}.HeaderTicketHistory .Expand{margin-left:auto;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));border:1px solid var(--emw--button-border-color, #009993);padding:10px 15px;user-select:none;color:var(--emw--button-text-color, #000);margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:var(--emw--color-error, #FF3D00);border:1px solid var(--emw--color-error, #FF3D00);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.ActionButton:hover{background:var(--emw--color-secondary, #FF6536);border:1px solid var(--emw--color-error, #FF3D00)}';const n=class{constructor(i){t(this,i),this.bulletEvent=e(this,"lotteryBulletSelection",7),this.select=()=>{this.selectable&&(this.isSelected=!this.isSelected,this.bulletEvent.emit({value:this.value,selected:this.isSelected}))},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.value="0",this.selectable=!0,this.isSelected=!1,this.isBonus=!1,this.clientStyling="",this.clientStylingUrlContent="",this.limitStylingAppends=!1}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return i("div",{key:"a21cbee8f556bfbbe9f97be5f44bfc08b6f24dd6",class:"Circle "+(this.selectable?"":"Disabled")+(this.isSelected?"Selected":"")+(this.isBonus?" Bonus":""),onClick:()=>this.select(),ref:t=>this.stylingContainer=t},this.value)}};n.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:var(--emw--button-text-color, #000);display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:radial-gradient(circle at top, var(--emw--color-gray-transparency-100, rgb(255, 255, 255)) 0%, var(--emw--color-gray-transparency-100, rgb(255, 255, 255)) 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, var(--emw--color-gray-transparency-100, rgb(255, 255, 255)) 0%, var(--emw--color-gray-50, #F1F1F1) 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:var(--emw--color-primary, #9EC258);background:-webkit-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:-moz-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:radial-gradient(circle at top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));border:solid 2px var(--emw--button-border-color, #00958f)}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #F1F1F1);background:var(--emw--color-gray-100, #D4D4D4);border:solid 2px var(--emw--color-gray-100, #D4D4D4);cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:var(--emw--color-gray-50, #F1F1F1);background:var(--emw--color-primary, #9EC258);background:-webkit-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:-moz-radial-gradient(top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));background:radial-gradient(circle at top, var(--emw--button-background-color, #00958f), var(--emw--color-primary-variant, #004D4A));border:solid 2px var(--emw--color-gray-100, #D4D4D4);cursor:default}.Circle.Bonus{background:var(--emw--color-error, #FF3D00)}';const a=class{constructor(i){t(this,i),this.gridFilledEvent=e(this,"gridFilled",7),this.gridDirtyEvent=e(this,"gridDirty",7),this.gridClearAllEvent=e(this,"gridClearAllEvent",7),this.selectedCounter=0,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.ticketId=void 0,this.totalNumbers=0,this.gameId=void 0,this.maximumAllowed=7,this.minimumAllowed=3,this.numberRange=void 0,this.selectable=!0,this.selectedNumbers="",this.secondaryNumbers="",this.displaySelected=!1,this.language="en",this.gridIndex=void 0,this.gridType="",this.clientStyling="",this.clientStylingUrlContent="",this.highNumber=47,this.lowNumber=1,this.selectionType="mainSelection",this.partialQuickpickAvailable=!1,this.numbers=[],this.bonusNumbers=[],this.limitStylingAppends=!1}connectedCallback(){let t=[];this.selectedNumbers.length>0&&(t=this.selectedNumbers.split(","),this.selectedCounter=t.length),this.secondaryNumbers.length>0&&(this.bonusNumbers=this.secondaryNumbers.split(",").map((t=>({number:t,selected:!0,selectable:this.selectable})))),this.displaySelected?t.forEach((t=>{this.numbers.push({number:t,selected:!0,selectable:this.selectable})})):Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e)).map((t=>t.toString())).forEach((e=>{this.numbers.push({number:e,selected:t.indexOf(e)>=0,selectable:this.selectedCounter!=this.maximumAllowed&&this.selectable})}))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}lotteryBulletSelectionHandler(t){this.numbers=this.numbers.map((e=>({number:e.number,selected:e.number==t.detail.value?t.detail.selected:e.selected,selectable:e.selectable}))),t.detail.selected?(this.selectedCounter+=1,this.selectedCounter>=this.minimumAllowed&&this.selectedCounter<=this.maximumAllowed&&(this.numbers=this.numbers.map((t=>this.selectedCounter===this.maximumAllowed?{number:t.number,selected:t.selected,selectable:!!t.selected}:{number:t.number,selected:t.selected,selectable:!0})),JSON.parse(this.numberRange).includes(this.selectedCounter)?this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))):(this.selectedCounter-=1,this.numbers=this.numbers.map((t=>({number:t.number,selected:t.selected,selectable:!0}))),0===this.selectedCounter&&this.gridClearAllEvent.emit(this.gridIndex),this.selectedCounter<this.minimumAllowed?this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}):this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}))}async resetSelectionHandler(t){t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex&&(this.selectedCounter=0,this.numbers=this.numbers.map((t=>({number:t.number,selected:!1,selectable:this.selectable}))),this.gridDirtyEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:[]}))}async autoSelectionHandler(t){if(t.detail&&t.detail.ticketId==this.ticketId&&t.detail.index===this.gridIndex){this.resetSelectionHandler(t);let e=Array.from({length:this.highNumber-this.lowNumber+1},((t,e)=>this.lowNumber+e));e=this.shuffleArray(e),e=e.slice(0,this.minimumAllowed),this.numbers=this.numbers.map((t=>({number:t.number,selected:e.indexOf(parseInt(t.number,10))>=0,selectable:!!this.partialQuickpickAvailable&&e.indexOf(parseInt(t.number,10))>=0}))),this.gridFilledEvent.emit({id:this.ticketId,index:this.gridIndex,selectionType:this.selectionType,selectedNumbers:this.numbers.filter((t=>t.selected)).map((t=>t.number))}),this.selectedCounter=this.minimumAllowed}}render(){return i("div",{key:"8ad436904a126e6bee036c7372cf45c075022e5f",class:"GridContainer",ref:t=>this.stylingContainer=t},i("div",{key:"5a8818209485f0808a99978910f6f26473dd6f59",class:"ticket"===this.gridType?"Grid TicketGrid":"Grid"},this.numbers.map((t=>i("div",null,i("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))),this.bonusNumbers.length?this.bonusNumbers.map((t=>i("div",null,i("lottery-bullet",{value:t.number,selectable:t.selectable,"is-selected":t.selected,"is-bonus":!0,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))):""))}};a.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}';const l=["ro","en","hr"],h={en:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},c=(t,e)=>{const i=e;return h[void 0!==i&&l.includes(i)?i:"en"][t]};var d=Object.defineProperty,u=Object.defineProperties,p=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,b=(t,e,i)=>e in t?d(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,g=(t,e)=>{for(var i in e||(e={}))v.call(e,i)&&b(t,i,e[i]);if(m)for(var i of m(e))f.call(e,i)&&b(t,i,e[i]);return t},y=(t,e)=>u(t,p(e)),w=(t,e,i)=>(b(t,"symbol"!=typeof e?e+"":e,i),i),_=(t,e,i)=>new Promise(((s,o)=>{var r=t=>{try{a(i.next(t))}catch(t){o(t)}},n=t=>{try{a(i.throw(t))}catch(t){o(t)}},a=t=>t.done?s(t.value):Promise.resolve(t.value).then(r,n);a((i=i.apply(t,e)).next())}))
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
5
5
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6
|
-
*/;function
|
|
6
|
+
*/;function x(t,e="24.5.10"){Object.defineProperty(t,"version",{get:()=>e});const i=customElements.get(t.is);if(i){const e=i.version;e&&t.version&&e===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${i.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
10
10
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
11
|
-
*/class k extends HTMLElement{static get is(){return"vaadin-lumo-styles"}}
|
|
11
|
+
*/class k extends HTMLElement{static get is(){return"vaadin-lumo-styles"}}x(k);
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2019 Google LLC
|
|
@@ -19,13 +19,13 @@ const C=globalThis,A=C.ShadowRoot&&(void 0===C.ShadyCSS||C.ShadyCSS.nativeShadow
|
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/,{is:E,defineProperty:P,getOwnPropertyDescriptor:N,getOwnPropertyNames:M,getOwnPropertySymbols:B,getPrototypeOf:F}=Object,j=globalThis,L=j.trustedTypes,R=L?L.emptyScript:"",V=
|
|
22
|
+
*/,{is:E,defineProperty:P,getOwnPropertyDescriptor:N,getOwnPropertyNames:M,getOwnPropertySymbols:B,getPrototypeOf:F}=Object,j=globalThis,L=j.trustedTypes,R=L?L.emptyScript:"",$=j.reactiveElementPolyfillSupport,V={toAttribute(t,e){switch(e){case Boolean:t=t?R:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},W=(t,e)=>!E(t,e),q={attribute:!0,type:String,converter:V,reflect:!1,hasChanged:W};null!=Symbol.metadata||(Symbol.metadata=Symbol("metadata")),null!=j.litPropertyMetadata||(j.litPropertyMetadata=new WeakMap);class U extends HTMLElement{static addInitializer(t){var e;this._$Ei(),(null!=(e=this.l)?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=q){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&P(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){var s;const{get:o,set:r}=null!=(s=N(this.prototype,t))?s:{get(){return this[e]},set(t){this[e]=t}};return{get(){return null==o?void 0:o.call(this)},set(e){const s=null==o?void 0:o.call(this);r.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return null!=(e=this.elementProperties.get(t))?e:q}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=F(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...M(t),...B(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(O(t))}else void 0!==t&&e.push(O(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e,i;(null!=(e=this._$EO)?e:this._$EO=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(i=t.hostConnected)||i.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var t;const e=null!=(t=this.shadowRoot)?t:this.attachShadow(this.constructor.shadowRootOptions);return D(e,this.constructor.elementStyles),e}connectedCallback(){var t;null!=this.renderRoot||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var i;const s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(void 0!==o&&!0===s.reflect){const r=(void 0!==(null==(i=s.converter)?void 0:i.toAttribute)?s.converter:V).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){var i;const s=this.constructor,o=s._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:V;this._$Em=o,this[o]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){var s;if(void 0!==t){if(null!=i||(i=this.constructor.getPropertyOptions(t)),!(null!=(s=i.hasChanged)?s:W)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){var s;this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(null!=(s=this._$Ej)?s:this._$Ej=new Set).add(t)}_$ET(){return _(this,null,(function*(){this.isUpdatePending=!0;try{yield this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&(yield t),!this.isUpdatePending}))}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(null!=this.renderRoot||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((t=>this._$EC(t,this[t])))),this._$EU()}updated(t){}firstUpdated(t){}}var H;U.elementStyles=[],U.shadowRootOptions={mode:"open"},U.elementProperties=new Map,U.finalized=new Map,null==$||$({ReactiveElement:U}),(null!=(H=j.reactiveElementVersions)?H:j.reactiveElementVersions=[]).push("2.0.4");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
27
|
*/
|
|
28
|
-
const G=globalThis,Y=G.trustedTypes,J=Y?Y.createPolicy("lit-html",{createHTML:t=>t}):void 0,K="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,Q="?"+Z,X=`<${Q}>`,tt=document,et=()=>tt.createComment(""),it=t=>null===t||"object"!=typeof t&&"function"!=typeof t,st=Array.isArray,ot="[ \t\n\f\r]",rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,at=/>/g,lt=RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ht=/'/g,ct=/"/g,dt=/^(?:script|style|textarea|title)$/i,ut=Symbol.for("lit-noChange"),pt=Symbol.for("lit-nothing"),mt=new WeakMap,vt=tt.createTreeWalker(tt,129);function ft(t,e){if(!st(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==J?J.createHTML(e):e}class bt{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const n=t.length-1,a=this.parts,[l,h]=((t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":3===e?"<math>":"",n=rt;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===rt?"!--"===l[1]?n=nt:void 0!==l[1]?n=at:void 0!==l[2]?(dt.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=lt):void 0!==l[3]&&(n=lt):n===lt?">"===l[0]?(n=null!=o?o:rt,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?lt:'"'===l[3]?ct:ht):n===ct||n===ht?n=lt:n===nt||n===at?n=rt:(n=lt,o=void 0);const d=n===lt&&t[e+1].startsWith("/>")?" ":"";r+=n===rt?i+X:h>=0?(s.push(a),i.slice(0,h)+K+i.slice(h)+Z+d):i+Z+(-2===h?e:d)}return[ft(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=bt.createElement(l,i),vt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=vt.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(K)){const e=h[r++],i=s.getAttribute(t).split(Z),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:n[2],strings:i,ctor:"."===n[1]?
|
|
28
|
+
const G=globalThis,Y=G.trustedTypes,J=Y?Y.createPolicy("lit-html",{createHTML:t=>t}):void 0,K="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,Q="?"+Z,X=`<${Q}>`,tt=document,et=()=>tt.createComment(""),it=t=>null===t||"object"!=typeof t&&"function"!=typeof t,st=Array.isArray,ot="[ \t\n\f\r]",rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,at=/>/g,lt=RegExp(`>|${ot}(?:([^\\s"'>=/]+)(${ot}*=${ot}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ht=/'/g,ct=/"/g,dt=/^(?:script|style|textarea|title)$/i,ut=Symbol.for("lit-noChange"),pt=Symbol.for("lit-nothing"),mt=new WeakMap,vt=tt.createTreeWalker(tt,129);function ft(t,e){if(!st(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==J?J.createHTML(e):e}class bt{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const n=t.length-1,a=this.parts,[l,h]=((t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":3===e?"<math>":"",n=rt;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===rt?"!--"===l[1]?n=nt:void 0!==l[1]?n=at:void 0!==l[2]?(dt.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=lt):void 0!==l[3]&&(n=lt):n===lt?">"===l[0]?(n=null!=o?o:rt,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?lt:'"'===l[3]?ct:ht):n===ct||n===ht?n=lt:n===nt||n===at?n=rt:(n=lt,o=void 0);const d=n===lt&&t[e+1].startsWith("/>")?" ":"";r+=n===rt?i+X:h>=0?(s.push(a),i.slice(0,h)+K+i.slice(h)+Z+d):i+Z+(-2===h?e:d)}return[ft(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=bt.createElement(l,i),vt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=vt.nextNode())&&a.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(K)){const e=h[r++],i=s.getAttribute(t).split(Z),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:n[2],strings:i,ctor:"."===n[1]?xt:"?"===n[1]?kt:"@"===n[1]?Ct:_t}),s.removeAttribute(t)}else t.startsWith(Z)&&(a.push({type:6,index:o}),s.removeAttribute(t));if(dt.test(s.tagName)){const t=s.textContent.split(Z),e=t.length-1;if(e>0){s.textContent=Y?Y.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],et()),vt.nextNode(),a.push({type:2,index:++o});s.append(t[e],et())}}}else if(8===s.nodeType)if(s.data===Q)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(Z,t+1));)a.push({type:7,index:o}),t+=Z.length-1}o++}}static createElement(t,e){const i=tt.createElement("template");return i.innerHTML=t,i}}function gt(t,e,i=t,s){var o,r,n;if(e===ut)return e;let a=void 0!==s?null==(o=i._$Co)?void 0:o[s]:i._$Cl;const l=it(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==l&&(null==(r=null==a?void 0:a._$AO)||r.call(a,!1),void 0===l?a=void 0:(a=new l(t),a._$AT(t,i,s)),void 0!==s?(null!=(n=i._$Co)?n:i._$Co=[])[s]=a:i._$Cl=a),void 0!==a&&(e=gt(t,a._$AS(t,e.values),a,s)),e}class yt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:s}=this._$AD,o=(null!=(e=null==t?void 0:t.creationScope)?e:tt).importNode(i,!0);vt.currentNode=o;let r=vt.nextNode(),n=0,a=0,l=s[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new wt(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new At(r,this,t)),this._$AV.push(e),l=s[++a]}n!==(null==l?void 0:l.index)&&(r=vt.nextNode(),n++)}return vt.currentNode=tt,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class wt{get _$AU(){var t,e;return null!=(e=null==(t=this._$AM)?void 0:t._$AU)?e:this._$Cv}constructor(t,e,i,s){var o;this.type=2,this._$AH=pt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=null==(o=null==s?void 0:s.isConnected)||o}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){var i;t=gt(this,t,e),it(t)?t===pt||null==t||""===t?(this._$AH!==pt&&this._$AR(),this._$AH=pt):t!==this._$AH&&t!==ut&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):st(i=t)||"function"==typeof(null==i?void 0:i[Symbol.iterator])?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==pt&&it(this._$AH)?this._$AA.nextSibling.data=t:this.T(tt.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=bt.createElement(ft(s.h,s.h[0]),this.options)),s);if((null==(e=this._$AH)?void 0:e._$AD)===o)this._$AH.p(i);else{const t=new yt(o,this),e=t.u(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=mt.get(t.strings);return void 0===e&&mt.set(t.strings,e=new bt(t)),e}k(t){st(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new wt(this.O(et()),this.O(et()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null==(i=this._$AP)||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class _t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=pt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=pt}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=gt(this,t,e,0),r=!it(t)||t!==this._$AH&&t!==ut,r&&(this._$AH=t);else{const s=t;let n,a;for(t=o[0],n=0;n<o.length-1;n++)a=gt(this,s[i+n],e,n),a===ut&&(a=this._$AH[n]),r||(r=!it(a)||a!==this._$AH[n]),a===pt?t=pt:t!==pt&&(t+=(null!=a?a:"")+o[n+1]),this._$AH[n]=a}r&&!s&&this.j(t)}j(t){t===pt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class xt extends _t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===pt?void 0:t}}class kt extends _t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==pt)}}class Ct extends _t{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){var i;if((t=null!=(i=gt(this,t,e,0))?i:pt)===ut)return;const s=this._$AH,o=t===pt&&s!==pt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==pt&&(s===pt||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!=(i=null==(e=this.options)?void 0:e.host)?i:this.element,t):this._$AH.handleEvent(t)}}class At{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){gt(this,t)}}const St=G.litHtmlPolyfillSupport;var It;null==St||St(bt,wt),(null!=(It=G.litHtmlVersions)?It:G.litHtmlVersions=[]).push("3.2.1");const zt=(t,e,i)=>{var s,o;const r=null!=(s=null==i?void 0:i.renderBefore)?s:e;let n=r._$litPart$;if(void 0===n){const t=null!=(o=null==i?void 0:i.renderBefore)?o:null;r._$litPart$=n=new wt(e.insertBefore(et(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
@@ -41,7 +41,7 @@ const Pt=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
43
43
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
44
|
-
*/,Nt=[],Mt=new Set,Bt=new Set;function Ft(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function jt(t,e){return(t||"").split(" ").some((t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e)))}function Lt(t){return t.map((t=>t.cssText)).join("\n")}const Rt="vaadin-themable-mixin-style";function
|
|
44
|
+
*/,Nt=[],Mt=new Set,Bt=new Set;function Ft(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function jt(t,e){return(t||"").split(" ").some((t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e)))}function Lt(t){return t.map((t=>t.cssText)).join("\n")}const Rt="vaadin-themable-mixin-style";function $t(t){t.prototype instanceof Tt?t.elementStyles=t.finalizeStyles(t.styles):t.prototype._template.content.getElementById(Rt).textContent=Lt(t.getStylesForThis()),Bt.forEach((e=>{const i=customElements.get(e);i!==t&&i.prototype instanceof t&&$t(i)}))}function Vt(t,e,i={}){e=function(t=[]){return[t].flat(1/0).filter((t=>t instanceof z||(console.warn("An item in styles is not of type CSSResult. Use `unsafeCSS` or `css`."),!1)))}(e),window.Vaadin&&window.Vaadin.styleModules?window.Vaadin.styleModules.registerStyles(t,e,i):Nt.push({themeFor:t,styles:e,include:i.include,moduleId:i.moduleId}),t&&Bt.forEach((i=>{if(jt(t,i)&&function(t){return Ft(customElements.get(t))}(i)){const t=customElements.get(i);!function(t,e){const i=t.__themes;return!(!i||!e)&&i.some((t=>t.styles.some((t=>e.some((e=>e.cssText===t.cssText))))))}(t,e)?(!window.Vaadin||!window.Vaadin.suppressPostFinalizeStylesWarning)&&console.warn(`The custom element definition for "${i}" was finalized before a style module was registered. Ideally, import component specific style modules before importing the corresponding custom element. This warning can be suppressed by setting "window.Vaadin.suppressPostFinalizeStylesWarning = true".`):console.warn(`Registering styles that already exist for ${i}`),$t(t),function(t){Mt.forEach((e=>{const i=e.deref();i instanceof t?function(t){if(!t.shadowRoot)return;const e=t.constructor;t instanceof Tt?([...t.shadowRoot.querySelectorAll("style")].forEach((t=>t.remove())),D(t.shadowRoot,e.elementStyles)):t.shadowRoot.getElementById(Rt).textContent=e.prototype._template.content.getElementById(Rt).textContent}(i):i||Mt.delete(e)}))}(t)}}))}function Wt(){return window.Vaadin&&window.Vaadin.styleModules?window.Vaadin.styleModules.getAllThemes():Nt}function qt(t=""){let e=0;return t.startsWith("lumo-")||t.startsWith("material-")?e=1:t.startsWith("vaadin-")&&(e=2),e}function Ut(t){const e=[];return t.include&&[].concat(t.include).forEach((t=>{const i=Wt().find((e=>e.moduleId===t));i?e.push(...Ut(i),...i.styles):console.warn(`Included moduleId ${t} not found in style registry`)}),t.styles),e}function Ht(t){const e=`${t}-default-theme`,i=Wt().filter((i=>i.moduleId!==e&&jt(i.themeFor,t))).map((t=>y(g({},t),{styles:[...Ut(t),...t.styles],includePriority:qt(t.moduleId)}))).sort(((t,e)=>e.includePriority-t.includePriority));return i.length>0?i:Wt().filter((t=>t.moduleId===e))}const Gt=t=>class extends(Pt(t)){constructor(){super(),Mt.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&Bt.add(this.is),this.elementStyles)return;const t=this.prototype._template;!t||Ft(this)||function(t,e){const i=document.createElement("style");i.id=Rt,i.textContent=Lt(t),e.content.appendChild(i)}(this.getStylesForThis(),t)}static finalizeStyles(t){const e=this.getStylesForThis();return t?[...[t].flat(1/0),...e]:e}static getStylesForThis(){const e=t.__themes||[],i=Object.getPrototypeOf(this.prototype);this.__themes=[...e,...(i?i.constructor.__themes:[])||[],...Ht(this.is)];const s=this.__themes.flatMap((t=>t.styles));return s.filter(((t,e)=>e===s.lastIndexOf(t)))}}
|
|
45
45
|
/**
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -131,7 +131,7 @@ const Pt=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
131
131
|
--lumo-disabled-text-color: GrayText;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
`)
|
|
134
|
+
`),Vt("",T`
|
|
135
135
|
[theme~='dark'] {
|
|
136
136
|
/* Base (background) */
|
|
137
137
|
--lumo-base-color: hsl(214, 35%, 21%);
|
|
@@ -466,7 +466,7 @@ const Jt=T`
|
|
|
466
466
|
--lumo-line-height-s: 1.375;
|
|
467
467
|
--lumo-line-height-m: 1.625;
|
|
468
468
|
}
|
|
469
|
-
|
|
469
|
+
`;Vt("",T`
|
|
470
470
|
body,
|
|
471
471
|
:host {
|
|
472
472
|
font-family: var(--lumo-font-family);
|
|
@@ -558,7 +558,7 @@ const Jt=T`
|
|
|
558
558
|
border-left: none;
|
|
559
559
|
border-right: 2px solid var(--lumo-contrast-30pct);
|
|
560
560
|
}
|
|
561
|
-
`,{moduleId:"lumo-typography"}),Yt("typography-props",Jt)
|
|
561
|
+
`,{moduleId:"lumo-typography"}),Yt("typography-props",Jt),Vt("vaadin-checkbox",T`
|
|
562
562
|
:host {
|
|
563
563
|
color: var(--vaadin-checkbox-label-color, var(--lumo-body-text-color));
|
|
564
564
|
font-size: var(--vaadin-checkbox-label-font-size, var(--lumo-font-size-m));
|
|
@@ -900,7 +900,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
900
900
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
901
901
|
Code distributed by Google as part of the polymer project is also
|
|
902
902
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
903
|
-
*/let we={},
|
|
903
|
+
*/let we={},_e={};function xe(t,e){we[t]=_e[t.toLowerCase()]=e}function ke(t){return we[t]||_e[t.toLowerCase()]}class Ce extends HTMLElement{static get observedAttributes(){return["id"]}static import(t,e){if(t){let i=ke(t);return i&&e?i.querySelector(e):i}return null}attributeChangedCallback(t,e,i,s){e!==i&&this.register()}get assetpath(){if(!this.__assetpath){const t=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument,e=te(this.getAttribute("assetpath")||"",t.baseURI);this.__assetpath=ie(e)}return this.__assetpath}register(t){if(t=t||this.id){if(ae&&void 0!==ke(t))throw xe(t,null),new Error(`strictTemplatePolicy: dom-module ${t} re-registered`);this.id=t,xe(t,this),(e=this).querySelector("style")&&console.warn("dom-module %s has style outside template",e.id)}var e}}Ce.prototype.modules=we,customElements.define("dom-module",Ce);
|
|
904
904
|
/**
|
|
905
905
|
@license
|
|
906
906
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -928,7 +928,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
928
928
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
929
929
|
Code distributed by Google as part of the polymer project is also
|
|
930
930
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
931
|
-
*/;function Me(t){return t.indexOf(".")>=0}function Be(t){let e=t.indexOf(".");return-1===e?t:t.slice(0,e)}function Fe(t,e){return 0===t.indexOf(e+".")}function je(t,e){return 0===e.indexOf(t+".")}function Le(t,e,i){return e+i.slice(t.length)}function Re(t){if(Array.isArray(t)){let e=[];for(let i=0;i<t.length;i++){let s=t[i].toString().split(".");for(let t=0;t<s.length;t++)e.push(s[t])}return e.join(".")}return t}function
|
|
931
|
+
*/;function Me(t){return t.indexOf(".")>=0}function Be(t){let e=t.indexOf(".");return-1===e?t:t.slice(0,e)}function Fe(t,e){return 0===t.indexOf(e+".")}function je(t,e){return 0===e.indexOf(t+".")}function Le(t,e,i){return e+i.slice(t.length)}function Re(t){if(Array.isArray(t)){let e=[];for(let i=0;i<t.length;i++){let s=t[i].toString().split(".");for(let t=0;t<s.length;t++)e.push(s[t])}return e.join(".")}return t}function $e(t){return Array.isArray(t)?Re(t).split("."):t.toString().split(".")}function Ve(t,e,i){let s=t,o=$e(e);for(let t=0;t<o.length;t++){if(!s)return;s=s[o[t]]}return i&&(i.path=o.join(".")),s}function We(t,e,i){let s=t,o=$e(e),r=o[o.length-1];if(o.length>1){for(let t=0;t<o.length-1;t++)if(s=s[o[t]],!s)return;s[r]=i}else s[e]=i;return o.join(".")}
|
|
932
932
|
/**
|
|
933
933
|
@license
|
|
934
934
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -966,7 +966,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
966
966
|
* be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
|
|
967
967
|
* Google as part of the polymer project is also subject to an additional IP
|
|
968
968
|
* rights grant found at http://polymer.github.io/PATENTS.txt
|
|
969
|
-
*/let yi=0;const wi=[],xi={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},_i="__computeInfo",ki=/[A-Z]/;function Ci(t,e,i){let s=t[e];if(s){if(!t.hasOwnProperty(e)&&(s=t[e]=Object.create(t[e]),i))for(let t in s){let e=s[t],i=s[t]=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]}}else s=t[e]={};return s}function Ai(t,e,i,s,o,r){if(e){let n=!1;const a=yi++;for(let l in i){let h=e[o?Be(l):l];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==a)&&(!o||Ii(l,e.trigger))&&(e.info&&(e.info.lastRun=a),e.fn(t,l,i,s,e.info,o,r),n=!0)}return n}return!1}function Si(t,e,i,s,o,r,n,a){let l=!1,h=e[n?Be(s):s];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==i)&&(!n||Ii(s,e.trigger))&&(e.info&&(e.info.lastRun=i),e.fn(t,s,o,r,e.info,n,a),l=!0);return l}function Ii(t,e){if(e){let i=e.name;return i==t||!(!e.structured||!Fe(i,t))||!(!e.wildcard||!je(i,t))}return!0}function zi(t,e,i,s,o){let r="string"==typeof o.method?t[o.method]:o.method,n=o.property;r?r.call(t,t.__data[n],s[n]):o.dynamicFn||console.warn("observer method `"+o.method+"` not defined")}function Ti(t,e,i){let s=Be(e);return s!==e&&(Di(t,Ye(s)+"-changed",i[e],e),!0)}function Di(t,e,i,s){let o={value:i,queueProperty:!0};s&&(o.path=s),Ne(t).dispatchEvent(new CustomEvent(e,{detail:o}))}function Oi(t,e,i,s,o,r){let n=(r?Be(e):e)!=e?e:null,a=n?$e(t,n):t.__data[e];n&&void 0===a&&(a=i[e]),Di(t,o.eventName,a,n)}function Ei(t,e,i,s,o){let r=t.__data[e];ne&&(r=ne(r,o.attrName,"attribute",t)),t._propertyToAttribute(e,o.attrName,r)}const Pi=(t,e,i)=>{let s=0,o=e.length-1,r=-1;for(;s<=o;){const n=s+o>>1,a=i.get(e[n].methodInfo)-i.get(t.methodInfo);if(a<0)s=n+1;else{if(!(a>0)){r=n;break}o=n-1}}r<0&&(r=o+1),e.splice(r,0,t)},Ni=(t,e,i,s,o)=>{const r=e[o?Be(t):t];if(r)for(let e=0;e<r.length;e++){const n=r[e];n.info.lastRun!==yi&&(!o||Ii(t,n.trigger))&&(n.info.lastRun=yi,Pi(n.info,i,s))}};function Mi(t,e,i,s,o){let r=$i(t,e,i,0,o);if(r===wi)return!1;let n=o.methodInfo;return t.__dataHasAccessor&&t.__dataHasAccessor[n]?t._setPendingProperty(n,r,!0):(t[n]=r,!1)}function Bi(t,e,i,s,o,r,n){i.bindings=i.bindings||[];let a={kind:s,target:o,parts:r,literal:n,isCompound:1!==r.length};if(i.bindings.push(a),function(t){return!!t.target&&"attribute"!=t.kind&&"text"!=t.kind&&!t.isCompound&&"{"===t.parts[0].mode}(a)){let{event:t,negate:e}=a.parts[0];a.listenerEvent=t||Ye(o)+"-changed",a.listenerNegate=e}let l=e.nodeInfoList.length;for(let i=0;i<a.parts.length;i++){let s=a.parts[i];s.compoundIndex=i,Fi(t,e,a,s,l)}}function Fi(t,e,i,s,o){if(!s.literal)if("attribute"===i.kind&&"-"===i.target[0])console.warn("Cannot set attribute "+i.target+' because "-" is not a valid attribute starting character');else{let r=s.dependencies,n={index:o,binding:i,part:s,evaluator:t};for(let i=0;i<r.length;i++){let s=r[i];"string"==typeof s&&(s=Ji(s),s.wildcard=!0),t._addTemplatePropertyEffect(e,s.rootProperty,{fn:ji,info:n,trigger:s})}}}function ji(t,e,i,s,o,r,n){let a=n[o.index],l=o.binding,h=o.part;if(r&&h.source&&e.length>h.source.length&&"property"==l.kind&&!l.isCompound&&a.__isPropertyEffectsClient&&a.__dataHasAccessor&&a.__dataHasAccessor[l.target]){let s=i[e];e=Le(h.source,l.target,e),a._setPendingPropertyOrPath(e,s,!1,!0)&&t._enqueueClient(a)}else{let n=o.evaluator._evaluateBinding(t,h,e,i,s,r);n!==wi&&function(t,e,i,s,o){if(o=function(t,e,i,s){if(i.isCompound){let o=t.__dataCompoundStorage[i.target];o[s.compoundIndex]=e,e=o.join("")}return"attribute"!==i.kind&&("textContent"===i.target||"value"===i.target&&("input"===t.localName||"textarea"===t.localName))&&(e=null==e?"":e),e}(e,o,i,s),ne&&(o=ne(o,i.target,i.kind,e)),"attribute"==i.kind)t._valueToNodeAttribute(e,o,i.target);else{let s=i.target;e.__isPropertyEffectsClient&&e.__dataHasAccessor&&e.__dataHasAccessor[s]?(!e[xi.READ_ONLY]||!e[xi.READ_ONLY][s])&&e._setPendingProperty(s,o)&&t._enqueueClient(e):t._setUnmanagedPropertyToNode(e,s,o)}}(t,a,l,h,n)}}function Li(t,e){if(e.isCompound){let i=t.__dataCompoundStorage||(t.__dataCompoundStorage={}),s=e.parts,o=new Array(s.length);for(let t=0;t<s.length;t++)o[t]=s[t].literal;let r=e.target;i[r]=o,e.literal&&"property"==e.kind&&("className"===r&&(t=Ne(t)),t[r]=e.literal)}}function Ri(t,e,i){if(i.listenerEvent){let s=i.parts[0];t.addEventListener(i.listenerEvent,(function(t){!function(t,e,i,s,o){let r,n=t.detail,a=n&&n.path;a?(s=Le(i,s,a),r=n&&n.value):r=t.currentTarget[i],r=o?!r:r,(!e[xi.READ_ONLY]||!e[xi.READ_ONLY][s])&&e._setPendingPropertyOrPath(s,r,!0,!!a)&&(!n||!n.queueProperty)&&e._invalidateProperties()}(t,e,i.target,s.source,s.negate)}))}}function Vi(t,e,i,s,o,r){let n={methodName:e.methodName,args:e.args,methodInfo:o,dynamicFn:r=e.static||r&&("object"!=typeof r||r[e.methodName])};for(let o,r=0;r<e.args.length&&(o=e.args[r]);r++)o.literal||t._addPropertyEffect(o.rootProperty,i,{fn:s,info:n,trigger:o});return r&&t._addPropertyEffect(e.methodName,i,{fn:s,info:n}),n}function $i(t,e,i,s,o){let r=t._methodHost||t,n=r[o.methodName];if(n){let s=t._marshalArgs(o.args,e,i);return s===wi?wi:n.apply(r,s)}o.dynamicFn||console.warn("method `"+o.methodName+"` not defined")}const Wi=[],qi="(?:[a-zA-Z_$][\\w.:$\\-*]*)",Ui="(?:("+qi+"|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)",Hi=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?("+qi+"\\s*(?:\\(\\s*(?:(?:"+Ui+"(?:,\\s*"+Ui+")*)?)\\)\\s*)?)(?:]]|}})","g");function Gi(t){let e="";for(let i=0;i<t.length;i++)e+=t[i].literal||"";return e}function Yi(t){let e=t.match(/([^\s]+?)\(([\s\S]*)\)/);if(e){let t={methodName:e[1],static:!0,args:Wi};return e[2].trim()?function(t,e){return e.args=t.map((function(t){let i=Ji(t);return i.literal||(e.static=!1),i}),this),e}(e[2].replace(/\\,/g,",").split(","),t):t}return null}function Ji(t){let e=t.trim().replace(/,/g,",").replace(/\\(.)/g,"$1"),i={name:e,value:"",literal:!1},s=e[0];switch("-"===s&&(s=e[1]),s>="0"&&s<="9"&&(s="#"),s){case"'":case'"':i.value=e.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(e),i.literal=!0}return i.literal||(i.rootProperty=Be(e),i.structured=Me(e),i.structured&&(i.wildcard=".*"==e.slice(-2),i.wildcard&&(i.name=e.slice(0,-2)))),i}function Ki(t,e,i){let s=$e(t,i);return void 0===s&&(s=e[i]),s}function Zi(t,e,i,s){const o={indexSplices:s};ue&&!t._overrideLegacyUndefined&&(e.splices=o),t.notifyPath(i+".splices",o),t.notifyPath(i+".length",e.length),ue&&!t._overrideLegacyUndefined&&(o.indexSplices=[])}function Qi(t,e,i,s,o,r){Zi(t,e,i,[{index:s,addedCount:o,removed:r,object:e,type:"splice"}])}const Xi=ye((t=>{const e=gi(li(t));return class extends e{constructor(){super(),this.__isPropertyEffectsClient=!0}get PROPERTY_EFFECT_TYPES(){return xi}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(ts.length){let t=ts[ts.length-1];t._enqueueClient(this),this.__dataHost=t}}_initializeProtoProperties(t){this.__data=Object.create(t),this.__dataPending=Object.create(t),this.__dataOld={}}_initializeInstanceProperties(t){let e=this[xi.READ_ONLY];for(let i in t)(!e||!e[i])&&(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=t[i])}_addPropertyEffect(t,e,i){this._createPropertyAccessor(t,e==xi.READ_ONLY);let s=Ci(this,e,!0)[t];s||(s=this[e][t]=[]),s.push(i)}_removePropertyEffect(t,e,i){let s=Ci(this,e,!0)[t],o=s.indexOf(i);o>=0&&s.splice(o,1)}_hasPropertyEffect(t,e){let i=this[e];return!(!i||!i[t])}_hasReadOnlyEffect(t){return this._hasPropertyEffect(t,xi.READ_ONLY)}_hasNotifyEffect(t){return this._hasPropertyEffect(t,xi.NOTIFY)}_hasReflectEffect(t){return this._hasPropertyEffect(t,xi.REFLECT)}_hasComputedEffect(t){return this._hasPropertyEffect(t,xi.COMPUTE)}_setPendingPropertyOrPath(t,e,i,s){if(s||Be(Array.isArray(t)?t[0]:t)!==t){if(!s){let i=$e(this,t);if(!(t=We(this,t,e))||!super._shouldPropertyChange(t,e,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(t,e,i))return function(t,e,i){let s=t.__dataLinkedPaths;if(s){let o;for(let r in s){let n=s[r];je(r,e)?(o=Le(r,n,e),t._setPendingPropertyOrPath(o,i,!0,!0)):je(n,e)&&(o=Le(n,r,e),t._setPendingPropertyOrPath(o,i,!0,!0))}}}(this,t,e),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[t])return this._setPendingProperty(t,e,i);this[t]=e}return!1}_setUnmanagedPropertyToNode(t,e,i){(i!==t[e]||"object"==typeof i)&&("className"===e&&(t=Ne(t)),t[e]=i)}_setPendingProperty(t,e,i){let s=this.__dataHasPaths&&Me(t);return!!this._shouldPropertyChange(t,e,(s?this.__dataTemp:this.__data)[t])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),t in this.__dataOld||(this.__dataOld[t]=this.__data[t]),s?this.__dataTemp[t]=e:this.__data[t]=e,this.__dataPending[t]=e,(s||this[xi.NOTIFY]&&this[xi.NOTIFY][t])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[t]=i),!0)}_setProperty(t,e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(t){this.__dataPendingClients=this.__dataPendingClients||[],t!==this&&this.__dataPendingClients.push(t)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let t=this.__dataPendingClients;if(t){this.__dataPendingClients=null;for(let e=0;e<t.length;e++){let i=t[e];i.__dataEnabled?i.__dataPending&&i._flushProperties():i._enableProperties()}}}_readyClients(){this.__enableOrFlushClients()}setProperties(t,e){for(let i in t)(e||!this[xi.READ_ONLY]||!this[xi.READ_ONLY][i])&&this._setPendingPropertyOrPath(i,t[i],!0);this._invalidateProperties()}ready(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}_propertiesChanged(t,e,i){let s,o=this.__dataHasPaths;this.__dataHasPaths=!1,function(t,e,i,s){let o=t[xi.COMPUTE];if(o)if(pe){yi++;const r=function(t){let e=t.constructor.__orderedComputedDeps;if(!e){e=new Map;const i=t[xi.COMPUTE];let s,{counts:o,ready:r,total:n}=function(t){const e=t[_i],i={},s=t[xi.COMPUTE],o=[];let r=0;for(let t in e){const s=e[t];r+=i[t]=s.args.filter((t=>!t.literal)).length+(s.dynamicFn?1:0)}for(let t in s)e[t]||o.push(t);return{counts:i,ready:o,total:r}}(t);for(;s=r.shift();){e.set(s,e.size);const t=i[s];t&&t.forEach((t=>{const e=t.info.methodInfo;--n,0==--o[e]&&r.push(e)}))}0!==n&&console.warn(`Computed graph for ${t.localName} incomplete; circular?`),t.constructor.__orderedComputedDeps=e}return e}(t),n=[];for(let t in e)Ni(t,o,n,r,s);let a;for(;a=n.shift();)Mi(t,"",e,0,a)&&Ni(a.methodInfo,o,n,r,s);Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),t.__dataPending=null}else{let r=e;for(;Ai(t,o,r,i,s);)Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),r=t.__dataPending,t.__dataPending=null}}(this,e,i,o),s=this.__dataToNotify,this.__dataToNotify=null,this._propagatePropertyChanges(e,i,o),this._flushClients(),Ai(this,this[xi.REFLECT],e,i,o),Ai(this,this[xi.OBSERVE],e,i,o),s&&function(t,e,i,s,o){let r,n,a=t[xi.NOTIFY],l=yi++;for(let n in e)e[n]&&(a&&Si(t,a,l,n,i,s,o)||o&&Ti(t,n,i))&&(r=!0);r&&(n=t.__dataHost)&&n._invalidateProperties&&n._invalidateProperties()}(this,s,e,i,o),1==this.__dataCounter&&(this.__dataTemp={})}_propagatePropertyChanges(t,e,i){this[xi.PROPAGATE]&&Ai(this,this[xi.PROPAGATE],t,e,i),this.__templateInfo&&this._runEffectsForTemplate(this.__templateInfo,t,e,i)}_runEffectsForTemplate(t,e,i,s){const o=(e,s)=>{Ai(this,t.propertyEffects,e,i,s,t.nodeList);for(let o=t.firstChild;o;o=o.nextSibling)this._runEffectsForTemplate(o,e,i,s)};t.runEffects?t.runEffects(o,e,s):o(e,s)}linkPaths(t,e){t=Re(t),e=Re(e),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[t]=e}unlinkPaths(t){t=Re(t),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[t]}notifySplices(t,e){let i={path:""};Zi(this,$e(this,t,i),i.path,e)}get(t,e){return $e(e||this,t)}set(t,e,i){i?We(i,t,e):(!this[xi.READ_ONLY]||!this[xi.READ_ONLY][t])&&this._setPendingPropertyOrPath(t,e,!0)&&this._invalidateProperties()}push(t,...e){let i={path:""},s=$e(this,t,i),o=s.length,r=s.push(...e);return e.length&&Qi(this,s,i.path,o,e.length,[]),r}pop(t){let e={path:""},i=$e(this,t,e),s=!!i.length,o=i.pop();return s&&Qi(this,i,e.path,i.length,0,[o]),o}splice(t,e,i,...s){let o,r={path:""},n=$e(this,t,r);return e<0?e=n.length-Math.floor(-e):e&&(e=Math.floor(e)),o=2===arguments.length?n.splice(e):n.splice(e,i,...s),(s.length||o.length)&&Qi(this,n,r.path,e,s.length,o),o}shift(t){let e={path:""},i=$e(this,t,e),s=!!i.length,o=i.shift();return s&&Qi(this,i,e.path,0,0,[o]),o}unshift(t,...e){let i={path:""},s=$e(this,t,i),o=s.unshift(...e);return e.length&&Qi(this,s,i.path,0,e.length,[]),o}notifyPath(t,e){let i;if(1==arguments.length){let s={path:""};e=$e(this,t,s),i=s.path}else i=Array.isArray(t)?Re(t):t;this._setPendingPropertyOrPath(i,e,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(t,e){this._addPropertyEffect(t,xi.READ_ONLY),e&&(this["_set"+function(t){return t[0].toUpperCase()+t.substring(1)}(t)]=function(e){this._setProperty(t,e)})}_createPropertyObserver(t,e,i){let s={property:t,method:e,dynamicFn:!!i};this._addPropertyEffect(t,xi.OBSERVE,{fn:zi,info:s,trigger:{name:t}}),i&&this._addPropertyEffect(e,xi.OBSERVE,{fn:zi,info:s,trigger:{name:e}})}_createMethodObserver(t,e){let i=Yi(t);if(!i)throw new Error("Malformed observer expression '"+t+"'");Vi(this,i,xi.OBSERVE,$i,null,e)}_createNotifyingProperty(t){this._addPropertyEffect(t,xi.NOTIFY,{fn:Oi,info:{eventName:Ye(t)+"-changed",property:t}})}_createReflectedProperty(t){let e=this.constructor.attributeNameForProperty(t);"-"===e[0]?console.warn("Property "+t+" cannot be reflected to attribute "+e+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(t,xi.REFLECT,{fn:Ei,info:{attrName:e}})}_createComputedProperty(t,e,i){let s=Yi(e);if(!s)throw new Error("Malformed computed expression '"+e+"'");const o=Vi(this,s,xi.COMPUTE,Mi,t,i);Ci(this,_i)[t]=o}_marshalArgs(t,e,i){const s=this.__data,o=[];for(let r=0,n=t.length;r<n;r++){let{name:n,structured:a,wildcard:l,value:h,literal:c}=t[r];if(!c)if(l){const t=je(n,e),o=Ki(s,i,t?e:n);h={path:t?e:n,value:o,base:t?$e(s,n):o}}else h=a?Ki(s,i,n):s[n];if(ue&&!this._overrideLegacyUndefined&&void 0===h&&t.length>1)return wi;o[r]=h}return o}static addPropertyEffect(t,e,i){this.prototype._addPropertyEffect(t,e,i)}static createPropertyObserver(t,e,i){this.prototype._createPropertyObserver(t,e,i)}static createMethodObserver(t,e){this.prototype._createMethodObserver(t,e)}static createNotifyingProperty(t){this.prototype._createNotifyingProperty(t)}static createReadOnlyProperty(t,e){this.prototype._createReadOnlyProperty(t,e)}static createReflectedProperty(t){this.prototype._createReflectedProperty(t)}static createComputedProperty(t,e,i){this.prototype._createComputedProperty(t,e,i)}static bindTemplate(t){return this.prototype._bindTemplate(t)}_bindTemplate(t,e){let i=this.constructor._parseTemplate(t),s=this.__preBoundTemplateInfo==i;if(!s)for(let t in i.propertyEffects)this._createPropertyAccessor(t);if(e)if(i=Object.create(i),i.wasPreBound=s,this.__templateInfo){const e=t._parentTemplateInfo||this.__templateInfo,s=e.lastChild;i.parent=e,e.lastChild=i,i.previousSibling=s,s?s.nextSibling=i:e.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(t,e,i){(t.hostProps=t.hostProps||{})[e]=!0;let s=t.propertyEffects=t.propertyEffects||{};(s[e]=s[e]||[]).push(i)}_stampTemplate(t,e){e=e||this._bindTemplate(t,!0),ts.push(this);let i=super._stampTemplate(t,e);if(ts.pop(),e.nodeList=i.nodeList,!e.wasPreBound){let t=e.childNodes=[];for(let e=i.firstChild;e;e=e.nextSibling)t.push(e)}return i.templateInfo=e,function(t,e){let{nodeList:i,nodeInfoList:s}=e;if(s.length)for(let e=0;e<s.length;e++){let o=i[e],r=s[e].bindings;if(r)for(let e=0;e<r.length;e++){let i=r[e];Li(o,i),Ri(o,t,i)}o.__dataHost=t}}(this,e),this.__dataClientsReady&&(this._runEffectsForTemplate(e,this.__data,null,!1),this._flushClients()),i}_removeBoundDom(t){const e=t.templateInfo,{previousSibling:i,nextSibling:s,parent:o}=e;i?i.nextSibling=s:o&&(o.firstChild=s),s?s.previousSibling=i:o&&(o.lastChild=i),e.nextSibling=e.previousSibling=null;let r=e.childNodes;for(let t=0;t<r.length;t++){let e=r[t];Ne(Ne(e).parentNode).removeChild(e)}}static _parseTemplateNode(t,i,s){let o=e._parseTemplateNode.call(this,t,i,s);if(t.nodeType===Node.TEXT_NODE){let e=this._parseBindings(t.textContent,i);e&&(t.textContent=Gi(e)||" ",Bi(this,i,s,"text","textContent",e),o=!0)}return o}static _parseTemplateNodeAttribute(t,i,s,o,r){let n=this._parseBindings(r,i);if(n){let e=o,r="property";ki.test(o)?r="attribute":"$"==o[o.length-1]&&(o=o.slice(0,-1),r="attribute");let a=Gi(n);return a&&"attribute"==r&&("class"==o&&t.hasAttribute("class")&&(a+=" "+t.getAttribute(o)),t.setAttribute(o,a)),"attribute"==r&&"disable-upgrade$"==e&&t.setAttribute(o,""),"input"===t.localName&&"value"===e&&t.setAttribute(e,""),t.removeAttribute(e),"property"===r&&(o=Ge(o)),Bi(this,i,s,r,o,n,a),!0}return e._parseTemplateNodeAttribute.call(this,t,i,s,o,r)}static _parseTemplateNestedTemplate(t,i,s){let o=e._parseTemplateNestedTemplate.call(this,t,i,s);const r=t.parentNode,n=s.templateInfo,a="dom-if"===r.localName;me&&(a||"dom-repeat"===r.localName)&&(r.removeChild(t),(s=s.parentInfo).templateInfo=n,s.noted=!0,o=!1);let l=n.hostProps;if(ve&&a)l&&(i.hostProps=Object.assign(i.hostProps||{},l),me||(s.parentInfo.noted=!0));else{let t="{";for(let e in l)Bi(this,i,s,"property","_host_"+e,[{mode:t,source:e,dependencies:[e],hostProp:!0}])}return o}static _parseBindings(t,e){let i,s=[],o=0;for(;null!==(i=Hi.exec(t));){i.index>o&&s.push({literal:t.slice(o,i.index)});let r=i[1][0],n=!!i[2],a=i[3].trim(),l=!1,h="",c=-1;"{"==r&&(c=a.indexOf("::"))>0&&(h=a.substring(c+2),a=a.substring(0,c),l=!0);let d=Yi(a),u=[];if(d){let{args:t,methodName:i}=d;for(let e=0;e<t.length;e++){let i=t[e];i.literal||u.push(i)}let s=e.dynamicFns;(s&&s[i]||d.static)&&(u.push(i),d.dynamicFn=!0)}else u.push(a);s.push({source:a,mode:r,negate:n,customEvent:l,signature:d,dependencies:u,event:h}),o=Hi.lastIndex}if(o&&o<t.length){let e=t.substring(o);e&&s.push({literal:e})}return s.length?s:null}static _evaluateBinding(t,e,i,s,o,r){let n;return n=e.signature?$i(t,i,s,0,e.signature):i!=e.source?$e(t,e.source):r&&Me(i)?$e(t,i):t.__data[i],e.negate&&(n=!n),n}}})),ts=[],es=ye((t=>{const e=oi(t);function i(t){const e=Object.getPrototypeOf(t);return e.prototype instanceof o?e:null}function s(t){if(!t.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",t))){let e=null;if(t.hasOwnProperty(JSCompiler_renameProperty("properties",t))){const i=t.properties;i&&(e=
|
|
969
|
+
*/let yi=0;const wi=[],_i={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},xi="__computeInfo",ki=/[A-Z]/;function Ci(t,e,i){let s=t[e];if(s){if(!t.hasOwnProperty(e)&&(s=t[e]=Object.create(t[e]),i))for(let t in s){let e=s[t],i=s[t]=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]}}else s=t[e]={};return s}function Ai(t,e,i,s,o,r){if(e){let n=!1;const a=yi++;for(let l in i){let h=e[o?Be(l):l];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==a)&&(!o||Ii(l,e.trigger))&&(e.info&&(e.info.lastRun=a),e.fn(t,l,i,s,e.info,o,r),n=!0)}return n}return!1}function Si(t,e,i,s,o,r,n,a){let l=!1,h=e[n?Be(s):s];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==i)&&(!n||Ii(s,e.trigger))&&(e.info&&(e.info.lastRun=i),e.fn(t,s,o,r,e.info,n,a),l=!0);return l}function Ii(t,e){if(e){let i=e.name;return i==t||!(!e.structured||!Fe(i,t))||!(!e.wildcard||!je(i,t))}return!0}function zi(t,e,i,s,o){let r="string"==typeof o.method?t[o.method]:o.method,n=o.property;r?r.call(t,t.__data[n],s[n]):o.dynamicFn||console.warn("observer method `"+o.method+"` not defined")}function Ti(t,e,i){let s=Be(e);return s!==e&&(Di(t,Ye(s)+"-changed",i[e],e),!0)}function Di(t,e,i,s){let o={value:i,queueProperty:!0};s&&(o.path=s),Ne(t).dispatchEvent(new CustomEvent(e,{detail:o}))}function Oi(t,e,i,s,o,r){let n=(r?Be(e):e)!=e?e:null,a=n?Ve(t,n):t.__data[e];n&&void 0===a&&(a=i[e]),Di(t,o.eventName,a,n)}function Ei(t,e,i,s,o){let r=t.__data[e];ne&&(r=ne(r,o.attrName,"attribute",t)),t._propertyToAttribute(e,o.attrName,r)}const Pi=(t,e,i)=>{let s=0,o=e.length-1,r=-1;for(;s<=o;){const n=s+o>>1,a=i.get(e[n].methodInfo)-i.get(t.methodInfo);if(a<0)s=n+1;else{if(!(a>0)){r=n;break}o=n-1}}r<0&&(r=o+1),e.splice(r,0,t)},Ni=(t,e,i,s,o)=>{const r=e[o?Be(t):t];if(r)for(let e=0;e<r.length;e++){const n=r[e];n.info.lastRun!==yi&&(!o||Ii(t,n.trigger))&&(n.info.lastRun=yi,Pi(n.info,i,s))}};function Mi(t,e,i,s,o){let r=Vi(t,e,i,0,o);if(r===wi)return!1;let n=o.methodInfo;return t.__dataHasAccessor&&t.__dataHasAccessor[n]?t._setPendingProperty(n,r,!0):(t[n]=r,!1)}function Bi(t,e,i,s,o,r,n){i.bindings=i.bindings||[];let a={kind:s,target:o,parts:r,literal:n,isCompound:1!==r.length};if(i.bindings.push(a),function(t){return!!t.target&&"attribute"!=t.kind&&"text"!=t.kind&&!t.isCompound&&"{"===t.parts[0].mode}(a)){let{event:t,negate:e}=a.parts[0];a.listenerEvent=t||Ye(o)+"-changed",a.listenerNegate=e}let l=e.nodeInfoList.length;for(let i=0;i<a.parts.length;i++){let s=a.parts[i];s.compoundIndex=i,Fi(t,e,a,s,l)}}function Fi(t,e,i,s,o){if(!s.literal)if("attribute"===i.kind&&"-"===i.target[0])console.warn("Cannot set attribute "+i.target+' because "-" is not a valid attribute starting character');else{let r=s.dependencies,n={index:o,binding:i,part:s,evaluator:t};for(let i=0;i<r.length;i++){let s=r[i];"string"==typeof s&&(s=Ji(s),s.wildcard=!0),t._addTemplatePropertyEffect(e,s.rootProperty,{fn:ji,info:n,trigger:s})}}}function ji(t,e,i,s,o,r,n){let a=n[o.index],l=o.binding,h=o.part;if(r&&h.source&&e.length>h.source.length&&"property"==l.kind&&!l.isCompound&&a.__isPropertyEffectsClient&&a.__dataHasAccessor&&a.__dataHasAccessor[l.target]){let s=i[e];e=Le(h.source,l.target,e),a._setPendingPropertyOrPath(e,s,!1,!0)&&t._enqueueClient(a)}else{let n=o.evaluator._evaluateBinding(t,h,e,i,s,r);n!==wi&&function(t,e,i,s,o){if(o=function(t,e,i,s){if(i.isCompound){let o=t.__dataCompoundStorage[i.target];o[s.compoundIndex]=e,e=o.join("")}return"attribute"!==i.kind&&("textContent"===i.target||"value"===i.target&&("input"===t.localName||"textarea"===t.localName))&&(e=null==e?"":e),e}(e,o,i,s),ne&&(o=ne(o,i.target,i.kind,e)),"attribute"==i.kind)t._valueToNodeAttribute(e,o,i.target);else{let s=i.target;e.__isPropertyEffectsClient&&e.__dataHasAccessor&&e.__dataHasAccessor[s]?(!e[_i.READ_ONLY]||!e[_i.READ_ONLY][s])&&e._setPendingProperty(s,o)&&t._enqueueClient(e):t._setUnmanagedPropertyToNode(e,s,o)}}(t,a,l,h,n)}}function Li(t,e){if(e.isCompound){let i=t.__dataCompoundStorage||(t.__dataCompoundStorage={}),s=e.parts,o=new Array(s.length);for(let t=0;t<s.length;t++)o[t]=s[t].literal;let r=e.target;i[r]=o,e.literal&&"property"==e.kind&&("className"===r&&(t=Ne(t)),t[r]=e.literal)}}function Ri(t,e,i){if(i.listenerEvent){let s=i.parts[0];t.addEventListener(i.listenerEvent,(function(t){!function(t,e,i,s,o){let r,n=t.detail,a=n&&n.path;a?(s=Le(i,s,a),r=n&&n.value):r=t.currentTarget[i],r=o?!r:r,(!e[_i.READ_ONLY]||!e[_i.READ_ONLY][s])&&e._setPendingPropertyOrPath(s,r,!0,!!a)&&(!n||!n.queueProperty)&&e._invalidateProperties()}(t,e,i.target,s.source,s.negate)}))}}function $i(t,e,i,s,o,r){let n={methodName:e.methodName,args:e.args,methodInfo:o,dynamicFn:r=e.static||r&&("object"!=typeof r||r[e.methodName])};for(let o,r=0;r<e.args.length&&(o=e.args[r]);r++)o.literal||t._addPropertyEffect(o.rootProperty,i,{fn:s,info:n,trigger:o});return r&&t._addPropertyEffect(e.methodName,i,{fn:s,info:n}),n}function Vi(t,e,i,s,o){let r=t._methodHost||t,n=r[o.methodName];if(n){let s=t._marshalArgs(o.args,e,i);return s===wi?wi:n.apply(r,s)}o.dynamicFn||console.warn("method `"+o.methodName+"` not defined")}const Wi=[],qi="(?:[a-zA-Z_$][\\w.:$\\-*]*)",Ui="(?:("+qi+"|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)",Hi=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?("+qi+"\\s*(?:\\(\\s*(?:(?:"+Ui+"(?:,\\s*"+Ui+")*)?)\\)\\s*)?)(?:]]|}})","g");function Gi(t){let e="";for(let i=0;i<t.length;i++)e+=t[i].literal||"";return e}function Yi(t){let e=t.match(/([^\s]+?)\(([\s\S]*)\)/);if(e){let t={methodName:e[1],static:!0,args:Wi};return e[2].trim()?function(t,e){return e.args=t.map((function(t){let i=Ji(t);return i.literal||(e.static=!1),i}),this),e}(e[2].replace(/\\,/g,",").split(","),t):t}return null}function Ji(t){let e=t.trim().replace(/,/g,",").replace(/\\(.)/g,"$1"),i={name:e,value:"",literal:!1},s=e[0];switch("-"===s&&(s=e[1]),s>="0"&&s<="9"&&(s="#"),s){case"'":case'"':i.value=e.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(e),i.literal=!0}return i.literal||(i.rootProperty=Be(e),i.structured=Me(e),i.structured&&(i.wildcard=".*"==e.slice(-2),i.wildcard&&(i.name=e.slice(0,-2)))),i}function Ki(t,e,i){let s=Ve(t,i);return void 0===s&&(s=e[i]),s}function Zi(t,e,i,s){const o={indexSplices:s};ue&&!t._overrideLegacyUndefined&&(e.splices=o),t.notifyPath(i+".splices",o),t.notifyPath(i+".length",e.length),ue&&!t._overrideLegacyUndefined&&(o.indexSplices=[])}function Qi(t,e,i,s,o,r){Zi(t,e,i,[{index:s,addedCount:o,removed:r,object:e,type:"splice"}])}const Xi=ye((t=>{const e=gi(li(t));return class extends e{constructor(){super(),this.__isPropertyEffectsClient=!0}get PROPERTY_EFFECT_TYPES(){return _i}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(ts.length){let t=ts[ts.length-1];t._enqueueClient(this),this.__dataHost=t}}_initializeProtoProperties(t){this.__data=Object.create(t),this.__dataPending=Object.create(t),this.__dataOld={}}_initializeInstanceProperties(t){let e=this[_i.READ_ONLY];for(let i in t)(!e||!e[i])&&(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=t[i])}_addPropertyEffect(t,e,i){this._createPropertyAccessor(t,e==_i.READ_ONLY);let s=Ci(this,e,!0)[t];s||(s=this[e][t]=[]),s.push(i)}_removePropertyEffect(t,e,i){let s=Ci(this,e,!0)[t],o=s.indexOf(i);o>=0&&s.splice(o,1)}_hasPropertyEffect(t,e){let i=this[e];return!(!i||!i[t])}_hasReadOnlyEffect(t){return this._hasPropertyEffect(t,_i.READ_ONLY)}_hasNotifyEffect(t){return this._hasPropertyEffect(t,_i.NOTIFY)}_hasReflectEffect(t){return this._hasPropertyEffect(t,_i.REFLECT)}_hasComputedEffect(t){return this._hasPropertyEffect(t,_i.COMPUTE)}_setPendingPropertyOrPath(t,e,i,s){if(s||Be(Array.isArray(t)?t[0]:t)!==t){if(!s){let i=Ve(this,t);if(!(t=We(this,t,e))||!super._shouldPropertyChange(t,e,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(t,e,i))return function(t,e,i){let s=t.__dataLinkedPaths;if(s){let o;for(let r in s){let n=s[r];je(r,e)?(o=Le(r,n,e),t._setPendingPropertyOrPath(o,i,!0,!0)):je(n,e)&&(o=Le(n,r,e),t._setPendingPropertyOrPath(o,i,!0,!0))}}}(this,t,e),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[t])return this._setPendingProperty(t,e,i);this[t]=e}return!1}_setUnmanagedPropertyToNode(t,e,i){(i!==t[e]||"object"==typeof i)&&("className"===e&&(t=Ne(t)),t[e]=i)}_setPendingProperty(t,e,i){let s=this.__dataHasPaths&&Me(t);return!!this._shouldPropertyChange(t,e,(s?this.__dataTemp:this.__data)[t])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),t in this.__dataOld||(this.__dataOld[t]=this.__data[t]),s?this.__dataTemp[t]=e:this.__data[t]=e,this.__dataPending[t]=e,(s||this[_i.NOTIFY]&&this[_i.NOTIFY][t])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[t]=i),!0)}_setProperty(t,e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(t){this.__dataPendingClients=this.__dataPendingClients||[],t!==this&&this.__dataPendingClients.push(t)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let t=this.__dataPendingClients;if(t){this.__dataPendingClients=null;for(let e=0;e<t.length;e++){let i=t[e];i.__dataEnabled?i.__dataPending&&i._flushProperties():i._enableProperties()}}}_readyClients(){this.__enableOrFlushClients()}setProperties(t,e){for(let i in t)(e||!this[_i.READ_ONLY]||!this[_i.READ_ONLY][i])&&this._setPendingPropertyOrPath(i,t[i],!0);this._invalidateProperties()}ready(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}_propertiesChanged(t,e,i){let s,o=this.__dataHasPaths;this.__dataHasPaths=!1,function(t,e,i,s){let o=t[_i.COMPUTE];if(o)if(pe){yi++;const r=function(t){let e=t.constructor.__orderedComputedDeps;if(!e){e=new Map;const i=t[_i.COMPUTE];let s,{counts:o,ready:r,total:n}=function(t){const e=t[xi],i={},s=t[_i.COMPUTE],o=[];let r=0;for(let t in e){const s=e[t];r+=i[t]=s.args.filter((t=>!t.literal)).length+(s.dynamicFn?1:0)}for(let t in s)e[t]||o.push(t);return{counts:i,ready:o,total:r}}(t);for(;s=r.shift();){e.set(s,e.size);const t=i[s];t&&t.forEach((t=>{const e=t.info.methodInfo;--n,0==--o[e]&&r.push(e)}))}0!==n&&console.warn(`Computed graph for ${t.localName} incomplete; circular?`),t.constructor.__orderedComputedDeps=e}return e}(t),n=[];for(let t in e)Ni(t,o,n,r,s);let a;for(;a=n.shift();)Mi(t,"",e,0,a)&&Ni(a.methodInfo,o,n,r,s);Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),t.__dataPending=null}else{let r=e;for(;Ai(t,o,r,i,s);)Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),r=t.__dataPending,t.__dataPending=null}}(this,e,i,o),s=this.__dataToNotify,this.__dataToNotify=null,this._propagatePropertyChanges(e,i,o),this._flushClients(),Ai(this,this[_i.REFLECT],e,i,o),Ai(this,this[_i.OBSERVE],e,i,o),s&&function(t,e,i,s,o){let r,n,a=t[_i.NOTIFY],l=yi++;for(let n in e)e[n]&&(a&&Si(t,a,l,n,i,s,o)||o&&Ti(t,n,i))&&(r=!0);r&&(n=t.__dataHost)&&n._invalidateProperties&&n._invalidateProperties()}(this,s,e,i,o),1==this.__dataCounter&&(this.__dataTemp={})}_propagatePropertyChanges(t,e,i){this[_i.PROPAGATE]&&Ai(this,this[_i.PROPAGATE],t,e,i),this.__templateInfo&&this._runEffectsForTemplate(this.__templateInfo,t,e,i)}_runEffectsForTemplate(t,e,i,s){const o=(e,s)=>{Ai(this,t.propertyEffects,e,i,s,t.nodeList);for(let o=t.firstChild;o;o=o.nextSibling)this._runEffectsForTemplate(o,e,i,s)};t.runEffects?t.runEffects(o,e,s):o(e,s)}linkPaths(t,e){t=Re(t),e=Re(e),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[t]=e}unlinkPaths(t){t=Re(t),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[t]}notifySplices(t,e){let i={path:""};Zi(this,Ve(this,t,i),i.path,e)}get(t,e){return Ve(e||this,t)}set(t,e,i){i?We(i,t,e):(!this[_i.READ_ONLY]||!this[_i.READ_ONLY][t])&&this._setPendingPropertyOrPath(t,e,!0)&&this._invalidateProperties()}push(t,...e){let i={path:""},s=Ve(this,t,i),o=s.length,r=s.push(...e);return e.length&&Qi(this,s,i.path,o,e.length,[]),r}pop(t){let e={path:""},i=Ve(this,t,e),s=!!i.length,o=i.pop();return s&&Qi(this,i,e.path,i.length,0,[o]),o}splice(t,e,i,...s){let o,r={path:""},n=Ve(this,t,r);return e<0?e=n.length-Math.floor(-e):e&&(e=Math.floor(e)),o=2===arguments.length?n.splice(e):n.splice(e,i,...s),(s.length||o.length)&&Qi(this,n,r.path,e,s.length,o),o}shift(t){let e={path:""},i=Ve(this,t,e),s=!!i.length,o=i.shift();return s&&Qi(this,i,e.path,0,0,[o]),o}unshift(t,...e){let i={path:""},s=Ve(this,t,i),o=s.unshift(...e);return e.length&&Qi(this,s,i.path,0,e.length,[]),o}notifyPath(t,e){let i;if(1==arguments.length){let s={path:""};e=Ve(this,t,s),i=s.path}else i=Array.isArray(t)?Re(t):t;this._setPendingPropertyOrPath(i,e,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(t,e){this._addPropertyEffect(t,_i.READ_ONLY),e&&(this["_set"+function(t){return t[0].toUpperCase()+t.substring(1)}(t)]=function(e){this._setProperty(t,e)})}_createPropertyObserver(t,e,i){let s={property:t,method:e,dynamicFn:!!i};this._addPropertyEffect(t,_i.OBSERVE,{fn:zi,info:s,trigger:{name:t}}),i&&this._addPropertyEffect(e,_i.OBSERVE,{fn:zi,info:s,trigger:{name:e}})}_createMethodObserver(t,e){let i=Yi(t);if(!i)throw new Error("Malformed observer expression '"+t+"'");$i(this,i,_i.OBSERVE,Vi,null,e)}_createNotifyingProperty(t){this._addPropertyEffect(t,_i.NOTIFY,{fn:Oi,info:{eventName:Ye(t)+"-changed",property:t}})}_createReflectedProperty(t){let e=this.constructor.attributeNameForProperty(t);"-"===e[0]?console.warn("Property "+t+" cannot be reflected to attribute "+e+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(t,_i.REFLECT,{fn:Ei,info:{attrName:e}})}_createComputedProperty(t,e,i){let s=Yi(e);if(!s)throw new Error("Malformed computed expression '"+e+"'");const o=$i(this,s,_i.COMPUTE,Mi,t,i);Ci(this,xi)[t]=o}_marshalArgs(t,e,i){const s=this.__data,o=[];for(let r=0,n=t.length;r<n;r++){let{name:n,structured:a,wildcard:l,value:h,literal:c}=t[r];if(!c)if(l){const t=je(n,e),o=Ki(s,i,t?e:n);h={path:t?e:n,value:o,base:t?Ve(s,n):o}}else h=a?Ki(s,i,n):s[n];if(ue&&!this._overrideLegacyUndefined&&void 0===h&&t.length>1)return wi;o[r]=h}return o}static addPropertyEffect(t,e,i){this.prototype._addPropertyEffect(t,e,i)}static createPropertyObserver(t,e,i){this.prototype._createPropertyObserver(t,e,i)}static createMethodObserver(t,e){this.prototype._createMethodObserver(t,e)}static createNotifyingProperty(t){this.prototype._createNotifyingProperty(t)}static createReadOnlyProperty(t,e){this.prototype._createReadOnlyProperty(t,e)}static createReflectedProperty(t){this.prototype._createReflectedProperty(t)}static createComputedProperty(t,e,i){this.prototype._createComputedProperty(t,e,i)}static bindTemplate(t){return this.prototype._bindTemplate(t)}_bindTemplate(t,e){let i=this.constructor._parseTemplate(t),s=this.__preBoundTemplateInfo==i;if(!s)for(let t in i.propertyEffects)this._createPropertyAccessor(t);if(e)if(i=Object.create(i),i.wasPreBound=s,this.__templateInfo){const e=t._parentTemplateInfo||this.__templateInfo,s=e.lastChild;i.parent=e,e.lastChild=i,i.previousSibling=s,s?s.nextSibling=i:e.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(t,e,i){(t.hostProps=t.hostProps||{})[e]=!0;let s=t.propertyEffects=t.propertyEffects||{};(s[e]=s[e]||[]).push(i)}_stampTemplate(t,e){e=e||this._bindTemplate(t,!0),ts.push(this);let i=super._stampTemplate(t,e);if(ts.pop(),e.nodeList=i.nodeList,!e.wasPreBound){let t=e.childNodes=[];for(let e=i.firstChild;e;e=e.nextSibling)t.push(e)}return i.templateInfo=e,function(t,e){let{nodeList:i,nodeInfoList:s}=e;if(s.length)for(let e=0;e<s.length;e++){let o=i[e],r=s[e].bindings;if(r)for(let e=0;e<r.length;e++){let i=r[e];Li(o,i),Ri(o,t,i)}o.__dataHost=t}}(this,e),this.__dataClientsReady&&(this._runEffectsForTemplate(e,this.__data,null,!1),this._flushClients()),i}_removeBoundDom(t){const e=t.templateInfo,{previousSibling:i,nextSibling:s,parent:o}=e;i?i.nextSibling=s:o&&(o.firstChild=s),s?s.previousSibling=i:o&&(o.lastChild=i),e.nextSibling=e.previousSibling=null;let r=e.childNodes;for(let t=0;t<r.length;t++){let e=r[t];Ne(Ne(e).parentNode).removeChild(e)}}static _parseTemplateNode(t,i,s){let o=e._parseTemplateNode.call(this,t,i,s);if(t.nodeType===Node.TEXT_NODE){let e=this._parseBindings(t.textContent,i);e&&(t.textContent=Gi(e)||" ",Bi(this,i,s,"text","textContent",e),o=!0)}return o}static _parseTemplateNodeAttribute(t,i,s,o,r){let n=this._parseBindings(r,i);if(n){let e=o,r="property";ki.test(o)?r="attribute":"$"==o[o.length-1]&&(o=o.slice(0,-1),r="attribute");let a=Gi(n);return a&&"attribute"==r&&("class"==o&&t.hasAttribute("class")&&(a+=" "+t.getAttribute(o)),t.setAttribute(o,a)),"attribute"==r&&"disable-upgrade$"==e&&t.setAttribute(o,""),"input"===t.localName&&"value"===e&&t.setAttribute(e,""),t.removeAttribute(e),"property"===r&&(o=Ge(o)),Bi(this,i,s,r,o,n,a),!0}return e._parseTemplateNodeAttribute.call(this,t,i,s,o,r)}static _parseTemplateNestedTemplate(t,i,s){let o=e._parseTemplateNestedTemplate.call(this,t,i,s);const r=t.parentNode,n=s.templateInfo,a="dom-if"===r.localName;me&&(a||"dom-repeat"===r.localName)&&(r.removeChild(t),(s=s.parentInfo).templateInfo=n,s.noted=!0,o=!1);let l=n.hostProps;if(ve&&a)l&&(i.hostProps=Object.assign(i.hostProps||{},l),me||(s.parentInfo.noted=!0));else{let t="{";for(let e in l)Bi(this,i,s,"property","_host_"+e,[{mode:t,source:e,dependencies:[e],hostProp:!0}])}return o}static _parseBindings(t,e){let i,s=[],o=0;for(;null!==(i=Hi.exec(t));){i.index>o&&s.push({literal:t.slice(o,i.index)});let r=i[1][0],n=!!i[2],a=i[3].trim(),l=!1,h="",c=-1;"{"==r&&(c=a.indexOf("::"))>0&&(h=a.substring(c+2),a=a.substring(0,c),l=!0);let d=Yi(a),u=[];if(d){let{args:t,methodName:i}=d;for(let e=0;e<t.length;e++){let i=t[e];i.literal||u.push(i)}let s=e.dynamicFns;(s&&s[i]||d.static)&&(u.push(i),d.dynamicFn=!0)}else u.push(a);s.push({source:a,mode:r,negate:n,customEvent:l,signature:d,dependencies:u,event:h}),o=Hi.lastIndex}if(o&&o<t.length){let e=t.substring(o);e&&s.push({literal:e})}return s.length?s:null}static _evaluateBinding(t,e,i,s,o,r){let n;return n=e.signature?Vi(t,i,s,0,e.signature):i!=e.source?Ve(t,e.source):r&&Me(i)?Ve(t,i):t.__data[i],e.negate&&(n=!n),n}}})),ts=[],es=ye((t=>{const e=oi(t);function i(t){const e=Object.getPrototypeOf(t);return e.prototype instanceof o?e:null}function s(t){if(!t.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",t))){let e=null;if(t.hasOwnProperty(JSCompiler_renameProperty("properties",t))){const i=t.properties;i&&(e=
|
|
970
970
|
/**
|
|
971
971
|
@license
|
|
972
972
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1483,7 +1483,7 @@ try {
|
|
|
1483
1483
|
* Code distributed by Google as part of the polymer project is also
|
|
1484
1484
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1485
1485
|
*/
|
|
1486
|
-
let ms=0,vs=0;const fs=[];let bs=!1;const gs={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},ys={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},ws={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},
|
|
1486
|
+
let ms=0,vs=0;const fs=[];let bs=!1;const gs={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},ys={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},ws={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},_s={run(t){bs||(bs=!0,queueMicrotask((()=>function(){bs=!1;const t=fs.length;for(let e=0;e<t;e++){const t=fs[e];if(t)try{t()}catch(t){setTimeout((()=>{throw t}))}}fs.splice(0,t),vs+=t}()))),fs.push(t);const e=ms;return ms+=1,e},cancel(t){const e=t-vs;if(e>=0){if(!fs[e])throw new Error(`invalid async handle: ${t}`);fs[e]=null}}},xs=new Set;
|
|
1487
1487
|
/**
|
|
1488
1488
|
@license
|
|
1489
1489
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1492,7 +1492,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
1492
1492
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1493
1493
|
Code distributed by Google as part of the polymer project is also
|
|
1494
1494
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1495
|
-
*/let ks=class t{static debounce(e,i,s){return e instanceof t?e._cancelAsync():e=new t,e.setConfig(i,s),e}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,
|
|
1495
|
+
*/let ks=class t{static debounce(e,i,s){return e instanceof t?e._cancelAsync():e=new t,e.setConfig(i,s),e}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,xs.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),xs.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}};function Cs(t){xs.add(t)}function As(){const t=!!xs.size;return xs.forEach((t=>{try{t.flush()}catch(t){setTimeout((()=>{throw t}))}})),t}const Ss=()=>{let t;do{t=As()}while(t)},Is=[];
|
|
1496
1496
|
/**
|
|
1497
1497
|
* @license
|
|
1498
1498
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1523,12 +1523,12 @@ class js{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this.
|
|
|
1523
1523
|
* @license
|
|
1524
1524
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1525
1525
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1526
|
-
*/class
|
|
1526
|
+
*/class $s extends EventTarget{static generateId(t,e="default"){return`${e}-${t.localName}-${Rs()}`}constructor(t,e,i,s={}){super();const{initializer:o,multiple:r,observe:n,useUniqueId:a,uniqueIdPrefix:l}=s;this.host=t,this.slotName=e,this.tagName=i,this.observe="boolean"!=typeof n||n,this.multiple="boolean"==typeof r&&r,this.slotInitializer=o,r&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,l||e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach((t=>{this.initAddedNode(t)}))}attachDefaultNode(){const{host:t,slotName:e,tagName:i}=this;let s=this.defaultNode;return!s&&i&&(s=document.createElement(i),s instanceof Element&&(""!==e&&s.setAttribute("slot",e),this.defaultNode=s)),s&&(this.node=s,t.appendChild(s)),s}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter((e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=this.host.shadowRoot.querySelector(""===t?"slot:not([name])":`slot[name=${t}]`);this.__slotObserver=new js(e,(({addedNodes:t,removedNodes:e})=>{const i=this.multiple?this.nodes:[this.node],s=t.filter((t=>{return!((e=t).nodeType===Node.TEXT_NODE&&""===e.textContent.trim()||i.includes(t));var e}));e.length&&(this.nodes=i.filter((t=>!e.includes(t))),e.forEach((t=>{this.teardownNode(t)}))),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...i,...s].filter((t=>t!==this.defaultNode)),s.forEach((t=>{this.initAddedNode(t)}))):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))}))}}
|
|
1527
1527
|
/**
|
|
1528
1528
|
* @license
|
|
1529
1529
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
1530
1530
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1531
|
-
*/class
|
|
1531
|
+
*/class Vs extends $s{constructor(t){super(t,"tooltip"),this.setTarget(t)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.__notifyChange()}teardownNode(){this.__notifyChange()}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__notifyChange(){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:this.node}}))}}
|
|
1532
1532
|
/**
|
|
1533
1533
|
@license
|
|
1534
1534
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1537,12 +1537,12 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
1537
1537
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1538
1538
|
Code distributed by Google as part of the polymer project is also
|
|
1539
1539
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1540
|
-
*/const Ws=!1,qs=t=>t,Us="string"==typeof document.head.style.touchAction,Hs="__polymerGestures",Gs="__polymerGesturesHandled",Ys="__polymerGesturesTouchAction",Js=["mousedown","mousemove","mouseup","click"],Ks=[0,1,4,2],Zs=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(t){return!1}}();function Qs(t){return Js.indexOf(t)>-1}let Xs=!1;function to(t){if(!Qs(t)&&"touchend"!==t&&Us&&Xs&&Ws)return{passive:!0}}!function(){try{const t=Object.defineProperty({},"passive",{get(){Xs=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}}();const eo=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u),io={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function so(t){const e=t.type;if(!Qs(e))return!1;if("mousemove"===e){let e=void 0===t.buttons?1:t.buttons;return t instanceof window.MouseEvent&&!Zs&&(e=Ks[t.which]||0),!!(1&e)}return 0===(void 0===t.button?0:t.button)}const oo={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};function ro(t,e,i){t.movefn=e,t.upfn=i,document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}function no(t){document.removeEventListener("mousemove",t.movefn),document.removeEventListener("mouseup",t.upfn),t.movefn=null,t.upfn=null}const ao=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:t=>t.composedPath&&t.composedPath()||[],lo={},ho=[];function co(t){const e=ao(t);return e.length>0?e[0]:t.target}function uo(t){const e=t.type,i=t.currentTarget[Hs];if(!i)return;const s=i[e];if(!s)return;if(!t[Gs]&&(t[Gs]={},e.startsWith("touch"))){const i=t.changedTouches[0];if("touchstart"===e&&1===t.touches.length&&(oo.touch.id=i.identifier),oo.touch.id!==i.identifier)return;Us||("touchstart"===e||"touchmove"===e)&&function(t){const e=t.changedTouches[0],i=t.type;if("touchstart"===i)oo.touch.x=e.clientX,oo.touch.y=e.clientY,oo.touch.scrollDecided=!1;else if("touchmove"===i){if(oo.touch.scrollDecided)return;oo.touch.scrollDecided=!0;const i=function(t){let e="auto";const i=ao(t);for(let t,s=0;s<i.length;s++)if(t=i[s],t[Ys]){e=t[Ys];break}return e}(t);let s=!1;const o=Math.abs(oo.touch.x-e.clientX),r=Math.abs(oo.touch.y-e.clientY);t.cancelable&&("none"===i?s=!0:"pan-x"===i?s=r>o:"pan-y"===i&&(s=o>r)),s?t.preventDefault():bo("track")}}(t)}const o=t[Gs];if(!o.skip){for(let e,i=0;i<ho.length;i++)e=ho[i],s[e.name]&&!o[e.name]&&e.flow&&e.flow.start.indexOf(t.type)>-1&&e.reset&&e.reset();for(let i,r=0;r<ho.length;r++)i=ho[r],s[i.name]&&!o[i.name]&&(o[i.name]=!0,i[e](t))}}function po(t,e,i){return!!lo[e]&&(function(t,e,i){const s=lo[e],o=s.deps,r=s.name;let n=t[Hs];n||(t[Hs]=n={});for(let e,i,s=0;s<o.length;s++)e=o[s],(!eo||!Qs(e)||"click"===e)&&(i=n[e],i||(n[e]=i={_count:0}),0===i._count&&t.addEventListener(e,uo,to(e)),i[r]=(i[r]||0)+1,i._count=(i._count||0)+1);t.addEventListener(e,i),s.touchAction&&vo(t,s.touchAction)}(t,e,i),!0)}function mo(t){ho.push(t),t.emits.forEach((e=>{lo[e]=t}))}function vo(t,e){Us&&t instanceof HTMLElement&&
|
|
1540
|
+
*/const Ws=!1,qs=t=>t,Us="string"==typeof document.head.style.touchAction,Hs="__polymerGestures",Gs="__polymerGesturesHandled",Ys="__polymerGesturesTouchAction",Js=["mousedown","mousemove","mouseup","click"],Ks=[0,1,4,2],Zs=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(t){return!1}}();function Qs(t){return Js.indexOf(t)>-1}let Xs=!1;function to(t){if(!Qs(t)&&"touchend"!==t&&Us&&Xs&&Ws)return{passive:!0}}!function(){try{const t=Object.defineProperty({},"passive",{get(){Xs=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}}();const eo=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u),io={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function so(t){const e=t.type;if(!Qs(e))return!1;if("mousemove"===e){let e=void 0===t.buttons?1:t.buttons;return t instanceof window.MouseEvent&&!Zs&&(e=Ks[t.which]||0),!!(1&e)}return 0===(void 0===t.button?0:t.button)}const oo={mouse:{target:null,mouseIgnoreJob:null},touch:{x:0,y:0,id:-1,scrollDecided:!1}};function ro(t,e,i){t.movefn=e,t.upfn=i,document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}function no(t){document.removeEventListener("mousemove",t.movefn),document.removeEventListener("mouseup",t.upfn),t.movefn=null,t.upfn=null}const ao=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:t=>t.composedPath&&t.composedPath()||[],lo={},ho=[];function co(t){const e=ao(t);return e.length>0?e[0]:t.target}function uo(t){const e=t.type,i=t.currentTarget[Hs];if(!i)return;const s=i[e];if(!s)return;if(!t[Gs]&&(t[Gs]={},e.startsWith("touch"))){const i=t.changedTouches[0];if("touchstart"===e&&1===t.touches.length&&(oo.touch.id=i.identifier),oo.touch.id!==i.identifier)return;Us||("touchstart"===e||"touchmove"===e)&&function(t){const e=t.changedTouches[0],i=t.type;if("touchstart"===i)oo.touch.x=e.clientX,oo.touch.y=e.clientY,oo.touch.scrollDecided=!1;else if("touchmove"===i){if(oo.touch.scrollDecided)return;oo.touch.scrollDecided=!0;const i=function(t){let e="auto";const i=ao(t);for(let t,s=0;s<i.length;s++)if(t=i[s],t[Ys]){e=t[Ys];break}return e}(t);let s=!1;const o=Math.abs(oo.touch.x-e.clientX),r=Math.abs(oo.touch.y-e.clientY);t.cancelable&&("none"===i?s=!0:"pan-x"===i?s=r>o:"pan-y"===i&&(s=o>r)),s?t.preventDefault():bo("track")}}(t)}const o=t[Gs];if(!o.skip){for(let e,i=0;i<ho.length;i++)e=ho[i],s[e.name]&&!o[e.name]&&e.flow&&e.flow.start.indexOf(t.type)>-1&&e.reset&&e.reset();for(let i,r=0;r<ho.length;r++)i=ho[r],s[i.name]&&!o[i.name]&&(o[i.name]=!0,i[e](t))}}function po(t,e,i){return!!lo[e]&&(function(t,e,i){const s=lo[e],o=s.deps,r=s.name;let n=t[Hs];n||(t[Hs]=n={});for(let e,i,s=0;s<o.length;s++)e=o[s],(!eo||!Qs(e)||"click"===e)&&(i=n[e],i||(n[e]=i={_count:0}),0===i._count&&t.addEventListener(e,uo,to(e)),i[r]=(i[r]||0)+1,i._count=(i._count||0)+1);t.addEventListener(e,i),s.touchAction&&vo(t,s.touchAction)}(t,e,i),!0)}function mo(t){ho.push(t),t.emits.forEach((e=>{lo[e]=t}))}function vo(t,e){Us&&t instanceof HTMLElement&&_s.run((()=>{t.style.touchAction=e})),t[Ys]=e}function fo(t,e,i){const s=new Event(e,{bubbles:!0,cancelable:!0,composed:!0});if(s.detail=i,qs(t).dispatchEvent(s),s.defaultPrevented){const t=i.preventer||i.sourceEvent;t&&t.preventDefault&&t.preventDefault()}}function bo(t){const e=function(t){for(let e,i=0;i<ho.length;i++){e=ho[i];for(let i,s=0;s<e.emits.length;s++)if(i=e.emits[s],i===t)return e}return null}(t);e.info&&(e.info.prevent=!0)}function go(t,e,i,s){e&&fo(e,t,{x:i.clientX,y:i.clientY,sourceEvent:i,preventer:s,prevent:t=>bo(t)})}function yo(t,e,i){if(t.prevent)return!1;if(t.started)return!0;const s=Math.abs(t.x-e),o=Math.abs(t.y-i);return s>=5||o>=5}function wo(t,e,i){if(!e)return;const s=t.moves[t.moves.length-2],o=t.moves[t.moves.length-1];let r,n=0;s&&(r=o.x-s.x,n=o.y-s.y),fo(e,"track",{state:t.state,x:i.clientX,y:i.clientY,dx:o.x-t.x,dy:o.y-t.y,ddx:r,ddy:n,sourceEvent:i,hover:()=>function(t,e){let i=document.elementFromPoint(t,e),s=i;for(;s&&s.shadowRoot&&!window.ShadyDOM;){const o=s;if(s=s.shadowRoot.elementFromPoint(t,e),o===s)break;s&&(i=s)}return i}(i.clientX,i.clientY)})}function _o(t,e,i){const s=Math.abs(e.clientX-t.x),o=Math.abs(e.clientY-t.y),r=co(i||e);!r||io[r.localName]&&r.hasAttribute("disabled")||(isNaN(s)||isNaN(o)||s<=25&&o<=25||function(t){if("click"===t.type){if(0===t.detail)return!0;const e=co(t);if(!e.nodeType||e.nodeType!==Node.ELEMENT_NODE)return!0;const i=e.getBoundingClientRect(),s=t.pageX,o=t.pageY;return!(s>=i.left&&s<=i.right&&o>=i.top&&o<=i.bottom)}return!1}(e))&&(t.prevent||fo(r,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:i}))}
|
|
1541
1541
|
/**
|
|
1542
1542
|
* @license
|
|
1543
1543
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1544
1544
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1545
|
-
*/mo({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset(){no(this.info)},mousedown(t){if(!so(t))return;const e=co(t),i=this;ro(this.info,(t=>{so(t)||(go("up",e,t),no(i.info))}),(t=>{so(t)&&go("up",e,t),no(i.info)})),go("down",e,t)},touchstart(t){go("down",co(t),t.changedTouches[0],t)},touchend(t){go("up",co(t),t.changedTouches[0],t)}}),mo({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove(t){this.moves.length>2&&this.moves.shift(),this.moves.push(t)},movefn:null,upfn:null,prevent:!1},reset(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,no(this.info)},mousedown(t){if(!so(t))return;const e=co(t),i=this,s=t=>{const s=t.clientX,o=t.clientY;yo(i.info,s,o)&&(i.info.state=i.info.started?"mouseup"===t.type?"end":"track":"start","start"===i.info.state&&bo("tap"),i.info.addMove({x:s,y:o}),so(t)||(i.info.state="end",no(i.info)),e&&wo(i.info,e,t),i.info.started=!0)};ro(this.info,s,(t=>{i.info.started&&s(t),no(i.info)})),this.info.x=t.clientX,this.info.y=t.clientY},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchmove(t){const e=co(t),i=t.changedTouches[0],s=i.clientX,o=i.clientY;yo(this.info,s,o)&&("start"===this.info.state&&bo("tap"),this.info.addMove({x:s,y:o}),wo(this.info,e,i),this.info.state="track",this.info.started=!0)},touchend(t){const e=co(t),i=t.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),wo(this.info,e,i))}}),mo({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown(t){so(t)&&(this.info.x=t.clientX,this.info.y=t.clientY)},click(t){so(t)&&
|
|
1545
|
+
*/mo({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset(){no(this.info)},mousedown(t){if(!so(t))return;const e=co(t),i=this;ro(this.info,(t=>{so(t)||(go("up",e,t),no(i.info))}),(t=>{so(t)&&go("up",e,t),no(i.info)})),go("down",e,t)},touchstart(t){go("down",co(t),t.changedTouches[0],t)},touchend(t){go("up",co(t),t.changedTouches[0],t)}}),mo({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove(t){this.moves.length>2&&this.moves.shift(),this.moves.push(t)},movefn:null,upfn:null,prevent:!1},reset(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,no(this.info)},mousedown(t){if(!so(t))return;const e=co(t),i=this,s=t=>{const s=t.clientX,o=t.clientY;yo(i.info,s,o)&&(i.info.state=i.info.started?"mouseup"===t.type?"end":"track":"start","start"===i.info.state&&bo("tap"),i.info.addMove({x:s,y:o}),so(t)||(i.info.state="end",no(i.info)),e&&wo(i.info,e,t),i.info.started=!0)};ro(this.info,s,(t=>{i.info.started&&s(t),no(i.info)})),this.info.x=t.clientX,this.info.y=t.clientY},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchmove(t){const e=co(t),i=t.changedTouches[0],s=i.clientX,o=i.clientY;yo(this.info,s,o)&&("start"===this.info.state&&bo("tap"),this.info.addMove({x:s,y:o}),wo(this.info,e,i),this.info.state="track",this.info.started=!0)},touchend(t){const e=co(t),i=t.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),wo(this.info,e,i))}}),mo({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown(t){so(t)&&(this.info.x=t.clientX,this.info.y=t.clientY)},click(t){so(t)&&_o(this.info,t)},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchend(t){_o(this.info,t.changedTouches[0],t)}});const xo=ye((t=>class extends t{static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0}}}_disabledChanged(t){this._setAriaDisabled(t)}_setAriaDisabled(t){t?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}click(){this.disabled||super.click()}})),ko=ye((t=>class extends t{ready(){super.ready(),this.addEventListener("keydown",(t=>{this._onKeyDown(t)})),this.addEventListener("keyup",(t=>{this._onKeyUp(t)}))}_onKeyDown(t){switch(t.key){case"Enter":this._onEnter(t);break;case"Escape":this._onEscape(t)}}_onKeyUp(t){}_onEnter(t){}_onEscape(t){}})),Co=t=>class extends(xo(ko(t))){get _activeKeys(){return[" "]}ready(){super.ready(),po(this,"down",(t=>{this._shouldSetActive(t)&&this._setActive(!0)})),po(this,"up",(()=>{this._setActive(!1)}))}disconnectedCallback(){super.disconnectedCallback(),this._setActive(!1)}_shouldSetActive(t){return!this.disabled}_onKeyDown(t){super._onKeyDown(t),this._shouldSetActive(t)&&this._activeKeys.includes(t.key)&&(this._setActive(!0),document.addEventListener("keyup",(t=>{this._activeKeys.includes(t.key)&&this._setActive(!1)}),{once:!0}))}_setActive(t){this.toggleAttribute("active",t)}}
|
|
1546
1546
|
/**
|
|
1547
1547
|
* @license
|
|
1548
1548
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1558,23 +1558,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
1558
1558
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1559
1559
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1560
1560
|
*/
|
|
1561
|
-
const Mo=ye((t=>class extends t{get _keyboardActive(){return Io()}ready(){this.addEventListener("focusin",(t=>{this._shouldSetFocus(t)&&this._setFocused(!0)})),this.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}})),Bo=t=>class extends(
|
|
1561
|
+
const Mo=ye((t=>class extends t{get _keyboardActive(){return Io()}ready(){this.addEventListener("focusin",(t=>{this._shouldSetFocus(t)&&this._setFocused(!0)})),this.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}})),Bo=t=>class extends(xo(t)){static get properties(){return{tabindex:{type:Number,reflectToAttribute:!0,observer:"_tabindexChanged"},_lastTabIndex:{type:Number}}}_disabledChanged(t,e){super._disabledChanged(t,e),t?(void 0!==this.tabindex&&(this._lastTabIndex=this.tabindex),this.tabindex=-1):e&&(this.tabindex=this._lastTabIndex)}_tabindexChanged(t){this.disabled&&-1!==t&&(this._lastTabIndex=t,this.tabindex=-1)}}
|
|
1562
1562
|
/**
|
|
1563
1563
|
* @license
|
|
1564
1564
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1565
1565
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1566
|
-
*/,Fo=ye((t=>class extends(Mo(Bo(t))){static get properties(){return{autofocus:{type:Boolean},focusElement:{type:Object,readOnly:!0,observer:"_focusElementChanged"},_lastTabIndex:{value:0}}}constructor(){super(),this._boundOnBlur=this._onBlur.bind(this),this._boundOnFocus=this._onFocus.bind(this)}ready(){super.ready(),this.autofocus&&!this.disabled&&requestAnimationFrame((()=>{this.focus(),this.setAttribute("focus-ring","")}))}focus(){this.focusElement&&!this.disabled&&this.focusElement.focus()}blur(){this.focusElement&&this.focusElement.blur()}click(){this.focusElement&&!this.disabled&&this.focusElement.click()}_focusElementChanged(t,e){t?(t.disabled=this.disabled,this._addFocusListeners(t),this.__forwardTabIndex(this.tabindex)):e&&this._removeFocusListeners(e)}_addFocusListeners(t){t.addEventListener("blur",this._boundOnBlur),t.addEventListener("focus",this._boundOnFocus)}_removeFocusListeners(t){t.removeEventListener("blur",this._boundOnBlur),t.removeEventListener("focus",this._boundOnFocus)}_onFocus(t){t.stopPropagation(),this.dispatchEvent(new Event("focus"))}_onBlur(t){t.stopPropagation(),this.dispatchEvent(new Event("blur"))}_shouldSetFocus(t){return t.target===this.focusElement}_shouldRemoveFocus(t){return t.target===this.focusElement}_disabledChanged(t,e){super._disabledChanged(t,e),this.focusElement&&(this.focusElement.disabled=t),t&&this.blur()}_tabindexChanged(t){this.__forwardTabIndex(t)}__forwardTabIndex(t){void 0!==t&&this.focusElement&&(this.focusElement.tabIndex=t,-1!==t&&(this.tabindex=void 0)),this.disabled&&t&&(-1!==t&&(this._lastTabIndex=t),this.tabindex=void 0)}})),jo=ye((t=>class extends t{static get properties(){return{stateTarget:{type:Object,observer:"_stateTargetChanged"}}}static get delegateAttrs(){return[]}static get delegateProps(){return[]}ready(){super.ready(),this._createDelegateAttrsObserver(),this._createDelegatePropsObserver()}_stateTargetChanged(t){t&&(this._ensureAttrsDelegated(),this._ensurePropsDelegated())}_createDelegateAttrsObserver(){this._createMethodObserver(`_delegateAttrsChanged(${this.constructor.delegateAttrs.join(", ")})`)}_createDelegatePropsObserver(){this._createMethodObserver(`_delegatePropsChanged(${this.constructor.delegateProps.join(", ")})`)}_ensureAttrsDelegated(){this.constructor.delegateAttrs.forEach((t=>{this._delegateAttribute(t,this[t])}))}_ensurePropsDelegated(){this.constructor.delegateProps.forEach((t=>{this._delegateProperty(t,this[t])}))}_delegateAttrsChanged(...t){this.constructor.delegateAttrs.forEach(((e,i)=>{this._delegateAttribute(e,t[i])}))}_delegatePropsChanged(...t){this.constructor.delegateProps.forEach(((e,i)=>{this._delegateProperty(e,t[i])}))}_delegateAttribute(t,e){this.stateTarget&&("invalid"===t&&this._delegateAttribute("aria-invalid",!!e&&"true"),"boolean"==typeof e?this.stateTarget.toggleAttribute(t,e):e?this.stateTarget.setAttribute(t,e):this.stateTarget.removeAttribute(t))}_delegateProperty(t,e){this.stateTarget&&(this.stateTarget[t]=e)}})),Lo=ye((t=>class extends t{static get properties(){return{inputElement:{type:Object,readOnly:!0,observer:"_inputElementChanged"},type:{type:String,readOnly:!0},value:{type:String,value:"",observer:"_valueChanged",notify:!0,sync:!0},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"}}}constructor(){super(),this._boundOnInput=this.__onInput.bind(this),this._boundOnChange=this._onChange.bind(this)}get _hasValue(){return null!=this.value&&""!==this.value}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this.inputElement?this.inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(t){this.inputElement&&(this.inputElement[this._inputElementValueProperty]=t)}clear(){this._hasInputValue=!1,this.value="",this._inputElementValue=""}_addInputListeners(t){t.addEventListener("input",this._boundOnInput),t.addEventListener("change",this._boundOnChange)}_removeInputListeners(t){t.removeEventListener("input",this._boundOnInput),t.removeEventListener("change",this._boundOnChange)}_forwardInputValue(t){this.inputElement&&(this._inputElementValue=null!=t?t:"")}_inputElementChanged(t,e){t?this._addInputListeners(t):e&&this._removeInputListeners(e)}_hasInputValueChanged(t,e){(t||e)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}__onInput(t){this._setHasInputValue(t),this._onInput(t)}_onInput(t){const e=t.composedPath()[0];this.__userInput=t.isTrusted,this.value=e.value,this.__userInput=!1}_onChange(t){}_toggleHasValue(t){this.toggleAttribute("has-value",t)}_valueChanged(t,e){this._toggleHasValue(this._hasValue),(""!==t||void 0!==e)&&(this.__userInput||this._forwardInputValue(t))}_setHasInputValue(t){const e=t.composedPath()[0];this._hasInputValue=e.value.length>0}})),Ro=ye((t=>class extends(jo(
|
|
1566
|
+
*/,Fo=ye((t=>class extends(Mo(Bo(t))){static get properties(){return{autofocus:{type:Boolean},focusElement:{type:Object,readOnly:!0,observer:"_focusElementChanged"},_lastTabIndex:{value:0}}}constructor(){super(),this._boundOnBlur=this._onBlur.bind(this),this._boundOnFocus=this._onFocus.bind(this)}ready(){super.ready(),this.autofocus&&!this.disabled&&requestAnimationFrame((()=>{this.focus(),this.setAttribute("focus-ring","")}))}focus(){this.focusElement&&!this.disabled&&this.focusElement.focus()}blur(){this.focusElement&&this.focusElement.blur()}click(){this.focusElement&&!this.disabled&&this.focusElement.click()}_focusElementChanged(t,e){t?(t.disabled=this.disabled,this._addFocusListeners(t),this.__forwardTabIndex(this.tabindex)):e&&this._removeFocusListeners(e)}_addFocusListeners(t){t.addEventListener("blur",this._boundOnBlur),t.addEventListener("focus",this._boundOnFocus)}_removeFocusListeners(t){t.removeEventListener("blur",this._boundOnBlur),t.removeEventListener("focus",this._boundOnFocus)}_onFocus(t){t.stopPropagation(),this.dispatchEvent(new Event("focus"))}_onBlur(t){t.stopPropagation(),this.dispatchEvent(new Event("blur"))}_shouldSetFocus(t){return t.target===this.focusElement}_shouldRemoveFocus(t){return t.target===this.focusElement}_disabledChanged(t,e){super._disabledChanged(t,e),this.focusElement&&(this.focusElement.disabled=t),t&&this.blur()}_tabindexChanged(t){this.__forwardTabIndex(t)}__forwardTabIndex(t){void 0!==t&&this.focusElement&&(this.focusElement.tabIndex=t,-1!==t&&(this.tabindex=void 0)),this.disabled&&t&&(-1!==t&&(this._lastTabIndex=t),this.tabindex=void 0)}})),jo=ye((t=>class extends t{static get properties(){return{stateTarget:{type:Object,observer:"_stateTargetChanged"}}}static get delegateAttrs(){return[]}static get delegateProps(){return[]}ready(){super.ready(),this._createDelegateAttrsObserver(),this._createDelegatePropsObserver()}_stateTargetChanged(t){t&&(this._ensureAttrsDelegated(),this._ensurePropsDelegated())}_createDelegateAttrsObserver(){this._createMethodObserver(`_delegateAttrsChanged(${this.constructor.delegateAttrs.join(", ")})`)}_createDelegatePropsObserver(){this._createMethodObserver(`_delegatePropsChanged(${this.constructor.delegateProps.join(", ")})`)}_ensureAttrsDelegated(){this.constructor.delegateAttrs.forEach((t=>{this._delegateAttribute(t,this[t])}))}_ensurePropsDelegated(){this.constructor.delegateProps.forEach((t=>{this._delegateProperty(t,this[t])}))}_delegateAttrsChanged(...t){this.constructor.delegateAttrs.forEach(((e,i)=>{this._delegateAttribute(e,t[i])}))}_delegatePropsChanged(...t){this.constructor.delegateProps.forEach(((e,i)=>{this._delegateProperty(e,t[i])}))}_delegateAttribute(t,e){this.stateTarget&&("invalid"===t&&this._delegateAttribute("aria-invalid",!!e&&"true"),"boolean"==typeof e?this.stateTarget.toggleAttribute(t,e):e?this.stateTarget.setAttribute(t,e):this.stateTarget.removeAttribute(t))}_delegateProperty(t,e){this.stateTarget&&(this.stateTarget[t]=e)}})),Lo=ye((t=>class extends t{static get properties(){return{inputElement:{type:Object,readOnly:!0,observer:"_inputElementChanged"},type:{type:String,readOnly:!0},value:{type:String,value:"",observer:"_valueChanged",notify:!0,sync:!0},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"}}}constructor(){super(),this._boundOnInput=this.__onInput.bind(this),this._boundOnChange=this._onChange.bind(this)}get _hasValue(){return null!=this.value&&""!==this.value}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this.inputElement?this.inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(t){this.inputElement&&(this.inputElement[this._inputElementValueProperty]=t)}clear(){this._hasInputValue=!1,this.value="",this._inputElementValue=""}_addInputListeners(t){t.addEventListener("input",this._boundOnInput),t.addEventListener("change",this._boundOnChange)}_removeInputListeners(t){t.removeEventListener("input",this._boundOnInput),t.removeEventListener("change",this._boundOnChange)}_forwardInputValue(t){this.inputElement&&(this._inputElementValue=null!=t?t:"")}_inputElementChanged(t,e){t?this._addInputListeners(t):e&&this._removeInputListeners(e)}_hasInputValueChanged(t,e){(t||e)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}__onInput(t){this._setHasInputValue(t),this._onInput(t)}_onInput(t){const e=t.composedPath()[0];this.__userInput=t.isTrusted,this.value=e.value,this.__userInput=!1}_onChange(t){}_toggleHasValue(t){this.toggleAttribute("has-value",t)}_valueChanged(t,e){this._toggleHasValue(this._hasValue),(""!==t||void 0!==e)&&(this.__userInput||this._forwardInputValue(t))}_setHasInputValue(t){const e=t.composedPath()[0];this._hasInputValue=e.value.length>0}})),Ro=ye((t=>class extends(jo(xo(Lo(t)))){static get properties(){return{checked:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0}}}static get delegateProps(){return[...super.delegateProps,"checked"]}_onChange(t){this._toggleChecked(t.target.checked)}_toggleChecked(t){this.checked=t}})),$o=new Map;
|
|
1567
1567
|
/**
|
|
1568
1568
|
* @license
|
|
1569
1569
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1570
1570
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1571
|
-
*/function
|
|
1571
|
+
*/function Vo(t){return $o.has(t)||$o.set(t,new WeakMap),$o.get(t)}function Wo(t,e){t&&t.removeAttribute(e)}function qo(t,e){if(!t||!e)return;const i=Vo(e);if(i.has(t))return;const s=Ms(t.getAttribute(e));i.set(t,new Set(s))}function Uo(t,e,i={newId:null,oldId:null,fromUser:!1}){if(!t||!e)return;const{newId:s,oldId:o,fromUser:r}=i,n=Vo(e),a=n.get(t);if(!r&&a)return o&&a.delete(o),void(s&&a.add(s));r&&(a?s||n.delete(t):qo(t,e),Wo(t,e)),function(t,e,i){const s=Ms(t.getAttribute(e));s.delete(i),0!==s.size?t.setAttribute(e,Bs(s)):t.removeAttribute(e)}(t,e,o);const l=s||Bs(a);l&&Fs(t,e,l)}
|
|
1572
1572
|
/**
|
|
1573
1573
|
* @license
|
|
1574
1574
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1575
1575
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1576
1576
|
*/
|
|
1577
|
-
class Ho{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__target=t,this.__setAriaRequiredAttribute(this.__required),this.__setLabelIdToAriaAttribute(this.__labelId,this.__labelId),null!=this.__labelIdFromUser&&this.__setLabelIdToAriaAttribute(this.__labelIdFromUser,this.__labelIdFromUser,!0),this.__setErrorIdToAriaAttribute(this.__errorId),this.__setHelperIdToAriaAttribute(this.__helperId),this.setAriaLabel(this.__label)}setRequired(t){this.__setAriaRequiredAttribute(t),this.__required=t}setAriaLabel(t){this.__setAriaLabelToAttribute(t),this.__label=t}setLabelId(t,e=!1){this.__setLabelIdToAriaAttribute(t,e?this.__labelIdFromUser:this.__labelId,e),e?this.__labelIdFromUser=t:this.__labelId=t}setErrorId(t){this.__setErrorIdToAriaAttribute(t,this.__errorId),this.__errorId=t}setHelperId(t){this.__setHelperIdToAriaAttribute(t,this.__helperId),this.__helperId=t}__setAriaLabelToAttribute(t){this.__target&&(t?(function(t,e){qo(t,e),Wo(t,e)}(this.__target,"aria-labelledby"),this.__target.setAttribute("aria-label",t)):this.__label&&(function(t,e){if(!t)return;const i
|
|
1577
|
+
class Ho{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__target=t,this.__setAriaRequiredAttribute(this.__required),this.__setLabelIdToAriaAttribute(this.__labelId,this.__labelId),null!=this.__labelIdFromUser&&this.__setLabelIdToAriaAttribute(this.__labelIdFromUser,this.__labelIdFromUser,!0),this.__setErrorIdToAriaAttribute(this.__errorId),this.__setHelperIdToAriaAttribute(this.__helperId),this.setAriaLabel(this.__label)}setRequired(t){this.__setAriaRequiredAttribute(t),this.__required=t}setAriaLabel(t){this.__setAriaLabelToAttribute(t),this.__label=t}setLabelId(t,e=!1){this.__setLabelIdToAriaAttribute(t,e?this.__labelIdFromUser:this.__labelId,e),e?this.__labelIdFromUser=t:this.__labelId=t}setErrorId(t){this.__setErrorIdToAriaAttribute(t,this.__errorId),this.__errorId=t}setHelperId(t){this.__setHelperIdToAriaAttribute(t,this.__helperId),this.__helperId=t}__setAriaLabelToAttribute(t){this.__target&&(t?(function(t,e){qo(t,e),Wo(t,e)}(this.__target,"aria-labelledby"),this.__target.setAttribute("aria-label",t)):this.__label&&(function(t,e){if(!t)return;const i=Vo(e),s=i.get(t);s&&0!==s.size?Fs(t,e,Bs(s)):t.removeAttribute(e),i.delete(t)}(this.__target,"aria-labelledby"),this.__target.removeAttribute("aria-label")))}__setLabelIdToAriaAttribute(t,e,i){Uo(this.__target,"aria-labelledby",{newId:t,oldId:e,fromUser:i})}__setErrorIdToAriaAttribute(t,e){Uo(this.__target,"aria-describedby",{newId:t,oldId:e,fromUser:!1})}__setHelperIdToAriaAttribute(t,e){Uo(this.__target,"aria-describedby",{newId:t,oldId:e,fromUser:!1})}__setAriaRequiredAttribute(t){this.__target&&(["input","textarea"].includes(this.__target.localName)||(t?this.__target.setAttribute("aria-required","true"):this.__target.removeAttribute("aria-required")))}}
|
|
1578
1578
|
/**
|
|
1579
1579
|
* @license
|
|
1580
1580
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1589,7 +1589,7 @@ class Ho{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__targe
|
|
|
1589
1589
|
* @license
|
|
1590
1590
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
1591
1591
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1592
|
-
*/Yo.style.position="fixed",Yo.style.clip="rect(0px, 0px, 0px, 0px)",Yo.setAttribute("aria-live","polite"),document.body.appendChild(Yo);class Zo extends
|
|
1592
|
+
*/Yo.style.position="fixed",Yo.style.clip="rect(0px, 0px, 0px, 0px)",Yo.setAttribute("aria-live","polite"),document.body.appendChild(Yo);class Zo extends $s{constructor(t,e,i,s={}){super(t,e,i,y(g({},s),{useUniqueId:!0}))}initCustomNode(t){this.__updateNodeId(t),this.__notifyChange(t)}teardownNode(t){const e=this.getSlotChild();e&&e!==this.defaultNode?this.__notifyChange(e):(this.restoreDefaultNode(),this.updateDefaultNode(this.node))}attachDefaultNode(){const t=super.attachDefaultNode();return t&&this.__updateNodeId(t),t}restoreDefaultNode(){}updateDefaultNode(t){this.__notifyChange(t)}observeNode(t){this.__nodeObserver&&this.__nodeObserver.disconnect(),this.__nodeObserver=new MutationObserver((t=>{t.forEach((t=>{const e=t.target,i=e===this.node;"attributes"===t.type?i&&this.__updateNodeId(e):(i||e.parentElement===this.node)&&this.__notifyChange(this.node)}))})),this.__nodeObserver.observe(t,{attributes:!0,attributeFilter:["id"],childList:!0,subtree:!0,characterData:!0})}__hasContent(t){return!!t&&(t.nodeType===Node.ELEMENT_NODE&&(customElements.get(t.localName)||t.children.length>0)||t.textContent&&""!==t.textContent.trim())}__notifyChange(t){this.dispatchEvent(new CustomEvent("slot-content-changed",{detail:{hasContent:this.__hasContent(t),node:t}}))}__updateNodeId(t){t.nodeType===Node.ELEMENT_NODE&&(!this.multiple||!this.nodes||t===this.nodes[0])&&!t.id&&(t.id=this.defaultId)}}
|
|
1593
1593
|
/**
|
|
1594
1594
|
* @license
|
|
1595
1595
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1619,7 +1619,7 @@ class Ho{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__targe
|
|
|
1619
1619
|
* @license
|
|
1620
1620
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1621
1621
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1622
|
-
*/class or extends
|
|
1622
|
+
*/class or extends $s{constructor(t,e,i={}){const{uniqueIdPrefix:s}=i;super(t,"input","input",{initializer:(t,i)=>{i.value&&(t.value=i.value),i.type&&t.setAttribute("type",i.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0,uniqueIdPrefix:s})}}
|
|
1623
1623
|
/**
|
|
1624
1624
|
* @license
|
|
1625
1625
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1640,7 +1640,7 @@ class Ho{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__targe
|
|
|
1640
1640
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1641
1641
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1642
1642
|
*/
|
|
1643
|
-
|
|
1643
|
+
Vt("vaadin-checkbox",T`
|
|
1644
1644
|
:host {
|
|
1645
1645
|
display: inline-block;
|
|
1646
1646
|
}
|
|
@@ -1744,7 +1744,7 @@ $t("vaadin-checkbox",T`
|
|
|
1744
1744
|
</div>
|
|
1745
1745
|
</div>
|
|
1746
1746
|
<slot name="tooltip"></slot>
|
|
1747
|
-
`}ready(){super.ready(),this._tooltipController=new
|
|
1747
|
+
`}ready(){super.ready(),this._tooltipController=new Vs(this),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}x(ar);
|
|
1748
1748
|
/**
|
|
1749
1749
|
* @license
|
|
1750
1750
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -1923,7 +1923,7 @@ const lr=T`
|
|
|
1923
1923
|
margin-left: 0;
|
|
1924
1924
|
margin-right: calc(var(--lumo-border-radius-m) / 4);
|
|
1925
1925
|
}
|
|
1926
|
-
|
|
1926
|
+
`;Vt("",hr,{moduleId:"lumo-required-field"}),Vt("vaadin-checkbox-group",[hr,lr,T`
|
|
1927
1927
|
:host {
|
|
1928
1928
|
color: var(--lumo-body-text-color);
|
|
1929
1929
|
font-size: var(--lumo-font-size-m);
|
|
@@ -1972,7 +1972,7 @@ const lr=T`
|
|
|
1972
1972
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
1973
1973
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1974
1974
|
*/
|
|
1975
|
-
const cr=t=>class extends(sr(Mo(
|
|
1975
|
+
const cr=t=>class extends(sr(Mo(xo(t)))){static get properties(){return{value:{type:Array,value:()=>[],notify:!0,sync:!0,observer:"__valueChanged"},readonly:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"__readonlyChanged"}}}constructor(){super(),this.__registerCheckbox=this.__registerCheckbox.bind(this),this.__unregisterCheckbox=this.__unregisterCheckbox.bind(this),this.__onCheckboxCheckedChanged=this.__onCheckboxCheckedChanged.bind(this),this._tooltipController=new Vs(this),this._tooltipController.addEventListener("tooltip-changed",(t=>{const e=t.detail.node;if(e&&e.isConnected){const t=this.__checkboxes.map((t=>t.inputElement));this._tooltipController.setAriaTarget(t)}else this._tooltipController.setAriaTarget([])}))}get __checkboxes(){return this.__filterCheckboxes([...this.children])}ready(){super.ready(),this.ariaTarget=this,this.setAttribute("role","group");const t=this.shadowRoot.querySelector("slot:not([name])");this._observer=new js(t,(({addedNodes:t,removedNodes:e})=>{const i=this.__filterCheckboxes(t),s=this.__filterCheckboxes(e);i.forEach(this.__registerCheckbox),s.forEach(this.__unregisterCheckbox);const o=this.__checkboxes.map((t=>t.inputElement));this._tooltipController.setAriaTarget(o),this.__warnOfCheckboxesWithoutValue(i)})),this.addController(this._tooltipController)}checkValidity(){return!this.required||!!(this.value&&this.value.length>0)}__filterCheckboxes(t){return t.filter((t=>t.nodeType===Node.ELEMENT_NODE&&"vaadin-checkbox"===t.localName))}__warnOfCheckboxesWithoutValue(t){t.some((t=>{const{value:e}=t;return!(t.hasAttribute("value")||e&&"on"!==e)}))&&console.warn("Please provide the value attribute to all the checkboxes inside the checkbox group.")}__registerCheckbox(t){t.addEventListener("checked-changed",this.__onCheckboxCheckedChanged),this.disabled&&(t.disabled=!0),this.readonly&&(t.readonly=!0),t.checked?this.__addCheckboxToValue(t.value):this.value&&this.value.includes(t.value)&&(t.checked=!0)}__unregisterCheckbox(t){t.removeEventListener("checked-changed",this.__onCheckboxCheckedChanged),t.checked&&this.__removeCheckboxFromValue(t.value)}_disabledChanged(t,e){super._disabledChanged(t,e),(t||void 0!==e)&&e!==t&&this.__checkboxes.forEach((e=>{e.disabled=t}))}__addCheckboxToValue(t){this.value?this.value.includes(t)||(this.value=[...this.value,t]):this.value=[t]}__removeCheckboxFromValue(t){this.value&&this.value.includes(t)&&(this.value=this.value.filter((e=>e!==t)))}__onCheckboxCheckedChanged(t){const e=t.target;e.checked?this.__addCheckboxToValue(e.value):this.__removeCheckboxFromValue(e.value)}__valueChanged(t,e){t&&0===t.length&&void 0===e||(this.toggleAttribute("has-value",t&&t.length>0),this.__checkboxes.forEach((e=>{e.checked=t&&t.includes(e.value)})),void 0!==e&&this.validate())}__readonlyChanged(t,e){(t||e)&&this.__checkboxes.forEach((e=>{e.readonly=t}))}_shouldRemoveFocus(t){return!this.contains(t.relatedTarget)}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}}
|
|
1976
1976
|
/**
|
|
1977
1977
|
* @license
|
|
1978
1978
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
@@ -1983,7 +1983,7 @@ const cr=t=>class extends(sr(Mo(_o(t)))){static get properties(){return{value:{t
|
|
|
1983
1983
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
1984
1984
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1985
1985
|
*/
|
|
1986
|
-
|
|
1986
|
+
Vt("vaadin-checkbox-group",T`
|
|
1987
1987
|
:host {
|
|
1988
1988
|
display: inline-flex;
|
|
1989
1989
|
}
|
|
@@ -2033,7 +2033,7 @@ $t("vaadin-checkbox-group",T`
|
|
|
2033
2033
|
</div>
|
|
2034
2034
|
|
|
2035
2035
|
<slot name="tooltip"></slot>
|
|
2036
|
-
`}}
|
|
2036
|
+
`}}x(dr);
|
|
2037
2037
|
/**
|
|
2038
2038
|
* @license
|
|
2039
2039
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -2104,7 +2104,7 @@ const ur=T`
|
|
|
2104
2104
|
opacity: 1;
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
|
-
|
|
2107
|
+
`;Vt("",ur,{moduleId:"lumo-overlay"});
|
|
2108
2108
|
/**
|
|
2109
2109
|
* @license
|
|
2110
2110
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -2140,7 +2140,7 @@ const pr=T`
|
|
|
2140
2140
|
opacity: 0;
|
|
2141
2141
|
}
|
|
2142
2142
|
}
|
|
2143
|
-
|
|
2143
|
+
`;Vt("",pr,{moduleId:"lumo-menu-overlay-core"});const mr=[ur,pr,T`
|
|
2144
2144
|
/* Small viewport (bottom sheet) styles */
|
|
2145
2145
|
/* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
|
|
2146
2146
|
@media (max-width: 450px), (max-height: 450px) {
|
|
@@ -2202,7 +2202,7 @@ const pr=T`
|
|
|
2202
2202
|
transform: translateY(150%);
|
|
2203
2203
|
}
|
|
2204
2204
|
}
|
|
2205
|
-
`]
|
|
2205
|
+
`];Vt("",mr,{moduleId:"lumo-menu-overlay"}),Vt("vaadin-date-picker-overlay",[mr,T`
|
|
2206
2206
|
[part='overlay'] {
|
|
2207
2207
|
/*
|
|
2208
2208
|
Width:
|
|
@@ -2523,7 +2523,7 @@ const pr=T`
|
|
|
2523
2523
|
margin-left: 0;
|
|
2524
2524
|
margin-right: 0;
|
|
2525
2525
|
}
|
|
2526
|
-
|
|
2526
|
+
`;Vt("vaadin-button",vr,{moduleId:"lumo-button"}),Vt("vaadin-date-picker-year",T`
|
|
2527
2527
|
:host([current]) [part='year-number'] {
|
|
2528
2528
|
color: var(--lumo-primary-text-color);
|
|
2529
2529
|
}
|
|
@@ -2547,7 +2547,7 @@ const pr=T`
|
|
|
2547
2547
|
color: var(--lumo-disabled-text-color);
|
|
2548
2548
|
content: '\\2022';
|
|
2549
2549
|
}
|
|
2550
|
-
`,{moduleId:"lumo-date-picker-year"})
|
|
2550
|
+
`,{moduleId:"lumo-date-picker-year"}),Vt("vaadin-date-picker-overlay-content",T`
|
|
2551
2551
|
:host {
|
|
2552
2552
|
position: relative;
|
|
2553
2553
|
/* Background for the year scroller, placed here as we are using a mask image on the actual years part */
|
|
@@ -2697,7 +2697,7 @@ const pr=T`
|
|
|
2697
2697
|
padding-left: 50px;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
`,{moduleId:"lumo-date-picker-overlay-content"})
|
|
2700
|
+
`,{moduleId:"lumo-date-picker-overlay-content"}),Vt("vaadin-month-calendar",T`
|
|
2701
2701
|
:host {
|
|
2702
2702
|
-moz-user-select: none;
|
|
2703
2703
|
-webkit-user-select: none;
|
|
@@ -2844,7 +2844,7 @@ const pr=T`
|
|
|
2844
2844
|
:host([disabled]) * {
|
|
2845
2845
|
color: var(--lumo-disabled-text-color) !important;
|
|
2846
2846
|
}
|
|
2847
|
-
`,{moduleId:"lumo-month-calendar"})
|
|
2847
|
+
`,{moduleId:"lumo-month-calendar"}),Vt("vaadin-input-container",T`
|
|
2848
2848
|
:host {
|
|
2849
2849
|
background: var(--_background);
|
|
2850
2850
|
padding: 0 calc(0.375em + var(--_input-container-radius) / 4 - 1px);
|
|
@@ -3055,7 +3055,7 @@ const fr=T`
|
|
|
3055
3055
|
font-family: 'lumo-icons';
|
|
3056
3056
|
display: block;
|
|
3057
3057
|
}
|
|
3058
|
-
|
|
3058
|
+
`;Vt("",fr,{moduleId:"lumo-field-button"});
|
|
3059
3059
|
/**
|
|
3060
3060
|
* @license
|
|
3061
3061
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -3192,7 +3192,7 @@ const br=[hr,fr,lr,T`
|
|
|
3192
3192
|
[part='clear-button']::before {
|
|
3193
3193
|
content: var(--lumo-icons-cross);
|
|
3194
3194
|
}
|
|
3195
|
-
`]
|
|
3195
|
+
`];Vt("",br,{moduleId:"lumo-input-field-shared-styles"}),Vt("vaadin-date-picker",[br,T`
|
|
3196
3196
|
[part='toggle-button']::before {
|
|
3197
3197
|
content: var(--lumo-icons-calendar);
|
|
3198
3198
|
}
|
|
@@ -3231,7 +3231,7 @@ const gr=t=>class extends t{static get properties(){return{disabled:{type:Boolea
|
|
|
3231
3231
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3232
3232
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3233
3233
|
*/
|
|
3234
|
-
|
|
3234
|
+
Vt("vaadin-input-container",T`
|
|
3235
3235
|
:host {
|
|
3236
3236
|
display: flex;
|
|
3237
3237
|
align-items: center;
|
|
@@ -3300,7 +3300,7 @@ $t("vaadin-input-container",T`
|
|
|
3300
3300
|
<slot name="prefix"></slot>
|
|
3301
3301
|
<slot></slot>
|
|
3302
3302
|
<slot name="suffix"></slot>
|
|
3303
|
-
`}}
|
|
3303
|
+
`}}x(yr);
|
|
3304
3304
|
/**
|
|
3305
3305
|
* @license
|
|
3306
3306
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -3374,7 +3374,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
3374
3374
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
3375
3375
|
Code distributed by Google as part of the polymer project is also
|
|
3376
3376
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3377
|
-
*/;let
|
|
3377
|
+
*/;let _r=!1,xr=[],kr=[];function Cr(t){const e=t[0],i=t[1],s=t[2];try{i.apply(e,s)}catch(t){setTimeout((()=>{throw t}))}}function Ar(t,e,i){_r||(_r=!0,requestAnimationFrame((function(){_r=!1,function(t){for(;t.length;)Cr(t.shift())}(xr),setTimeout((function(){!function(t){for(let e=0,i=t.length;e<i;e++)Cr(t.shift())}(kr)}))}))),kr.push([t,e,i])
|
|
3378
3378
|
/**
|
|
3379
3379
|
* @license
|
|
3380
3380
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -3399,12 +3399,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
3399
3399
|
* @license
|
|
3400
3400
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3401
3401
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3402
|
-
*/const
|
|
3402
|
+
*/const $r=[];class Vr{constructor(t){this.host=t,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){return function(t){const e=[];return No(t,e)?Do(e):e}(this.__trapNode)}get __focusedElementIndex(){const t=this.__focusableElements;return t.indexOf(t.filter(Po).pop())}hostConnected(){document.addEventListener("keydown",this.__onKeyDown)}hostDisconnected(){document.removeEventListener("keydown",this.__onKeyDown)}trapFocus(t){if(this.__trapNode=t,0===this.__focusableElements.length)throw this.__trapNode=null,new Error("The trap node should have at least one focusable descendant or be focusable itself.");$r.push(this),-1===this.__focusedElementIndex&&this.__focusableElements[0].focus()}releaseFocus(){this.__trapNode=null,$r.pop()}__onKeyDown(t){this.__trapNode&&this===Array.from($r).pop()&&"Tab"===t.key&&(t.preventDefault(),this.__focusNextElement(t.shiftKey))}__focusNextElement(t=!1){const e=this.__focusableElements,i=e[(e.length+this.__focusedElementIndex+(t?-1:1))%e.length];i.focus(),"input"===i.localName&&i.select()}}
|
|
3403
3403
|
/**
|
|
3404
3404
|
* @license
|
|
3405
3405
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3406
3406
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3407
|
-
*/const Wr=t=>class extends(Go(t)){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new Lr(this),this.__focusTrapController=new
|
|
3407
|
+
*/const Wr=t=>class extends(Go(t)){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new Lr(this),this.__focusTrapController=new Vr(this),this.__focusRestorationController=new Rr}ready(){super.ready(),this.addController(this.__ariaModalController),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}_resetFocus(){if(this.focusTrap&&(this.__ariaModalController.close(),this.__focusTrapController.releaseFocus()),this.restoreFocusOnClose&&this._shouldRestoreFocus()){const t=!Io();this.__focusRestorationController.restoreFocus({preventScroll:t})}}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&(this.__ariaModalController.showModal(),this.__focusTrapController.trapFocus(this.$.overlay))}_shouldRestoreFocus(){const t=So();return t===document.body||this._deepContains(t)}_deepContains(t){if(this.contains(t))return!0;let e=t;const i=t.ownerDocument;for(;e&&e!==i&&e!==this;)e=e.parentNode||e.host;return e===this}}
|
|
3408
3408
|
/**
|
|
3409
3409
|
* @license
|
|
3410
3410
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -3440,7 +3440,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
3440
3440
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3441
3441
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3442
3442
|
*/
|
|
3443
|
-
|
|
3443
|
+
Vt("vaadin-date-picker-overlay",[wr,T`
|
|
3444
3444
|
[part='overlay'] {
|
|
3445
3445
|
display: flex;
|
|
3446
3446
|
flex: auto;
|
|
@@ -3462,7 +3462,7 @@ $t("vaadin-date-picker-overlay",[wr,T`
|
|
|
3462
3462
|
<slot></slot>
|
|
3463
3463
|
</div>
|
|
3464
3464
|
</div>
|
|
3465
|
-
`}}
|
|
3465
|
+
`}}x(Xr);
|
|
3466
3466
|
/**
|
|
3467
3467
|
* @license
|
|
3468
3468
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -3538,7 +3538,7 @@ const tn=T`
|
|
|
3538
3538
|
* @license
|
|
3539
3539
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3540
3540
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3541
|
-
|
|
3541
|
+
*/Vt("vaadin-button",tn,{moduleId:"vaadin-button-styles"});class sn extends(en(Ps(Gt(Go(hs))))){static get is(){return"vaadin-button"}static get template(){return as`
|
|
3542
3542
|
<div class="vaadin-button-container">
|
|
3543
3543
|
<span part="prefix" aria-hidden="true">
|
|
3544
3544
|
<slot name="prefix"></slot>
|
|
@@ -3551,7 +3551,7 @@ const tn=T`
|
|
|
3551
3551
|
</span>
|
|
3552
3552
|
</div>
|
|
3553
3553
|
<slot name="tooltip"></slot>
|
|
3554
|
-
`}ready(){super.ready(),this._tooltipController=new
|
|
3554
|
+
`}ready(){super.ready(),this._tooltipController=new Vs(this),this.addController(this._tooltipController)}}function on(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function rn(t,e,i=on){return t instanceof Date&&e instanceof Date&&i(t).getTime()===i(e).getTime()}function nn(t){return{day:t.getDate(),month:t.getMonth(),year:t.getFullYear()}}function an(t,e,i,s){let o=!1;return"function"==typeof s&&t&&(o=s(nn(t))),(!e||t>=e)&&(!i||t<=i)&&!o}function ln(t,e){return e.filter((t=>void 0!==t)).reduce(((e,i)=>i?e?Math.abs(t.getTime()-i.getTime())<Math.abs(e.getTime()-t.getTime())?i:e:i:e))}function hn(t){const e=new Date,i=new Date(e);return i.setDate(1),i.setMonth(parseInt(t)+e.getMonth()),i}function cn(t){const e=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(t);if(!e)return;const i=new Date(0,0);return i.setFullYear(parseInt(e[1],10)),i.setMonth(parseInt(e[2],10)-1),i.setDate(parseInt(e[3],10)),i}x(sn);
|
|
3555
3555
|
/**
|
|
3556
3556
|
@license
|
|
3557
3557
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3575,13 +3575,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
3575
3575
|
* @license
|
|
3576
3576
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3577
3577
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3578
|
-
*/const bn=document.createElement("template");bn.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n }\n </style>\n",
|
|
3578
|
+
*/const bn=document.createElement("template");bn.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n }\n </style>\n",x(class extends fn{static get is(){return"vaadin-date-picker-month-scroller"}constructor(){super(),this.bufferSize=3,this.shadowRoot.appendChild(bn.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-month-calendar")}_updateElement(t,e){t.month=hn(e)}});
|
|
3579
3579
|
/**
|
|
3580
3580
|
* @license
|
|
3581
3581
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3582
3582
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3583
3583
|
*/
|
|
3584
|
-
const gn=document.createElement("template");gn.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n display: block;\n height: 100%;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n :host::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n </style>\n",
|
|
3584
|
+
const gn=document.createElement("template");gn.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n display: block;\n height: 100%;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n :host::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n </style>\n",x(class extends fn{static get is(){return"vaadin-date-picker-year-scroller"}constructor(){super(),this.bufferSize=12,this.shadowRoot.appendChild(gn.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-date-picker-year")}_updateElement(t,e){t.year=this._yearAfterXYears(e)}_yearAfterXYears(t){const e=new Date,i=new Date(e);return i.setFullYear(parseInt(t)+e.getFullYear()),i.getFullYear()}});
|
|
3585
3585
|
/**
|
|
3586
3586
|
* @license
|
|
3587
3587
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -3611,7 +3611,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
3611
3611
|
Code distributed by Google as part of the polymer project is also
|
|
3612
3612
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3613
3613
|
*/
|
|
3614
|
-
function
|
|
3614
|
+
function _n(t,e,i,s,o){let r;o&&(r="object"==typeof i&&null!==i,r&&(s=t.__dataTemp[e]));let n=s!==i&&(s==s||i==i);return r&&n&&(t.__dataTemp[e]=i),n}x(wn);const xn=ye((t=>class extends t{_shouldPropertyChange(t,e,i){return _n(this,t,e,i,!0)}})),kn=ye((t=>class extends t{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(t,e,i){return _n(this,t,e,i,this.mutableData)}}));xn._mutablePropertyChange=_n;
|
|
3615
3615
|
/**
|
|
3616
3616
|
@license
|
|
3617
3617
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3621,7 +3621,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
3621
3621
|
Code distributed by Google as part of the polymer project is also
|
|
3622
3622
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3623
3623
|
*/
|
|
3624
|
-
let Cn=null;function An(){return Cn}An.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:An,writable:!0}});const Sn=Xi(An),In=
|
|
3624
|
+
let Cn=null;function An(){return Cn}An.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:An,writable:!0}});const Sn=Xi(An),In=xn(Sn),zn=Xi(class{});class Tn extends zn{constructor(t){super(),this._configureProperties(t),this.root=this._stampTemplate(this.__dataHost);let e=[];this.children=e;for(let t=this.root.firstChild;t;t=t.nextSibling)e.push(t),t.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let i=this.__templatizeOptions;(t&&i.instanceProps||!i.instanceProps)&&this._enableProperties()}_configureProperties(t){if(this.__templatizeOptions.forwardHostProp)for(let t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(let e in t)this._setPendingProperty(e,t[e])}forwardHostProp(t,e){this._setPendingPropertyOrPath(t,e,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(t,e,i){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(t,e,(t=>{t.model=this,i(t)}));else{let s=this.__dataHost.__dataHost;s&&s._addEventListenerToNode(t,e,i)}}_showHideChildren(t){!function(t,e){for(let i=0;i<e.length;i++){let s=e[i];if(!!t!=!!s.__hideTemplateChildren__)if(s.nodeType===Node.TEXT_NODE)t?(s.__polymerTextContent__=s.textContent,s.textContent=""):s.textContent=s.__polymerTextContent__;else if("slot"===s.localName)if(t)s.__polymerReplaced__=document.createComment("hidden-slot"),Ne(Ne(s).parentNode).replaceChild(s.__polymerReplaced__,s);else{const t=s.__polymerReplaced__;t&&Ne(Ne(t).parentNode).replaceChild(s,t)}else s.style&&(t?(s.__polymerDisplay__=s.style.display,s.style.display="none"):s.style.display=s.__polymerDisplay__);s.__hideTemplateChildren__=t,s._showHideChildren&&s._showHideChildren(t)}}(t,this.children)}_setUnmanagedPropertyToNode(t,e,i){t.__hideTemplateChildren__&&t.nodeType==Node.TEXT_NODE&&"textContent"==e?t.__polymerTextContent__=i:super._setUnmanagedPropertyToNode(t,e,i)}get parentModel(){let t=this.__parentModel;if(!t){let e;t=this;do{t=t.__dataHost.__dataHost}while((e=t.__templatizeOptions)&&!e.parentModel);this.__parentModel=t}return t}dispatchEvent(t){return!0}}const Dn=xn(Tn);function On(t){let e=t.__dataHost;return e&&e._methodHost||e}function En(t,e){return function(t,i,s){e.call(t.__templatizeOwner,i.substring(6),s[i])}}function Pn(t,e){return function(t,i,s){e.call(t.__templatizeOwner,t,i,s[i])}}function Nn(t,e,i){if(ae&&!On(t))throw new Error("strictTemplatePolicy: template owner not trusted");if(i=i||{},t.__templatizeOwner)throw new Error("A <template> can only be templatized once");t.__templatizeOwner=e;let s=(e?e.constructor:Tn)._parseTemplate(t),o=s.templatizeInstanceClass;o||(o=function(t,e,i){let s=i.mutableData?Dn:Tn;Nn.mixin&&(s=Nn.mixin(s));let o=class extends s{};return o.prototype.__templatizeOptions=i,o.prototype._bindTemplate(t),function(t,e,i,s){let o=i.hostProps||{};for(let e in s.instanceProps){delete o[e];let i=s.notifyInstanceProp;i&&t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:Pn(0,i)})}if(s.forwardHostProp&&e.__dataHost)for(let e in o)i.hasHostProps||(i.hasHostProps=!0),t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(t,e,i){t.__dataHost._setPendingPropertyOrPath("_host_"+e,i[e],!0,!0)}})}(o,t,e,i),o}(t,s,i),s.templatizeInstanceClass=o);const r=On(t);!function(t,e,i,s){let o=i.forwardHostProp;if(o&&e.hasHostProps){const r="template"==t.localName;let n=e.templatizeTemplateClass;if(!n){if(r){let t=i.mutableData?In:Sn;class s extends t{}n=e.templatizeTemplateClass=s}else{const i=t.constructor;class s extends i{}n=e.templatizeTemplateClass=s}let a=e.hostProps;for(let t in a)n.prototype._addPropertyEffect("_host_"+t,n.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:En(0,o)}),n.prototype._createNotifyingProperty("_host_"+t);ce&&s&&function(t,e,i){const s=i.constructor._properties,{propertyEffects:o}=t,{instanceProps:r}=e;for(let t in o)if(!(s[t]||r&&r[t])){const e=o[t];for(let i=0;i<e.length;i++){const{part:s}=e[i].info;if(!s.signature||!s.signature.static){console.warn(`Property '${t}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(e,i,s)}if(t.__dataProto&&Object.assign(t.__data,t.__dataProto),r)(function(t,e){Cn=t,Object.setPrototypeOf(t,e.prototype),new e,Cn=null})(t,n),t.__dataTemp={},t.__dataPending=null,t.__dataOld=null,t._enableProperties();else{Object.setPrototypeOf(t,n.prototype);const i=e.hostProps;for(let e in i)if(e="_host_"+e,e in t){const i=t[e];delete t[e],t.__data[e]=i}}}}(t,s,i,r);let n=class extends o{};return n.prototype._methodHost=r,n.prototype.__dataHost=t,n.prototype.__templatizeOwner=e,n.prototype.__hostProps=s.hostProps,n}
|
|
3625
3625
|
/**
|
|
3626
3626
|
@license
|
|
3627
3627
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3663,7 +3663,7 @@ const jn=t=>class extends(Mo(t)){static get properties(){return{month:{type:Obje
|
|
|
3663
3663
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3664
3664
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3665
3665
|
*/
|
|
3666
|
-
|
|
3666
|
+
Vt("vaadin-month-calendar",T`
|
|
3667
3667
|
:host {
|
|
3668
3668
|
display: block;
|
|
3669
3669
|
}
|
|
@@ -3761,7 +3761,7 @@ $t("vaadin-month-calendar",T`
|
|
|
3761
3761
|
</template>
|
|
3762
3762
|
</tbody>
|
|
3763
3763
|
</table>
|
|
3764
|
-
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate, isDateDisabled)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,s,o,r){const n=["date"],a=t>on(new Date),l=t<on(new Date);return this.__isDayDisabled(t,s,o,r)&&n.push("disabled"),this.__isDayFocused(t,e)&&n.push("focused"),this.__isDaySelected(t,i)&&n.push("selected"),this._isToday(t)&&n.push("today"),l&&n.push("past"),a&&n.push("future"),n.join(" ")}__isDayFocused(t,e){return rn(t,e)}__isDaySelected(t,e){return rn(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i,s){return!an(t,e,i,s)}__getDayAriaDisabled(t,e,i,s){if(void 0!==t&&(void 0!==e||void 0!==i||void 0!==s)&&this.__isDayDisabled(t,e,i,s))return"true"}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}
|
|
3764
|
+
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate, isDateDisabled)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,s,o,r){const n=["date"],a=t>on(new Date),l=t<on(new Date);return this.__isDayDisabled(t,s,o,r)&&n.push("disabled"),this.__isDayFocused(t,e)&&n.push("focused"),this.__isDaySelected(t,i)&&n.push("selected"),this._isToday(t)&&n.push("today"),l&&n.push("past"),a&&n.push("future"),n.join(" ")}__isDayFocused(t,e){return rn(t,e)}__isDaySelected(t,e){return rn(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i,s){return!an(t,e,i,s)}__getDayAriaDisabled(t,e,i,s){if(void 0!==t&&(void 0!==e||void 0!==i||void 0!==s)&&this.__isDayDisabled(t,e,i,s))return"true"}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}x(Ln);
|
|
3765
3765
|
/**
|
|
3766
3766
|
* @license
|
|
3767
3767
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -3772,7 +3772,7 @@ class Rn{constructor(t,e){this.query=t,this.callback=e,this._boundQueryHandler=t
|
|
|
3772
3772
|
* @license
|
|
3773
3773
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3774
3774
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3775
|
-
*/const Vn=t=>class extends t{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},isDateDisabled:{type:Function},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme, isDateDisabled)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate, isDateDisabled)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((t=>t.focusableDateElement)).find(Boolean)}_addListeners(){vo(this.$.scrollers,"pan-y"),po(this.$.scrollers,"track",this._track.bind(this)),po(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),po(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),po(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new Rn(this._desktopMediaQuery,(t=>{this._desktopMode=t}))),this.addController(new Vs(this,"today-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onTodayButtonKeyDown(t))),po(t,"tap",this._onTodayTap.bind(this)),this._todayButton=t}})),this.addController(new Vs(this,"cancel-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onCancelButtonKeyDown(t))),po(t,"tap",this._cancel.bind(this)),this._cancelButton=t}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(t,e){const i=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(t):0;this._scrollToPosition(this._differenceInMonths(t,this._originDate)+i,e),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new Vs(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:t=>{t.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),t.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),t.addEventListener("keydown",(t=>{this.__onMonthCalendarKeyDown(t)})),t.addEventListener("init-done",(()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach((t=>{t.addEventListener("selected-date-changed",(t=>{this.selectedDate=t.detail.value}))})),this.calendars=t})),this._monthScroller=t}}))}__initYearScroller(){this.addController(new Vs(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:t=>{t.setAttribute("aria-hidden","true"),po(t,"tap",(t=>{this._onYearTap(t)})),t.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),t.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),t.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=t}}))}__updateCancelButton(t,e){t&&(t.textContent=e&&e.cancel)}__updateTodayButton(t,e,i,s,o){t&&(t.textContent=e&&e.today,t.disabled=!this._isTodayAllowed(i,s,o))}__updateCalendars(t,e,i,s,o,r,n,a,l,h){t&&t.length&&t.forEach((t=>{t.i18n=e,t.minDate=i,t.maxDate=s,t.isDateDisabled=h,t.focusedDate=r,t.selectedDate=o,t.showWeekNumbers=n,t.ignoreTaps=a,l?t.setAttribute("theme",l):t.removeAttribute("theme")}))}__updateYears(t,e,i){t&&t.length&&t.forEach((t=>{t.selectedDate=e,i?t.setAttribute("theme",i):t.removeAttribute("theme")}))}_selectDate(t){return!!this._dateAllowed(t)&&(this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0})),!0)}_desktopModeChanged(t){this.toggleAttribute("desktop",t)}_focusedDateChanged(t){this.revealDate(t)}revealDate(t,e=!0){if(!t)return;const i=this._differenceInMonths(t,this._originDate);if(this.__useSubMonthScrolling){const s=this._calculateWeekScrollOffset(t);return void this._scrollToPosition(i+s,e)}const s=this._monthScroller.position>i,o=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,r=this._monthScroller.position+o-1<i;s?this._scrollToPosition(i,e):r&&this._scrollToPosition(i-o+1,e)}_calculateWeekScrollOffset(t){const e=new Date(0,0);e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(1);let i=0;for(;e.getDate()<t.getDate();)e.setDate(e.getDate()+1),e.getDay()===this.i18n.firstDayOfWeek&&(i+=1);return i/6}_initialPositionChanged(t){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(t)}_repositionYearScroller(){const t=this._monthScroller.position;this._visibleMonthIndex=Math.floor(t),this._yearScroller.position=(t+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=ks.debounce(this._debouncer,gs.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(t,e,i){return t&&e&&"function"==typeof e.formatDate?e.formatDate(nn(t)):i}_onTodayTap(){const t=this._getTodayMidnight();Math.abs(this._monthScroller.position-this._differenceInMonths(t,this._originDate))<.001?(this._selectDate(t),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(t){if(!this._ignoreTaps&&!this._notTapping){const e=(t.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*e,!0)}}_scrollToPosition(t,e){if(void 0!==this._targetPosition)return void(this._targetPosition=t);if(!e)return this._monthScroller.position=t,this._monthScroller.forceUpdate(),this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let i;this._targetPosition=t,this._revealPromise=new Promise((t=>{i=t}));let s=0;const o=this._monthScroller.position,r=t=>{s||(s=t);const e=t-s;if(e<this.scrollDuration){const t=((t,e,i)=>(t/=this.scrollDuration/2)<1?i/2*t*t+e:-i/2*((t-=1)*(t-2)-1)+e)(e,o,this._targetPosition-o);this._monthScroller.position=t,window.requestAnimationFrame(r)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:o}})),this._monthScroller.position=this._targetPosition,this._monthScroller.forceUpdate(),this._targetPosition=void 0,i(),this._revealPromise=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(r)}_limit(t,e){return Math.min(e.max,Math.max(e.min,t))}_handleTrack(t){Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10||(Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0),this._translateX=this._limit(this._translateX+t.detail.ddx,{min:0,max:this._yearScrollerWidth}))}_track(t){if(!this._desktopMode)switch(t.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(t);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(t){t?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(t){this._desktopMode||(this._monthScroller.style.transform=`translateX(${t-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${t}px)`)}_yearAfterXMonths(t){return hn(t).getFullYear()}_differenceInMonths(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(t){t.preventDefault()}__toggleDate(t){rn(t,this.selectedDate)?(this._clear(),this.focusedDate=t):this._selectDate(t)}__onMonthCalendarKeyDown(t){let e=!1;switch(t.key){case"ArrowDown":this._moveFocusByDays(7),e=!0;break;case"ArrowUp":this._moveFocusByDays(-7),e=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),e=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),e=!0;break;case"Enter":this._selectDate(this.focusedDate)&&(this._close(),e=!0);break;case" ":this.__toggleDate(this.focusedDate),e=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),e=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),e=!0;break;case"PageDown":this._moveFocusByMonths(t.shiftKey?12:1),e=!0;break;case"PageUp":this._moveFocusByMonths(t.shiftKey?-12:-1),e=!0;break;case"Tab":this._onTabKeyDown(t,"calendar")}e&&(t.preventDefault(),t.stopPropagation())}_onTabKeyDown(t,e){switch(t.stopPropagation(),e){case"calendar":t.shiftKey&&(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":t.shiftKey&&(t.preventDefault(),this.focusDateElement());break;case"cancel":t.shiftKey||(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"today")}__onCancelButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&rn(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}focusDate(t,e){return x(this,null,(function*(){const i=t||this.selectedDate||this.initialPosition||new Date;this.focusedDate=i,e||(this._focusedMonthDate=i.getDate()),yield this.focusDateElement(!1)}))}focusDateElement(t=!0){return x(this,null,(function*(){this.__pendingDateFocus=this.focusedDate,this.calendars.length||(yield new Promise((t=>{Ar(this,(()=>{mn(),t()}))}))),t&&this.revealDate(this.focusedDate),this._revealPromise&&(yield this._revealPromise),this.__tryFocusDate()}))}_focusClosestDate(t){this.focusDate(ln(t,[this.minDate,this.maxDate]))}_focusAllowedDate(t,e,i){this._dateAllowed(t,void 0,void 0,(()=>!1))?this.focusDate(t,i):this._dateAllowed(this.focusedDate)?this.focusDate(e>0?this.maxDate:this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(t,e){const i=new Date(0,0);return i.setFullYear(this.focusedDate.getFullYear()),i.setMonth(this.focusedDate.getMonth()+t),e&&i.setDate(this.focusedDate.getDate()+e),i}_moveFocusByDays(t){const e=this._getDateDiff(0,t);this._focusAllowedDate(e,t,!1)}_moveFocusByMonths(t){const e=this._getDateDiff(t),i=e.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),e.setDate(this._focusedMonthDate),e.getMonth()!==i&&e.setDate(0),this._focusAllowedDate(e,t,!0)}_moveFocusInsideMonth(t,e){const i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i)?this.focusDate(i):this._dateAllowed(t)?this.focusDate(this[e]):this._focusClosestDate(t)}_dateAllowed(t,e=this.minDate,i=this.maxDate,s=this.isDateDisabled){return an(t,e,i,s)}_isTodayAllowed(t,e,i){return this._dateAllowed(this._getTodayMidnight(),t,e,i)}_getTodayMidnight(){const t=new Date,e=new Date(0,0);return e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(t.getDate()),e}}
|
|
3775
|
+
*/const $n=t=>class extends t{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},isDateDisabled:{type:Function},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme, isDateDisabled)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate, isDateDisabled)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((t=>t.focusableDateElement)).find(Boolean)}_addListeners(){vo(this.$.scrollers,"pan-y"),po(this.$.scrollers,"track",this._track.bind(this)),po(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),po(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),po(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new Rn(this._desktopMediaQuery,(t=>{this._desktopMode=t}))),this.addController(new $s(this,"today-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onTodayButtonKeyDown(t))),po(t,"tap",this._onTodayTap.bind(this)),this._todayButton=t}})),this.addController(new $s(this,"cancel-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onCancelButtonKeyDown(t))),po(t,"tap",this._cancel.bind(this)),this._cancelButton=t}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(t,e){const i=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(t):0;this._scrollToPosition(this._differenceInMonths(t,this._originDate)+i,e),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new $s(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:t=>{t.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),t.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),t.addEventListener("keydown",(t=>{this.__onMonthCalendarKeyDown(t)})),t.addEventListener("init-done",(()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach((t=>{t.addEventListener("selected-date-changed",(t=>{this.selectedDate=t.detail.value}))})),this.calendars=t})),this._monthScroller=t}}))}__initYearScroller(){this.addController(new $s(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:t=>{t.setAttribute("aria-hidden","true"),po(t,"tap",(t=>{this._onYearTap(t)})),t.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),t.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),t.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=t}}))}__updateCancelButton(t,e){t&&(t.textContent=e&&e.cancel)}__updateTodayButton(t,e,i,s,o){t&&(t.textContent=e&&e.today,t.disabled=!this._isTodayAllowed(i,s,o))}__updateCalendars(t,e,i,s,o,r,n,a,l,h){t&&t.length&&t.forEach((t=>{t.i18n=e,t.minDate=i,t.maxDate=s,t.isDateDisabled=h,t.focusedDate=r,t.selectedDate=o,t.showWeekNumbers=n,t.ignoreTaps=a,l?t.setAttribute("theme",l):t.removeAttribute("theme")}))}__updateYears(t,e,i){t&&t.length&&t.forEach((t=>{t.selectedDate=e,i?t.setAttribute("theme",i):t.removeAttribute("theme")}))}_selectDate(t){return!!this._dateAllowed(t)&&(this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0})),!0)}_desktopModeChanged(t){this.toggleAttribute("desktop",t)}_focusedDateChanged(t){this.revealDate(t)}revealDate(t,e=!0){if(!t)return;const i=this._differenceInMonths(t,this._originDate);if(this.__useSubMonthScrolling){const s=this._calculateWeekScrollOffset(t);return void this._scrollToPosition(i+s,e)}const s=this._monthScroller.position>i,o=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,r=this._monthScroller.position+o-1<i;s?this._scrollToPosition(i,e):r&&this._scrollToPosition(i-o+1,e)}_calculateWeekScrollOffset(t){const e=new Date(0,0);e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(1);let i=0;for(;e.getDate()<t.getDate();)e.setDate(e.getDate()+1),e.getDay()===this.i18n.firstDayOfWeek&&(i+=1);return i/6}_initialPositionChanged(t){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(t)}_repositionYearScroller(){const t=this._monthScroller.position;this._visibleMonthIndex=Math.floor(t),this._yearScroller.position=(t+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=ks.debounce(this._debouncer,gs.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(t,e,i){return t&&e&&"function"==typeof e.formatDate?e.formatDate(nn(t)):i}_onTodayTap(){const t=this._getTodayMidnight();Math.abs(this._monthScroller.position-this._differenceInMonths(t,this._originDate))<.001?(this._selectDate(t),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(t){if(!this._ignoreTaps&&!this._notTapping){const e=(t.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*e,!0)}}_scrollToPosition(t,e){if(void 0!==this._targetPosition)return void(this._targetPosition=t);if(!e)return this._monthScroller.position=t,this._monthScroller.forceUpdate(),this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let i;this._targetPosition=t,this._revealPromise=new Promise((t=>{i=t}));let s=0;const o=this._monthScroller.position,r=t=>{s||(s=t);const e=t-s;if(e<this.scrollDuration){const t=((t,e,i)=>(t/=this.scrollDuration/2)<1?i/2*t*t+e:-i/2*((t-=1)*(t-2)-1)+e)(e,o,this._targetPosition-o);this._monthScroller.position=t,window.requestAnimationFrame(r)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:o}})),this._monthScroller.position=this._targetPosition,this._monthScroller.forceUpdate(),this._targetPosition=void 0,i(),this._revealPromise=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(r)}_limit(t,e){return Math.min(e.max,Math.max(e.min,t))}_handleTrack(t){Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10||(Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0),this._translateX=this._limit(this._translateX+t.detail.ddx,{min:0,max:this._yearScrollerWidth}))}_track(t){if(!this._desktopMode)switch(t.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(t);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(t){t?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(t){this._desktopMode||(this._monthScroller.style.transform=`translateX(${t-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${t}px)`)}_yearAfterXMonths(t){return hn(t).getFullYear()}_differenceInMonths(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(t){t.preventDefault()}__toggleDate(t){rn(t,this.selectedDate)?(this._clear(),this.focusedDate=t):this._selectDate(t)}__onMonthCalendarKeyDown(t){let e=!1;switch(t.key){case"ArrowDown":this._moveFocusByDays(7),e=!0;break;case"ArrowUp":this._moveFocusByDays(-7),e=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),e=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),e=!0;break;case"Enter":this._selectDate(this.focusedDate)&&(this._close(),e=!0);break;case" ":this.__toggleDate(this.focusedDate),e=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),e=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),e=!0;break;case"PageDown":this._moveFocusByMonths(t.shiftKey?12:1),e=!0;break;case"PageUp":this._moveFocusByMonths(t.shiftKey?-12:-1),e=!0;break;case"Tab":this._onTabKeyDown(t,"calendar")}e&&(t.preventDefault(),t.stopPropagation())}_onTabKeyDown(t,e){switch(t.stopPropagation(),e){case"calendar":t.shiftKey&&(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":t.shiftKey&&(t.preventDefault(),this.focusDateElement());break;case"cancel":t.shiftKey||(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"today")}__onCancelButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&rn(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}focusDate(t,e){return _(this,null,(function*(){const i=t||this.selectedDate||this.initialPosition||new Date;this.focusedDate=i,e||(this._focusedMonthDate=i.getDate()),yield this.focusDateElement(!1)}))}focusDateElement(t=!0){return _(this,null,(function*(){this.__pendingDateFocus=this.focusedDate,this.calendars.length||(yield new Promise((t=>{Ar(this,(()=>{mn(),t()}))}))),t&&this.revealDate(this.focusedDate),this._revealPromise&&(yield this._revealPromise),this.__tryFocusDate()}))}_focusClosestDate(t){this.focusDate(ln(t,[this.minDate,this.maxDate]))}_focusAllowedDate(t,e,i){this._dateAllowed(t,void 0,void 0,(()=>!1))?this.focusDate(t,i):this._dateAllowed(this.focusedDate)?this.focusDate(e>0?this.maxDate:this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(t,e){const i=new Date(0,0);return i.setFullYear(this.focusedDate.getFullYear()),i.setMonth(this.focusedDate.getMonth()+t),e&&i.setDate(this.focusedDate.getDate()+e),i}_moveFocusByDays(t){const e=this._getDateDiff(0,t);this._focusAllowedDate(e,t,!1)}_moveFocusByMonths(t){const e=this._getDateDiff(t),i=e.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),e.setDate(this._focusedMonthDate),e.getMonth()!==i&&e.setDate(0),this._focusAllowedDate(e,t,!0)}_moveFocusInsideMonth(t,e){const i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i)?this.focusDate(i):this._dateAllowed(t)?this.focusDate(this[e]):this._focusClosestDate(t)}_dateAllowed(t,e=this.minDate,i=this.maxDate,s=this.isDateDisabled){return an(t,e,i,s)}_isTodayAllowed(t,e,i){return this._dateAllowed(this._getTodayMidnight(),t,e,i)}_getTodayMidnight(){const t=new Date,e=new Date(0,0);return e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(t.getDate()),e}}
|
|
3776
3776
|
/**
|
|
3777
3777
|
* @license
|
|
3778
3778
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -3783,7 +3783,7 @@ class Rn{constructor(t,e){this.query=t,this.callback=e,this._boundQueryHandler=t
|
|
|
3783
3783
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3784
3784
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3785
3785
|
*/
|
|
3786
|
-
|
|
3786
|
+
Vt("vaadin-date-picker-overlay-content",T`
|
|
3787
3787
|
:host {
|
|
3788
3788
|
display: flex;
|
|
3789
3789
|
flex-direction: column;
|
|
@@ -3843,7 +3843,7 @@ $t("vaadin-date-picker-overlay-content",T`
|
|
|
3843
3843
|
z-index: 2;
|
|
3844
3844
|
flex-shrink: 0;
|
|
3845
3845
|
}
|
|
3846
|
-
`,{moduleId:"vaadin-date-picker-overlay-content-styles"});class
|
|
3846
|
+
`,{moduleId:"vaadin-date-picker-overlay-content-styles"});class Vn extends($n(Go(Gt(Ds(hs))))){static get template(){return as`
|
|
3847
3847
|
<div part="overlay-header" on-touchend="_preventDefault" aria-hidden="true">
|
|
3848
3848
|
<div part="label">[[_formatDisplayed(selectedDate, i18n, label)]]</div>
|
|
3849
3849
|
<div part="clear-button" hidden$="[[!selectedDate]]"></div>
|
|
@@ -3863,7 +3863,7 @@ $t("vaadin-date-picker-overlay-content",T`
|
|
|
3863
3863
|
<slot name="today-button"></slot>
|
|
3864
3864
|
<slot name="cancel-button"></slot>
|
|
3865
3865
|
</div>
|
|
3866
|
-
`}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}
|
|
3866
|
+
`}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}x(Vn);
|
|
3867
3867
|
/**
|
|
3868
3868
|
* @license
|
|
3869
3869
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -3970,7 +3970,7 @@ const Wn=new WeakMap,qn=ye((t=>class extends t{get slotStyles(){return{}}connect
|
|
|
3970
3970
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3971
3971
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3972
3972
|
*/
|
|
3973
|
-
|
|
3973
|
+
Vt("vaadin-date-picker",[Kn,T`
|
|
3974
3974
|
:host([opened]) {
|
|
3975
3975
|
pointer-events: auto;
|
|
3976
3976
|
}
|
|
@@ -4025,13 +4025,13 @@ $t("vaadin-date-picker",[Kn,T`
|
|
|
4025
4025
|
></vaadin-date-picker-overlay>
|
|
4026
4026
|
|
|
4027
4027
|
<slot name="tooltip"></slot>
|
|
4028
|
-
`}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new or(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}),{uniqueIdPrefix:"search-input"})),this.addController(new rr(this.inputElement,this._labelController)),this._tooltipController=new
|
|
4028
|
+
`}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new or(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}),{uniqueIdPrefix:"search-input"})),this.addController(new rr(this.inputElement,this._labelController)),this._tooltipController=new Vs(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this.shadowRoot.querySelector('[part="toggle-button"]').addEventListener("mousedown",(t=>t.preventDefault())),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this))}_onVaadinOverlayClose(t){t.detail.sourceEvent&&t.detail.sourceEvent.composedPath().includes(this)&&t.preventDefault()}_toggle(t){t.stopPropagation(),this.$.overlay.opened?this.close():this.open()}_openedChanged(t){super._openedChanged(t),this.$.overlay.positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.$.overlay.noVerticalOverlap=!0}}x(ta),
|
|
4029
4029
|
/**
|
|
4030
4030
|
* @license
|
|
4031
4031
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
4032
4032
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4033
4033
|
*/
|
|
4034
|
-
|
|
4034
|
+
Vt("vaadin-text-field",br,{moduleId:"lumo-text-field-styles"});
|
|
4035
4035
|
/**
|
|
4036
4036
|
* @license
|
|
4037
4037
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -4047,7 +4047,7 @@ const ea=t=>class extends(Gn(t)){static get properties(){return{autocomplete:{ty
|
|
|
4047
4047
|
* @license
|
|
4048
4048
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
4049
4049
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4050
|
-
|
|
4050
|
+
*/;Vt("vaadin-text-field",Kn,{moduleId:"vaadin-text-field-styles"});class sa extends(ia(Gt(Ps(hs)))){static get is(){return"vaadin-text-field"}static get template(){return as`
|
|
4051
4051
|
<div class="vaadin-field-container">
|
|
4052
4052
|
<div part="label">
|
|
4053
4053
|
<slot name="label"></slot>
|
|
@@ -4076,7 +4076,7 @@ const ea=t=>class extends(Gn(t)){static get properties(){return{autocomplete:{ty
|
|
|
4076
4076
|
</div>
|
|
4077
4077
|
</div>
|
|
4078
4078
|
<slot name="tooltip"></slot>
|
|
4079
|
-
`}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new
|
|
4079
|
+
`}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new Vs(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}x(sa),Vt("vaadin-password-field-button",[vr,T`
|
|
4080
4080
|
:host {
|
|
4081
4081
|
position: absolute;
|
|
4082
4082
|
right: 0;
|
|
@@ -4089,7 +4089,7 @@ const ea=t=>class extends(Gn(t)){static get properties(){return{autocomplete:{ty
|
|
|
4089
4089
|
background: transparent;
|
|
4090
4090
|
outline: none;
|
|
4091
4091
|
}
|
|
4092
|
-
`],{moduleId:"lumo-password-field-button"})
|
|
4092
|
+
`],{moduleId:"lumo-password-field-button"}),Vt("vaadin-password-field",[br,T`
|
|
4093
4093
|
[part='reveal-button']::before {
|
|
4094
4094
|
content: var(--lumo-icons-eye);
|
|
4095
4095
|
}
|
|
@@ -4113,13 +4113,13 @@ const ea=t=>class extends(Gn(t)){static get properties(){return{autocomplete:{ty
|
|
|
4113
4113
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4114
4114
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4115
4115
|
*/
|
|
4116
|
-
|
|
4116
|
+
Vt("vaadin-password-field-button",tn,{moduleId:"vaadin-password-field-button-styles"});class oa extends(en(Ds(Gt(hs)))){static get is(){return"vaadin-password-field-button"}static get template(){return as``}}x(oa);
|
|
4117
4117
|
/**
|
|
4118
4118
|
* @license
|
|
4119
4119
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4120
4120
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4121
4121
|
*/
|
|
4122
|
-
const ra=t=>class extends(qn(
|
|
4122
|
+
const ra=t=>class extends(qn(xo(Mo(Lo(t))))){static get properties(){return{revealButtonHidden:{type:Boolean,observer:"_revealButtonHiddenChanged",value:!1},passwordVisible:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_passwordVisibleChanged",readOnly:!0},i18n:{type:Object,value:()=>({reveal:"Show password"})}}}static get observers(){return["__i18nChanged(i18n)"]}constructor(){super(),this._setType("password"),this.__boundRevealButtonClick=this._onRevealButtonClick.bind(this),this.__boundRevealButtonMouseDown=this._onRevealButtonMouseDown.bind(this),this.__lastChange=""}get slotStyles(){return[...super.slotStyles,`\n ${this.localName} [slot="input"]::-ms-reveal {\n display: none;\n }\n `]}get _revealNode(){return this._revealButtonController&&this._revealButtonController.node}ready(){super.ready(),this._revealPart=this.shadowRoot.querySelector('[part="reveal-button"]'),this._revealButtonController=new $s(this,"reveal","vaadin-password-field-button",{initializer:t=>{t.disabled=this.disabled,t.addEventListener("click",this.__boundRevealButtonClick),t.addEventListener("mousedown",this.__boundRevealButtonMouseDown)}}),this.addController(this._revealButtonController),this.__updateAriaLabel(this.i18n),this._updateToggleState(!1),this._toggleRevealHidden(this.revealButtonHidden),this.inputElement&&(this.inputElement.autocapitalize="off")}_onChange(t){super._onChange(t),this.__lastChange=this.inputElement.value}_shouldSetFocus(t){return t.target===this.inputElement||t.target===this._revealNode}_shouldRemoveFocus(t){return!(t.relatedTarget===this._revealNode||t.relatedTarget===this.inputElement&&t.target===this._revealNode)}_setFocused(t){if(super._setFocused(t),t){const t=this.getRootNode().activeElement===this._revealNode;this.toggleAttribute("focus-ring",this._keyboardActive&&!t)}else this._setPasswordVisible(!1),this.__lastChange!==this.inputElement.value&&(this.__lastChange=this.inputElement.value,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}__updateAriaLabel(t){t&&t.reveal&&this._revealNode&&this._revealNode.setAttribute("aria-label",t.reveal)}__i18nChanged(t){this.__updateAriaLabel(t)}_revealButtonHiddenChanged(t){this._toggleRevealHidden(t)}_togglePasswordVisibility(){this._setPasswordVisible(!this.passwordVisible)}_onRevealButtonClick(){this._togglePasswordVisibility()}_onRevealButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_toggleRevealHidden(t){this._revealNode&&(t?(this._revealPart.setAttribute("hidden",""),this._revealNode.setAttribute("tabindex","-1"),this._revealNode.setAttribute("aria-hidden","true")):(this._revealPart.removeAttribute("hidden"),this._revealNode.setAttribute("tabindex","0"),this._revealNode.removeAttribute("aria-hidden")))}_updateToggleState(t){this._revealNode&&this._revealNode.setAttribute("aria-pressed",t?"true":"false")}_passwordVisibleChanged(t){this._setType(t?"text":"password"),this._updateToggleState(t)}_disabledChanged(t,e){super._disabledChanged(t,e),this._revealNode&&(this._revealNode.disabled=t)}}
|
|
4123
4123
|
/**
|
|
4124
4124
|
* @license
|
|
4125
4125
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -4128,7 +4128,7 @@ const ra=t=>class extends(qn(_o(Mo(Lo(t))))){static get properties(){return{reve
|
|
|
4128
4128
|
<div part="reveal-button" slot="suffix">
|
|
4129
4129
|
<slot name="reveal"></slot>
|
|
4130
4130
|
</div>
|
|
4131
|
-
`;let aa;class la extends(ra(sa)){static get is(){return"vaadin-password-field"}static get template(){if(!aa){aa=super.template.cloneNode(!0);const t=na.content.querySelector('[part="reveal-button"]');aa.content.querySelector('[part="input-field"]').appendChild(t)}return aa}}
|
|
4131
|
+
`;let aa;class la extends(ra(sa)){static get is(){return"vaadin-password-field"}static get template(){if(!aa){aa=super.template.cloneNode(!0);const t=na.content.querySelector('[part="reveal-button"]');aa.content.querySelector('[part="input-field"]').appendChild(t)}return aa}}x(la);const ha=T`
|
|
4132
4132
|
:host {
|
|
4133
4133
|
display: flex;
|
|
4134
4134
|
align-items: center;
|
|
@@ -4212,7 +4212,7 @@ const ra=t=>class extends(qn(_o(Mo(Lo(t))))){static get properties(){return{reve
|
|
|
4212
4212
|
width: var(--lumo-icon-size-m);
|
|
4213
4213
|
height: var(--lumo-icon-size-m);
|
|
4214
4214
|
}
|
|
4215
|
-
|
|
4215
|
+
`;Vt("vaadin-item",ha,{moduleId:"lumo-item"});const ca=T`
|
|
4216
4216
|
:host {
|
|
4217
4217
|
transition: background-color 100ms;
|
|
4218
4218
|
overflow: hidden;
|
|
@@ -4224,7 +4224,7 @@ const ra=t=>class extends(qn(_o(Mo(Lo(t))))){static get properties(){return{reve
|
|
|
4224
4224
|
:host([focused]:not([disabled])) {
|
|
4225
4225
|
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
4226
4226
|
}
|
|
4227
|
-
|
|
4227
|
+
`;Vt("vaadin-combo-box-item",[ha,ca],{moduleId:"lumo-combo-box-item"});
|
|
4228
4228
|
/**
|
|
4229
4229
|
* @license
|
|
4230
4230
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
@@ -4301,12 +4301,12 @@ const da=T`
|
|
|
4301
4301
|
top: var(--lumo-space-s);
|
|
4302
4302
|
margin-inline: auto 0;
|
|
4303
4303
|
}
|
|
4304
|
-
|
|
4304
|
+
`;Vt("vaadin-combo-box-overlay",[ur,pr,ua,da,pa,T`
|
|
4305
4305
|
:host {
|
|
4306
4306
|
--_vaadin-combo-box-items-container-border-width: var(--lumo-space-xs);
|
|
4307
4307
|
--_vaadin-combo-box-items-container-border-style: solid;
|
|
4308
4308
|
}
|
|
4309
|
-
`],{moduleId:"lumo-combo-box-overlay"})
|
|
4309
|
+
`],{moduleId:"lumo-combo-box-overlay"}),Vt("vaadin-combo-box",[br,T`
|
|
4310
4310
|
[part='toggle-button']::before {
|
|
4311
4311
|
content: var(--lumo-icons-dropdown);
|
|
4312
4312
|
}
|
|
@@ -4335,7 +4335,7 @@ const ma=t=>class extends t{static get properties(){return{index:{type:Number},i
|
|
|
4335
4335
|
<div part="content">
|
|
4336
4336
|
<slot></slot>
|
|
4337
4337
|
</div>
|
|
4338
|
-
`}static get is(){return"vaadin-combo-box-item"}}
|
|
4338
|
+
`}static get is(){return"vaadin-combo-box-item"}}x(va);
|
|
4339
4339
|
/**
|
|
4340
4340
|
* @license
|
|
4341
4341
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
@@ -4346,7 +4346,7 @@ const fa=t=>class extends(Zr(t)){static get observers(){return["_setOverlayWidth
|
|
|
4346
4346
|
* @license
|
|
4347
4347
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4348
4348
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4349
|
-
|
|
4349
|
+
*/;Vt("vaadin-combo-box-overlay",[wr,T`
|
|
4350
4350
|
#overlay {
|
|
4351
4351
|
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
|
|
4352
4352
|
}
|
|
@@ -4377,12 +4377,12 @@ function ga(t,e){return t.split(".").reduce(((t,e)=>t?t[e]:void 0),e)}
|
|
|
4377
4377
|
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
4378
4378
|
* Code distributed by Google as part of the polymer project is also
|
|
4379
4379
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
4380
|
-
*/
|
|
4380
|
+
*/x(ba);const ya=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/u),wa=ya&&ya[1]>=8,_a={_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_maxPages:2,_templateCost:0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return this._physicalSize-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){return Math.max(0,this._virtualCount-this._physicalCount)},get _virtualStart(){return this._virtualStartVal||0},set _virtualStart(t){t=this._clamp(t,0,this._maxVirtualStart),this._virtualStartVal=t},get _physicalStart(){return this._physicalStartVal||0},set _physicalStart(t){(t%=this._physicalCount)<0&&(t=this._physicalCount+t),this._physicalStartVal=t},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalCount(){return this._physicalCountVal||0},set _physicalCount(t){this._physicalCountVal=t},get _optPhysicalSize(){return 0===this._viewportHeight?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return!(!this.offsetWidth&&!this.offsetHeight)},get firstVisibleIndex(){let t=this._firstVisibleIndexVal;if(null==t){let e=this._physicalTop+this._scrollOffset;t=this._iterateItems(((t,i)=>{if(e+=this._getPhysicalSizeIncrement(t),e>this._scrollPosition)return i}))||0,this._firstVisibleIndexVal=t}return t},get lastVisibleIndex(){let t=this._lastVisibleIndexVal;if(null==t){let e=this._physicalTop+this._scrollOffset;this._iterateItems(((i,s)=>{e<this._scrollBottom&&(t=s),e+=this._getPhysicalSizeIncrement(i)})),this._lastVisibleIndexVal=t}return t},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},_scrollHandler(){const t=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop));let e=t-this._scrollPosition;const i=e>=0;if(this._scrollPosition=t,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(e)>this._physicalSize&&this._physicalSize>0){e-=this._scrollOffset;const t=Math.round(e/this._physicalAverage);this._virtualStart+=t,this._physicalStart+=t,this._physicalTop=Math.min(Math.floor(this._virtualStart)*this._physicalAverage,this._scrollPosition),this._update()}else if(this._physicalCount>0){const t=this._getReusables(i);i?(this._physicalTop=t.physicalTop,this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length):(this._virtualStart-=t.indexes.length,this._physicalStart-=t.indexes.length),this._update(t.indexes,i?null:t.indexes),this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,0),_s)}},_getReusables(t){let e,i,s;const o=[],r=this._hiddenContentSize*this._ratio,n=this._virtualStart,a=this._virtualEnd,l=this._physicalCount;let h=this._physicalTop+this._scrollOffset;const c=this._scrollPosition,d=this._scrollBottom;for(t?(e=this._physicalStart,i=c-h):(e=this._physicalEnd,i=this._physicalBottom+this._scrollOffset-d);s=this._getPhysicalSizeIncrement(e),i-=s,!(o.length>=l||i<=r);)if(t){if(a+o.length+1>=this._virtualCount||h+s>=c-this._scrollOffset)break;o.push(e),h+=s,e=(e+1)%l}else{if(n-o.length<=0||h+this._physicalSize-s<=d)break;o.push(e),h-=s,e=0===e?l-1:e-1}return{indexes:o,physicalTop:h-this._scrollOffset}},_update(t,e){if(!(t&&0===t.length||0===this._physicalCount)){if(this._assignModels(t),this._updateMetrics(t),e)for(;e.length;){const t=e.pop();this._physicalTop-=this._getPhysicalSizeIncrement(t)}this._positionItems(),this._updateScrollerSize()}},_isClientFull(){return 0!==this._scrollBottom&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded(t){const e=this._clamp(this._physicalCount+t,3,this._virtualCount-this._virtualStart)-this._physicalCount;let i=Math.round(.5*this._physicalCount);if(!(e<0)){if(e>0){const t=window.performance.now();[].push.apply(this._physicalItems,this._createPool(e));for(let t=0;t<e;t++)this._physicalSizes.push(0);this._physicalCount+=e,this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart+=e),this._update(),this._templateCost=(window.performance.now()-t)/e,i=Math.round(.5*this._physicalCount)}this._virtualEnd>=this._virtualCount-1||0===i||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,i)),ws):this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,i),_s))}},_render(){if(this.isAttached&&this._isVisible)if(0!==this._physicalCount){const t=this._getReusables(!0);this._physicalTop=t.physicalTop,this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length,this._update(t.indexes),this._update(),this._increasePoolIfNeeded(0)}else this._virtualCount>0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(3))},_itemsChanged(t){"items"===t.path&&(this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalItems||(this._physicalItems=[]),this._physicalSizes||(this._physicalSizes=[]),this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._debounce("_render",this._render,ys))},_iterateItems(t,e){let i,s,o,r;if(2===arguments.length&&e){for(r=0;r<e.length;r++)if(i=e[r],s=this._computeVidx(i),null!=(o=t.call(this,i,s)))return o}else{for(i=this._physicalStart,s=this._virtualStart;i<this._physicalCount;i++,s++)if(null!=(o=t.call(this,i,s)))return o;for(i=0;i<this._physicalStart;i++,s++)if(null!=(o=t.call(this,i,s)))return o}},_computeVidx(t){return t>=this._physicalStart?this._virtualStart+(t-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+t},_positionItems(){this._adjustScrollPosition();let t=this._physicalTop;this._iterateItems((e=>{this.translate3d(0,`${t}px`,0,this._physicalItems[e]),t+=this._physicalSizes[e]}))},_getPhysicalSizeIncrement(t){return this._physicalSizes[t]},_adjustScrollPosition(){const t=0===this._virtualStart?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(0!==t){this._physicalTop-=t;const e=this._scrollPosition;!wa&&e>0&&this._resetScrollPosition(e-t)}},_resetScrollPosition(t){this.scrollTarget&&t>=0&&(this._scrollTop=t,this._scrollPosition=this._scrollTop)},_updateScrollerSize(t){const e=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage;this._estScrollHeight=e,(t||0===this._scrollHeight||this._scrollPosition>=e-this._physicalSize||Math.abs(e-this._scrollHeight)>=this._viewportHeight)&&(this.$.items.style.height=`${e}px`,this._scrollHeight=e)},scrollToIndex(t){if("number"!=typeof t||t<0||t>this.items.length-1||(Ss(),0===this._physicalCount))return;t=this._clamp(t,0,this._virtualCount-1),(!this._isIndexRendered(t)||t>=this._maxVirtualStart)&&(this._virtualStart=t-1),this._assignModels(),this._updateMetrics(),this._physicalTop=this._virtualStart*this._physicalAverage;let e=this._physicalStart,i=this._virtualStart,s=0;const o=this._hiddenContentSize;for(;i<t&&s<=o;)s+=this._getPhysicalSizeIncrement(e),e=(e+1)%this._physicalCount,i+=1;this._updateScrollerSize(!0),this._positionItems(),this._resetScrollPosition(this._physicalTop+this._scrollOffset+s),this._increasePoolIfNeeded(0),this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null},_resetAverage(){this._physicalAverage=0,this._physicalAverageCount=0},_resizeHandler(){this._debounce("_render",(()=>{this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._isVisible?(this.updateViewportBoundaries(),this.toggleScrollListener(!0),this._resetAverage(),this._render()):this.toggleScrollListener(!1)}),ys)},_isIndexRendered(t){return t>=this._virtualStart&&t<=this._virtualEnd},_getPhysicalIndex(t){return(this._physicalStart+(t-this._virtualStart))%this._physicalCount},_clamp:(t,e,i)=>Math.min(i,Math.max(e,t)),_debounce(t,e,i){this._debouncers||(this._debouncers={}),this._debouncers[t]=ks.debounce(this._debouncers[t],i,e.bind(this)),Cs(this._debouncers[t])}},xa=1e3;
|
|
4381
4381
|
/**
|
|
4382
4382
|
* @license
|
|
4383
4383
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4384
4384
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4385
|
-
*/class ka{constructor({createElements:t,updateElement:e,scrollTarget:i,scrollContainer:s,elementsContainer:o,reorderElements:r}){this.isAttached=!0,this._vidxOffset=0,this.createElements=t,this.updateElement=e,this.scrollTarget=i,this.scrollContainer=s,this.elementsContainer=o||s,this.reorderElements=r,this._maxPages=1.3,this.__placeholderHeight=200,this.__elementHeightQueue=Array(10),this.timeouts={SCROLL_REORDER:500,IGNORE_WHEEL:500,FIX_INVALID_ITEM_POSITIONING:100},this.__resizeObserver=new ResizeObserver((()=>this._resizeHandler())),"visible"===getComputedStyle(this.scrollTarget).overflow&&(this.scrollTarget.style.overflow="auto"),"static"===getComputedStyle(this.scrollContainer).position&&(this.scrollContainer.style.position="relative"),this.__resizeObserver.observe(this.scrollTarget),this.scrollTarget.addEventListener("scroll",(()=>this._scrollHandler())),new ResizeObserver((([{contentRect:t}])=>{const e=0===t.width&&0===t.height;!e&&this.__scrollTargetHidden&&this.scrollTarget.scrollTop!==this._scrollPosition&&(this.scrollTarget.scrollTop=this._scrollPosition),this.__scrollTargetHidden=e})).observe(this.scrollTarget),this._scrollLineHeight=this._getScrollLineHeight(),this.scrollTarget.addEventListener("wheel",(t=>this.__onWheel(t))),this.scrollTarget.addEventListener("virtualizer-element-focused",(t=>this.__onElementFocused(t))),this.elementsContainer.addEventListener("focusin",(()=>{this.scrollTarget.dispatchEvent(new CustomEvent("virtualizer-element-focused",{detail:{element:this.__getFocusedElement()}}))})),this.reorderElements&&(this.scrollTarget.addEventListener("mousedown",(()=>{this.__mouseDown=!0})),this.scrollTarget.addEventListener("mouseup",(()=>{this.__mouseDown=!1,this.__pendingReorder&&this.__reorderElements()})))}get scrollOffset(){return 0}get adjustedFirstVisibleIndex(){return this.firstVisibleIndex+this._vidxOffset}get adjustedLastVisibleIndex(){return this.lastVisibleIndex+this._vidxOffset}get _maxVirtualIndexOffset(){return this.size-this._virtualCount}__hasPlaceholders(){return this.__getVisibleElements().some((t=>t.__virtualizerPlaceholder))}scrollToIndex(t){if("number"!=typeof t||isNaN(t)||0===this.size||!this.scrollTarget.offsetHeight)return;delete this.__pendingScrollToIndex,this._physicalCount<=3&&this.flush(),t=this._clamp(t,0,this.size-1);const e=this.__getVisibleElements().length;let i=Math.floor(t/this.size*this._virtualCount);this._virtualCount-i<e?(i=this._virtualCount-(this.size-t),this._vidxOffset=this._maxVirtualIndexOffset):i<e?t<_a?(i=t,this._vidxOffset=0):(i=_a,this._vidxOffset=t-i):this._vidxOffset=t-i,this.__skipNextVirtualIndexAdjust=!0,super.scrollToIndex(i),this.adjustedFirstVisibleIndex!==t&&this._scrollTop<this._maxScrollTop&&!this.grid&&(this._scrollTop-=this.__getIndexScrollOffset(t)||0),this._scrollHandler(),this.__hasPlaceholders()&&(this.__pendingScrollToIndex=t)}flush(){0!==this.scrollTarget.offsetHeight&&(this._resizeHandler(),Ss(),this._scrollHandler(),this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.flush(),this.__scrollReorderDebouncer&&this.__scrollReorderDebouncer.flush(),this.__debouncerWheelAnimationFrame&&this.__debouncerWheelAnimationFrame.flush())}update(t=0,e=this.size-1){const i=[];this.__getVisibleElements().forEach((s=>{s.__virtualIndex>=t&&s.__virtualIndex<=e&&(this.__updateElement(s,s.__virtualIndex,!0),i.push(s))})),this.__afterElementsUpdated(i)}_updateMetrics(t){Ss();let e=0,i=0;const s=this._physicalAverageCount,o=this._physicalAverage;this._iterateItems((t=>{i+=this._physicalSizes[t],this._physicalSizes[t]=Math.ceil(this.__getBorderBoxHeight(this._physicalItems[t])),e+=this._physicalSizes[t],this._physicalAverageCount+=this._physicalSizes[t]?1:0}),t),this._physicalSize=this._physicalSize+e-i,this._physicalAverageCount!==s&&(this._physicalAverage=Math.round((o*s+e)/this._physicalAverageCount))}__getBorderBoxHeight(t){const e=getComputedStyle(t),i=parseFloat(e.height)||0;return"border-box"===e.boxSizing?i:i+(parseFloat(e.paddingBottom)||0)+(parseFloat(e.paddingTop)||0)+(parseFloat(e.borderBottomWidth)||0)+(parseFloat(e.borderTopWidth)||0)}__updateElement(t,e,i){t.__virtualizerPlaceholder&&(t.style.paddingTop="",t.style.opacity="",t.__virtualizerPlaceholder=!1),!this.__preventElementUpdates&&(t.__lastUpdatedIndex!==e||i)&&(this.updateElement(t,e),t.__lastUpdatedIndex=e)}__afterElementsUpdated(t){t.forEach((t=>{const e=t.offsetHeight;if(0===e)t.style.paddingTop=`${this.__placeholderHeight}px`,t.style.opacity="0",t.__virtualizerPlaceholder=!0,this.__placeholderClearDebouncer=ks.debounce(this.__placeholderClearDebouncer,ys,(()=>this._resizeHandler()));else{this.__elementHeightQueue.push(e),this.__elementHeightQueue.shift();const t=this.__elementHeightQueue.filter((t=>void 0!==t));this.__placeholderHeight=Math.round(t.reduce(((t,e)=>t+e),0)/t.length)}})),void 0!==this.__pendingScrollToIndex&&!this.__hasPlaceholders()&&this.scrollToIndex(this.__pendingScrollToIndex)}__getIndexScrollOffset(t){const e=this.__getVisibleElements().find((e=>e.__virtualIndex===t));return e?this.scrollTarget.getBoundingClientRect().top-e.getBoundingClientRect().top:void 0}get size(){return this.__size}set size(t){if(t===this.size)return;let e,i;if(this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.cancel(),this._debouncers&&this._debouncers._increasePoolIfNeeded&&this._debouncers._increasePoolIfNeeded.cancel(),this.__preventElementUpdates=!0,t>0&&(e=this.adjustedFirstVisibleIndex,i=this.__getIndexScrollOffset(e)),this.__size=t,this._itemsChanged({path:"items"}),Ss(),t>0){e=Math.min(e,t-1),this.scrollToIndex(e);const s=this.__getIndexScrollOffset(e);void 0!==i&&void 0!==s&&(this._scrollTop+=i-s)}this.__preventElementUpdates=!1,this._isVisible||this._assignModels(),this.elementsContainer.children.length||requestAnimationFrame((()=>this._resizeHandler())),this._resizeHandler(),Ss(),this._debounce("_update",this._update,xs)}get _scrollTop(){return this.scrollTarget.scrollTop}set _scrollTop(t){this.scrollTarget.scrollTop=t}get items(){return{length:Math.min(this.size,1e5)}}get offsetHeight(){return this.scrollTarget.offsetHeight}get $(){return{items:this.scrollContainer}}updateViewportBoundaries(){const t=window.getComputedStyle(this.scrollTarget);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(t["padding-top"],10),this._isRTL="rtl"===t.direction,this._viewportWidth=this.elementsContainer.offsetWidth,this._viewportHeight=this.scrollTarget.offsetHeight,this._scrollPageHeight=this._viewportHeight-this._scrollLineHeight,this.grid&&this._updateGridMetrics()}setAttribute(){}_createPool(t){const e=this.createElements(t),i=document.createDocumentFragment();return e.forEach((t=>{t.style.position="absolute",i.appendChild(t),this.__resizeObserver.observe(t)})),this.elementsContainer.appendChild(i),e}_assignModels(t){const e=[];this._iterateItems(((t,i)=>{const s=this._physicalItems[t];s.hidden=i>=this.size,s.hidden?delete s.__lastUpdatedIndex:(s.__virtualIndex=i+(this._vidxOffset||0),this.__updateElement(s,s.__virtualIndex),e.push(s))}),t),this.__afterElementsUpdated(e)}_isClientFull(){return setTimeout((()=>{this.__clientFull=!0})),this.__clientFull||super._isClientFull()}translate3d(t,e,i,s){s.style.transform=`translateY(${e})`}toggleScrollListener(){}__getFocusedElement(t=this.__getVisibleElements()){return t.find((t=>t.contains(this.elementsContainer.getRootNode().activeElement)||t.contains(this.scrollTarget.getRootNode().activeElement)))}__nextFocusableSiblingMissing(t,e){return e.indexOf(t)===e.length-1&&this.size>t.__virtualIndex+1}__previousFocusableSiblingMissing(t,e){return 0===e.indexOf(t)&&t.__virtualIndex>0}__onElementFocused(t){if(!this.reorderElements)return;const e=t.detail.element;if(!e)return;const i=this.__getVisibleElements();(this.__previousFocusableSiblingMissing(e,i)||this.__nextFocusableSiblingMissing(e,i))&&this.flush();const s=this.__getVisibleElements();this.__nextFocusableSiblingMissing(e,s)?(this._scrollTop+=Math.ceil(e.getBoundingClientRect().bottom)-Math.floor(this.scrollTarget.getBoundingClientRect().bottom-1),this.flush()):this.__previousFocusableSiblingMissing(e,s)&&(this._scrollTop-=Math.ceil(this.scrollTarget.getBoundingClientRect().top+1)-Math.floor(e.getBoundingClientRect().top),this.flush())}_scrollHandler(){if(0===this.scrollTarget.offsetHeight)return;this._adjustVirtualIndexOffset(this._scrollTop-(this.__previousScrollTop||0));const t=this.scrollTarget.scrollTop-this._scrollPosition;if(super._scrollHandler(),0!==this._physicalCount){const e=t>=0,i=this._getReusables(!e);i.indexes.length&&(this._physicalTop=i.physicalTop,e?(this._virtualStart-=i.indexes.length,this._physicalStart-=i.indexes.length):(this._virtualStart+=i.indexes.length,this._physicalStart+=i.indexes.length),this._resizeHandler())}t&&(this.__fixInvalidItemPositioningDebouncer=ks.debounce(this.__fixInvalidItemPositioningDebouncer,gs.after(this.timeouts.FIX_INVALID_ITEM_POSITIONING),(()=>this.__fixInvalidItemPositioning()))),this.reorderElements&&(this.__scrollReorderDebouncer=ks.debounce(this.__scrollReorderDebouncer,gs.after(this.timeouts.SCROLL_REORDER),(()=>this.__reorderElements()))),this.__previousScrollTop=this._scrollTop,0===this._scrollTop&&0!==this.firstVisibleIndex&&Math.abs(t)>0&&this.scrollToIndex(0)}__fixInvalidItemPositioning(){if(!this.scrollTarget.isConnected)return;const t=this._physicalBottom<this._scrollBottom;if(this._physicalTop>this._scrollTop&&0!==this.adjustedFirstVisibleIndex||t&&this.adjustedLastVisibleIndex!==this.size-1){const e=t,i=this._ratio;this._ratio=0,this._scrollPosition=this._scrollTop+(e?-1:1),this._scrollHandler(),this._ratio=i}}__onWheel(t){if(t.ctrlKey||this._hasScrolledAncestor(t.target,t.deltaX,t.deltaY))return;let e=t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._scrollLineHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._scrollPageHeight),this._deltaYAcc||(this._deltaYAcc=0),this._wheelAnimationFrame)return this._deltaYAcc+=e,void t.preventDefault();e+=this._deltaYAcc,this._deltaYAcc=0,this._wheelAnimationFrame=!0,this.__debouncerWheelAnimationFrame=ks.debounce(this.__debouncerWheelAnimationFrame,ys,(()=>{this._wheelAnimationFrame=!1}));const i=Math.abs(t.deltaX)+Math.abs(e);this._canScroll(this.scrollTarget,t.deltaX,e)?(t.preventDefault(),this.scrollTarget.scrollTop+=e,this.scrollTarget.scrollLeft+=t.deltaX,this._hasResidualMomentum=!0,this._ignoreNewWheel=!0,this._debouncerIgnoreNewWheel=ks.debounce(this._debouncerIgnoreNewWheel,gs.after(this.timeouts.IGNORE_WHEEL),(()=>{this._ignoreNewWheel=!1}))):this._hasResidualMomentum&&i<=this._previousMomentum||this._ignoreNewWheel?t.preventDefault():i>this._previousMomentum&&(this._hasResidualMomentum=!1),this._previousMomentum=i}_hasScrolledAncestor(t,e,i){return t!==this.scrollTarget&&t!==this.scrollTarget.getRootNode().host&&(!(!this._canScroll(t,e,i)||-1===["auto","scroll"].indexOf(getComputedStyle(t).overflow))||(t!==this&&t.parentElement?this._hasScrolledAncestor(t.parentElement,e,i):void 0))}_canScroll(t,e,i){return i>0&&t.scrollTop<t.scrollHeight-t.offsetHeight||i<0&&t.scrollTop>0||e>0&&t.scrollLeft<t.scrollWidth-t.offsetWidth||e<0&&t.scrollLeft>0}_increasePoolIfNeeded(t){if(this._physicalCount>2&&t){const e=Math.ceil(this._optPhysicalSize/this._physicalAverage)-this._physicalCount;super._increasePoolIfNeeded(Math.max(t,Math.min(100,e)))}else super._increasePoolIfNeeded(t)}get _optPhysicalSize(){const t=super._optPhysicalSize;return t<=0||this.__hasPlaceholders()?t:t+this.__getItemHeightBuffer()}__getItemHeightBuffer(){if(0===this._physicalCount)return 0;const t=Math.ceil(this._viewportHeight*(this._maxPages-1)/2),e=Math.max(...this._physicalSizes);return e>Math.min(...this._physicalSizes)?Math.max(0,e-t):0}_getScrollLineHeight(){const t=document.createElement("div");t.style.fontSize="initial",t.style.display="none",document.body.appendChild(t);const e=window.getComputedStyle(t).fontSize;return document.body.removeChild(t),e?window.parseInt(e):void 0}__getVisibleElements(){return Array.from(this.elementsContainer.children).filter((t=>!t.hidden))}__reorderElements(){if(this.__mouseDown)return void(this.__pendingReorder=!0);this.__pendingReorder=!1;const t=this._virtualStart+(this._vidxOffset||0),e=this.__getVisibleElements(),i=this.__getFocusedElement(e)||e[0];if(!i)return;const s=i.__virtualIndex-t,o=e.indexOf(i)-s;if(o>0)for(let t=0;t<o;t++)this.elementsContainer.appendChild(e[t]);else if(o<0)for(let t=e.length+o;t<e.length;t++)this.elementsContainer.insertBefore(e[t],e[0]);if(Dr){const{transform:t}=this.scrollTarget.style;this.scrollTarget.style.transform="translateZ(0)",setTimeout((()=>{this.scrollTarget.style.transform=t}))}}_adjustVirtualIndexOffset(t){const e=this._maxVirtualIndexOffset;if(this._virtualCount>=this.size)this._vidxOffset=0;else if(this.__skipNextVirtualIndexAdjust)this.__skipNextVirtualIndexAdjust=!1;else if(Math.abs(t)>1e4)this._vidxOffset=Math.round(this._scrollTop/(this.scrollTarget.scrollHeight-this.scrollTarget.clientHeight)*e);else{const t=this._vidxOffset,i=_a,s=100;0===this._scrollTop?(this._vidxOffset=0,t!==this._vidxOffset&&super.scrollToIndex(0)):this.firstVisibleIndex<i&&this._vidxOffset>0&&(this._vidxOffset-=Math.min(this._vidxOffset,s),super.scrollToIndex(this.firstVisibleIndex+(t-this._vidxOffset))),this._scrollTop>=this._maxScrollTop&&this._maxScrollTop>0?(this._vidxOffset=e,t!==this._vidxOffset&&super.scrollToIndex(this._virtualCount-1)):this.firstVisibleIndex>this._virtualCount-i&&this._vidxOffset<e&&(this._vidxOffset+=Math.min(e-this._vidxOffset,s),super.scrollToIndex(this.firstVisibleIndex-(this._vidxOffset-t)))}}}Object.setPrototypeOf(ka.prototype,xa);class Ca{constructor(t){this.__adapter=new ka(t)}get firstVisibleIndex(){return this.__adapter.adjustedFirstVisibleIndex}get lastVisibleIndex(){return this.__adapter.adjustedLastVisibleIndex}get size(){return this.__adapter.size}set size(t){this.__adapter.size=t}scrollToIndex(t){this.__adapter.scrollToIndex(t)}update(t=0,e=this.size-1){this.__adapter.update(t,e)}flush(){this.__adapter.flush()}}
|
|
4385
|
+
*/class ka{constructor({createElements:t,updateElement:e,scrollTarget:i,scrollContainer:s,elementsContainer:o,reorderElements:r}){this.isAttached=!0,this._vidxOffset=0,this.createElements=t,this.updateElement=e,this.scrollTarget=i,this.scrollContainer=s,this.elementsContainer=o||s,this.reorderElements=r,this._maxPages=1.3,this.__placeholderHeight=200,this.__elementHeightQueue=Array(10),this.timeouts={SCROLL_REORDER:500,IGNORE_WHEEL:500,FIX_INVALID_ITEM_POSITIONING:100},this.__resizeObserver=new ResizeObserver((()=>this._resizeHandler())),"visible"===getComputedStyle(this.scrollTarget).overflow&&(this.scrollTarget.style.overflow="auto"),"static"===getComputedStyle(this.scrollContainer).position&&(this.scrollContainer.style.position="relative"),this.__resizeObserver.observe(this.scrollTarget),this.scrollTarget.addEventListener("scroll",(()=>this._scrollHandler())),new ResizeObserver((([{contentRect:t}])=>{const e=0===t.width&&0===t.height;!e&&this.__scrollTargetHidden&&this.scrollTarget.scrollTop!==this._scrollPosition&&(this.scrollTarget.scrollTop=this._scrollPosition),this.__scrollTargetHidden=e})).observe(this.scrollTarget),this._scrollLineHeight=this._getScrollLineHeight(),this.scrollTarget.addEventListener("wheel",(t=>this.__onWheel(t))),this.scrollTarget.addEventListener("virtualizer-element-focused",(t=>this.__onElementFocused(t))),this.elementsContainer.addEventListener("focusin",(()=>{this.scrollTarget.dispatchEvent(new CustomEvent("virtualizer-element-focused",{detail:{element:this.__getFocusedElement()}}))})),this.reorderElements&&(this.scrollTarget.addEventListener("mousedown",(()=>{this.__mouseDown=!0})),this.scrollTarget.addEventListener("mouseup",(()=>{this.__mouseDown=!1,this.__pendingReorder&&this.__reorderElements()})))}get scrollOffset(){return 0}get adjustedFirstVisibleIndex(){return this.firstVisibleIndex+this._vidxOffset}get adjustedLastVisibleIndex(){return this.lastVisibleIndex+this._vidxOffset}get _maxVirtualIndexOffset(){return this.size-this._virtualCount}__hasPlaceholders(){return this.__getVisibleElements().some((t=>t.__virtualizerPlaceholder))}scrollToIndex(t){if("number"!=typeof t||isNaN(t)||0===this.size||!this.scrollTarget.offsetHeight)return;delete this.__pendingScrollToIndex,this._physicalCount<=3&&this.flush(),t=this._clamp(t,0,this.size-1);const e=this.__getVisibleElements().length;let i=Math.floor(t/this.size*this._virtualCount);this._virtualCount-i<e?(i=this._virtualCount-(this.size-t),this._vidxOffset=this._maxVirtualIndexOffset):i<e?t<xa?(i=t,this._vidxOffset=0):(i=xa,this._vidxOffset=t-i):this._vidxOffset=t-i,this.__skipNextVirtualIndexAdjust=!0,super.scrollToIndex(i),this.adjustedFirstVisibleIndex!==t&&this._scrollTop<this._maxScrollTop&&!this.grid&&(this._scrollTop-=this.__getIndexScrollOffset(t)||0),this._scrollHandler(),this.__hasPlaceholders()&&(this.__pendingScrollToIndex=t)}flush(){0!==this.scrollTarget.offsetHeight&&(this._resizeHandler(),Ss(),this._scrollHandler(),this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.flush(),this.__scrollReorderDebouncer&&this.__scrollReorderDebouncer.flush(),this.__debouncerWheelAnimationFrame&&this.__debouncerWheelAnimationFrame.flush())}update(t=0,e=this.size-1){const i=[];this.__getVisibleElements().forEach((s=>{s.__virtualIndex>=t&&s.__virtualIndex<=e&&(this.__updateElement(s,s.__virtualIndex,!0),i.push(s))})),this.__afterElementsUpdated(i)}_updateMetrics(t){Ss();let e=0,i=0;const s=this._physicalAverageCount,o=this._physicalAverage;this._iterateItems((t=>{i+=this._physicalSizes[t],this._physicalSizes[t]=Math.ceil(this.__getBorderBoxHeight(this._physicalItems[t])),e+=this._physicalSizes[t],this._physicalAverageCount+=this._physicalSizes[t]?1:0}),t),this._physicalSize=this._physicalSize+e-i,this._physicalAverageCount!==s&&(this._physicalAverage=Math.round((o*s+e)/this._physicalAverageCount))}__getBorderBoxHeight(t){const e=getComputedStyle(t),i=parseFloat(e.height)||0;return"border-box"===e.boxSizing?i:i+(parseFloat(e.paddingBottom)||0)+(parseFloat(e.paddingTop)||0)+(parseFloat(e.borderBottomWidth)||0)+(parseFloat(e.borderTopWidth)||0)}__updateElement(t,e,i){t.__virtualizerPlaceholder&&(t.style.paddingTop="",t.style.opacity="",t.__virtualizerPlaceholder=!1),!this.__preventElementUpdates&&(t.__lastUpdatedIndex!==e||i)&&(this.updateElement(t,e),t.__lastUpdatedIndex=e)}__afterElementsUpdated(t){t.forEach((t=>{const e=t.offsetHeight;if(0===e)t.style.paddingTop=`${this.__placeholderHeight}px`,t.style.opacity="0",t.__virtualizerPlaceholder=!0,this.__placeholderClearDebouncer=ks.debounce(this.__placeholderClearDebouncer,ys,(()=>this._resizeHandler()));else{this.__elementHeightQueue.push(e),this.__elementHeightQueue.shift();const t=this.__elementHeightQueue.filter((t=>void 0!==t));this.__placeholderHeight=Math.round(t.reduce(((t,e)=>t+e),0)/t.length)}})),void 0!==this.__pendingScrollToIndex&&!this.__hasPlaceholders()&&this.scrollToIndex(this.__pendingScrollToIndex)}__getIndexScrollOffset(t){const e=this.__getVisibleElements().find((e=>e.__virtualIndex===t));return e?this.scrollTarget.getBoundingClientRect().top-e.getBoundingClientRect().top:void 0}get size(){return this.__size}set size(t){if(t===this.size)return;let e,i;if(this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.cancel(),this._debouncers&&this._debouncers._increasePoolIfNeeded&&this._debouncers._increasePoolIfNeeded.cancel(),this.__preventElementUpdates=!0,t>0&&(e=this.adjustedFirstVisibleIndex,i=this.__getIndexScrollOffset(e)),this.__size=t,this._itemsChanged({path:"items"}),Ss(),t>0){e=Math.min(e,t-1),this.scrollToIndex(e);const s=this.__getIndexScrollOffset(e);void 0!==i&&void 0!==s&&(this._scrollTop+=i-s)}this.__preventElementUpdates=!1,this._isVisible||this._assignModels(),this.elementsContainer.children.length||requestAnimationFrame((()=>this._resizeHandler())),this._resizeHandler(),Ss(),this._debounce("_update",this._update,_s)}get _scrollTop(){return this.scrollTarget.scrollTop}set _scrollTop(t){this.scrollTarget.scrollTop=t}get items(){return{length:Math.min(this.size,1e5)}}get offsetHeight(){return this.scrollTarget.offsetHeight}get $(){return{items:this.scrollContainer}}updateViewportBoundaries(){const t=window.getComputedStyle(this.scrollTarget);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(t["padding-top"],10),this._isRTL="rtl"===t.direction,this._viewportWidth=this.elementsContainer.offsetWidth,this._viewportHeight=this.scrollTarget.offsetHeight,this._scrollPageHeight=this._viewportHeight-this._scrollLineHeight,this.grid&&this._updateGridMetrics()}setAttribute(){}_createPool(t){const e=this.createElements(t),i=document.createDocumentFragment();return e.forEach((t=>{t.style.position="absolute",i.appendChild(t),this.__resizeObserver.observe(t)})),this.elementsContainer.appendChild(i),e}_assignModels(t){const e=[];this._iterateItems(((t,i)=>{const s=this._physicalItems[t];s.hidden=i>=this.size,s.hidden?delete s.__lastUpdatedIndex:(s.__virtualIndex=i+(this._vidxOffset||0),this.__updateElement(s,s.__virtualIndex),e.push(s))}),t),this.__afterElementsUpdated(e)}_isClientFull(){return setTimeout((()=>{this.__clientFull=!0})),this.__clientFull||super._isClientFull()}translate3d(t,e,i,s){s.style.transform=`translateY(${e})`}toggleScrollListener(){}__getFocusedElement(t=this.__getVisibleElements()){return t.find((t=>t.contains(this.elementsContainer.getRootNode().activeElement)||t.contains(this.scrollTarget.getRootNode().activeElement)))}__nextFocusableSiblingMissing(t,e){return e.indexOf(t)===e.length-1&&this.size>t.__virtualIndex+1}__previousFocusableSiblingMissing(t,e){return 0===e.indexOf(t)&&t.__virtualIndex>0}__onElementFocused(t){if(!this.reorderElements)return;const e=t.detail.element;if(!e)return;const i=this.__getVisibleElements();(this.__previousFocusableSiblingMissing(e,i)||this.__nextFocusableSiblingMissing(e,i))&&this.flush();const s=this.__getVisibleElements();this.__nextFocusableSiblingMissing(e,s)?(this._scrollTop+=Math.ceil(e.getBoundingClientRect().bottom)-Math.floor(this.scrollTarget.getBoundingClientRect().bottom-1),this.flush()):this.__previousFocusableSiblingMissing(e,s)&&(this._scrollTop-=Math.ceil(this.scrollTarget.getBoundingClientRect().top+1)-Math.floor(e.getBoundingClientRect().top),this.flush())}_scrollHandler(){if(0===this.scrollTarget.offsetHeight)return;this._adjustVirtualIndexOffset(this._scrollTop-(this.__previousScrollTop||0));const t=this.scrollTarget.scrollTop-this._scrollPosition;if(super._scrollHandler(),0!==this._physicalCount){const e=t>=0,i=this._getReusables(!e);i.indexes.length&&(this._physicalTop=i.physicalTop,e?(this._virtualStart-=i.indexes.length,this._physicalStart-=i.indexes.length):(this._virtualStart+=i.indexes.length,this._physicalStart+=i.indexes.length),this._resizeHandler())}t&&(this.__fixInvalidItemPositioningDebouncer=ks.debounce(this.__fixInvalidItemPositioningDebouncer,gs.after(this.timeouts.FIX_INVALID_ITEM_POSITIONING),(()=>this.__fixInvalidItemPositioning()))),this.reorderElements&&(this.__scrollReorderDebouncer=ks.debounce(this.__scrollReorderDebouncer,gs.after(this.timeouts.SCROLL_REORDER),(()=>this.__reorderElements()))),this.__previousScrollTop=this._scrollTop,0===this._scrollTop&&0!==this.firstVisibleIndex&&Math.abs(t)>0&&this.scrollToIndex(0)}__fixInvalidItemPositioning(){if(!this.scrollTarget.isConnected)return;const t=this._physicalBottom<this._scrollBottom;if(this._physicalTop>this._scrollTop&&0!==this.adjustedFirstVisibleIndex||t&&this.adjustedLastVisibleIndex!==this.size-1){const e=t,i=this._ratio;this._ratio=0,this._scrollPosition=this._scrollTop+(e?-1:1),this._scrollHandler(),this._ratio=i}}__onWheel(t){if(t.ctrlKey||this._hasScrolledAncestor(t.target,t.deltaX,t.deltaY))return;let e=t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._scrollLineHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._scrollPageHeight),this._deltaYAcc||(this._deltaYAcc=0),this._wheelAnimationFrame)return this._deltaYAcc+=e,void t.preventDefault();e+=this._deltaYAcc,this._deltaYAcc=0,this._wheelAnimationFrame=!0,this.__debouncerWheelAnimationFrame=ks.debounce(this.__debouncerWheelAnimationFrame,ys,(()=>{this._wheelAnimationFrame=!1}));const i=Math.abs(t.deltaX)+Math.abs(e);this._canScroll(this.scrollTarget,t.deltaX,e)?(t.preventDefault(),this.scrollTarget.scrollTop+=e,this.scrollTarget.scrollLeft+=t.deltaX,this._hasResidualMomentum=!0,this._ignoreNewWheel=!0,this._debouncerIgnoreNewWheel=ks.debounce(this._debouncerIgnoreNewWheel,gs.after(this.timeouts.IGNORE_WHEEL),(()=>{this._ignoreNewWheel=!1}))):this._hasResidualMomentum&&i<=this._previousMomentum||this._ignoreNewWheel?t.preventDefault():i>this._previousMomentum&&(this._hasResidualMomentum=!1),this._previousMomentum=i}_hasScrolledAncestor(t,e,i){return t!==this.scrollTarget&&t!==this.scrollTarget.getRootNode().host&&(!(!this._canScroll(t,e,i)||-1===["auto","scroll"].indexOf(getComputedStyle(t).overflow))||(t!==this&&t.parentElement?this._hasScrolledAncestor(t.parentElement,e,i):void 0))}_canScroll(t,e,i){return i>0&&t.scrollTop<t.scrollHeight-t.offsetHeight||i<0&&t.scrollTop>0||e>0&&t.scrollLeft<t.scrollWidth-t.offsetWidth||e<0&&t.scrollLeft>0}_increasePoolIfNeeded(t){if(this._physicalCount>2&&t){const e=Math.ceil(this._optPhysicalSize/this._physicalAverage)-this._physicalCount;super._increasePoolIfNeeded(Math.max(t,Math.min(100,e)))}else super._increasePoolIfNeeded(t)}get _optPhysicalSize(){const t=super._optPhysicalSize;return t<=0||this.__hasPlaceholders()?t:t+this.__getItemHeightBuffer()}__getItemHeightBuffer(){if(0===this._physicalCount)return 0;const t=Math.ceil(this._viewportHeight*(this._maxPages-1)/2),e=Math.max(...this._physicalSizes);return e>Math.min(...this._physicalSizes)?Math.max(0,e-t):0}_getScrollLineHeight(){const t=document.createElement("div");t.style.fontSize="initial",t.style.display="none",document.body.appendChild(t);const e=window.getComputedStyle(t).fontSize;return document.body.removeChild(t),e?window.parseInt(e):void 0}__getVisibleElements(){return Array.from(this.elementsContainer.children).filter((t=>!t.hidden))}__reorderElements(){if(this.__mouseDown)return void(this.__pendingReorder=!0);this.__pendingReorder=!1;const t=this._virtualStart+(this._vidxOffset||0),e=this.__getVisibleElements(),i=this.__getFocusedElement(e)||e[0];if(!i)return;const s=i.__virtualIndex-t,o=e.indexOf(i)-s;if(o>0)for(let t=0;t<o;t++)this.elementsContainer.appendChild(e[t]);else if(o<0)for(let t=e.length+o;t<e.length;t++)this.elementsContainer.insertBefore(e[t],e[0]);if(Dr){const{transform:t}=this.scrollTarget.style;this.scrollTarget.style.transform="translateZ(0)",setTimeout((()=>{this.scrollTarget.style.transform=t}))}}_adjustVirtualIndexOffset(t){const e=this._maxVirtualIndexOffset;if(this._virtualCount>=this.size)this._vidxOffset=0;else if(this.__skipNextVirtualIndexAdjust)this.__skipNextVirtualIndexAdjust=!1;else if(Math.abs(t)>1e4)this._vidxOffset=Math.round(this._scrollTop/(this.scrollTarget.scrollHeight-this.scrollTarget.clientHeight)*e);else{const t=this._vidxOffset,i=xa,s=100;0===this._scrollTop?(this._vidxOffset=0,t!==this._vidxOffset&&super.scrollToIndex(0)):this.firstVisibleIndex<i&&this._vidxOffset>0&&(this._vidxOffset-=Math.min(this._vidxOffset,s),super.scrollToIndex(this.firstVisibleIndex+(t-this._vidxOffset))),this._scrollTop>=this._maxScrollTop&&this._maxScrollTop>0?(this._vidxOffset=e,t!==this._vidxOffset&&super.scrollToIndex(this._virtualCount-1)):this.firstVisibleIndex>this._virtualCount-i&&this._vidxOffset<e&&(this._vidxOffset+=Math.min(e-this._vidxOffset,s),super.scrollToIndex(this.firstVisibleIndex-(this._vidxOffset-t)))}}}Object.setPrototypeOf(ka.prototype,_a);class Ca{constructor(t){this.__adapter=new ka(t)}get firstVisibleIndex(){return this.__adapter.adjustedFirstVisibleIndex}get lastVisibleIndex(){return this.__adapter.adjustedLastVisibleIndex}get size(){return this.__adapter.size}set size(t){this.__adapter.size=t}scrollToIndex(t){this.__adapter.scrollToIndex(t)}update(t=0,e=this.size-1){this.__adapter.update(t,e)}flush(){this.__adapter.flush()}}
|
|
4386
4386
|
/**
|
|
4387
4387
|
* @license
|
|
4388
4388
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
@@ -4424,7 +4424,7 @@ function ga(t,e){return t.split(".").reduce(((t,e)=>t?t[e]:void 0),e)}
|
|
|
4424
4424
|
<div id="selector">
|
|
4425
4425
|
<slot></slot>
|
|
4426
4426
|
</div>
|
|
4427
|
-
`}}
|
|
4427
|
+
`}}x(Ia);
|
|
4428
4428
|
/**
|
|
4429
4429
|
* @license
|
|
4430
4430
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -4460,12 +4460,12 @@ const za=t=>class extends(Hn(t)){static get properties(){return{pattern:{type:St
|
|
|
4460
4460
|
* @license
|
|
4461
4461
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4462
4462
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4463
|
-
*/function Ba(t){return null!=t}function Fa(t,e){return t.findIndex((t=>!(t instanceof Aa)&&e(t)))}const ja=t=>class extends(Zn(Go(ir(Mo(ko(Lo(_o(t)))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,sync:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean,sync:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Object,sync:!0},items:{type:Array,sync:!0,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged",sync:!0},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1,sync:!0},filter:{type:String,value:"",notify:!0,sync:!0},selectedItem:{type:Object,notify:!0,sync:!0},itemClassNameGenerator:{type:Object},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged",sync:!0},itemValuePath:{type:String,value:"value",sync:!0},itemIdPath:{type:String,sync:!0},_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array,sync:!0},_closeOnBlurIsPrevented:Boolean,_scroller:{type:Object,sync:!0},_overlayOpened:{type:Boolean,sync:!0,observer:"_overlayOpenedChanged"},__keepOverlayOpened:{type:Boolean,sync:!0}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading, __keepOverlayOpened)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, _theme, itemClassNameGenerator)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(t){super._inputElementChanged(t);const e=this._nativeInput;e&&(e.autocomplete="off",e.autocapitalize="off",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",!!this.opened),e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const t=()=>{requestAnimationFrame((()=>{this._overlayElement.bringToFront()}))};this.addEventListener("mousedown",t),this.addEventListener("touchstart",t),Ma(this),this.addController(new Qn(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach((t=>{t.requestContentUpdate()})))}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(t,e,i){super._propertiesChanged(t,e,i),void 0!==e.filter&&this._filterChanged(e.filter)}updated(t){super.updated(t),t.has("filter")&&this._filterChanged(this.filter)}_initOverlay(){const t=this.$.overlay;t._comboBox=this,t.addEventListener("touchend",this._boundOnOverlayTouchAction),t.addEventListener("touchmove",this._boundOnOverlayTouchAction),t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("opened-changed",(t=>{this._overlayOpened=t.detail.value})),this._overlayElement=t}_initScroller(t){const e=document.createElement(`${this._tagNamePrefix}-scroller`);e.owner=t||this,e.getItemLabel=this._getItemLabel.bind(this),e.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged);const i=this._overlayElement;i.renderer=t=>{t.innerHTML||t.appendChild(e)},i.requestContentUpdate(),this._scroller=e}_updateScroller(t,e,i,s,o,r,n,a,l,h){if(t&&(i&&(t.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),t.setProperties({items:i?e:[],opened:i,loading:s,selectedItem:o,itemIdPath:r,focusedIndex:n,renderer:a,theme:l,itemClassNameGenerator:h}),t.performUpdate&&!t.hasUpdated))try{t.performUpdate()}catch(t){}}_openedOrItemsChanged(t,e,i,s){this._overlayOpened=t&&(s||i||!(!e||!e.length))}_overlayOpenedChanged(t,e){t?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):e&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(t,e){void 0!==e&&this._updateActiveDescendant(t)}_isInputFocused(){return this.inputElement&&Po(this.inputElement)}_updateActiveDescendant(t){const e=this._nativeInput;if(!e)return;const i=this._getItemElements().find((e=>e.index===t));i?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant")}_openedChanged(t,e){if(void 0===e)return;t?!this._isInputFocused()&&!Or&&this.inputElement&&this.inputElement.focus():this._onClosed();const i=this._nativeInput;i&&(i.setAttribute("aria-expanded",!!t),t?i.setAttribute("aria-controls",this._scroller.id):i.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(t){return t.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_onClearButtonClick(t){t.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(t){t.preventDefault(),this.opened?this.close():this.open()}_onHostClick(t){this.autoOpenDisabled||(t.preventDefault(),this.open())}_onClick(t){this._isClearButton(t)?this._onClearButtonClick(t):t.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(t):this._onHostClick(t)}_onKeyDown(t){super._onKeyDown(t),"ArrowDown"===t.key?(this._onArrowDown(),t.preventDefault()):"ArrowUp"===t.key&&(this._onArrowUp(),t.preventDefault())}_getItemLabel(t){let e=t&&this.itemLabelPath?ga(this.itemLabelPath,t):void 0;return null==e&&(e=t?t.toString():""),e}_getItemValue(t){let e=t&&this.itemValuePath?ga(this.itemValuePath,t):void 0;return void 0===e&&(e=t?t.toString():""),e}_onArrowDown(){if(this.opened){const t=this._dropdownItems;t&&(this._focusedIndex=Math.min(t.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const t=this._dropdownItems;t&&(this._focusedIndex=t.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){this._focusedIndex>-1&&(this._inputElementValue=this._getItemLabel(this._dropdownItems[this._focusedIndex]),this._markAllSelectionRange())}_setSelectionRange(t,e){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(t,e)}_markAllSelectionRange(){void 0!==this._inputElementValue&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(void 0!==this._inputElementValue){const t=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(t,t)}}_closeOrCommit(){this.opened||this.loading?this.close():this._commitValue()}_onEnter(t){if(!this._hasValidInputValue())return t.preventDefault(),void t.stopPropagation();this.opened&&(t.preventDefault(),t.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const t=this._focusedIndex<0&&""!==this._inputElementValue&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!t}_onEscape(t){this.autoOpenDisabled&&(this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0)?(t.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.opened?(t.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_toggleElementChanged(t){t&&(t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("click",(()=>{Or&&!this._isInputFocused()&&document.activeElement.blur()})))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}_clearFilter(){this.filter=""}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){(!this.loading||this.allowCustomValue)&&this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const t=this._dropdownItems[this._focusedIndex];this.selectedItem!==t&&(this.selectedItem=t),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(""===this._inputElementValue||void 0===this._inputElementValue)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const t=[this.selectedItem,...this._dropdownItems||[]],e=t[this.__getItemIndexByLabel(t,this._inputElementValue)];if(this.allowCustomValue&&!e){const t=this._inputElementValue;this._lastCustomValue=t;const e=new CustomEvent("custom-value-set",{detail:t,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(e),e.defaultPrevented||(this.value=t)}else this.allowCustomValue||this.opened||!e?this._revertInputValueToValue():this.value=this._getItemValue(e)}this._detectAndDispatchChange(),this._clearSelectionRange(),this._clearFilter()}_onInput(t){const e=this._inputElementValue,i={};this.filter===e?this._filterChanged(this.filter):i.filter=e,!this.opened&&!this._isClearButton(t)&&!this.autoOpenDisabled&&(i.opened=!0),this.setProperties(i)}_onChange(t){t.stopPropagation()}_itemLabelPathChanged(t){"string"!=typeof t&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(t){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,t):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this._inputElementValue=this.allowCustomValue&&!this.selectedItem?this.value:this._getItemLabel(this.selectedItem)}_selectedItemChanged(t){if(null==t)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const e=this._getItemValue(t);if(this.value!==e&&(this.value=e,this.value!==e))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(t)}}_valueChanged(t,e){""===t&&void 0===e||(Ba(t)?(this._getItemValue(this.selectedItem)!==t&&this._selectItemForValue(t),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=t),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this._clearFilter(),this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this.validate(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(t,e){this._ensureItemsOrDataProvider((()=>{this.items=e})),t?this.filteredItems=t.slice(0):e&&(this.filteredItems=null)}_filteredItemsChanged(t){this._setDropdownItems(t)}_filterItems(t,e){return t&&t.filter((t=>(e=e?e.toString().toLowerCase():"",this._getItemLabel(t).toString().toLowerCase().indexOf(e)>-1)))}_selectItemForValue(t){const e=this.__getItemIndexByValue(this.filteredItems,t),i=this.selectedItem;this.selectedItem=e>=0?this.filteredItems[e]:this.dataProvider&&void 0===this.selectedItem?void 0:null,null===this.selectedItem&&null===i&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(t){const e=this._dropdownItems;this._dropdownItems=t;const i=e?e[this._focusedIndex]:null,s=this.__getItemIndexByValue(t,this.value);null==this.selectedItem&&s>=0&&(this.selectedItem=t[s]);const o=this.__getItemIndexByValue(t,this._getItemValue(i));this._focusedIndex=o>-1?o:this.__getItemIndexByLabel(t,this.filter)}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(t){this._scroller&&this._scroller.scrollIntoView(t)}__getItemIndexByValue(t,e){return t&&Ba(e)?Fa(t,(t=>this._getItemValue(t)===e)):-1}__getItemIndexByLabel(t,e){return t&&e?Fa(t,(t=>this._getItemLabel(t).toString().toLowerCase()===e.toString().toLowerCase())):-1}_overlaySelectedItemChanged(t){t.stopPropagation(),!(t.detail.item instanceof Aa)&&this.opened&&(this._focusedIndex=this.filteredItems.indexOf(t.detail.item),this.close())}_setFocused(t){if(super._setFocused(t),!t&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue)return void delete this._lastCustomValue;if(Io())return void this._closeOrCommit();this.opened?this._overlayOpened||this.close():this._commitValue()}}_shouldRemoveFocus(t){return!(t.relatedTarget&&t.relatedTarget.localName===`${this._tagNamePrefix}-item`||t.relatedTarget===this._overlayElement&&(t.composedPath()[0].focus(),1))}_onTouchend(t){!this.clearElement||t.composedPath()[0]!==this.clearElement||(t.preventDefault(),this._onClearAction())}}
|
|
4463
|
+
*/function Ba(t){return null!=t}function Fa(t,e){return t.findIndex((t=>!(t instanceof Aa)&&e(t)))}const ja=t=>class extends(Zn(Go(ir(Mo(ko(Lo(xo(t)))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,sync:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean,sync:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Object,sync:!0},items:{type:Array,sync:!0,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged",sync:!0},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1,sync:!0},filter:{type:String,value:"",notify:!0,sync:!0},selectedItem:{type:Object,notify:!0,sync:!0},itemClassNameGenerator:{type:Object},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged",sync:!0},itemValuePath:{type:String,value:"value",sync:!0},itemIdPath:{type:String,sync:!0},_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array,sync:!0},_closeOnBlurIsPrevented:Boolean,_scroller:{type:Object,sync:!0},_overlayOpened:{type:Boolean,sync:!0,observer:"_overlayOpenedChanged"},__keepOverlayOpened:{type:Boolean,sync:!0}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading, __keepOverlayOpened)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, _theme, itemClassNameGenerator)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(t){super._inputElementChanged(t);const e=this._nativeInput;e&&(e.autocomplete="off",e.autocapitalize="off",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",!!this.opened),e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const t=()=>{requestAnimationFrame((()=>{this._overlayElement.bringToFront()}))};this.addEventListener("mousedown",t),this.addEventListener("touchstart",t),Ma(this),this.addController(new Qn(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach((t=>{t.requestContentUpdate()})))}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(t,e,i){super._propertiesChanged(t,e,i),void 0!==e.filter&&this._filterChanged(e.filter)}updated(t){super.updated(t),t.has("filter")&&this._filterChanged(this.filter)}_initOverlay(){const t=this.$.overlay;t._comboBox=this,t.addEventListener("touchend",this._boundOnOverlayTouchAction),t.addEventListener("touchmove",this._boundOnOverlayTouchAction),t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("opened-changed",(t=>{this._overlayOpened=t.detail.value})),this._overlayElement=t}_initScroller(t){const e=document.createElement(`${this._tagNamePrefix}-scroller`);e.owner=t||this,e.getItemLabel=this._getItemLabel.bind(this),e.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged);const i=this._overlayElement;i.renderer=t=>{t.innerHTML||t.appendChild(e)},i.requestContentUpdate(),this._scroller=e}_updateScroller(t,e,i,s,o,r,n,a,l,h){if(t&&(i&&(t.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),t.setProperties({items:i?e:[],opened:i,loading:s,selectedItem:o,itemIdPath:r,focusedIndex:n,renderer:a,theme:l,itemClassNameGenerator:h}),t.performUpdate&&!t.hasUpdated))try{t.performUpdate()}catch(t){}}_openedOrItemsChanged(t,e,i,s){this._overlayOpened=t&&(s||i||!(!e||!e.length))}_overlayOpenedChanged(t,e){t?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):e&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(t,e){void 0!==e&&this._updateActiveDescendant(t)}_isInputFocused(){return this.inputElement&&Po(this.inputElement)}_updateActiveDescendant(t){const e=this._nativeInput;if(!e)return;const i=this._getItemElements().find((e=>e.index===t));i?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant")}_openedChanged(t,e){if(void 0===e)return;t?!this._isInputFocused()&&!Or&&this.inputElement&&this.inputElement.focus():this._onClosed();const i=this._nativeInput;i&&(i.setAttribute("aria-expanded",!!t),t?i.setAttribute("aria-controls",this._scroller.id):i.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(t){return t.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_onClearButtonClick(t){t.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(t){t.preventDefault(),this.opened?this.close():this.open()}_onHostClick(t){this.autoOpenDisabled||(t.preventDefault(),this.open())}_onClick(t){this._isClearButton(t)?this._onClearButtonClick(t):t.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(t):this._onHostClick(t)}_onKeyDown(t){super._onKeyDown(t),"ArrowDown"===t.key?(this._onArrowDown(),t.preventDefault()):"ArrowUp"===t.key&&(this._onArrowUp(),t.preventDefault())}_getItemLabel(t){let e=t&&this.itemLabelPath?ga(this.itemLabelPath,t):void 0;return null==e&&(e=t?t.toString():""),e}_getItemValue(t){let e=t&&this.itemValuePath?ga(this.itemValuePath,t):void 0;return void 0===e&&(e=t?t.toString():""),e}_onArrowDown(){if(this.opened){const t=this._dropdownItems;t&&(this._focusedIndex=Math.min(t.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const t=this._dropdownItems;t&&(this._focusedIndex=t.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){this._focusedIndex>-1&&(this._inputElementValue=this._getItemLabel(this._dropdownItems[this._focusedIndex]),this._markAllSelectionRange())}_setSelectionRange(t,e){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(t,e)}_markAllSelectionRange(){void 0!==this._inputElementValue&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(void 0!==this._inputElementValue){const t=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(t,t)}}_closeOrCommit(){this.opened||this.loading?this.close():this._commitValue()}_onEnter(t){if(!this._hasValidInputValue())return t.preventDefault(),void t.stopPropagation();this.opened&&(t.preventDefault(),t.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const t=this._focusedIndex<0&&""!==this._inputElementValue&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!t}_onEscape(t){this.autoOpenDisabled&&(this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0)?(t.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.opened?(t.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_toggleElementChanged(t){t&&(t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("click",(()=>{Or&&!this._isInputFocused()&&document.activeElement.blur()})))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}_clearFilter(){this.filter=""}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){(!this.loading||this.allowCustomValue)&&this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const t=this._dropdownItems[this._focusedIndex];this.selectedItem!==t&&(this.selectedItem=t),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(""===this._inputElementValue||void 0===this._inputElementValue)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const t=[this.selectedItem,...this._dropdownItems||[]],e=t[this.__getItemIndexByLabel(t,this._inputElementValue)];if(this.allowCustomValue&&!e){const t=this._inputElementValue;this._lastCustomValue=t;const e=new CustomEvent("custom-value-set",{detail:t,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(e),e.defaultPrevented||(this.value=t)}else this.allowCustomValue||this.opened||!e?this._revertInputValueToValue():this.value=this._getItemValue(e)}this._detectAndDispatchChange(),this._clearSelectionRange(),this._clearFilter()}_onInput(t){const e=this._inputElementValue,i={};this.filter===e?this._filterChanged(this.filter):i.filter=e,!this.opened&&!this._isClearButton(t)&&!this.autoOpenDisabled&&(i.opened=!0),this.setProperties(i)}_onChange(t){t.stopPropagation()}_itemLabelPathChanged(t){"string"!=typeof t&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(t){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,t):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this._inputElementValue=this.allowCustomValue&&!this.selectedItem?this.value:this._getItemLabel(this.selectedItem)}_selectedItemChanged(t){if(null==t)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const e=this._getItemValue(t);if(this.value!==e&&(this.value=e,this.value!==e))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(t)}}_valueChanged(t,e){""===t&&void 0===e||(Ba(t)?(this._getItemValue(this.selectedItem)!==t&&this._selectItemForValue(t),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=t),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this._clearFilter(),this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this.validate(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(t,e){this._ensureItemsOrDataProvider((()=>{this.items=e})),t?this.filteredItems=t.slice(0):e&&(this.filteredItems=null)}_filteredItemsChanged(t){this._setDropdownItems(t)}_filterItems(t,e){return t&&t.filter((t=>(e=e?e.toString().toLowerCase():"",this._getItemLabel(t).toString().toLowerCase().indexOf(e)>-1)))}_selectItemForValue(t){const e=this.__getItemIndexByValue(this.filteredItems,t),i=this.selectedItem;this.selectedItem=e>=0?this.filteredItems[e]:this.dataProvider&&void 0===this.selectedItem?void 0:null,null===this.selectedItem&&null===i&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(t){const e=this._dropdownItems;this._dropdownItems=t;const i=e?e[this._focusedIndex]:null,s=this.__getItemIndexByValue(t,this.value);null==this.selectedItem&&s>=0&&(this.selectedItem=t[s]);const o=this.__getItemIndexByValue(t,this._getItemValue(i));this._focusedIndex=o>-1?o:this.__getItemIndexByLabel(t,this.filter)}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(t){this._scroller&&this._scroller.scrollIntoView(t)}__getItemIndexByValue(t,e){return t&&Ba(e)?Fa(t,(t=>this._getItemValue(t)===e)):-1}__getItemIndexByLabel(t,e){return t&&e?Fa(t,(t=>this._getItemLabel(t).toString().toLowerCase()===e.toString().toLowerCase())):-1}_overlaySelectedItemChanged(t){t.stopPropagation(),!(t.detail.item instanceof Aa)&&this.opened&&(this._focusedIndex=this.filteredItems.indexOf(t.detail.item),this.close())}_setFocused(t){if(super._setFocused(t),!t&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue)return void delete this._lastCustomValue;if(Io())return void this._closeOrCommit();this.opened?this._overlayOpened||this.close():this._commitValue()}}_shouldRemoveFocus(t){return!(t.relatedTarget&&t.relatedTarget.localName===`${this._tagNamePrefix}-item`||t.relatedTarget===this._overlayElement&&(t.composedPath()[0].focus(),1))}_onTouchend(t){!this.clearElement||t.composedPath()[0]!==this.clearElement||(t.preventDefault(),this._onClearAction())}}
|
|
4464
4464
|
/**
|
|
4465
4465
|
* @license
|
|
4466
4466
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4467
4467
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4468
|
-
|
|
4468
|
+
*/;Vt("vaadin-combo-box",Kn,{moduleId:"vaadin-combo-box-styles"});class La extends(Na(ja(za(Gn(Gt(Ps(hs))))))){static get is(){return"vaadin-combo-box"}static get template(){return as`
|
|
4469
4469
|
<style>
|
|
4470
4470
|
:host([opened]) {
|
|
4471
4471
|
pointer-events: auto;
|
|
@@ -4510,7 +4510,7 @@ const za=t=>class extends(Hn(t)){static get properties(){return{pattern:{type:St
|
|
|
4510
4510
|
></vaadin-combo-box-overlay>
|
|
4511
4511
|
|
|
4512
4512
|
<slot name="tooltip"></slot>
|
|
4513
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new or(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new rr(this.inputElement,this._labelController)),this._tooltipController=new
|
|
4513
|
+
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new or(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new rr(this.inputElement,this._labelController)),this._tooltipController=new Vs(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}x(La),Vt("vaadin-multi-select-combo-box-chip",[fr,T`
|
|
4514
4514
|
:host {
|
|
4515
4515
|
font-size: var(--lumo-font-size-xxs);
|
|
4516
4516
|
line-height: 1;
|
|
@@ -4599,23 +4599,23 @@ const za=t=>class extends(Hn(t)){static get properties(){return{pattern:{type:St
|
|
|
4599
4599
|
-webkit-text-fill-color: var(--lumo-disabled-text-color);
|
|
4600
4600
|
pointer-events: none;
|
|
4601
4601
|
}
|
|
4602
|
-
`],{moduleId:"lumo-multi-select-combo-box-chip"})
|
|
4602
|
+
`],{moduleId:"lumo-multi-select-combo-box-chip"}),Vt("vaadin-multi-select-combo-box-item",[ha,ca,T`
|
|
4603
4603
|
@media (any-hover: hover) {
|
|
4604
4604
|
:host(:hover[readonly]) {
|
|
4605
4605
|
background-color: transparent;
|
|
4606
4606
|
cursor: default;
|
|
4607
4607
|
}
|
|
4608
4608
|
}
|
|
4609
|
-
`],{moduleId:"lumo-multi-select-combo-box-item"})
|
|
4609
|
+
`],{moduleId:"lumo-multi-select-combo-box-item"}),Vt("vaadin-multi-select-combo-box-overlay",[ur,pr,ua,da,pa,T`
|
|
4610
4610
|
:host {
|
|
4611
4611
|
--_vaadin-multi-select-combo-box-items-container-border-width: var(--lumo-space-xs);
|
|
4612
4612
|
--_vaadin-multi-select-combo-box-items-container-border-style: solid;
|
|
4613
4613
|
}
|
|
4614
|
-
`],{moduleId:"lumo-multi-select-combo-box-overlay"})
|
|
4614
|
+
`],{moduleId:"lumo-multi-select-combo-box-overlay"}),Vt("vaadin-multi-select-combo-box-container",T`
|
|
4615
4615
|
:host([auto-expand-vertically]) {
|
|
4616
4616
|
padding-block: var(--lumo-space-xs);
|
|
4617
4617
|
}
|
|
4618
|
-
`,{moduleId:"lumo-multi-select-combo-box-container"})
|
|
4618
|
+
`,{moduleId:"lumo-multi-select-combo-box-container"}),Vt("vaadin-multi-select-combo-box",[br,T`
|
|
4619
4619
|
:host([has-value]) {
|
|
4620
4620
|
padding-inline-start: 0;
|
|
4621
4621
|
}
|
|
@@ -4703,13 +4703,13 @@ class Ra extends(Gt(hs)){static get is(){return"vaadin-multi-select-combo-box-ch
|
|
|
4703
4703
|
</style>
|
|
4704
4704
|
<div part="label">[[label]]</div>
|
|
4705
4705
|
<div part="remove-button" on-click="_onRemoveClick"></div>
|
|
4706
|
-
`}_onRemoveClick(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("item-removed",{detail:{item:this.item},bubbles:!0,composed:!0}))}}let
|
|
4706
|
+
`}_onRemoveClick(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("item-removed",{detail:{item:this.item},bubbles:!0,composed:!0}))}}let $a;x(Ra),
|
|
4707
4707
|
/**
|
|
4708
4708
|
* @license
|
|
4709
4709
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4710
4710
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4711
4711
|
*/
|
|
4712
|
-
|
|
4712
|
+
Vt("vaadin-multi-select-combo-box-container",T`
|
|
4713
4713
|
#wrapper {
|
|
4714
4714
|
display: flex;
|
|
4715
4715
|
width: 100%;
|
|
@@ -4719,13 +4719,13 @@ $t("vaadin-multi-select-combo-box-container",T`
|
|
|
4719
4719
|
:host([auto-expand-vertically]) #wrapper {
|
|
4720
4720
|
flex-wrap: wrap;
|
|
4721
4721
|
}
|
|
4722
|
-
`,{moduleId:"vaadin-multi-select-combo-box-container-styles"}),
|
|
4722
|
+
`,{moduleId:"vaadin-multi-select-combo-box-container-styles"}),x(class extends yr{static get is(){return"vaadin-multi-select-combo-box-container"}static get template(){if(!$a){$a=super.template.cloneNode(!0);const t=$a.content,e=t.querySelectorAll("slot"),i=document.createElement("div");i.setAttribute("id","wrapper"),t.insertBefore(i,e[2]),i.appendChild(e[0]),i.appendChild(e[1])}return $a}static get properties(){return{autoExpandVertically:{type:Boolean,reflectToAttribute:!0}}}});
|
|
4723
4723
|
/**
|
|
4724
4724
|
* @license
|
|
4725
4725
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4726
4726
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4727
4727
|
*/
|
|
4728
|
-
class
|
|
4728
|
+
class Va extends(ma(Gt(Ds(hs)))){static get is(){return"vaadin-multi-select-combo-box-item"}static get template(){return as`
|
|
4729
4729
|
<style>
|
|
4730
4730
|
:host {
|
|
4731
4731
|
display: block;
|
|
@@ -4739,7 +4739,7 @@ class $a extends(ma(Gt(Ds(hs)))){static get is(){return"vaadin-multi-select-comb
|
|
|
4739
4739
|
<div part="content">
|
|
4740
4740
|
<slot></slot>
|
|
4741
4741
|
</div>
|
|
4742
|
-
`}}
|
|
4742
|
+
`}}x(Va),Vt("vaadin-multi-select-combo-box-overlay",[wr,T`
|
|
4743
4743
|
#overlay {
|
|
4744
4744
|
width: var(
|
|
4745
4745
|
--vaadin-multi-select-combo-box-overlay-width,
|
|
@@ -4758,7 +4758,7 @@ class $a extends(ma(Gt(Ds(hs)))){static get is(){return"vaadin-multi-select-comb
|
|
|
4758
4758
|
<div part="loader"></div>
|
|
4759
4759
|
<div part="content" id="content"><slot></slot></div>
|
|
4760
4760
|
</div>
|
|
4761
|
-
`}}
|
|
4761
|
+
`}}x(Wa);
|
|
4762
4762
|
/**
|
|
4763
4763
|
* @license
|
|
4764
4764
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -4791,7 +4791,7 @@ class qa extends(Sa(hs)){static get is(){return"vaadin-multi-select-combo-box-sc
|
|
|
4791
4791
|
<div id="selector">
|
|
4792
4792
|
<slot></slot>
|
|
4793
4793
|
</div>
|
|
4794
|
-
`}ready(){super.ready(),this.setAttribute("aria-multiselectable","true")}_isItemSelected(t,e,i){return!(t instanceof Aa||this.owner.readonly)&&this.owner._findIndex(t,this.owner.selectedItems,i)>-1}_updateElement(t,e){super._updateElement(t,e),t.toggleAttribute("readonly",this.owner.readonly)}}
|
|
4794
|
+
`}ready(){super.ready(),this.setAttribute("aria-multiselectable","true")}_isItemSelected(t,e,i){return!(t instanceof Aa||this.owner.readonly)&&this.owner._findIndex(t,this.owner.selectedItems,i)>-1}_updateElement(t,e){super._updateElement(t,e),t.toggleAttribute("readonly",this.owner.readonly)}}x(qa);
|
|
4795
4795
|
/**
|
|
4796
4796
|
* @license
|
|
4797
4797
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -4815,7 +4815,7 @@ class Ua extends(Na(ja(Gt(hs)))){static get is(){return"vaadin-multi-select-comb
|
|
|
4815
4815
|
no-vertical-overlap
|
|
4816
4816
|
restore-focus-node="[[inputElement]]"
|
|
4817
4817
|
></vaadin-multi-select-combo-box-overlay>
|
|
4818
|
-
`}static get properties(){return{filteredItems:{type:Array,notify:!0},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,notify:!0},size:{type:Number,notify:!0},selectedItems:{type:Array,value:()=>[]},selectedItemsOnTop:{type:Boolean,value:!1},lastFilter:{type:String,notify:!0},topGroup:{type:Array,observer:"_topGroupChanged"},_target:{type:Object}}}static get observers(){return["_readonlyChanged(readonly)"]}get clearElement(){return this.querySelector('[part="clear-button"]')}get _tagNamePrefix(){return"vaadin-multi-select-combo-box"}constructor(){super(),this.addEventListener("custom-value-set",this.__onCustomValueSet.bind(this))}open(){!this.disabled&&(!this.readonly||0!==this.selectedItems.length)&&(this.opened=!0)}ready(){super.ready(),this._target=this,this._toggleElement=this.querySelector(".toggle-button")}_readonlyChanged(){this._setDropdownItems(this.filteredItems)}_setDropdownItems(t){if(this.readonly)super._setDropdownItems(this.selectedItems);else if(!this.filter&&this.selectedItemsOnTop)if(t&&t.length&&this.topGroup&&this.topGroup.length){const e=t.filter((t=>-1===this._comboBox._findIndex(t,this.topGroup,this.itemIdPath)));super._setDropdownItems(this.topGroup.concat(e))}else super._setDropdownItems(t);else super._setDropdownItems(t)}_topGroupChanged(t){t&&this._setDropdownItems(this.filteredItems)}_initScroller(){const t=this.getRootNode().host;this._comboBox=t,super._initScroller(t)}_onEnter(t){if(this.opened){if(t.preventDefault(),t.stopPropagation(),this.readonly)this.close();else if(this._hasValidInputValue()){const t=this._dropdownItems[this._focusedIndex];this._commitValue(),this._focusedIndex=this._dropdownItems.indexOf(t)}}else super._onEnter(t)}_onEscape(t){if(this.readonly)return t.stopPropagation(),void(this.opened&&this.close());super._onEscape(t)}_clearFilter(){(!this.keepFilter||!this.opened)&&super._clearFilter()}_revertInputValueToValue(){super._revertInputValueToValue(),this.filter=""}_commitValue(){this.lastFilter=this.filter,super._commitValue()}_onArrowDown(){this.readonly?this.opened||this.open():super._onArrowDown()}_onArrowUp(){this.readonly?this.opened||this.open():super._onArrowUp()}_setFocused(t){t||(this._ignoreCommitValue=!0),super._setFocused(t),!t&&this.readonly&&!this._closeOnBlurIsPrevented&&this.close()}_onClosed(){this._ignoreCommitValue=!0,super._onClosed()}_detectAndDispatchChange(){if(this._ignoreCommitValue)return this._ignoreCommitValue=!1,this.clear(),void(this._inputElementValue="");super._detectAndDispatchChange()}_overlaySelectedItemChanged(t){t.stopPropagation(),!this.readonly&&(t.detail.item instanceof Aa||this.opened&&(this.lastFilter=this.filter,this.dispatchEvent(new CustomEvent("combo-box-item-selected",{detail:{item:t.detail.item}}))))}_shouldFetchData(){return!this.readonly&&super._shouldFetchData()}clearCache(){this.readonly||super.clearCache()}__onCustomValueSet(t){this._ignoreCommitValue&&t.stopImmediatePropagation()}}
|
|
4818
|
+
`}static get properties(){return{filteredItems:{type:Array,notify:!0},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,notify:!0},size:{type:Number,notify:!0},selectedItems:{type:Array,value:()=>[]},selectedItemsOnTop:{type:Boolean,value:!1},lastFilter:{type:String,notify:!0},topGroup:{type:Array,observer:"_topGroupChanged"},_target:{type:Object}}}static get observers(){return["_readonlyChanged(readonly)"]}get clearElement(){return this.querySelector('[part="clear-button"]')}get _tagNamePrefix(){return"vaadin-multi-select-combo-box"}constructor(){super(),this.addEventListener("custom-value-set",this.__onCustomValueSet.bind(this))}open(){!this.disabled&&(!this.readonly||0!==this.selectedItems.length)&&(this.opened=!0)}ready(){super.ready(),this._target=this,this._toggleElement=this.querySelector(".toggle-button")}_readonlyChanged(){this._setDropdownItems(this.filteredItems)}_setDropdownItems(t){if(this.readonly)super._setDropdownItems(this.selectedItems);else if(!this.filter&&this.selectedItemsOnTop)if(t&&t.length&&this.topGroup&&this.topGroup.length){const e=t.filter((t=>-1===this._comboBox._findIndex(t,this.topGroup,this.itemIdPath)));super._setDropdownItems(this.topGroup.concat(e))}else super._setDropdownItems(t);else super._setDropdownItems(t)}_topGroupChanged(t){t&&this._setDropdownItems(this.filteredItems)}_initScroller(){const t=this.getRootNode().host;this._comboBox=t,super._initScroller(t)}_onEnter(t){if(this.opened){if(t.preventDefault(),t.stopPropagation(),this.readonly)this.close();else if(this._hasValidInputValue()){const t=this._dropdownItems[this._focusedIndex];this._commitValue(),this._focusedIndex=this._dropdownItems.indexOf(t)}}else super._onEnter(t)}_onEscape(t){if(this.readonly)return t.stopPropagation(),void(this.opened&&this.close());super._onEscape(t)}_clearFilter(){(!this.keepFilter||!this.opened)&&super._clearFilter()}_revertInputValueToValue(){super._revertInputValueToValue(),this.filter=""}_commitValue(){this.lastFilter=this.filter,super._commitValue()}_onArrowDown(){this.readonly?this.opened||this.open():super._onArrowDown()}_onArrowUp(){this.readonly?this.opened||this.open():super._onArrowUp()}_setFocused(t){t||(this._ignoreCommitValue=!0),super._setFocused(t),!t&&this.readonly&&!this._closeOnBlurIsPrevented&&this.close()}_onClosed(){this._ignoreCommitValue=!0,super._onClosed()}_detectAndDispatchChange(){if(this._ignoreCommitValue)return this._ignoreCommitValue=!1,this.clear(),void(this._inputElementValue="");super._detectAndDispatchChange()}_overlaySelectedItemChanged(t){t.stopPropagation(),!this.readonly&&(t.detail.item instanceof Aa||this.opened&&(this.lastFilter=this.filter,this.dispatchEvent(new CustomEvent("combo-box-item-selected",{detail:{item:t.detail.item}}))))}_shouldFetchData(){return!this.readonly&&super._shouldFetchData()}clearCache(){this.readonly||super.clearCache()}__onCustomValueSet(t){this._ignoreCommitValue&&t.stopImmediatePropagation()}}x(Ua);
|
|
4819
4819
|
/**
|
|
4820
4820
|
* @license
|
|
4821
4821
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -4826,7 +4826,7 @@ const Ha=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.resiza
|
|
|
4826
4826
|
* @license
|
|
4827
4827
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4828
4828
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4829
|
-
|
|
4829
|
+
*/Vt("vaadin-multi-select-combo-box",[Kn,T`
|
|
4830
4830
|
:host {
|
|
4831
4831
|
--input-min-width: var(--vaadin-multi-select-combo-box-input-min-width, 4em);
|
|
4832
4832
|
--_chip-min-width: var(--vaadin-multi-select-combo-box-chip-min-width, 50px);
|
|
@@ -4935,7 +4935,7 @@ const Ha=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.resiza
|
|
|
4935
4935
|
</div>
|
|
4936
4936
|
|
|
4937
4937
|
<slot name="tooltip"></slot>
|
|
4938
|
-
`}static get properties(){return{autoExpandHorizontally:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandHorizontallyChanged"},autoExpandVertically:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandVerticallyChanged"},autoOpenDisabled:Boolean,clearButtonVisible:{type:Boolean,reflectToAttribute:!0,observer:"_clearButtonVisibleChanged",value:!1},items:{type:Array},itemClassNameGenerator:{type:Object,observer:"__itemClassNameGeneratorChanged"},itemLabelPath:{type:String,value:"label"},itemValuePath:{type:String,value:"value"},itemIdPath:{type:String},i18n:{type:Object,value:()=>({cleared:"Selection cleared",focused:"focused. Press Backspace to remove",selected:"added to selection",deselected:"removed from selection",total:"{count} items selected"})},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,value:!1,reflectToAttribute:!0},overlayClass:{type:String},readonly:{type:Boolean,value:!1,observer:"_readonlyChanged",reflectToAttribute:!0},selectedItems:{type:Array,value:()=>[],notify:!0},opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},size:{type:Number},pageSize:{type:Number,value:50,observer:"_pageSizeChanged"},dataProvider:{type:Object},allowCustomValue:{type:Boolean,value:!1},placeholder:{type:String,observer:"_placeholderChanged"},renderer:Function,filter:{type:String,value:"",notify:!0},filteredItems:Array,selectedItemsOnTop:{type:Boolean,value:!1},value:{type:String},_overflowItems:{type:Array,value:()=>[]},_focusedChipIndex:{type:Number,value:-1,observer:"_focusedChipIndexChanged"},_lastFilter:{type:String},_topGroup:{type:Array}}}static get observers(){return["_selectedItemsChanged(selectedItems, selectedItems.*)","__updateOverflowChip(_overflow, _overflowItems, disabled, readonly)","__updateTopGroup(selectedItemsOnTop, selectedItems, opened)"]}get slotStyles(){return[...super.slotStyles,`\n ${this.localName}[has-value] input::placeholder {\n color: transparent !important;\n forced-color-adjust: none;\n }\n `]}get clearElement(){return this.$.clearButton}get _chips(){return[...this.querySelectorAll('[slot="chip"]')]}get _hasValue(){return this.selectedItems&&this.selectedItems.length>0}ready(){super.ready(),this.addController(new or(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new rr(this.inputElement,this._labelController)),this._tooltipController=new $s(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._inputField=this.shadowRoot.querySelector('[part="input-field"]'),this._overflowController=new Vs(this,"overflow","vaadin-multi-select-combo-box-chip",{initializer:t=>{t.addEventListener("mousedown",(t=>this._preventBlur(t))),this._overflow=t}}),this.addController(this._overflowController),this.__updateChips(),Ma(this)}checkValidity(){return!(this.required&&!this.readonly)||this._hasValue}clear(){this.__updateSelection([]),Ko(this.i18n.cleared)}clearCache(){this.$&&this.$.comboBox&&this.$.comboBox.clearCache()}requestContentUpdate(){this.$&&this.$.comboBox&&this.$.comboBox.requestContentUpdate()}_disabledChanged(t,e){super._disabledChanged(t,e),(t||e)&&this.__updateChips()}_inputElementChanged(t){super._inputElementChanged(t),t&&this.$.comboBox._setInputElement(t)}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&(this._focusedChipIndex=-1,this.validate())}_onResize(){this.__updateChips()}_delegateAttribute(t,e){if(this.stateTarget){if("required"===t)return void this._delegateAttribute("aria-required",!!e&&"true");super._delegateAttribute(t,e)}}_autoExpandHorizontallyChanged(t,e){(t||e)&&this.__updateChips()}_autoExpandVerticallyChanged(t,e){(t||e)&&this.__updateChips()}_clearButtonVisibleChanged(t,e){(t||e)&&this.__updateChips()}_onFilteredItemsChanged(t){const{value:e}=t.detail;(Array.isArray(e)||null==e)&&(this.filteredItems=e)}_readonlyChanged(t,e){(t||e)&&this.__updateChips(),this.dataProvider&&this.clearCache()}__itemClassNameGeneratorChanged(t,e){(t||e)&&this.__updateChips()}_pageSizeChanged(t,e){(Math.floor(t)!==t||t<=0)&&(this.pageSize=e,console.error('"pageSize" value must be an integer > 0')),this.$.comboBox.pageSize=this.pageSize}_placeholderChanged(t){const e=this.__tmpA11yPlaceholder;e!==t&&(this.__savedPlaceholder=t,e&&(this.placeholder=e))}_selectedItemsChanged(t){if(this._toggleHasValue(this._hasValue),this._hasValue){const e=this._mergeItemLabels(t);void 0===this.__tmpA11yPlaceholder&&(this.__savedPlaceholder=this.placeholder),this.__tmpA11yPlaceholder=e,this.placeholder=e}else void 0!==this.__tmpA11yPlaceholder&&(delete this.__tmpA11yPlaceholder,this.placeholder=this.__savedPlaceholder);this.__updateChips(),this.requestContentUpdate(),this.opened&&this.$.comboBox.$.overlay._updateOverlayWidth()}_getItemLabel(t){return this.$.comboBox._getItemLabel(t)}_mergeItemLabels(t){return t.map((t=>this._getItemLabel(t))).join(", ")}_findIndex(t,e,i){if(i&&t){for(let s=0;s<e.length;s++)if(e[s]&&e[s][i]===t[i])return s;return-1}return e.indexOf(t)}__clearInternalValue(t=!1){!this.keepFilter||t?(this.filter="",this.$.comboBox.clear()):(this.$.comboBox.clear(),this._inputElementValue=this.filter)}__announceItem(t,e,i){const s=e?"selected":"deselected",o=this.i18n.total.replace("{count}",i||0);Ko(`${t} ${this.i18n[s]} ${o}`)}__removeItem(t){const e=[...this.selectedItems];e.splice(e.indexOf(t),1),this.__updateSelection(e);const i=this._getItemLabel(t);this.__announceItem(i,!1,e.length)}__selectItem(t){const e=[...this.selectedItems],i=this._findIndex(t,e,this.itemIdPath),s=this._getItemLabel(t);let o=!1;if(-1!==i){const t=this._lastFilter;if(t&&t.toLowerCase()===s.toLowerCase())return void this.__clearInternalValue();e.splice(i,1)}else e.push(t),o=!0;this.__updateSelection(e),this.__clearInternalValue(),this.__announceItem(s,o,e.length)}__updateSelection(t){this.selectedItems=t,this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}__updateTopGroup(t,e,i){t?i||(this._topGroup=[...e]):this._topGroup=[]}__createChip(t){const e=document.createElement("vaadin-multi-select-combo-box-chip");e.setAttribute("slot","chip"),e.item=t,e.disabled=this.disabled,e.readonly=this.readonly;const i=this._getItemLabel(t);return e.label=i,e.setAttribute("title",i),"function"==typeof this.itemClassNameGenerator&&(e.className=this.itemClassNameGenerator(t)),e.addEventListener("item-removed",(t=>this._onItemRemoved(t))),e.addEventListener("mousedown",(t=>this._preventBlur(t))),e}__getOverflowWidth(){const t=this._overflow;t.style.visibility="hidden",t.removeAttribute("hidden");const e=t.getAttribute("count");t.setAttribute("count","99");const i=getComputedStyle(t),s=t.clientWidth+parseInt(i.marginInlineStart);return t.setAttribute("count",e),t.setAttribute("hidden",""),t.style.visibility="",s}__updateChips(){if(!this._inputField||!this.inputElement)return;this._chips.forEach((t=>{t.remove()}));const t=[...this.selectedItems],e=this._inputField.$.wrapper.clientWidth,i=parseInt(getComputedStyle(this.inputElement).flexBasis);let s=e-i;t.length>1&&(s-=this.__getOverflowWidth());const o=parseInt(getComputedStyle(this).getPropertyValue("--_chip-min-width"));if(this.autoExpandHorizontally){const e=[];for(let i=t.length-1,s=null;i>=0;i--){const o=this.__createChip(t[i]);this.insertBefore(o,s),s=o,e.unshift(o)}const r=[];if(!this.autoExpandVertically&&this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth<i){for(;e.length>1;){e.pop().remove(),r.unshift(t.pop());const s=r.length>0?i+this.__getOverflowWidth():i;if(this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth>=s)break}1===e.length&&(e[0].style.maxWidth=`${Math.max(o,s)}px`)}this._overflowItems=r}else{for(let e=t.length-1,i=null;e>=0;e--){const r=this.__createChip(t[e]);if(this.insertBefore(r,i),!this.autoExpandVertically&&this.$.chips.clientWidth>s){if(null!==i){r.remove();break}r.style.maxWidth=`${Math.max(o,s)}px`}t.pop(),i=r}this._overflowItems=t}}__updateOverflowChip(t,e,i,s){if(t){const o=e.length;t.label=`${o}`,t.setAttribute("count",`${o}`),t.setAttribute("title",this._mergeItemLabels(e)),t.toggleAttribute("hidden",0===o),t.disabled=i,t.readonly=s}}_onClearButtonTouchend(t){t.preventDefault(),t.stopPropagation(),this.clear()}_onClearButtonClick(t){t.stopPropagation(),this.clear()}_onChange(t){t.stopPropagation()}_onEscape(t){this.clearButtonVisible&&this.selectedItems&&this.selectedItems.length&&(t.stopPropagation(),this.selectedItems=[])}_onKeyDown(t){super._onKeyDown(t);const e=this._chips;if(!this.readonly&&e.length>0)switch(t.key){case"Backspace":this._onBackSpace(e);break;case"ArrowLeft":this._onArrowLeft(e,t);break;case"ArrowRight":this._onArrowRight(e,t);break;default:this._focusedChipIndex=-1}}_onArrowLeft(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let s;-1!==i&&e.preventDefault(),this.__isRTL?i===t.length-1?s=-1:i>-1&&(s=i+1):-1===i?s=t.length-1:i>0&&(s=i-1),void 0!==s&&(this._focusedChipIndex=s)}_onArrowRight(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let s;-1!==i&&e.preventDefault(),this.__isRTL?-1===i?s=t.length-1:i>0&&(s=i-1):i===t.length-1?s=-1:i>-1&&(s=i+1),void 0!==s&&(this._focusedChipIndex=s)}_onBackSpace(t){if(0!==this.inputElement.selectionStart)return;const e=this._focusedChipIndex;-1===e?this._focusedChipIndex=t.length-1:(this.__removeItem(t[e].item),this._focusedChipIndex=-1)}_focusedChipIndexChanged(t,e){if(t>-1||e>-1){const e=this._chips;e.forEach(((e,i)=>{e.toggleAttribute("focused",i===t)})),t>-1&&Ko(`${this._getItemLabel(e[t].item)} ${this.i18n.focused}`)}}_onComboBoxChange(){const t=this.$.comboBox.selectedItem;t&&this.__selectItem(t)}_onComboBoxItemSelected(t){this.__selectItem(t.detail.item)}_onCustomValueSet(t){t.preventDefault(),t.stopPropagation(),this.__clearInternalValue(!0),this.dispatchEvent(new CustomEvent("custom-value-set",{detail:t.detail,composed:!0,bubbles:!0}))}_onItemRemoved(t){this.__removeItem(t.detail.item)}_preventBlur(t){t.preventDefault()}}_(Ya),$t("vaadin-notification-card",T`
|
|
4938
|
+
`}static get properties(){return{autoExpandHorizontally:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandHorizontallyChanged"},autoExpandVertically:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandVerticallyChanged"},autoOpenDisabled:Boolean,clearButtonVisible:{type:Boolean,reflectToAttribute:!0,observer:"_clearButtonVisibleChanged",value:!1},items:{type:Array},itemClassNameGenerator:{type:Object,observer:"__itemClassNameGeneratorChanged"},itemLabelPath:{type:String,value:"label"},itemValuePath:{type:String,value:"value"},itemIdPath:{type:String},i18n:{type:Object,value:()=>({cleared:"Selection cleared",focused:"focused. Press Backspace to remove",selected:"added to selection",deselected:"removed from selection",total:"{count} items selected"})},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,value:!1,reflectToAttribute:!0},overlayClass:{type:String},readonly:{type:Boolean,value:!1,observer:"_readonlyChanged",reflectToAttribute:!0},selectedItems:{type:Array,value:()=>[],notify:!0},opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},size:{type:Number},pageSize:{type:Number,value:50,observer:"_pageSizeChanged"},dataProvider:{type:Object},allowCustomValue:{type:Boolean,value:!1},placeholder:{type:String,observer:"_placeholderChanged"},renderer:Function,filter:{type:String,value:"",notify:!0},filteredItems:Array,selectedItemsOnTop:{type:Boolean,value:!1},value:{type:String},_overflowItems:{type:Array,value:()=>[]},_focusedChipIndex:{type:Number,value:-1,observer:"_focusedChipIndexChanged"},_lastFilter:{type:String},_topGroup:{type:Array}}}static get observers(){return["_selectedItemsChanged(selectedItems, selectedItems.*)","__updateOverflowChip(_overflow, _overflowItems, disabled, readonly)","__updateTopGroup(selectedItemsOnTop, selectedItems, opened)"]}get slotStyles(){return[...super.slotStyles,`\n ${this.localName}[has-value] input::placeholder {\n color: transparent !important;\n forced-color-adjust: none;\n }\n `]}get clearElement(){return this.$.clearButton}get _chips(){return[...this.querySelectorAll('[slot="chip"]')]}get _hasValue(){return this.selectedItems&&this.selectedItems.length>0}ready(){super.ready(),this.addController(new or(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new rr(this.inputElement,this._labelController)),this._tooltipController=new Vs(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._inputField=this.shadowRoot.querySelector('[part="input-field"]'),this._overflowController=new $s(this,"overflow","vaadin-multi-select-combo-box-chip",{initializer:t=>{t.addEventListener("mousedown",(t=>this._preventBlur(t))),this._overflow=t}}),this.addController(this._overflowController),this.__updateChips(),Ma(this)}checkValidity(){return!(this.required&&!this.readonly)||this._hasValue}clear(){this.__updateSelection([]),Ko(this.i18n.cleared)}clearCache(){this.$&&this.$.comboBox&&this.$.comboBox.clearCache()}requestContentUpdate(){this.$&&this.$.comboBox&&this.$.comboBox.requestContentUpdate()}_disabledChanged(t,e){super._disabledChanged(t,e),(t||e)&&this.__updateChips()}_inputElementChanged(t){super._inputElementChanged(t),t&&this.$.comboBox._setInputElement(t)}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&(this._focusedChipIndex=-1,this.validate())}_onResize(){this.__updateChips()}_delegateAttribute(t,e){if(this.stateTarget){if("required"===t)return void this._delegateAttribute("aria-required",!!e&&"true");super._delegateAttribute(t,e)}}_autoExpandHorizontallyChanged(t,e){(t||e)&&this.__updateChips()}_autoExpandVerticallyChanged(t,e){(t||e)&&this.__updateChips()}_clearButtonVisibleChanged(t,e){(t||e)&&this.__updateChips()}_onFilteredItemsChanged(t){const{value:e}=t.detail;(Array.isArray(e)||null==e)&&(this.filteredItems=e)}_readonlyChanged(t,e){(t||e)&&this.__updateChips(),this.dataProvider&&this.clearCache()}__itemClassNameGeneratorChanged(t,e){(t||e)&&this.__updateChips()}_pageSizeChanged(t,e){(Math.floor(t)!==t||t<=0)&&(this.pageSize=e,console.error('"pageSize" value must be an integer > 0')),this.$.comboBox.pageSize=this.pageSize}_placeholderChanged(t){const e=this.__tmpA11yPlaceholder;e!==t&&(this.__savedPlaceholder=t,e&&(this.placeholder=e))}_selectedItemsChanged(t){if(this._toggleHasValue(this._hasValue),this._hasValue){const e=this._mergeItemLabels(t);void 0===this.__tmpA11yPlaceholder&&(this.__savedPlaceholder=this.placeholder),this.__tmpA11yPlaceholder=e,this.placeholder=e}else void 0!==this.__tmpA11yPlaceholder&&(delete this.__tmpA11yPlaceholder,this.placeholder=this.__savedPlaceholder);this.__updateChips(),this.requestContentUpdate(),this.opened&&this.$.comboBox.$.overlay._updateOverlayWidth()}_getItemLabel(t){return this.$.comboBox._getItemLabel(t)}_mergeItemLabels(t){return t.map((t=>this._getItemLabel(t))).join(", ")}_findIndex(t,e,i){if(i&&t){for(let s=0;s<e.length;s++)if(e[s]&&e[s][i]===t[i])return s;return-1}return e.indexOf(t)}__clearInternalValue(t=!1){!this.keepFilter||t?(this.filter="",this.$.comboBox.clear()):(this.$.comboBox.clear(),this._inputElementValue=this.filter)}__announceItem(t,e,i){const s=e?"selected":"deselected",o=this.i18n.total.replace("{count}",i||0);Ko(`${t} ${this.i18n[s]} ${o}`)}__removeItem(t){const e=[...this.selectedItems];e.splice(e.indexOf(t),1),this.__updateSelection(e);const i=this._getItemLabel(t);this.__announceItem(i,!1,e.length)}__selectItem(t){const e=[...this.selectedItems],i=this._findIndex(t,e,this.itemIdPath),s=this._getItemLabel(t);let o=!1;if(-1!==i){const t=this._lastFilter;if(t&&t.toLowerCase()===s.toLowerCase())return void this.__clearInternalValue();e.splice(i,1)}else e.push(t),o=!0;this.__updateSelection(e),this.__clearInternalValue(),this.__announceItem(s,o,e.length)}__updateSelection(t){this.selectedItems=t,this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}__updateTopGroup(t,e,i){t?i||(this._topGroup=[...e]):this._topGroup=[]}__createChip(t){const e=document.createElement("vaadin-multi-select-combo-box-chip");e.setAttribute("slot","chip"),e.item=t,e.disabled=this.disabled,e.readonly=this.readonly;const i=this._getItemLabel(t);return e.label=i,e.setAttribute("title",i),"function"==typeof this.itemClassNameGenerator&&(e.className=this.itemClassNameGenerator(t)),e.addEventListener("item-removed",(t=>this._onItemRemoved(t))),e.addEventListener("mousedown",(t=>this._preventBlur(t))),e}__getOverflowWidth(){const t=this._overflow;t.style.visibility="hidden",t.removeAttribute("hidden");const e=t.getAttribute("count");t.setAttribute("count","99");const i=getComputedStyle(t),s=t.clientWidth+parseInt(i.marginInlineStart);return t.setAttribute("count",e),t.setAttribute("hidden",""),t.style.visibility="",s}__updateChips(){if(!this._inputField||!this.inputElement)return;this._chips.forEach((t=>{t.remove()}));const t=[...this.selectedItems],e=this._inputField.$.wrapper.clientWidth,i=parseInt(getComputedStyle(this.inputElement).flexBasis);let s=e-i;t.length>1&&(s-=this.__getOverflowWidth());const o=parseInt(getComputedStyle(this).getPropertyValue("--_chip-min-width"));if(this.autoExpandHorizontally){const e=[];for(let i=t.length-1,s=null;i>=0;i--){const o=this.__createChip(t[i]);this.insertBefore(o,s),s=o,e.unshift(o)}const r=[];if(!this.autoExpandVertically&&this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth<i){for(;e.length>1;){e.pop().remove(),r.unshift(t.pop());const s=r.length>0?i+this.__getOverflowWidth():i;if(this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth>=s)break}1===e.length&&(e[0].style.maxWidth=`${Math.max(o,s)}px`)}this._overflowItems=r}else{for(let e=t.length-1,i=null;e>=0;e--){const r=this.__createChip(t[e]);if(this.insertBefore(r,i),!this.autoExpandVertically&&this.$.chips.clientWidth>s){if(null!==i){r.remove();break}r.style.maxWidth=`${Math.max(o,s)}px`}t.pop(),i=r}this._overflowItems=t}}__updateOverflowChip(t,e,i,s){if(t){const o=e.length;t.label=`${o}`,t.setAttribute("count",`${o}`),t.setAttribute("title",this._mergeItemLabels(e)),t.toggleAttribute("hidden",0===o),t.disabled=i,t.readonly=s}}_onClearButtonTouchend(t){t.preventDefault(),t.stopPropagation(),this.clear()}_onClearButtonClick(t){t.stopPropagation(),this.clear()}_onChange(t){t.stopPropagation()}_onEscape(t){this.clearButtonVisible&&this.selectedItems&&this.selectedItems.length&&(t.stopPropagation(),this.selectedItems=[])}_onKeyDown(t){super._onKeyDown(t);const e=this._chips;if(!this.readonly&&e.length>0)switch(t.key){case"Backspace":this._onBackSpace(e);break;case"ArrowLeft":this._onArrowLeft(e,t);break;case"ArrowRight":this._onArrowRight(e,t);break;default:this._focusedChipIndex=-1}}_onArrowLeft(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let s;-1!==i&&e.preventDefault(),this.__isRTL?i===t.length-1?s=-1:i>-1&&(s=i+1):-1===i?s=t.length-1:i>0&&(s=i-1),void 0!==s&&(this._focusedChipIndex=s)}_onArrowRight(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let s;-1!==i&&e.preventDefault(),this.__isRTL?-1===i?s=t.length-1:i>0&&(s=i-1):i===t.length-1?s=-1:i>-1&&(s=i+1),void 0!==s&&(this._focusedChipIndex=s)}_onBackSpace(t){if(0!==this.inputElement.selectionStart)return;const e=this._focusedChipIndex;-1===e?this._focusedChipIndex=t.length-1:(this.__removeItem(t[e].item),this._focusedChipIndex=-1)}_focusedChipIndexChanged(t,e){if(t>-1||e>-1){const e=this._chips;e.forEach(((e,i)=>{e.toggleAttribute("focused",i===t)})),t>-1&&Ko(`${this._getItemLabel(e[t].item)} ${this.i18n.focused}`)}}_onComboBoxChange(){const t=this.$.comboBox.selectedItem;t&&this.__selectItem(t)}_onComboBoxItemSelected(t){this.__selectItem(t.detail.item)}_onCustomValueSet(t){t.preventDefault(),t.stopPropagation(),this.__clearInternalValue(!0),this.dispatchEvent(new CustomEvent("custom-value-set",{detail:t.detail,composed:!0,bubbles:!0}))}_onItemRemoved(t){this.__removeItem(t.detail.item)}_preventBlur(t){t.preventDefault()}}x(Ya),Vt("vaadin-notification-card",T`
|
|
4939
4939
|
:host {
|
|
4940
4940
|
position: relative;
|
|
4941
4941
|
margin: var(--lumo-space-s);
|
|
@@ -5251,7 +5251,7 @@ class Ja extends(Hr(Gt(Ps(hs)))){static get template(){return as`
|
|
|
5251
5251
|
}
|
|
5252
5252
|
</style>
|
|
5253
5253
|
<vaadin-notification-card theme$="[[_theme]]"> </vaadin-notification-card>
|
|
5254
|
-
`}static get is(){return"vaadin-notification"}static get properties(){return{duration:{type:Number,value:5e3},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},position:{type:String,value:"bottom-start",observer:"_positionChanged"},renderer:Function}}static get observers(){return["_durationChanged(duration, opened)","_rendererChanged(renderer, opened, _overlayElement)"]}static show(t,e){return Za._createAndShowNotification(void 0!==(null==(i=t)?void 0:i._$litType$)?e=>{zt(t,e)}:e=>{e.innerText=t},e);var i}static _createAndShowNotification(t,e){const i=document.createElement(Za.is);return e&&Number.isFinite(e.duration)&&(i.duration=e.duration),e&&e.position&&(i.position=e.position),e&&e.theme&&i.setAttribute("theme",e.theme),i.renderer=t,document.body.appendChild(i),i.opened=!0,i.addEventListener("opened-changed",(t=>{t.detail.value||i.remove()})),i}get _container(){return Za._container||(Za._container=document.createElement("vaadin-notification-container"),document.body.appendChild(Za._container)),Za._container}get _card(){return this._overlayElement}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-notification-card"),Ma(this)}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask((()=>{this.isConnected||(this.opened=!1)}))}requestContentUpdate(){this.renderer&&this.renderer(this._card,this)}_rendererChanged(t,e,i){if(!i)return;const s=this._oldRenderer!==t;this._oldRenderer=t,s&&(i.innerHTML="",delete i._$litPart$),e&&(this._didAnimateNotificationAppend||this._animatedAppendNotificationCard(),this.requestContentUpdate())}open(){this.opened=!0}close(){this.opened=!1}_openedChanged(t){t?(this._container.opened=!0,this._animatedAppendNotificationCard()):this._card&&this._closeNotificationCard()}__cleanUpOpeningClosingState(){this._card.removeAttribute("opening"),this._card.removeAttribute("closing"),this._card.removeEventListener("animationend",this.__animationEndListener)}_animatedAppendNotificationCard(){this._card?(this.__cleanUpOpeningClosingState(),this._card.setAttribute("opening",""),this._appendNotificationCard(),this.__animationEndListener=()=>this.__cleanUpOpeningClosingState(),this._card.addEventListener("animationend",this.__animationEndListener),this._didAnimateNotificationAppend=!0):this._didAnimateNotificationAppend=!1}_appendNotificationCard(){if(this._card){if(!this._container.shadowRoot.querySelector(`slot[name="${this.position}"]`))return void console.warn(`Invalid alignment parameter provided: position=${this.position}`);this._container.bringToFront(),this._card.slot=this.position,this._container.firstElementChild&&/top/u.test(this.position)?this._container.insertBefore(this._card,this._container.firstElementChild):this._container.appendChild(this._card)}}_removeNotificationCard(){this._card.parentNode&&this._card.parentNode.removeChild(this._card),this._card.removeAttribute("closing"),this._container.opened=!!this._container.firstElementChild,this.dispatchEvent(new CustomEvent("closed"))}_closeNotificationCard(){this._durationTimeoutId&&clearTimeout(this._durationTimeoutId),this._animatedRemoveNotificationCard()}_animatedRemoveNotificationCard(){this.__cleanUpOpeningClosingState(),this._card.setAttribute("closing","");const t=getComputedStyle(this._card).getPropertyValue("animation-name");t&&"none"!==t?(this.__animationEndListener=()=>{this._removeNotificationCard(),this.__cleanUpOpeningClosingState()},this._card.addEventListener("animationend",this.__animationEndListener)):this._removeNotificationCard()}_positionChanged(){this.opened&&this._animatedAppendNotificationCard()}_durationChanged(t,e){e&&(clearTimeout(this._durationTimeoutId),t>0&&(this._durationTimeoutId=setTimeout((()=>this.close()),t)))}}
|
|
5254
|
+
`}static get is(){return"vaadin-notification"}static get properties(){return{duration:{type:Number,value:5e3},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},position:{type:String,value:"bottom-start",observer:"_positionChanged"},renderer:Function}}static get observers(){return["_durationChanged(duration, opened)","_rendererChanged(renderer, opened, _overlayElement)"]}static show(t,e){return Za._createAndShowNotification(void 0!==(null==(i=t)?void 0:i._$litType$)?e=>{zt(t,e)}:e=>{e.innerText=t},e);var i}static _createAndShowNotification(t,e){const i=document.createElement(Za.is);return e&&Number.isFinite(e.duration)&&(i.duration=e.duration),e&&e.position&&(i.position=e.position),e&&e.theme&&i.setAttribute("theme",e.theme),i.renderer=t,document.body.appendChild(i),i.opened=!0,i.addEventListener("opened-changed",(t=>{t.detail.value||i.remove()})),i}get _container(){return Za._container||(Za._container=document.createElement("vaadin-notification-container"),document.body.appendChild(Za._container)),Za._container}get _card(){return this._overlayElement}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-notification-card"),Ma(this)}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask((()=>{this.isConnected||(this.opened=!1)}))}requestContentUpdate(){this.renderer&&this.renderer(this._card,this)}_rendererChanged(t,e,i){if(!i)return;const s=this._oldRenderer!==t;this._oldRenderer=t,s&&(i.innerHTML="",delete i._$litPart$),e&&(this._didAnimateNotificationAppend||this._animatedAppendNotificationCard(),this.requestContentUpdate())}open(){this.opened=!0}close(){this.opened=!1}_openedChanged(t){t?(this._container.opened=!0,this._animatedAppendNotificationCard()):this._card&&this._closeNotificationCard()}__cleanUpOpeningClosingState(){this._card.removeAttribute("opening"),this._card.removeAttribute("closing"),this._card.removeEventListener("animationend",this.__animationEndListener)}_animatedAppendNotificationCard(){this._card?(this.__cleanUpOpeningClosingState(),this._card.setAttribute("opening",""),this._appendNotificationCard(),this.__animationEndListener=()=>this.__cleanUpOpeningClosingState(),this._card.addEventListener("animationend",this.__animationEndListener),this._didAnimateNotificationAppend=!0):this._didAnimateNotificationAppend=!1}_appendNotificationCard(){if(this._card){if(!this._container.shadowRoot.querySelector(`slot[name="${this.position}"]`))return void console.warn(`Invalid alignment parameter provided: position=${this.position}`);this._container.bringToFront(),this._card.slot=this.position,this._container.firstElementChild&&/top/u.test(this.position)?this._container.insertBefore(this._card,this._container.firstElementChild):this._container.appendChild(this._card)}}_removeNotificationCard(){this._card.parentNode&&this._card.parentNode.removeChild(this._card),this._card.removeAttribute("closing"),this._container.opened=!!this._container.firstElementChild,this.dispatchEvent(new CustomEvent("closed"))}_closeNotificationCard(){this._durationTimeoutId&&clearTimeout(this._durationTimeoutId),this._animatedRemoveNotificationCard()}_animatedRemoveNotificationCard(){this.__cleanUpOpeningClosingState(),this._card.setAttribute("closing","");const t=getComputedStyle(this._card).getPropertyValue("animation-name");t&&"none"!==t?(this.__animationEndListener=()=>{this._removeNotificationCard(),this.__cleanUpOpeningClosingState()},this._card.addEventListener("animationend",this.__animationEndListener)):this._removeNotificationCard()}_positionChanged(){this.opened&&this._animatedAppendNotificationCard()}_durationChanged(t,e){e&&(clearTimeout(this._durationTimeoutId),t>0&&(this._durationTimeoutId=setTimeout((()=>this.close()),t)))}}x(Ja),x(Ka),x(Za);const Qa=T`
|
|
5255
5255
|
:host {
|
|
5256
5256
|
-webkit-tap-highlight-color: transparent;
|
|
5257
5257
|
--_lumo-item-selected-icon-display: var(--_lumo-list-box-item-selected-icon-display, block);
|
|
@@ -5265,13 +5265,13 @@ class Ja extends(Hr(Gt(Ps(hs)))){static get template(){return as`
|
|
|
5265
5265
|
margin: var(--lumo-space-s) var(--lumo-border-radius-m);
|
|
5266
5266
|
background-color: var(--lumo-contrast-10pct);
|
|
5267
5267
|
}
|
|
5268
|
-
|
|
5268
|
+
`;Vt("vaadin-list-box",Qa,{moduleId:"lumo-list-box"}),
|
|
5269
5269
|
/**
|
|
5270
5270
|
* @license
|
|
5271
5271
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5272
5272
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5273
5273
|
*/
|
|
5274
|
-
|
|
5274
|
+
Vt("vaadin-select-item",ha,{moduleId:"lumo-select-item"}),Vt("vaadin-select-list-box",Qa,{moduleId:"lumo-select-list-box"}),Vt("vaadin-select",[br,T`
|
|
5275
5275
|
:host(:not([theme*='align'])) ::slotted([slot='value']) {
|
|
5276
5276
|
text-align: start;
|
|
5277
5277
|
}
|
|
@@ -5314,7 +5314,7 @@ $t("vaadin-select-item",ha,{moduleId:"lumo-select-item"}),$t("vaadin-select-list
|
|
|
5314
5314
|
--_lumo-selected-item-height: var(--lumo-size-s);
|
|
5315
5315
|
--_lumo-selected-item-padding: 0;
|
|
5316
5316
|
}
|
|
5317
|
-
`],{moduleId:"lumo-select"})
|
|
5317
|
+
`],{moduleId:"lumo-select"}),Vt("vaadin-select-value-button",T`
|
|
5318
5318
|
:host {
|
|
5319
5319
|
font-family: var(--lumo-font-family);
|
|
5320
5320
|
font-size: var(--vaadin-input-field-value-font-size, var(--lumo-font-size-m));
|
|
@@ -5333,7 +5333,7 @@ $t("vaadin-select-item",ha,{moduleId:"lumo-select-item"}),$t("vaadin-select-list
|
|
|
5333
5333
|
::slotted(*:hover) {
|
|
5334
5334
|
background-color: transparent;
|
|
5335
5335
|
}
|
|
5336
|
-
`,{moduleId:"lumo-select-value-button"})
|
|
5336
|
+
`,{moduleId:"lumo-select-value-button"}),Vt("vaadin-select-overlay",[mr,T`
|
|
5337
5337
|
:host {
|
|
5338
5338
|
--_lumo-item-selected-icon-display: block;
|
|
5339
5339
|
}
|
|
@@ -5394,7 +5394,7 @@ const Xa=t=>class extends(Co(Mo(t))){static get properties(){return{_hasVaadinIt
|
|
|
5394
5394
|
<div part="content">
|
|
5395
5395
|
<slot></slot>
|
|
5396
5396
|
</div>
|
|
5397
|
-
`}ready(){super.ready(),this.setAttribute("role","option")}}
|
|
5397
|
+
`}ready(){super.ready(),this.setAttribute("role","option")}}x(tl);
|
|
5398
5398
|
/**
|
|
5399
5399
|
* @license
|
|
5400
5400
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
@@ -5436,7 +5436,7 @@ function(t,e){const{scrollLeft:i}=t;return"rtl"!==e?i:t.scrollWidth-t.clientWidt
|
|
|
5436
5436
|
<div part="items">
|
|
5437
5437
|
<slot></slot>
|
|
5438
5438
|
</div>
|
|
5439
|
-
`}static get properties(){return{orientation:{readOnly:!0}}}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}ready(){super.ready(),this.setAttribute("role","listbox")}}
|
|
5439
|
+
`}static get properties(){return{orientation:{readOnly:!0}}}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}ready(){super.ready(),this.setAttribute("role","listbox")}}x(sl);
|
|
5440
5440
|
/**
|
|
5441
5441
|
* @license
|
|
5442
5442
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -5447,7 +5447,7 @@ const ol=t=>class extends(Zr(Gr(Ds(t)))){static get observers(){return["_updateO
|
|
|
5447
5447
|
* @license
|
|
5448
5448
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5449
5449
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5450
|
-
|
|
5450
|
+
*/;Vt("vaadin-select-overlay",[wr,T`
|
|
5451
5451
|
:host {
|
|
5452
5452
|
align-items: flex-start;
|
|
5453
5453
|
justify-content: flex-start;
|
|
@@ -5469,13 +5469,13 @@ const ol=t=>class extends(Zr(Gr(Ds(t)))){static get observers(){return["_updateO
|
|
|
5469
5469
|
<slot></slot>
|
|
5470
5470
|
</div>
|
|
5471
5471
|
</div>
|
|
5472
|
-
`}ready(){super.ready(),this.owner=this.__dataHost,this.owner._overlayElement=this}requestContentUpdate(){if(super.requestContentUpdate(),this.owner){const t=this._getMenuElement();this.owner._assignMenuElement(t)}}}
|
|
5472
|
+
`}ready(){super.ready(),this.owner=this.__dataHost,this.owner._overlayElement=this}requestContentUpdate(){if(super.requestContentUpdate(),this.owner){const t=this._getMenuElement();this.owner._assignMenuElement(t)}}}x(rl),
|
|
5473
5473
|
/**
|
|
5474
5474
|
* @license
|
|
5475
5475
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5476
5476
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5477
5477
|
*/
|
|
5478
|
-
|
|
5478
|
+
Vt("vaadin-select-value-button",T`
|
|
5479
5479
|
:host {
|
|
5480
5480
|
display: inline-block;
|
|
5481
5481
|
position: relative;
|
|
@@ -5523,7 +5523,7 @@ $t("vaadin-select-value-button",T`
|
|
|
5523
5523
|
<slot></slot>
|
|
5524
5524
|
</span>
|
|
5525
5525
|
</div>
|
|
5526
|
-
`}}
|
|
5526
|
+
`}}x(nl);
|
|
5527
5527
|
/**
|
|
5528
5528
|
* @license
|
|
5529
5529
|
* Copyright (c) 2021 - 2024 Vaadin Ltd..
|
|
@@ -5548,17 +5548,17 @@ const al=T`
|
|
|
5548
5548
|
* @license
|
|
5549
5549
|
* Copyright (c) 2023 - 2024 Vaadin Ltd.
|
|
5550
5550
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5551
|
-
*/;class ll extends
|
|
5551
|
+
*/;class ll extends $s{constructor(t){super(t,"value","vaadin-select-value-button",{initializer:(t,e)=>{e._setFocusElement(t),e.ariaTarget=t,e.stateTarget=t,t.setAttribute("aria-haspopup","listbox")}})}}
|
|
5552
5552
|
/**
|
|
5553
5553
|
* @license
|
|
5554
5554
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5555
5555
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5556
|
-
*/const hl=t=>class extends(Zn(Fo(jo(ko(sr(t)))))){static get properties(){return{items:{type:Array,observer:"__itemsChanged"},opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,sync:!0},renderer:{type:Object},value:{type:String,value:"",notify:!0,observer:"_valueChanged"},name:{type:String},placeholder:{type:String},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},noVerticalOverlap:{type:Boolean,value:!1},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},_inputContainer:Object,_items:Object}}static get delegateAttrs(){return[...super.delegateAttrs,"invalid"]}static get observers(){return["_updateAriaExpanded(opened, focusElement)","_updateSelectedItem(value, _items, placeholder)","_openedChanged(opened, _overlayElement, _inputContainer)"]}constructor(){super(),this._itemId=`value-${this.localName}-${Rs()}`,this._srLabelController=new tr(this),this._srLabelController.slotName="sr-label"}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}ready(){super.ready(),this._inputContainer=this.shadowRoot.querySelector('[part~="input-field"]'),this._valueButtonController=new ll(this),this.addController(this._valueButtonController),this.addController(this._srLabelController),this.addController(new Rn(this._phoneMediaQuery,(t=>{this._phone=t}))),this._tooltipController=new
|
|
5556
|
+
*/const hl=t=>class extends(Zn(Fo(jo(ko(sr(t)))))){static get properties(){return{items:{type:Array,observer:"__itemsChanged"},opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,sync:!0},renderer:{type:Object},value:{type:String,value:"",notify:!0,observer:"_valueChanged"},name:{type:String},placeholder:{type:String},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},noVerticalOverlap:{type:Boolean,value:!1},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},_inputContainer:Object,_items:Object}}static get delegateAttrs(){return[...super.delegateAttrs,"invalid"]}static get observers(){return["_updateAriaExpanded(opened, focusElement)","_updateSelectedItem(value, _items, placeholder)","_openedChanged(opened, _overlayElement, _inputContainer)"]}constructor(){super(),this._itemId=`value-${this.localName}-${Rs()}`,this._srLabelController=new tr(this),this._srLabelController.slotName="sr-label"}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}ready(){super.ready(),this._inputContainer=this.shadowRoot.querySelector('[part~="input-field"]'),this._valueButtonController=new ll(this),this.addController(this._valueButtonController),this.addController(this._srLabelController),this.addController(new Rn(this._phoneMediaQuery,(t=>{this._phone=t}))),this._tooltipController=new Vs(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.focusElement),this.addController(this._tooltipController)}requestContentUpdate(){this._overlayElement&&(this._overlayElement.requestContentUpdate(),this._menuElement&&this._menuElement.items&&this._updateSelectedItem(this.value,this._menuElement.items))}_requiredChanged(t){super._requiredChanged(t),!1===t&&this.validate()}__itemsChanged(t,e){(t||e)&&this.requestContentUpdate()}_assignMenuElement(t){t&&t!==this.__lastMenuElement&&(this._menuElement=t,this.__initMenuItems(t),t.addEventListener("items-changed",(()=>{this.__initMenuItems(t)})),t.addEventListener("selected-changed",(()=>this.__updateValueButton())),t.addEventListener("keydown",(t=>this._onKeyDownInside(t)),!0),t.addEventListener("click",(t=>{const e=t.composedPath().find((t=>t._hasVaadinItemMixin));this.__dispatchChangePending=!(!e||void 0===e.value||e.value===this.value),this.opened=!1}),!0),this.__lastMenuElement=t)}__initMenuItems(t){t.items&&(this._items=t.items)}_valueChanged(t,e){this.toggleAttribute("has-value",!!t),void 0!==e&&!this.__dispatchChangePending&&this.validate()}_onClick(t){this.disabled||(t.preventDefault(),this.opened=!this.readonly)}_onToggleMouseDown(t){t.preventDefault()}_onKeyDown(t){if(t.target===this.focusElement&&!this.readonly&&!this.disabled&&!this.opened)if(/^(Enter|SpaceBar|\s|ArrowDown|Down|ArrowUp|Up)$/u.test(t.key))t.preventDefault(),this.opened=!0;else if(/[\p{L}\p{Nd}]/u.test(t.key)&&1===t.key.length){const e=this._menuElement.selected,i=this._menuElement._searchKey(void 0!==e?e:-1,t.key);i>=0&&(this.__dispatchChangePending=!0,this._updateAriaLive(!0),this._menuElement.selected=i)}}_onKeyDownInside(t){/^(Tab)$/u.test(t.key)&&(this.opened=!1)}_openedChanged(t,e,i){if(e&&i){if(t){if(this.disabled||this.readonly)return void(this.opened=!1);this._updateAriaLive(!1),e.style.setProperty("--vaadin-select-text-field-width",`${i.offsetWidth}px`);const t=this.hasAttribute("focus-ring");this._openedWithFocusRing=t,t&&this.removeAttribute("focus-ring")}else this.__oldOpened&&(this._openedWithFocusRing&&this.setAttribute("focus-ring",""),!this.__dispatchChangePending&&!this._keyboardActive&&this.validate());this.__oldOpened=t}}_updateAriaExpanded(t,e){e&&e.setAttribute("aria-expanded",t?"true":"false")}_updateAriaLive(t){this.focusElement&&(t?this.focusElement.setAttribute("aria-live","polite"):this.focusElement.removeAttribute("aria-live"))}__attachSelectedItem(t){let e;const i=t.getAttribute("label");e=i?this.__createItemElement({label:i}):t.cloneNode(!0),e._sourceItem=t,this.__appendValueItemElement(e,this.focusElement),e.selected=!0}__createItemElement(t){const e=document.createElement(t.component||"vaadin-select-item");return t.label&&(e.textContent=t.label),t.value&&(e.value=t.value),t.disabled&&(e.disabled=t.disabled),t.className&&(e.className=t.className),e}__appendValueItemElement(t,e){e.appendChild(t),t.removeAttribute("tabindex"),t.removeAttribute("aria-selected"),t.removeAttribute("role"),t.removeAttribute("focused"),t.removeAttribute("focus-ring"),t.removeAttribute("active"),t.setAttribute("id",this._itemId)}_accessibleNameChanged(t){this._srLabelController.setLabel(t),this._setCustomAriaLabelledBy(t?this._srLabelController.defaultId:null)}_accessibleNameRefChanged(t){this._setCustomAriaLabelledBy(t)}_setCustomAriaLabelledBy(t){const e=this._getLabelIdWithItemId(t);this._fieldAriaController.setLabelId(e,!0)}_getLabelIdWithItemId(t){return t?`${t} ${this._items&&this._items[this._menuElement.selected]||this.placeholder?this._itemId:""}`.trim():null}__updateValueButton(){const t=this.focusElement;if(!t)return;t.innerHTML="";const e=this._items[this._menuElement.selected];if(t.removeAttribute("placeholder"),this._hasContent(e))this.__attachSelectedItem(e);else if(this.placeholder){const e=this.__createItemElement({label:this.placeholder});this.__appendValueItemElement(e,t),t.setAttribute("placeholder","")}!this._valueChanging&&e&&(this._selectedChanging=!0,this.value=e.value||"",this.__dispatchChangePending&&this.__dispatchChange(),delete this._selectedChanging),Uo(t,"aria-labelledby",e||this.placeholder?{newId:this._itemId}:{oldId:this._itemId}),(this.accessibleName||this.accessibleNameRef)&&this._setCustomAriaLabelledBy(this.accessibleNameRef||this._srLabelController.defaultId)}_hasContent(t){return!!t&&(!!(t.hasAttribute("label")?t.getAttribute("label"):t.textContent.trim())||t.childElementCount>0)}_updateSelectedItem(t,e){if(e){const i=null==t?t:t.toString();this._menuElement.selected=e.reduce(((t,e,s)=>void 0===t&&e.value===i?s:t),void 0),this._selectedChanging||(this._valueChanging=!0,this.__updateValueButton(),delete this._valueChanging)}}_shouldRemoveFocus(){return!this.opened}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}checkValidity(){return!this.required||this.readonly||!!this.value}__defaultRenderer(t,e){if(!this.items||0===this.items.length)return void(t.textContent="");let i=t.firstElementChild;i||(i=document.createElement("vaadin-select-list-box"),t.appendChild(i)),i.textContent="",this.items.forEach((t=>{i.appendChild(this.__createItemElement(t))}))}__dispatchChange(){return _(this,null,(function*(){this.updateComplete&&(yield this.updateComplete),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.__dispatchChangePending=!1}))}}
|
|
5557
5557
|
/**
|
|
5558
5558
|
* @license
|
|
5559
5559
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5560
5560
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5561
|
-
|
|
5561
|
+
*/;Vt("vaadin-select",[Yn,Jn,al],{moduleId:"vaadin-select-styles"});class cl extends(hl(Ps(Gt(hs)))){static get is(){return"vaadin-select"}static get template(){return as`
|
|
5562
5562
|
<style>
|
|
5563
5563
|
:host {
|
|
5564
5564
|
position: relative;
|
|
@@ -5611,4 +5611,436 @@ const al=T`
|
|
|
5611
5611
|
<div class="sr-only">
|
|
5612
5612
|
<slot name="sr-label"></slot>
|
|
5613
5613
|
</div>
|
|
5614
|
-
`}static get observers(){return["_rendererChanged(renderer, _overlayElement)"]}ready(){super.ready(),Ma(this)}_rendererChanged(t,e){e&&(e.renderer=t||this.__defaultRenderer,this.requestContentUpdate())}_onOverlayOpen(){this._menuElement&&this._menuElement.focus()}}_(cl);const dl=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.drawMultiplierChange=e(this,"drawMultiplierChange",7),this.lineMultiplierChange=e(this,"lineMultiplierChange",7),this.betTypeChange=e(this,"betTypeChange",7),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.endpoint=void 0,this.gameId=void 0,this.numberOfGrids=1,this.multipleDraws=!0,this.ticketId=void 0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=[],this.isCustomSelect=!1,this.amountInfo={},this.limitStylingAppends=!1,this.stakeMultiplier="1",this.lineMultiplier=0,this.isCustomSelectStake=!1,this.isCustomSelectDraw=!1,this.isCustomSelectLine=!1,this.drawMultiplier=1,this.secondarySelectionAllowed=!1,this.partialQuickpickAvailable=!1,this.boardsAllowed=[],this.tabIndex=0,this.groupType=[],this.playType=[],this.selectedPlayTypeId="",this.maximumAllowed=6,this.numberRange=[],this.secondaryNumberRange=[],this.secondaryMaximumAllowed=1,this.minimumAllowed=6,this.secondaryMinimumAllowed=1,this.quickPicks=[]}handleLineMultiplierChange(t){this.grids=Array.from({length:t},((t,e)=>e+1)),this.ticketDone=Array.from({length:t},(()=>!1)),this.quickPicks=Array.from({length:t},(()=>!1)),this.grids.forEach(((t,e)=>{this.resetSelection.emit({ticketId:this.ticketId,index:e})}))}handleTabIndexChange(t){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)})),this.setDrawMultiplier(1),this.setStakeMultiplier("1"),this.amountInfo=this.gameData.rules.stakes[0],this.setWagerPerDraw(this.amountInfo),this.playType=this.groupType[t].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.boardsAllowed=this.playType[0].boardsAllowed,this.setLineMultiplier(this.boardsAllowed[0]),this.selectedPlayTypeId=this.playType[0].value,this.numberRange=this.playType[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=this.playType[0].secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange),this.betTypeChange.emit({ticketId:this.ticketId,betType:this.playType[0]})}checkForClickOutside(t){this.selectRef&&!this.selectRef.contains(t.composedPath()[0])&&(this.isCustomSelect=!1),this.selectStakeRef&&!this.selectStakeRef.contains(t.composedPath()[0])&&(this.isCustomSelectStake=!1),this.selectDrawRef&&!this.selectDrawRef.contains(t.composedPath()[0])&&(this.isCustomSelectDraw=!1),this.selectLineRef&&!this.selectLineRef.contains(t.composedPath()[0])&&(this.isCustomSelectLine=!1)}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{var e;this.isLoading=!1,this.gameData=t,this.amountInfo=this.gameData.rules.stakes[0],this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed;const i=this.gameData.rules.betTypes.reduce(((t,e)=>(e.group?(t.groups[e.group]||(t.groups[e.group]=[]),t.groups[e.group].push(e)):t.noGroup.push({groupName:e.name||e.id,betType:[Object.assign({},e)]}),t)),{groups:{},noGroup:[]}),s=Object.entries(i.groups).map((([t,e])=>({groupName:t,betType:e})));this.groupType=[...i.noGroup,...s],this.playType=this.groupType[0].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.partialQuickpickAvailable=this.gameData.rules.partialQuickpickAvailable,this.boardsAllowed=null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.filter((t=>"Prima"===t.id))[0].boardsAllowed,this.lineMultiplier=this.boardsAllowed[0];let o=this.gameData.rules.betTypes[0].secondarySelectionRules;this.numberRange=this.gameData.rules.betTypes[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=o.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange)})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])h[e][i]=t[e][i]})))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{drawCount:this.drawMultiplier,multiplierNum:Number(this.stakeMultiplier),multiplier:this.gameData.rules.stakeMultiplierAvailable,quickPicks:this.quickPicks,betName:this.playType.length>1?this.playType.find((t=>t.value===this.selectedPlayTypeId)).label:this.groupType[this.tabIndex].groupName}),this.ticketDone=[...this.ticketDone.slice(0,t.detail.index),!0,...this.ticketDone.slice(t.detail.index+1)],this.ticketCompleted.emit(this.ticket)}handleGridClearAllEvent(t){let e=t.detail;this.ticketDone=[...this.ticketDone.slice(0,e),!1,...this.ticketDone.slice(e+1)],this.quickPicks[e]=!1}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.autoSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!0}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)],this.resetSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!1}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}toggleSelection(){this.isCustomSelectStake=!this.isCustomSelectStake}toggleLineSelection(){this.isCustomSelectLine=!this.isCustomSelectLine}toggleDrawSelection(){this.isCustomSelectDraw=!this.isCustomSelectDraw}setWagerPerDraw(t){this.amountInfo={value:t.value,currency:t.currency},this.isCustomSelect=!1,this.changeStake(this.ticketId,t.value)}setStakeMultiplier(t){this.stakeMultiplier=t,this.isCustomSelectStake=!1,this.multiplierChange.emit({ticketId:this.ticketId,multiplierNum:Number(t),multiplier:this.gameData.rules.stakeMultiplierAvailable})}setLineMultiplier(t){this.lineMultiplier=t,this.isCustomSelectLine=!1,this.lineMultiplierChange.emit({ticketId:this.ticketId,lineNum:t})}setDrawMultiplier(t){this.drawMultiplier=t,this.isCustomSelectDraw=!1,this.drawMultiplierChange.emit({ticketId:this.ticketId,drawCount:t})}handlePlayTypeChange(t){this.selectedPlayTypeId=t;let e=this.playType.filter((e=>e.id===t))[0];this.boardsAllowed=e.boardsAllowed,this.numberRange=e.selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=e.secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange);for(let t=0;t<this.lineMultiplier;t++)this.toggleResetSelection(t);this.betTypeChange.emit({ticketId:this.ticketId,betType:e}),this.setLineMultiplier(this.boardsAllowed[0])}render(){if(this.isLoading)return i("div",null,i("p",null,c("loading",this.language)));if(this.hasErrors)return i("div",null,i("p",null,c("error",this.language)));{const{rules:t}=this.gameData;return i("div",{class:"TicketContainer",ref:t=>this.stylingContainer=t},i("p",{class:"TicketTitle"},this.gameData.name),i("div",{class:"TicketTabs"},this.groupType.map(((t,e)=>i("div",{class:"TabButton"+(this.tabIndex==e?" Active":""),onClick:()=>this.tabIndex=e},t.groupName)))),this.playType.length>1&&i("div",null,i("label",{class:"Label"},c("playType",this.language),": "),i("vaadin-select",{style:{width:"160px"},items:this.playType,value:this.selectedPlayTypeId,"on-value-changed":t=>this.handlePlayTypeChange(t.detail.value)})),this.boardsAllowed.length>1&&i("div",null,i("label",{class:"Label"},c("lines",this.language),": "),i("div",{class:"WagerInput"},i("div",{ref:t=>this.selectLineRef=t,class:this.isCustomSelectLine?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleLineSelection()},i("span",null,this.lineMultiplier),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},this.boardsAllowed.map((t=>i("li",{class:this.lineMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setLineMultiplier(t)},t)))))))),this.grids.map(((e,s)=>i("div",null,i("div",{class:"TicketGridHeader"},i("div",null,c("lineName",this.language),s+1),this.resetButton&&this.ticketDone[s]&&i("div",{class:"ButtonContainer"},i("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection(s)},c("resetButton",this.language))),this.autoPick&&!this.ticketDone[s]&&i("div",{class:"ButtonContainer"},i("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection(s)},c("autoButton",this.language)))),i("div",{class:"TicketGridBullets"},i("p",{class:"TicketGridTitle"},t.boards[0].selectionName),i("lottery-grid",{"grid-index":s,"maximum-allowed":this.maximumAllowed,"minimum-allowed":this.minimumAllowed,"number-range":JSON.stringify(this.numberRange),"high-number":t.boards[0].highNumber,"low-number":t.boards[0].lowNumber,"total-numbers":t.boards[0].highNumber-t.boards[0].lowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"mainSelection","client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),this.secondarySelectionAllowed&&i("div",{class:"SecondarySelectionWrapper"},i("div",{class:"TicketGridBullets"},i("p",{class:"TicketGridTitle"},t.boards[0].secondarySelectionName),i("lottery-grid",{"grid-index":s,"maximum-allowed":this.secondaryMaximumAllowed,"minimum-allowed":this.secondaryMinimumAllowed,"number-range":JSON.stringify(this.secondaryNumberRange),"high-number":t.boards[0].secondaryHighNumber,"low-number":t.boards[0].secondaryLowNumber,"total-numbers":t.boards[0].secondaryHighNumber-t.boards[0].secondaryLowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"secondarySelection","client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))))),t.stakeMultiplierAvailable&&i("div",null,i("label",{class:"Label"},c("multiplier",this.language),": "),i("div",{class:"WagerInput"},t.stakeMultipliers.length>1?i("div",{ref:t=>this.selectStakeRef=t,class:this.isCustomSelectStake?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleSelection()},i("span",null,this.stakeMultiplier),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},t.stakeMultipliers.map((t=>i("li",{class:this.stakeMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setStakeMultiplier(t)},t)))))):i("div",null,i("input",{min:"1",value:t.stakeMultipliers[0]||1,type:"number",disabled:!0})))),t.drawMultiplierAvailable&&i("div",null,i("label",{class:"Label"},c("numberOfDraws",this.language),": "),i("div",{class:"WagerInput"},t.durations.length>1?i("div",{ref:t=>this.selectDrawRef=t,class:this.isCustomSelectDraw?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleDrawSelection()},i("span",null,this.drawMultiplier),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},t.durations.map((t=>i("li",{class:this.drawMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setDrawMultiplier(t)},t)))))):i("div",null,i("input",{min:"1",value:t.durations[0]||1,type:"number",disabled:!0})))),i("div",null,i("label",{class:"Label"},c("wagerPerDraw",this.language),": "),i("div",{class:"WagerInput"},t.stakes.length>1?i("div",{ref:t=>this.selectRef=t,class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleClass()},i("span",null,this.amountInfo.value," ",this.amountInfo.currency),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},t.stakes.map((t=>i("li",{class:this.amountInfo.value==t.value?"SelectedValue":"",value:t.value,onClick:()=>this.setWagerPerDraw(t)},t.value," ",t.currency)))))):i("div",null,i("input",{min:"1",value:t.stakes[0].value,type:"number",disabled:!0}),i("span",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}static get watchers(){return{lineMultiplier:["handleLineMultiplierChange"],tabIndex:["handleTabIndexChange"]}}};dl.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.TicketTabs{display:flex;overflow:auto}.TicketTabs .TabButton{color:var(--emw--color-typography, #009993);margin:0 40px 10px 0;cursor:pointer}.TicketTabs .Active{border-bottom:1px solid var(--emw--color-typography, #009993)}.ButtonContainer{display:flex;justify-content:flex-end}.SecondarySelectionWrapper{margin-top:20px}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:var(--emw--button-text-color, #000)}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:var(--emw--button-text-color, #000);padding:10px;margin-left:8px}.AutoButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;border:1px solid var(--emw--button-border-color, #00958f);background:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));color:var(--emw--button-text-color, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:var(--emw--button-background-color, #00958f);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.ResetButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;color:var(--emw--button-text-color, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:var(--emw--color-error, #FF3D00);border:1px solid var(--emw--color-error, #FF3D00);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.ResetButton:hover{background:var(--emw--color-secondary, #FF6536);border:1px solid var(--emw--color-error, #FF3D00)}.TicketGridHeader{display:flex;justify-content:space-between;align-items:center;font-weight:bold;margin-top:10px}.TicketGridBullets{background:var(--emw--color-gray-50, #F1F1F1);border-radius:4px;padding:20px;margin-top:5px;margin-bottom:10px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:var(--emw--color-background, #009993)}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:var(--emw--color-background, #009993)}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid var(--emw--color-gray-transparency-80, #ccc);border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid var(--emw--color-gray-transparency-80, #ccc);overflow:hidden;background:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));z-index:20}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:var(--emw--color-background, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:var(--emw--color-gray-50, #F1F1F1);border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:var(--emw--color-gray-transparency-80, #ccc);border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:var(--emw--color-gray-150, #f2f2f2)}';const ul=["ro","en","fr","ar","hr"],pl={en:{ticket:"Ticket"},ro:{ticket:"Bilet"},fr:{ticket:"Billet"},ar:{ticket:"تذكرة"},hr:{ticket:"Listić"}},ml=(t,e)=>{const i=e;return pl[void 0!==i&&ul.includes(i)?i:"en"][t]},vl=class{constructor(i){t(this,i),this.deleteTicketEvent=e(this,"deleteTicket",7),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.endpoint="",this.ticketId=1,this.ticketDescription=void 0,this.gameId=void 0,this.postMessage=!1,this.eventName="deleteTicketAction",this.collapsed=!0,this.numberOfGrids=1,this.last=!1,this.language="en",this.autoPick=!1,this.resetButton=!1,this.totalControllers=1,this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.limitStylingAppends=!1}helperAccordionActionHandler(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.deleteTicketEvent.emit({ticketId:this.ticketId})}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])pl[e][i]=t[e][i]})))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return i("div",{key:"581989035aa42a397cd39a4cdd929ea91190494c",class:"LotteryTicketControllerContainer",ref:t=>this.stylingContainer=t},i("helper-accordion",{key:"724d50d1532510344ed7acd57c3c5faef17aef8c","header-title":`${ml("ticket",this.language)} ${this.ticketId}`,"header-subtitle":this.ticketDescription,footer:!0,"delete-tab":1!==this.totalControllers,collapsed:!this.last||this.collapsed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("div",{key:"ba851ea2792641971a5552a94558fe8d28068187",slot:"accordionContent"},i("lottery-ticket",{key:"199abc15160d60499d7d1d1d14084f64a6314c53",endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"translation-url":this.translationUrl,"reset-button":this.resetButton,"auto-pick":this.autoPick,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}))))}};vl.style=':host{font-family:"Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}';export{r as helper_accordion,n as lottery_bullet,a as lottery_grid,dl as lottery_ticket,vl as lottery_ticket_controller}
|
|
5614
|
+
`}static get observers(){return["_rendererChanged(renderer, _overlayElement)"]}ready(){super.ready(),Ma(this)}_rendererChanged(t,e){e&&(e.renderer=t||this.__defaultRenderer,this.requestContentUpdate())}_onOverlayOpen(){this._menuElement&&this._menuElement.focus()}}x(cl);const dl=T`
|
|
5615
|
+
/* Optical centering */
|
|
5616
|
+
:host::before,
|
|
5617
|
+
:host::after {
|
|
5618
|
+
content: '';
|
|
5619
|
+
flex-basis: 0;
|
|
5620
|
+
flex-grow: 1;
|
|
5621
|
+
}
|
|
5622
|
+
|
|
5623
|
+
:host::after {
|
|
5624
|
+
flex-grow: 1.1;
|
|
5625
|
+
}
|
|
5626
|
+
|
|
5627
|
+
[part='overlay'] {
|
|
5628
|
+
border-radius: var(--lumo-border-radius-l);
|
|
5629
|
+
box-shadow:
|
|
5630
|
+
0 0 0 1px var(--lumo-shade-5pct),
|
|
5631
|
+
var(--lumo-box-shadow-xl);
|
|
5632
|
+
background-image: none;
|
|
5633
|
+
outline: none;
|
|
5634
|
+
-webkit-tap-highlight-color: transparent;
|
|
5635
|
+
}
|
|
5636
|
+
|
|
5637
|
+
[part='content'] {
|
|
5638
|
+
padding: var(--lumo-space-l);
|
|
5639
|
+
}
|
|
5640
|
+
|
|
5641
|
+
:host(:is([has-header], [has-title])) [part='header'] + [part='content'] {
|
|
5642
|
+
padding-top: 0;
|
|
5643
|
+
}
|
|
5644
|
+
|
|
5645
|
+
[part='header'],
|
|
5646
|
+
[part='header-content'],
|
|
5647
|
+
[part='footer'] {
|
|
5648
|
+
gap: var(--lumo-space-xs) var(--lumo-space-s);
|
|
5649
|
+
line-height: var(--lumo-line-height-s);
|
|
5650
|
+
}
|
|
5651
|
+
|
|
5652
|
+
[part='header'] {
|
|
5653
|
+
padding: var(--lumo-space-m);
|
|
5654
|
+
background-color: var(--lumo-base-color);
|
|
5655
|
+
border-radius: var(--lumo-border-radius-l) var(--lumo-border-radius-l) 0 0; /* Needed for Safari */
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
[part='footer'] {
|
|
5659
|
+
padding: var(--lumo-space-s) var(--lumo-space-m);
|
|
5660
|
+
background-color: var(--lumo-contrast-5pct);
|
|
5661
|
+
border-radius: 0 0 var(--lumo-border-radius-l) var(--lumo-border-radius-l); /* Needed for Safari */
|
|
5662
|
+
}
|
|
5663
|
+
|
|
5664
|
+
[part='title'] {
|
|
5665
|
+
font-size: var(--lumo-font-size-xl);
|
|
5666
|
+
font-weight: 600;
|
|
5667
|
+
color: var(--lumo-header-text-color);
|
|
5668
|
+
margin-inline-start: calc(var(--lumo-space-l) - var(--lumo-space-m));
|
|
5669
|
+
}
|
|
5670
|
+
|
|
5671
|
+
/* No padding */
|
|
5672
|
+
:host([theme~='no-padding']) [part='content'] {
|
|
5673
|
+
padding: 0 !important;
|
|
5674
|
+
}
|
|
5675
|
+
|
|
5676
|
+
@media (min-height: 320px) {
|
|
5677
|
+
:host([overflow~='top']) [part='header'] {
|
|
5678
|
+
box-shadow: 0 1px 0 0 var(--lumo-contrast-10pct);
|
|
5679
|
+
}
|
|
5680
|
+
}
|
|
5681
|
+
|
|
5682
|
+
/* Animations */
|
|
5683
|
+
|
|
5684
|
+
:host([opening]),
|
|
5685
|
+
:host([closing]) {
|
|
5686
|
+
animation: 0.25s lumo-overlay-dummy-animation;
|
|
5687
|
+
}
|
|
5688
|
+
|
|
5689
|
+
:host([opening]) [part='overlay'] {
|
|
5690
|
+
animation: 0.12s 0.05s vaadin-dialog-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
|
|
5691
|
+
}
|
|
5692
|
+
|
|
5693
|
+
@keyframes vaadin-dialog-enter {
|
|
5694
|
+
0% {
|
|
5695
|
+
opacity: 0;
|
|
5696
|
+
transform: scale(0.95);
|
|
5697
|
+
}
|
|
5698
|
+
}
|
|
5699
|
+
|
|
5700
|
+
:host([closing]) [part='overlay'] {
|
|
5701
|
+
animation: 0.1s 0.03s vaadin-dialog-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
|
|
5702
|
+
}
|
|
5703
|
+
|
|
5704
|
+
:host([closing]) [part='backdrop'] {
|
|
5705
|
+
animation-delay: 0.05s;
|
|
5706
|
+
}
|
|
5707
|
+
|
|
5708
|
+
@keyframes vaadin-dialog-exit {
|
|
5709
|
+
100% {
|
|
5710
|
+
opacity: 0;
|
|
5711
|
+
transform: scale(1.02);
|
|
5712
|
+
}
|
|
5713
|
+
}
|
|
5714
|
+
`;Vt("vaadin-dialog-overlay",[ur,dl],{moduleId:"lumo-dialog"}),Vt("vaadin-confirm-dialog-overlay",[ur,dl,T`
|
|
5715
|
+
[part='header'] ::slotted(h3) {
|
|
5716
|
+
margin-top: 0 !important;
|
|
5717
|
+
margin-bottom: 0 !important;
|
|
5718
|
+
margin-inline-start: calc(var(--lumo-space-l) - var(--lumo-space-m));
|
|
5719
|
+
}
|
|
5720
|
+
|
|
5721
|
+
[part='message'] {
|
|
5722
|
+
width: 25em;
|
|
5723
|
+
min-width: 100%;
|
|
5724
|
+
max-width: 100%;
|
|
5725
|
+
}
|
|
5726
|
+
|
|
5727
|
+
::slotted([slot$='button'][theme~='tertiary']) {
|
|
5728
|
+
padding-left: var(--lumo-space-s);
|
|
5729
|
+
padding-right: var(--lumo-space-s);
|
|
5730
|
+
}
|
|
5731
|
+
|
|
5732
|
+
[part='cancel-button'] {
|
|
5733
|
+
flex-grow: 1;
|
|
5734
|
+
}
|
|
5735
|
+
|
|
5736
|
+
@media (max-width: 360px) {
|
|
5737
|
+
[part='footer'] {
|
|
5738
|
+
flex-direction: column-reverse;
|
|
5739
|
+
align-items: stretch;
|
|
5740
|
+
padding: var(--lumo-space-s) var(--lumo-space-l);
|
|
5741
|
+
gap: var(--lumo-space-s);
|
|
5742
|
+
}
|
|
5743
|
+
|
|
5744
|
+
::slotted([slot$='button']) {
|
|
5745
|
+
width: 100%;
|
|
5746
|
+
margin: 0;
|
|
5747
|
+
}
|
|
5748
|
+
}
|
|
5749
|
+
`],{moduleId:"lumo-confirm-dialog-overlay"});
|
|
5750
|
+
/**
|
|
5751
|
+
* @license
|
|
5752
|
+
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5753
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5754
|
+
*/
|
|
5755
|
+
const ul=t=>class extends t{static get properties(){return{opened:{type:Boolean,value:!1,notify:!0},noCloseOnOutsideClick:{type:Boolean,value:!1},noCloseOnEsc:{type:Boolean,value:!1},modeless:{type:Boolean,value:!1},overlayRole:{type:String,value:"dialog"}}}ready(){super.ready();const t=this.$.overlay;t.addEventListener("vaadin-overlay-outside-click",this._handleOutsideClick.bind(this)),t.addEventListener("vaadin-overlay-escape-press",this._handleEscPress.bind(this)),t.addEventListener("vaadin-overlay-closed",this.__handleOverlayClosed.bind(this)),this._overlayElement=t}__handleOverlayClosed(){this.dispatchEvent(new CustomEvent("closed"))}connectedCallback(){super.connectedCallback(),this.__restoreOpened&&(this.opened=!0)}disconnectedCallback(){super.disconnectedCallback(),setTimeout((()=>{this.isConnected||(this.__restoreOpened=this.opened,this.opened=!1)}))}_onOverlayOpened(t){!1===t.detail.value&&(this.opened=!1)}_handleOutsideClick(t){this.noCloseOnOutsideClick&&t.preventDefault()}_handleEscPress(t){this.noCloseOnEsc&&t.preventDefault()}_bringOverlayToFront(){this.modeless&&this._overlayElement.bringToFront()}}
|
|
5756
|
+
/**
|
|
5757
|
+
* @license
|
|
5758
|
+
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5759
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5760
|
+
*/,pl=T`
|
|
5761
|
+
[part='header'],
|
|
5762
|
+
[part='header-content'],
|
|
5763
|
+
[part='footer'] {
|
|
5764
|
+
display: flex;
|
|
5765
|
+
align-items: center;
|
|
5766
|
+
flex-wrap: wrap;
|
|
5767
|
+
flex: none;
|
|
5768
|
+
pointer-events: none;
|
|
5769
|
+
z-index: 1;
|
|
5770
|
+
}
|
|
5771
|
+
|
|
5772
|
+
[part='header'] {
|
|
5773
|
+
flex-wrap: nowrap;
|
|
5774
|
+
}
|
|
5775
|
+
|
|
5776
|
+
::slotted([slot='header-content']),
|
|
5777
|
+
::slotted([slot='title']),
|
|
5778
|
+
::slotted([slot='footer']) {
|
|
5779
|
+
display: contents;
|
|
5780
|
+
pointer-events: auto;
|
|
5781
|
+
}
|
|
5782
|
+
|
|
5783
|
+
::slotted([slot='title']) {
|
|
5784
|
+
font: inherit !important;
|
|
5785
|
+
overflow-wrap: anywhere;
|
|
5786
|
+
}
|
|
5787
|
+
|
|
5788
|
+
[part='header-content'] {
|
|
5789
|
+
flex: 1;
|
|
5790
|
+
}
|
|
5791
|
+
|
|
5792
|
+
:host([has-title]) [part='header-content'],
|
|
5793
|
+
[part='footer'] {
|
|
5794
|
+
justify-content: flex-end;
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5797
|
+
:host(:not([has-title]):not([has-header])) [part='header'],
|
|
5798
|
+
:host(:not([has-header])) [part='header-content'],
|
|
5799
|
+
:host(:not([has-title])) [part='title'],
|
|
5800
|
+
:host(:not([has-footer])) [part='footer'] {
|
|
5801
|
+
display: none !important;
|
|
5802
|
+
}
|
|
5803
|
+
|
|
5804
|
+
:host(:is([has-title], [has-header], [has-footer])) [part='content'] {
|
|
5805
|
+
height: auto;
|
|
5806
|
+
}
|
|
5807
|
+
|
|
5808
|
+
@media (min-height: 320px) {
|
|
5809
|
+
:host(:is([has-title], [has-header], [has-footer])) .resizer-container {
|
|
5810
|
+
overflow: hidden;
|
|
5811
|
+
display: flex;
|
|
5812
|
+
flex-direction: column;
|
|
5813
|
+
}
|
|
5814
|
+
|
|
5815
|
+
:host(:is([has-title], [has-header], [has-footer])) [part='content'] {
|
|
5816
|
+
flex: 1;
|
|
5817
|
+
overflow: auto;
|
|
5818
|
+
}
|
|
5819
|
+
}
|
|
5820
|
+
|
|
5821
|
+
/*
|
|
5822
|
+
NOTE(platosha): Make some min-width to prevent collapsing of the content
|
|
5823
|
+
taking the parent width, e. g., <vaadin-grid> and such.
|
|
5824
|
+
*/
|
|
5825
|
+
[part='content'] {
|
|
5826
|
+
min-width: 12em; /* matches the default <vaadin-text-field> width */
|
|
5827
|
+
}
|
|
5828
|
+
|
|
5829
|
+
:host([has-bounds-set]) [part='overlay'] {
|
|
5830
|
+
max-width: none;
|
|
5831
|
+
}
|
|
5832
|
+
|
|
5833
|
+
@media (forced-colors: active) {
|
|
5834
|
+
[part='overlay'] {
|
|
5835
|
+
outline: 3px solid !important;
|
|
5836
|
+
}
|
|
5837
|
+
}
|
|
5838
|
+
`;T`
|
|
5839
|
+
[part='overlay'] {
|
|
5840
|
+
position: relative;
|
|
5841
|
+
overflow: visible;
|
|
5842
|
+
max-height: 100%;
|
|
5843
|
+
display: flex;
|
|
5844
|
+
}
|
|
5845
|
+
|
|
5846
|
+
[part='content'] {
|
|
5847
|
+
box-sizing: border-box;
|
|
5848
|
+
height: 100%;
|
|
5849
|
+
}
|
|
5850
|
+
|
|
5851
|
+
.resizer-container {
|
|
5852
|
+
overflow: auto;
|
|
5853
|
+
flex-grow: 1;
|
|
5854
|
+
border-radius: inherit; /* prevent child elements being drawn outside part=overlay */
|
|
5855
|
+
}
|
|
5856
|
+
|
|
5857
|
+
[part='overlay'][style] .resizer-container {
|
|
5858
|
+
min-height: 100%;
|
|
5859
|
+
width: 100%;
|
|
5860
|
+
}
|
|
5861
|
+
|
|
5862
|
+
:host(:not([resizable])) .resizer {
|
|
5863
|
+
display: none;
|
|
5864
|
+
}
|
|
5865
|
+
|
|
5866
|
+
:host([resizable]) [part='title'] {
|
|
5867
|
+
cursor: move;
|
|
5868
|
+
-webkit-user-select: none;
|
|
5869
|
+
user-select: none;
|
|
5870
|
+
}
|
|
5871
|
+
|
|
5872
|
+
.resizer {
|
|
5873
|
+
position: absolute;
|
|
5874
|
+
height: 16px;
|
|
5875
|
+
width: 16px;
|
|
5876
|
+
}
|
|
5877
|
+
|
|
5878
|
+
.resizer.edge {
|
|
5879
|
+
height: 8px;
|
|
5880
|
+
width: 8px;
|
|
5881
|
+
inset: -4px;
|
|
5882
|
+
}
|
|
5883
|
+
|
|
5884
|
+
.resizer.edge.n {
|
|
5885
|
+
width: auto;
|
|
5886
|
+
bottom: auto;
|
|
5887
|
+
cursor: ns-resize;
|
|
5888
|
+
}
|
|
5889
|
+
|
|
5890
|
+
.resizer.ne {
|
|
5891
|
+
top: -4px;
|
|
5892
|
+
right: -4px;
|
|
5893
|
+
cursor: nesw-resize;
|
|
5894
|
+
}
|
|
5895
|
+
|
|
5896
|
+
.resizer.edge.e {
|
|
5897
|
+
height: auto;
|
|
5898
|
+
left: auto;
|
|
5899
|
+
cursor: ew-resize;
|
|
5900
|
+
}
|
|
5901
|
+
|
|
5902
|
+
.resizer.se {
|
|
5903
|
+
bottom: -4px;
|
|
5904
|
+
right: -4px;
|
|
5905
|
+
cursor: nwse-resize;
|
|
5906
|
+
}
|
|
5907
|
+
|
|
5908
|
+
.resizer.edge.s {
|
|
5909
|
+
width: auto;
|
|
5910
|
+
top: auto;
|
|
5911
|
+
cursor: ns-resize;
|
|
5912
|
+
}
|
|
5913
|
+
|
|
5914
|
+
.resizer.sw {
|
|
5915
|
+
bottom: -4px;
|
|
5916
|
+
left: -4px;
|
|
5917
|
+
cursor: nesw-resize;
|
|
5918
|
+
}
|
|
5919
|
+
|
|
5920
|
+
.resizer.edge.w {
|
|
5921
|
+
height: auto;
|
|
5922
|
+
right: auto;
|
|
5923
|
+
cursor: ew-resize;
|
|
5924
|
+
}
|
|
5925
|
+
|
|
5926
|
+
.resizer.nw {
|
|
5927
|
+
top: -4px;
|
|
5928
|
+
left: -4px;
|
|
5929
|
+
cursor: nwse-resize;
|
|
5930
|
+
}
|
|
5931
|
+
`
|
|
5932
|
+
/**
|
|
5933
|
+
* @license
|
|
5934
|
+
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
5935
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5936
|
+
*/;const ml=t=>class extends t{static get properties(){return{ariaLabel:{type:String,value:""},contentHeight:{type:String},contentWidth:{type:String}}}static get observers(){return["__updateContentHeight(contentHeight, _overlayElement)","__updateContentWidth(contentWidth, _overlayElement)"]}__updateDimension(t,e,i){const s=`--_vaadin-confirm-dialog-content-${e}`;i?t.style.setProperty(s,i):t.style.removeProperty(s)}__updateContentHeight(t,e){e&&this.__updateDimension(e,"height",t)}__updateContentWidth(t,e){e&&this.__updateDimension(e,"width",t)}}
|
|
5937
|
+
/**
|
|
5938
|
+
* @license
|
|
5939
|
+
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
5940
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5941
|
+
*/;
|
|
5942
|
+
/**
|
|
5943
|
+
* @license
|
|
5944
|
+
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
5945
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5946
|
+
*/
|
|
5947
|
+
Vt("vaadin-confirm-dialog-overlay",[wr,pl,T`
|
|
5948
|
+
:host {
|
|
5949
|
+
--_vaadin-confirm-dialog-content-width: auto;
|
|
5950
|
+
--_vaadin-confirm-dialog-content-height: auto;
|
|
5951
|
+
}
|
|
5952
|
+
|
|
5953
|
+
[part='overlay'] {
|
|
5954
|
+
width: var(--_vaadin-confirm-dialog-content-width);
|
|
5955
|
+
height: var(--_vaadin-confirm-dialog-content-height);
|
|
5956
|
+
}
|
|
5957
|
+
|
|
5958
|
+
::slotted([slot='header']) {
|
|
5959
|
+
pointer-events: auto;
|
|
5960
|
+
}
|
|
5961
|
+
|
|
5962
|
+
/* Make buttons clickable */
|
|
5963
|
+
[part='footer'] > * {
|
|
5964
|
+
pointer-events: all;
|
|
5965
|
+
}
|
|
5966
|
+
`],{moduleId:"vaadin-confirm-dialog-overlay-styles"});class vl extends(Gr(Ds(Gt(hs)))){static get is(){return"vaadin-confirm-dialog-overlay"}static get template(){return as`
|
|
5967
|
+
<div part="backdrop" id="backdrop" hidden$="[[!withBackdrop]]"></div>
|
|
5968
|
+
<div part="overlay" id="overlay" tabindex="0">
|
|
5969
|
+
<section id="resizerContainer" class="resizer-container">
|
|
5970
|
+
<header part="header"><slot name="header"></slot></header>
|
|
5971
|
+
<div part="content" id="content">
|
|
5972
|
+
<div part="message"><slot></slot></div>
|
|
5973
|
+
</div>
|
|
5974
|
+
<footer part="footer" role="toolbar">
|
|
5975
|
+
<div part="cancel-button">
|
|
5976
|
+
<slot name="cancel-button"></slot>
|
|
5977
|
+
</div>
|
|
5978
|
+
<div part="reject-button">
|
|
5979
|
+
<slot name="reject-button"></slot>
|
|
5980
|
+
</div>
|
|
5981
|
+
<div part="confirm-button">
|
|
5982
|
+
<slot name="confirm-button"></slot>
|
|
5983
|
+
</div>
|
|
5984
|
+
</footer>
|
|
5985
|
+
</section>
|
|
5986
|
+
</div>
|
|
5987
|
+
`}ready(){super.ready(),this.setAttribute("has-header",""),this.setAttribute("has-footer","")}}x(vl);class fl extends(ml(ul(Zn(Pt(hs))))){static get is(){return"vaadin-confirm-dialog-dialog"}static get template(){return as`
|
|
5988
|
+
<style>
|
|
5989
|
+
:host {
|
|
5990
|
+
display: none;
|
|
5991
|
+
}
|
|
5992
|
+
</style>
|
|
5993
|
+
|
|
5994
|
+
<vaadin-confirm-dialog-overlay
|
|
5995
|
+
id="overlay"
|
|
5996
|
+
opened="[[opened]]"
|
|
5997
|
+
on-opened-changed="_onOverlayOpened"
|
|
5998
|
+
on-mousedown="_bringOverlayToFront"
|
|
5999
|
+
on-touchstart="_bringOverlayToFront"
|
|
6000
|
+
theme$="[[_theme]]"
|
|
6001
|
+
modeless="[[modeless]]"
|
|
6002
|
+
with-backdrop="[[!modeless]]"
|
|
6003
|
+
resizable$="[[resizable]]"
|
|
6004
|
+
aria-label$="[[ariaLabel]]"
|
|
6005
|
+
restore-focus-on-close
|
|
6006
|
+
focus-trap
|
|
6007
|
+
></vaadin-confirm-dialog-overlay>
|
|
6008
|
+
`}}x(fl);
|
|
6009
|
+
/**
|
|
6010
|
+
* @license
|
|
6011
|
+
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
6012
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6013
|
+
*/
|
|
6014
|
+
const bl=t=>class extends t{static get properties(){return{accessibleDescriptionRef:{type:String},opened:{type:Boolean,value:!1,notify:!0},header:{type:String,value:""},message:{type:String,value:""},confirmText:{type:String,value:"Confirm"},confirmTheme:{type:String,value:"primary"},noCloseOnEsc:{type:Boolean,value:!1},rejectButtonVisible:{type:Boolean,reflectToAttribute:!0,value:!1},rejectText:{type:String,value:"Reject"},rejectTheme:{type:String,value:"error tertiary"},cancelButtonVisible:{type:Boolean,reflectToAttribute:!0,value:!1},cancelText:{type:String,value:"Cancel"},cancelTheme:{type:String,value:"tertiary"},overlayClass:{type:String},_cancelButton:{type:Object},_confirmButton:{type:Object},_headerNode:{type:Object},_messageNodes:{type:Array,value:()=>[]},_overlayElement:{type:Object,sync:!0},_rejectButton:{type:Object},_contentHeight:{type:String},_contentWidth:{type:String}}}static get observers(){return["__updateConfirmButton(_confirmButton, confirmText, confirmTheme)","__updateCancelButton(_cancelButton, cancelText, cancelTheme, cancelButtonVisible)","__updateHeaderNode(_headerNode, header)","__updateMessageNodes(_messageNodes, message)","__updateRejectButton(_rejectButton, rejectText, rejectTheme, rejectButtonVisible)","__accessibleDescriptionRefChanged(_overlayElement, _messageNodes, accessibleDescriptionRef)"]}constructor(){super(),this.__cancel=this.__cancel.bind(this),this.__confirm=this.__confirm.bind(this),this.__reject=this.__reject.bind(this)}get __slottedNodes(){return[this._headerNode,...this._messageNodes,this._cancelButton,this._confirmButton,this._rejectButton]}ready(){super.ready(),this._headerController=new $s(this,"header","h3",{initializer:t=>{this._headerNode=t}}),this.addController(this._headerController),this._messageController=new $s(this,"","div",{multiple:!0,observe:!1,initializer:t=>{const e=document.createElement("div");e.style.display="contents";const i=`confirm-dialog-message-${Rs()}`;e.id=i,this.appendChild(e),e.appendChild(t),this._messageNodes=[...this._messageNodes,e]}}),this.addController(this._messageController),this._cancelController=new $s(this,"cancel-button","vaadin-button",{initializer:t=>{this.__setupSlottedButton("cancel",t)}}),this.addController(this._cancelController),this._rejectController=new $s(this,"reject-button","vaadin-button",{initializer:t=>{this.__setupSlottedButton("reject",t)}}),this.addController(this._rejectController),this._confirmController=new $s(this,"confirm-button","vaadin-button",{initializer:t=>{this.__setupSlottedButton("confirm",t)}}),this.addController(this._confirmController)}_initOverlay(t){t.addEventListener("vaadin-overlay-escape-press",this._escPressed.bind(this)),t.addEventListener("vaadin-overlay-open",(()=>this.__onDialogOpened())),t.addEventListener("vaadin-overlay-closed",(()=>this.__onDialogClosed())),t.setAttribute("role","alertdialog")}__onDialogOpened(){const t=this._overlayElement;this.__slottedNodes.forEach((e=>{t.appendChild(e)}));const e=t.querySelector('[slot="confirm-button"]');e&&e.focus()}__onDialogClosed(){this.__slottedNodes.forEach((t=>{this.appendChild(t)})),this.dispatchEvent(new CustomEvent("closed"))}__accessibleDescriptionRefChanged(t,e,i){!t||!e||(void 0!==i?Uo(t,"aria-describedby",{newId:i,oldId:this.__oldAccessibleDescriptionRef,fromUser:!0}):e.forEach((e=>{Uo(t,"aria-describedby",{newId:e.id})})),this.__oldAccessibleDescriptionRef=i)}__setupSlottedButton(t,e){const i=`_${t}Button`,s=`__${t}`;this[i]&&this[i]!==e&&this[i].remove(),e.addEventListener("click",this[s]),this[i]=e}__updateCancelButton(t,e,i,s){t&&(t===this._cancelController.defaultNode&&(t.textContent=e,t.setAttribute("theme",i)),t.toggleAttribute("hidden",!s))}__updateConfirmButton(t,e,i){t&&t===this._confirmController.defaultNode&&(t.textContent=e,t.setAttribute("theme",i))}__updateHeaderNode(t,e){t&&t===this._headerController.defaultNode&&(t.textContent=e)}__updateMessageNodes(t,e){if(t&&t.length>0){const i=t.find((t=>this._messageController.defaultNode&&t===this._messageController.defaultNode.parentElement));i&&(i.firstChild.textContent=e)}}__updateRejectButton(t,e,i,s){t&&(t===this._rejectController.defaultNode&&(t.textContent=e,t.setAttribute("theme",i)),t.toggleAttribute("hidden",!s))}_escPressed(t){t.defaultPrevented||this.__cancel()}__confirm(){this.dispatchEvent(new CustomEvent("confirm")),this.opened=!1}__cancel(){this.dispatchEvent(new CustomEvent("cancel")),this.opened=!1}__reject(){this.dispatchEvent(new CustomEvent("reject")),this.opened=!1}_getAriaLabel(t){return t||"confirmation"}}
|
|
6015
|
+
/**
|
|
6016
|
+
* @license
|
|
6017
|
+
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
6018
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6019
|
+
*/;class gl extends(bl(Ps(Pt(Go(hs))))){static get template(){return as`
|
|
6020
|
+
<style>
|
|
6021
|
+
:host,
|
|
6022
|
+
[hidden] {
|
|
6023
|
+
display: none !important;
|
|
6024
|
+
}
|
|
6025
|
+
</style>
|
|
6026
|
+
|
|
6027
|
+
<vaadin-confirm-dialog-dialog
|
|
6028
|
+
id="dialog"
|
|
6029
|
+
opened="{{opened}}"
|
|
6030
|
+
overlay-class="[[overlayClass]]"
|
|
6031
|
+
aria-label="[[_getAriaLabel(header)]]"
|
|
6032
|
+
theme$="[[_theme]]"
|
|
6033
|
+
no-close-on-outside-click
|
|
6034
|
+
no-close-on-esc="[[noCloseOnEsc]]"
|
|
6035
|
+
content-height="[[_contentHeight]]"
|
|
6036
|
+
content-width="[[_contentWidth]]"
|
|
6037
|
+
></vaadin-confirm-dialog-dialog>
|
|
6038
|
+
|
|
6039
|
+
<div hidden>
|
|
6040
|
+
<slot name="header"></slot>
|
|
6041
|
+
<slot></slot>
|
|
6042
|
+
<slot name="cancel-button"></slot>
|
|
6043
|
+
<slot name="reject-button"></slot>
|
|
6044
|
+
<slot name="confirm-button"></slot>
|
|
6045
|
+
</div>
|
|
6046
|
+
`}static get is(){return"vaadin-confirm-dialog"}ready(){super.ready(),this._overlayElement=this.$.dialog.$.overlay,this._initOverlay(this._overlayElement)}}x(gl);const yl=class{constructor(i){t(this,i),this.ticketCompleted=e(this,"ticketCompleted",7),this.autoSelection=e(this,"autoSelection",7),this.resetSelection=e(this,"resetSelection",7),this.stakeChange=e(this,"stakeChange",7),this.multiplierChange=e(this,"multiplierChange",7),this.drawMultiplierChange=e(this,"drawMultiplierChange",7),this.lineMultiplierChange=e(this,"lineMultiplierChange",7),this.betTypeChange=e(this,"betTypeChange",7),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.endpoint=void 0,this.gameId=void 0,this.numberOfGrids=1,this.multipleDraws=!0,this.ticketId=void 0,this.resetButton=!1,this.autoPick=!1,this.language="en",this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.isLoading=!0,this.hasErrors=!1,this.ticketDone=[],this.isCustomSelect=!1,this.amountInfo={},this.limitStylingAppends=!1,this.stakeMultiplier="1",this.lineMultiplier=0,this.isCustomSelectStake=!1,this.isCustomSelectDraw=!1,this.isCustomSelectLine=!1,this.drawMultiplier=1,this.secondarySelectionAllowed=!1,this.partialQuickpickAvailable=!1,this.boardsAllowed=[],this.tabIndex=0,this.groupType=[],this.playType=[],this.selectedPlayTypeId="",this.maximumAllowed=6,this.numberRange=[],this.secondaryNumberRange=[],this.secondaryMaximumAllowed=1,this.minimumAllowed=6,this.secondaryMinimumAllowed=1,this.quickPicks=[]}handleLineMultiplierChange(t){this.grids=Array.from({length:t},((t,e)=>e+1)),this.ticketDone=Array.from({length:t},(()=>!1)),this.quickPicks=Array.from({length:t},(()=>!1)),this.grids.forEach(((t,e)=>{this.resetSelection.emit({ticketId:this.ticketId,index:e})}))}handleTabIndexChange(t){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)})),this.setDrawMultiplier(1),this.setStakeMultiplier("1"),this.amountInfo=this.gameData.rules.stakes[0],this.setWagerPerDraw(this.amountInfo),this.playType=this.groupType[t].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.boardsAllowed=this.playType[0].boardsAllowed,this.setLineMultiplier(this.boardsAllowed[0]),this.selectedPlayTypeId=this.playType[0].value,this.numberRange=this.playType[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=this.playType[0].secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange),this.betTypeChange.emit({ticketId:this.ticketId,betType:this.playType[0]})}checkForClickOutside(t){this.selectRef&&!this.selectRef.contains(t.composedPath()[0])&&(this.isCustomSelect=!1),this.selectStakeRef&&!this.selectStakeRef.contains(t.composedPath()[0])&&(this.isCustomSelectStake=!1),this.selectDrawRef&&!this.selectDrawRef.contains(t.composedPath()[0])&&(this.isCustomSelectDraw=!1),this.selectLineRef&&!this.selectLineRef.contains(t.composedPath()[0])&&(this.isCustomSelectLine=!1)}connectedCallback(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.ok)return t.json();this.hasErrors=!0})).then((t=>{var e;this.isLoading=!1,this.gameData=t,this.amountInfo=this.gameData.rules.stakes[0],this.secondarySelectionAllowed="INPUT"===this.gameData.rules.secondarySelectionAllowed;const i=this.gameData.rules.betTypes.reduce(((t,e)=>(e.group?(t.groups[e.group]||(t.groups[e.group]=[]),t.groups[e.group].push(e)):t.noGroup.push({groupName:e.name||e.id,betType:[Object.assign({},e)]}),t)),{groups:{},noGroup:[]}),s=Object.entries(i.groups).map((([t,e])=>({groupName:t,betType:e})));this.groupType=[...i.noGroup,...s],this.playType=this.groupType[0].betType.map((t=>Object.assign(Object.assign({},t),{label:t.name||t.id,value:t.id}))),this.partialQuickpickAvailable=this.gameData.rules.partialQuickpickAvailable,this.boardsAllowed=null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.filter((t=>"Prima"===t.id))[0].boardsAllowed,this.lineMultiplier=this.boardsAllowed[0];let o=this.gameData.rules.betTypes[0].secondarySelectionRules;this.numberRange=this.gameData.rules.betTypes[0].selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=o.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange)})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)}))}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])h[e][i]=t[e][i]})))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}gridFilledHandler(t){this.ticket=Object.assign(Object.assign({},t.detail),{drawCount:this.drawMultiplier,multiplierNum:Number(this.stakeMultiplier),multiplier:this.gameData.rules.stakeMultiplierAvailable,quickPicks:this.quickPicks,betName:this.playType.length>1?this.playType.find((t=>t.value===this.selectedPlayTypeId)).label:this.groupType[this.tabIndex].groupName}),this.ticketDone=[...this.ticketDone.slice(0,t.detail.index),!0,...this.ticketDone.slice(t.detail.index+1)],this.ticketCompleted.emit(this.ticket)}handleGridClearAllEvent(t){let e=t.detail;this.ticketDone=[...this.ticketDone.slice(0,e),!1,...this.ticketDone.slice(e+1)],this.quickPicks[e]=!1}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.autoSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!0}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)],this.resetSelection.emit({ticketId:this.ticketId,index:t}),this.quickPicks[t]=!1}changeStake(t,e){this.stakeChange.emit({ticketId:t,stake:e})}toggleClass(){this.isCustomSelect=!this.isCustomSelect}toggleSelection(){this.isCustomSelectStake=!this.isCustomSelectStake}toggleLineSelection(){this.isCustomSelectLine=!this.isCustomSelectLine}toggleDrawSelection(){this.isCustomSelectDraw=!this.isCustomSelectDraw}setWagerPerDraw(t){this.amountInfo={value:t.value,currency:t.currency},this.isCustomSelect=!1,this.changeStake(this.ticketId,t.value)}setStakeMultiplier(t){this.stakeMultiplier=t,this.isCustomSelectStake=!1,this.multiplierChange.emit({ticketId:this.ticketId,multiplierNum:Number(t),multiplier:this.gameData.rules.stakeMultiplierAvailable})}setLineMultiplier(t){this.lineMultiplier=t,this.isCustomSelectLine=!1,this.lineMultiplierChange.emit({ticketId:this.ticketId,lineNum:t})}setDrawMultiplier(t){this.drawMultiplier=t,this.isCustomSelectDraw=!1,this.drawMultiplierChange.emit({ticketId:this.ticketId,drawCount:t})}handlePlayTypeChange(t){this.selectedPlayTypeId=t;let e=this.playType.filter((e=>e.id===t))[0];this.boardsAllowed=e.boardsAllowed,this.numberRange=e.selectionRules.map((t=>t.selectionCount)),this.maximumAllowed=Math.max(...this.numberRange),this.minimumAllowed=Math.min(...this.numberRange),this.secondaryNumberRange=e.secondarySelectionRules.map((t=>t.selectionCount)),this.secondaryMaximumAllowed=Math.max(...this.secondaryNumberRange),this.secondaryMinimumAllowed=Math.min(...this.secondaryNumberRange);for(let t=0;t<this.lineMultiplier;t++)this.toggleResetSelection(t);this.betTypeChange.emit({ticketId:this.ticketId,betType:e}),this.setLineMultiplier(this.boardsAllowed[0])}render(){if(this.isLoading)return i("div",null,i("p",null,c("loading",this.language)));if(this.hasErrors)return i("div",null,i("p",null,c("error",this.language)));{const{rules:t}=this.gameData;return i("div",{class:"TicketContainer",ref:t=>this.stylingContainer=t},i("p",{class:"TicketTitle"},this.gameData.name),i("div",{class:"TicketTabs"},this.groupType.map(((t,e)=>i("div",{class:"TabButton"+(this.tabIndex==e?" Active":""),onClick:()=>this.tabIndex=e},t.groupName)))),this.playType.length>1&&i("div",null,i("label",{class:"Label"},c("playType",this.language),": "),i("vaadin-select",{style:{width:"160px"},items:this.playType,value:this.selectedPlayTypeId,"on-value-changed":t=>this.handlePlayTypeChange(t.detail.value)})),this.boardsAllowed.length>1&&i("div",null,i("label",{class:"Label"},c("lines",this.language),": "),i("div",{class:"WagerInput"},i("div",{ref:t=>this.selectLineRef=t,class:this.isCustomSelectLine?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleLineSelection()},i("span",null,this.lineMultiplier),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},this.boardsAllowed.map((t=>i("li",{class:this.lineMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setLineMultiplier(t)},t)))))))),this.grids.map(((e,s)=>i("div",null,i("div",{class:"TicketGridHeader"},i("div",null,c("lineName",this.language),s+1),this.resetButton&&this.ticketDone[s]&&i("div",{class:"ButtonContainer"},i("a",{class:"ResetButton",onClick:()=>this.toggleResetSelection(s)},c("resetButton",this.language))),this.autoPick&&!this.ticketDone[s]&&i("div",{class:"ButtonContainer"},i("a",{class:"AutoButton",onClick:()=>this.toggleAutoSelection(s)},c("autoButton",this.language)))),i("div",{class:"TicketGridBullets"},i("p",{class:"TicketGridTitle"},t.boards[0].selectionName),i("lottery-grid",{"grid-index":s,"maximum-allowed":this.maximumAllowed,"minimum-allowed":this.minimumAllowed,"number-range":JSON.stringify(this.numberRange),"high-number":t.boards[0].highNumber,"low-number":t.boards[0].lowNumber,"total-numbers":t.boards[0].highNumber-t.boards[0].lowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"mainSelection","client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),this.secondarySelectionAllowed&&i("div",{class:"SecondarySelectionWrapper"},i("div",{class:"TicketGridBullets"},i("p",{class:"TicketGridTitle"},t.boards[0].secondarySelectionName),i("lottery-grid",{"grid-index":s,"maximum-allowed":this.secondaryMaximumAllowed,"minimum-allowed":this.secondaryMinimumAllowed,"number-range":JSON.stringify(this.secondaryNumberRange),"high-number":t.boards[0].secondaryHighNumber,"low-number":t.boards[0].secondaryLowNumber,"total-numbers":t.boards[0].secondaryHighNumber-t.boards[0].secondaryLowNumber+1,selectable:!0,"reset-button":!0,"auto-pick":!0,"game-id":this.gameId,"ticket-id":this.ticketId,"partial-quickpick-available":this.partialQuickpickAvailable,language:this.language,"translation-url":this.translationUrl,"selection-type":"secondarySelection","client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})))))),t.stakeMultiplierAvailable&&i("div",null,i("label",{class:"Label"},c("multiplier",this.language),": "),i("div",{class:"WagerInput"},t.stakeMultipliers.length>1?i("div",{ref:t=>this.selectStakeRef=t,class:this.isCustomSelectStake?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleSelection()},i("span",null,this.stakeMultiplier),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},t.stakeMultipliers.map((t=>i("li",{class:this.stakeMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setStakeMultiplier(t)},t)))))):i("div",null,i("input",{min:"1",value:t.stakeMultipliers[0]||1,type:"number",disabled:!0})))),t.drawMultiplierAvailable&&i("div",null,i("label",{class:"Label"},c("numberOfDraws",this.language),": "),i("div",{class:"WagerInput"},t.durations.length>1?i("div",{ref:t=>this.selectDrawRef=t,class:this.isCustomSelectDraw?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleDrawSelection()},i("span",null,this.drawMultiplier),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},t.durations.map((t=>i("li",{class:this.drawMultiplier==t?"SelectedValue":"",value:t,onClick:()=>this.setDrawMultiplier(t)},t)))))):i("div",null,i("input",{min:"1",value:t.durations[0]||1,type:"number",disabled:!0})))),i("div",null,i("label",{class:"Label"},c("wagerPerDraw",this.language),": "),i("div",{class:"WagerInput"},t.stakes.length>1?i("div",{ref:t=>this.selectRef=t,class:this.isCustomSelect?"SelectWrapper SelectActive":"SelectWrapper"},i("div",{class:"SelectButton",onClick:()=>this.toggleClass()},i("span",null,this.amountInfo.value," ",this.amountInfo.currency),i("span",{class:"SelectExpand"},"▼")),i("div",{class:"SelectContent"},i("ul",{class:"SelectOptions"},t.stakes.map((t=>i("li",{class:this.amountInfo.value==t.value?"SelectedValue":"",value:t.value,onClick:()=>this.setWagerPerDraw(t)},t.value," ",t.currency)))))):i("div",null,i("input",{min:"1",value:t.stakes[0].value,type:"number",disabled:!0}),i("span",{class:"WagerInputTitle"},t.stakes[0].currency)))))}}static get watchers(){return{lineMultiplier:["handleLineMultiplierChange"],tabIndex:["handleTabIndexChange"]}}};yl.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.TicketTabs{display:flex;overflow:auto}.TicketTabs .TabButton{color:var(--emw--color-typography, #009993);margin:0 40px 10px 0;cursor:pointer}.TicketTabs .Active{border-bottom:1px solid var(--emw--color-typography, #009993)}.ButtonContainer{display:flex;justify-content:flex-end}.SecondarySelectionWrapper{margin-top:20px}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:var(--emw--button-text-color, #000)}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:var(--emw--button-text-color, #000);padding:10px;margin-left:8px}.AutoButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;border:1px solid var(--emw--button-border-color, #00958f);background:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));color:var(--emw--button-text-color, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:var(--emw--button-background-color, #00958f);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.ResetButton{cursor:pointer;display:inline-block;border-radius:var(--emw--button-border-radius, 4px);padding:8px 20px;width:max-content;margin:5px 0;color:var(--emw--button-text-color, #000);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:var(--emw--color-error, #FF3D00);border:1px solid var(--emw--color-error, #FF3D00);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.ResetButton:hover{background:var(--emw--color-secondary, #FF6536);border:1px solid var(--emw--color-error, #FF3D00)}.TicketGridHeader{display:flex;justify-content:space-between;align-items:center;font-weight:bold;margin-top:10px}.TicketGridBullets{background:var(--emw--color-gray-50, #F1F1F1);border-radius:4px;padding:20px;margin-top:5px;margin-bottom:10px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:var(--emw--color-background, #009993)}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));background:var(--emw--color-background, #009993)}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid var(--emw--color-gray-transparency-80, #ccc);border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid var(--emw--color-gray-transparency-80, #ccc);overflow:hidden;background:var(--emw--color-gray-transparency-100, rgb(255, 255, 255));z-index:20}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:var(--emw--color-background, #009993);color:var(--emw--color-gray-transparency-100, rgb(255, 255, 255))}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:var(--emw--color-gray-50, #F1F1F1);border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:var(--emw--color-gray-transparency-80, #ccc);border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:var(--emw--color-gray-150, #f2f2f2)}';const wl=["ro","en","fr","ar","hr"],_l={en:{ticket:"Ticket"},ro:{ticket:"Bilet"},fr:{ticket:"Billet"},ar:{ticket:"تذكرة"},hr:{ticket:"Listić"}},xl=(t,e)=>{const i=e;return _l[void 0!==i&&wl.includes(i)?i:"en"][t]},kl=class{constructor(i){t(this,i),this.deleteTicketEvent=e(this,"deleteTicket",7),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=document.createElement("style");setTimeout((()=>{t.innerHTML=this.clientStylingUrlContent,this.stylingContainer.prepend(t)}),1)},this.endpoint="",this.ticketId=1,this.ticketDescription=void 0,this.gameId=void 0,this.postMessage=!1,this.eventName="deleteTicketAction",this.collapsed=!0,this.numberOfGrids=1,this.last=!1,this.language="en",this.autoPick=!1,this.resetButton=!1,this.totalControllers=1,this.clientStyling="",this.clientStylingUrlContent="",this.translationUrl=void 0,this.limitStylingAppends=!1}helperAccordionActionHandler(){this.postMessage&&window.postMessage({type:this.eventName},window.location.href),this.deleteTicketEvent.emit({ticketId:this.ticketId})}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])_l[e][i]=t[e][i]})))}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrlContent&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return i("div",{key:"581989035aa42a397cd39a4cdd929ea91190494c",class:"LotteryTicketControllerContainer",ref:t=>this.stylingContainer=t},i("helper-accordion",{key:"724d50d1532510344ed7acd57c3c5faef17aef8c","header-title":`${xl("ticket",this.language)} ${this.ticketId}`,"header-subtitle":this.ticketDescription,footer:!0,"delete-tab":1!==this.totalControllers,collapsed:!this.last||this.collapsed,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("div",{key:"ba851ea2792641971a5552a94558fe8d28068187",slot:"accordionContent"},i("lottery-ticket",{key:"199abc15160d60499d7d1d1d14084f64a6314c53",endpoint:this.endpoint,"game-id":this.gameId,"ticket-id":this.ticketId,"number-of-grids":this.numberOfGrids,language:this.language,"translation-url":this.translationUrl,"reset-button":this.resetButton,"auto-pick":this.autoPick,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}))))}};kl.style=':host{font-family:"Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}';export{r as helper_accordion,n as lottery_bullet,a as lottery_grid,yl as lottery_ticket,kl as lottery_ticket_controller}
|