UNPKG

@cocalc/static

Version:

CoCalc's static frontend Webpack-based build system and framework

1 lines 19.4 kB
"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[4498],{82325:function(e,t,n){var r,i=this&&this.__extends||(r=function(e,t){var n,i;return r=Object.setPrototypeOf||(n={__proto__:[]},(null!=(i=Array)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?!!i[Symbol.hasInstance](n):n instanceof i)&&function(e,t){e.__proto__=t})||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){var n=function(){this.constructor=e};r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return o(t,e),t},u=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};Object.defineProperty(t,"__esModule",{value:!0});var c=s(n(63505)),d=n(59887),l=n(11918),h=["ArrowRight","ArrowUp","k","PageUp"],f=["ArrowLeft","ArrowDown","j","PageDown"],p=function(e){var t=function(t){var n=e.call(this,t)||this;if(n.trackRef=c.createRef(),n.thumbRefs=[],n.markRefs=[],n.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(n.props.values.length).fill(0).map((function(e,t){return t})),isChanged:!1,markOffsets:[]},n.getOffsets=function(){var e=n.props,t=e.direction,r=e.values,i=e.min,a=e.max,o=n.trackRef.current,s=o.getBoundingClientRect(),u=d.getPaddingAndBorder(o);return n.getThumbs().map((function(e,n){var o={x:0,y:0},c=e.getBoundingClientRect(),h=d.getMargin(e);switch(t){case l.Direction.Right:return o.x=-1*(h.left+u.left),o.y=-1*((c.height-s.height)/2+u.top),o.x+=s.width*d.relativeValue(r[n],i,a)-c.width/2,o;case l.Direction.Left:return o.x=-1*(h.right+u.right),o.y=-1*((c.height-s.height)/2+u.top),o.x+=s.width-s.width*d.relativeValue(r[n],i,a)-c.width/2,o;case l.Direction.Up:return o.x=-1*((c.width-s.width)/2+h.left+u.left),o.y=-u.left,o.y+=s.height-s.height*d.relativeValue(r[n],i,a)-c.height/2,o;case l.Direction.Down:return o.x=-1*((c.width-s.width)/2+h.left+u.left),o.y=-u.left,o.y+=s.height*d.relativeValue(r[n],i,a)-c.height/2,o;default:return d.assertUnreachable(t)}}))},n.getThumbs=function(){return n.trackRef&&n.trackRef.current?Array.from(n.trackRef.current.children).filter((function(e){return e.hasAttribute("aria-valuenow")})):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},n.getTargetIndex=function(e){return n.getThumbs().findIndex((function(t){return t===e.target||t.contains(e.target)}))},n.addTouchEvents=function(e){document.addEventListener("touchmove",n.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",n.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",n.schdOnEnd,{passive:!1})},n.addMouseEvents=function(e){document.addEventListener("mousemove",n.schdOnMouseMove),document.addEventListener("mouseup",n.schdOnEnd)},n.onMouseDownTrack=function(e){var t;if(0===e.button)if(e.persist(),e.preventDefault(),n.addMouseEvents(e.nativeEvent),n.props.values.length>1&&n.props.draggableTrack){if(n.thumbRefs.some((function(t){var n;return null===(n=t.current)||void 0===n?void 0:n.contains(e.target)})))return;n.setState({draggedTrackPos:[e.clientX,e.clientY]},(function(){return n.onMove(e.clientX,e.clientY)}))}else{var r=d.getClosestThumbIndex(n.thumbRefs.map((function(e){return e.current})),e.clientX,e.clientY,n.props.direction);null===(t=n.thumbRefs[r].current)||void 0===t||t.focus(),n.setState({draggedThumbIndex:r},(function(){return n.onMove(e.clientX,e.clientY)}))}},n.onResize=function(){d.translateThumbs(n.getThumbs(),n.getOffsets(),n.props.rtl),n.calculateMarkOffsets()},n.onTouchStartTrack=function(e){var t;if(e.persist(),n.addTouchEvents(e.nativeEvent),n.props.values.length>1&&n.props.draggableTrack){if(n.thumbRefs.some((function(t){var n;return null===(n=t.current)||void 0===n?void 0:n.contains(e.target)})))return;n.setState({draggedTrackPos:[e.touches[0].clientX,e.touches[0].clientY]},(function(){return n.onMove(e.touches[0].clientX,e.touches[0].clientY)}))}else{var r=d.getClosestThumbIndex(n.thumbRefs.map((function(e){return e.current})),e.touches[0].clientX,e.touches[0].clientY,n.props.direction);null===(t=n.thumbRefs[r].current)||void 0===t||t.focus(),n.setState({draggedThumbIndex:r},(function(){return n.onMove(e.touches[0].clientX,e.touches[0].clientY)}))}},n.onMouseOrTouchStart=function(e){if(!n.props.disabled){var t=d.isTouchEvent(e);if(t||0===e.button){var r=n.getTargetIndex(e);-1!==r&&(t?n.addTouchEvents(e):n.addMouseEvents(e),n.setState({draggedThumbIndex:r,thumbZIndexes:n.state.thumbZIndexes.map((function(e,t){return t===r?Math.max.apply(Math,n.state.thumbZIndexes):e<=n.state.thumbZIndexes[r]?e:e-1}))}))}}},n.onMouseMove=function(e){e.preventDefault(),n.onMove(e.clientX,e.clientY)},n.onTouchMove=function(e){e.preventDefault(),n.onMove(e.touches[0].clientX,e.touches[0].clientY)},n.onKeyDown=function(e){var t=n.props,r=t.values,i=t.onChange,a=t.step,o=t.rtl,s=n.state.isChanged,u=n.getTargetIndex(e.nativeEvent),c=o?-1:1;-1!==u&&(h.includes(e.key)?(e.preventDefault(),n.setState({draggedThumbIndex:u,isChanged:!0}),i(d.replaceAt(r,u,n.normalizeValue(r[u]+c*("PageUp"===e.key?10*a:a),u)))):f.includes(e.key)?(e.preventDefault(),n.setState({draggedThumbIndex:u,isChanged:!0}),i(d.replaceAt(r,u,n.normalizeValue(r[u]-c*("PageDown"===e.key?10*a:a),u)))):"Tab"===e.key?n.setState({draggedThumbIndex:-1},(function(){s&&n.fireOnFinalChange()})):s&&n.fireOnFinalChange())},n.onKeyUp=function(e){var t=n.state.isChanged;n.setState({draggedThumbIndex:-1},(function(){t&&n.fireOnFinalChange()}))},n.onMove=function(e,t){var r=n.state,i=r.draggedThumbIndex,a=r.draggedTrackPos,o=n.props,s=o.direction,u=o.min,c=o.max,h=o.onChange,f=o.values,p=o.step,v=o.rtl;if(-1===i&&-1===a[0]&&-1===a[1])return null;var g=n.trackRef.current;if(!g)return null;var m=g.getBoundingClientRect(),b=d.isVertical(s)?m.height:m.width;if(-1!==a[0]&&-1!==a[1]){var k=e-a[0],w=t-a[1],T=0;switch(s){case l.Direction.Right:case l.Direction.Left:T=k/b*(c-u);break;case l.Direction.Down:case l.Direction.Up:T=w/b*(c-u);break;default:d.assertUnreachable(s)}if(v&&(T*=-1),Math.abs(T)>=p/2){for(var M=0;M<n.thumbRefs.length;M++){if(f[M]===c&&1===Math.sign(T)||f[M]===u&&-1===Math.sign(T))return;var O=f[M]+T;O>c?T=c-f[M]:O<u&&(T=u-f[M])}var x=f.slice(0);for(M=0;M<n.thumbRefs.length;M++)x=d.replaceAt(x,M,n.normalizeValue(f[M]+T,M));n.setState({draggedTrackPos:[e,t]}),h(x)}}else{var y=0;switch(s){case l.Direction.Right:y=(e-m.left)/b*(c-u)+u;break;case l.Direction.Left:y=(b-(e-m.left))/b*(c-u)+u;break;case l.Direction.Down:y=(t-m.top)/b*(c-u)+u;break;case l.Direction.Up:y=(b-(t-m.top))/b*(c-u)+u;break;default:d.assertUnreachable(s)}v&&(y=c+u-y),Math.abs(f[i]-y)>=p/2&&h(d.replaceAt(f,i,n.normalizeValue(y,i)))}},n.normalizeValue=function(e,t){var r=n.props,i=r.min,a=r.max,o=r.step,s=r.allowOverlap,u=r.values;return d.normalizeValue(e,t,i,a,o,s,u)},n.onEnd=function(e){if(e.preventDefault(),document.removeEventListener("mousemove",n.schdOnMouseMove),document.removeEventListener("touchmove",n.schdOnTouchMove),document.removeEventListener("mouseup",n.schdOnEnd),document.removeEventListener("touchend",n.schdOnEnd),document.removeEventListener("touchcancel",n.schdOnEnd),-1===n.state.draggedThumbIndex&&-1===n.state.draggedTrackPos[0]&&-1===n.state.draggedTrackPos[1])return null;n.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},(function(){n.fireOnFinalChange()}))},n.fireOnFinalChange=function(){n.setState({isChanged:!1});var e=n.props,t=e.onFinalChange,r=e.values;t&&t(r)},n.calculateMarkOffsets=function(){if(n.props.renderMark&&n.trackRef&&null!==n.trackRef.current){for(var e=window.getComputedStyle(n.trackRef.current),t=parseInt(e.width,10),r=parseInt(e.height,10),i=parseInt(e.paddingLeft,10),a=parseInt(e.paddingTop,10),o=[],s=0;s<n.numOfMarks+1;s++){var u=9999,c=9999;if(n.markRefs[s].current){var d=n.markRefs[s].current.getBoundingClientRect();u=d.height,c=d.width}n.props.direction===l.Direction.Left||n.props.direction===l.Direction.Right?o.push([Math.round(t/n.numOfMarks*s+i-c/2),-Math.round((u-r)/2)]):o.push([Math.round(r/n.numOfMarks*s+a-u/2),-Math.round((c-t)/2)])}n.setState({markOffsets:o})}},0===t.step)throw new Error('"step" property should be a positive number');n.numOfMarks=(t.max-t.min)/n.props.step,n.schdOnMouseMove=d.schd(n.onMouseMove),n.schdOnTouchMove=d.schd(n.onTouchMove),n.schdOnEnd=d.schd(n.onEnd),n.thumbRefs=t.values.map((function(){return c.createRef()}));for(var r=0;r<n.numOfMarks+1;r++)n.markRefs[r]=c.createRef();return n};return i(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.values,r=t.min,i=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",e.onResize)},unobserve:function(){return window.removeEventListener("resize",e.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&d.checkInitialOverlap(this.props.values),this.props.values.forEach((function(t){return d.checkBoundaries(t,e.props.min,e.props.max)})),this.resizeObserver.observe(this.trackRef.current),d.translateThumbs(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),n.forEach((function(e){d.isStepDivisible(r,e,i)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},t.prototype.componentDidUpdate=function(e,t){var n=this.props,r=n.max,i=n.min,a=n.step,o=n.values,s=n.rtl;if(e.max!==r||e.min!==i||e.step!==a){this.markRefs=[],this.numOfMarks=(r-i)/a;for(var u=0;u<this.numOfMarks+1;u++)this.markRefs[u]=c.createRef()}d.translateThumbs(this.getThumbs(),this.getOffsets(),s),e.max===r&&e.min===i&&e.step===a&&t.markOffsets.length===this.state.markOffsets.length||(this.calculateMarkOffsets(),o.forEach((function(e){d.isStepDivisible(i,e,a)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})))},t.prototype.componentWillUnmount=function(){document.removeEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},t.prototype.render=function(){var e=this,t=this.props,n=t.renderTrack,r=t.renderThumb,i=t.renderMark,a=void 0===i?function(){return null}:i,o=t.values,s=t.min,c=t.max,h=t.allowOverlap,f=t.disabled,p=this.state,v=p.draggedThumbIndex,g=p.thumbZIndexes,m=p.markOffsets;return n({props:{style:{transform:"scale(1)",cursor:v>-1?"grabbing":this.props.draggableTrack?d.isVertical(this.props.direction)?"ns-resize":"ew-resize":1!==o.length||f?"inherit":"pointer"},onMouseDown:f?d.voidFn:this.onMouseDownTrack,onTouchStart:f?d.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:f,children:u(m.map((function(t,n,r){return a({props:{style:e.props.direction===l.Direction.Left||e.props.direction===l.Direction.Right?{position:"absolute",left:t[0]+"px",marginTop:t[1]+"px"}:{position:"absolute",top:t[0]+"px",marginLeft:t[1]+"px"},key:"mark"+n,ref:e.markRefs[n]},index:n})})),o.map((function(t,n){var i=e.state.draggedThumbIndex===n;return r({index:n,value:t,isDragged:i,props:{style:{position:"absolute",zIndex:g[n],cursor:f?"inherit":i?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:n,tabIndex:f?void 0:0,"aria-valuemax":h?c:o[n+1]||c,"aria-valuemin":h?s:o[n-1]||s,"aria-valuenow":t,draggable:!1,ref:e.thumbRefs[n],role:"slider",onKeyDown:f?d.voidFn:e.onKeyDown,onKeyUp:f?d.voidFn:e.onKeyUp}})})))})},t.defaultProps={step:1,direction:l.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},t}(c.Component);t.default=p},54498:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkValuesAgainstBoundaries=t.relativeValue=t.useThumbOverlap=t.Direction=t.getTrackBackground=t.Range=void 0;var i=r(n(82325));t.Range=i.default;var a=n(59887);Object.defineProperty(t,"getTrackBackground",{enumerable:!0,get:function(){return a.getTrackBackground}}),Object.defineProperty(t,"useThumbOverlap",{enumerable:!0,get:function(){return a.useThumbOverlap}}),Object.defineProperty(t,"relativeValue",{enumerable:!0,get:function(){return a.relativeValue}}),Object.defineProperty(t,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return a.checkValuesAgainstBoundaries}});var o=n(11918);Object.defineProperty(t,"Direction",{enumerable:!0,get:function(){return o.Direction}})},11918:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Direction=void 0,(n=t.Direction||(t.Direction={})).Right="to right",n.Left="to left",n.Down="to bottom",n.Up="to top"},59887:function(e,t,n){var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.useThumbOverlap=t.assertUnreachable=t.voidFn=t.getTrackBackground=t.replaceAt=t.schd=t.translate=t.getClosestThumbIndex=t.translateThumbs=t.getPaddingAndBorder=t.getMargin=t.checkInitialOverlap=t.checkValuesAgainstBoundaries=t.checkBoundaries=t.isVertical=t.relativeValue=t.normalizeValue=t.isStepDivisible=t.isTouchEvent=t.getStepDecimals=void 0;var i=n(63505),a=n(11918);function o(e){return e===a.Direction.Up||e===a.Direction.Down}function s(e,t,n){e.style.transform="translate("+t+"px, "+n+"px)"}t.getStepDecimals=function(e){var t=e.toString().split(".")[1];return t?t.length:0},t.isTouchEvent=function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length},t.isStepDivisible=function(e,t,n){var r=Number(((t-e)/n).toFixed(8));return parseInt(r.toString(),10)===r},t.normalizeValue=function(e,n,r,i,a,o,s){var u=1e11;if(e=Math.round(e*u)/u,!o){var c=s[n-1],d=s[n+1];if(c&&c>e)return c;if(d&&d<e)return d}if(e>i)return i;if(e<r)return r;var l=Math.floor(e*u-r*u)%Math.floor(a*u),h=Math.floor(e*u-Math.abs(l)),f=0===l?e:h/u,p=Math.abs(l/u)<a/2?f:f+a,v=t.getStepDecimals(a);return parseFloat(p.toFixed(v))},t.relativeValue=function(e,t,n){return(e-t)/(n-t)},t.isVertical=o,t.checkBoundaries=function(e,t,n){if(t>=n)throw new RangeError("min ("+t+") is equal/bigger than max ("+n+")");if(e<t)throw new RangeError("value ("+e+") is smaller than min ("+t+")");if(e>n)throw new RangeError("value ("+e+") is bigger than max ("+n+")")},t.checkValuesAgainstBoundaries=function(e,t,n){return e<t?t:e>n?n:e},t.checkInitialOverlap=function(e){if(!(e.length<2||e.slice(1).every((function(t,n){return e[n]<=t}))))throw new RangeError("values={["+e+"]} needs to be sorted when allowOverlap={false}")},t.getMargin=function(e){var t=window.getComputedStyle(e);return{top:parseInt(t["margin-top"],10),bottom:parseInt(t["margin-bottom"],10),left:parseInt(t["margin-left"],10),right:parseInt(t["margin-right"],10)}},t.getPaddingAndBorder=function(e){var t=window.getComputedStyle(e);return{top:parseInt(t["padding-top"],10)+parseInt(t["border-top-width"],10),bottom:parseInt(t["padding-bottom"],10)+parseInt(t["border-bottom-width"],10),left:parseInt(t["padding-left"],10)+parseInt(t["border-left-width"],10),right:parseInt(t["padding-right"],10)+parseInt(t["border-right-width"],10)}},t.translateThumbs=function(e,t,n){var r=n?-1:1;e.forEach((function(e,n){return s(e,r*t[n].x,t[n].y)}))},t.getClosestThumbIndex=function(e,t,n,r){for(var i=0,a=c(e[0],t,n,r),o=1;o<e.length;o++){var s=c(e[o],t,n,r);s<a&&(a=s,i=o)}return i},t.translate=s,t.schd=function(e){var t=[],n=null;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];t=r,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))}},t.replaceAt=function(e,t,n){var r=e.slice(0);return r[t]=n,r},t.getTrackBackground=function(e){var t=e.values,n=e.colors,r=e.min,i=e.max,o=e.direction,s=void 0===o?a.Direction.Right:o,u=e.rtl,c=void 0!==u&&u;c&&s===a.Direction.Right?s=a.Direction.Left:c&&a.Direction.Left&&(s=a.Direction.Right);var d=t.slice(0).sort((function(e,t){return e-t})).map((function(e){return(e-r)/(i-r)*100})).reduce((function(e,t,r){return e+", "+n[r]+" "+t+"%, "+n[r+1]+" "+t+"%"}),"");return"linear-gradient("+s+", "+n[0]+" 0%"+d+", "+n[n.length-1]+" 100%)"},t.voidFn=function(){},t.assertUnreachable=function(e){throw new Error("Didn't expect to get here")};var u=function(e,t,n,i,a){return void 0===a&&(a=function(e){return e}),Math.ceil(r([e],Array.from(e.children)).reduce((function(e,r){var o=Math.ceil(r.getBoundingClientRect().width);if(r.innerText&&r.innerText.includes(n)&&0===r.childElementCount){var s=r.cloneNode(!0);s.innerHTML=a(t.toFixed(i)),s.style.visibility="hidden",document.body.appendChild(s),o=Math.ceil(s.getBoundingClientRect().width),document.body.removeChild(s)}return o>e?o:e}),e.getBoundingClientRect().width))};function c(e,t,n,r){var i=e.getBoundingClientRect(),a=i.left,s=i.top,u=i.width,c=i.height;return o(r)?Math.abs(n-(s+c/2)):Math.abs(t-(a+u/2))}t.useThumbOverlap=function(e,n,a,o,s,c){void 0===o&&(o=.1),void 0===s&&(s=" - "),void 0===c&&(c=function(e){return e});var d=t.getStepDecimals(o),l=i.useState({}),h=l[0],f=l[1],p=i.useState(c(n[a].toFixed(d))),v=p[0],g=p[1];return i.useEffect((function(){if(e){var t=e.getThumbs();if(t.length<1)return;var i={},o=e.getOffsets(),l=function(e,t,n,i,a,o,s){void 0===s&&(s=function(e){return e});var c=[],d=function(e){var l=u(n[e],i[e],a,o,s),h=t[e].x;t.forEach((function(t,f){var p=t.x,v=u(n[f],i[f],a,o,s);e!==f&&(h>=p&&h<=p+v||h+l>=p&&h+l<=p+v)&&(c.includes(f)||(c.push(e),c.push(f),c=r(c,[e,f]),d(f)))}))};return d(e),Array.from(new Set(c.sort()))}(a,o,t,n,s,d,c),h=c(n[a].toFixed(d));if(l.length){var p=l.reduce((function(e,t,n,i){return e.length?r(e,[o[i[n]].x]):[o[i[n]].x]}),[]);if(Math.min.apply(Math,p)===o[a].x){var v=[];l.forEach((function(e){v.push(n[e].toFixed(d))})),h=Array.from(new Set(v.sort((function(e,t){return parseFloat(e)-parseFloat(t)})))).map(c).join(s);var m=Math.min.apply(Math,p),b=Math.max.apply(Math,p),k=t[l[p.indexOf(b)]].getBoundingClientRect().width;i.left=Math.abs(m-(b+k))/2+"px",i.transform="translate(-50%, 0)"}else i.visibility="hidden"}g(h),f(i)}}),[e,n]),[v,h]}}}]);