@teipublisher/pb-components 3.0.0-next-4.21 → 3.0.0-next-4.22
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.
- package/CHANGELOG.md +15 -0
- package/dist/{focus-mixin-BTMHjJn_.js → focus-mixin-177q2Y1S.js} +17 -17
- package/dist/pb-component-docs.js +18 -18
- package/dist/pb-components-bundle.js +220 -218
- package/dist/pb-mei.js +1 -1
- package/dist/pb-odd-editor.js +1 -1
- package/dist/pb-tify.js +1 -1
- package/dist/purify.es-DOKMcktY.js +1 -0
- package/dist/{urls-D1E6DSqS.js → urls-SAtBvPhD.js} +1 -1
- package/package.json +2 -1
- package/src/authority/airtable.js +3 -1
- package/src/authority/custom.js +2 -1
- package/src/authority/gnd.js +3 -1
- package/src/authority/kbga.js +3 -1
- package/src/authority/metagrid.js +3 -1
- package/src/authority/reconciliation.js +3 -1
- package/src/docs/pb-component-view.js +6 -1
- package/src/pb-authority-lookup.js +18 -2
- package/src/pb-link.js +4 -1
- package/src/pb-load.js +8 -3
- package/src/pb-markdown.js +5 -1
- package/src/pb-mei.js +6 -1
- package/src/pb-message.js +3 -2
- package/src/pb-page.js +4 -1
- package/src/pb-split-list.js +18 -15
- package/src/pb-timeline.js +11 -9
- package/src/pb-view-annotate.js +92 -16
- package/src/pb-view.js +5 -2
- package/src/urls.js +9 -3
- package/src/utils/sanitize.js +204 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [3.0.0-next-4.22](https://github.com/eeditiones/tei-publisher-components/compare/v3.0.0-next-4.21...v3.0.0-next-4.22) (2026-05-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **pb-mei:** improve error handling and SVG rendering logic ([3f4a93b](https://github.com/eeditiones/tei-publisher-components/commit/3f4a93bf064e9302b48fdc9014efc3ccddc0a205))
|
|
7
|
+
* **sanitation:** allow pb-code-highlight attributes ([5e40d7b](https://github.com/eeditiones/tei-publisher-components/commit/5e40d7bbec876d5af235baaa4c9d591498ea838e))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **pb-timeline:** implement HTML sanitization for tooltips and info items ([3f77dc4](https://github.com/eeditiones/tei-publisher-components/commit/3f77dc4de8f053ac4977bb661ecc9579c24f5f57))
|
|
13
|
+
* **pb-view-annotate:** add match anchor functionality for text segments ([5b85178](https://github.com/eeditiones/tei-publisher-components/commit/5b85178ca95a7feac023d8ee64d343e2b0772a1c))
|
|
14
|
+
* **sanitize:** add DOMPurify for HTML sanitization ([e717b0b](https://github.com/eeditiones/tei-publisher-components/commit/e717b0b5fe2320c4e2b93f7b6fe59be780f656a2))
|
|
15
|
+
|
|
1
16
|
# [3.0.0-next-4.21](https://github.com/eeditiones/tei-publisher-components/compare/v3.0.0-next-4.20...v3.0.0-next-4.21) (2026-05-24)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin-BUnZhCew.js";import{t as c}from"./pb-dialog-69GQVfpQ.js";import{e as d,a as h,b as u,g as p,t as g}from"./pb-i18n-DpafwkRO.js";import{l as f}from"./logger-BDsEU7Z8.js";import{o as m}from"./unsafe-html-C8JBHfUC.js";const
|
|
1
|
+
import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin-BUnZhCew.js";import{t as c}from"./pb-dialog-69GQVfpQ.js";import{e as d,a as h,b as u,g as p,t as g}from"./pb-i18n-DpafwkRO.js";import{l as f}from"./logger-BDsEU7Z8.js";import{o as m}from"./unsafe-html-C8JBHfUC.js";import{p as v}from"./purify.es-DOKMcktY.js";const b=e=>e??t;class y extends(c(e(s))){static get properties(){return Object.assign(Object.assign({},super.properties),{},{noAnimation:{type:Boolean,attribute:"no-animation"},opened:{type:Boolean},toggles:{type:Boolean},expandIcon:{type:String,attribute:"expand-icon"},collapseIcon:{type:String,attribute:"collapse-icon"},iconSprite:{type:String,attribute:"icon-sprite"},noIcons:{type:Boolean,attribute:"no-icons"}})}constructor(){super(),this.horizontal=!1,this.noAnimation=!1,this.opened=!1,this.expandIcon="icons:expand-more",this.collapseIcon="icons:expand-less",this.noIcons=!1,this.toggles=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("pb-collapse-open",()=>{this.open()}),this.toggles&&this.subscribeTo("pb-collapse-open",t=>{if(t.detail&&t.detail._source!==this){for(const e of this.querySelectorAll("pb-collapse"))if(e===t.detail._source)return;this.close()}})}updated(t){if(super.updated(t),t.has("opened")){const t=this.shadowRoot.querySelector("details");t&&(t.open=this.opened)}}open(){this.opened||(this.opened=!0,this.emitTo("pb-collapse-open",this))}close(){this.opened&&(this.opened=!1)}toggle(){this.opened=!this.opened,this.opened&&this.emitTo("pb-collapse-open",this.data)}_handleToggle(t){t.preventDefault(),this.toggle()}render(){return n`
|
|
2
2
|
<details ?open="${this.opened}" class="${this.horizontal?"horizontal":""}">
|
|
3
3
|
<summary
|
|
4
4
|
@click="${this._handleToggle}"
|
|
@@ -15,7 +15,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
15
15
|
</details>
|
|
16
16
|
`}_renderIcon({position:t}){if(this.noIcons)return null;const e=this.classList&&this.classList.contains("icon-right");if("left"===t&&e||"right"===t&&!e)return null;const s=this._customIconImage(),i=s&&"none"!==s,o=this.opened?this.collapseIcon:this.expandIcon,r=this.iconSprite||null;return n`
|
|
17
17
|
<span class="collapse-icon" data-custom="${i?"true":"false"}">
|
|
18
|
-
<pb-icon icon="${o}" sprite=${
|
|
18
|
+
<pb-icon icon="${o}" sprite=${b(r||void 0)} decorative></pb-icon>
|
|
19
19
|
</span>
|
|
20
20
|
`}_customIconImage(){return"undefined"==typeof window||"function"!=typeof getComputedStyle?"none":getComputedStyle(this).getPropertyValue("--pb-collapse-icon-image").trim()||"none"}static get styles(){return i`
|
|
21
21
|
:host {
|
|
@@ -107,10 +107,10 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
107
107
|
max-height: 0;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
`}}customElements.get("pb-collapse")||customElements.define("pb-collapse",b);class y extends HTMLElement{static get observedAttributes(){return["handle-as","method","with-credentials","content-type"]}constructor(){super(),this._url="",this._method="GET",this._handleAs="json",this._withCredentials=!1,this._contentType=null,this.params={},this.headers={},this.body=void 0,this.loading=!1,this.lastResponse=null,this.lastRequest=null,this.lastError=null,this._controller=null}connectedCallback(){this.hasAttribute("method")&&this.attributeChangedCallback("method",null,this.getAttribute("method")),this.hasAttribute("handle-as")&&this.attributeChangedCallback("handle-as",null,this.getAttribute("handle-as")),this.hasAttribute("with-credentials")&&this.attributeChangedCallback("with-credentials",null,this.getAttribute("with-credentials")),this.hasAttribute("content-type")&&this.attributeChangedCallback("content-type",null,this.getAttribute("content-type"))}attributeChangedCallback(t,e,s){switch(t){case"handle-as":this._handleAs=(s||"json").toLowerCase();break;case"method":this._method=(s||"GET").toUpperCase();break;case"with-credentials":this._withCredentials=null!==s;break;case"content-type":this._contentType=s||null}}set url(t){this._url=t||""}get url(){return this._url}set method(t){const e=(t||"GET").toUpperCase();this._method!==e&&(this._method=e,null==t?this.removeAttribute("method"):this.setAttribute("method",t))}get method(){return this._method}set handleAs(t){const e=(t||"json").toLowerCase();this._handleAs!==e&&(this._handleAs=e,null==t?this.removeAttribute("handle-as"):this.setAttribute("handle-as",t))}get handleAs(){return this._handleAs}set withCredentials(t){const e=Boolean(t);this._withCredentials!==e&&(this._withCredentials=e,e?this.setAttribute("with-credentials",""):this.removeAttribute("with-credentials"))}get withCredentials(){return this._withCredentials}set contentType(t){this._contentType!==t&&(this._contentType=t||null,null==t?this.removeAttribute("content-type"):this.setAttribute("content-type",t))}get contentType(){return this._contentType}abort(){this._controller&&(this._controller.abort(),this._controller=null,this.loading=!1)}async generateRequest(){if(!this._url)return null;this.abort(),this._controller=new AbortController;const t=this._buildRequestInit();t.signal=this._controller.signal,this.loading=!0;try{const e=this._buildUrlWithParams(),s=await fetch(e,t),{parsed:n,rawText:i}=await this._parseBody(s);if(this.lastRequest={url:e,method:this._method,params:this.params,headers:t.headers},!s.ok){const t={status:s.status,statusText:s.statusText,response:i,xhr:this._createXhrShim(s)};return this.lastError=t,this.lastResponse=null,this.loading=!1,this.dispatchEvent(new CustomEvent("error",{detail:t})),null}this.lastError=null,this.lastResponse=n,this.loading=!1;const o={response:n,status:s.status,xhr:this._createXhrShim(s),request:this.lastRequest};return this.dispatchEvent(new CustomEvent("response",{detail:o})),n}catch(t){if("AbortError"===t.name)return null;if(!this.lastError){const e={status:t.status||0,statusText:t.statusText||t.message,response:t.response||null,xhr:t.xhr||null};this.lastError=e,this.lastResponse=null,this.dispatchEvent(new CustomEvent("error",{detail:e}))}return this.loading=!1,null}finally{this._controller=null}}_buildUrlWithParams(){if(!this.params||0===Object.keys(this.params).length)return this._url;const t=[];if(Object.entries(this.params).forEach(([e,s])=>{null!=s&&(Array.isArray(s)?s.forEach(s=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`)}):t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`))}),0===t.length)return this._url;const e=this._url.includes("?")?"&":"?";return`${this._url}${e}${t.join("&")}`}_buildRequestInit(){const t=this.headers&&"function"==typeof this.headers.entries?Object.fromEntries(this.headers.entries()):this.headers||{},e=new Headers(t),s={method:this._method||"GET",headers:e,credentials:this._withCredentials?"include":"same-origin"},n=this._prepareBody(e);return void 0!==n&&(s.body=n),s}_prepareBody(t){if(null==this.body)return;if(this.body instanceof FormData||this.body instanceof Blob||this.body instanceof ArrayBuffer)return this.body;if("string"==typeof this.body)return this._contentType&&!t.has("Content-Type")&&t.set("Content-Type",this._contentType),this.body;if(this.body instanceof URLSearchParams)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this.body.toString();if("application/x-www-form-urlencoded"===this._contentType)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this._encodeFormBody(this.body);const e=this._contentType||"application/json";return t.has("Content-Type")||t.set("Content-Type",e),e.includes("json")?JSON.stringify(this.body):this.body}async _parseBody(t){const e=t.clone();let s="";try{s=await e.text()}catch(t){s=""}if(204===t.status||205===t.status)return{parsed:null,rawText:""};switch(this._handleAs){case"text":return{parsed:s,rawText:s};case"json":if(!s)return{parsed:null,rawText:s};try{return{parsed:JSON.parse(s),rawText:s}}catch(t){return{parsed:null,rawText:s}}case"blob":return{parsed:await t.blob(),rawText:s};case"arraybuffer":return{parsed:await t.arrayBuffer(),rawText:s};default:return{parsed:s,rawText:s}}}_createXhrShim(t){return{status:t.status,statusText:t.statusText,responseURL:t.url,getResponseHeader:e=>t.headers.get(e),getAllResponseHeaders:()=>[...t.headers.entries()].map(([t,e])=>`${t}: ${e}`).join("\r\n")}}_encodeFormBody(t){if(t instanceof URLSearchParams)return t.toString();if("string"==typeof t)return t;if(!t||"object"!=typeof t)return"";const e=new URLSearchParams;return Object.entries(t).forEach(([t,s])=>{Array.isArray(s)?s.forEach(s=>e.append(t,s)):null!=s&&e.append(t,s)}),e.toString()}}customElements.get("pb-fetch")||customElements.define("pb-fetch",y);const _=d(class extends h{constructor(t){var e;if(super(t),t.type!==u.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e){var s;e[t]&&(null===(s=this.nt)||void 0===s||!s.has(t))&&this.st.add(t)}return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){var i;const s=!!e[t];s===this.st.has(t)||(null===(i=this.nt)||void 0===i?void 0:i.has(t))||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return o}});let w=0;const x={ENTER:"Enter",ESC:"Escape",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown"},k=200;function C(t){if("object"==typeof t&&t){const e=t.text??t.value??"",s=t.value??t.text??"";return{text:String(e),value:String(s)}}const e=null==t?"":String(t);return{text:e,value:e}}function S(t=[]){return Array.isArray(t)?t.map(C):[]}class E extends(e(s)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},value:{type:String},placeholder:{type:String,attribute:"placeholder"},label:{type:String},source:{type:String},preload:{type:Boolean},suggestions:{type:Array},substring:{type:Boolean},icon:{type:String},helperText:{type:String,attribute:"helper-text"},alwaysFloatLabel:{type:Boolean,attribute:"always-float-label"},disabled:{type:Boolean,reflect:!0},requestParams:{type:Object,attribute:!1}})}constructor(){super(),this.placeholder="search.placeholder",this.label="",this.suggestions=[],this.substring=!1,this.preload=!1,this.icon="",this.helperText="",this.alwaysFloatLabel=!1,this.disabled=!1,this.lastSelected=null,this.value="",this.name="",this._hiddenInput=null,this._initialized=!1,this._menuOpen=!1,this._isFocused=!1,this._inputValue="",this._filteredSuggestions=[],this._highlightedIndex=-1,this._loading=!1,this._pointerSelecting=!1,this._fetchTimeout=null,this._abortController=null,this.requestParams={},this._inputId="pb-autocomplete-input-"+ ++w}_resolveLabelText(){return this.label?p(this.label):this.placeholder?p(this.placeholder):""}_resolveHelperText(){return this.helperText?p(this.helperText):""}get _input(){var t;return(null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(this._inputId))??null}connectedCallback(){super.connectedCallback(),this._inputValue=this.value||""}firstUpdated(){!this._hiddenInput&&this.name&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this.appendChild(this._hiddenInput)),r("pb-page-ready",()=>{this.preload&&this.source?this._sendRequest():this.value&&this.source?this._sendRequest(this.value):(this._syncInputValueFromSuggestions(),this._filterSuggestions())}),this.source||(this._syncInputValueFromSuggestions(),this._filterSuggestions())}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this._fetchTimeout),this._abortController&&(this._abortController.abort(),this._abortController=null)}updated(t){t.has("suggestions")&&(this._filterSuggestions(),this._syncInputValueFromSuggestions()),t.has("value")&&(this._syncInputValueFromSuggestions(),this._hiddenInput&&(this._hiddenInput.value=this.value??"")),t.has("name")&&(!this._hiddenInput&&this.name?(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this._hiddenInput.disabled=this.disabled,this.appendChild(this._hiddenInput)):this._hiddenInput&&(this._hiddenInput.name=this.name)),t.has("disabled")&&(this.disabled&&this._closeMenu(),this._hiddenInput&&(this._hiddenInput.disabled=this.disabled))}render(){const e=this._resolveLabelText(),s=this._resolveHelperText(),i={"pb-input-container":!0,"pb-input-container--focused":this._isFocused,"pb-input-container--filled":!!this._inputValue,"pb-input-container--has-prefix":!!this.icon,"pb-input-container--always-float":this.alwaysFloatLabel,"pb-input-container--disabled":this.disabled},o=this._menuOpen&&this._highlightedIndex>=0?`pb-autocomplete-option-${this._highlightedIndex}`:void 0,r=this._filteredSuggestions,a=this._menuOpen&&(r.length>0||this._loading),l=e?`${this._inputId}-label`:void 0,c=s?`${this._inputId}-helper`:void 0,d=!l&&e?e:void 0,h=l||!this.placeholder?"":p(this.placeholder);return n`
|
|
110
|
+
`}}function _(t,e={}){if(!t||"string"!=typeof t)return"";const s=/<([a-z]+-[a-z0-9-]+)(?:\s|>)/gi,n=new Set;let i;for(;null!==(i=s.exec(t));)n.add(i[1].toLowerCase());const o={ALLOWED_TAGS:["p","br","strong","em","u","s","sub","sup","h1","h2","h3","h4","h5","h6","ul","ol","li","dl","dt","dd","blockquote","pre","code","kbd","samp","a","img","figure","figcaption","table","thead","tbody","tfoot","tr","th","td","div","span","section","article","aside","header","footer","main","nav","svg","circle","rect","path","line","polyline","polygon","g","text","tspan","mark","small","del","ins","q","cite","abbr","dfn","time","template"],FORBID_TAGS:["script","iframe","object","embed","form","input","button","textarea","select"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","onchange","onsubmit"],ALLOWED_ATTR:["href","title","alt","src","width","height","class","id","role","aria-label","aria-labelledby","viewBox","cx","cy","r","x","y","d","fill","stroke","style","key","loaded","display","language","line-numbers"],ALLOW_DATA_ATTR:!0,ALLOW_UNKNOWN_PROTOCOLS:!1,SAFE_FOR_TEMPLATES:!0,KEEP_CONTENT:!0},r=Object.assign(Object.assign({},o),e);n.size>0&&(r.ADD_TAGS=[...r.ADD_TAGS||[],...Array.from(n)]);let a=v.sanitize(t,r);return a.includes("style=")&&(a=a.replace(/style="([^"]*javascript:[^"]*)"|style='([^']*javascript:[^']*)'/gi,'style=""'),a=a.replace(/style="([^"]*data:[^"]*)"|style='([^']*data:[^']*)'/gi,'style=""'),a=a.replace(/style="([^"]*expression\([^"]*\))"|style='([^']*expression\([^']*\))'/gi,'style=""')),a}customElements.get("pb-collapse")||customElements.define("pb-collapse",y);class w extends HTMLElement{static get observedAttributes(){return["handle-as","method","with-credentials","content-type"]}constructor(){super(),this._url="",this._method="GET",this._handleAs="json",this._withCredentials=!1,this._contentType=null,this.params={},this.headers={},this.body=void 0,this.loading=!1,this.lastResponse=null,this.lastRequest=null,this.lastError=null,this._controller=null}connectedCallback(){this.hasAttribute("method")&&this.attributeChangedCallback("method",null,this.getAttribute("method")),this.hasAttribute("handle-as")&&this.attributeChangedCallback("handle-as",null,this.getAttribute("handle-as")),this.hasAttribute("with-credentials")&&this.attributeChangedCallback("with-credentials",null,this.getAttribute("with-credentials")),this.hasAttribute("content-type")&&this.attributeChangedCallback("content-type",null,this.getAttribute("content-type"))}attributeChangedCallback(t,e,s){switch(t){case"handle-as":this._handleAs=(s||"json").toLowerCase();break;case"method":this._method=(s||"GET").toUpperCase();break;case"with-credentials":this._withCredentials=null!==s;break;case"content-type":this._contentType=s||null}}set url(t){this._url=t||""}get url(){return this._url}set method(t){const e=(t||"GET").toUpperCase();this._method!==e&&(this._method=e,null==t?this.removeAttribute("method"):this.setAttribute("method",t))}get method(){return this._method}set handleAs(t){const e=(t||"json").toLowerCase();this._handleAs!==e&&(this._handleAs=e,null==t?this.removeAttribute("handle-as"):this.setAttribute("handle-as",t))}get handleAs(){return this._handleAs}set withCredentials(t){const e=Boolean(t);this._withCredentials!==e&&(this._withCredentials=e,e?this.setAttribute("with-credentials",""):this.removeAttribute("with-credentials"))}get withCredentials(){return this._withCredentials}set contentType(t){this._contentType!==t&&(this._contentType=t||null,null==t?this.removeAttribute("content-type"):this.setAttribute("content-type",t))}get contentType(){return this._contentType}abort(){this._controller&&(this._controller.abort(),this._controller=null,this.loading=!1)}async generateRequest(){if(!this._url)return null;this.abort(),this._controller=new AbortController;const t=this._buildRequestInit();t.signal=this._controller.signal,this.loading=!0;try{const e=this._buildUrlWithParams(),s=await fetch(e,t),{parsed:n,rawText:i}=await this._parseBody(s);if(this.lastRequest={url:e,method:this._method,params:this.params,headers:t.headers},!s.ok){const t={status:s.status,statusText:s.statusText,response:i,xhr:this._createXhrShim(s)};return this.lastError=t,this.lastResponse=null,this.loading=!1,this.dispatchEvent(new CustomEvent("error",{detail:t})),null}this.lastError=null,this.lastResponse=n,this.loading=!1;const o={response:n,status:s.status,xhr:this._createXhrShim(s),request:this.lastRequest};return this.dispatchEvent(new CustomEvent("response",{detail:o})),n}catch(t){if("AbortError"===t.name)return null;if(!this.lastError){const e={status:t.status||0,statusText:t.statusText||t.message,response:t.response||null,xhr:t.xhr||null};this.lastError=e,this.lastResponse=null,this.dispatchEvent(new CustomEvent("error",{detail:e}))}return this.loading=!1,null}finally{this._controller=null}}_buildUrlWithParams(){if(!this.params||0===Object.keys(this.params).length)return this._url;const t=[];if(Object.entries(this.params).forEach(([e,s])=>{null!=s&&(Array.isArray(s)?s.forEach(s=>{t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`)}):t.push(`${encodeURIComponent(e)}=${encodeURIComponent(s)}`))}),0===t.length)return this._url;const e=this._url.includes("?")?"&":"?";return`${this._url}${e}${t.join("&")}`}_buildRequestInit(){const t=this.headers&&"function"==typeof this.headers.entries?Object.fromEntries(this.headers.entries()):this.headers||{},e=new Headers(t),s={method:this._method||"GET",headers:e,credentials:this._withCredentials?"include":"same-origin"},n=this._prepareBody(e);return void 0!==n&&(s.body=n),s}_prepareBody(t){if(null==this.body)return;if(this.body instanceof FormData||this.body instanceof Blob||this.body instanceof ArrayBuffer)return this.body;if("string"==typeof this.body)return this._contentType&&!t.has("Content-Type")&&t.set("Content-Type",this._contentType),this.body;if(this.body instanceof URLSearchParams)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this.body.toString();if("application/x-www-form-urlencoded"===this._contentType)return t.has("Content-Type")||t.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),this._encodeFormBody(this.body);const e=this._contentType||"application/json";return t.has("Content-Type")||t.set("Content-Type",e),e.includes("json")?JSON.stringify(this.body):this.body}async _parseBody(t){const e=t.clone();let s="";try{s=await e.text()}catch(t){s=""}if(204===t.status||205===t.status)return{parsed:null,rawText:""};switch(this._handleAs){case"text":return{parsed:s,rawText:s};case"json":if(!s)return{parsed:null,rawText:s};try{return{parsed:JSON.parse(s),rawText:s}}catch(t){return{parsed:null,rawText:s}}case"blob":return{parsed:await t.blob(),rawText:s};case"arraybuffer":return{parsed:await t.arrayBuffer(),rawText:s};default:return{parsed:s,rawText:s}}}_createXhrShim(t){return{status:t.status,statusText:t.statusText,responseURL:t.url,getResponseHeader:e=>t.headers.get(e),getAllResponseHeaders:()=>[...t.headers.entries()].map(([t,e])=>`${t}: ${e}`).join("\r\n")}}_encodeFormBody(t){if(t instanceof URLSearchParams)return t.toString();if("string"==typeof t)return t;if(!t||"object"!=typeof t)return"";const e=new URLSearchParams;return Object.entries(t).forEach(([t,s])=>{Array.isArray(s)?s.forEach(s=>e.append(t,s)):null!=s&&e.append(t,s)}),e.toString()}}customElements.get("pb-fetch")||customElements.define("pb-fetch",w);const x=d(class extends h{constructor(t){var e;if(super(t),t.type!==u.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e){var s;e[t]&&(null===(s=this.nt)||void 0===s||!s.has(t))&&this.st.add(t)}return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){var i;const s=!!e[t];s===this.st.has(t)||(null===(i=this.nt)||void 0===i?void 0:i.has(t))||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return o}});let k=0;const C={ENTER:"Enter",ESC:"Escape",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown"},S=200;function E(t){if("object"==typeof t&&t){const e=t.text??t.value??"",s=t.value??t.text??"";return{text:String(e),value:String(s)}}const e=null==t?"":String(t);return{text:e,value:e}}function T(t=[]){return Array.isArray(t)?t.map(E):[]}class A extends(e(s)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{name:{type:String},value:{type:String},placeholder:{type:String,attribute:"placeholder"},label:{type:String},source:{type:String},preload:{type:Boolean},suggestions:{type:Array},substring:{type:Boolean},icon:{type:String},helperText:{type:String,attribute:"helper-text"},alwaysFloatLabel:{type:Boolean,attribute:"always-float-label"},disabled:{type:Boolean,reflect:!0},requestParams:{type:Object,attribute:!1}})}constructor(){super(),this.placeholder="search.placeholder",this.label="",this.suggestions=[],this.substring=!1,this.preload=!1,this.icon="",this.helperText="",this.alwaysFloatLabel=!1,this.disabled=!1,this.lastSelected=null,this.value="",this.name="",this._hiddenInput=null,this._initialized=!1,this._menuOpen=!1,this._isFocused=!1,this._inputValue="",this._filteredSuggestions=[],this._highlightedIndex=-1,this._loading=!1,this._pointerSelecting=!1,this._fetchTimeout=null,this._abortController=null,this.requestParams={},this._inputId="pb-autocomplete-input-"+ ++k}_resolveLabelText(){return this.label?p(this.label):this.placeholder?p(this.placeholder):""}_resolveHelperText(){return this.helperText?p(this.helperText):""}get _input(){var t;return(null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(this._inputId))??null}connectedCallback(){super.connectedCallback(),this._inputValue=this.value||""}firstUpdated(){!this._hiddenInput&&this.name&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this.appendChild(this._hiddenInput)),r("pb-page-ready",()=>{this.preload&&this.source?this._sendRequest():this.value&&this.source?this._sendRequest(this.value):(this._syncInputValueFromSuggestions(),this._filterSuggestions())}),this.source||(this._syncInputValueFromSuggestions(),this._filterSuggestions())}disconnectedCallback(){super.disconnectedCallback(),window.clearTimeout(this._fetchTimeout),this._abortController&&(this._abortController.abort(),this._abortController=null)}updated(t){t.has("suggestions")&&(this._filterSuggestions(),this._syncInputValueFromSuggestions()),t.has("value")&&(this._syncInputValueFromSuggestions(),this._hiddenInput&&(this._hiddenInput.value=this.value??"")),t.has("name")&&(!this._hiddenInput&&this.name?(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this.name,this._hiddenInput.value=this.value||"",this._hiddenInput.disabled=this.disabled,this.appendChild(this._hiddenInput)):this._hiddenInput&&(this._hiddenInput.name=this.name)),t.has("disabled")&&(this.disabled&&this._closeMenu(),this._hiddenInput&&(this._hiddenInput.disabled=this.disabled))}render(){const e=this._resolveLabelText(),s=this._resolveHelperText(),i={"pb-input-container":!0,"pb-input-container--focused":this._isFocused,"pb-input-container--filled":!!this._inputValue,"pb-input-container--has-prefix":!!this.icon,"pb-input-container--always-float":this.alwaysFloatLabel,"pb-input-container--disabled":this.disabled},o=this._menuOpen&&this._highlightedIndex>=0?`pb-autocomplete-option-${this._highlightedIndex}`:void 0,r=this._filteredSuggestions,a=this._menuOpen&&(r.length>0||this._loading),l=e?`${this._inputId}-label`:void 0,c=s?`${this._inputId}-helper`:void 0,d=!l&&e?e:void 0,h=l||!this.placeholder?"":p(this.placeholder);return n`
|
|
111
111
|
<div class="autocomplete">
|
|
112
112
|
<slot></slot>
|
|
113
|
-
<div class="${
|
|
113
|
+
<div class="${x(i)}">
|
|
114
114
|
${this.icon?n`<pb-icon class="pb-input-prefix" icon="${this.icon}" decorative></pb-icon>`:t}
|
|
115
115
|
<input
|
|
116
116
|
id="${this._inputId}"
|
|
@@ -125,10 +125,10 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
125
125
|
aria-autocomplete="list"
|
|
126
126
|
aria-expanded="${this._menuOpen?"true":"false"}"
|
|
127
127
|
aria-controls="pb-autocomplete-list"
|
|
128
|
-
aria-activedescendant=${
|
|
129
|
-
aria-labelledby=${
|
|
130
|
-
aria-describedby=${
|
|
131
|
-
aria-label=${
|
|
128
|
+
aria-activedescendant=${b(o)}
|
|
129
|
+
aria-labelledby=${b(l)}
|
|
130
|
+
aria-describedby=${b(c)}
|
|
131
|
+
aria-label=${b(d)}
|
|
132
132
|
?disabled=${this.disabled}
|
|
133
133
|
@input=${this._handleInput}
|
|
134
134
|
@keydown=${this._handleKeydown}
|
|
@@ -157,7 +157,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
157
157
|
`}_renderSuggestion(t,e){const s=e===this._highlightedIndex;return n`
|
|
158
158
|
<li
|
|
159
159
|
id="pb-autocomplete-option-${e}"
|
|
160
|
-
class=${
|
|
160
|
+
class=${x({suggestion:!0,"suggestion--active":s})}
|
|
161
161
|
role="option"
|
|
162
162
|
aria-selected="${s?"true":"false"}"
|
|
163
163
|
@click=${()=>this._selectSuggestion(t)}
|
|
@@ -165,7 +165,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
165
165
|
>
|
|
166
166
|
${t.text}
|
|
167
167
|
</li>
|
|
168
|
-
`}_handleInput(t){if(this.disabled)return void t.preventDefault();const e=t.currentTarget;this._inputValue=e.value,this.value=e.value,this._hiddenInput&&(this._hiddenInput.value=this.value),this._filterSuggestions(),this._menuOpen=!0,this._highlightedIndex=this._filteredSuggestions.length?0:-1,this.requestUpdate(),this.source&&!this.preload&&this._scheduleFetch(this.value),this.emitTo("pb-autocomplete-input",{text:this._inputValue,value:this.value})}_handleFocus(){this.disabled||(this._isFocused=!0,this._filteredSuggestions.length&&(this._menuOpen=!0))}_handleBlur(){this._isFocused=!1,this._pointerSelecting||window.setTimeout(()=>{this._isFocused||this._pointerSelecting||this._closeMenu()},100)}_handleSuggestionsPointerDown(t){this.disabled||(t.preventDefault(),this._pointerSelecting=!0)}_handleSuggestionsPointerUp(){var t;this.disabled||(this._pointerSelecting=!1,null===(t=this._input)||void 0===t||t.focus())}_handleKeydown(t){if(this.disabled)return;const{key:e}=t;switch(e){case
|
|
168
|
+
`}_handleInput(t){if(this.disabled)return void t.preventDefault();const e=t.currentTarget;this._inputValue=e.value,this.value=e.value,this._hiddenInput&&(this._hiddenInput.value=this.value),this._filterSuggestions(),this._menuOpen=!0,this._highlightedIndex=this._filteredSuggestions.length?0:-1,this.requestUpdate(),this.source&&!this.preload&&this._scheduleFetch(this.value),this.emitTo("pb-autocomplete-input",{text:this._inputValue,value:this.value})}_handleFocus(){this.disabled||(this._isFocused=!0,this._filteredSuggestions.length&&(this._menuOpen=!0))}_handleBlur(){this._isFocused=!1,this._pointerSelecting||window.setTimeout(()=>{this._isFocused||this._pointerSelecting||this._closeMenu()},100)}_handleSuggestionsPointerDown(t){this.disabled||(t.preventDefault(),this._pointerSelecting=!0)}_handleSuggestionsPointerUp(){var t;this.disabled||(this._pointerSelecting=!1,null===(t=this._input)||void 0===t||t.focus())}_handleKeydown(t){if(this.disabled)return;const{key:e}=t;switch(e){case C.ARROW_DOWN:t.preventDefault(),this._openMenu(),this._moveHighlight(1);break;case C.ARROW_UP:t.preventDefault(),this._openMenu(),this._moveHighlight(-1);break;case C.ENTER:this._menuOpen&&t.preventDefault(),this._handleEnter();break;case C.ESC:this._closeMenu()}}_handleEnter(){if(this.disabled)return;if(this._menuOpen&&this._highlightedIndex>=0){const t=this._filteredSuggestions[this._highlightedIndex];if(t)return void this._selectSuggestion(t)}if(!this.value)return;const t=this._findSuggestionByValue(this.value);t&&this._selectSuggestion(t)}_openMenu(){this.disabled||this._menuOpen||(this._menuOpen=!0,this.requestUpdate())}_closeMenu(){this._menuOpen&&(this._menuOpen=!1,this._highlightedIndex=-1,this.requestUpdate())}_moveHighlight(t){if(this.disabled)return;const e=this._filteredSuggestions;if(!e.length)return this._highlightedIndex=-1,void this.requestUpdate();let s=this._highlightedIndex+t;s<0?s=e.length-1:s>=e.length&&(s=0),this._setHighlightedIndex(s)}async _setHighlightedIndex(t){var e;this._highlightedIndex=t,this.requestUpdate(),await this.updateComplete;const s=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById(`pb-autocomplete-option-${t}`);null==s||s.scrollIntoView({block:"nearest"})}_selectSuggestion(t){if(this.disabled)return;const{text:e,value:s}=E(t);this.lastSelected=e,this.value=s,this._inputValue=e,this._hiddenInput&&(this._hiddenInput.value=s);const n=this._input;n&&(n.value=e),this._closeMenu(),this.emitTo("pb-autocomplete-selected",{text:e,value:s}),this.emitTo("pb-autocomplete-input",{text:e,value:s})}_filterSuggestions(){const t=T(this.suggestions);if(!t.length)return void(this._filteredSuggestions=[]);const e=(this._inputValue||"").trim().toLowerCase();if(!e)return void(this._filteredSuggestions=t);const s=this.substring?t=>t.text.toLowerCase().includes(e):t=>t.text.toLowerCase().startsWith(e);this._filteredSuggestions=t.filter(s)}_findSuggestionByValue(t){if(!t)return null;const e=T(this.suggestions),s=String(t).toLowerCase();return e.find(t=>t.value.toLowerCase()===s||t.text.toLowerCase()===s)??null}_syncInputValueFromSuggestions(){if(!this.value)return void(this._inputValue="");const t=this._findSuggestionByValue(this.value);this._inputValue=t?t.text:this.value}_scheduleFetch(t){window.clearTimeout(this._fetchTimeout),this._fetchTimeout=window.setTimeout(()=>{this._fetchTimeout=null,this._sendRequest(t)},S)}async _sendRequest(t){if(!this.source)return;const e=this.toAbsoluteURL(this.source);let s;try{s=new URL(e)}catch(t){s=new URL(e,window.location.href)}const n=Object.assign(Object.assign({},this.requestParams||{}),this._getParameters());null!=t&&(n.query=t),Object.entries(n).forEach(([t,e])=>{null!=e&&(Array.isArray(e)?e.forEach(e=>s.searchParams.append(t,e)):s.searchParams.set(t,e))}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._loading=!0,this._menuOpen=!0,this.requestUpdate();try{const t=await fetch(s.href,{method:"GET",credentials:"include",signal:this._abortController.signal,headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`Request failed with status ${t.status}`);const e=await t.json();this._applyRemoteSuggestions(e)}catch(t){"AbortError"!==t.name&&f.error("pb-autocomplete: request failed",t)}finally{var i;if(null!==(i=this._abortController)&&void 0!==i&&i.signal.aborted)return void(this._loading=!1);this._loading=!1,this._abortController=null,this.requestUpdate()}}_applyRemoteSuggestions(t){if(!Array.isArray(t))return this.suggestions=[],this._filteredSuggestions=[],this._highlightedIndex=-1,this._menuOpen=!1,void this.requestUpdate();this._initialized=!0,this.suggestions=[...t],this._filteredSuggestions=T(t),this._highlightedIndex=this._filteredSuggestions.length?0:-1,this._menuOpen=!0,this._syncInputValueFromSuggestions(),this.requestUpdate()}_getParameters(){const t={};return this.querySelectorAll("[name]").forEach(e=>{t[e.name]=e.value}),t}static get styles(){return i`
|
|
169
169
|
:host {
|
|
170
170
|
display: inline-flex;
|
|
171
171
|
flex-direction: column;
|
|
@@ -311,7 +311,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
311
311
|
background-color: transparent;
|
|
312
312
|
color: rgba(0, 0, 0, 0.54);
|
|
313
313
|
}
|
|
314
|
-
`}}customElements.get("pb-autocomplete")||customElements.define("pb-autocomplete",
|
|
314
|
+
`}}customElements.get("pb-autocomplete")||customElements.define("pb-autocomplete",A);const O="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function I(t,e,s,n){t.addEventListener?t.addEventListener(e,s,n):t.attachEvent&&t.attachEvent(`on${e}`,s)}function j(t,e,s,n){t&&(t.removeEventListener?t.removeEventListener(e,s,n):t.detachEvent&&t.detachEvent(`on${e}`,s))}function M(t,e){const s=e.slice(0,e.length-1),n=[];for(let e=0;e<s.length;e++)n.push(t[s[e].toLowerCase()]);return n}function L(t){"string"!=typeof t&&(t="");const e=(t=t.replace(/\s/g,"")).split(",");let s=e.lastIndexOf("");for(;s>=0;)e[s-1]+=",",e.splice(s,1),s=e.lastIndexOf("");return e}function P(t,e){const s=t.length>=e.length?t:e,n=t.length>=e.length?e:t;let i=!0;for(let t=0;t<s.length;t++)-1===n.indexOf(s[t])&&(i=!1);return i}function $(t){let e=t.keyCode||t.which||t.charCode;return t.code&&/^Key[A-Z]$/.test(t.code)&&(e=t.code.charCodeAt(3)),e}const N={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":O?173:189,"=":O?61:187,";":O?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},B={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,meta:91,command:91},R={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},D={16:!1,18:!1,17:!1,91:!1},U={};for(let t=1;t<20;t++)N[`f${t}`]=111+t;let F=[],V=null,z="all";const q=new Map,K=t=>N[t.toLowerCase()]||B[t.toLowerCase()]||t.toUpperCase().charCodeAt(0),X=t=>Object.keys(N).find(e=>N[e]===t),H=t=>Object.keys(B).find(e=>B[e]===t),W=t=>{z=t||"all"},Y=()=>z||"all",Z=()=>F.map(t=>X(t)||H(t)||String.fromCharCode(t)),G=()=>{const t=[];return Object.keys(U).forEach(e=>{U[e].forEach(({key:e,scope:s,mods:n,shortcut:i})=>{t.push({scope:s,shortcut:i,mods:n,keys:e.split("+").map(t=>K(t))})})}),t},J=t=>{const e=t.target||t.srcElement,{tagName:s}=e;let n=!0;const i="INPUT"===s&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(e.type);return(e.isContentEditable||(i||"TEXTAREA"===s||"SELECT"===s)&&!e.readOnly)&&(n=!1),n},Q=t=>("string"==typeof t&&(t=K(t)),-1!==F.indexOf(t)),tt=(t,e)=>{let s,n;t||(t=Y());for(const e in U)if(Object.prototype.hasOwnProperty.call(U,e))for(s=U[e],n=0;n<s.length;)s[n].scope===t?s.splice(n,1).forEach(({element:t})=>lt(t)):n++;Y()===t&&W(e||"all")};function et(t){let e=$(t);t.key&&"capslock"===t.key.toLowerCase()&&(e=K(t.key));const s=F.indexOf(e);if(s>=0&&F.splice(s,1),t.key&&"meta"===t.key.toLowerCase()&&F.splice(0,F.length),(93===e||224===e)&&(e=91),e in D){D[e]=!1;for(const t in B)B[t]===e&&(rt[t]=!1)}}const st=(t,...e)=>{if(void 0===t)Object.keys(U).forEach(t=>{Array.isArray(U[t])&&U[t].forEach(t=>nt(t)),delete U[t]}),lt(null);else if(Array.isArray(t))t.forEach(t=>{t.key&&nt(t)});else if("object"==typeof t)t.key&&nt(t);else if("string"==typeof t){let[s,n]=e;"function"==typeof s&&(n=s,s=""),nt({key:t,scope:s,method:n,splitKey:"+"})}},nt=({key:t,scope:e,method:s,splitKey:n="+"})=>{L(t).forEach(t=>{const i=t.split(n),o=i.length,r=i[o-1],a="*"===r?"*":K(r);if(!U[a])return;e||(e=Y());const l=o>1?M(B,i):[],c=[];U[a]=U[a].filter(t=>{const n=(!s||t.method===s)&&t.scope===e&&P(t.mods,l);return n&&c.push(t.element),!n}),c.forEach(t=>lt(t))})};function it(t,e,s,n){if(e.element!==n)return;let i;if(e.scope===s||"all"===e.scope){i=e.mods.length>0;for(const t in D)Object.prototype.hasOwnProperty.call(D,t)&&(!D[t]&&e.mods.indexOf(+t)>-1||D[t]&&-1===e.mods.indexOf(+t))&&(i=!1);(0===e.mods.length&&!D[16]&&!D[18]&&!D[17]&&!D[91]||i||"*"===e.shortcut)&&(e.keys=[],e.keys=e.keys.concat(F),!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0)))}}function ot(t,e){const s=U["*"];let n=$(t);if(t.key&&"capslock"===t.key.toLowerCase()||!(rt.filter||J).call(this,t))return;if((93===n||224===n)&&(n=91),-1===F.indexOf(n)&&229!==n&&F.push(n),["metaKey","ctrlKey","altKey","shiftKey"].forEach(e=>{const s=R[e];t[e]&&-1===F.indexOf(s)?F.push(s):!t[e]&&F.indexOf(s)>-1?F.splice(F.indexOf(s),1):"metaKey"===e&&t[e]&&(F=F.filter(t=>t in R||t===n))}),n in D){D[n]=!0;for(const e in B)if(Object.prototype.hasOwnProperty.call(B,e)){const s=R[B[e]];rt[e]=t[s]}if(!s)return}for(const e in D)Object.prototype.hasOwnProperty.call(D,e)&&(D[e]=t[R[e]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===F.indexOf(17)&&F.push(17),-1===F.indexOf(18)&&F.push(18),D[17]=!0,D[18]=!0);const i=Y();if(s)for(let n=0;n<s.length;n++)s[n].scope===i&&("keydown"===t.type&&s[n].keydown||"keyup"===t.type&&s[n].keyup)&&it(t,s[n],i,e);if(!(n in U))return;const o=U[n],r=o.length;for(let s=0;s<r;s++)if(("keydown"===t.type&&o[s].keydown||"keyup"===t.type&&o[s].keyup)&&o[s].key){const n=o[s],{splitKey:r}=n,a=n.key.split(r),l=[];for(let t=0;t<a.length;t++)l.push(K(a[t]));l.sort().join("")===F.sort().join("")&&it(t,n,i,e)}}const rt=function(t,e,s){F=[];const n=L(t);let i=[],o="all",r=document,a=0,l=!1,c=!0,d="+",h=!1,u=!1;if(void 0===s&&"function"==typeof e&&(s=e),"[object Object]"===Object.prototype.toString.call(e)){const t=e;t.scope&&(o=t.scope),t.element&&(r=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(c=t.keydown),void 0!==t.capture&&(h=t.capture),"string"==typeof t.splitKey&&(d=t.splitKey),!0===t.single&&(u=!0)}for("string"==typeof e&&(o=e),u&&st(t,o);a<n.length;a++){const t=n[a].split(d);i=[],t.length>1&&(i=M(B,t));let e=t[t.length-1];e="*"===e?"*":K(e),e in U||(U[e]=[]),U[e].push({keyup:l,keydown:c,scope:o,mods:i,shortcut:n[a],method:s,key:n[a],splitKey:d,element:r})}if(void 0!==r&&"undefined"!=typeof window){if(!q.has(r)){const t=(t=window.event)=>ot(t,r),e=(t=window.event)=>{ot(t,r),et(t)};q.set(r,{keydownListener:t,keyupListenr:e,capture:h}),I(r,"keydown",t,h),I(r,"keyup",e,h)}if(!V){const t=()=>{F=[]};V={listener:t,capture:h},I(window,"focus",t,h)}}};function at(t,e="all"){Object.keys(U).forEach(s=>{U[s].filter(s=>s.scope===e&&s.shortcut===t).forEach(t=>{t&&t.method&&t.method({},t)})})}function lt(t){const e=Object.values(U).flat();if(e.findIndex(({element:e})=>e===t)<0&&t){const{keydownListener:e,keyupListenr:s,capture:n}=q.get(t)||{};e&&s&&(j(t,"keyup",s,n),j(t,"keydown",e,n),q.delete(t))}if((e.length<=0||q.size<=0)&&(Array.from(q.keys()).forEach(t=>{const{keydownListener:e,keyupListenr:s,capture:n}=q.get(t)||{};e&&s&&(j(t,"keyup",s,n),j(t,"keydown",e,n),q.delete(t))}),q.clear(),Object.keys(U).forEach(t=>delete U[t]),V)){const{listener:t,capture:e}=V;j(window,"focus",t,e),V=null}}const ct={getPressedKeyString:Z,setScope:W,getScope:Y,deleteScope:tt,getPressedKeyCodes:()=>F.slice(0),getAllKeyCodes:G,isPressed:Q,filter:J,trigger:at,unbind:st,keyMap:N,modifier:B,modifierMap:R};for(const t in ct){const e=t;Object.prototype.hasOwnProperty.call(ct,e)&&(rt[e]=ct[e])}if("undefined"!=typeof window){const t=window.hotkeys;rt.noConflict=e=>(e&&window.hotkeys===rt&&(window.hotkeys=t),rt),window.hotkeys=rt}const dt=new Set(["INPUT","SELECT","TEXTAREA","PAPER-INPUT","PAPER-TEXTAREA","PB-SEARCH"]);let ht=!0;ht&&(rt.filter=t=>{const{target:e}=t;if(e.isContentEditable)return!1;const{tagName:s}=e;return!dt.has(s)},ht=!1);const ut=t=>class extends t{static get properties(){return Object.assign(Object.assign({},super.properties),{},{hotkeys:{type:Object}})}constructor(){super(),this.hotkeys={}}registerHotkey(t,e,s){t&&this.hotkeys[t]&&(s?rt(this.hotkeys[t],{element:s},e):rt(this.hotkeys[t],e))}display(t){if(t&&this.hotkeys[t]){const e=[];return this.hotkeys[t].split(/\s*,\s*/).forEach(t=>{e.push(t.replace("+","-"))}),e.join(", ")}return""}};function pt(t,e,s){s?rt(t,{element:s},e):rt(t,e)}window.pbKeyboard=pt;const gt=(t="")=>t.replace(/[-_]/g," ").trim();class ft extends s{static properties={icon:{type:String},disabled:{type:Boolean,reflect:!0},label:{type:String},toggles:{type:Boolean},active:{type:Boolean,reflect:!0}};constructor(){super(),this.icon="",this.disabled=!1,this.label="",this.toggles=!1,this.active=!1}render(){const t=this.title||"",e=this.icon?gt(this.icon.includes(":")?this.icon.split(":").pop():this.icon):"",s=this.label||t||e;return n`
|
|
315
315
|
<button
|
|
316
316
|
class="pb-button pb-button--icon"
|
|
317
317
|
type="button"
|
|
@@ -359,15 +359,15 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
359
359
|
:host([active]) button {
|
|
360
360
|
background: var(--pb-icon-button-active-background, rgba(0, 0, 0, 0.08));
|
|
361
361
|
}
|
|
362
|
-
`}customElements.get("pb-icon-button")||customElements.define("pb-icon-button",
|
|
362
|
+
`}customElements.get("pb-icon-button")||customElements.define("pb-icon-button",ft);class mt extends(c(s)){static get styles(){return i`
|
|
363
363
|
:host {
|
|
364
364
|
display: block;
|
|
365
365
|
}
|
|
366
366
|
`}static get properties(){return{title:{type:String,reflect:!0},type:{type:String},message:{type:String,reflect:!0},open:{type:Boolean,reflect:!0}}}constructor(){super(),this.title="",this.message="",this.type="message",this.open=!1}render(){return n`
|
|
367
367
|
<pb-dialog>
|
|
368
|
-
<h2 id="title" slot="title">${m(this.title)}</h2>
|
|
368
|
+
<h2 id="title" slot="title">${m(_(this.title))}</h2>
|
|
369
369
|
<div id="message" class="message" tabindex="0">
|
|
370
|
-
${this.message?m(this.message):n`<slot></slot>`}
|
|
370
|
+
${this.message?m(_(this.message)):n`<slot></slot>`}
|
|
371
371
|
</div>
|
|
372
372
|
|
|
373
373
|
<div class="buttons" slot="footer">
|
|
@@ -383,7 +383,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
383
383
|
`}
|
|
384
384
|
</div>
|
|
385
385
|
</pb-dialog>
|
|
386
|
-
`}firstUpdated(){this.modal=this.renderRoot.querySelector("pb-dialog")}show(t,e){return this.type="message",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{this.renderRoot.querySelector(".close").addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})})})})}confirm(t,e){return this.type="confirm",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{const s=this.renderRoot.querySelector(".confirm"),n=this.renderRoot.querySelector(".reject");s.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})}),n.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),e({once:!0})})})})}set(t,e){(t||e)&&(t&&(this.title=t),e&&(this.message=e))}isMessage(){return"message"===this.type}isConfirm(){return"confirm"===this.type}}customElements.define("pb-message",
|
|
386
|
+
`}firstUpdated(){this.modal=this.renderRoot.querySelector("pb-dialog")}show(t,e){return this.type="message",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{this.renderRoot.querySelector(".close").addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})})})})}confirm(t,e){return this.type="confirm",this.set(t,e),this.open=!0,this.modal.openDialog(),new Promise((t,e)=>{requestAnimationFrame(()=>{const s=this.renderRoot.querySelector(".confirm"),n=this.renderRoot.querySelector(".reject");s.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),t({once:!0})}),n.addEventListener("click",()=>{this.open=!1,this.modal.closeDialog(),e({once:!0})})})})}set(t,e){(t||e)&&(t&&(this.title=t),e&&(this.message=e))}isMessage(){return"message"===this.type}isConfirm(){return"confirm"===this.type}}customElements.define("pb-message",mt);class vt extends(c(e(s))){static get properties(){return Object.assign(Object.assign({},super.properties),{},{path:{type:String},src:{type:String},title:{type:String},_href:{type:String}})}constructor(){super(),this.title=""}connectedCallback(){super.connectedCallback(),r("pb-page-ready",t=>{if("."===t.endpoint)this._href="/exist/apps/eXide/";else{const e=/^(.*:\/+[^/]+)\/.*$/.exec(t.endpoint);this._href=e?`${e[1]}/exist/apps/eXide/`:"/exist/apps/eXide/"}})}render(){return new URL(this._href,window.location.href).origin===this.getUrl().origin?n`<a href="${this._href}" target="eXide" title="${this.title}" @click="${this.open}"
|
|
387
387
|
><slot></slot
|
|
388
388
|
></a>`:n`<a href="${this._href}/index.html?open=${this.path}" title="${this.title}"
|
|
389
389
|
><slot></slot
|
|
@@ -395,7 +395,7 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
395
395
|
a {
|
|
396
396
|
text-decoration: none;
|
|
397
397
|
}
|
|
398
|
-
`}setPath(t){this.path=t}open(t){t.preventDefault();let e=this._href,{path:s}=this;if(this.src){const t=document.getElementById(this.src);s=t.getFullPath(),e=t.sourceView}const n=window.open("","eXide");if(n&&!n.closed){n.eXide?(f.log("<pb-edit-xml> using existing eXide to open %s",s),n.eXide.app.findDocument(s),n.focus()):(f.log("<pb-edit-xml> opening new eXide for %s",s),window.eXide_onload=function(){n.eXide.app.findDocument(s)},n.location=e)}}}function mt(t){return t.replace(/-[a-z]/gu,t=>t[1].toUpperCase())}customElements.define("pb-edit-xml",ft),window.Vaadin||={},window.Vaadin.featureFlags||={};const vt={};function bt(t,e="25.0.3"){if(Object.defineProperty(t,"version",{get:()=>e}),t.experimental){const e="string"==typeof t.experimental?t.experimental:`${mt(t.is.split("-").slice(1).join("-"))}Component`;if(!window.Vaadin.featureFlags[e]&&!vt[e])return vt[e]=new Set,vt[e].add(t),void Object.defineProperty(window.Vaadin.featureFlags,e,{get:()=>0===vt[e].size,set(t){t&&vt[e].size>0&&(vt[e].forEach(t=>{customElements.define(t.is,t)}),vt[e].clear())}});if(vt[e])return void vt[e].add(t)}const s=customElements.get(t.is);if(s){const e=s.version;e&&t.version&&e===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${s.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}const yt=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,_t=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function wt(){function t(){return!0}return Et(t)}function xt(){try{return!!kt()||!!Ct()&&(_t?!St():!wt())}catch(t){return!1}}function kt(){return localStorage.getItem("vaadin.developmentmode.force")}function Ct(){return["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0}function St(){if(_t){if(Object.keys(_t).map(t=>_t[t]).filter(t=>t.productionMode).length>0)return!0}return!1}function Et(t,e){if("function"!=typeof t)return;const s=yt.exec(t.toString());if(s)try{t=new Function(s[1])}catch(t){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",t)}return t(e)}window.Vaadin=window.Vaadin||{};const Tt=function(t,e){if(window.Vaadin.developmentMode)return Et(t,e)};function At(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=xt());const Ot=function(){if("function"==typeof Tt)return Tt(At)};let It=0,jt=0;const Mt=[];let $t=!1;function Pt(){$t=!1;const t=Mt.length;for(let e=0;e<t;e++){const t=Mt[e];if(t)try{t()}catch(t){setTimeout(()=>{throw t})}}Mt.splice(0,t),jt+=t}const Lt={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Nt={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},Bt={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},Rt={run(t){$t||($t=!0,queueMicrotask(()=>Pt())),Mt.push(t);const e=It;return It+=1,e},cancel(t){const e=t-jt;if(e>=0){if(!Mt[e])throw new Error(`invalid async handle: ${t}`);Mt[e]=null}}},Dt=new Set;class Ut{static debounce(t,e,s){return t instanceof Ut?t._cancelAsync():t=new Ut,t.setConfig(e,s),t}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run(()=>{this._timer=null,Dt.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),Dt.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}}function Vt(t){Dt.add(t)}const Ft=[];function qt(t,e,s=t.getAttribute("dir")){e?t.setAttribute("dir",e):null!=s&&t.removeAttribute("dir")}function zt(){return document.documentElement.getAttribute("dir")}function Kt(){const t=zt();Ft.forEach(e=>{qt(e,t)})}new MutationObserver(Kt).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const Xt=t=>class extends t{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:t=>t||"",toAttribute:t=>""===t?null:t}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),this.hasAttribute("dir")&&!this.__restoreSubscription||(this.__subscribe(),qt(this,zt(),null))}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"dir"!==t)return;const n=zt(),i=s===n&&-1===Ft.indexOf(this),o=!s&&e&&-1===Ft.indexOf(this),r=s!==n&&e===n;i||o?(this.__subscribe(),qt(this,n,s)):r&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=Ft.includes(this),this.__unsubscribe()}_valueToNodeAttribute(t,e,s){("dir"!==s||""!==e||t.hasAttribute("dir"))&&super._valueToNodeAttribute(t,e,s)}_attributeToProperty(t,e,s){"dir"!==t||e?super._attributeToProperty(t,e,s):this.dir=""}__subscribe(){Ft.includes(this)||Ft.push(this)}__unsubscribe(){Ft.includes(this)&&Ft.splice(Ft.indexOf(this),1)}};let Ht;window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){Ot()};const Wt=new Set,Yt=t=>class extends(Xt(t)){static finalize(){super.finalize();const{is:t}=this;if(t&&!Wt.has(t)){window.Vaadin.registrations.push(this),Wt.add(t);const e=window.Vaadin.developmentModeCallback;e&&(Ht=Ut.debounce(Ht,Bt,()=>{e["vaadin-usage-statistics"]()}),Vt(Ht))}}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}},Zt=new WeakMap;function Gt(t,e){let s=e;for(;s;){if(Zt.get(s)===t)return!0;s=Object.getPrototypeOf(s)}return!1}function Jt(t){return e=>{if(Gt(t,e))return e;const s=t(e);return Zt.set(s,t),s}}function Qt(t,e){return t.split(".").reduce((t,e)=>t?t[e]:void 0,e)}function te(t,e,s){const n=t.split("."),i=n.pop();n.reduce((t,e)=>t[e],s)[i]=e}const ee={},se=/([A-Z])/gu;function ne(t){return ee[t]||(ee[t]=t.replace(se,"-$1").toLowerCase()),ee[t]}function ie(t){return t[0].toUpperCase()+t.substring(1)}function oe(t){const[e,s]=t.split("(");return{method:e,observerProps:s.replace(")","").split(",").map(t=>t.trim())}}function re(t,e){return Object.prototype.hasOwnProperty.call(t,e)||(t[e]=new Map(t[e])),t[e]}const ae=Jt(t=>{class e extends t{static enabledWarnings=[];static createProperty(t,e){[String,Boolean,Number,Array].includes(e)&&(e={type:e}),e&&e.reflectToAttribute&&(e.reflect=!0),super.createProperty(t,e)}static getOrCreateMap(t){return re(this,t)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){const t=this.getOrCreateMap("__complexObservers");this.observers.forEach(e=>{const{method:s,observerProps:n}=oe(e);t.set(s,n)})}}static addCheckedInitializer(t){super.addInitializer(e=>{e instanceof this&&t(e)})}static getPropertyDescriptor(t,e,s){const n=super.getPropertyDescriptor(t,e,s);let i=n;if(this.getOrCreateMap("__propKeys").set(t,e),s.sync&&(i={get:n.get,set(n){const i=this[t];a(n,i)&&(this[e]=n,this.requestUpdate(t,i,s),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),s.readOnly){const e=i.set;this.addCheckedInitializer(s=>{s[`_set${ie(t)}`]=function(t){e.call(s,t)}}),i={get:i.get,set(){},configurable:!0,enumerable:!0}}if("value"in s&&this.addCheckedInitializer(e=>{const n="function"==typeof s.value?s.value.call(e):s.value;s.readOnly?e[`_set${ie(t)}`](n):e[t]=n}),s.observer){const e=s.observer;this.getOrCreateMap("__observers").set(t,e),this.addCheckedInitializer(t=>{t[e]||console.warn(`observer method ${e} not defined`)})}if(s.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){const t=this.__notifyProps;this.__notifyProps=new Set(t)}}else this.__notifyProps=new Set;this.__notifyProps.add(t)}if(s.computed){const e=`__assignComputed${t}`,n=oe(s.computed);this.prototype[e]=function(...e){this[t]=this[n.method](...e)},this.getOrCreateMap("__computedObservers").set(e,n.observerProps)}return s.attribute||(s.attribute=ne(t)),i}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();const{polylitConfig:t}=this.constructor;this.hasUpdated||t.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(t=>{this.$[t.id]=t})}ready(){}willUpdate(t){this.constructor.__computedObservers&&this.__runComplexObservers(t,this.constructor.__computedObservers)}updated(t){const e=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(t,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(t,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(t,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(t,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(t,this.constructor.__notifyProps),e||this.ready()}setProperties(t){Object.entries(t).forEach(([t,e])=>{const s=this.constructor.__propKeys.get(t),n=this[s];this[s]=e,this.requestUpdate(t,n)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(t){const e=re(this,"__dynamicMethodObservers"),{method:s,observerProps:n}=oe(t);e.set(s,n)}_createPropertyObserver(t,e){re(this,"__dynamicPropertyObservers").set(e,t)}__runComplexObservers(t,e){e.forEach((e,s)=>{e.some(e=>t.has(e))&&(this[s]?this[s](...e.map(t=>this[t])):console.warn(`observer method ${s} not defined`))})}__runDynamicObservers(t,e){e.forEach((e,s)=>{t.has(e)&&this[s]&&this[s](this[e],t.get(e))})}__runObservers(t,e){t.forEach((t,s)=>{const n=e.get(s);void 0!==n&&this[n]&&this[n](this[s],t)})}__runNotifyProps(t,e){t.forEach((t,s)=>{e.has(s)&&this.dispatchEvent(new CustomEvent(`${ne(s)}-changed`,{detail:{value:this[s]}}))})}_get(t,e){return Qt(t,e)}_set(t,e,s){te(t,e,s)}}return e});function le(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}class ce{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const s=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,i)=>{const o=t.indexOf(e);-1===o?s.push(e):o!==i&&n.push(e)}),(e.length||s.length||n.length)&&this.callback({addedNodes:e,currentNodes:t,movedNodes:n,removedNodes:s}),this._storedNodes=t}}let de=0;function he(){return de++}class ue extends EventTarget{static generateId(t,e="default"){return`${e}-${t.localName}-${he()}`}constructor(t,e,s,n={}){super();const{initializer:i,multiple:o,observe:r,useUniqueId:a,uniqueIdPrefix:l}=n;this.host=t,this.slotName=e,this.tagName=s,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof o&&o,this.slotInitializer=i,o&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,l||e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:s}=this;let n=this.defaultNode;return!n&&s&&(n=document.createElement(s),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>(e.nodeType!==Node.ELEMENT_NODE||!e.hasAttribute("data-slot-ignore"))&&(e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,s=this.host.shadowRoot.querySelector(e);this.__slotObserver=new ce(s,({addedNodes:t,removedNodes:e})=>{const s=this.multiple?this.nodes:[this.node],n=t.filter(t=>!(le(t)||s.includes(t)||t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("data-slot-ignore")));e.length&&(this.nodes=s.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),n&&n.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...s,...n].filter(t=>t!==this.defaultNode),n.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=n[0],this.initAddedNode(this.node)))})}}class pe extends ue{constructor(t){super(t,"tooltip"),this.setTarget(t),this.__onContentChange=this.__onContentChange.bind(this)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.manual||this.host.setAttribute("has-tooltip",""),this.__notifyChange(t),t.addEventListener("content-changed",this.__onContentChange)}teardownNode(t){this.manual||this.host.removeAttribute("has-tooltip"),t.removeEventListener("content-changed",this.__onContentChange),this.__notifyChange(null)}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__onContentChange(t){this.__notifyChange(t.target)}__notifyChange(t){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:t}}))}}class ge extends EventTarget{#t;#e=new Set;#s;#n=!1;constructor(t){super(),this.#t=t,this.#s=new CSSStyleSheet}#i(t){const{propertyName:e}=t;this.#e.has(e)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:e}}))}observe(t){this.connect(),this.#e.has(t)||(this.#e.add(t),this.#s.replaceSync(`\n :root::before, :host::before {\n content: '' !important;\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n visibility: hidden !important;\n transition: 1ms allow-discrete step-end !important;\n transition-property: ${[...this.#e].join(", ")} !important;\n }\n `))}connect(){this.#n||(this.#t.adoptedStyleSheets.unshift(this.#s),this.#o.addEventListener("transitionstart",t=>this.#i(t)),this.#o.addEventListener("transitionend",t=>this.#i(t)),this.#n=!0)}disconnect(){this.#e.clear(),this.#t.adoptedStyleSheets=this.#t.adoptedStyleSheets.filter(t=>t!==this.#s),this.#o.removeEventListener("transitionstart",this.#i),this.#o.removeEventListener("transitionend",this.#i),this.#n=!1}get#o(){return this.#t.documentElement??this.#t.host}static for(t){return t.__cssPropertyObserver||=new ge(t),t.__cssPropertyObserver}}function fe(t){const{baseStyles:e,themeStyles:s,elementStyles:n,lumoInjector:i}=t.constructor,o=t.__lumoStyleSheet;return o&&(e||s)?[...i.includeBaseStyles?e:[],o,...s]:[o,...n].filter(Boolean)}function me(t){l(t.shadowRoot,fe(t))}function ve(t,e){t.__lumoStyleSheet=e,me(t)}function be(t){t.__lumoStyleSheet=void 0,me(t)}const ye=new Set;function _e(t){ye.has(t)||(ye.add(t),console.warn(t))}const we=new WeakMap;function xe(t){try{return t.media.mediaText}catch{return _e('[LumoInjector] Browser denied to access property "mediaText" for some CSS rules, so they were skipped.'),""}}function ke(t){try{return t.cssRules}catch{return _e('[LumoInjector] Browser denied to access property "cssRules" for some CSS stylesheets, so they were skipped.'),[]}}function Ce(t,e={tags:new Map,modules:new Map}){for(const n of ke(t)){if(n instanceof CSSImportRule){const t=xe(n);t.startsWith("lumo_")?e.modules.set(t,[...n.styleSheet.cssRules]):Ce(n.styleSheet,e);continue}if(n instanceof CSSMediaRule){const t=xe(n);t.startsWith("lumo_")&&e.modules.set(t,[...n.cssRules]);continue}if(n instanceof CSSStyleRule&&n.cssText.includes("-inject"))for(const t of n.style){var s;const i=null===(s=t.match(/^--_lumo-(.*)-inject-modules$/u))||void 0===s?void 0:s[1];if(!i)continue;const o=n.style.getPropertyValue(t);e.tags.set(i,o.split(",").map(t=>t.trim().replace(/'|"/gu,"")))}else;}return e}function Se(t){let e=new Map,s=new Map;for(const n of t){let t=we.get(n);t||(t=Ce(n),we.set(n,t)),e=new Map([...e,...t.tags]),s=new Map([...s,...t.modules])}return{tags:e,modules:s}}function Ee(t){return`--_lumo-${t.is}-inject`}class Te{#t;#r;#a=new Map;#l=new Map;constructor(t=document){this.#t=t,this.handlePropertyChange=this.handlePropertyChange.bind(this),this.#r=ge.for(t),this.#r.addEventListener("property-changed",this.handlePropertyChange)}disconnect(){this.#r.removeEventListener("property-changed",this.handlePropertyChange),this.#a.clear(),this.#l.values().forEach(t=>t.forEach(be))}forceUpdate(){for(const t of this.#a.keys())this.#c(t)}componentConnected(t){const{lumoInjector:e}=t.constructor,{is:s}=e;this.#l.set(s,this.#l.get(s)??new Set),this.#l.get(s).add(t);const n=this.#a.get(s);if(n)return void(n.cssRules.length>0&&ve(t,n));this.#d(s);const i=Ee(e);this.#r.observe(i)}componentDisconnected(t){var e;const{is:s}=t.constructor.lumoInjector;null===(e=this.#l.get(s))||void 0===e||e.delete(t),be(t)}handlePropertyChange(t){var e;const{propertyName:s}=t.detail,n=null===(e=s.match(/^--_lumo-(.*)-inject$/u))||void 0===e?void 0:e[1];n&&this.#c(n)}#d(t){this.#a.set(t,new CSSStyleSheet),this.#c(t)}#c(t){var e;const{tags:s,modules:n}=Se(this.#h),i=(s.get(t)??[]).flatMap(t=>n.get(t)??[]).map(t=>t.cssText).join("\n"),o=this.#a.get(t);o.replaceSync(i),null===(e=this.#l.get(t))||void 0===e||e.forEach(t=>{i?ve(t,o):be(t)})}get#h(){let t=new Set;for(const e of[this.#t,document])t=t.union(new Set(e.styleSheets)),t=t.union(new Set(e.adoptedStyleSheets));return[...t]}}const Ae=new Set;function Oe(t){const e=t.getRootNode();return e.host&&e.host.constructor.version?Oe(e.host):e}const Ie=t=>class extends t{static finalize(){super.finalize();const t=Ee(this.lumoInjector);this.is&&!Ae.has(t)&&(Ae.add(t),CSS.registerProperty({name:t,syntax:"<number>",inherits:!0,initialValue:"0"}))}static get lumoInjector(){return{is:this.is,includeBaseStyles:!1}}connectedCallback(){super.connectedCallback();const t=Oe(this);t.__lumoInjectorDisabled||this.isConnected&&(t.__lumoInjector||=new Te(t),this.__lumoInjector=t.__lumoInjector,this.__lumoInjector.componentConnected(this))}disconnectedCallback(){super.disconnectedCallback(),this.__lumoInjector&&(this.__lumoInjector.componentDisconnected(this),this.__lumoInjector=void 0)}},je=t=>class extends t{static get properties(){return{_theme:{type:String,readOnly:!0}}}static get observedAttributes(){return[...super.observedAttributes,"theme"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),"theme"===t&&this._set_theme(s)}},Me=[],$e=new Set,Pe=new Set;function Le(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function Ne(t,e){return(t||"").split(" ").some(t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e))}function Be(t){return t.map(t=>t.cssText).join("\n")}const Re="vaadin-themable-mixin-style";function De(t,e){const s=document.createElement("style");s.id=Re,s.textContent=Be(t),e.content.appendChild(s)}function Ue(t=""){let e=0;return t.startsWith("lumo-")||t.startsWith("material-")?e=1:t.startsWith("vaadin-")&&(e=2),e}function Ve(t){const e=[];return t.include&&[].concat(t.include).forEach(t=>{const s=Me.find(e=>e.moduleId===t);s?e.push(...Ve(s),...s.styles):console.warn(`Included moduleId ${t} not found in style registry`)},t.styles),e}function Fe(t){const e=`${t}-default-theme`,s=Me.filter(s=>s.moduleId!==e&&Ne(s.themeFor,t)).map(t=>Object.assign(Object.assign({},t),{},{styles:[...Ve(t),...t.styles],includePriority:Ue(t.moduleId)})).sort((t,e)=>e.includePriority-t.includePriority);return s.length>0?s:Me.filter(t=>t.moduleId===e)}const qe=t=>class extends(je(t)){constructor(){super(),$e.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&Pe.add(this.is),this.elementStyles)return;const t=this.prototype._template;t&&!Le(this)&&De(this.getStylesForThis(),t)}static finalizeStyles(t){return this.baseStyles=t?[t].flat(1/0):[],this.themeStyles=this.getStylesForThis(),[...this.baseStyles,...this.themeStyles]}static getStylesForThis(){const e=t.__themes||[],s=Object.getPrototypeOf(this.prototype),n=(s?s.constructor.__themes:[])||[];this.__themes=[...e,...n,...Fe(this.is)];const i=this.__themes.flatMap(t=>t.styles);return i.filter((t,e)=>e===i.lastIndexOf(t))}},ze=(t,...e)=>{const s=document.createElement("style");s.id=t,s.textContent=e.map(t=>t.toString()).join("\n"),document.head.insertAdjacentElement("afterbegin",s)};["--vaadin-text-color","--vaadin-text-color-disabled","--vaadin-text-color-secondary","--vaadin-border-color","--vaadin-border-color-secondary","--vaadin-background-color"].forEach(t=>{CSS.registerProperty({name:t,syntax:"<color>",inherits:!0,initialValue:"light-dark(black, white)"})}),ze("vaadin-base",i`
|
|
398
|
+
`}setPath(t){this.path=t}open(t){t.preventDefault();let e=this._href,{path:s}=this;if(this.src){const t=document.getElementById(this.src);s=t.getFullPath(),e=t.sourceView}const n=window.open("","eXide");if(n&&!n.closed){n.eXide?(f.log("<pb-edit-xml> using existing eXide to open %s",s),n.eXide.app.findDocument(s),n.focus()):(f.log("<pb-edit-xml> opening new eXide for %s",s),window.eXide_onload=function(){n.eXide.app.findDocument(s)},n.location=e)}}}function bt(t){return t.replace(/-[a-z]/gu,t=>t[1].toUpperCase())}customElements.define("pb-edit-xml",vt),window.Vaadin||={},window.Vaadin.featureFlags||={};const yt={};function _t(t,e="25.0.3"){if(Object.defineProperty(t,"version",{get:()=>e}),t.experimental){const e="string"==typeof t.experimental?t.experimental:`${bt(t.is.split("-").slice(1).join("-"))}Component`;if(!window.Vaadin.featureFlags[e]&&!yt[e])return yt[e]=new Set,yt[e].add(t),void Object.defineProperty(window.Vaadin.featureFlags,e,{get:()=>0===yt[e].size,set(t){t&&yt[e].size>0&&(yt[e].forEach(t=>{customElements.define(t.is,t)}),yt[e].clear())}});if(yt[e])return void yt[e].add(t)}const s=customElements.get(t.is);if(s){const e=s.version;e&&t.version&&e===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${s.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}const wt=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,xt=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function kt(){function t(){return!0}return At(t)}function Ct(){try{return!!St()||!!Et()&&(xt?!Tt():!kt())}catch(t){return!1}}function St(){return localStorage.getItem("vaadin.developmentmode.force")}function Et(){return["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0}function Tt(){if(xt){if(Object.keys(xt).map(t=>xt[t]).filter(t=>t.productionMode).length>0)return!0}return!1}function At(t,e){if("function"!=typeof t)return;const s=wt.exec(t.toString());if(s)try{t=new Function(s[1])}catch(t){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",t)}return t(e)}window.Vaadin=window.Vaadin||{};const Ot=function(t,e){if(window.Vaadin.developmentMode)return At(t,e)};function It(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=Ct());const jt=function(){if("function"==typeof Ot)return Ot(It)};let Mt=0,Lt=0;const Pt=[];let $t=!1;function Nt(){$t=!1;const t=Pt.length;for(let e=0;e<t;e++){const t=Pt[e];if(t)try{t()}catch(t){setTimeout(()=>{throw t})}}Pt.splice(0,t),Lt+=t}const Bt={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Rt={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},Dt={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},Ut={run(t){$t||($t=!0,queueMicrotask(()=>Nt())),Pt.push(t);const e=Mt;return Mt+=1,e},cancel(t){const e=t-Lt;if(e>=0){if(!Pt[e])throw new Error(`invalid async handle: ${t}`);Pt[e]=null}}},Ft=new Set;class Vt{static debounce(t,e,s){return t instanceof Vt?t._cancelAsync():t=new Vt,t.setConfig(e,s),t}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run(()=>{this._timer=null,Ft.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),Ft.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}}function zt(t){Ft.add(t)}const qt=[];function Kt(t,e,s=t.getAttribute("dir")){e?t.setAttribute("dir",e):null!=s&&t.removeAttribute("dir")}function Xt(){return document.documentElement.getAttribute("dir")}function Ht(){const t=Xt();qt.forEach(e=>{Kt(e,t)})}new MutationObserver(Ht).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const Wt=t=>class extends t{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:t=>t||"",toAttribute:t=>""===t?null:t}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),this.hasAttribute("dir")&&!this.__restoreSubscription||(this.__subscribe(),Kt(this,Xt(),null))}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"dir"!==t)return;const n=Xt(),i=s===n&&-1===qt.indexOf(this),o=!s&&e&&-1===qt.indexOf(this),r=s!==n&&e===n;i||o?(this.__subscribe(),Kt(this,n,s)):r&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=qt.includes(this),this.__unsubscribe()}_valueToNodeAttribute(t,e,s){("dir"!==s||""!==e||t.hasAttribute("dir"))&&super._valueToNodeAttribute(t,e,s)}_attributeToProperty(t,e,s){"dir"!==t||e?super._attributeToProperty(t,e,s):this.dir=""}__subscribe(){qt.includes(this)||qt.push(this)}__unsubscribe(){qt.includes(this)&&qt.splice(qt.indexOf(this),1)}};let Yt;window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){jt()};const Zt=new Set,Gt=t=>class extends(Wt(t)){static finalize(){super.finalize();const{is:t}=this;if(t&&!Zt.has(t)){window.Vaadin.registrations.push(this),Zt.add(t);const e=window.Vaadin.developmentModeCallback;e&&(Yt=Vt.debounce(Yt,Dt,()=>{e["vaadin-usage-statistics"]()}),zt(Yt))}}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}},Jt=new WeakMap;function Qt(t,e){let s=e;for(;s;){if(Jt.get(s)===t)return!0;s=Object.getPrototypeOf(s)}return!1}function te(t){return e=>{if(Qt(t,e))return e;const s=t(e);return Jt.set(s,t),s}}function ee(t,e){return t.split(".").reduce((t,e)=>t?t[e]:void 0,e)}function se(t,e,s){const n=t.split("."),i=n.pop();n.reduce((t,e)=>t[e],s)[i]=e}const ne={},ie=/([A-Z])/gu;function oe(t){return ne[t]||(ne[t]=t.replace(ie,"-$1").toLowerCase()),ne[t]}function re(t){return t[0].toUpperCase()+t.substring(1)}function ae(t){const[e,s]=t.split("(");return{method:e,observerProps:s.replace(")","").split(",").map(t=>t.trim())}}function le(t,e){return Object.prototype.hasOwnProperty.call(t,e)||(t[e]=new Map(t[e])),t[e]}const ce=te(t=>{class e extends t{static enabledWarnings=[];static createProperty(t,e){[String,Boolean,Number,Array].includes(e)&&(e={type:e}),e&&e.reflectToAttribute&&(e.reflect=!0),super.createProperty(t,e)}static getOrCreateMap(t){return le(this,t)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){const t=this.getOrCreateMap("__complexObservers");this.observers.forEach(e=>{const{method:s,observerProps:n}=ae(e);t.set(s,n)})}}static addCheckedInitializer(t){super.addInitializer(e=>{e instanceof this&&t(e)})}static getPropertyDescriptor(t,e,s){const n=super.getPropertyDescriptor(t,e,s);let i=n;if(this.getOrCreateMap("__propKeys").set(t,e),s.sync&&(i={get:n.get,set(n){const i=this[t];a(n,i)&&(this[e]=n,this.requestUpdate(t,i,s),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),s.readOnly){const e=i.set;this.addCheckedInitializer(s=>{s[`_set${re(t)}`]=function(t){e.call(s,t)}}),i={get:i.get,set(){},configurable:!0,enumerable:!0}}if("value"in s&&this.addCheckedInitializer(e=>{const n="function"==typeof s.value?s.value.call(e):s.value;s.readOnly?e[`_set${re(t)}`](n):e[t]=n}),s.observer){const e=s.observer;this.getOrCreateMap("__observers").set(t,e),this.addCheckedInitializer(t=>{t[e]||console.warn(`observer method ${e} not defined`)})}if(s.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){const t=this.__notifyProps;this.__notifyProps=new Set(t)}}else this.__notifyProps=new Set;this.__notifyProps.add(t)}if(s.computed){const e=`__assignComputed${t}`,n=ae(s.computed);this.prototype[e]=function(...e){this[t]=this[n.method](...e)},this.getOrCreateMap("__computedObservers").set(e,n.observerProps)}return s.attribute||(s.attribute=oe(t)),i}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();const{polylitConfig:t}=this.constructor;this.hasUpdated||t.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(t=>{this.$[t.id]=t})}ready(){}willUpdate(t){this.constructor.__computedObservers&&this.__runComplexObservers(t,this.constructor.__computedObservers)}updated(t){const e=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(t,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(t,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(t,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(t,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(t,this.constructor.__notifyProps),e||this.ready()}setProperties(t){Object.entries(t).forEach(([t,e])=>{const s=this.constructor.__propKeys.get(t),n=this[s];this[s]=e,this.requestUpdate(t,n)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(t){const e=le(this,"__dynamicMethodObservers"),{method:s,observerProps:n}=ae(t);e.set(s,n)}_createPropertyObserver(t,e){le(this,"__dynamicPropertyObservers").set(e,t)}__runComplexObservers(t,e){e.forEach((e,s)=>{e.some(e=>t.has(e))&&(this[s]?this[s](...e.map(t=>this[t])):console.warn(`observer method ${s} not defined`))})}__runDynamicObservers(t,e){e.forEach((e,s)=>{t.has(e)&&this[s]&&this[s](this[e],t.get(e))})}__runObservers(t,e){t.forEach((t,s)=>{const n=e.get(s);void 0!==n&&this[n]&&this[n](this[s],t)})}__runNotifyProps(t,e){t.forEach((t,s)=>{e.has(s)&&this.dispatchEvent(new CustomEvent(`${oe(s)}-changed`,{detail:{value:this[s]}}))})}_get(t,e){return ee(t,e)}_set(t,e,s){se(t,e,s)}}return e});function de(t){return t.nodeType===Node.TEXT_NODE&&""===t.textContent.trim()}class he{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const s=[],n=[];t.length&&(e=t.filter(t=>!this._storedNodes.includes(t))),this._storedNodes.length&&this._storedNodes.forEach((e,i)=>{const o=t.indexOf(e);-1===o?s.push(e):o!==i&&n.push(e)}),(e.length||s.length||n.length)&&this.callback({addedNodes:e,currentNodes:t,movedNodes:n,removedNodes:s}),this._storedNodes=t}}let ue=0;function pe(){return ue++}class ge extends EventTarget{static generateId(t,e="default"){return`${e}-${t.localName}-${pe()}`}constructor(t,e,s,n={}){super();const{initializer:i,multiple:o,observe:r,useUniqueId:a,uniqueIdPrefix:l}=n;this.host=t,this.slotName=e,this.tagName=s,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof o&&o,this.slotInitializer=i,o&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,l||e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach(t=>{this.initAddedNode(t)})}attachDefaultNode(){const{host:t,slotName:e,tagName:s}=this;let n=this.defaultNode;return!n&&s&&(n=document.createElement(s),n instanceof Element&&(""!==e&&n.setAttribute("slot",e),this.defaultNode=n)),n&&(this.node=n,t.appendChild(n)),n}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter(e=>(e.nodeType!==Node.ELEMENT_NODE||!e.hasAttribute("data-slot-ignore"))&&(e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=""===t?"slot:not([name])":`slot[name=${t}]`,s=this.host.shadowRoot.querySelector(e);this.__slotObserver=new he(s,({addedNodes:t,removedNodes:e})=>{const s=this.multiple?this.nodes:[this.node],n=t.filter(t=>!(de(t)||s.includes(t)||t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("data-slot-ignore")));e.length&&(this.nodes=s.filter(t=>!e.includes(t)),e.forEach(t=>{this.teardownNode(t)})),n&&n.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...s,...n].filter(t=>t!==this.defaultNode),n.forEach(t=>{this.initAddedNode(t)})):(this.node&&this.node.remove(),this.node=n[0],this.initAddedNode(this.node)))})}}class fe extends ge{constructor(t){super(t,"tooltip"),this.setTarget(t),this.__onContentChange=this.__onContentChange.bind(this)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.manual||this.host.setAttribute("has-tooltip",""),this.__notifyChange(t),t.addEventListener("content-changed",this.__onContentChange)}teardownNode(t){this.manual||this.host.removeAttribute("has-tooltip"),t.removeEventListener("content-changed",this.__onContentChange),this.__notifyChange(null)}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__onContentChange(t){this.__notifyChange(t.target)}__notifyChange(t){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:t}}))}}class me extends EventTarget{#t;#e=new Set;#s;#n=!1;constructor(t){super(),this.#t=t,this.#s=new CSSStyleSheet}#i(t){const{propertyName:e}=t;this.#e.has(e)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:e}}))}observe(t){this.connect(),this.#e.has(t)||(this.#e.add(t),this.#s.replaceSync(`\n :root::before, :host::before {\n content: '' !important;\n position: absolute !important;\n top: -9999px !important;\n left: -9999px !important;\n visibility: hidden !important;\n transition: 1ms allow-discrete step-end !important;\n transition-property: ${[...this.#e].join(", ")} !important;\n }\n `))}connect(){this.#n||(this.#t.adoptedStyleSheets.unshift(this.#s),this.#o.addEventListener("transitionstart",t=>this.#i(t)),this.#o.addEventListener("transitionend",t=>this.#i(t)),this.#n=!0)}disconnect(){this.#e.clear(),this.#t.adoptedStyleSheets=this.#t.adoptedStyleSheets.filter(t=>t!==this.#s),this.#o.removeEventListener("transitionstart",this.#i),this.#o.removeEventListener("transitionend",this.#i),this.#n=!1}get#o(){return this.#t.documentElement??this.#t.host}static for(t){return t.__cssPropertyObserver||=new me(t),t.__cssPropertyObserver}}function ve(t){const{baseStyles:e,themeStyles:s,elementStyles:n,lumoInjector:i}=t.constructor,o=t.__lumoStyleSheet;return o&&(e||s)?[...i.includeBaseStyles?e:[],o,...s]:[o,...n].filter(Boolean)}function be(t){l(t.shadowRoot,ve(t))}function ye(t,e){t.__lumoStyleSheet=e,be(t)}function _e(t){t.__lumoStyleSheet=void 0,be(t)}const we=new Set;function xe(t){we.has(t)||(we.add(t),console.warn(t))}const ke=new WeakMap;function Ce(t){try{return t.media.mediaText}catch{return xe('[LumoInjector] Browser denied to access property "mediaText" for some CSS rules, so they were skipped.'),""}}function Se(t){try{return t.cssRules}catch{return xe('[LumoInjector] Browser denied to access property "cssRules" for some CSS stylesheets, so they were skipped.'),[]}}function Ee(t,e={tags:new Map,modules:new Map}){for(const n of Se(t)){if(n instanceof CSSImportRule){const t=Ce(n);t.startsWith("lumo_")?e.modules.set(t,[...n.styleSheet.cssRules]):Ee(n.styleSheet,e);continue}if(n instanceof CSSMediaRule){const t=Ce(n);t.startsWith("lumo_")&&e.modules.set(t,[...n.cssRules]);continue}if(n instanceof CSSStyleRule&&n.cssText.includes("-inject"))for(const t of n.style){var s;const i=null===(s=t.match(/^--_lumo-(.*)-inject-modules$/u))||void 0===s?void 0:s[1];if(!i)continue;const o=n.style.getPropertyValue(t);e.tags.set(i,o.split(",").map(t=>t.trim().replace(/'|"/gu,"")))}else;}return e}function Te(t){let e=new Map,s=new Map;for(const n of t){let t=ke.get(n);t||(t=Ee(n),ke.set(n,t)),e=new Map([...e,...t.tags]),s=new Map([...s,...t.modules])}return{tags:e,modules:s}}function Ae(t){return`--_lumo-${t.is}-inject`}class Oe{#t;#r;#a=new Map;#l=new Map;constructor(t=document){this.#t=t,this.handlePropertyChange=this.handlePropertyChange.bind(this),this.#r=me.for(t),this.#r.addEventListener("property-changed",this.handlePropertyChange)}disconnect(){this.#r.removeEventListener("property-changed",this.handlePropertyChange),this.#a.clear(),this.#l.values().forEach(t=>t.forEach(_e))}forceUpdate(){for(const t of this.#a.keys())this.#c(t)}componentConnected(t){const{lumoInjector:e}=t.constructor,{is:s}=e;this.#l.set(s,this.#l.get(s)??new Set),this.#l.get(s).add(t);const n=this.#a.get(s);if(n)return void(n.cssRules.length>0&&ye(t,n));this.#d(s);const i=Ae(e);this.#r.observe(i)}componentDisconnected(t){var e;const{is:s}=t.constructor.lumoInjector;null===(e=this.#l.get(s))||void 0===e||e.delete(t),_e(t)}handlePropertyChange(t){var e;const{propertyName:s}=t.detail,n=null===(e=s.match(/^--_lumo-(.*)-inject$/u))||void 0===e?void 0:e[1];n&&this.#c(n)}#d(t){this.#a.set(t,new CSSStyleSheet),this.#c(t)}#c(t){var e;const{tags:s,modules:n}=Te(this.#h),i=(s.get(t)??[]).flatMap(t=>n.get(t)??[]).map(t=>t.cssText).join("\n"),o=this.#a.get(t);o.replaceSync(i),null===(e=this.#l.get(t))||void 0===e||e.forEach(t=>{i?ye(t,o):_e(t)})}get#h(){let t=new Set;for(const e of[this.#t,document])t=t.union(new Set(e.styleSheets)),t=t.union(new Set(e.adoptedStyleSheets));return[...t]}}const Ie=new Set;function je(t){const e=t.getRootNode();return e.host&&e.host.constructor.version?je(e.host):e}const Me=t=>class extends t{static finalize(){super.finalize();const t=Ae(this.lumoInjector);this.is&&!Ie.has(t)&&(Ie.add(t),CSS.registerProperty({name:t,syntax:"<number>",inherits:!0,initialValue:"0"}))}static get lumoInjector(){return{is:this.is,includeBaseStyles:!1}}connectedCallback(){super.connectedCallback();const t=je(this);t.__lumoInjectorDisabled||this.isConnected&&(t.__lumoInjector||=new Oe(t),this.__lumoInjector=t.__lumoInjector,this.__lumoInjector.componentConnected(this))}disconnectedCallback(){super.disconnectedCallback(),this.__lumoInjector&&(this.__lumoInjector.componentDisconnected(this),this.__lumoInjector=void 0)}},Le=t=>class extends t{static get properties(){return{_theme:{type:String,readOnly:!0}}}static get observedAttributes(){return[...super.observedAttributes,"theme"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),"theme"===t&&this._set_theme(s)}},Pe=[],$e=new Set,Ne=new Set;function Be(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function Re(t,e){return(t||"").split(" ").some(t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e))}function De(t){return t.map(t=>t.cssText).join("\n")}const Ue="vaadin-themable-mixin-style";function Fe(t,e){const s=document.createElement("style");s.id=Ue,s.textContent=De(t),e.content.appendChild(s)}function Ve(t=""){let e=0;return t.startsWith("lumo-")||t.startsWith("material-")?e=1:t.startsWith("vaadin-")&&(e=2),e}function ze(t){const e=[];return t.include&&[].concat(t.include).forEach(t=>{const s=Pe.find(e=>e.moduleId===t);s?e.push(...ze(s),...s.styles):console.warn(`Included moduleId ${t} not found in style registry`)},t.styles),e}function qe(t){const e=`${t}-default-theme`,s=Pe.filter(s=>s.moduleId!==e&&Re(s.themeFor,t)).map(t=>Object.assign(Object.assign({},t),{},{styles:[...ze(t),...t.styles],includePriority:Ve(t.moduleId)})).sort((t,e)=>e.includePriority-t.includePriority);return s.length>0?s:Pe.filter(t=>t.moduleId===e)}const Ke=t=>class extends(Le(t)){constructor(){super(),$e.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&Ne.add(this.is),this.elementStyles)return;const t=this.prototype._template;t&&!Be(this)&&Fe(this.getStylesForThis(),t)}static finalizeStyles(t){return this.baseStyles=t?[t].flat(1/0):[],this.themeStyles=this.getStylesForThis(),[...this.baseStyles,...this.themeStyles]}static getStylesForThis(){const e=t.__themes||[],s=Object.getPrototypeOf(this.prototype),n=(s?s.constructor.__themes:[])||[];this.__themes=[...e,...n,...qe(this.is)];const i=this.__themes.flatMap(t=>t.styles);return i.filter((t,e)=>e===i.lastIndexOf(t))}},Xe=(t,...e)=>{const s=document.createElement("style");s.id=t,s.textContent=e.map(t=>t.toString()).join("\n"),document.head.insertAdjacentElement("afterbegin",s)};["--vaadin-text-color","--vaadin-text-color-disabled","--vaadin-text-color-secondary","--vaadin-border-color","--vaadin-border-color-secondary","--vaadin-background-color"].forEach(t=>{CSS.registerProperty({name:t,syntax:"<color>",inherits:!0,initialValue:"light-dark(black, white)"})}),Xe("vaadin-base",i`
|
|
399
399
|
@layer vaadin.base {
|
|
400
400
|
html {
|
|
401
401
|
/* Background color */
|
|
@@ -504,4 +504,4 @@ import{E as t,p as e,a as s,x as n,i,T as o,w as r,f as a,S as l}from"./pb-mixin
|
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
`);const
|
|
507
|
+
`);const He=t=>t,We="string"==typeof document.head.style.touchAction,Ye="__polymerGestures",Ze="__polymerGesturesHandled",Ge="__polymerGesturesTouchAction",Je=25,Qe=5,ts=2,es=["mousedown","mousemove","mouseup","click"],ss=[0,1,4,2],ns=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(t){return!1}}();function is(t){return es.indexOf(t)>-1}let os=!1;function rs(t){is(t)}!function(){try{const t=Object.defineProperty({},"passive",{get(){os=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}}();const as=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u),ls={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function cs(t){const e=t.type;if(!is(e))return!1;if("mousemove"===e){let e=void 0===t.buttons?1:t.buttons;return t instanceof window.MouseEvent&&!ns&&(e=ss[t.which]||0),Boolean(1&e)}return 0===(void 0===t.button?0:t.button)}function ds(t){if("click"===t.type){if(0===t.detail)return!0;const e=ys(t);if(!e.nodeType||e.nodeType!==Node.ELEMENT_NODE)return!0;const s=e.getBoundingClientRect(),n=t.pageX,i=t.pageY;return!(n>=s.left&&n<=s.right&&i>=s.top&&i<=s.bottom)}return!1}const hs={touch:{x:0,y:0,id:-1,scrollDecided:!1}};function us(t){let e="auto";const s=fs(t);for(let t,n=0;n<s.length;n++)if(t=s[n],t[Ge]){e=t[Ge];break}return e}function ps(t,e,s){t.movefn=e,t.upfn=s,document.addEventListener("mousemove",e),document.addEventListener("mouseup",s)}function gs(t){document.removeEventListener("mousemove",t.movefn),document.removeEventListener("mouseup",t.upfn),t.movefn=null,t.upfn=null}const fs=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:t=>t.composedPath&&t.composedPath()||[],ms={},vs=[];function bs(t,e){let s=document.elementFromPoint(t,e),n=s;for(;n&&n.shadowRoot&&!window.ShadyDOM;){const i=n;if(n=n.shadowRoot.elementFromPoint(t,e),i===n)break;n&&(s=n)}return s}function ys(t){const e=fs(t);return e.length>0?e[0]:t.target}function _s(t){const e=t.type,s=t.currentTarget[Ye];if(!s)return;const n=s[e];if(!n)return;if(!t[Ze]&&(t[Ze]={},e.startsWith("touch"))){const s=t.changedTouches[0];if("touchstart"===e&&1===t.touches.length&&(hs.touch.id=s.identifier),hs.touch.id!==s.identifier)return;We||"touchstart"!==e&&"touchmove"!==e||ws(t)}const i=t[Ze];if(!i.skip){for(let e,s=0;s<vs.length;s++)e=vs[s],n[e.name]&&!i[e.name]&&e.flow&&e.flow.start.indexOf(t.type)>-1&&e.reset&&e.reset();for(let s,o=0;o<vs.length;o++)s=vs[o],n[s.name]&&!i[s.name]&&(i[s.name]=!0,s[e](t))}}function ws(t){const e=t.changedTouches[0],s=t.type;if("touchstart"===s)hs.touch.x=e.clientX,hs.touch.y=e.clientY,hs.touch.scrollDecided=!1;else if("touchmove"===s){if(hs.touch.scrollDecided)return;hs.touch.scrollDecided=!0;const s=us(t);let n=!1;const i=Math.abs(hs.touch.x-e.clientX),o=Math.abs(hs.touch.y-e.clientY);t.cancelable&&("none"===s?n=!0:"pan-x"===s?n=o>i:"pan-y"===s&&(n=i>o)),n?t.preventDefault():As("track")}}function xs(t,e,s){return!!ms[e]&&(ks(t,e,s),!0)}function ks(t,e,s){const n=ms[e],i=n.deps,o=n.name;let r=t[Ye];r||(t[Ye]=r={});for(let e,s,n=0;n<i.length;n++)e=i[n],as&&is(e)&&"click"!==e||(s=r[e],s||(r[e]=s={_count:0}),0===s._count&&t.addEventListener(e,_s,rs(e)),s[o]=(s[o]||0)+1,s._count=(s._count||0)+1);t.addEventListener(e,s),n.touchAction&&Es(t,n.touchAction)}function Cs(t){vs.push(t),t.emits.forEach(e=>{ms[e]=t})}function Ss(t){for(let e,s=0;s<vs.length;s++){e=vs[s];for(let s,n=0;n<e.emits.length;n++)if(s=e.emits[n],s===t)return e}return null}function Es(t,e){We&&t instanceof HTMLElement&&Ut.run(()=>{t.style.touchAction=e}),t[Ge]=e}function Ts(t,e,s){const n=new Event(e,{bubbles:!0,cancelable:!0,composed:!0});if(n.detail=s,He(t).dispatchEvent(n),n.defaultPrevented){const t=s.preventer||s.sourceEvent;t&&t.preventDefault&&t.preventDefault()}}function As(t){const e=Ss(t);e.info&&(e.info.prevent=!0)}function Os(t,e,s,n){e&&Ts(e,t,{x:s.clientX,y:s.clientY,sourceEvent:s,preventer:n,prevent:t=>As(t)})}function Is(t,e,s){if(t.prevent)return!1;if(t.started)return!0;const n=Math.abs(t.x-e),i=Math.abs(t.y-s);return n>=Qe||i>=Qe}function js(t,e,s){if(!e)return;const n=t.moves[t.moves.length-2],i=t.moves[t.moves.length-1],o=i.x-t.x,r=i.y-t.y;let a,l=0;n&&(a=i.x-n.x,l=i.y-n.y),Ts(e,"track",{state:t.state,x:s.clientX,y:s.clientY,dx:o,dy:r,ddx:a,ddy:l,sourceEvent:s,hover:()=>bs(s.clientX,s.clientY)})}function Ms(t,e,s){const n=Math.abs(e.clientX-t.x),i=Math.abs(e.clientY-t.y),o=ys(s||e);!o||ls[o.localName]&&o.hasAttribute("disabled")||(isNaN(n)||isNaN(i)||n<=Je&&i<=Je||ds(e))&&(t.prevent||Ts(o,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:s}))}Cs({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset(){gs(this.info)},mousedown(t){if(!cs(t))return;const e=ys(t),s=this,n=t=>{cs(t)||(Os("up",e,t),gs(s.info))},i=t=>{cs(t)&&Os("up",e,t),gs(s.info)};ps(this.info,n,i),Os("down",e,t)},touchstart(t){Os("down",ys(t),t.changedTouches[0],t)},touchend(t){Os("up",ys(t),t.changedTouches[0],t)}}),Cs({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove(t){this.moves.length>ts&&this.moves.shift(),this.moves.push(t)},movefn:null,upfn:null,prevent:!1},reset(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,gs(this.info)},mousedown(t){if(!cs(t))return;const e=ys(t),s=this,n=t=>{const n=t.clientX,i=t.clientY;Is(s.info,n,i)&&(s.info.state=s.info.started?"mouseup"===t.type?"end":"track":"start","start"===s.info.state&&As("tap"),s.info.addMove({x:n,y:i}),cs(t)||(s.info.state="end",gs(s.info)),e&&js(s.info,e,t),s.info.started=!0)},i=t=>{s.info.started&&n(t),gs(s.info)};ps(this.info,n,i),this.info.x=t.clientX,this.info.y=t.clientY},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchmove(t){const e=ys(t),s=t.changedTouches[0],n=s.clientX,i=s.clientY;Is(this.info,n,i)&&("start"===this.info.state&&As("tap"),this.info.addMove({x:n,y:i}),js(this.info,e,s),this.info.state="track",this.info.started=!0)},touchend(t){const e=ys(t),s=t.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:s.clientX,y:s.clientY}),js(this.info,e,s))}}),Cs({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown(t){cs(t)&&(this.info.x=t.clientX,this.info.y=t.clientY)},click(t){cs(t)&&Ms(this.info,t)},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchend(t){Ms(this.info,t.changedTouches[0],t)}});const Ls=te(t=>class extends t{static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0,sync:!0}}}_disabledChanged(t){this._setAriaDisabled(t)}_setAriaDisabled(t){t?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}click(){this.disabled||super.click()}}),Ps=te(t=>class extends t{ready(){super.ready(),this.addEventListener("keydown",t=>{this._onKeyDown(t)}),this.addEventListener("keyup",t=>{this._onKeyUp(t)})}_onKeyDown(t){switch(t.key){case"Enter":this._onEnter(t);break;case"Escape":this._onEscape(t)}}_onKeyUp(t){}_onEnter(t){}_onEscape(t){}}),$s=t=>class extends(Ls(Ps(t))){get _activeKeys(){return[" "]}ready(){super.ready(),xs(this,"down",t=>{this._shouldSetActive(t)&&this._setActive(!0)}),xs(this,"up",()=>{this._setActive(!1)})}disconnectedCallback(){super.disconnectedCallback(),this._setActive(!1)}_shouldSetActive(t){return!this.disabled}_onKeyDown(t){super._onKeyDown(t),this._shouldSetActive(t)&&this._activeKeys.includes(t.key)&&(this._setActive(!0),document.addEventListener("keyup",t=>{this._activeKeys.includes(t.key)&&this._setActive(!1)},{once:!0}))}_setActive(t){this.toggleAttribute("active",t)}};let Ns=!1;function Bs(){return Ns}function Rs(t){const e=t.style;if("hidden"===e.visibility||"none"===e.display)return!0;const s=window.getComputedStyle(t);return"hidden"===s.visibility||"none"===s.display}function Ds(t){return t.checkVisibility?!t.checkVisibility({visibilityProperty:!0}):null===t.offsetParent&&0===t.clientWidth&&0===t.clientHeight||Rs(t)}function Us(t){return t.getRootNode().activeElement===t}window.addEventListener("keydown",()=>{Ns=!0},{capture:!0}),window.addEventListener("mousedown",()=>{Ns=!1},{capture:!0});const Fs=te(t=>class extends t{get _keyboardActive(){return Bs()}ready(){this.addEventListener("focusin",t=>{this._shouldSetFocus(t)&&this._setFocused(!0)}),this.addEventListener("focusout",t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)}),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}focus(t){super.focus(t),t&&!1===t.focusVisible||this.setAttribute("focus-ring","")}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}});export{$s as A,Ls as D,Gt as E,Fs as F,Ps as K,Me as L,ce as P,ge as S,Ke as T,fe as a,Vt as b,Rt as c,_t as d,Us as e,Ds as f,he as g,te as h,Bs as i,b as o,ut as p,_ as s,Bt as t};
|