3 lines
No EOL
14 KiB
JavaScript
3 lines
No EOL
14 KiB
JavaScript
/*! For license information please see 2488.BSKRLImaphU.js.LICENSE.txt */
|
|
"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([[2488],{86477:function(t,e,r){var n=r(33368),i=r(71650),o=r(68308),a=r(69205),s=r(43204),c=r(95260),u=r(82390),l=r(34541),h=r(47838),d=(r(94738),r(98214),r(46798),r(5095)),p=r(25550),f=["focusin","focusout","pointerdown"],v=function(t){function e(){var t;return(0,i.Z)(this,e),(t=(0,o.Z)(this,e,arguments)).visible=!1,t.inward=!1,t.attachableController=new p.J((0,u.Z)(t),t.onControlChange.bind((0,u.Z)(t))),t}return(0,a.Z)(e,t),(0,n.Z)(e,[{key:"htmlFor",get:function(){return this.attachableController.htmlFor},set:function(t){this.attachableController.htmlFor=t}},{key:"control",get:function(){return this.attachableController.control},set:function(t){this.attachableController.control=t}},{key:"attach",value:function(t){this.attachableController.attach(t)}},{key:"detach",value:function(){this.attachableController.detach()}},{key:"connectedCallback",value:function(){(0,l.Z)((0,h.Z)(e.prototype),"connectedCallback",this).call(this),this.setAttribute("aria-hidden","true")}},{key:"handleEvent",value:function(t){var e,r;if(!t[b]){switch(t.type){default:return;case"focusin":this.visible=null!==(e=null===(r=this.control)||void 0===r?void 0:r.matches(":focus-visible"))&&void 0!==e&&e;break;case"focusout":case"pointerdown":this.visible=!1}t[b]=!0}}},{key:"onControlChange",value:function(t,e){if(!d.sk)for(var r=0,n=f;r<n.length;r++){var i=n[r];null==t||t.removeEventListener(i,this),null==e||e.addEventListener(i,this)}}},{key:"update",value:function(t){t.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),(0,l.Z)((0,h.Z)(e.prototype),"update",this).call(this,t)}}]),e}(d.oi);(0,s.__decorate)([(0,c.Cb)({type:Boolean,reflect:!0})],v.prototype,"visible",void 0),(0,s.__decorate)([(0,c.Cb)({type:Boolean,reflect:!0})],v.prototype,"inward",void 0);var m,b=Symbol("handledByFocusRing"),y=r(88962),C=(0,d.iv)(m||(m=(0,y.Z)([":host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2,0,0,1);box-sizing:border-box;color:var(--md-focus-ring-color,var(--md-sys-color-secondary,#625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end,var(--md-focus-ring-shape,9999px)) + var(--md-focus-ring-outward-offset,2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start,var(--md-focus-ring-shape,9999px)) + var(--md-focus-ring-outward-offset,2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end,var(--md-focus-ring-shape,9999px)) + var(--md-focus-ring-outward-offset,2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start,var(--md-focus-ring-shape,9999px)) + var(--md-focus-ring-outward-offset,2px));inset:calc(-1*var(--md-focus-ring-outward-offset,2px));outline:var(--md-focus-ring-width,3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end,var(--md-focus-ring-shape,9999px)) - var(--md-focus-ring-inward-offset,0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start,var(--md-focus-ring-shape,9999px)) - var(--md-focus-ring-inward-offset,0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end,var(--md-focus-ring-shape,9999px)) - var(--md-focus-ring-inward-offset,0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start,var(--md-focus-ring-shape,9999px)) - var(--md-focus-ring-inward-offset,0px));border:var(--md-focus-ring-width,3px) solid currentColor;inset:var(--md-focus-ring-inward-offset,0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width,8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width,8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width,8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width,8px)}}@media(prefers-reduced-motion){:host{animation:none}}"]))),g=function(t){function e(){return(0,i.Z)(this,e),(0,o.Z)(this,e,arguments)}return(0,a.Z)(e,t),(0,n.Z)(e)}(v);g.styles=[C],g=(0,s.__decorate)([(0,c.Mo)("md-focus-ring")],g)},25550:function(t,e,r){r.d(e,{J:function(){return u}});var n,i=r(71650),o=r(33368),a=r(40039),s=(r(94738),r(98214),r(46798),r(5095)),c=Symbol("attachableController");s.sk||(n=new MutationObserver((function(t){var e,r=(0,a.Z)(t);try{for(r.s();!(e=r.n()).done;){var n;null===(n=e.value.target[c])||void 0===n||n.hostConnected()}}catch(i){r.e(i)}finally{r.f()}})));var u=function(){function t(e,r){var o;(0,i.Z)(this,t),this.host=e,this.onControlChange=r,this.currentControl=null,e.addController(this),e[c]=this,null===(o=n)||void 0===o||o.observe(e,{attributeFilter:["for"]})}return(0,o.Z)(t,[{key:"htmlFor",get:function(){return this.host.getAttribute("for")},set:function(t){null===t?this.host.removeAttribute("for"):this.host.setAttribute("for",t)}},{key:"control",get:function(){return this.host.hasAttribute("for")?this.htmlFor&&this.host.isConnected?this.host.getRootNode().querySelector("#".concat(this.htmlFor)):null:this.currentControl||this.host.parentElement},set:function(t){t?this.attach(t):this.detach()}},{key:"attach",value:function(t){t!==this.currentControl&&(this.setCurrentControl(t),this.host.removeAttribute("for"))}},{key:"detach",value:function(){this.setCurrentControl(null),this.host.setAttribute("for","")}},{key:"hostConnected",value:function(){this.setCurrentControl(this.control)}},{key:"hostDisconnected",value:function(){this.setCurrentControl(null)}},{key:"setCurrentControl",value:function(t){this.onControlChange(this.currentControl,t),this.currentControl=t}}]),t}()},35981:function(t,e,r){var n,i=r(33368),o=r(71650),a=r(68308),s=r(69205),c=r(43204),u=r(95260),l=r(99312),h=r(81043),d=r(88962),p=r(82390),f=r(34541),v=r(47838),m=(r(46798),r(47084),r(97393),r(5095)),b=r(53180),y=r(25550),C=(r(51358),r(78399),r(5239),r(56086),r(47884),r(81912),r(64584),r(41483),r(12367),r(9454),r(98490),r(63789),r(18098),r(11451),r(76843),"cubic-bezier(0.2, 0, 0, 1)");var g;!function(t){t[t.INACTIVE=0]="INACTIVE",t[t.TOUCH_DELAY=1]="TOUCH_DELAY",t[t.HOLDING=2]="HOLDING",t[t.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(g||(g={}));var k,w=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],x=function(t){function e(){var t;return(0,o.Z)(this,e),(t=(0,a.Z)(this,e,arguments)).disabled=!1,t.hovered=!1,t.pressed=!1,t.rippleSize="",t.rippleScale="",t.initialSize=0,t.state=g.INACTIVE,t.checkBoundsAfterContextMenu=!1,t.attachableController=new y.J((0,p.Z)(t),t.onControlChange.bind((0,p.Z)(t))),t}var r,c,u;return(0,s.Z)(e,t),(0,i.Z)(e,[{key:"htmlFor",get:function(){return this.attachableController.htmlFor},set:function(t){this.attachableController.htmlFor=t}},{key:"control",get:function(){return this.attachableController.control},set:function(t){this.attachableController.control=t}},{key:"attach",value:function(t){this.attachableController.attach(t)}},{key:"detach",value:function(){this.attachableController.detach()}},{key:"connectedCallback",value:function(){(0,f.Z)((0,v.Z)(e.prototype),"connectedCallback",this).call(this),this.setAttribute("aria-hidden","true")}},{key:"render",value:function(){var t={hovered:this.hovered,pressed:this.pressed};return(0,m.dy)(n||(n=(0,d.Z)(['<div class="surface ','"></div>'])),(0,b.$)(t))}},{key:"update",value:function(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),(0,f.Z)((0,v.Z)(e.prototype),"update",this).call(this,t)}},{key:"handlePointerenter",value:function(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}},{key:"handlePointerleave",value:function(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==g.INACTIVE&&this.endPressAnimation())}},{key:"handlePointerup",value:function(t){if(this.shouldReactToEvent(t)){if(this.state!==g.HOLDING)return this.state===g.TOUCH_DELAY?(this.state=g.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=g.WAITING_FOR_CLICK}}},{key:"handlePointerdown",value:(u=(0,h.Z)((0,l.Z)().mark((function t(e){return(0,l.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shouldReactToEvent(e)){t.next=2;break}return t.abrupt("return");case 2:if(this.rippleStartEvent=e,this.isTouch(e)){t.next=7;break}return this.state=g.WAITING_FOR_CLICK,this.startPressAnimation(e),t.abrupt("return");case 7:if(!this.checkBoundsAfterContextMenu||this.inBounds(e)){t.next=9;break}return t.abrupt("return");case 9:return this.checkBoundsAfterContextMenu=!1,this.state=g.TOUCH_DELAY,t.next=13,new Promise((function(t){setTimeout(t,150)}));case 13:if(this.state===g.TOUCH_DELAY){t.next=15;break}return t.abrupt("return");case 15:this.state=g.HOLDING,this.startPressAnimation(e);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"handleClick",value:function(){this.disabled||(this.state!==g.WAITING_FOR_CLICK?this.state===g.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}},{key:"handlePointercancel",value:function(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}},{key:"handleContextmenu",value:function(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}},{key:"determineRippleSize",value:function(){var t=this.getBoundingClientRect(),e=t.height,r=t.width,n=Math.max(e,r),i=Math.max(.35*n,75),o=Math.floor(.2*n),a=Math.sqrt(Math.pow(r,2)+Math.pow(e,2))+10;this.initialSize=o,this.rippleScale="".concat((a+i)/o),this.rippleSize="".concat(o,"px")}},{key:"getNormalizedPointerEventCoords",value:function(t){var e=window,r=e.scrollX,n=e.scrollY,i=this.getBoundingClientRect(),o=r+i.left,a=n+i.top;return{x:t.pageX-o,y:t.pageY-a}}},{key:"getTranslationCoordinates",value:function(t){var e,r=this.getBoundingClientRect(),n=r.height,i=r.width,o={x:(i-this.initialSize)/2,y:(n-this.initialSize)/2};return{startPoint:e={x:(e=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:i/2,y:n/2}).x-this.initialSize/2,y:e.y-this.initialSize/2},endPoint:o}}},{key:"startPressAnimation",value:function(t){var e;if(this.mdRoot){this.pressed=!0,null===(e=this.growAnimation)||void 0===e||e.cancel(),this.determineRippleSize();var r=this.getTranslationCoordinates(t),n=r.startPoint,i=r.endPoint,o="".concat(n.x,"px, ").concat(n.y,"px"),a="".concat(i.x,"px, ").concat(i.y,"px");this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:["translate(".concat(o,") scale(1)"),"translate(".concat(a,") scale(").concat(this.rippleScale,")")]},{pseudoElement:"::after",duration:450,easing:C,fill:"forwards"})}}},{key:"endPressAnimation",value:(c=(0,h.Z)((0,l.Z)().mark((function t(){var e,r;return(0,l.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.state=g.INACTIVE,e=this.growAnimation,r=1/0,"number"==typeof(null==e?void 0:e.currentTime)?r=e.currentTime:null!=e&&e.currentTime&&(r=e.currentTime.to("ms").value),!(r>=225)){t.next=7;break}return this.pressed=!1,t.abrupt("return");case 7:return t.next=9,new Promise((function(t){setTimeout(t,225-r)}));case 9:if(this.growAnimation===e){t.next=11;break}return t.abrupt("return");case 11:this.pressed=!1;case 12:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"shouldReactToEvent",value:function(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);var e=1===t.buttons;return this.isTouch(t)||e}},{key:"inBounds",value:function(t){var e=t.x,r=t.y,n=this.getBoundingClientRect(),i=n.top,o=n.left,a=n.bottom,s=n.right;return e>=o&&e<=s&&r>=i&&r<=a}},{key:"isTouch",value:function(t){return"touch"===t.pointerType}},{key:"handleEvent",value:(r=(0,h.Z)((0,l.Z)().mark((function t(e){return(0,l.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.type,t.next="click"===t.t0?3:"contextmenu"===t.t0?5:"pointercancel"===t.t0?7:"pointerdown"===t.t0?9:"pointerenter"===t.t0?12:"pointerleave"===t.t0?14:"pointerup"===t.t0?16:18;break;case 3:return this.handleClick(),t.abrupt("break",19);case 5:return this.handleContextmenu(),t.abrupt("break",19);case 7:return this.handlePointercancel(e),t.abrupt("break",19);case 9:return t.next=11,this.handlePointerdown(e);case 11:case 18:return t.abrupt("break",19);case 12:return this.handlePointerenter(e),t.abrupt("break",19);case 14:return this.handlePointerleave(e),t.abrupt("break",19);case 16:return this.handlePointerup(e),t.abrupt("break",19);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"onControlChange",value:function(t,e){if(!m.sk)for(var r=0,n=w;r<n.length;r++){var i=n[r];null==t||t.removeEventListener(i,this),null==e||e.addEventListener(i,this)}}}]),e}(m.oi);(0,c.__decorate)([(0,u.Cb)({type:Boolean,reflect:!0})],x.prototype,"disabled",void 0),(0,c.__decorate)([(0,u.SB)()],x.prototype,"hovered",void 0),(0,c.__decorate)([(0,u.SB)()],x.prototype,"pressed",void 0),(0,c.__decorate)([(0,u.IO)(".surface")],x.prototype,"mdRoot",void 0);var A=(0,m.iv)(k||(k=(0,d.Z)([':host{--_hover-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-opacity:var(--md-ripple-hover-opacity, 0.08);--_pressed-color:var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-opacity:var(--md-ripple-pressed-opacity, 0.12);display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors:active){:host{display:none}}.surface,:host{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:transparent}.surface::after,.surface::before{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--_hover-color);inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side,var(--_pressed-color) max(100% - 70px,65%),transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--_hover-color);opacity:var(--_hover-opacity)}.pressed::after{opacity:var(--_pressed-opacity);transition-duration:105ms}']))),_=function(t){function e(){return(0,o.Z)(this,e),(0,a.Z)(this,e,arguments)}return(0,s.Z)(e,t),(0,i.Z)(e)}(x);_.styles=[A],_=(0,c.__decorate)([(0,u.Mo)("md-ripple")],_)}}]);
|
|
//# sourceMappingURL=2488.BSKRLImaphU.js.map
|