mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-15 16:34:49 +00:00
1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
|
|
import{t as e}from"./chunk-DECur_0Z.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`nipplejs`,[],r):typeof e==`object`?e.nipplejs=r():n.nipplejs=r()})(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,`default`,{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=0)}([function(e,t,n){n.r(t);var r,i=function(e,t){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)},a=function(e){return Math.PI/180*e},o=function(e){return 180/Math.PI*e},s=new Map,c=function(e){s.has(e)&&clearTimeout(s.get(e)),s.set(e,setTimeout(e,100))},l=function(e,t,n){for(var r,i=t.split(/[ ,]+/g),a=0;a<i.length;a+=1)r=i[a],e.addEventListener?e.addEventListener(r,n,!1):e.attachEvent&&e.attachEvent(r,n)},u=function(e,t,n){for(var r,i=t.split(/[ ,]+/g),a=0;a<i.length;a+=1)r=i[a],e.removeEventListener?e.removeEventListener(r,n):e.detachEvent&&e.detachEvent(r,n)},d=function(e){return e.preventDefault(),e.type.match(/^touch/)?e.changedTouches:e},f=function(){return{x:window.pageXOffset===void 0?(document.documentElement||document.body.parentNode||document.body).scrollLeft:window.pageXOffset,y:window.pageYOffset===void 0?(document.documentElement||document.body.parentNode||document.body).scrollTop:window.pageYOffset}},p=function(e,t){t.top||t.right||t.bottom||t.left?(e.style.top=t.top,e.style.right=t.right,e.style.bottom=t.bottom,e.style.left=t.left):(e.style.left=t.x+`px`,e.style.top=t.y+`px`)},m=function(e,t,n){var r=h(e);for(var i in r)if(r.hasOwnProperty(i))if(typeof t==`string`)r[i]=t+` `+n;else{for(var a=``,o=0,s=t.length;o<s;o+=1)a+=t[o]+` `+n+`, `;r[i]=a.slice(0,-2)}return r},h=function(e){var t={};return t[e]=``,[`webkit`,`Moz`,`o`].forEach(function(n){t[n+e.charAt(0).toUpperCase()+e.slice(1)]=``}),t},g=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},_=function(e,t){if(e.length)for(var n=0,r=e.length;n<r;n+=1)t(e[n]);else t(e)},v=`ontouchstart`in window,y=!!window.PointerEvent,b=!!window.MSPointerEvent,x={start:`mousedown`,move:`mousemove`,end:`mouseup`},S={};function C(){}y?r={start:`pointerdown`,move:`pointermove`,end:`pointerup, pointercancel`}:b?r={start:`MSPointerDown`,move:`MSPointerMove`,end:`MSPointerUp`}:v?(r={start:`touchstart`,move:`touchmove`,end:`touchend, touchcancel`},S=x):r=x,C.prototype.on=function(e,t){var n,r=e.split(/[ ,]+/g);this._handlers_=this._handlers_||{};for(var i=0;i<r.length;i+=1)n=r[i],this._handlers_[n]=this._handlers_[n]||[],this._handlers_[n].push(t);return this},C.prototype.off=function(e,t){return this._handlers_=this._handlers_||{},e===void 0?this._handlers_={}:t===void 0?this._handlers_[e]=null:this._handlers_[e]&&this._handlers_[e].indexOf(t)>=0&&this._handlers_[e].splice(this._handlers_[e].indexOf(t),1),this},C.prototype.trigger=function(e,t){var n,r=this,i=e.split(/[ ,]+/g);r._handlers_=r._handlers_||{};for(var a=0;a<i.length;a+=1)n=i[a],r._handlers_[n]&&r._handlers_[n].length&&r._handlers_[n].forEach(function(e){e.call(r,{type:n,target:r},t)})},C.prototype.config=function(e){this.options=this.defaults||{},e&&(this.options=function(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&t.hasOwnProperty(r)?n[r]=t[r]:e.hasOwnProperty(r)&&(n[r]=e[r]);return n}(this.options,e))},C.prototype.bindEvt=function(e,t){var n=this
|