@ni/spright-components 6.6.3 → 6.6.4

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.
@@ -1199,12 +1199,12 @@ const ad=rd.compose({baseName:"anchor",baseClass:xn,template:(t,e)=>Q`${""}<div
1199
1199
  >${""}<span
1200
1200
  part="start"
1201
1201
  ${Pt("startContainer")}
1202
- class="${t=>e.start?"start":null}"
1202
+ class="${t=>void 0!==e.start?"start":null}"
1203
1203
  ><slot
1204
1204
  name="start"
1205
1205
  ${Pt("start")}
1206
1206
  @slotchange="${t=>t.handleStartContentChange()}">
1207
- ${e.start||""}
1207
+ ${e.start??""}
1208
1208
  </slot
1209
1209
  ></span
1210
1210
  ><span
@@ -1217,12 +1217,12 @@ const ad=rd.compose({baseName:"anchor",baseClass:xn,template:(t,e)=>Q`${""}<div
1217
1217
  ><span
1218
1218
  part="end"
1219
1219
  ${Pt("endContainer")}
1220
- class=${t=>e.end?"end":null}
1220
+ class=${t=>void 0!==e.end?"end":null}
1221
1221
  ><slot
1222
1222
  name="end"
1223
1223
  ${Pt("end")}
1224
1224
  @slotchange="${t=>t.handleEndContentChange()}">
1225
- ${e.end||""}
1225
+ ${e.end??""}
1226
1226
  </slot
1227
1227
  ></span></a></div>`,styles:sd,shadowOptions:{delegatesFocus:!0}})
1228
1228
  $i.getOrCreate().withPrefix("nimble").register(ad())
@@ -3008,15 +3008,15 @@ const yg=bg.compose({baseName:"checkbox",baseClass:Vn,template:(t,e)=>Q`
3008
3008
  <div part="container" class="container">
3009
3009
  <div part="control" class="control">
3010
3010
  <slot name="checked-indicator">
3011
- ${e.checkedIndicator||""}
3011
+ ${e.checkedIndicator??""}
3012
3012
  </slot>
3013
3013
  <slot name="indeterminate-indicator">
3014
- ${e.indeterminateIndicator||""}
3014
+ ${e.indeterminateIndicator??""}
3015
3015
  </slot>
3016
3016
  </div>
3017
3017
  <label
3018
3018
  part="label"
3019
- class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
3019
+ class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
3020
3020
  >
3021
3021
  <slot ${Qt("defaultSlottedNodes")}></slot>
3022
3022
  </label>
@@ -3529,15 +3529,15 @@ function Ng(t){return Q`
3529
3529
  let Bg=class extends Bi{}
3530
3530
  class Pg extends(Dn(Bg)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}function zg(t){class e extends t{constructor(){super(...arguments),this.requiredVisible=!1}}return ft({attribute:"required-visible",mode:"boolean"})(e.prototype,"requiredVisible"),e}class Vg extends(vg(zg(Pg))){constructor(){super(...arguments),this.appearance=$g,this.appearanceReadOnly=!1,this.fullBleed=!1,this.open=!1,this.filteredOptions=[],this.hasOverflow=!1,this.listboxId=yn("listbox-"),this.availableViewportHeight=0,this.valueUpdatedByInput=!1,this._value="",this.filter="",this.forcedPosition=!1}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
3531
3531
  let n=t
3532
- if(this.$fastController.isConnected&&this.options){const e=this.findIndexOfValidOption(t),i=this.options[this.selectedIndex]?.text,o=this.options[e]?.text
3533
- i!==o&&(this.selectedIndex=e),n=this.firstSelectedOption?.text||n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value")),this.filter=t,this.filterOptions(),this.selectedIndex=this.findIndexOfValidOption(this.value)}get options(){return x.track(this,"options"),this.filteredOptions&&this.filter?this.filteredOptions:this._options}set options(t){this._options=t,x.notify(this,"options")}get isAutocompleteInline(){return this.autocomplete===Xn||this.isAutocompleteBoth}get isAutocompleteList(){return this.autocomplete===Jn||this.isAutocompleteBoth}get isAutocompleteBoth(){return this.autocomplete===Qn}slottedOptionsChanged(t,e){const n=this.value
3532
+ if(this.$fastController.isConnected){const e=this.findIndexOfValidOption(t),i=this.options[this.selectedIndex]?.text,o=this.options[e]?.text
3533
+ i!==o&&(this.selectedIndex=e),n=this.firstSelectedOption?.text||n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value")),this.filter=t,this.filterOptions(),this.selectedIndex=this.findIndexOfValidOption(this.value)}get options(){return x.track(this,"options"),this.filter?this.filteredOptions:this._options}set options(t){this._options=t,x.notify(this,"options")}get isAutocompleteInline(){return this.autocomplete===Xn||this.isAutocompleteBoth}get isAutocompleteList(){return this.autocomplete===Jn||this.isAutocompleteBoth}get isAutocompleteBoth(){return this.autocomplete===Qn}slottedOptionsChanged(t,e){const n=this.value
3534
3534
  super.slottedOptionsChanged(t,e),this.updateValue(),n&&(this.value=n)}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.value&&(this.initialValue=this.value),this.setPositioning(),this.updateInputAriaLabel()}clickHandler(t){if(this.disabled)return!1
3535
3535
  if(this.open){const e=t.target.closest("option,[role=option]")
3536
3536
  if(!e||e.disabled)return!1
3537
3537
  this.selectedOptions=[e],this.control.value=e.text,this.clearSelectionRange(),this.updateValue(!0)}return this.open=!this.open,this.open&&this.control.focus(),!0}toggleButtonClickHandler(t){t.stopImmediatePropagation()}toggleButtonChangeHandler(t){this.open=this.dropdownButton.checked,t.stopImmediatePropagation()}toggleButtonKeyDownHandler(t){switch(t.key){case sn:case en:case un:case rn:return this.open=!0,this.stopPropagation(t),!1
3538
3538
  default:return!0}}filterOptions(){this.autocomplete&&this.autocomplete!==ti||(this.filter="")
3539
3539
  const t=this.filter.toLowerCase()
3540
- this.filteredOptions=this._options.filter((e=>e.text.toLowerCase().startsWith(t)&&!e.hidden)),this.isAutocompleteList&&this._options.forEach((t=>{t.visuallyHidden=!this.filteredOptions.includes(t)}))}inputHandler(t){return this.filter=this.control.value,this.filterOptions(),this.isAutocompleteInline||(this.selectedIndex=this.findIndexOfValidOption(this.control.value)),!t.inputType.includes("deleteContent")&&this.filter.length&&(this.isAutocompleteList&&!this.open&&(this.open=!0),this.isAutocompleteInline&&(this.filteredOptions.length?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption),this.setInlineSelection()):this.selectedIndex=-1)),this.valueUpdatedByInput||(this.valueBeforeTextUpdate=this.value),this.valueUpdatedByInput=!0,this.value!==this.control.value&&this.focusAndScrollOptionIntoView(),this.value=this.control.value,!0}keydownHandler(t){if(t.ctrlKey||t.altKey)return!0
3540
+ this.filteredOptions=this._options.filter((e=>e.text.toLowerCase().startsWith(t)&&!e.hidden)),this.isAutocompleteList&&this._options.forEach((t=>{t.visuallyHidden=!this.filteredOptions.includes(t)}))}inputHandler(t){return this.filter=this.control.value,this.filterOptions(),this.isAutocompleteInline||(this.selectedIndex=this.findIndexOfValidOption(this.control.value)),!t.inputType.includes("deleteContent")&&this.filter.length>0&&(this.isAutocompleteList&&!this.open&&(this.open=!0),this.isAutocompleteInline&&(this.filteredOptions.length>0?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption),this.setInlineSelection()):this.selectedIndex=-1)),this.valueUpdatedByInput||(this.valueBeforeTextUpdate=this.value),this.valueUpdatedByInput=!0,this.value!==this.control.value&&this.focusAndScrollOptionIntoView(),this.value=this.control.value,!0}keydownHandler(t){if(t.ctrlKey||t.altKey)return!0
3541
3541
  switch(t.key){case rn:this.syncValue(),this.isAutocompleteInline&&(this.filter=this.value),this.open=!1,this.clearSelectionRange(),this.emitChangeIfValueUpdated()
3542
3542
  break
3543
3543
  case an:if(this.isAutocompleteInline||(this.selectedIndex=-1),this.open){this.open=!1
@@ -3550,8 +3550,8 @@ case en:case sn:if(this.filterOptions(),!this.open){this.open=!0
3550
3550
  break}this.filteredOptions.length>0&&super.keydownHandler(t),this.isAutocompleteInline&&this.setInlineSelection(),this.open&&this.valueUpdatedByInput&&(this.valueUpdatedByInput=!1)
3551
3551
  break
3552
3552
  default:return!0}return!0}keyupHandler(t){switch(t.key){case"ArrowLeft":case"ArrowRight":case"Backspace":case"Delete":case"Home":case"End":this.filter=this.control.value,this.selectedIndex=-1,this.filterOptions()}return!0}focusoutHandler(t){if(this.syncValue(),this.open){const e=t.relatedTarget
3553
- this.isSameNode(e)&&this.focus()}return this.open=!1,this.emitChangeIfValueUpdated(),!0}formResetCallback(){super.formResetCallback(),this.setDefaultSelectedOption(),this.updateValue()}validate(){super.validate(this.control)}setDefaultSelectedOption(){if(this.$fastController.isConnected&&this.options){const t=this.options.findIndex((t=>!t.disabled&&(null!==t.getAttribute("selected")||t.selected)))
3554
- this.selectedIndex=t,!this.dirtyValue&&this.firstSelectedOption&&(this.value=this.firstSelectedOption.text),this.setSelectedOptions()}}selectedIndexChanged(t,e){if(this.$fastController.isConnected){let n=gn(-1,this.options.length-1,e)
3553
+ this.isSameNode(e)&&this.focus()}return this.open=!1,this.emitChangeIfValueUpdated(),!0}formResetCallback(){super.formResetCallback(),this.setDefaultSelectedOption(),this.updateValue()}validate(){super.validate(this.control)}setDefaultSelectedOption(){if(this.$fastController.isConnected){const t=this.options.findIndex((t=>!t.disabled&&(null!==t.getAttribute("selected")||t.selected)))
3554
+ this.selectedIndex=t,this.dirtyValue||null===this.firstSelectedOption||(this.value=this.firstSelectedOption.text),this.setSelectedOptions()}}selectedIndexChanged(t,e){if(this.$fastController.isConnected){let n=gn(-1,this.options.length-1,e)
3555
3555
  if(this.options[n]?.disabled&&(n=-1),n!==this.selectedIndex)return void(this.selectedIndex=n)
3556
3556
  super.selectedIndexChanged(t,n),this.setSelectedOptions()}}disabledChanged(t,e){super.disabledChanged&&super.disabledChanged(t,e),this.ariaDisabled=this.disabled?"true":"false"}selectNextOption(){if(!this.disabled){let t=this.selectedIndex
3557
3557
  do{if(t+1>=this.options.length)return
@@ -3560,7 +3560,7 @@ this.selectedIndex=t}}selectPreviousOption(){if(!this.disabled){let t=this.selec
3560
3560
  do{if(t-=1,t<0)break}while(this.options[t].disabled)
3561
3561
  this.selectedIndex=t}}setPositioning(){if(!this.$fastController.isConnected)return
3562
3562
  const t=this.getBoundingClientRect(),e=window.innerHeight-t.bottom
3563
- this.forcedPosition?this.position=this.positionAttribute:t.top>e?this.position=Gn:this.position=Zn,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.availableViewportHeight=this.position===Gn?Math.trunc(t.top):Math.trunc(e)}focusAndScrollOptionIntoView(){this.open&&this.contains(document.activeElement)&&(this.control.focus(),this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})})))}openChanged(){this.open?(this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),b.queueUpdate((()=>this.focus()))):(this.ariaControls="",this.ariaExpanded="false"),this.dropdownButton&&(this.dropdownButton.checked=this.open)}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder??"")}setSelectedOptions(){this.selectedOptions=this.selectedIndex>-1?[this.options[this.selectedIndex]]:[],this.ariaActiveDescendant=this.firstSelectedOption?.id??"",this.focusAndScrollOptionIntoView()}selectedOptionsChanged(t,e){this.$fastController.isConnected&&this._options.forEach((t=>{t.selected=e.includes(t)}))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}regionChanged(t,e){this.region&&this.controlWrapper&&(this.region.anchorElement=this.controlWrapper)}controlWrapperChanged(t,e){this.region&&this.controlWrapper&&(this.region.anchorElement=this.controlWrapper)}ariaLabelChanged(t,e){this.updateInputAriaLabel()}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.text||this.control.value,this.control.value=this.value),t&&this.$emit("change")}setInputToSelection(){this.firstSelectedOption&&(this.control.value=this.firstSelectedOption.text,this.control.focus())}setInlineSelection(){this.firstSelectedOption&&(this.setInputToSelection(),this.control.setSelectionRange(this.filter.length,this.control.value.length,"backward"))}clearSelectionRange(){const t=this.control.value.length
3563
+ this.forcedPosition?this.position=this.positionAttribute:t.top>e?this.position=Gn:this.position=Zn,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.availableViewportHeight=this.position===Gn?Math.trunc(t.top):Math.trunc(e)}focusAndScrollOptionIntoView(){this.open&&this.contains(document.activeElement)&&(this.control.focus(),null!==this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})})))}openChanged(){this.open?(this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),b.queueUpdate((()=>this.focus()))):(this.ariaControls="",this.ariaExpanded="false"),this.dropdownButton&&(this.dropdownButton.checked=this.open)}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder??"")}setSelectedOptions(){this.selectedOptions=this.selectedIndex>-1?[this.options[this.selectedIndex]]:[],this.ariaActiveDescendant=this.firstSelectedOption?.id??"",this.focusAndScrollOptionIntoView()}selectedOptionsChanged(t,e){this.$fastController.isConnected&&this._options.forEach((t=>{t.selected=e.includes(t)}))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}regionChanged(t,e){this.region&&(this.region.anchorElement=this.controlWrapper)}controlWrapperChanged(t,e){this.region&&(this.region.anchorElement=this.controlWrapper)}ariaLabelChanged(t,e){this.updateInputAriaLabel()}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.text||this.control.value,this.control.value=this.value),t&&this.$emit("change")}setInputToSelection(){null!==this.firstSelectedOption&&(this.control.value=this.firstSelectedOption.text,this.control.focus())}setInlineSelection(){null!==this.firstSelectedOption&&(this.setInputToSelection(),this.control.setSelectionRange(this.filter.length,this.control.value.length,"backward"))}clearSelectionRange(){const t=this.control.value.length
3564
3564
  this.control.setSelectionRange(t,t)}syncValue(){const t=this.selectedIndex>-1?this.firstSelectedOption?.text:this.control.value
3565
3565
  this.updateValue(this.value!==t)}updateInputAriaLabel(){const t=this.shadowRoot?.querySelector(".selected-value")
3566
3566
  this.ariaLabel?t?.setAttribute("aria-label",this.ariaLabel):t?.removeAttribute("aria-label")}emitChangeIfValueUpdated(){this.valueUpdatedByInput&&(this.value!==this.valueBeforeTextUpdate&&this.$emit("change"),this.valueUpdatedByInput=!1)}findIndexOfValidOption(t){return this.options.findIndex((e=>!e.disabled&&e.text===t))}}t([ft],Vg.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],Vg.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"full-bleed",mode:"boolean"})],Vg.prototype,"fullBleed",void 0),t([ft({attribute:"autocomplete",mode:"fromView"})],Vg.prototype,"autocomplete",void 0),t([ft({attribute:"position"})],Vg.prototype,"positionAttribute",void 0),t([ft({attribute:"open",mode:"boolean"})],Vg.prototype,"open",void 0),t([ft],Vg.prototype,"placeholder",void 0),t([C],Vg.prototype,"position",void 0),t([C],Vg.prototype,"region",void 0),t([C],Vg.prototype,"controlWrapper",void 0),t([C],Vg.prototype,"control",void 0),t([C],Vg.prototype,"listbox",void 0),t([C],Vg.prototype,"dropdownButton",void 0),t([C],Vg.prototype,"filteredOptions",void 0),t([C],Vg.prototype,"hasOverflow",void 0),t([C],Vg.prototype,"availableViewportHeight",void 0)
@@ -3602,7 +3602,7 @@ const Hg=Vg.compose({baseName:"combobox",baseClass:Pg,template:(t,e)=>Q`
3602
3602
  />
3603
3603
  <div class="indicator" part="indicator" aria-hidden="true">
3604
3604
  <slot name="indicator">
3605
- ${e.indicator||""}
3605
+ ${e.indicator??""}
3606
3606
  </slot>
3607
3607
  </div>
3608
3608
  </slot>
@@ -3791,7 +3791,7 @@ const Ug=Symbol("user dismissed"),qg=$t`
3791
3791
  `
3792
3792
  class Wg extends Ve{constructor(){super(...arguments),this.preventDismiss=!1,this.headerHidden=!1,this.footerHidden=!1,this.footerIsEmpty=!0}get open(){return void 0!==this.resolveShow}async show(){if(this.open)throw new Error("Dialog is already open")
3793
3793
  return this.dialogElement.showModal(),await new Promise(((t,e)=>{this.resolveShow=t}))}close(t){if(!this.open)throw new Error("Dialog is not open")
3794
- this.dialogElement.close(),this.doResolveShow(t)}slottedFooterElementsChanged(t,e){this.footerIsEmpty=!e?.length}cancelHandler(t){return this.preventDismiss?t.preventDefault():this.doResolveShow(Ug),!0}closeHandler(t){t.target===this.dialogElement&&this.resolveShow&&this.doResolveShow(Ug)}doResolveShow(t){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3794
+ this.dialogElement.close(),this.doResolveShow(t)}slottedFooterElementsChanged(t,e){this.footerIsEmpty=void 0===e||0===e.length}cancelHandler(t){return this.preventDismiss?t.preventDefault():this.doResolveShow(Ug),!0}closeHandler(t){t.target===this.dialogElement&&this.resolveShow&&this.doResolveShow(Ug)}doResolveShow(t){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
3795
3795
  this.resolveShow(t),this.resolveShow=void 0}}Wg.UserDismissed=Ug,t([ft({attribute:"prevent-dismiss",mode:"boolean"})],Wg.prototype,"preventDismiss",void 0),t([ft({attribute:"header-hidden",mode:"boolean"})],Wg.prototype,"headerHidden",void 0),t([ft({attribute:"footer-hidden",mode:"boolean"})],Wg.prototype,"footerHidden",void 0),t([C],Wg.prototype,"footerIsEmpty",void 0),t([C],Wg.prototype,"slottedFooterElements",void 0),qe(Wg,wn)
3796
3796
  const Gg=Wg.compose({baseName:"dialog",template:jg,styles:qg,baseClass:Wg})
3797
3797
  $i.getOrCreate().withPrefix("nimble").register(Gg())
@@ -4415,16 +4415,16 @@ this.menuItems[this.focusIndex]?.setAttribute("tabindex","-1"),this.menuItems[t]
4415
4415
  void 0!==this.menuItems&&e!==this.menuItems[this.focusIndex]&&(this.menuItems[this.focusIndex]?.setAttribute("tabindex","-1"),this.focusIndex=this.menuItems.indexOf(e),e.setAttribute("tabindex","0"))},this.handleExpandedChanged=t=>{if(t.defaultPrevented||null===t.target||!this.menuItems?.includes(t.target))return
4416
4416
  t.preventDefault()
4417
4417
  const e=t.target
4418
- null===this.expandedItem||e!==this.expandedItem||!1!==e.expanded?e.expanded&&(null!==this.expandedItem&&this.expandedItem!==e&&(this.expandedItem.expanded=!1),this.menuItems[this.focusIndex]?.setAttribute("tabindex","-1"),this.expandedItem=e,this.focusIndex=this.menuItems.indexOf(e),e.setAttribute("tabindex","0")):this.expandedItem=null},this.removeItemListeners=()=>{void 0!==this.menuItems&&this.menuItems.forEach((t=>{t.removeEventListener("expanded-change",this.handleExpandedChanged),t.removeEventListener("focus",this.handleItemFocus)}))},this.setItems=()=>{const t=this.domChildren()
4418
+ null===this.expandedItem||e!==this.expandedItem||e.expanded?e.expanded&&(null!==this.expandedItem&&this.expandedItem!==e&&(this.expandedItem.expanded=!1),this.menuItems[this.focusIndex]?.setAttribute("tabindex","-1"),this.expandedItem=e,this.focusIndex=this.menuItems.indexOf(e),e.setAttribute("tabindex","0")):this.expandedItem=null},this.removeItemListeners=()=>{void 0!==this.menuItems&&this.menuItems.forEach((t=>{t.removeEventListener("expanded-change",this.handleExpandedChanged),t.removeEventListener("focus",this.handleItemFocus)}))},this.setItems=()=>{const t=this.domChildren()
4419
4419
  this.removeItemListeners(),this.menuItems=t
4420
4420
  const e=this.menuItems.filter(this.isMenuItemElement)
4421
- e.length&&(this.focusIndex=0)
4421
+ e.length>0&&(this.focusIndex=0)
4422
4422
  const n=e.reduce(((t,e)=>{const n=function(t){const e=t.getAttribute("role"),n=t.querySelector("[slot=start]")
4423
4423
  return e!==Pi&&null===n||e===Pi&&null!==n?1:e!==Pi&&null!==n?2:0}(e)
4424
4424
  return t>n?t:n}),0)
4425
4425
  e.forEach(((t,e)=>{t.setAttribute("tabindex",0===e?"0":"-1"),t.addEventListener("expanded-change",this.handleExpandedChanged),t.addEventListener("focus",this.handleItemFocus),(t instanceof Ui||"startColumnCount"in t)&&(t.startColumnCount=n)}))},this.changeHandler=t=>{if(void 0===this.menuItems)return
4426
4426
  const e=t.target,n=this.menuItems.indexOf(e)
4427
- if(-1!==n&&"menuitemradio"===e.role&&!0===e.checked){for(let t=n-1;t>=0;--t){const e=this.menuItems[t],n=e.getAttribute("role")
4427
+ if(-1!==n&&"menuitemradio"===e.role&&e.checked){for(let t=n-1;t>=0;--t){const e=this.menuItems[t],n=e.getAttribute("role")
4428
4428
  if(n===Vi&&(e.checked=!1),"separator"===n)break}const t=this.menuItems.length-1
4429
4429
  for(let e=n+1;e<=t;++e){const t=this.menuItems[e],n=t.getAttribute("role")
4430
4430
  if(n===Vi&&(t.checked=!1),"separator"===n)break}}},this.isMenuItemElement=e=>Ze(e)&&Object.prototype.hasOwnProperty.call(t.focusableElementRoles,e.getAttribute("role")),this.isFocusableElement=t=>this.isMenuItemElement(t)}connectedCallback(){super.connectedCallback(),b.queueUpdate((()=>{this.setItems()})),this.addEventListener("change",this.changeHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeItemListeners(),this.menuItems=void 0,this.removeEventListener("change",this.changeHandler)}focus(){this.setFocus(0,1)}collapseExpandedItem(){null!==this.expandedItem&&(this.expandedItem.expanded=!1,this.expandedItem=null)}handleMenuKeyDown(t){if(t.defaultPrevented||void 0===this.menuItems)return!1
@@ -4571,13 +4571,13 @@ return!(!this.contains(e)&&!this.getMenu()?.contains(e))||(this.setOpen(!1),!1)}
4571
4571
  case en:return this.setOpen(!0),!1
4572
4572
  default:return!0}}menuKeyDownHandler(t){return t.key!==an||(this.setOpen(!1),this.toggleButton.focus(),!1)}setOpen(t){if(this.open===t)return
4573
4573
  const e={oldState:this.open,newState:t}
4574
- this.$emit("beforetoggle",e),this.open=t}getMenu(){if(!this.slottedMenus?.length)return
4574
+ this.$emit("beforetoggle",e),this.open=t}getMenu(){if(!this.slottedMenus||0===this.slottedMenus.length)return
4575
4575
  let t=this.slottedMenus[0]
4576
4576
  for(;t;){if("menu"===t.getAttribute("role"))return t
4577
4577
  if(!this.isSlotElement(t))return
4578
4578
  {const e=t.assignedNodes()[0]
4579
4579
  t=e instanceof HTMLElement?e:void 0}}}isSlotElement(t){return"SLOT"===t?.nodeName}focusMenu(){this.getMenu()?.focus()}focusLastMenuItem(){const t=this.getMenu()?.querySelectorAll("[role=menuitem]")
4580
- if(t?.length){t[t.length-1].focus()}}}t([ft],_b.prototype,"appearance",void 0),t([ft({attribute:"appearance-variant"})],_b.prototype,"appearanceVariant",void 0),t([ft({mode:"boolean"})],_b.prototype,"disabled",void 0),t([ft({attribute:"content-hidden",mode:"boolean"})],_b.prototype,"contentHidden",void 0),t([ft({attribute:"tabindex",converter:ut})],_b.prototype,"tabIndex",void 0),t([ft({mode:"boolean"})],_b.prototype,"open",void 0),t([ft({attribute:"position"})],_b.prototype,"position",void 0),t([C],_b.prototype,"toggleButton",void 0),t([C],_b.prototype,"region",void 0),t([C],_b.prototype,"slottedMenus",void 0)
4580
+ if(t&&t.length>0){t[t.length-1].focus()}}}t([ft],_b.prototype,"appearance",void 0),t([ft({attribute:"appearance-variant"})],_b.prototype,"appearanceVariant",void 0),t([ft({mode:"boolean"})],_b.prototype,"disabled",void 0),t([ft({attribute:"content-hidden",mode:"boolean"})],_b.prototype,"contentHidden",void 0),t([ft({attribute:"tabindex",converter:ut})],_b.prototype,"tabIndex",void 0),t([ft({mode:"boolean"})],_b.prototype,"open",void 0),t([ft({attribute:"position"})],_b.prototype,"position",void 0),t([C],_b.prototype,"toggleButton",void 0),t([C],_b.prototype,"region",void 0),t([C],_b.prototype,"slottedMenus",void 0)
4581
4581
  const Mb=_b.compose({baseName:"menu-button",template:Sb,styles:kb,shadowOptions:{delegatesFocus:!0}})
4582
4582
  $i.getOrCreate().withPrefix("nimble").register(Mb())
4583
4583
  const $b="nimble-menu-button",Ib=$t`
@@ -4941,7 +4941,7 @@ const Ab="underline",Tb="outline",Db="block",Ob="frameless",Rb=$t`
4941
4941
  `)),Fb=Ng(Q`<label
4942
4942
  part="label"
4943
4943
  for="control"
4944
- class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
4944
+ class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
4945
4945
  >
4946
4946
  <slot ${Qt("defaultSlottedNodes")}></slot>
4947
4947
  </label>`)
@@ -5004,7 +5004,7 @@ const Lb=Nb.compose({baseName:"number-field",baseClass:Xi,template:(t,e)=>Q`
5004
5004
  @click="${t=>t.stepUp()}"
5005
5005
  >
5006
5006
  <slot name="step-up-glyph">
5007
- ${e.stepUpGlyph||""}
5007
+ ${e.stepUpGlyph??""}
5008
5008
  </slot>
5009
5009
  </div>
5010
5010
  <div
@@ -5013,7 +5013,7 @@ const Lb=Nb.compose({baseName:"number-field",baseClass:Xi,template:(t,e)=>Q`
5013
5013
  @click="${t=>t.stepDown()}"
5014
5014
  >
5015
5015
  <slot name="step-down-glyph">
5016
- ${e.stepDownGlyph||""}
5016
+ ${e.stepDownGlyph??""}
5017
5017
  </slot>
5018
5018
  </div>
5019
5019
  </div>
@@ -7886,17 +7886,17 @@ const dI="nimble-toolbar",hI="Bold",uI="Italics",pI="Bulleted List",fI="Numbered
7886
7886
  </${Hm}>
7887
7887
  </template>
7888
7888
  `,xI=t=>t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()
7889
- class CI extends Bi{constructor(){super(...arguments),this.availableViewportHeight=0,this.filter="",this.filteredOptions=[],this.anchorElementIntersectionObserver=new IntersectionObserver((t=>{t[0]?.isIntersecting||this.setOpen(!1)}),{threshold:1,root:document})}close(){this.setOpen(!1)}get options(){return x.track(this,"options"),this.filteredOptions?.length?this.filteredOptions:[]}set options(t){this._options=t,x.notify(this,"options")}show(t){const e=t.anchorNode.getBoundingClientRect().bottom
7889
+ class CI extends Bi{constructor(){super(...arguments),this.availableViewportHeight=0,this.filter="",this.filteredOptions=[],this.anchorElementIntersectionObserver=new IntersectionObserver((t=>{t[0]?.isIntersecting||this.setOpen(!1)}),{threshold:1,root:document})}close(){this.setOpen(!1)}get options(){return x.track(this,"options"),this.filteredOptions?.length>0?this.filteredOptions:[]}set options(t){this._options=t,x.notify(this,"options")}show(t){const e=t.anchorNode.getBoundingClientRect().bottom
7890
7890
  this.availableViewportHeight=Math.trunc(window.innerHeight-e),this.filter=t.filter,this.anchorElement=t.anchorNode,this.setOpen(!0),this.filterOptions()}keydownHandler(t){if(!this.open)return!1
7891
7891
  switch(t.key){case pn:case rn:{if(!this.hasSelectableOptions)return!1
7892
7892
  const t={href:this.firstSelectedOption.value,displayName:this.firstSelectedOption.text}
7893
7893
  return this.$emit("mention-selected",t),this.setOpen(!1),!0}case an:return this.setOpen(!1),!1
7894
7894
  default:return super.keydownHandler(t),!1}}filterOptions(){if(this.filter){const t=xI(this.filter)
7895
7895
  this.filteredOptions=this._options.filter((e=>xI(e.text).includes(t)))}else this.filteredOptions=this._options
7896
- this._options.forEach((t=>{t.hidden=!this.filteredOptions.includes(t)})),this.filteredOptions.length?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption)):(this.selectedOptions=[],this.selectedIndex=-1)}slottedOptionsChanged(t,e){super.slottedOptionsChanged(t,e),this.filterOptions()}clickHandler(t){const e=t.target.closest("option,[role=option]")
7896
+ this._options.forEach((t=>{t.hidden=!this.filteredOptions.includes(t)})),this.filteredOptions.length>0?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption)):(this.selectedOptions=[],this.selectedIndex=-1)}slottedOptionsChanged(t,e){super.slottedOptionsChanged(t,e),this.filterOptions()}clickHandler(t){const e=t.target.closest("option,[role=option]")
7897
7897
  if(!e||e.disabled)return!1
7898
7898
  const n={href:e.value,displayName:e.text}
7899
- return this.$emit("mention-selected",n),this.setOpen(!1),!0}anchorElementChanged(t,e){t&&this.anchorElementIntersectionObserver.unobserve(t),this.region&&this.anchorElement&&(this.region.anchorElement=this.anchorElement,this.region.update(),this.anchorElementIntersectionObserver.observe(e))}regionChanged(){this.regionNotifier&&this.regionNotifier.unsubscribe(this),this.regionNotifier=x.getNotifier(this.region),this.regionNotifier.subscribe(this)}handleChange(t,e){super.handleChange(t,e),"initialLayoutComplete"===e&&this.focusAndScrollOptionIntoView()}focusAndScrollOptionIntoView(){this.open&&this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})}))}setOpen(t){this.open=t}}t([C],CI.prototype,"open",void 0),t([C],CI.prototype,"region",void 0),t([C],CI.prototype,"availableViewportHeight",void 0),t([C],CI.prototype,"filteredOptions",void 0),t([C],CI.prototype,"anchorElement",void 0)
7899
+ return this.$emit("mention-selected",n),this.setOpen(!1),!0}anchorElementChanged(t,e){t&&this.anchorElementIntersectionObserver.unobserve(t),this.region&&this.anchorElement&&(this.region.anchorElement=this.anchorElement,this.region.update(),this.anchorElementIntersectionObserver.observe(e))}regionChanged(){this.regionNotifier&&this.regionNotifier.unsubscribe(this),this.regionNotifier=x.getNotifier(this.region),this.regionNotifier.subscribe(this)}handleChange(t,e){super.handleChange(t,e),"initialLayoutComplete"===e&&this.focusAndScrollOptionIntoView()}focusAndScrollOptionIntoView(){this.open&&null!==this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})}))}setOpen(t){this.open=t}}t([C],CI.prototype,"open",void 0),t([C],CI.prototype,"region",void 0),t([C],CI.prototype,"availableViewportHeight",void 0),t([C],CI.prototype,"filteredOptions",void 0),t([C],CI.prototype,"anchorElement",void 0)
7900
7900
  const kI=CI.compose({baseName:"rich-text-mention-listbox",template:wI,styles:yI})
7901
7901
  $i.getOrCreate().withPrefix("nimble").register(kI())
7902
7902
  const SI="nimble-rich-text-mention-listbox",_I=Q`
@@ -9156,7 +9156,7 @@ return null===n?{fragment:document.createDocumentFragment(),mentionedHrefs:Array
9156
9156
  return t.normalizeLinkText=t=>t,new _T(this.updatedSchema,t,$T.tokens)}static getCustomSchemaConfiguration(){return new Ny({nodes:yT.spec.nodes,marks:{link:{attrs:{href:{},rel:{default:"noopener noreferrer"},class:{default:""}},inclusive:!1,excludes:"_",toDOM(t){const e=t.attrs.href,n=OT.mentionConfigs?.find((t=>t.isValidMentionHref(e))),i=n?.getDisplayName(e)
9157
9157
  return n&&i?(OT.mentionedHrefs.add(e),[n.viewElement,{"mention-href":e,"mention-label":i}]):[ld,{href:OT.startsWithHttpOrHttps(e)?e:null,rel:t.attrs.rel,class:e,"underline-hidden":!OT.startsWithHttpOrHttps(e)||null}]}},em:yT.spec.marks.get("em"),strong:yT.spec.marks.get("strong")}})}static setup(t){OT.mentionConfigs=t,OT.mentionedHrefs.clear()}static cleanup(){OT.mentionConfigs=void 0,OT.mentionedHrefs.clear()}static startsWithHttpOrHttps(t){return/^https?:\/\//i.test(t)}}OT=RT,RT.mentionedHrefs=new Set,RT.updatedSchema=OT.getCustomSchemaConfiguration(),RT.markdownParser=OT.initializeMarkdownParser(),RT.domSerializer=Zy.fromSchema(OT.updatedSchema)
9158
9158
  class FT{constructor(t){this.markdownSerializer=this.initializeMarkdownSerializerForTipTap(t)}serializeDOMToMarkdown(t){return this.markdownSerializer.serialize(t)}initializeMarkdownSerializerForTipTap(t){const e=function(t,e){const n=e.attrs.href
9159
- t.write(`<${n}>`)},n={bulletList:AT.nodes.bullet_list,listItem:AT.nodes.list_item,orderedList:function(t,e){const n=e.attrs.start||1,i=String(n+e.childCount-1).length,o=t.repeat(" ",i+2)
9159
+ t.write(`<${n}>`)},n={bulletList:AT.nodes.bullet_list,listItem:AT.nodes.list_item,orderedList:function(t,e){const n=e.attrs.start??1,i=String(n+e.childCount-1).length,o=t.repeat(" ",i+2)
9160
9160
  t.renderList(e,o,(e=>{const o=String(n+e)
9161
9161
  return`${t.repeat(" ",i-o.length)+o}. `}))},doc:AT.nodes.doc,paragraph:AT.nodes.paragraph,text:AT.nodes.text,hardBreak:AT.nodes.hard_break}
9162
9162
  t.forEach((t=>{n[t]=e}))
@@ -9177,7 +9177,7 @@ class UT extends VT{constructor(t){super(HT),this.richText=t,this.updateQueued=!
9177
9177
  break
9178
9178
  case"pattern":this.track("pattern")
9179
9179
  break
9180
- case"buttonLabel":this.track("buttonLabel")}this.queueUpdate()}trackMentionElementsInstancesChanged(){this.track("pattern"),this.track("mappingConfigs"),this.track("buttonLabel"),this.queueUpdate()}queueUpdate(){this.richText.$fastController.isConnected&&(this.updateQueued||(this.updateQueued=!0,b.queueUpdate((()=>{this.richText.createConfig(),this.untrackAll(),this.updateQueued=!1}))))}}class qT{constructor(){this.invalidMentionConfiguration=!1,this.duplicateMentionConfiguration=!1}getValidity(){return{invalidMentionConfiguration:this.invalidMentionConfiguration,duplicateMentionConfiguration:this.duplicateMentionConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!1===t))}validate(t){this.validateDuplicateMentionConfigurations(t),this.validateMentionConfigurations(t)}validateMentionConfigurations(t){return this.invalidMentionConfiguration=t.some((t=>!t.mentionInternals.validator.isValid())),!this.invalidMentionConfiguration}validateDuplicateMentionConfigurations(t){const e=t.map((t=>t.mentionInternals.character))
9180
+ case"buttonLabel":this.track("buttonLabel")}this.queueUpdate()}trackMentionElementsInstancesChanged(){this.track("pattern"),this.track("mappingConfigs"),this.track("buttonLabel"),this.queueUpdate()}queueUpdate(){this.richText.$fastController.isConnected&&(this.updateQueued||(this.updateQueued=!0,b.queueUpdate((()=>{this.richText.createConfig(),this.untrackAll(),this.updateQueued=!1}))))}}class qT{constructor(){this.invalidMentionConfiguration=!1,this.duplicateMentionConfiguration=!1}getValidity(){return{invalidMentionConfiguration:this.invalidMentionConfiguration,duplicateMentionConfiguration:this.duplicateMentionConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!t))}validate(t){this.validateDuplicateMentionConfigurations(t),this.validateMentionConfigurations(t)}validateMentionConfigurations(t){return this.invalidMentionConfiguration=t.some((t=>!t.mentionInternals.validator.isValid())),!this.invalidMentionConfiguration}validateDuplicateMentionConfigurations(t){const e=t.map((t=>t.mentionInternals.character))
9181
9181
  return this.duplicateMentionConfiguration=e.length!==new Set(e).size,!this.duplicateMentionConfiguration}}async function jT(t){const e=t.map((async t=>{t.matches(":not(:defined)")&&await customElements.whenDefined(t.localName)}))
9182
9182
  await Promise.all(e)}class WT extends Ve{constructor(){super(...arguments),this.mentionInternalsNotifiers=[],this.childItems=[],this.richTextUpdateTracker=new UT(this),this.richTextValidator=new qT}get validity(){return this.richTextValidator.getValidity()}checkValidity(){return this.richTextValidator.isValid()}handleChange(t,e){t instanceof NT&&"string"==typeof e&&this.richTextUpdateTracker.trackMentionInternalsPropertyChanged(e)}createConfig(){this.validate(),this.richTextValidator.isValid()?(this.richTextUpdateTracker.updateMappingConfigs||this.richTextUpdateTracker.updatePattern)&&(this.configuration=new PT(this.mentionElements)):this.configuration=void 0}validate(){this.richTextValidator.validate(this.mentionElements)}childItemsChanged(t,e){void 0!==t&&this.updateMentionElementsFromChildItems()}async updateMentionElementsFromChildItems(){await jT(this.childItems),this.mentionElements=this.childItems.filter((t=>t instanceof LT)),this.observeMentionInternals(),this.richTextUpdateTracker.trackMentionElementsInstancesChanged()}observeMentionInternals(){this.removeMentionInternalsObservers()
9183
9183
  for(const t of this.mentionElements){const e=x.getNotifier(t.mentionInternals)
@@ -9733,7 +9733,7 @@ function kF(t,e,n,i,o,s){const r=rR.extend({excludes:"_",inclusive:!1,parseHTML:
9733
9733
  return{onStart:s=>{null!==s.decorationNode&&(o=!0,t.mentionUpdateEmitter(s.query),e(s.text.slice(0,1)),n(s.command),i?.show({filter:s.query,anchorNode:s.decorationNode}))},onUpdate:e=>{o&&(t.mentionUpdateEmitter(e.query),n(e.command),i?.show({filter:e.query,anchorNode:e.decorationNode}))},onKeyDown:t=>!!o&&(t.event.key===an&&(o=!1),i?.keydownHandler(t.event)??!1),onExit:()=>{e(""),n(void 0),i?.close()}}}}})}(n,t,e,o))),l=new W$({element:n,enableInputRules:[dR,IR],enablePasteRules:!1,editorProps:{transformPasted:function(t){const e=SF(l,t.content)
9734
9734
  return new Qb(e,t.openStart,t.openEnd)}},extensions:[eD,VR,HR,dR,IR,hR,QT,aD,xF,yF.configure({placeholder:s,showOnlyWhenEditable:!1}),aI,r,...a]})
9735
9735
  return l}function SF(t,e){const n=[]
9736
- return e.forEach((e=>{if(e.isText&&e.marks.length>0){const i=e.marks.find((t=>"link"===t.type.name&&t.attrs))
9736
+ return e.forEach((e=>{if(e.isText&&e.marks.length>0){const i=e.marks.find((t=>"link"===t.type.name))
9737
9737
  i?CF.test(i.attrs.href)?n.push(t.schema.text(i.attrs.href,e.marks)):n.push(t.schema.text(e.textContent,i.removeFromSet(e.marks))):n.push(e)}else if(e.type.name.startsWith(EI))n.push(t.schema.text(e.attrs.label))
9738
9738
  else{const i=SF(t,e.content)
9739
9739
  n.push(e.copy(i))}})),Gb.fromArray(n)}class _F{constructor(t){_F.instance+=1
@@ -9741,7 +9741,7 @@ const e=`${EI}${_F.instance}`
9741
9741
  this.name=e,this.key=e,this.viewElement=t.viewElement,this.character=t.character,this.mappingConfigs=t.mappingConfigs,this.iconTemplate=t.iconTemplate,this.buttonLabel=t.buttonLabel??"",this.mentionUpdateEmitter=t.mentionUpdateEmitter}}_F.instance=0
9742
9742
  class MF extends PT{constructor(t){super(t),this.mentionExtensionConfig=this.isValid?t.map((t=>new _F(t.mentionInternals))):[]}}class $F extends(vg(WT)){constructor(){super(...arguments),this.editorDiv=this.createEditor(),this.tiptapEditor=kF((()=>{}),(()=>{}),this.editorDiv,[],this.mentionListbox,this.placeholder),this.xmlSerializer=new XMLSerializer,this.richTextMarkdownSerializer=new FT([]),this.disabled=!1,this.footerHidden=!1,this.scrollbarWidth=-1,this.activeMentionCharacter="",this.updateScrollbarWidthQueued=!1}get empty(){if(""===this.tiptapEditor.state.doc.textContent.trim()){let t=!1
9743
9743
  return this.tiptapEditor.state.doc.descendants((e=>{e.type.name.startsWith(EI)&&(t=!0)
9744
- return!1===t})),!t}return!1}connectedCallback(){super.connectedCallback(),this.editorDiv.isConnected||this.editorContainer.append(this.editorDiv),this.bindEditorTransactionEvent(),this.bindEditorUpdateEvent(),this.stopNativeInputEventPropagation(),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.unbindEditorTransactionEvent(),this.unbindEditorUpdateEvent(),this.unbindNativeInputEvent(),this.resizeObserver?.disconnect()}disabledChanged(){this.disableEditor(),this.disableMentionViewElement()}placeholderChanged(t,e){const n=this.getMarkdown(),{from:i,to:o}=this.tiptapEditor.view.state.selection
9744
+ return!t})),!t}return!1}connectedCallback(){super.connectedCallback(),this.editorDiv.isConnected||this.editorContainer.append(this.editorDiv),this.bindEditorTransactionEvent(),this.bindEditorUpdateEvent(),this.stopNativeInputEventPropagation(),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.unbindEditorTransactionEvent(),this.unbindEditorUpdateEvent(),this.unbindNativeInputEvent(),this.resizeObserver?.disconnect()}disabledChanged(){this.disableEditor(),this.disableMentionViewElement()}placeholderChanged(t,e){const n=this.getMarkdown(),{from:i,to:o}=this.tiptapEditor.view.state.selection
9745
9745
  this.initializeEditor(),this.setMarkdown(n),this.tiptapEditor.commands.setTextSelection({from:i,to:o})}ariaLabelChanged(t,e){null!==this.ariaLabel&&void 0!==this.ariaLabel?this.editorDiv.setAttribute("aria-label",this.ariaLabel):this.editorDiv.removeAttribute("aria-label")}configurationChanged(t,e){const n=this.getButtonsState(this.tiptapEditor),{from:i,to:o}=this.tiptapEditor.view.state.selection
9746
9746
  if(this.isMentionExtensionConfigUnchanged(t,e))this.setMarkdown(this.getMarkdown())
9747
9747
  else{const t=this.getMentionExtensionConfig(),e=this.getMarkdown()
@@ -10153,7 +10153,7 @@ let UF=class extends Bi{}
10153
10153
  class qF extends(Dn(UF)){constructor(){super(...arguments),this.proxy=document.createElement("select")}}const jF=t=>!t.visuallyHidden&&!t.disabled&&!t.hidden,WF=t=>!t.visuallyHidden&&!t.hidden
10154
10154
  class GF extends(vg(zg(qF))){constructor(){super(...arguments),this.appearance=$g,this.appearanceReadOnly=!1,this.fullBleed=!1,this.filterMode=Og.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=yn("listbox-"),this.hasOverflow=!1,this.filteredOptions=[],this.filter="",this.availableViewportHeight=0,this._value="",this.forcedPosition=!1,this.selectedOptionObserver=new MutationObserver((()=>{this.updateDisplayValue()}))}get collapsible(){return!(this.multiple||"number"==typeof this.size)}get labelContent(){return this.$fastController.isConnected?Qv(this.labelSlot):""}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.open&&this.initializeOpenState(),this.observeSelectedOptionTextContent()}disconnectedCallback(){super.disconnectedCallback(),this.selectedOptionObserver?.disconnect()}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
10155
10155
  let n=t
10156
- if(this.options?.length){const t=this.options.findIndex((t=>t.value===n)),e=this.options[this.selectedIndex]?.value??null,i=this.options[t]?.value??null;-1!==t&&e===i||(n="",this.selectedIndex=t),n=this.firstSelectedOption?.value??n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value"),this.updateDisplayValue())}get displayValue(){return x.track(this,"displayValue"),this.firstSelectedOption?.text??""}anchoredRegionChanged(t,e){this.anchoredRegion&&this.control&&(this.anchoredRegion.anchorElement=this.control)}controlChanged(t,e){this.anchoredRegion&&this.control&&(this.anchoredRegion.anchorElement=this.control)}slottedOptionsChanged(t,e){const n=this.value
10156
+ if(void 0!==this.options&&this.options.length>0){const t=this.options.findIndex((t=>t.value===n)),e=this.options[this.selectedIndex]?.value??null,i=this.options[t]?.value??null;-1!==t&&e===i||(n="",this.selectedIndex=t),n=this.firstSelectedOption?.value??n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value"),this.updateDisplayValue())}get displayValue(){return x.track(this,"displayValue"),this.firstSelectedOption?.text??""}anchoredRegionChanged(t,e){void 0!==this.anchoredRegion&&void 0!==this.control&&(this.anchoredRegion.anchorElement=this.control)}controlChanged(t,e){void 0!==this.anchoredRegion&&void 0!==this.control&&(this.anchoredRegion.anchorElement=this.control)}slottedOptionsChanged(t,e){const n=this.value
10157
10157
  this.options.forEach((t=>{const e=x.getNotifier(t)
10158
10158
  e.unsubscribe(this,"value"),e.unsubscribe(this,"hidden"),e.unsubscribe(this,"disabled")})),t?.filter(VF).forEach((t=>{const e=x.getNotifier(t)
10159
10159
  e.unsubscribe(this,"hidden"),e.unsubscribe(this,"visuallyHidden"),e.unsubscribe(this,"listOptions")}))
@@ -10176,11 +10176,11 @@ case"visuallyHidden":(VF(n)||zF(n))&&this.updateAdjacentSeparatorState(n)
10176
10176
  break
10177
10177
  case"disabled":this.updateDisplayValue()
10178
10178
  break
10179
- case"listOptions":this.slottedOptionsChanged(this.slottedOptions,this.slottedOptions)}}mousedownHandler(t){return t.offsetX>=0&&t.offsetX<=this.listbox?.scrollWidth?super.mousedownHandler(t):this.collapsible}regionLoadedHandler(){this.focusAndScrollOptionIntoView()}multipleChanged(t,e){super.multipleChanged(t,e),this.proxy&&(this.proxy.multiple=e)}ignoreClickHandler(t){t.stopPropagation()}clearClickHandler(t){this.open=!1,this.clearSelect(),this.updateValue(!0),t.stopPropagation()}updateDisplayValue(){const t=this.getPlaceholderOption()
10179
+ case"listOptions":this.slottedOptionsChanged(this.slottedOptions,this.slottedOptions)}}mousedownHandler(t){return t.offsetX>=0&&t.offsetX<=this.listbox?.scrollWidth?super.mousedownHandler(t):this.collapsible}regionLoadedHandler(){this.focusAndScrollOptionIntoView()}multipleChanged(t,e){super.multipleChanged(t,e),this.proxy.multiple=e}ignoreClickHandler(t){t.stopPropagation()}clearClickHandler(t){this.open=!1,this.clearSelect(),this.updateValue(!0),t.stopPropagation()}updateDisplayValue(){const t=this.getPlaceholderOption()
10180
10180
  t&&this.firstSelectedOption===t?this.displayPlaceholder=!0:this.displayPlaceholder=!1,x.notify(this,"displayValue")}inputHandler(t){if(this.filter=this.filterInput?.value??"",this.filterMode===Og.standard){this.filterOptions()
10181
10181
  const t=this.filteredOptions.filter((t=>!t.disabled))
10182
10182
  let e=""!==this.filter?this.openActiveIndex??this.selectedIndex:this.selectedIndex
10183
- t.length>0&&!t.find((t=>t===this.options[e]))?e=this.options.indexOf(t[0]):0===t.length&&(e=-1),this.setActiveOption(e)}return this.filterMode!==Og.none&&this.emitFilterInputEvent(),t.inputType.includes("deleteContent")||!this.filter.length||t.stopPropagation(),!0}focusoutHandler(t){if(super.focusoutHandler(t),!this.open)return!0
10183
+ t.length>0&&!t.find((t=>t===this.options[e]))?e=this.options.indexOf(t[0]):0===t.length&&(e=-1),this.setActiveOption(e)}return this.filterMode!==Og.none&&this.emitFilterInputEvent(),t.inputType.includes("deleteContent")||0===this.filter.length||t.stopPropagation(),!0}focusoutHandler(t){if(super.focusoutHandler(t),!this.open)return!0
10184
10184
  this.open=!1
10185
10185
  const e=t.relatedTarget
10186
10186
  return!this.isSameNode(e)||(this.focus(),!0)}keydownHandler(t){const e=this.selectedIndex,n=t.key
@@ -10201,14 +10201,14 @@ this.open?o=!0:this.open=!0,o&&this.focus()
10201
10201
  break
10202
10202
  case an:if(!this.open){if(this.clearable)return this.clearSelect(),this.updateValue(!0),!0
10203
10203
  break}this.collapsible&&this.open&&(t.preventDefault(),this.open=!1),i=this.selectedIndex,this.focus()}return this.open&&!o||(this.selectedIndex!==i&&(this.selectedIndex=i),e!==this.selectedIndex&&this.updateValue(!0)),o&&(this.open=!1),!(n===en||n===sn)}selectedIndexChanged(t,e){this.setSelectedOptions(),this.open&&this.setActiveOption(this.selectedIndex),this.updateValue()}typeaheadBufferChanged(t,e){if(this.$fastController.isConnected){const t=this.getTypeaheadMatches()
10204
- if(t.length){const e=this.options.indexOf(t[0])
10204
+ if(t.length>0){const e=this.options.indexOf(t[0])
10205
10205
  this.open&&this.filterMode!==Og.none||this.setActiveOption(e)}this.typeaheadExpired=!1}}disabledChanged(t,e){super.disabledChanged&&super.disabledChanged(t,e),this.ariaDisabled=this.disabled?"true":"false"}formResetCallback(){this.setProxyOptions(),super.setDefaultSelectedOption(),-1===this.selectedIndex&&(this.selectedIndex=0)}selectNextOption(){for(let t=(this.openActiveIndex??this.selectedIndex)+1;t<this.options.length;t++){const e=this.options[t]
10206
10206
  if(zF(e)&&jF(e)){this.setActiveOption(t)
10207
10207
  break}}}selectPreviousOption(){for(let t=(this.openActiveIndex??this.selectedIndex)-1;t>=0;t--){const e=this.options[t]
10208
10208
  if(zF(e)&&jF(e)){this.setActiveOption(t)
10209
10209
  break}}}selectFirstOption(){const t=this.options.findIndex((t=>zF(t)&&jF(t)))
10210
10210
  this.setActiveOption(t)}selectLastOption(){const t=Ge(this.options,(t=>zF(t)&&jF(t)))
10211
- this.setActiveOption(t)}registerOption(t){this.options.includes(t)||this.options.push(t)}setSelectedOptions(){this.open&&-1===this.selectedIndex||super.setSelectedOptions()}focusAndScrollOptionIntoView(){this.open&&(super.focusAndScrollOptionIntoView(),window.requestAnimationFrame((()=>{this.filterInput?.focus()})))}getTypeaheadMatches(){return super.getTypeaheadMatches().filter((t=>!t.hidden&&!t.disabled))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}sizeChanged(t,e){super.sizeChanged(t,e),this.proxy&&(this.proxy.size=e)}openChanged(){if(!this.collapsible)return
10211
+ this.setActiveOption(t)}registerOption(t){this.options.includes(t)||this.options.push(t)}setSelectedOptions(){this.open&&-1===this.selectedIndex||super.setSelectedOptions()}focusAndScrollOptionIntoView(){this.open&&(super.focusAndScrollOptionIntoView(),window.requestAnimationFrame((()=>{this.filterInput?.focus()})))}getTypeaheadMatches(){return super.getTypeaheadMatches().filter((t=>!t.hidden&&!t.disabled))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}sizeChanged(t,e){super.sizeChanged(t,e),this.proxy.size=e}openChanged(){if(!this.collapsible)return
10212
10212
  if(this.open)return void this.initializeOpenState()
10213
10213
  const t=this.options[this.openActiveIndex??this.selectedIndex]
10214
10214
  zF(t)&&(t.activeOption=!1),this.openActiveIndex=void 0,this.filter="",this.filterInput&&(this.filterInput.value=""),this.filterMode!==Og.none&&this.emitFilterInputEvent(),this.ariaControls="",this.ariaExpanded="false"}selectedOptionsChanged(t,e){this.options?.forEach(((t,n)=>{const i=x.getNotifier(t)
@@ -10245,11 +10245,11 @@ for(const e of this.slottedOptions)if(VF(e)){if(e.hidden)continue
10245
10245
  const n=this.getGroupOptions(e),i=this.filterMatchesText(e.labelContent)
10246
10246
  n.forEach((e=>{e.visuallyHidden=!i&&this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e)}))}else zF(e)&&(e.visuallyHidden=this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e))
10247
10247
  this.filteredOptions=t}getGroupOptions(t){return Array.from(t.children).filter((t=>zF(t))).map((e=>(t.hidden&&zF(e)&&(e.visuallyHidden=!0),e)))}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.value??"",this.observeSelectedOptionTextContent()),t&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}clearSelect(){const t=this.getPlaceholderOption()
10248
- this.selectedIndex=t?this.options.indexOf(t):-1}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&this.options&&(this.proxy.options.length=0,this.options.forEach((t=>{const e=t.proxy||(t instanceof HTMLOptionElement?t.cloneNode():null)
10249
- e&&this.proxy.options.add(e)})))}filterChanged(){this.filterOptions()}emitFilterInputEvent(){const t={filterText:this.filter}
10248
+ this.selectedIndex=t?this.options.indexOf(t):-1}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&null!==this.options&&(this.proxy.options.length=0,this.options.forEach((t=>{const e=t.proxy??(t instanceof HTMLOptionElement?t.cloneNode():null)
10249
+ null!==e&&this.proxy.options.add(e)})))}filterChanged(){this.filterOptions()}emitFilterInputEvent(){const t={filterText:this.filter}
10250
10250
  this.$emit("filter-input",t,{bubbles:!0})}initializeOpenState(){this.setActiveOption(this.selectedIndex),this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView()}observeSelectedOptionTextContent(){if(this.selectedOptionObserver?.disconnect(),-1===this.selectedIndex)return
10251
10251
  const t=this.firstSelectedOption
10252
- t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],GF.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],GF.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"full-bleed",mode:"boolean"})],GF.prototype,"fullBleed",void 0),t([ft({attribute:"position"})],GF.prototype,"positionAttribute",void 0),t([ft({attribute:"filter-mode"})],GF.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],GF.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],GF.prototype,"loadingVisible",void 0),t([C],GF.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],GF.prototype,"open",void 0),t([C],GF.prototype,"position",void 0),t([C],GF.prototype,"control",void 0),t([C],GF.prototype,"scrollableRegion",void 0),t([C],GF.prototype,"filterInput",void 0),t([C],GF.prototype,"anchoredRegion",void 0),t([C],GF.prototype,"hasOverflow",void 0),t([C],GF.prototype,"filteredOptions",void 0),t([C],GF.prototype,"filter",void 0),t([C],GF.prototype,"availableViewportHeight",void 0),t([k],GF.prototype,"collapsible",null),t([k],GF.prototype,"labelContent",null),t([k],GF.prototype,"displayValue",null)
10252
+ null!==t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],GF.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],GF.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"full-bleed",mode:"boolean"})],GF.prototype,"fullBleed",void 0),t([ft({attribute:"position"})],GF.prototype,"positionAttribute",void 0),t([ft({attribute:"filter-mode"})],GF.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],GF.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],GF.prototype,"loadingVisible",void 0),t([C],GF.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],GF.prototype,"open",void 0),t([C],GF.prototype,"position",void 0),t([C],GF.prototype,"control",void 0),t([C],GF.prototype,"scrollableRegion",void 0),t([C],GF.prototype,"filterInput",void 0),t([C],GF.prototype,"anchoredRegion",void 0),t([C],GF.prototype,"hasOverflow",void 0),t([C],GF.prototype,"filteredOptions",void 0),t([C],GF.prototype,"filter",void 0),t([C],GF.prototype,"availableViewportHeight",void 0),t([k],GF.prototype,"collapsible",null),t([k],GF.prototype,"labelContent",null),t([k],GF.prototype,"displayValue",null)
10253
10253
  const ZF=GF.compose({baseName:"select",baseClass:oo,template:(t,e)=>Q`
10254
10254
  <template
10255
10255
  class="${t=>[t.collapsible&&"collapsible",t.collapsible&&t.open&&"open",t.disabled&&"disabled",t.collapsible&&t.position].filter(Boolean).join(" ")}"
@@ -10297,7 +10297,7 @@ const ZF=GF.compose({baseName:"select",baseClass:oo,template:(t,e)=>Q`
10297
10297
  `)}
10298
10298
  <div aria-hidden="true" class="indicator" part="indicator">
10299
10299
  <slot name="indicator">
10300
- ${e.indicator||""}
10300
+ ${e.indicator??""}
10301
10301
  </slot>
10302
10302
  </div>
10303
10303
  </slot>
@@ -10565,7 +10565,7 @@ const eN=$t`
10565
10565
  >
10566
10566
  <label
10567
10567
  part="label"
10568
- class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
10568
+ class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
10569
10569
  >
10570
10570
  <slot ${Qt("defaultSlottedNodes")}></slot>
10571
10571
  </label>
@@ -11112,7 +11112,7 @@ try{e=document.createElement(t)}catch(t){}if(!(e instanceof AL))throw new Error(
11112
11112
  class RL{constructor(t){this.uniqueId=yn("table-column-slot"),this.sortOperation=ML,this.dataRecordFieldNames=[],this.groupingDisabled=!0,this.fractionalWidth=1,this.minPixelWidth=117,this.resizingDisabled=!1,this.hideHeaderIndicators=!1,this.headerAlignment=gL,this.currentFractionalWidth=1,this.sortingDisabled=!0,this.currentSortDirection=hL.none,this.cellRecordFieldNames=t.cellRecordFieldNames,this.cellViewTemplate=OL(t.cellViewTag),t.groupHeaderViewTag&&(this.groupHeaderViewTemplate=EL(t.groupHeaderViewTag)),this.delegatedEvents=t.delegatedEvents,this.slotNames=t.slotNames??[],this.sortOperation=t.sortOperation??ML,this.validator=t.validator}fractionalWidthChanged(){this.currentFractionalWidth=this.fractionalWidth}pixelWidthChanged(){this.currentPixelWidth=this.pixelWidth}}function FL(t,...e){for(const n of e)if(t===n)return!0
11113
11113
  return!1}t([C],RL.prototype,"columnConfig",void 0),t([C],RL.prototype,"operandDataRecordFieldName",void 0),t([C],RL.prototype,"sortOperation",void 0),t([C],RL.prototype,"dataRecordFieldNames",void 0),t([C],RL.prototype,"groupingDisabled",void 0),t([C],RL.prototype,"groupIndex",void 0),t([C],RL.prototype,"pixelWidth",void 0),t([C],RL.prototype,"fractionalWidth",void 0),t([C],RL.prototype,"minPixelWidth",void 0),t([C],RL.prototype,"resizingDisabled",void 0),t([C],RL.prototype,"hideHeaderIndicators",void 0),t([C],RL.prototype,"headerAlignment",void 0),t([C],RL.prototype,"currentFractionalWidth",void 0),t([C],RL.prototype,"currentPixelWidth",void 0),t([C],RL.prototype,"sortingDisabled",void 0),t([C],RL.prototype,"currentSortIndex",void 0),t([C],RL.prototype,"currentSortDirection",void 0)
11114
11114
  class NL extends Ve{constructor(){super(...arguments),this.columnInternals=new RL(this.getColumnInternalsOptions()),this.columnHidden=!1,this.hasOverflow=!1}checkValidity(){return this.columnInternals.validator.isColumnValid}get validity(){return this.columnInternals.validator.getValidity()}get headerTextContent(){return Qv(this.contentSlot)}connectedCallback(){super.connectedCallback(),this.setAttribute("slot",this.columnInternals.uniqueId)}}t([ft({attribute:"column-id"})],NL.prototype,"columnId",void 0),t([ft({attribute:"action-menu-slot"})],NL.prototype,"actionMenuSlot",void 0),t([ft({attribute:"action-menu-label"})],NL.prototype,"actionMenuLabel",void 0),t([ft({attribute:"column-hidden",mode:"boolean"})],NL.prototype,"columnHidden",void 0),t([C],NL.prototype,"hasOverflow",void 0)
11115
- class LL{constructor(){this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.duplicateColumnId=!1,this.missingColumnId=!1,this.duplicateSortIndex=!1,this.duplicateGroupIndex=!1,this.idFieldNameNotConfigured=!1,this.invalidColumnConfiguration=!1,this.invalidParentIdConfiguration=!1,this.recordIds=new Set}getValidity(){return{duplicateRecordId:this.duplicateRecordId,missingRecordId:this.missingRecordId,invalidRecordId:this.invalidRecordId,duplicateColumnId:this.duplicateColumnId,missingColumnId:this.missingColumnId,duplicateSortIndex:this.duplicateSortIndex,duplicateGroupIndex:this.duplicateGroupIndex,idFieldNameNotConfigured:this.idFieldNameNotConfigured,invalidColumnConfiguration:this.invalidColumnConfiguration,invalidParentIdConfiguration:this.invalidParentIdConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!1===t))}areRecordIdsValid(){const t=this.getValidity()
11115
+ class LL{constructor(){this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.duplicateColumnId=!1,this.missingColumnId=!1,this.duplicateSortIndex=!1,this.duplicateGroupIndex=!1,this.idFieldNameNotConfigured=!1,this.invalidColumnConfiguration=!1,this.invalidParentIdConfiguration=!1,this.recordIds=new Set}getValidity(){return{duplicateRecordId:this.duplicateRecordId,missingRecordId:this.missingRecordId,invalidRecordId:this.invalidRecordId,duplicateColumnId:this.duplicateColumnId,missingColumnId:this.missingColumnId,duplicateSortIndex:this.duplicateSortIndex,duplicateGroupIndex:this.duplicateGroupIndex,idFieldNameNotConfigured:this.idFieldNameNotConfigured,invalidColumnConfiguration:this.invalidColumnConfiguration,invalidParentIdConfiguration:this.invalidParentIdConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!t))}areRecordIdsValid(){const t=this.getValidity()
11116
11116
  return!t.duplicateRecordId&&!t.missingRecordId&&!t.invalidRecordId}validateIdFieldConfiguration(t,e,n){const i=t!==uL.none||"string"==typeof n
11117
11117
  return this.idFieldNameNotConfigured=!!i&&"string"!=typeof e,!this.idFieldNameNotConfigured}validateRecordIds(t,e){if(this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.recordIds.clear(),"string"!=typeof e)return!0
11118
11118
  for(const n of t){if(!Object.prototype.hasOwnProperty.call(n,e)){this.missingRecordId=!0
@@ -12221,7 +12221,7 @@ class _B{constructor(t){this.table=t,this.isColumnBeingSized=!1,this.visibleColu
12221
12221
  this.currentTotalDelta=this.getAllowedSizeDelta(t.clientX-this.dragStart),this.performCascadeSizeLeft(this.leftColumnIndex,this.currentTotalDelta),this.performCascadeSizeRight(this.rightColumnIndex,this.currentTotalDelta)
12222
12222
  const e=this.getTotalColumnFixedWidth()-this.initialColumnTotalWidth
12223
12223
  this.table.tableScrollableMinWidth=e>0?this.initialTableScrollableWidth+e:this.initialTableScrollableMinWidth},this.onDividerPointerUp=()=>{this.activeColumnDividerElement.removeEventListener("pointermove",this.onDividerPointerMove),this.activeColumnDividerElement.removeEventListener("pointerup",this.onDividerPointerUp),this.resetGridSizedColumns(),this.isColumnBeingSized=!1,this.activeColumnIndex=void 0,this.activeColumnDivider=void 0,this.activeColumnDividerElement=void 0,this.visibleColumns=[]}}getGridTemplateColumns(){return this.getVisibleColumns().map((t=>{const{minPixelWidth:e,currentPixelWidth:n,currentFractionalWidth:i}=t.columnInternals
12224
- if(n){return`${Math.max(e,n)}px`}return`minmax(${e}px, ${i}fr)`})).join(" ")}beginColumnInteractiveSize(t,e,n,i){this.activeColumnDivider=i,this.activeColumnDividerElement=t,this.leftColumnIndex=this.getLeftColumnIndexFromDivider(this.activeColumnDivider),this.rightColumnIndex=this.leftColumnIndex+1,this.activeColumnIndex=this.leftColumnIndex+this.activeColumnDivider%2,this.dragStart=n,this.currentTotalDelta=0,this.visibleColumns=this.getVisibleColumns(),this.setColumnsToFixedSize(),this.initialTableScrollableWidth=this.table.viewport.scrollWidth,this.initialTableScrollableMinWidth=this.table.tableScrollableMinWidth,this.initialColumnTotalWidth=this.getTotalColumnFixedWidth(),this.isColumnBeingSized=!0,-1!==e&&t.setPointerCapture(e),t.addEventListener("pointermove",this.onDividerPointerMove),t.addEventListener("pointerup",this.onDividerPointerUp)}hasResizableColumnToLeft(t){return-1!==this.getFirstLeftResizableColumnIndex(t)}hasResizableColumnToRight(t){return-1!==this.getFirstRightResizableColumnIndex(t)}getTotalColumnFixedWidth(){let t=0
12224
+ if(void 0!==n){return`${Math.max(e,n)}px`}return`minmax(${e}px, ${i}fr)`})).join(" ")}beginColumnInteractiveSize(t,e,n,i){this.activeColumnDivider=i,this.activeColumnDividerElement=t,this.leftColumnIndex=this.getLeftColumnIndexFromDivider(this.activeColumnDivider),this.rightColumnIndex=this.leftColumnIndex+1,this.activeColumnIndex=this.leftColumnIndex+this.activeColumnDivider%2,this.dragStart=n,this.currentTotalDelta=0,this.visibleColumns=this.getVisibleColumns(),this.setColumnsToFixedSize(),this.initialTableScrollableWidth=this.table.viewport.scrollWidth,this.initialTableScrollableMinWidth=this.table.tableScrollableMinWidth,this.initialColumnTotalWidth=this.getTotalColumnFixedWidth(),this.isColumnBeingSized=!0,-1!==e&&t.setPointerCapture(e),t.addEventListener("pointermove",this.onDividerPointerMove),t.addEventListener("pointerup",this.onDividerPointerUp)}hasResizableColumnToLeft(t){return-1!==this.getFirstLeftResizableColumnIndex(t)}hasResizableColumnToRight(t){return-1!==this.getFirstRightResizableColumnIndex(t)}getTotalColumnFixedWidth(){let t=0
12225
12225
  for(const e of this.visibleColumns)t+=e.columnInternals.currentPixelWidth??0
12226
12226
  return t}setColumnsToFixedSize(){this.cacheGridSizedColumns()
12227
12227
  const t=this.table.getHeaderContainerElements()
@@ -12265,7 +12265,7 @@ for(const t of n)delete i[t]
12265
12265
  this.tanStackTable.setRowSelection(i)}getAllLeafRowIds(t){const e=this.tanStackTable.getRowModel().flatRows.find((e=>e.id===t))
12266
12266
  return e?.getIsGrouped()?e.getLeafRows().filter((t=>!t.getIsGrouped())).map((t=>t.id)):[]}getAllOrderedRows(){const t=this.tanStackTable.getPreExpandedRowModel().rows
12267
12267
  return this.getOrderedRows(t)}getOrderedRows(t){const e=[]
12268
- for(const n of t)e.push(n),n.subRows?.length&&e.push(...this.getOrderedRows(n.subRows))
12268
+ for(const n of t)e.push(n),n.subRows?.length>0&&e.push(...this.getOrderedRows(n.subRows))
12269
12269
  return e}}class AB extends EB{handleRowSelectionToggle(t,e,n){return!1}handleRowClick(t,e,n){return!1}handleActionMenuOpening(t){return!1}}class TB extends EB{handleRowSelectionToggle(t,e,n){return n&&this.tryUpdateRangeSelection(t.id,!0)||(this.shiftSelectStartRowId=e?t.id:void 0,this.previousShiftSelectRowEndId=void 0,this.toggleIsRowSelected(t,e)),!0}handleRowClick(t,e,n){if(e){const e=n
12270
12270
  if(this.tryUpdateRangeSelection(t.id,e))return!0}if(n){const e=t.selectionState!==fL
12271
12271
  return this.shiftSelectStartRowId=e?t.id:void 0,this.previousShiftSelectRowEndId=void 0,this.toggleIsRowSelected(t),!0}return this.shiftSelectStartRowId=t.id,this.previousShiftSelectRowEndId=void 0,this.selectSingleRow(t)}handleActionMenuOpening(t){return!this.actionMenusPreserveSelection&&(t.selectionState!==fL&&this.selectSingleRow(t))}reset(){this.shiftSelectStartRowId=void 0,this.previousShiftSelectRowEndId=void 0}tryUpdateRangeSelection(t,e){if(void 0===this.shiftSelectStartRowId)return!1
@@ -12286,11 +12286,11 @@ case uL.single:return new DB(this.tanStackTable,e)
12286
12286
  case uL.none:return new AB(this.tanStackTable,e)
12287
12287
  default:throw new Error("unknown selection mode found")}}}function RB(t,e){const n=e,i=[],o={},s=new Set
12288
12288
  for(let e=0;e<t.length;e++){const r=t[e],a=r[n.id],l=r[n.parentId]
12289
- Object.prototype.hasOwnProperty.call(o,a)||(o[a]={subRows:[],clientRecord:void 0,originalIndex:void 0}),s&&s.delete(a),o[a].clientRecord=r
12289
+ Object.prototype.hasOwnProperty.call(o,a)||(o[a]={subRows:[],clientRecord:void 0,originalIndex:void 0}),s.delete(a),o[a].clientRecord=r
12290
12290
  const c=o[a]
12291
- c.originalIndex=e,null==l?i.push(c):(Object.prototype.hasOwnProperty.call(o,l)||(o[l]={subRows:[],clientRecord:void 0,originalIndex:void 0},s&&s.add(l)),o[l].subRows.push(c))}if(s?.size){const t=Array.from(s.values()).join(",")
12291
+ c.originalIndex=e,null==l?i.push(c):(Object.prototype.hasOwnProperty.call(o,l)||(o[l]={subRows:[],clientRecord:void 0,originalIndex:void 0},s.add(l)),o[l].subRows.push(c))}if(s.size>0){const t=Array.from(s.values()).join(",")
12292
12292
  throw new Error(`The items array contains orphans that point to the following parentIds: [${t}]. These parentIds do not exist in the items array.`)}if(FB(i)<Object.keys(o).length)throw new Error("The items array contains nodes with a circular parent/child relationship.")
12293
- return i}function FB(t){return t.reduce(((t,e)=>t+1+(e.subRows&&FB(e.subRows))),0)}class NB{constructor(t,e,n){if(this.isDataFlat=!1,"string"==typeof e&&"string"==typeof n)try{this._hierarchicalData=RB(t,{id:e,parentId:n}),this.isDataFlat=!1,this._parentIdConfigurationValid=!0}catch{this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:t,originalIndex:e}))),this._parentIdConfigurationValid=!1}else this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:t,originalIndex:e}))),this._parentIdConfigurationValid=!0}get hierarchicalData(){return this._hierarchicalData}get parentIdConfigurationValid(){return this._parentIdConfigurationValid}getAllRecords(t=!1){const e=[]
12293
+ return i}function FB(t){return t.reduce(((t,e)=>t+1+(e.subRows?FB(e.subRows):0)),0)}class NB{constructor(t,e,n){if(this.isDataFlat=!1,"string"==typeof e&&"string"==typeof n)try{this._hierarchicalData=RB(t,{id:e,parentId:n}),this.isDataFlat=!1,this._parentIdConfigurationValid=!0}catch{this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:t,originalIndex:e}))),this._parentIdConfigurationValid=!1}else this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:t,originalIndex:e}))),this._parentIdConfigurationValid=!0}get hierarchicalData(){return this._hierarchicalData}get parentIdConfigurationValid(){return this._parentIdConfigurationValid}getAllRecords(t=!1){const e=[]
12294
12294
  return this.getAllNodes(this._hierarchicalData,e),this.isDataFlat||!t?e.map((t=>t.clientRecord)):e.sort(((t,e)=>t.originalIndex-e.originalIndex)).map((t=>t.clientRecord))}getAllNodes(t,e){for(const n of t)e.push(n),n.subRows&&this.getAllNodes(n.subRows,e)}}class LB{constructor(t){this.tanStackTable=t,this.explicitExpansionStates=new Map,this.hierarchyOptions=new Map,this.isHierarchyEnabled=!1,this.parentRowsWithChildren=new Set}isRowExpanded(t){if(!this.isRowExpandable(t))return!1
12295
12295
  return this.explicitExpansionStates.get(t.id)??this.getDefaultExpansionState(t)}toggleRowExpansion(t){if(!this.isRowExpandable(t))return
12296
12296
  const e=this.isRowExpanded(t)
@@ -12517,7 +12517,7 @@ return n?fL:pL}getGroupRowColumn(t){const e=t.groupingColumnId
12517
12517
  if(void 0!==e)return this.columns.find((t=>t.columnInternals.uniqueId===e))}updateTableOptions(t){if(this.options={...this.options,...t,state:{...this.options.state,...t.state}},this.table.setOptions(this.options),t.data&&this.tableValidator.areRecordIdsValid()){const t=this.table.getRowModel().flatRows
12518
12518
  this.expansionManager.processDataUpdate(t)}this.refreshRows()}toggleRowExpanded(t){const e=this.table.getRowModel().rows[t]
12519
12519
  this.expansionManager.toggleRowExpansion(e)}calculateTanStackSortState(){const t=this.getColumnsParticipatingInSorting().sort(((t,e)=>t.columnInternals.currentSortIndex-e.columnInternals.currentSortIndex))
12520
- return this.firstSortedColumn=t.length?t[0]:void 0,t.map((t=>({id:t.columnInternals.uniqueId,desc:t.columnInternals.currentSortDirection===hL.descending})))}calculateTanStackGroupingState(){return this.getColumnsParticipatingInGrouping().sort(((t,e)=>t.columnInternals.groupIndex-e.columnInternals.groupIndex)).map((t=>t.columnInternals.uniqueId))}calculateTanStackRowIdFunction(){return null===this.idFieldName||void 0===this.idFieldName?void 0:t=>t.clientRecord[this.idFieldName]}calculateTanStackColumns(){return this.columns.map((t=>({id:t.columnInternals.uniqueId,accessorFn:e=>{const n=t.columnInternals.operandDataRecordFieldName
12520
+ return this.firstSortedColumn=t.length>0?t[0]:void 0,t.map((t=>({id:t.columnInternals.uniqueId,desc:t.columnInternals.currentSortDirection===hL.descending})))}calculateTanStackGroupingState(){return this.getColumnsParticipatingInGrouping().sort(((t,e)=>t.columnInternals.groupIndex-e.columnInternals.groupIndex)).map((t=>t.columnInternals.uniqueId))}calculateTanStackRowIdFunction(){return null===this.idFieldName||void 0===this.idFieldName?void 0:t=>t.clientRecord[this.idFieldName]}calculateTanStackColumns(){return this.columns.map((t=>({id:t.columnInternals.uniqueId,accessorFn:e=>{const n=t.columnInternals.operandDataRecordFieldName
12521
12521
  if("string"==typeof n)return e.clientRecord[n]},sortingFn:CB(t.columnInternals.sortOperation),sortUndefined:!1})))}calculateTanStackSelectionState(t){if(this.selectionMode===uL.none)return{}
12522
12522
  const e={},n=this.tableValidator.getPresentRecordIds(t)
12523
12523
  for(const t of n)if(e[t]=!0,this.selectionMode===uL.single)break
@@ -12698,9 +12698,9 @@ const l=Math.floor(r)
12698
12698
  if(l<=999&&l>0){const t=this.daysFormatter.format(l)
12699
12699
  e.push(t),a-=l*s}else if(l>999)return this.scientificSecondsFormatter.format(t/n)
12700
12700
  const c=Math.floor(t/o%24)
12701
- if(a-=c*o,c){const t=this.hoursFormatter.format(c)
12701
+ if(a-=c*o,0!==c){const t=this.hoursFormatter.format(c)
12702
12702
  e.push(t)}const d=Math.floor(t/i%60)
12703
- if(a-=d*i,d){const t=this.minutesFormatter.format(d)
12703
+ if(a-=d*i,0!==d){const t=this.minutesFormatter.format(d)
12704
12704
  e.push(t)}const h=a/n,u=0===h?0:h%60
12705
12705
  if(t<1&&0!==h)return this.scientificSecondsFormatter.format(h)
12706
12706
  if(u>=5e-4||0===u&&0===e.length){const t=this.secondsFormatter.format(u)
@@ -13194,7 +13194,7 @@ const Pz="outline",zz="block",Vz=$t`
13194
13194
  <label
13195
13195
  part="label"
13196
13196
  for="control"
13197
- class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
13197
+ class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
13198
13198
  >
13199
13199
  <slot ${Qt("defaultSlottedNodes")}></slot>
13200
13200
  </label>
@@ -13513,7 +13513,7 @@ const jz="underline",Wz="outline",Gz="block",Zz="frameless",Kz=$t`
13513
13513
  `)),Yz=Ng(Q`<label
13514
13514
  part="label"
13515
13515
  for="control"
13516
- class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
13516
+ class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
13517
13517
  >
13518
13518
  <slot
13519
13519
  ${Qt({property:"defaultSlottedNodes",filter:function(t,e,n){return t.nodeType!==Node.TEXT_NODE||"string"==typeof t.nodeValue&&!!t.nodeValue.trim().length}})}
@@ -15557,12 +15557,12 @@ return`translate(${n[0]}, ${n[1]})`}return""}renderDies(){const t=this.wafermap.
15557
15557
  i[0]-=e,i[1]-=n
15558
15558
  for(const s of this.dies)this.isDieVisible(s,i,o)&&(t.fillStyle=s.fillStyle,t.fillRect(s.x,s.y,e,n))}renderText(){if(this.wafermap.dieLabelsHidden)return
15559
15559
  const t=this.wafermap.dataManager.dieDimensions.width,e=this.wafermap.dataManager.dieDimensions.height
15560
- if(t*e*(this.wafermap.transform.k||1)>=this.minDieDim){const n=this.wafermap.dataManager.labelsFontSize,i=this.wafermap.canvasContext
15560
+ if(t*e*(0!==this.wafermap.transform.k?this.wafermap.transform.k:1)>=this.minDieDim){const n=this.wafermap.dataManager.labelsFontSize,i=this.wafermap.canvasContext
15561
15561
  i.font=`${n.toString()}px sans-serif`,i.fillStyle="#ffffff",i.textAlign="center",i.lineCap="butt"
15562
15562
  const o=i.measureText("M"),s=this.wafermap.transform.invert([0,0]),r=this.wafermap.transform.invert([this.wafermap.canvas.width,this.wafermap.canvas.height])
15563
15563
  s[0]-=t,s[1]-=e
15564
15564
  for(const n of this.dies)this.isDieVisible(n,s,r)&&i.fillText(n.text,n.x+t/2,n.y+e/2+o.width/2,t-t/100*20)}}clearCanvas(){this.wafermap.canvasContext.clearRect(0,0,this.wafermap.canvas.width,this.wafermap.canvas.height)}scaleCanvas(){this.wafermap.canvasContext.translate(this.wafermap.transform.x,this.wafermap.transform.y),this.wafermap.canvasContext.scale(this.wafermap.transform.k,this.wafermap.transform.k)}isDieVisible(t,e,n){return t.x>=e[0]&&t.x<n[0]&&t.y>=e[1]&&t.y<n[1]}}const QJ=["highlightedTags","canvasWidth","canvasHeight","originLocation","gridMinX","gridMaxX","gridMinY","gridMaxY","dies","maxCharacters","colorScale","colorScaleMode","dieLabelsHidden","dieLabelsSuffix","transform","hoverDie"]
15565
- class tQ extends VT{constructor(t){super(QJ),this.wafermap=t,this.updateQueued=!1}get requiresEventsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")||this.isTracked("transform")}get requiresWorkerWaferSetup(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresContainerDimensionsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresComponentResizeUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresScalesUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresInputDataUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresLabelsFontSizeUpdate(){return this.isTracked("maxCharacters")}get requiresDiesRenderInfoUpdate(){return this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresColorAndTextUpdate(){return this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresDrawnWaferUpdate(){return this.isTracked("transform")}get requiresRenderHoverUpdate(){return this.isTracked("hoverDie")}queueUpdate(){this.wafermap.$fastController.isConnected&&!this.updateQueued&&(this.updateQueued=!0,void 0===this.wafermap.currentTask?b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1})):(async()=>{await this.wafermap.currentTask,b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1,this.wafermap.currentTask=void 0}))})())}}class eQ{constructor(t){this.wafermap=t,this.invalidGridDimensions=!1,this.invalidDiesTableSchema=!1}getValidity(){return{invalidGridDimensions:this.invalidGridDimensions,invalidDiesTableSchema:this.invalidDiesTableSchema}}isValid(){return Object.values(this.getValidity()).every((t=>!1===t))}validateGridDimensions(){return this.invalidGridDimensions=!1,void 0===this.wafermap.gridMinX&&void 0===this.wafermap.gridMaxX&&void 0===this.wafermap.gridMinY&&void 0===this.wafermap.gridMaxY?this.invalidGridDimensions=!1:("number"!=typeof this.wafermap.gridMinX||"number"!=typeof this.wafermap.gridMaxX||"number"!=typeof this.wafermap.gridMinY||"number"!=typeof this.wafermap.gridMaxY||this.wafermap.gridMaxX<this.wafermap.gridMinX||this.wafermap.gridMaxY<this.wafermap.gridMinY)&&(this.invalidGridDimensions=!0),!this.invalidGridDimensions}validateDiesTableSchema(){if(this.invalidDiesTableSchema=!1,void 0===this.wafermap.diesTable)this.invalidDiesTableSchema=!1
15565
+ class tQ extends VT{constructor(t){super(QJ),this.wafermap=t,this.updateQueued=!1}get requiresEventsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")||this.isTracked("transform")}get requiresWorkerWaferSetup(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresContainerDimensionsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresComponentResizeUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresScalesUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresInputDataUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresLabelsFontSizeUpdate(){return this.isTracked("maxCharacters")}get requiresDiesRenderInfoUpdate(){return this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresColorAndTextUpdate(){return this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresDrawnWaferUpdate(){return this.isTracked("transform")}get requiresRenderHoverUpdate(){return this.isTracked("hoverDie")}queueUpdate(){this.wafermap.$fastController.isConnected&&!this.updateQueued&&(this.updateQueued=!0,void 0===this.wafermap.currentTask?b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1})):(async()=>{await this.wafermap.currentTask,b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1,this.wafermap.currentTask=void 0}))})())}}class eQ{constructor(t){this.wafermap=t,this.invalidGridDimensions=!1,this.invalidDiesTableSchema=!1}getValidity(){return{invalidGridDimensions:this.invalidGridDimensions,invalidDiesTableSchema:this.invalidDiesTableSchema}}isValid(){return Object.values(this.getValidity()).every((t=>!t))}validateGridDimensions(){return this.invalidGridDimensions=!1,void 0===this.wafermap.gridMinX&&void 0===this.wafermap.gridMaxX&&void 0===this.wafermap.gridMinY&&void 0===this.wafermap.gridMaxY?this.invalidGridDimensions=!1:("number"!=typeof this.wafermap.gridMinX||"number"!=typeof this.wafermap.gridMaxX||"number"!=typeof this.wafermap.gridMinY||"number"!=typeof this.wafermap.gridMaxY||this.wafermap.gridMaxX<this.wafermap.gridMinX||this.wafermap.gridMaxY<this.wafermap.gridMinY)&&(this.invalidGridDimensions=!0),!this.invalidGridDimensions}validateDiesTableSchema(){if(this.invalidDiesTableSchema=!1,void 0===this.wafermap.diesTable)this.invalidDiesTableSchema=!1
15566
15566
  else{const t=this.wafermap.diesTable.schema.fields,e=t.find((t=>"colIndex"===t.name)),n=t.find((t=>"rowIndex"===t.name)),i=t.find((t=>"value"===t.name))
15567
15567
  e&&n&&i&&vG.isInt(e.type)&&32===e.type.bitWidth&&vG.isInt(n.type)&&32===n.type.bitWidth&&vG.isFloat(i.type)&&i.type.precision===Vj.DOUBLE||(this.invalidDiesTableSchema=!0)}return!this.invalidDiesTableSchema}}
15568
15568
  /**
@@ -15621,13 +15621,13 @@ function yQ(t,e){return bQ.set(t,e),t}function wQ(t){for(const[e,n]of lQ)if(n.ca
15621
15621
  return[{type:"HANDLER",name:e,value:i},o]}return[{type:"RAW",value:t},bQ.get(t)||[]]}function xQ(t){switch(t.type){case"HANDLER":return lQ.get(t.name).deserialize(t.value)
15622
15622
  case"RAW":return t.value}}function CQ(t,e,n,i){return new Promise((o=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-")
15623
15623
  e.set(s,o),t.start&&t.start(),t.postMessage(Object.assign({id:s},n),i)}))}let kQ
15624
- class SQ{constructor(t){this.wafermap=t,this.minDieDim=100}async setupWafer(t){if(void 0===this.matrixRenderer){const{matrixRenderer:t}=await(async()=>{if(void 0===kQ){const t=new Blob(['var MatrixRenderer = (function (exports) {\n \'use strict\';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol("Comlink.proxy");\n const createEndpoint = Symbol("Comlink.endpoint");\n const releaseProxy = Symbol("Comlink.releaseProxy");\n const finalizer = Symbol("Comlink.finalizer");\n const throwMarker = Symbol("Comlink.thrown");\n const isObject = (val) => (typeof val === "object" && val !== null) || typeof val === "function";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n ["proxy", proxyTransferHandler],\n ["throw", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === "*") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {\n ep.addEventListener("message", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin \'${ev.origin}\' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case "GET" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case "SET" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case "APPLY" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case "CONSTRUCT" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case "ENDPOINT" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case "RELEASE" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === "RELEASE" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener("message", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === "function") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError("Unserializable return value"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === "MessagePort";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener("message", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error("Proxy has been released and is not useable");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: "RELEASE" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = "FinalizationRegistry" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === "then") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: "GET" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: "SET" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: "ENDPOINT" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === "bind") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "APPLY" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "CONSTRUCT" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: "HANDLER" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: "RAW" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case "HANDLER" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case "RAW" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join("-");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink\'s `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.colorIndices = Int32Array.from([]);\n this.colors = [];\n this.colorValues = Float64Array.from([]);\n this.outsideRangeDieColor = \'rgba(218,223,236,1)\';\n this.fontSizeFactor = 0.8;\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n gridMinX: 0,\n gridMaxX: 0,\n gridMinY: 0,\n gridMaxY: 0,\n labelsFontSize: 0,\n colorScale: [],\n dieLabelsSuffix: \'\',\n maxCharacters: 0\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n setMatrixData(columnIndices, rowIndices, valuesBuffer) {\n const scaledColumnIndex = [];\n const columnPositions = [];\n const scaledRowIndices = [];\n const values = [];\n const colorIndices = [];\n let prevXIndex;\n let dieCount = 0;\n for (let i = 0; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n const yIndex = rowIndices[i];\n if (this.isDieInGrid(xIndex, yIndex)) {\n if (xIndex !== prevXIndex) {\n scaledColumnIndex.push(this.calculateHorizontalScaledIndices(xIndex));\n columnPositions.push(dieCount);\n prevXIndex = xIndex;\n }\n scaledRowIndices.push(this.calculateVerticalScaledIndices(yIndex));\n const value = valuesBuffer[i];\n values.push(value);\n colorIndices.push(this.findColorIndex(value));\n dieCount += 1;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n this.scaledRowIndices = Float64Array.from(scaledRowIndices);\n this.values = Float64Array.from(values);\n this.colorIndices = Int32Array.from(colorIndices);\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n this.colors = renderConfig.colorScale.map(marker => marker.color);\n this.colorValues = Float64Array.from(renderConfig.colorScale.map(marker => marker.value));\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext(\'2d\');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = this.colors[this.colorIndices[columnStartIndex]]\n ?? this.outsideRangeDieColor;\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n drawText() {\n this.context.font = `${this.renderConfig.labelsFontSize.toString()}px sans-serif`;\n this.context.fillStyle = \'#ffffff\';\n this.context.textAlign = \'center\';\n this.context.lineCap = \'butt\';\n const approximateTextHeight = this.context.measureText(\'M\');\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n let label = `${this.values[columnStartIndex] || \'NaN\'}${this.renderConfig.dieLabelsSuffix}`;\n if (label.length >= this.renderConfig.maxCharacters) {\n label = `${label.substring(0, this.renderConfig.maxCharacters)}…`;\n }\n this.context.fillText(label, scaledX + this.renderConfig.dieDimensions.width / 2, scaledY\n + this.renderConfig.dieDimensions.height / 2\n + approximateTextHeight.width / 2, this.renderConfig.dieDimensions.width * this.fontSizeFactor);\n }\n }\n }\n isDieInGrid(x, y) {\n return (x >= this.renderConfig.gridMinX\n && x <= this.renderConfig.gridMaxX\n && y >= this.renderConfig.gridMinY\n && y <= this.renderConfig.gridMaxY);\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n findColorIndex(value) {\n let index = -1;\n if (this.colorValues.length === 0 || this.colorValues[0] >= value) {\n return index;\n }\n for (let i = 0; i < this.colorValues.length; i++) {\n if (value <= this.colorValues[i]) {\n index = i;\n break;\n }\n }\n return index;\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n'],{type:"text/javascript"})
15624
+ class SQ{constructor(t){this.wafermap=t,this.minDieDim=100}async setupWafer(t){if(void 0===this.matrixRenderer){const{matrixRenderer:t}=await(async()=>{if(void 0===kQ){const t=new Blob(['var MatrixRenderer = (function (exports) {\n \'use strict\';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol("Comlink.proxy");\n const createEndpoint = Symbol("Comlink.endpoint");\n const releaseProxy = Symbol("Comlink.releaseProxy");\n const finalizer = Symbol("Comlink.finalizer");\n const throwMarker = Symbol("Comlink.thrown");\n const isObject = (val) => (typeof val === "object" && val !== null) || typeof val === "function";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n ["proxy", proxyTransferHandler],\n ["throw", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === "*") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {\n ep.addEventListener("message", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin \'${ev.origin}\' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case "GET" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case "SET" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case "APPLY" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case "CONSTRUCT" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case "ENDPOINT" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case "RELEASE" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === "RELEASE" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener("message", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === "function") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError("Unserializable return value"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === "MessagePort";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener("message", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error("Proxy has been released and is not useable");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: "RELEASE" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = "FinalizationRegistry" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === "then") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: "GET" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: "SET" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: "ENDPOINT" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === "bind") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "APPLY" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "CONSTRUCT" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: "HANDLER" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: "RAW" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case "HANDLER" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case "RAW" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join("-");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink\'s `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.colorIndices = Int32Array.from([]);\n this.colors = [];\n this.colorValues = Float64Array.from([]);\n this.outsideRangeDieColor = \'rgba(218,223,236,1)\';\n this.fontSizeFactor = 0.8;\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n gridMinX: 0,\n gridMaxX: 0,\n gridMinY: 0,\n gridMaxY: 0,\n labelsFontSize: 0,\n colorScale: [],\n dieLabelsSuffix: \'\',\n maxCharacters: 0\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n setMatrixData(columnIndices, rowIndices, valuesBuffer) {\n const scaledColumnIndex = [];\n const columnPositions = [];\n const scaledRowIndices = [];\n const values = [];\n const colorIndices = [];\n let prevXIndex;\n let dieCount = 0;\n for (let i = 0; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n const yIndex = rowIndices[i];\n if (this.isDieInGrid(xIndex, yIndex)) {\n if (xIndex !== prevXIndex) {\n scaledColumnIndex.push(this.calculateHorizontalScaledIndices(xIndex));\n columnPositions.push(dieCount);\n prevXIndex = xIndex;\n }\n scaledRowIndices.push(this.calculateVerticalScaledIndices(yIndex));\n const value = valuesBuffer[i];\n values.push(value);\n colorIndices.push(this.findColorIndex(value));\n dieCount += 1;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n this.scaledRowIndices = Float64Array.from(scaledRowIndices);\n this.values = Float64Array.from(values);\n this.colorIndices = Int32Array.from(colorIndices);\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n this.colors = renderConfig.colorScale.map(marker => marker.color);\n this.colorValues = Float64Array.from(renderConfig.colorScale.map(marker => marker.value));\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext(\'2d\');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = this.colors[this.colorIndices[columnStartIndex]]\n ?? this.outsideRangeDieColor;\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n drawText() {\n this.context.font = `${this.renderConfig.labelsFontSize.toString()}px sans-serif`;\n this.context.fillStyle = \'#ffffff\';\n this.context.textAlign = \'center\';\n this.context.lineCap = \'butt\';\n const approximateTextHeight = this.context.measureText(\'M\');\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n let label = `${this.values[columnStartIndex] ?? \'NaN\'}${this.renderConfig.dieLabelsSuffix}`;\n if (label.length >= this.renderConfig.maxCharacters) {\n label = `${label.substring(0, this.renderConfig.maxCharacters)}…`;\n }\n this.context.fillText(label, scaledX + this.renderConfig.dieDimensions.width / 2, scaledY\n + this.renderConfig.dieDimensions.height / 2\n + approximateTextHeight.width / 2, this.renderConfig.dieDimensions.width * this.fontSizeFactor);\n }\n }\n }\n isDieInGrid(x, y) {\n return (x >= this.renderConfig.gridMinX\n && x <= this.renderConfig.gridMaxX\n && y >= this.renderConfig.gridMinY\n && y <= this.renderConfig.gridMaxY);\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n findColorIndex(value) {\n let index = -1;\n if (this.colorValues.length === 0 || this.colorValues[0] >= value) {\n return index;\n }\n for (let i = 0; i < this.colorValues.length; i++) {\n if (value <= this.colorValues[i]) {\n index = i;\n break;\n }\n }\n return index;\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n'],{type:"text/javascript"})
15625
15625
  kQ=URL.createObjectURL(t)}const t=new Worker(kQ),e=hQ(t)
15626
15626
  return{matrixRenderer:await new e,terminate:()=>t.terminate()}})()
15627
15627
  this.matrixRenderer=t
15628
15628
  const e=this.wafermap.workerCanvas.transferControlToOffscreen()
15629
15629
  await this.matrixRenderer.setCanvas(yQ(e,[e]))}await this.matrixRenderer.setCanvasDimensions(t.canvasDimensions),await this.matrixRenderer.setRenderConfig(t.renderConfig),await this.matrixRenderer.setMatrixData(t.columnIndices,t.rowIndices,t.values)}async drawWafer(t){const e=t.transform.invert([0,0]),n=t.transform.invert([t.canvasDimensions.width,t.canvasDimensions.height])
15630
- await this.matrixRenderer.setTransformConfig({transform:t.transform,topLeftCanvasCorner:{x:e[0]-t.dieDimensions.width,y:e[1]-t.dieDimensions.height},bottomRightCanvasCorner:{x:n[0],y:n[1]}}),await this.matrixRenderer.drawWafer(),!t.dieLabelsHidden&&t.dieDimensions&&t.dieDimensions.width*t.dieDimensions.height*(t.transform.k||1)>=this.minDieDim&&await this.matrixRenderer.drawText()}renderHover(){void 0!==this.wafermap.computations.dieDimensions&&void 0!==this.wafermap.transform&&(this.wafermap.hoverWidth=this.wafermap.computations.dieDimensions.width*this.wafermap.transform.k,this.wafermap.hoverHeight=this.wafermap.computations.dieDimensions.height*this.wafermap.transform.k,this.wafermap.hoverOpacity=void 0===this.wafermap.hoverDie?WJ:jJ,this.wafermap.hoverTransform=this.calculateHoverTransform())}calculateHoverTransform(){if(void 0!==this.wafermap.hoverDie){const t=this.wafermap.computations.horizontalScale(this.wafermap.hoverDie.x)
15630
+ await this.matrixRenderer.setTransformConfig({transform:t.transform,topLeftCanvasCorner:{x:e[0]-t.dieDimensions.width,y:e[1]-t.dieDimensions.height},bottomRightCanvasCorner:{x:n[0],y:n[1]}}),await this.matrixRenderer.drawWafer(),!t.dieLabelsHidden&&t.dieDimensions.width*t.dieDimensions.height*(0!==t.transform.k?t.transform.k:1)>=this.minDieDim&&await this.matrixRenderer.drawText()}renderHover(){void 0!==this.wafermap.computations.dieDimensions&&void 0!==this.wafermap.transform&&(this.wafermap.hoverWidth=this.wafermap.computations.dieDimensions.width*this.wafermap.transform.k,this.wafermap.hoverHeight=this.wafermap.computations.dieDimensions.height*this.wafermap.transform.k,this.wafermap.hoverOpacity=void 0===this.wafermap.hoverDie?WJ:jJ,this.wafermap.hoverTransform=this.calculateHoverTransform())}calculateHoverTransform(){if(void 0!==this.wafermap.hoverDie){const t=this.wafermap.computations.horizontalScale(this.wafermap.hoverDie.x)
15631
15631
  if(void 0===t)return""
15632
15632
  const e=this.wafermap.computations.verticalScale(this.wafermap.hoverDie.y)
15633
15633
  if(void 0===e)return""
@@ -15716,7 +15716,7 @@ const TQ=t=>`${Po(t)}:host{box-sizing:border-box;}*{box-sizing:border-box;}:host
15716
15716
  </slot>
15717
15717
  </div>
15718
15718
  `,RQ={default:void 0}
15719
- class FQ extends Ve{constructor(){super(...arguments),this.appearance=RQ.default,this.inputEmpty=!0}slottedInputElementsChanged(t,e){this.inputEmpty=!e?.length}}t([ft],FQ.prototype,"appearance",void 0),t([C],FQ.prototype,"inputEmpty",void 0),t([C],FQ.prototype,"slottedInputElements",void 0)
15719
+ class FQ extends Ve{constructor(){super(...arguments),this.appearance=RQ.default,this.inputEmpty=!0}slottedInputElementsChanged(t,e){this.inputEmpty=void 0===e||0===e.length}}t([ft],FQ.prototype,"appearance",void 0),t([C],FQ.prototype,"inputEmpty",void 0),t([C],FQ.prototype,"slottedInputElements",void 0)
15720
15720
  const NQ=FQ.compose({baseName:"chat-conversation",template:OQ,styles:DQ})
15721
15721
  $i.getOrCreate().withPrefix("spright").register(NQ())
15722
15722
  const LQ=$t`
@@ -15895,7 +15895,7 @@ const VQ={system:void 0,outbound:"outbound",inbound:"inbound"},HQ=$t`
15895
15895
  margin-top: ${Ul};
15896
15896
  }
15897
15897
  `
15898
- class UQ extends Ve{constructor(){super(...arguments),this.messageType=VQ.system,this.footerActionsIsEmpty=!0}slottedFooterActionsElementsChanged(t,e){this.footerActionsIsEmpty=!e?.length}}t([ft({attribute:"message-type"})],UQ.prototype,"messageType",void 0),t([C],UQ.prototype,"footerActionsIsEmpty",void 0),t([C],UQ.prototype,"slottedFooterActionsElements",void 0),qe(UQ,ne)
15898
+ class UQ extends Ve{constructor(){super(...arguments),this.messageType=VQ.system,this.footerActionsIsEmpty=!0}slottedFooterActionsElementsChanged(t,e){this.footerActionsIsEmpty=void 0===e||0===e.length}}t([ft({attribute:"message-type"})],UQ.prototype,"messageType",void 0),t([C],UQ.prototype,"footerActionsIsEmpty",void 0),t([C],UQ.prototype,"slottedFooterActionsElements",void 0),qe(UQ,ne)
15899
15899
  const qQ=UQ.compose({baseName:"chat-message",template:(t,e)=>Q`
15900
15900
  <div class="container">
15901
15901
  ${oe(0,e)}
@@ -15969,7 +15969,7 @@ const jQ=$t`
15969
15969
  margin-top: ${Ul};
15970
15970
  }
15971
15971
  `
15972
- class WQ extends Ve{constructor(){super(...arguments),this.footerActionsIsEmpty=!0}slottedFooterActionsElementsChanged(t,e){this.footerActionsIsEmpty=!e?.length}}t([C],WQ.prototype,"footerActionsIsEmpty",void 0),t([C],WQ.prototype,"slottedFooterActionsElements",void 0),qe(WQ,ne)
15972
+ class WQ extends Ve{constructor(){super(...arguments),this.footerActionsIsEmpty=!0}slottedFooterActionsElementsChanged(t,e){this.footerActionsIsEmpty=void 0===e||0===e.length}}t([C],WQ.prototype,"footerActionsIsEmpty",void 0),t([C],WQ.prototype,"slottedFooterActionsElements",void 0),qe(WQ,ne)
15973
15973
  const GQ=WQ.compose({baseName:"chat-message-inbound",template:(t,e)=>Q`
15974
15974
  <div class="container">
15975
15975
  ${oe(0,e)}