tinkiet 0.2.70 → 0.3.2
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/drawer/drawer.d.ts +7 -2
- package/drawer/drawer.js +74 -13
- package/drawer/drawer.scss.js +2 -2
- package/list-item/list-item.d.ts +2 -1
- package/list-item/list-item.js +15 -8
- package/package.json +3 -2
- package/select/select.js +2 -2
- package/textarea/textarea.js +2 -2
- package/textfield/textfield.js +2 -2
- package/umd/tinkiet.min.d.ts +9 -3
- package/umd/tinkiet.min.js +340 -21
package/umd/tinkiet.min.js
CHANGED
|
@@ -12,29 +12,29 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function e(t,e,r,i){var o,a=arguments.length,
|
|
15
|
+
***************************************************************************** */function e(t,e,r,i){var o,a=arguments.length,n=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,r,n):o(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function r(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}
|
|
16
16
|
/**
|
|
17
17
|
* @license
|
|
18
18
|
* Copyright 2019 Google LLC
|
|
19
19
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
-
*/const i=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new Map;class
|
|
20
|
+
*/const i=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new Map;class n{constructor(t,e){if(this._$cssResult$=!0,e!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=a.get(this.cssText);return i&&void 0===t&&(a.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const s=t=>new n("string"==typeof t?t:t+"",o),l=(t,...e)=>{const r=1===t.length?t[0]:e.reduce(((e,r,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1]),t[0]);return new n(r,o)},h=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return s(e)})(t):t
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/;var d;const c=window.trustedTypes,p=c?c.emptyScript:"",v=window.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},g=(t,e)=>e!==t&&(e==e||t==t),
|
|
25
|
+
*/;var d;const c=window.trustedTypes,p=c?c.emptyScript:"",v=window.reactiveElementPolyfillSupport,u={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},g=(t,e)=>e!==t&&(e==e||t==t),m={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:g};class b extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,r)=>{const i=this._$Eh(r,e);void 0!==i&&(this._$Eu.set(i,r),t.push(i))})),t}static createProperty(t,e=m){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const r="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,r,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){return{get(){return this[e]},set(i){const o=this[t];this[e]=i,this.requestUpdate(t,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||m}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of e)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Eh(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,r;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(r=t.hostConnected)||void 0===r||r.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const r=document.createElement("style"),i=window.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=e.cssText,t.appendChild(r)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ES(t,e,r=m){var i,o;const a=this.constructor._$Eh(t,r);if(void 0!==a&&!0===r.reflect){const n=(null!==(o=null===(i=r.converter)||void 0===i?void 0:i.toAttribute)&&void 0!==o?o:u.toAttribute)(e,r.type);this._$Ei=t,null==n?this.removeAttribute(a):this.setAttribute(a,n),this._$Ei=null}}_$AK(t,e){var r,i,o;const a=this.constructor,n=a._$Eu.get(t);if(void 0!==n&&this._$Ei!==n){const t=a.getPropertyOptions(n),s=t.converter,l=null!==(o=null!==(i=null===(r=s)||void 0===r?void 0:r.fromAttribute)&&void 0!==i?i:"function"==typeof s?s:null)&&void 0!==o?o:u.fromAttribute;this._$Ei=n,this[n]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,r){let i=!0;void 0!==t&&(((r=r||this.constructor.getPropertyOptions(t)).hasChanged||g)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===r.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,r))):i=!1),!this.isUpdatePending&&i&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(r)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(r)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
|
|
26
26
|
/**
|
|
27
27
|
* @license
|
|
28
28
|
* Copyright 2017 Google LLC
|
|
29
29
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
30
|
*/
|
|
31
|
-
var y;
|
|
31
|
+
var y;b.finalized=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:b}),(null!==(d=globalThis.reactiveElementVersions)&&void 0!==d?d:globalThis.reactiveElementVersions=[]).push("1.3.0");const f=globalThis.trustedTypes,k=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,T=`<${w}>`,$=document,P=(t="")=>$.createComment(t),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,_=Array.isArray,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,z=/>/g,C=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,B=/'/g,M=/"/g,L=/^(?:script|style|textarea|title)$/i,I=(t=>(e,...r)=>({_$litType$:t,strings:e,values:r}))(1),D=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),N=new WeakMap,H=$.createTreeWalker($,129,null,!1),R=(t,e)=>{const r=t.length-1,i=[];let o,a=2===e?"<svg>":"",n=E;for(let e=0;e<r;e++){const r=t[e];let s,l,h=-1,d=0;for(;d<r.length&&(n.lastIndex=d,l=n.exec(r),null!==l);)d=n.lastIndex,n===E?"!--"===l[1]?n=A:void 0!==l[1]?n=z:void 0!==l[2]?(L.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=C):void 0!==l[3]&&(n=C):n===C?">"===l[0]?(n=null!=o?o:E,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,s=l[1],n=void 0===l[3]?C:'"'===l[3]?M:B):n===M||n===B?n=C:n===A||n===z?n=E:(n=C,o=void 0);const c=n===C&&t[e+1].startsWith("/>")?" ":"";a+=n===E?r+T:h>=0?(i.push(s),r.slice(0,h)+"$lit$"+r.slice(h)+x+c):r+x+(-2===h?(i.push(void 0),e):c)}const s=a+(t[r]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(s):s,i]};class q{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let o=0,a=0;const n=t.length-1,s=this.parts,[l,h]=R(t,e);if(this.el=q.createElement(l,r),H.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=H.nextNode())&&s.length<n;){if(1===i.nodeType){if(i.hasAttributes()){const t=[];for(const e of i.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const r=h[a++];if(t.push(e),void 0!==r){const t=i.getAttribute(r.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(r);s.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?F:"?"===e[1]?X:"@"===e[1]?K:V})}else s.push({type:6,index:o})}for(const e of t)i.removeAttribute(e)}if(L.test(i.tagName)){const t=i.textContent.split(x),e=t.length-1;if(e>0){i.textContent=f?f.emptyScript:"";for(let r=0;r<e;r++)i.append(t[r],P()),H.nextNode(),s.push({type:2,index:++o});i.append(t[e],P())}}}else if(8===i.nodeType)if(i.data===w)s.push({type:2,index:o});else{let t=-1;for(;-1!==(t=i.data.indexOf(x,t+1));)s.push({type:7,index:o}),t+=x.length-1}o++}}static createElement(t,e){const r=$.createElement("template");return r.innerHTML=t,r}}function G(t,e,r=t,i){var o,a,n,s;if(e===D)return e;let l=void 0!==i?null===(o=r._$Cl)||void 0===o?void 0:o[i]:r._$Cu;const h=S(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(a=null==l?void 0:l._$AO)||void 0===a||a.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,r,i)),void 0!==i?(null!==(n=(s=r)._$Cl)&&void 0!==n?n:s._$Cl=[])[i]=l:r._$Cu=l),void 0!==l&&(e=G(t,l._$AS(t,e.values),l,i)),e}class O{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:r},parts:i}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:$).importNode(r,!0);H.currentNode=o;let a=H.nextNode(),n=0,s=0,l=i[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new j(a,a.nextSibling,this,t):1===l.type?e=new l.ctor(a,l.name,l.strings,this,t):6===l.type&&(e=new Q(a,this,t)),this.v.push(e),l=i[++s]}n!==(null==l?void 0:l.index)&&(a=H.nextNode(),n++)}return o}m(t){let e=0;for(const r of this.v)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class j{constructor(t,e,r,i){var o;this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cg=null===(o=null==i?void 0:i.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),S(t)?t===U||null==t||""===t?(this._$AH!==U&&this._$AR(),this._$AH=U):t!==this._$AH&&t!==D&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return _(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==U&&S(this._$AH)?this._$AA.nextSibling.data=t:this.k($.createTextNode(t)),this._$AH=t}T(t){var e;const{values:r,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=q.createElement(i.h,this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(r);else{const t=new O(o,this),e=t.p(this.options);t.m(r),this.k(e),this._$AH=t}}_$AC(t){let e=N.get(t.strings);return void 0===e&&N.set(t.strings,e=new q(t)),e}S(t){_(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const o of t)i===e.length?e.push(r=new j(this.A(P()),this.A(P()),this,this.options)):r=e[i],r._$AI(o),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for(null===(r=this._$AP)||void 0===r||r.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class V{constructor(t,e,r,i,o){this.type=1,this._$AH=U,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=U}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,r,i){const o=this.strings;let a=!1;if(void 0===o)t=G(this,t,e,0),a=!S(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const i=t;let n,s;for(t=o[0],n=0;n<o.length-1;n++)s=G(this,i[r+n],e,n),s===D&&(s=this._$AH[n]),a||(a=!S(s)||s!==this._$AH[n]),s===U?t=U:t!==U&&(t+=(null!=s?s:"")+o[n+1]),this._$AH[n]=s}a&&!i&&this.C(t)}C(t){t===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class F extends V{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===U?void 0:t}}const Y=f?f.emptyScript:"";class X extends V{constructor(){super(...arguments),this.type=4}C(t){t&&t!==U?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class K extends V{constructor(t,e,r,i,o){super(t,e,r,i,o),this.type=5}_$AI(t,e=this){var r;if((t=null!==(r=G(this,t,e,0))&&void 0!==r?r:U)===D)return;const i=this._$AH,o=t===U&&i!==U||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==U&&(i===U||o);o&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;"function"==typeof this._$AH?this._$AH.call(null!==(r=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==r?r:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const W=window.litHtmlPolyfillSupport;
|
|
32
32
|
/**
|
|
33
33
|
* @license
|
|
34
34
|
* Copyright 2017 Google LLC
|
|
35
35
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
36
36
|
*/
|
|
37
|
-
var
|
|
37
|
+
var Z,J;null==W||W(q,j),(null!==(y=globalThis.litHtmlVersions)&&void 0!==y?y:globalThis.litHtmlVersions=[]).push("2.2.0");class tt extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const r=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=r.firstChild),r}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,r)=>{var i,o;const a=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:e;let n=a._$litPart$;if(void 0===n){const t=null!==(o=null==r?void 0:r.renderBefore)&&void 0!==o?o:null;a._$litPart$=n=new j(e.insertBefore(P(),t),t,void 0,null!=r?r:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return D}}tt.finalized=!0,tt._$litElement$=!0,null===(Z=globalThis.litElementHydrateSupport)||void 0===Z||Z.call(globalThis,{LitElement:tt});const et=globalThis.litElementPolyfillSupport;null==et||et({LitElement:tt}),(null!==(J=globalThis.litElementVersions)&&void 0!==J?J:globalThis.litElementVersions=[]).push("3.2.0");
|
|
38
38
|
/**
|
|
39
39
|
* @license
|
|
40
40
|
* Copyright 2017 Google LLC
|
|
@@ -50,34 +50,33 @@ const rt=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e
|
|
|
50
50
|
* @license
|
|
51
51
|
* Copyright 2017 Google LLC
|
|
52
52
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
-
*/}
|
|
53
|
+
*/}function at(t){return ot({...t,state:!0})}
|
|
54
54
|
/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2017 Google LLC
|
|
57
57
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/
|
|
59
|
-
const at=({finisher:t,descriptor:e})=>(r,i)=>{var o;if(void 0===i){const i=null!==(o=r.originalKey)&&void 0!==o?o:r.key,a=null!=e?{kind:"method",placement:"prototype",key:i,descriptor:e(r.key)}:{...r,key:i};return null!=t&&(a.finisher=function(e){t(e,i)}),a}{const o=r.constructor;void 0!==e&&Object.defineProperty(r,i,e(i)),null==t||t(o,i)}}
|
|
58
|
+
*/const nt=({finisher:t,descriptor:e})=>(r,i)=>{var o;if(void 0===i){const i=null!==(o=r.originalKey)&&void 0!==o?o:r.key,a=null!=e?{kind:"method",placement:"prototype",key:i,descriptor:e(r.key)}:{...r,key:i};return null!=t&&(a.finisher=function(e){t(e,i)}),a}{const o=r.constructor;void 0!==e&&Object.defineProperty(r,i,e(i)),null==t||t(o,i)}}
|
|
60
59
|
/**
|
|
61
60
|
* @license
|
|
62
61
|
* Copyright 2017 Google LLC
|
|
63
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
64
|
-
*/;function st(t){return
|
|
63
|
+
*/;function st(t){return nt({finisher:(e,r)=>{Object.assign(e.prototype[r],t)}})}
|
|
65
64
|
/**
|
|
66
65
|
* @license
|
|
67
66
|
* Copyright 2017 Google LLC
|
|
68
67
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
69
|
-
*/function
|
|
68
|
+
*/function lt(t,e){return nt({descriptor:r=>{const i={get(){var e,r;return null!==(r=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==r?r:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof r?Symbol():"__"+r;i.get=function(){var r,i;return void 0===this[e]&&(this[e]=null!==(i=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(t))&&void 0!==i?i:null),this[e]}}return i}})}
|
|
70
69
|
/**
|
|
71
70
|
* @license
|
|
72
71
|
* Copyright 2021 Google LLC
|
|
73
72
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
-
*/var
|
|
73
|
+
*/var ht;null===(ht=window.HTMLSlotElement)||void 0===ht||ht.prototype.assignedElements;
|
|
75
74
|
/**
|
|
76
75
|
* @license
|
|
77
76
|
* Copyright 2018 Google LLC
|
|
78
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
78
|
*/
|
|
80
|
-
const
|
|
79
|
+
const dt=t=>null!=t?t:U;const ct=["primary-lighter","primary-light","primary","primary-dark","primary-darker","on-primary-lighter","on-primary-light","on-primary","on-primary-dark","on-primary-darker","accent-lighter","accent-light","accent","accent-dark","accent-darker","on-accent-lighter","on-accent-light","on-accent","on-accent-dark","on-accent-darker","error-lighter","error-light","error","error-dark","error-darker","on-error-lighter","on-error-light","on-error","on-error-dark","on-error-darker","shade-lighter","shade-light","shade","shade-dark","shade-darker","on-shade-lighter","on-shade-light","on-shade","on-shade-dark","on-shade-darker"];
|
|
81
80
|
/**
|
|
82
81
|
* A container that lays out its contents in one direction
|
|
83
82
|
*
|
|
@@ -109,25 +108,25 @@ const ht=t=>null!=t?t:U;const dt=["primary-lighter","primary-light","primary","p
|
|
|
109
108
|
* @param {number} length
|
|
110
109
|
* @returns {string}
|
|
111
110
|
*/
|
|
112
|
-
function
|
|
111
|
+
function pt(t=10){return`_${Math.random().toString(36).substr(2,t)}`}t.TkBox=class extends tt{constructor(){super(...arguments),
|
|
113
112
|
/**
|
|
114
113
|
* Activate ripple
|
|
115
114
|
*/
|
|
116
|
-
this.ripple=!1}static get styles(){return[l`${n('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{box-sizing:border-box;display:flex;flex-direction:column;position:relative;transition:background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease)}:host([hidden]){display:none}.ripple{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.ripple span{background-color:currentColor;border-radius:50%;opacity:.5;position:absolute}:host([align-content=start]){align-content:flex-start}:host([align-content=end]){align-content:flex-end}:host([align-content=stretch]){align-content:stretch}:host([align-content=center]){align-content:center}:host([align-content=around]){align-content:space-around}:host([align-content=between]){align-content:space-between}:host([align-items=start]){align-items:flex-start}:host([align-items=end]){align-items:flex-end}:host([align-items=stretch]){align-items:stretch}:host([align-items=center]){align-items:center}:host([align-items=baseline]){align-items:baseline}:host([align-self=start]){align-self:flex-start}:host([align-self=end]){align-self:flex-end}:host([align-self=stretch]){align-self:stretch}:host([align-self=center]){align-self:center}:host([background=primary-lighter]){background-color:var(--primary-lighter)}:host([color=primary-lighter]){color:var(--primary-lighter)}:host([background=primary-light]){background-color:var(--primary-light)}:host([color=primary-light]){color:var(--primary-light)}:host([background=primary]){background-color:var(--primary)}:host([color=primary]){color:var(--primary)}:host([background=primary-dark]){background-color:var(--primary-dark)}:host([color=primary-dark]){color:var(--primary-dark)}:host([background=primary-darker]){background-color:var(--primary-darker)}:host([color=primary-darker]){color:var(--primary-darker)}:host([background=on-primary-lighter]){background-color:var(--on-primary-lighter)}:host([color=on-primary-lighter]){color:var(--on-primary-lighter)}:host([background=on-primary-light]){background-color:var(--on-primary-light)}:host([color=on-primary-light]){color:var(--on-primary-light)}:host([background=on-primary]){background-color:var(--on-primary)}:host([color=on-primary]){color:var(--on-primary)}:host([background=on-primary-dark]){background-color:var(--on-primary-dark)}:host([color=on-primary-dark]){color:var(--on-primary-dark)}:host([background=on-primary-darker]){background-color:var(--on-primary-darker)}:host([color=on-primary-darker]){color:var(--on-primary-darker)}:host([background=accent-lighter]){background-color:var(--accent-lighter)}:host([color=accent-lighter]){color:var(--accent-lighter)}:host([background=accent-light]){background-color:var(--accent-light)}:host([color=accent-light]){color:var(--accent-light)}:host([background=accent]){background-color:var(--accent)}:host([color=accent]){color:var(--accent)}:host([background=accent-dark]){background-color:var(--accent-dark)}:host([color=accent-dark]){color:var(--accent-dark)}:host([background=accent-darker]){background-color:var(--accent-darker)}:host([color=accent-darker]){color:var(--accent-darker)}:host([background=on-accent-lighter]){background-color:var(--on-accent-lighter)}:host([color=on-accent-lighter]){color:var(--on-accent-lighter)}:host([background=on-accent-light]){background-color:var(--on-accent-light)}:host([color=on-accent-light]){color:var(--on-accent-light)}:host([background=on-accent]){background-color:var(--on-accent)}:host([color=on-accent]){color:var(--on-accent)}:host([background=on-accent-dark]){background-color:var(--on-accent-dark)}:host([color=on-accent-dark]){color:var(--on-accent-dark)}:host([background=on-accent-darker]){background-color:var(--on-accent-darker)}:host([color=on-accent-darker]){color:var(--on-accent-darker)}:host([background=error-lighter]){background-color:var(--error-lighter)}:host([color=error-lighter]){color:var(--error-lighter)}:host([background=error-light]){background-color:var(--error-light)}:host([color=error-light]){color:var(--error-light)}:host([background=error]){background-color:var(--error)}:host([color=error]){color:var(--error)}:host([background=error-dark]){background-color:var(--error-dark)}:host([color=error-dark]){color:var(--error-dark)}:host([background=error-darker]){background-color:var(--error-darker)}:host([color=error-darker]){color:var(--error-darker)}:host([background=on-error-lighter]){background-color:var(--on-error-lighter)}:host([color=on-error-lighter]){color:var(--on-error-lighter)}:host([background=on-error-light]){background-color:var(--on-error-light)}:host([color=on-error-light]){color:var(--on-error-light)}:host([background=on-error]){background-color:var(--on-error)}:host([color=on-error]){color:var(--on-error)}:host([background=on-error-dark]){background-color:var(--on-error-dark)}:host([color=on-error-dark]){color:var(--on-error-dark)}:host([background=on-error-darker]){background-color:var(--on-error-darker)}:host([color=on-error-darker]){color:var(--on-error-darker)}:host([background=shade-lighter]){background-color:var(--shade-lighter)}:host([color=shade-lighter]){color:var(--shade-lighter)}:host([background=shade-light]){background-color:var(--shade-light)}:host([color=shade-light]){color:var(--shade-light)}:host([background=shade]){background-color:var(--shade)}:host([color=shade]){color:var(--shade)}:host([background=shade-dark]){background-color:var(--shade-dark)}:host([color=shade-dark]){color:var(--shade-dark)}:host([background=shade-darker]){background-color:var(--shade-darker)}:host([color=shade-darker]){color:var(--shade-darker)}:host([background=on-shade-lighter]){background-color:var(--on-shade-lighter)}:host([color=on-shade-lighter]){color:var(--on-shade-lighter)}:host([background=on-shade-light]){background-color:var(--on-shade-light)}:host([color=on-shade-light]){color:var(--on-shade-light)}:host([background=on-shade]){background-color:var(--on-shade)}:host([color=on-shade]){color:var(--on-shade)}:host([background=on-shade-dark]){background-color:var(--on-shade-dark)}:host([color=on-shade-dark]){color:var(--on-shade-dark)}:host([background=on-shade-darker]){background-color:var(--on-shade-darker)}:host([color=on-shade-darker]){color:var(--on-shade-darker)}:host([background=foreground]){background-color:var(--foreground)}:host([color=foreground]){color:var(--foreground)}:host([background=background]){background-color:var(--background)}:host([color=background]){color:var(--background)}:host([direction=column]){flex-direction:column}:host([direction=row-reverse]){flex-direction:row-reverse}:host([direction=column-reverse]){flex-direction:column-reverse}:host([text=center]){text-align:center}:host([text=justify]){text-align:justify}:host([text=left]){text-align:left}:host([text=right]){text-align:right}:host([weight="100"]){font-weight:100}:host([weight="200"]){font-weight:200}:host([weight="300"]){font-weight:300}:host([weight="400"]){font-weight:400}:host([weight="500"]){font-weight:500}:host([weight="600"]){font-weight:600}:host([weight="700"]){font-weight:700}:host([weight="800"]){font-weight:800}:host([weight="900"]){font-weight:900}:host([weight=lighter]){font-weight:lighter}:host([weight=bold]){font-weight:700}:host([weight=bolder]){font-weight:bolder}:host([direction=row]){flex-direction:row}:host([direction=row-reverse]){flex-direction:row}:host([elevation=xsmall]){box-shadow:var(--box-elevation,var(--elevation-1,0 1px 2px var(--shadow)))}:host([elevation=small]){box-shadow:var(--box-elevation,var(--elevation-2,0 2px 4px var(--shadow)))}:host([elevation=medium]){box-shadow:var(--box-elevation,var(--elevation-3,0 4px 8px var(--shadow)))}:host([elevation=large]){box-shadow:var(--box-elevation,var(--elevation-4,0 8px 16px var(--shadow)))}:host([elevation=xlarge]){box-shadow:var(--box-elevation,var(--elevation-5,0 12px 24px var(--shadow)))}:host([fill=horizontal]){width:100%}:host([fill=vertical]){height:100%}:host([fill=true]){height:100%;width:100%}:host([flex=grow]){flex:1 0}:host([flex=shrink]){flex:0 1}:host([flex=true]){flex:1 1}:host([flex=false]){flex:0 0}:host([gap=xsmall]) ::slotted(*),:host([gap=xsmall][direction=column]) ::slotted(*){margin:var(--spacing-xs,.25rem) 0}:host([gap=xsmall][direction=row]) ::slotted(*){margin:0 var(--spacing-xs,.25rem)}:host([margin=xsmall]){margin:var(--box-margin,var(--spacing-xs,.25rem))}:host([margin="xsmall auto"]){margin:var(--box-margin,var(--spacing-xs,.25rem)) auto}:host([margin="auto xsmall"]){margin:auto var(--box-margin,var(--spacing-xs,.25rem))}:host([padding=xsmall]){padding:var(--box-padding,var(--spacing-xs,.25rem))}:host([gap=small]) ::slotted(*),:host([gap=small][direction=column]) ::slotted(*){margin:var(--spacing-s,.5rem) 0}:host([gap=small][direction=row]) ::slotted(*){margin:0 var(--spacing-s,.5rem)}:host([margin=small]){margin:var(--box-margin,var(--spacing-s,.5rem))}:host([margin="small auto"]){margin:var(--box-margin,var(--spacing-s,.5rem)) auto}:host([margin="auto small"]){margin:auto var(--box-margin,var(--spacing-s,.5rem))}:host([padding=small]){padding:var(--box-padding,var(--spacing-s,.5rem))}:host([gap=medium]) ::slotted(*),:host([gap=medium][direction=column]) ::slotted(*){margin:var(--spacing-m,1rem) 0}:host([gap=medium][direction=row]) ::slotted(*){margin:0 var(--spacing-m,1rem)}:host([margin=medium]){margin:var(--box-margin,var(--spacing-m,1rem))}:host([margin="medium auto"]){margin:var(--box-margin,var(--spacing-m,1rem)) auto}:host([margin="auto medium"]){margin:auto var(--box-margin,var(--spacing-m,1rem))}:host([padding=medium]){padding:var(--box-padding,var(--spacing-m,1rem))}:host([gap=large]) ::slotted(*),:host([gap=large][direction=column]) ::slotted(*){margin:var(--spacing-l,1.25rem) 0}:host([gap=large][direction=row]) ::slotted(*){margin:0 var(--spacing-l,1.25rem)}:host([margin=large]){margin:var(--box-margin,var(--spacing-l,1.25rem))}:host([margin="large auto"]){margin:var(--box-margin,var(--spacing-l,1.25rem)) auto}:host([margin="auto large"]){margin:auto var(--box-margin,var(--spacing-l,1.25rem))}:host([padding=large]){padding:var(--box-padding,var(--spacing-l,1.25rem))}:host([gap=xlarge]) ::slotted(*),:host([gap=xlarge][direction=column]) ::slotted(*){margin:var(--spacing-xl,2rem) 0}:host([gap=xlarge][direction=row]) ::slotted(*){margin:0 var(--spacing-xl,2rem)}:host([margin=xlarge]){margin:var(--box-margin,var(--spacing-xl,2rem))}:host([margin="xlarge auto"]){margin:var(--box-margin,var(--spacing-xl,2rem)) auto}:host([margin="auto xlarge"]){margin:auto var(--box-margin,var(--spacing-xl,2rem))}:host([padding=xlarge]){padding:var(--box-padding,var(--spacing-xl,2rem))}:host([font=xsmall]),:host([size=xsmall]){font-size:var(--box-font-size,var(--font-size-xs,.625rem))}:host([font=small]),:host([size=small]){font-size:var(--box-font-size,var(--font-size-s,.875rem))}:host([font=medium]),:host([size=medium]){font-size:var(--box-font-size,var(--font-size-m,1rem))}:host([font=large]),:host([size=large]){font-size:var(--box-font-size,var(--font-size-l,1.25rem))}:host([font=xlarge]),:host([size=xlarge]){font-size:var(--box-font-size,var(--font-size-xl,1.5rem))}:host([font=xxlarge]),:host([size=xxlarge]){font-size:var(--box-font-size,var(--font-size-xxl,2.25rem))}:host([justify=start]){justify-content:flex-start}:host([justify=end]){justify-content:flex-end}:host([justify=stretch]){justify-content:stretch}:host([justify=baseline]){justify-content:baseline}:host([justify=center]){justify-content:center}:host([justify=around]){justify-content:space-around}:host([justify=between]){justify-content:space-between}:host([overflow=auto]){overflow:auto}:host([overflow=hidden]){overflow:hidden}:host([overflow=scroll]){overflow:scroll}:host([overflow=visible]){overflow:visible}:host([radius=none]){border-radius:var(--box-border-radius,0)}:host([radius=small]){border-radius:var(--box-border-radius,var(--border-radius-small,.125rem))}:host([radius=medium]){border-radius:var(--box-border-radius,var(--border-radius-medium,.25rem))}:host([radius=large]){border-radius:var(--box-border-radius,var(--border-radius-large,.5rem))}:host([radius=xlarge]){border-radius:var(--box-border-radius,var(--border-radius-x-large,1rem))}:host([radius=circle]){border-radius:var(--box-border-radius,var(--border-radius-circle,50%))}:host([radius=pill]){border-radius:var(--box-border-radius,var(--border-radius-pill,9999px))}:host([max-width=xxsmall]){max-width:var(--box-max-width,var(--size-xxs,2rem))}:host([width=xxsmall]){width:var(--box-width,var(--size-xxs,2rem))}:host([max-height=xxsmall]){max-height:var(--box-max-height,var(--size-xxs,2rem))}:host([height=xxsmall]){height:var(--box-height,var(--size-xxs,2rem))}:host([max-width=xsmall]){max-width:var(--box-max-width,var(--size-xs,4rem))}:host([width=xsmall]){width:var(--box-width,var(--size-xs,4rem))}:host([max-height=xsmall]){max-height:var(--box-max-height,var(--size-xs,4rem))}:host([height=xsmall]){height:var(--box-height,var(--size-xs,4rem))}:host([max-width=small]){max-width:var(--box-max-width,var(--size-s,8rem))}:host([width=small]){width:var(--box-width,var(--size-s,8rem))}:host([max-height=small]){max-height:var(--box-max-height,var(--size-s,8rem))}:host([height=small]){height:var(--box-height,var(--size-s,8rem))}:host([max-width=medium]){max-width:var(--box-max-width,var(--size-m,16rem))}:host([width=medium]){width:var(--box-width,var(--size-m,16rem))}:host([max-height=medium]){max-height:var(--box-max-height,var(--size-m,16rem))}:host([height=medium]){height:var(--box-height,var(--size-m,16rem))}:host([max-width=large]){max-width:var(--box-max-width,var(--size-l,32rem))}:host([width=large]){width:var(--box-width,var(--size-l,32rem))}:host([max-height=large]){max-height:var(--box-max-height,var(--size-l,32rem))}:host([height=large]){height:var(--box-height,var(--size-l,32rem))}:host([max-width=xlarge]){max-width:var(--box-max-width,var(--size-xl,48rem))}:host([width=xlarge]){width:var(--box-width,var(--size-xl,48rem))}:host([max-height=xlarge]){max-height:var(--box-max-height,var(--size-xl,48rem))}:host([height=xlarge]){height:var(--box-height,var(--size-xl,48rem))}:host([max-width=xxlarge]){max-width:var(--box-max-width,var(--size-xxl,64rem))}:host([width=xxlarge]){width:var(--box-width,var(--size-xxl,64rem))}:host([max-height=xxlarge]){max-height:var(--box-max-height,var(--size-xxl,64rem))}:host([height=xxlarge]){height:var(--box-height,var(--size-xxl,64rem))}:host([wrap=true]){flex-wrap:wrap}:host([wrap=reverse]){flex-wrap:wrap-reverse}')}`]}render(){return H`<slot></slot>`}connectedCallback(){this.ripple&&(this.addEventListener("mousedown",this.showRipple.bind(this),{passive:!0}),this.addEventListener("mouseup",this.hideRipple.bind(this),{passive:!0})),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("mousedown",this.showRipple),this.addEventListener("mouseup",this.hideRipple),super.disconnectedCallback()}updated(t){t.has("background")&&![...dt,"background","foreground"].includes(this.background)&&this.style.setProperty("background-color",this.background.toString()),t.has("color")&&![...dt,"background","foreground"].includes(this.color)&&this.style.setProperty("color",this.color.toString()),super.updated(t)}showRipple(t){const e=t.clientX,r=t.clientY,{offsetWidth:i,offsetHeight:o}=this,a=document.createElement("span");a.classList.add("ripple","open");const s=document.createElement("span");a.appendChild(s),this.shadowRoot.appendChild(a);const n=this.getBoundingClientRect(),l=2*Math.max(i,i);s.style.width=s.style.height=l+"px",s.style.left=e-n.left-l/2+"px",s.style.top=r-n.top-l/2+"px";s.animate({transform:["scale(0)","scale(1)"]},{easing:"ease-out",fill:"both",duration:500}).onfinish=()=>{a.classList.remove("open");s.animate({opacity:["0.5","0"]},{easing:"ease-in",fill:"both",duration:300}).onfinish=()=>{requestAnimationFrame((()=>{a.remove()}))}}}hideRipple(t){this.shadowRoot?.querySelectorAll(".ripple:not([open])").forEach((t=>{t.querySelector("span").animate({opacity:["0.5","0"]},{easing:"ease-out",fill:"both",duration:300}).onfinish=()=>{requestAnimationFrame((()=>{t.remove()}))}}))}},e([ot({type:Boolean}),r("design:type",Boolean)],t.TkBox.prototype,"ripple",void 0),e([ot(),r("design:type",Object)],t.TkBox.prototype,"background",void 0),e([ot(),r("design:type",Object)],t.TkBox.prototype,"color",void 0),t.TkBox=e([rt("tk-box")],t.TkBox);class pt extends t.TkBox{constructor(){super(...arguments),
|
|
115
|
+
this.ripple=!1}static get styles(){return[l`${s('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{box-sizing:border-box;display:flex;flex-direction:column;position:relative;transition:background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease)}:host([hidden]){display:none}.ripple{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.ripple span{background-color:currentColor;border-radius:50%;opacity:.5;position:absolute}:host([align-content=start]){align-content:flex-start}:host([align-content=end]){align-content:flex-end}:host([align-content=stretch]){align-content:stretch}:host([align-content=center]){align-content:center}:host([align-content=around]){align-content:space-around}:host([align-content=between]){align-content:space-between}:host([align-items=start]){align-items:flex-start}:host([align-items=end]){align-items:flex-end}:host([align-items=stretch]){align-items:stretch}:host([align-items=center]){align-items:center}:host([align-items=baseline]){align-items:baseline}:host([align-self=start]){align-self:flex-start}:host([align-self=end]){align-self:flex-end}:host([align-self=stretch]){align-self:stretch}:host([align-self=center]){align-self:center}:host([background=primary-lighter]){background-color:var(--primary-lighter)}:host([color=primary-lighter]){color:var(--primary-lighter)}:host([background=primary-light]){background-color:var(--primary-light)}:host([color=primary-light]){color:var(--primary-light)}:host([background=primary]){background-color:var(--primary)}:host([color=primary]){color:var(--primary)}:host([background=primary-dark]){background-color:var(--primary-dark)}:host([color=primary-dark]){color:var(--primary-dark)}:host([background=primary-darker]){background-color:var(--primary-darker)}:host([color=primary-darker]){color:var(--primary-darker)}:host([background=on-primary-lighter]){background-color:var(--on-primary-lighter)}:host([color=on-primary-lighter]){color:var(--on-primary-lighter)}:host([background=on-primary-light]){background-color:var(--on-primary-light)}:host([color=on-primary-light]){color:var(--on-primary-light)}:host([background=on-primary]){background-color:var(--on-primary)}:host([color=on-primary]){color:var(--on-primary)}:host([background=on-primary-dark]){background-color:var(--on-primary-dark)}:host([color=on-primary-dark]){color:var(--on-primary-dark)}:host([background=on-primary-darker]){background-color:var(--on-primary-darker)}:host([color=on-primary-darker]){color:var(--on-primary-darker)}:host([background=accent-lighter]){background-color:var(--accent-lighter)}:host([color=accent-lighter]){color:var(--accent-lighter)}:host([background=accent-light]){background-color:var(--accent-light)}:host([color=accent-light]){color:var(--accent-light)}:host([background=accent]){background-color:var(--accent)}:host([color=accent]){color:var(--accent)}:host([background=accent-dark]){background-color:var(--accent-dark)}:host([color=accent-dark]){color:var(--accent-dark)}:host([background=accent-darker]){background-color:var(--accent-darker)}:host([color=accent-darker]){color:var(--accent-darker)}:host([background=on-accent-lighter]){background-color:var(--on-accent-lighter)}:host([color=on-accent-lighter]){color:var(--on-accent-lighter)}:host([background=on-accent-light]){background-color:var(--on-accent-light)}:host([color=on-accent-light]){color:var(--on-accent-light)}:host([background=on-accent]){background-color:var(--on-accent)}:host([color=on-accent]){color:var(--on-accent)}:host([background=on-accent-dark]){background-color:var(--on-accent-dark)}:host([color=on-accent-dark]){color:var(--on-accent-dark)}:host([background=on-accent-darker]){background-color:var(--on-accent-darker)}:host([color=on-accent-darker]){color:var(--on-accent-darker)}:host([background=error-lighter]){background-color:var(--error-lighter)}:host([color=error-lighter]){color:var(--error-lighter)}:host([background=error-light]){background-color:var(--error-light)}:host([color=error-light]){color:var(--error-light)}:host([background=error]){background-color:var(--error)}:host([color=error]){color:var(--error)}:host([background=error-dark]){background-color:var(--error-dark)}:host([color=error-dark]){color:var(--error-dark)}:host([background=error-darker]){background-color:var(--error-darker)}:host([color=error-darker]){color:var(--error-darker)}:host([background=on-error-lighter]){background-color:var(--on-error-lighter)}:host([color=on-error-lighter]){color:var(--on-error-lighter)}:host([background=on-error-light]){background-color:var(--on-error-light)}:host([color=on-error-light]){color:var(--on-error-light)}:host([background=on-error]){background-color:var(--on-error)}:host([color=on-error]){color:var(--on-error)}:host([background=on-error-dark]){background-color:var(--on-error-dark)}:host([color=on-error-dark]){color:var(--on-error-dark)}:host([background=on-error-darker]){background-color:var(--on-error-darker)}:host([color=on-error-darker]){color:var(--on-error-darker)}:host([background=shade-lighter]){background-color:var(--shade-lighter)}:host([color=shade-lighter]){color:var(--shade-lighter)}:host([background=shade-light]){background-color:var(--shade-light)}:host([color=shade-light]){color:var(--shade-light)}:host([background=shade]){background-color:var(--shade)}:host([color=shade]){color:var(--shade)}:host([background=shade-dark]){background-color:var(--shade-dark)}:host([color=shade-dark]){color:var(--shade-dark)}:host([background=shade-darker]){background-color:var(--shade-darker)}:host([color=shade-darker]){color:var(--shade-darker)}:host([background=on-shade-lighter]){background-color:var(--on-shade-lighter)}:host([color=on-shade-lighter]){color:var(--on-shade-lighter)}:host([background=on-shade-light]){background-color:var(--on-shade-light)}:host([color=on-shade-light]){color:var(--on-shade-light)}:host([background=on-shade]){background-color:var(--on-shade)}:host([color=on-shade]){color:var(--on-shade)}:host([background=on-shade-dark]){background-color:var(--on-shade-dark)}:host([color=on-shade-dark]){color:var(--on-shade-dark)}:host([background=on-shade-darker]){background-color:var(--on-shade-darker)}:host([color=on-shade-darker]){color:var(--on-shade-darker)}:host([background=foreground]){background-color:var(--foreground)}:host([color=foreground]){color:var(--foreground)}:host([background=background]){background-color:var(--background)}:host([color=background]){color:var(--background)}:host([direction=column]){flex-direction:column}:host([direction=row-reverse]){flex-direction:row-reverse}:host([direction=column-reverse]){flex-direction:column-reverse}:host([text=center]){text-align:center}:host([text=justify]){text-align:justify}:host([text=left]){text-align:left}:host([text=right]){text-align:right}:host([weight="100"]){font-weight:100}:host([weight="200"]){font-weight:200}:host([weight="300"]){font-weight:300}:host([weight="400"]){font-weight:400}:host([weight="500"]){font-weight:500}:host([weight="600"]){font-weight:600}:host([weight="700"]){font-weight:700}:host([weight="800"]){font-weight:800}:host([weight="900"]){font-weight:900}:host([weight=lighter]){font-weight:lighter}:host([weight=bold]){font-weight:700}:host([weight=bolder]){font-weight:bolder}:host([direction=row]){flex-direction:row}:host([direction=row-reverse]){flex-direction:row}:host([elevation=xsmall]){box-shadow:var(--box-elevation,var(--elevation-1,0 1px 2px var(--shadow)))}:host([elevation=small]){box-shadow:var(--box-elevation,var(--elevation-2,0 2px 4px var(--shadow)))}:host([elevation=medium]){box-shadow:var(--box-elevation,var(--elevation-3,0 4px 8px var(--shadow)))}:host([elevation=large]){box-shadow:var(--box-elevation,var(--elevation-4,0 8px 16px var(--shadow)))}:host([elevation=xlarge]){box-shadow:var(--box-elevation,var(--elevation-5,0 12px 24px var(--shadow)))}:host([fill=horizontal]){width:100%}:host([fill=vertical]){height:100%}:host([fill=true]){height:100%;width:100%}:host([flex=grow]){flex:1 0}:host([flex=shrink]){flex:0 1}:host([flex=true]){flex:1 1}:host([flex=false]){flex:0 0}:host([gap=xsmall]) ::slotted(*),:host([gap=xsmall][direction=column]) ::slotted(*){margin:var(--spacing-xs,.25rem) 0}:host([gap=xsmall][direction=row]) ::slotted(*){margin:0 var(--spacing-xs,.25rem)}:host([margin=xsmall]){margin:var(--box-margin,var(--spacing-xs,.25rem))}:host([margin="xsmall auto"]){margin:var(--box-margin,var(--spacing-xs,.25rem)) auto}:host([margin="auto xsmall"]){margin:auto var(--box-margin,var(--spacing-xs,.25rem))}:host([padding=xsmall]){padding:var(--box-padding,var(--spacing-xs,.25rem))}:host([gap=small]) ::slotted(*),:host([gap=small][direction=column]) ::slotted(*){margin:var(--spacing-s,.5rem) 0}:host([gap=small][direction=row]) ::slotted(*){margin:0 var(--spacing-s,.5rem)}:host([margin=small]){margin:var(--box-margin,var(--spacing-s,.5rem))}:host([margin="small auto"]){margin:var(--box-margin,var(--spacing-s,.5rem)) auto}:host([margin="auto small"]){margin:auto var(--box-margin,var(--spacing-s,.5rem))}:host([padding=small]){padding:var(--box-padding,var(--spacing-s,.5rem))}:host([gap=medium]) ::slotted(*),:host([gap=medium][direction=column]) ::slotted(*){margin:var(--spacing-m,1rem) 0}:host([gap=medium][direction=row]) ::slotted(*){margin:0 var(--spacing-m,1rem)}:host([margin=medium]){margin:var(--box-margin,var(--spacing-m,1rem))}:host([margin="medium auto"]){margin:var(--box-margin,var(--spacing-m,1rem)) auto}:host([margin="auto medium"]){margin:auto var(--box-margin,var(--spacing-m,1rem))}:host([padding=medium]){padding:var(--box-padding,var(--spacing-m,1rem))}:host([gap=large]) ::slotted(*),:host([gap=large][direction=column]) ::slotted(*){margin:var(--spacing-l,1.25rem) 0}:host([gap=large][direction=row]) ::slotted(*){margin:0 var(--spacing-l,1.25rem)}:host([margin=large]){margin:var(--box-margin,var(--spacing-l,1.25rem))}:host([margin="large auto"]){margin:var(--box-margin,var(--spacing-l,1.25rem)) auto}:host([margin="auto large"]){margin:auto var(--box-margin,var(--spacing-l,1.25rem))}:host([padding=large]){padding:var(--box-padding,var(--spacing-l,1.25rem))}:host([gap=xlarge]) ::slotted(*),:host([gap=xlarge][direction=column]) ::slotted(*){margin:var(--spacing-xl,2rem) 0}:host([gap=xlarge][direction=row]) ::slotted(*){margin:0 var(--spacing-xl,2rem)}:host([margin=xlarge]){margin:var(--box-margin,var(--spacing-xl,2rem))}:host([margin="xlarge auto"]){margin:var(--box-margin,var(--spacing-xl,2rem)) auto}:host([margin="auto xlarge"]){margin:auto var(--box-margin,var(--spacing-xl,2rem))}:host([padding=xlarge]){padding:var(--box-padding,var(--spacing-xl,2rem))}:host([font=xsmall]),:host([size=xsmall]){font-size:var(--box-font-size,var(--font-size-xs,.625rem))}:host([font=small]),:host([size=small]){font-size:var(--box-font-size,var(--font-size-s,.875rem))}:host([font=medium]),:host([size=medium]){font-size:var(--box-font-size,var(--font-size-m,1rem))}:host([font=large]),:host([size=large]){font-size:var(--box-font-size,var(--font-size-l,1.25rem))}:host([font=xlarge]),:host([size=xlarge]){font-size:var(--box-font-size,var(--font-size-xl,1.5rem))}:host([font=xxlarge]),:host([size=xxlarge]){font-size:var(--box-font-size,var(--font-size-xxl,2.25rem))}:host([justify=start]){justify-content:flex-start}:host([justify=end]){justify-content:flex-end}:host([justify=stretch]){justify-content:stretch}:host([justify=baseline]){justify-content:baseline}:host([justify=center]){justify-content:center}:host([justify=around]){justify-content:space-around}:host([justify=between]){justify-content:space-between}:host([overflow=auto]){overflow:auto}:host([overflow=hidden]){overflow:hidden}:host([overflow=scroll]){overflow:scroll}:host([overflow=visible]){overflow:visible}:host([radius=none]){border-radius:var(--box-border-radius,0)}:host([radius=small]){border-radius:var(--box-border-radius,var(--border-radius-small,.125rem))}:host([radius=medium]){border-radius:var(--box-border-radius,var(--border-radius-medium,.25rem))}:host([radius=large]){border-radius:var(--box-border-radius,var(--border-radius-large,.5rem))}:host([radius=xlarge]){border-radius:var(--box-border-radius,var(--border-radius-x-large,1rem))}:host([radius=circle]){border-radius:var(--box-border-radius,var(--border-radius-circle,50%))}:host([radius=pill]){border-radius:var(--box-border-radius,var(--border-radius-pill,9999px))}:host([max-width=xxsmall]){max-width:var(--box-max-width,var(--size-xxs,2rem))}:host([width=xxsmall]){width:var(--box-width,var(--size-xxs,2rem))}:host([max-height=xxsmall]){max-height:var(--box-max-height,var(--size-xxs,2rem))}:host([height=xxsmall]){height:var(--box-height,var(--size-xxs,2rem))}:host([max-width=xsmall]){max-width:var(--box-max-width,var(--size-xs,4rem))}:host([width=xsmall]){width:var(--box-width,var(--size-xs,4rem))}:host([max-height=xsmall]){max-height:var(--box-max-height,var(--size-xs,4rem))}:host([height=xsmall]){height:var(--box-height,var(--size-xs,4rem))}:host([max-width=small]){max-width:var(--box-max-width,var(--size-s,8rem))}:host([width=small]){width:var(--box-width,var(--size-s,8rem))}:host([max-height=small]){max-height:var(--box-max-height,var(--size-s,8rem))}:host([height=small]){height:var(--box-height,var(--size-s,8rem))}:host([max-width=medium]){max-width:var(--box-max-width,var(--size-m,16rem))}:host([width=medium]){width:var(--box-width,var(--size-m,16rem))}:host([max-height=medium]){max-height:var(--box-max-height,var(--size-m,16rem))}:host([height=medium]){height:var(--box-height,var(--size-m,16rem))}:host([max-width=large]){max-width:var(--box-max-width,var(--size-l,32rem))}:host([width=large]){width:var(--box-width,var(--size-l,32rem))}:host([max-height=large]){max-height:var(--box-max-height,var(--size-l,32rem))}:host([height=large]){height:var(--box-height,var(--size-l,32rem))}:host([max-width=xlarge]){max-width:var(--box-max-width,var(--size-xl,48rem))}:host([width=xlarge]){width:var(--box-width,var(--size-xl,48rem))}:host([max-height=xlarge]){max-height:var(--box-max-height,var(--size-xl,48rem))}:host([height=xlarge]){height:var(--box-height,var(--size-xl,48rem))}:host([max-width=xxlarge]){max-width:var(--box-max-width,var(--size-xxl,64rem))}:host([width=xxlarge]){width:var(--box-width,var(--size-xxl,64rem))}:host([max-height=xxlarge]){max-height:var(--box-max-height,var(--size-xxl,64rem))}:host([height=xxlarge]){height:var(--box-height,var(--size-xxl,64rem))}:host([wrap=true]){flex-wrap:wrap}:host([wrap=reverse]){flex-wrap:wrap-reverse}')}`]}render(){return I`<slot></slot>`}connectedCallback(){this.ripple&&(this.addEventListener("mousedown",this.showRipple.bind(this),{passive:!0}),this.addEventListener("mouseup",this.hideRipple.bind(this),{passive:!0})),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("mousedown",this.showRipple),this.addEventListener("mouseup",this.hideRipple),super.disconnectedCallback()}updated(t){t.has("background")&&![...ct,"background","foreground"].includes(this.background)&&this.style.setProperty("background-color",this.background.toString()),t.has("color")&&![...ct,"background","foreground"].includes(this.color)&&this.style.setProperty("color",this.color.toString()),super.updated(t)}showRipple(t){const e=t.clientX,r=t.clientY,{offsetWidth:i,offsetHeight:o}=this,a=document.createElement("span");a.classList.add("ripple","open");const n=document.createElement("span");a.appendChild(n),this.shadowRoot.appendChild(a);const s=this.getBoundingClientRect(),l=2*Math.max(i,i);n.style.width=n.style.height=l+"px",n.style.left=e-s.left-l/2+"px",n.style.top=r-s.top-l/2+"px";n.animate({transform:["scale(0)","scale(1)"]},{easing:"ease-out",fill:"both",duration:500}).onfinish=()=>{a.classList.remove("open");n.animate({opacity:["0.5","0"]},{easing:"ease-in",fill:"both",duration:300}).onfinish=()=>{requestAnimationFrame((()=>{a.remove()}))}}}hideRipple(t){this.shadowRoot?.querySelectorAll(".ripple:not([open])").forEach((t=>{t.querySelector("span").animate({opacity:["0.5","0"]},{easing:"ease-out",fill:"both",duration:300}).onfinish=()=>{requestAnimationFrame((()=>{t.remove()}))}}))}},e([ot({type:Boolean}),r("design:type",Boolean)],t.TkBox.prototype,"ripple",void 0),e([ot(),r("design:type",Object)],t.TkBox.prototype,"background",void 0),e([ot(),r("design:type",Object)],t.TkBox.prototype,"color",void 0),t.TkBox=e([rt("tk-box")],t.TkBox);class vt extends t.TkBox{constructor(){super(...arguments),
|
|
117
116
|
/**
|
|
118
117
|
* Element random id
|
|
119
118
|
*/
|
|
120
|
-
this._id=
|
|
119
|
+
this._id=pt(),
|
|
121
120
|
/**
|
|
122
121
|
* disabled atribute
|
|
123
122
|
*/
|
|
124
|
-
this.disabled=!1}updated(t){this.tabIndex=this.disabled?-1:0,super.updated(t)}}e([ot({type:Boolean}),r("design:type",String)],
|
|
123
|
+
this.disabled=!1}updated(t){this.tabIndex=this.disabled?-1:0,super.updated(t)}}e([ot({type:Boolean}),r("design:type",String)],vt.prototype,"_id",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],vt.prototype,"disabled",void 0);t.TkAccordion=class extends vt{constructor(){super(...arguments),this.checked=!1,this.rippleHeader=!1}static get styles(){return[...t.TkBox.styles,l`${s('@charset "UTF-8";*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host .header{border:1px solid var(--shade-lighter);border-radius:10px;color:var(--primary);cursor:pointer;padding:.6em}:host .header>*{margin:0 10px}:host .header:after{content:"▼";display:inline-block;font-size:12px;transition:transform .3s}:host .header .before{width:fit-content}:host .header .header-content{flex:1}:host .content{height:0;margin:0 auto;opacity:0;transition:all .2s;visibility:hidden;width:95%}:host h3,:host h5{margin:0}:host([checked]) .header{background-color:var(--primary);color:var(--on-primary)}:host([checked]) .header:after{transform:rotate(180deg)}:host([checked]) .content{height:auto;opacity:1;transition:all .3s,opacity .7s;visibility:visible}:host([pill]) .header{border-radius:9999px}')}`]}render(){return I`<tk-box margin="small"><tk-box @click="${this.handleClick.bind(this)}" ?ripple="${this.rippleHeader}" class="header" direction="row" align-items="center"><tk-box class="before"><slot name="before"></slot></tk-box><tk-box class="header-content"><h3 class="title"><slot name="title"></slot></h3><h5><slot name="description"></slot></h5></tk-box></tk-box><tk-box class="content"><slot></slot></tk-box></tk-box><input id="${this.id}" slot="none" style="display:none" type="radio" ?checked="${this.checked}" ?disabled="${this.disabled}" name="${dt(this.name)}" aria-hidden="true" tabindex="-1">`}firstUpdated(){this.appendChild(this.$input)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}handleClick(){this.checked=!this.checked,this.checked&&this.name&&this.getRootNode().querySelectorAll(`tk-accordion[name="${this.name}"]`).forEach((t=>t!=this?t.checked=!1:null)),this.dispatchEvent(new Event("change"))}},e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkAccordion.prototype,"name",void 0),e([ot({attribute:!0,type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkAccordion.prototype,"checked",void 0),e([ot({attribute:"ripple-header",type:Boolean}),r("design:type",Boolean)],t.TkAccordion.prototype,"rippleHeader",void 0),e([lt("input"),r("design:type",HTMLInputElement)],t.TkAccordion.prototype,"$input",void 0),t.TkAccordion=e([rt("tk-accordion")],t.TkAccordion);
|
|
125
124
|
/**
|
|
126
125
|
* A badge WebComponent
|
|
127
126
|
* @cssprop --tk-badge-color - Color of widget default to --primary
|
|
128
127
|
* @cssprop --tk-badge-text-color - Text color of widget to --on-primary
|
|
129
128
|
*/
|
|
130
|
-
t.TkBadge=class extends t.TkBox{static get styles(){return[...t.TkBox.styles,l`${
|
|
129
|
+
t.TkBadge=class extends t.TkBox{static get styles(){return[...t.TkBox.styles,l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--tk-badge-color,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--text:var(--tk-badge-text-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));align-items:center;background-color:var(--color);border-radius:9999px;color:var(--text);cursor:inherit;display:inline-flex;height:1.375em;justify-content:center;padding:0 .5em;user-select:none;white-space:nowrap}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)));--text:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)))}")}`]}},t.TkBadge=e([rt("tk-badge")],t.TkBadge);
|
|
131
130
|
/**
|
|
132
131
|
* A button web component
|
|
133
132
|
*
|
|
@@ -143,19 +142,339 @@ t.TkBadge=class extends t.TkBox{static get styles(){return[...t.TkBox.styles,l`$
|
|
|
143
142
|
* @attr {Boolean} ripple - display ripple when active
|
|
144
143
|
* @attr {Boolean} small - mini button
|
|
145
144
|
*/
|
|
146
|
-
t.TkButton=class extends t.TkBox{constructor(){super(...arguments),this.href=null,this.type="button",this.disabled=!1}static get styles(){return[...t.TkBox.styles,l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--color-darker:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background-color:var(--color);border:1px solid var(--color);border-radius:var(--border-radius-medium,.25rem);box-sizing:border-box;color:var(--text);cursor:pointer;display:inline-flex;flex-direction:row;font-family:Roboto,sans-serif;height:2.5em;justify-content:center;letter-spacing:.8px;line-height:2.5em;padding:0 var(--spacing-m,1rem);position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;user-select:none;vertical-align:middle;white-space:nowrap}:host .content{align-items:center;display:flex;pointer-events:none}:host .before{align-items:center;display:flex}:host .before ::slotted(*){margin-right:var(--spacing-s,.5rem)}:host .after{align-items:center;display:flex}:host .after ::slotted(*){margin-left:var(--spacing-s,.5rem)}:host .badge-out{display:flex;pointer-events:none;position:absolute;right:-.8em;top:-.7em}:host .badge-in{display:flex;pointer-events:none;position:absolute;right:2px;top:2px}:host(:focus){outline:none}:host(:focus),:host(:hover){--color:var(--primary-light,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*1.15)))}:host(:active){--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]:focus),:host([inverted]:hover){--color:#0000001a}:host([inverted]:active){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)))}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)));--color-darker:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent]:focus),:host([accent]:hover){--color:var(--accent-light,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),calc(var(--accent-l, 72.7451%)*1.15)))}:host([accent]:active){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)));--text:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]:focus),:host([accent][inverted]:hover){--color:#0000001a}:host([accent][inverted]:active){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)))}:host([outlined]){background:var(--background,#f7f7f7) radial-gradient(circle,#0000 1%,var(--background,#f7f7f7) 1%) center/15000%;color:var(--color)}:host([pill]){border-radius:var(--border-radius-pill,9999px)}:host([small]){font-size:.8em;height:28px;line-height:.9em;padding:0 var(--spacing-s,.5rem)}:host([small]) .before ::slotted(*){margin-right:var(--spacing-xs,.25rem)}:host([small]) .after ::slotted(*){margin-left:var(--spacing-xs,.25rem)}:host([fab]){align-items:center;border-radius:50%;box-shadow:var(--elevation-1,0 1px 2px var(--shadow));height:40px;justify-content:center;line-height:normal;overflow:hidden;padding:0;width:40px}:host([fab]):hover{box-shadow:var(--elevation-3,0 4px 8px var(--shadow))}:host([fab][small]){font-size:.75em;height:30px;width:30px}:host([flat]){box-shadow:none}:host([flat]):hover{box-shadow:none}:host([disabled]),:host([disabled][accent]){--text:var(--button-color-disabled,var(--shade-lighter));--color:var(--button-bg-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));box-shadow:none;cursor:default;pointer-events:none}")}`]}render(){return H`<div class="before"><slot name="before"></slot></div><div class="content"><slot></slot></div><div class="after"><slot name="after"></slot></div><div class="badge-in"><slot name="badge-in"></slot></div><div class="badge-out"><slot name="badge-out"></slot></div>${this.href?H`<a hidden id="ahref" href="${this.href}" target="${ht(this.target)}" rel="noreferrer"></a>`:""} <button id="${ct()}" hidden type="${ht(this.type)}"></button>`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}updated(t){this.tabIndex=this.disabled?-1:0,super.updated(t)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}firstUpdated(){"submit"!=this.type&&"reset"!=this.type||this.appendChild(this.$button)}handleClick(t){this.querySelector("button")&&t.target==this.querySelector("button")||this.$ahref&&t.target==this.$ahref||(this.href?this.$ahref.click():"submit"!=this.type&&"reset"!=this.type||this.querySelector("button")?.dispatchEvent(new MouseEvent("click",{relatedTarget:this,composed:!0,bubbles:!0})))}},e([ot(),r("design:type",Object)],t.TkButton.prototype,"href",void 0),e([ot(),r("design:type",String)],t.TkButton.prototype,"target",void 0),e([ot(),r("design:type",String)],t.TkButton.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkButton.prototype,"disabled",void 0),e([nt("#ahref"),r("design:type",HTMLAnchorElement)],t.TkButton.prototype,"$ahref",void 0),e([nt("button"),r("design:type",HTMLButtonElement)],t.TkButton.prototype,"$button",void 0),t.TkButton=e([rt("tk-button")],t.TkButton);t.TkCheckbox=class extends tt{constructor(){super(...arguments),this.checked=!1}render(){return H`<tk-box direction="row" align-items="center"><div tabindex="0" class="checkbox"><svg id="checkmark" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none" viewBox="0 0 24 24"><path id="checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path><line id="indeterminate-path" fill="none" x1="0" y1="12.5" x2="24" y2="12.5"/></svg></div><span class="label"><slot></slot></span></tk-box><input id="${ct()}" slot="none" style="display:none" ?checked="${this.checked}" type="checkbox" name="${ht(this.name)}" value="${ht(this.value)}" aria-hidden="true" tabindex="-1">`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}firstUpdated(){this.appendChild(this.$input)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}handleClick(){this.checked=!this.checked,setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkCheckbox.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_checkbox-bg:var(--checkbox-bg,#0000);--_checkbox-color:var(--checkbox-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .checkbox{align-items:center;background:var(--_checkbox-bg);border:var(--checkbox-border-config,.125rem solid) currentColor;border-radius:var(--checkbox-border-radius,.375rem);color:var(--_checkbox-color);display:inline-flex;height:var(--checkbox-size,1.25rem);justify-content:center;margin:0 5px;min-width:var(--checkbox-size,1.25rem);outline:none;position:relative;transition:var(--checkbox-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--checkbox-size,1.25rem)}:host .label{font-size:1.1em}:host(:not([disabled])){cursor:pointer}:host([checked]),:host([indeterminate]){--_checkbox-bg:var(--checkbox-bg-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--_checkbox-color:var(--checkbox-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}:host([disabled]){--_checkbox-bg:var(--checkbox-bg-disabled,#0000);--_checkbox-color:var(--checkbox-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));pointer-events:none}:host([disabled][checked]),:host([disabled][indeterminate]){--_checkbox-bg:var(--checkbox-bg-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_checkbox-color:var(--checkbox-color-disabled-checked,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}#checkmark{height:var(--checkbox-checkmark-size,.75rem);width:var(--checkbox-checkmark-size,.75rem)}#checkmark-path,#indeterminate-path{stroke-width:var(--checkbox-checkmark-path-width,.3rem);stroke:var(--checkbox-checkmark-stroke-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));stroke-dasharray:var(--checkbox-checkmark-path-dasharray,30);stroke-dashoffset:var(--checkbox-checkmark-path-dasharray,30);transition:var(--checkbox-checkmark-transition,stroke-dashoffset var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)))}#checkmark-path{transition-delay:var(--checkbox-checkmark-path-delay,50ms)}#ripple{transform:var(--checkbox-ripple-transform,translate(-50%,-50%) scale(1.8))}")}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkCheckbox.prototype,"name",void 0),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkCheckbox.prototype,"value",void 0),e([ot({attribute:!0,type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkCheckbox.prototype,"checked",void 0),e([nt("input"),r("design:type",HTMLInputElement)],t.TkCheckbox.prototype,"$input",void 0),t.TkCheckbox=e([rt("tk-checkbox")],t.TkCheckbox);t.TkDialog=class extends tt{constructor(){super(...arguments),this.modal=!1,this.open=!1,this.blurOverlay=!1}render(){return H`${this.open?H`<div class="overlay ${this.blurOverlay?"blur":""}" @click="${()=>this.modal?null:this.hide()}"></div><div class="container"><slot></slot></div>`:""}`}updated(t){t.has("open")&&this.open&&this.dispatchEvent(new Event("did-show")),t.has("open")&&!this.open&&this.dispatchEvent(new Event("did-close"))}show(){return this.open=!0,new Promise((t=>{this.resolve=t}))}hide(t=null){this.open=!1,this.resolve(t)}},t.TkDialog.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:none;outline:none;position:relative}:host([open]){align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:var(--dialog-z-index,300)}:host([open]) .overlay{background-color:#00000080;bottom:0;left:0;position:absolute;right:0;top:0}:host([open]) .overlay.blur{backdrop-filter:blur(2px)}:host([open]) .container{animation:fade-in .3s forwards;border-radius:var(--border-radius-medium,.25rem);height:100%;margin:0;max-width:100%;overflow-y:auto;overscroll-behavior:contain;padding:1rem;position:fixed;width:fit-content;will-change:transform,opacity}@keyframes fade-in{0%{opacity:0}to{opacity:1}}")}`,e([ot({type:Boolean,attribute:!0}),r("design:type",Boolean)],t.TkDialog.prototype,"modal",void 0),e([ot({type:Boolean,attribute:!0,reflect:!0}),r("design:type",Boolean)],t.TkDialog.prototype,"open",void 0),e([ot({type:Boolean,attribute:"blur-overlay"}),r("design:type",Boolean)],t.TkDialog.prototype,"blurOverlay",void 0),t.TkDialog=e([rt("tk-dialog")],t.TkDialog);t.TkDrawer=class extends tt{constructor(){super(...arguments),this.open=!1,this.over=!1,this.left=!1}render(){return H`<div class="container"><slot name="drawer-container"></slot></div><div class="overlay" @click="${()=>this.open=!1}"></div><div class="drawer"><div class="drawer-header"><slot name="drawer-header"></slot></div><div class="drawer-content"><slot name="drawer-content"></slot></div><div class="drawer-footer"><slot name="drawer-footer"></slot></div></div>`}updated(t){t.has("open")&&this.open&&this.dispatchEvent(new Event("did-show")),t.has("open")&&!this.open&&this.dispatchEvent(new Event("did-close")),t.has("overQuery")&&this.overMediaQuery(),t.has("openQuery")&&window.matchMedia(this.openQuery).matches&&this.show()}overMediaQuery(){this.mql&&this.mql.removeEventListener("change",this.overMediaQueryListener.bind(this)),this.mql=window.matchMedia(this.overQuery),this.mql.matches?this.setAttribute("over",""):this.removeAttribute("over"),this.mql.addEventListener("change",this.overMediaQueryListener.bind(this))}overMediaQueryListener(t){t.matches?this.setAttribute("over",""):this.removeAttribute("over")}hideIfOver(){(this.overQuery&&this.mql?.matches||this.over)&&(this.open=!1)}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}},t.TkDrawer.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--drawer-width:256px;display:block;height:100%;overflow:hidden;position:relative;width:100%}.drawer{background-color:var(--background,#f7f7f7);color:var(--foreground,#454545);display:flex;flex-direction:column;height:100%;overflow:scroll;position:absolute;top:0;transform:translateX(-100%);transition:transform cubic-bezier(.4,0,.2,1) var(--transition-duration-medium,.18s);width:var(--drawer-width);will-change:transform;z-index:var(--drawer-z-index,200)}.drawer .drawer-content{flex:1;overflow:scroll}:host([left]) .drawer{right:0;transform:translateX(100%)}.overlay{background-color:#00000080;bottom:0;display:none;left:0;position:absolute;right:0;top:0;z-index:var(--drawer-overlay-z-index,200)}.container{background-color:var(--background,#f7f7f7);height:100%;overflow:scroll;transition:padding cubic-bezier(.4,0,.2,1) var(--transition-duration-slow,.25s)}:host([open]) .drawer{transform:none}:host([open]) .container{padding-left:var(--drawer-width)}:host([open][over]) .container{padding-left:0}:host([open][over]) .overlay{display:block}@media (max-width:var(--drawer-trigger-width,400px)){:host([open]) .container{padding-left:0}:host([open]) .overlay{display:block}}")}`,e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"open",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"over",void 0),e([ot({type:String,attribute:"open-query"}),r("design:type",String)],t.TkDrawer.prototype,"openQuery",void 0),e([ot({type:String,attribute:"over-query"}),r("design:type",String)],t.TkDrawer.prototype,"overQuery",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"left",void 0),t.TkDrawer=e([rt("tk-drawer")],t.TkDrawer);
|
|
145
|
+
t.TkButton=class extends t.TkBox{constructor(){super(...arguments),this.href=null,this.type="button",this.disabled=!1}static get styles(){return[...t.TkBox.styles,l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--color-darker:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background-color:var(--color);border:1px solid var(--color);border-radius:var(--border-radius-medium,.25rem);box-sizing:border-box;color:var(--text);cursor:pointer;display:inline-flex;flex-direction:row;font-family:Roboto,sans-serif;height:2.5em;justify-content:center;letter-spacing:.8px;line-height:2.5em;padding:0 var(--spacing-m,1rem);position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;user-select:none;vertical-align:middle;white-space:nowrap}:host .content{align-items:center;display:flex;pointer-events:none}:host .before{align-items:center;display:flex}:host .before ::slotted(*){margin-right:var(--spacing-s,.5rem)}:host .after{align-items:center;display:flex}:host .after ::slotted(*){margin-left:var(--spacing-s,.5rem)}:host .badge-out{display:flex;pointer-events:none;position:absolute;right:-.8em;top:-.7em}:host .badge-in{display:flex;pointer-events:none;position:absolute;right:2px;top:2px}:host(:focus){outline:none}:host(:focus),:host(:hover){--color:var(--primary-light,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*1.15)))}:host(:active){--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([inverted]:focus),:host([inverted]:hover){--color:#0000001a}:host([inverted]:active){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)))}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)));--color-darker:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent]:focus),:host([accent]:hover){--color:var(--accent-light,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),calc(var(--accent-l, 72.7451%)*1.15)))}:host([accent]:active){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)));--text:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}:host([accent][inverted]:focus),:host([accent][inverted]:hover){--color:#0000001a}:host([accent][inverted]:active){--color:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)))}:host([outlined]){background:var(--background,#f7f7f7) radial-gradient(circle,#0000 1%,var(--background,#f7f7f7) 1%) center/15000%;color:var(--color)}:host([pill]){border-radius:var(--border-radius-pill,9999px)}:host([small]){font-size:.8em;height:28px;line-height:.9em;padding:0 var(--spacing-s,.5rem)}:host([small]) .before ::slotted(*){margin-right:var(--spacing-xs,.25rem)}:host([small]) .after ::slotted(*){margin-left:var(--spacing-xs,.25rem)}:host([fab]){align-items:center;border-radius:50%;box-shadow:var(--elevation-1,0 1px 2px var(--shadow));height:40px;justify-content:center;line-height:normal;overflow:hidden;padding:0;width:40px}:host([fab]):hover{box-shadow:var(--elevation-3,0 4px 8px var(--shadow))}:host([fab][small]){font-size:.75em;height:30px;width:30px}:host([flat]){box-shadow:none}:host([flat]):hover{box-shadow:none}:host([disabled]),:host([disabled][accent]){--text:var(--button-color-disabled,var(--shade-lighter));--color:var(--button-bg-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));box-shadow:none;cursor:default;pointer-events:none}")}`]}render(){return I`<div class="before"><slot name="before"></slot></div><div class="content"><slot></slot></div><div class="after"><slot name="after"></slot></div><div class="badge-in"><slot name="badge-in"></slot></div><div class="badge-out"><slot name="badge-out"></slot></div>${this.href?I`<a hidden id="ahref" href="${this.href}" target="${dt(this.target)}" rel="noreferrer"></a>`:""} <button id="${pt()}" hidden type="${dt(this.type)}"></button>`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}updated(t){this.tabIndex=this.disabled?-1:0,super.updated(t)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}firstUpdated(){"submit"!=this.type&&"reset"!=this.type||this.appendChild(this.$button)}handleClick(t){this.querySelector("button")&&t.target==this.querySelector("button")||this.$ahref&&t.target==this.$ahref||(this.href?this.$ahref.click():"submit"!=this.type&&"reset"!=this.type||this.querySelector("button")?.dispatchEvent(new MouseEvent("click",{relatedTarget:this,composed:!0,bubbles:!0})))}},e([ot(),r("design:type",Object)],t.TkButton.prototype,"href",void 0),e([ot(),r("design:type",String)],t.TkButton.prototype,"target",void 0),e([ot(),r("design:type",String)],t.TkButton.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkButton.prototype,"disabled",void 0),e([lt("#ahref"),r("design:type",HTMLAnchorElement)],t.TkButton.prototype,"$ahref",void 0),e([lt("button"),r("design:type",HTMLButtonElement)],t.TkButton.prototype,"$button",void 0),t.TkButton=e([rt("tk-button")],t.TkButton);t.TkCheckbox=class extends tt{constructor(){super(...arguments),this.checked=!1}render(){return I`<tk-box direction="row" align-items="center"><div tabindex="0" class="checkbox"><svg id="checkmark" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none" viewBox="0 0 24 24"><path id="checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path><line id="indeterminate-path" fill="none" x1="0" y1="12.5" x2="24" y2="12.5"/></svg></div><span class="label"><slot></slot></span></tk-box><input id="${pt()}" slot="none" style="display:none" ?checked="${this.checked}" type="checkbox" name="${dt(this.name)}" value="${dt(this.value)}" aria-hidden="true" tabindex="-1">`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}firstUpdated(){this.appendChild(this.$input)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}handleClick(){this.checked=!this.checked,setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkCheckbox.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_checkbox-bg:var(--checkbox-bg,#0000);--_checkbox-color:var(--checkbox-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .checkbox{align-items:center;background:var(--_checkbox-bg);border:var(--checkbox-border-config,.125rem solid) currentColor;border-radius:var(--checkbox-border-radius,.375rem);color:var(--_checkbox-color);display:inline-flex;height:var(--checkbox-size,1.25rem);justify-content:center;margin:0 5px;min-width:var(--checkbox-size,1.25rem);outline:none;position:relative;transition:var(--checkbox-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--checkbox-size,1.25rem)}:host .label{font-size:1.1em}:host(:not([disabled])){cursor:pointer}:host([checked]),:host([indeterminate]){--_checkbox-bg:var(--checkbox-bg-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--_checkbox-color:var(--checkbox-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}:host([disabled]){--_checkbox-bg:var(--checkbox-bg-disabled,#0000);--_checkbox-color:var(--checkbox-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));pointer-events:none}:host([disabled][checked]),:host([disabled][indeterminate]){--_checkbox-bg:var(--checkbox-bg-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_checkbox-color:var(--checkbox-color-disabled-checked,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}#checkmark{height:var(--checkbox-checkmark-size,.75rem);width:var(--checkbox-checkmark-size,.75rem)}#checkmark-path,#indeterminate-path{stroke-width:var(--checkbox-checkmark-path-width,.3rem);stroke:var(--checkbox-checkmark-stroke-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));stroke-dasharray:var(--checkbox-checkmark-path-dasharray,30);stroke-dashoffset:var(--checkbox-checkmark-path-dasharray,30);transition:var(--checkbox-checkmark-transition,stroke-dashoffset var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)))}#checkmark-path{transition-delay:var(--checkbox-checkmark-path-delay,50ms)}#ripple{transform:var(--checkbox-ripple-transform,translate(-50%,-50%) scale(1.8))}")}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkCheckbox.prototype,"name",void 0),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkCheckbox.prototype,"value",void 0),e([ot({attribute:!0,type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkCheckbox.prototype,"checked",void 0),e([lt("input"),r("design:type",HTMLInputElement)],t.TkCheckbox.prototype,"$input",void 0),t.TkCheckbox=e([rt("tk-checkbox")],t.TkCheckbox);t.TkDialog=class extends tt{constructor(){super(...arguments),this.modal=!1,this.open=!1,this.blurOverlay=!1}render(){return I`${this.open?I`<div class="overlay ${this.blurOverlay?"blur":""}" @click="${()=>this.modal?null:this.hide()}"></div><div class="container"><slot></slot></div>`:""}`}updated(t){t.has("open")&&this.open&&this.dispatchEvent(new Event("did-show")),t.has("open")&&!this.open&&this.dispatchEvent(new Event("did-close"))}show(){return this.open=!0,new Promise((t=>{this.resolve=t}))}hide(t=null){this.open=!1,this.resolve(t)}},t.TkDialog.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:none;outline:none;position:relative}:host([open]){align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:var(--dialog-z-index,300)}:host([open]) .overlay{background-color:#00000080;bottom:0;left:0;position:absolute;right:0;top:0}:host([open]) .overlay.blur{backdrop-filter:blur(2px)}:host([open]) .container{animation:fade-in .3s forwards;border-radius:var(--border-radius-medium,.25rem);height:100%;margin:0;max-width:100%;overflow-y:auto;overscroll-behavior:contain;padding:1rem;position:fixed;width:fit-content;will-change:transform,opacity}@keyframes fade-in{0%{opacity:0}to{opacity:1}}")}`,e([ot({type:Boolean,attribute:!0}),r("design:type",Boolean)],t.TkDialog.prototype,"modal",void 0),e([ot({type:Boolean,attribute:!0,reflect:!0}),r("design:type",Boolean)],t.TkDialog.prototype,"open",void 0),e([ot({type:Boolean,attribute:"blur-overlay"}),r("design:type",Boolean)],t.TkDialog.prototype,"blurOverlay",void 0),t.TkDialog=e([rt("tk-dialog")],t.TkDialog);const ut="left",gt="right",mt="down",bt=[ut,gt],yt=[ut,gt,"up",mt],ft="possible",kt="blocked";
|
|
146
|
+
/*
|
|
147
|
+
* contact-js uses pointer events, which combine touch and mouse events (and more)
|
|
148
|
+
* for readability, "touch" is used in comments
|
|
149
|
+
*/
|
|
150
|
+
/*
|
|
151
|
+
* At the time the user touches the surface it is not known which gesture he will perform. He can also add or remove touches.
|
|
152
|
+
* The contact phenomenon starts when the user initially touches the surface, and ends when no more touches are present.
|
|
153
|
+
* During the contact phenonmenon between human being and artificial surface, different gestures can be detected.
|
|
154
|
+
* According to the gesture definitions, a gesture can be possible or impossible at a given time. When a gesture has been rendered impossible, it can not become possible during the current contact phenomenon.
|
|
155
|
+
*/
|
|
156
|
+
/*
|
|
157
|
+
* The Contact Prototype represents the contact phenomenon. It starts with the first pointerdown event and ends when the last pointer has become inactive (pointerup event).
|
|
158
|
+
* Therefore, the first pointerdownEvent is the point in time where Contact becomes alive. It dies with the last pointerup event
|
|
159
|
+
* Contact collects data of the interaction with the surface, but does not decide if a gesture has been detected.
|
|
160
|
+
*/
|
|
161
|
+
class xt{constructor(t,e){e=e||{},this.options={DEBUG:!1};for(let t in e)this.options[t]=e[t];this.DEBUG=this.options.DEBUG,this.id=(new Date).getTime(),
|
|
162
|
+
// a map of all active PointerInput instances
|
|
163
|
+
this.pointerInputs={},this.activePointerInputs={},this.primaryPointerId=t.pointerId,
|
|
164
|
+
// initialPointerEvent holds the correct event.target for bubbling if pointerListener is bound to a "ancestor element"
|
|
165
|
+
this.initialPointerEvent=t,this.currentPointerEvent=t,this.addPointer(t),this.isActive=!0,
|
|
166
|
+
// global timings
|
|
167
|
+
this.startTimestamp=t.timeStamp,this.currentTimestamp=this.startTimestamp,this.endTimestamp=null,
|
|
168
|
+
// multipointer parameters
|
|
169
|
+
this.multipointer={liveParameters:{centerMovement:null,centerMovementVector:null,distanceChange:null,// px
|
|
170
|
+
relativeDistanceChange:null,// %
|
|
171
|
+
rotationAngle:null,//deg ccw[0,360], cw[0,-360]
|
|
172
|
+
vectorAngle:null},globalParameters:{centerMovement:null,centerMovementVector:null,distanceChange:null,relativeDistanceChange:null,rotationAngle:null,vectorAngle:null}}}
|
|
173
|
+
// add more pointers
|
|
174
|
+
addPointer(t){this.currentPointerEvent=t;var e={DEBUG:this.DEBUG},r=new wt(t,e);this.pointerInputs[t.pointerId]=r,this.activePointerInputs[t.pointerId]=r}removePointer(t){delete this.activePointerInputs[t]}
|
|
175
|
+
// return a specific pointer input by its identifier
|
|
176
|
+
getPointerInput(t){if(Object.prototype.hasOwnProperty.call(this.pointers,t)){return this.pointers[t]}throw new Error("invalid pointerId: "+t+". Pointer not found in Contact.pointers")}
|
|
177
|
+
// return the pointer input which started this specific contact phenomenon
|
|
178
|
+
getPrimaryPointerInput(){return this.pointerInputs[this.primaryPointerId]}
|
|
179
|
+
// currently, on 2 Inputs are supported
|
|
180
|
+
getMultiPointerInputs(){var t=Object.keys(this.activePointerInputs)[0],e=this.activePointerInputs[t],r=Object.keys(this.activePointerInputs)[1];return[e,this.activePointerInputs[r]]}
|
|
181
|
+
// pointermove contains only one single pointer, not multiple like on touch events (touches, changedTouches,...)
|
|
182
|
+
onPointerMove(t){this.currentPointerEvent=t,this.currentTimestamp=t.timeStamp,this.pointerInputs[t.pointerId].onMove(t),!0===this.DEBUG&&console.log(this.pointerInputs),this.updateState()}
|
|
183
|
+
// pointerup event: finger released, or mouse button released
|
|
184
|
+
onPointerUp(t){var e=t.pointerId;this.currentPointerEvent=t,this.currentTimestamp=t.timeStamp,this.pointerInputs[e].onUp(t),this.removePointer(e),this.updateState()}onPointerCancel(t){this.onPointerUp(t),1==this.DEBUG&&console.log("[Contact] pointercancel detected")}
|
|
185
|
+
// also covers pointerleave
|
|
186
|
+
// not necessary - using element.setPointerCapture and element.releasePointerCapture instead
|
|
187
|
+
onPointerLeave(t){this.onPointerUp(t),1==this.DEBUG&&console.log("[Contact] pointerleave detected")}
|
|
188
|
+
// if the contact idles (no Momvement), the time still passes
|
|
189
|
+
// therefore, the pointerInput has to be updated
|
|
190
|
+
onIdle(){for(let t in this.activePointerInputs){this.activePointerInputs[t].onIdle()}}
|
|
191
|
+
// update this contact instance. invoked on pointermove, pointerup and pointercancel events
|
|
192
|
+
updateState(){var t=!1;Object.keys(this.activePointerInputs).length>0&&(t=!0),this.isActive=t,0==this.isActive?this.endTimestamp=this.currentTimestamp:Object.keys(this.activePointerInputs).length>=2&&this.updateMultipointerParameters()}
|
|
193
|
+
// functions for multi pointer gestures, currently only 2 pointers are supported
|
|
194
|
+
updateMultipointerParameters(){var t=this.getMultiPointerInputs(),e=t[0],r=t[1],i=e.liveParameters.vector,o=r.liveParameters.vector;if(null!=i&&null!=o){var a=Pt(i.startPoint,o.startPoint);this.multipointer.liveParameters.center=a;var n=this.calculateCenterMovement(i,o);this.multipointer.liveParameters.centerMovementVector=n,this.multipointer.liveParameters.centerMovement=n.vectorLength;var s=this.calculateDistanceChange(i,o);this.multipointer.liveParameters.distanceChange=s.absolute,this.multipointer.liveParameters.relativeDistanceChange=s.relative;
|
|
195
|
+
// calculate rotation angle. imagine the user turning a wheel with 2 fingers
|
|
196
|
+
var l=this.calculateRotationAngle(i,o);this.multipointer.liveParameters.rotationAngle=l;
|
|
197
|
+
// calculate the simple vectorAngle for determining if the fingers moved into the same direction
|
|
198
|
+
var h=this.calculateVectorAngle(i,o);this.multipointer.liveParameters.vectorAngle=h}
|
|
199
|
+
// global distance change and rotation
|
|
200
|
+
var d=e.globalParameters.vector,c=r.globalParameters.vector;if(null!=d&&null!=c){var p=Pt(d.startPoint,c.startPoint);this.multipointer.globalParameters.center=p;var v=this.calculateCenterMovement(d,c);this.multipointer.globalParameters.centerMovementVector=v,this.multipointer.globalParameters.centerMovement=v.vectorLength;var u=this.calculateDistanceChange(d,c);this.multipointer.globalParameters.distanceChange=u.absolute,this.multipointer.globalParameters.relativeDistanceChange=u.relative;var g=this.calculateRotationAngle(d,c);this.multipointer.globalParameters.rotationAngle=g;var m=this.calculateVectorAngle(d,c);this.multipointer.liveParameters.vectorAngle=m}!0===this.DEBUG&&(console.log("[Contact] 2 fingers: centerMovement between pointer #"+e.pointerId+" and pointer #"+r.pointerId+" : "+this.multipointer.liveParameters.centerMovement+"px"),console.log("[Contact] 2 fingers: distanceChange: between pointer #"+e.pointerId+" and pointer #"+r.pointerId+" : "+this.multipointer.liveParameters.distanceChange+"px"),console.log("[Contact] 2 fingers live angle: "+this.multipointer.liveParameters.rotationAngle+"deg"),console.log("[Contact] 2 fingers global angle: "+this.multipointer.globalParameters.rotationAngle+"deg"))}calculateCenterMovement(t,e){
|
|
201
|
+
// start point is the center between the starting points of the 2 vectors
|
|
202
|
+
var r=Pt(t.startPoint,e.startPoint),i=Pt(t.endPoint,e.endPoint);
|
|
203
|
+
// center between the end points of the vectors
|
|
204
|
+
return new $t(r,i)}calculateDistanceChange(t,e){var r=new $t(t.startPoint,e.startPoint),i=new $t(t.endPoint,e.endPoint);return{absolute:i.vectorLength-r.vectorLength,relative:i.vectorLength/r.vectorLength}}
|
|
205
|
+
/*
|
|
206
|
+
* CALCULATE ROTATION
|
|
207
|
+
* this is not a trivial problem
|
|
208
|
+
* required output is: angle and direction (cw //ccw)
|
|
209
|
+
* direction is relative to the first touch with two fingers, not absolute to the screens default coordinate system
|
|
210
|
+
* to determine rotation direction, 3 points on the circle - with timestamps - are required
|
|
211
|
+
* imagine a steering wheel
|
|
212
|
+
* - initial state is 0 deg (0)
|
|
213
|
+
* - if the wheel has been turned ccw, its state has a negative angle
|
|
214
|
+
* - if the wheel has been turned cw, its state has a positive angle
|
|
215
|
+
* - possible values for the angle: [-360,360]
|
|
216
|
+
*/calculateRotationAngle(t,e){
|
|
217
|
+
// vector_ are vectors between 2 points in time, same finger
|
|
218
|
+
// angleAector_ are vectors between 2 fingers
|
|
219
|
+
var r=new $t(t.startPoint,e.startPoint),i=new $t(t.endPoint,e.endPoint),o=new Tt(0,0),a=new $t(r.startPoint,o),n=St(r.endPoint,a),s=new $t(i.startPoint,o),l=St(i.endPoint,s),h=-1*function(t){var e=Math.atan2(t.y,t.x);// [-PI, PI]
|
|
220
|
+
e<0&&(e=2*Math.PI+e);return e}
|
|
221
|
+
// single finger gestures
|
|
222
|
+
(n),d=l.x*Math.cos(h)-l.y*Math.sin(h),c=Math.round(l.x*Math.sin(h)+l.y*Math.cos(h));// in time: occured first
|
|
223
|
+
return 180*Math.atan2(c,d)/Math.PI}calculateVectorAngle(t,e){var r=null;if(t.vectorLength>0&&e.vectorLength>0){var i=(t.x*e.x+t.y*e.y)/(t.vectorLength*e.vectorLength);r=function(t){return t/(Math.PI/180)}(Math.acos(i))}return r}}
|
|
224
|
+
/*********************************************************************************************
|
|
225
|
+
PointerInput
|
|
226
|
+
|
|
227
|
+
- contains data about one single finger / active pointer
|
|
228
|
+
- there are "live" parameters and "global" parameters
|
|
229
|
+
- "live" parameters are caluclated using liveTimespan
|
|
230
|
+
- "global" parameters are calculated using the whole timespan of this pointerdown
|
|
231
|
+
- the current vector. The vector should be calculated "live" and not over the whole pointerdown duration. The user expects the pointer input to be in sync with his current finger movement on the screen, not with something a second ago.
|
|
232
|
+
- start and end coordinates
|
|
233
|
+
- start and end timestamps
|
|
234
|
+
- speeds and distances
|
|
235
|
+
**********************************************************************************************/class wt{constructor(t,e){e=e||{},this.options={DEBUG:!1};for(let t in e)this.options[t]=e[t];this.DEBUG=this.options.DEBUG;var r=(new Date).getTime();this.pointerId=t.pointerId;var i=Object.prototype.hasOwnProperty.call(this.options,"vectorTimespan");this.vectorTimespan=1==i?this.options.vectorTimespan:100,// milliseconds
|
|
236
|
+
// events used for vector calculation
|
|
237
|
+
this.initialPointerEvent=t,this.currentPointerEvent=t,this.recognizedEvents=[t],this.canceled=!1,this.isActive=!0;
|
|
238
|
+
// start with the NullVector to support idle
|
|
239
|
+
var o=this.getVector(t,t);
|
|
240
|
+
// parameters within this.vectorTimespan
|
|
241
|
+
this.liveParameters={vector:o,// provides the traveled distance as length
|
|
242
|
+
speed:0,// length of the vector
|
|
243
|
+
isMoving:!1},
|
|
244
|
+
// parameters that span across the whole pointerdown duration
|
|
245
|
+
this.globalParameters={startX:this.initialPointerEvent.clientX,startY:this.initialPointerEvent.clientY,vector:o,deltaX:0,deltaY:0,startTimestampUTC:r,startTimestamp:this.initialPointerEvent.timeStamp,// unfortunately, FF (linux) does not provide UTC, but elapsed time since the window Object was created
|
|
246
|
+
currentTimestamp:this.initialPointerEvent.timeStamp,endTimestamp:null,maximumSpeed:0,averageSpeed:0,finalSpeed:null,traveledDistance:0,hasBeenMoved:!1,duration:0}}
|
|
247
|
+
// do not update vector, only update time
|
|
248
|
+
onIdle(){
|
|
249
|
+
// currentTimestamp is not an UTC millisecond timestamp.
|
|
250
|
+
// this.globalParameters.currentTimestamp = now;
|
|
251
|
+
let t=(new Date).getTime()-this.globalParameters.startTimestampUTC;this.globalParameters.duration=t}onMove(t){this.globalParameters.hasBeenMoved=!0,this.liveParameters.isMoving=!0,this.update(t,!0)}onUp(t){this.globalParameters.finalSpeed=this.liveParameters.speed,this.liveParameters.currentSpeed=0,this.liveParameters.isMoving=!1,this.isActive=!1,this.globalParameters.endTimestamp=t.timeStamp,this.update(t),!0===this.DEBUG&&console.log("[Contact] pointerdown ended. pointerdown duration: "+this.globalParameters.duration+"ms")}onCancel(t){this.update(t),this.liveParameters.speed=0,this.canceled=!0,this.liveParameters.isMoving=!1,this.isActive=!1,this.globalParameters.endTimestamp=t.timeStamp,!0===this.DEBUG&&console.log("[Contact] canceled, pointerdown duration:"+this.duration)}update(t){
|
|
252
|
+
// update general parameters
|
|
253
|
+
this.currentPointerEvent=t,this.recognizedEvents.push(t);
|
|
254
|
+
// update liveParameters
|
|
255
|
+
var e=this.getTimedPointerEvents(),r=this.getVector(e[0],e[1]);if(this.liveParameters.vector=r,null!=r){this.liveParameters.speed=this.getSpeed(r,e[0].timeStamp,e[1].timeStamp),
|
|
256
|
+
// update global parameters
|
|
257
|
+
this.liveParameters.speed>this.globalParameters.maximumSpeed&&(this.globalParameters.maximumSpeed=this.liveParameters.speed),this.globalParameters.currentTimestamp=t.timeStamp,this.globalParameters.duration=t.timeStamp-this.globalParameters.startTimestamp,this.globalParameters.deltaX=r.endPoint.x-this.globalParameters.startX,this.globalParameters.deltaY=r.endPoint.y-this.globalParameters.startY;var i=this.getVector(this.initialPointerEvent,this.currentPointerEvent);this.globalParameters.vector=i,!0===this.DEBUG&&(console.log("[Contact] current speed: "+this.liveParameters.speed+"px/s"),console.log("[Contact] pointerdown duration: "+this.globalParameters.duration+"ms"),console.log("[Contact] live vector length within vectorTimespan: "+this.liveParameters.vector.vectorLength+"px"))}}
|
|
258
|
+
/*
|
|
259
|
+
* Get the two events which are necessary for vector calculation. This is based on this.vectorTimespan.
|
|
260
|
+
* vectorTimespan defines the timespan which actually defines the "live" vector
|
|
261
|
+
*/getTimedPointerEvents(){for(
|
|
262
|
+
// if the duration is lower than the vectorTimespan, startPointerEvent would be null
|
|
263
|
+
// if so, use this.initialPointerEvent as a fallback
|
|
264
|
+
var t=this.initialPointerEvent,e=this.recognizedEvents[this.recognizedEvents.length-1],r=this.recognizedEvents.length-1,i=0,o=e.timeStamp;i<this.vectorTimespan&&!((r-=1)<0);)i=o-(t=this.recognizedEvents[r]).timeStamp;var a=[t,e];return this.recognizedEvents=this.recognizedEvents.slice(-20),a}
|
|
265
|
+
// create and return a vector based on 2 PointerEvents
|
|
266
|
+
getVector(t,e){var r=null;if(null!=t&&null!=e){let i=new Tt(t.clientX,t.clientY),o=new Tt(e.clientX,e.clientY);r=new $t(i,o)}return r}
|
|
267
|
+
// update speed. speed = distance / time
|
|
268
|
+
getSpeed(t,e,r){!0===this.DEBUG&&(console.log("[PointerInput vector] "+t),console.log("[PointerInput startTimestamp] "+e),console.log("[PointerInput endTimestamp] "+r));var i=0,o=(r-e)/1e3;return null!=t&&0!=o&&(
|
|
269
|
+
// px/s
|
|
270
|
+
i=t.vectorLength/o),i}}class Tt{constructor(t,e){this.x=t,this.y=e}}class $t{
|
|
271
|
+
// vector between 2 points: START(x,y) and END(x,y)
|
|
272
|
+
constructor(t,e){this.startPoint=t,this.endPoint=e,this.direction="0",this.deltaX=this.endPoint.x-this.startPoint.x,this.deltaY=this.endPoint.y-this.startPoint.y,this.x=this.deltaX,this.y=this.deltaY,
|
|
273
|
+
// determine length
|
|
274
|
+
this.vectorLength=Math.sqrt(Math.pow(this.deltaX,2)+Math.pow(this.deltaY,2)),
|
|
275
|
+
// determine direction
|
|
276
|
+
Math.abs(this.deltaX)>Math.abs(this.deltaY)?
|
|
277
|
+
// left or right
|
|
278
|
+
this.startPoint.x<this.endPoint.x?this.direction=gt:this.direction=ut:
|
|
279
|
+
// up or down
|
|
280
|
+
this.startPoint.y<this.endPoint.y?this.direction="up":this.direction=mt}}function Pt(t,e){var r=(t.x+e.x)/2,i=(t.y+e.y)/2;return new Tt(r,i)}function St(t,e){var r=t.x+e.x,i=t.y+e.y;return new Tt(r,i)}class _t{constructor(t,e){this.domElement=t,this.isActive=!1,this.state=ft,
|
|
281
|
+
// the PointerEvent when the gesture has been recognized, used for some global calculations
|
|
282
|
+
// it is not always reasonable to use contact.pointerdownEvent, because the user could first rotate and object, and after some time perform a pinch
|
|
283
|
+
// the starting point of the pinch then is not contact.pointerdownEvent
|
|
284
|
+
this.initialPointerEvent=null,this.boolParameters={requiresPointerMove:null,requiresActivePointer:null},
|
|
285
|
+
// intervals before a gesture is detected for the first time
|
|
286
|
+
this.initialMinMaxParameters={pointerCount:[null,null],// minimum number of fingers currently on the surface
|
|
287
|
+
duration:[null,null],// ms
|
|
288
|
+
currentSpeed:[null,null],// px/s
|
|
289
|
+
averageSpeed:[null,null],// px/s
|
|
290
|
+
finalSpeed:[null,null],// px/s
|
|
291
|
+
distance:[null,null]},
|
|
292
|
+
// intervals to use if the gesture is active
|
|
293
|
+
this.activeStateMinMaxParameters={pointerCount:[null,null],// minimum number of fingers currently on the surface
|
|
294
|
+
duration:[null,null],// ms
|
|
295
|
+
currentSpeed:[null,null],// px/s
|
|
296
|
+
averageSpeed:[null,null],// px/s
|
|
297
|
+
finalSpeed:[null,null],// px/s
|
|
298
|
+
distance:[null,null]};let r={bubbles:!0,blocks:[],DEBUG:!1};this.options=e||{};for(let t in r)t in this.options||(this.options[t]=r[t]);this.DEBUG=this.options.DEBUG}validateMinMax(t,e,r){var i=t[e][0],o=t[e][1];return 1==this.DEBUG&&console.log("[Gestures] checking "+e+"[gesture.isActive: "+this.isActive.toString()+"] minValue: "+i+", maxValue: "+o+", current value: "+r),null!=i&&null!=r&&r<i?(1==this.DEBUG&&console.log("dismissing min"+this.eventBaseName+": required "+e+": "+i+", current value: "+r),!1):!(null!=o&&null!=r&&r>o)||(1==this.DEBUG&&console.log("dismissing max"+this.eventBaseName+": required "+e+": "+o+", current value: "+r),!1)}validateBool(t,e){
|
|
299
|
+
// requiresPointerMove = null -> it does not matter if the pointer has been moved
|
|
300
|
+
var r=this.boolParameters[t];return null!=r&&null!=e&&r===e||(null==r||(1==this.DEBUG&&console.log("[Gestures] dismissing "+this.eventBaseName+": "+t+" required: "+r+", actual value: "+e),!1))}getMinMaxParameters(t){var e=t.getPrimaryPointerInput();return{pointerCount:Object.keys(t.activePointerInputs).length,duration:e.globalParameters.duration,currentSpeed:e.liveParameters.speed,averageSpeed:e.globalParameters.averageSpeed,finalSpeed:e.globalParameters.finalSpeed,distance:e.liveParameters.vector.vectorLength}}getBoolParameters(t){var e=t.getPrimaryPointerInput();return{requiresPointerUp:!1===e.isActive,requiresActivePointer:!0===e.isActive,requiresPointerMove:!0===e.globalParameters.hasBeenMoved}}validate(t){if(this.state==kt)return!1;var e=t.getPrimaryPointerInput();1==this.DEBUG&&console.log("[Gestures] running recognition for "+this.eventBaseName);var r=this.getBoolParameters(t);for(let t in this.boolParameters){let e=r[t];if(0==this.validateBool(t,e))return!1;
|
|
301
|
+
//break;
|
|
302
|
+
}var i,o=this.getMinMaxParameters(t);
|
|
303
|
+
// check duration
|
|
304
|
+
i=1==this.isActive?this.activeStateMinMaxParameters:this.initialMinMaxParameters;for(let t in i){let e=o[t];if(0==this.validateMinMax(i,t,e))return!1;
|
|
305
|
+
//break;
|
|
306
|
+
}
|
|
307
|
+
// check direction
|
|
308
|
+
return!(1==Object.prototype.hasOwnProperty.call(this.options,"supportedDirections")&&this.options.supportedDirections.length>0&&-1==this.options.supportedDirections.indexOf(e.liveParameters.vector.direction))||(1==this.DEBUG&&console.log("[Gestures] dismissing "+this.eventBaseName+": supported directions: "+this.options.supportedDirections+", current direction: "+e.liveParameters.vector.direction),!1)}recognize(t){var e=this.validate(t);1==e&&0==this.isActive&&this.state==ft&&this.onStart(t),1==e&&1==this.isActive&&this.state==ft?this.emit(t):1==this.isActive&&0==e&&this.onEnd(t)}block(t){-1==this.options.blocks.indexOf(t)&&this.options.blocks.push(t)}unblock(t){-1!=this.options.blocks.indexOf(t)&&this.options.blocks.splice(this.options.blocks.indexOf(t),1)}blockGestures(){for(let t=0;t<this.options.blocks.length;t++){let e=this.options.blocks[t];0==e.isActive&&(0==this.DEBUG&&console.log("[Gesture] blocking "+e.eventBaseName),e.state=kt)}}unblockGestures(){for(let t=0;t<this.options.blocks.length;t++){this.options.blocks[t].state=ft}}getEventData(t){return{contact:t,recognizer:this}}
|
|
309
|
+
// fire events
|
|
310
|
+
emit(t,e){
|
|
311
|
+
// fire general event like "pan" , "pinch", "rotate"
|
|
312
|
+
e=e||this.eventBaseName,!0===this.DEBUG&&console.log("[Gestures] detected and firing event "+e);var r=this.getEventData(t),i={detail:r,bubbles:this.options.bubbles},o=new CustomEvent(e,i),a=t.initialPointerEvent.target;1==i.bubbles?a.dispatchEvent(o):this.domElement.dispatchEvent(o);
|
|
313
|
+
// fire direction specific events
|
|
314
|
+
var n=r.live.direction;if(1==Object.prototype.hasOwnProperty.call(this.options,"supportedDirections"))for(let t=0;t<this.options.supportedDirections.length;t++){let r=this.options.supportedDirections[t];if(r==n){let t=e+r;1==this.DEBUG&&console.log("[Gestures] detected and firing event "+t);let o=new CustomEvent(t,i);1==i.bubbles?a.dispatchEvent(o):this.domElement.dispatchEvent(o)}}}onStart(t){this.blockGestures(),this.isActive=!0,this.initialPointerEvent=t.currentPointerEvent;var e=this.eventBaseName+"start";!0===this.DEBUG&&console.log("[Gestures] firing event: "+e);
|
|
315
|
+
// fire gestureend event
|
|
316
|
+
var r=this.getEventData(t),i=new CustomEvent(e,{detail:r});this.domElement.dispatchEvent(i)}onEnd(t){this.unblockGestures(),this.isActive=!1;var e=this.eventBaseName+"end";!0===this.DEBUG&&console.log("[Gestures] firing event: "+e);
|
|
317
|
+
// fire gestureend event
|
|
318
|
+
let r=this.getEventData(t);var i=new CustomEvent(e,{detail:r});this.domElement.dispatchEvent(i)}
|
|
319
|
+
// provide the ability to react (eg block) to touch events
|
|
320
|
+
onTouchStart(){}onTouchMove(){}onTouchEnd(){}onTouchCancel(){}}class Et extends _t{constructor(t,e){super(t,e=e||{})}getEventData(t){
|
|
321
|
+
// provide short-cuts to the values collected in the Contact object
|
|
322
|
+
// match this to the event used by hammer.js
|
|
323
|
+
var e=super.getEventData(t),r=t.getPrimaryPointerInput(),i=new Tt(this.initialPointerEvent.clientX,this.initialPointerEvent.clientY),o=new Tt(t.currentPointerEvent.clientX,t.currentPointerEvent.clientY),a=new $t(i,o),n=t.currentPointerEvent.timeStamp-this.initialPointerEvent.timeStamp;
|
|
324
|
+
// this should be optimized in the future, not using primaryPointerInput, but something like currentPointerInput
|
|
325
|
+
// global: global for this recognizer, not the Contact object
|
|
326
|
+
return e.global={deltaX:a.x,deltaY:a.y,distance:a.vectorLength,speedX:a.x/n,speedY:a.y/n,speed:a.vectorLength/n,direction:a.direction,scale:1,rotation:0,srcEvent:t.currentPointerEvent},e.live={deltaX:r.liveParameters.vector.x,deltaY:r.liveParameters.vector.y,distance:r.liveParameters.vector.vectorLength,speedX:r.liveParameters.vector.x/t.vectorTimespan,speedY:r.liveParameters.vector.y/t.vectorTimespan,speed:r.liveParameters.speed,direction:r.liveParameters.vector.direction,scale:1,rotation:0,center:{x:r.liveParameters.vector.endPoint.x,y:r.liveParameters.vector.endPoint.y},srcEvent:t.currentPointerEvent
|
|
327
|
+
/*,
|
|
328
|
+
target : primaryPointerInput.touch.target,
|
|
329
|
+
pointerType : ,
|
|
330
|
+
eventType : ,
|
|
331
|
+
isFirst : ,
|
|
332
|
+
isFinal :,
|
|
333
|
+
pointers : ,*/},e}}
|
|
334
|
+
/*
|
|
335
|
+
* PAN DEFINITION:
|
|
336
|
+
* - user touches surface with only one finger, or presses the mouse down
|
|
337
|
+
* - user moves this one finger into different directions while staying on the surface, this movement is required
|
|
338
|
+
* - the start of a pan is defined by a minimum pointerdown/touch duration and a minimum distance
|
|
339
|
+
* - pan ends when the user removes the finger from the surface
|
|
340
|
+
* - to detect a "swipe", the final speed is used
|
|
341
|
+
* - a SWIPE is a pan that ended with a high speed (velocity without direction)
|
|
342
|
+
* - Pan supports directions. options["supportedDirections"] = []
|
|
343
|
+
*/class At extends Et{constructor(t,e){super(t,e=e||{}),this.eventBaseName="pan",this.initialMinMaxParameters.pointerCount=[1,1],// 1: no pan recognized at the pointerup event. 0: pan recognized at pointerup
|
|
344
|
+
this.initialMinMaxParameters.duration=[0,null],this.initialMinMaxParameters.distance=[10,null],this.activeStateMinMaxParameters.pointerCount=[1,1],this.boolParameters.requiresPointerMove=!0,this.boolParameters.requiresActivePointer=!0,this.swipeFinalSpeed=600,this.isSwipe=!1,this.initialSupportedDirections=yt,Object.prototype.hasOwnProperty.call(e,"supportedDirections")?this.initialSupportedDirections=e.supportedDirections:this.options.supportedDirections=yt}validate(t){
|
|
345
|
+
// on second recognition allow all directions. otherwise, the "pan" mode would end if the finger was moved right and then down during "panleft" mode
|
|
346
|
+
return 1==this.isActive&&(this.options.supportedDirections=yt),super.validate(t)}onStart(t){this.isSwipe=!1,super.onStart(t)}
|
|
347
|
+
// check if it was a swipe
|
|
348
|
+
onEnd(t){var e=t.getPrimaryPointerInput();this.swipeFinalSpeed<e.globalParameters.finalSpeed&&(this.isSwipe=!0,this.emit(t,"swipe")),super.onEnd(t),this.options.supportedDirections=this.initialSupportedDirections}onTouchMove(t){1==this.isActive&&(1==this.DEBUG&&console.log("[Pan] preventing touchmove default"),t.preventDefault(),t.stopPropagation())}}
|
|
349
|
+
/*
|
|
350
|
+
* TAP DEFINITION
|
|
351
|
+
* - user touches the screen with one finger or presses the mouse button down
|
|
352
|
+
* - the finger does not move for x ms
|
|
353
|
+
* - the finger is released, Tap is no recognized
|
|
354
|
+
*/class zt extends Et{constructor(t,e){super(t,e=e||{}),this.eventBaseName="tap",this.initialMinMaxParameters.pointerCount=[0,0],// count of fingers touching the surface. a tap is fired AFTER the user removed his finger
|
|
355
|
+
this.initialMinMaxParameters.duration=[0,200],// milliseconds. after a certain touch duration, it is not a TAP anymore
|
|
356
|
+
this.initialMinMaxParameters.distance=[null,30],// if a certain distance is detected, TAP becomes impossible
|
|
357
|
+
this.boolParameters.requiresPointerMove=null,this.boolParameters.requiresActivePointer=!1}recognize(t){1==this.validate(t)&&this.state==ft&&(this.initialPointerEvent=t.currentPointerEvent,this.emit(t))}}
|
|
358
|
+
/*
|
|
359
|
+
* press should only be fired once
|
|
360
|
+
* if global duration is below Press.initialMinMaxParameters["duration"][0], set the Press to possible
|
|
361
|
+
* if global duration is above Press.initialMinMaxParameters["duration"][0] AND press already has been emitted, set Press to impossible
|
|
362
|
+
*
|
|
363
|
+
*/class Ct extends _t{constructor(t,e){super(t,e=e||{}),this.boolParameters={requiresPointerMove:null,requiresActivePointer:null},this.initialMinMaxParameters={pointerCount:[2,null]},this.activeStateMinMaxParameters={pointerCount:[2,null]},this.options=e||{}}}class Bt extends Ct{constructor(t,e){super(t,e=e||{}),this.boolParameters.requiresPointerMove=!0,this.boolParameters.requiresActivePointer=!0,this.initialMinMaxParameters.pointerCount=[2,2],// minimum number of fingers currently on the surface
|
|
364
|
+
this.initialMinMaxParameters.centerMovement=[null,null],//px
|
|
365
|
+
this.initialMinMaxParameters.distanceChange=[null,null],//px - distance between 2 fingers
|
|
366
|
+
this.initialMinMaxParameters.rotationAngle=[null,null],// degrees: positive = clockwise, negative = counter-clockwise (js convention, not mathematical convention)
|
|
367
|
+
this.initialMinMaxParameters.vectorAngle=[null,null],this.activeStateMinMaxParameters.pointerCount=[2,2],this.activeStateMinMaxParameters.centerMovement=[null,null],this.activeStateMinMaxParameters.distanceChange=[null,null],this.activeStateMinMaxParameters.rotationAngle=[null,null],this.activeStateMinMaxParameters.vectorAngle=[null,null]}getMinMaxParameters(t){var e=super.getMinMaxParameters(t);return e.centerMovement=t.multipointer.liveParameters.centerMovement,
|
|
368
|
+
// negative distance change: distance was decreased, positive: distance was increased.
|
|
369
|
+
e.distanceChange=Math.abs(t.multipointer.liveParameters.distanceChange),e.rotationAngle=Math.abs(t.multipointer.liveParameters.rotationAngle),e.vectorAngle=t.multipointer.liveParameters.vectorAngle,e}getEventData(t){
|
|
370
|
+
// provide short-cuts to the values collected in the Contact object
|
|
371
|
+
// match this to the event used by hammer.js
|
|
372
|
+
var e=super.getEventData(t),r=t.currentPointerEvent.timeStamp-this.initialPointerEvent.timeStamp,i=t.multipointer.globalParameters,o=t.multipointer.liveParameters;
|
|
373
|
+
// global: global for this recognizer, not the Contact object
|
|
374
|
+
return e.global={deltaX:i.centerMovementVector.x,deltaY:i.centerMovementVector.y,distance:i.centerMovement,speedX:i.centerMovementVector.x/r,speedY:i.centerMovementVector.y/r,speed:i.centerMovementVector.vectorLength/r,direction:i.centerMovementVector.direction,scale:i.relativeDistanceChange,rotation:i.rotationAngle,srcEvent:t.currentPointerEvent},e.live={deltaX:o.centerMovementVector.x,deltaY:o.centerMovementVector.y,distance:o.centerMovement,speedX:o.centerMovementVector.x/r,speedY:o.centerMovementVector.y/r,speed:o.centerMovementVector.vectorLength/r,direction:o.centerMovementVector.direction,scale:o.relativeDistanceChange,rotation:o.rotationAngle,center:{x:o.centerMovementVector.startPoint.x,y:o.centerMovementVector.startPoint.y},srcEvent:t.currentPointerEvent},e}}
|
|
375
|
+
/*
|
|
376
|
+
* PINCH DEFINITION
|
|
377
|
+
* - 2 fingers touch the surface
|
|
378
|
+
* - those fongers are moved towards each other, or away from each other
|
|
379
|
+
* - 2 fingers define a circle: center=middle between two touches, diameter = distance
|
|
380
|
+
* - the center between the 2 fingers stays at the same coordinates
|
|
381
|
+
* - the distance between the 2 start points and the two end points is reduces (diameter shrinks)
|
|
382
|
+
*/
|
|
383
|
+
/*
|
|
384
|
+
* PointerListener class
|
|
385
|
+
* - implements the possibility to listen to gesture events performed on a specific DOM Element
|
|
386
|
+
* expample: element.addEventListener("pan", function(event){});
|
|
387
|
+
* - creates and destroys Contact instances
|
|
388
|
+
* - updates the Contact instances
|
|
389
|
+
* - uses the Contact instances to determine which gesture(s) are performed by passing Contact instances to GestureRegonizers
|
|
390
|
+
*
|
|
391
|
+
* - var listener = new PointerListener(domElement, {});
|
|
392
|
+
* - domElement.addEventListener("pan", function(){});
|
|
393
|
+
*/
|
|
394
|
+
var Mt=[zt,class extends Et{constructor(t,e){super(t,e=e||{}),this.eventBaseName="press",this.initialMinMaxParameters.pointerCount=[1,1],// count of fingers touching the surface. a press is fired during an active contact
|
|
395
|
+
this.initialMinMaxParameters.duration=[600,null],// milliseconds. after a certain touch duration, it is not a TAP anymore
|
|
396
|
+
this.initialMinMaxParameters.distance=[null,10],// if a certain distance is detected, Press becomes impossible
|
|
397
|
+
this.boolParameters.requiresPointerMove=null,this.boolParameters.requiresActivePointer=!0,
|
|
398
|
+
// only Press has this parameter
|
|
399
|
+
this.hasBeenEmitted=!1,
|
|
400
|
+
// as the global vector length is used, press should not trigger if the user moves away from the startpoint, then back, then stays
|
|
401
|
+
this.hasBeenInvalidatedForContactId=null}
|
|
402
|
+
// distance has to use the global vector
|
|
403
|
+
getMinMaxParameters(t){var e=super.getMinMaxParameters(t),r=t.getPrimaryPointerInput();return e.distance=r.globalParameters.vector.vectorLength,e}recognize(t){var e=this.validate(t),r=t.getPrimaryPointerInput();if(null!=this.hasBeenInvalidatedForContactId&&this.hasBeenInvalidatedForContactId!=t.id&&(this.hasBeenInvalidatedForContactId=null),0==e&&r.globalParameters.vector.vectorLength>this.initialMinMaxParameters.distance[1]&&(this.hasBeenInvalidatedForContactId=t.id),1==e&&0==this.hasBeenEmitted&&null==this.hasBeenInvalidatedForContactId)this.initialPointerEvent=t.currentPointerEvent,this.emit(t),this.hasBeenEmitted=!0;else{let t=r.globalParameters.duration;1==this.hasBeenEmitted&&t<=this.initialMinMaxParameters.duration[0]&&(this.hasBeenEmitted=!1)}}},At,class extends Bt{constructor(t,e){super(t,e=e||{}),this.eventBaseName="pinch",this.initialMinMaxParameters.centerMovement=[0,50],//px
|
|
404
|
+
this.initialMinMaxParameters.distanceChange=[5,null],// distance between 2 fingers
|
|
405
|
+
this.initialMinMaxParameters.rotationAngle=[null,20],// distance between 2 fingers
|
|
406
|
+
this.initialMinMaxParameters.vectorAngle=[10,null]}}
|
|
407
|
+
/*
|
|
408
|
+
* ROTATE DEFINITION
|
|
409
|
+
* - 2 fingers touch the surface
|
|
410
|
+
* - 1 or 2 fingers are moved in a circular motion. the center is between the 2 fingers
|
|
411
|
+
*/,class extends Bt{constructor(t,e){super(t,e=e||{}),this.eventBaseName="rotate",this.initialMinMaxParameters.centerMovement=[0,50],this.initialMinMaxParameters.distanceChange=[null,50],this.initialMinMaxParameters.rotationAngle=[5,null]}}
|
|
412
|
+
/*
|
|
413
|
+
* 2 fingers are moved across the surface, in the same direction
|
|
414
|
+
*/,class extends Bt{constructor(t,e){super(t,e=e||{}),this.eventBaseName="twofingerpan",this.initialMinMaxParameters.centerMovement=[3,null],this.initialMinMaxParameters.distanceChange=[null,50],this.initialMinMaxParameters.rotationAngle=[null,null],this.initialMinMaxParameters.vectorAngle=[null,150]}}];class Lt{constructor(t,e){
|
|
415
|
+
// registry for events like "pan", "rotate", which have to be removed on this.destroy();
|
|
416
|
+
this.eventHandlers={},this.lastRecognitionTimestamp=null,this.idleRecognitionIntervalId=null,this.pointerEventHandlers={},this.touchEventHandlers={},e=e||{},this.options={bubbles:!0,handleTouchEvents:!0,DEBUG:!1,DEBUG_GESTURES:!1,DEBUG_CONTACT:!1};
|
|
417
|
+
// add user-defined options to this.options
|
|
418
|
+
for(let t in e)"supportedGestures"!=t&&(this.options[t]=e[t]);this.DEBUG=this.options.DEBUG;
|
|
419
|
+
// add instantiatedGestures to options.supportedGestures
|
|
420
|
+
var r=Mt,i=[];1==Object.prototype.hasOwnProperty.call(e,"supportedGestures")&&(r=e.supportedGestures);for(let e=0;e<r.length;e++){let o,a=r[e],n={bubbles:this.options.bubbles,DEBUG:this.options.DEBUG_GESTURES};if("function"==typeof a)o=new a(t,n);else{if("object"!=typeof a)throw new Error("unsupported gesture type: "+typeof a);o=a}i.push(o)}this.options.supportedGestures=i,this.domElement=t,
|
|
421
|
+
// the Contact instance - only active during an active pointerdown
|
|
422
|
+
this.contact=null,
|
|
423
|
+
// disable context menu on long taps - this kills pointermove
|
|
424
|
+
/*domElement.addEventListener("contextmenu", function(event) {
|
|
425
|
+
event.preventDefault();
|
|
426
|
+
return false;
|
|
427
|
+
});*/
|
|
428
|
+
this.addPointerListeners(),this.addTouchListeners()}addPointerListeners(){var t=this,e=this.domElement,r=function(r){if(1==t.DEBUG&&console.log("[PointerListener] pointerdown event detected"),
|
|
429
|
+
// re-target all pointerevents to the current element
|
|
430
|
+
// see https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture
|
|
431
|
+
e.setPointerCapture(r.pointerId),null==t.contact||0==t.contact.isActive){let e={DEBUG:t.options.DEBUG_CONTACT};t.contact=new xt(r,e)}else
|
|
432
|
+
// use existing contact instance if a second pointer becomes present
|
|
433
|
+
t.contact.addPointer(r);1==Object.prototype.hasOwnProperty.call(t.options,"pointerdown")&&t.options.pointerdown(r,t),
|
|
434
|
+
// before starting a new interval, make sure the old one is stopped if present
|
|
435
|
+
null!=t.idleRecognitionIntervalId&&t.clearIdleRecognitionInterval(),t.idleRecognitionIntervalId=setInterval((function(){t.onIdle()}),100)},i=function(e){
|
|
436
|
+
// pointermove is also firing if the mouse button is not pressed
|
|
437
|
+
null!=t.contact&&1==t.contact.isActive&&(
|
|
438
|
+
// this would disable vertical scrolling - which should only be disabled if a panup/down or swipeup/down listener has been triggered
|
|
439
|
+
// event.preventDefault();
|
|
440
|
+
t.contact.onPointerMove(e),t.recognizeGestures(),1==Object.prototype.hasOwnProperty.call(t.options,"pointermove")&&t.options.pointermove(e,t))},o=function(r){(1==t.DEBUG&&console.log("[PointerListener] pointerup event detected"),e.releasePointerCapture(r.pointerId),null!=t.contact&&1==t.contact.isActive)&&(
|
|
441
|
+
// use css: touch-action: none instead of js to disable scrolling
|
|
442
|
+
//self.domElement.classList.remove("disable-scrolling");
|
|
443
|
+
t.contact.onPointerUp(r),t.recognizeGestures(),1==Object.prototype.hasOwnProperty.call(t.options,"pointerup")&&t.options.pointerup(r,t));t.clearIdleRecognitionInterval()},a=function(e){1==t.DEBUG&&console.log("[PointerListener] pointerleave detected"),null!=t.contact&&1==t.contact.isActive&&(t.contact.onPointerLeave(e),t.recognizeGestures()),t.clearIdleRecognitionInterval()},n=function(r){e.releasePointerCapture(r.pointerId),1==t.DEBUG&&console.log("[PointerListener] pointercancel detected"),
|
|
444
|
+
//self.domElement.classList.remove("disable-scrolling");
|
|
445
|
+
t.contact.onPointerCancel(r),t.recognizeGestures(),t.clearIdleRecognitionInterval(),1==Object.prototype.hasOwnProperty.call(t.options,"pointercancel")&&t.options.pointercancel(r,t)};e.addEventListener("pointerdown",r,{passive:!0}),e.addEventListener("pointermove",i,{passive:!0}),e.addEventListener("pointerup",o,{passive:!0}),e.addEventListener("pointerleave",a,{passive:!0}),e.addEventListener("pointercancel",n,{passive:!0}),this.pointerEventHandlers={pointerdown:r,pointermove:i,pointerup:o,pointerleave:a,pointercancel:n}}removePointerListeners(){for(let t in this.pointerEventHandlers){let e=this.pointerEventHandlers[t];this.domElement.removeEventListener(t,e)}}
|
|
446
|
+
// provide the ability to interact/prevent touch events
|
|
447
|
+
// scrolling (touchmove event) results in pointerCancel event, stopping horizontal panning if user scrolls vertically
|
|
448
|
+
// the better solution is using eg css: touch-action: pan-y;
|
|
449
|
+
addTouchListeners(){var t=this;if(1==t.options.handleTouchEvents){var e=function(e){
|
|
450
|
+
// fire onTouchMove for all gestures
|
|
451
|
+
for(let r=0;r<t.options.supportedGestures.length;r++){t.options.supportedGestures[r].onTouchMove(e)}};this.domElement.addEventListener("touchmove",e),this.touchEventHandlers={touchmove:e}}}removeTouchListeners(){for(let t in this.touchEventHandlers){let e=this.touchEventHandlers[t];this.domElement.removeEventListener(t,e)}}
|
|
452
|
+
// to recognize Press, recognition has to be run if the user does nothing while having contact with the surfave (no pointermove, no pointerup, no pointercancel)
|
|
453
|
+
onIdle(){if(null==this.contact||0==this.contact.isActive)this.clearIdleRecognitionInterval();else{let t=(new Date).getTime(),e=null;null!=this.lastRecognitionTimestamp&&(e=t-this.lastRecognitionTimestamp),(null==e||e>100)&&(this.contact.onIdle(),1==this.DEBUG&&console.log("[PointerListener] onIdle - running idle recognition"),this.recognizeGestures())}}clearIdleRecognitionInterval(){null!=this.idleRecognitionIntervalId&&(clearInterval(this.idleRecognitionIntervalId),this.idleRecognitionIntervalId=null)}
|
|
454
|
+
// run all configured recognizers
|
|
455
|
+
recognizeGestures(){this.lastRecognitionTimestamp=(new Date).getTime();for(let t=0;t<this.options.supportedGestures.length;t++){this.options.supportedGestures[t].recognize(this.contact)}}
|
|
456
|
+
/*
|
|
457
|
+
* handler management
|
|
458
|
+
* eventsString: one or more events: "tap" or "pan twofingerpan pinchend"
|
|
459
|
+
* currently, it is not supported to add the same handlerReference twice (once with useCapture = true, and once with useCapture = false)
|
|
460
|
+
* useCapture defaults to false
|
|
461
|
+
*/parseEventsString(t){return t.trim().split(/\s+/g)}on(t,e){let r=this.parseEventsString(t);for(let t=0;t<r.length;t++){let i=r[t];i in this.eventHandlers||(this.eventHandlers[i]=[]),-1==this.eventHandlers[i].indexOf(e)&&this.eventHandlers[i].push(e),this.domElement.addEventListener(i,e,!1)}}off(t,e){let r=this.parseEventsString(t);for(let t=0;t<r.length;t++){let i=r[t];if(i in this.eventHandlers){let t=this.eventHandlers[i],r=t.indexOf(e);r>=0&&(t.splice(r,1),this.eventHandlers[i]=t),this.domElement.removeEventListener(i,e,!1)}}}destroy(){
|
|
462
|
+
// remove all EventListeners from self.domElement
|
|
463
|
+
for(let t in this.eventHandlers){let e=this.eventHandlers[t];for(let r=0;r<e.length;r++){let i=e[r];this.domElement.removeEventListener(t,i)}delete this.eventHandlers[t]}this.removePointerListeners(),this.removeTouchListeners()}}t.TkDrawer=class extends tt{constructor(){super(...arguments),this._open=!1,this.over=!1,this.right=!1,this.swipeable=!1}set open(t){const e=this._open;this._open=t,this.requestUpdate("open",e),this._open&&this.dispatchEvent(new Event("did-show")),this._open||this.dispatchEvent(new Event("did-close"))}get open(){return this._open}render(){return I`<div class="container fi"><slot name="drawer-container"></slot></div><div class="overlay" @click="${()=>this.open=!1}"></div><div class="drawer"><div class="drawer-header"><slot name="drawer-header"></slot></div><div class="drawer-content"><slot name="drawer-content"></slot></div><div class="drawer-footer"><slot name="drawer-footer"></slot></div></div>`}updated(t){if(t.has("overQuery")&&this.overMediaQuery(),t.has("openQuery")&&window.matchMedia(this.openQuery).matches&&this.show(),t.has("swipeable")&&this.swipeable){var e={supportedDirections:bt,bubbles:!1},r=new At(this.$drawer,e);this.pointerListener=new Lt(this.$drawer,{DEBUG:!0,DEBUG_CONTACT:!0,DEBUG_GESTURES:!0,
|
|
464
|
+
// handleTouchEvents : false,
|
|
465
|
+
supportedGestures:[zt,r],bubbles:!1}),this.$drawer.addEventListener("tap",(t=>{const{x:e,y:r}=t.detail.live.srcEvent,i=this.shadowRoot?.elementFromPoint(e,r);i&&i.click()})),this.$drawer.addEventListener("panstart",(t=>{this.$drawer.style.transition="transform 0ms ease"})),this.$drawer.addEventListener("pan",(t=>{var e="translate3d("+(t.detail.global.deltaX>0?0:t.detail.global.deltaX)+"px, 0px, 0)";requestAnimationFrame((t=>{this.$drawer.style.transform=e}))})),this.$drawer.addEventListener("panend",(t=>{requestAnimationFrame((e=>{this.$drawer.style.transition="",this.$drawer.style.transform="",this.open=!(t.detail.global.deltaX<-50)}))}))}t.has("swipeable")&&!this.swipeable&&(this.pointerListener&&this.pointerListener.destroy(),this.pointerListener=null)}overMediaQuery(){this.mql&&this.mql.removeEventListener("change",this.overMediaQueryListener.bind(this)),this.mql=window.matchMedia(this.overQuery),this.mql.matches?this.setAttribute("over",""):this.removeAttribute("over"),this.mql.addEventListener("change",this.overMediaQueryListener.bind(this))}overMediaQueryListener(t){t.matches?this.setAttribute("over",""):this.removeAttribute("over")}hideIfOver(){(this.overQuery&&this.mql?.matches||this.over)&&(this.open=!1)}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}},t.TkDrawer.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:block;height:100%;overflow:hidden;position:relative;width:100%}.drawer{background-color:var(--background,#f7f7f7);color:var(--foreground,#454545);display:flex;flex-direction:column;height:100%;overflow:scroll;position:absolute;top:0;touch-action:pan-y;transform:translateX(-100%);transition:transform cubic-bezier(.4,0,.2,1) var(--transition-duration-medium,.18s);width:var(--drawer-width,256px);will-change:transform;z-index:var(--drawer-z-index,200)}.drawer .drawer-content{flex:1;overflow:scroll}:host([right]) .drawer{right:0;transform:translateX(100%)}.overlay{background-color:#00000080;bottom:0;display:none;left:0;position:absolute;right:0;top:0;z-index:var(--drawer-overlay-z-index,200)}.container{background-color:var(--background,#f7f7f7);height:100%;overflow:scroll;transition:padding cubic-bezier(.4,0,.2,1) var(--transition-duration-slow,.25s)}:host([open]) .drawer{transform:none}:host([open]) .container{padding-left:var(--drawer-width)}:host([open][over]) .container{padding-left:0}:host([open][over]) .overlay{display:block}@media (max-width:var(--drawer-trigger-width,400px)){:host([open]) .container{padding-left:0}:host([open]) .overlay{display:block}}")}`,e([ot({type:Boolean,reflect:!0}),r("design:type",Object),r("design:paramtypes",[Object])],t.TkDrawer.prototype,"open",null),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"over",void 0),e([ot({type:String,attribute:"open-query"}),r("design:type",String)],t.TkDrawer.prototype,"openQuery",void 0),e([ot({type:String,attribute:"over-query"}),r("design:type",String)],t.TkDrawer.prototype,"overQuery",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"right",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"swipeable",void 0),e([lt("div.drawer"),r("design:type",HTMLElement)],t.TkDrawer.prototype,"$drawer",void 0),t.TkDrawer=e([rt("tk-drawer")],t.TkDrawer);
|
|
147
466
|
/**
|
|
148
467
|
* @license
|
|
149
468
|
* Copyright 2017 Google LLC
|
|
150
469
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
151
470
|
*/
|
|
152
|
-
const
|
|
471
|
+
const It=2;
|
|
153
472
|
/**
|
|
154
473
|
* @license
|
|
155
474
|
* Copyright 2017 Google LLC
|
|
156
475
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
157
476
|
*/
|
|
158
|
-
class ut extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){if(super(t),this.it=U,t.type!==vt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===U||null==t)return this.ft=void 0,this.it=t;if(t===R)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ut.directiveName="unsafeHTML",ut.resultType=1;const gt=(t=>(...e)=>({_$litDirective$:t,values:e}))(ut);t.TkIcon=class extends t.TkBox{constructor(){super(...arguments),this.svg=""}static get styles(){return[...t.TkBox.styles,l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--tk-icon-color,currentColor);display:inline-flex;height:1.5em;width:1.5em}:host svg{fill:var(--color);display:block;height:100%;width:100%}")}`]}render(){return H`${this.path?H`<svg viewBox="0 0 24 24"><path d="${this.path}"></path></svg>`:H`${gt(this.svg)}`}`}updated(t){t.has("name")&&this.name&&this.loadIcon()}async loadIcon(){const t=this.library?document.querySelector(`tk-icons[library=${this.library}]`):document.querySelector("tk-icons");t&&(this.svg=await fetch(t.resolve(this.name)).then((t=>t.blob().then((e=>({contentType:t.headers.get("Content-Type"),raw:e}))))).then((t=>t.contentType&&/svg/.test(t.contentType)?t.raw.text():"")))}},e([ot(),r("design:type",String)],t.TkIcon.prototype,"name",void 0),e([ot(),r("design:type",String)],t.TkIcon.prototype,"library",void 0),e([ot(),r("design:type",String)],t.TkIcon.prototype,"path",void 0),e([ot(),r("design:type",String)],t.TkIcon.prototype,"svg",void 0),t.TkIcon=e([rt("tk-icon")],t.TkIcon),t.TkIcons=class extends tt{constructor(){super(...arguments),this.library="default"}firstUpdated(){window.document.body.appendChild(this)}},e([ot({attribute:!1}),r("design:type",Function)],t.TkIcons.prototype,"resolve",void 0),e([ot({reflect:!0}),r("design:type",String)],t.TkIcons.prototype,"library",void 0),t.TkIcons=e([rt("tk-icons")],t.TkIcons);t.TkListItem=class extends tt{constructor(){super(),this.href="",this.target=""}render(){return H`<slot name="before"></slot><div id="content"><slot></slot></div><slot name="after"></slot>${this.href?H`<a tabindex="-1" id="link" href="${this.href}" rel="noreferrer" aria-label="${this.ariaLabel}"></a>`:""}`}firstUpdated(){!this.ariaLabel&&this.innerText&&(this.ariaLabel=this.innerText)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",(()=>this.handleClick()))}disconnectedCallback(){this.removeEventListener("click",this.handleClick),super.disconnectedCallback()}handleClick(){this.href&&this.target?window.open(this.href,this.target,"noopener noreferrer"):this.href&&this.shadowRoot?.querySelector("#link")?.click()}},t.TkListItem.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--text:var(--list-item-color,var(--foreground,#454545));--color:var(--list-item-bg,var(--background,#f7f7f7));align-items:center;background:var(--color);border-radius:var(--list-item-border-radius,var(--border-radius-large,.5rem));color:var(--text);display:flex;outline:none;overflow:hidden;padding:var(--spacing-m,1rem) var(--spacing-m,1rem);position:relative;text-align:left;transition:var(--list-item-transition,background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}:host([clickable]),:host([href]){user-select:none}:host([clickable]:not([active]):not([disabled])),:host([href]:not([active]):not([disabled])){cursor:pointer}:host(:focus),:host(:hover){--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)));will-change:background,color}:host([active]:focus),:host([active]:hover){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}:host([disabled]){--text:var(--shade-dark,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*0.85)));--color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));opacity:.4;pointer-events:none}:host([active]){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}::slotted([slot=after]),::slotted([slot=before]){flex-shrink:0}::slotted([slot=before]){align-self:var(--list-item-left-align-self,center);margin:0 var(--spacing-m,1rem) 0 0}::slotted([slot=after]){align-self:var(--list-item-left-align-self,center);margin:0 0 0 var(--spacing-m,1rem)}#content{display:flex;flex-direction:column;flex-grow:1}")}`,e([ot({attribute:!0}),r("design:type",String)],t.TkListItem.prototype,"href",void 0),e([ot({attribute:!0}),r("design:type",String)],t.TkListItem.prototype,"target",void 0),e([ot({attribute:"aria-label"}),r("design:type",String)],t.TkListItem.prototype,"ariaLabel",void 0),t.TkListItem=e([rt("tk-list-item"),r("design:paramtypes",[])],t.TkListItem);t.TkLoading=class extends t.TkBox{constructor(){super(...arguments),this.circle=!1,this.indeterminate=!1}static get styles(){return[...t.TkBox.styles,l`${n('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:currentColor}.circle{animation:rotator 3s linear infinite;display:inline-flex;height:2em;width:2em}.circle,.circle .path{transform-origin:center}.circle .path{stroke-dasharray:265;stroke-dashoffset:0;stroke:var(--color);animation:dash 3s ease-in-out infinite}@keyframes rotator{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dashoffset:265}50%{stroke-dashoffset:65;transform:rotate(90deg)}to{stroke-dashoffset:265;transform:rotate(1turn)}}.line{background-color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)));height:.4em;overflow:hidden;position:relative}.line .indeterminate{background-color:var(--color)}.line .indeterminate:before{animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.line .indeterminate:after,.line .indeterminate:before{background-color:inherit;bottom:0;content:"";left:0;position:absolute;top:0;will-change:left,right}.line .indeterminate:after{animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation-delay:1.15s}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}')}`]}render(){return H`${this.circle?H`<svg class="circle" viewBox="0 0 100 100"><circle class="path" fill="none" stroke-width="1em" stroke-linecap="butt" cx="50" cy="50" r="40"></circle></svg>`:H`<div class="line"><div class="indeterminate"></div></div>`}`}},e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkLoading.prototype,"circle",void 0),e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkLoading.prototype,"indeterminate",void 0),t.TkLoading=e([rt("tk-loading")],t.TkLoading);t.TkNavbar=class extends t.TkBox{static get styles(){return[...t.TkBox.styles,l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background:var(--color);color:var(--text);flex-direction:row;justify-content:space-between}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([fixed]){left:0;position:fixed;right:0;top:0;z-index:var(--navbar-z-index,100)}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-weight:var(--nav-title-font-weight,var(--font-weight-regular,500));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}")}`]}render(){return H`<div id="left"><slot name="left"></slot><slot name="title"></slot></div><div id="right"><slot name="right"></slot></div>`}},t.TkNavbar=e([rt("tk-navbar")],t.TkNavbar);t.TkTextfield=class extends tt{constructor(){super(...arguments),this._id=ct(),this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1}set value(t){this.$input?(this.$input.value=t,this.refreshAttributes()):this.initialValue=t}get value(){return null!=this.$input?this.$input.value:this.initialValue||""}render(){return H`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><slot id="slot"></slot><input id="${this._id}" @keydown="${this.handleChange.bind(this)}" @input="${this.handleChange.bind(this)}" @focusout="${this.handleChange.bind(this)}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" autocomplete="${ht(this.autocomplete)}" autocapitalize="${ht(this.autocapitalize)}" aria-label="${ht(this.label)}" type="${ht(this.type)}" name="${ht(this.name)}" list="${ht(this.list)}" pattern="${ht(this.pattern)}" minlength="${ht(this.minLength)}" maxlength="${ht(this.maxLength)}" min="${ht(this.min)}" max="${ht(this.max)}" tabindex="${this.disabled?-1:0}"></div><slot id="after" name="after"></slot></div>`}handleChange(){this.refreshAttributes()}firstUpdated(){this.$input=this.shadowRoot?.querySelector("input"),this.appendChild(this.$input),this.initialValue&&(this.value=this.initialValue)}refreshAttributes(){this.$input.value?this.setAttribute("dirty",""):this.removeAttribute("dirty"),this.$input.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid","")}focus(){this.$input.focus()}},t.TkTextfield.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}")}`,e([ot({type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkTextfield.prototype,"value",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTextfield.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"list",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextfield.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextfield.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextfield.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"autocomplete",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"autocapitalize",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"pattern",void 0),e([ot({type:String,attribute:"value"}),r("design:type",String)],t.TkTextfield.prototype,"initialValue",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"min",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"max",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"minLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"maxLength",void 0),e([st({passive:!0}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],t.TkTextfield.prototype,"handleChange",null),t.TkTextfield=e([rt("tk-textfield")],t.TkTextfield);var bt,mt,yt;!function(t){t.show="show",t.force="force",t.confirm="confirm",t.input="input"}(mt||(mt={})),function(t){t.success="success",t.warning="warning",t.error="error",t.info="info",t.neutral="neutral"}(yt||(yt={})),t.TkNotie=bt=class extends t.TkBox{constructor(t=""){super(),this.persistent=!0,this.open=!1,this.position="bottom",this.type=mt.show,this.level=yt.info,this.delay=3e3,this.animationDelay=300,this.buttonText="OK",this.confirmText="OK",this.cancelText="CANCEL",this.text=t}static get styles(){return[...t.TkBox.styles,l`${n(":host{bottom:0;display:none;font-size:1.6rem;left:0;margin:0;position:fixed;right:0;top:0}:host .overlay{background-color:#00000080;bottom:0;left:0;position:fixed;right:0;top:0;z-index:var(--notie-z-index,400)}:host .container{background-color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));height:fit-content;left:0;position:fixed;right:0;text-align:center;transform:translateY(100%);transition:all .15s ease-in;z-index:calc(var(--notie-z-index, 400) + 1)}:host .container.info{background-color:#4d82d6}:host .container.error{background-color:#e1715b}:host .container.warning{background-color:#d6a14d}:host .container.success{background-color:#57bf57}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background);color:var(--foreground);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.forcer{background-color:#57bf57;color:#fff}:host .button.cancel{background-color:var(--error,#e1715b);color:var(--on-error,#fff)}@media screen and (max-width:900px){:host{font-size:1.4rem}}@media screen and (max-width:750px){:host{font-size:1.2rem}}@media screen and (max-width:400px){:host{font-size:1rem}}:host([position=top]) .container{bottom:inherit;position:fixed;top:0;transform:translateY(-100%)}:host([open]) .container{transform:translateY(0)}")}`]}render(){return H`<div class="overlay" @click="${()=>this.hide(!1)}"></div><tk-box class="container ${this.level}">${this.text?H`<tk-box class="text" @click="${()=>this.type==mt.show?this.hide(!0):null}">${this.text}</tk-box>`:""} ${this.template?H`<tk-box class="template" @click="${()=>this.type==mt.show?this.hide(!0):null}">${this.template}</tk-box>`:""} ${this.type==mt.force?H`<tk-box @click="${()=>this.hide(!0)}" class="button force">${this.buttonText}</tk-box>`:""} ${this.type==mt.input?H`<tk-textfield class="input"></tk-textfield>`:""} ${this.type==mt.confirm||this.type==mt.input?H`<tk-box direction="row"><tk-box justify="center" align-items="center" flex="grow" @click="${()=>this.hide(!0)}" class="button confirm">${this.confirmText}</tk-box><tk-box justify="center" align-items="center" flex="grow" @click="${()=>this.hide(!1)}" class="button confirm cancel">${this.cancelText}</tk-box></tk-box>`:""}</tk-box>`}show(){return new Promise((t=>{this.resolve=t,this.style.setProperty("display","flex"),setTimeout((()=>this.open=!0)),this.dispatchEvent(new Event("didShow")),this.$input&&setTimeout((()=>this.$input.focus())),this.type==mt.show&&setTimeout((()=>this.hide(!1)),this.delay)}))}hide(t){t&&this.type===mt.input&&(t=this.$input.value),t||this.type!==mt.input||(t=null),this.$input&&(this.$input.value=""),this.$container.addEventListener("transitionend",(()=>{this.dispatchEvent(new Event("didHide")),this.resolve(t),this.persistent||this.remove()}),{once:!0}),this.open=!1}static show(t){return this.getNotie(t,mt.show).show()}static force(t){const e=this.getNotie(t,mt.force);return t.buttonText&&(e.buttonText=t.buttonText),e.show()}static confirm(t){const e=this.getNotie(t,mt.confirm);return t.confirmText&&(e.confirmText=t.confirmText),t.cancelText&&(e.cancelText=t.cancelText),e.show()}static input(t){const e=this.getNotie(t,mt.input);return t.password&&(e.$input.type="password"),t.confirmText&&(e.confirmText=t.confirmText),t.cancelText&&(e.cancelText=t.cancelText),e.show()}static getNotie(t,e){const r=new bt(t.text);return r.persistent=!1,r.type=e,r.delay=t.delay??999999999,t.template&&(r.template=t.template),t.position&&(r.position=t.position),t.background&&r.$container&&r.$container.setAttribute("background-color",t.background),t.color&&r.$container&&r.$container.setAttribute("color",t.color),t.container?t.container.shadowRoot?.appendChild(r):window.document.body.appendChild(r),t.zIndex&&r.style.setProperty("z-index",t.zIndex.toString()),r}},e([function(t){return ot({...t,state:!0})}(),r("design:type",Boolean)],t.TkNotie.prototype,"persistent",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkNotie.prototype,"open",void 0),e([ot({reflect:!0}),r("design:type",Object)],t.TkNotie.prototype,"position",void 0),e([ot({type:String}),r("design:type",String)],t.TkNotie.prototype,"type",void 0),e([ot({type:String}),r("design:type",String)],t.TkNotie.prototype,"level",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkNotie.prototype,"delay",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"text",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"buttonText",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"confirmText",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"cancelText",void 0),e([ot({type:Object}),r("design:type",Object)],t.TkNotie.prototype,"template",void 0),e([nt("tk-textfield"),r("design:type",t.TkTextfield)],t.TkNotie.prototype,"$input",void 0),e([nt(".container"),r("design:type",HTMLElement)],t.TkNotie.prototype,"$container",void 0),t.TkNotie=bt=e([rt("tk-notie"),r("design:paramtypes",[String])],t.TkNotie);t.TkPages=class extends tt{constructor(){super(...arguments),this._page="",this.selected="",this.handleScroll=!1,this.scrollHistory={}}set page(t){let e=this._page;if(this._page=t,e&&this.handleScroll){if(this.querySelector(`[page=${e}]`)){const t=document.scrollingElement||document.documentElement;this.scrollHistory[e]=t.scrollTop}}this.requestUpdate("page",e)}get page(){return this._page}render(){return H`<slot></slot>`}updated(t){t.has("page")&&this.querySelectorAll(":scope > *").forEach((t=>{const e=t.getAttribute("page")??"default",r=document.scrollingElement||document.documentElement;e==this.page?(t.removeAttribute("hidden"),""!=this.selected&&t.setAttribute(this.selected,""),this.handleScroll&&!t.hasAttribute("no-scroll")&&(r.scrollTop=this.scrollHistory[e]?this.scrollHistory[e]:0)):(t.setAttribute("hidden",""),""!=this.selected&&t.removeAttribute(this.selected))}))}},t.TkPages.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}")}`,e([ot({attribute:"page",type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkPages.prototype,"page",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkPages.prototype,"selected",void 0),e([ot({attribute:"handle-scroll",type:Boolean}),r("design:type",Boolean)],t.TkPages.prototype,"handleScroll",void 0),t.TkPages=e([rt("tk-pages")],t.TkPages);t.TkProgress=class extends tt{constructor(){super(...arguments),this.circle=!1,this.indeterminate=!1,this.value=0,this.buffer=0}render(){return H`${this.circle?H`<svg class="spinner" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle class="path" fill="none" stroke-width="10" stroke-linecap="butt" cx="50" cy="50" r="40"></circle></svg>`:H`${this.indeterminate?H`<div class="progress-materializecss"><div class="indeterminate"></div></div>`:H`<progress class="progress" max="100" value="50"></progress>`}`}`}},t.TkProgress.styles=l`${n('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary)}:host([accent]){--color:var(--accent)}:host([error]){--color:var(--error)}.spinner{animation:rotator 3s linear infinite;height:1em;transform-origin:center;width:1em}.spinner .path{stroke-dasharray:265;stroke-dashoffset:0;stroke:var(--color);animation:dash 3s ease-in-out infinite;transform-origin:center}@keyframes rotator{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dashoffset:265}50%{stroke-dashoffset:65;transform:rotate(90deg)}to{stroke-dashoffset:265;transform:rotate(1turn)}}.progress-materializecss{background-color:var(--shade-lighter);display:block;height:.3em;margin:5px 0;overflow:hidden;position:relative}.progress-materializecss .indeterminate{background-color:var(--primary)}.progress-materializecss .indeterminate:before{animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.progress-materializecss .indeterminate:after,.progress-materializecss .indeterminate:before{background-color:inherit;bottom:0;content:"";left:0;position:absolute;top:0;will-change:left,right}.progress-materializecss .indeterminate:after{animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation-delay:1.15s}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}')}`,e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkProgress.prototype,"circle",void 0),e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkProgress.prototype,"indeterminate",void 0),e([ot({attribute:!0,type:Number}),r("design:type",Number)],t.TkProgress.prototype,"value",void 0),e([ot({attribute:!0,type:Number}),r("design:type",Number)],t.TkProgress.prototype,"buffer",void 0),t.TkProgress=e([rt("tk-progress")],t.TkProgress);t.TkRadio=class extends tt{constructor(){super(...arguments),this.checked=!1,this.required=!1,this.disabled=!1,this.readonly=!1}render(){return H`<tk-box direction="row" align-items="center"><div tabindex="0" class="radio"><div id="dot"></div></div><span class="label"><slot></slot></span></tk-box><input id="${ct()}" slot="none" style="display:none" type="radio" ?checked="${this.checked}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" value="${ht(this.value)}" name="${ht(this.name)}" aria-hidden="true" tabindex="-1">`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}firstUpdated(){this.appendChild(this.$input)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}handleClick(){this.checked=!this.checked,this.checked&&this.name&&this.getRootNode().querySelectorAll(`tk-radio[name="${this.name}"]`).forEach((t=>t!=this?t.checked=!1:null)),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkRadio.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_radio-bg:var(--radio-bg,#0000);--_radio-color:var(--radio-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .radio{align-items:center;background:var(--_radio-bg);border:var(--radio-border-config,.125rem solid) currentColor;border-radius:var(--radio-border-radius,100%);color:var(--_radio-color);display:inline-flex;height:var(--radio-size,1.25rem);justify-content:center;outline:none;position:relative;transition:var(--radio-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--radio-size,1.25rem)}:host .label{font-size:1.1em;margin-left:10px}:host(:not([disabled])){cursor:pointer}:host([checked]){--_radio-bg:var(--radio-bg-checked,#0000);--_radio-color:var(--radio-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]) #dot{transform:scale(1)}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #dot,:host(:hover) #dot{will-change:transform,background}:host([disabled]){--_radio-bg:var(--radio-bg-disabled,#0000);--_radio-color:var(--radio-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));pointer-events:none}:host([disabled][checked]){--_radio-bg:var(--radio-bg-disabled-checked,#0000);--_radio-color:var(--radio-color-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}#dot{background:currentColor;border-radius:var(--radio-dot-border-radius,100%);height:var(--radio-dot-size,.625rem);transform:scale(0);transition:var(--radio-dot-transition,transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--radio-dot-size,.625rem)}#ripple{transform:var(--radio-ripple-transform,translate(-50%,-50%) scale(1.8))}")}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkRadio.prototype,"name",void 0),e([ot({attribute:!0,type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkRadio.prototype,"checked",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkRadio.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkRadio.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkRadio.prototype,"readonly",void 0),e([ot({type:String,reflect:!0}),r("design:type",String)],t.TkRadio.prototype,"value",void 0),e([nt("input"),r("design:type",HTMLInputElement)],t.TkRadio.prototype,"$input",void 0),t.TkRadio=e([rt("tk-radio")],t.TkRadio);t.TkSelect=class extends tt{constructor(){super(...arguments),this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1}set value(t){this.$select?(this.$select.value=t,this.refreshAttributes()):this.initialValue=t}get value(){return null!=this.$select?this.$select.value:this.initialValue||""}render(){return H`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><slot id="slot"></slot><select id="${ct()}" @keydown="${this.handleChange.bind(this)}" @input="${this.handleChange.bind(this)}" @focusout="${this.handleChange.bind(this)}" @change="${this.handleChange.bind(this)}" .value="${this.initialValue}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" name="${ht(this.name)}" autocomplete="${ht(this.autocomplete)}" tabindex="${this.disabled?-1:0}"></select> <svg id="arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 25" preserveAspectRatio="none"><polygon points="0,0 50,0 25,25"/></svg></div><slot id="after" name="after"></slot></div>`}handleChange(){this.refreshAttributes()}firstUpdated(){this.$select=this.shadowRoot?.querySelector("select"),this.appendChild(this.$select);this.querySelectorAll("option").forEach((t=>this.$select.appendChild(t))),this.initialValue&&(this.value=this.initialValue)}refreshAttributes(){this.$select.value?this.setAttribute("dirty",""):this.removeAttribute("dirty"),this.$select.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid",""),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkSelect.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}#arrow{fill:var(--_input-state-color);height:8px;position:absolute;right:0;top:50%;transform:translate(-100%,-50%);z-index:-1}::slotted(option){display:none}:host(:not([dirty])) ::slotted(select){opacity:0}")}`,e([ot({type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkSelect.prototype,"value",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkSelect.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"list",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSelect.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSelect.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSelect.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"autocomplete",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"pattern",void 0),e([ot({type:String,attribute:"value"}),r("design:type",String)],t.TkSelect.prototype,"initialValue",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"min",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"max",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"minLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"maxLength",void 0),e([st({passive:!0}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],t.TkSelect.prototype,"handleChange",null),t.TkSelect=e([rt("tk-select")],t.TkSelect);t.TkSlider=class extends tt{constructor(){super(...arguments),this.required=!1,this.disabled=!1,this.readonly=!1,this.thumbLabel=!1,this.thumbLabelPersist=!1,this.min=0,this.value=this.min,this.max=100}render(){return H`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><div id="slot-wrapper"><input @input="${this.handleChange.bind(this)}" id="slider" type="range" .value="${this.value.toString()}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" aria-label="${ht(this.label)}" name="${ht(this.name)}" autocomplete="${ht(this.autocomplete)}" min="${ht(this.min)}" max="${ht(this.max)}" step="${ht(this.step)}" tabindex="0"> ${this.thumbLabel||this.thumbLabelPersist?H`<div id="thumb-container"><div id="thumb-label"><slot name="thumb-label">${this.value}</slot></div></div>`:""}</div><input id="${ct()}" class="hidden-input" type="hidden" value="${this.value.toString()}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" aria-label="${ht(this.label)}" name="${ht(this.name)}"></div><slot id="after" name="after"></slot></div>`}handleChange(t){t.target.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid",""),this.value=t.target.value.toString(),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}firstUpdated(){this.appendChild(this.$input),this.setAttribute("dirty","")}updated(){console.log("slider updated",this.$slider.valueAsNumber),requestAnimationFrame((()=>{this.style.setProperty("--_perc",((Number(this.value)-this.min)/(this.max-this.min)).toString())}))}},t.TkSlider.styles=l`${n('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host{--_perc:0;--_slider-track-bg:var(--slider-bg,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_slider-track-bg-active:var(--slider-bg-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--_slider-thumb-bg:var(--slider-thumb-bg,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));--_slider-thumb-border:var(--slider-thumb-bg,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([disabled]){--_slider-track-bg:var(--slider-bg-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_slider-track-bg-active:var(--slider-bg-active-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_slider-thumb-bg:var(--slider-thumb-bg-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_slider-thumb-border:var(--slider-thumb-bg,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host([thumblabel-persist]) #container,:host([thumblabel]) #container{padding-top:33px}#container{border:none;overflow:visible}#slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(90deg,var(--_slider-track-bg-active) 0,var(--_slider-track-bg-active) calc(var(--_perc)*100%),var(--_slider-track-bg) calc(var(--_perc)*100%),var(--_slider-track-bg));border:none;border-radius:0;box-sizing:border-box;cursor:grab;height:var(--slider-height,.3125rem);margin:0;outline:none;top:calc(var(--slider-height, .3125rem)*-1/2)}#slider,#thumb-container{position:relative;width:100%}#thumb-label{--_thumb-label-transform-y:0.625rem;-webkit-text-fill-color:var(--slider-thumb-label-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));align-items:center;border-radius:var(--slider-thumb-label-border-radius,100%);bottom:calc(100% + var(--slider-thumb-size, .75rem) + var(--slider-height, .3125rem) + var(--slider-thumb-space, .75rem));color:var(--slider-thumb-label-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));display:flex;font-size:var(--slider-thumb-label-font-size,.75rem);height:var(--slider-thumb-label-size,1.875rem);justify-content:center;left:calc(var(--_perc)*100% - var(--slider-thumb-size, 1.2rem)*var(--_perc));opacity:0;pointer-events:none;text-overflow:ellipsis;transform:translate(calc(-50% + var(--slider-thumb-size, 1.2rem)/2),var(--_thumb-label-transform-y));transition:var(--slider-thumb-label-transition,opacity var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--slider-thumb-label-size,1.875rem)}#thumb-label,#thumb-label:before{background:var(--slider-thumb-label-bg,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));position:absolute}#thumb-label:before{border-radius:0 50% 50% 50%;content:"";height:100%;left:0;top:0;transform:rotate(225deg);width:100%;z-index:-1}#slider:focus+#thumb-container #thumb-label,:host([thumblabel-persist]) #thumb-label,:host:focus #thumb-label{--_thumb-label-transform-y:0;opacity:1}#slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--_slider-thumb-bg);border:4px solid var(--_slider-thumb-border);border-radius:var(--slider-thumb-border-radius,100%);box-shadow:0 0 0 0 var(--slider-thumb-focus-ring-bg,#00000015);cursor:grab;height:var(--slider-thumb-size,1.2rem);position:relative;-webkit-transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--slider-thumb-size,1.2rem)}#slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background:var(--_slider-thumb-bg);border:none;border-radius:var(--slider-thumb-border-radius,100%);box-shadow:0 0 0 0 var(--slider-thumb-focus-ring-bg,#00000015);cursor:grab;height:var(--slider-thumb-size,1.2rem);position:relative;-moz-transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--slider-thumb-size,1.2rem)}#slider:focus::-webkit-slider-thumb{box-shadow:0 0 0 var(--slider-thumb-focus-ring-size,.75rem) var(--slider-thumb-focus-ring-bg,#00000015);transform:var(--slider-thumb-transform-focus,scale(1.2))}#slider:focus::-moz-range-thumb{box-shadow:0 0 0 var(--slider-thumb-focus-ring-size,.75rem) var(--slider-thumb-focus-ring-bg,#00000015);transform:var(--slider-thumb-transform-focus,scale(1.2))}')}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkSlider.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkSlider.prototype,"list",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSlider.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSlider.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSlider.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkSlider.prototype,"autocomplete",void 0),e([ot({type:Boolean,attribute:"thumblabel"}),r("design:type",Boolean)],t.TkSlider.prototype,"thumbLabel",void 0),e([ot({type:Boolean,attribute:"thumblabel-persist"}),r("design:type",Boolean)],t.TkSlider.prototype,"thumbLabelPersist",void 0),e([ot({type:String}),r("design:type",String)],t.TkSlider.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSlider.prototype,"min",void 0),e([ot({type:Number,reflect:!0}),r("design:type",Number)],t.TkSlider.prototype,"value",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSlider.prototype,"max",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSlider.prototype,"step",void 0),e([nt("#slider"),r("design:type",HTMLInputElement)],t.TkSlider.prototype,"$slider",void 0),e([nt(".hidden-input"),r("design:type",HTMLInputElement)],t.TkSlider.prototype,"$input",void 0),t.TkSlider=e([rt("tk-slider")],t.TkSlider);t.TkSwitch=class extends tt{constructor(){super(...arguments),this.checked=!1,this.required=!1,this.disabled=!1,this.readonly=!1}render(){return H`<tk-box direction="row" align-items="center"><span class="switch"><span id="knob"></span> </span><span class="label"><slot></slot></span></tk-box><input id="${ct()}" slot="none" style="display:none" type="radio" ?checked="${this.checked}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" value="${ht(this.value)}" name="${ht(this.name)}" aria-hidden="true" tabindex="-1">`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}firstUpdated(){this.appendChild(this.$input)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}handleClick(){this.checked=!this.checked,this.checked&&this.name&&this.getRootNode().querySelectorAll(`tk-radio[name="${this.name}"]`).forEach((t=>t!=this?t.checked=!1:null)),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkSwitch.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_switch-bg:var(--switch-bg,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_switch-color:var(--switch-color,var(--background,#f7f7f7))}:host .switch{align-items:center;background:var(--_switch-bg);border-radius:var(--switch-border-radius,.75rem);color:var(--_switch-color);display:inline-flex;height:var(--switch-height,.875rem);outline:none;position:relative;transition:var(--switch-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--switch-width,2.125rem)}:host .switch #knob{background:currentColor;border-radius:var(--switch-knob-border-radius,100%);box-shadow:var(--switch-knob-elevation,var(--elevation-3,0 4px 8px var(--shadow)));height:var(--switch-knob-size,1.25rem);position:absolute;transition:var(--switch-knob-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--switch-knob-size,1.25rem)}:host .label{font-size:1.1em;margin-left:10px}:host(:not([disabled])){cursor:pointer}:host([checked]){--_switch-bg:var(--switch-bg-checked,var(--primary-lighter,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*1.3))));--_switch-color:var(--switch-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]) .switch #knob{transform:translateX(calc(var(--switch-width, 2.125rem) - 100%))}:host(:focus),:host(:hover){will-change:background-color}:host([disabled]){--_switch-bg:var(--switch-bg-disabled,hsl(var(--shade-200,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,85%))));--_switch-color:var(\n \t--switch-color-disabled,hsl(var(--shade-300,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,75%)))\n );pointer-events:none}:host([disabled][checked]){--_switch-bg:var(\n \t--switch-bg-disabled-checked,hsla(var(--primary-400,var(--primary-hue,224),var(--primary-saturation,42%),var(--primary-lightness,52%)),0.1)\n );--_switch-color:var(\n \t--switch-color-disabled-checked,hsla(var(--primary-400,var(--primary-hue,224),var(--primary-saturation,42%),var(--primary-lightness,52%)),0.4)\n )}")}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkSwitch.prototype,"name",void 0),e([ot({attribute:!0,type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkSwitch.prototype,"checked",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSwitch.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSwitch.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSwitch.prototype,"readonly",void 0),e([ot({type:String,reflect:!0}),r("design:type",String)],t.TkSwitch.prototype,"value",void 0),e([nt("input"),r("design:type",HTMLInputElement)],t.TkSwitch.prototype,"$input",void 0),t.TkSwitch=e([rt("tk-switch")],t.TkSwitch);t.TkTabGroup=class extends tt{constructor(){super(),this.circle=!1,this.observe="",this.selected=""}render(){return H`<div class="tabs"><slot @click="${t=>this.clickOnTab(t.target)}" @slotchange="${()=>this.updateUnderline()}"></slot></div>${this.circle?H`<div class="circle"></div>`:H`<div class="underline"></div>`}`}firstUpdated(){if(IntersectionObserver){new IntersectionObserver(this.updateUnderline.bind(this)).observe(this)}else this.updateUnderline.bind(this)}updated(t){t.has("selected")&&(this.querySelectorAll("*").forEach((t=>t.removeAttribute("selected"))),this.querySelector(`[tab="${this.selected}"]`)?.setAttribute("selected","")),t.has("observe")&&(this.querySelector(`[tab="${this.selected}"]`)?.focus(),this.updateUnderline())}clickOnTab(t){this.querySelectorAll("*").forEach((t=>t.removeAttribute("selected"))),t.setAttribute("selected",""),this.updateUnderline(),this.dispatchEvent(new CustomEvent("change",{detail:t.getAttribute("tab"),composed:!0,bubbles:!0}))}updateUnderline(){const t=this.querySelector("[selected]");t&&setTimeout((()=>{this.circle?this.$circle.style.transform=`translate(${t.offsetLeft+t.clientWidth/2-this.$circle.clientWidth/2}px, -${this.$circle.clientWidth/2}px)`:(this.$underline.style.width=t.clientWidth+"px",this.$underline.style.transform=`translateX(${t.offsetLeft}px)`)}));
|
|
477
|
+
class Dt extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){if(super(t),this.it=U,t.type!==It)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===U||null==t)return this.ft=void 0,this.it=t;if(t===D)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Dt.directiveName="unsafeHTML",Dt.resultType=1;const Ut=(t=>(...e)=>({_$litDirective$:t,values:e}))(Dt);t.TkIcon=class extends t.TkBox{constructor(){super(...arguments),this.svg=""}static get styles(){return[...t.TkBox.styles,l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--tk-icon-color,currentColor);display:inline-flex;height:1.5em;width:1.5em}:host svg{fill:var(--color);display:block;height:100%;width:100%}")}`]}render(){return I`${this.path?I`<svg viewBox="0 0 24 24"><path d="${this.path}"></path></svg>`:I`${Ut(this.svg)}`}`}updated(t){t.has("name")&&this.name&&this.loadIcon()}async loadIcon(){const t=this.library?document.querySelector(`tk-icons[library=${this.library}]`):document.querySelector("tk-icons");t&&(this.svg=await fetch(t.resolve(this.name)).then((t=>t.blob().then((e=>({contentType:t.headers.get("Content-Type"),raw:e}))))).then((t=>t.contentType&&/svg/.test(t.contentType)?t.raw.text():"")))}},e([ot(),r("design:type",String)],t.TkIcon.prototype,"name",void 0),e([ot(),r("design:type",String)],t.TkIcon.prototype,"library",void 0),e([ot(),r("design:type",String)],t.TkIcon.prototype,"path",void 0),e([ot(),r("design:type",String)],t.TkIcon.prototype,"svg",void 0),t.TkIcon=e([rt("tk-icon")],t.TkIcon),t.TkIcons=class extends tt{constructor(){super(...arguments),this.library="default"}firstUpdated(){window.document.body.appendChild(this)}},e([ot({attribute:!1}),r("design:type",Function)],t.TkIcons.prototype,"resolve",void 0),e([ot({reflect:!0}),r("design:type",String)],t.TkIcons.prototype,"library",void 0),t.TkIcons=e([rt("tk-icons")],t.TkIcons);t.TkListItem=class extends tt{constructor(){super(),this.href="",this.target=""}render(){return I`<slot name="before"></slot><div id="content"><slot></slot></div><slot name="after"></slot>${this.href?I`<a tabindex="-1" id="ahref" href="${this.href}" rel="noreferrer" aria-label="${this.ariaLabel}"></a>`:""}`}firstUpdated(){!this.ariaLabel&&this.innerText&&(this.ariaLabel=this.innerText)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this))}disconnectedCallback(){this.removeEventListener("click",this.handleClick),super.disconnectedCallback()}handleClick(t){this.querySelector("button")&&t.target==this.querySelector("button")||this.$ahref&&t.target==this.$ahref||this.href&&this.$ahref.click()}},t.TkListItem.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--text:var(--list-item-color,var(--foreground,#454545));--color:var(--list-item-bg,var(--background,#f7f7f7));align-items:center;background:var(--color);border-radius:var(--list-item-border-radius,var(--border-radius-large,.5rem));color:var(--text);display:flex;outline:none;overflow:hidden;padding:var(--spacing-m,1rem) var(--spacing-m,1rem);position:relative;text-align:left;transition:var(--list-item-transition,background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}:host([clickable]),:host([href]){user-select:none}:host([clickable]:not([active]):not([disabled])),:host([href]:not([active]):not([disabled])){cursor:pointer}:host(:focus),:host(:hover){--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)));will-change:background,color}:host([active]:focus),:host([active]:hover){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}:host([disabled]){--text:var(--shade-dark,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*0.85)));--color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));opacity:.4;pointer-events:none}:host([active]){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}::slotted([slot=after]),::slotted([slot=before]){flex-shrink:0}::slotted([slot=before]){align-self:var(--list-item-left-align-self,center);margin:0 var(--spacing-m,1rem) 0 0}::slotted([slot=after]){align-self:var(--list-item-left-align-self,center);margin:0 0 0 var(--spacing-m,1rem)}#content{display:flex;flex-direction:column;flex-grow:1}")}`,e([ot({attribute:!0}),r("design:type",String)],t.TkListItem.prototype,"href",void 0),e([ot({attribute:!0}),r("design:type",String)],t.TkListItem.prototype,"target",void 0),e([ot({attribute:"aria-label"}),r("design:type",String)],t.TkListItem.prototype,"ariaLabel",void 0),e([lt("#ahref"),r("design:type",HTMLAnchorElement)],t.TkListItem.prototype,"$ahref",void 0),t.TkListItem=e([rt("tk-list-item"),r("design:paramtypes",[])],t.TkListItem);t.TkLoading=class extends t.TkBox{constructor(){super(...arguments),this.circle=!1,this.indeterminate=!1}static get styles(){return[...t.TkBox.styles,l`${s('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:currentColor}.circle{animation:rotator 3s linear infinite;display:inline-flex;height:2em;width:2em}.circle,.circle .path{transform-origin:center}.circle .path{stroke-dasharray:265;stroke-dashoffset:0;stroke:var(--color);animation:dash 3s ease-in-out infinite}@keyframes rotator{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dashoffset:265}50%{stroke-dashoffset:65;transform:rotate(90deg)}to{stroke-dashoffset:265;transform:rotate(1turn)}}.line{background-color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)));height:.4em;overflow:hidden;position:relative}.line .indeterminate{background-color:var(--color)}.line .indeterminate:before{animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.line .indeterminate:after,.line .indeterminate:before{background-color:inherit;bottom:0;content:"";left:0;position:absolute;top:0;will-change:left,right}.line .indeterminate:after{animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation-delay:1.15s}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}')}`]}render(){return I`${this.circle?I`<svg class="circle" viewBox="0 0 100 100"><circle class="path" fill="none" stroke-width="1em" stroke-linecap="butt" cx="50" cy="50" r="40"></circle></svg>`:I`<div class="line"><div class="indeterminate"></div></div>`}`}},e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkLoading.prototype,"circle",void 0),e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkLoading.prototype,"indeterminate",void 0),t.TkLoading=e([rt("tk-loading")],t.TkLoading);t.TkNavbar=class extends t.TkBox{static get styles(){return[...t.TkBox.styles,l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background:var(--color);color:var(--text);flex-direction:row;justify-content:space-between}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([fixed]){left:0;position:fixed;right:0;top:0;z-index:var(--navbar-z-index,100)}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-weight:var(--nav-title-font-weight,var(--font-weight-regular,500));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}")}`]}render(){return I`<div id="left"><slot name="left"></slot><slot name="title"></slot></div><div id="right"><slot name="right"></slot></div>`}},t.TkNavbar=e([rt("tk-navbar")],t.TkNavbar);t.TkTextfield=class extends tt{constructor(){super(...arguments),this._id=pt(),this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1}set value(t){this.$input?(this.$input.value=t,this.refreshAttributes()):this.initialValue=t}get value(){return null!=this.$input?this.$input.value:this.initialValue||""}render(){return I`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><slot id="slot"></slot><input id="${this._id}" @keydown="${this.handleChange.bind(this)}" @input="${this.handleChange.bind(this)}" @focusout="${this.handleChange.bind(this)}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" autocomplete="${dt(this.autocomplete)}" autocapitalize="${dt(this.autocapitalize)}" aria-label="${dt(this.label)}" type="${dt(this.type)}" name="${dt(this.name)}" list="${dt(this.list)}" pattern="${dt(this.pattern)}" minlength="${dt(this.minLength)}" maxlength="${dt(this.maxLength)}" min="${dt(this.min)}" max="${dt(this.max)}" tabindex="${this.disabled?-1:0}"></div><slot id="after" name="after"></slot></div>`}handleChange(){this.refreshAttributes()}firstUpdated(){this.$input=this.shadowRoot?.querySelector("input"),this.appendChild(this.$input),this.initialValue&&(this.value=this.initialValue)}refreshAttributes(){this.$input.value?this.setAttribute("dirty",""):this.removeAttribute("dirty"),this.$input.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid","")}focus(){this.$input.focus()}},t.TkTextfield.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}")}`,e([ot({type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkTextfield.prototype,"value",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTextfield.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"list",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextfield.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextfield.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextfield.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"autocomplete",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"autocapitalize",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"pattern",void 0),e([at(),r("design:type",String)],t.TkTextfield.prototype,"initialValue",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextfield.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"min",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"max",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"minLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextfield.prototype,"maxLength",void 0),e([st({passive:!0}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],t.TkTextfield.prototype,"handleChange",null),t.TkTextfield=e([rt("tk-textfield")],t.TkTextfield);var Nt,Ht,Rt;!function(t){t.show="show",t.force="force",t.confirm="confirm",t.input="input"}(Ht||(Ht={})),function(t){t.success="success",t.warning="warning",t.error="error",t.info="info",t.neutral="neutral"}(Rt||(Rt={})),t.TkNotie=Nt=class extends t.TkBox{constructor(t=""){super(),this.persistent=!0,this.open=!1,this.position="bottom",this.type=Ht.show,this.level=Rt.info,this.delay=3e3,this.animationDelay=300,this.buttonText="OK",this.confirmText="OK",this.cancelText="CANCEL",this.text=t}static get styles(){return[...t.TkBox.styles,l`${s(":host{bottom:0;display:none;font-size:1.6rem;left:0;margin:0;position:fixed;right:0;top:0}:host .overlay{background-color:#00000080;bottom:0;left:0;position:fixed;right:0;top:0;z-index:var(--notie-z-index,400)}:host .container{background-color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));height:fit-content;left:0;position:fixed;right:0;text-align:center;transform:translateY(100%);transition:all .15s ease-in;z-index:calc(var(--notie-z-index, 400) + 1)}:host .container.info{background-color:#4d82d6}:host .container.error{background-color:#e1715b}:host .container.warning{background-color:#d6a14d}:host .container.success{background-color:#57bf57}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background);color:var(--foreground);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.forcer{background-color:#57bf57;color:#fff}:host .button.cancel{background-color:var(--error,#e1715b);color:var(--on-error,#fff)}@media screen and (max-width:900px){:host{font-size:1.4rem}}@media screen and (max-width:750px){:host{font-size:1.2rem}}@media screen and (max-width:400px){:host{font-size:1rem}}:host([position=top]) .container{bottom:inherit;position:fixed;top:0;transform:translateY(-100%)}:host([open]) .container{transform:translateY(0)}")}`]}render(){return I`<div class="overlay" @click="${()=>this.hide(!1)}"></div><tk-box class="container ${this.level}">${this.text?I`<tk-box class="text" @click="${()=>this.type==Ht.show?this.hide(!0):null}">${this.text}</tk-box>`:""} ${this.template?I`<tk-box class="template" @click="${()=>this.type==Ht.show?this.hide(!0):null}">${this.template}</tk-box>`:""} ${this.type==Ht.force?I`<tk-box @click="${()=>this.hide(!0)}" class="button force">${this.buttonText}</tk-box>`:""} ${this.type==Ht.input?I`<tk-textfield class="input"></tk-textfield>`:""} ${this.type==Ht.confirm||this.type==Ht.input?I`<tk-box direction="row"><tk-box justify="center" align-items="center" flex="grow" @click="${()=>this.hide(!0)}" class="button confirm">${this.confirmText}</tk-box><tk-box justify="center" align-items="center" flex="grow" @click="${()=>this.hide(!1)}" class="button confirm cancel">${this.cancelText}</tk-box></tk-box>`:""}</tk-box>`}show(){return new Promise((t=>{this.resolve=t,this.style.setProperty("display","flex"),setTimeout((()=>this.open=!0)),this.dispatchEvent(new Event("didShow")),this.$input&&setTimeout((()=>this.$input.focus())),this.type==Ht.show&&setTimeout((()=>this.hide(!1)),this.delay)}))}hide(t){t&&this.type===Ht.input&&(t=this.$input.value),t||this.type!==Ht.input||(t=null),this.$input&&(this.$input.value=""),this.$container.addEventListener("transitionend",(()=>{this.dispatchEvent(new Event("didHide")),this.resolve(t),this.persistent||this.remove()}),{once:!0}),this.open=!1}static show(t){return this.getNotie(t,Ht.show).show()}static force(t){const e=this.getNotie(t,Ht.force);return t.buttonText&&(e.buttonText=t.buttonText),e.show()}static confirm(t){const e=this.getNotie(t,Ht.confirm);return t.confirmText&&(e.confirmText=t.confirmText),t.cancelText&&(e.cancelText=t.cancelText),e.show()}static input(t){const e=this.getNotie(t,Ht.input);return t.password&&(e.$input.type="password"),t.confirmText&&(e.confirmText=t.confirmText),t.cancelText&&(e.cancelText=t.cancelText),e.show()}static getNotie(t,e){const r=new Nt(t.text);return r.persistent=!1,r.type=e,r.delay=t.delay??999999999,t.template&&(r.template=t.template),t.position&&(r.position=t.position),t.background&&r.$container&&r.$container.setAttribute("background-color",t.background),t.color&&r.$container&&r.$container.setAttribute("color",t.color),t.container?t.container.shadowRoot?.appendChild(r):window.document.body.appendChild(r),t.zIndex&&r.style.setProperty("z-index",t.zIndex.toString()),r}},e([at(),r("design:type",Boolean)],t.TkNotie.prototype,"persistent",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkNotie.prototype,"open",void 0),e([ot({reflect:!0}),r("design:type",Object)],t.TkNotie.prototype,"position",void 0),e([ot({type:String}),r("design:type",String)],t.TkNotie.prototype,"type",void 0),e([ot({type:String}),r("design:type",String)],t.TkNotie.prototype,"level",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkNotie.prototype,"delay",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"text",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"buttonText",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"confirmText",void 0),e([ot(),r("design:type",String)],t.TkNotie.prototype,"cancelText",void 0),e([ot({type:Object}),r("design:type",Object)],t.TkNotie.prototype,"template",void 0),e([lt("tk-textfield"),r("design:type",t.TkTextfield)],t.TkNotie.prototype,"$input",void 0),e([lt(".container"),r("design:type",HTMLElement)],t.TkNotie.prototype,"$container",void 0),t.TkNotie=Nt=e([rt("tk-notie"),r("design:paramtypes",[String])],t.TkNotie);t.TkPages=class extends tt{constructor(){super(...arguments),this._page="",this.selected="",this.handleScroll=!1,this.scrollHistory={}}set page(t){let e=this._page;if(this._page=t,e&&this.handleScroll){if(this.querySelector(`[page=${e}]`)){const t=document.scrollingElement||document.documentElement;this.scrollHistory[e]=t.scrollTop}}this.requestUpdate("page",e)}get page(){return this._page}render(){return I`<slot></slot>`}updated(t){t.has("page")&&this.querySelectorAll(":scope > *").forEach((t=>{const e=t.getAttribute("page")??"default",r=document.scrollingElement||document.documentElement;e==this.page?(t.removeAttribute("hidden"),""!=this.selected&&t.setAttribute(this.selected,""),this.handleScroll&&!t.hasAttribute("no-scroll")&&(r.scrollTop=this.scrollHistory[e]?this.scrollHistory[e]:0)):(t.setAttribute("hidden",""),""!=this.selected&&t.removeAttribute(this.selected))}))}},t.TkPages.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}")}`,e([ot({attribute:"page",type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkPages.prototype,"page",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkPages.prototype,"selected",void 0),e([ot({attribute:"handle-scroll",type:Boolean}),r("design:type",Boolean)],t.TkPages.prototype,"handleScroll",void 0),t.TkPages=e([rt("tk-pages")],t.TkPages);t.TkProgress=class extends tt{constructor(){super(...arguments),this.circle=!1,this.indeterminate=!1,this.value=0,this.buffer=0}render(){return I`${this.circle?I`<svg class="spinner" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle class="path" fill="none" stroke-width="10" stroke-linecap="butt" cx="50" cy="50" r="40"></circle></svg>`:I`${this.indeterminate?I`<div class="progress-materializecss"><div class="indeterminate"></div></div>`:I`<progress class="progress" max="100" value="50"></progress>`}`}`}},t.TkProgress.styles=l`${s('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary)}:host([accent]){--color:var(--accent)}:host([error]){--color:var(--error)}.spinner{animation:rotator 3s linear infinite;height:1em;transform-origin:center;width:1em}.spinner .path{stroke-dasharray:265;stroke-dashoffset:0;stroke:var(--color);animation:dash 3s ease-in-out infinite;transform-origin:center}@keyframes rotator{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dashoffset:265}50%{stroke-dashoffset:65;transform:rotate(90deg)}to{stroke-dashoffset:265;transform:rotate(1turn)}}.progress-materializecss{background-color:var(--shade-lighter);display:block;height:.3em;margin:5px 0;overflow:hidden;position:relative}.progress-materializecss .indeterminate{background-color:var(--primary)}.progress-materializecss .indeterminate:before{animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.progress-materializecss .indeterminate:after,.progress-materializecss .indeterminate:before{background-color:inherit;bottom:0;content:"";left:0;position:absolute;top:0;will-change:left,right}.progress-materializecss .indeterminate:after{animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation-delay:1.15s}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}')}`,e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkProgress.prototype,"circle",void 0),e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkProgress.prototype,"indeterminate",void 0),e([ot({attribute:!0,type:Number}),r("design:type",Number)],t.TkProgress.prototype,"value",void 0),e([ot({attribute:!0,type:Number}),r("design:type",Number)],t.TkProgress.prototype,"buffer",void 0),t.TkProgress=e([rt("tk-progress")],t.TkProgress);t.TkRadio=class extends tt{constructor(){super(...arguments),this.checked=!1,this.required=!1,this.disabled=!1,this.readonly=!1}render(){return I`<tk-box direction="row" align-items="center"><div tabindex="0" class="radio"><div id="dot"></div></div><span class="label"><slot></slot></span></tk-box><input id="${pt()}" slot="none" style="display:none" type="radio" ?checked="${this.checked}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" value="${dt(this.value)}" name="${dt(this.name)}" aria-hidden="true" tabindex="-1">`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}firstUpdated(){this.appendChild(this.$input)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}handleClick(){this.checked=!this.checked,this.checked&&this.name&&this.getRootNode().querySelectorAll(`tk-radio[name="${this.name}"]`).forEach((t=>t!=this?t.checked=!1:null)),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkRadio.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_radio-bg:var(--radio-bg,#0000);--_radio-color:var(--radio-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));display:inline-flex}:host .radio{align-items:center;background:var(--_radio-bg);border:var(--radio-border-config,.125rem solid) currentColor;border-radius:var(--radio-border-radius,100%);color:var(--_radio-color);display:inline-flex;height:var(--radio-size,1.25rem);justify-content:center;outline:none;position:relative;transition:var(--radio-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--radio-size,1.25rem)}:host .label{font-size:1.1em;margin-left:10px}:host(:not([disabled])){cursor:pointer}:host([checked]){--_radio-bg:var(--radio-bg-checked,#0000);--_radio-color:var(--radio-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]) #dot{transform:scale(1)}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #dot,:host(:hover) #dot{will-change:transform,background}:host([disabled]){--_radio-bg:var(--radio-bg-disabled,#0000);--_radio-color:var(--radio-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));pointer-events:none}:host([disabled][checked]){--_radio-bg:var(--radio-bg-disabled-checked,#0000);--_radio-color:var(--radio-color-disabled-checked,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}#dot{background:currentColor;border-radius:var(--radio-dot-border-radius,100%);height:var(--radio-dot-size,.625rem);transform:scale(0);transition:var(--radio-dot-transition,transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--radio-dot-size,.625rem)}#ripple{transform:var(--radio-ripple-transform,translate(-50%,-50%) scale(1.8))}")}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkRadio.prototype,"name",void 0),e([ot({attribute:!0,type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkRadio.prototype,"checked",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkRadio.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkRadio.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkRadio.prototype,"readonly",void 0),e([ot({type:String,reflect:!0}),r("design:type",String)],t.TkRadio.prototype,"value",void 0),e([lt("input"),r("design:type",HTMLInputElement)],t.TkRadio.prototype,"$input",void 0),t.TkRadio=e([rt("tk-radio")],t.TkRadio);t.TkSelect=class extends tt{constructor(){super(...arguments),this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1}set value(t){this.$select?(this.$select.value=t,this.refreshAttributes()):this.initialValue=t}get value(){return null!=this.$select?this.$select.value:this.initialValue||""}render(){return I`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><slot id="slot"></slot><select id="${pt()}" @keydown="${this.handleChange.bind(this)}" @input="${this.handleChange.bind(this)}" @focusout="${this.handleChange.bind(this)}" @change="${this.handleChange.bind(this)}" .value="${this.initialValue}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" name="${dt(this.name)}" autocomplete="${dt(this.autocomplete)}" tabindex="${this.disabled?-1:0}"></select> <svg id="arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 25" preserveAspectRatio="none"><polygon points="0,0 50,0 25,25"/></svg></div><slot id="after" name="after"></slot></div>`}handleChange(){this.refreshAttributes()}firstUpdated(){this.$select=this.shadowRoot?.querySelector("select"),this.appendChild(this.$select);this.querySelectorAll("option").forEach((t=>this.$select.appendChild(t))),this.initialValue&&(this.value=this.initialValue)}refreshAttributes(){this.$select.value?this.setAttribute("dirty",""):this.removeAttribute("dirty"),this.$select.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid",""),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkSelect.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}#arrow{fill:var(--_input-state-color);height:8px;position:absolute;right:0;top:50%;transform:translate(-100%,-50%);z-index:-1}::slotted(option){display:none}:host(:not([dirty])) ::slotted(select){opacity:0}")}`,e([ot({type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkSelect.prototype,"value",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkSelect.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"list",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSelect.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSelect.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSelect.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"autocomplete",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"pattern",void 0),e([at(),r("design:type",String)],t.TkSelect.prototype,"initialValue",void 0),e([ot({type:String}),r("design:type",String)],t.TkSelect.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"min",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"max",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"minLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSelect.prototype,"maxLength",void 0),e([st({passive:!0}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],t.TkSelect.prototype,"handleChange",null),t.TkSelect=e([rt("tk-select")],t.TkSelect);t.TkSlider=class extends tt{constructor(){super(...arguments),this.required=!1,this.disabled=!1,this.readonly=!1,this.thumbLabel=!1,this.thumbLabelPersist=!1,this.min=0,this.value=this.min,this.max=100}render(){return I`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><div id="slot-wrapper"><input @input="${this.handleChange.bind(this)}" id="slider" type="range" .value="${this.value.toString()}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" aria-label="${dt(this.label)}" name="${dt(this.name)}" autocomplete="${dt(this.autocomplete)}" min="${dt(this.min)}" max="${dt(this.max)}" step="${dt(this.step)}" tabindex="0"> ${this.thumbLabel||this.thumbLabelPersist?I`<div id="thumb-container"><div id="thumb-label"><slot name="thumb-label">${this.value}</slot></div></div>`:""}</div><input id="${pt()}" class="hidden-input" type="hidden" value="${this.value.toString()}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" aria-label="${dt(this.label)}" name="${dt(this.name)}"></div><slot id="after" name="after"></slot></div>`}handleChange(t){t.target.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid",""),this.value=t.target.value.toString(),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}firstUpdated(){this.appendChild(this.$input),this.setAttribute("dirty","")}updated(){console.log("slider updated",this.$slider.valueAsNumber),requestAnimationFrame((()=>{this.style.setProperty("--_perc",((Number(this.value)-this.min)/(this.max-this.min)).toString())}))}},t.TkSlider.styles=l`${s('*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host{--_perc:0;--_slider-track-bg:var(--slider-bg,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_slider-track-bg-active:var(--slider-bg-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--_slider-thumb-bg:var(--slider-thumb-bg,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));--_slider-thumb-border:var(--slider-thumb-bg,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([disabled]){--_slider-track-bg:var(--slider-bg-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_slider-track-bg-active:var(--slider-bg-active-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_slider-thumb-bg:var(--slider-thumb-bg-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_slider-thumb-border:var(--slider-thumb-bg,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host([thumblabel-persist]) #container,:host([thumblabel]) #container{padding-top:33px}#container{border:none;overflow:visible}#slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(90deg,var(--_slider-track-bg-active) 0,var(--_slider-track-bg-active) calc(var(--_perc)*100%),var(--_slider-track-bg) calc(var(--_perc)*100%),var(--_slider-track-bg));border:none;border-radius:0;box-sizing:border-box;cursor:grab;height:var(--slider-height,.3125rem);margin:0;outline:none;top:calc(var(--slider-height, .3125rem)*-1/2)}#slider,#thumb-container{position:relative;width:100%}#thumb-label{--_thumb-label-transform-y:0.625rem;-webkit-text-fill-color:var(--slider-thumb-label-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));align-items:center;border-radius:var(--slider-thumb-label-border-radius,100%);bottom:calc(100% + var(--slider-thumb-size, .75rem) + var(--slider-height, .3125rem) + var(--slider-thumb-space, .75rem));color:var(--slider-thumb-label-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));display:flex;font-size:var(--slider-thumb-label-font-size,.75rem);height:var(--slider-thumb-label-size,1.875rem);justify-content:center;left:calc(var(--_perc)*100% - var(--slider-thumb-size, 1.2rem)*var(--_perc));opacity:0;pointer-events:none;text-overflow:ellipsis;transform:translate(calc(-50% + var(--slider-thumb-size, 1.2rem)/2),var(--_thumb-label-transform-y));transition:var(--slider-thumb-label-transition,opacity var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--slider-thumb-label-size,1.875rem)}#thumb-label,#thumb-label:before{background:var(--slider-thumb-label-bg,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));position:absolute}#thumb-label:before{border-radius:0 50% 50% 50%;content:"";height:100%;left:0;top:0;transform:rotate(225deg);width:100%;z-index:-1}#slider:focus+#thumb-container #thumb-label,:host([thumblabel-persist]) #thumb-label,:host:focus #thumb-label{--_thumb-label-transform-y:0;opacity:1}#slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--_slider-thumb-bg);border:4px solid var(--_slider-thumb-border);border-radius:var(--slider-thumb-border-radius,100%);box-shadow:0 0 0 0 var(--slider-thumb-focus-ring-bg,#00000015);cursor:grab;height:var(--slider-thumb-size,1.2rem);position:relative;-webkit-transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--slider-thumb-size,1.2rem)}#slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background:var(--_slider-thumb-bg);border:none;border-radius:var(--slider-thumb-border-radius,100%);box-shadow:0 0 0 0 var(--slider-thumb-focus-ring-bg,#00000015);cursor:grab;height:var(--slider-thumb-size,1.2rem);position:relative;-moz-transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));transition:var(--slider-thumb-transition,transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--slider-thumb-size,1.2rem)}#slider:focus::-webkit-slider-thumb{box-shadow:0 0 0 var(--slider-thumb-focus-ring-size,.75rem) var(--slider-thumb-focus-ring-bg,#00000015);transform:var(--slider-thumb-transform-focus,scale(1.2))}#slider:focus::-moz-range-thumb{box-shadow:0 0 0 var(--slider-thumb-focus-ring-size,.75rem) var(--slider-thumb-focus-ring-bg,#00000015);transform:var(--slider-thumb-transform-focus,scale(1.2))}')}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkSlider.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkSlider.prototype,"list",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSlider.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSlider.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSlider.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkSlider.prototype,"autocomplete",void 0),e([ot({type:Boolean,attribute:"thumblabel"}),r("design:type",Boolean)],t.TkSlider.prototype,"thumbLabel",void 0),e([ot({type:Boolean,attribute:"thumblabel-persist"}),r("design:type",Boolean)],t.TkSlider.prototype,"thumbLabelPersist",void 0),e([ot({type:String}),r("design:type",String)],t.TkSlider.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSlider.prototype,"min",void 0),e([ot({type:Number,reflect:!0}),r("design:type",Number)],t.TkSlider.prototype,"value",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSlider.prototype,"max",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkSlider.prototype,"step",void 0),e([lt("#slider"),r("design:type",HTMLInputElement)],t.TkSlider.prototype,"$slider",void 0),e([lt(".hidden-input"),r("design:type",HTMLInputElement)],t.TkSlider.prototype,"$input",void 0),t.TkSlider=e([rt("tk-slider")],t.TkSlider);t.TkSwitch=class extends tt{constructor(){super(...arguments),this.checked=!1,this.required=!1,this.disabled=!1,this.readonly=!1}render(){return I`<tk-box direction="row" align-items="center"><span class="switch"><span id="knob"></span> </span><span class="label"><slot></slot></span></tk-box><input id="${pt()}" slot="none" style="display:none" type="radio" ?checked="${this.checked}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" value="${dt(this.value)}" name="${dt(this.name)}" aria-hidden="true" tabindex="-1">`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.onKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.onKeyDown)}firstUpdated(){this.appendChild(this.$input)}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),t.stopPropagation(),this.click())}handleClick(){this.checked=!this.checked,this.checked&&this.name&&this.getRootNode().querySelectorAll(`tk-radio[name="${this.name}"]`).forEach((t=>t!=this?t.checked=!1:null)),setTimeout((()=>this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))}},t.TkSwitch.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_switch-bg:var(--switch-bg,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_switch-color:var(--switch-color,var(--background,#f7f7f7))}:host .switch{align-items:center;background:var(--_switch-bg);border-radius:var(--switch-border-radius,.75rem);color:var(--_switch-color);display:inline-flex;height:var(--switch-height,.875rem);outline:none;position:relative;transition:var(--switch-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:var(--switch-width,2.125rem)}:host .switch #knob{background:currentColor;border-radius:var(--switch-knob-border-radius,100%);box-shadow:var(--switch-knob-elevation,var(--elevation-3,0 4px 8px var(--shadow)));height:var(--switch-knob-size,1.25rem);position:absolute;transition:var(--switch-knob-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:var(--switch-knob-size,1.25rem)}:host .label{font-size:1.1em;margin-left:10px}:host(:not([disabled])){cursor:pointer}:host([checked]){--_switch-bg:var(--switch-bg-checked,var(--primary-lighter,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*1.3))));--_switch-color:var(--switch-color-checked,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([checked]) .switch #knob{transform:translateX(calc(var(--switch-width, 2.125rem) - 100%))}:host(:focus),:host(:hover){will-change:background-color}:host([disabled]){--_switch-bg:var(--switch-bg-disabled,hsl(var(--shade-200,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,85%))));--_switch-color:var(\n \t--switch-color-disabled,hsl(var(--shade-300,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,75%)))\n );pointer-events:none}:host([disabled][checked]){--_switch-bg:var(\n \t--switch-bg-disabled-checked,hsla(var(--primary-400,var(--primary-hue,224),var(--primary-saturation,42%),var(--primary-lightness,52%)),0.1)\n );--_switch-color:var(\n \t--switch-color-disabled-checked,hsla(var(--primary-400,var(--primary-hue,224),var(--primary-saturation,42%),var(--primary-lightness,52%)),0.4)\n )}")}`,e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkSwitch.prototype,"name",void 0),e([ot({attribute:!0,type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkSwitch.prototype,"checked",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSwitch.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSwitch.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkSwitch.prototype,"readonly",void 0),e([ot({type:String,reflect:!0}),r("design:type",String)],t.TkSwitch.prototype,"value",void 0),e([lt("input"),r("design:type",HTMLInputElement)],t.TkSwitch.prototype,"$input",void 0),t.TkSwitch=e([rt("tk-switch")],t.TkSwitch);t.TkTabGroup=class extends tt{constructor(){super(),this.circle=!1,this.observe="",this.selected=""}render(){return I`<div class="tabs"><slot @click="${t=>this.clickOnTab(t.target)}" @slotchange="${()=>this.updateUnderline()}"></slot></div>${this.circle?I`<div class="circle"></div>`:I`<div class="underline"></div>`}`}firstUpdated(){if(IntersectionObserver){new IntersectionObserver(this.updateUnderline.bind(this)).observe(this)}else this.updateUnderline.bind(this)}updated(t){t.has("selected")&&(this.querySelectorAll("*").forEach((t=>t.removeAttribute("selected"))),this.querySelector(`[tab="${this.selected}"]`)?.setAttribute("selected","")),t.has("observe")&&(this.querySelector(`[tab="${this.selected}"]`)?.focus(),this.updateUnderline())}clickOnTab(t){this.querySelectorAll("*").forEach((t=>t.removeAttribute("selected"))),t.setAttribute("selected",""),this.updateUnderline(),this.dispatchEvent(new CustomEvent("change",{detail:t.getAttribute("tab"),composed:!0,bubbles:!0}))}updateUnderline(){const t=this.querySelector("[selected]");t&&setTimeout((()=>{this.circle?this.$circle.style.transform=`translate(${t.offsetLeft+t.clientWidth/2-this.$circle.clientWidth/2}px, -${this.$circle.clientWidth/2}px)`:(this.$underline.style.width=t.clientWidth+"px",this.$underline.style.transform=`translateX(${t.offsetLeft}px)`)}));
|
|
159
478
|
// else {
|
|
160
479
|
// if (this.circle) {
|
|
161
480
|
// this.$circle.style.transform = `translate(-100px, -${this.$circle.clientWidth / 2}px)`;
|
|
@@ -163,4 +482,4 @@ class ut extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e
|
|
|
163
482
|
// this.$underline.style.width = "0";
|
|
164
483
|
// }
|
|
165
484
|
// }
|
|
166
|
-
}},t.TkTabGroup.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));display:inline-block;overflow:hidden;position:relative}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}.tabs{display:flex}:host(:not([circle])) .tabs{border-bottom:2px solid var(--shade-lighter)}.underline{height:2px;margin-top:-2px;transition:transform .2s ease;width:0}.circle,.underline{background-color:var(--color)}.circle{border-radius:var(--border-radius-circle,50%);height:8px;transition:transform .3s ease;width:8px}")}`,e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkTabGroup.prototype,"circle",void 0),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTabGroup.prototype,"observe",void 0),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTabGroup.prototype,"selected",void 0),e([nt(".underline"),r("design:type",HTMLElement)],t.TkTabGroup.prototype,"$underline",void 0),e([nt(".circle"),r("design:type",HTMLElement)],t.TkTabGroup.prototype,"$circle",void 0),t.TkTabGroup=e([rt("tk-tab-group"),r("design:paramtypes",[])],t.TkTabGroup);t.TkTag=class extends tt{render(){return H`<div class="tag"><slot></slot></div>`}},t.TkTag.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary);--text:var(--on-primary);background:var(--color);box-sizing:border-box;color:var(--text);display:flex;flex-grow:1;height:var(--navbar-height,48px);justify-content:space-between;padding:var(--navbar-padding,var(--spacing-s,.5rem));position:relative;transition:var(--nav-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));z-index:var(--navbar-z-index,100)}:host([inverted]){--color:var(--on-primary);--text:var(--primary)}:host([fixed]){left:0;position:fixed;top:0;width:100%}:host([shadow]){box-shadow:var(--nav-elevation,var(--elevation-5,0 12px 24px var(--shadow)))}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-size:var(--nav-title-font-size,var(--font-size-l,1.25rem));font-weight:var(--nav-title-font-weight,var(--font-weight-regular,500));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}")}`,t.TkTag=e([rt("tk-tag")],t.TkTag);t.TkTextarea=class extends tt{constructor(){super(...arguments),this._id=ct(),this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=1}set value(t){this.$input?(this.$input.value=t,this.refreshAttributes()):this.initialValue=t}get value(){return null!=this.$input?this.$input.value:this.initialValue||""}render(){return H`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><slot id="slot"></slot><textarea id="${this._id}" @keydown="${this.handleChange.bind(this)}" @input="${this.handleChange.bind(this)}" @focusout="${this.handleChange.bind(this)}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" aria-label="${ht(this.label)}" name="${ht(this.name)}" pattern="${ht(this.pattern)}" autocomplete="${ht(this.autocomplete)}" autocapitalize="${ht(this.autocapitalize)}" minlength="${ht(this.minLength)}" maxlength="${ht(this.maxLength)}" rows="${this.rows}" tabindex="${this.disabled?-1:0}"></textarea></div><slot id="after" name="after"></slot></div>`}handleChange(){this.refreshAttributes()}firstUpdated(){this.$input=this.shadowRoot?.querySelector("textarea"),this.appendChild(this.$input),this.initialValue&&(this.value=this.initialValue)}refreshAttributes(){this.$input.value?this.setAttribute("dirty",""):this.removeAttribute("dirty"),this.$input.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid","")}focus(){this.$input.focus()}},t.TkTextarea.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}#wrapper ::slotted(textarea){font-family:inherit;height:var(--textarea-height,var(--_textarea-height));max-height:var(--textarea-max-height);min-height:var(--textarea-min-height,var(--textarea-height,var(--_textarea-height)));resize:var(--textarea-resize,none)}:host(:focus) ::slotted(textarea),:host(:hover) ::slotted(textarea){will-change:height}")}`,e([ot({type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkTextarea.prototype,"value",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTextarea.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"list",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextarea.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextarea.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextarea.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"autocomplete",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"autocapitalize",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"pattern",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"initialValue",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextarea.prototype,"minLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextarea.prototype,"maxLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextarea.prototype,"rows",void 0),e([st({passive:!0}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],t.TkTextarea.prototype,"handleChange",null),t.TkTextarea=e([rt("tk-textarea")],t.TkTextarea);t.TkTheme=class extends tt{constructor(){super(...arguments),this.primary="#8970bf",this.onPrimary="#FFFFFF",this.accent="#E69A8D",this.onAccent="#FFFFFF",this.shade="#AAAAAA",this.onShade="#FFFFFF",this.error="#F44336",this.onError="#FFFFFF",this.foreground="#FFFFFF",this.background="#000",this.forceBody=!1,this.inverted=!1}render(){return H`<slot></slot>`}updated(){this.setThemeColor()}connectedCallback(){super.connectedCallback(),this.addEventListener("turn-theme-to-inverted",(()=>this.turnThemeToInverted()),{passive:!0}),this.addEventListener("turn-theme-to-non-inverted",(()=>this.turnThemeToNonInverted()),{passive:!0}),this.addEventListener("set-theme",this.setTheme),this.addEventListener("set-theme-font-size",this.setThemeFontSize)}disconnectedCallback(){this.removeEventListener("turn-theme-to-inverted",this.turnThemeToInverted),this.removeEventListener("turn-theme-to-non-inverted",this.turnThemeToNonInverted),this.removeEventListener("set-theme",this.setTheme),this.removeEventListener("set-theme-font-size",this.setThemeFontSize),super.disconnectedCallback()}setTheme(t){const e=t;this.background=e.detail.background?e.detail.background:this.background,this.foreground=e.detail.foreground?e.detail.foreground:this.foreground,this.primary=e.detail.primary?e.detail.primary:this.primary,this.onPrimary=e.detail.onPrimary?e.detail.onPrimary:this.onPrimary,this.accent=e.detail.accent?e.detail.accent:this.accent,this.onAccent=e.detail.onAccent?e.detail.onAccent:this.onAccent}setThemeFontSize(t){const e=t;console.log("ev",e),this.style.setProperty("--font-size",e.detail)}turnThemeToInverted(){this.inverted=!0,this.forceBody&&this.setBodyStyle()}turnThemeToNonInverted(){this.inverted=!1,this.forceBody&&this.setBodyStyle()}hexToHSL(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(t);if(null==e)return["0","0%","0%"];const[,r,i,o]=e,a=parseInt(r,16)/255,s=parseInt(i,16)/255,n=parseInt(o,16)/255,l=Math.max(a,s,n),h=Math.min(a,s,n);let d=0,c=0,p=(l+h)/2;if(l!=h){const t=l-h;switch(c=p>.5?t/(2-l-h):t/(l+h),l){case a:d=(s-n)/t+(s<n?6:0);break;case s:d=(n-a)/t+2;break;case n:d=(a-s)/t+4}d/=6}return[(360*d).toString(),(100*c).toString()+"%",(100*p).toString()+"%"]}setThemeColor(){const t=this.hexToHSL(this.primary);this.style.setProperty("--primary-h",t[0]),this.style.setProperty("--primary-s",t[1]),this.style.setProperty("--primary-l",t[2]);const e=this.hexToHSL(this.onPrimary);this.style.setProperty("--on-primary-h",e[0]),this.style.setProperty("--on-primary-s",e[1]),this.style.setProperty("--on-primary-l",e[2]);const r=this.hexToHSL(this.accent);this.style.setProperty("--accent-h",r[0]),this.style.setProperty("--accent-s",r[1]),this.style.setProperty("--accent-l",r[2]);const i=this.hexToHSL(this.onAccent);this.style.setProperty("--on-accent-h",i[0]),this.style.setProperty("--on-accent-s",i[1]),this.style.setProperty("--on-accent-l",i[2]);const o=this.hexToHSL(this.shade);this.style.setProperty("--shade-h",o[0]),this.style.setProperty("--shade-s",o[1]),this.style.setProperty("--shade-l",o[2]);const a=this.hexToHSL(this.onShade);this.style.setProperty("--on-shade-h",a[0]),this.style.setProperty("--on-shade-s",a[1]),this.style.setProperty("--on-shade-l",a[2]);const s=this.hexToHSL(this.error);this.style.setProperty("--error-h",s[0]),this.style.setProperty("--error-s",s[1]),this.style.setProperty("--error-l",s[2]);const n=this.hexToHSL(this.onError);this.style.setProperty("--on-error-h",n[0]),this.style.setProperty("--on-error-s",n[1]),this.style.setProperty("--on-error-l",n[2]);const l=this.hexToHSL(this.foreground);this.style.setProperty("--theme-foreground",`hsl(${l[0]},${l[1]},${l[2]})`);const h=this.hexToHSL(this.background);this.style.setProperty("--theme-background",`hsl(${h[0]},${h[1]},${h[2]})`),this.forceBody&&this.setBodyStyle()}setBodyStyle(){let t=this.hexToHSL(this.foreground),e=this.hexToHSL(this.background);this.inverted&&(t=this.hexToHSL(this.background),e=this.hexToHSL(this.foreground)),document.body.style.setProperty("background",`hsl(${e[0]},${e[1]},${e[2]})`),document.body.style.setProperty("color",`hsl(${t[0]},${t[1]},${t[2]})`)}},t.TkTheme.styles=l`${n("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--background:var(--theme-background);--foreground:var(--theme-foreground);--primary-lighter:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.3));--primary-light:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.15));--primary:hsl(var(--primary-h),var(--primary-s),var(--primary-l));--primary-dark:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.85));--primary-darker:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.7));--on-primary-lighter:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.3));--on-primary-light:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.15));--on-primary:hsl(var(--on-primary-h),var(--on-primary-s),var(--on-primary-l));--on-primary-dark:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.85));--on-primary-darker:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.7));--accent-lighter:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.3));--accent-light:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.15));--accent:hsl(var(--accent-h),var(--accent-s),var(--accent-l));--accent-dark:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.85));--accent-darker:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.7));--on-accent-lighter:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.3));--on-accent-light:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.15));--on-accent:hsl(var(--on-accent-h),var(--on-accent-s),var(--on-accent-l));--on-accent-dark:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.85));--on-accent-darker:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.7));--shade-lighter:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.3));--shade-light:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.15));--shade:hsl(var(--shade-h),var(--shade-s),var(--shade-l));--shade-dark:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.85));--shade-darker:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.7));--on-shade-lighter:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.3));--on-shade-light:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.15));--on-shade:hsl(var(--on-shade-h),var(--on-shade-s),var(--on-shade-l));--on-shade-dark:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.85));--on-shade-darker:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.7));--error-lighter:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.3));--error-light:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.15));--error:hsl(var(--error-h),var(--error-s),var(--error-l));--error-dark:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.85));--error-darker:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.7));--on-error-lighter:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.3));--on-error-light:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.15));--on-error:hsl(var(--on-error-h),var(--on-error-s),var(--on-error-l));--on-error-dark:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.85));--on-error-darker:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.7));--shadow-lighter:#0000001a;--shadow-light:#00000026;--shadow:#0003;--shadow-dark:#0006;--shadow-darker:#0009;background-color:var(--background);color:var(--foreground);font-family:var(--font-family,Roboto,sans-serif);font-size:var(--font-size,1rem)}:host([inverted]){--background:var(--theme-foreground);--foreground:var(--theme-background);--primary-lighter:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.7));--primary-light:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.85));--primary:hsl(var(--primary-h),var(--primary-s),var(--primary-l));--primary-dark:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.15));--primary-darker:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.3));--on-primary-lighter:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.7));--on-primary-light:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.85));--on-primary:hsl(var(--on-primary-h),var(--on-primary-s),var(--on-primary-l));--on-primary-dark:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.15));--on-primary-darker:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.3));--accent-lighter:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.7));--accent-light:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.85));--accent:hsl(var(--accent-h),var(--accent-s),var(--accent-l));--accent-dark:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.15));--accent-darker:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.3));--on-accent-lighter:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.7));--on-accent-light:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.85));--on-accent:hsl(var(--on-accent-h),var(--on-accent-s),var(--on-accent-l));--on-accent-dark:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.15));--on-accent-darker:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.3));--shade-lighter:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.7));--shade-light:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.85));--shade:hsl(var(--shade-h),var(--shade-s),var(--shade-l));--shade-dark:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.15));--shade-darker:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.3));--on-shade-lighter:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.7));--on-shade-light:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.85));--on-shade:hsl(var(--on-shade-h),var(--on-shade-s),var(--on-shade-l));--on-shade-dark:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.15));--on-shade-darker:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.3));--error-lighter:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.7));--error-light:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.85));--error:hsl(var(--error-h),var(--error-s),var(--error-l));--error-dark:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.15));--error-darker:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.3));--on-error-lighter:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.7));--on-error-light:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.85));--on-error:hsl(var(--on-error-h),var(--on-error-s),var(--on-error-l));--on-error-dark:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.15));--on-error-darker:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.3));--shadow-lighter:#ffffff1a;--shadow-light:#ffffff26;--shadow:#fff3;--shadow-dark:#fff6;--shadow-darker:#fff9}")}`,e([ot(),r("design:type",String)],t.TkTheme.prototype,"primary",void 0),e([ot({attribute:"on-primary"}),r("design:type",String)],t.TkTheme.prototype,"onPrimary",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"accent",void 0),e([ot({attribute:"on-accent"}),r("design:type",String)],t.TkTheme.prototype,"onAccent",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"shade",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"onShade",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"error",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"onError",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"foreground",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"background",void 0),e([ot({type:Boolean,attribute:"force-body",reflect:!0}),r("design:type",Boolean)],t.TkTheme.prototype,"forceBody",void 0),e([ot({type:Boolean,attribute:!0,reflect:!0}),r("design:type",Boolean)],t.TkTheme.prototype,"inverted",void 0),t.TkTheme=e([rt("tk-theme")],t.TkTheme),Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
485
|
+
}},t.TkTabGroup.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));display:inline-block;overflow:hidden;position:relative}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)))}.tabs{display:flex}:host(:not([circle])) .tabs{border-bottom:2px solid var(--shade-lighter)}.underline{height:2px;margin-top:-2px;transition:transform .2s ease;width:0}.circle,.underline{background-color:var(--color)}.circle{border-radius:var(--border-radius-circle,50%);height:8px;transition:transform .3s ease;width:8px}")}`,e([ot({attribute:!0,type:Boolean}),r("design:type",Boolean)],t.TkTabGroup.prototype,"circle",void 0),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTabGroup.prototype,"observe",void 0),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTabGroup.prototype,"selected",void 0),e([lt(".underline"),r("design:type",HTMLElement)],t.TkTabGroup.prototype,"$underline",void 0),e([lt(".circle"),r("design:type",HTMLElement)],t.TkTabGroup.prototype,"$circle",void 0),t.TkTabGroup=e([rt("tk-tab-group"),r("design:paramtypes",[])],t.TkTabGroup);t.TkTag=class extends tt{render(){return I`<div class="tag"><slot></slot></div>`}},t.TkTag.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary);--text:var(--on-primary);background:var(--color);box-sizing:border-box;color:var(--text);display:flex;flex-grow:1;height:var(--navbar-height,48px);justify-content:space-between;padding:var(--navbar-padding,var(--spacing-s,.5rem));position:relative;transition:var(--nav-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),box-shadow var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));z-index:var(--navbar-z-index,100)}:host([inverted]){--color:var(--on-primary);--text:var(--primary)}:host([fixed]){left:0;position:fixed;top:0;width:100%}:host([shadow]){box-shadow:var(--nav-elevation,var(--elevation-5,0 12px 24px var(--shadow)))}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-size:var(--nav-title-font-size,var(--font-size-l,1.25rem));font-weight:var(--nav-title-font-weight,var(--font-weight-regular,500));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}")}`,t.TkTag=e([rt("tk-tag")],t.TkTag);t.TkTextarea=class extends tt{constructor(){super(...arguments),this._id=pt(),this.type="text",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=1}set value(t){this.$input?(this.$input.value=t,this.refreshAttributes()):this.initialValue=t}get value(){return null!=this.$input?this.$input.value:this.initialValue||""}render(){return I`<div id="container"><slot id="before" name="before"></slot><div id="wrapper"><div id="label">${this.label}</div><slot id="slot"></slot><textarea id="${this._id}" @keydown="${this.handleChange.bind(this)}" @input="${this.handleChange.bind(this)}" @focusout="${this.handleChange.bind(this)}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" aria-label="${dt(this.label)}" name="${dt(this.name)}" pattern="${dt(this.pattern)}" autocomplete="${dt(this.autocomplete)}" autocapitalize="${dt(this.autocapitalize)}" minlength="${dt(this.minLength)}" maxlength="${dt(this.maxLength)}" rows="${this.rows}" tabindex="${this.disabled?-1:0}"></textarea></div><slot id="after" name="after"></slot></div>`}handleChange(){this.refreshAttributes()}firstUpdated(){this.$input=this.shadowRoot?.querySelector("textarea"),this.appendChild(this.$input),this.initialValue&&(this.value=this.initialValue)}refreshAttributes(){this.$input.value?this.setAttribute("dirty",""):this.removeAttribute("dirty"),this.$input.checkValidity()?this.removeAttribute("invalid"):this.setAttribute("invalid","")}focus(){this.$input.focus()}},t.TkTextarea.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--_input-state-color:var(--input-state-color-inactive,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,#0000);--_input-border-radius:0;--_input-color:var(--input-color,var(--foreground,#454545));--_input-label-color:var(--input-label-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-border-style:var(--input-border-style,solid);display:block;outline:none;transform:translateZ(0)}:host([disabled]){--_input-state-color:var(--input-state-color-disabled,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))));--_input-label-color:var(--input-label-color-disabled,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))));--_input-color:var(--input-color-disabled,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))));--_input-border-style:var(--input-border-style-disabled,dashed);pointer-events:none}#container{align-items:center;background:var(--_input-bg);border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);border-radius:var(--_input-border-radius);color:var(--_input-color);display:flex;font-size:var(--input-font-size,1rem);overflow:hidden;position:relative;transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}#wrapper{flex-grow:1;position:relative}#label{color:var(--_input-label-color);font-size:inherit;left:var(--_input-padding-left-right);line-height:1;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));-webkit-user-select:none;user-select:none;white-space:nowrap;z-index:1}:host(:hover){--_input-state-color:var(--input-state-color-hover,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,var(--shade-light,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.15))))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--_input-color);-webkit-overflow-scrolling:touch;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;border:none;box-sizing:border-box;caret-color:var(--_input-color-state);color:inherit;display:block;font-size:var(--input-font-size,1rem);margin:0;outline:none;padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);position:relative;text-align:var(--input-text-align,inherit);width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,var(--error,hsl(var(--error-h,4.10526),var(--error-s,89.6226%),var(--error-l,58.4314%))))}::slotted(input[type=color]){cursor:pointer;height:3.75rem}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}#wrapper ::slotted(textarea){font-family:inherit;height:var(--textarea-height,var(--_textarea-height));max-height:var(--textarea-max-height);min-height:var(--textarea-min-height,var(--textarea-height,var(--_textarea-height)));resize:var(--textarea-resize,none)}:host(:focus) ::slotted(textarea),:host(:hover) ::slotted(textarea){will-change:height}")}`,e([ot({type:String}),r("design:type",String),r("design:paramtypes",[String])],t.TkTextarea.prototype,"value",null),e([ot({attribute:!0,type:String}),r("design:type",String)],t.TkTextarea.prototype,"name",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"list",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"type",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextarea.prototype,"required",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextarea.prototype,"disabled",void 0),e([ot({type:Boolean}),r("design:type",Boolean)],t.TkTextarea.prototype,"readonly",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"autocomplete",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"autocapitalize",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"pattern",void 0),e([at(),r("design:type",String)],t.TkTextarea.prototype,"initialValue",void 0),e([ot({type:String}),r("design:type",String)],t.TkTextarea.prototype,"label",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextarea.prototype,"minLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextarea.prototype,"maxLength",void 0),e([ot({type:Number}),r("design:type",Number)],t.TkTextarea.prototype,"rows",void 0),e([st({passive:!0}),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],t.TkTextarea.prototype,"handleChange",null),t.TkTextarea=e([rt("tk-textarea")],t.TkTextarea);t.TkTheme=class extends tt{constructor(){super(...arguments),this.primary="#8970bf",this.onPrimary="#FFFFFF",this.accent="#E69A8D",this.onAccent="#FFFFFF",this.shade="#AAAAAA",this.onShade="#FFFFFF",this.error="#F44336",this.onError="#FFFFFF",this.foreground="#FFFFFF",this.background="#000",this.forceBody=!1,this.inverted=!1}render(){return I`<slot></slot>`}updated(){this.setThemeColor()}connectedCallback(){super.connectedCallback(),this.addEventListener("turn-theme-to-inverted",(()=>this.turnThemeToInverted()),{passive:!0}),this.addEventListener("turn-theme-to-non-inverted",(()=>this.turnThemeToNonInverted()),{passive:!0}),this.addEventListener("set-theme",this.setTheme),this.addEventListener("set-theme-font-size",this.setThemeFontSize)}disconnectedCallback(){this.removeEventListener("turn-theme-to-inverted",this.turnThemeToInverted),this.removeEventListener("turn-theme-to-non-inverted",this.turnThemeToNonInverted),this.removeEventListener("set-theme",this.setTheme),this.removeEventListener("set-theme-font-size",this.setThemeFontSize),super.disconnectedCallback()}setTheme(t){const e=t;this.background=e.detail.background?e.detail.background:this.background,this.foreground=e.detail.foreground?e.detail.foreground:this.foreground,this.primary=e.detail.primary?e.detail.primary:this.primary,this.onPrimary=e.detail.onPrimary?e.detail.onPrimary:this.onPrimary,this.accent=e.detail.accent?e.detail.accent:this.accent,this.onAccent=e.detail.onAccent?e.detail.onAccent:this.onAccent}setThemeFontSize(t){const e=t;console.log("ev",e),this.style.setProperty("--font-size",e.detail)}turnThemeToInverted(){this.inverted=!0,this.forceBody&&this.setBodyStyle()}turnThemeToNonInverted(){this.inverted=!1,this.forceBody&&this.setBodyStyle()}hexToHSL(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(t);if(null==e)return["0","0%","0%"];const[,r,i,o]=e,a=parseInt(r,16)/255,n=parseInt(i,16)/255,s=parseInt(o,16)/255,l=Math.max(a,n,s),h=Math.min(a,n,s);let d=0,c=0,p=(l+h)/2;if(l!=h){const t=l-h;switch(c=p>.5?t/(2-l-h):t/(l+h),l){case a:d=(n-s)/t+(n<s?6:0);break;case n:d=(s-a)/t+2;break;case s:d=(a-n)/t+4}d/=6}return[(360*d).toString(),(100*c).toString()+"%",(100*p).toString()+"%"]}setThemeColor(){const t=this.hexToHSL(this.primary);this.style.setProperty("--primary-h",t[0]),this.style.setProperty("--primary-s",t[1]),this.style.setProperty("--primary-l",t[2]);const e=this.hexToHSL(this.onPrimary);this.style.setProperty("--on-primary-h",e[0]),this.style.setProperty("--on-primary-s",e[1]),this.style.setProperty("--on-primary-l",e[2]);const r=this.hexToHSL(this.accent);this.style.setProperty("--accent-h",r[0]),this.style.setProperty("--accent-s",r[1]),this.style.setProperty("--accent-l",r[2]);const i=this.hexToHSL(this.onAccent);this.style.setProperty("--on-accent-h",i[0]),this.style.setProperty("--on-accent-s",i[1]),this.style.setProperty("--on-accent-l",i[2]);const o=this.hexToHSL(this.shade);this.style.setProperty("--shade-h",o[0]),this.style.setProperty("--shade-s",o[1]),this.style.setProperty("--shade-l",o[2]);const a=this.hexToHSL(this.onShade);this.style.setProperty("--on-shade-h",a[0]),this.style.setProperty("--on-shade-s",a[1]),this.style.setProperty("--on-shade-l",a[2]);const n=this.hexToHSL(this.error);this.style.setProperty("--error-h",n[0]),this.style.setProperty("--error-s",n[1]),this.style.setProperty("--error-l",n[2]);const s=this.hexToHSL(this.onError);this.style.setProperty("--on-error-h",s[0]),this.style.setProperty("--on-error-s",s[1]),this.style.setProperty("--on-error-l",s[2]);const l=this.hexToHSL(this.foreground);this.style.setProperty("--theme-foreground",`hsl(${l[0]},${l[1]},${l[2]})`);const h=this.hexToHSL(this.background);this.style.setProperty("--theme-background",`hsl(${h[0]},${h[1]},${h[2]})`),this.forceBody&&this.setBodyStyle()}setBodyStyle(){let t=this.hexToHSL(this.foreground),e=this.hexToHSL(this.background);this.inverted&&(t=this.hexToHSL(this.background),e=this.hexToHSL(this.foreground)),document.body.style.setProperty("background",`hsl(${e[0]},${e[1]},${e[2]})`),document.body.style.setProperty("color",`hsl(${t[0]},${t[1]},${t[2]})`)}},t.TkTheme.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--background:var(--theme-background);--foreground:var(--theme-foreground);--primary-lighter:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.3));--primary-light:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.15));--primary:hsl(var(--primary-h),var(--primary-s),var(--primary-l));--primary-dark:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.85));--primary-darker:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.7));--on-primary-lighter:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.3));--on-primary-light:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.15));--on-primary:hsl(var(--on-primary-h),var(--on-primary-s),var(--on-primary-l));--on-primary-dark:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.85));--on-primary-darker:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.7));--accent-lighter:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.3));--accent-light:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.15));--accent:hsl(var(--accent-h),var(--accent-s),var(--accent-l));--accent-dark:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.85));--accent-darker:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.7));--on-accent-lighter:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.3));--on-accent-light:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.15));--on-accent:hsl(var(--on-accent-h),var(--on-accent-s),var(--on-accent-l));--on-accent-dark:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.85));--on-accent-darker:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.7));--shade-lighter:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.3));--shade-light:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.15));--shade:hsl(var(--shade-h),var(--shade-s),var(--shade-l));--shade-dark:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.85));--shade-darker:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.7));--on-shade-lighter:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.3));--on-shade-light:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.15));--on-shade:hsl(var(--on-shade-h),var(--on-shade-s),var(--on-shade-l));--on-shade-dark:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.85));--on-shade-darker:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.7));--error-lighter:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.3));--error-light:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.15));--error:hsl(var(--error-h),var(--error-s),var(--error-l));--error-dark:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.85));--error-darker:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.7));--on-error-lighter:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.3));--on-error-light:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.15));--on-error:hsl(var(--on-error-h),var(--on-error-s),var(--on-error-l));--on-error-dark:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.85));--on-error-darker:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.7));--shadow-lighter:#0000001a;--shadow-light:#00000026;--shadow:#0003;--shadow-dark:#0006;--shadow-darker:#0009;background-color:var(--background);color:var(--foreground);font-family:var(--font-family,Roboto,sans-serif);font-size:var(--font-size,1rem)}:host([inverted]){--background:var(--theme-foreground);--foreground:var(--theme-background);--primary-lighter:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.7));--primary-light:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*0.85));--primary:hsl(var(--primary-h),var(--primary-s),var(--primary-l));--primary-dark:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.15));--primary-darker:hsl(var(--primary-h),var(--primary-s),calc(var(--primary-l)*1.3));--on-primary-lighter:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.7));--on-primary-light:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*0.85));--on-primary:hsl(var(--on-primary-h),var(--on-primary-s),var(--on-primary-l));--on-primary-dark:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.15));--on-primary-darker:hsl(var(--on-primary-h),var(--on-primary-s),calc(var(--on-primary-l)*1.3));--accent-lighter:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.7));--accent-light:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*0.85));--accent:hsl(var(--accent-h),var(--accent-s),var(--accent-l));--accent-dark:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.15));--accent-darker:hsl(var(--accent-h),var(--accent-s),calc(var(--accent-l)*1.3));--on-accent-lighter:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.7));--on-accent-light:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*0.85));--on-accent:hsl(var(--on-accent-h),var(--on-accent-s),var(--on-accent-l));--on-accent-dark:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.15));--on-accent-darker:hsl(var(--on-accent-h),var(--on-accent-s),calc(var(--on-accent-l)*1.3));--shade-lighter:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.7));--shade-light:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*0.85));--shade:hsl(var(--shade-h),var(--shade-s),var(--shade-l));--shade-dark:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.15));--shade-darker:hsl(var(--shade-h),var(--shade-s),calc(var(--shade-l)*1.3));--on-shade-lighter:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.7));--on-shade-light:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*0.85));--on-shade:hsl(var(--on-shade-h),var(--on-shade-s),var(--on-shade-l));--on-shade-dark:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.15));--on-shade-darker:hsl(var(--on-shade-h),var(--on-shade-s),calc(var(--on-shade-l)*1.3));--error-lighter:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.7));--error-light:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*0.85));--error:hsl(var(--error-h),var(--error-s),var(--error-l));--error-dark:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.15));--error-darker:hsl(var(--error-h),var(--error-s),calc(var(--error-l)*1.3));--on-error-lighter:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.7));--on-error-light:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*0.85));--on-error:hsl(var(--on-error-h),var(--on-error-s),var(--on-error-l));--on-error-dark:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.15));--on-error-darker:hsl(var(--on-error-h),var(--on-error-s),calc(var(--on-error-l)*1.3));--shadow-lighter:#ffffff1a;--shadow-light:#ffffff26;--shadow:#fff3;--shadow-dark:#fff6;--shadow-darker:#fff9}")}`,e([ot(),r("design:type",String)],t.TkTheme.prototype,"primary",void 0),e([ot({attribute:"on-primary"}),r("design:type",String)],t.TkTheme.prototype,"onPrimary",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"accent",void 0),e([ot({attribute:"on-accent"}),r("design:type",String)],t.TkTheme.prototype,"onAccent",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"shade",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"onShade",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"error",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"onError",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"foreground",void 0),e([ot(),r("design:type",String)],t.TkTheme.prototype,"background",void 0),e([ot({type:Boolean,attribute:"force-body",reflect:!0}),r("design:type",Boolean)],t.TkTheme.prototype,"forceBody",void 0),e([ot({type:Boolean,attribute:!0,reflect:!0}),r("design:type",Boolean)],t.TkTheme.prototype,"inverted",void 0),t.TkTheme=e([rt("tk-theme")],t.TkTheme),Object.defineProperty(t,"__esModule",{value:!0})}));
|