19 lines
174 KiB
JavaScript
19 lines
174 KiB
JavaScript
|
/*
|
||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||
|
if you want to view the source, please visit the github repository of this plugin
|
||
|
*/
|
||
|
|
||
|
var Ma=Object.create;var $t=Object.defineProperty;var Oa=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Ca=Object.getPrototypeOf,La=Object.prototype.hasOwnProperty;var kr=g=>$t(g,"__esModule",{value:!0});var Tr=(g,s)=>()=>(s||g((s={exports:{}}).exports,s),s.exports),Ia=(g,s)=>{kr(g);for(var u in s)$t(g,u,{get:s[u],enumerable:!0})},Aa=(g,s,u)=>{if(s&&typeof s=="object"||typeof s=="function")for(let h of _a(s))!La.call(g,h)&&h!=="default"&&$t(g,h,{get:()=>s[h],enumerable:!(u=Oa(s,h))||u.enumerable});return g},be=g=>Aa(kr($t(g!=null?Ma(Ca(g)):{},"default",g&&g.__esModule&&"default"in g?{get:()=>g.default,enumerable:!0}:{value:g,enumerable:!0})),g);var Or=Tr((Ya,Mr)=>{Mr.exports=function(s,u){u||(u=[0,""]),s=String(s);var h=parseFloat(s,10);return u[0]=h,u[1]=s.match(/[\d.\-\+]*\s*(.*)/)[1]||"",u}});var $r=Tr((Kr,Zn)=>{(function(g){typeof Kr=="object"&&typeof Zn!="undefined"?Zn.exports=g():typeof define=="function"&&define.amd?define([],g):(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this).interact=g()})(function(){var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.default=void 0,g.default=function(e){return!(!e||!e.Window)&&e instanceof e.Window};var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.init=v,s.getWindow=function(e){return(0,g.default)(e)?e:(e.ownerDocument||e).defaultView||h.window},s.window=s.realWindow=void 0;var u=void 0;s.realWindow=u;var h=void 0;function v(e){s.realWindow=u=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),s.window=h=e}s.window=h,typeof window!="undefined"&&window&&v(window);var d={};function E(e){return(E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}Object.defineProperty(d,"__esModule",{value:!0}),d.default=void 0;var T=function(e){return!!e&&E(e)==="object"},k=function(e){return typeof e=="function"},S={window:function(e){return e===s.window||(0,g.default)(e)},docFrag:function(e){return T(e)&&e.nodeType===11},object:T,func:k,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||E(e)!=="object")return!1;var t=s.getWindow(e)||s.window;return/object|function/.test(E(t.Element))?e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return T(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return T(e)&&e.length!==void 0&&k(e.splice)}};d.default=S;var H={};function M(e){var t=e.interaction;if(t.prepared.name==="drag"){var o=t.prepared.axis;o==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):o==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function V(e){var t=e.iEvent,o=e.interaction;if(o.prepared.name==="drag"){var n=o.prepared.axis;if(n==="x"||n==="y"){var r=n==="x"?"y":"x";t.page[r]=o.coords.start.page[r],t.client[r]=o.coords.start.client[r],t.delta[r]=0}}}Object.defineProperty(H,"__esModule",{value:!0}),H.default=void 0;var D={id:"actions/drag",install:function(e){var t=e.actions,o=e.Interactable,n=e.defaults;o.prototype.draggable=D.draggable,t.map.drag=D,t.methodDict.drag="draggable",n.actions.drag=D.defaults},listeners:{"interactions:before-action-move":M,"interactions:action-resume":M,"interactions:action-move":V,"auto-start:check":function(e){var t=e.interaction,o=e.interactable,n=e.buttons,r=o.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(n&o.options.drag.mouseButtons)!=0))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return d.default.object(e)?(this.options.drag.enable
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())),d.default.element(i)&&(i=(0,I.getElementRect)(i)),i},G.rectToXY=function(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}},G.xywhToTlbr=function(e){return!e||"left"in e&&"top"in e||((e=(0,L.default)({},e)).left=e.x||0,e.top=e.y||0,e.right=e.right||e.left+e.width,e.bottom=e.bottom||e.top+e.height),e},G.tlbrToXywh=function(e){return!e||"x"in e&&"y"in e||((e=(0,L.default)({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e},G.addEdges=function(e,t,o){e.left&&(t.left+=o.x),e.right&&(t.right+=o.x),e.top&&(t.top+=o.y),e.bottom&&(t.bottom+=o.y),t.width=t.right-t.left,t.height=t.bottom-t.top};var ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=function(e,t,o){var n=e.options[o],r=n&&n.origin||e.options.origin,i=(0,G.resolveRectLike)(r,e,t,[e&&t]);return(0,G.rectToXY)(i)||{x:0,y:0}};var De={};function oo(e){return e.trim().split(/ +/)}Object.defineProperty(De,"__esModule",{value:!0}),De.default=function e(t,o,n){if(n=n||{},d.default.string(t)&&t.search(" ")!==-1&&(t=oo(t)),d.default.array(t))return t.reduce(function(l,p){return(0,L.default)(l,e(p,o,n))},n);if(d.default.object(t)&&(o=t,t=""),d.default.func(o))n[t]=n[t]||[],n[t].push(o);else if(d.default.array(o))for(var r=0;r<o.length;r++){var i;i=o[r],e(t,i,n)}else if(d.default.object(o))for(var c in o){var a=oo(c).map(function(l){return"".concat(t).concat(l)});e(a,o[c],n)}return n};var we={};Object.defineProperty(we,"__esModule",{value:!0}),we.default=void 0,we.default=function(e,t){return Math.sqrt(e*e+t*t)};var Ze={};function ln(e,t){for(var o in t){var n=ln.prefixedPropREs,r=!1;for(var i in n)if(o.indexOf(i)===0&&n[i].test(o)){r=!0;break}r||typeof t[o]=="function"||(e[o]=t[o])}return e}Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0,ln.prefixedPropREs={webkit:/(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,moz:/(Pressure)$/};var Zr=ln;Ze.default=Zr;var C={};function cn(e){return e instanceof A.default.Event||e instanceof A.default.Touch}function Qe(e,t,o){return e=e||"page",(o=o||{}).x=t[e+"X"],o.y=t[e+"Y"],o}function ro(e,t){return t=t||{x:0,y:0},$.default.isOperaMobile&&cn(e)?(Qe("screen",e,t),t.x+=window.scrollX,t.y+=window.scrollY):Qe("page",e,t),t}function io(e,t){return t=t||{},$.default.isOperaMobile&&cn(e)?Qe("screen",e,t):Qe("client",e,t),t}function gt(e){var t=[];return d.default.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function ao(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<e.length;o++){var n=e[o];for(var r in t)t[r]+=n[r]}for(var i in t)t[i]/=e.length;return t}Object.defineProperty(C,"__esModule",{value:!0}),C.copyCoords=function(e,t){e.page=e.page||{},e.page.x=t.page.x,e.page.y=t.page.y,e.client=e.client||{},e.client.x=t.client.x,e.client.y=t.client.y,e.timeStamp=t.timeStamp},C.setCoordDeltas=function(e,t,o){e.page.x=o.page.x-t.page.x,e.page.y=o.page.y-t.page.y,e.client.x=o.client.x-t.client.x,e.client.y=o.client.y-t.client.y,e.timeStamp=o.timeStamp-t.timeStamp},C.setCoordVelocity=function(e,t){var o=Math.max(t.timeStamp/1e3,.001);e.page.x=t.page.x/o,e.page.y=t.page.y/o,e.client.x=t.client.x/o,e.client.y=t.client.y/o,e.timeStamp=o},C.setZeroCoords=function(e){e.page.x=0,e.page.y=0,e.client.x=0,e.client.y=0},C.isNativePointer=cn,C.getXY=Qe,C.getPageXY=ro,C.getClientXY=io,C.getPointerId=function(e){return d.default.number(e.pointerId)?e.pointerId:e.identifier},C.setCoords=function(e,t,o){var n=t.length>1?ao(t):t[0];ro(n,e.page),io(n,e.client),e.timeStamp=o},C.getTouchPair=gt,C.pointerAverage=ao,C.touchBBox=function(e){if(!e.length)return null;var t=gt(e),o=Math.min(t[0].pageX,t[1].pageX),n=Math.min(t[0].pageY,t[1].pageY),r=Math.max(t[0].pageX,t[1].pageX),i=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:n,left:o,top:n,right:r,bottom:i,width:r-o,height:i-n}},C.
|
||
|
`},{name:ze.boxSizing,perform:function(e){var t=e.element;return e.prepared.name==="resize"&&t instanceof A.default.HTMLElement&&!To(t,"boxSizing",/border-box/)},text:'Consider adding CSS "box-sizing: border-box" to this resizable element',getInfo:function(e){return[e.element,bn.boxSizing]}},{name:ze.noListeners,perform:function(e){var t=e.prepared.name;return!(e.interactable.events.types["".concat(t,"move")]||[]).length},getInfo:function(e){return[e.prepared.name,e.interactable]},text:"There are no listeners set for this action"}];function To(e,t,o){var n=e.style[t]||s.window.getComputedStyle(e)[t];return o.test((n||"").toString())}var wi={id:"dev-tools",install:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t.logger,n=e.Interactable,r=e.defaults;e.logger=o||console,r.base.devTools={ignore:{}},n.prototype.devTools=function(i){return i?((0,L.default)(this.options.devTools,i),this):this.options.devTools},e.usePlugin(Mt.default)},listeners:{"interactions:action-start":function(e,t){for(var o=e.interaction,n=0;n<wn.length;n++){var r,i=wn[n],c=o.interactable&&o.interactable.options;c&&c.devTools&&c.devTools.ignore[i.name]||!i.perform(o)||(r=t.logger).warn.apply(r,[ko+i.text].concat(function(l){if(Array.isArray(l))return yn(l)}(a=i.getInfo(o))||function(l){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(l))return Array.from(l)}(a)||function(l,p){if(l){if(typeof l=="string")return yn(l,p);var f=Object.prototype.toString.call(l).slice(8,-1);return f==="Object"&&l.constructor&&(f=l.constructor.name),f==="Map"||f==="Set"?Array.from(l):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?yn(l,p):void 0}}(a)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()))}var a}},checks:wn,CheckName:ze,links:bn,prefix:ko};Ot.default=wi;var Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.default=function e(t){var o={};for(var n in t){var r=t[n];d.default.plainObject(r)?o[n]=e(r):d.default.array(r)?o[n]=K.from(r):o[n]=r}return o};var Oe={};function Mo(e,t){return function(o){if(Array.isArray(o))return o}(e)||function(o,n){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(o)){var r=[],i=!0,c=!1,a=void 0;try{for(var l,p=o[Symbol.iterator]();!(i=(l=p.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(f){c=!0,a=f}finally{try{i||p.return==null||p.return()}finally{if(c)throw a}}return r}}(e,t)||function(o,n){if(o){if(typeof o=="string")return Oo(o,n);var r=Object.prototype.toString.call(o).slice(8,-1);return r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set"?Array.from(o):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oo(o,n):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Oo(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function Ei(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.getRectOffset=_o,Oe.default=void 0;var xi=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=n,this.result=_t()}var t,o;return t=e,(o=[{key:"start",value:function(n,r){var i=n.phase,c=this.interaction,a=function(p){var f=p.interactable.options[p.prepared.name],m=f.modifiers;return m&&m.length?m:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(b){var w=f[b];return w&&w.enabled&&{options:w,methods:w._methods}}).filter(function(b){return!!b})}(c);this.prepareStates(a),this.edges=(0,L.default)({},c.edges),this.startOffset=_o(c.rect,r),this.startDelta={x:0,y:0};var l=this.fillArg({phase:i,pageCoords:r,preEnd:!1});return this.result=_t(),this.startAll(l),this.result=this.setAll(l)}},{key:"fillArg",value:function(n){var r=this.interaction;return n.interaction=r,n.interactable=r.interactable,n.element=r.element,n.rect=n.rect||r.rect,n.edges=this.edges,n.startOffset=this.startOffset,n}},{key:"startAll",value:function(n){for(var r=0;r<this.states.length;r++){var i=this.states[r];i.methods.start&&(n.state=i,i.methods.start(n))}}},{key:"setAll",value:function(n){var r=n.phase,i=n.preEnd,c=n.skipModifiers,a=n.rect;n.coords=(0,L.default)({},n.pageCoords),n.rect=(0,L.default)({},a);for(var l=c?this.states.slice(c):this.states,p=_t(n.coords,n.rect),f=0;f<l.length;f++){var m,b=l[f],w=b.options,y=(0,L.default)({},n.coords),P=null;(m=b.methods)!=null&&m.set&&this.shouldDo(w,i,r)&&(n.state=b,P=b.methods.set(n),G.addEdges(this.interaction.edges,n.rect,{x:n.coords.x-y.x,y:n.coords.y-y.y})),p.eventProps.push(P)}p.delta.x=n.coords.x-n.pageCoords.x,p.delta.y=n.coords.y-n.pageCoords.y,p.rectDelta.left=n.rect.left-a.left,p.rectDelta.right=n.rect.right-a.right,p.rectDelta.top=n.rect.top-a.top,p.rectDelta.bottom=n.rect.bottom-a.bottom;var O=this.result.coords,x=this.result.rect;if(O&&x){var _=p.rect.left!==x.left||p.rect.right!==x.right||p.rect.top!==x.top||p.rect.bottom!==x.bottom;p.changed=_||O.x!==p.coords.x||O.y!==p.coords.y}return p}},{key:"applyToInteraction",value:function(n){var r=this.interaction,i=n.phase,c=r.coords.cur,a=r.coords.start,l=this.result,p=this.startDelta,f=l.delta;i==="start"&&(0,L.default)(this.startDelta,l.delta);for(var m=[[a,p],[c,f]],b=0;b<m.length;b++){var w=Mo(m[b],2),y=w[0],P=w[1];y.page.x+=P.x,y.page.y+=P.y,y.client.x+=P.x,y.client.y+=P.y}var O=this.result.rectDelta,x=n.rect||r.rect;x.left+=O.left,x.right+=O.right,x.top+=O.top,x.bottom+=O.bottom,x.width=x.right-x.left,x.height=x.bottom-x.top}},{key:"setAndApply",value:function(n){var r=this.interaction,i=n.phase,c=n.preEnd,a=n.skipModifiers,l=this.setAll(this.fillArg({preEnd:c,phase:i,pageCoords:n.modifiedCoords||r.coords.cur.page}));if(this.result=l,!l.changed&&(!a||a<this.states.length)&&r.interacting())return!1;if(n.modifiedCoords){var p=r.coords.cur.page,f={x:n.modifiedCoords.x-p.x,y:n.modifiedCoords.y-p.y};l.coords.x+=f.x,l.coords.y+=f.y,l.delta.x+=f.x,l.delta.y+=f.y}this.applyToInteraction(n)}},{key:"beforeEnd",value:function(n){var r=n.interaction,i=n.event,c=this.states;if(c&&c.length){for(var a=!1,l=0;l<c.length;l++){var p=c[l];n.state=p;var f=p.options,m=p.methods,b=m.beforeEnd&&m.beforeEnd(n);if(b)return this.endResult=b,!1;a=a||!a&&this.shouldDo(f,!0,n.phase,!0)}a&&r.move({event:i,preEnd:!0})}}},{key:"stop",value:function(n){var r=n.interaction;if(this.states&&this.states.length){var i=(0,L.default)({states:this.states,interactable:r.interactable,element:
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Vo(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=void 0;var Fi=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=n,(0,Ze.default)(this,n)}var t,o;return t=e,(o=[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}])&&Wi(t.prototype,o),e}();function it(e){if(!d.default.object(e))return{capture:!!e,passive:!1};var t=(0,L.default)({},e);return t.capture=!!e.capture,t.passive=!!e.passive,t}var Vi={id:"events",install:function(e){var t,o=[],n={},r=[],i={add:c,remove:a,addDelegate:function(f,m,b,w,y){var P=it(y);if(!n[b]){n[b]=[];for(var O=0;O<r.length;O++){var x=r[O];c(x,b,l),c(x,b,p,!0)}}var _=n[b],j=K.find(_,function(F){return F.selector===f&&F.context===m});j||(j={selector:f,context:m,listeners:[]},_.push(j)),j.listeners.push([w,P])},removeDelegate:function(f,m,b,w,y){var P,O=it(y),x=n[b],_=!1;if(x)for(P=x.length-1;P>=0;P--){var j=x[P];if(j.selector===f&&j.context===m){for(var F=j.listeners,q=F.length-1;q>=0;q--){var Z=kn(F[q],2),N=Z[0],Y=Z[1],ue=Y.capture,ye=Y.passive;if(N===w&&ue===O.capture&&ye===O.passive){F.splice(q,1),F.length||(x.splice(P,1),a(m,b,l),a(m,b,p,!0)),_=!0;break}}if(_)break}}},delegateListener:l,delegateUseCapture:p,delegatedEvents:n,documents:r,targets:o,supportsOptions:!1,supportsPassive:!1};function c(f,m,b,w){var y=it(w),P=K.find(o,function(O){return O.eventTarget===f});P||(P={eventTarget:f,events:{}},o.push(P)),P.events[m]||(P.events[m]=[]),f.addEventListener&&!K.contains(P.events[m],b)&&(f.addEventListener(m,b,i.supportsOptions?y:y.capture),P.events[m].push(b))}function a(f,m,b,w){var y=it(w),P=K.findIndex(o,function(q){return q.eventTarget===f}),O=o[P];if(O&&O.events)if(m!=="all"){var x=!1,_=O.events[m];if(_){if(b==="all"){for(var j=_.length-1;j>=0;j--)a(f,m,_[j],y);return}for(var F=0;F<_.length;F++)if(_[F]===b){f.removeEventListener(m,b,i.supportsOptions?y:y.capture),_.splice(F,1),_.length===0&&(delete O.events[m],x=!0);break}}x&&!Object.keys(O.events).length&&o.splice(P,1)}else for(m in O.events)O.events.hasOwnProperty(m)&&a(f,m,"all")}function l(f,m){for(var b=it(m),w=new Fi(f),y=n[f.type],P=kn(C.getEventTargets(f),1)[0],O=P;d.default.element(O);){for(var x=0;x<y.length;x++){var _=y[x],j=_.selector,F=_.context;if(I.matchesSelector(O,j)&&I.nodeContains(F,P)&&I.nodeContains(F,O)){var q=_.listeners;w.currentTarget=O;for(var Z=0;Z<q.length;Z++){var N=kn(q[Z],2),Y=N[0],ue=N[1],ye=ue.capture,Wn=ue.passive;ye===b.capture&&Wn===b.passive&&Y(w)}}}O=I.parentNode(O)}}function p(f){return l(f,!0)}return(t=e.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return i.supportsOptions=!0},get passive(){return i.supportsPassive=!0}}),e.events=i,i}};Ht.default=Vi;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=void 0;var zt={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(e){for(var t=0;t<zt.methodOrder.length;t++){var o;o=zt.methodOrder[t];var n=zt[o](e);if(n)return n}return null},simulationResume:function(e){var t=e.pointerType,o=e.eventType,n=e.eventTarget,r=e.scope;if(!/down|start/i.test(o))return null;for(var i=0;i<r.interactions.list.length;i++){var c=r.interactions.list[i],a=n;if(c.simulation&&c.simulation.allowResume&&c.pointerType===t)for(;a;){if(a===c.element)return c;a=I.parentNode(a)}}return null},mouseOrPen:function(e){var t,o=e.pointerId,n=e.pointerType,r=e.eventType,i=e.scope;if(n!=="mouse"&&n!=="pen")return null;for(var c=0;c<i.interactions.list.length;c++){var a=i.interactions.list[c];if(a.pointerType===n){if(a.simulation&&!Bo(a,o))continu
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Xo(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function Ni(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Yo(e,t){return(Yo=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function Xi(e,t){return!t||No(t)!=="object"&&typeof t!="function"?function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(e):t}function Tn(e){return(Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.default=void 0;var Mn=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Uo(e,t){return function(o){var n=t.interactions.list,r=C.getPointerType(o),i=qo(C.getEventTargets(o),2),c=i[0],a=i[1],l=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var p=0;p<o.changedTouches.length;p++){var f=o.changedTouches[p],m={pointer:f,pointerId:C.getPointerId(f),pointerType:r,eventType:o.type,eventTarget:c,curEventTarget:a,scope:t},b=Ko(m);l.push([m.pointer,m.eventTarget,m.curEventTarget,b])}}else{var w=!1;if(!$.default.supportsPointerEvent&&/mouse/.test(o.type)){for(var y=0;y<n.length&&!w;y++)w=n[y].pointerType!=="mouse"&&n[y].pointerIsDown;w=w||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!w){var P={pointer:o,pointerId:C.getPointerId(o),pointerType:r,eventType:o.type,curEventTarget:a,eventTarget:c,scope:t},O=Ko(P);l.push([P.pointer,P.eventTarget,P.curEventTarget,O])}}for(var x=0;x<l.length;x++){var _=qo(l[x],4),j=_[0],F=_[1],q=_[2];_[3][e](j,o,F,q)}}}function Ko(e){var t=e.pointerType,o=e.scope,n={interaction:Rt.default.search(e),searchDetails:e};return o.fire("interactions:find",n),n.interaction||o.interactions.new({pointerType:t})}function On(e,t){var o=e.doc,n=e.scope,r=e.options,i=n.interactions.docEvents,c=n.events,a=c[t];for(var l in n.browser.isIOS&&!r.events&&(r.events={passive:!1}),c.delegatedEvents)a(o,l,c.delegateListener),a(o,l,c.delegateUseCapture,!0);for(var p=r&&r.events,f=0;f<i.length;f++){var m=i[f];a(o,m.type,m.listener,p)}}var Yi={id:"core/interactions",install:function(e){for(var t={},o=0;o<Mn.length;o++){var n=Mn[o];t[n]=Uo(n,e)}var r,i=$.default.pEventTypes;function c(){for(var a=0;a<e.interactions.list.length;a++){var l=e.interactions.list[a];if(l.pointerIsDown&&l.pointerType==="touch"&&!l._interacting)for(var p=function(){var m=l.pointers[f];e.documents.some(function(b){var w=b.doc;return(0,I.nodeContains)(w,m.downTarget)})||l.removePointer(m.pointer,m.event)},f=0;f<l.pointers.length;f++)p()}}(r=A.default.PointerEvent?[{type:i.down,listener:c},{type:i.down,listener:t.pointerDown},{type:i.move,listener:t.pointerMove},{type:i.up,listener:t.pointerUp},{type:i.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:c},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}]).push({type:"blur",listener:function(a){for(var l=0;l<e.interactions.list.length;l++)e.interactions.list[l].documentBlur(a)}}),e.prevTouchTime=0,e.Interaction=function(a){(function(y,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(P&&P.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),P&&Yo(y,P)})(w,a);var l,p,f,m,b=(f=w,m=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(y){retur
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function rr(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=void 0,Bt.default=function(e){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(n){var r=or(n,2),i=r[0],c=r[1];return i in e||c in e}),o=function(n,r){for(var i=e.range,c=e.limits,a=c===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:c,l=e.offset,p=l===void 0?{x:0,y:0}:l,f={range:i,grid:e,x:null,y:null},m=0;m<t.length;m++){var b=or(t[m],2),w=b[0],y=b[1],P=Math.round((n-p.x)/e[w]),O=Math.round((r-p.y)/e[y]);f[w]=Math.max(a.left,Math.min(a.right,P*e[w]+p.x)),f[y]=Math.max(a.top,Math.min(a.bottom,O*e[y]+p.y))}return f};return o.grid=e,o.coordFields=t,o};var st={};Object.defineProperty(st,"__esModule",{value:!0}),Object.defineProperty(st,"edgeTarget",{enumerable:!0,get:function(){return Ft.default}}),Object.defineProperty(st,"elements",{enumerable:!0,get:function(){return Vt.default}}),Object.defineProperty(st,"grid",{enumerable:!0,get:function(){return Bt.default}});var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.default=void 0;var Zi={id:"snappers",install:function(e){var t=e.interactStatic;t.snappers=(0,L.default)(t.snappers||{},st),t.createSnapGrid=t.snappers.grid}};Nt.default=Zi;var Ve={};function ir(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),o.push.apply(o,n)}return o}function Cn(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ir(Object(o),!0).forEach(function(n){Qi(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ir(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function Qi(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.aspectRatio=Ve.default=void 0;var ar={start:function(e){if(!e.state.options.enabled)return!1;var t=e.state,o=e.rect,n=e.edges,r=e.pageCoords,i=t.options.ratio,c=t.options,a=c.equalDelta,l=c.modifiers;i==="preserve"&&(i=o.width/o.height),t.startCoords=(0,L.default)({},r),t.startRect=(0,L.default)({},o),t.ratio=i,t.equalDelta=a;var p=t.linkedEdges={top:n.top||n.left&&!n.bottom,left:n.left||n.top&&!n.right,bottom:n.bottom||n.right&&!n.top,right:n.right||n.bottom&&!n.left};if(t.xIsPrimaryAxis=!(!n.left&&!n.right),t.equalDelta)t.edgeSign=(p.left?1:-1)*(p.top?1:-1);else{var f=t.xIsPrimaryAxis?p.top:p.left;t.edgeSign=f?-1:1}if((0,L.default)(e.edges,p),l&&l.length){var m=new Oe.default(e.interaction);m.copyFrom(e.interaction.modification),m.prepareStates(l),t.subModification=m,m.startAll(Cn({},e))}},set:function(e){if(e.state.options.enabled===!1)return!1;var t=e.state,o=e.rect,n=e.coords,r=(0,L.default)({},n),i=t.equalDelta?Ji:ea;if(i(t,t.xIsPrimaryAxis,n,o),!t.subModification)return null;var c=(0,L.default)({},o);(0,G.addEdges)(t.linkedEdges,c,{x:n.x-r.x,y:n.y-r.y});var a=t.subModification.setAll(Cn(Cn({},e),{},{rect:c,edges:t.linkedEdges,pageCoords:n,prevCoords:n,prevRect:c})),l=a.delta;return a.changed&&(i(t,Math.abs(l.x)>Math.abs(l.y),a.coords,a.rect),(0,L.default)(n,a.coords)),a.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Ji(e,t,o){var n=e.startCoords,r=e.edgeSign;t?o.y=n.y+(o.x-n.x)*r:o.x=n.x+(o.y-n.y)*r}function ea(e,t,o,n){var r=e.startRect,i=e.startCoords,c=e.ratio,a=e.edgeSign;if(t){var l=n.width/c;o.y=i.y+(l-r.height)*a}else{var p=n.height*c;o.x=i.x+(p-r.width)*a}}Ve.aspectRatio=ar;var ta=(0,ee.makeModifier)(ar,"aspectRatio");Ve.default=ta;var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.default=void 0;var sr=function(){};sr._defaults={};var na=sr;Ce.default=na;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0}),Object.defineProperty
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()),y=w[0],P=w[1];if(y in m||P in m){m.x=m[y],m.y=m[P];break}}r.options.targets.push(m)}}var O=xe.snap.set(e);return r.options=c,O},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}};me.snapSize=mr;var pa=(0,ee.makeModifier)(mr,"snapSize");me.default=pa;var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.snapEdges=qe.default=void 0;var yr={start:function(e){var t=e.edges;return t?(e.state.targetFields=e.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],me.snapSize.start(e)):null},set:me.snapSize.set,defaults:(0,L.default)((0,Me.default)(me.snapSize.defaults),{targets:null,range:null,offset:{x:0,y:0}})};qe.snapEdges=yr;var da=(0,ee.makeModifier)(yr,"snapEdges");qe.default=da;var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Object.defineProperty(Dn,"default",{enumerable:!0,get:function(){return Ce.default}});var jn={};Object.defineProperty(jn,"__esModule",{value:!0}),Object.defineProperty(jn,"default",{enumerable:!0,get:function(){return Ce.default}});var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.default=void 0;var fa={aspectRatio:Ve.default,restrictEdges:fe.default,restrict:ne.default,restrictRect:Be.default,restrictSize:Ne.default,snapEdges:qe.default,snap:xe.default,snapSize:me.default,spring:Dn.default,avoid:Ln.default,transform:jn.default,rubberband:An.default};Xe.default=fa;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=void 0;var ha={id:"modifiers",install:function(e){var t=e.interactStatic;for(var o in e.usePlugin(ee.default),e.usePlugin(Nt.default),t.modifiers=Xe.default,Xe.default){var n=Xe.default[o],r=n._defaults,i=n._methods;r._methods=i,e.defaults.perAction[o]=r}}};qt.default=ha;var Le={};function br(e){return(br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function va(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wr(e,t){return(wr=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function ga(e,t){return!t||br(t)!=="object"&&typeof t!="function"?Hn(e):t}function Hn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rn(e){return(Rn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(Le,"__esModule",{value:!0}),Le.PointerEvent=Le.default=void 0;var ma=function(e){(function(a,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(l&&l.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),l&&wr(a,l)})(c,e);var t,o,n,r,i=(n=c,r=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}(),function(){var a,l=Rn(n);if(r){var p=Rn(this).constructor;a=Reflect.construct(l,arguments,p)}else a=l.apply(this,arguments);return ga(this,a)});function c(a,l,p,f,m,b){var w;if(function(O,x){if(!(O instanceof x))throw new TypeError("Cannot call a class as a function")}(this,c),(w=i.call(this,m)).type=void 0,w.originalEvent=void 0,w.pointerId=void 0,w.pointerType=void 0,w.double=void 0,w.pageX=void 0,w.pageY=void 0,w.clientX=void 0,w.clientY=void 0,w.dt=void 0,w.eventable=void 0,C.pointerExtend(Hn(w),p),p!==l&&C.pointerExtend(Hn(w),l),w.timeStamp=b,w.originalEvent=p,w.type=a,w.pointerId=C.getPointerId(l),w.pointerType=C.getPointerType(l),w.target=f,w.currentTarget=null,a==="tap"){var y=m.getPointerIndex(l);w.dt=w.timeStamp-m.pointers[y].downTime;var P=w.timeStamp-m.tapTime;w.double=!!(m.prevTap&&m.prevTap.type!=="doubletap"&&m.prevTap.target===w.targ
|
||
|
will maximize the popover vertically. The top edge will maximize the popover to fill the entire
|
||
|
screen. Dragging the popovers away from the edges will restore the popver to its original size.`).addToggle(u=>u.setValue(this.plugin.settings.snapToEdges).onChange(h=>{this.plugin.settings.snapToEdges=h,this.plugin.saveSettings()})),new oe.Setting(s).setName("Show view header by default").setDesc(`Show the view header by default when triggering a hover editor.
|
||
|
When disabled, view headers will only show if you click the view header icon to the left of the minimize button.`).addToggle(u=>u.setValue(this.plugin.settings.showViewHeader).onChange(h=>{this.plugin.settings.showViewHeader=h,this.plugin.saveSettings()})),new oe.Setting(s).setName("Click to zoom image").setDesc(`Click and hold an image within a hover editor to temporarily maximize the popover and image to fill the entire viewport.
|
||
|
On mouse up, the hover editor will restore to its original size.`).addToggle(u=>u.setValue(this.plugin.settings.imageZoom).onChange(h=>{this.plugin.settings.imageZoom=h,this.plugin.saveSettings()})),new oe.Setting(s).setName("Initial popover width").setDesc("Enter any valid CSS unit").addText(u=>{u.setPlaceholder(this.plugin.settings.initialWidth),u.inputEl.type="text",u.setValue(this.plugin.settings.initialWidth),u.onChange(async h=>{h=Fn(h),h||(h=nn.initialWidth),this.plugin.settings.initialWidth=h,this.plugin.saveSettings()})}),new oe.Setting(s).setName("Initial popover height").setDesc("Enter any valid CSS unit").addText(u=>{u.setPlaceholder(String(this.plugin.settings.initialHeight)),u.inputEl.type="text",u.setValue(String(this.plugin.settings.initialHeight)),u.onChange(async h=>{h=Fn(h),h||(h=nn.initialHeight),this.plugin.settings.initialHeight=h,this.plugin.saveSettings()})}),new oe.Setting(s).setName("Hover Trigger Delay (ms)").setDesc("How long to wait before showing a Hover Editor when hovering over a link").addText(u=>{u.setPlaceholder(String(this.plugin.settings.triggerDelay)),u.inputEl.type="number",u.setValue(String(this.plugin.settings.triggerDelay)),u.onChange(async h=>{this.plugin.settings.triggerDelay=Number(h),this.plugin.saveSettings()})}),new oe.Setting(s).setName("Hover Close Delay (ms)").setDesc("How long to wait before closing a Hover Editor once the mouse leaves").addText(u=>{u.setPlaceholder(String(this.plugin.settings.closeDelay)),u.inputEl.type="number",u.setValue(String(this.plugin.settings.closeDelay)),u.onChange(async h=>{this.plugin.settings.closeDelay=Number(h),this.plugin.saveSettings()})})}};var Qn=be($r());var Gr=class extends $n{constructor(){super(...arguments);this.interact=this.createInteractor();this.plugin=this.use(on)}createInteractor(){if(this.win===window)return Qn.default;let s=Qn.default.scope,h=new s.constructor().init(this.win).interactStatic;for(let v of s._plugins.list)h.use(v);return h}onload(){this.win.addEventListener("resize",this.plugin.debouncedPopoverReflow)}onunload(){this.win.removeEventListener("resize",this.plugin.debouncedPopoverReflow);try{this.interact.removeDocument(this.win.document)}catch(s){console.error(s)}}},on=class extends B.Plugin{constructor(){super(...arguments);this.use=se.plugin(this);this.interact=this.use(Gr);this.debouncedPopoverReflow=(0,B.debounce)(()=>{U.activePopovers().forEach(s=>{var u;(u=s.interact)==null||u.reflow({name:"drag",axis:"xy"})})},100,!0)}async onload(){this.registerActivePopoverHandler(),this.registerFileRenameHandler(),this.registerContextMenuHandler(),this.registerCommands(),this.patchUnresolvedGraphNodeHover(),this.patchWorkspace(),this.patchQuickSwitcher(),this.patchWorkspaceLeaf(),this.patchItemView(),this.patchMarkdownPreviewRenderer(),await this.loadSettings(),this.registerSettingsTab(),this.app.workspace.onLayoutReady(()=>{this.patchSlidingPanes(),this.patchLinkHover(),setTimeout(()=>{this.app.workspace.trigger("css-change")},2e3)})}get activePopovers(){return U.activePopovers()}patchWorkspaceLeaf(){this.register(ie(B.WorkspaceLeaf.prototype,{getRoot(s){return function(){let u=s.call(this);return u.getRoot===this.getRoot?u:u.getRoot()}},onResize(s){return function(){var u;(u=this.view)==null||u.onResize()}},setViewState(s){return async function(u,h){var d,E,T;let v=await s.call(this,u,h);try{let k=U.forLeaf(this);if(k){u.type&&k.hoverEl.setAttribute("data-active-view-type",u.type);let S=k.hoverEl.querySelector(".popover-title");S&&(S.textContent=(d=this.view)==null?void 0:d.getDisplayText(),((T=(E=this.view)==null?void 0:E.file)==null?void 0:T.path)?S.setAttribute("data-path",this.view.file.path):S.removeAttribute("data-path"))}}catch(k){}return v}},setEphemeralState(s){return function(u){var h;s.call(this,u),u.focus&&((h=this.view)==null?void 0:h.getViewType())==="empty"&&(this.view.contentEl.tabIndex=-1,this.view.contentEl.focus())}}})),this.register(ie(B.WorkspaceItem.prototype,{getContainer(s){return function(){if(!!s)return!this.parentSplit||this instanceof B.WorkspaceContainer?s.call(this):this.pare
|