react-slick.js 174 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory(require("react"));
  4. else if(typeof define === 'function' && define.amd)
  5. define(["react"], factory);
  6. else if(typeof exports === 'object')
  7. exports["Slider"] = factory(require("react"));
  8. else
  9. root["Slider"] = factory(root["React"]);
  10. })(window, function(__WEBPACK_EXTERNAL_MODULE__16__) {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = 0);
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ([
  98. /* 0 */
  99. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100. "use strict";
  101. __webpack_require__.r(__webpack_exports__);
  102. /* harmony import */ var _slider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
  103. /* harmony default export */ __webpack_exports__["default"] = (_slider__WEBPACK_IMPORTED_MODULE_0__["default"]);
  104. /***/ }),
  105. /* 1 */
  106. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107. "use strict";
  108. __webpack_require__.r(__webpack_exports__);
  109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Slider; });
  110. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
  111. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
  112. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
  113. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__);
  114. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
  115. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
  116. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
  117. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
  118. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
  119. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
  120. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);
  121. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5__);
  122. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13);
  123. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
  124. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14);
  125. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__);
  126. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4);
  127. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8__);
  128. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(16);
  129. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
  130. /* harmony import */ var _inner_slider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17);
  131. /* harmony import */ var json2mq__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(30);
  132. /* harmony import */ var json2mq__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(json2mq__WEBPACK_IMPORTED_MODULE_11__);
  133. /* harmony import */ var _default_props__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(24);
  134. /* harmony import */ var _utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(23);
  135. function _callSuper(t, o, e) { return o = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(o), _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(t, _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5___default()() ? Reflect.construct(o, e || [], _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(t).constructor) : o.apply(t, e)); }
  136. var Slider = /*#__PURE__*/function (_React$Component) {
  137. function Slider(props) {
  138. var _this;
  139. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Slider);
  140. _this = _callSuper(this, Slider, [props]);
  141. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_this, "innerSliderRefHandler", function (ref) {
  142. return _this.innerSlider = ref;
  143. });
  144. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_this, "slickPrev", function () {
  145. return _this.innerSlider.slickPrev();
  146. });
  147. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_this, "slickNext", function () {
  148. return _this.innerSlider.slickNext();
  149. });
  150. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_this, "slickGoTo", function (slide) {
  151. var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  152. return _this.innerSlider.slickGoTo(slide, dontAnimate);
  153. });
  154. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_this, "slickPause", function () {
  155. return _this.innerSlider.pause("paused");
  156. });
  157. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_this, "slickPlay", function () {
  158. return _this.innerSlider.autoPlay("play");
  159. });
  160. _this.state = {
  161. breakpoint: null
  162. };
  163. _this._responsiveMediaHandlers = [];
  164. return _this;
  165. }
  166. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default()(Slider, _React$Component);
  167. return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(Slider, [{
  168. key: "media",
  169. value: function media(query, handler) {
  170. // javascript handler for css media query
  171. var mql = window.matchMedia(query);
  172. var listener = function listener(_ref) {
  173. var matches = _ref.matches;
  174. if (matches) {
  175. handler();
  176. }
  177. };
  178. mql.addListener(listener);
  179. listener(mql);
  180. this._responsiveMediaHandlers.push({
  181. mql: mql,
  182. query: query,
  183. listener: listener
  184. });
  185. }
  186. // handles responsive breakpoints
  187. }, {
  188. key: "componentDidMount",
  189. value: function componentDidMount() {
  190. var _this2 = this;
  191. // performance monitoring
  192. //if (process.env.NODE_ENV !== 'production') {
  193. //const { whyDidYouUpdate } = require('why-did-you-update')
  194. //whyDidYouUpdate(React)
  195. //}
  196. if (this.props.responsive) {
  197. var breakpoints = this.props.responsive.map(function (breakpt) {
  198. return breakpt.breakpoint;
  199. });
  200. // sort them in increasing order of their numerical value
  201. breakpoints.sort(function (x, y) {
  202. return x - y;
  203. });
  204. breakpoints.forEach(function (breakpoint, index) {
  205. // media query for each breakpoint
  206. var bQuery;
  207. if (index === 0) {
  208. bQuery = json2mq__WEBPACK_IMPORTED_MODULE_11___default()({
  209. minWidth: 0,
  210. maxWidth: breakpoint
  211. });
  212. } else {
  213. bQuery = json2mq__WEBPACK_IMPORTED_MODULE_11___default()({
  214. minWidth: breakpoints[index - 1] + 1,
  215. maxWidth: breakpoint
  216. });
  217. }
  218. // when not using server side rendering
  219. Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_13__["canUseDOM"])() && _this2.media(bQuery, function () {
  220. _this2.setState({
  221. breakpoint: breakpoint
  222. });
  223. });
  224. });
  225. // Register media query for full screen. Need to support resize from small to large
  226. // convert javascript object to media query string
  227. var query = json2mq__WEBPACK_IMPORTED_MODULE_11___default()({
  228. minWidth: breakpoints.slice(-1)[0]
  229. });
  230. Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_13__["canUseDOM"])() && this.media(query, function () {
  231. _this2.setState({
  232. breakpoint: null
  233. });
  234. });
  235. }
  236. }
  237. }, {
  238. key: "componentWillUnmount",
  239. value: function componentWillUnmount() {
  240. this._responsiveMediaHandlers.forEach(function (obj) {
  241. obj.mql.removeListener(obj.listener);
  242. });
  243. }
  244. }, {
  245. key: "render",
  246. value: function render() {
  247. var _this3 = this;
  248. var settings;
  249. var newProps;
  250. if (this.state.breakpoint) {
  251. newProps = this.props.responsive.filter(function (resp) {
  252. return resp.breakpoint === _this3.state.breakpoint;
  253. });
  254. settings = newProps[0].settings === "unslick" ? "unslick" : _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()({}, _default_props__WEBPACK_IMPORTED_MODULE_12__["default"]), this.props), newProps[0].settings);
  255. } else {
  256. settings = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()({}, _default_props__WEBPACK_IMPORTED_MODULE_12__["default"]), this.props);
  257. }
  258. // force scrolling by one if centerMode is on
  259. if (settings.centerMode) {
  260. if (settings.slidesToScroll > 1 && "none" !== "production") {
  261. console.warn("slidesToScroll should be equal to 1 in centerMode, you are using ".concat(settings.slidesToScroll));
  262. }
  263. settings.slidesToScroll = 1;
  264. }
  265. // force showing one slide and scrolling by one if the fade mode is on
  266. if (settings.fade) {
  267. if (settings.slidesToShow > 1 && "none" !== "production") {
  268. console.warn("slidesToShow should be equal to 1 when fade is true, you're using ".concat(settings.slidesToShow));
  269. }
  270. if (settings.slidesToScroll > 1 && "none" !== "production") {
  271. console.warn("slidesToScroll should be equal to 1 when fade is true, you're using ".concat(settings.slidesToScroll));
  272. }
  273. settings.slidesToShow = 1;
  274. settings.slidesToScroll = 1;
  275. }
  276. // makes sure that children is an array, even when there is only 1 child
  277. var children = react__WEBPACK_IMPORTED_MODULE_9___default.a.Children.toArray(this.props.children);
  278. // Children may contain false or null, so we should filter them
  279. // children may also contain string filled with spaces (in certain cases where we use jsx strings)
  280. children = children.filter(function (child) {
  281. if (typeof child === "string") {
  282. return !!child.trim();
  283. }
  284. return !!child;
  285. });
  286. // rows and slidesPerRow logic is handled here
  287. if (settings.variableWidth && (settings.rows > 1 || settings.slidesPerRow > 1)) {
  288. console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1");
  289. settings.variableWidth = false;
  290. }
  291. var newChildren = [];
  292. var currentWidth = null;
  293. for (var i = 0; i < children.length; i += settings.rows * settings.slidesPerRow) {
  294. var newSlide = [];
  295. for (var j = i; j < i + settings.rows * settings.slidesPerRow; j += settings.slidesPerRow) {
  296. var row = [];
  297. for (var k = j; k < j + settings.slidesPerRow; k += 1) {
  298. if (settings.variableWidth && children[k].props.style) {
  299. currentWidth = children[k].props.style.width;
  300. }
  301. if (k >= children.length) break;
  302. row.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.cloneElement(children[k], {
  303. key: 100 * i + 10 * j + k,
  304. tabIndex: -1,
  305. style: {
  306. width: "".concat(100 / settings.slidesPerRow, "%"),
  307. display: "inline-block"
  308. }
  309. }));
  310. }
  311. newSlide.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("div", {
  312. key: 10 * i + j
  313. }, row));
  314. }
  315. if (settings.variableWidth) {
  316. newChildren.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("div", {
  317. key: i,
  318. style: {
  319. width: currentWidth
  320. }
  321. }, newSlide));
  322. } else {
  323. newChildren.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("div", {
  324. key: i
  325. }, newSlide));
  326. }
  327. }
  328. if (settings === "unslick") {
  329. var className = "regular slider " + (this.props.className || "");
  330. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("div", {
  331. className: className
  332. }, children);
  333. } else if (newChildren.length <= settings.slidesToShow && !settings.infinite) {
  334. settings.unslick = true;
  335. }
  336. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement(_inner_slider__WEBPACK_IMPORTED_MODULE_10__["InnerSlider"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
  337. style: this.props.style,
  338. ref: this.innerSliderRefHandler
  339. }, Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_13__["filterSettings"])(settings)), newChildren);
  340. }
  341. }]);
  342. }(react__WEBPACK_IMPORTED_MODULE_9___default.a.Component);
  343. /***/ }),
  344. /* 2 */
  345. /***/ (function(module, exports) {
  346. function _extends() {
  347. module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
  348. for (var i = 1; i < arguments.length; i++) {
  349. var source = arguments[i];
  350. for (var key in source) {
  351. if (Object.prototype.hasOwnProperty.call(source, key)) {
  352. target[key] = source[key];
  353. }
  354. }
  355. }
  356. return target;
  357. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  358. return _extends.apply(this, arguments);
  359. }
  360. module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
  361. /***/ }),
  362. /* 3 */
  363. /***/ (function(module, exports, __webpack_require__) {
  364. var defineProperty = __webpack_require__(4);
  365. function ownKeys(e, r) {
  366. var t = Object.keys(e);
  367. if (Object.getOwnPropertySymbols) {
  368. var o = Object.getOwnPropertySymbols(e);
  369. r && (o = o.filter(function (r) {
  370. return Object.getOwnPropertyDescriptor(e, r).enumerable;
  371. })), t.push.apply(t, o);
  372. }
  373. return t;
  374. }
  375. function _objectSpread2(e) {
  376. for (var r = 1; r < arguments.length; r++) {
  377. var t = null != arguments[r] ? arguments[r] : {};
  378. r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
  379. defineProperty(e, r, t[r]);
  380. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
  381. Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
  382. });
  383. }
  384. return e;
  385. }
  386. module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
  387. /***/ }),
  388. /* 4 */
  389. /***/ (function(module, exports, __webpack_require__) {
  390. var toPropertyKey = __webpack_require__(5);
  391. function _defineProperty(obj, key, value) {
  392. key = toPropertyKey(key);
  393. if (key in obj) {
  394. Object.defineProperty(obj, key, {
  395. value: value,
  396. enumerable: true,
  397. configurable: true,
  398. writable: true
  399. });
  400. } else {
  401. obj[key] = value;
  402. }
  403. return obj;
  404. }
  405. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  406. /***/ }),
  407. /* 5 */
  408. /***/ (function(module, exports, __webpack_require__) {
  409. var _typeof = __webpack_require__(6)["default"];
  410. var toPrimitive = __webpack_require__(7);
  411. function toPropertyKey(t) {
  412. var i = toPrimitive(t, "string");
  413. return "symbol" == _typeof(i) ? i : i + "";
  414. }
  415. module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  416. /***/ }),
  417. /* 6 */
  418. /***/ (function(module, exports) {
  419. function _typeof(o) {
  420. "@babel/helpers - typeof";
  421. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
  422. return typeof o;
  423. } : function (o) {
  424. return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  425. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
  426. }
  427. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  428. /***/ }),
  429. /* 7 */
  430. /***/ (function(module, exports, __webpack_require__) {
  431. var _typeof = __webpack_require__(6)["default"];
  432. function toPrimitive(t, r) {
  433. if ("object" != _typeof(t) || !t) return t;
  434. var e = t[Symbol.toPrimitive];
  435. if (void 0 !== e) {
  436. var i = e.call(t, r || "default");
  437. if ("object" != _typeof(i)) return i;
  438. throw new TypeError("@@toPrimitive must return a primitive value.");
  439. }
  440. return ("string" === r ? String : Number)(t);
  441. }
  442. module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  443. /***/ }),
  444. /* 8 */
  445. /***/ (function(module, exports) {
  446. function _classCallCheck(instance, Constructor) {
  447. if (!(instance instanceof Constructor)) {
  448. throw new TypeError("Cannot call a class as a function");
  449. }
  450. }
  451. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  452. /***/ }),
  453. /* 9 */
  454. /***/ (function(module, exports, __webpack_require__) {
  455. var toPropertyKey = __webpack_require__(5);
  456. function _defineProperties(target, props) {
  457. for (var i = 0; i < props.length; i++) {
  458. var descriptor = props[i];
  459. descriptor.enumerable = descriptor.enumerable || false;
  460. descriptor.configurable = true;
  461. if ("value" in descriptor) descriptor.writable = true;
  462. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  463. }
  464. }
  465. function _createClass(Constructor, protoProps, staticProps) {
  466. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  467. if (staticProps) _defineProperties(Constructor, staticProps);
  468. Object.defineProperty(Constructor, "prototype", {
  469. writable: false
  470. });
  471. return Constructor;
  472. }
  473. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  474. /***/ }),
  475. /* 10 */
  476. /***/ (function(module, exports, __webpack_require__) {
  477. var _typeof = __webpack_require__(6)["default"];
  478. var assertThisInitialized = __webpack_require__(11);
  479. function _possibleConstructorReturn(self, call) {
  480. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  481. return call;
  482. } else if (call !== void 0) {
  483. throw new TypeError("Derived constructors may only return object or undefined");
  484. }
  485. return assertThisInitialized(self);
  486. }
  487. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  488. /***/ }),
  489. /* 11 */
  490. /***/ (function(module, exports) {
  491. function _assertThisInitialized(self) {
  492. if (self === void 0) {
  493. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  494. }
  495. return self;
  496. }
  497. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  498. /***/ }),
  499. /* 12 */
  500. /***/ (function(module, exports) {
  501. function _isNativeReflectConstruct() {
  502. try {
  503. var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  504. } catch (t) {}
  505. return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
  506. return !!t;
  507. }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
  508. }
  509. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  510. /***/ }),
  511. /* 13 */
  512. /***/ (function(module, exports) {
  513. function _getPrototypeOf(o) {
  514. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  515. return o.__proto__ || Object.getPrototypeOf(o);
  516. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  517. return _getPrototypeOf(o);
  518. }
  519. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  520. /***/ }),
  521. /* 14 */
  522. /***/ (function(module, exports, __webpack_require__) {
  523. var setPrototypeOf = __webpack_require__(15);
  524. function _inherits(subClass, superClass) {
  525. if (typeof superClass !== "function" && superClass !== null) {
  526. throw new TypeError("Super expression must either be null or a function");
  527. }
  528. subClass.prototype = Object.create(superClass && superClass.prototype, {
  529. constructor: {
  530. value: subClass,
  531. writable: true,
  532. configurable: true
  533. }
  534. });
  535. Object.defineProperty(subClass, "prototype", {
  536. writable: false
  537. });
  538. if (superClass) setPrototypeOf(subClass, superClass);
  539. }
  540. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  541. /***/ }),
  542. /* 15 */
  543. /***/ (function(module, exports) {
  544. function _setPrototypeOf(o, p) {
  545. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  546. o.__proto__ = p;
  547. return o;
  548. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  549. return _setPrototypeOf(o, p);
  550. }
  551. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  552. /***/ }),
  553. /* 16 */
  554. /***/ (function(module, exports) {
  555. module.exports = __WEBPACK_EXTERNAL_MODULE__16__;
  556. /***/ }),
  557. /* 17 */
  558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  559. "use strict";
  560. __webpack_require__.r(__webpack_exports__);
  561. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerSlider", function() { return InnerSlider; });
  562. /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
  563. /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
  564. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
  565. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__);
  566. /* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18);
  567. /* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__);
  568. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
  569. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3__);
  570. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
  571. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);
  572. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9);
  573. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__);
  574. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10);
  575. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6__);
  576. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(12);
  577. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_7__);
  578. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(13);
  579. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__);
  580. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(14);
  581. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_9__);
  582. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4);
  583. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10__);
  584. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(16);
  585. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_11__);
  586. /* harmony import */ var _initial_state__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(20);
  587. /* harmony import */ var throttle_debounce__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(21);
  588. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(22);
  589. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_14__);
  590. /* harmony import */ var _utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(23);
  591. /* harmony import */ var _track__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(25);
  592. /* harmony import */ var _dots__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26);
  593. /* harmony import */ var _arrows__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(27);
  594. /* harmony import */ var resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(28);
  595. var _excluded = ["animating"];
  596. function _callSuper(t, o, e) { return o = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8___default()(o), _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6___default()(t, _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_7___default()() ? Reflect.construct(o, e || [], _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8___default()(t).constructor) : o.apply(t, e)); }
  597. var InnerSlider = /*#__PURE__*/function (_React$Component) {
  598. function InnerSlider(props) {
  599. var _this;
  600. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this, InnerSlider);
  601. _this = _callSuper(this, InnerSlider, [props]);
  602. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "listRefHandler", function (ref) {
  603. return _this.list = ref;
  604. });
  605. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "trackRefHandler", function (ref) {
  606. return _this.track = ref;
  607. });
  608. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "adaptHeight", function () {
  609. if (_this.props.adaptiveHeight && _this.list) {
  610. var elem = _this.list.querySelector("[data-index=\"".concat(_this.state.currentSlide, "\"]"));
  611. _this.list.style.height = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getHeight"])(elem) + "px";
  612. }
  613. });
  614. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "componentDidMount", function () {
  615. _this.props.onInit && _this.props.onInit();
  616. if (_this.props.lazyLoad) {
  617. var slidesToLoad = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getOnDemandLazySlides"])(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state));
  618. if (slidesToLoad.length > 0) {
  619. _this.setState(function (prevState) {
  620. return {
  621. lazyLoadedList: prevState.lazyLoadedList.concat(slidesToLoad)
  622. };
  623. });
  624. if (_this.props.onLazyLoad) {
  625. _this.props.onLazyLoad(slidesToLoad);
  626. }
  627. }
  628. }
  629. var spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({
  630. listRef: _this.list,
  631. trackRef: _this.track
  632. }, _this.props);
  633. _this.updateState(spec, true, function () {
  634. _this.adaptHeight();
  635. _this.props.autoplay && _this.autoPlay("playing");
  636. });
  637. if (_this.props.lazyLoad === "progressive") {
  638. _this.lazyLoadTimer = setInterval(_this.progressiveLazyLoad, 1000);
  639. }
  640. _this.ro = new resize_observer_polyfill__WEBPACK_IMPORTED_MODULE_19__["default"](function () {
  641. if (_this.state.animating) {
  642. _this.onWindowResized(false); // don't set trackStyle hence don't break animation
  643. _this.callbackTimers.push(setTimeout(function () {
  644. return _this.onWindowResized();
  645. }, _this.props.speed));
  646. } else {
  647. _this.onWindowResized();
  648. }
  649. });
  650. _this.ro.observe(_this.list);
  651. document.querySelectorAll && Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"), function (slide) {
  652. slide.onfocus = _this.props.pauseOnFocus ? _this.onSlideFocus : null;
  653. slide.onblur = _this.props.pauseOnFocus ? _this.onSlideBlur : null;
  654. });
  655. if (window.addEventListener) {
  656. window.addEventListener("resize", _this.onWindowResized);
  657. } else {
  658. window.attachEvent("onresize", _this.onWindowResized);
  659. }
  660. });
  661. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "componentWillUnmount", function () {
  662. if (_this.animationEndCallback) {
  663. clearTimeout(_this.animationEndCallback);
  664. }
  665. if (_this.lazyLoadTimer) {
  666. clearInterval(_this.lazyLoadTimer);
  667. }
  668. if (_this.callbackTimers.length) {
  669. _this.callbackTimers.forEach(function (timer) {
  670. return clearTimeout(timer);
  671. });
  672. _this.callbackTimers = [];
  673. }
  674. if (window.addEventListener) {
  675. window.removeEventListener("resize", _this.onWindowResized);
  676. } else {
  677. window.detachEvent("onresize", _this.onWindowResized);
  678. }
  679. if (_this.autoplayTimer) {
  680. clearInterval(_this.autoplayTimer);
  681. }
  682. _this.ro.disconnect();
  683. });
  684. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "componentDidUpdate", function (prevProps) {
  685. _this.checkImagesLoad();
  686. _this.props.onReInit && _this.props.onReInit();
  687. if (_this.props.lazyLoad) {
  688. var slidesToLoad = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getOnDemandLazySlides"])(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state));
  689. if (slidesToLoad.length > 0) {
  690. _this.setState(function (prevState) {
  691. return {
  692. lazyLoadedList: prevState.lazyLoadedList.concat(slidesToLoad)
  693. };
  694. });
  695. if (_this.props.onLazyLoad) {
  696. _this.props.onLazyLoad(slidesToLoad);
  697. }
  698. }
  699. }
  700. // if (this.props.onLazyLoad) {
  701. // this.props.onLazyLoad([leftMostSlide])
  702. // }
  703. _this.adaptHeight();
  704. var spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({
  705. listRef: _this.list,
  706. trackRef: _this.track
  707. }, _this.props), _this.state);
  708. var setTrackStyle = _this.didPropsChange(prevProps);
  709. setTrackStyle && _this.updateState(spec, setTrackStyle, function () {
  710. if (_this.state.currentSlide >= react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(_this.props.children)) {
  711. _this.changeSlide({
  712. message: "index",
  713. index: react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(_this.props.children) - _this.props.slidesToShow,
  714. currentSlide: _this.state.currentSlide
  715. });
  716. }
  717. if (prevProps.autoplay !== _this.props.autoplay || prevProps.autoplaySpeed !== _this.props.autoplaySpeed) {
  718. if (!prevProps.autoplay && _this.props.autoplay) {
  719. _this.autoPlay("playing");
  720. } else if (_this.props.autoplay) {
  721. _this.autoPlay("update");
  722. } else {
  723. _this.pause("paused");
  724. }
  725. }
  726. });
  727. });
  728. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "onWindowResized", function (setTrackStyle) {
  729. if (_this.debouncedResize) _this.debouncedResize.cancel();
  730. _this.debouncedResize = Object(throttle_debounce__WEBPACK_IMPORTED_MODULE_13__["debounce"])(50, function () {
  731. return _this.resizeWindow(setTrackStyle);
  732. });
  733. _this.debouncedResize();
  734. });
  735. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "resizeWindow", function () {
  736. var setTrackStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  737. var isTrackMounted = Boolean(_this.track && _this.track.node);
  738. // prevent warning: setting state on unmounted component (server side rendering)
  739. if (!isTrackMounted) return;
  740. var spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({
  741. listRef: _this.list,
  742. trackRef: _this.track
  743. }, _this.props), _this.state);
  744. _this.updateState(spec, setTrackStyle, function () {
  745. if (_this.props.autoplay) _this.autoPlay("update");else _this.pause("paused");
  746. });
  747. // animating state should be cleared while resizing, otherwise autoplay stops working
  748. _this.setState({
  749. animating: false
  750. });
  751. clearTimeout(_this.animationEndCallback);
  752. delete _this.animationEndCallback;
  753. });
  754. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "updateState", function (spec, setTrackStyle, callback) {
  755. var updatedState = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["initializedState"])(spec);
  756. spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, spec), updatedState), {}, {
  757. slideIndex: updatedState.currentSlide
  758. });
  759. var targetLeft = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getTrackLeft"])(spec);
  760. spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, spec), {}, {
  761. left: targetLeft
  762. });
  763. var trackStyle = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getTrackCSS"])(spec);
  764. if (setTrackStyle || react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(_this.props.children) !== react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(spec.children)) {
  765. updatedState["trackStyle"] = trackStyle;
  766. }
  767. _this.setState(updatedState, callback);
  768. });
  769. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "ssrInit", function () {
  770. if (_this.props.variableWidth) {
  771. var _trackWidth = 0,
  772. _trackLeft = 0;
  773. var childrenWidths = [];
  774. var preClones = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getPreClones"])(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state), {}, {
  775. slideCount: _this.props.children.length
  776. }));
  777. var postClones = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getPostClones"])(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state), {}, {
  778. slideCount: _this.props.children.length
  779. }));
  780. _this.props.children.forEach(function (child) {
  781. childrenWidths.push(child.props.style.width);
  782. _trackWidth += child.props.style.width;
  783. });
  784. for (var i = 0; i < preClones; i++) {
  785. _trackLeft += childrenWidths[childrenWidths.length - 1 - i];
  786. _trackWidth += childrenWidths[childrenWidths.length - 1 - i];
  787. }
  788. for (var _i = 0; _i < postClones; _i++) {
  789. _trackWidth += childrenWidths[_i];
  790. }
  791. for (var _i2 = 0; _i2 < _this.state.currentSlide; _i2++) {
  792. _trackLeft += childrenWidths[_i2];
  793. }
  794. var _trackStyle = {
  795. width: _trackWidth + "px",
  796. left: -_trackLeft + "px"
  797. };
  798. if (_this.props.centerMode) {
  799. var currentWidth = "".concat(childrenWidths[_this.state.currentSlide], "px");
  800. _trackStyle.left = "calc(".concat(_trackStyle.left, " + (100% - ").concat(currentWidth, ") / 2 ) ");
  801. }
  802. return {
  803. trackStyle: _trackStyle
  804. };
  805. }
  806. var childrenCount = react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(_this.props.children);
  807. var spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state), {}, {
  808. slideCount: childrenCount
  809. });
  810. var slideCount = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getPreClones"])(spec) + Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getPostClones"])(spec) + childrenCount;
  811. var trackWidth = 100 / _this.props.slidesToShow * slideCount;
  812. var slideWidth = 100 / slideCount;
  813. var trackLeft = -slideWidth * (Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getPreClones"])(spec) + _this.state.currentSlide) * trackWidth / 100;
  814. if (_this.props.centerMode) {
  815. trackLeft += (100 - slideWidth * trackWidth / 100) / 2;
  816. }
  817. var trackStyle = {
  818. width: trackWidth + "%",
  819. left: trackLeft + "%"
  820. };
  821. return {
  822. slideWidth: slideWidth + "%",
  823. trackStyle: trackStyle
  824. };
  825. });
  826. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "checkImagesLoad", function () {
  827. var images = _this.list && _this.list.querySelectorAll && _this.list.querySelectorAll(".slick-slide img") || [];
  828. var imagesCount = images.length,
  829. loadedCount = 0;
  830. Array.prototype.forEach.call(images, function (image) {
  831. var handler = function handler() {
  832. return ++loadedCount && loadedCount >= imagesCount && _this.onWindowResized();
  833. };
  834. if (!image.onclick) {
  835. image.onclick = function () {
  836. return image.parentNode.focus();
  837. };
  838. } else {
  839. var prevClickHandler = image.onclick;
  840. image.onclick = function (e) {
  841. prevClickHandler(e);
  842. image.parentNode.focus();
  843. };
  844. }
  845. if (!image.onload) {
  846. if (_this.props.lazyLoad) {
  847. image.onload = function () {
  848. _this.adaptHeight();
  849. _this.callbackTimers.push(setTimeout(_this.onWindowResized, _this.props.speed));
  850. };
  851. } else {
  852. image.onload = handler;
  853. image.onerror = function () {
  854. handler();
  855. _this.props.onLazyLoadError && _this.props.onLazyLoadError();
  856. };
  857. }
  858. }
  859. });
  860. });
  861. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "progressiveLazyLoad", function () {
  862. var slidesToLoad = [];
  863. var spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state);
  864. for (var index = _this.state.currentSlide; index < _this.state.slideCount + Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getPostClones"])(spec); index++) {
  865. if (_this.state.lazyLoadedList.indexOf(index) < 0) {
  866. slidesToLoad.push(index);
  867. break;
  868. }
  869. }
  870. for (var _index = _this.state.currentSlide - 1; _index >= -Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["getPreClones"])(spec); _index--) {
  871. if (_this.state.lazyLoadedList.indexOf(_index) < 0) {
  872. slidesToLoad.push(_index);
  873. break;
  874. }
  875. }
  876. if (slidesToLoad.length > 0) {
  877. _this.setState(function (state) {
  878. return {
  879. lazyLoadedList: state.lazyLoadedList.concat(slidesToLoad)
  880. };
  881. });
  882. if (_this.props.onLazyLoad) {
  883. _this.props.onLazyLoad(slidesToLoad);
  884. }
  885. } else {
  886. if (_this.lazyLoadTimer) {
  887. clearInterval(_this.lazyLoadTimer);
  888. delete _this.lazyLoadTimer;
  889. }
  890. }
  891. });
  892. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "slideHandler", function (index) {
  893. var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  894. var _this$props = _this.props,
  895. asNavFor = _this$props.asNavFor,
  896. beforeChange = _this$props.beforeChange,
  897. onLazyLoad = _this$props.onLazyLoad,
  898. speed = _this$props.speed,
  899. afterChange = _this$props.afterChange;
  900. // capture currentslide before state is updated
  901. var currentSlide = _this.state.currentSlide;
  902. var _slideHandler = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["slideHandler"])(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({
  903. index: index
  904. }, _this.props), _this.state), {}, {
  905. trackRef: _this.track,
  906. useCSS: _this.props.useCSS && !dontAnimate
  907. })),
  908. state = _slideHandler.state,
  909. nextState = _slideHandler.nextState;
  910. if (!state) return;
  911. beforeChange && beforeChange(currentSlide, state.currentSlide);
  912. var slidesToLoad = state.lazyLoadedList.filter(function (value) {
  913. return _this.state.lazyLoadedList.indexOf(value) < 0;
  914. });
  915. onLazyLoad && slidesToLoad.length > 0 && onLazyLoad(slidesToLoad);
  916. if (!_this.props.waitForAnimate && _this.animationEndCallback) {
  917. clearTimeout(_this.animationEndCallback);
  918. afterChange && afterChange(currentSlide);
  919. delete _this.animationEndCallback;
  920. }
  921. _this.setState(state, function () {
  922. // asNavForIndex check is to avoid recursive calls of slideHandler in waitForAnimate=false mode
  923. if (asNavFor && _this.asNavForIndex !== index) {
  924. _this.asNavForIndex = index;
  925. asNavFor.innerSlider.slideHandler(index);
  926. }
  927. if (!nextState) return;
  928. _this.animationEndCallback = setTimeout(function () {
  929. var animating = nextState.animating,
  930. firstBatch = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(nextState, _excluded);
  931. _this.setState(firstBatch, function () {
  932. _this.callbackTimers.push(setTimeout(function () {
  933. return _this.setState({
  934. animating: animating
  935. });
  936. }, 10));
  937. afterChange && afterChange(state.currentSlide);
  938. delete _this.animationEndCallback;
  939. });
  940. }, speed);
  941. });
  942. });
  943. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "changeSlide", function (options) {
  944. var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  945. var spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state);
  946. var targetSlide = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["changeSlide"])(spec, options);
  947. if (targetSlide !== 0 && !targetSlide) return;
  948. if (dontAnimate === true) {
  949. _this.slideHandler(targetSlide, dontAnimate);
  950. } else {
  951. _this.slideHandler(targetSlide);
  952. }
  953. _this.props.autoplay && _this.autoPlay("update");
  954. if (_this.props.focusOnSelect) {
  955. var nodes = _this.list.querySelectorAll(".slick-current");
  956. nodes[0] && nodes[0].focus();
  957. }
  958. });
  959. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "clickHandler", function (e) {
  960. if (_this.clickable === false) {
  961. e.stopPropagation();
  962. e.preventDefault();
  963. }
  964. _this.clickable = true;
  965. });
  966. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "keyHandler", function (e) {
  967. var dir = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["keyHandler"])(e, _this.props.accessibility, _this.props.rtl);
  968. dir !== "" && _this.changeSlide({
  969. message: dir
  970. });
  971. });
  972. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "selectHandler", function (options) {
  973. _this.changeSlide(options);
  974. });
  975. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "disableBodyScroll", function () {
  976. var preventDefault = function preventDefault(e) {
  977. e = e || window.event;
  978. if (e.preventDefault) e.preventDefault();
  979. e.returnValue = false;
  980. };
  981. window.ontouchmove = preventDefault;
  982. });
  983. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "enableBodyScroll", function () {
  984. window.ontouchmove = null;
  985. });
  986. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "swipeStart", function (e) {
  987. if (_this.props.verticalSwiping) {
  988. _this.disableBodyScroll();
  989. }
  990. var state = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["swipeStart"])(e, _this.props.swipe, _this.props.draggable);
  991. state !== "" && _this.setState(state);
  992. });
  993. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "swipeMove", function (e) {
  994. var state = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["swipeMove"])(e, _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state), {}, {
  995. trackRef: _this.track,
  996. listRef: _this.list,
  997. slideIndex: _this.state.currentSlide
  998. }));
  999. if (!state) return;
  1000. if (state["swiping"]) {
  1001. _this.clickable = false;
  1002. }
  1003. _this.setState(state);
  1004. });
  1005. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "swipeEnd", function (e) {
  1006. var state = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["swipeEnd"])(e, _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state), {}, {
  1007. trackRef: _this.track,
  1008. listRef: _this.list,
  1009. slideIndex: _this.state.currentSlide
  1010. }));
  1011. if (!state) return;
  1012. var triggerSlideHandler = state["triggerSlideHandler"];
  1013. delete state["triggerSlideHandler"];
  1014. _this.setState(state);
  1015. if (triggerSlideHandler === undefined) return;
  1016. _this.slideHandler(triggerSlideHandler);
  1017. if (_this.props.verticalSwiping) {
  1018. _this.enableBodyScroll();
  1019. }
  1020. });
  1021. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "touchEnd", function (e) {
  1022. _this.swipeEnd(e);
  1023. _this.clickable = true;
  1024. });
  1025. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "slickPrev", function () {
  1026. // this and fellow methods are wrapped in setTimeout
  1027. // to make sure initialize setState has happened before
  1028. // any of such methods are called
  1029. _this.callbackTimers.push(setTimeout(function () {
  1030. return _this.changeSlide({
  1031. message: "previous"
  1032. });
  1033. }, 0));
  1034. });
  1035. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "slickNext", function () {
  1036. _this.callbackTimers.push(setTimeout(function () {
  1037. return _this.changeSlide({
  1038. message: "next"
  1039. });
  1040. }, 0));
  1041. });
  1042. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "slickGoTo", function (slide) {
  1043. var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1044. slide = Number(slide);
  1045. if (isNaN(slide)) return "";
  1046. _this.callbackTimers.push(setTimeout(function () {
  1047. return _this.changeSlide({
  1048. message: "index",
  1049. index: slide,
  1050. currentSlide: _this.state.currentSlide
  1051. }, dontAnimate);
  1052. }, 0));
  1053. });
  1054. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "play", function () {
  1055. var nextIndex;
  1056. if (_this.props.rtl) {
  1057. nextIndex = _this.state.currentSlide - _this.props.slidesToScroll;
  1058. } else {
  1059. if (Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["canGoNext"])(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state))) {
  1060. nextIndex = _this.state.currentSlide + _this.props.slidesToScroll;
  1061. } else {
  1062. return false;
  1063. }
  1064. }
  1065. _this.slideHandler(nextIndex);
  1066. });
  1067. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "autoPlay", function (playType) {
  1068. if (_this.autoplayTimer) {
  1069. clearInterval(_this.autoplayTimer);
  1070. }
  1071. var autoplaying = _this.state.autoplaying;
  1072. if (playType === "update") {
  1073. if (autoplaying === "hovered" || autoplaying === "focused" || autoplaying === "paused") {
  1074. return;
  1075. }
  1076. } else if (playType === "leave") {
  1077. if (autoplaying === "paused" || autoplaying === "focused") {
  1078. return;
  1079. }
  1080. } else if (playType === "blur") {
  1081. if (autoplaying === "paused" || autoplaying === "hovered") {
  1082. return;
  1083. }
  1084. }
  1085. _this.autoplayTimer = setInterval(_this.play, _this.props.autoplaySpeed + 50);
  1086. _this.setState({
  1087. autoplaying: "playing"
  1088. });
  1089. });
  1090. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "pause", function (pauseType) {
  1091. if (_this.autoplayTimer) {
  1092. clearInterval(_this.autoplayTimer);
  1093. _this.autoplayTimer = null;
  1094. }
  1095. var autoplaying = _this.state.autoplaying;
  1096. if (pauseType === "paused") {
  1097. _this.setState({
  1098. autoplaying: "paused"
  1099. });
  1100. } else if (pauseType === "focused") {
  1101. if (autoplaying === "hovered" || autoplaying === "playing") {
  1102. _this.setState({
  1103. autoplaying: "focused"
  1104. });
  1105. }
  1106. } else {
  1107. // pauseType is 'hovered'
  1108. if (autoplaying === "playing") {
  1109. _this.setState({
  1110. autoplaying: "hovered"
  1111. });
  1112. }
  1113. }
  1114. });
  1115. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "onDotsOver", function () {
  1116. return _this.props.autoplay && _this.pause("hovered");
  1117. });
  1118. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "onDotsLeave", function () {
  1119. return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave");
  1120. });
  1121. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "onTrackOver", function () {
  1122. return _this.props.autoplay && _this.pause("hovered");
  1123. });
  1124. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "onTrackLeave", function () {
  1125. return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave");
  1126. });
  1127. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "onSlideFocus", function () {
  1128. return _this.props.autoplay && _this.pause("focused");
  1129. });
  1130. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "onSlideBlur", function () {
  1131. return _this.props.autoplay && _this.state.autoplaying === "focused" && _this.autoPlay("blur");
  1132. });
  1133. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(_this, "render", function () {
  1134. var className = classnames__WEBPACK_IMPORTED_MODULE_14___default()("slick-slider", _this.props.className, {
  1135. "slick-vertical": _this.props.vertical,
  1136. "slick-initialized": true
  1137. });
  1138. var spec = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.props), _this.state);
  1139. var trackProps = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["extractObject"])(spec, ["fade", "cssEase", "speed", "infinite", "centerMode", "focusOnSelect", "currentSlide", "lazyLoad", "lazyLoadedList", "rtl", "slideWidth", "slideHeight", "listHeight", "vertical", "slidesToShow", "slidesToScroll", "slideCount", "trackStyle", "variableWidth", "unslick", "centerPadding", "targetSlide", "useCSS"]);
  1140. var pauseOnHover = _this.props.pauseOnHover;
  1141. trackProps = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, trackProps), {}, {
  1142. onMouseEnter: pauseOnHover ? _this.onTrackOver : null,
  1143. onMouseLeave: pauseOnHover ? _this.onTrackLeave : null,
  1144. onMouseOver: pauseOnHover ? _this.onTrackOver : null,
  1145. focusOnSelect: _this.props.focusOnSelect && _this.clickable ? _this.selectHandler : null
  1146. });
  1147. var dots;
  1148. if (_this.props.dots === true && _this.state.slideCount >= _this.props.slidesToShow) {
  1149. var dotProps = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["extractObject"])(spec, ["dotsClass", "slideCount", "slidesToShow", "currentSlide", "slidesToScroll", "clickHandler", "children", "customPaging", "infinite", "appendDots"]);
  1150. var pauseOnDotsHover = _this.props.pauseOnDotsHover;
  1151. dotProps = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, dotProps), {}, {
  1152. clickHandler: _this.changeSlide,
  1153. onMouseEnter: pauseOnDotsHover ? _this.onDotsLeave : null,
  1154. onMouseOver: pauseOnDotsHover ? _this.onDotsOver : null,
  1155. onMouseLeave: pauseOnDotsHover ? _this.onDotsLeave : null
  1156. });
  1157. dots = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement(_dots__WEBPACK_IMPORTED_MODULE_17__["Dots"], dotProps);
  1158. }
  1159. var prevArrow, nextArrow;
  1160. var arrowProps = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_15__["extractObject"])(spec, ["infinite", "centerMode", "currentSlide", "slideCount", "slidesToShow", "prevArrow", "nextArrow"]);
  1161. arrowProps.clickHandler = _this.changeSlide;
  1162. if (_this.props.arrows) {
  1163. prevArrow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement(_arrows__WEBPACK_IMPORTED_MODULE_18__["PrevArrow"], arrowProps);
  1164. nextArrow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement(_arrows__WEBPACK_IMPORTED_MODULE_18__["NextArrow"], arrowProps);
  1165. }
  1166. var verticalHeightStyle = null;
  1167. if (_this.props.vertical) {
  1168. verticalHeightStyle = {
  1169. height: _this.state.listHeight
  1170. };
  1171. }
  1172. var centerPaddingStyle = null;
  1173. if (_this.props.vertical === false) {
  1174. if (_this.props.centerMode === true) {
  1175. centerPaddingStyle = {
  1176. padding: "0px " + _this.props.centerPadding
  1177. };
  1178. }
  1179. } else {
  1180. if (_this.props.centerMode === true) {
  1181. centerPaddingStyle = {
  1182. padding: _this.props.centerPadding + " 0px"
  1183. };
  1184. }
  1185. }
  1186. var listStyle = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, verticalHeightStyle), centerPaddingStyle);
  1187. var touchMove = _this.props.touchMove;
  1188. var listProps = {
  1189. className: "slick-list",
  1190. style: listStyle,
  1191. onClick: _this.clickHandler,
  1192. onMouseDown: touchMove ? _this.swipeStart : null,
  1193. onMouseMove: _this.state.dragging && touchMove ? _this.swipeMove : null,
  1194. onMouseUp: touchMove ? _this.swipeEnd : null,
  1195. onMouseLeave: _this.state.dragging && touchMove ? _this.swipeEnd : null,
  1196. onTouchStart: touchMove ? _this.swipeStart : null,
  1197. onTouchMove: _this.state.dragging && touchMove ? _this.swipeMove : null,
  1198. onTouchEnd: touchMove ? _this.touchEnd : null,
  1199. onTouchCancel: _this.state.dragging && touchMove ? _this.swipeEnd : null,
  1200. onKeyDown: _this.props.accessibility ? _this.keyHandler : null
  1201. };
  1202. var innerSliderProps = {
  1203. className: className,
  1204. dir: "ltr",
  1205. style: _this.props.style
  1206. };
  1207. if (_this.props.unslick) {
  1208. listProps = {
  1209. className: "slick-list"
  1210. };
  1211. innerSliderProps = {
  1212. className: className,
  1213. style: _this.props.style
  1214. };
  1215. }
  1216. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div", innerSliderProps, !_this.props.unslick ? prevArrow : "", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement("div", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
  1217. ref: _this.listRefHandler
  1218. }, listProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_11___default.a.createElement(_track__WEBPACK_IMPORTED_MODULE_16__["Track"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
  1219. ref: _this.trackRefHandler
  1220. }, trackProps), _this.props.children)), !_this.props.unslick ? nextArrow : "", !_this.props.unslick ? dots : "");
  1221. });
  1222. _this.list = null;
  1223. _this.track = null;
  1224. _this.state = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _initial_state__WEBPACK_IMPORTED_MODULE_12__["default"]), {}, {
  1225. currentSlide: _this.props.initialSlide,
  1226. targetSlide: _this.props.initialSlide ? _this.props.initialSlide : 0,
  1227. slideCount: react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(_this.props.children)
  1228. });
  1229. _this.callbackTimers = [];
  1230. _this.clickable = true;
  1231. _this.debouncedResize = null;
  1232. var ssrState = _this.ssrInit();
  1233. _this.state = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_3___default()({}, _this.state), ssrState);
  1234. return _this;
  1235. }
  1236. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_9___default()(InnerSlider, _React$Component);
  1237. return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default()(InnerSlider, [{
  1238. key: "didPropsChange",
  1239. value: function didPropsChange(prevProps) {
  1240. var setTrackStyle = false;
  1241. for (var _i3 = 0, _Object$keys = Object.keys(this.props); _i3 < _Object$keys.length; _i3++) {
  1242. var key = _Object$keys[_i3];
  1243. // eslint-disable-next-line no-prototype-builtins
  1244. if (!prevProps.hasOwnProperty(key)) {
  1245. setTrackStyle = true;
  1246. break;
  1247. }
  1248. if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(prevProps[key]) === "object" || typeof prevProps[key] === "function" || isNaN(prevProps[key])) {
  1249. continue;
  1250. }
  1251. if (prevProps[key] !== this.props[key]) {
  1252. setTrackStyle = true;
  1253. break;
  1254. }
  1255. }
  1256. return setTrackStyle || react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(this.props.children) !== react__WEBPACK_IMPORTED_MODULE_11___default.a.Children.count(prevProps.children);
  1257. }
  1258. }]);
  1259. }(react__WEBPACK_IMPORTED_MODULE_11___default.a.Component);
  1260. /***/ }),
  1261. /* 18 */
  1262. /***/ (function(module, exports, __webpack_require__) {
  1263. var objectWithoutPropertiesLoose = __webpack_require__(19);
  1264. function _objectWithoutProperties(source, excluded) {
  1265. if (source == null) return {};
  1266. var target = objectWithoutPropertiesLoose(source, excluded);
  1267. var key, i;
  1268. if (Object.getOwnPropertySymbols) {
  1269. var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  1270. for (i = 0; i < sourceSymbolKeys.length; i++) {
  1271. key = sourceSymbolKeys[i];
  1272. if (excluded.indexOf(key) >= 0) continue;
  1273. if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
  1274. target[key] = source[key];
  1275. }
  1276. }
  1277. return target;
  1278. }
  1279. module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1280. /***/ }),
  1281. /* 19 */
  1282. /***/ (function(module, exports) {
  1283. function _objectWithoutPropertiesLoose(source, excluded) {
  1284. if (source == null) return {};
  1285. var target = {};
  1286. var sourceKeys = Object.keys(source);
  1287. var key, i;
  1288. for (i = 0; i < sourceKeys.length; i++) {
  1289. key = sourceKeys[i];
  1290. if (excluded.indexOf(key) >= 0) continue;
  1291. target[key] = source[key];
  1292. }
  1293. return target;
  1294. }
  1295. module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1296. /***/ }),
  1297. /* 20 */
  1298. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1299. "use strict";
  1300. __webpack_require__.r(__webpack_exports__);
  1301. var initialState = {
  1302. animating: false,
  1303. autoplaying: null,
  1304. currentDirection: 0,
  1305. currentLeft: null,
  1306. currentSlide: 0,
  1307. direction: 1,
  1308. dragging: false,
  1309. edgeDragged: false,
  1310. initialized: false,
  1311. lazyLoadedList: [],
  1312. listHeight: null,
  1313. listWidth: null,
  1314. scrolling: false,
  1315. slideCount: null,
  1316. slideHeight: null,
  1317. slideWidth: null,
  1318. swipeLeft: null,
  1319. swiped: false,
  1320. // used by swipeEvent. differentites between touch and swipe.
  1321. swiping: false,
  1322. touchObject: {
  1323. startX: 0,
  1324. startY: 0,
  1325. curX: 0,
  1326. curY: 0
  1327. },
  1328. trackStyle: {},
  1329. trackWidth: 0,
  1330. targetSlide: 0
  1331. };
  1332. /* harmony default export */ __webpack_exports__["default"] = (initialState);
  1333. /***/ }),
  1334. /* 21 */
  1335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1336. "use strict";
  1337. __webpack_require__.r(__webpack_exports__);
  1338. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; });
  1339. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; });
  1340. /* eslint-disable no-undefined,no-param-reassign,no-shadow */
  1341. /**
  1342. * Throttle execution of a function. Especially useful for rate limiting
  1343. * execution of handlers on events like resize and scroll.
  1344. *
  1345. * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
  1346. * are most useful.
  1347. * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
  1348. * as-is, to `callback` when the throttled-function is executed.
  1349. * @param {object} [options] - An object to configure options.
  1350. * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
  1351. * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
  1352. * one final time after the last throttled-function call. (After the throttled-function has not been called for
  1353. * `delay` milliseconds, the internal counter is reset).
  1354. * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
  1355. * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
  1356. * callback will never executed if both noLeading = true and noTrailing = true.
  1357. * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
  1358. * false (at end), schedule `callback` to execute after `delay` ms.
  1359. *
  1360. * @returns {Function} A new, throttled, function.
  1361. */
  1362. function throttle (delay, callback, options) {
  1363. var _ref = options || {},
  1364. _ref$noTrailing = _ref.noTrailing,
  1365. noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
  1366. _ref$noLeading = _ref.noLeading,
  1367. noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
  1368. _ref$debounceMode = _ref.debounceMode,
  1369. debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
  1370. /*
  1371. * After wrapper has stopped being called, this timeout ensures that
  1372. * `callback` is executed at the proper times in `throttle` and `end`
  1373. * debounce modes.
  1374. */
  1375. var timeoutID;
  1376. var cancelled = false; // Keep track of the last time `callback` was executed.
  1377. var lastExec = 0; // Function to clear existing timeout
  1378. function clearExistingTimeout() {
  1379. if (timeoutID) {
  1380. clearTimeout(timeoutID);
  1381. }
  1382. } // Function to cancel next exec
  1383. function cancel(options) {
  1384. var _ref2 = options || {},
  1385. _ref2$upcomingOnly = _ref2.upcomingOnly,
  1386. upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
  1387. clearExistingTimeout();
  1388. cancelled = !upcomingOnly;
  1389. }
  1390. /*
  1391. * The `wrapper` function encapsulates all of the throttling / debouncing
  1392. * functionality and when executed will limit the rate at which `callback`
  1393. * is executed.
  1394. */
  1395. function wrapper() {
  1396. for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
  1397. arguments_[_key] = arguments[_key];
  1398. }
  1399. var self = this;
  1400. var elapsed = Date.now() - lastExec;
  1401. if (cancelled) {
  1402. return;
  1403. } // Execute `callback` and update the `lastExec` timestamp.
  1404. function exec() {
  1405. lastExec = Date.now();
  1406. callback.apply(self, arguments_);
  1407. }
  1408. /*
  1409. * If `debounceMode` is true (at begin) this is used to clear the flag
  1410. * to allow future `callback` executions.
  1411. */
  1412. function clear() {
  1413. timeoutID = undefined;
  1414. }
  1415. if (!noLeading && debounceMode && !timeoutID) {
  1416. /*
  1417. * Since `wrapper` is being called for the first time and
  1418. * `debounceMode` is true (at begin), execute `callback`
  1419. * and noLeading != true.
  1420. */
  1421. exec();
  1422. }
  1423. clearExistingTimeout();
  1424. if (debounceMode === undefined && elapsed > delay) {
  1425. if (noLeading) {
  1426. /*
  1427. * In throttle mode with noLeading, if `delay` time has
  1428. * been exceeded, update `lastExec` and schedule `callback`
  1429. * to execute after `delay` ms.
  1430. */
  1431. lastExec = Date.now();
  1432. if (!noTrailing) {
  1433. timeoutID = setTimeout(debounceMode ? clear : exec, delay);
  1434. }
  1435. } else {
  1436. /*
  1437. * In throttle mode without noLeading, if `delay` time has been exceeded, execute
  1438. * `callback`.
  1439. */
  1440. exec();
  1441. }
  1442. } else if (noTrailing !== true) {
  1443. /*
  1444. * In trailing throttle mode, since `delay` time has not been
  1445. * exceeded, schedule `callback` to execute `delay` ms after most
  1446. * recent execution.
  1447. *
  1448. * If `debounceMode` is true (at begin), schedule `clear` to execute
  1449. * after `delay` ms.
  1450. *
  1451. * If `debounceMode` is false (at end), schedule `callback` to
  1452. * execute after `delay` ms.
  1453. */
  1454. timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
  1455. }
  1456. }
  1457. wrapper.cancel = cancel; // Return the wrapper function.
  1458. return wrapper;
  1459. }
  1460. /* eslint-disable no-undefined */
  1461. /**
  1462. * Debounce execution of a function. Debouncing, unlike throttling,
  1463. * guarantees that a function is only executed a single time, either at the
  1464. * very beginning of a series of calls, or at the very end.
  1465. *
  1466. * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
  1467. * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
  1468. * to `callback` when the debounced-function is executed.
  1469. * @param {object} [options] - An object to configure options.
  1470. * @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
  1471. * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
  1472. * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
  1473. *
  1474. * @returns {Function} A new, debounced function.
  1475. */
  1476. function debounce (delay, callback, options) {
  1477. var _ref = options || {},
  1478. _ref$atBegin = _ref.atBegin,
  1479. atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
  1480. return throttle(delay, callback, {
  1481. debounceMode: atBegin !== false
  1482. });
  1483. }
  1484. //# sourceMappingURL=index.js.map
  1485. /***/ }),
  1486. /* 22 */
  1487. /***/ (function(module, exports, __webpack_require__) {
  1488. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  1489. Copyright (c) 2018 Jed Watson.
  1490. Licensed under the MIT License (MIT), see
  1491. http://jedwatson.github.io/classnames
  1492. */
  1493. /* global define */
  1494. (function () {
  1495. 'use strict';
  1496. var hasOwn = {}.hasOwnProperty;
  1497. function classNames () {
  1498. var classes = '';
  1499. for (var i = 0; i < arguments.length; i++) {
  1500. var arg = arguments[i];
  1501. if (arg) {
  1502. classes = appendClass(classes, parseValue(arg));
  1503. }
  1504. }
  1505. return classes;
  1506. }
  1507. function parseValue (arg) {
  1508. if (typeof arg === 'string' || typeof arg === 'number') {
  1509. return arg;
  1510. }
  1511. if (typeof arg !== 'object') {
  1512. return '';
  1513. }
  1514. if (Array.isArray(arg)) {
  1515. return classNames.apply(null, arg);
  1516. }
  1517. if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
  1518. return arg.toString();
  1519. }
  1520. var classes = '';
  1521. for (var key in arg) {
  1522. if (hasOwn.call(arg, key) && arg[key]) {
  1523. classes = appendClass(classes, key);
  1524. }
  1525. }
  1526. return classes;
  1527. }
  1528. function appendClass (value, newClass) {
  1529. if (!newClass) {
  1530. return value;
  1531. }
  1532. if (value) {
  1533. return value + ' ' + newClass;
  1534. }
  1535. return value + newClass;
  1536. }
  1537. if ( true && module.exports) {
  1538. classNames.default = classNames;
  1539. module.exports = classNames;
  1540. } else if (true) {
  1541. // register as 'classnames', consistent with npm package name
  1542. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  1543. return classNames;
  1544. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  1545. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1546. } else {}
  1547. }());
  1548. /***/ }),
  1549. /* 23 */
  1550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1551. "use strict";
  1552. __webpack_require__.r(__webpack_exports__);
  1553. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return clamp; });
  1554. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safePreventDefault", function() { return safePreventDefault; });
  1555. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOnDemandLazySlides", function() { return getOnDemandLazySlides; });
  1556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRequiredLazySlides", function() { return getRequiredLazySlides; });
  1557. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lazyStartIndex", function() { return lazyStartIndex; });
  1558. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lazyEndIndex", function() { return lazyEndIndex; });
  1559. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lazySlidesOnLeft", function() { return lazySlidesOnLeft; });
  1560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lazySlidesOnRight", function() { return lazySlidesOnRight; });
  1561. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWidth", function() { return getWidth; });
  1562. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHeight", function() { return getHeight; });
  1563. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSwipeDirection", function() { return getSwipeDirection; });
  1564. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canGoNext", function() { return canGoNext; });
  1565. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "extractObject", function() { return extractObject; });
  1566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initializedState", function() { return initializedState; });
  1567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slideHandler", function() { return slideHandler; });
  1568. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "changeSlide", function() { return changeSlide; });
  1569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyHandler", function() { return keyHandler; });
  1570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "swipeStart", function() { return swipeStart; });
  1571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "swipeMove", function() { return swipeMove; });
  1572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "swipeEnd", function() { return swipeEnd; });
  1573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNavigableIndexes", function() { return getNavigableIndexes; });
  1574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkNavigable", function() { return checkNavigable; });
  1575. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSlideCount", function() { return getSlideCount; });
  1576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkSpecKeys", function() { return checkSpecKeys; });
  1577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTrackCSS", function() { return getTrackCSS; });
  1578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTrackAnimateCSS", function() { return getTrackAnimateCSS; });
  1579. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTrackLeft", function() { return getTrackLeft; });
  1580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPreClones", function() { return getPreClones; });
  1581. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPostClones", function() { return getPostClones; });
  1582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTotalSlides", function() { return getTotalSlides; });
  1583. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "siblingDirection", function() { return siblingDirection; });
  1584. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slidesOnRight", function() { return slidesOnRight; });
  1585. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slidesOnLeft", function() { return slidesOnLeft; });
  1586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canUseDOM", function() { return canUseDOM; });
  1587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validSettings", function() { return validSettings; });
  1588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filterSettings", function() { return filterSettings; });
  1589. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  1590. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__);
  1591. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
  1592. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  1593. /* harmony import */ var _default_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
  1594. function clamp(number, lowerBound, upperBound) {
  1595. return Math.max(lowerBound, Math.min(number, upperBound));
  1596. }
  1597. var safePreventDefault = function safePreventDefault(event) {
  1598. var passiveEvents = ["onTouchStart", "onTouchMove", "onWheel"];
  1599. if (!passiveEvents.includes(event._reactName)) {
  1600. event.preventDefault();
  1601. }
  1602. };
  1603. var getOnDemandLazySlides = function getOnDemandLazySlides(spec) {
  1604. var onDemandSlides = [];
  1605. var startIndex = lazyStartIndex(spec);
  1606. var endIndex = lazyEndIndex(spec);
  1607. for (var slideIndex = startIndex; slideIndex < endIndex; slideIndex++) {
  1608. if (spec.lazyLoadedList.indexOf(slideIndex) < 0) {
  1609. onDemandSlides.push(slideIndex);
  1610. }
  1611. }
  1612. return onDemandSlides;
  1613. };
  1614. // return list of slides that need to be present
  1615. var getRequiredLazySlides = function getRequiredLazySlides(spec) {
  1616. var requiredSlides = [];
  1617. var startIndex = lazyStartIndex(spec);
  1618. var endIndex = lazyEndIndex(spec);
  1619. for (var slideIndex = startIndex; slideIndex < endIndex; slideIndex++) {
  1620. requiredSlides.push(slideIndex);
  1621. }
  1622. return requiredSlides;
  1623. };
  1624. // startIndex that needs to be present
  1625. var lazyStartIndex = function lazyStartIndex(spec) {
  1626. return spec.currentSlide - lazySlidesOnLeft(spec);
  1627. };
  1628. var lazyEndIndex = function lazyEndIndex(spec) {
  1629. return spec.currentSlide + lazySlidesOnRight(spec);
  1630. };
  1631. var lazySlidesOnLeft = function lazySlidesOnLeft(spec) {
  1632. return spec.centerMode ? Math.floor(spec.slidesToShow / 2) + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : 0;
  1633. };
  1634. var lazySlidesOnRight = function lazySlidesOnRight(spec) {
  1635. return spec.centerMode ? Math.floor((spec.slidesToShow - 1) / 2) + 1 + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : spec.slidesToShow;
  1636. };
  1637. // get width of an element
  1638. var getWidth = function getWidth(elem) {
  1639. return elem && elem.offsetWidth || 0;
  1640. };
  1641. var getHeight = function getHeight(elem) {
  1642. return elem && elem.offsetHeight || 0;
  1643. };
  1644. var getSwipeDirection = function getSwipeDirection(touchObject) {
  1645. var verticalSwiping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1646. var xDist, yDist, r, swipeAngle;
  1647. xDist = touchObject.startX - touchObject.curX;
  1648. yDist = touchObject.startY - touchObject.curY;
  1649. r = Math.atan2(yDist, xDist);
  1650. swipeAngle = Math.round(r * 180 / Math.PI);
  1651. if (swipeAngle < 0) {
  1652. swipeAngle = 360 - Math.abs(swipeAngle);
  1653. }
  1654. if (swipeAngle <= 45 && swipeAngle >= 0 || swipeAngle <= 360 && swipeAngle >= 315) {
  1655. return "left";
  1656. }
  1657. if (swipeAngle >= 135 && swipeAngle <= 225) {
  1658. return "right";
  1659. }
  1660. if (verticalSwiping === true) {
  1661. if (swipeAngle >= 35 && swipeAngle <= 135) {
  1662. return "up";
  1663. } else {
  1664. return "down";
  1665. }
  1666. }
  1667. return "vertical";
  1668. };
  1669. // whether or not we can go next
  1670. var canGoNext = function canGoNext(spec) {
  1671. var canGo = true;
  1672. if (!spec.infinite) {
  1673. if (spec.centerMode && spec.currentSlide >= spec.slideCount - 1) {
  1674. canGo = false;
  1675. } else if (spec.slideCount <= spec.slidesToShow || spec.currentSlide >= spec.slideCount - spec.slidesToShow) {
  1676. canGo = false;
  1677. }
  1678. }
  1679. return canGo;
  1680. };
  1681. // given an object and a list of keys, return new object with given keys
  1682. var extractObject = function extractObject(spec, keys) {
  1683. var newObject = {};
  1684. keys.forEach(function (key) {
  1685. return newObject[key] = spec[key];
  1686. });
  1687. return newObject;
  1688. };
  1689. // get initialized state
  1690. var initializedState = function initializedState(spec) {
  1691. // spec also contains listRef, trackRef
  1692. var slideCount = react__WEBPACK_IMPORTED_MODULE_1___default.a.Children.count(spec.children);
  1693. var listNode = spec.listRef;
  1694. var listWidth = Math.ceil(getWidth(listNode));
  1695. var trackNode = spec.trackRef && spec.trackRef.node;
  1696. var trackWidth = Math.ceil(getWidth(trackNode));
  1697. var slideWidth;
  1698. if (!spec.vertical) {
  1699. var centerPaddingAdj = spec.centerMode && parseInt(spec.centerPadding) * 2;
  1700. if (typeof spec.centerPadding === "string" && spec.centerPadding.slice(-1) === "%") {
  1701. centerPaddingAdj *= listWidth / 100;
  1702. }
  1703. slideWidth = Math.ceil((listWidth - centerPaddingAdj) / spec.slidesToShow);
  1704. } else {
  1705. slideWidth = listWidth;
  1706. }
  1707. var slideHeight = listNode && getHeight(listNode.querySelector('[data-index="0"]'));
  1708. var listHeight = slideHeight * spec.slidesToShow;
  1709. var currentSlide = spec.currentSlide === undefined ? spec.initialSlide : spec.currentSlide;
  1710. if (spec.rtl && spec.currentSlide === undefined) {
  1711. currentSlide = slideCount - 1 - spec.initialSlide;
  1712. }
  1713. var lazyLoadedList = spec.lazyLoadedList || [];
  1714. var slidesToLoad = getOnDemandLazySlides(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1715. currentSlide: currentSlide,
  1716. lazyLoadedList: lazyLoadedList
  1717. }));
  1718. lazyLoadedList = lazyLoadedList.concat(slidesToLoad);
  1719. var state = {
  1720. slideCount: slideCount,
  1721. slideWidth: slideWidth,
  1722. listWidth: listWidth,
  1723. trackWidth: trackWidth,
  1724. currentSlide: currentSlide,
  1725. slideHeight: slideHeight,
  1726. listHeight: listHeight,
  1727. lazyLoadedList: lazyLoadedList
  1728. };
  1729. if (spec.autoplaying === null && spec.autoplay) {
  1730. state["autoplaying"] = "playing";
  1731. }
  1732. return state;
  1733. };
  1734. var slideHandler = function slideHandler(spec) {
  1735. var waitForAnimate = spec.waitForAnimate,
  1736. animating = spec.animating,
  1737. fade = spec.fade,
  1738. infinite = spec.infinite,
  1739. index = spec.index,
  1740. slideCount = spec.slideCount,
  1741. lazyLoad = spec.lazyLoad,
  1742. currentSlide = spec.currentSlide,
  1743. centerMode = spec.centerMode,
  1744. slidesToScroll = spec.slidesToScroll,
  1745. slidesToShow = spec.slidesToShow,
  1746. useCSS = spec.useCSS;
  1747. var lazyLoadedList = spec.lazyLoadedList;
  1748. if (waitForAnimate && animating) return {};
  1749. var animationSlide = index,
  1750. finalSlide,
  1751. animationLeft,
  1752. finalLeft;
  1753. var state = {},
  1754. nextState = {};
  1755. var targetSlide = infinite ? index : clamp(index, 0, slideCount - 1);
  1756. if (fade) {
  1757. if (!infinite && (index < 0 || index >= slideCount)) return {};
  1758. if (index < 0) {
  1759. animationSlide = index + slideCount;
  1760. } else if (index >= slideCount) {
  1761. animationSlide = index - slideCount;
  1762. }
  1763. if (lazyLoad && lazyLoadedList.indexOf(animationSlide) < 0) {
  1764. lazyLoadedList = lazyLoadedList.concat(animationSlide);
  1765. }
  1766. state = {
  1767. animating: true,
  1768. currentSlide: animationSlide,
  1769. lazyLoadedList: lazyLoadedList,
  1770. targetSlide: animationSlide
  1771. };
  1772. nextState = {
  1773. animating: false,
  1774. targetSlide: animationSlide
  1775. };
  1776. } else {
  1777. finalSlide = animationSlide;
  1778. if (animationSlide < 0) {
  1779. finalSlide = animationSlide + slideCount;
  1780. if (!infinite) finalSlide = 0;else if (slideCount % slidesToScroll !== 0) finalSlide = slideCount - slideCount % slidesToScroll;
  1781. } else if (!canGoNext(spec) && animationSlide > currentSlide) {
  1782. animationSlide = finalSlide = currentSlide;
  1783. } else if (centerMode && animationSlide >= slideCount) {
  1784. animationSlide = infinite ? slideCount : slideCount - 1;
  1785. finalSlide = infinite ? 0 : slideCount - 1;
  1786. } else if (animationSlide >= slideCount) {
  1787. finalSlide = animationSlide - slideCount;
  1788. if (!infinite) finalSlide = slideCount - slidesToShow;else if (slideCount % slidesToScroll !== 0) finalSlide = 0;
  1789. }
  1790. if (!infinite && animationSlide + slidesToShow >= slideCount) {
  1791. finalSlide = slideCount - slidesToShow;
  1792. }
  1793. animationLeft = getTrackLeft(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1794. slideIndex: animationSlide
  1795. }));
  1796. finalLeft = getTrackLeft(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1797. slideIndex: finalSlide
  1798. }));
  1799. if (!infinite) {
  1800. if (animationLeft === finalLeft) animationSlide = finalSlide;
  1801. animationLeft = finalLeft;
  1802. }
  1803. if (lazyLoad) {
  1804. lazyLoadedList = lazyLoadedList.concat(getOnDemandLazySlides(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1805. currentSlide: animationSlide
  1806. })));
  1807. }
  1808. if (!useCSS) {
  1809. state = {
  1810. currentSlide: finalSlide,
  1811. trackStyle: getTrackCSS(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1812. left: finalLeft
  1813. })),
  1814. lazyLoadedList: lazyLoadedList,
  1815. targetSlide: targetSlide
  1816. };
  1817. } else {
  1818. state = {
  1819. animating: true,
  1820. currentSlide: finalSlide,
  1821. trackStyle: getTrackAnimateCSS(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1822. left: animationLeft
  1823. })),
  1824. lazyLoadedList: lazyLoadedList,
  1825. targetSlide: targetSlide
  1826. };
  1827. nextState = {
  1828. animating: false,
  1829. currentSlide: finalSlide,
  1830. trackStyle: getTrackCSS(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1831. left: finalLeft
  1832. })),
  1833. swipeLeft: null,
  1834. targetSlide: targetSlide
  1835. };
  1836. }
  1837. }
  1838. return {
  1839. state: state,
  1840. nextState: nextState
  1841. };
  1842. };
  1843. var changeSlide = function changeSlide(spec, options) {
  1844. var indexOffset, previousInt, slideOffset, unevenOffset, targetSlide;
  1845. var slidesToScroll = spec.slidesToScroll,
  1846. slidesToShow = spec.slidesToShow,
  1847. slideCount = spec.slideCount,
  1848. currentSlide = spec.currentSlide,
  1849. previousTargetSlide = spec.targetSlide,
  1850. lazyLoad = spec.lazyLoad,
  1851. infinite = spec.infinite;
  1852. unevenOffset = slideCount % slidesToScroll !== 0;
  1853. indexOffset = unevenOffset ? 0 : (slideCount - currentSlide) % slidesToScroll;
  1854. if (options.message === "previous") {
  1855. slideOffset = indexOffset === 0 ? slidesToScroll : slidesToShow - indexOffset;
  1856. targetSlide = currentSlide - slideOffset;
  1857. if (lazyLoad && !infinite) {
  1858. previousInt = currentSlide - slideOffset;
  1859. targetSlide = previousInt === -1 ? slideCount - 1 : previousInt;
  1860. }
  1861. if (!infinite) {
  1862. targetSlide = previousTargetSlide - slidesToScroll;
  1863. }
  1864. } else if (options.message === "next") {
  1865. slideOffset = indexOffset === 0 ? slidesToScroll : indexOffset;
  1866. targetSlide = currentSlide + slideOffset;
  1867. if (lazyLoad && !infinite) {
  1868. targetSlide = (currentSlide + slidesToScroll) % slideCount + indexOffset;
  1869. }
  1870. if (!infinite) {
  1871. targetSlide = previousTargetSlide + slidesToScroll;
  1872. }
  1873. } else if (options.message === "dots") {
  1874. // Click on dots
  1875. targetSlide = options.index * options.slidesToScroll;
  1876. } else if (options.message === "children") {
  1877. // Click on the slides
  1878. targetSlide = options.index;
  1879. if (infinite) {
  1880. var direction = siblingDirection(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1881. targetSlide: targetSlide
  1882. }));
  1883. if (targetSlide > options.currentSlide && direction === "left") {
  1884. targetSlide = targetSlide - slideCount;
  1885. } else if (targetSlide < options.currentSlide && direction === "right") {
  1886. targetSlide = targetSlide + slideCount;
  1887. }
  1888. }
  1889. } else if (options.message === "index") {
  1890. targetSlide = Number(options.index);
  1891. }
  1892. return targetSlide;
  1893. };
  1894. var keyHandler = function keyHandler(e, accessibility, rtl) {
  1895. if (e.target.tagName.match("TEXTAREA|INPUT|SELECT") || !accessibility) return "";
  1896. if (e.keyCode === 37) return rtl ? "next" : "previous";
  1897. if (e.keyCode === 39) return rtl ? "previous" : "next";
  1898. return "";
  1899. };
  1900. var swipeStart = function swipeStart(e, swipe, draggable) {
  1901. e.target.tagName === "IMG" && safePreventDefault(e);
  1902. if (!swipe || !draggable && e.type.indexOf("mouse") !== -1) return "";
  1903. return {
  1904. dragging: true,
  1905. touchObject: {
  1906. startX: e.touches ? e.touches[0].pageX : e.clientX,
  1907. startY: e.touches ? e.touches[0].pageY : e.clientY,
  1908. curX: e.touches ? e.touches[0].pageX : e.clientX,
  1909. curY: e.touches ? e.touches[0].pageY : e.clientY
  1910. }
  1911. };
  1912. };
  1913. var swipeMove = function swipeMove(e, spec) {
  1914. // spec also contains, trackRef and slideIndex
  1915. var scrolling = spec.scrolling,
  1916. animating = spec.animating,
  1917. vertical = spec.vertical,
  1918. swipeToSlide = spec.swipeToSlide,
  1919. verticalSwiping = spec.verticalSwiping,
  1920. rtl = spec.rtl,
  1921. currentSlide = spec.currentSlide,
  1922. edgeFriction = spec.edgeFriction,
  1923. edgeDragged = spec.edgeDragged,
  1924. onEdge = spec.onEdge,
  1925. swiped = spec.swiped,
  1926. swiping = spec.swiping,
  1927. slideCount = spec.slideCount,
  1928. slidesToScroll = spec.slidesToScroll,
  1929. infinite = spec.infinite,
  1930. touchObject = spec.touchObject,
  1931. swipeEvent = spec.swipeEvent,
  1932. listHeight = spec.listHeight,
  1933. listWidth = spec.listWidth;
  1934. if (scrolling) return;
  1935. if (animating) return safePreventDefault(e);
  1936. if (vertical && swipeToSlide && verticalSwiping) safePreventDefault(e);
  1937. var swipeLeft,
  1938. state = {};
  1939. var curLeft = getTrackLeft(spec);
  1940. touchObject.curX = e.touches ? e.touches[0].pageX : e.clientX;
  1941. touchObject.curY = e.touches ? e.touches[0].pageY : e.clientY;
  1942. touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curX - touchObject.startX, 2)));
  1943. var verticalSwipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curY - touchObject.startY, 2)));
  1944. if (!verticalSwiping && !swiping && verticalSwipeLength > 10) {
  1945. return {
  1946. scrolling: true
  1947. };
  1948. }
  1949. if (verticalSwiping) touchObject.swipeLength = verticalSwipeLength;
  1950. var positionOffset = (!rtl ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1);
  1951. if (verticalSwiping) positionOffset = touchObject.curY > touchObject.startY ? 1 : -1;
  1952. var dotCount = Math.ceil(slideCount / slidesToScroll);
  1953. var swipeDirection = getSwipeDirection(spec.touchObject, verticalSwiping);
  1954. var touchSwipeLength = touchObject.swipeLength;
  1955. if (!infinite) {
  1956. if (currentSlide === 0 && (swipeDirection === "right" || swipeDirection === "down") || currentSlide + 1 >= dotCount && (swipeDirection === "left" || swipeDirection === "up") || !canGoNext(spec) && (swipeDirection === "left" || swipeDirection === "up")) {
  1957. touchSwipeLength = touchObject.swipeLength * edgeFriction;
  1958. if (edgeDragged === false && onEdge) {
  1959. onEdge(swipeDirection);
  1960. state["edgeDragged"] = true;
  1961. }
  1962. }
  1963. }
  1964. if (!swiped && swipeEvent) {
  1965. swipeEvent(swipeDirection);
  1966. state["swiped"] = true;
  1967. }
  1968. if (!vertical) {
  1969. if (!rtl) {
  1970. swipeLeft = curLeft + touchSwipeLength * positionOffset;
  1971. } else {
  1972. swipeLeft = curLeft - touchSwipeLength * positionOffset;
  1973. }
  1974. } else {
  1975. swipeLeft = curLeft + touchSwipeLength * (listHeight / listWidth) * positionOffset;
  1976. }
  1977. if (verticalSwiping) {
  1978. swipeLeft = curLeft + touchSwipeLength * positionOffset;
  1979. }
  1980. state = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, state), {}, {
  1981. touchObject: touchObject,
  1982. swipeLeft: swipeLeft,
  1983. trackStyle: getTrackCSS(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  1984. left: swipeLeft
  1985. }))
  1986. });
  1987. if (Math.abs(touchObject.curX - touchObject.startX) < Math.abs(touchObject.curY - touchObject.startY) * 0.8) {
  1988. return state;
  1989. }
  1990. if (touchObject.swipeLength > 10) {
  1991. state["swiping"] = true;
  1992. safePreventDefault(e);
  1993. }
  1994. return state;
  1995. };
  1996. var swipeEnd = function swipeEnd(e, spec) {
  1997. var dragging = spec.dragging,
  1998. swipe = spec.swipe,
  1999. touchObject = spec.touchObject,
  2000. listWidth = spec.listWidth,
  2001. touchThreshold = spec.touchThreshold,
  2002. verticalSwiping = spec.verticalSwiping,
  2003. listHeight = spec.listHeight,
  2004. swipeToSlide = spec.swipeToSlide,
  2005. scrolling = spec.scrolling,
  2006. onSwipe = spec.onSwipe,
  2007. targetSlide = spec.targetSlide,
  2008. currentSlide = spec.currentSlide,
  2009. infinite = spec.infinite;
  2010. if (!dragging) {
  2011. if (swipe) safePreventDefault(e);
  2012. return {};
  2013. }
  2014. var minSwipe = verticalSwiping ? listHeight / touchThreshold : listWidth / touchThreshold;
  2015. var swipeDirection = getSwipeDirection(touchObject, verticalSwiping);
  2016. // reset the state of touch related state variables.
  2017. var state = {
  2018. dragging: false,
  2019. edgeDragged: false,
  2020. scrolling: false,
  2021. swiping: false,
  2022. swiped: false,
  2023. swipeLeft: null,
  2024. touchObject: {}
  2025. };
  2026. if (scrolling) {
  2027. return state;
  2028. }
  2029. if (!touchObject.swipeLength) {
  2030. return state;
  2031. }
  2032. if (touchObject.swipeLength > minSwipe) {
  2033. safePreventDefault(e);
  2034. if (onSwipe) {
  2035. onSwipe(swipeDirection);
  2036. }
  2037. var slideCount, newSlide;
  2038. var activeSlide = infinite ? currentSlide : targetSlide;
  2039. switch (swipeDirection) {
  2040. case "left":
  2041. case "up":
  2042. newSlide = activeSlide + getSlideCount(spec);
  2043. slideCount = swipeToSlide ? checkNavigable(spec, newSlide) : newSlide;
  2044. state["currentDirection"] = 0;
  2045. break;
  2046. case "right":
  2047. case "down":
  2048. newSlide = activeSlide - getSlideCount(spec);
  2049. slideCount = swipeToSlide ? checkNavigable(spec, newSlide) : newSlide;
  2050. state["currentDirection"] = 1;
  2051. break;
  2052. default:
  2053. slideCount = activeSlide;
  2054. }
  2055. state["triggerSlideHandler"] = slideCount;
  2056. } else {
  2057. // Adjust the track back to it's original position.
  2058. var currentLeft = getTrackLeft(spec);
  2059. state["trackStyle"] = getTrackAnimateCSS(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, spec), {}, {
  2060. left: currentLeft
  2061. }));
  2062. }
  2063. return state;
  2064. };
  2065. var getNavigableIndexes = function getNavigableIndexes(spec) {
  2066. var max = spec.infinite ? spec.slideCount * 2 : spec.slideCount;
  2067. var breakpoint = spec.infinite ? spec.slidesToShow * -1 : 0;
  2068. var counter = spec.infinite ? spec.slidesToShow * -1 : 0;
  2069. var indexes = [];
  2070. while (breakpoint < max) {
  2071. indexes.push(breakpoint);
  2072. breakpoint = counter + spec.slidesToScroll;
  2073. counter += Math.min(spec.slidesToScroll, spec.slidesToShow);
  2074. }
  2075. return indexes;
  2076. };
  2077. var checkNavigable = function checkNavigable(spec, index) {
  2078. var navigables = getNavigableIndexes(spec);
  2079. var prevNavigable = 0;
  2080. if (index > navigables[navigables.length - 1]) {
  2081. index = navigables[navigables.length - 1];
  2082. } else {
  2083. for (var n in navigables) {
  2084. if (index < navigables[n]) {
  2085. index = prevNavigable;
  2086. break;
  2087. }
  2088. prevNavigable = navigables[n];
  2089. }
  2090. }
  2091. return index;
  2092. };
  2093. var getSlideCount = function getSlideCount(spec) {
  2094. var centerOffset = spec.centerMode ? spec.slideWidth * Math.floor(spec.slidesToShow / 2) : 0;
  2095. if (spec.swipeToSlide) {
  2096. var swipedSlide;
  2097. var slickList = spec.listRef;
  2098. var slides = slickList.querySelectorAll && slickList.querySelectorAll(".slick-slide") || [];
  2099. Array.from(slides).every(function (slide) {
  2100. if (!spec.vertical) {
  2101. if (slide.offsetLeft - centerOffset + getWidth(slide) / 2 > spec.swipeLeft * -1) {
  2102. swipedSlide = slide;
  2103. return false;
  2104. }
  2105. } else {
  2106. if (slide.offsetTop + getHeight(slide) / 2 > spec.swipeLeft * -1) {
  2107. swipedSlide = slide;
  2108. return false;
  2109. }
  2110. }
  2111. return true;
  2112. });
  2113. if (!swipedSlide) {
  2114. return 0;
  2115. }
  2116. var currentIndex = spec.rtl === true ? spec.slideCount - spec.currentSlide : spec.currentSlide;
  2117. var slidesTraversed = Math.abs(swipedSlide.dataset.index - currentIndex) || 1;
  2118. return slidesTraversed;
  2119. } else {
  2120. return spec.slidesToScroll;
  2121. }
  2122. };
  2123. var checkSpecKeys = function checkSpecKeys(spec, keysArray) {
  2124. return (
  2125. // eslint-disable-next-line no-prototype-builtins
  2126. keysArray.reduce(function (value, key) {
  2127. return value && spec.hasOwnProperty(key);
  2128. }, true) ? null : console.error("Keys Missing:", spec)
  2129. );
  2130. };
  2131. var getTrackCSS = function getTrackCSS(spec) {
  2132. checkSpecKeys(spec, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth"]);
  2133. var trackWidth, trackHeight;
  2134. if (!spec.vertical) {
  2135. trackWidth = getTotalSlides(spec) * spec.slideWidth;
  2136. } else {
  2137. var trackChildren = spec.unslick ? spec.slideCount : spec.slideCount + 2 * spec.slidesToShow;
  2138. trackHeight = trackChildren * spec.slideHeight;
  2139. }
  2140. var style = {
  2141. opacity: 1,
  2142. transition: "",
  2143. WebkitTransition: ""
  2144. };
  2145. if (spec.useTransform) {
  2146. var WebkitTransform = !spec.vertical ? "translate3d(" + spec.left + "px, 0px, 0px)" : "translate3d(0px, " + spec.left + "px, 0px)";
  2147. var transform = !spec.vertical ? "translate3d(" + spec.left + "px, 0px, 0px)" : "translate3d(0px, " + spec.left + "px, 0px)";
  2148. var msTransform = !spec.vertical ? "translateX(" + spec.left + "px)" : "translateY(" + spec.left + "px)";
  2149. style = _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({}, style), {}, {
  2150. WebkitTransform: WebkitTransform,
  2151. transform: transform,
  2152. msTransform: msTransform
  2153. });
  2154. } else {
  2155. if (spec.vertical) {
  2156. style["top"] = spec.left;
  2157. } else {
  2158. style["left"] = spec.left;
  2159. }
  2160. }
  2161. if (spec.fade) style = {
  2162. opacity: 1
  2163. };
  2164. if (trackWidth) style.width = trackWidth;
  2165. if (trackHeight) style.height = trackHeight;
  2166. // Fallback for IE8
  2167. if (window && !window.addEventListener && window.attachEvent) {
  2168. if (!spec.vertical) {
  2169. style.marginLeft = spec.left + "px";
  2170. } else {
  2171. style.marginTop = spec.left + "px";
  2172. }
  2173. }
  2174. return style;
  2175. };
  2176. var getTrackAnimateCSS = function getTrackAnimateCSS(spec) {
  2177. checkSpecKeys(spec, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth", "speed", "cssEase"]);
  2178. var style = getTrackCSS(spec);
  2179. // useCSS is true by default so it can be undefined
  2180. if (spec.useTransform) {
  2181. style.WebkitTransition = "-webkit-transform " + spec.speed + "ms " + spec.cssEase;
  2182. style.transition = "transform " + spec.speed + "ms " + spec.cssEase;
  2183. } else {
  2184. if (spec.vertical) {
  2185. style.transition = "top " + spec.speed + "ms " + spec.cssEase;
  2186. } else {
  2187. style.transition = "left " + spec.speed + "ms " + spec.cssEase;
  2188. }
  2189. }
  2190. return style;
  2191. };
  2192. var getTrackLeft = function getTrackLeft(spec) {
  2193. if (spec.unslick) {
  2194. return 0;
  2195. }
  2196. checkSpecKeys(spec, ["slideIndex", "trackRef", "infinite", "centerMode", "slideCount", "slidesToShow", "slidesToScroll", "slideWidth", "listWidth", "variableWidth", "slideHeight"]);
  2197. var slideIndex = spec.slideIndex,
  2198. trackRef = spec.trackRef,
  2199. infinite = spec.infinite,
  2200. centerMode = spec.centerMode,
  2201. slideCount = spec.slideCount,
  2202. slidesToShow = spec.slidesToShow,
  2203. slidesToScroll = spec.slidesToScroll,
  2204. slideWidth = spec.slideWidth,
  2205. listWidth = spec.listWidth,
  2206. variableWidth = spec.variableWidth,
  2207. slideHeight = spec.slideHeight,
  2208. fade = spec.fade,
  2209. vertical = spec.vertical;
  2210. var slideOffset = 0;
  2211. var targetLeft;
  2212. var targetSlide;
  2213. var verticalOffset = 0;
  2214. if (fade || spec.slideCount === 1) {
  2215. return 0;
  2216. }
  2217. var slidesToOffset = 0;
  2218. if (infinite) {
  2219. slidesToOffset = -getPreClones(spec); // bring active slide to the beginning of visual area
  2220. // if next scroll doesn't have enough children, just reach till the end of original slides instead of shifting slidesToScroll children
  2221. if (slideCount % slidesToScroll !== 0 && slideIndex + slidesToScroll > slideCount) {
  2222. slidesToOffset = -(slideIndex > slideCount ? slidesToShow - (slideIndex - slideCount) : slideCount % slidesToScroll);
  2223. }
  2224. // shift current slide to center of the frame
  2225. if (centerMode) {
  2226. slidesToOffset += parseInt(slidesToShow / 2);
  2227. }
  2228. } else {
  2229. if (slideCount % slidesToScroll !== 0 && slideIndex + slidesToScroll > slideCount) {
  2230. slidesToOffset = slidesToShow - slideCount % slidesToScroll;
  2231. }
  2232. if (centerMode) {
  2233. slidesToOffset = parseInt(slidesToShow / 2);
  2234. }
  2235. }
  2236. slideOffset = slidesToOffset * slideWidth;
  2237. verticalOffset = slidesToOffset * slideHeight;
  2238. if (!vertical) {
  2239. targetLeft = slideIndex * slideWidth * -1 + slideOffset;
  2240. } else {
  2241. targetLeft = slideIndex * slideHeight * -1 + verticalOffset;
  2242. }
  2243. if (variableWidth === true) {
  2244. var targetSlideIndex;
  2245. var trackElem = trackRef && trackRef.node;
  2246. targetSlideIndex = slideIndex + getPreClones(spec);
  2247. targetSlide = trackElem && trackElem.childNodes[targetSlideIndex];
  2248. targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0;
  2249. if (centerMode === true) {
  2250. targetSlideIndex = infinite ? slideIndex + getPreClones(spec) : slideIndex;
  2251. targetSlide = trackElem && trackElem.children[targetSlideIndex];
  2252. targetLeft = 0;
  2253. for (var slide = 0; slide < targetSlideIndex; slide++) {
  2254. targetLeft -= trackElem && trackElem.children[slide] && trackElem.children[slide].offsetWidth;
  2255. }
  2256. targetLeft -= parseInt(spec.centerPadding);
  2257. targetLeft += targetSlide && (listWidth - targetSlide.offsetWidth) / 2;
  2258. }
  2259. }
  2260. return targetLeft;
  2261. };
  2262. var getPreClones = function getPreClones(spec) {
  2263. if (spec.unslick || !spec.infinite) {
  2264. return 0;
  2265. }
  2266. if (spec.variableWidth) {
  2267. return spec.slideCount;
  2268. }
  2269. return spec.slidesToShow + (spec.centerMode ? 1 : 0);
  2270. };
  2271. var getPostClones = function getPostClones(spec) {
  2272. if (spec.unslick || !spec.infinite) {
  2273. return 0;
  2274. }
  2275. return spec.slideCount;
  2276. };
  2277. var getTotalSlides = function getTotalSlides(spec) {
  2278. return spec.slideCount === 1 ? 1 : getPreClones(spec) + spec.slideCount + getPostClones(spec);
  2279. };
  2280. var siblingDirection = function siblingDirection(spec) {
  2281. if (spec.targetSlide > spec.currentSlide) {
  2282. if (spec.targetSlide > spec.currentSlide + slidesOnRight(spec)) {
  2283. return "left";
  2284. }
  2285. return "right";
  2286. } else {
  2287. if (spec.targetSlide < spec.currentSlide - slidesOnLeft(spec)) {
  2288. return "right";
  2289. }
  2290. return "left";
  2291. }
  2292. };
  2293. var slidesOnRight = function slidesOnRight(_ref) {
  2294. var slidesToShow = _ref.slidesToShow,
  2295. centerMode = _ref.centerMode,
  2296. rtl = _ref.rtl,
  2297. centerPadding = _ref.centerPadding;
  2298. // returns no of slides on the right of active slide
  2299. if (centerMode) {
  2300. var right = (slidesToShow - 1) / 2 + 1;
  2301. if (parseInt(centerPadding) > 0) right += 1;
  2302. if (rtl && slidesToShow % 2 === 0) right += 1;
  2303. return right;
  2304. }
  2305. if (rtl) {
  2306. return 0;
  2307. }
  2308. return slidesToShow - 1;
  2309. };
  2310. var slidesOnLeft = function slidesOnLeft(_ref2) {
  2311. var slidesToShow = _ref2.slidesToShow,
  2312. centerMode = _ref2.centerMode,
  2313. rtl = _ref2.rtl,
  2314. centerPadding = _ref2.centerPadding;
  2315. // returns no of slides on the left of active slide
  2316. if (centerMode) {
  2317. var left = (slidesToShow - 1) / 2 + 1;
  2318. if (parseInt(centerPadding) > 0) left += 1;
  2319. if (!rtl && slidesToShow % 2 === 0) left += 1;
  2320. return left;
  2321. }
  2322. if (rtl) {
  2323. return slidesToShow - 1;
  2324. }
  2325. return 0;
  2326. };
  2327. var canUseDOM = function canUseDOM() {
  2328. return !!(typeof window !== "undefined" && window.document && window.document.createElement);
  2329. };
  2330. var validSettings = Object.keys(_default_props__WEBPACK_IMPORTED_MODULE_2__["default"]);
  2331. function filterSettings(settings) {
  2332. return validSettings.reduce(function (acc, settingName) {
  2333. if (settings.hasOwnProperty(settingName)) {
  2334. acc[settingName] = settings[settingName];
  2335. }
  2336. return acc;
  2337. }, {});
  2338. }
  2339. /***/ }),
  2340. /* 24 */
  2341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2342. "use strict";
  2343. __webpack_require__.r(__webpack_exports__);
  2344. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
  2345. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  2346. var defaultProps = {
  2347. accessibility: true,
  2348. adaptiveHeight: false,
  2349. afterChange: null,
  2350. appendDots: function appendDots(dots) {
  2351. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("ul", {
  2352. style: {
  2353. display: "block"
  2354. }
  2355. }, dots);
  2356. },
  2357. arrows: true,
  2358. autoplay: false,
  2359. autoplaySpeed: 3000,
  2360. beforeChange: null,
  2361. centerMode: false,
  2362. centerPadding: "50px",
  2363. className: "",
  2364. cssEase: "ease",
  2365. customPaging: function customPaging(i) {
  2366. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", null, i + 1);
  2367. },
  2368. dots: false,
  2369. dotsClass: "slick-dots",
  2370. draggable: true,
  2371. easing: "linear",
  2372. edgeFriction: 0.35,
  2373. fade: false,
  2374. focusOnSelect: false,
  2375. infinite: true,
  2376. initialSlide: 0,
  2377. lazyLoad: null,
  2378. nextArrow: null,
  2379. onEdge: null,
  2380. onInit: null,
  2381. onLazyLoadError: null,
  2382. onReInit: null,
  2383. pauseOnDotsHover: false,
  2384. pauseOnFocus: false,
  2385. pauseOnHover: true,
  2386. prevArrow: null,
  2387. responsive: null,
  2388. rows: 1,
  2389. rtl: false,
  2390. slide: "div",
  2391. slidesPerRow: 1,
  2392. slidesToScroll: 1,
  2393. slidesToShow: 1,
  2394. speed: 500,
  2395. swipe: true,
  2396. swipeEvent: null,
  2397. swipeToSlide: false,
  2398. touchMove: true,
  2399. touchThreshold: 5,
  2400. useCSS: true,
  2401. useTransform: true,
  2402. variableWidth: false,
  2403. vertical: false,
  2404. waitForAnimate: true,
  2405. asNavFor: null
  2406. };
  2407. /* harmony default export */ __webpack_exports__["default"] = (defaultProps);
  2408. /***/ }),
  2409. /* 25 */
  2410. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2411. "use strict";
  2412. __webpack_require__.r(__webpack_exports__);
  2413. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Track", function() { return Track; });
  2414. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
  2415. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
  2416. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
  2417. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  2418. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
  2419. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
  2420. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
  2421. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2422. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12);
  2423. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4__);
  2424. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13);
  2425. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
  2426. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(14);
  2427. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__);
  2428. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4);
  2429. /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__);
  2430. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3);
  2431. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8__);
  2432. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(16);
  2433. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_9__);
  2434. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(22);
  2435. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__);
  2436. /* harmony import */ var _utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(23);
  2437. function _callSuper(t, o, e) { return o = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(o), _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(t, _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4___default()() ? Reflect.construct(o, e || [], _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(t).constructor) : o.apply(t, e)); }
  2438. // given specifications/props for a slide, fetch all the classes that need to be applied to the slide
  2439. var getSlideClasses = function getSlideClasses(spec) {
  2440. var slickActive, slickCenter, slickCloned;
  2441. var centerOffset, index;
  2442. if (spec.rtl) {
  2443. index = spec.slideCount - 1 - spec.index;
  2444. } else {
  2445. index = spec.index;
  2446. }
  2447. slickCloned = index < 0 || index >= spec.slideCount;
  2448. if (spec.centerMode) {
  2449. centerOffset = Math.floor(spec.slidesToShow / 2);
  2450. slickCenter = (index - spec.currentSlide) % spec.slideCount === 0;
  2451. if (index > spec.currentSlide - centerOffset - 1 && index <= spec.currentSlide + centerOffset) {
  2452. slickActive = true;
  2453. }
  2454. } else {
  2455. slickActive = spec.currentSlide <= index && index < spec.currentSlide + spec.slidesToShow;
  2456. }
  2457. var focusedSlide;
  2458. if (spec.targetSlide < 0) {
  2459. focusedSlide = spec.targetSlide + spec.slideCount;
  2460. } else if (spec.targetSlide >= spec.slideCount) {
  2461. focusedSlide = spec.targetSlide - spec.slideCount;
  2462. } else {
  2463. focusedSlide = spec.targetSlide;
  2464. }
  2465. var slickCurrent = index === focusedSlide;
  2466. return {
  2467. "slick-slide": true,
  2468. "slick-active": slickActive,
  2469. "slick-center": slickCenter,
  2470. "slick-cloned": slickCloned,
  2471. "slick-current": slickCurrent // dubious in case of RTL
  2472. };
  2473. };
  2474. var getSlideStyle = function getSlideStyle(spec) {
  2475. var style = {};
  2476. if (spec.variableWidth === undefined || spec.variableWidth === false) {
  2477. style.width = spec.slideWidth;
  2478. }
  2479. if (spec.fade) {
  2480. style.position = "relative";
  2481. if (spec.vertical && spec.slideHeight) {
  2482. style.top = -spec.index * parseInt(spec.slideHeight);
  2483. } else {
  2484. style.left = -spec.index * parseInt(spec.slideWidth);
  2485. }
  2486. style.opacity = spec.currentSlide === spec.index ? 1 : 0;
  2487. style.zIndex = spec.currentSlide === spec.index ? 999 : 998;
  2488. if (spec.useCSS) {
  2489. style.transition = "opacity " + spec.speed + "ms " + spec.cssEase + ", " + "visibility " + spec.speed + "ms " + spec.cssEase;
  2490. }
  2491. }
  2492. return style;
  2493. };
  2494. var getKey = function getKey(child, fallbackKey) {
  2495. return child.key + "-" + fallbackKey;
  2496. };
  2497. var renderSlides = function renderSlides(spec) {
  2498. var key;
  2499. var slides = [];
  2500. var preCloneSlides = [];
  2501. var postCloneSlides = [];
  2502. var childrenCount = react__WEBPACK_IMPORTED_MODULE_9___default.a.Children.count(spec.children);
  2503. var startIndex = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_11__["lazyStartIndex"])(spec);
  2504. var endIndex = Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_11__["lazyEndIndex"])(spec);
  2505. react__WEBPACK_IMPORTED_MODULE_9___default.a.Children.forEach(spec.children, function (elem, index) {
  2506. var child;
  2507. var childOnClickOptions = {
  2508. message: "children",
  2509. index: index,
  2510. slidesToScroll: spec.slidesToScroll,
  2511. currentSlide: spec.currentSlide
  2512. };
  2513. // in case of lazyLoad, whether or not we want to fetch the slide
  2514. if (!spec.lazyLoad || spec.lazyLoad && spec.lazyLoadedList.indexOf(index) >= 0) {
  2515. child = elem;
  2516. } else {
  2517. child = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("div", null);
  2518. }
  2519. var childStyle = getSlideStyle(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()({}, spec), {}, {
  2520. index: index
  2521. }));
  2522. var slideClass = child.props.className || "";
  2523. var slideClasses = getSlideClasses(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()({}, spec), {}, {
  2524. index: index
  2525. }));
  2526. // push a cloned element of the desired slide
  2527. slides.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.cloneElement(child, {
  2528. key: "original" + getKey(child, index),
  2529. "data-index": index,
  2530. className: classnames__WEBPACK_IMPORTED_MODULE_10___default()(slideClasses, slideClass),
  2531. tabIndex: "-1",
  2532. "aria-hidden": !slideClasses["slick-active"],
  2533. style: _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()({
  2534. outline: "none"
  2535. }, child.props.style || {}), childStyle),
  2536. onClick: function onClick(e) {
  2537. child.props && child.props.onClick && child.props.onClick(e);
  2538. if (spec.focusOnSelect) {
  2539. spec.focusOnSelect(childOnClickOptions);
  2540. }
  2541. }
  2542. }));
  2543. // if slide needs to be precloned or postcloned
  2544. if (spec.infinite && childrenCount > 1 && spec.fade === false && !spec.unslick) {
  2545. var preCloneNo = childrenCount - index;
  2546. if (preCloneNo <= Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_11__["getPreClones"])(spec)) {
  2547. key = -preCloneNo;
  2548. if (key >= startIndex) {
  2549. child = elem;
  2550. }
  2551. slideClasses = getSlideClasses(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()({}, spec), {}, {
  2552. index: key
  2553. }));
  2554. preCloneSlides.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.cloneElement(child, {
  2555. key: "precloned" + getKey(child, key),
  2556. "data-index": key,
  2557. tabIndex: "-1",
  2558. className: classnames__WEBPACK_IMPORTED_MODULE_10___default()(slideClasses, slideClass),
  2559. "aria-hidden": !slideClasses["slick-active"],
  2560. style: _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props.style || {}), childStyle),
  2561. onClick: function onClick(e) {
  2562. child.props && child.props.onClick && child.props.onClick(e);
  2563. if (spec.focusOnSelect) {
  2564. spec.focusOnSelect(childOnClickOptions);
  2565. }
  2566. }
  2567. }));
  2568. }
  2569. key = childrenCount + index;
  2570. if (key < endIndex) {
  2571. child = elem;
  2572. }
  2573. slideClasses = getSlideClasses(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()({}, spec), {}, {
  2574. index: key
  2575. }));
  2576. postCloneSlides.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.cloneElement(child, {
  2577. key: "postcloned" + getKey(child, key),
  2578. "data-index": key,
  2579. tabIndex: "-1",
  2580. className: classnames__WEBPACK_IMPORTED_MODULE_10___default()(slideClasses, slideClass),
  2581. "aria-hidden": !slideClasses["slick-active"],
  2582. style: _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_8___default()({}, child.props.style || {}), childStyle),
  2583. onClick: function onClick(e) {
  2584. child.props && child.props.onClick && child.props.onClick(e);
  2585. if (spec.focusOnSelect) {
  2586. spec.focusOnSelect(childOnClickOptions);
  2587. }
  2588. }
  2589. }));
  2590. }
  2591. });
  2592. if (spec.rtl) {
  2593. return preCloneSlides.concat(slides, postCloneSlides).reverse();
  2594. } else {
  2595. return preCloneSlides.concat(slides, postCloneSlides);
  2596. }
  2597. };
  2598. var Track = /*#__PURE__*/function (_React$PureComponent) {
  2599. function Track() {
  2600. var _this;
  2601. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Track);
  2602. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  2603. args[_key] = arguments[_key];
  2604. }
  2605. _this = _callSuper(this, Track, [].concat(args));
  2606. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_this, "node", null);
  2607. _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(_this, "handleRef", function (ref) {
  2608. _this.node = ref;
  2609. });
  2610. return _this;
  2611. }
  2612. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default()(Track, _React$PureComponent);
  2613. return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Track, [{
  2614. key: "render",
  2615. value: function render() {
  2616. var slides = renderSlides(this.props);
  2617. var _this$props = this.props,
  2618. onMouseEnter = _this$props.onMouseEnter,
  2619. onMouseOver = _this$props.onMouseOver,
  2620. onMouseLeave = _this$props.onMouseLeave;
  2621. var mouseEvents = {
  2622. onMouseEnter: onMouseEnter,
  2623. onMouseOver: onMouseOver,
  2624. onMouseLeave: onMouseLeave
  2625. };
  2626. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement("div", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
  2627. ref: this.handleRef,
  2628. className: "slick-track",
  2629. style: this.props.trackStyle
  2630. }, mouseEvents), slides);
  2631. }
  2632. }]);
  2633. }(react__WEBPACK_IMPORTED_MODULE_9___default.a.PureComponent);
  2634. /***/ }),
  2635. /* 26 */
  2636. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2637. "use strict";
  2638. __webpack_require__.r(__webpack_exports__);
  2639. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dots", function() { return Dots; });
  2640. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
  2641. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0__);
  2642. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
  2643. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
  2644. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9);
  2645. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
  2646. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
  2647. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
  2648. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12);
  2649. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4__);
  2650. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13);
  2651. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
  2652. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(14);
  2653. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__);
  2654. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16);
  2655. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
  2656. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22);
  2657. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__);
  2658. /* harmony import */ var _utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23);
  2659. function _callSuper(t, o, e) { return o = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(o), _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(t, _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_4___default()() ? Reflect.construct(o, e || [], _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(t).constructor) : o.apply(t, e)); }
  2660. var getDotCount = function getDotCount(spec) {
  2661. var dots;
  2662. if (spec.infinite) {
  2663. dots = Math.ceil(spec.slideCount / spec.slidesToScroll);
  2664. } else {
  2665. dots = Math.ceil((spec.slideCount - spec.slidesToShow) / spec.slidesToScroll) + 1;
  2666. }
  2667. return dots;
  2668. };
  2669. var Dots = /*#__PURE__*/function (_React$PureComponent) {
  2670. function Dots() {
  2671. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Dots);
  2672. return _callSuper(this, Dots, arguments);
  2673. }
  2674. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default()(Dots, _React$PureComponent);
  2675. return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Dots, [{
  2676. key: "clickHandler",
  2677. value: function clickHandler(options, e) {
  2678. // In Autoplay the focus stays on clicked button even after transition
  2679. // to next slide. That only goes away by click somewhere outside
  2680. e.preventDefault();
  2681. this.props.clickHandler(options);
  2682. }
  2683. }, {
  2684. key: "render",
  2685. value: function render() {
  2686. var _this$props = this.props,
  2687. onMouseEnter = _this$props.onMouseEnter,
  2688. onMouseOver = _this$props.onMouseOver,
  2689. onMouseLeave = _this$props.onMouseLeave,
  2690. infinite = _this$props.infinite,
  2691. slidesToScroll = _this$props.slidesToScroll,
  2692. slidesToShow = _this$props.slidesToShow,
  2693. slideCount = _this$props.slideCount,
  2694. currentSlide = _this$props.currentSlide;
  2695. var dotCount = getDotCount({
  2696. slideCount: slideCount,
  2697. slidesToScroll: slidesToScroll,
  2698. slidesToShow: slidesToShow,
  2699. infinite: infinite
  2700. });
  2701. var mouseEvents = {
  2702. onMouseEnter: onMouseEnter,
  2703. onMouseOver: onMouseOver,
  2704. onMouseLeave: onMouseLeave
  2705. };
  2706. var dots = [];
  2707. for (var i = 0; i < dotCount; i++) {
  2708. var _rightBound = (i + 1) * slidesToScroll - 1;
  2709. var rightBound = infinite ? _rightBound : Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_9__["clamp"])(_rightBound, 0, slideCount - 1);
  2710. var _leftBound = rightBound - (slidesToScroll - 1);
  2711. var leftBound = infinite ? _leftBound : Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_9__["clamp"])(_leftBound, 0, slideCount - 1);
  2712. var className = classnames__WEBPACK_IMPORTED_MODULE_8___default()({
  2713. "slick-active": infinite ? currentSlide >= leftBound && currentSlide <= rightBound : currentSlide === leftBound
  2714. });
  2715. var dotOptions = {
  2716. message: "dots",
  2717. index: i,
  2718. slidesToScroll: slidesToScroll,
  2719. currentSlide: currentSlide
  2720. };
  2721. var onClick = this.clickHandler.bind(this, dotOptions);
  2722. dots = dots.concat( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("li", {
  2723. key: i,
  2724. className: className
  2725. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default.a.cloneElement(this.props.customPaging(i), {
  2726. onClick: onClick
  2727. })));
  2728. }
  2729. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default.a.cloneElement(this.props.appendDots(dots), _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_0___default()({
  2730. className: this.props.dotsClass
  2731. }, mouseEvents));
  2732. }
  2733. }]);
  2734. }(react__WEBPACK_IMPORTED_MODULE_7___default.a.PureComponent);
  2735. /***/ }),
  2736. /* 27 */
  2737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2738. "use strict";
  2739. __webpack_require__.r(__webpack_exports__);
  2740. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrevArrow", function() { return PrevArrow; });
  2741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NextArrow", function() { return NextArrow; });
  2742. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
  2743. /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
  2744. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
  2745. /* harmony import */ var _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1__);
  2746. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
  2747. /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);
  2748. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
  2749. /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);
  2750. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
  2751. /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
  2752. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);
  2753. /* harmony import */ var _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5__);
  2754. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(13);
  2755. /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
  2756. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14);
  2757. /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7__);
  2758. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16);
  2759. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);
  2760. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22);
  2761. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_9__);
  2762. /* harmony import */ var _utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23);
  2763. function _callSuper(t, o, e) { return o = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(o), _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(t, _babel_runtime_helpers_isNativeReflectConstruct__WEBPACK_IMPORTED_MODULE_5___default()() ? Reflect.construct(o, e || [], _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(t).constructor) : o.apply(t, e)); }
  2764. var PrevArrow = /*#__PURE__*/function (_React$PureComponent) {
  2765. function PrevArrow() {
  2766. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, PrevArrow);
  2767. return _callSuper(this, PrevArrow, arguments);
  2768. }
  2769. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default()(PrevArrow, _React$PureComponent);
  2770. return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(PrevArrow, [{
  2771. key: "clickHandler",
  2772. value: function clickHandler(options, e) {
  2773. if (e) {
  2774. e.preventDefault();
  2775. }
  2776. this.props.clickHandler(options, e);
  2777. }
  2778. }, {
  2779. key: "render",
  2780. value: function render() {
  2781. var prevClasses = {
  2782. "slick-arrow": true,
  2783. "slick-prev": true
  2784. };
  2785. var prevHandler = this.clickHandler.bind(this, {
  2786. message: "previous"
  2787. });
  2788. if (!this.props.infinite && (this.props.currentSlide === 0 || this.props.slideCount <= this.props.slidesToShow)) {
  2789. prevClasses["slick-disabled"] = true;
  2790. prevHandler = null;
  2791. }
  2792. var prevArrowProps = {
  2793. key: "0",
  2794. "data-role": "none",
  2795. className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(prevClasses),
  2796. style: {
  2797. display: "block"
  2798. },
  2799. onClick: prevHandler
  2800. };
  2801. var customProps = {
  2802. currentSlide: this.props.currentSlide,
  2803. slideCount: this.props.slideCount
  2804. };
  2805. var prevArrow;
  2806. if (this.props.prevArrow) {
  2807. prevArrow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.cloneElement(this.props.prevArrow, _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()({}, prevArrowProps), customProps));
  2808. } else {
  2809. prevArrow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("button", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
  2810. key: "0",
  2811. type: "button"
  2812. }, prevArrowProps), " ", "Previous");
  2813. }
  2814. return prevArrow;
  2815. }
  2816. }]);
  2817. }(react__WEBPACK_IMPORTED_MODULE_8___default.a.PureComponent);
  2818. var NextArrow = /*#__PURE__*/function (_React$PureComponent2) {
  2819. function NextArrow() {
  2820. _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, NextArrow);
  2821. return _callSuper(this, NextArrow, arguments);
  2822. }
  2823. _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_7___default()(NextArrow, _React$PureComponent2);
  2824. return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(NextArrow, [{
  2825. key: "clickHandler",
  2826. value: function clickHandler(options, e) {
  2827. if (e) {
  2828. e.preventDefault();
  2829. }
  2830. this.props.clickHandler(options, e);
  2831. }
  2832. }, {
  2833. key: "render",
  2834. value: function render() {
  2835. var nextClasses = {
  2836. "slick-arrow": true,
  2837. "slick-next": true
  2838. };
  2839. var nextHandler = this.clickHandler.bind(this, {
  2840. message: "next"
  2841. });
  2842. if (!Object(_utils_innerSliderUtils__WEBPACK_IMPORTED_MODULE_10__["canGoNext"])(this.props)) {
  2843. nextClasses["slick-disabled"] = true;
  2844. nextHandler = null;
  2845. }
  2846. var nextArrowProps = {
  2847. key: "1",
  2848. "data-role": "none",
  2849. className: classnames__WEBPACK_IMPORTED_MODULE_9___default()(nextClasses),
  2850. style: {
  2851. display: "block"
  2852. },
  2853. onClick: nextHandler
  2854. };
  2855. var customProps = {
  2856. currentSlide: this.props.currentSlide,
  2857. slideCount: this.props.slideCount
  2858. };
  2859. var nextArrow;
  2860. if (this.props.nextArrow) {
  2861. nextArrow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.cloneElement(this.props.nextArrow, _babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()(_babel_runtime_helpers_objectSpread2__WEBPACK_IMPORTED_MODULE_1___default()({}, nextArrowProps), customProps));
  2862. } else {
  2863. nextArrow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("button", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
  2864. key: "1",
  2865. type: "button"
  2866. }, nextArrowProps), " ", "Next");
  2867. }
  2868. return nextArrow;
  2869. }
  2870. }]);
  2871. }(react__WEBPACK_IMPORTED_MODULE_8___default.a.PureComponent);
  2872. /***/ }),
  2873. /* 28 */
  2874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2875. "use strict";
  2876. __webpack_require__.r(__webpack_exports__);
  2877. /* WEBPACK VAR INJECTION */(function(global) {/**
  2878. * A collection of shims that provide minimal functionality of the ES6 collections.
  2879. *
  2880. * These implementations are not meant to be used outside of the ResizeObserver
  2881. * modules as they cover only a limited range of use cases.
  2882. */
  2883. /* eslint-disable require-jsdoc, valid-jsdoc */
  2884. var MapShim = (function () {
  2885. if (typeof Map !== 'undefined') {
  2886. return Map;
  2887. }
  2888. /**
  2889. * Returns index in provided array that matches the specified key.
  2890. *
  2891. * @param {Array<Array>} arr
  2892. * @param {*} key
  2893. * @returns {number}
  2894. */
  2895. function getIndex(arr, key) {
  2896. var result = -1;
  2897. arr.some(function (entry, index) {
  2898. if (entry[0] === key) {
  2899. result = index;
  2900. return true;
  2901. }
  2902. return false;
  2903. });
  2904. return result;
  2905. }
  2906. return /** @class */ (function () {
  2907. function class_1() {
  2908. this.__entries__ = [];
  2909. }
  2910. Object.defineProperty(class_1.prototype, "size", {
  2911. /**
  2912. * @returns {boolean}
  2913. */
  2914. get: function () {
  2915. return this.__entries__.length;
  2916. },
  2917. enumerable: true,
  2918. configurable: true
  2919. });
  2920. /**
  2921. * @param {*} key
  2922. * @returns {*}
  2923. */
  2924. class_1.prototype.get = function (key) {
  2925. var index = getIndex(this.__entries__, key);
  2926. var entry = this.__entries__[index];
  2927. return entry && entry[1];
  2928. };
  2929. /**
  2930. * @param {*} key
  2931. * @param {*} value
  2932. * @returns {void}
  2933. */
  2934. class_1.prototype.set = function (key, value) {
  2935. var index = getIndex(this.__entries__, key);
  2936. if (~index) {
  2937. this.__entries__[index][1] = value;
  2938. }
  2939. else {
  2940. this.__entries__.push([key, value]);
  2941. }
  2942. };
  2943. /**
  2944. * @param {*} key
  2945. * @returns {void}
  2946. */
  2947. class_1.prototype.delete = function (key) {
  2948. var entries = this.__entries__;
  2949. var index = getIndex(entries, key);
  2950. if (~index) {
  2951. entries.splice(index, 1);
  2952. }
  2953. };
  2954. /**
  2955. * @param {*} key
  2956. * @returns {void}
  2957. */
  2958. class_1.prototype.has = function (key) {
  2959. return !!~getIndex(this.__entries__, key);
  2960. };
  2961. /**
  2962. * @returns {void}
  2963. */
  2964. class_1.prototype.clear = function () {
  2965. this.__entries__.splice(0);
  2966. };
  2967. /**
  2968. * @param {Function} callback
  2969. * @param {*} [ctx=null]
  2970. * @returns {void}
  2971. */
  2972. class_1.prototype.forEach = function (callback, ctx) {
  2973. if (ctx === void 0) { ctx = null; }
  2974. for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
  2975. var entry = _a[_i];
  2976. callback.call(ctx, entry[1], entry[0]);
  2977. }
  2978. };
  2979. return class_1;
  2980. }());
  2981. })();
  2982. /**
  2983. * Detects whether window and document objects are available in current environment.
  2984. */
  2985. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
  2986. // Returns global object of a current environment.
  2987. var global$1 = (function () {
  2988. if (typeof global !== 'undefined' && global.Math === Math) {
  2989. return global;
  2990. }
  2991. if (typeof self !== 'undefined' && self.Math === Math) {
  2992. return self;
  2993. }
  2994. if (typeof window !== 'undefined' && window.Math === Math) {
  2995. return window;
  2996. }
  2997. // eslint-disable-next-line no-new-func
  2998. return Function('return this')();
  2999. })();
  3000. /**
  3001. * A shim for the requestAnimationFrame which falls back to the setTimeout if
  3002. * first one is not supported.
  3003. *
  3004. * @returns {number} Requests' identifier.
  3005. */
  3006. var requestAnimationFrame$1 = (function () {
  3007. if (typeof requestAnimationFrame === 'function') {
  3008. // It's required to use a bounded function because IE sometimes throws
  3009. // an "Invalid calling object" error if rAF is invoked without the global
  3010. // object on the left hand side.
  3011. return requestAnimationFrame.bind(global$1);
  3012. }
  3013. return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
  3014. })();
  3015. // Defines minimum timeout before adding a trailing call.
  3016. var trailingTimeout = 2;
  3017. /**
  3018. * Creates a wrapper function which ensures that provided callback will be
  3019. * invoked only once during the specified delay period.
  3020. *
  3021. * @param {Function} callback - Function to be invoked after the delay period.
  3022. * @param {number} delay - Delay after which to invoke callback.
  3023. * @returns {Function}
  3024. */
  3025. function throttle (callback, delay) {
  3026. var leadingCall = false, trailingCall = false, lastCallTime = 0;
  3027. /**
  3028. * Invokes the original callback function and schedules new invocation if
  3029. * the "proxy" was called during current request.
  3030. *
  3031. * @returns {void}
  3032. */
  3033. function resolvePending() {
  3034. if (leadingCall) {
  3035. leadingCall = false;
  3036. callback();
  3037. }
  3038. if (trailingCall) {
  3039. proxy();
  3040. }
  3041. }
  3042. /**
  3043. * Callback invoked after the specified delay. It will further postpone
  3044. * invocation of the original function delegating it to the
  3045. * requestAnimationFrame.
  3046. *
  3047. * @returns {void}
  3048. */
  3049. function timeoutCallback() {
  3050. requestAnimationFrame$1(resolvePending);
  3051. }
  3052. /**
  3053. * Schedules invocation of the original function.
  3054. *
  3055. * @returns {void}
  3056. */
  3057. function proxy() {
  3058. var timeStamp = Date.now();
  3059. if (leadingCall) {
  3060. // Reject immediately following calls.
  3061. if (timeStamp - lastCallTime < trailingTimeout) {
  3062. return;
  3063. }
  3064. // Schedule new call to be in invoked when the pending one is resolved.
  3065. // This is important for "transitions" which never actually start
  3066. // immediately so there is a chance that we might miss one if change
  3067. // happens amids the pending invocation.
  3068. trailingCall = true;
  3069. }
  3070. else {
  3071. leadingCall = true;
  3072. trailingCall = false;
  3073. setTimeout(timeoutCallback, delay);
  3074. }
  3075. lastCallTime = timeStamp;
  3076. }
  3077. return proxy;
  3078. }
  3079. // Minimum delay before invoking the update of observers.
  3080. var REFRESH_DELAY = 20;
  3081. // A list of substrings of CSS properties used to find transition events that
  3082. // might affect dimensions of observed elements.
  3083. var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
  3084. // Check if MutationObserver is available.
  3085. var mutationObserverSupported = typeof MutationObserver !== 'undefined';
  3086. /**
  3087. * Singleton controller class which handles updates of ResizeObserver instances.
  3088. */
  3089. var ResizeObserverController = /** @class */ (function () {
  3090. /**
  3091. * Creates a new instance of ResizeObserverController.
  3092. *
  3093. * @private
  3094. */
  3095. function ResizeObserverController() {
  3096. /**
  3097. * Indicates whether DOM listeners have been added.
  3098. *
  3099. * @private {boolean}
  3100. */
  3101. this.connected_ = false;
  3102. /**
  3103. * Tells that controller has subscribed for Mutation Events.
  3104. *
  3105. * @private {boolean}
  3106. */
  3107. this.mutationEventsAdded_ = false;
  3108. /**
  3109. * Keeps reference to the instance of MutationObserver.
  3110. *
  3111. * @private {MutationObserver}
  3112. */
  3113. this.mutationsObserver_ = null;
  3114. /**
  3115. * A list of connected observers.
  3116. *
  3117. * @private {Array<ResizeObserverSPI>}
  3118. */
  3119. this.observers_ = [];
  3120. this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
  3121. this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
  3122. }
  3123. /**
  3124. * Adds observer to observers list.
  3125. *
  3126. * @param {ResizeObserverSPI} observer - Observer to be added.
  3127. * @returns {void}
  3128. */
  3129. ResizeObserverController.prototype.addObserver = function (observer) {
  3130. if (!~this.observers_.indexOf(observer)) {
  3131. this.observers_.push(observer);
  3132. }
  3133. // Add listeners if they haven't been added yet.
  3134. if (!this.connected_) {
  3135. this.connect_();
  3136. }
  3137. };
  3138. /**
  3139. * Removes observer from observers list.
  3140. *
  3141. * @param {ResizeObserverSPI} observer - Observer to be removed.
  3142. * @returns {void}
  3143. */
  3144. ResizeObserverController.prototype.removeObserver = function (observer) {
  3145. var observers = this.observers_;
  3146. var index = observers.indexOf(observer);
  3147. // Remove observer if it's present in registry.
  3148. if (~index) {
  3149. observers.splice(index, 1);
  3150. }
  3151. // Remove listeners if controller has no connected observers.
  3152. if (!observers.length && this.connected_) {
  3153. this.disconnect_();
  3154. }
  3155. };
  3156. /**
  3157. * Invokes the update of observers. It will continue running updates insofar
  3158. * it detects changes.
  3159. *
  3160. * @returns {void}
  3161. */
  3162. ResizeObserverController.prototype.refresh = function () {
  3163. var changesDetected = this.updateObservers_();
  3164. // Continue running updates if changes have been detected as there might
  3165. // be future ones caused by CSS transitions.
  3166. if (changesDetected) {
  3167. this.refresh();
  3168. }
  3169. };
  3170. /**
  3171. * Updates every observer from observers list and notifies them of queued
  3172. * entries.
  3173. *
  3174. * @private
  3175. * @returns {boolean} Returns "true" if any observer has detected changes in
  3176. * dimensions of it's elements.
  3177. */
  3178. ResizeObserverController.prototype.updateObservers_ = function () {
  3179. // Collect observers that have active observations.
  3180. var activeObservers = this.observers_.filter(function (observer) {
  3181. return observer.gatherActive(), observer.hasActive();
  3182. });
  3183. // Deliver notifications in a separate cycle in order to avoid any
  3184. // collisions between observers, e.g. when multiple instances of
  3185. // ResizeObserver are tracking the same element and the callback of one
  3186. // of them changes content dimensions of the observed target. Sometimes
  3187. // this may result in notifications being blocked for the rest of observers.
  3188. activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
  3189. return activeObservers.length > 0;
  3190. };
  3191. /**
  3192. * Initializes DOM listeners.
  3193. *
  3194. * @private
  3195. * @returns {void}
  3196. */
  3197. ResizeObserverController.prototype.connect_ = function () {
  3198. // Do nothing if running in a non-browser environment or if listeners
  3199. // have been already added.
  3200. if (!isBrowser || this.connected_) {
  3201. return;
  3202. }
  3203. // Subscription to the "Transitionend" event is used as a workaround for
  3204. // delayed transitions. This way it's possible to capture at least the
  3205. // final state of an element.
  3206. document.addEventListener('transitionend', this.onTransitionEnd_);
  3207. window.addEventListener('resize', this.refresh);
  3208. if (mutationObserverSupported) {
  3209. this.mutationsObserver_ = new MutationObserver(this.refresh);
  3210. this.mutationsObserver_.observe(document, {
  3211. attributes: true,
  3212. childList: true,
  3213. characterData: true,
  3214. subtree: true
  3215. });
  3216. }
  3217. else {
  3218. document.addEventListener('DOMSubtreeModified', this.refresh);
  3219. this.mutationEventsAdded_ = true;
  3220. }
  3221. this.connected_ = true;
  3222. };
  3223. /**
  3224. * Removes DOM listeners.
  3225. *
  3226. * @private
  3227. * @returns {void}
  3228. */
  3229. ResizeObserverController.prototype.disconnect_ = function () {
  3230. // Do nothing if running in a non-browser environment or if listeners
  3231. // have been already removed.
  3232. if (!isBrowser || !this.connected_) {
  3233. return;
  3234. }
  3235. document.removeEventListener('transitionend', this.onTransitionEnd_);
  3236. window.removeEventListener('resize', this.refresh);
  3237. if (this.mutationsObserver_) {
  3238. this.mutationsObserver_.disconnect();
  3239. }
  3240. if (this.mutationEventsAdded_) {
  3241. document.removeEventListener('DOMSubtreeModified', this.refresh);
  3242. }
  3243. this.mutationsObserver_ = null;
  3244. this.mutationEventsAdded_ = false;
  3245. this.connected_ = false;
  3246. };
  3247. /**
  3248. * "Transitionend" event handler.
  3249. *
  3250. * @private
  3251. * @param {TransitionEvent} event
  3252. * @returns {void}
  3253. */
  3254. ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
  3255. var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
  3256. // Detect whether transition may affect dimensions of an element.
  3257. var isReflowProperty = transitionKeys.some(function (key) {
  3258. return !!~propertyName.indexOf(key);
  3259. });
  3260. if (isReflowProperty) {
  3261. this.refresh();
  3262. }
  3263. };
  3264. /**
  3265. * Returns instance of the ResizeObserverController.
  3266. *
  3267. * @returns {ResizeObserverController}
  3268. */
  3269. ResizeObserverController.getInstance = function () {
  3270. if (!this.instance_) {
  3271. this.instance_ = new ResizeObserverController();
  3272. }
  3273. return this.instance_;
  3274. };
  3275. /**
  3276. * Holds reference to the controller's instance.
  3277. *
  3278. * @private {ResizeObserverController}
  3279. */
  3280. ResizeObserverController.instance_ = null;
  3281. return ResizeObserverController;
  3282. }());
  3283. /**
  3284. * Defines non-writable/enumerable properties of the provided target object.
  3285. *
  3286. * @param {Object} target - Object for which to define properties.
  3287. * @param {Object} props - Properties to be defined.
  3288. * @returns {Object} Target object.
  3289. */
  3290. var defineConfigurable = (function (target, props) {
  3291. for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
  3292. var key = _a[_i];
  3293. Object.defineProperty(target, key, {
  3294. value: props[key],
  3295. enumerable: false,
  3296. writable: false,
  3297. configurable: true
  3298. });
  3299. }
  3300. return target;
  3301. });
  3302. /**
  3303. * Returns the global object associated with provided element.
  3304. *
  3305. * @param {Object} target
  3306. * @returns {Object}
  3307. */
  3308. var getWindowOf = (function (target) {
  3309. // Assume that the element is an instance of Node, which means that it
  3310. // has the "ownerDocument" property from which we can retrieve a
  3311. // corresponding global object.
  3312. var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
  3313. // Return the local global object if it's not possible extract one from
  3314. // provided element.
  3315. return ownerGlobal || global$1;
  3316. });
  3317. // Placeholder of an empty content rectangle.
  3318. var emptyRect = createRectInit(0, 0, 0, 0);
  3319. /**
  3320. * Converts provided string to a number.
  3321. *
  3322. * @param {number|string} value
  3323. * @returns {number}
  3324. */
  3325. function toFloat(value) {
  3326. return parseFloat(value) || 0;
  3327. }
  3328. /**
  3329. * Extracts borders size from provided styles.
  3330. *
  3331. * @param {CSSStyleDeclaration} styles
  3332. * @param {...string} positions - Borders positions (top, right, ...)
  3333. * @returns {number}
  3334. */
  3335. function getBordersSize(styles) {
  3336. var positions = [];
  3337. for (var _i = 1; _i < arguments.length; _i++) {
  3338. positions[_i - 1] = arguments[_i];
  3339. }
  3340. return positions.reduce(function (size, position) {
  3341. var value = styles['border-' + position + '-width'];
  3342. return size + toFloat(value);
  3343. }, 0);
  3344. }
  3345. /**
  3346. * Extracts paddings sizes from provided styles.
  3347. *
  3348. * @param {CSSStyleDeclaration} styles
  3349. * @returns {Object} Paddings box.
  3350. */
  3351. function getPaddings(styles) {
  3352. var positions = ['top', 'right', 'bottom', 'left'];
  3353. var paddings = {};
  3354. for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
  3355. var position = positions_1[_i];
  3356. var value = styles['padding-' + position];
  3357. paddings[position] = toFloat(value);
  3358. }
  3359. return paddings;
  3360. }
  3361. /**
  3362. * Calculates content rectangle of provided SVG element.
  3363. *
  3364. * @param {SVGGraphicsElement} target - Element content rectangle of which needs
  3365. * to be calculated.
  3366. * @returns {DOMRectInit}
  3367. */
  3368. function getSVGContentRect(target) {
  3369. var bbox = target.getBBox();
  3370. return createRectInit(0, 0, bbox.width, bbox.height);
  3371. }
  3372. /**
  3373. * Calculates content rectangle of provided HTMLElement.
  3374. *
  3375. * @param {HTMLElement} target - Element for which to calculate the content rectangle.
  3376. * @returns {DOMRectInit}
  3377. */
  3378. function getHTMLElementContentRect(target) {
  3379. // Client width & height properties can't be
  3380. // used exclusively as they provide rounded values.
  3381. var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
  3382. // By this condition we can catch all non-replaced inline, hidden and
  3383. // detached elements. Though elements with width & height properties less
  3384. // than 0.5 will be discarded as well.
  3385. //
  3386. // Without it we would need to implement separate methods for each of
  3387. // those cases and it's not possible to perform a precise and performance
  3388. // effective test for hidden elements. E.g. even jQuery's ':visible' filter
  3389. // gives wrong results for elements with width & height less than 0.5.
  3390. if (!clientWidth && !clientHeight) {
  3391. return emptyRect;
  3392. }
  3393. var styles = getWindowOf(target).getComputedStyle(target);
  3394. var paddings = getPaddings(styles);
  3395. var horizPad = paddings.left + paddings.right;
  3396. var vertPad = paddings.top + paddings.bottom;
  3397. // Computed styles of width & height are being used because they are the
  3398. // only dimensions available to JS that contain non-rounded values. It could
  3399. // be possible to utilize the getBoundingClientRect if only it's data wasn't
  3400. // affected by CSS transformations let alone paddings, borders and scroll bars.
  3401. var width = toFloat(styles.width), height = toFloat(styles.height);
  3402. // Width & height include paddings and borders when the 'border-box' box
  3403. // model is applied (except for IE).
  3404. if (styles.boxSizing === 'border-box') {
  3405. // Following conditions are required to handle Internet Explorer which
  3406. // doesn't include paddings and borders to computed CSS dimensions.
  3407. //
  3408. // We can say that if CSS dimensions + paddings are equal to the "client"
  3409. // properties then it's either IE, and thus we don't need to subtract
  3410. // anything, or an element merely doesn't have paddings/borders styles.
  3411. if (Math.round(width + horizPad) !== clientWidth) {
  3412. width -= getBordersSize(styles, 'left', 'right') + horizPad;
  3413. }
  3414. if (Math.round(height + vertPad) !== clientHeight) {
  3415. height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
  3416. }
  3417. }
  3418. // Following steps can't be applied to the document's root element as its
  3419. // client[Width/Height] properties represent viewport area of the window.
  3420. // Besides, it's as well not necessary as the <html> itself neither has
  3421. // rendered scroll bars nor it can be clipped.
  3422. if (!isDocumentElement(target)) {
  3423. // In some browsers (only in Firefox, actually) CSS width & height
  3424. // include scroll bars size which can be removed at this step as scroll
  3425. // bars are the only difference between rounded dimensions + paddings
  3426. // and "client" properties, though that is not always true in Chrome.
  3427. var vertScrollbar = Math.round(width + horizPad) - clientWidth;
  3428. var horizScrollbar = Math.round(height + vertPad) - clientHeight;
  3429. // Chrome has a rather weird rounding of "client" properties.
  3430. // E.g. for an element with content width of 314.2px it sometimes gives
  3431. // the client width of 315px and for the width of 314.7px it may give
  3432. // 314px. And it doesn't happen all the time. So just ignore this delta
  3433. // as a non-relevant.
  3434. if (Math.abs(vertScrollbar) !== 1) {
  3435. width -= vertScrollbar;
  3436. }
  3437. if (Math.abs(horizScrollbar) !== 1) {
  3438. height -= horizScrollbar;
  3439. }
  3440. }
  3441. return createRectInit(paddings.left, paddings.top, width, height);
  3442. }
  3443. /**
  3444. * Checks whether provided element is an instance of the SVGGraphicsElement.
  3445. *
  3446. * @param {Element} target - Element to be checked.
  3447. * @returns {boolean}
  3448. */
  3449. var isSVGGraphicsElement = (function () {
  3450. // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
  3451. // interface.
  3452. if (typeof SVGGraphicsElement !== 'undefined') {
  3453. return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
  3454. }
  3455. // If it's so, then check that element is at least an instance of the
  3456. // SVGElement and that it has the "getBBox" method.
  3457. // eslint-disable-next-line no-extra-parens
  3458. return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
  3459. typeof target.getBBox === 'function'); };
  3460. })();
  3461. /**
  3462. * Checks whether provided element is a document element (<html>).
  3463. *
  3464. * @param {Element} target - Element to be checked.
  3465. * @returns {boolean}
  3466. */
  3467. function isDocumentElement(target) {
  3468. return target === getWindowOf(target).document.documentElement;
  3469. }
  3470. /**
  3471. * Calculates an appropriate content rectangle for provided html or svg element.
  3472. *
  3473. * @param {Element} target - Element content rectangle of which needs to be calculated.
  3474. * @returns {DOMRectInit}
  3475. */
  3476. function getContentRect(target) {
  3477. if (!isBrowser) {
  3478. return emptyRect;
  3479. }
  3480. if (isSVGGraphicsElement(target)) {
  3481. return getSVGContentRect(target);
  3482. }
  3483. return getHTMLElementContentRect(target);
  3484. }
  3485. /**
  3486. * Creates rectangle with an interface of the DOMRectReadOnly.
  3487. * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
  3488. *
  3489. * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
  3490. * @returns {DOMRectReadOnly}
  3491. */
  3492. function createReadOnlyRect(_a) {
  3493. var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
  3494. // If DOMRectReadOnly is available use it as a prototype for the rectangle.
  3495. var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
  3496. var rect = Object.create(Constr.prototype);
  3497. // Rectangle's properties are not writable and non-enumerable.
  3498. defineConfigurable(rect, {
  3499. x: x, y: y, width: width, height: height,
  3500. top: y,
  3501. right: x + width,
  3502. bottom: height + y,
  3503. left: x
  3504. });
  3505. return rect;
  3506. }
  3507. /**
  3508. * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
  3509. * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
  3510. *
  3511. * @param {number} x - X coordinate.
  3512. * @param {number} y - Y coordinate.
  3513. * @param {number} width - Rectangle's width.
  3514. * @param {number} height - Rectangle's height.
  3515. * @returns {DOMRectInit}
  3516. */
  3517. function createRectInit(x, y, width, height) {
  3518. return { x: x, y: y, width: width, height: height };
  3519. }
  3520. /**
  3521. * Class that is responsible for computations of the content rectangle of
  3522. * provided DOM element and for keeping track of it's changes.
  3523. */
  3524. var ResizeObservation = /** @class */ (function () {
  3525. /**
  3526. * Creates an instance of ResizeObservation.
  3527. *
  3528. * @param {Element} target - Element to be observed.
  3529. */
  3530. function ResizeObservation(target) {
  3531. /**
  3532. * Broadcasted width of content rectangle.
  3533. *
  3534. * @type {number}
  3535. */
  3536. this.broadcastWidth = 0;
  3537. /**
  3538. * Broadcasted height of content rectangle.
  3539. *
  3540. * @type {number}
  3541. */
  3542. this.broadcastHeight = 0;
  3543. /**
  3544. * Reference to the last observed content rectangle.
  3545. *
  3546. * @private {DOMRectInit}
  3547. */
  3548. this.contentRect_ = createRectInit(0, 0, 0, 0);
  3549. this.target = target;
  3550. }
  3551. /**
  3552. * Updates content rectangle and tells whether it's width or height properties
  3553. * have changed since the last broadcast.
  3554. *
  3555. * @returns {boolean}
  3556. */
  3557. ResizeObservation.prototype.isActive = function () {
  3558. var rect = getContentRect(this.target);
  3559. this.contentRect_ = rect;
  3560. return (rect.width !== this.broadcastWidth ||
  3561. rect.height !== this.broadcastHeight);
  3562. };
  3563. /**
  3564. * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
  3565. * from the corresponding properties of the last observed content rectangle.
  3566. *
  3567. * @returns {DOMRectInit} Last observed content rectangle.
  3568. */
  3569. ResizeObservation.prototype.broadcastRect = function () {
  3570. var rect = this.contentRect_;
  3571. this.broadcastWidth = rect.width;
  3572. this.broadcastHeight = rect.height;
  3573. return rect;
  3574. };
  3575. return ResizeObservation;
  3576. }());
  3577. var ResizeObserverEntry = /** @class */ (function () {
  3578. /**
  3579. * Creates an instance of ResizeObserverEntry.
  3580. *
  3581. * @param {Element} target - Element that is being observed.
  3582. * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
  3583. */
  3584. function ResizeObserverEntry(target, rectInit) {
  3585. var contentRect = createReadOnlyRect(rectInit);
  3586. // According to the specification following properties are not writable
  3587. // and are also not enumerable in the native implementation.
  3588. //
  3589. // Property accessors are not being used as they'd require to define a
  3590. // private WeakMap storage which may cause memory leaks in browsers that
  3591. // don't support this type of collections.
  3592. defineConfigurable(this, { target: target, contentRect: contentRect });
  3593. }
  3594. return ResizeObserverEntry;
  3595. }());
  3596. var ResizeObserverSPI = /** @class */ (function () {
  3597. /**
  3598. * Creates a new instance of ResizeObserver.
  3599. *
  3600. * @param {ResizeObserverCallback} callback - Callback function that is invoked
  3601. * when one of the observed elements changes it's content dimensions.
  3602. * @param {ResizeObserverController} controller - Controller instance which
  3603. * is responsible for the updates of observer.
  3604. * @param {ResizeObserver} callbackCtx - Reference to the public
  3605. * ResizeObserver instance which will be passed to callback function.
  3606. */
  3607. function ResizeObserverSPI(callback, controller, callbackCtx) {
  3608. /**
  3609. * Collection of resize observations that have detected changes in dimensions
  3610. * of elements.
  3611. *
  3612. * @private {Array<ResizeObservation>}
  3613. */
  3614. this.activeObservations_ = [];
  3615. /**
  3616. * Registry of the ResizeObservation instances.
  3617. *
  3618. * @private {Map<Element, ResizeObservation>}
  3619. */
  3620. this.observations_ = new MapShim();
  3621. if (typeof callback !== 'function') {
  3622. throw new TypeError('The callback provided as parameter 1 is not a function.');
  3623. }
  3624. this.callback_ = callback;
  3625. this.controller_ = controller;
  3626. this.callbackCtx_ = callbackCtx;
  3627. }
  3628. /**
  3629. * Starts observing provided element.
  3630. *
  3631. * @param {Element} target - Element to be observed.
  3632. * @returns {void}
  3633. */
  3634. ResizeObserverSPI.prototype.observe = function (target) {
  3635. if (!arguments.length) {
  3636. throw new TypeError('1 argument required, but only 0 present.');
  3637. }
  3638. // Do nothing if current environment doesn't have the Element interface.
  3639. if (typeof Element === 'undefined' || !(Element instanceof Object)) {
  3640. return;
  3641. }
  3642. if (!(target instanceof getWindowOf(target).Element)) {
  3643. throw new TypeError('parameter 1 is not of type "Element".');
  3644. }
  3645. var observations = this.observations_;
  3646. // Do nothing if element is already being observed.
  3647. if (observations.has(target)) {
  3648. return;
  3649. }
  3650. observations.set(target, new ResizeObservation(target));
  3651. this.controller_.addObserver(this);
  3652. // Force the update of observations.
  3653. this.controller_.refresh();
  3654. };
  3655. /**
  3656. * Stops observing provided element.
  3657. *
  3658. * @param {Element} target - Element to stop observing.
  3659. * @returns {void}
  3660. */
  3661. ResizeObserverSPI.prototype.unobserve = function (target) {
  3662. if (!arguments.length) {
  3663. throw new TypeError('1 argument required, but only 0 present.');
  3664. }
  3665. // Do nothing if current environment doesn't have the Element interface.
  3666. if (typeof Element === 'undefined' || !(Element instanceof Object)) {
  3667. return;
  3668. }
  3669. if (!(target instanceof getWindowOf(target).Element)) {
  3670. throw new TypeError('parameter 1 is not of type "Element".');
  3671. }
  3672. var observations = this.observations_;
  3673. // Do nothing if element is not being observed.
  3674. if (!observations.has(target)) {
  3675. return;
  3676. }
  3677. observations.delete(target);
  3678. if (!observations.size) {
  3679. this.controller_.removeObserver(this);
  3680. }
  3681. };
  3682. /**
  3683. * Stops observing all elements.
  3684. *
  3685. * @returns {void}
  3686. */
  3687. ResizeObserverSPI.prototype.disconnect = function () {
  3688. this.clearActive();
  3689. this.observations_.clear();
  3690. this.controller_.removeObserver(this);
  3691. };
  3692. /**
  3693. * Collects observation instances the associated element of which has changed
  3694. * it's content rectangle.
  3695. *
  3696. * @returns {void}
  3697. */
  3698. ResizeObserverSPI.prototype.gatherActive = function () {
  3699. var _this = this;
  3700. this.clearActive();
  3701. this.observations_.forEach(function (observation) {
  3702. if (observation.isActive()) {
  3703. _this.activeObservations_.push(observation);
  3704. }
  3705. });
  3706. };
  3707. /**
  3708. * Invokes initial callback function with a list of ResizeObserverEntry
  3709. * instances collected from active resize observations.
  3710. *
  3711. * @returns {void}
  3712. */
  3713. ResizeObserverSPI.prototype.broadcastActive = function () {
  3714. // Do nothing if observer doesn't have active observations.
  3715. if (!this.hasActive()) {
  3716. return;
  3717. }
  3718. var ctx = this.callbackCtx_;
  3719. // Create ResizeObserverEntry instance for every active observation.
  3720. var entries = this.activeObservations_.map(function (observation) {
  3721. return new ResizeObserverEntry(observation.target, observation.broadcastRect());
  3722. });
  3723. this.callback_.call(ctx, entries, ctx);
  3724. this.clearActive();
  3725. };
  3726. /**
  3727. * Clears the collection of active observations.
  3728. *
  3729. * @returns {void}
  3730. */
  3731. ResizeObserverSPI.prototype.clearActive = function () {
  3732. this.activeObservations_.splice(0);
  3733. };
  3734. /**
  3735. * Tells whether observer has active observations.
  3736. *
  3737. * @returns {boolean}
  3738. */
  3739. ResizeObserverSPI.prototype.hasActive = function () {
  3740. return this.activeObservations_.length > 0;
  3741. };
  3742. return ResizeObserverSPI;
  3743. }());
  3744. // Registry of internal observers. If WeakMap is not available use current shim
  3745. // for the Map collection as it has all required methods and because WeakMap
  3746. // can't be fully polyfilled anyway.
  3747. var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
  3748. /**
  3749. * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
  3750. * exposing only those methods and properties that are defined in the spec.
  3751. */
  3752. var ResizeObserver = /** @class */ (function () {
  3753. /**
  3754. * Creates a new instance of ResizeObserver.
  3755. *
  3756. * @param {ResizeObserverCallback} callback - Callback that is invoked when
  3757. * dimensions of the observed elements change.
  3758. */
  3759. function ResizeObserver(callback) {
  3760. if (!(this instanceof ResizeObserver)) {
  3761. throw new TypeError('Cannot call a class as a function.');
  3762. }
  3763. if (!arguments.length) {
  3764. throw new TypeError('1 argument required, but only 0 present.');
  3765. }
  3766. var controller = ResizeObserverController.getInstance();
  3767. var observer = new ResizeObserverSPI(callback, controller, this);
  3768. observers.set(this, observer);
  3769. }
  3770. return ResizeObserver;
  3771. }());
  3772. // Expose public methods of ResizeObserver.
  3773. [
  3774. 'observe',
  3775. 'unobserve',
  3776. 'disconnect'
  3777. ].forEach(function (method) {
  3778. ResizeObserver.prototype[method] = function () {
  3779. var _a;
  3780. return (_a = observers.get(this))[method].apply(_a, arguments);
  3781. };
  3782. });
  3783. var index = (function () {
  3784. // Export existing implementation if available.
  3785. if (typeof global$1.ResizeObserver !== 'undefined') {
  3786. return global$1.ResizeObserver;
  3787. }
  3788. return ResizeObserver;
  3789. })();
  3790. /* harmony default export */ __webpack_exports__["default"] = (index);
  3791. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(29)))
  3792. /***/ }),
  3793. /* 29 */
  3794. /***/ (function(module, exports) {
  3795. var g;
  3796. // This works in non-strict mode
  3797. g = (function() {
  3798. return this;
  3799. })();
  3800. try {
  3801. // This works if eval is allowed (see CSP)
  3802. g = g || new Function("return this")();
  3803. } catch (e) {
  3804. // This works if the window reference is available
  3805. if (typeof window === "object") g = window;
  3806. }
  3807. // g can still be undefined, but nothing to do about it...
  3808. // We return undefined, instead of nothing here, so it's
  3809. // easier to handle this case. if(!global) { ...}
  3810. module.exports = g;
  3811. /***/ }),
  3812. /* 30 */
  3813. /***/ (function(module, exports, __webpack_require__) {
  3814. var camel2hyphen = __webpack_require__(31);
  3815. var isDimension = function (feature) {
  3816. var re = /[height|width]$/;
  3817. return re.test(feature);
  3818. };
  3819. var obj2mq = function (obj) {
  3820. var mq = '';
  3821. var features = Object.keys(obj);
  3822. features.forEach(function (feature, index) {
  3823. var value = obj[feature];
  3824. feature = camel2hyphen(feature);
  3825. // Add px to dimension features
  3826. if (isDimension(feature) && typeof value === 'number') {
  3827. value = value + 'px';
  3828. }
  3829. if (value === true) {
  3830. mq += feature;
  3831. } else if (value === false) {
  3832. mq += 'not ' + feature;
  3833. } else {
  3834. mq += '(' + feature + ': ' + value + ')';
  3835. }
  3836. if (index < features.length-1) {
  3837. mq += ' and '
  3838. }
  3839. });
  3840. return mq;
  3841. };
  3842. var json2mq = function (query) {
  3843. var mq = '';
  3844. if (typeof query === 'string') {
  3845. return query;
  3846. }
  3847. // Handling array of media queries
  3848. if (query instanceof Array) {
  3849. query.forEach(function (q, index) {
  3850. mq += obj2mq(q);
  3851. if (index < query.length-1) {
  3852. mq += ', '
  3853. }
  3854. });
  3855. return mq;
  3856. }
  3857. // Handling single media query
  3858. return obj2mq(query);
  3859. };
  3860. module.exports = json2mq;
  3861. /***/ }),
  3862. /* 31 */
  3863. /***/ (function(module, exports) {
  3864. var camel2hyphen = function (str) {
  3865. return str
  3866. .replace(/[A-Z]/g, function (match) {
  3867. return '-' + match.toLowerCase();
  3868. })
  3869. .toLowerCase();
  3870. };
  3871. module.exports = camel2hyphen;
  3872. /***/ })
  3873. /******/ ]);
  3874. });
  3875. //# sourceMappingURL=react-slick.js.map