File: /www/wwwroot/www.cytocare.cn/wp-content/themes/blocksy/static/bundle/315.e1701962eb45c232f788.js
"use strict";(self.blocksyJsonP=self.blocksyJsonP||[]).push([[315],{8315:function(t,e,n){n.d(e,{D:function(){return w}});const i=["style"];function o(t,e){if(null==t)return{};var n,i,o=function(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const u=function(){return"rtl"===document.querySelector("html").dir},d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;if(t.getBoundingClientRect&&!t.firstElementChild)return t.getBoundingClientRect();e||(e=t);let{top:n,left:i,right:o,width:r,height:s}=t.getBoundingClientRect(),a=window.getComputedStyle(e).transform.split(/\(|,|\)/).slice(1,-1).map((function(t){return parseFloat(t)}));if(6!=a.length)return t.getBoundingClientRect();var l=a;let u=l[0]*l[3]-l[1]*l[2];return{width:r/l[0],height:s/l[3],left:(i*l[3]-n*l[2]+l[2]*l[5]-l[4]*l[3])/u,right:(o*l[3]-n*l[2]+l[2]*l[5]-l[4]*l[3])/u,top:(-i*l[1]+n*l[0]+l[4]*l[1]-l[0]*l[5])/u}},c=function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},h=function(t){return t?t&&"[object Function]"==={}.toString.call(t)?t():t:null},p=function(t){if(!t.options.pillsContainerSelector)return;const e=t.options.pillsContainerSelector.querySelector(".active");e&&e.classList.remove("active"),t.options.pillsContainerSelector.children[t.state.previousCurrentIndex].classList.add("active"),t.options.pillsFlexyInstance&&function(t){const e=t.options.pillsFlexyInstance.flexy,n=[...t.options.pillsContainerSelector.children],i=h(e.sliderContainer),o=[...i.children].map((function(t){return d(t,h(e.options.nullifyTransformEl))})),r=d(i,h(e.options.nullifyTransformEl));let a=0;const l=o.map((function(t,e){return{left:Math.abs(t.left-r.left),top:Math.abs(t.top-r.top),right:Math.abs(t.right-r.right)}}));if("horizontal"===e.options.orientation){const t=Math.min(...l.map((function(t){return t.left}))),e=Math.min(...l.map((function(t){return t.right})));a=u()?l.findIndex((function(t){return t.right===e})):l.findIndex((function(e){return e.left===t}))}if("vertical"===e.options.orientation){const t=Math.min(...l.map((function(t){return t.top})));a=l.findIndex((function(e){return e.top===t}))}let c=0;if("horizontal"===e.options.orientation){let e=Math.round(d(i).width/d(i.firstElementChild).width);c=Math.max(t.state.previousCurrentIndex+1-e,0),i.closest('[data-type="circle"]')&&(c=Math.max(t.state.previousCurrentIndex-2,0),n.length-1-t.state.previousCurrentIndex<3&&(c=n.length-5))}else c=t.state.previousCurrentIndex;let p=Math.abs(c-a),f=Math.min(a,c)+(n.length-Math.max(a,c)),m=Math.min(p,f)*(f>=p?a>c?1:-1:a>c?-1:1);u()&&(m*=-1);let g=100*Math.round(100*e.state.positionX/e.state.slideWidth/100)*e.state.slideWidth/100+e.state.slideWidth*m;e.state=s(s({},e.state),{},{positionTarget:g})}(t)};class f{constructor(t,e){var n=this;l(this,"options",{mountListeners:!0}),l(this,"flexyInstance",null),l(this,"navigate",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"right";const e=n.flexyInstance,i="left"===t?1:-1,o=e.state.slideWidth;let r=100*Math.round(100*e.state.positionX/o/100)*o/100+o*i;e.state=s(s({},e.state),{},{positionTarget:r})})),this.flexyInstance=t,this.options=s(s({},this.options),e),this.options.mountListeners&&this.mountArrowsListeners()}mountArrowsListeners(){var t=this;if(!this.options.mountListeners)return;const e=this.flexyInstance.options.leftArrow,n=this.flexyInstance.options.rightArrow;e&&e.addEventListener("click",(function(e){e.preventDefault(),t.navigate("left")})),n&&n.addEventListener("click",(function(e){e.preventDefault(),t.navigate("right")}))}}const m=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=s({rootEl:null},e),e.rootEl&&t.el!==e.rootEl&&t.elComputed.minHeight&&parseFloat(t.elComputed.minHeight)===t.height)return 0;const n=t.childrenHeight.reduce((function(e,n,i){let o=parseFloat(t.childrenComputed[i].marginTop);return"auto"===t.childrenComputed[i].getPropertyValue("--card-element-margin-start")&&(o=0),e+n+o+parseFloat(t.childrenComputed[i].marginBottom)}),0)+parseFloat(t.elComputed.paddingTop)+parseFloat(t.elComputed.paddingBottom);return t.totalChildrenHeight>=t.height?0:t.height-n},g=function(t){t.childrenHeight.every((function(e,n){return e>=t.height}));return 0},v=function(t){const e=h(t.sliderContainer),n=(h(t.options.flexyAttributeEl),Math.round(t.state.containerInnerWidth/t.state.slideWidth));let i=[...e.children],o=i.slice(t.state.previousCurrentIndex,t.state.previousCurrentIndex+n);o.length<n&&i.length>n&&(o=[...o,...i.slice(0,n-o.length)]);const r=o.map((function(t,e){const n=t.getBoundingClientRect().height,i=function(t){const e=t;if(!t)return 0;const n=[t,...t.querySelectorAll("*")].map((function(t){let e=[...t.children].map((function(t){const e=t.getBoundingClientRect();return{el:t,elComputed:window.getComputedStyle(t),rect:e,height:e.height}}));const n=e.filter((function(t){return"absolute"===t.elComputed.position}));e=e.filter((function(t){return"absolute"!==t.elComputed.position&&0!==t.rect.height}));let i="row";if(e.length>1){const t=e[0];e[1].rect.left>=t.rect.right&&(i="column")}const o=window.getComputedStyle(t),r=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth);return{el:t,elComputed:o,height:t.getBoundingClientRect().height-r,orientation:i,absoluteChildrenComputed:n.map((function(t){let{elComputed:e}=t;return e})),absoluteChildrenHeight:n.map((function(t){let{height:e}=t;return e})),childrenComputed:e.map((function(t){let{elComputed:e}=t;return e})),childrenHeight:e.map((function(t){let{height:e}=t;return e}))}})),i=n.filter((function(t){return 0!==t.childrenComputed.length&&(!n.find((function(e){return"column"===e.orientation&&e.el.contains(t.el)&&e.el!==t.el}))&&(!t.absoluteChildrenHeight.find((function(e){return Math.round(e)===Math.round(t.height)}))&&("absolute"!==t.elComputed.position&&!t.childrenComputed.some((function(t){return"inline"===t.display&&"absolute"!==t.position})))))})).map((function(t){return s(s({},t),{},{voidSpace:Math.round("row"===t.orientation?m(t,{rootEl:e}):g(t))})})).filter((function(t){return t.voidSpace>0}));return 1===i.length?i.reduce((function(t,e){return t+e.voidSpace}),0):0}(t);return n-i})),a=Math.round(Math.max(...r)),l=Math.round(parseFloat(e.parentNode.style.getPropertyValue("--flexy-view-height")));l&&a!==l&&e.parentNode.style.setProperty("--flexy-view-height",a+"px")},y=function(t,e){return"vertical"===e.options.orientation?t.height:t.width},C=function(t,e){let n="pageX";"vertical"===e.options.orientation&&(n="pageY");let i=t[n];return!i&&t.touches&&t.touches[0]&&(i=t.touches[0][n]),i};function b(t){return null==t||t.matches("html")?null:t.scrollHeight>t.clientHeight?t:b(t.parentNode)}class x{constructor(t){var e=this;l(this,"options",{mountDragAndDropEventListener:!0}),l(this,"flexyInstance",null),l(this,"getState",(function(){})),l(this,"setState",(function(){})),l(this,"handleDown",(function(t){if(!e.getState().sliderActivated)return;const n=h(e.flexyInstance.sliderContainer);if(e.flexyInstance.options.elementsThatDoNotStartDrag.reduce((function(e,n){return!!e||(t.target.matches(n)||t.target.closest(n))}),!1))return;const i=t.type;e.options.mountDragAndDropEventListener&&(t.stopPropagation(),"touchstart"!==t.type&&t.preventDefault());let o=!1;"touchstart"===i?e.setState(s(s({},e.getState()),{},{startX:C(t,e.flexyInstance),endX:C(t,e.flexyInstance)})):e.setState(s(s({},e.getState()),{},{startX:C(t,e.flexyInstance),endX:C(t,e.flexyInstance),mouseDown:!0,positionSnapshot:e.getState().positionX}));const r=function(t){let o=!0;if("touchstart"===i&&(o=!1,e.getState().mouseDown&&(o=!0),!e.getState().mouseDown)){let n=C(t,e.flexyInstance);n||(n=e.getState().startX),Math.abs(n-e.getState().startX)<=3&&(o=!0)}if(!o)return;t.stopPropagation(),e.setState(s(s({},e.getState()),{},{mouseDown:!1})),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",r),document.removeEventListener("touchmove",a),document.removeEventListener("touchend",r),document.removeEventListener("scroll",l),b(t.target)&&b(t.target).removeEventListener("scroll",l);let u=e.getState();const c=y(d(n.firstElementChild,h(e.flexyInstance.options.nullifyTransformEl)),e.flexyInstance);let p=100*u.positionX/c;e.setState(s(s({},e.getState()),{},{positionTarget:c*(Math.abs(u.endX-u.startX)>50?u.endX-u.startX<0?100*Math.floor(p/100):100*Math.ceil(p/100):100*Math.round(p/100))/100}))},a=function(t){let n=C(t,e.flexyInstance);if(o)return void r(t);if("touchstart"===i&&!e.getState().mouseDown)return void(Math.abs(n-e.getState().startX)>3&&(e.flexyInstance.options.onDragStart(t),e.setState(s(s({},e.getState()),{},{startX:C(t,e.flexyInstance),endX:C(t,e.flexyInstance),mouseDown:!0,positionSnapshot:e.getState().positionX})),o=!1,document.removeEventListener("scroll",l),b(t.target)&&b(t.target).removeEventListener("scroll",l)));t.preventDefault();let a=e.getState();e.setState(s(s({},a),{},{endX:n}))},l=function(t){o=!0};document.addEventListener(c()?"touchmove":"mousemove",a,{passive:!1}),document.addEventListener(c()?"touchend":"mouseup",r,{passive:!1}),document.addEventListener("scroll",l),b(t.target)&&b(t.target).addEventListener("scroll",l)})),this.options=s(s({},this.options),t)}handleDragFor(t,e,n){var i=this;if(!t.options.hasDragAndDrop)return;this.flexyInstance=t,this.getState=e,this.setState=n;const o=h(t.sliderContainer);this.options.mountDragAndDropEventListener&&o.addEventListener(c()?"touchstart":"mousedown",this.handleDown,{passive:!1}),t.options.initialDragEvent&&requestAnimationFrame((function(){i.handleDown(t.options.initialDragEvent)}))}}const E="__DESTROYED__";class w{constructor(t){var e=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l(this,"getDefaultState",(function(){return{elementsOnBehind:1,positionSnapshot:0,positionX:0,positionTarget:0,velocity:0,containerInnerWidth:e.sliderContainer?y(d(h(e.sliderContainer),h(e.nullifyTransformEl)),e):0,slideWidth:e.sliderContainer?y(d(e.sliderContainer.firstElementChild,e.sliderContainer),e):0,previousCurrentIndex:0,startX:0,endX:0,mouseDown:!1,recalculationScheduled:!1,lastTimeAnimated:1/0}})),l(this,"state",this.getDefaultState()),l(this,"options",{onDragStart:function(){},onSlideChange:function(){},autoplay:!1,scaleRotateEffect:!1,pillsContainerSelector:null,pillsFlexyInstance:null,flexyAttributeEl:null,initialDragEvent:null,wrapAroundMode:"container",orientation:"horizontal",nullifyTransformEl:null,elementsThatDoNotStartDrag:[],hasDragAndDrop:!0,onRender:function(){},dragAndDropOptions:{},arrowsOptions:{}}),l(this,"sliderContainer",null),l(this,"dragAndDrop",null),l(this,"sliderArrows",null),l(this,"drawLoop",(function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e.state.sliderActivated===E)return;if(!h(e.sliderContainer))return void requestAnimationFrame((function(){return e.drawLoop()}));const n=y(d(h(e.sliderContainer).firstElementChild,h(e.options.nullifyTransformEl)),e);if(!n||n<=0)return void requestAnimationFrame((function(){return e.drawLoop()}));let i=t?1/0:e.state.positionX;(e.state.containerInnerWidth!==d(h(e.sliderContainer),h(e.nullifyTransformEl)).width||e.state.recalculationScheduled)&&e.refreshActivation();let o=e.state,r={};if(e.state.sliderActivated){let t=o.velocity+(e.state.mouseDown?e.state.positionSnapshot+(e.state.endX-e.state.startX)-e.state.positionX-e.state.velocity:.02*(e.state.positionTarget-e.state.positionX));r.velocity=.72*t,r.positionX=e.state.positionX+t}if(e.state.sliderActivated&&(Math.abs(e.state.containerInnerWidth-y(d(h(e.sliderContainer),h(e.nullifyTransformEl)),e))>1||e.state.recalculationScheduled)&&(r.positionX=Math.round(y(d(h(e.sliderContainer).firstElementChild,h(e.options.nullifyTransformEl)),e)*(100*Math.round(e.state.positionX/e.state.slideWidth))/100),r.positionTarget=Math.round(y(d(h(e.sliderContainer).firstElementChild,h(e.options.nullifyTransformEl)),e)*(100*Math.round(e.state.positionX/e.state.slideWidth))/100),r.recalculationScheduled=!1),r.scrollPosition={x:window.pageXOffset,y:window.pageYOffset},r.containerInnerWidth=y(d(h(e.sliderContainer),h(e.nullifyTransformEl)),e),r.slideWidth=n,e.state=s(s({},e.state),r),(i!==e.state.positionX||Math.abs(e.state.positionX-e.state.positionTarget)>.1)&&!t&&e.state.sliderActivated){let{relativeDelta:t,elementsOnBehind:n}=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"container";const o=h(t.sliderContainer),r=h(t.options.nullifyTransformEl);"horizontal"===t.options.orientation&&u()&&(n="left"===n?"right":"left");const s=[...o.children].map((function(t){return d(t,r)}));let a=null,l=null;if("horizontal"===t.options.orientation){const t=Math.min(...s.map((function(t){return t.left}))),e=Math.max(...s.map((function(t){return t.right}))),n=s.find((function(e){let{left:n}=e;return n===t})),i=s.find((function(t){let{right:n}=t;return n===e}));a=u()?i:n,l=u()?n:i}if("vertical"===t.options.orientation){const t=Math.min(...s.map((function(t){return t.top}))),e=Math.max(...s.map((function(t){return t.bottom})));a=s.find((function(e){let{top:n}=e;return n===t})),l=s.find((function(t){let{bottom:n}=t;return n===e}))}const c=d(o,r);let p=0;if("left"===n){let n=!1;"horizontal"===t.options.orientation&&(n=a.left>0,u()&&(n=a.right<window.innerWidth),"container"===i&&(n=a.left>c.left,u()&&(n=a.right<c.right))),"vertical"===t.options.orientation&&(n=a.top>0,"container"===i&&(n=a.top>c.top)),n&&(p=-1*t.state.slideWidth,"horizontal"===t.options.orientation&&u()&&(p*=-1),e=e===o.children.length?1:e+1)}if("right"===n){let n=!1;"horizontal"===t.options.orientation&&(n=l.right<window.innerWidth,u()&&(n=l.left>0),"container"===i&&(n=l.right<c.right,u()&&(n=l.left>c.left))),"vertical"===t.options.orientation&&(n=l.bottom<window.innerHeight,"container"===i&&(n=l.bottom<c.bottom)),n&&(p=t.state.slideWidth,"horizontal"===t.options.orientation&&u()&&(p*=-1),e=1===e?o.children.length:e-1)}return{relativeDelta:p,elementsOnBehind:e}}(e,e.state.elementsOnBehind,e.state.mouseDown?e.state.endX<=e.state.startX?"right":"left":e.state.positionX>=e.state.positionTarget?"right":"left",e.options.wrapAroundMode);e.state=s(s({},e.state),{},{elementsOnBehind:n,positionTarget:e.state.positionTarget+t,positionX:e.state.positionX+t,positionSnapshot:e.state.positionSnapshot+t})}let a=e.state.previousCurrentIndex;var l,c,f;if(!e.state.mouseDown&&e.state.sliderActivated&&(Math.abs(e.state.positionX-e.state.positionTarget)<.2&&(e.state=s(s({},e.state),{},{positionX:e.state.positionTarget,velocity:0})),e.state=s(s({},e.state),{},{previousCurrentIndex:(l=e.state.elementsOnBehind>Math.round(Math.abs(e.state.positionTarget)/y(d(h(e.sliderContainer).firstElementChild,h(e.options.nullifyTransformEl)),e))?Math.round(Math.abs(e.state.positionTarget)/y(d(h(e.sliderContainer).firstElementChild,h(e.options.nullifyTransformEl)),e))+(h(e.sliderContainer).children.length-e.state.elementsOnBehind):Math.abs(Math.round(Math.abs(e.state.positionTarget)/y(d(h(e.sliderContainer).firstElementChild,h(e.options.nullifyTransformEl)),e))-e.state.elementsOnBehind),c=0,f=h(e.sliderContainer).children.length-1,Math.min(Math.max(l,c),f))})),e.state.positionX!==i&&e.state.sliderActivated&&(e.state.positionX===e.state.positionTarget||h(e.options.flexyAttributeEl).hasAttribute("data-flexy-moving")||(!function(t){const e=h(t.sliderContainer),n=e.parentNode.getBoundingClientRect().height;e.parentNode.style.setProperty("--flexy-view-height",n+"px")}(e),h(e.options.flexyAttributeEl).dataset.flexyMoving=""),e.render(),o.positionX!==o.positionTarget&&e.state.positionX===e.state.positionTarget&&(h(e.options.flexyAttributeEl).removeAttribute("data-flexy-moving"),h(e.sliderContainer).parentNode.removeAttribute("style")),e.state=s(s({},e.state),{},{lastTimeAnimated:(new Date).getTime()})),!e.state.mouseDown&&e.state.sliderActivated&&a!==e.state.previousCurrentIndex&&(p(e),e.options.onSlideChange(e,{currentIndex:e.state.previousCurrentIndex,previousIndex:a}),v(e)),e.options.autoplay&&e.state.sliderActivated){const t=parseFloat(e.options.autoplay,10)||3;if(Math.abs(e.state.positionX-e.state.positionTarget)<.5){((new Date).getTime()-e.state.lastTimeAnimated)/1e3>t&&(e.state=s(s({},e.state),{},{positionTarget:e.state.positionX-y(d(h(e.sliderContainer).firstElementChild,h(e.options.nullifyTransformEl)),e)}))}}requestAnimationFrame((function(){return e.drawLoop()}))})),this.options=s(s({},this.options),{},{flexyAttributeEl:t,nullifyTransformEl:t},n),this.sliderContainer=t,this.sliderArrows=new f(this,this.options.arrowsOptions),function(t){if(!t.options.pillsContainerSelector)return;let e=[...t.options.pillsContainerSelector.children];const n=h(t.sliderContainer),i=h(t.options.nullifyTransformEl),o=function(o){[...n.children].map((function(t){return d(t,i)}));let r=t.state.previousCurrentIndex,a=e.indexOf(o);t.options.pillsContainerSelector.querySelector(".active")&&t.options.pillsContainerSelector.querySelector(".active").classList.remove("active"),o.classList.add("active");const l=Math.abs(a-r),c=Math.min(r,a)+(e.length-Math.max(r,a)),h=Math.min(l,c);let p=r>a?-1:1;c>=l&&(p=r>a?1:-1),u()&&(p*=-1);let f=100*Math.round(100*t.state.positionX/t.state.slideWidth/100)*t.state.slideWidth/100+t.state.slideWidth*(h*p);t.state=s(s({},t.state),{},{positionTarget:f})};t.options.initialDragEvent&&t.options.initialDragEvent.target.closest(".flexy-pills > * > *")&&setTimeout((function(){o(t.options.initialDragEvent.target.closest(".flexy-pills > * > *"))})),e.map((function(t){return t.addEventListener("click",(function(e){setTimeout((function(){e.defaultPrevented||o(t),e.preventDefault()}))}))}))}(this),function(t){const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n=t)&&"[object Function]"==={}.toString.call(n)?t(e):t;var n}(t.sliderContainer);if(!t.options.autoplay)return;const n=function(){t.state.sliderActivated&&(t.options=s(s({},t.options),{},{autoplay:!1,_autoplay:t.options.autoplay}))},i=function(){t.state.sliderActivated&&(t.options=s(s({},t.options),{},{autoplay:t.options._autoplay,_autoplay:!1}),t.state=s(s({},t.state),{},{lastTimeAnimated:(new Date).getTime()}))};e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",i),new IntersectionObserver((function(e){e.map((function(e){let{target:o,isIntersecting:r,intersectionRatio:s}=e;if(r){if(!Object.keys(t.options).includes("_autoplay"))return;i()}r||n()}))}),{}).observe(e)}(this),this.dragAndDrop=new x(this.options.dragAndDropOptions),this.dragAndDrop.handleDragFor(this,(function(){return e.state}),(function(t){return e.state=t})),[...h(this.sliderContainer).children].map((function(t){return t.addEventListener("click",(function(t){Math.abs(e.state.startX-e.state.endX)>3&&t.preventDefault()}))}));let i=1,o=1,r=getComputedStyle(h(this.options.flexyAttributeEl));r.getPropertyValue("--current-item")&&(o=parseInt(r.getPropertyValue("--current-item")),i=h(this.sliderContainer).children.length);const a=u()?1:-1,c=y(d(h(this.sliderContainer).firstElementChild,h(this.options.nullifyTransformEl)),this);this.state=s(s({},this.state),{},{elementsOnBehind:i,slideWidth:c,positionX:c*o*a,positionTarget:c*o*a,containerInnerWidth:y(d(h(this.sliderContainer),h(this.nullifyTransformEl)),this)}),this.refreshActivation(),requestAnimationFrame((function(){return e.drawLoop(!0)}))}destroy(){this.state=s(s({},this.state),{},{sliderActivated:E})}scheduleSliderRecalculation(){this.state=s(s({},this.state),{},{recalculationScheduled:!0})}refreshActivation(){if(!h(this.sliderContainer))return;const t=this.state.sliderActivated===E;let e=y(d(h(this.sliderContainer).children[0],h(this.options.nullifyTransformEl))||{width:0,height:0},this)*h(this.sliderContainer).children.length,n=!1;h(this.sliderContainer)&&(n=-1===getComputedStyle(h(this.sliderContainer),":after").content.indexOf("no-flexy")&&e>y(d("vertical"===this.options.orientation?h(this.sliderContainer).parentNode:h(this.sliderContainer),h(this.options.nullifyTransformEl)),this)+10),this.state=s(s({},this.state),{},{sliderActivated:n});const i=h(this.options.flexyAttributeEl);i&&(this.state.sliderActivated?i.dataset.flexy="":(i.removeAttribute("data-flexy"),[...h(this.sliderContainer).children].map((function(t){return t.removeAttribute("style")}))));this.retrieveSliderAttributes();(!t&&!this.state.sliderActivated||this.state.recalculationScheduled)&&this.render(),t&&this.drawLoop()}retrieveSliderAttributes(){var t=this;const e=h(this.sliderContainer),n=[...e.children].map((function(t,e){return{el:t,index:e,attr:{}}}));let r=n;if(this.state.elementsOnBehind>0){const t=n.slice(-1*this.state.elementsOnBehind),e=n.slice(0,-1*this.state.elementsOnBehind);r=[...t.map((function(t){return s(s({},t),{},{attr:{style:{order:1}}})})),...e.map((function(t){return s(s({},t),{},{attr:{style:{order:2}}})}))]}else r=r.map((function(t){return s(s({},t),{},{attr:{style:{order:2}}})}));r=r.map((function(n,i){let o=i*t.state.slideWidth,r=o+t.state.slideWidth,a=!1;const l={left:Math.abs(t.state.positionX),right:Math.abs(t.state.positionX)+t.state.containerInnerWidth};if("viewport"===t.options.wrapAroundMode){const n=d(e,h(t.options.nullifyTransformEl));l.left=l.left-n.left,l.right=l.right+(window.innerWidth-n.right)}o-l.left>3&&l.right-o>3&&(a=!0),r-l.left>3&&l.right-r>3&&(a=!0),Math.abs(o-l.left)<3&&Math.abs(r-l.right)<3&&(a=!0);let u=`translate3d(${t.state.positionX}px, 0, 0)`;return"vertical"===t.options.orientation&&(u=`translate3d(0, ${t.state.positionX}px, 0)`),s(s({},n),{},{fits:a,attr:s(s({},n.attr),{},{className:a?"flexy-item-is-visible":"",style:s(s({},n.attr.style),{},{transform:u})})})}));let a={};return this.state.mouseDown&&(a["data-flexy-dragging"]=""),this.state.sliderActivated&&(a["data-flexy"]=""),this.state.sliderActivated||(r=r.map((function(t){const e=t.attr,{style:n}=e,r=o(e,i);return s(s({},t),{},{attr:r})}))),{elementsDescriptor:r.sort((function(t,e){return t.index-e.index})),flexyAttributeElAttr:a}}render(){var t=this;const e=this.retrieveSliderAttributes();this.options.onRender(this,e);const n=h(this.sliderContainer);e.elementsDescriptor.map((function(t){const e=n.children[t.index];e.classList.remove("flexy-item-is-visible"),t.fits&&e.classList.add("flexy-item-is-visible"),t.attr&&t.attr.style&&Object.keys(t.attr.style).map((function(n){e.style[n]=t.attr.style[n]}))})),h(this.options.flexyAttributeEl).removeAttribute("data-flexy-dragging"),Object.keys(e.flexyAttributeElAttr).map((function(n){h(t.options.flexyAttributeEl).setAttribute(n,e.flexyAttributeElAttr[n])}))}}}}]);