12 lines
13 KiB
JavaScript
12 lines
13 KiB
JavaScript
|
import{dD as t,dE as e,dF as n,dy as o,d1 as r,s as a,dC as i,y as s,dn as c,bk as l,bm as d,bn as u}from"./card-555679fd.js";var h=function(){return h=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},h.apply(this,arguments)};function p(t,e){for(var n=t.length;n--;)if(t[n].pointerId===e.pointerId)return n;return-1}function m(t,e){var n;if(e.touches){n=0;for(var o=0,r=e.touches;o<r.length;o++){var a=r[o];a.pointerId=n++,m(t,a)}}else(n=p(t,e))>-1&&t.splice(n,1),t.push(e)}function f(t){for(var e,n=(t=t.slice(0)).pop();e=t.pop();)n={clientX:(e.clientX-n.clientX)/2+n.clientX,clientY:(e.clientY-n.clientY)/2+n.clientY};return n}function v(t){if(t.length<2)return 0;var e=t[0],n=t[1];return Math.sqrt(Math.pow(Math.abs(n.clientX-e.clientX),2)+Math.pow(Math.abs(n.clientY-e.clientY),2))}"undefined"!=typeof window&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}));var g={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};function w(t,e,n,o){g[t].split(" ").forEach((function(t){e.addEventListener(t,n,o)}))}function y(t,e,n){g[t].split(" ").forEach((function(t){e.removeEventListener(t,n)}))}function _(t){if(t.parentElement)return t.parentElement;var e=t.getRootNode();return e instanceof ShadowRoot&&e.host instanceof HTMLElement?e.host:void 0}"undefined"!=typeof window&&("function"==typeof window.PointerEvent?g={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:"function"==typeof window.TouchEvent&&(g={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));var b,z="undefined"!=typeof document&&!!document.documentMode;function x(){return b||(b=document.createElement("div").style)}var E=["webkit","moz","ms"],S={};function P(t){if(S[t])return S[t];var e=x();if(t in e)return S[t]=t;for(var n=t[0].toUpperCase()+t.slice(1),o=E.length;o--;){var r="".concat(E[o]).concat(n);if(r in e)return S[t]=r}}function M(t,e){return parseFloat(e[P(t)])||0}function A(t,e,n){void 0===n&&(n=window.getComputedStyle(t));var o="border"===e?"Width":"";return{left:M("".concat(e,"Left").concat(o),n),right:M("".concat(e,"Right").concat(o),n),top:M("".concat(e,"Top").concat(o),n),bottom:M("".concat(e,"Bottom").concat(o),n)}}function O(t,e,n){t.style[P(e)]=n}function C(t){var e=_(t),n=window.getComputedStyle(t),o=window.getComputedStyle(e),r=t.getBoundingClientRect(),a=e.getBoundingClientRect();return{elem:{style:n,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:A(t,"margin",n),border:A(t,"border",n)},parent:{style:o,width:a.width,height:a.height,top:a.top,bottom:a.bottom,left:a.left,right:a.right,padding:A(e,"padding",o),border:A(e,"border",o)}}}function H(t,e){return 1===t.nodeType&&" ".concat(function(t){return(t.getAttribute("class")||"").trim()}(t)," ").indexOf(" ".concat(e," "))>-1}var X=/^http:[\w\.\/]+svg$/;var Y={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(t){t.preventDefault(),t.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:function(t,e,n){var o=e.x,r=e.y,a=e.scale,i=e.isSVG;if(O(t,"transform","scale(".concat(a,") translate(").concat(o,"px, ").concat(r,"px)")),i&&z){var s=window.getComputedStyle(t).getPropertyValue("transform");t.setAttribute("transform",s)}},startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function L(t,e){if(!t)throw new Error("Panzoom requires an element as an argument");if(1!==t.nodeType)throw new Error("Panzoom requires an element with a nodeType of 1");if(!function(t){for(var e=t;e&&e.parentNode;){if(e.parentNode===document)return!0;e
|
||
|
:host {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
display: block;
|
||
|
cursor: auto;
|
||
|
}
|
||
|
:host([zoomed]) {
|
||
|
cursor: move;
|
||
|
}
|
||
|
`}};l([d()],V.prototype,"_zoomed",void 0),V=l([u("frigate-card-zoomer")],V);export{V as FrigateCardZoomer};
|