UNPKG

@zoom/meetingsdk

Version:
2 lines 788 kB
/*! For license information please see zoomus-websdk-998.umd.min.js.LICENSE.txt */ "use strict";(self.webpackChunk_zoom_webclientjs=self.webpackChunk_zoom_webclientjs||[]).push([[998],{80998:(e,t,n)=>{var i;n.r(t),n.d(t,{default:()=>tS});var r=n(31099),o=n(74342),s=n(40961),a=Object.defineProperty,l=(e,t,n)=>(((e,t,n)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!==typeof t?t+"":t,n),n);function d(e){return e.split("-")[0]}function c(e){return e.split("-")[1]}function u(e){return["top","bottom"].includes(d(e))?"x":"y"}function h(e){return"y"===e?"height":"width"}function p(e,t,n){let{reference:i,floating:r}=e;const o=i.x+i.width/2-r.width/2,s=i.y+i.height/2-r.height/2,a=u(t),l=h(a),p=i[l]/2-r[l]/2,g="x"===a;let f;switch(d(t)){case"top":f={x:o,y:i.y-r.height};break;case"bottom":f={x:o,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:s};break;case"left":f={x:i.x-r.width,y:s};break;default:f={x:i.x,y:i.y}}switch(c(t)){case"start":f[a]-=p*(n&&g?-1:1);break;case"end":f[a]+=p*(n&&g?-1:1)}return f}function g(e){return"number"!=typeof e?(t=e,{top:0,right:0,bottom:0,left:0,...t}):{top:e,right:e,bottom:e,left:e};var t}function f(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function m(e,t){var n;void 0===t&&(t={});const{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=t,m=g(p),v=a[h?"floating"===u?"reference":"floating":u],b=f(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),y=f(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===u?{...s.floating,x:i,y:r}:s.reference,offsetParent:await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),strategy:l}):s[u]);return{top:b.top-y.top+m.top,bottom:y.bottom-b.bottom+m.bottom,left:b.left-y.left+m.left,right:y.right-b.right+m.right}}const v=Math.min,b=Math.max;function y(e,t,n){return b(e,v(t,n))}const w=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:i=0}=null!=e?e:{},{x:r,y:o,placement:s,rects:a,platform:l}=t;if(null==n)return{};const d=g(i),p={x:r,y:o},f=u(s),m=c(s),v=h(f),b=await l.getDimensions(n),w="y"===f?"top":"left",x="y"===f?"bottom":"right",C=a.reference[v]+a.reference[f]-p[f]-a.floating[v],S=p[f]-a.reference[f],k=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let j=k?"y"===f?k.clientHeight||0:k.clientWidth||0:0;0===j&&(j=a.floating[v]);const I=C/2-S/2,E=d[w],P=j-b[v]-d[x],M=j/2-b[v]/2+I,T=y(E,M,P),B=("start"===m?d[w]:d[x])>0&&M!==T&&a.reference[v]<=a.floating[v];return{[f]:p[f]-(B?M<E?E-M:P-M:0),data:{[f]:T,centerOffset:M-T}}}}),x={left:"right",right:"left",bottom:"top",top:"bottom"};function C(e){return e.replace(/left|right|bottom|top/g,(e=>x[e]))}const S={start:"end",end:"start"};function k(e){return e.replace(/start|end/g,(e=>S[e]))}const j=["top","right","bottom","left"];j.reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]);const I=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:i,middlewareData:r,rects:o,initialPlacement:s,platform:a,elements:l}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:v="bestFit",flipAlignment:b=!0,...y}=e,w=d(i),x=[s,...f||(w!==s&&b?function(e){const t=C(e);return[k(e),t,k(t)]}(s):[C(s)])],S=await m(t,y),j=[];let I=(null==(n=r.flip)?void 0:n.overflows)||[];if(p&&j.push(S[w]),g){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const i=c(e),r=u(e),o=h(r);let s="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=C(s)),{main:s,cross:C(s)}}(i,o,await(null==a.isRTL?void 0:a.isRTL(l.floating)));j.push(S[e],S[t])}if(I=[...I,{placement:i,overflows:j}],!j.every((e=>e<=0))){var E,P;const e=(null!=(E=null==(P=r.flip)?void 0:P.index)?E:0)+1,t=x[e];if(t)return{data:{index:e,overflows:I},reset:{placement:t}};let n="bottom";switch(v){case"bestFit":{var M;const e=null==(M=I.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:M[0].placement;e&&(n=e);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}};function E(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function P(e){return j.some((t=>e[t]>=0))}const M=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){const{rects:i}=e;switch(t){case"referenceHidden":{const t=E(await m(e,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:P(t)}}}case"escaped":{const t=E(await m(e,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:P(t)}}}default:return{}}}}};function T(e){return"x"===e?"y":"x"}const B=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,c={x:n,y:i},h=await m(t,l),p=u(d(r)),g=T(p);let f=c[p],v=c[g];if(o){const e="y"===p?"bottom":"right";f=y(f+h["y"===p?"top":"left"],f,f-h[e])}if(s){const e="y"===g?"bottom":"right";v=y(v+h["y"===g?"top":"left"],v,v-h[e])}const b=a.fn({...t,[p]:f,[g]:v});return{...b,data:{x:b.x-n,y:b.y-i}}}}};function D(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function R(e){if(null==e)return window;if(!D(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function L(e){return R(e).getComputedStyle(e)}function A(e){return D(e)?"":e?(e.nodeName||"").toLowerCase():""}function _(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function O(e){return e instanceof R(e).HTMLElement}function z(e){return e instanceof R(e).Element}function H(e){return"undefined"!=typeof ShadowRoot&&(e instanceof R(e).ShadowRoot||e instanceof ShadowRoot)}function F(e){const{overflow:t,overflowX:n,overflowY:i}=L(e);return/auto|scroll|overlay|hidden/.test(t+i+n)}function N(e){return["table","td","th"].includes(A(e))}function $(e){const t=/firefox/i.test(_()),n=L(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function K(){return!/^((?!chrome|android).)*safari/i.test(_())}const V=Math.min,U=Math.max,G=Math.round;function W(e,t,n){var i,r,o,s;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect();let l=1,d=1;t&&O(e)&&(l=e.offsetWidth>0&&G(a.width)/e.offsetWidth||1,d=e.offsetHeight>0&&G(a.height)/e.offsetHeight||1);const c=z(e)?R(e):window,u=!K()&&n,h=(a.left+(u&&null!=(i=null==(r=c.visualViewport)?void 0:r.offsetLeft)?i:0))/l,p=(a.top+(u&&null!=(o=null==(s=c.visualViewport)?void 0:s.offsetTop)?o:0))/d,g=a.width/l,f=a.height/d;return{width:g,height:f,top:p,right:h+g,bottom:p+f,left:h,x:h,y:p}}function X(e){return(t=e,(t instanceof R(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Y(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Z(e){return W(X(e)).left+Y(e).scrollLeft}function q(e,t,n){const i=O(t),r=X(t),o=W(e,i&&function(e){const t=W(e);return G(t.width)!==e.offsetWidth||G(t.height)!==e.offsetHeight}(t),"fixed"===n);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(i||!i&&"fixed"!==n)if(("body"!==A(t)||F(r))&&(s=Y(t)),O(t)){const e=W(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else r&&(a.x=Z(r));return{x:o.left+s.scrollLeft-a.x,y:o.top+s.scrollTop-a.y,width:o.width,height:o.height}}function J(e){return"html"===A(e)?e:e.assignedSlot||e.parentNode||(H(e)?e.host:null)||X(e)}function Q(e){return O(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function ee(e){const t=R(e);let n=Q(e);for(;n&&N(n)&&"static"===getComputedStyle(n).position;)n=Q(n);return n&&("html"===A(n)||"body"===A(n)&&"static"===getComputedStyle(n).position&&!$(n))?t:n||function(e){let t=J(e);for(H(t)&&(t=t.host);O(t)&&!["html","body"].includes(A(t));){if($(t))return t;t=t.parentNode}return null}(e)||t}function te(e){if(O(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=W(e);return{width:t.width,height:t.height}}function ne(e){const t=J(e);return["html","body","#document"].includes(A(t))?e.ownerDocument.body:O(t)&&F(t)?t:ne(t)}function ie(e,t){var n;void 0===t&&(t=[]);const i=ne(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=R(i),s=r?[o].concat(o.visualViewport||[],F(i)?i:[]):i,a=t.concat(s);return r?a:a.concat(ie(s))}function re(e,t,n){return"viewport"===t?f(function(e,t){const n=R(e),i=X(e),r=n.visualViewport;let o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;const e=K();(e||!e&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a,y:l}}(e,n)):z(t)?function(e,t){const n=W(e,!1,"fixed"===t),i=n.top+e.clientTop,r=n.left+e.clientLeft;return{top:i,left:r,x:r,y:i,right:r+e.clientWidth,bottom:i+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):f(function(e){var t;const n=X(e),i=Y(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=U(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=U(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let a=-i.scrollLeft+Z(e);const l=-i.scrollTop;return"rtl"===L(r||n).direction&&(a+=U(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(X(e)))}function oe(e){const t=ie(e),n=["absolute","fixed"].includes(L(e).position)&&O(e)?ee(e):e;return z(n)?t.filter((e=>z(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&H(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==A(e))):[]}const se={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[..."clippingAncestors"===n?oe(t):[].concat(n),i],s=o[0],a=o.reduce(((e,n)=>{const i=re(t,n,r);return e.top=U(i.top,e.top),e.right=V(i.right,e.right),e.bottom=V(i.bottom,e.bottom),e.left=U(i.left,e.left),e}),re(t,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:i}=e;const r=O(n),o=X(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((r||!r&&"fixed"!==i)&&(("body"!==A(n)||F(o))&&(s=Y(n)),O(n))){const e=W(n,!0);a.x=e.x+n.clientLeft,a.y=e.y+n.clientTop}return{...t,x:t.x-s.scrollLeft+a.x,y:t.y-s.scrollTop+a.y}},isElement:z,getDimensions:te,getOffsetParent:ee,getDocumentElement:X,getElementRects:e=>{let{reference:t,floating:n,strategy:i}=e;return{reference:q(t,ee(n),i),floating:{...te(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===L(e).direction};function ae(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=!0,animationFrame:a=!1}=i,l=r&&!a,d=o&&!a,c=l||d?[...z(e)?ie(e):[],...ie(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),d&&e.addEventListener("resize",n)}));let u,h=null;if(s){let i=!0;h=new ResizeObserver((()=>{i||n(),i=!1})),z(e)&&!a&&h.observe(e),h.observe(t)}let p=a?W(e):null;return a&&function t(){const i=W(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n(),p=i,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),d&&e.removeEventListener("resize",n)})),null==(e=h)||e.disconnect(),h=null,a&&cancelAnimationFrame(u)}}const le=(e,t,n)=>(async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=n,a=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:c}=p(l,i,a),u=i,h={},g=0;for(let f=0;f<o.length;f++){const{name:n,fn:m}=o[f],{x:v,y:b,data:y,reset:w}=await m({x:d,y:c,initialPlacement:i,placement:u,strategy:r,middlewareData:h,rects:l,platform:s,elements:{reference:e,floating:t}});d=null!=v?v:d,c=null!=b?b:c,h={...h,[n]:{...h[n],...y}},w&&g<=50&&(g++,"object"==typeof w&&(w.placement&&(u=w.placement),w.rects&&(l=!0===w.rects?await s.getElementRects({reference:e,floating:t,strategy:r}):w.rects),({x:d,y:c}=p(l,u,a))),f=-1)}return{x:d,y:c,placement:u,strategy:r,middlewareData:h}})(e,t,{platform:se,...n});var de=Object.defineProperty,ce=(e,t,n)=>(((e,t,n)=>{t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),ue=class{static clamp(e,t,n){return Math.max(t,"undefined"!=typeof n?Math.min(e,n):e)}static clampV(e,t,n){return e.map((e=>n?ue.clamp(e,t,n):ue.clamp(e,t)))}static cross(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(t[1]-e[1])}static snap(e,t=1){return[Math.round(e[0]/t)*t,Math.round(e[1]/t)*t]}},he=ue;ce(he,"neg",(e=>[-e[0],-e[1]])),ce(he,"add",((e,t)=>[e[0]+t[0],e[1]+t[1]])),ce(he,"addScalar",((e,t)=>[e[0]+t,e[1]+t])),ce(he,"sub",((e,t)=>[e[0]-t[0],e[1]-t[1]])),ce(he,"subScalar",((e,t)=>[e[0]-t,e[1]-t])),ce(he,"vec",((e,t)=>[t[0]-e[0],t[1]-e[1]])),ce(he,"mul",((e,t)=>[e[0]*t,e[1]*t])),ce(he,"mulV",((e,t)=>[e[0]*t[0],e[1]*t[1]])),ce(he,"div",((e,t)=>[e[0]/t,e[1]/t])),ce(he,"divV",((e,t)=>[e[0]/t[0],e[1]/t[1]])),ce(he,"per",(e=>[e[1],-e[0]])),ce(he,"dpr",((e,t)=>e[0]*t[0]+e[1]*t[1])),ce(he,"cpr",((e,t)=>e[0]*t[1]-t[0]*e[1])),ce(he,"len2",(e=>e[0]*e[0]+e[1]*e[1])),ce(he,"len",(e=>Math.hypot(e[0],e[1]))),ce(he,"pry",((e,t)=>ue.dpr(e,t)/ue.len(t))),ce(he,"uni",(e=>ue.div(e,ue.len(e)))),ce(he,"normalize",(e=>ue.uni(e))),ce(he,"tangent",((e,t)=>ue.uni(ue.sub(e,t)))),ce(he,"dist2",((e,t)=>ue.len2(ue.sub(e,t)))),ce(he,"dist",((e,t)=>Math.hypot(e[1]-t[1],e[0]-t[0]))),ce(he,"fastDist",((e,t)=>{let n=[t[0]-e[0],t[1]-e[1]],i=[Math.abs(n[0]),Math.abs(n[1])],r=1/Math.max(i[0],i[1]);return r*=1.29289-(i[0]+i[1])*r*.29289,[n[0]*r,n[1]*r]})),ce(he,"ang",((e,t)=>Math.atan2(ue.cpr(e,t),ue.dpr(e,t)))),ce(he,"angle",((e,t)=>Math.atan2(t[1]-e[1],t[0]-e[0]))),ce(he,"med",((e,t)=>ue.mul(ue.add(e,t),.5))),ce(he,"rot",((e,t=0)=>[e[0]*Math.cos(t)-e[1]*Math.sin(t),e[0]*Math.sin(t)+e[1]*Math.cos(t)])),ce(he,"rotWith",((e,t,n=0)=>{if(0===n)return e;let i=Math.sin(n),r=Math.cos(n),o=e[0]-t[0],s=e[1]-t[1],a=o*i+s*r;return[o*r-s*i+t[0],a+t[1]]})),ce(he,"isEqual",((e,t)=>e[0]===t[0]&&e[1]===t[1])),ce(he,"lrp",((e,t,n)=>ue.add(e,ue.mul(ue.sub(t,e),n)))),ce(he,"int",((e,t,n,i,r=1)=>{let o=(ue.clamp(n,i)-n)/(i-n);return ue.add(ue.mul(e,1-o),ue.mul(t,r))})),ce(he,"ang3",((e,t,n)=>{let i=ue.vec(t,e),r=ue.vec(t,n);return ue.ang(i,r)})),ce(he,"abs",(e=>[Math.abs(e[0]),Math.abs(e[1])])),ce(he,"rescale",((e,t)=>{let n=ue.len(e);return[t*e[0]/n,t*e[1]/n]})),ce(he,"isLeft",((e,t,n)=>(t[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(t[1]-e[1]))),ce(he,"clockwise",((e,t,n)=>ue.isLeft(e,t,n)>0)),ce(he,"toFixed",(e=>e.map((e=>Math.round(100*e)/100)))),ce(he,"nearestPointOnLineThroughPoint",((e,t,n)=>ue.add(e,ue.mul(t,ue.pry(ue.sub(n,e),t))))),ce(he,"distanceToLineThroughPoint",((e,t,n)=>ue.dist(n,ue.nearestPointOnLineThroughPoint(e,t,n)))),ce(he,"nearestPointOnLineSegment",((e,t,n,i=!0)=>{let r=ue.uni(ue.sub(t,e)),o=ue.add(e,ue.mul(r,ue.pry(ue.sub(n,e),r)));if(i){if(o[0]<Math.min(e[0],t[0]))return e[0]<t[0]?e:t;if(o[0]>Math.max(e[0],t[0]))return e[0]>t[0]?e:t;if(o[1]<Math.min(e[1],t[1]))return e[1]<t[1]?e:t;if(o[1]>Math.max(e[1],t[1]))return e[1]>t[1]?e:t}return o})),ce(he,"distanceToLineSegment",((e,t,n,i=!0)=>ue.dist(n,ue.nearestPointOnLineSegment(e,t,n,i)))),ce(he,"nearestPointOnBounds",((e,t)=>[ue.clamp(t[0],e.minX,e.maxX),ue.clamp(t[1],e.minY,e.maxY)])),ce(he,"distanceToBounds",((e,t)=>ue.dist(t,ue.nearestPointOnBounds(e,t)))),ce(he,"nudge",((e,t,n)=>ue.isEqual(e,t)?e:ue.add(e,ue.mul(ue.uni(ue.sub(t,e)),n)))),ce(he,"nudgeAtAngle",((e,t,n)=>[Math.cos(t)*n+e[0],Math.sin(t)*n+e[1]])),ce(he,"toPrecision",((e,t=4)=>[+e[0].toPrecision(t),+e[1].toPrecision(t)])),ce(he,"pointsBetween",((e,t,n=6)=>Array.from(Array(n)).map(((i,r)=>{let o=r/(n-1),s=Math.min(1,.5+Math.abs(.5-o));return[...ue.lrp(e,t,o),s]})))),ce(he,"slope",((e,t)=>e[0]===t[0]?NaN:(e[1]-t[1])/(e[0]-t[0]))),ce(he,"max",((...e)=>[Math.max(...e.map((e=>e[0]))),Math.max(...e.map((e=>e[1])))])),ce(he,"min",((...e)=>[Math.min(...e.map((e=>e[0]))),Math.min(...e.map((e=>e[1])))]));var pe=he;const ge={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function fe(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function me(e,t,n,i=.15){return 0===i?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-fe(t-e,n-t,i)+t:e>n?+fe(e-n,n-t,i)+n:e}function ve(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}function be(e,t,n){return(t=ve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){be(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const xe={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function Ce(e){return e?e[0].toUpperCase()+e.slice(1):""}const Se=["enter","leave"];function ke(e,t="",n=!1){const i=xe[e],r=i&&i[t]||t;return"on"+Ce(e)+Ce(r)+(function(e=!1,t){return e&&!Se.includes(t)}(n,r)?"Capture":"")}const je=["gotpointercapture","lostpointercapture"];function Ie(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const i=je.includes(t)?"capturecapture":"capture",r=!!~t.indexOf(i);return r&&(t=t.replace("capture","")),{device:t,capture:r,passive:n}}function Ee(e){return"touches"in e}function Pe(e){return Ee(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Me(e){return Ee(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function Te(e,t){try{const n=t.clientX-e.clientX,i=t.clientY-e.clientY,r=(t.clientX+e.clientX)/2,o=(t.clientY+e.clientY)/2,s=Math.hypot(n,i),a=-180*Math.atan2(n,i)/Math.PI;return{angle:a,distance:s,origin:[r,o]}}catch(n){}return null}function Be(e){return function(e){return Array.from(e.touches).filter((t=>{var n,i;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(i=n.contains)||void 0===i?void 0:i.call(n,t.target))}))}(e).map((e=>e.identifier))}function De(e,t){const[n,i]=Array.from(e.touches).filter((e=>t.includes(e.identifier)));return Te(n,i)}function Re(e){const t=Me(e);return Ee(e)?t.identifier:t.pointerId}function Le(e){const t=Me(e);return[t.clientX,t.clientY]}function Ae(e){let{deltaX:t,deltaY:n,deltaMode:i}=e;return 1===i?(t*=40,n*=40):2===i&&(t*=800,n*=800),[t,n]}function _e(e,...t){return"function"===typeof e?e(...t):e}function Oe(){}function ze(...e){return 0===e.length?Oe:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function He(e,t){return Object.assign({},t,e||{})}class Fe{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:i}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?_e(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:i}=this;t.args=this.args;let r=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:i,metaKey:r,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:i,metaKey:r,ctrlKey:o})}return t}(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,r=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);ge.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[o,s]=t._movement,[a,l]=n.threshold,{_step:d,values:c}=t;if(n.hasCustomTransform?(!1===d[0]&&(d[0]=Math.abs(o)>=a&&c[0]),!1===d[1]&&(d[1]=Math.abs(s)>=l&&c[1])):(!1===d[0]&&(d[0]=Math.abs(o)>=a&&Math.sign(o)*a),!1===d[1]&&(d[1]=Math.abs(s)>=l&&Math.sign(s)*l)),t.intentional=!1!==d[0]||!1!==d[1],!t.intentional)return;const u=[0,0];if(n.hasCustomTransform){const[e,t]=c;u[0]=!1!==d[0]?e-d[0]:0,u[1]=!1!==d[1]?t-d[1]:0}else u[0]=!1!==d[0]?o-d[0]:0,u[1]=!1!==d[1]?s-d[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(u);const h=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=i[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=_e(n.bounds,t)),this.setup&&this.setup()),t.movement=u,this.computeOffset()));const[g,f]=t.offset,[[m,v],[b,y]]=t._bounds;t.overflow=[g<m?-1:g>v?1:0,f<b?-1:f>y?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const w=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[i,r]){const[[o,s],[a,l]]=e;return[me(t,o,s,i),me(n,a,l,r)]}(t._bounds,t.offset,w),t.delta=ge.sub(t.offset,h),this.computeMovement(),p&&(!t.last||r>32)){t.delta=ge.sub(t.offset,h);const e=t.delta.map(Math.abs);ge.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&r>0&&(t.velocity=[e[0]/r,e[1]/r],t.timeDelta=r)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const i=this.handler(we(we(we({},t),e),{},{[this.aliasKey]:e.values}));void 0!==i&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Ne extends Fe{constructor(...e){super(...e),be(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ge.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ge.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const i="object"===typeof n.axisThreshold?n.axisThreshold[Pe(e)]:n.axisThreshold;t.axis=function([e,t],n){const i=Math.abs(e),r=Math.abs(t);return i>r&&i>n?"x":r>i&&r>n?"y":void 0}(t._movement,i)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const $e=e=>e,Ke={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>we(we({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return ge.toVector(e)}},from:e=>"function"===typeof e?e:null!=e?ge.toVector(e):void 0,transform(e,t,n){const i=e||n.shared.transform;return this.hasCustomTransform=!!i,i||$e},threshold:e=>ge.toVector(e,0)};const Ve=we(we({},Ke),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"===typeof e)return t=>Ve.bounds(e(t));if("current"in e)return()=>e.current;if("function"===typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:i=-1/0,bottom:r=1/0}=e;return[[t,n],[i,r]]}}),Ue={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Ge="undefined"!==typeof window&&window.document&&window.document.createElement;function We(){return Ge&&"ontouchstart"in window||Ge&&window.navigator.maxTouchPoints>1}const Xe={isBrowser:Ge,gesture:function(){try{return"constructor"in GestureEvent}catch(sv){return!1}}(),touch:We(),touchscreen:We(),pointer:Ge&&"onpointerdown"in window,pointerLock:Ge&&"exitPointerLock"in window.document},Ye={mouse:0,touch:0,pen:8},Ze=we(we({},Ve),{},{device(e,t,{pointer:{touch:n=!1,lock:i=!1,mouse:r=!1}={}}){return this.pointerLock=i&&Xe.pointerLock,Xe.touch&&n?"touch":this.pointerLock?"mouse":Xe.pointer&&!r?"pointer":Xe.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"===typeof n?n:n||void 0===n&&e?250:void 0,Xe.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:i=1,keys:r=!0}={}}){return this.pointerButtons=i,this.keys=r,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:i=3,axis:r}){const o=ge.toVector(e,n?i:r?1:0);return this.filterTaps=n,this.tapsThreshold=i,o},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(ge.toVector(e)),distance:this.transform(ge.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?we(we({},Ye),e):Ye,keyboardDisplacement:(e=10)=>e});function qe(e){const[t,n]=e.overflow,[i,r]=e._delta,[o,s]=e._direction;(t<0&&i>0&&o<0||t>0&&i<0&&o>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&r>0&&s<0||n>0&&r<0&&s>0)&&(e._movement[1]=e._movementBound[1])}const Je=we(we({},Ke),{},{device(e,t,{shared:n,pointer:{touch:i=!1}={}}){if(n.target&&!Xe.touch&&Xe.gesture)return"gesture";if(Xe.touch&&i)return"touch";if(Xe.touchscreen){if(Xe.pointer)return"pointer";if(Xe.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:i={}}){const r=e=>{const t=He(_e(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},o=e=>{const t=He(_e(i,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!==typeof n&&"function"!==typeof i?[r(),o()]:e=>[r(e),o(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return ge.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});const Qe=we(we({},Ve),{},{mouseOnly:(e=!0)=>e});const et=Ve;const tt=Ve;const nt=we(we({},Ve),{},{mouseOnly:(e=!0)=>e}),it=new Map,rt=new Map;function ot(e){it.set(e.key,e.engine),rt.set(e.key,e.resolver)}const st={key:"drag",engine:class extends Ne{constructor(...e){super(...e),be(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),i={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Ve.bounds(i)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const i=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),i&&i.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=Re(e),n._pointerActive=!0,this.computeValues(Le(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==Pe(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;if(t.type===e.type&&e.timeStamp===t.timeStamp)return;const i=Re(e);if(void 0!==t._pointerId&&i!==t._pointerId)return;const r=Le(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=ge.sub(r,t._values),this.computeValues(r)),ge.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(s){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const i=Re(e);if(void 0!==t._pointerId&&i!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[r,o]=t._distance;if(t.tap=r<=n.tapsThreshold&&o<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,i]=t._delta,[r,o]=t._movement,[s,a]=n.swipe.velocity,[l,d]=n.swipe.distance,c=n.swipe.duration;if(t.elapsedTime<c){const n=Math.abs(e/t.timeDelta),c=Math.abs(i/t.timeDelta);n>s&&Math.abs(r)>l&&(t.swipe[0]=Math.sign(e)),c>a&&Math.abs(o)>d&&(t.swipe[1]=Math.sign(i))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"===typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Ue[e.key];if(t){const n=this.state,i=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,i),n._keyboardActive=!0,ge.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Ue&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Ze},at={key:"hover",engine:class extends Ne{constructor(...e){super(...e),be(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.start(e),this.computeValues(Le(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&"mouse"!==e.pointerType)return;const t=this.state;if(!t._active)return;t._active=!1;const n=Le(e);t._movement=t._delta=ge.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},resolver:nt},lt={key:"move",engine:class extends Ne{constructor(...e){super(...e),be(this,"ingKey","moving")}move(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(Le(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=Le(e),n=this.state;n._delta=ge.sub(t,n._values),ge.addTo(n._movement,n._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}},resolver:Qe},dt={key:"pinch",engine:class extends Fe{constructor(...e){super(...e),be(this,"ingKey","pinching"),be(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;this.state.offset="wheel"===e?ge.add(t,n):[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const i=30*Math.abs(t)-Math.abs(n);i<0?e.axis="angle":i>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout((()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()}),0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every((e=>n.has(e))))return;if(n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const i=De(e,t._touchIds);i&&this.pinchStart(e,i)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,i=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every((e=>i.has(e))))return;if(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2)return;this.start(e);const r=Te(...Array.from(n.values()));r&&this.pinchStart(e,r)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=De(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=Te(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,i=n._values[1],r=t.angle-i;let o=0;Math.abs(r)>270&&(o+=Math.sign(r)),this.computeValues([t.distance,t.angle-360*o]),n.origin=t.origin,n.turns=o,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some((e=>!this.ctrl.touchIds.has(e)))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch(n){}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=ge.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&!e[t]||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-Ae(e)[1]/100*t.offset[0],0],ge.addTo(t._movement,t._delta),qe(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:Je},ct={key:"scroll",engine:class extends Ne{constructor(...e){super(...e),be(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,n=function(e){var t,n;const{scrollX:i,scrollY:r,scrollLeft:o,scrollTop:s}=e.currentTarget;return[null!==(t=null!==i&&void 0!==i?i:o)&&void 0!==t?t:0,null!==(n=null!==r&&void 0!==r?r:s)&&void 0!==n?n:0]}(e);t._delta=ge.sub(n,t._values),ge.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}},resolver:et},ut={key:"wheel",engine:class extends Ne{constructor(...e){super(...e),be(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=Ae(e),ge.addTo(t._movement,t._delta),qe(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}},resolver:tt};function ht(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const pt={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Xe.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},gt=["target","eventOptions","window","enabled","transform"];function ft(e={},t){const n={};for(const[i,r]of Object.entries(t))switch(typeof r){case"function":n[i]=r.call(n,e[i],i,e);break;case"object":n[i]=ft(e[i],r);break;case"boolean":r&&(n[i]=e[i])}return n}class mt{constructor(e,t){be(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,i,r){const o=this._listeners,s=function(e,t=""){const n=xe[e];return e+(n&&n[t]||t)}(t,n),a=we(we({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),r);e.addEventListener(s,i,a);const l=()=>{e.removeEventListener(s,i,a),o.delete(l)};return o.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class vt{constructor(){be(this,"_timeouts",new Map)}add(e,t,n=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...i))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class bt{constructor(e){be(this,"gestures",new Set),be(this,"_targetEventStore",new mt(this)),be(this,"gestureEventStores",{}),be(this,"gestureTimeoutStores",{}),be(this,"handlers",{}),be(this,"config",{}),be(this,"pointerIds",new Set),be(this,"touchIds",new Set),be(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&yt(e,"drag");t.wheel&&yt(e,"wheel");t.scroll&&yt(e,"scroll");t.move&&yt(e,"move");t.pinch&&yt(e,"pinch");t.hover&&yt(e,"hover")}(this,e)}setEventIds(e){return Ee(e)?(this.touchIds=new Set(Be(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const i=e,{target:r,eventOptions:o,window:s,enabled:a,transform:l}=i,d=ht(i,gt);if(n.shared=ft({target:r,eventOptions:o,window:s,enabled:a,transform:l},pt),t){const e=rt.get(t);n[t]=ft(we({shared:n.shared},d),e)}else for(const c in d){const e=rt.get(c);e&&(n[c]=ft(we({shared:n.shared},d[c]),e))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let i;if(!t.target||(i=t.target(),i)){if(t.enabled){for(const t of this.gestures){const r=this.config[t],o=wt(n,r.eventOptions,!!i);if(r.enabled){new(it.get(t))(this,e,t).bind(o)}}const r=wt(n,t.eventOptions,!!i);for(const t in this.nativeHandlers)r(t,"",(n=>this.nativeHandlers[t](we(we({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=ze(...n[e]);if(!i)return n;for(const e in n){const{device:t,capture:r,passive:o}=Ie(e);this._targetEventStore.add(i,t,"",n[e],{capture:r,passive:o})}}}}function yt(e,t){e.gestures.add(t),e.gestureEventStores[t]=new mt(e,t),e.gestureTimeoutStores[t]=new vt}const wt=(e,t,n)=>(i,r,o,s={},a=!1)=>{var l,d;const c=null!==(l=s.capture)&&void 0!==l?l:t.capture,u=null!==(d=s.passive)&&void 0!==d?d:t.passive;let h=a?i:ke(i,r,c);n&&u&&(h+="Passive"),e[h]=e[h]||[],e[h].push(o)},xt=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Ct(e,t,n,i,r,o){if(!e.has(n))return;if(!it.has(i))return void 0;const s=n+"Start",a=n+"End";r[i]=e=>{let i;return e.first&&s in t&&t[s](e),n in t&&(i=t[n](e)),e.last&&a in t&&t[a](e),i},o[i]=o[i]||{}}function St(e,t){const[n,i,r]=function(e){const t={},n={},i=new Set;for(let r in e)xt.test(r)?(i.add(RegExp.lastMatch),n[r]=e[r]):t[r]=e[r];return[n,t,i]}(e),o={};return Ct(r,n,"onDrag","drag",o,t),Ct(r,n,"onWheel","wheel",o,t),Ct(r,n,"onScroll","scroll",o,t),Ct(r,n,"onPinch","pinch",o,t),Ct(r,n,"onMove","move",o,t),Ct(r,n,"onHover","hover",o,t),{handlers:o,config:t,nativeHandlers:i}}function kt(e){return e.forEach(ot),function(e,t){const{handlers:n,nativeHandlers:i,config:o}=St(e,t||{});return function(e,t={},n,i){const o=r.useMemo((()=>new bt(e)),[]);if(o.applyHandlers(e,i),o.applyConfig(t,n),r.useEffect(o.effect.bind(o)),r.useEffect((()=>o.clean.bind(o)),[]),void 0===t.target)return o.bind.bind(o)}(n,o,void 0,i)}}function jt(e,t,n,i=e=>e){return e*i(.5-t*(.5-n))}function It(e,t){return[e[0]+t[0],e[1]+t[1]]}function Et(e,t){return[e[0]-t[0],e[1]-t[1]]}function Pt(e,t){return[e[0]*t,e[1]*t]}function Mt(e){return[e[1],-e[0]]}function Tt(e,t){return e[0]*t[0]+e[1]*t[1]}function Bt(e,t){return e[0]===t[0]&&e[1]===t[1]}function Dt(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Et(e,t))}function Rt(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Lt(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function At(e,t,n){let i=Math.sin(n),r=Math.cos(n),o=e[0]-t[0],s=e[1]-t[1],a=o*i+s*r;return[o*r-s*i+t[0],a+t[1]]}function _t(e,t,n){return It(e,Pt(Et(t,e),n))}function Ot(e,t,n){return It(e,Pt(t,n))}var{min:zt,PI:Ht}=Math,Ft=Ht+1e-4;function Nt(e,t={}){let{size:n=16,smoothing:i=.5,thinning:r=.5,simulatePressure:o=!0,easing:s=e=>e,start:a={},end:l={},last:d=!1}=t,{cap:c=!0,easing:u=e=>e*(2-e)}=a,{cap:h=!0,easing:p=e=>--e*e*e+1}=l;if(0===e.length||n<=0)return[];let g,f=e[e.length-1].runningLength,m=!1===a.taper?0:!0===a.taper?Math.max(n,f):a.taper,v=!1===l.taper?0:!0===l.taper?Math.max(n,f):l.taper,b=Math.pow(n*i,2),y=[],w=[],x=e.slice(0,10).reduce(((e,t)=>{let i=t.pressure;if(o){let r=zt(1,t.distance/n),o=zt(1,1-r);i=zt(1,e+.275*r*(o-e))}return(e+i)/2}),e[0].pressure),C=jt(n,r,e[e.length-1].pressure,s),S=e[0].vector,k=e[0].point,j=k,I=k,E=j,P=!1;for(let R=0;R<e.length;R++){let{pressure:t}=e[R],{point:i,vector:a,distance:l,runningLength:d}=e[R];if(R<e.length-1&&f-d<3)continue;if(r){if(o){let e=zt(1,l/n),i=zt(1,1-e);t=zt(1,x+.275*e*(i-x))}C=jt(n,r,t,s)}else C=n/2;void 0===g&&(g=C);let c=d<m?u(d/m):1,h=f-d<v?p((f-d)/v):1;C=Math.max(.01,C*Math.min(c,h));let M=(R<e.length-1?e[R+1]:e[R]).vector,T=R<e.length-1?Tt(a,M):1,B=null!==T&&T<0;if(Tt(a,S)<0&&!P||B){let e=Pt(Mt(S),C);for(let t=1/13,n=0;n<=1;n+=t)I=At(Et(i,e),i,Ft*n),y.push(I),E=At(It(i,e),i,Ft*-n),w.push(E);k=I,j=E,B&&(P=!0);continue}if(P=!1,R===e.length-1){let e=Pt(Mt(a),C);y.push(Et(i,e)),w.push(It(i,e));continue}let D=Pt(Mt(_t(M,a,T)),C);I=Et(i,D),(R<=1||Dt(k,I)>b)&&(y.push(I),k=I),E=It(i,D),(R<=1||Dt(j,E)>b)&&(w.push(E),j=E),x=t,S=a}let M=e[0].point.slice(0,2),T=e.length>1?e[e.length-1].point.slice(0,2):It(e[0].point,[1,1]),B=[],D=[];if(1===e.length){if(!m&&!v||d){let e=Ot(M,Rt(Mt(Et(M,T))),-(g||C)),t=[];for(let n=1/13,i=n;i<=1;i+=n)t.push(At(e,M,2*Ft*i));return t}}else{if(!(m||v&&1===e.length))if(c)for(let e=1/13,n=e;n<=1;n+=e){let e=At(w[0],M,Ft*n);B.push(e)}else{let e=Et(y[0],w[0]),t=Pt(e,.5),n=Pt(e,.51);B.push(Et(M,t),Et(M,n),It(M,n),It(M,t))}let t=Mt(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(v||m&&1===e.length)D.push(T);else if(h){let e=Ot(T,t,C);for(let t=1/29,n=t;n<1;n+=t)D.push(At(e,T,3*Ft*n))}else D.push(It(T,Pt(t,C)),It(T,Pt(t,.99*C)),Et(T,Pt(t,.99*C)),Et(T,Pt(t,C)))}return y.concat(D,w.reverse(),B)}function $t(e,t={}){var n;let{streamline:i=.5,size:r=16,last:o=!1}=t;if(0===e.length)return[];let s=.15+.85*(1-i),a=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===a.length){let e=a[1];a=a.slice(0,-1);for(let t=1;t<5;t++)a.push(_t(a[0],e,t/4))}1===a.length&&(a=[...a,[...It(a[0],[1,1]),...a[0].slice(2)]]);let l=[{point:[a[0][0],a[0][1]],pressure:a[0][2]>=0?a[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,c=0,u=l[0],h=a.length-1;for(let p=1;p<a.length;p++){let e=o&&p===h?a[p].slice(0,2):_t(u.point,a[p],s);if(Bt(u.point,e))continue;let t=Lt(e,u.point);if(c+=t,p<h&&!d){if(c<r)continue;d=!0}u={point:e,pressure:a[p][2]>=0?a[p][2]:.5,vector:Rt(Et(u.point,e)),distance:t,runningLength:c},l.push(u)}return l[0].vector=(null==(n=l[1])?void 0:n.vector)||[0,0],l}var Kt=function(e,t={}){return Nt($t(e,t),t)},Vt=Object.defineProperty,Ut=Object.defineProperties,Gt=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Zt=(e,t,n)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qt=(e,t)=>{for(var n in t||(t={}))Xt.call(t,n)&&Zt(e,n,t[n]);if(Wt)for(var n of Wt(t))Yt.call(t,n)&&Zt(e,n,t[n]);return e},Jt=(e,t)=>Ut(e,Gt(t));function Qt(e,...t){return{didIntersect:t.length>0,message:e,points:t}}function en(e,t,n=0){let i=[e[0]+t[0]/2,e[1]+t[1]/2],r=he.rotWith(e,i,n),o=he.rotWith(he.add(e,[t[0],0]),i,n),s=he.rotWith(he.add(e,t),i,n),a=he.rotWith(he.add(e,[0,t[1]]),i,n);return[["top",[r,o]],["right",[o,s]],["bottom",[s,a]],["left",[a,r]]]}function tn(e,t,n,i){let[r,o]=e,[s,a]=t,[l,d]=n,[c,u]=i;if(a/s!==(u-d)/(c-l)){let e=s*(u-d)-a*(c-l);if(0!==e){let t=((o-d)*(c-l)-(r-l)*(u-d))/e,n=((o-d)*s-(r-l)*a)/e;if(t>=0&&n>=0&&n<=1)return Qt("intersection",[r+t*s,o+t*a])}}return Qt("no intersection")}function nn(e,t,n,i,r=0){return function(e,t,n,i,r){return en(e,t,n).reduce(((e,[t,[n,o]])=>{let s=tn(i,r,n,o);return s&&e.push(Qt(t,...s.points)),e}),[]).filter((e=>e.didIntersect))}(n,i,r,e,t)}function rn(e,t,n,i,r,o){return dn(e,he.mul(t,999999999),n,i,r,o)}function on(e,t,n,i=0){let{minX:r,minY:o,width:s,height:a}=n;return nn(e,t,[r,o],[s,a],i)}function sn(e,t,n,i){l