PageSourceSearch

https://www.carezimbabwe.org/wp-content/themes/careorg/assets/js/source.dev.js?ver=1.0.0

js carezimbabwe.org collected 2026-09-29 12:13:25 UTC 221,724 bytes, 7,646 lines download raw bytes

1"use strict";var _typeof2=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f;}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e);},l,l.exports,e,t,n,r);}return n[o].exports;}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++){s(r[o]);}return s;})({1:[function(require,module,exports){
2(function(process){
3/**
4 * @popperjs/core v2.3.2 - MIT License
5 */
6
7'use strict';
8
9Object.defineProperty(exports,'__esModule',{value:true});
10
11function getBoundingClientRect(element){
12var rect=element.getBoundingClientRect();
13return{
14width:rect.width,
15height:rect.height,
16top:rect.top,
17right:rect.right,
18bottom:rect.bottom,
19left:rect.left,
20x:rect.left,
21y:rect.top};
22
23}
24
25/*:: import type { Window } from '../types'; */
26
27/*:: declare function getWindow(node: Node | Window): Window; */
28function getWindow(node){
29if(node.toString()!=='[object Window]'){
30var ownerDocument=node.ownerDocument;
31return ownerDocument?ownerDocument.defaultView:window;
32}
33
34return node;
35}
36
37function getWindowScroll(node){
38var win=getWindow(node);
39var scrollLeft=win.pageXOffset;
40var scrollTop=win.pageYOffset;
41return{
42scrollLeft:scrollLeft,
43scrollTop:scrollTop};
44
45}
46
47/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
48  Element); */
49
50function isElement(node){
51var OwnElement=getWindow(node).Element;
52return node instanceof OwnElement||node instanceof Element;
53}
54/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
55  HTMLElement); */
56
57
58function isHTMLElement(node){
59var OwnElement=getWindow(node).HTMLElement;
60return node instanceof OwnElement||node instanceof HTMLElement;
61}
62
63function getHTMLElementScroll(element){
64return{
65scrollLeft:element.scrollLeft,
66scrollTop:element.scrollTop};
67
68}
69
70function getNodeScroll(node){
71if(node===getWindow(node)||!isHTMLElement(node)){
72return getWindowScroll(node);
73}else{
74return getHTMLElementScroll(node);
75}
76}
77
78function getNodeName(element){
79return element?(element.nodeName||'').toLowerCase():null;
80}
81
82function getDocumentElement(element){
83// $FlowFixMe: assume body is always available
84return(isElement(element)?element.ownerDocument:element.document).documentElement;
85}
86
87function getWindowScrollBarX(element){
88// If <html> has a CSS width greater than the viewport, then this will be
89// incorrect for RTL.
90// Popper 1 is broken in this case and never had a bug report so let's assume
91// it's not an issue. I don't think anyone ever specifies width on <html>
92// anyway.
93// Browsers where the left scrollbar doesn't cause an issue report `0` for
94// this (e.g. Edge 2019, IE11, Safari)
95return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft;
96}
97
98// Composite means it takes into account transforms as well as layout.
99
100function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){
101if(isFixed===void 0){
102isFixed=false;
103}
104
105var documentElement;
106var rect=getBoundingClientRect(elementOrVirtualElement);
107var scroll={
108scrollLeft:0,
109scrollTop:0};
110
111var offsets={
112x:0,
113y:0};
114
115
116if(!isFixed){
117if(getNodeName(offsetParent)!=='body'){
118scroll=getNodeScroll(offsetParent);
119}
120
121if(isHTMLElement(offsetParent)){
122offsets=getBoundingClientRect(offsetParent);
123offsets.x+=offsetParent.clientLeft;
124offsets.y+=offsetParent.clientTop;
125}else if(documentElement=getDocumentElement(offsetParent)){
126offsets.x=getWindowScrollBarX(documentElement);
127}
128}
129
130return{
131x:rect.left+scroll.scrollLeft-offsets.x,
132y:rect.top+scroll.scrollTop-offsets.y,
133width:rect.width,
134height:rect.height};
135
136}
137
138// Returns the layout rect of an element relative to its offsetParent. Layout
139// means it doesn't take into account transforms.
140function getLayoutRect(element){
141return{
142x:element.offsetLeft,
143y:element.offsetTop,
144width:element.offsetWidth,
145height:element.offsetHeight};
146
147}
148
149function getParentNode(element){
150if(getNodeName(element)==='html'){
151return element;
152}
153
154return(// $FlowFixMe: this is a quicker (but less type safe) way to save quite some bytes from the bundle
155element.assignedSlot||// step into the shadow DOM of the parent of a slotted node
156element.parentNode||// DOM Element detected
157// $FlowFixMe: need a better way to handle this...
158element.host||// ShadowRoot detected
159// $FlowFixMe: HTMLElement is a Node
160getDocumentElement(element)// fallback
161);
162
163}
164
165function getComputedStyle(element){
166return getWindow(element).getComputedStyle(element);
167}
168
169function getScrollParent(node){
170if(['html','body','#document'].indexOf(getNodeName(node))>=0){
171// $FlowFixMe: assume body is always available
172return node.ownerDocument.body;
173}
174
175if(isHTMLElement(node)){
176// Firefox wants us to check `-x` and `-y` variations as well
177var _getComputedStyle=getComputedStyle(node),
178overflow=_getComputedStyle.overflow,
179overflowX=_getComputedStyle.overflowX,
180overflowY=_getComputedStyle.overflowY;
181
182if(/auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX)){
183return node;
184}
185}
186
187return getScrollParent(getParentNode(node));
vendor: 4,131 bytes, lines 188-336
188}
189
190function listScrollParents(element,list){
191if(list===void 0){
192list=[];
193}
194
195var scrollParent=getScrollParent(element);
196var isBody=getNodeName(scrollParent)==='body';
197var win=getWindow(scrollParent);
198var target=isBody?[win].concat(win.visualViewport||[]):scrollParent;
199var updatedList=list.concat(target);
200return isBody?updatedList:// $FlowFixMe: isBody tells us target will be an HTMLElement here
201updatedList.concat(listScrollParents(getParentNode(target)));
202}
203
204function isTableElement(element){
205return['table','td','th'].indexOf(getNodeName(element))>=0;
206}
207
208function getTrueOffsetParent(element){
209if(!isHTMLElement(element)||// https://github.com/popperjs/popper-core/issues/837
210getComputedStyle(element).position==='fixed'){
211return null;
212}
213
214return element.offsetParent;
215}
216
217function getOffsetParent(element){
218var window=getWindow(element);
219var offsetParent=getTrueOffsetParent(element);// Find the nearest non-table offsetParent
220
221while(offsetParent&&isTableElement(offsetParent)){
222offsetParent=getTrueOffsetParent(offsetParent);
223}
224
225if(offsetParent&&getNodeName(offsetParent)==='body'&&getComputedStyle(offsetParent).position==='static'){
226return window;
227}
228
229return offsetParent||window;
230}
231
232var top='top';
233var bottom='bottom';
234var right='right';
235var left='left';
236var auto='auto';
237var basePlacements=[top,bottom,right,left];
238var start='start';
239var end='end';
240var clippingParents='clippingParents';
241var viewport='viewport';
242var popper='popper';
243var reference='reference';
244var variationPlacements=/*#__PURE__*/basePlacements.reduce(function(acc,placement){
245return acc.concat([placement+"-"+start,placement+"-"+end]);
246},[]);
247var placements=/*#__PURE__*/[].concat(basePlacements,[auto]).reduce(function(acc,placement){
248return acc.concat([placement,placement+"-"+start,placement+"-"+end]);
249},[]);// modifiers that need to read the DOM
250
251var beforeRead='beforeRead';
252var read='read';
253var afterRead='afterRead';// pure-logic modifiers
254
255var beforeMain='beforeMain';
256var main='main';
257var afterMain='afterMain';// modifier with the purpose to write to the DOM (or write into a framework state)
258
259var beforeWrite='beforeWrite';
260var write='write';
261var afterWrite='afterWrite';
262var modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];
263
264function order(modifiers){
265var map=new Map();
266var visited=new Set();
267var result=[];
268modifiers.forEach(function(modifier){
269map.set(modifier.name,modifier);
270});// On visiting object, check for its dependencies and visit them recursively
271
272function sort(modifier){
273visited.add(modifier.name);
274var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);
275requires.forEach(function(dep){
276if(!visited.has(dep)){
277var depModifier=map.get(dep);
278
279if(depModifier){
280sort(depModifier);
281}
282}
283});
284result.push(modifier);
285}
286
287modifiers.forEach(function(modifier){
288if(!visited.has(modifier.name)){
289// check for visited object
290sort(modifier);
291}
292});
293return result;
294}
295
296function orderModifiers(modifiers){
297// order based on dependencies
298var orderedModifiers=order(modifiers);// order based on phase
299
300return modifierPhases.reduce(function(acc,phase){
301return acc.concat(orderedModifiers.filter(function(modifier){
302return modifier.phase===phase;
303}));
304},[]);
305}
306
307function debounce(fn){
308var pending;
309return function(){
310if(!pending){
311pending=new Promise(function(resolve){
312Promise.resolve().then(function(){
313pending=undefined;
314resolve(fn());
315});
316});
317}
318
319return pending;
320};
321}
322
323function format(str){
324for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){
325args[_key-1]=arguments[_key];
326}
327
328return[].concat(args).reduce(function(p,c){
329return p.replace(/%s/,c);
330},str);
331}
332
333var INVALID_MODIFIER_ERROR='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
334var MISSING_DEPENDENCY_ERROR='Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
335var VALID_PROPERTIES=['name','enabled','phase','fn','effect','requires','options'];
336function validateModifiers(modifiers){
vendor: 4,965 bytes, lines 337-501
337modifiers.forEach(function(modifier){
338Object.keys(modifier).forEach(function(key){
339switch(key){
340case'name':
341if(typeof modifier.name!=='string'){
342console.error(format(INVALID_MODIFIER_ERROR,String(modifier.name),'"name"','"string"',"\""+String(modifier.name)+"\""));
343}
344
345break;
346
347case'enabled':
348if(typeof modifier.enabled!=='boolean'){
349console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"enabled"','"boolean"',"\""+String(modifier.enabled)+"\""));
350}
351
352case'phase':
353if(modifierPhases.indexOf(modifier.phase)<0){
354console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"phase"',"either "+modifierPhases.join(', '),"\""+String(modifier.phase)+"\""));
355}
356
357break;
358
359case'fn':
360if(typeof modifier.fn!=='function'){
361console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"fn"','"function"',"\""+String(modifier.fn)+"\""));
362}
363
364break;
365
366case'effect':
367if(typeof modifier.effect!=='function'){
368console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"effect"','"function"',"\""+String(modifier.fn)+"\""));
369}
370
371break;
372
373case'requires':
374if(!Array.isArray(modifier.requires)){
375console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requires"','"array"',"\""+String(modifier.requires)+"\""));
376}
377
378break;
379
380case'requiresIfExists':
381if(!Array.isArray(modifier.requiresIfExists)){
382console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requiresIfExists"','"array"',"\""+String(modifier.requiresIfExists)+"\""));
383}
384
385break;
386
387case'options':
388case'data':
389break;
390
391default:
392console.error("PopperJS: an invalid property has been provided to the \""+modifier.name+"\" modifier, valid properties are "+VALID_PROPERTIES.map(function(s){
393return"\""+s+"\"";
394}).join(', ')+"; but \""+key+"\" was provided.");}
395
396
397modifier.requires&&modifier.requires.forEach(function(requirement){
398if(modifiers.find(function(mod){
399return mod.name===requirement;
400})==null){
401console.error(format(MISSING_DEPENDENCY_ERROR,String(modifier.name),requirement,requirement));
402}
403});
404});
405});
406}
407
408function uniqueBy(arr,fn){
409var identifiers=new Set();
410return arr.filter(function(item){
411var identifier=fn(item);
412
413if(!identifiers.has(identifier)){
414identifiers.add(identifier);
415return true;
416}
417});
418}
419
420function getBasePlacement(placement){
421return placement.split('-')[0];
422}
423
424function mergeByName(modifiers){
425var merged=modifiers.reduce(function(merged,current){
426var existing=merged[current.name];
427merged[current.name]=existing?Object.assign({},existing,{},current,{
428options:Object.assign({},existing.options,{},current.options),
429data:Object.assign({},existing.data,{},current.data)}):
430current;
431return merged;
432},{});// IE11 does not support Object.values
433
434return Object.keys(merged).map(function(key){
435return merged[key];
436});
437}
438
439var INVALID_ELEMENT_ERROR='Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';
440var INFINITE_LOOP_ERROR='Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';
441var DEFAULT_OPTIONS={
442placement:'bottom',
443modifiers:[],
444strategy:'absolute'};
445
446
447function areValidElements(){
448for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){
449args[_key]=arguments[_key];
450}
451
452return!args.some(function(element){
453return!(element&&typeof element.getBoundingClientRect==='function');
454});
455}
456
457function popperGenerator(generatorOptions){
458if(generatorOptions===void 0){
459generatorOptions={};
460}
461
462var _generatorOptions=generatorOptions,
463_generatorOptions$def=_generatorOptions.defaultModifiers,
464defaultModifiers=_generatorOptions$def===void 0?[]:_generatorOptions$def,
465_generatorOptions$def2=_generatorOptions.defaultOptions,
466defaultOptions=_generatorOptions$def2===void 0?DEFAULT_OPTIONS:_generatorOptions$def2;
467return function createPopper(reference,popper,options){
468if(options===void 0){
469options=defaultOptions;
470}
471
472var state={
473placement:'bottom',
474orderedModifiers:[],
475options:Object.assign({},DEFAULT_OPTIONS,{},defaultOptions),
476modifiersData:{},
477elements:{
478reference:reference,
479popper:popper},
480
481attributes:{},
482styles:{}};
483
484var effectCleanupFns=[];
485var isDestroyed=false;
486var instance={
487state:state,
488setOptions:function setOptions(options){
489cleanupModifierEffects();
490state.options=Object.assign({},defaultOptions,{},state.options,{},options);
491state.scrollParents={
492reference:isElement(reference)?listScrollParents(reference):reference.contextElement?listScrollParents(reference.contextElement):[],
493popper:listScrollParents(popper)};
494// Orders the modifiers based on their dependencies and `phase`
495// properties
496
497var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers,state.options.modifiers)));// Strip out disabled modifiers
498
499state.orderedModifiers=orderedModifiers.filter(function(m){
500return m.enabled;
501});// Validate the provided modifiers so that the consumer will get warned
vendor: 4,678 bytes, lines 502-648
502// if one of the modifiers is invalid for any reason
503
504if(process.env.NODE_ENV!=="production"){
505var modifiers=uniqueBy([].concat(orderedModifiers,state.options.modifiers),function(_ref){
506var name=_ref.name;
507return name;
508});
509validateModifiers(modifiers);
510
511if(getBasePlacement(state.options.placement)===auto){
512var flipModifier=state.orderedModifiers.find(function(_ref2){
513var name=_ref2.name;
514return name==='flip';
515});
516
517if(!flipModifier){
518console.error(['Popper: "auto" placements require the "flip" modifier be','present and enabled to work.'].join(' '));
519}
520}
521
522var _getComputedStyle=getComputedStyle(popper),
523marginTop=_getComputedStyle.marginTop,
524marginRight=_getComputedStyle.marginRight,
525marginBottom=_getComputedStyle.marginBottom,
526marginLeft=_getComputedStyle.marginLeft;// We no longer take into account `margins` on the popper, and it can
527// cause bugs with positioning, so we'll warn the consumer
528
529
530if([marginTop,marginRight,marginBottom,marginLeft].some(function(margin){
531return parseFloat(margin);
532})){
533console.warn(['Popper: CSS "margin" styles cannot be used to apply padding','between the popper and its reference element or boundary.','To replicate margin, use the `offset` modifier, as well as','the `padding` option in the `preventOverflow` and `flip`','modifiers.'].join(' '));
534}
535}
536
537runModifierEffects();
538return instance.update();
539},
540// Sync update – it will always be executed, even if not necessary. This
541// is useful for low frequency updates where sync behavior simplifies the
542// logic.
543// For high frequency updates (e.g. `resize` and `scroll` events), always
544// prefer the async Popper#update method
545forceUpdate:function forceUpdate(){
546if(isDestroyed){
547return;
548}
549
550var _state$elements=state.elements,
551reference=_state$elements.reference,
552popper=_state$elements.popper;// Don't proceed if `reference` or `popper` are not valid elements
553// anymore
554
555if(!areValidElements(reference,popper)){
556if(process.env.NODE_ENV!=="production"){
557console.error(INVALID_ELEMENT_ERROR);
558}
559
560return;
561}// Store the reference and popper rects to be read by modifiers
562
563
564state.rects={
565reference:getCompositeRect(reference,getOffsetParent(popper),state.options.strategy==='fixed'),
566popper:getLayoutRect(popper)};
567// Modifiers have the ability to reset the current update cycle. The
568// most common use case for this is the `flip` modifier changing the
569// placement, which then needs to re-run all the modifiers, because the
570// logic was previously ran for the previous placement and is therefore
571// stale/incorrect
572
573state.reset=false;
574state.placement=state.options.placement;// On each update cycle, the `modifiersData` property for each modifier
575// is filled with the initial data specified by the modifier. This means
576// it doesn't persist and is fresh on each update.
577// To ensure persistent data, use `${name}#persistent`
578
579state.orderedModifiers.forEach(function(modifier){
580return state.modifiersData[modifier.name]=Object.assign({},modifier.data);
581});
582var __debug_loops__=0;
583
584for(var index=0;index<state.orderedModifiers.length;index++){
585if(process.env.NODE_ENV!=="production"){
586__debug_loops__+=1;
587
588if(__debug_loops__>100){
589console.error(INFINITE_LOOP_ERROR);
590break;
591}
592}
593
594if(state.reset===true){
595state.reset=false;
596index=-1;
597continue;
598}
599
600var _state$orderedModifie=state.orderedModifiers[index],
601fn=_state$orderedModifie.fn,
602_state$orderedModifie2=_state$orderedModifie.options,
603_options=_state$orderedModifie2===void 0?{}:_state$orderedModifie2,
604name=_state$orderedModifie.name;
605
606if(typeof fn==='function'){
607state=fn({
608state:state,
609options:_options,
610name:name,
611instance:instance})||
612state;
613}
614}
615},
616// Async and optimistically optimized update – it will not be executed if
617// not necessary (debounced to run at most once-per-tick)
618update:debounce(function(){
619return new Promise(function(resolve){
620instance.forceUpdate();
621resolve(state);
622});
623}),
624destroy:function destroy(){
625cleanupModifierEffects();
626isDestroyed=true;
627}};
628
629
630if(!areValidElements(reference,popper)){
631if(process.env.NODE_ENV!=="production"){
632console.error(INVALID_ELEMENT_ERROR);
633}
634
635return instance;
636}
637
638instance.setOptions(options).then(function(state){
639if(!isDestroyed&&options.onFirstUpdate){
640options.onFirstUpdate(state);
641}
642});// Modifiers have the ability to execute arbitrary code before the first
643// update cycle runs. They will be executed in the same order as the update
644// cycle. This is useful when a modifier adds some persistent data that
645// other modifiers need to use, but the modifier is run after the dependent
646// one.
647
648function runModifierEffects(){
vendor: 4,561 bytes, lines 649-866
649state.orderedModifiers.forEach(function(_ref3){
650var name=_ref3.name,
651_ref3$options=_ref3.options,
652options=_ref3$options===void 0?{}:_ref3$options,
653effect=_ref3.effect;
654
655if(typeof effect==='function'){
656var cleanupFn=effect({
657state:state,
658name:name,
659instance:instance,
660options:options});
661
662
663var noopFn=function noopFn(){};
664
665effectCleanupFns.push(cleanupFn||noopFn);
666}
667});
668}
669
670function cleanupModifierEffects(){
671effectCleanupFns.forEach(function(fn){
672return fn();
673});
674effectCleanupFns=[];
675}
676
677return instance;
678};
679}
680
681var passive={
682passive:true};
683
684
685function effect(_ref){
686var state=_ref.state,
687instance=_ref.instance,
688options=_ref.options;
689var _options$scroll=options.scroll,
690scroll=_options$scroll===void 0?true:_options$scroll,
691_options$resize=options.resize,
692resize=_options$resize===void 0?true:_options$resize;
693var window=getWindow(state.elements.popper);
694var scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);
695
696if(scroll){
697scrollParents.forEach(function(scrollParent){
698scrollParent.addEventListener('scroll',instance.update,passive);
699});
700}
701
702if(resize){
703window.addEventListener('resize',instance.update,passive);
704}
705
706return function(){
707if(scroll){
708scrollParents.forEach(function(scrollParent){
709scrollParent.removeEventListener('scroll',instance.update,passive);
710});
711}
712
713if(resize){
714window.removeEventListener('resize',instance.update,passive);
715}
716};
717}// eslint-disable-next-line import/no-unused-modules
718
719
720var eventListeners={
721name:'eventListeners',
722enabled:true,
723phase:'write',
724fn:function fn(){},
725effect:effect,
726data:{}};
727
728
729function getVariation(placement){
730return placement.split('-')[1];
731}
732
733function getMainAxisFromPlacement(placement){
734return['top','bottom'].indexOf(placement)>=0?'x':'y';
735}
736
737function computeOffsets(_ref){
738var reference=_ref.reference,
739element=_ref.element,
740placement=_ref.placement;
741var basePlacement=placement?getBasePlacement(placement):null;
742var variation=placement?getVariation(placement):null;
743var commonX=reference.x+reference.width/2-element.width/2;
744var commonY=reference.y+reference.height/2-element.height/2;
745var offsets;
746
747switch(basePlacement){
748case top:
749offsets={
750x:commonX,
751y:reference.y-element.height};
752
753break;
754
755case bottom:
756offsets={
757x:commonX,
758y:reference.y+reference.height};
759
760break;
761
762case right:
763offsets={
764x:reference.x+reference.width,
765y:commonY};
766
767break;
768
769case left:
770offsets={
771x:reference.x-element.width,
772y:commonY};
773
774break;
775
776default:
777offsets={
778x:reference.x,
779y:reference.y};}
780
781
782
783var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;
784
785if(mainAxis!=null){
786var len=mainAxis==='y'?'height':'width';
787
788switch(variation){
789case start:
790offsets[mainAxis]=Math.floor(offsets[mainAxis])-Math.floor(reference[len]/2-element[len]/2);
791break;
792
793case end:
794offsets[mainAxis]=Math.floor(offsets[mainAxis])+Math.ceil(reference[len]/2-element[len]/2);
795break;}
796
797}
798
799return offsets;
800}
801
802function popperOffsets(_ref){
803var state=_ref.state,
804name=_ref.name;
805// Offsets are the actual position the popper needs to have to be
806// properly positioned near its reference element
807// This is the most basic placement, and will be adjusted by
808// the modifiers in the next step
809state.modifiersData[name]=computeOffsets({
810reference:state.rects.reference,
811element:state.rects.popper,
812strategy:'absolute',
813placement:state.placement});
814
815}// eslint-disable-next-line import/no-unused-modules
816
817
818var popperOffsets$1={
819name:'popperOffsets',
820enabled:true,
821phase:'read',
822fn:popperOffsets,
823data:{}};
824
825
826var unsetSides={
827top:'auto',
828right:'auto',
829bottom:'auto',
830left:'auto'};
831// Round the offsets to the nearest suitable subpixel based on the DPR.
832// Zooming can change the DPR, but it seems to report a value that will
833// cleanly divide the values into the appropriate subpixels.
834
835function roundOffsets(_ref){
836var x=_ref.x,
837y=_ref.y;
838var win=window;
839var dpr=win.devicePixelRatio||1;
840return{
841x:Math.round(x*dpr)/dpr||0,
842y:Math.round(y*dpr)/dpr||0};
843
844}
845
846function mapToStyles(_ref2){
847var _Object$assign2;
848
849var popper=_ref2.popper,
850popperRect=_ref2.popperRect,
851placement=_ref2.placement,
852offsets=_ref2.offsets,
853position=_ref2.position,
854gpuAcceleration=_ref2.gpuAcceleration,
855adaptive=_ref2.adaptive;
856
857var _roundOffsets=roundOffsets(offsets),
858x=_roundOffsets.x,
859y=_roundOffsets.y;
860
861var hasX=offsets.hasOwnProperty('x');
862var hasY=offsets.hasOwnProperty('y');
863var sideX=left;
864var sideY=top;
865var win=window;
866
867if(adaptive){
868var offsetParent=getOffsetParent(popper);
869
870if(offsetParent===getWindow(popper)){
871offsetParent=getDocumentElement(popper);
872}// $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
873
874/*:: offsetParent = (offsetParent: Element); */
875
876
877if(placement===top){
878sideY=bottom;
879y-=offsetParent.clientHeight-popperRect.height;
880y*=gpuAcceleration?1:-1;
881}
882
883if(placement===left){
884sideX=right;
885x-=offsetParent.clientWidth-popperRect.width;
886x*=gpuAcceleration?1:-1;
887}
888}
889
890var commonStyles=Object.assign({
891position:position},
892adaptive&&unsetSides);
893
894if(gpuAcceleration){
895var _Object$assign;
896
897return Object.assign({},commonStyles,(_Object$assign={},_Object$assign[sideY]=hasY?'0':'',_Object$assign[sideX]=hasX?'0':'',_Object$assign.transform=(win.devicePixelRatio||1)<2?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign));
898}
899
900return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":'',_Object$assign2[sideX]=hasX?x+"px":'',_Object$assign2.transform='',_Object$assign2));
901}
902
903function computeStyles(_ref3){
904var state=_ref3.state,
905options=_ref3.options;
906var _options$gpuAccelerat=options.gpuAcceleration,
907gpuAcceleration=_options$gpuAccelerat===void 0?true:_options$gpuAccelerat,
908_options$adaptive=options.adaptive,
909adaptive=_options$adaptive===void 0?true:_options$adaptive;
910
911if(process.env.NODE_ENV!=="production"){
912var transitionProperty=getComputedStyle(state.elements.popper).transitionProperty||'';
913
914if(adaptive&&['transform','top','right','bottom','left'].some(function(property){
915return transitionProperty.indexOf(property)>=0;
916})){
917console.warn(['Popper: Detected CSS transitions on at least one of the following','CSS properties: "transform", "top", "right", "bottom", "left".','\n\n','Disable the "computeStyles" modifier\'s `adaptive` option to allow','for smooth transitions, or remove these properties from the CSS','transition declaration on the popper element if only transitioning','opacity or background-color for example.','\n\n','We recommend using the popper element as a wrapper around an inner','element that can have any CSS property transitioned for animations.'].join(' '));
918}
919}
920
921var commonStyles={
922placement:getBasePlacement(state.placement),
923popper:state.elements.popper,
924popperRect:state.rects.popper,
925gpuAcceleration:gpuAcceleration};
926
927
928if(state.modifiersData.popperOffsets!=null){
929state.styles.popper=Object.assign({},state.styles.popper,{},mapToStyles(Object.assign({},commonStyles,{
930offsets:state.modifiersData.popperOffsets,
931position:state.options.strategy,
932adaptive:adaptive})));
933
934}
935
936if(state.modifiersData.arrow!=null){
937state.styles.arrow=Object.assign({},state.styles.arrow,{},mapToStyles(Object.assign({},commonStyles,{
938offsets:state.modifiersData.arrow,
939position:'absolute',
940adaptive:false})));
941
942}
943
944state.attributes.popper=Object.assign({},state.attributes.popper,{
945'data-popper-placement':state.placement});
946
947}// eslint-disable-next-line import/no-unused-modules
948
949
950var computeStyles$1={
951name:'computeStyles',
952enabled:true,
953phase:'beforeWrite',
954fn:computeStyles,
955data:{}};
956
957
958// and applies them to the HTMLElements such as popper and arrow
959
960function applyStyles(_ref){
961var state=_ref.state;
962Object.keys(state.elements).forEach(function(name){
963var style=state.styles[name]||{};
964var attributes=state.attributes[name]||{};
965var element=state.elements[name];// arrow is optional + virtual elements
966
967if(!isHTMLElement(element)||!getNodeName(element)){
968return;
969}// Flow doesn't support to extend this property, but it's the most
970// effective way to apply styles to an HTMLElement
971// $FlowFixMe
972
973
974Object.assign(element.style,style);
975Object.keys(attributes).forEach(function(name){
976var value=attributes[name];
977
978if(value===false){
979element.removeAttribute(name);
980}else{
981element.setAttribute(name,value===true?'':value);
982}
983});
984});
985}
986
987function effect$1(_ref2){
988var state=_ref2.state;
989var initialStyles={
990popper:{
991position:state.options.strategy,
992left:'0',
993top:'0',
994margin:'0'},
995
996arrow:{
997position:'absolute'},
998
999reference:{}};
1000
1001Object.assign(state.elements.popper.style,initialStyles.popper);
1002
1003if(state.elements.arrow){
1004Object.assign(state.elements.arrow.style,initialStyles.arrow);
1005}
1006
1007return function(){
1008Object.keys(state.elements).forEach(function(name){
1009var element=state.elements[name];
1010var attributes=state.attributes[name]||{};
1011var styleProperties=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]);// Set all values to an empty string to unset them
1012
1013var style=styleProperties.reduce(function(style,property){
1014style[property]='';
1015return style;
1016},{});// arrow is optional + virtual elements
1017
1018if(!isHTMLElement(element)||!getNodeName(element)){
1019return;
1020}// Flow doesn't support to extend this property, but it's the most
1021// effective way to apply styles to an HTMLElement
1022// $FlowFixMe
1023
1024
1025Object.assign(element.style,style);
1026Object.keys(attributes).forEach(function(attribute){
1027element.removeAttribute(attribute);
1028});
1029});
1030};
1031}// eslint-disable-next-line import/no-unused-modules
1032
1033
1034var applyStyles$1={
1035name:'applyStyles',
1036enabled:true,
1037phase:'write',
1038fn:applyStyles,
1039effect:effect$1,
1040requires:['computeStyles']};
1041
1042
1043function distanceAndSkiddingToXY(placement,rects,offset){
1044var basePlacement=getBasePlacement(placement);
1045var invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1;
1046
1047var _ref=typeof offset==='function'?offset(Object.assign({},rects,{
1048placement:placement})):
1049offset,
1050skidding=_ref[0],
1051distance=_ref[1];
1052
1053skidding=skidding||0;
1054distance=(distance||0)*invertDistance;
1055return[left,right].indexOf(basePlacement)>=0?{
1056x:distance,
1057y:skidding}:
1058{
1059x:skidding,
1060y:distance};
1061
1062}
1063
1064function offset(_ref2){
1065var state=_ref2.state,
1066options=_ref2.options,
1067name=_ref2.name;
1068var _options$offset=options.offset,
1069offset=_options$offset===void 0?[0,0]:_options$offset;
1070var data=placements.reduce(function(acc,placement){
1071acc[placement]=distanceAndSkiddingToXY(placement,state.rects,offset);
1072return acc;
1073},{});
1074var _data$state$placement=data[state.placement],
1075x=_data$state$placement.x,
1076y=_data$state$placement.y;
1077
1078if(state.modifiersData.popperOffsets!=null){
1079state.modifiersData.popperOffsets.x+=x;
1080state.modifiersData.popperOffsets.y+=y;
1081}
1082
1083state.modifiersData[name]=data;
1084}// eslint-disable-next-line import/no-unused-modules
1085
1086
1087var offset$1={
1088name:'offset',
1089enabled:true,
1090phase:'main',
1091requires:['popperOffsets'],
1092fn:offset};
1093
1094
1095var hash={
1096left:'right',
1097right:'left',
1098bottom:'top',
1099top:'bottom'};
1100
1101function getOppositePlacement(placement){
1102return placement.replace(/left|right|bottom|top/g,function(matched){
1103return hash[matched];
1104});
1105}
1106
1107var hash$1={
1108start:'end',
1109end:'start'};
1110
1111function getOppositeVariationPlacement(placement){
1112return placement.replace(/start|end/g,function(matched){
1113return hash$1[matched];
1114});
1115}
1116
1117function getViewportRect(element){
1118var win=getWindow(element);
1119var visualViewport=win.visualViewport;
1120var width=win.innerWidth;
1121var height=win.innerHeight;// We don't know which browsers have buggy or odd implementations of this, so
1122// for now we're only applying it to iOS to fix the keyboard issue.
1123// Investigation required
1124
1125if(visualViewport&&/iPhone|iPod|iPad/.test(navigator.platform)){
1126width=visualViewport.width;
1127height=visualViewport.height;
1128}
1129
1130return{
1131width:width,
1132height:height,
1133x:0,
1134y:0};
1135
1136}
1137
1138function getDocumentRect(element){
1139var win=getWindow(element);
1140var winScroll=getWindowScroll(element);
1141var documentRect=getCompositeRect(getDocumentElement(element),win);
1142documentRect.height=Math.max(documentRect.height,win.innerHeight);
1143documentRect.width=Math.max(documentRect.width,win.innerWidth);
1144documentRect.x=-winScroll.scrollLeft;
1145documentRect.y=-winScroll.scrollTop;
1146return documentRect;
1147}
1148
1149function toNumber(cssValue){
1150return parseFloat(cssValue)||0;
1151}
1152
1153function getBorders(element){
1154var computedStyle=isHTMLElement(element)?getComputedStyle(element):{};
1155return{
1156top:toNumber(computedStyle.borderTopWidth),
1157right:toNumber(computedStyle.borderRightWidth),
1158bottom:toNumber(computedStyle.borderBottomWidth),
1159left:toNumber(computedStyle.borderLeftWidth)};
1160
1161}
1162
1163function getDecorations(element){
1164var win=getWindow(element);
1165var borders=getBorders(element);
1166var isHTML=getNodeName(element)==='html';
1167var winScrollBarX=getWindowScrollBarX(element);
1168var x=element.clientWidth+borders.right;
1169var y=element.clientHeight+borders.bottom;// HACK:
1170// document.documentElement.clientHeight on iOS reports the height of the
1171// viewport including the bottom bar, even if the bottom bar isn't visible.
1172// If the difference between window innerHeight and html clientHeight is more
1173// than 50, we assume it's a mobile bottom bar and ignore scrollbars.
1174// * A 50px thick scrollbar is likely non-existent (macOS is 15px and Windows
1175//   is about 17px)
1176// * The mobile bar is 114px tall
1177
1178if(isHTML&&win.innerHeight-element.clientHeight>50){
1179y=win.innerHeight-borders.bottom;
1180}
1181
1182return{
1183top:isHTML?0:element.clientTop,
1184right:// RTL scrollbar (scrolling containers only)
1185element.clientLeft>borders.left?borders.right:// LTR scrollbar
1186isHTML?win.innerWidth-x-winScrollBarX:element.offsetWidth-x,
1187bottom:isHTML?win.innerHeight-y:element.offsetHeight-y,
1188left:isHTML?winScrollBarX:element.clientLeft};
1189
1190}
1191
1192function contains(parent,child){
1193// $FlowFixMe: hasOwnProperty doesn't seem to work in tests
1194var isShadow=Boolean(child.getRootNode&&child.getRootNode().host);// First, attempt with faster native method
1195
1196if(parent.contains(child)){
1197return true;
1198}// then fallback to custom implementation with Shadow DOM support
1199else if(isShadow){
1200var next=child;
1201
1202do{
1203if(next&&parent.isSameNode(next)){
1204return true;
1205}// $FlowFixMe: need a better way to handle this...
1206
1207
1208next=next.parentNode||next.host;
1209}while(next);
1210}// Give up, the result is false
1211
1212
1213return false;
1214}
1215
1216function rectToClientRect(rect){
1217return Object.assign({},rect,{
1218left:rect.x,
1219top:rect.y,
1220right:rect.x+rect.width,
1221bottom:rect.y+rect.height});
1222
1223}
1224
1225function getClientRectFromMixedType(element,clippingParent){
1226return clippingParent===viewport?rectToClientRect(getViewportRect(element)):isHTMLElement(clippingParent)?getBoundingClientRect(clippingParent):rectToClientRect(getDocumentRect(getDocumentElement(element)));
1227}// A "clipping parent" is an overflowable container with the characteristic of
1228// clipping (or hiding) overflowing elements with a position different from
1229// `initial`
1230
1231
1232function getClippingParents(element){
1233var clippingParents=listScrollParents(element);
1234var canEscapeClipping=['absolute','fixed'].indexOf(getComputedStyle(element).position)>=0;
1235var clipperElement=canEscapeClipping&&isHTMLElement(element)?getOffsetParent(element):element;
1236
1237if(!isElement(clipperElement)){
1238return[];
1239}// $FlowFixMe: https://github.com/facebook/flow/issues/1414
1240
1241
1242return clippingParents.filter(function(clippingParent){
1243return isElement(clippingParent)&&contains(clippingParent,clipperElement);
1244});
1245}// Gets the maximum area that the element is visible in due to any number of
1246// clipping parents
1247
1248
1249function getClippingRect(element,boundary,rootBoundary){
1250var mainClippingParents=boundary==='clippingParents'?getClippingParents(element):[].concat(boundary);
1251var clippingParents=[].concat(mainClippingParents,[rootBoundary]);
1252var firstClippingParent=clippingParents[0];
1253var clippingRect=clippingParents.reduce(function(accRect,clippingParent){
1254var rect=getClientRectFromMixedType(element,clippingParent);
1255var decorations=getDecorations(isHTMLElement(clippingParent)?clippingParent:getDocumentElement(element));
1256accRect.top=Math.max(rect.top+decorations.top,accRect.top);
1257accRect.right=Math.min(rect.right-decorations.right,accRect.right);
1258accRect.bottom=Math.min(rect.bottom-decorations.bottom,accRect.bottom);
1259accRect.left=Math.max(rect.left+decorations.left,accRect.left);
1260return accRect;
1261},getClientRectFromMixedType(element,firstClippingParent));
1262clippingRect.width=clippingRect.right-clippingRect.left;
1263clippingRect.height=clippingRect.bottom-clippingRect.top;
1264clippingRect.x=clippingRect.left;
1265clippingRect.y=clippingRect.top;
1266return clippingRect;
1267}
1268
1269function getFreshSideObject(){
1270return{
1271top:0,
1272right:0,
1273bottom:0,
1274left:0};
1275
1276}
1277
1278function mergePaddingObject(paddingObject){
1279return Object.assign({},getFreshSideObject(),{},paddingObject);
1280}
1281
1282function expandToHashMap(value,keys){
1283return keys.reduce(function(hashMap,key){
1284hashMap[key]=value;
1285return hashMap;
1286},{});
1287}
1288
1289function detectOverflow(state,options){
1290if(options===void 0){
1291options={};
1292}
1293
1294var _options=options,
1295_options$placement=_options.placement,
1296placement=_options$placement===void 0?state.placement:_options$placement,
vendor: 5,614 bytes, lines 1297-1440
1297_options$boundary=_options.boundary,
1298boundary=_options$boundary===void 0?clippingParents:_options$boundary,
1299_options$rootBoundary=_options.rootBoundary,
1300rootBoundary=_options$rootBoundary===void 0?viewport:_options$rootBoundary,
1301_options$elementConte=_options.elementContext,
1302elementContext=_options$elementConte===void 0?popper:_options$elementConte,
1303_options$altBoundary=_options.altBoundary,
1304altBoundary=_options$altBoundary===void 0?false:_options$altBoundary,
1305_options$padding=_options.padding,
1306padding=_options$padding===void 0?0:_options$padding;
1307var paddingObject=mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));
1308var altContext=elementContext===popper?reference:popper;
1309var referenceElement=state.elements.reference;
1310var popperRect=state.rects.popper;
1311var element=state.elements[altBoundary?altContext:elementContext];
1312var clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary);
1313var referenceClientRect=getBoundingClientRect(referenceElement);
1314var popperOffsets=computeOffsets({
1315reference:referenceClientRect,
1316element:popperRect,
1317strategy:'absolute',
1318placement:placement});
1319
1320var popperClientRect=rectToClientRect(Object.assign({},popperRect,{},popperOffsets));
1321var elementClientRect=elementContext===popper?popperClientRect:referenceClientRect;// positive = overflowing the clipping rect
1322// 0 or negative = within the clipping rect
1323
1324var overflowOffsets={
1325top:clippingClientRect.top-elementClientRect.top+paddingObject.top,
1326bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,
1327left:clippingClientRect.left-elementClientRect.left+paddingObject.left,
1328right:elementClientRect.right-clippingClientRect.right+paddingObject.right};
1329
1330var offsetData=state.modifiersData.offset;// Offsets can be applied only to the popper element
1331
1332if(elementContext===popper&&offsetData){
1333var offset=offsetData[placement];
1334Object.keys(overflowOffsets).forEach(function(key){
1335var multiply=[right,bottom].indexOf(key)>=0?1:-1;
1336var axis=[top,bottom].indexOf(key)>=0?'y':'x';
1337overflowOffsets[key]+=offset[axis]*multiply;
1338});
1339}
1340
1341return overflowOffsets;
1342}
1343
1344/*:: type OverflowsMap = { [ComputedPlacement]: number }; */
1345
1346/*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */
1347function computeAutoPlacement(state,options){
1348if(options===void 0){
1349options={};
1350}
1351
1352var _options=options,
1353placement=_options.placement,
1354boundary=_options.boundary,
1355rootBoundary=_options.rootBoundary,
1356padding=_options.padding,
1357flipVariations=_options.flipVariations,
1358_options$allowedAutoP=_options.allowedAutoPlacements,
1359allowedAutoPlacements=_options$allowedAutoP===void 0?placements:_options$allowedAutoP;
1360var variation=getVariation(placement);
1361var placements$1=(variation?flipVariations?variationPlacements:variationPlacements.filter(function(placement){
1362return getVariation(placement)===variation;
1363}):basePlacements).filter(function(placement){
1364return allowedAutoPlacements.indexOf(placement)>=0;
1365});// $FlowFixMe: Flow seems to have problems with two array unions...
1366
1367var overflows=placements$1.reduce(function(acc,placement){
1368acc[placement]=detectOverflow(state,{
1369placement:placement,
1370boundary:boundary,
1371rootBoundary:rootBoundary,
1372padding:padding})[
1373getBasePlacement(placement)];
1374return acc;
1375},{});
1376return Object.keys(overflows).sort(function(a,b){
1377return overflows[a]-overflows[b];
1378});
1379}
1380
1381function getExpandedFallbackPlacements(placement){
1382if(getBasePlacement(placement)===auto){
1383return[];
1384}
1385
1386var oppositePlacement=getOppositePlacement(placement);
1387return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)];
1388}
1389
1390function flip(_ref){
1391var state=_ref.state,
1392options=_ref.options,
1393name=_ref.name;
1394
1395if(state.modifiersData[name]._skip){
1396return;
1397}
1398
1399var specifiedFallbackPlacements=options.fallbackPlacements,
1400padding=options.padding,
1401boundary=options.boundary,
1402rootBoundary=options.rootBoundary,
1403altBoundary=options.altBoundary,
1404_options$flipVariatio=options.flipVariations,
1405flipVariations=_options$flipVariatio===void 0?true:_options$flipVariatio,
1406allowedAutoPlacements=options.allowedAutoPlacements;
1407var preferredPlacement=state.options.placement;
1408var basePlacement=getBasePlacement(preferredPlacement);
1409var isBasePlacement=basePlacement===preferredPlacement;
1410var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));
1411var placements=[preferredPlacement].concat(fallbackPlacements).reduce(function(acc,placement){
1412return acc.concat(getBasePlacement(placement)===auto?computeAutoPlacement(state,{
1413placement:placement,
1414boundary:boundary,
1415rootBoundary:rootBoundary,
1416padding:padding,
1417flipVariations:flipVariations,
1418allowedAutoPlacements:allowedAutoPlacements}):
1419placement);
1420},[]);
1421var referenceRect=state.rects.reference;
1422var popperRect=state.rects.popper;
1423var checksMap=new Map();
1424var makeFallbackChecks=true;
1425var firstFittingPlacement=placements[0];
1426
1427for(var i=0;i<placements.length;i++){
1428var placement=placements[i];
1429
1430var _basePlacement=getBasePlacement(placement);
1431
1432var isStartVariation=getVariation(placement)===start;
1433var isVertical=[top,bottom].indexOf(_basePlacement)>=0;
1434var len=isVertical?'width':'height';
1435var overflow=detectOverflow(state,{
1436placement:placement,
1437boundary:boundary,
1438rootBoundary:rootBoundary,
1439altBoundary:altBoundary,
1440padding:padding});
vendor: 7,985 bytes, lines 1441-1681
1441
1442var mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;
1443
1444if(referenceRect[len]>popperRect[len]){
1445mainVariationSide=getOppositePlacement(mainVariationSide);
1446}
1447
1448var altVariationSide=getOppositePlacement(mainVariationSide);
1449var checks=[overflow[_basePlacement]<=0,overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0];
1450
1451if(checks.every(function(check){
1452return check;
1453})){
1454firstFittingPlacement=placement;
1455makeFallbackChecks=false;
1456break;
1457}
1458
1459checksMap.set(placement,checks);
1460}
1461
1462if(makeFallbackChecks){
1463// `2` may be desired in some cases – research later
1464var numberOfChecks=flipVariations?3:1;
1465
1466var _loop=function _loop(_i){
1467var fittingPlacement=placements.find(function(placement){
1468var checks=checksMap.get(placement);
1469
1470if(checks){
1471return checks.slice(0,_i).every(function(check){
1472return check;
1473});
1474}
1475});
1476
1477if(fittingPlacement){
1478firstFittingPlacement=fittingPlacement;
1479return"break";
1480}
1481};
1482
1483for(var _i=numberOfChecks;_i>0;_i--){
1484var _ret=_loop(_i);
1485
1486if(_ret==="break")break;
1487}
1488}
1489
1490if(state.placement!==firstFittingPlacement){
1491state.modifiersData[name]._skip=true;
1492state.placement=firstFittingPlacement;
1493state.reset=true;
1494}
1495}// eslint-disable-next-line import/no-unused-modules
1496
1497
1498var flip$1={
1499name:'flip',
1500enabled:true,
1501phase:'main',
1502fn:flip,
1503requiresIfExists:['offset'],
1504data:{
1505_skip:false}};
1506
1507
1508
1509function getAltAxis(axis){
1510return axis==='x'?'y':'x';
1511}
1512
1513function within(min,value,max){
1514return Math.max(min,Math.min(value,max));
1515}
1516
1517function preventOverflow(_ref){
1518var state=_ref.state,
1519options=_ref.options,
1520name=_ref.name;
1521var _options$mainAxis=options.mainAxis,
1522checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,
1523_options$altAxis=options.altAxis,
1524checkAltAxis=_options$altAxis===void 0?false:_options$altAxis,
1525boundary=options.boundary,
1526rootBoundary=options.rootBoundary,
1527altBoundary=options.altBoundary,
1528padding=options.padding,
1529_options$tether=options.tether,
1530tether=_options$tether===void 0?true:_options$tether,
1531_options$tetherOffset=options.tetherOffset,
1532tetherOffset=_options$tetherOffset===void 0?0:_options$tetherOffset;
1533var overflow=detectOverflow(state,{
1534boundary:boundary,
1535rootBoundary:rootBoundary,
1536padding:padding,
1537altBoundary:altBoundary});
1538
1539var basePlacement=getBasePlacement(state.placement);
1540var variation=getVariation(state.placement);
1541var isBasePlacement=!variation;
1542var mainAxis=getMainAxisFromPlacement(basePlacement);
1543var altAxis=getAltAxis(mainAxis);
1544var popperOffsets=state.modifiersData.popperOffsets;
1545var referenceRect=state.rects.reference;
1546var popperRect=state.rects.popper;
1547var tetherOffsetValue=typeof tetherOffset==='function'?tetherOffset(Object.assign({},state.rects,{
1548placement:state.placement})):
1549tetherOffset;
1550var data={
1551x:0,
1552y:0};
1553
1554
1555if(!popperOffsets){
1556return;
1557}
1558
1559if(checkMainAxis){
1560var mainSide=mainAxis==='y'?top:left;
1561var altSide=mainAxis==='y'?bottom:right;
1562var len=mainAxis==='y'?'height':'width';
1563var offset=popperOffsets[mainAxis];
1564var min=popperOffsets[mainAxis]+overflow[mainSide];
1565var max=popperOffsets[mainAxis]-overflow[altSide];
1566var additive=tether?-popperRect[len]/2:0;
1567var minLen=variation===start?referenceRect[len]:popperRect[len];
1568var maxLen=variation===start?-popperRect[len]:-referenceRect[len];// We need to include the arrow in the calculation so the arrow doesn't go
1569// outside the reference bounds
1570
1571var arrowElement=state.elements.arrow;
1572var arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{
1573width:0,
1574height:0};
1575
1576var arrowPaddingObject=state.modifiersData['arrow#persistent']?state.modifiersData['arrow#persistent'].padding:getFreshSideObject();
1577var arrowPaddingMin=arrowPaddingObject[mainSide];
1578var arrowPaddingMax=arrowPaddingObject[altSide];// If the reference length is smaller than the arrow length, we don't want
1579// to include its full size in the calculation. If the reference is small
1580// and near the edge of a boundary, the popper can overflow even if the
1581// reference is not overflowing as well (e.g. virtual elements with no
1582// width or height)
1583
1584var arrowLen=within(0,referenceRect[len],arrowRect[len]);
1585var minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-tetherOffsetValue:minLen-arrowLen-arrowPaddingMin-tetherOffsetValue;
1586var maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+tetherOffsetValue:maxLen+arrowLen+arrowPaddingMax+tetherOffsetValue;
1587var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);
1588var clientOffset=arrowOffsetParent?mainAxis==='y'?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;
1589var offsetModifierValue=state.modifiersData.offset?state.modifiersData.offset[state.placement][mainAxis]:0;
1590var tetherMin=popperOffsets[mainAxis]+minOffset-offsetModifierValue-clientOffset;
1591var tetherMax=popperOffsets[mainAxis]+maxOffset-offsetModifierValue;
1592var preventedOffset=within(tether?Math.min(min,tetherMin):min,offset,tether?Math.max(max,tetherMax):max);
1593popperOffsets[mainAxis]=preventedOffset;
1594data[mainAxis]=preventedOffset-offset;
1595}
1596
1597if(checkAltAxis){
1598var _mainSide=mainAxis==='x'?top:left;
1599
1600var _altSide=mainAxis==='x'?bottom:right;
1601
1602var _offset=popperOffsets[altAxis];
1603
1604var _min=_offset+overflow[_mainSide];
1605
1606var _max=_offset-overflow[_altSide];
1607
1608var _preventedOffset=within(_min,_offset,_max);
1609
1610popperOffsets[altAxis]=_preventedOffset;
1611data[altAxis]=_preventedOffset-_offset;
1612}
1613
1614state.modifiersData[name]=data;
1615}// eslint-disable-next-line import/no-unused-modules
1616
1617
1618var preventOverflow$1={
1619name:'preventOverflow',
1620enabled:true,
1621phase:'main',
1622fn:preventOverflow,
1623requiresIfExists:['offset']};
1624
1625
1626function arrow(_ref){
1627var _state$modifiersData$;
1628
1629var state=_ref.state,
1630name=_ref.name;
1631var arrowElement=state.elements.arrow;
1632var popperOffsets=state.modifiersData.popperOffsets;
1633var basePlacement=getBasePlacement(state.placement);
1634var axis=getMainAxisFromPlacement(basePlacement);
1635var isVertical=[left,right].indexOf(basePlacement)>=0;
1636var len=isVertical?'height':'width';
1637
1638if(!arrowElement||!popperOffsets){
1639return;
1640}
1641
1642var paddingObject=state.modifiersData[name+"#persistent"].padding;
1643var arrowRect=getLayoutRect(arrowElement);
1644var minProp=axis==='y'?top:left;
1645var maxProp=axis==='y'?bottom:right;
1646var endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets[axis]-state.rects.popper[len];
1647var startDiff=popperOffsets[axis]-state.rects.reference[axis];
1648var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);
1649var clientSize=arrowOffsetParent?axis==='y'?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;
1650var centerToReference=endDiff/2-startDiff/2;// Make sure the arrow doesn't overflow the popper if the center point is
1651// outside of the popper bounds
1652
1653var min=paddingObject[minProp];
1654var max=clientSize-arrowRect[len]-paddingObject[maxProp];
1655var center=clientSize/2-arrowRect[len]/2+centerToReference;
1656var offset=within(min,center,max);// Prevents breaking syntax highlighting...
1657
1658var axisProp=axis;
1659state.modifiersData[name]=(_state$modifiersData$={},_state$modifiersData$[axisProp]=offset,_state$modifiersData$.centerOffset=offset-center,_state$modifiersData$);
1660}
1661
1662function effect$2(_ref2){
1663var state=_ref2.state,
1664options=_ref2.options,
1665name=_ref2.name;
1666var _options$element=options.element,
1667arrowElement=_options$element===void 0?'[data-popper-arrow]':_options$element,
1668_options$padding=options.padding,
1669padding=_options$padding===void 0?0:_options$padding;// CSS selector
1670
1671if(typeof arrowElement==='string'){
1672arrowElement=state.elements.popper.querySelector(arrowElement);
1673
1674if(!arrowElement){
1675return;
1676}
1677}
1678
1679if(!contains(state.elements.popper,arrowElement)){
1680if(process.env.NODE_ENV!=="production"){
1681console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper','element.'].join(' '));
1682}
1683
1684return;
1685}
1686
1687state.elements.arrow=arrowElement;
1688state.modifiersData[name+"#persistent"]={
1689padding:mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements))};
1690
1691}// eslint-disable-next-line import/no-unused-modules
1692
1693
1694var arrow$1={
1695name:'arrow',
1696enabled:true,
1697phase:'main',
1698fn:arrow,
1699effect:effect$2,
1700requires:['popperOffsets'],
1701requiresIfExists:['preventOverflow']};
1702
1703
1704function getSideOffsets(overflow,rect,preventedOffsets){
1705if(preventedOffsets===void 0){
1706preventedOffsets={
1707x:0,
1708y:0};
1709
1710}
1711
1712return{
1713top:overflow.top-rect.height-preventedOffsets.y,
1714right:overflow.right-rect.width+preventedOffsets.x,
1715bottom:overflow.bottom-rect.height+preventedOffsets.y,
1716left:overflow.left-rect.width-preventedOffsets.x};
1717
1718}
1719
1720function isAnySideFullyClipped(overflow){
1721return[top,right,bottom,left].some(function(side){
1722return overflow[side]>=0;
1723});
1724}
1725
1726function hide(_ref){
1727var state=_ref.state,
1728name=_ref.name;
1729var referenceRect=state.rects.reference;
1730var popperRect=state.rects.popper;
1731var preventedOffsets=state.modifiersData.preventOverflow;
1732var referenceOverflow=detectOverflow(state,{
1733elementContext:'reference'});
1734
1735var popperAltOverflow=detectOverflow(state,{
1736altBoundary:true});
1737
1738var referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect);
1739var popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets);
1740var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);
1741var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);
1742state.modifiersData[name]={
1743referenceClippingOffsets:referenceClippingOffsets,
1744popperEscapeOffsets:popperEscapeOffsets,
1745isReferenceHidden:isReferenceHidden,
1746hasPopperEscaped:hasPopperEscaped};
1747
1748state.attributes.popper=Object.assign({},state.attributes.popper,{
1749'data-popper-reference-hidden':isReferenceHidden,
1750'data-popper-escaped':hasPopperEscaped});
1751
1752}// eslint-disable-next-line import/no-unused-modules
1753
1754
1755var hide$1={
1756name:'hide',
1757enabled:true,
1758phase:'main',
1759requiresIfExists:['preventOverflow'],
1760fn:hide};
1761
1762
1763var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];
1764var createPopper=/*#__PURE__*/popperGenerator({
1765defaultModifiers:defaultModifiers});
1766// eslint-disable-next-line import/no-unused-modules
1767
1768exports.createPopper=createPopper;
1769exports.defaultModifiers=defaultModifiers;
1770exports.detectOverflow=detectOverflow;
1771exports.popperGenerator=popperGenerator;
1772
1773
1774}).call(this,require('_process'));
1775
1776},{"_process":9}],2:[function(require,module,exports){
1777/**
1778 * matchesSelector v2.0.2
1779 * matchesSelector( element, '.selector' )
1780 * MIT license
1781 */
1782
1783/*jshint browser: true, strict: true, undef: true, unused: true */
1784
1785(function(window,factory){
1786/*global define: false, module: false */
1787'use strict';
1788// universal module definition
1789if(typeof define=='function'&&define.amd){
1790// AMD
1791define(factory);
1792}else if((typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module.exports){
1793// CommonJS
1794module.exports=factory();
1795}else{
1796// browser global
1797window.matchesSelector=factory();
1798}
1799
1800})(window,function factory(){
1801'use strict';
1802
1803var matchesMethod=function(){
1804var ElemProto=window.Element.prototype;
1805// check for the standard method name first
1806if(ElemProto.matches){
1807return'matches';
1808}
1809// check un-prefixed
1810if(ElemProto.matchesSelector){
1811return'matchesSelector';
1812}
1813// check vendor prefixes
1814var prefixes=['webkit','moz','ms','o'];
1815
1816for(var i=0;i<prefixes.length;i++){
1817var prefix=prefixes[i];
1818var method=prefix+'MatchesSelector';
1819if(ElemProto[method]){
1820return method;
1821}
1822}
1823}();
1824
1825return function matchesSelector(elem,selector){
1826return elem[matchesMethod](selector);
1827};
1828
1829});
1830
1831},{}],3:[function(require,module,exports){
1832/**
1833 * EvEmitter v1.1.0
1834 * Lil' event emitter
1835 * MIT License
1836 */
1837
1838/* jshint unused: true, undef: true, strict: true */
1839
1840(function(global,factory){
1841// universal module definition
1842/* jshint strict: false *//* globals define, module, window */
1843if(typeof define=='function'&&define.amd){
1844// AMD - RequireJS
1845define(factory);
1846}else if((typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module.exports){
1847// CommonJS - Browserify, Webpack
1848module.exports=factory();
1849}else{
1850// Browser globals
1851global.EvEmitter=factory();
1852}
1853
1854})(typeof window!='undefined'?window:this,function(){
1855
1856"use strict";
1857
1858function EvEmitter(){}
1859
1860var proto=EvEmitter.prototype;
1861
1862proto.on=function(eventName,listener){
1863if(!eventName||!listener){
1864return;
1865}
1866// set events hash
1867var events=this._events=this._events||{};
1868// set listeners array
1869var listeners=events[eventName]=events[eventName]||[];
1870// only add once
1871if(listeners.indexOf(listener)==-1){
1872listeners.push(listener);
1873}
1874
1875return this;
1876};
1877
1878proto.once=function(eventName,listener){
1879if(!eventName||!listener){
1880return;
1881}
1882// add event
1883this.on(eventName,listener);
1884// set once flag
1885// set onceEvents hash
1886var onceEvents=this._onceEvents=this._onceEvents||{};
1887// set onceListeners object
1888var onceListeners=onceEvents[eventName]=onceEvents[eventName]||{};
1889// set flag
1890onceListeners[listener]=true;
1891
1892return this;
1893};
1894
1895proto.off=function(eventName,listener){
1896var listeners=this._events&&this._events[eventName];
1897if(!listeners||!listeners.length){
1898return;
1899}
1900var index=listeners.indexOf(listener);
1901if(index!=-1){
1902listeners.splice(index,1);
1903}
1904
1905return this;
1906};
1907
1908proto.emitEvent=function(eventName,args){
1909var listeners=this._events&&this._events[eventName];
1910if(!listeners||!listeners.length){
1911return;
1912}
1913// copy over to avoid interference if .off() in listener
1914listeners=listeners.slice(0);
1915args=args||[];
1916// once stuff
1917var onceListeners=this._onceEvents&&this._onceEvents[eventName];
1918
1919for(var i=0;i<listeners.length;i++){
1920var listener=listeners[i];
1921var isOnce=onceListeners&&onceListeners[listener];
1922if(isOnce){
1923// remove listener
1924// remove before trigger to prevent recursion
1925this.off(eventName,listener);
1926// unset once flag
1927delete onceListeners[listener];
1928}
1929// trigger listener
1930listener.apply(this,args);
1931}
1932
1933return this;
1934};
1935
1936proto.allOff=function(){
1937delete this._events;
1938delete this._onceEvents;
1939};
1940
1941return EvEmitter;
1942
1943});
1944
1945},{}],4:[function(require,module,exports){
1946/**
1947 * Fizzy UI utils v2.0.7
1948 * MIT license
1949 */
1950
1951/*jshint browser: true, undef: true, unused: true, strict: true */
1952
1953(function(window,factory){
1954// universal module definition
1955/*jshint strict: false *//*globals define, module, require */
1956
1957if(typeof define=='function'&&define.amd){
1958// AMD
1959define([
1960'desandro-matches-selector/matches-selector'],
1961function(matchesSelector){
1962return factory(window,matchesSelector);
1963});
1964}else if((typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module.exports){
1965// CommonJS
1966module.exports=factory(
1967window,
1968require('desandro-matches-selector'));
1969
1970}else{
1971// browser global
1972window.fizzyUIUtils=factory(
1973window,
1974window.matchesSelector);
1975
1976}
1977
1978})(window,function factory(window,matchesSelector){
1979
1980'use strict';
1981
1982var utils={};
1983
1984// ----- extend ----- //
1985
1986// extends objects
1987utils.extend=function(a,b){
1988for(var prop in b){
1989a[prop]=b[prop];
1990}
1991return a;
1992};
1993
1994// ----- modulo ----- //
1995
1996utils.modulo=function(num,div){
1997return(num%div+div)%div;
1998};
1999
2000// ----- makeArray ----- //
2001
2002var arraySlice=Array.prototype.slice;
2003
2004// turn element or nodeList into an array
2005utils.makeArray=function(obj){
2006if(Array.isArray(obj)){
2007// use object if already an array
2008return obj;
2009}
2010// return empty array if undefined or null. #6
2011if(obj===null||obj===undefined){
2012return[];
2013}
2014
2015var isArrayLike=(typeof obj==="undefined"?"undefined":_typeof2(obj))=='object'&&typeof obj.length=='number';
2016if(isArrayLike){
2017// convert nodeList to array
2018return arraySlice.call(obj);
2019}
2020
2021// array of single index
2022return[obj];
2023};
2024
2025// ----- removeFrom ----- //
2026
2027utils.removeFrom=function(ary,obj){
2028var index=ary.indexOf(obj);
2029if(index!=-1){
2030ary.splice(index,1);
2031}
2032};
2033
2034// ----- getParent ----- //
2035
2036utils.getParent=function(elem,selector){
2037while(elem.parentNode&&elem!=document.body){
2038elem=elem.parentNode;
2039if(matchesSelector(elem,selector)){
2040return elem;
2041}
2042}
2043};
2044
2045// ----- getQueryElement ----- //
2046
2047// use element as selector string
2048utils.getQueryElement=function(elem){
2049if(typeof elem=='string'){
2050return document.querySelector(elem);
2051}
2052return elem;
2053};
2054
2055// ----- handleEvent ----- //
2056
2057// enable .ontype to trigger from .addEventListener( elem, 'type' )
2058utils.handleEvent=function(event){
2059var method='on'+event.type;
2060if(this[method]){
2061this[method](event);
2062}
2063};
2064
2065// ----- filterFindElements ----- //
2066
2067utils.filterFindElements=function(elems,selector){
2068// make array of elems
2069elems=utils.makeArray(elems);
2070var ffElems=[];
2071
2072elems.forEach(function(elem){
2073// check that elem is an actual element
2074if(!(elem instanceof HTMLElement)){
2075return;
2076}
2077// add elem if no selector
2078if(!selector){
2079ffElems.push(elem);
2080return;
2081}
2082// filter & find items if we have a selector
2083// filter
vendor: 10,272 bytes, lines 2084-2492
2084if(matchesSelector(elem,selector)){
2085ffElems.push(elem);
2086}
2087// find children
2088var childElems=elem.querySelectorAll(selector);
2089// concat childElems to filterFound array
2090for(var i=0;i<childElems.length;i++){
2091ffElems.push(childElems[i]);
2092}
2093});
2094
2095return ffElems;
2096};
2097
2098// ----- debounceMethod ----- //
2099
2100utils.debounceMethod=function(_class,methodName,threshold){
2101threshold=threshold||100;
2102// original method
2103var method=_class.prototype[methodName];
2104var timeoutName=methodName+'Timeout';
2105
2106_class.prototype[methodName]=function(){
2107var timeout=this[timeoutName];
2108clearTimeout(timeout);
2109
2110var args=arguments;
2111var _this=this;
2112this[timeoutName]=setTimeout(function(){
2113method.apply(_this,args);
2114delete _this[timeoutName];
2115},threshold);
2116};
2117};
2118
2119// ----- docReady ----- //
2120
2121utils.docReady=function(callback){
2122var readyState=document.readyState;
2123if(readyState=='complete'||readyState=='interactive'){
2124// do async to allow for other scripts to run. metafizzy/flickity#441
2125setTimeout(callback);
2126}else{
2127document.addEventListener('DOMContentLoaded',callback);
2128}
2129};
2130
2131// ----- htmlInit ----- //
2132
2133// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
2134utils.toDashed=function(str){
2135return str.replace(/(.)([A-Z])/g,function(match,$1,$2){
2136return $1+'-'+$2;
2137}).toLowerCase();
2138};
2139
2140var console=window.console;
2141/**
2142 * allow user to initialize classes via [data-namespace] or .js-namespace class
2143 * htmlInit( Widget, 'widgetName' )
2144 * options are parsed from data-namespace-options
2145 */
2146utils.htmlInit=function(WidgetClass,namespace){
2147utils.docReady(function(){
2148var dashedNamespace=utils.toDashed(namespace);
2149var dataAttr='data-'+dashedNamespace;
2150var dataAttrElems=document.querySelectorAll('['+dataAttr+']');
2151var jsDashElems=document.querySelectorAll('.js-'+dashedNamespace);
2152var elems=utils.makeArray(dataAttrElems).
2153concat(utils.makeArray(jsDashElems));
2154var dataOptionsAttr=dataAttr+'-options';
2155var jQuery=window.jQuery;
2156
2157elems.forEach(function(elem){
2158var attr=elem.getAttribute(dataAttr)||
2159elem.getAttribute(dataOptionsAttr);
2160var options;
2161try{
2162options=attr&&JSON.parse(attr);
2163}catch(error){
2164// log error, do not initialize
2165if(console){
2166console.error('Error parsing '+dataAttr+' on '+elem.className+
2167': '+error);
2168}
2169return;
2170}
2171// initialize
2172var instance=new WidgetClass(elem,options);
2173// make available via $().data('namespace')
2174if(jQuery){
2175jQuery.data(elem,namespace,instance);
2176}
2177});
2178
2179});
2180};
2181
2182// -----  ----- //
2183
2184return utils;
2185
2186});
2187
2188},{"desandro-matches-selector":2}],5:[function(require,module,exports){
2189/*!
2190 * getSize v2.0.3
2191 * measure size of elements
2192 * MIT license
2193 */
2194
2195/* jshint browser: true, strict: true, undef: true, unused: true */
2196/* globals console: false */
2197
2198(function(window,factory){
2199/* jshint strict: false *//* globals define, module */
2200if(typeof define=='function'&&define.amd){
2201// AMD
2202define(factory);
2203}else if((typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module.exports){
2204// CommonJS
2205module.exports=factory();
2206}else{
2207// browser global
2208window.getSize=factory();
2209}
2210
2211})(window,function factory(){
2212'use strict';
2213
2214// -------------------------- helpers -------------------------- //
2215
2216// get a number from a string, not a percentage
2217function getStyleSize(value){
2218var num=parseFloat(value);
2219// not a percent like '100%', and a number
2220var isValid=value.indexOf('%')==-1&&!isNaN(num);
2221return isValid&&num;
2222}
2223
2224function noop(){}
2225
2226var logError=typeof console=='undefined'?noop:
2227function(message){
2228console.error(message);
2229};
2230
2231// -------------------------- measurements -------------------------- //
2232
2233var measurements=[
2234'paddingLeft',
2235'paddingRight',
2236'paddingTop',
2237'paddingBottom',
2238'marginLeft',
2239'marginRight',
2240'marginTop',
2241'marginBottom',
2242'borderLeftWidth',
2243'borderRightWidth',
2244'borderTopWidth',
2245'borderBottomWidth'];
2246
2247
2248var measurementsLength=measurements.length;
2249
2250function getZeroSize(){
2251var size={
2252width:0,
2253height:0,
2254innerWidth:0,
2255innerHeight:0,
2256outerWidth:0,
2257outerHeight:0};
2258
2259for(var i=0;i<measurementsLength;i++){
2260var measurement=measurements[i];
2261size[measurement]=0;
2262}
2263return size;
2264}
2265
2266// -------------------------- getStyle -------------------------- //
2267
2268/**
2269 * getStyle, get style of element, check for Firefox bug
2270 * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
2271 */
2272function getStyle(elem){
2273var style=getComputedStyle(elem);
2274if(!style){
2275logError('Style returned '+style+
2276'. Are you running this code in a hidden iframe on Firefox? '+
2277'See https://bit.ly/getsizebug1');
2278}
2279return style;
2280}
2281
2282// -------------------------- setup -------------------------- //
2283
2284var isSetup=false;
2285
2286var isBoxSizeOuter;
2287
2288/**
2289 * setup
2290 * check isBoxSizerOuter
2291 * do on first getSize() rather than on page load for Firefox bug
2292 */
2293function setup(){
2294// setup once
2295if(isSetup){
2296return;
2297}
2298isSetup=true;
2299
2300// -------------------------- box sizing -------------------------- //
2301
2302/**
2303   * Chrome & Safari measure the outer-width on style.width on border-box elems
2304   * IE11 & Firefox<29 measures the inner-width
2305   */
2306var div=document.createElement('div');
2307div.style.width='200px';
2308div.style.padding='1px 2px 3px 4px';
2309div.style.borderStyle='solid';
2310div.style.borderWidth='1px 2px 3px 4px';
2311div.style.boxSizing='border-box';
2312
2313var body=document.body||document.documentElement;
2314body.appendChild(div);
2315var style=getStyle(div);
2316// round value for browser zoom. desandro/masonry#928
2317isBoxSizeOuter=Math.round(getStyleSize(style.width))==200;
2318getSize.isBoxSizeOuter=isBoxSizeOuter;
2319
2320body.removeChild(div);
2321}
2322
2323// -------------------------- getSize -------------------------- //
2324
2325function getSize(elem){
2326setup();
2327
2328// use querySeletor if elem is string
2329if(typeof elem=='string'){
2330elem=document.querySelector(elem);
2331}
2332
2333// do not proceed on non-objects
2334if(!elem||(typeof elem==="undefined"?"undefined":_typeof2(elem))!='object'||!elem.nodeType){
2335return;
2336}
2337
2338var style=getStyle(elem);
2339
2340// if hidden, everything is 0
2341if(style.display=='none'){
2342return getZeroSize();
2343}
2344
2345var size={};
2346size.width=elem.offsetWidth;
2347size.height=elem.offsetHeight;
2348
2349var isBorderBox=size.isBorderBox=style.boxSizing=='border-box';
2350
2351// get all measurements
2352for(var i=0;i<measurementsLength;i++){
2353var measurement=measurements[i];
2354var value=style[measurement];
2355var num=parseFloat(value);
2356// any 'auto', 'medium' value will be 0
2357size[measurement]=!isNaN(num)?num:0;
2358}
2359
2360var paddingWidth=size.paddingLeft+size.paddingRight;
2361var paddingHeight=size.paddingTop+size.paddingBottom;
2362var marginWidth=size.marginLeft+size.marginRight;
2363var marginHeight=size.marginTop+size.marginBottom;
2364var borderWidth=size.borderLeftWidth+size.borderRightWidth;
2365var borderHeight=size.borderTopWidth+size.borderBottomWidth;
2366
2367var isBorderBoxSizeOuter=isBorderBox&&isBoxSizeOuter;
2368
2369// overwrite width and height if we can get it from style
2370var styleWidth=getStyleSize(style.width);
2371if(styleWidth!==false){
2372size.width=styleWidth+(
2373// add padding and border unless it's already including it
2374isBorderBoxSizeOuter?0:paddingWidth+borderWidth);
2375}
2376
2377var styleHeight=getStyleSize(style.height);
2378if(styleHeight!==false){
2379size.height=styleHeight+(
2380// add padding and border unless it's already including it
2381isBorderBoxSizeOuter?0:paddingHeight+borderHeight);
2382}
2383
2384size.innerWidth=size.width-(paddingWidth+borderWidth);
2385size.innerHeight=size.height-(paddingHeight+borderHeight);
2386
2387size.outerWidth=size.width+marginWidth;
2388size.outerHeight=size.height+marginHeight;
2389
2390return size;
2391}
2392
2393return getSize;
2394
2395});
2396
2397},{}],6:[function(require,module,exports){
2398/*!
2399 * Masonry v4.2.2
2400 * Cascading grid layout library
2401 * https://masonry.desandro.com
2402 * MIT License
2403 * by David DeSandro
2404 */
2405
2406(function(window,factory){
2407// universal module definition
2408/* jshint strict: false *//*globals define, module, require */
2409if(typeof define=='function'&&define.amd){
2410// AMD
2411define([
2412'outlayer/outlayer',
2413'get-size/get-size'],
2414
2415factory);
2416}else if((typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module.exports){
2417// CommonJS
2418module.exports=factory(
2419require('outlayer'),
2420require('get-size'));
2421
2422}else{
2423// browser global
2424window.Masonry=factory(
2425window.Outlayer,
2426window.getSize);
2427
2428}
2429
2430})(window,function factory(Outlayer,getSize){
2431
2432'use strict';
2433
2434// -------------------------- masonryDefinition -------------------------- //
2435
2436// create an Outlayer layout class
2437var Masonry=Outlayer.create('masonry');
2438// isFitWidth -> fitWidth
2439Masonry.compatOptions.fitWidth='isFitWidth';
2440
2441var proto=Masonry.prototype;
2442
2443proto._resetLayout=function(){
2444this.getSize();
2445this._getMeasurement('columnWidth','outerWidth');
2446this._getMeasurement('gutter','outerWidth');
2447this.measureColumns();
2448
2449// reset column Y
2450this.colYs=[];
2451for(var i=0;i<this.cols;i++){
2452this.colYs.push(0);
2453}
2454
2455this.maxY=0;
2456this.horizontalColIndex=0;
2457};
2458
2459proto.measureColumns=function(){
2460this.getContainerWidth();
2461// if columnWidth is 0, default to outerWidth of first item
2462if(!this.columnWidth){
2463var firstItem=this.items[0];
2464var firstItemElem=firstItem&&firstItem.element;
2465// columnWidth fall back to item of first element
2466this.columnWidth=firstItemElem&&getSize(firstItemElem).outerWidth||
2467// if first elem has no width, default to size of container
2468this.containerWidth;
2469}
2470
2471var columnWidth=this.columnWidth+=this.gutter;
2472
2473// calculate columns
2474var containerWidth=this.containerWidth+this.gutter;
2475var cols=containerWidth/columnWidth;
2476// fix rounding errors, typically with gutters
2477var excess=columnWidth-containerWidth%columnWidth;
2478// if overshoot is less than a pixel, round up, otherwise floor it
2479var mathMethod=excess&&excess<1?'round':'floor';
2480cols=Math[mathMethod](cols);
2481this.cols=Math.max(cols,1);
2482};
2483
2484proto.getContainerWidth=function(){
2485// container is parent if fit width
2486var isFitWidth=this._getOption('fitWidth');
2487var container=isFitWidth?this.element.parentNode:this.element;
2488// check that this.size and size are there
2489// IE8 triggers resize on body size change, so they might not be
2490var size=getSize(container);
2491this.containerWidth=size&&size.innerWidth;
2492};
vendor: 3,933 bytes, lines 2493-2632
2493
2494proto._getItemLayoutPosition=function(item){
2495item.getSize();
2496// how many columns does this brick span
2497var remainder=item.size.outerWidth%this.columnWidth;
2498var mathMethod=remainder&&remainder<1?'round':'ceil';
2499// round if off by 1 pixel, otherwise use ceil
2500var colSpan=Math[mathMethod](item.size.outerWidth/this.columnWidth);
2501colSpan=Math.min(colSpan,this.cols);
2502// use horizontal or top column position
2503var colPosMethod=this.options.horizontalOrder?
2504'_getHorizontalColPosition':'_getTopColPosition';
2505var colPosition=this[colPosMethod](colSpan,item);
2506// position the brick
2507var position={
2508x:this.columnWidth*colPosition.col,
2509y:colPosition.y};
2510
2511// apply setHeight to necessary columns
2512var setHeight=colPosition.y+item.size.outerHeight;
2513var setMax=colSpan+colPosition.col;
2514for(var i=colPosition.col;i<setMax;i++){
2515this.colYs[i]=setHeight;
2516}
2517
2518return position;
2519};
2520
2521proto._getTopColPosition=function(colSpan){
2522var colGroup=this._getTopColGroup(colSpan);
2523// get the minimum Y value from the columns
2524var minimumY=Math.min.apply(Math,colGroup);
2525
2526return{
2527col:colGroup.indexOf(minimumY),
2528y:minimumY};
2529
2530};
2531
2532/**
2533   * @param {Number} colSpan - number of columns the element spans
2534   * @returns {Array} colGroup
2535   */
2536proto._getTopColGroup=function(colSpan){
2537if(colSpan<2){
2538// if brick spans only one column, use all the column Ys
2539return this.colYs;
2540}
2541
2542var colGroup=[];
2543// how many different places could this brick fit horizontally
2544var groupCount=this.cols+1-colSpan;
2545// for each group potential horizontal position
2546for(var i=0;i<groupCount;i++){
2547colGroup[i]=this._getColGroupY(i,colSpan);
2548}
2549return colGroup;
2550};
2551
2552proto._getColGroupY=function(col,colSpan){
2553if(colSpan<2){
2554return this.colYs[col];
2555}
2556// make an array of colY values for that one group
2557var groupColYs=this.colYs.slice(col,col+colSpan);
2558// and get the max value of the array
2559return Math.max.apply(Math,groupColYs);
2560};
2561
2562// get column position based on horizontal index. #873
2563proto._getHorizontalColPosition=function(colSpan,item){
2564var col=this.horizontalColIndex%this.cols;
2565var isOver=colSpan>1&&col+colSpan>this.cols;
2566// shift to next row if item can't fit on current row
2567col=isOver?0:col;
2568// don't let zero-size items take up space
2569var hasSize=item.size.outerWidth&&item.size.outerHeight;
2570this.horizontalColIndex=hasSize?col+colSpan:this.horizontalColIndex;
2571
2572return{
2573col:col,
2574y:this._getColGroupY(col,colSpan)};
2575
2576};
2577
2578proto._manageStamp=function(stamp){
2579var stampSize=getSize(stamp);
2580var offset=this._getElementOffset(stamp);
2581// get the columns that this stamp affects
2582var isOriginLeft=this._getOption('originLeft');
2583var firstX=isOriginLeft?offset.left:offset.right;
2584var lastX=firstX+stampSize.outerWidth;
2585var firstCol=Math.floor(firstX/this.columnWidth);
2586firstCol=Math.max(0,firstCol);
2587var lastCol=Math.floor(lastX/this.columnWidth);
2588// lastCol should not go over if multiple of columnWidth #425
2589lastCol-=lastX%this.columnWidth?0:1;
2590lastCol=Math.min(this.cols-1,lastCol);
2591// set colYs to bottom of the stamp
2592
2593var isOriginTop=this._getOption('originTop');
2594var stampMaxY=(isOriginTop?offset.top:offset.bottom)+
2595stampSize.outerHeight;
2596for(var i=firstCol;i<=lastCol;i++){
2597this.colYs[i]=Math.max(stampMaxY,this.colYs[i]);
2598}
2599};
2600
2601proto._getContainerSize=function(){
2602this.maxY=Math.max.apply(Math,this.colYs);
2603var size={
2604height:this.maxY};
2605
2606
2607if(this._getOption('fitWidth')){
2608size.width=this._getContainerFitWidth();
2609}
2610
2611return size;
2612};
2613
2614proto._getContainerFitWidth=function(){
2615var unusedCols=0;
2616// count unused columns
2617var i=this.cols;
2618while(--i){
2619if(this.colYs[i]!==0){
2620break;
2621}
2622unusedCols++;
2623}
2624// fit container to columns that have been used
2625return(this.cols-unusedCols)*this.columnWidth-this.gutter;
2626};
2627
2628proto.needsResizeLayout=function(){
2629var previousWidth=this.containerWidth;
2630this.getContainerWidth();
2631return previousWidth!=this.containerWidth;
2632};
2633
2634return Masonry;
2635
2636});
2637
2638},{"get-size":5,"outlayer":8}],7:[function(require,module,exports){
2639/**
2640 * Outlayer Item
2641 */
2642
2643(function(window,factory){
2644// universal module definition
2645/* jshint strict: false *//* globals define, module, require */
2646if(typeof define=='function'&&define.amd){
2647// AMD - RequireJS
2648define([
2649'ev-emitter/ev-emitter',
2650'get-size/get-size'],
2651
2652factory);
2653
2654}else if((typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module.exports){
2655// CommonJS - Browserify, Webpack
2656module.exports=factory(
2657require('ev-emitter'),
2658require('get-size'));
2659
2660}else{
2661// browser global
2662window.Outlayer={};
2663window.Outlayer.Item=factory(
2664window.EvEmitter,
2665window.getSize);
2666
2667}
2668
2669})(window,function factory(EvEmitter,getSize){
2670'use strict';
2671
2672// ----- helpers ----- //
2673
2674function isEmptyObj(obj){
2675for(var prop in obj){
2676return false;
2677}
2678prop=null;
2679return true;
2680}
2681
2682// -------------------------- CSS3 support -------------------------- //
2683
2684
2685var docElemStyle=document.documentElement.style;
2686
2687var transitionProperty=typeof docElemStyle.transition=='string'?
2688'transition':'WebkitTransition';
2689var transformProperty=typeof docElemStyle.transform=='string'?
2690'transform':'WebkitTransform';
2691
2692var transitionEndEvent={
2693WebkitTransition:'webkitTransitionEnd',
2694transition:'transitionend'}[
2695transitionProperty];
2696
2697// cache all vendor properties that could have vendor prefix
2698var vendorProperties={
2699transform:transformProperty,
2700transition:transitionProperty,
2701transitionDuration:transitionProperty+'Duration',
2702transitionProperty:transitionProperty+'Property',
2703transitionDelay:transitionProperty+'Delay'};
2704
2705
2706// -------------------------- Item -------------------------- //
2707
2708function Item(element,layout){
2709if(!element){
2710return;
2711}
2712
2713this.element=element;
2714// parent layout class, i.e. Masonry, Isotope, or Packery
2715this.layout=layout;
2716this.position={
2717x:0,
2718y:0};
2719
2720
2721this._create();
2722}
2723
2724// inherit EvEmitter
2725var proto=Item.prototype=Object.create(EvEmitter.prototype);
2726proto.constructor=Item;
2727
2728proto._create=function(){
2729// transition objects
2730this._transn={
2731ingProperties:{},
2732clean:{},
2733onEnd:{}};
2734
2735
2736this.css({
2737position:'absolute'});
2738
2739};
2740
2741// trigger specified handler for event type
2742proto.handleEvent=function(event){
2743var method='on'+event.type;
2744if(this[method]){
2745this[method](event);
2746}
2747};
2748
2749proto.getSize=function(){
2750this.size=getSize(this.element);
2751};
2752
2753/**
2754 * apply CSS styles to element
2755 * @param {Object} style
2756 */
2757proto.css=function(style){
2758var elemStyle=this.element.style;
2759
2760for(var prop in style){
2761// use vendor property if available
2762var supportedProp=vendorProperties[prop]||prop;
2763elemStyle[supportedProp]=style[prop];
2764}
2765};
2766
2767// measure position, and sets it
2768proto.getPosition=function(){
2769var style=getComputedStyle(this.element);
2770var isOriginLeft=this.layout._getOption('originLeft');
2771var isOriginTop=this.layout._getOption('originTop');
2772var xValue=style[isOriginLeft?'left':'right'];
2773var yValue=style[isOriginTop?'top':'bottom'];
2774var x=parseFloat(xValue);
2775var y=parseFloat(yValue);
2776// convert percent to pixels
2777var layoutSize=this.layout.size;
2778if(xValue.indexOf('%')!=-1){
2779x=x/100*layoutSize.width;
2780}
2781if(yValue.indexOf('%')!=-1){
2782y=y/100*layoutSize.height;
2783}
2784// clean up 'auto' or other non-integer values
2785x=isNaN(x)?0:x;
2786y=isNaN(y)?0:y;
2787// remove padding from measurement
2788x-=isOriginLeft?layoutSize.paddingLeft:layoutSize.paddingRight;
2789y-=isOriginTop?layoutSize.paddingTop:layoutSize.paddingBottom;
2790
2791this.position.x=x;
2792this.position.y=y;
2793};
2794
2795// set settled position, apply padding
2796proto.layoutPosition=function(){
2797var layoutSize=this.layout.size;
2798var style={};
2799var isOriginLeft=this.layout._getOption('originLeft');
2800var isOriginTop=this.layout._getOption('originTop');
2801
2802// x
2803var xPadding=isOriginLeft?'paddingLeft':'paddingRight';
2804var xProperty=isOriginLeft?'left':'right';
2805var xResetProperty=isOriginLeft?'right':'left';
2806
2807var x=this.position.x+layoutSize[xPadding];
2808// set in percentage or pixels
2809style[xProperty]=this.getXValue(x);
2810// reset other property
2811style[xResetProperty]='';
2812
2813// y
2814var yPadding=isOriginTop?'paddingTop':'paddingBottom';
2815var yProperty=isOriginTop?'top':'bottom';
2816var yResetProperty=isOriginTop?'bottom':'top';
2817
2818var y=this.position.y+layoutSize[yPadding];
2819// set in percentage or pixels
2820style[yProperty]=this.getYValue(y);
2821// reset other property
2822style[yResetProperty]='';
2823
2824this.css(style);
2825this.emitEvent('layout',[this]);
2826};
2827
2828proto.getXValue=function(x){
2829var isHorizontal=this.layout._getOption('horizontal');
2830return this.layout.options.percentPosition&&!isHorizontal?
2831x/this.layout.size.width*100+'%':x+'px';
2832};
2833
2834proto.getYValue=function(y){
2835var isHorizontal=this.layout._getOption('horizontal');
2836return this.layout.options.percentPosition&&isHorizontal?
2837y/this.layout.size.height*100+'%':y+'px';
2838};
2839
2840proto._transitionTo=function(x,y){
2841this.getPosition();
vendor: 5,626 bytes, lines 2842-3053
2842// get current x & y from top/left
2843var curX=this.position.x;
2844var curY=this.position.y;
2845
2846var didNotMove=x==this.position.x&&y==this.position.y;
2847
2848// save end position
2849this.setPosition(x,y);
2850
2851// if did not move and not transitioning, just go to layout
2852if(didNotMove&&!this.isTransitioning){
2853this.layoutPosition();
2854return;
2855}
2856
2857var transX=x-curX;
2858var transY=y-curY;
2859var transitionStyle={};
2860transitionStyle.transform=this.getTranslate(transX,transY);
2861
2862this.transition({
2863to:transitionStyle,
2864onTransitionEnd:{
2865transform:this.layoutPosition},
2866
2867isCleaning:true});
2868
2869};
2870
2871proto.getTranslate=function(x,y){
2872// flip cooridinates if origin on right or bottom
2873var isOriginLeft=this.layout._getOption('originLeft');
2874var isOriginTop=this.layout._getOption('originTop');
2875x=isOriginLeft?x:-x;
2876y=isOriginTop?y:-y;
2877return'translate3d('+x+'px, '+y+'px, 0)';
2878};
2879
2880// non transition + transform support
2881proto.goTo=function(x,y){
2882this.setPosition(x,y);
2883this.layoutPosition();
2884};
2885
2886proto.moveTo=proto._transitionTo;
2887
2888proto.setPosition=function(x,y){
2889this.position.x=parseFloat(x);
2890this.position.y=parseFloat(y);
2891};
2892
2893// ----- transition ----- //
2894
2895/**
2896 * @param {Object} style - CSS
2897 * @param {Function} onTransitionEnd
2898 */
2899
2900// non transition, just trigger callback
2901proto._nonTransition=function(args){
2902this.css(args.to);
2903if(args.isCleaning){
2904this._removeStyles(args.to);
2905}
2906for(var prop in args.onTransitionEnd){
2907args.onTransitionEnd[prop].call(this);
2908}
2909};
2910
2911/**
2912 * proper transition
2913 * @param {Object} args - arguments
2914 *   @param {Object} to - style to transition to
2915 *   @param {Object} from - style to start transition from
2916 *   @param {Boolean} isCleaning - removes transition styles after transition
2917 *   @param {Function} onTransitionEnd - callback
2918 */
2919proto.transition=function(args){
2920// redirect to nonTransition if no transition duration
2921if(!parseFloat(this.layout.options.transitionDuration)){
2922this._nonTransition(args);
2923return;
2924}
2925
2926var _transition=this._transn;
2927// keep track of onTransitionEnd callback by css property
2928for(var prop in args.onTransitionEnd){
2929_transition.onEnd[prop]=args.onTransitionEnd[prop];
2930}
2931// keep track of properties that are transitioning
2932for(prop in args.to){
2933_transition.ingProperties[prop]=true;
2934// keep track of properties to clean up when transition is done
2935if(args.isCleaning){
2936_transition.clean[prop]=true;
2937}
2938}
2939
2940// set from styles
2941if(args.from){
2942this.css(args.from);
2943// force redraw. http://blog.alexmaccaw.com/css-transitions
2944var h=this.element.offsetHeight;
2945// hack for JSHint to hush about unused var
2946h=null;
2947}
2948// enable transition
2949this.enableTransition(args.to);
2950// set styles that are transitioning
2951this.css(args.to);
2952
2953this.isTransitioning=true;
2954
2955};
2956
2957// dash before all cap letters, including first for
2958// WebkitTransform => -webkit-transform
2959function toDashedAll(str){
2960return str.replace(/([A-Z])/g,function($1){
2961return'-'+$1.toLowerCase();
2962});
2963}
2964
2965var transitionProps='opacity,'+toDashedAll(transformProperty);
2966
2967proto.enableTransition=function()/* style */{
2968// HACK changing transitionProperty during a transition
2969// will cause transition to jump
2970if(this.isTransitioning){
2971return;
2972}
2973
2974// make `transition: foo, bar, baz` from style object
2975// HACK un-comment this when enableTransition can work
2976// while a transition is happening
2977// var transitionValues = [];
2978// for ( var prop in style ) {
2979//   // dash-ify camelCased properties like WebkitTransition
2980//   prop = vendorProperties[ prop ] || prop;
2981//   transitionValues.push( toDashedAll( prop ) );
2982// }
2983// munge number to millisecond, to match stagger
2984var duration=this.layout.options.transitionDuration;
2985duration=typeof duration=='number'?duration+'ms':duration;
2986// enable transition styles
2987this.css({
2988transitionProperty:transitionProps,
2989transitionDuration:duration,
2990transitionDelay:this.staggerDelay||0});
2991
2992// listen for transition end event
2993this.element.addEventListener(transitionEndEvent,this,false);
2994};
2995
2996// ----- events ----- //
2997
2998proto.onwebkitTransitionEnd=function(event){
2999this.ontransitionend(event);
3000};
3001
3002proto.onotransitionend=function(event){
3003this.ontransitionend(event);
3004};
3005
3006// properties that I munge to make my life easier
3007var dashedVendorProperties={
3008'-webkit-transform':'transform'};
3009
3010
3011proto.ontransitionend=function(event){
3012// disregard bubbled events from children
3013if(event.target!==this.element){
3014return;
3015}
3016var _transition=this._transn;
3017// get property name of transitioned property, convert to prefix-free
3018var propertyName=dashedVendorProperties[event.propertyName]||event.propertyName;
3019
3020// remove property that has completed transitioning
3021delete _transition.ingProperties[propertyName];
3022// check if any properties are still transitioning
3023if(isEmptyObj(_transition.ingProperties)){
3024// all properties have completed transitioning
3025this.disableTransition();
3026}
3027// clean style
3028if(propertyName in _transition.clean){
3029// clean up style
3030this.element.style[event.propertyName]='';
3031delete _transition.clean[propertyName];
3032}
3033// trigger onTransitionEnd callback
3034if(propertyName in _transition.onEnd){
3035var onTransitionEnd=_transition.onEnd[propertyName];
3036onTransitionEnd.call(this);
3037delete _transition.onEnd[propertyName];
3038}
3039
3040this.emitEvent('transitionEnd',[this]);
3041};
3042
3043proto.disableTransition=function(){
3044this.removeTransitionStyles();
3045this.element.removeEventListener(transitionEndEvent,this,false);
3046this.isTransitioning=false;
3047};
3048
3049/**
3050 * removes style property from element
3051 * @param {Object} style
3052**/
3053proto._removeStyles=function(style){
vendor: 6,285 bytes, lines 3054-3352
3054// clean up transition styles
3055var cleanStyle={};
3056for(var prop in style){
3057cleanStyle[prop]='';
3058}
3059this.css(cleanStyle);
3060};
3061
3062var cleanTransitionStyle={
3063transitionProperty:'',
3064transitionDuration:'',
3065transitionDelay:''};
3066
3067
3068proto.removeTransitionStyles=function(){
3069// remove transition
3070this.css(cleanTransitionStyle);
3071};
3072
3073// ----- stagger ----- //
3074
3075proto.stagger=function(delay){
3076delay=isNaN(delay)?0:delay;
3077this.staggerDelay=delay+'ms';
3078};
3079
3080// ----- show/hide/remove ----- //
3081
3082// remove element from DOM
3083proto.removeElem=function(){
3084this.element.parentNode.removeChild(this.element);
3085// remove display: none
3086this.css({display:''});
3087this.emitEvent('remove',[this]);
3088};
3089
3090proto.remove=function(){
3091// just remove element if no transition support or no transition
3092if(!transitionProperty||!parseFloat(this.layout.options.transitionDuration)){
3093this.removeElem();
3094return;
3095}
3096
3097// start transition
3098this.once('transitionEnd',function(){
3099this.removeElem();
3100});
3101this.hide();
3102};
3103
3104proto.reveal=function(){
3105delete this.isHidden;
3106// remove display: none
3107this.css({display:''});
3108
3109var options=this.layout.options;
3110
3111var onTransitionEnd={};
3112var transitionEndProperty=this.getHideRevealTransitionEndProperty('visibleStyle');
3113onTransitionEnd[transitionEndProperty]=this.onRevealTransitionEnd;
3114
3115this.transition({
3116from:options.hiddenStyle,
3117to:options.visibleStyle,
3118isCleaning:true,
3119onTransitionEnd:onTransitionEnd});
3120
3121};
3122
3123proto.onRevealTransitionEnd=function(){
3124// check if still visible
3125// during transition, item may have been hidden
3126if(!this.isHidden){
3127this.emitEvent('reveal');
3128}
3129};
3130
3131/**
3132 * get style property use for hide/reveal transition end
3133 * @param {String} styleProperty - hiddenStyle/visibleStyle
3134 * @returns {String}
3135 */
3136proto.getHideRevealTransitionEndProperty=function(styleProperty){
3137var optionStyle=this.layout.options[styleProperty];
3138// use opacity
3139if(optionStyle.opacity){
3140return'opacity';
3141}
3142// get first property
3143for(var prop in optionStyle){
3144return prop;
3145}
3146};
3147
3148proto.hide=function(){
3149// set flag
3150this.isHidden=true;
3151// remove display: none
3152this.css({display:''});
3153
3154var options=this.layout.options;
3155
3156var onTransitionEnd={};
3157var transitionEndProperty=this.getHideRevealTransitionEndProperty('hiddenStyle');
3158onTransitionEnd[transitionEndProperty]=this.onHideTransitionEnd;
3159
3160this.transition({
3161from:options.visibleStyle,
3162to:options.hiddenStyle,
3163// keep hidden stuff hidden
3164isCleaning:true,
3165onTransitionEnd:onTransitionEnd});
3166
3167};
3168
3169proto.onHideTransitionEnd=function(){
3170// check if still hidden
3171// during transition, item may have been un-hidden
3172if(this.isHidden){
3173this.css({display:'none'});
3174this.emitEvent('hide');
3175}
3176};
3177
3178proto.destroy=function(){
3179this.css({
3180position:'',
3181left:'',
3182right:'',
3183top:'',
3184bottom:'',
3185transition:'',
3186transform:''});
3187
3188};
3189
3190return Item;
3191
3192});
3193
3194},{"ev-emitter":3,"get-size":5}],8:[function(require,module,exports){
3195/*!
3196 * Outlayer v2.1.1
3197 * the brains and guts of a layout library
3198 * MIT license
3199 */
3200
3201(function(window,factory){
3202'use strict';
3203// universal module definition
3204/* jshint strict: false *//* globals define, module, require */
3205if(typeof define=='function'&&define.amd){
3206// AMD - RequireJS
3207define([
3208'ev-emitter/ev-emitter',
3209'get-size/get-size',
3210'fizzy-ui-utils/utils',
3211'./item'],
3212
3213function(EvEmitter,getSize,utils,Item){
3214return factory(window,EvEmitter,getSize,utils,Item);
3215});
3216
3217}else if((typeof module==="undefined"?"undefined":_typeof2(module))=='object'&&module.exports){
3218// CommonJS - Browserify, Webpack
3219module.exports=factory(
3220window,
3221require('ev-emitter'),
3222require('get-size'),
3223require('fizzy-ui-utils'),
3224require('./item'));
3225
3226}else{
3227// browser global
3228window.Outlayer=factory(
3229window,
3230window.EvEmitter,
3231window.getSize,
3232window.fizzyUIUtils,
3233window.Outlayer.Item);
3234
3235}
3236
3237})(window,function factory(window,EvEmitter,getSize,utils,Item){
3238'use strict';
3239
3240// ----- vars ----- //
3241
3242var console=window.console;
3243var jQuery=window.jQuery;
3244var noop=function noop(){};
3245
3246// -------------------------- Outlayer -------------------------- //
3247
3248// globally unique identifiers
3249var GUID=0;
3250// internal store of all Outlayer intances
3251var instances={};
3252
3253
3254/**
3255 * @param {Element, String} element
3256 * @param {Object} options
3257 * @constructor
3258 */
3259function Outlayer(element,options){
3260var queryElement=utils.getQueryElement(element);
3261if(!queryElement){
3262if(console){
3263console.error('Bad element for '+this.constructor.namespace+
3264': '+(queryElement||element));
3265}
3266return;
3267}
3268this.element=queryElement;
3269// add jQuery
3270if(jQuery){
3271this.$element=jQuery(this.element);
3272}
3273
3274// options
3275this.options=utils.extend({},this.constructor.defaults);
3276this.option(options);
3277
3278// add id for Outlayer.getFromElement
3279var id=++GUID;
3280this.element.outlayerGUID=id;// expando
3281instances[id]=this;// associate via id
3282
3283// kick it off
3284this._create();
3285
3286var isInitLayout=this._getOption('initLayout');
3287if(isInitLayout){
3288this.layout();
3289}
3290}
3291
3292// settings are for internal use only
3293Outlayer.namespace='outlayer';
3294Outlayer.Item=Item;
3295
3296// default options
3297Outlayer.defaults={
3298containerStyle:{
3299position:'relative'},
3300
3301initLayout:true,
3302originLeft:true,
3303originTop:true,
3304resize:true,
3305resizeContainer:true,
3306// item options
3307transitionDuration:'0.4s',
3308hiddenStyle:{
3309opacity:0,
3310transform:'scale(0.001)'},
3311
3312visibleStyle:{
3313opacity:1,
3314transform:'scale(1)'}};
3315
3316
3317
3318var proto=Outlayer.prototype;
3319// inherit EvEmitter
3320utils.extend(proto,EvEmitter.prototype);
3321
3322/**
3323 * set options
3324 * @param {Object} opts
3325 */
3326proto.option=function(opts){
3327utils.extend(this.options,opts);
3328};
3329
3330/**
3331 * get backwards compatible option value, check old name
3332 */
3333proto._getOption=function(option){
3334var oldOption=this.constructor.compatOptions[option];
3335return oldOption&&this.options[oldOption]!==undefined?
3336this.options[oldOption]:this.options[option];
3337};
3338
3339Outlayer.compatOptions={
3340// currentName: oldName
3341initLayout:'isInitLayout',
3342horizontal:'isHorizontal',
3343layoutInstant:'isLayoutInstant',
3344originLeft:'isOriginLeft',
3345originTop:'isOriginTop',
3346resize:'isResizeBound',
3347resizeContainer:'isResizingContainer'};
3348
3349
3350proto._create=function(){
3351// get items from children
3352this.reloadItems();
vendor: 14,942 bytes, lines 3353-4024
3353// elements that affect layout, but are not laid out
3354this.stamps=[];
3355this.stamp(this.options.stamp);
3356// set container style
3357utils.extend(this.element.style,this.options.containerStyle);
3358
3359// bind resize method
3360var canBindResize=this._getOption('resize');
3361if(canBindResize){
3362this.bindResize();
3363}
3364};
3365
3366// goes through all children again and gets bricks in proper order
3367proto.reloadItems=function(){
3368// collection of item elements
3369this.items=this._itemize(this.element.children);
3370};
3371
3372
3373/**
3374 * turn elements into Outlayer.Items to be used in layout
3375 * @param {Array or NodeList or HTMLElement} elems
3376 * @returns {Array} items - collection of new Outlayer Items
3377 */
3378proto._itemize=function(elems){
3379
3380var itemElems=this._filterFindItemElements(elems);
3381var Item=this.constructor.Item;
3382
3383// create new Outlayer Items for collection
3384var items=[];
3385for(var i=0;i<itemElems.length;i++){
3386var elem=itemElems[i];
3387var item=new Item(elem,this);
3388items.push(item);
3389}
3390
3391return items;
3392};
3393
3394/**
3395 * get item elements to be used in layout
3396 * @param {Array or NodeList or HTMLElement} elems
3397 * @returns {Array} items - item elements
3398 */
3399proto._filterFindItemElements=function(elems){
3400return utils.filterFindElements(elems,this.options.itemSelector);
3401};
3402
3403/**
3404 * getter method for getting item elements
3405 * @returns {Array} elems - collection of item elements
3406 */
3407proto.getItemElements=function(){
3408return this.items.map(function(item){
3409return item.element;
3410});
3411};
3412
3413// ----- init & layout ----- //
3414
3415/**
3416 * lays out all items
3417 */
3418proto.layout=function(){
3419this._resetLayout();
3420this._manageStamps();
3421
3422// don't animate first layout
3423var layoutInstant=this._getOption('layoutInstant');
3424var isInstant=layoutInstant!==undefined?
3425layoutInstant:!this._isLayoutInited;
3426this.layoutItems(this.items,isInstant);
3427
3428// flag for initalized
3429this._isLayoutInited=true;
3430};
3431
3432// _init is alias for layout
3433proto._init=proto.layout;
3434
3435/**
3436 * logic before any new layout
3437 */
3438proto._resetLayout=function(){
3439this.getSize();
3440};
3441
3442
3443proto.getSize=function(){
3444this.size=getSize(this.element);
3445};
3446
3447/**
3448 * get measurement from option, for columnWidth, rowHeight, gutter
3449 * if option is String -> get element from selector string, & get size of element
3450 * if option is Element -> get size of element
3451 * else use option as a number
3452 *
3453 * @param {String} measurement
3454 * @param {String} size - width or height
3455 * @private
3456 */
3457proto._getMeasurement=function(measurement,size){
3458var option=this.options[measurement];
3459var elem;
3460if(!option){
3461// default to 0
3462this[measurement]=0;
3463}else{
3464// use option as an element
3465if(typeof option=='string'){
3466elem=this.element.querySelector(option);
3467}else if(option instanceof HTMLElement){
3468elem=option;
3469}
3470// use size of element, if element
3471this[measurement]=elem?getSize(elem)[size]:option;
3472}
3473};
3474
3475/**
3476 * layout a collection of item elements
3477 * @api public
3478 */
3479proto.layoutItems=function(items,isInstant){
3480items=this._getItemsForLayout(items);
3481
3482this._layoutItems(items,isInstant);
3483
3484this._postLayout();
3485};
3486
3487/**
3488 * get the items to be laid out
3489 * you may want to skip over some items
3490 * @param {Array} items
3491 * @returns {Array} items
3492 */
3493proto._getItemsForLayout=function(items){
3494return items.filter(function(item){
3495return!item.isIgnored;
3496});
3497};
3498
3499/**
3500 * layout items
3501 * @param {Array} items
3502 * @param {Boolean} isInstant
3503 */
3504proto._layoutItems=function(items,isInstant){
3505this._emitCompleteOnItems('layout',items);
3506
3507if(!items||!items.length){
3508// no items, emit event with empty array
3509return;
3510}
3511
3512var queue=[];
3513
3514items.forEach(function(item){
3515// get x/y object from method
3516var position=this._getItemLayoutPosition(item);
3517// enqueue
3518position.item=item;
3519position.isInstant=isInstant||item.isLayoutInstant;
3520queue.push(position);
3521},this);
3522
3523this._processLayoutQueue(queue);
3524};
3525
3526/**
3527 * get item layout position
3528 * @param {Outlayer.Item} item
3529 * @returns {Object} x and y position
3530 */
3531proto._getItemLayoutPosition=function()/* item */{
3532return{
3533x:0,
3534y:0};
3535
3536};
3537
3538/**
3539 * iterate over array and position each item
3540 * Reason being - separating this logic prevents 'layout invalidation'
3541 * thx @paul_irish
3542 * @param {Array} queue
3543 */
3544proto._processLayoutQueue=function(queue){
3545this.updateStagger();
3546queue.forEach(function(obj,i){
3547this._positionItem(obj.item,obj.x,obj.y,obj.isInstant,i);
3548},this);
3549};
3550
3551// set stagger from option in milliseconds number
3552proto.updateStagger=function(){
3553var stagger=this.options.stagger;
3554if(stagger===null||stagger===undefined){
3555this.stagger=0;
3556return;
3557}
3558this.stagger=getMilliseconds(stagger);
3559return this.stagger;
3560};
3561
3562/**
3563 * Sets position of item in DOM
3564 * @param {Outlayer.Item} item
3565 * @param {Number} x - horizontal position
3566 * @param {Number} y - vertical position
3567 * @param {Boolean} isInstant - disables transitions
3568 */
3569proto._positionItem=function(item,x,y,isInstant,i){
3570if(isInstant){
3571// if not transition, just set CSS
3572item.goTo(x,y);
3573}else{
3574item.stagger(i*this.stagger);
3575item.moveTo(x,y);
3576}
3577};
3578
3579/**
3580 * Any logic you want to do after each layout,
3581 * i.e. size the container
3582 */
3583proto._postLayout=function(){
3584this.resizeContainer();
3585};
3586
3587proto.resizeContainer=function(){
3588var isResizingContainer=this._getOption('resizeContainer');
3589if(!isResizingContainer){
3590return;
3591}
3592var size=this._getContainerSize();
3593if(size){
3594this._setContainerMeasure(size.width,true);
3595this._setContainerMeasure(size.height,false);
3596}
3597};
3598
3599/**
3600 * Sets width or height of container if returned
3601 * @returns {Object} size
3602 *   @param {Number} width
3603 *   @param {Number} height
3604 */
3605proto._getContainerSize=noop;
3606
3607/**
3608 * @param {Number} measure - size of width or height
3609 * @param {Boolean} isWidth
3610 */
3611proto._setContainerMeasure=function(measure,isWidth){
3612if(measure===undefined){
3613return;
3614}
3615
3616var elemSize=this.size;
3617// add padding and border width if border box
3618if(elemSize.isBorderBox){
3619measure+=isWidth?elemSize.paddingLeft+elemSize.paddingRight+
3620elemSize.borderLeftWidth+elemSize.borderRightWidth:
3621elemSize.paddingBottom+elemSize.paddingTop+
3622elemSize.borderTopWidth+elemSize.borderBottomWidth;
3623}
3624
3625measure=Math.max(measure,0);
3626this.element.style[isWidth?'width':'height']=measure+'px';
3627};
3628
3629/**
3630 * emit eventComplete on a collection of items events
3631 * @param {String} eventName
3632 * @param {Array} items - Outlayer.Items
3633 */
3634proto._emitCompleteOnItems=function(eventName,items){
3635var _this=this;
3636function onComplete(){
3637_this.dispatchEvent(eventName+'Complete',null,[items]);
3638}
3639
3640var count=items.length;
3641if(!items||!count){
3642onComplete();
3643return;
3644}
3645
3646var doneCount=0;
3647function tick(){
3648doneCount++;
3649if(doneCount==count){
3650onComplete();
3651}
3652}
3653
3654// bind callback
3655items.forEach(function(item){
3656item.once(eventName,tick);
3657});
3658};
3659
3660/**
3661 * emits events via EvEmitter and jQuery events
3662 * @param {String} type - name of event
3663 * @param {Event} event - original event
3664 * @param {Array} args - extra arguments
3665 */
3666proto.dispatchEvent=function(type,event,args){
3667// add original event to arguments
3668var emitArgs=event?[event].concat(args):args;
3669this.emitEvent(type,emitArgs);
3670
3671if(jQuery){
3672// set this.$element
3673this.$element=this.$element||jQuery(this.element);
3674if(event){
3675// create jQuery event
3676var $event=jQuery.Event(event);
3677$event.type=type;
3678this.$element.trigger($event,args);
3679}else{
3680// just trigger with type if no event available
3681this.$element.trigger(type,args);
3682}
3683}
3684};
3685
3686// -------------------------- ignore & stamps -------------------------- //
3687
3688
3689/**
3690 * keep item in collection, but do not lay it out
3691 * ignored items do not get skipped in layout
3692 * @param {Element} elem
3693 */
3694proto.ignore=function(elem){
3695var item=this.getItem(elem);
3696if(item){
3697item.isIgnored=true;
3698}
3699};
3700
3701/**
3702 * return item to layout collection
3703 * @param {Element} elem
3704 */
3705proto.unignore=function(elem){
3706var item=this.getItem(elem);
3707if(item){
3708delete item.isIgnored;
3709}
3710};
3711
3712/**
3713 * adds elements to stamps
3714 * @param {NodeList, Array, Element, or String} elems
3715 */
3716proto.stamp=function(elems){
3717elems=this._find(elems);
3718if(!elems){
3719return;
3720}
3721
3722this.stamps=this.stamps.concat(elems);
3723// ignore
3724elems.forEach(this.ignore,this);
3725};
3726
3727/**
3728 * removes elements to stamps
3729 * @param {NodeList, Array, or Element} elems
3730 */
3731proto.unstamp=function(elems){
3732elems=this._find(elems);
3733if(!elems){
3734return;
3735}
3736
3737elems.forEach(function(elem){
3738// filter out removed stamp elements
3739utils.removeFrom(this.stamps,elem);
3740this.unignore(elem);
3741},this);
3742};
3743
3744/**
3745 * finds child elements
3746 * @param {NodeList, Array, Element, or String} elems
3747 * @returns {Array} elems
3748 */
3749proto._find=function(elems){
3750if(!elems){
3751return;
3752}
3753// if string, use argument as selector string
3754if(typeof elems=='string'){
3755elems=this.element.querySelectorAll(elems);
3756}
3757elems=utils.makeArray(elems);
3758return elems;
3759};
3760
3761proto._manageStamps=function(){
3762if(!this.stamps||!this.stamps.length){
3763return;
3764}
3765
3766this._getBoundingRect();
3767
3768this.stamps.forEach(this._manageStamp,this);
3769};
3770
3771// update boundingLeft / Top
3772proto._getBoundingRect=function(){
3773// get bounding rect for container element
3774var boundingRect=this.element.getBoundingClientRect();
3775var size=this.size;
3776this._boundingRect={
3777left:boundingRect.left+size.paddingLeft+size.borderLeftWidth,
3778top:boundingRect.top+size.paddingTop+size.borderTopWidth,
3779right:boundingRect.right-(size.paddingRight+size.borderRightWidth),
3780bottom:boundingRect.bottom-(size.paddingBottom+size.borderBottomWidth)};
3781
3782};
3783
3784/**
3785 * @param {Element} stamp
3786**/
3787proto._manageStamp=noop;
3788
3789/**
3790 * get x/y position of element relative to container element
3791 * @param {Element} elem
3792 * @returns {Object} offset - has left, top, right, bottom
3793 */
3794proto._getElementOffset=function(elem){
3795var boundingRect=elem.getBoundingClientRect();
3796var thisRect=this._boundingRect;
3797var size=getSize(elem);
3798var offset={
3799left:boundingRect.left-thisRect.left-size.marginLeft,
3800top:boundingRect.top-thisRect.top-size.marginTop,
3801right:thisRect.right-boundingRect.right-size.marginRight,
3802bottom:thisRect.bottom-boundingRect.bottom-size.marginBottom};
3803
3804return offset;
3805};
3806
3807// -------------------------- resize -------------------------- //
3808
3809// enable event handlers for listeners
3810// i.e. resize -> onresize
3811proto.handleEvent=utils.handleEvent;
3812
3813/**
3814 * Bind layout to window resizing
3815 */
3816proto.bindResize=function(){
3817window.addEventListener('resize',this);
3818this.isResizeBound=true;
3819};
3820
3821/**
3822 * Unbind layout to window resizing
3823 */
3824proto.unbindResize=function(){
3825window.removeEventListener('resize',this);
3826this.isResizeBound=false;
3827};
3828
3829proto.onresize=function(){
3830this.resize();
3831};
3832
3833utils.debounceMethod(Outlayer,'onresize',100);
3834
3835proto.resize=function(){
3836// don't trigger if size did not change
3837// or if resize was unbound. See #9
3838if(!this.isResizeBound||!this.needsResizeLayout()){
3839return;
3840}
3841
3842this.layout();
3843};
3844
3845/**
3846 * check if layout is needed post layout
3847 * @returns Boolean
3848 */
3849proto.needsResizeLayout=function(){
3850var size=getSize(this.element);
3851// check that this.size and size are there
3852// IE8 triggers resize on body size change, so they might not be
3853var hasSizes=this.size&&size;
3854return hasSizes&&size.innerWidth!==this.size.innerWidth;
3855};
3856
3857// -------------------------- methods -------------------------- //
3858
3859/**
3860 * add items to Outlayer instance
3861 * @param {Array or NodeList or Element} elems
3862 * @returns {Array} items - Outlayer.Items
3863**/
3864proto.addItems=function(elems){
3865var items=this._itemize(elems);
3866// add items to collection
3867if(items.length){
3868this.items=this.items.concat(items);
3869}
3870return items;
3871};
3872
3873/**
3874 * Layout newly-appended item elements
3875 * @param {Array or NodeList or Element} elems
3876 */
3877proto.appended=function(elems){
3878var items=this.addItems(elems);
3879if(!items.length){
3880return;
3881}
3882// layout and reveal just the new items
3883this.layoutItems(items,true);
3884this.reveal(items);
3885};
3886
3887/**
3888 * Layout prepended elements
3889 * @param {Array or NodeList or Element} elems
3890 */
3891proto.prepended=function(elems){
3892var items=this._itemize(elems);
3893if(!items.length){
3894return;
3895}
3896// add items to beginning of collection
3897var previousItems=this.items.slice(0);
3898this.items=items.concat(previousItems);
3899// start new layout
3900this._resetLayout();
3901this._manageStamps();
3902// layout new stuff without transition
3903this.layoutItems(items,true);
3904this.reveal(items);
3905// layout previous items
3906this.layoutItems(previousItems);
3907};
3908
3909/**
3910 * reveal a collection of items
3911 * @param {Array of Outlayer.Items} items
3912 */
3913proto.reveal=function(items){
3914this._emitCompleteOnItems('reveal',items);
3915if(!items||!items.length){
3916return;
3917}
3918var stagger=this.updateStagger();
3919items.forEach(function(item,i){
3920item.stagger(i*stagger);
3921item.reveal();
3922});
3923};
3924
3925/**
3926 * hide a collection of items
3927 * @param {Array of Outlayer.Items} items
3928 */
3929proto.hide=function(items){
3930this._emitCompleteOnItems('hide',items);
3931if(!items||!items.length){
3932return;
3933}
3934var stagger=this.updateStagger();
3935items.forEach(function(item,i){
3936item.stagger(i*stagger);
3937item.hide();
3938});
3939};
3940
3941/**
3942 * reveal item elements
3943 * @param {Array}, {Element}, {NodeList} items
3944 */
3945proto.revealItemElements=function(elems){
3946var items=this.getItems(elems);
3947this.reveal(items);
3948};
3949
3950/**
3951 * hide item elements
3952 * @param {Array}, {Element}, {NodeList} items
3953 */
3954proto.hideItemElements=function(elems){
3955var items=this.getItems(elems);
3956this.hide(items);
3957};
3958
3959/**
3960 * get Outlayer.Item, given an Element
3961 * @param {Element} elem
3962 * @param {Function} callback
3963 * @returns {Outlayer.Item} item
3964 */
3965proto.getItem=function(elem){
3966// loop through items to get the one that matches
3967for(var i=0;i<this.items.length;i++){
3968var item=this.items[i];
3969if(item.element==elem){
3970// return item
3971return item;
3972}
3973}
3974};
3975
3976/**
3977 * get collection of Outlayer.Items, given Elements
3978 * @param {Array} elems
3979 * @returns {Array} items - Outlayer.Items
3980 */
3981proto.getItems=function(elems){
3982elems=utils.makeArray(elems);
3983var items=[];
3984elems.forEach(function(elem){
3985var item=this.getItem(elem);
3986if(item){
3987items.push(item);
3988}
3989},this);
3990
3991return items;
3992};
3993
3994/**
3995 * remove element(s) from instance and DOM
3996 * @param {Array or NodeList or Element} elems
3997 */
3998proto.remove=function(elems){
3999var removeItems=this.getItems(elems);
4000
4001this._emitCompleteOnItems('remove',removeItems);
4002
4003// bail if no items to remove
4004if(!removeItems||!removeItems.length){
4005return;
4006}
4007
4008removeItems.forEach(function(item){
4009item.remove();
4010// remove item from collection
4011utils.removeFrom(this.items,item);
4012},this);
4013};
4014
4015// ----- destroy ----- //
4016
4017// remove and disable Outlayer instance
4018proto.destroy=function(){
4019// clean up dynamic styles
4020var style=this.element.style;
4021style.height='';
4022style.position='';
4023style.width='';
4024// destroy items
4025this.items.forEach(function(item){
4026item.destroy();
4027});
4028
4029this.unbindResize();
4030
4031var id=this.element.outlayerGUID;
4032delete instances[id];// remove reference to instance by id
4033delete this.element.outlayerGUID;
4034// remove data for jQuery
4035if(jQuery){
4036jQuery.removeData(this.element,this.constructor.namespace);
4037}
4038
4039};
4040
4041// -------------------------- data -------------------------- //
4042
4043/**
4044 * get Outlayer instance from element
4045 * @param {Element} elem
4046 * @returns {Outlayer}
4047 */
4048Outlayer.data=function(elem){
4049elem=utils.getQueryElement(elem);
4050var id=elem&&elem.outlayerGUID;
4051return id&&instances[id];
4052};
4053
4054
4055// -------------------------- create Outlayer class -------------------------- //
4056
4057/**
4058 * create a layout class
4059 * @param {String} namespace
4060 */
4061Outlayer.create=function(namespace,options){
4062// sub-class Outlayer
4063var Layout=subclass(Outlayer);
4064// apply new options and compatOptions
4065Layout.defaults=utils.extend({},Outlayer.defaults);
4066utils.extend(Layout.defaults,options);
4067Layout.compatOptions=utils.extend({},Outlayer.compatOptions);
4068
4069Layout.namespace=namespace;
4070
4071Layout.data=Outlayer.data;
4072
4073// sub-class Item
4074Layout.Item=subclass(Item);
4075
4076// -------------------------- declarative -------------------------- //
4077
4078utils.htmlInit(Layout,namespace);
4079
4080// -------------------------- jQuery bridge -------------------------- //
4081
4082// make into jQuery plugin
4083if(jQuery&&jQuery.bridget){
4084jQuery.bridget(namespace,Layout);
4085}
4086
4087return Layout;
4088};
4089
4090function subclass(Parent){
4091function SubClass(){
4092Parent.apply(this,arguments);
4093}
4094
4095SubClass.prototype=Object.create(Parent.prototype);
4096SubClass.prototype.constructor=SubClass;
4097
4098return SubClass;
4099}
4100
4101// ----- helpers ----- //
4102
4103// how many milliseconds are in each unit
4104var msUnits={
4105ms:1,
4106s:1000};
4107
4108
4109// munge time-like parameter into millisecond number
4110// '0.4s' -> 40
4111function getMilliseconds(time){
4112if(typeof time=='number'){
4113return time;
4114}
4115var matches=time.match(/(^\d*\.?\d*)(\w*)/);
4116var num=matches&&matches[1];
4117var unit=matches&&matches[2];
4118if(!num.length){
4119return 0;
4120}
4121num=parseFloat(num);
4122var mult=msUnits[unit]||1;
4123return num*mult;
4124}
4125
4126// ----- fin ----- //
4127
4128// back in global
4129Outlayer.Item=Item;
4130
4131return Outlayer;
4132
4133});
4134
4135},{"./item":7,"ev-emitter":3,"fizzy-ui-utils":4,"get-size":5}],9:[function(require,module,exports){
4136// shim for using process in browser
4137var process=module.exports={};
4138
4139// cached from whatever global is present so that test runners that stub it
4140// don't break things.  But we need to wrap it in a try catch in case it is
4141// wrapped in strict mode code which doesn't define any globals.  It's inside a
4142// function because try/catches deoptimize in certain engines.
4143
4144var cachedSetTimeout;
4145var cachedClearTimeout;
4146
4147function defaultSetTimout(){
4148throw new Error('setTimeout has not been defined');
4149}
4150function defaultClearTimeout(){
4151throw new Error('clearTimeout has not been defined');
4152}
4153(function(){
4154try{
4155if(typeof setTimeout==='function'){
4156cachedSetTimeout=setTimeout;
4157}else{
4158cachedSetTimeout=defaultSetTimout;
4159}
4160}catch(e){
4161cachedSetTimeout=defaultSetTimout;
4162}
4163try{
4164if(typeof clearTimeout==='function'){
4165cachedClearTimeout=clearTimeout;
4166}else{
4167cachedClearTimeout=defaultClearTimeout;
4168}
4169}catch(e){
4170cachedClearTimeout=defaultClearTimeout;
4171}
4172})();
4173function runTimeout(fun){
4174if(cachedSetTimeout===setTimeout){
4175//normal enviroments in sane situations
4176return setTimeout(fun,0);
4177}
4178// if setTimeout wasn't available but was latter defined
4179if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){
4180cachedSetTimeout=setTimeout;
4181return setTimeout(fun,0);
4182}
4183try{
4184// when when somebody has screwed with setTimeout but no I.E. maddness
4185return cachedSetTimeout(fun,0);
4186}catch(e){
4187try{
4188// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4189return cachedSetTimeout.call(null,fun,0);
4190}catch(e){
4191// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
4192return cachedSetTimeout.call(this,fun,0);
4193}
4194}
4195
4196
4197}
4198function runClearTimeout(marker){
4199if(cachedClearTimeout===clearTimeout){
4200//normal enviroments in sane situations
4201return clearTimeout(marker);
4202}
4203// if clearTimeout wasn't available but was latter defined
4204if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){
4205cachedClearTimeout=clearTimeout;
4206return clearTimeout(marker);
4207}
4208try{
4209// when when somebody has screwed with setTimeout but no I.E. maddness
4210return cachedClearTimeout(marker);
4211}catch(e){
4212try{
4213// When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
4214return cachedClearTimeout.call(null,marker);
4215}catch(e){
4216// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
4217// Some versions of I.E. have different rules for clearTimeout vs setTimeout
4218return cachedClearTimeout.call(this,marker);
4219}
4220}
4221
4222
4223
4224}
4225var queue=[];
4226var draining=false;
4227var currentQueue;
4228var queueIndex=-1;
4229
4230function cleanUpNextTick(){
4231if(!draining||!currentQueue){
4232return;
4233}
4234draining=false;
4235if(currentQueue.length){
4236queue=currentQueue.concat(queue);
4237}else{
4238queueIndex=-1;
4239}
4240if(queue.length){
4241drainQueue();
4242}
4243}
4244
4245function drainQueue(){
4246if(draining){
4247return;
4248}
4249var timeout=runTimeout(cleanUpNextTick);
4250draining=true;
4251
4252var len=queue.length;
4253while(len){
4254currentQueue=queue;
4255queue=[];
4256while(++queueIndex<len){
4257if(currentQueue){
4258currentQueue[queueIndex].run();
4259}
4260}
4261queueIndex=-1;
4262len=queue.length;
4263}
4264currentQueue=null;
4265draining=false;
4266runClearTimeout(timeout);
4267}
4268
4269process.nextTick=function(fun){
4270var args=new Array(arguments.length-1);
4271if(arguments.length>1){
4272for(var i=1;i<arguments.length;i++){
4273args[i-1]=arguments[i];
4274}
4275}
4276queue.push(new Item(fun,args));
4277if(queue.length===1&&!draining){
4278runTimeout(drainQueue);
4279}
4280};
4281
4282// v8 likes predictible objects
4283function Item(fun,array){
4284this.fun=fun;
4285this.array=array;
4286}
4287Item.prototype.run=function(){
4288this.fun.apply(null,this.array);
4289};
4290process.title='browser';
4291process.browser=true;
4292process.env={};
4293process.argv=[];
4294process.version='';// empty string to avoid regexp issues
4295process.versions={};
4296
4297function noop(){}
4298
4299process.on=noop;
4300process.addListener=noop;
4301process.once=noop;
4302process.off=noop;
4303process.removeListener=noop;
4304process.removeAllListeners=noop;
4305process.emit=noop;
4306process.prependListener=noop;
4307process.prependOnceListener=noop;
4308
4309process.listeners=function(name){return[];};
4310
4311process.binding=function(name){
4312throw new Error('process.binding is not supported');
4313};
4314
4315process.cwd=function(){return'/';};
4316process.chdir=function(dir){
4317throw new Error('process.chdir is not supported');
4318};
4319process.umask=function(){return 0;};
4320
4321},{}],10:[function(require,module,exports){
4322(function(process){
4323/**!
4324* tippy.js v6.1.1
4325* (c) 2017-2020 atomiks
4326* MIT License
4327*/
4328'use strict';
4329
4330Object.defineProperty(exports,'__esModule',{value:true});
4331
4332var core=require('@popperjs/core');
4333
4334var PASSIVE={
4335passive:true};
4336
4337var ROUND_ARROW='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';
4338var IOS_CLASS="tippy-iOS";
4339var BOX_CLASS="tippy-box";
4340var CONTENT_CLASS="tippy-content";
4341var BACKDROP_CLASS="tippy-backdrop";
4342var ARROW_CLASS="tippy-arrow";
4343var SVG_ARROW_CLASS="tippy-svg-arrow";
4344
4345function hasOwnProperty(obj,key){
4346return{}.hasOwnProperty.call(obj,key);
4347}
4348function getValueAtIndexOrReturn(value,index,defaultValue){
4349if(Array.isArray(value)){
4350var v=value[index];
4351return v==null?Array.isArray(defaultValue)?defaultValue[index]:defaultValue:v;
4352}
4353
4354return value;
4355}
4356function isType(value,type){
4357var str={}.toString.call(value);
4358return str.indexOf('[object')===0&&str.indexOf(type+"]")>-1;
4359}
4360function invokeWithArgsOrReturn(value,args){
4361return typeof value==='function'?value.apply(void 0,args):value;
4362}
4363function debounce(fn,ms){
4364// Avoid wrapping in `setTimeout` if ms is 0 anyway
4365if(ms===0){
4366return fn;
4367}
4368
4369var timeout;
4370return function(arg){
4371clearTimeout(timeout);
4372timeout=setTimeout(function(){
4373fn(arg);
4374},ms);
4375};
4376}
4377function removeProperties(obj,keys){
4378var clone=Object.assign({},obj);
4379keys.forEach(function(key){
4380delete clone[key];
4381});
4382return clone;
4383}
4384function splitBySpaces(value){
4385return value.split(/\s+/).filter(Boolean);
4386}
4387function normalizeToArray(value){
4388return[].concat(value);
4389}
4390function pushIfUnique(arr,value){
4391if(arr.indexOf(value)===-1){
4392arr.push(value);
4393}
4394}
4395function unique(arr){
4396return arr.filter(function(item,index){
4397return arr.indexOf(item)===index;
4398});
4399}
4400function getBasePlacement(placement){
4401return placement.split('-')[0];
4402}
4403function arrayFrom(value){
4404return[].slice.call(value);
4405}
4406
4407function div(){
4408return document.createElement('div');
4409}
4410function isElement(value){
4411return['Element','Fragment'].some(function(type){
4412return isType(value,type);
4413});
4414}
4415function isNodeList(value){
4416return isType(value,'NodeList');
4417}
4418function isMouseEvent(value){
4419return isType(value,'MouseEvent');
4420}
4421function isReferenceElement(value){
4422return!!(value&&value._tippy&&value._tippy.reference===value);
4423}
4424function getArrayOfElements(value){
4425if(isElement(value)){
4426return[value];
4427}
4428
4429if(isNodeList(value)){
4430return arrayFrom(value);
4431}
4432
4433if(Array.isArray(value)){
4434return value;
4435}
4436
4437return arrayFrom(document.querySelectorAll(value));
4438}
4439function setTransitionDuration(els,value){
4440els.forEach(function(el){
4441if(el){
4442el.style.transitionDuration=value+"ms";
4443}
4444});
4445}
4446function setVisibilityState(els,state){
4447els.forEach(function(el){
4448if(el){
4449el.setAttribute('data-state',state);
4450}
4451});
4452}
4453function getOwnerDocument(elementOrElements){
4454var _normalizeToArray=normalizeToArray(elementOrElements),
4455element=_normalizeToArray[0];
4456
4457return element?element.ownerDocument||document:document;
4458}
4459function isCursorOutsideInteractiveBorder(popperTreeData,event){
4460var clientX=event.clientX,
4461clientY=event.clientY;
4462return popperTreeData.every(function(_ref){
4463var popperRect=_ref.popperRect,
4464popperState=_ref.popperState,
4465props=_ref.props;
4466var interactiveBorder=props.interactiveBorder;
4467var basePlacement=getBasePlacement(popperState.placement);
4468var offsetData=popperState.modifiersData.offset;
4469
4470if(!offsetData){
4471return true;
4472}
4473
4474var topDistance=basePlacement==='bottom'?offsetData.top.y:0;
4475var bottomDistance=basePlacement==='top'?offsetData.bottom.y:0;
4476var leftDistance=basePlacement==='right'?offsetData.left.x:0;
4477var rightDistance=basePlacement==='left'?offsetData.right.x:0;
4478var exceedsTop=popperRect.top-clientY+topDistance>interactiveBorder;
4479var exceedsBottom=clientY-popperRect.bottom-bottomDistance>interactiveBorder;
4480var exceedsLeft=popperRect.left-clientX+leftDistance>interactiveBorder;
vendor: 4,192 bytes, lines 4481-4613
4481var exceedsRight=clientX-popperRect.right-rightDistance>interactiveBorder;
4482return exceedsTop||exceedsBottom||exceedsLeft||exceedsRight;
4483});
4484}
4485function updateTransitionEndListener(box,action,listener){
4486var method=action+"EventListener";// some browsers apparently support `transition` (unprefixed) but only fire
4487// `webkitTransitionEnd`...
4488
4489['transitionend','webkitTransitionEnd'].forEach(function(event){
4490box[method](event,listener);
4491});
4492}
4493
4494var currentInput={
4495isTouch:false};
4496
4497var lastMouseMoveTime=0;
4498/**
4499 * When a `touchstart` event is fired, it's assumed the user is using touch
4500 * input. We'll bind a `mousemove` event listener to listen for mouse input in
4501 * the future. This way, the `isTouch` property is fully dynamic and will handle
4502 * hybrid devices that use a mix of touch + mouse input.
4503 */
4504
4505function onDocumentTouchStart(){
4506if(currentInput.isTouch){
4507return;
4508}
4509
4510currentInput.isTouch=true;
4511
4512if(window.performance){
4513document.addEventListener('mousemove',onDocumentMouseMove);
4514}
4515}
4516/**
4517 * When two `mousemove` event are fired consecutively within 20ms, it's assumed
4518 * the user is using mouse input again. `mousemove` can fire on touch devices as
4519 * well, but very rarely that quickly.
4520 */
4521
4522function onDocumentMouseMove(){
4523var now=performance.now();
4524
4525if(now-lastMouseMoveTime<20){
4526currentInput.isTouch=false;
4527document.removeEventListener('mousemove',onDocumentMouseMove);
4528}
4529
4530lastMouseMoveTime=now;
4531}
4532/**
4533 * When an element is in focus and has a tippy, leaving the tab/window and
4534 * returning causes it to show again. For mouse users this is unexpected, but
4535 * for keyboard use it makes sense.
4536 * TODO: find a better technique to solve this problem
4537 */
4538
4539function onWindowBlur(){
4540var activeElement=document.activeElement;
4541
4542if(isReferenceElement(activeElement)){
4543var instance=activeElement._tippy;
4544
4545if(activeElement.blur&&!instance.state.isVisible){
4546activeElement.blur();
4547}
4548}
4549}
4550function bindGlobalEventListeners(){
4551document.addEventListener('touchstart',onDocumentTouchStart,Object.assign({},PASSIVE,{
4552capture:true}));
4553
4554window.addEventListener('blur',onWindowBlur);
4555}
4556
4557var isBrowser=typeof window!=='undefined'&&typeof document!=='undefined';
4558var ua=isBrowser?navigator.userAgent:'';
4559var isIE=/MSIE |Trident\//.test(ua);
4560var isIOS=isBrowser&&/iPhone|iPad|iPod/.test(navigator.platform);
4561
4562function createMemoryLeakWarning(method){
4563var txt=method==='destroy'?'n already-':' ';
4564return[method+"() was called on a"+txt+"destroyed instance. This is a no-op but",'indicates a potential memory leak.'].join(' ');
4565}
4566function clean(value){
4567var spacesAndTabs=/[ \t]{2,}/g;
4568var lineStartWithSpaces=/^[ \t]*/gm;
4569return value.replace(spacesAndTabs,' ').replace(lineStartWithSpaces,'').trim();
4570}
4571
4572function getDevMessage(message){
4573return clean("\n  %ctippy.js\n\n  %c"+clean(message)+"\n\n  %c\uD83D\uDC77\u200D This is a development-only message. It will be removed in production.\n  ");
4574}
4575
4576function getFormattedMessage(message){
4577return[getDevMessage(message),// title
4578'color: #00C584; font-size: 1.3em; font-weight: bold;',// message
4579'line-height: 1.5',// footer
4580'color: #a6a095;'];
4581}// Assume warnings and errors never have the same message
4582
4583var visitedMessages;
4584
4585if(process.env.NODE_ENV!=="production"){
4586resetVisitedMessages();
4587}
4588
4589function resetVisitedMessages(){
4590visitedMessages=new Set();
4591}
4592function warnWhen(condition,message){
4593if(condition&&!visitedMessages.has(message)){
4594var _console;
4595
4596visitedMessages.add(message);
4597
4598(_console=console).warn.apply(_console,getFormattedMessage(message));
4599}
4600}
4601function errorWhen(condition,message){
4602if(condition&&!visitedMessages.has(message)){
4603var _console2;
4604
4605visitedMessages.add(message);
4606
4607(_console2=console).error.apply(_console2,getFormattedMessage(message));
4608}
4609}
4610function validateTargets(targets){
4611var didPassFalsyValue=!targets;
4612var didPassPlainObject=Object.prototype.toString.call(targets)==='[object Object]'&&!targets.addEventListener;
4613errorWhen(didPassFalsyValue,['tippy() was passed','`'+String(targets)+'`','as its targets (first) argument. Valid types are: String, Element,','Element[], or NodeList.'].join(' '));
vendor: 6,936 bytes, lines 4614-4886
4614errorWhen(didPassPlainObject,['tippy() was passed a plain object which is not supported as an argument','for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));
4615}
4616
4617var pluginProps={
4618animateFill:false,
4619followCursor:false,
4620inlinePositioning:false,
4621sticky:false};
4622
4623var renderProps={
4624allowHTML:false,
4625animation:'fade',
4626arrow:true,
4627content:'',
4628inertia:false,
4629maxWidth:350,
4630role:'tooltip',
4631theme:'',
4632zIndex:9999};
4633
4634var defaultProps=Object.assign({
4635appendTo:function appendTo(){
4636return document.body;
4637},
4638aria:{
4639content:'auto',
4640expanded:'auto'},
4641
4642delay:0,
4643duration:[300,250],
4644getReferenceClientRect:null,
4645hideOnClick:true,
4646ignoreAttributes:false,
4647interactive:false,
4648interactiveBorder:2,
4649interactiveDebounce:0,
4650moveTransition:'',
4651offset:[0,10],
4652onAfterUpdate:function onAfterUpdate(){},
4653onBeforeUpdate:function onBeforeUpdate(){},
4654onCreate:function onCreate(){},
4655onDestroy:function onDestroy(){},
4656onHidden:function onHidden(){},
4657onHide:function onHide(){},
4658onMount:function onMount(){},
4659onShow:function onShow(){},
4660onShown:function onShown(){},
4661onTrigger:function onTrigger(){},
4662onUntrigger:function onUntrigger(){},
4663onClickOutside:function onClickOutside(){},
4664placement:'top',
4665plugins:[],
4666popperOptions:{},
4667render:null,
4668showOnCreate:false,
4669touch:true,
4670trigger:'mouseenter focus',
4671triggerTarget:null},
4672pluginProps,{},renderProps);
4673var defaultKeys=Object.keys(defaultProps);
4674var setDefaultProps=function setDefaultProps(partialProps){
4675/* istanbul ignore else */
4676if(process.env.NODE_ENV!=="production"){
4677validateProps(partialProps,[]);
4678}
4679
4680var keys=Object.keys(partialProps);
4681keys.forEach(function(key){
4682defaultProps[key]=partialProps[key];
4683});
4684};
4685function getExtendedPassedProps(passedProps){
4686var plugins=passedProps.plugins||[];
4687var pluginProps=plugins.reduce(function(acc,plugin){
4688var name=plugin.name,
4689defaultValue=plugin.defaultValue;
4690
4691if(name){
4692acc[name]=passedProps[name]!==undefined?passedProps[name]:defaultValue;
4693}
4694
4695return acc;
4696},{});
4697return Object.assign({},passedProps,{},pluginProps);
4698}
4699function getDataAttributeProps(reference,plugins){
4700var propKeys=plugins?Object.keys(getExtendedPassedProps(Object.assign({},defaultProps,{
4701plugins:plugins}))):
4702defaultKeys;
4703var props=propKeys.reduce(function(acc,key){
4704var valueAsString=(reference.getAttribute("data-tippy-"+key)||'').trim();
4705
4706if(!valueAsString){
4707return acc;
4708}
4709
4710if(key==='content'){
4711acc[key]=valueAsString;
4712}else{
4713try{
4714acc[key]=JSON.parse(valueAsString);
4715}catch(e){
4716acc[key]=valueAsString;
4717}
4718}
4719
4720return acc;
4721},{});
4722return props;
4723}
4724function evaluateProps(reference,props){
4725var out=Object.assign({},props,{
4726content:invokeWithArgsOrReturn(props.content,[reference])},
4727props.ignoreAttributes?{}:getDataAttributeProps(reference,props.plugins));
4728out.aria=Object.assign({},defaultProps.aria,{},out.aria);
4729out.aria={
4730expanded:out.aria.expanded==='auto'?props.interactive:out.aria.expanded,
4731content:out.aria.content==='auto'?props.interactive?null:'describedby':out.aria.content};
4732
4733return out;
4734}
4735function validateProps(partialProps,plugins){
4736if(partialProps===void 0){
4737partialProps={};
4738}
4739
4740if(plugins===void 0){
4741plugins=[];
4742}
4743
4744var keys=Object.keys(partialProps);
4745keys.forEach(function(prop){
4746var nonPluginProps=removeProperties(defaultProps,Object.keys(pluginProps));
4747var didPassUnknownProp=!hasOwnProperty(nonPluginProps,prop);// Check if the prop exists in `plugins`
4748
4749if(didPassUnknownProp){
4750didPassUnknownProp=plugins.filter(function(plugin){
4751return plugin.name===prop;
4752}).length===0;
4753}
4754
4755warnWhen(didPassUnknownProp,["`"+prop+"`","is not a valid prop. You may have spelled it incorrectly, or if it's",'a plugin, forgot to pass it in an array as props.plugins.','\n\n','All props: https://atomiks.github.io/tippyjs/v6/all-props/\n','Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' '));
4756});
4757}
4758
4759var innerHTML=function innerHTML(){
4760return'innerHTML';
4761};
4762
4763function dangerouslySetInnerHTML(element,html){
4764element[innerHTML()]=html;
4765}
4766
4767function createArrowElement(value){
4768var arrow=div();
4769
4770if(value===true){
4771arrow.className=ARROW_CLASS;
4772}else{
4773arrow.className=SVG_ARROW_CLASS;
4774
4775if(isElement(value)){
4776arrow.appendChild(value);
4777}else{
4778dangerouslySetInnerHTML(arrow,value);
4779}
4780}
4781
4782return arrow;
4783}
4784
4785function setContent(content,props){
4786if(isElement(props.content)){
4787dangerouslySetInnerHTML(content,'');
4788content.appendChild(props.content);
4789}else if(typeof props.content!=='function'){
4790if(props.allowHTML){
4791dangerouslySetInnerHTML(content,props.content);
4792}else{
4793content.textContent=props.content;
4794}
4795}
4796}
4797function getChildren(popper){
4798var box=popper.firstElementChild;
4799var boxChildren=arrayFrom(box.children);
4800return{
4801box:box,
4802content:boxChildren.find(function(node){
4803return node.classList.contains(CONTENT_CLASS);
4804}),
4805arrow:boxChildren.find(function(node){
4806return node.classList.contains(ARROW_CLASS)||node.classList.contains(SVG_ARROW_CLASS);
4807}),
4808backdrop:boxChildren.find(function(node){
4809return node.classList.contains(BACKDROP_CLASS);
4810})};
4811
4812}
4813function render(instance){
4814var popper=div();
4815var box=div();
4816box.className=BOX_CLASS;
4817box.setAttribute('data-state','hidden');
4818box.setAttribute('tabindex','-1');
4819var content=div();
4820content.className=CONTENT_CLASS;
4821content.setAttribute('data-state','hidden');
4822setContent(content,instance.props);
4823popper.appendChild(box);
4824box.appendChild(content);
4825onUpdate(instance.props,instance.props);
4826
4827function onUpdate(prevProps,nextProps){
4828var _getChildren=getChildren(popper),
4829box=_getChildren.box,
4830content=_getChildren.content,
4831arrow=_getChildren.arrow;
4832
4833if(nextProps.theme){
4834box.setAttribute('data-theme',nextProps.theme);
4835}else{
4836box.removeAttribute('data-theme');
4837}
4838
4839if(typeof nextProps.animation==='string'){
4840box.setAttribute('data-animation',nextProps.animation);
4841}else{
4842box.removeAttribute('data-animation');
4843}
4844
4845if(nextProps.inertia){
4846box.setAttribute('data-inertia','');
4847}else{
4848box.removeAttribute('data-inertia');
4849}
4850
4851box.style.maxWidth=typeof nextProps.maxWidth==='number'?nextProps.maxWidth+"px":nextProps.maxWidth;
4852
4853if(nextProps.role){
4854box.setAttribute('role',nextProps.role);
4855}else{
4856box.removeAttribute('role');
4857}
4858
4859if(prevProps.content!==nextProps.content){
4860setContent(content,instance.props);
4861}
4862
4863if(nextProps.arrow){
4864if(!arrow){
4865box.appendChild(createArrowElement(nextProps.arrow));
4866}else if(prevProps.arrow!==nextProps.arrow){
4867box.removeChild(arrow);
4868box.appendChild(createArrowElement(nextProps.arrow));
4869}
4870}else if(arrow){
4871box.removeChild(arrow);
4872}
4873}
4874
4875return{
4876popper:popper,
4877onUpdate:onUpdate};
4878
4879}// Runtime check to identify if the render function is the default one; this
4880// way we can apply default CSS transitions logic and it can be tree-shaken away
4881
4882render.$$tippy=true;
4883
4884var idCounter=1;
4885var mouseMoveListeners=[];// Used by `hideAll()`
4886
4887var mountedInstances=[];
4888function createTippy(reference,passedProps){
4889var props=evaluateProps(reference,Object.assign({},defaultProps,{},getExtendedPassedProps(passedProps)));// ===========================================================================
4890// 🔒 Private members
4891// ===========================================================================
4892
4893var showTimeout;
4894var hideTimeout;
4895var scheduleHideAnimationFrame;
4896var isVisibleFromClick=false;
4897var didHideDueToDocumentMouseDown=false;
4898var ignoreOnFirstUpdate=false;
4899var lastTriggerEvent;
4900var currentTransitionEndListener;
4901var onFirstUpdate;
4902var listeners=[];
4903var debouncedOnMouseMove=debounce(onMouseMove,props.interactiveDebounce);
4904var currentTarget;
4905var doc=getOwnerDocument(props.triggerTarget||reference);// ===========================================================================
4906// 🔑 Public members
4907// ===========================================================================
4908
4909var id=idCounter++;
4910var popperInstance=null;
4911var plugins=unique(props.plugins);
4912var state={
4913// Is the instance currently enabled?
4914isEnabled:true,
4915// Is the tippy currently showing and not transitioning out?
4916isVisible:false,
4917// Has the instance been destroyed?
4918isDestroyed:false,
4919// Is the tippy currently mounted to the DOM?
4920isMounted:false,
4921// Has the tippy finished transitioning in?
4922isShown:false};
4923
4924var instance={
4925// properties
4926id:id,
4927reference:reference,
4928popper:div(),
4929popperInstance:popperInstance,
4930props:props,
4931state:state,
4932plugins:plugins,
4933// methods
4934clearDelayTimeouts:clearDelayTimeouts,
4935setProps:setProps,
4936setContent:setContent,
4937show:show,
4938hide:hide,
4939enable:enable,
4940disable:disable,
4941unmount:unmount,
4942destroy:destroy};
4943// TODO: Investigate why this early return causes a TDZ error in the tests —
4944// it doesn't seem to happen in the browser
4945
4946/* istanbul ignore if */
4947
4948if(!props.render){
4949if(process.env.NODE_ENV!=="production"){
4950errorWhen(true,'render() function has not been supplied.');
4951}
4952
4953return instance;
4954}// ===========================================================================
4955// Initial mutations
4956// ===========================================================================
4957
4958
4959var _props$render=props.render(instance),
4960popper=_props$render.popper,
4961onUpdate=_props$render.onUpdate;
4962
4963popper.setAttribute('data-tippy-root','');
4964popper.id="tippy-"+instance.id;
4965instance.popper=popper;
4966reference._tippy=instance;
4967popper._tippy=instance;
4968var pluginsHooks=plugins.map(function(plugin){
4969return plugin.fn(instance);
4970});
4971var hasAriaExpanded=reference.hasAttribute('aria-expanded');
4972addListeners();
4973handleAriaExpandedAttribute();
4974handleStyles();
4975invokeHook('onCreate',[instance]);
4976
4977if(props.showOnCreate){
4978scheduleShow();
4979}// Prevent a tippy with a delay from hiding if the cursor left then returned
4980// before it started hiding
4981
4982
4983popper.addEventListener('mouseenter',function(){
4984if(instance.props.interactive&&instance.state.isVisible){
4985instance.clearDelayTimeouts();
4986}
4987});
4988popper.addEventListener('mouseleave',function(event){
4989if(instance.props.interactive&&instance.props.trigger.indexOf('mouseenter')>=0){
4990doc.addEventListener('mousemove',debouncedOnMouseMove);
4991debouncedOnMouseMove(event);
4992}
4993});
4994return instance;// ===========================================================================
4995// 🔒 Private methods
4996// ===========================================================================
4997
4998function getNormalizedTouchSettings(){
4999var touch=instance.props.touch;
5000return Array.isArray(touch)?touch:[touch,0];
5001}
5002
5003function getIsCustomTouchBehavior(){
5004return getNormalizedTouchSettings()[0]==='hold';
5005}
5006
5007function getIsDefaultRenderFn(){
5008var _instance$props$rende;
5009
5010// @ts-ignore
5011return!!((_instance$props$rende=instance.props.render)==null?void 0:_instance$props$rende.$$tippy);
5012}
5013
5014function getCurrentTarget(){
5015return currentTarget||reference;
5016}
5017
5018function getDefaultTemplateChildren(){
5019return getChildren(popper);
5020}
5021
5022function getDelay(isShow){
5023// For touch or keyboard input, force `0` delay for UX reasons
5024// Also if the instance is mounted but not visible (transitioning out),
5025// ignore delay
5026if(instance.state.isMounted&&!instance.state.isVisible||currentInput.isTouch||lastTriggerEvent&&lastTriggerEvent.type==='focus'){
5027return 0;
5028}
5029
5030return getValueAtIndexOrReturn(instance.props.delay,isShow?0:1,defaultProps.delay);
5031}
5032
5033function handleStyles(){
5034popper.style.pointerEvents=instance.props.interactive&&instance.state.isVisible?'':'none';
5035popper.style.zIndex=""+instance.props.zIndex;
5036}
5037
5038function updateIOSClass(isAdd){
5039var shouldAdd=isAdd&&isIOS&&currentInput.isTouch;
5040doc.body.classList[shouldAdd?'add':'remove'](IOS_CLASS);
5041}
5042
5043function invokeHook(hook,args,shouldInvokePropsHook){
5044if(shouldInvokePropsHook===void 0){
5045shouldInvokePropsHook=true;
5046}
5047
5048pluginsHooks.forEach(function(pluginHooks){
5049if(pluginHooks[hook]){
5050pluginHooks[hook].apply(void 0,args);
5051}
5052});
5053
5054if(shouldInvokePropsHook){
5055var _instance$props;
5056
5057(_instance$props=instance.props)[hook].apply(_instance$props,args);
5058}
5059}
5060
5061function handleAriaContentAttribute(){
5062var aria=instance.props.aria;
5063
5064if(!aria.content){
5065return;
5066}
5067
5068var attr="aria-"+aria.content;
5069var id=popper.id;
5070var nodes=normalizeToArray(instance.props.triggerTarget||reference);
5071nodes.forEach(function(node){
5072var currentValue=node.getAttribute(attr);
5073
5074if(instance.state.isVisible){
5075node.setAttribute(attr,currentValue?currentValue+" "+id:id);
5076}else{
5077var nextValue=currentValue&&currentValue.replace(id,'').trim();
5078
5079if(nextValue){
5080node.setAttribute(attr,nextValue);
5081}else{
5082node.removeAttribute(attr);
5083}
5084}
5085});
5086}
5087
5088function handleAriaExpandedAttribute(){
5089if(hasAriaExpanded||!instance.props.aria.expanded){
5090return;
5091}
5092
5093var nodes=normalizeToArray(instance.props.triggerTarget||reference);
5094nodes.forEach(function(node){
5095if(instance.props.interactive){
5096node.setAttribute('aria-expanded',instance.state.isVisible&&node===getCurrentTarget()?'true':'false');
5097}else{
5098node.removeAttribute('aria-expanded');
5099}
5100});
5101}
5102
5103function cleanupInteractiveMouseListeners(){
5104doc.body.removeEventListener('mouseleave',scheduleHide);
5105doc.removeEventListener('mousemove',debouncedOnMouseMove);
5106mouseMoveListeners=mouseMoveListeners.filter(function(listener){
5107return listener!==debouncedOnMouseMove;
5108});
5109}
5110
5111function onDocumentMouseDown(event){
5112// Clicked on interactive popper
5113if(instance.props.interactive&&popper.contains(event.target)){
5114return;
5115}// Clicked on the event listeners target
5116
5117
5118if(getCurrentTarget().contains(event.target)){
5119if(currentInput.isTouch){
5120return;
5121}
5122
5123if(instance.state.isVisible&&instance.props.trigger.indexOf('click')>=0){
5124return;
5125}
5126}else{
5127instance.props.onClickOutside(instance,event);
5128}
5129
5130if(instance.props.hideOnClick===true){
5131isVisibleFromClick=false;
5132instance.clearDelayTimeouts();
5133instance.hide();// `mousedown` event is fired right before `focus` if pressing the
5134// currentTarget. This lets a tippy with `focus` trigger know that it
5135// should not show
5136
5137didHideDueToDocumentMouseDown=true;
5138setTimeout(function(){
5139didHideDueToDocumentMouseDown=false;
5140});// The listener gets added in `scheduleShow()`, but this may be hiding it
5141// before it shows, and hide()'s early bail-out behavior can prevent it
5142// from being cleaned up
5143
5144if(!instance.state.isMounted){
5145removeDocumentMouseDownListener();
5146}
5147}
5148}
5149
5150function addDocumentMouseDownListener(){
5151doc.addEventListener('mousedown',onDocumentMouseDown,true);
5152}
5153
5154function removeDocumentMouseDownListener(){
5155doc.removeEventListener('mousedown',onDocumentMouseDown,true);
5156}
5157
5158function onTransitionedOut(duration,callback){
5159onTransitionEnd(duration,function(){
5160if(!instance.state.isVisible&&popper.parentNode&&popper.parentNode.contains(popper)){
5161callback();
5162}
5163});
5164}
5165
5166function onTransitionedIn(duration,callback){
5167onTransitionEnd(duration,callback);
5168}
5169
5170function onTransitionEnd(duration,callback){
5171var box=getDefaultTemplateChildren().box;
5172
5173function listener(event){
5174if(event.target===box){
5175updateTransitionEndListener(box,'remove',listener);
5176callback();
5177}
5178}// Make callback synchronous if duration is 0
5179// `transitionend` won't fire otherwise
5180
5181
5182if(duration===0){
5183return callback();
5184}
5185
5186updateTransitionEndListener(box,'remove',currentTransitionEndListener);
5187updateTransitionEndListener(box,'add',listener);
5188currentTransitionEndListener=listener;
5189}
5190
5191function on(eventType,handler,options){
5192if(options===void 0){
5193options=false;
5194}
5195
5196var nodes=normalizeToArray(instance.props.triggerTarget||reference);
5197nodes.forEach(function(node){
5198node.addEventListener(eventType,handler,options);
5199listeners.push({
5200node:node,
5201eventType:eventType,
5202handler:handler,
5203options:options});
5204
5205});
5206}
5207
5208function addListeners(){
5209if(getIsCustomTouchBehavior()){
5210on('touchstart',onTrigger,PASSIVE);
5211on('touchend',onMouseLeave,PASSIVE);
5212}
5213
5214splitBySpaces(instance.props.trigger).forEach(function(eventType){
5215if(eventType==='manual'){
5216return;
5217}
5218
5219on(eventType,onTrigger);
5220
5221switch(eventType){
5222case'mouseenter':
5223on('mouseleave',onMouseLeave);
5224break;
5225
5226case'focus':
5227on(isIE?'focusout':'blur',onBlurOrFocusOut);
5228break;
5229
5230case'focusin':
5231on('focusout',onBlurOrFocusOut);
5232break;}
5233
5234});
5235}
5236
5237function removeListeners(){
5238listeners.forEach(function(_ref){
5239var node=_ref.node,
5240eventType=_ref.eventType,
5241handler=_ref.handler,
5242options=_ref.options;
5243node.removeEventListener(eventType,handler,options);
5244});
5245listeners=[];
5246}
5247
5248function onTrigger(event){
5249var shouldScheduleClickHide=false;
5250
5251if(!instance.state.isEnabled||isEventListenerStopped(event)||didHideDueToDocumentMouseDown){
5252return;
5253}
5254
5255lastTriggerEvent=event;
5256currentTarget=event.currentTarget;
5257handleAriaExpandedAttribute();
5258
5259if(!instance.state.isVisible&&isMouseEvent(event)){
5260// If scrolling, `mouseenter` events can be fired if the cursor lands
5261// over a new target, but `mousemove` events don't get fired. This
5262// causes interactive tooltips to get stuck open until the cursor is
5263// moved
5264mouseMoveListeners.forEach(function(listener){
5265return listener(event);
5266});
5267}// Toggle show/hide when clicking click-triggered tooltips
5268
5269
5270if(event.type==='click'&&(instance.props.trigger.indexOf('mouseenter')<0||isVisibleFromClick)&&instance.props.hideOnClick!==false&&instance.state.isVisible){
5271shouldScheduleClickHide=true;
5272}else{
5273scheduleShow(event);
5274}
5275
5276if(event.type==='click'){
5277isVisibleFromClick=!shouldScheduleClickHide;
5278}
5279
5280if(shouldScheduleClickHide){
5281scheduleHide(event);
5282}
5283}
5284
5285function onMouseMove(event){
5286var target=event.target;
5287var isCursorOverReferenceOrPopper=reference.contains(target)||popper.contains(target);
5288
5289if(event.type==='mousemove'&&isCursorOverReferenceOrPopper){
5290return;
5291}
5292
5293var popperTreeData=getNestedPopperTree().concat(popper).map(function(popper){
5294var _instance$popperInsta;
5295
5296var instance=popper._tippy;
5297var state=(_instance$popperInsta=instance.popperInstance)==null?void 0:_instance$popperInsta.state;
5298
5299if(state){
5300return{
5301popperRect:popper.getBoundingClientRect(),
5302popperState:state,
5303props:props};
5304
5305}
5306
5307return null;
5308}).filter(Boolean);
5309
5310if(isCursorOutsideInteractiveBorder(popperTreeData,event)){
5311cleanupInteractiveMouseListeners();
5312scheduleHide(event);
5313}
5314}
5315
5316function onMouseLeave(event){
5317var shouldBail=isEventListenerStopped(event)||instance.props.trigger.indexOf('click')>=0&&isVisibleFromClick;
5318
5319if(shouldBail){
5320return;
5321}
5322
5323if(instance.props.interactive){
5324doc.body.addEventListener('mouseleave',scheduleHide);
5325doc.addEventListener('mousemove',debouncedOnMouseMove);
5326pushIfUnique(mouseMoveListeners,debouncedOnMouseMove);
5327debouncedOnMouseMove(event);
5328return;
5329}
5330
5331scheduleHide(event);
5332}
5333
5334function onBlurOrFocusOut(event){
5335if(instance.props.trigger.indexOf('focusin')<0&&event.target!==getCurrentTarget()){
5336return;
5337}// If focus was moved to within the popper
5338
5339
5340if(instance.props.interactive&&event.relatedTarget&&popper.contains(event.relatedTarget)){
5341return;
5342}
5343
5344scheduleHide(event);
5345}
5346
5347function isEventListenerStopped(event){
5348return currentInput.isTouch?getIsCustomTouchBehavior()!==event.type.indexOf('touch')>=0:false;
5349}
5350
5351function createPopperInstance(){
5352destroyPopperInstance();
5353var _instance$props2=instance.props,
5354popperOptions=_instance$props2.popperOptions,
5355placement=_instance$props2.placement,
5356offset=_instance$props2.offset,
5357getReferenceClientRect=_instance$props2.getReferenceClientRect,
5358moveTransition=_instance$props2.moveTransition;
5359var arrow=getIsDefaultRenderFn()?getChildren(popper).arrow:null;
5360var computedReference=getReferenceClientRect?{
5361getBoundingClientRect:getReferenceClientRect,
5362contextElement:getCurrentTarget()}:
5363reference;
5364var tippyModifier={
5365name:'$$tippy',
5366enabled:true,
5367phase:'beforeWrite',
5368requires:['computeStyles'],
5369fn:function fn(_ref2){
5370var state=_ref2.state;
5371
5372if(getIsDefaultRenderFn()){
5373var _getDefaultTemplateCh=getDefaultTemplateChildren(),
5374box=_getDefaultTemplateCh.box;
5375
5376['placement','reference-hidden','escaped'].forEach(function(attr){
5377if(attr==='placement'){
5378box.setAttribute('data-placement',state.placement);
5379}else{
5380if(state.attributes.popper["data-popper-"+attr]){
5381box.setAttribute("data-"+attr,'');
5382}else{
5383box.removeAttribute("data-"+attr);
5384}
5385}
5386});
5387state.attributes.popper={};
5388}
5389}};
5390
5391var arrowModifier={
5392name:'arrow',
5393enabled:!!arrow,
5394options:{
5395element:arrow,
5396padding:3}};
5397
5398
5399var modifiers=[{
5400name:'offset',
5401options:{
5402offset:offset}},
5403
5404{
5405name:'preventOverflow',
5406options:{
5407padding:{
5408top:2,
5409bottom:2,
5410left:5,
5411right:5}}},
5412
5413
5414{
5415name:'flip',
5416options:{
5417padding:5}},
5418
5419{
5420name:'computeStyles',
5421options:{
5422adaptive:!moveTransition}}].
5423
5424concat(getIsDefaultRenderFn()?[arrowModifier]:[],(popperOptions==null?void 0:popperOptions.modifiers)||[],[tippyModifier]);
5425instance.popperInstance=core.createPopper(computedReference,popper,Object.assign({},popperOptions,{
5426placement:placement,
5427onFirstUpdate:onFirstUpdate,
5428modifiers:modifiers}));
5429
5430}
5431
5432function destroyPopperInstance(){
5433if(instance.popperInstance){
5434instance.popperInstance.destroy();
5435instance.popperInstance=null;
5436}
5437}
5438
5439function mount(){
5440var appendTo=instance.props.appendTo;
5441var parentNode;// By default, we'll append the popper to the triggerTargets's parentNode so
5442// it's directly after the reference element so the elements inside the
5443// tippy can be tabbed to
5444// If there are clipping issues, the user can specify a different appendTo
5445// and ensure focus management is handled correctly manually
5446
5447var node=getCurrentTarget();
5448
5449if(instance.props.interactive&&appendTo===defaultProps.appendTo||appendTo==='parent'){
5450parentNode=node.parentNode;
5451}else{
5452parentNode=invokeWithArgsOrReturn(appendTo,[node]);
5453}// The popper element needs to exist on the DOM before its position can be
5454// updated as Popper needs to read its dimensions
5455
5456
5457if(!parentNode.contains(popper)){
vendor: 8,823 bytes, lines 5458-5776
5458parentNode.appendChild(popper);
5459}
5460
5461createPopperInstance();
5462/* istanbul ignore else */
5463
5464if(process.env.NODE_ENV!=="production"){
5465// Accessibility check
5466warnWhen(instance.props.interactive&&appendTo===defaultProps.appendTo&&node.nextElementSibling!==popper,['Interactive tippy element may not be accessible via keyboard','navigation because it is not directly after the reference element','in the DOM source order.','\n\n','Using a wrapper <div> or <span> tag around the reference element','solves this by creating a new parentNode context.','\n\n','Specifying `appendTo: document.body` silences this warning, but it','assumes you are using a focus management solution to handle','keyboard navigation.','\n\n','See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));
5467}
5468}
5469
5470function getNestedPopperTree(){
5471return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));
5472}
5473
5474function scheduleShow(event){
5475instance.clearDelayTimeouts();
5476
5477if(event){
5478invokeHook('onTrigger',[instance,event]);
5479}
5480
5481addDocumentMouseDownListener();
5482var delay=getDelay(true);
5483
5484var _getNormalizedTouchSe=getNormalizedTouchSettings(),
5485touchValue=_getNormalizedTouchSe[0],
5486touchDelay=_getNormalizedTouchSe[1];
5487
5488if(currentInput.isTouch&&touchValue==='hold'&&touchDelay){
5489delay=touchDelay;
5490}
5491
5492if(delay){
5493showTimeout=setTimeout(function(){
5494instance.show();
5495},delay);
5496}else{
5497instance.show();
5498}
5499}
5500
5501function scheduleHide(event){
5502instance.clearDelayTimeouts();
5503invokeHook('onUntrigger',[instance,event]);
5504
5505if(!instance.state.isVisible){
5506removeDocumentMouseDownListener();
5507return;
5508}// For interactive tippies, scheduleHide is added to a document.body handler
5509// from onMouseLeave so must intercept scheduled hides from mousemove/leave
5510// events when trigger contains mouseenter and click, and the tip is
5511// currently shown as a result of a click.
5512
5513
5514if(instance.props.trigger.indexOf('mouseenter')>=0&&instance.props.trigger.indexOf('click')>=0&&['mouseleave','mousemove'].indexOf(event.type)>=0&&isVisibleFromClick){
5515return;
5516}
5517
5518var delay=getDelay(false);
5519
5520if(delay){
5521hideTimeout=setTimeout(function(){
5522if(instance.state.isVisible){
5523instance.hide();
5524}
5525},delay);
5526}else{
5527// Fixes a `transitionend` problem when it fires 1 frame too
5528// late sometimes, we don't want hide() to be called.
5529scheduleHideAnimationFrame=requestAnimationFrame(function(){
5530instance.hide();
5531});
5532}
5533}// ===========================================================================
5534// 🔑 Public methods
5535// ===========================================================================
5536
5537
5538function enable(){
5539instance.state.isEnabled=true;
5540}
5541
5542function disable(){
5543// Disabling the instance should also hide it
5544// https://github.com/atomiks/tippy.js-react/issues/106
5545instance.hide();
5546instance.state.isEnabled=false;
5547}
5548
5549function clearDelayTimeouts(){
5550clearTimeout(showTimeout);
5551clearTimeout(hideTimeout);
5552cancelAnimationFrame(scheduleHideAnimationFrame);
5553}
5554
5555function setProps(partialProps){
5556/* istanbul ignore else */
5557if(process.env.NODE_ENV!=="production"){
5558warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('setProps'));
5559}
5560
5561if(instance.state.isDestroyed){
5562return;
5563}
5564
5565invokeHook('onBeforeUpdate',[instance,partialProps]);
5566removeListeners();
5567var prevProps=instance.props;
5568var nextProps=evaluateProps(reference,Object.assign({},instance.props,{},partialProps,{
5569ignoreAttributes:true}));
5570
5571instance.props=nextProps;
5572addListeners();
5573
5574if(prevProps.interactiveDebounce!==nextProps.interactiveDebounce){
5575cleanupInteractiveMouseListeners();
5576debouncedOnMouseMove=debounce(onMouseMove,nextProps.interactiveDebounce);
5577}// Ensure stale aria-expanded attributes are removed
5578
5579
5580if(prevProps.triggerTarget&&!nextProps.triggerTarget){
5581normalizeToArray(prevProps.triggerTarget).forEach(function(node){
5582node.removeAttribute('aria-expanded');
5583});
5584}else if(nextProps.triggerTarget){
5585reference.removeAttribute('aria-expanded');
5586}
5587
5588handleAriaExpandedAttribute();
5589handleStyles();
5590
5591if(onUpdate){
5592onUpdate(prevProps,nextProps);
5593}
5594
5595if(instance.popperInstance){
5596createPopperInstance();// Fixes an issue with nested tippies if they are all getting re-rendered,
5597// and the nested ones get re-rendered first.
5598// https://github.com/atomiks/tippyjs-react/issues/177
5599// TODO: find a cleaner / more efficient solution(!)
5600
5601getNestedPopperTree().forEach(function(nestedPopper){
5602// React (and other UI libs likely) requires a rAF wrapper as it flushes
5603// its work in one
5604requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
5605});
5606}
5607
5608invokeHook('onAfterUpdate',[instance,partialProps]);
5609}
5610
5611function setContent(content){
5612instance.setProps({
5613content:content});
5614
5615}
5616
5617function show(){
5618/* istanbul ignore else */
5619if(process.env.NODE_ENV!=="production"){
5620warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('show'));
5621}// Early bail-out
5622
5623
5624var isAlreadyVisible=instance.state.isVisible;
5625var isDestroyed=instance.state.isDestroyed;
5626var isDisabled=!instance.state.isEnabled;
5627var isTouchAndTouchDisabled=currentInput.isTouch&&!instance.props.touch;
5628var duration=getValueAtIndexOrReturn(instance.props.duration,0,defaultProps.duration);
5629
5630if(isAlreadyVisible||isDestroyed||isDisabled||isTouchAndTouchDisabled){
5631return;
5632}// Normalize `disabled` behavior across browsers.
5633// Firefox allows events on disabled elements, but Chrome doesn't.
5634// Using a wrapper element (i.e. <span>) is recommended.
5635
5636
5637if(getCurrentTarget().hasAttribute('disabled')){
5638return;
5639}
5640
5641invokeHook('onShow',[instance],false);
5642
5643if(instance.props.onShow(instance)===false){
5644return;
5645}
5646
5647instance.state.isVisible=true;
5648
5649if(getIsDefaultRenderFn()){
5650popper.style.visibility='visible';
5651}
5652
5653handleStyles();
5654addDocumentMouseDownListener();
5655
5656if(!instance.state.isMounted){
5657popper.style.transition='none';
5658}// If flipping to the opposite side after hiding at least once, the
5659// animation will use the wrong placement without resetting the duration
5660
5661
5662if(getIsDefaultRenderFn()){
5663var _getDefaultTemplateCh2=getDefaultTemplateChildren(),
5664box=_getDefaultTemplateCh2.box,
5665content=_getDefaultTemplateCh2.content;
5666
5667setTransitionDuration([box,content],0);
5668}
5669
5670onFirstUpdate=function onFirstUpdate(){
5671if(!instance.state.isVisible||ignoreOnFirstUpdate){
5672return;
5673}
5674
5675ignoreOnFirstUpdate=true;// reflow
5676
5677void popper.offsetHeight;
5678popper.style.transition=instance.props.moveTransition;
5679
5680if(getIsDefaultRenderFn()&&instance.props.animation){
5681var _getDefaultTemplateCh3=getDefaultTemplateChildren(),
5682_box=_getDefaultTemplateCh3.box,
5683_content=_getDefaultTemplateCh3.content;
5684
5685setTransitionDuration([_box,_content],duration);
5686setVisibilityState([_box,_content],'visible');
5687}
5688
5689handleAriaContentAttribute();
5690handleAriaExpandedAttribute();
5691pushIfUnique(mountedInstances,instance);
5692updateIOSClass(true);
5693instance.state.isMounted=true;
5694invokeHook('onMount',[instance]);
5695
5696if(instance.props.animation&&getIsDefaultRenderFn()){
5697onTransitionedIn(duration,function(){
5698instance.state.isShown=true;
5699invokeHook('onShown',[instance]);
5700});
5701}
5702};
5703
5704mount();
5705}
5706
5707function hide(){
5708/* istanbul ignore else */
5709if(process.env.NODE_ENV!=="production"){
5710warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('hide'));
5711}// Early bail-out
5712
5713
5714var isAlreadyHidden=!instance.state.isVisible;
5715var isDestroyed=instance.state.isDestroyed;
5716var isDisabled=!instance.state.isEnabled;
5717var duration=getValueAtIndexOrReturn(instance.props.duration,1,defaultProps.duration);
5718
5719if(isAlreadyHidden||isDestroyed||isDisabled){
5720return;
5721}
5722
5723invokeHook('onHide',[instance],false);
5724
5725if(instance.props.onHide(instance)===false){
5726return;
5727}
5728
5729instance.state.isVisible=false;
5730instance.state.isShown=false;
5731ignoreOnFirstUpdate=false;
5732
5733if(getIsDefaultRenderFn()){
5734popper.style.visibility='hidden';
5735}
5736
5737cleanupInteractiveMouseListeners();
5738removeDocumentMouseDownListener();
5739handleStyles();
5740
5741if(getIsDefaultRenderFn()){
5742var _getDefaultTemplateCh4=getDefaultTemplateChildren(),
5743box=_getDefaultTemplateCh4.box,
5744content=_getDefaultTemplateCh4.content;
5745
5746if(instance.props.animation){
5747setTransitionDuration([box,content],duration);
5748setVisibilityState([box,content],'hidden');
5749}
5750}
5751
5752handleAriaContentAttribute();
5753handleAriaExpandedAttribute();
5754
5755if(instance.props.animation){
5756if(getIsDefaultRenderFn()){
5757onTransitionedOut(duration,instance.unmount);
5758}
5759}else{
5760instance.unmount();
5761}
5762}
5763
5764function unmount(){
5765if(instance.state.isVisible){
5766instance.hide();
5767}
5768
5769if(!instance.state.isMounted){
5770return;
5771}
5772
5773destroyPopperInstance();// If a popper is not interactive, it will be appended outside the popper
5774// tree by default. This seems mainly for interactive tippies, but we should
5775// find a workaround if possible
5776
5777getNestedPopperTree().forEach(function(nestedPopper){
5778nestedPopper._tippy.unmount();
5779});
5780
5781if(popper.parentNode){
5782popper.parentNode.removeChild(popper);
5783}
5784
5785mountedInstances=mountedInstances.filter(function(i){
5786return i!==instance;
5787});
5788
5789if(mountedInstances.length===0){
5790updateIOSClass(false);
5791}
5792
5793instance.state.isMounted=false;
5794invokeHook('onHidden',[instance]);
5795}
5796
5797function destroy(){
5798/* istanbul ignore else */
5799if(process.env.NODE_ENV!=="production"){
5800warnWhen(instance.state.isDestroyed,createMemoryLeakWarning('destroy'));
5801}
5802
5803if(instance.state.isDestroyed){
5804return;
5805}
5806
5807instance.clearDelayTimeouts();
5808instance.unmount();
5809removeListeners();
5810delete reference._tippy;
5811instance.state.isDestroyed=true;
5812invokeHook('onDestroy',[instance]);
5813}
5814}
5815
5816function tippy(targets,optionalProps){
5817if(optionalProps===void 0){
5818optionalProps={};
5819}
5820
5821var plugins=defaultProps.plugins.concat(optionalProps.plugins||[]);
5822/* istanbul ignore else */
5823
5824if(process.env.NODE_ENV!=="production"){
5825validateTargets(targets);
5826validateProps(optionalProps,plugins);
5827}
5828
5829bindGlobalEventListeners();
5830var passedProps=Object.assign({},optionalProps,{
5831plugins:plugins});
5832
5833var elements=getArrayOfElements(targets);
5834/* istanbul ignore else */
5835
5836if(process.env.NODE_ENV!=="production"){
5837var isSingleContentElement=isElement(passedProps.content);
5838var isMoreThanOneReferenceElement=elements.length>1;
5839warnWhen(isSingleContentElement&&isMoreThanOneReferenceElement,['tippy() was passed an Element as the `content` prop, but more than','one tippy instance was created by this invocation. This means the','content element will only be appended to the last tippy instance.','\n\n','Instead, pass the .innerHTML of the element, or use a function that','returns a cloned version of the element instead.','\n\n','1) content: element.innerHTML\n','2) content: () => element.cloneNode(true)'].join(' '));
5840}
5841
5842var instances=elements.reduce(function(acc,reference){
5843var instance=reference&&createTippy(reference,passedProps);
5844
5845if(instance){
5846acc.push(instance);
5847}
5848
5849return acc;
5850},[]);
5851return isElement(targets)?instances[0]:instances;
5852}
5853
5854tippy.defaultProps=defaultProps;
5855tippy.setDefaultProps=setDefaultProps;
5856tippy.currentInput=currentInput;
5857var hideAll=function hideAll(_temp){
5858var _ref=_temp===void 0?{}:_temp,
5859excludedReferenceOrInstance=_ref.exclude,
5860duration=_ref.duration;
5861
5862mountedInstances.forEach(function(instance){
5863var isExcluded=false;
5864
5865if(excludedReferenceOrInstance){
5866isExcluded=isReferenceElement(excludedReferenceOrInstance)?instance.reference===excludedReferenceOrInstance:instance.popper===excludedReferenceOrInstance.popper;
5867}
5868
5869if(!isExcluded){
5870var originalDuration=instance.props.duration;
5871instance.setProps({
5872duration:duration});
5873
5874instance.hide();
5875
5876if(!instance.state.isDestroyed){
5877instance.setProps({
5878duration:originalDuration});
5879
5880}
5881}
5882});
5883};
5884
5885var createSingleton=function createSingleton(tippyInstances,optionalProps){
5886if(optionalProps===void 0){
5887optionalProps={};
5888}
5889
5890/* istanbul ignore else */
5891if(process.env.NODE_ENV!=="production"){
5892errorWhen(!Array.isArray(tippyInstances),['The first argument passed to createSingleton() must be an array of','tippy instances. The passed value was',String(tippyInstances)].join(' '));
5893}
5894
5895tippyInstances.forEach(function(instance){
5896instance.disable();
5897});
5898var currentTarget;
5899var references=tippyInstances.map(function(instance){
5900return instance.reference;
5901});
5902var singleton={
5903fn:function fn(){
5904return{
5905onDestroy:function onDestroy(){
5906tippyInstances.forEach(function(instance){
5907instance.enable();
5908});
5909},
5910onTrigger:function onTrigger(instance,event){
5911var target=event.currentTarget;
5912var index=references.indexOf(target);// bail-out
5913
5914if(target===currentTarget){
5915return;
5916}
5917
5918currentTarget=target;
5919var overrideProps=(optionalProps.overrides||[]).concat('content').reduce(function(acc,prop){
5920acc[prop]=tippyInstances[index].props[prop];
5921return acc;
5922},{});
5923instance.setProps(Object.assign({},overrideProps,{
5924getReferenceClientRect:function getReferenceClientRect(){
5925return target.getBoundingClientRect();
5926}}));
5927
5928}};
5929
5930}};
5931
5932return tippy(div(),Object.assign({},removeProperties(optionalProps,['overrides']),{
5933plugins:[singleton].concat(optionalProps.plugins||[]),
5934triggerTarget:references}));
5935
5936};
5937
5938var BUBBLING_EVENTS_MAP={
5939mouseover:'mouseenter',
5940focusin:'focus',
5941click:'click'};
5942
5943/**
5944 * Creates a delegate instance that controls the creation of tippy instances
5945 * for child elements (`target` CSS selector).
5946 */
5947
5948function delegate(targets,props){
5949/* istanbul ignore else */
5950if(process.env.NODE_ENV!=="production"){
5951errorWhen(!(props&&props.target),['You must specity a `target` prop indicating a CSS selector string matching','the target elements that should receive a tippy.'].join(' '));
5952}
5953
5954var listeners=[];
5955var childTippyInstances=[];
5956var target=props.target;
5957var nativeProps=removeProperties(props,['target']);
5958var parentProps=Object.assign({},nativeProps,{
5959trigger:'manual',
5960touch:false});
5961
5962var childProps=Object.assign({},nativeProps,{
5963showOnCreate:true});
5964
5965var returnValue=tippy(targets,parentProps);
5966var normalizedReturnValue=normalizeToArray(returnValue);
5967
5968function onTrigger(event){
5969if(!event.target){
5970return;
5971}
5972
5973var targetNode=event.target.closest(target);
5974
5975if(!targetNode){
5976return;
5977}// Get relevant trigger with fallbacks:
5978// 1. Check `data-tippy-trigger` attribute on target node
5979// 2. Fallback to `trigger` passed to `delegate()`
5980// 3. Fallback to `defaultProps.trigger`
5981
5982
5983var trigger=targetNode.getAttribute('data-tippy-trigger')||props.trigger||defaultProps.trigger;// @ts-ignore
5984
5985if(targetNode._tippy){
5986return;
5987}
5988
5989if(event.type==='touchstart'&&typeof childProps.touch==='boolean'){
5990return;
5991}
5992
5993if(event.type!=='touchstart'&&trigger.indexOf(BUBBLING_EVENTS_MAP[event.type])){
5994return;
5995}
5996
5997var instance=tippy(targetNode,childProps);
5998
5999if(instance){
6000childTippyInstances=childTippyInstances.concat(instance);
6001}
6002}
6003
6004function on(node,eventType,handler,options){
6005if(options===void 0){
6006options=false;
6007}
6008
6009node.addEventListener(eventType,handler,options);
6010listeners.push({
6011node:node,
6012eventType:eventType,
6013handler:handler,
6014options:options});
6015
6016}
6017
6018function addEventListeners(instance){
6019var reference=instance.reference;
6020on(reference,'touchstart',onTrigger);
6021on(reference,'mouseover',onTrigger);
6022on(reference,'focusin',onTrigger);
6023on(reference,'click',onTrigger);
6024}
6025
6026function removeEventListeners(){
6027listeners.forEach(function(_ref){
6028var node=_ref.node,
6029eventType=_ref.eventType,
6030handler=_ref.handler,
6031options=_ref.options;
6032node.removeEventListener(eventType,handler,options);
6033});
6034listeners=[];
6035}
6036
6037function applyMutations(instance){
6038var originalDestroy=instance.destroy;
6039
6040instance.destroy=function(shouldDestroyChildInstances){
6041if(shouldDestroyChildInstances===void 0){
6042shouldDestroyChildInstances=true;
6043}
6044
6045if(shouldDestroyChildInstances){
6046childTippyInstances.forEach(function(instance){
6047instance.destroy();
6048});
6049}
6050
6051childTippyInstances=[];
6052removeEventListeners();
6053originalDestroy();
6054};
6055
6056addEventListeners(instance);
6057}
6058
6059normalizedReturnValue.forEach(applyMutations);
6060return returnValue;
6061}
6062
6063var animateFill={
6064name:'animateFill',
6065defaultValue:false,
6066fn:function fn(instance){
6067var _instance$props$rende;
6068
6069// @ts-ignore
6070if(!((_instance$props$rende=instance.props.render)==null?void 0:_instance$props$rende.$$tippy)){
6071if(process.env.NODE_ENV!=="production"){
6072errorWhen(instance.props.animateFill,'The `animateFill` plugin requires the default render function.');
6073}
6074
6075return{};
6076}
6077
6078var _getChildren=getChildren(instance.popper),
6079box=_getChildren.box,
6080content=_getChildren.content;
6081
6082var backdrop=instance.props.animateFill?createBackdropElement():null;
6083return{
6084onCreate:function onCreate(){
6085if(backdrop){
6086box.insertBefore(backdrop,box.firstElementChild);
6087box.setAttribute('data-animatefill','');
6088box.style.overflow='hidden';
6089instance.setProps({
6090arrow:false,
6091animation:'shift-away'});
6092
6093}
6094},
6095onMount:function onMount(){
6096if(backdrop){
6097var transitionDuration=box.style.transitionDuration;
6098var duration=Number(transitionDuration.replace('ms',''));// The content should fade in after the backdrop has mostly filled the
6099// tooltip element. `clip-path` is the other alternative but is not
6100// well-supported and is buggy on some devices.
6101
6102content.style.transitionDelay=Math.round(duration/10)+"ms";
6103backdrop.style.transitionDuration=transitionDuration;
6104setVisibilityState([backdrop],'visible');
6105}
6106},
6107onShow:function onShow(){
6108if(backdrop){
6109backdrop.style.transitionDuration='0ms';
6110}
6111},
6112onHide:function onHide(){
6113if(backdrop){
6114setVisibilityState([backdrop],'hidden');
6115}
6116}};
6117
6118}};
6119
6120
6121function createBackdropElement(){
6122var backdrop=div();
6123backdrop.className=BACKDROP_CLASS;
6124setVisibilityState([backdrop],'hidden');
6125return backdrop;
6126}
6127
6128var followCursor={
6129name:'followCursor',
6130defaultValue:false,
6131fn:function fn(instance){
6132var reference=instance.reference;
6133var doc=getOwnerDocument(instance.props.triggerTarget||reference);
6134var initialMouseCoords=null;
6135
6136function getIsManual(){
6137return instance.props.trigger.trim()==='manual';
6138}
6139
6140function getIsEnabled(){
6141// #597
6142var isValidMouseEvent=getIsManual()?true:// Check if a keyboard "click"
6143initialMouseCoords!==null&&!(initialMouseCoords.clientX===0&&initialMouseCoords.clientY===0);
6144return instance.props.followCursor&&isValidMouseEvent;
6145}
6146
6147function getIsInitialBehavior(){
6148return currentInput.isTouch||instance.props.followCursor==='initial'&&instance.state.isVisible;
6149}
6150
6151function unsetReferenceClientRect(shouldUnset){
6152if(shouldUnset){
6153instance.setProps({
6154getReferenceClientRect:null});
6155
6156}
6157}
6158
6159function handleMouseMoveListener(){
6160if(getIsEnabled()){
6161addListener();
6162}else{
6163unsetReferenceClientRect(instance.props.followCursor);
6164}
6165}
6166
6167function triggerLastMouseMove(){
6168if(getIsEnabled()){
6169onMouseMove(initialMouseCoords);
6170}
6171}
6172
6173function addListener(){
6174doc.addEventListener('mousemove',onMouseMove);
6175}
6176
6177function removeListener(){
6178doc.removeEventListener('mousemove',onMouseMove);
6179}
6180
6181function onMouseMove(event){
6182initialMouseCoords={
6183clientX:event.clientX,
6184clientY:event.clientY};
6185// If the instance is interactive, avoid updating the position unless it's
6186// over the reference element
6187
6188var isCursorOverReference=event.target?reference.contains(event.target):true;
6189var followCursor=instance.props.followCursor;
6190var clientX=event.clientX,
6191clientY=event.clientY;
6192var rect=reference.getBoundingClientRect();
6193var relativeX=clientX-rect.left;
6194var relativeY=clientY-rect.top;
6195
6196if(isCursorOverReference||!instance.props.interactive){
6197instance.setProps({
6198getReferenceClientRect:function getReferenceClientRect(){
6199var rect=reference.getBoundingClientRect();
6200var x=clientX;
6201var y=clientY;
6202
6203if(followCursor==='initial'){
6204x=rect.left+relativeX;
6205y=rect.top+relativeY;
6206}
6207
6208var top=followCursor==='horizontal'?rect.top:y;
6209var right=followCursor==='vertical'?rect.right:x;
6210var bottom=followCursor==='horizontal'?rect.bottom:y;
6211var left=followCursor==='vertical'?rect.left:x;
6212return{
6213width:right-left,
6214height:bottom-top,
6215top:top,
6216right:right,
6217bottom:bottom,
6218left:left};
6219
6220}});
6221
6222}
6223
6224if(getIsInitialBehavior()){
6225removeListener();
6226}
6227}
6228
6229return{
6230onAfterUpdate:function onAfterUpdate(_,_ref){
6231var followCursor=_ref.followCursor;
6232
6233if(followCursor!==undefined&&!followCursor){
6234unsetReferenceClientRect(true);
6235}
6236},
6237onMount:function onMount(){
6238triggerLastMouseMove();
6239},
6240onShow:function onShow(){
6241if(getIsManual()){
6242// Since there's no trigger event to use, we have to use these as
6243// baseline coords
6244initialMouseCoords={
6245clientX:0,
6246clientY:0};
6247
6248handleMouseMoveListener();
6249}
6250},
6251onTrigger:function onTrigger(_,event){
6252// Tapping on touch devices can trigger `mouseenter` then `focus`
6253if(initialMouseCoords){
6254return;
6255}
6256
6257if(isMouseEvent(event)){
6258initialMouseCoords={
6259clientX:event.clientX,
6260clientY:event.clientY};
6261
6262}
6263
6264handleMouseMoveListener();
6265},
6266onUntrigger:function onUntrigger(){
6267// If untriggered before showing (`onHidden` will never be invoked)
6268if(!instance.state.isVisible){
6269removeListener();
6270initialMouseCoords=null;
6271}
6272},
6273onHidden:function onHidden(){
6274removeListener();
6275initialMouseCoords=null;
6276}};
6277
6278}};
6279
6280
6281// position.
6282
6283var inlinePositioning={
6284name:'inlinePositioning',
6285defaultValue:false,
6286fn:function fn(instance){
6287var reference=instance.reference;
6288
6289function isEnabled(){
6290return!!instance.props.inlinePositioning;
6291}
6292
6293var placement;
6294var modifier={
6295name:'tippyInlinePositioning',
6296enabled:true,
6297phase:'afterWrite',
6298fn:function fn(_ref){
6299var state=_ref.state;
6300
6301if(isEnabled()){
6302if(placement!==state.placement){
6303instance.setProps({
6304getReferenceClientRect:function getReferenceClientRect(){
6305return _getReferenceClientRect(state.placement);
6306}});
6307
6308}
6309
6310placement=state.placement;
6311}
6312}};
6313
6314
6315function _getReferenceClientRect(placement){
6316return getInlineBoundingClientRect(getBasePlacement(placement),reference.getBoundingClientRect(),arrayFrom(reference.getClientRects()));
6317}
6318
6319return{
6320onCreate:function onCreate(){
6321var _instance$props$poppe;
6322
6323instance.setProps({
6324popperOptions:Object.assign({},instance.props.popperOptions,{
6325modifiers:[].concat(((_instance$props$poppe=instance.props.popperOptions)==null?void 0:_instance$props$poppe.modifiers)||[],[modifier])})});
6326
6327
6328}};
6329
6330}};
6331
6332function getInlineBoundingClientRect(currentBasePlacement,boundingRect,clientRects){
6333// Not an inline element, or placement is not yet known
6334if(clientRects.length<2||currentBasePlacement===null){
6335return boundingRect;
6336}
6337
6338switch(currentBasePlacement){
vendor: 4,806 bytes, lines 6339-6493
6339case'top':
6340case'bottom':
6341{
6342var firstRect=clientRects[0];
6343var lastRect=clientRects[clientRects.length-1];
6344var isTop=currentBasePlacement==='top';
6345var top=firstRect.top;
6346var bottom=lastRect.bottom;
6347var left=isTop?firstRect.left:lastRect.left;
6348var right=isTop?firstRect.right:lastRect.right;
6349var width=right-left;
6350var height=bottom-top;
6351return{
6352top:top,
6353bottom:bottom,
6354left:left,
6355right:right,
6356width:width,
6357height:height};
6358
6359}
6360
6361case'left':
6362case'right':
6363{
6364var minLeft=Math.min.apply(Math,clientRects.map(function(rects){
6365return rects.left;
6366}));
6367var maxRight=Math.max.apply(Math,clientRects.map(function(rects){
6368return rects.right;
6369}));
6370var measureRects=clientRects.filter(function(rect){
6371return currentBasePlacement==='left'?rect.left===minLeft:rect.right===maxRight;
6372});
6373var _top=measureRects[0].top;
6374var _bottom=measureRects[measureRects.length-1].bottom;
6375var _left=minLeft;
6376var _right=maxRight;
6377
6378var _width=_right-_left;
6379
6380var _height=_bottom-_top;
6381
6382return{
6383top:_top,
6384bottom:_bottom,
6385left:_left,
6386right:_right,
6387width:_width,
6388height:_height};
6389
6390}
6391
6392default:
6393{
6394return boundingRect;
6395}}
6396
6397}
6398
6399var sticky={
6400name:'sticky',
6401defaultValue:false,
6402fn:function fn(instance){
6403var reference=instance.reference,
6404popper=instance.popper;
6405
6406function getReference(){
6407return instance.popperInstance?instance.popperInstance.state.elements.reference:reference;
6408}
6409
6410function shouldCheck(value){
6411return instance.props.sticky===true||instance.props.sticky===value;
6412}
6413
6414var prevRefRect=null;
6415var prevPopRect=null;
6416
6417function updatePosition(){
6418var currentRefRect=shouldCheck('reference')?getReference().getBoundingClientRect():null;
6419var currentPopRect=shouldCheck('popper')?popper.getBoundingClientRect():null;
6420
6421if(currentRefRect&&areRectsDifferent(prevRefRect,currentRefRect)||currentPopRect&&areRectsDifferent(prevPopRect,currentPopRect)){
6422if(instance.popperInstance){
6423instance.popperInstance.update();
6424}
6425}
6426
6427prevRefRect=currentRefRect;
6428prevPopRect=currentPopRect;
6429
6430if(instance.state.isMounted){
6431requestAnimationFrame(updatePosition);
6432}
6433}
6434
6435return{
6436onMount:function onMount(){
6437if(instance.props.sticky){
6438updatePosition();
6439}
6440}};
6441
6442}};
6443
6444
6445function areRectsDifferent(rectA,rectB){
6446if(rectA&&rectB){
6447return rectA.top!==rectB.top||rectA.right!==rectB.right||rectA.bottom!==rectB.bottom||rectA.left!==rectB.left;
6448}
6449
6450return true;
6451}
6452
6453tippy.setDefaultProps({
6454render:render});
6455
6456
6457exports.animateFill=animateFill;
6458exports.createSingleton=createSingleton;
6459exports.default=tippy;
6460exports.delegate=delegate;
6461exports.followCursor=followCursor;
6462exports.hideAll=hideAll;
6463exports.inlinePositioning=inlinePositioning;
6464exports.roundArrow=ROUND_ARROW;
6465exports.sticky=sticky;
6466
6467
6468}).call(this,require('_process'));
6469
6470},{"@popperjs/core":1,"_process":9}],11:[function(require,module,exports){
6471/* eslint-env browser */
6472'use strict';
6473
6474var _countUpMin=require('./vendor/countUp.min.js');
6475var _aos=require('./vendor/aos');var _aos2=_interopRequireDefault(_aos);
6476var _tippy=require('tippy.js');var _tippy2=_interopRequireDefault(_tippy);
6477var _masonryLayout=require('masonry-layout');var _masonryLayout2=_interopRequireDefault(_masonryLayout);
6478
6479var _searchPlaceholders=require('./modules/searchPlaceholders');var _searchPlaceholders2=_interopRequireDefault(_searchPlaceholders);
6480var _backToTop=require('./modules/backToTop.js');var _backToTop2=_interopRequireDefault(_backToTop);
6481var _footerPie=require('./modules/footerPie');var _footerPie2=_interopRequireDefault(_footerPie);
6482var _header=require('modules/header.js');var _header2=_interopRequireDefault(_header);
6483var _alert=require('modules/alert.js');var _alert2=_interopRequireDefault(_alert);
6484var _sideNavigation=require('modules/sideNavigation.js');var _sideNavigation2=_interopRequireDefault(_sideNavigation);
6485var _bodyVideo=require('./modules/bodyVideo.js');var _bodyVideo2=_interopRequireDefault(_bodyVideo);
6486var _slideshow=require('./modules/slideshow.js');var _slideshow2=_interopRequireDefault(_slideshow);
6487var _parallaxAnimation=require('./modules/parallaxAnimation.js');var _parallaxAnimation2=_interopRequireDefault(_parallaxAnimation);
6488var _homePillarsAnimation=require('./modules/homePillarsAnimation.js');var _homePillarsAnimation2=_interopRequireDefault(_homePillarsAnimation);
6489var _twopie=require('modules/twopie.js');var _twopie2=_interopRequireDefault(_twopie);
6490var _fwPie=require('./modules/fwPie.js');var _fwPie2=_interopRequireDefault(_fwPie);
6491var _donut=require('./modules/donut.js');var _donut2=_interopRequireDefault(_donut);
6492var _socialHighlights=require('./modules/socialHighlights.js');var _socialHighlights2=_interopRequireDefault(_socialHighlights);
6493var _workMap=require('./modules/workMap.js');var _workMap2=_interopRequireDefault(_workMap);
6494var _mapRegions=require('./modules/mapRegions');var _mapRegions2=_interopRequireDefault(_mapRegions);
6495var _timeline=require('./modules/timeline.js');var _timeline2=_interopRequireDefault(_timeline);
6496var _countrySidebar=require('./modules/countrySidebar.js');var _countrySidebar2=_interopRequireDefault(_countrySidebar);
6497var _archiveSidebar=require('./modules/archiveSidebar.js');var _archiveSidebar2=_interopRequireDefault(_archiveSidebar);
6498var _resourceSidebar=require('./modules/resourceSidebar.js');var _resourceSidebar2=_interopRequireDefault(_resourceSidebar);
6499var _newsAndStories=require('./modules/newsAndStories.js');var _newsAndStories2=_interopRequireDefault(_newsAndStories);
6500var _iconCallout=require('./modules/iconCallout');var _iconCallout2=_interopRequireDefault(_iconCallout);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}
6501
6502(function($){
6503$(window).ready(function(){
6504_aos2.default.init({
6505once:true});
6506
6507$('.select2').select2();
6508
6509(0,_searchPlaceholders2.default)();
6510(0,_backToTop2.default)($);
6511(0,_footerPie2.default)(_countUpMin.CountUp);
6512(0,_header2.default)();
6513(0,_alert2.default)();
6514(0,_sideNavigation2.default)();
6515(0,_bodyVideo2.default)();
6516(0,_slideshow2.default)();
6517(0,_parallaxAnimation2.default)();
6518(0,_homePillarsAnimation2.default)();
6519(0,_twopie2.default)(_countUpMin.CountUp);
6520(0,_fwPie2.default)(_countUpMin.CountUp);
6521(0,_donut2.default)(_countUpMin.CountUp);
6522(0,_socialHighlights2.default)(_masonryLayout2.default);
6523(0,_workMap2.default)(_tippy2.default,_tippy.followCursor);
6524(0,_mapRegions2.default)();
6525(0,_timeline2.default)();
6526(0,_countrySidebar2.default)();
6527(0,_archiveSidebar2.default)();
6528(0,_resourceSidebar2.default)();
6529(0,_newsAndStories2.default)();
6530(0,_iconCallout2.default)();
6531});
6532})(jQuery);
6533
6534},{"./modules/archiveSidebar.js":13,"./modules/backToTop.js":14,"./modules/bodyVideo.js":15,"./modules/countrySidebar.js":16,"./modules/donut.js":17,"./modules/footerPie":18,"./modules/fwPie.js":19,"./modules/homePillarsAnimation.js":21,"./modules/iconCallout":22,"./modules/mapRegions":23,"./modules/newsAndStories.js":24,"./modules/parallaxAnimation.js":25,"./modules/resourceSidebar.js":26,"./modules/searchPlaceholders":27,"./modules/slideshow.js":29,"./modules/socialHighlights.js":30,"./modules/timeline.js":31,"./modules/workMap.js":33,"./vendor/aos":34,"./vendor/countUp.min.js":35,"masonry-layout":6,"modules/alert.js":12,"modules/header.js":20,"modules/sideNavigation.js":28,"modules/twopie.js":32,"tippy.js":10}],12:[function(require,module,exports){
6535'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(){
6536
6537if($('.alert').length===0){
6538return;
6539}
6540
6541var KEY='care-alert-banner-hidden';
6542
6543// hide alert if previously hidden (mobile only)
6544if(sessionStorage.getItem(KEY)){
6545hideAlert();
6546$('.header__alert-icon').hide();
6547}
6548
6549function hideAlert(){
6550$('.alert').hide();
6551$('body').removeClass('alert-active');
6552setAlertPadding();
6553}
6554
6555function setAlertPadding(){
6556if($(window).width()<1024){
6557if($('body').hasClass('alert-active')){
6558var h=$('.alert').outerHeight();
6559$('body').css({'padding-top':65+h+'px'});
6560}else{
6561$('body').css({'padding-top':'65px'});
6562}
6563}else{
6564if($('body').hasClass('alert-active')){
6565var _h=$('.alert').outerHeight();
6566$('body').css({'padding-top':120+_h+'px'});
6567}else{
6568$('body').css({'padding-top':'120px'});
6569}
6570}
6571}
6572
6573$('.alert__close').click(function(){
6574hideAlert();
6575
6576// prevent it reappearing this session
6577sessionStorage.setItem(KEY,true);
6578});
6579
6580// set correct padding to account for alert height
6581setAlertPadding();
6582$(window).resize(function(){
6583setAlertPadding();
6584});
6585
6586// hide alert when scrolling
6587$(window).scroll(function(){
6588if($(window).width()>=1024){
6589$('.alert').toggleClass('alert-hidden-by-scroll',$(this).scrollTop()>$('nav').height());
6590}else{
6591$('.alert').removeClass('alert-hidden-by-scroll');
6592}
6593});
6594
6595// show alert when user clicks alert icon
6596$('.header__alert-icon').click(function(){
6597$('.alert').removeClass('alert-hidden-by-scroll');
6598});
6599};
6600
6601},{}],13:[function(require,module,exports){
6602'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
6603
6604
6605
6606
6607
6608function(){
6609
6610if($('.category-archive__sb').length===0)
6611return;
6612
6613$('.category-archive__go-to-category').change(function(){
6614window.location=$(this).val();
6615});
6616
6617};
6618
6619},{}],14:[function(require,module,exports){
6620'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
6621
6622
6623
6624
6625
6626function($){
6627
6628if($('.footer__to-top').length===0)
6629return;
6630
6631$('.footer__to-top > span').click(function(){
6632$("html, body").animate({scrollTop:0},500);
6633});
6634
6635};
6636
6637},{}],15:[function(require,module,exports){
6638'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(){
6639if($('.body-video').length===0)
6640return;
6641
6642// load YouTube IFrame API
6643var firstScriptTag=document.getElementsByTagName('script')[0];
6644var tag=document.createElement('script');
6645tag.src='https://www.youtube.com/iframe_api';
6646firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);
6647
6648window.onYouTubeIframeAPIReady=function(){
6649var players={};
6650
6651$('.body-video__video').each(function(){
6652var id='yt-'+Math.random().toString(10).substring(2,6);
6653$(this).attr('id',id);
6654
6655var ytId=$(this).attr('data-yt');
6656players[id]=new YT.Player(id,{
6657videoId:ytId,
6658playerVars:{
6659rel:0,
6660showinfo:0}});
6661
6662
6663});
6664window.ytPlayers=players;
6665
6666$('.body-video__play').click(function(){
6667var parent=$(this).parents('.body-video');
6668var id=parent.find('.body-video__video').attr('id');
6669var thumbnail=parent.find('.body-video__thumbnail');
6670
6671window.ytPlayers[id].playVideo();
6672
6673thumbnail.animate({opacity:0}
6673,500,'swing',function(){
6674thumbnail.hide();
6675});
6676});
6677};
6678};
6679
6680},{}],16:[function(require,module,exports){
6681"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=
6682
6683function(){
6684if($(".country-intro").length===0)return;
6685
6686var open=false;
6687var element=$(".country-intro select");
6688
6689// just a function to print out message
6690function isOpen(){
6691
6692
6693}// if (open) $(".country-intro__countries").addClass("open");
6694// else $(".country-intro__countries").removeClass("open");
6695// on each click toggle the "open" variable
6696element.on("click",function(){open=!open;
6697isOpen();
6698});
6699// on each blur toggle the "open" variable
6700// fire only if menu is already in "open" state
6701element.on("blur",function(){
6702if(open){
6703open=!open;
6704isOpen();
6705}
6706});
6707// on ESC key toggle the "open" variable only if menu is in "open" state
6708$(document).keyup(function(e){
6709if(e.keyCode==27){
6710if(open){
6711open=!open;
6712isOpen();
6713}
6714}
6715});
6716
6717$(".country-intro__country-select").on("change",function(){
6718var url=$(this).val();
6719
6720if(url)window.location.href=url;
6721});
6722};
6723
6724},{}],17:[function(require,module,exports){
6725'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(CountUp){
6726
6727if($('.fw-donut .donut-pie, .cw-donut .donut-pie').length===0)
6728return;
6729
6730$('.fw-donut .donut-pie, .cw-donut .donut-pie').each(function(){
6731var pie=this;
6732var observer=new IntersectionObserver(function(entries){
6733if(entries[0].isIntersecting){
6734observer.unobserve(pie);
6735animateDonut(pie);
6736}
6737});
6738
6739observer.observe(pie);
6740});
6741
6742function animateDonut(element){
6743var pie=$(element);
6744var targetPctsRaw=pie.attr('data-target-pcts').split(',');
6745var cumulativeTotal=0;
6746
6747var targets=[];
6748$(targetPctsRaw).each(function(){
6749var pct=parseInt(this);
6750
6751if(pct){
6752cumulativeTotal+=pct;
6753targets.unshift(cumulativeTotal);
6754}
6755});
6756
6757var arcCount=targets.length;
6758var arcOffset=5-arcCount;
6759$(targets).each(function(idx){
6760var arcIdx=arcOffset+idx;
6761var arc=$('svg circle:eq('+arcIdx+')',pie);
6762
6763var onCountUpdateDonut=function onCountUpdateDonut(n){
6764var len=1570.796/100*n;
6765arc.attr('stroke-dasharray',len+' '+(1570.796-len));
6766};
6767
6768var counterDonut=new CountUp(pie,this,{
6769duration:1.5*(this/100),
6770useEasing:false,
6771formattingFn:onCountUpdateDonut});
6772
6773counterDonut.start();
6774});
6775}
6776
6777};
6778
6779},{}],18:[function(require,module,exports){
6780'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(CountUp){
6781
6782if($('footer .footer-pie').length===0)
6783return;
6784
6785$('footer .footer-pie').each(function(){
6786var pie=this;
6787var observer=new IntersectionObserver(function(entries){
6788if(entries[0].isIntersecting){
6789observer.unobserve(pie);
6790animatePie(pie);
6791}
6792},{
6793threshold:[1]});
6794
6795
6796observer.observe(pie);
6797});
6798
6799function animatePie(element){
6800var pie=$(element);
6801var targetPct=parseInt(pie.attr('data-target-pct'));
6802
6803var onCountUpdateDonut=function onCountUpdateDonut(n){
6804pie.attr('data-pct',n+'%');
6805
6806var arc=$('svg circle:eq(1)',pie);
6807var len=271.747/100*n;
6808arc.attr('stroke-dasharray',len+' '+(271.747-len));
6809};
6810
6811var counterDonut=new CountUp(pie,targetPct,{
6812duration:1.75,
6813useEasing:true,
6814formattingFn:onCountUpdateDonut});
6815
6816counterDonut.start();
6817}
6818
6819};
6820
6821},{}],19:[function(require,module,exports){
6822'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(CountUp){
6823
6824if($('.fw-stat .large-pie').length===0){
6825return;
6826}
6827
6828
6829$('.fw-stat .large-pie').each(function(){
6830var pie=this;
6831var observer=new IntersectionObserver(function(entries){
6832if(entries[0].isIntersecting){
6833observer.unobserve(pie);
6834animatePie(pie);
6835}
6836},{
6837threshold:[1]});
6838
6839
6840observer.observe(pie);
6841});
6842
6843function animatePie(element){
6844var pie=$(element);
6845var targetPct=parseInt(pie.attr('data-target-pct'));
6846
6847var onCountUpdateDonut=function onCountUpdateDonut(n){
6848pie.attr('data-pct',n+'%');
6849
6850var arc=$('svg circle:eq(1)',pie);
6851var len=1570.796/100*n;
6852arc.attr('stroke-dasharray',len+' '+(1570.796-len));
6853};
6854
6855var counterDonut=new CountUp(pie,targetPct,{
6856duration:2.5,
6857useEasing:true,
6858formattingFn:onCountUpdateDonut});
6859
6860
6861counterDonut.start();
6862}
6863};
6864
6865},{}],20:[function(require,module,exports){
6866'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(){
6867$(window).scroll(function(){
6868if(parseInt($(window).width())>1023){
6869$('.header > .container').toggleClass('scrolled-nav',$(this).scrollTop()>$('nav').height());
6870$('body').toggleClass('scrolled',$(this).scrollTop()>$('nav').height());
6871$('.header__donate-full').toggleClass('scrolled-donate',$(this).scrollTop()>$('nav').height());
6872$('.header__branding').toggleClass('scrolled-branding',$(this).scrollTop()>$('nav').height());
6873$('.header__branding--xs').toggleClass('scrolled-branding',$(this).scrollTop()>$('nav').height());
6874$('.header__search-input').toggleClass('scrolled-search-input',$(this).scrollTop()>$('nav').height());
6875$('.header__search-input-icon').toggleClass('scrolled-search-input-icon',$(this).scrollTop()>$('nav').height());
6876$('.header__alert-icon').toggleClass('alert-icon-scrolled',$(this).scrollTop()>$('nav').height());
6877$('.header__navigation--children').toggleClass('navigation--children-scrolled',$(this).scrollTop()>$('nav').height());
6878}else{
6879$('.header > .container').removeClass('scrolled-nav');
6880$('body').removeClass('scrolled');
6881$('.header__donate-full').removeClass('scrolled-donate');
6882$('.header__branding').removeClass('scrolled-branding');
6883$('.header__search-input').removeClass('scrolled-search-input');
6884$('.header__search-input-icon').removeClass('scrolled-search-input-icon');
6885$('.header__navigation--children').removeClass('scrolled-navigation--children-scrolled');
6886}
6887});
6888
6889$(window).resize(function(){
6890if(parseInt($(window).width())<1023){
6891$('.header__donate-full').removeClass("header__donate-full--hover");
6892$('.header__donate-link').removeClass("header__donate-link--clicked");
6893}
6894});
6895
6896$(window).resize(function(){
6897if(parseInt($(window).width())>1023){
6898$('.header__donate-link-close').removeClass("header__donate-link-close--active");
6899$('.header__donate-link > span').css("display","block");
6900$('.header__donate-table--tablet').removeClass("header__donate-table--tablet--active");
6901}
6902});
6903
6904$('.header__hamburger').click(function(){
6905$(this).toggleClass('header__hamburger--active');
6906$('.header__mobile').toggleClass('header__mobile--active');
6907$('.header__hamburger-menu').toggleClass('header__hamburger-menu
6907--active');
6908
6909if($('.header__donate-table--tablet').hasClass('header__donate-table--tablet--active')){
6910$('.header__donate-link-close').removeClass('header__donate-link-close--active');
6911$('.header__donate-link > span').show();
6912$('.header__donate-table--tablet').removeClass('header__donate-table--tablet--active');
6913}
6914
6915if($('.header__donate-full').hasClass('header__donate-full--hover')){
6916$('.header__donate-full').removeClass('header__donate-full--hover');
6917}
6918});
6919
6920$('.header__nav-item--mobile').click(function(){
6921$(this).next().toggleClass('header__navigation--children-m--active');
6922$(this).children('i').toggleClass('icon--plus--active');
6923});
6924
6925$('.header__donate-link').click(function(){
6926$('.header__donate-link').toggleClass('header__donate-link--clicked');
6927
6928if(parseInt($(window).width())>1023){
6929$('.header__donate-full').toggleClass("header__donate-full--hover");
6930
6931if($('.header__hamburger').hasClass('header__hamburger--active')){
6932$('.header__hamburger').trigger('click');
6933$('.header__donate-full').toggleClass("header__donate-full--hover");
6934}
6935}
6936});
6937
6938$('.header__donate-link').click(function(){
6939if(parseInt($(window).width())<1023){
6940$('.header__donate-table--tablet').toggleClass('header__donate-table--tablet--active');
6941$('.header__donate-link span').toggle();
6942$('.header__donate-link-close').toggleClass('header__donate-link-close--active');
6943
6944if($('.header__hamburger-menu').hasClass('header__hamburger-menu--active')){
6945$('.header__hamburger-menu').trigger('click');
6946$('.header__donate-table--tablet').toggleClass('header__donate-table--tablet--active');
6947$('.header__donate-link span').toggle();
6948$('.header__donate-link-close').toggleClass('header__donate-link-close--active');
6949}
6950}
6951});
6952
6953$('.header__donate-link-close').click(function(){
6954$('.header__donate-table--tablet').removeClass("header__donate-table--tablet--active");
6955$('.header__donate-link-close').removeClass("header__donate-link-close--active");
6956$('.header__donate-link > span').css("display","block");
6957});
6958
6959$('.header__search-icon').click(function(){
6960$('.header__search-input').toggleClass("header__search-input--active");
6961$('.header__search-input-icon').toggleClass("header__search-input-icon--active");
6962$('.header__search-icon--icon').toggleClass("header__search-icon--icon--active");
6963});
6964
6965$(".header__search-icon").click(function(el){
6966$(".header__donate-full").removeClass('header__donate-full--hover');
6967$('.header__donate-link').removeClass('header__donate-link--clicked');
6968el.stopPropagation();
6969});
6970
6971$(".header__search-input").click(function(el){
6972el.stopPropagation();
6973});
6974
6975$(document).click(function(){
6976$('.header__search-input').removeClass("header__search-input--active");
6977$('.header__search-input-icon').removeClass("header__search-input-icon--active");
6978$('.header__search-icon--icon').removeClass("header__search-icon--icon--active");
6979});
6980$(".header__donate-link").click(function(e){
6981$('.header__search-input').removeClass("header__search-input--active");
6982$('.header__search-input-icon').removeClass("header__search-input-icon--active");
6983$('.header__search-icon--icon').removeClass("header__search-icon--icon--active");
6984e.stopPropagation();
6985});
6986
6987$(".header__donate-full").click(function(e){
6988e.stopPropagation();
6989});
6990
6991$(document).click(function(){
6992$(".header__donate-full").removeClass('header__donate-full--hover');
6993$('.header__donate-link').removeClass('header__donate-link--clicked');
6994});
6995};
6996
6997},{}],21:[function(require,module,exports){
6998'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
6999
7000
7001function(){
7002if($('.pillar-block').length===0)
7003return;
7004
7005// on load, stage is not set
7006var currentStage=0;
7007
7008var observer1=new IntersectionObserver(function(entries){
7009if(entries[0].isIntersecting){
7010observer1.unobserve($('.pillar-block__subheadline')[0]);
7011stageOne();
7012observer2.observe($('.pillar-block__headline')[0]);
7013}
7014},{
7015threshold:[1]});
7016
7017
7018var observer2=new IntersectionObserver(function(entries){
7019if(entries[0].isIntersecting){
7020observer2.unobserve($('.pillar-block__headline')[0]);
7021stageTwo();
7022observer3.observe($('.pillar-block__items-content')[0]);
7023}
7024},{
7025threshold:[1]});
7026
7027
7028var observer3=new IntersectionObserver(function(entries){
7029if(entries[0].isIntersecting){
7030observer3.unobserve($('.pillar-block__items-content')[0]);
7031stageThree();
7032}
7033},{
7034threshold:[1]});
7035
7036
7037// observe subheadline scrolling into view
7038observer1.observe($('.pillar-block__subheadline')[0]);
7039
7040// reposition bar when window is resized
7041var pillarSize;
7042$(window).resize(function(){
7043clearTimeout(pillarSize);
7044pillarSize=setTimeout(function(){
7045pillarStage(currentStage);
7046},100);
7047
7048$('.pillar-block__bar').removeClass('pillar-block__bar--transition');
7049
7050setTimeout(function(){
7051$('.pillar-block__bar').addClass('pillar-block__bar--transition');
7052},850);
7053});
7054
7055function pillarStage(){
7056switch(currentStage){
7057case 1:
7058stageOne();
7059break;
7060case 2:
7061stageTwo();
7062break;
7063case 3:
7064stageThree();
7065break;}
7066
7067}
7068
7069function getLeftOffset(){
7070var leftOffset=-30;
7071if($(window).width()>=768)
7072leftOffset=-56;
7073
7074return leftOffset;
7075}
7076
7077var line=$('.pillar-block__bar');
7078
7079// bar next to subheadline
7080function stageOne(){
7081var targetTop=parseInt($('.pillar-block__subheadline').offset().top);
7082var targetLeft=parseInt($('.pillar-block__subheadline').offset().left)+getLeftOffset();
7083var targetHeight=parseInt($('.pillar-block__subheadline').height());
7084
7085line.css({
7086top:targetTop+'px',
7087left:targetLeft+'px'});
7088
7089line.height(targetHeight);
7090
7091currentStage=1;
7092}
7093
7094// bar next to headline
7095function stageTwo(){
7096var targetTop=parseInt($('.pillar-block__headline').offset().top);
7097var targetLeft=parseInt($('.pillar-block__headline').offset().left)+getLeftOffset();
7098var targetHeight=parseInt($('.pillar-block__headline').height());
7099
7100line.css({
7101top:targetTop+'px',
7102left:targetLeft+'px'});
7103
7104line.height(targetHeight);
7105
7106currentStage=2;
7107}
7108
7109// bar next to "Here's how we fight poverty" headline, background changes to orange
7110function stageThree(){
7111var targetTop=parseInt($('.pillar-block__items-content').offset().top);
7112var targetLeft=parseInt($('.pillar-block__items-content').offset().left)+getLeftOffset();
7113var targetHeight=parseInt($('.pillar-block__items-content').height());
7114
7115line.css({
7116top:targetTop+'px',
7117left:targetLeft+'px'});
7118
7119line.height(targetHeight);
7120line.addClass('pillar-block__bar--white');
7121
7122$('.pillar-block__items').removeClass('pillar-block__items--white');
7123
7124currentStage=3;
7125}
7126
7127};
7128
7129},{}],22:[function(require,module,exports){
7130'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7131
7132
7133function(){
7134
7135$('.icon-callout__icon, .icon-callout__link').hover(function(){
7136var icon=$(this).parents('.icon-callout__wrap').find('.icon-callout__icon');
7137icon.addClass('hover');
7138},function(){
7139var icon=$(this).parents('.icon-callout__wrap').find('.icon-callout__icon');
7140icon.removeClass('hover');
7141});
7142
7143};
7144
7145},{}],23:[function(require,module,exports){
7146'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(){
7147var countries=$('.map-region-col__countries');
7148var animateTime=200;
7149var continent=$('.map-region-col__title');
7150
7151$('.map-region-col__title').click(function(){
7152if(parseInt($(window).width())<1023){
7153$(this).toggleClass('map-region-col__title--minus');
7154$(this).next().toggleClass('map-region-col__countries--menu-expand');
7155}
7156
7157if(parseInt($(window).width())<1023){
7158if($(this).next().height()===0){
7159heightAnimate($(this).next(),animateTime);
7160}else{
7161$(this).next().stop().animate({height:'0'},animateTime);
7162}
7163}
7164});
7165
7166if(parseInt($(window).width())>1023){
7167$('.map-region-col__countries').attr('style','');
7168}
7169
7170/* Function to animate height: auto */
7171function heightAnimate(element,time){
7172var curHeight=element.height(),// Get Default Height
7173autoHeight=element.css('height','auto').height();// Get Auto Height
7174element.height(curHeight);// Reset to Default Height
7175element.stop().animate({height:autoHeight},time);// Animate to Auto Height
7176}
7177};
7178
7179},{}],24:[function(require,module,exports){
7180'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7181
7182function(){
7183
7184if($('.news-hero').length===0)
7185return;
7186
7187$('.news-hero__list-mobile > select').on('change',function(){
7188var url=$(this).val();
7189
7190if(url)
7191window.location.href=url;
7192});
7193
7194};
7195
7196},{}],25:[function(require,module,exports){
7197"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(){
7198window.onscroll=myScroll;
7199var counter=0;// Global Variable
7200function myScroll(){
7201var val=document.getElementById("content");
7202if(counter==0){// if counter is 1, it will not execute
7203if(window.pageYOffset>1140){
7204$(".fc__content").addClass('is-in-viewport');
7205$(".fc__content").removeClass('is-out-viewport');
7206counter++;// increment the counter by 1, new value = 1
7207}
7208}
7209}
7210};
7211
7212},{}],26:[function(require,module,exports){
7213'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7214
7215function(){
7216
7217if($('body.page-template-template-resources').length===0)
7218return;
7219
7220// remove unused facets from DOM according to screen size
7221// (FacetWP only supports one instace of each facet on the page)
7222if($(window).width()>=1024){
7223$('.resource-filters--mobile').remove();
7224}else{
7225$('.resource-filters--desktop').remove();
7226}
7227FWP.refresh();
7228
7229$('.resource-filters__filter-list').click(function(){
7230$(this).toggleClass('minus');
7231$(this).next().toggleClass('visible');
7232});
7233
7234$('.resource-filters__filter-item > h2').click(function(){
7235$(this).toggleClass('minus');
7236$(this).siblings('ul').toggleClass('expand');
7237$(this).siblings('div').toggleClass('expand-list');
7238});
7239
7240// Resource Page Select and Clear all
7241$('.resource-filters__quick-select > .select-all').click(function(){
7242$(this).parent().siblings('.facetwp-facet').children('.facetwp-checkbox:not(.checked)').each(function(){
7243$(this).click();
7244});
7245});
7246
7247$('.resource-filters__quick-select > .clear-all').click(function(){
7248if(typeof FWP!=='undefined'){
7249var facetName=$(this).parent().attr('data-facet-name');
7250FWP.reset(facetName);
7251}
7252});
7253
7254};
7255
7256},{}],27:[function(require,module,exports){
7257'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7258
7259
7260function(){
7261
7262window.onload=function(){
7263var placeholder=$('body').attr('data-search-placeholder');
7264$('#gsc-i-id1, #gsc-i-id2, #gsc-i-id3').attr('placeholder',placeholder);
7265};
7266
7267};
7268
7269},{}],28:[function(require,module,exports){
7270'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7271
7272
7273
7274
7275
7276
7277function(){
7278
7279if($('.introduction__subsection').length===0)
7280return;
7281
7282// handle select when available
7283if($('.introduction__list-select').length>0){
7284$('.introduction__list-select').on('change',function(){
7285var url=$(this).val();
7286
7287if(url)
7288window.location.href=url;
7289});
7290
7291return;
7292}
7293
7294var bodyContent=$('.body-text__content');
7295var table=$('ul.introduction__subsection--tertiary');
7296var counter=1;
7297
7298// hide 4th level nav if there are no <h2> subheads on this page
7299if($('h2',bodyContent).length===0){
7300$('.introduction__subsection--tertiary').hide();
7301}
7302
7303// find <h2> subheads on this page and list them
7304$('h2',bodyContent).each(function(){
7305$(this).attr('data-toc-id',counter);
7306
7307var listItem=$('.introduction__list-item--tertiary.template').clone();
7308$('a',listItem).attr('data-toc-id',counter);
7309$('a',listItem).html($(this).html());
7310listItem.removeClass('template');
7311table.append(listItem);
7312
7313counter++;
7314});
7315
7316// handle clicks on 4th level nav items
7317$('a',table).click(function(e){
7318e.preventDefault();
7319
7320var id=$(this).attr('data-toc-id');
7321var top=$('h2[data-toc-id="'+id+'"]',bodyContent).offset().top;
7322
7323$([document.documentElement,document.body]).animate({
7324scrollTop:top-50},
7325500);
7326});
7327};
7328
7329},{}],29:[function(require,module,exports){
7330'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(){
7331
7332if($('.slideshow').length===0)
7333return;
7334
7335// define functionality for each slideshow on the page
7336$('.slideshow').each(function(){
7337var slideshowElement=$(this);
7338var totalSlides=parseInt(slideshowElement.attr('data-slideshow-total'));
7339
7340$('.slideshow__counter-prev',slideshowElement).click(function(ev){
7341var currentSlideIndex=parseInt(slideshowElement.attr('data-slideshow-current'));
7342
7343var newSlideIndex=currentSlideIndex-1;
7344if(newSlideIndex<0)
7345newSlideIndex=totalSlides-1;
7346
7347displayNewSlide(newSlideIndex,currentSlideIndex,slideshowElement);
7348
7349ev.preventDefault();
7350});
7351
7352$('.slideshow__counter-next',slideshowElement).click(function(ev){
7353var currentSlideIndex=parseInt(slideshowElement.attr('data-slideshow-current'));
7354
7355var newSlideIndex=currentSlideIndex+1;
7356if(newSlideIndex==totalSlides)
7357newSlideIndex=0;
7358
7359displayNewSlide(newSlideIndex,currentSlideIndex,slideshowElement);
7360
7361ev.preventDefault();
7362});
7363});
7364
7365function displayNewSlide(index,prevIndex,slideshowElement){
7366var dataElement=$('span[data-slideshow-slide="'+index+'"]',slideshowElement);
7367
7368// crossfade images
7369$('.slideshow__slide-image[data-slideshow-slide="'+prevIndex+'"]').removeClass('active');
7370$('.slideshow__slide-image[data-slideshow-slide="'+index+'"]').addClass('active');
7371
7372// update caption from hidden data elements
7373$('.slideshow__slide-headline',slideshowElement).html(dataElement.attr('data-slideshow-headline'));
7374$('.slideshow__slide-description',slideshowElement).html(dataElement.attr('data-slideshow-description'));
7375
7376$(slideshowElement).attr('data-slideshow-current',index);
7377$('.slideshow__counter-current',slideshowElement).html(index+1);
7378}
7379
7380};
7381
7382},{}],30:[function(require,module,exports){
7383'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7384
7385
7386
7387
7388function(Masonry){
7389
7390if($('.social-highlights').length===0)
7391return;
7392
7393$('.social-highlights').each(function(){
7394var wrapper=$('.social-highlights__posts',this);
7395
7396var mas=new Masonry(wrapper[0],{
7397itemSelector:'.social-highlights__post',
7398columnWidth:'.social-highlights__grid-sizer',
7399gutter:'.social-highlights__gutter-sizer'});
7400
7401
7402wrapper.bind('DOMSubtreeModified',function(){
7403updateLayout(mas);
7404});
7405
7406$(window).resize(function(){
7407updateLayout(mas);
7408});
7409});
7410
7411function updateLayout(mas){
7412mas.layout();
7413
7414// repeat to catch late size changes
7415setTimeout(function(){
7416mas.layout();
7417},1000);
7418
7419setTimeout(function(){
7420mas.layout();
7421},3000);
7422}
7423
7424};
7425
7426},{}],31:[function(require,module,exports){
7427'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7428
7429
7430
7431
7432
7433function(){
7434
7435if($('.timeline').length===0)
7436return;
7437
7438$('.timeline__event-content').each(function(){
7439var eventElement=this;
7440
7441var observer=new IntersectionObserver(function(entries){
7442if(entries[0].isIntersecting){
7443observer.unobserve(eventElement);
7444addClassToElement(eventElement);
7445}
7446},{
7447threshold:[0.5]});
7448
7449
7450observer.observe(eventElement);
7451});
7452
7453function addClassToElement(element){
7454$(element).addClass('timeline__event-content--visible');
7455}
7456
7457// prepare YouTube stuff only if needed
7458if($('.timeline__event--video').length>0){
7459// load YouTube IFrame API
7460var firstScriptTag=document.getElementsByTagName('script')[0];
7461var tag=document.createElement('script');
7462tag.src='https://www.youtube.com/iframe_api';
7463firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);
7464
7465// wait for YouTube API to be ready
7466window.onYouTubeIframeAPIReady=function(){
7467var players={};
7468
7469// initialize players
7470$('.timeline__event-video-embed').each(function(){
7471
7472// generate random unique identifier for this player
7473var id='yt-'+Math.random().toString(10).substring(2,6);
7474$(this).attr('id',id);
7475console.log(id);
7476
7477// create player
7478var ytId=$(this).attr('data-yt');
7479console.log(ytId);
7480players[id]=new YT.Player(id,{
7481videoId:ytId,
7482playerVars:{
7483rel:0,
7484showinfo:0}});
7485
7486
7487});
7488window.ytPlayers=players;
7489
7490// play button functionality for this player
7491$('.timeline__event-video-play').click(function(){
7492var parent=$(this).parents('.timeline__event-video-wrapper');
7493var id=parent.find('.timeline__event-video-embed').attr('id');
7494var thumbnail=parent.find('.timeline__event-video-thumbnail');
7495
7496window.ytPlayers[id].playVideo();
7497
7498thumbnail.animate({opacity:0}
7498,500,'swing',function(){
7499thumbnail.hide();
7500});
7501
7502$(this).animate({opacity:0},250,'swing',function(){
7503thumbnail.hide();
7504});
7505});
7506
7507};
7508}
7509
7510};
7511
7512},{}],32:[function(require,module,exports){
7513'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(CountUp){
7514
7515if($('.two-up-stats__pie').length===0)
7516return;
7517
7518$('.two-up-stats__pie').each(function(){
7519var pie=this;
7520var observer=new IntersectionObserver(function(entries){
7521if(entries[0].isIntersecting){
7522observer.unobserve(pie);
7523animatePie(pie);
7524}
7525});
7526
7527observer.observe(pie);
7528});
7529
7530function animatePie(element){
7531var pie=$(element);
7532var targetPct=parseInt(pie.attr('data-target-pct'));
7533
7534var onCountUpdateDonut=function onCountUpdateDonut(n){
7535pie.attr('data-pct',n+'%');
7536
7537var arc=$('svg circle:eq(1)',pie);
7538var len=271.747/100*n;
7539arc.attr('stroke-dasharray',len+' '+(271.747-len));
7540};
7541
7542var counterDonut=new CountUp(pie,targetPct,{
7543duration:2.5,
7544useEasing:true,
7545formattingFn:onCountUpdateDonut});
7546
7547counterDonut.start();
7548}
7549
7550};
7551
7552},{}],33:[function(require,module,exports){
7553'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.default=
7554
7555
7556
7557
7558
7559function(tippy,followCursor){
7560
7561if($('.work-map').length===0)
7562return;
7563
7564// list of visible country tooltips
7565var visibleTooltips=[];
7566
7567// highlight countries on the map
7568$('.work-map__data > .country').each(function(){
7569try{
7570var iso=$(this).attr('data-iso');
7571var highlightCountryTypeClass=$(this).attr('data-highlight-country-type');
7572var countrySvg=$('.work-map__map #'+iso);
7573
7574countrySvg.addClass(highlightCountryTypeClass);
7575
7576if($(window).width()>=1024){
7577// country tooltip
7578var tooltipDiv=$('.work-map__data #'+iso+'-tooltip');
7579tippy(countrySvg[0],{
7580trigger:'click',
7581appendTo:$('.work-map')[0],
7582content:tooltipDiv[0],
7583allowHTML:true,
7584placement:'right',
7585interactive:true,
7586interactiveBorder:0,
7587offset:[0,0],
7588onShow:onTippyShow,
7589onHide:onTippyHide});
7590
7591}
7592}catch(ex){
7593console.error('Could not style country',this,ex);
7594}
7595});
7596
7597function onTippyShow(tooltip){
7598// highlight country on map
7599var tooltipJq=$(tooltip.props.content);
7600var iso=tooltipJq.attr('data-iso');
7601var countrySvg=$('.work-map__map #'+iso);
7602
7603countrySvg.addClass('selected');
7604
7605// on close button click
7606$('.work-map-tooltip__close',tooltipJq).click(function(){
7607tooltip.hide();
7608});
7609
7610// hide other visible tooltips
7611if(visibleTooltips.length>0){
7612$(visibleTooltips).each(function(){
7613this.hide();
7614});
7615}
7616
7617// update list of visible tooltips
7618visibleTooltips.push(tooltip);
7619}
7620
7621function onTippyHide(tooltip){
7622// remove country highlight
7623var tooltipJq=$(tooltip.props.content);
7624var iso=tooltipJq.attr('data-iso');
7625var countrySvg=$('.work-map__map #'+iso);
7626
7627countrySvg.removeClass('selected');
7628
7629// unbind click handler on close button
7630$('.work-map-tooltip__close',tooltipJq).unbind('click');
7631
7632// update list of visible tooltips
7633visibleTooltips=visibleTooltips.filter(function(t){
7634return t!==tooltip;
7635});
7636}
7637
7638};
7639
7640},{}],34:[function(require,module,exports){
7641"use strict";var _typeof=typeof Symbol==="function"&&_typeof2(Symbol.iterator)==="symbol"?function(obj){return typeof obj==="undefined"?"undefined":_typeof2(obj);}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj==="undefined"?"undefined":_typeof2(obj);};!function(e,t){"object"==(typeof exports==="undefined"?"undefined":_typeof(exports))&&"object"==(typeof module==="undefined"?"undefined":_typeof(module))?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==(typeof exports==="undefined"?"undefined":_typeof(exports))?exports.AOS=t():e.AOS=t();}(undefined,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports;}var n={};return t.m=e,t.c=n,t.p="dist/",t(0);}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e};}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n){Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);}}return e;},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),f=o(c),s=n(8),d=o(s),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x=document.all&&!window.atob,j={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},O=function O(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,j),(0,b.default)(w,j.once),w;},_=function _(){w=(0,h.default)(),O();}
7641,S=function S(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay");});},z=function z(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0;},A=function A(e){return j=i(j,e),w=(0,h.default)(),z(j.disable)||x?S():(document.querySelector("body").setAttribute("data-aos-easing",j.easing),document.querySelector("body").setAttribute("data-aos-duration",j.duration),document.querySelector("body").setAttribute("data-aos-delay",j.delay),"DOMContentLoaded"===j.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?O(!0):"load"===j.startEvent?window.addEventListener(j.startEvent,function(){O(!0);}):document.addEventListener(j.startEvent,function(){O(!0);}),window.addEventListener("resize",(0,f.default)(O,j.debounceDelay,!0)),window.addEventListener("orientationchange",(0,f.default)(O,j.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,j.once);},j.throttleDelay)),j.disableMutationObserver||(0,d.default)("[data-aos]",_),w);};e.exports={init:A,refresh:O,refreshHard:_};},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n);}function r(e){return k=e,h=setTimeout(s,t),_?o(e):g;}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i;}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y;}function s(){var e=O();return c(e)?d(e):void(h=setTimeout(s,a(e)));}function d(e){return h=void 0,z&&b?o(e):(b=v=void 0,g);}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0;}function p(){return void 0===h?g:d(O());}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),o(w);}return void 0===h&&(h=setTimeout(s,t)),g;}var b,v,y,g,h,w,k=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(f);return t=u(t)||0,i(n)&&(_=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m;}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(f);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a});}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t);}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e));}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d;}function u(e){if("number"==typeof e)return e;if(a(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t;}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?s:+e;}var c="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return typeof e==="undefined"?"undefined":_typeof(e);}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e==="undefined"?"undefined":_typeof(e);},f="Expected a function",s=NaN,d="[object Symbol]",l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function O(){return h.Date.now();};e.exports=o;}).call(t,function(){return this;}());},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n);}function r(e){return O=e,h=setTimeout(s,t),_?i(e):g;}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i;}function f(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y;}function s(){var e=j();return f(e)?d(e):void(h=setTimeout(s,u(e)));}function d(e){return h=void 0,z&&b?i(e):(b=v=void 0,g);}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0;}function p(){return void 0===h?g:d(j());}function m(){var e=j(),n=f(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),i(w);}return void 0===h&&(h=setTimeout(s,t)),g;}var b,v,y,g,h,w,O=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(_=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m;}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t);}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e));}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==s;}function a(e){if("number"==typeof e)return e;if(r(e))return f;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t;}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?f:+e;}var u="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return typeof e==="undefined"?"undefined":_typeof(e);}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e==="undefined"?"undefined":_typeof(e);},c="Expected a function",f=NaN,s="[object Symbol]",d=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function j(){return g.Date.now();};e.exports=n;}).call(t,function(){return this;}());},function(e,t){"use strict";function n(e,t){var n=new r(o);a=t,n.observe(i.documentElement,{childList:!0,subtree:!0,removedNodes:!0});}function o(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),n=Array.prototype.slice.call(e.removedNodes
7641),o=t.concat(n).filter(function(e){return e.hasAttribute&&e.hasAttribute("data-aos");}).length;o&&a();});}Object.defineProperty(t,"__esModule",{value:!0});var i=window.document,r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,a=function a(){};t.default=n;},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function");}function o(){return navigator.userAgent||navigator.vendor||window.opera||"";}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o);}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t;};}(),r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,a=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,u=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,c=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
7641sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,f=function(){function e(){n(this,e);}return i(e,[{key:"phone",value:function value(){var e=o();return!(!r.test(e)&&!a.test(e.substr(0,4)));}},{key:"mobile",value:function value(){var e=o();return!(!u.test(e)&&!c.test(e.substr(0,4)));}},{key:"tablet",value:function value(){return this.mobile()&&!this.phone();}}]),e;}();t.default=new f();},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function n(e,t,_n){var o=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!_n&&"true"!==o)&&e.node.classList.remove("aos-animate");},o=function o(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t);});};t.default=o;},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e};}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function a(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset);}),e;};t.default=a;},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e};}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function a(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i;}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o;};t.default=a;},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function n(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);){t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;}return{top:n,left:t};};t.default=n;},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function n(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e};});};t.default=n;}]);});
7642
7643},{}],35:[function(require,module,exports){
7644"use strict";Object.defineProperty(exports,"__esModule",{value:true});var __assign=undefined&&undefined.__assign||function(){return(__assign=Object.assign||function(t){for(var i,a=1,s=arguments.length;a<s;a++){for(var n in i=arguments[a]){Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);}}return t;}).apply(this,arguments);},CountUp=function(){function t(t,i,a){var s=this;this.target=t,this.endVal=i,this.options=a,this.version="2.0.4",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:""},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.count=function(t){s.startTime||(s.startTime=t);var i=t-s.startTime;s.remaining=s.duration-i,s.useEasing?s.countDown?s.frameVal=s.startVal-s.easingFn(i,0,s.startVal-s.endVal,s.duration):s.frameVal=s.easingFn(i,s.startVal,s.endVal-s.startVal,s.duration):s.countDown?s.frameVal=s.startVal-(s.startVal-s.endVal)*(i/s.duration):s.frameVal=s.startVal+(s.endVal-s.startVal)*(i/s.duration),s.countDown?s.frameVal=s.frameVal<s.endVal?s.endVal:s.frameVal:s.frameVal=s.frameVal>s.endVal?s.endVal:s.frameVal,s.frameVal=Math.round(s.frameVal*s.decimalMult)/s.decimalMult,s.printValue(s.frameVal),i<s.duration?s.rAF=requestAnimationFrame(s.count):null!==s.finalEndVal?s.update(s.finalEndVal):s.callback&&s.callback();},this.formatNumber=function(t){var i,a,n,e,r,o=t<0?"-":"";if(i=Math.abs(t).toFixed(s.options.decimalPlaces),n=(a=(i+="").split("."))[0],e=a.length>1?s.options.decimal+a[1]:"",s.options.useGrouping){r="";for(var l=0,h=n.length;l<h;++l){0!==l&&l%3==0&&(r=s.options.separator+r),r=n[h-l-1]+r;}n=r;}return s.options.numerals&&s.options.numerals.length&&(n=n.replace(/[0-9]/g,function(t){return s.options.numerals[+t];}),e=e.replace(/[0-9]/g,function(t){return s.options.numerals[+t];})),o+s.options.prefix+n+e+s.options.suffix;},this.easeOutExpo=function(t,i,a,s){return a*(1-Math.pow(2,-10*t/s))*1024/1023+i;},this.options=__assign({},this.defaults,a),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(i),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.decimalMult=Math.pow(10,this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof t?document.getElementById(t):t,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined";}return t.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var i=t-this.startVal;if(Math.abs(i)>this.options.smartEasingThreshold){this.finalEndVal=t;var a=this.countDown?1:-1;
7644this.endVal=t+a*this.options.smartEasingAmount,this.duration=this.duration/2;}else this.endVal=t,this.finalEndVal=null;this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing;},t.prototype.start=function(t){this.error||(this.callback=t,this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal));},t.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused;},t.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal);},t.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal||this.resetDuration(),this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count));},t.prototype.printValue=function(t){var i=this.formattingFn(t);"INPUT"===this.el.tagName?this.el.value=i:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=i:this.el.innerHTML=i;},t.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t);},t.prototype.validateValue=function(t){var i=Number(t);return this.ensureNumber(i)?i:(this.error="[CountUp] invalid start or end value: "+t,null);},t.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration;},t;}();exports.CountUp=CountUp;
7645
7646},{}]},{},[11]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.