aiber-martin/www/26-es2015.js.map
Martin Donnelly a4b8625d0f init
2020-12-17 16:23:12 +00:00

1 line
53 KiB
Plaintext

{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/ion-refresher_2.entry.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA4I;AACjD;AACT;AACnB;AACW;AACb;AACJ;AACK;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gEAAe;AACzC;AACA;AACA,2CAA2C,gEAAe;AAC1D;AACA;AACA,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS;AACT;AACA,iCAAiC,gEAAe;AAChD;AACA;AACA,SAAS,2CAA2C;AACpD,SAAS,8CAA8C;AACvD,SAAS,gDAAgD;AACzD,SAAS;AACT;AACA,iCAAiC,gEAAe;AAChD;AACA;AACA,SAAS,yCAAyC;AAClD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,gEAAe;AACvD;AACA;AACA,aAAa,uCAAuC;AACpD,aAAa,0CAA0C;AACvD,aAAa,4CAA4C;AACzD,aAAa;AACb;AACA,+BAA+B,gEAAe;AAC9C;AACA;AACA,aAAa,mDAAmD;AAChE,aAAa,sDAAsD;AACnE,aAAa,yDAAyD;AACtE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gEAAe;AAC5C;AACA;AACA,SAAS,+CAA+C,YAAY,MAAM;AAC1E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,6BAA6B,gEAAe;AAC5C;AACA;AACA,SAAS,sCAAsC,YAAY,MAAM;AACjE,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW,gEAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,4DAAS;AACb;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI,4DAAS;AACb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,4DAAS;AACb;AACA;AACA;AACA;AACA;AACA,kEAAkE,MAAM;AACxE;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,mEAAU;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,8DAAK;AAC3C,wBAAwB,4DAAS;AACjC;AACA;AACA,oBAAoB,4DAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8DAAK;AACrC,mDAAmD,8DAAK;AACxD,0CAA0C,8DAAK;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6DAAY,EAAE,iBAAiB;AACvD;AACA;AACA;AACA;AACA;AACA,yEAAyE,gBAAgB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,8BAA8B,yJAA6B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAQ,oDAAoD,qBAAqB;AACrG;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,uBAAuB,8DAAc;AACrC;AACA,iCAAiC,8DAAc;AAC/C;AACA,YAAY,4DAAS;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,8BAA8B,yJAA6B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,gCAAgC,8DAAK;AACrC;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,gBAAgB,4DAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,iCAAiC,mEAAuB;AACxD;AACA;AACA,gBAAgB,4DAAS;AACzB,mGAAmG,iBAAiB;AACpH;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,8DAAc;AACjD,8CAA8C,mEAAU;AACxD;AACA;AACA;AACA,kCAAkC,yJAA6B;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAG,OAAO,8DAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAG,OAAO,8DAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAS;AACjB;AACA;AACA;AACA,6FAA6F,EAAE;AAC/F;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qBAAqB,mEAAU;AAC/B,gBAAgB,4DAAC,CAAC,oDAAI,GAAG;AACzB;AACA;AACA,8BAA8B,KAAK;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,EAAE;AACf;AACA,cAAc,QAAQ,4DAAU,OAAO;AACvC,2BAA2B;AAC3B;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ,4DAAgB;AACxB;AACA;AACA;AACA,yBAAyB,mEAAU;AACnC;AACA,+BAA+B,2DAAM,yCAAyC,mEAAU,aAAa,2DAAM;AAC3G;AACA;AACA,yBAAyB,mEAAU;AACnC,qCAAqC,2DAAM,0BAA0B,2DAAM;AAC3E;AACA;AACA;AACA;AACA,kDAAkD,8DAAQ;AAC1D,qBAAqB,mEAAU;AAC/B,gBAAgB,4DAAC,CAAC,oDAAI,GAAG,cAAc,EAAE,4DAAC,SAAS,6BAA6B;AAChF,YAAY,4DAAC,SAAS,kCAAkC,EAAE,4DAAC,SAAS,mCAAmC,EAAE,4DAAC,iBAAiB,uCAAuC;AAClK,gBAAgB,4DAAC,SAAS,2BAA2B,EAAE,4DAAC,cAAc,2BAA2B;AACjG,YAAY,4DAAC,SAAS,kCAAkC,EAAE,4DAAC,cAAc,sCAAsC;AAC/G,YAAY,4DAAC,SAAS,6CAA6C,4DAAiB,oBAAoB,IAAI,4DAAC,SAAS,gCAAgC;AACtJ,YAAY,4DAAC,SAAS,qCAAqC,EAAE,4DAAC,iBAAiB,+BAA+B;AAC9G,YAAY,4DAAC,SAAS,gDAAgD,4DAAiB,uBAAuB;AAC9G;AACA,cAAc,QAAQ,4DAAU,OAAO;AACvC;;AAEiF","file":"26-es2015.js","sourcesContent":["import { c as writeTask, r as registerInstance, e as createEvent, f as readTask, h, i as getElement, H as Host } from './index-92848855.js';\nimport { i as isPlatform, b as getIonMode, c as config } from './ionic-global-23e7365a.js';\nimport { c as clamp, g as getElementRoot, r as raf } from './helpers-5c745fbd.js';\nimport { c as createAnimation } from './animation-a635a2fc.js';\nimport { g as getTimeGivenProgression } from './cubic-bezier-685f606a.js';\nimport { s as sanitizeDOMString } from './index-79d74e0b.js';\nimport { d as hapticImpact } from './haptic-7b8ba70a.js';\nimport { S as SPINNERS } from './spinner-configs-c78e170e.js';\n\nconst getRefresherAnimationType = (contentEl) => {\n const previousSibling = contentEl.previousElementSibling;\n const hasHeader = previousSibling !== null && previousSibling.tagName === 'ION-HEADER';\n return hasHeader ? 'translate' : 'scale';\n};\nconst createPullingAnimation = (type, pullingSpinner) => {\n return type === 'scale' ? createScaleAnimation(pullingSpinner) : createTranslateAnimation(pullingSpinner);\n};\nconst createBaseAnimation = (pullingRefresherIcon) => {\n const spinner = pullingRefresherIcon.querySelector('ion-spinner');\n const circle = spinner.shadowRoot.querySelector('circle');\n const spinnerArrowContainer = pullingRefresherIcon.querySelector('.spinner-arrow-container');\n const arrowContainer = pullingRefresherIcon.querySelector('.arrow-container');\n const arrow = (arrowContainer) ? arrowContainer.querySelector('ion-icon') : null;\n const baseAnimation = createAnimation()\n .duration(1000)\n .easing('ease-out');\n const spinnerArrowContainerAnimation = createAnimation()\n .addElement(spinnerArrowContainer)\n .keyframes([\n { offset: 0, opacity: '0.3' },\n { offset: 0.45, opacity: '0.3' },\n { offset: 0.55, opacity: '1' },\n { offset: 1, opacity: '1' }\n ]);\n const circleInnerAnimation = createAnimation()\n .addElement(circle)\n .keyframes([\n { offset: 0, strokeDasharray: '1px, 200px' },\n { offset: 0.20, strokeDasharray: '1px, 200px' },\n { offset: 0.55, strokeDasharray: '100px, 200px' },\n { offset: 1, strokeDasharray: '100px, 200px' }\n ]);\n const circleOuterAnimation = createAnimation()\n .addElement(spinner)\n .keyframes([\n { offset: 0, transform: 'rotate(-90deg)' },\n { offset: 1, transform: 'rotate(210deg)' }\n ]);\n /**\n * Only add arrow animation if present\n * this allows users to customize the spinners\n * without errors being thrown\n */\n if (arrowContainer && arrow) {\n const arrowContainerAnimation = createAnimation()\n .addElement(arrowContainer)\n .keyframes([\n { offset: 0, transform: 'rotate(0deg)' },\n { offset: 0.30, transform: 'rotate(0deg)' },\n { offset: 0.55, transform: 'rotate(280deg)' },\n { offset: 1, transform: 'rotate(400deg)' }\n ]);\n const arrowAnimation = createAnimation()\n .addElement(arrow)\n .keyframes([\n { offset: 0, transform: 'translateX(2px) scale(0)' },\n { offset: 0.30, transform: 'translateX(2px) scale(0)' },\n { offset: 0.55, transform: 'translateX(-1.5px) scale(1)' },\n { offset: 1, transform: 'translateX(-1.5px) scale(1)' }\n ]);\n baseAnimation.addAnimation([arrowContainerAnimation, arrowAnimation]);\n }\n return baseAnimation.addAnimation([spinnerArrowContainerAnimation, circleInnerAnimation, circleOuterAnimation]);\n};\nconst createScaleAnimation = (pullingRefresherIcon) => {\n const height = pullingRefresherIcon.clientHeight;\n const spinnerAnimation = createAnimation()\n .addElement(pullingRefresherIcon)\n .keyframes([\n { offset: 0, transform: `scale(0) translateY(-${height + 20}px)` },\n { offset: 1, transform: 'scale(1) translateY(100px)' }\n ]);\n return createBaseAnimation(pullingRefresherIcon).addAnimation([spinnerAnimation]);\n};\nconst createTranslateAnimation = (pullingRefresherIcon) => {\n const height = pullingRefresherIcon.clientHeight;\n const spinnerAnimation = createAnimation()\n .addElement(pullingRefresherIcon)\n .keyframes([\n { offset: 0, transform: `translateY(-${height + 20}px)` },\n { offset: 1, transform: 'translateY(100px)' }\n ]);\n return createBaseAnimation(pullingRefresherIcon).addAnimation([spinnerAnimation]);\n};\nconst createSnapBackAnimation = (pullingRefresherIcon) => {\n return createAnimation()\n .duration(125)\n .addElement(pullingRefresherIcon)\n .fromTo('transform', 'translateY(var(--ion-pulling-refresher-translate, 100px))', 'translateY(0px)');\n};\n// iOS Native Refresher\n// -----------------------------\nconst setSpinnerOpacity = (spinner, opacity) => {\n spinner.style.setProperty('opacity', opacity.toString());\n};\nconst handleScrollWhilePulling = (spinner, ticks, opacity, currentTickToShow) => {\n writeTask(() => {\n setSpinnerOpacity(spinner, opacity);\n ticks.forEach((el, i) => el.style.setProperty('opacity', (i <= currentTickToShow) ? '0.99' : '0'));\n });\n};\nconst handleScrollWhileRefreshing = (spinner, lastVelocityY) => {\n writeTask(() => {\n // If user pulls down quickly, the spinner should spin faster\n spinner.style.setProperty('--refreshing-rotation-duration', (lastVelocityY >= 1.0) ? '0.5s' : '2s');\n spinner.style.setProperty('opacity', '1');\n });\n};\nconst translateElement = (el, value) => {\n if (!el) {\n return Promise.resolve();\n }\n const trans = transitionEndAsync(el, 200);\n writeTask(() => {\n el.style.setProperty('transition', '0.2s all ease-out');\n if (value === undefined) {\n el.style.removeProperty('transform');\n }\n else {\n el.style.setProperty('transform', `translate3d(0px, ${value}, 0px)`);\n }\n });\n return trans;\n};\n// Utils\n// -----------------------------\nconst shouldUseNativeRefresher = (referenceEl, mode) => {\n const pullingSpinner = referenceEl.querySelector('ion-refresher-content .refresher-pulling ion-spinner');\n const refreshingSpinner = referenceEl.querySelector('ion-refresher-content .refresher-refreshing ion-spinner');\n return (pullingSpinner !== null &&\n refreshingSpinner !== null &&\n ((mode === 'ios' && isPlatform('mobile') && referenceEl.style.webkitOverflowScrolling !== undefined) ||\n mode === 'md'));\n};\nconst transitionEndAsync = (el, expectedDuration = 0) => {\n return new Promise(resolve => {\n transitionEnd(el, expectedDuration, resolve);\n });\n};\nconst transitionEnd = (el, expectedDuration = 0, callback) => {\n let unRegTrans;\n let animationTimeout;\n const opts = { passive: true };\n const ANIMATION_FALLBACK_TIMEOUT = 500;\n const unregister = () => {\n if (unRegTrans) {\n unRegTrans();\n }\n };\n const onTransitionEnd = (ev) => {\n if (ev === undefined || el === ev.target) {\n unregister();\n callback(ev);\n }\n };\n if (el) {\n el.addEventListener('webkitTransitionEnd', onTransitionEnd, opts);\n el.addEventListener('transitionend', onTransitionEnd, opts);\n animationTimeout = setTimeout(onTransitionEnd, expectedDuration + ANIMATION_FALLBACK_TIMEOUT);\n unRegTrans = () => {\n if (animationTimeout) {\n clearTimeout(animationTimeout);\n animationTimeout = undefined;\n }\n el.removeEventListener('webkitTransitionEnd', onTransitionEnd, opts);\n el.removeEventListener('transitionend', onTransitionEnd, opts);\n };\n }\n return unregister;\n};\n\nconst refresherIosCss = \"ion-refresher{left:0;top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}[dir=rtl] ion-refresher,:host-context([dir=rtl]) ion-refresher{left:unset;right:unset;right:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}[dir=rtl] .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-ios .refresher-pulling-icon,.refresher-ios .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-ios .refresher-pulling-text,.refresher-ios .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-lines-ios line,.refresher-ios .refresher-refreshing .spinner-lines-small-ios line,.refresher-ios .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-bubbles circle,.refresher-ios .refresher-refreshing .spinner-circles circle,.refresher-ios .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native ion-spinner{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.refresher-native .refresher-refreshing ion-spinner{--refreshing-rotation-duration:2s;display:none;-webkit-animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards;animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards}.refresher-native .refresher-refreshing{display:none;-webkit-animation:250ms linear refresher-pop forwards;animation:250ms linear refresher-pop forwards}.refresher-native.refresher-refreshing .refresher-pulling ion-spinner,.refresher-native.refresher-completing .refresher-pulling ion-spinner{display:none}.refresher-native.refresher-refreshing .refresher-refreshing ion-spinner,.refresher-native.refresher-completing .refresher-refreshing ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-pulling ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-refreshing ion-spinner{display:none}@-webkit-keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}@keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}\";\n\nconst refresherMdCss = \"ion-refresher{left:0;top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}[dir=rtl] ion-refresher,:host-context([dir=rtl]) ion-refresher{left:unset;right:unset;right:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}[dir=rtl] .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-md .refresher-pulling-icon,.refresher-md .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-md .refresher-pulling-text,.refresher-md .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-lines-md line,.refresher-md .refresher-refreshing .spinner-lines-small-md line,.refresher-md .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-bubbles circle,.refresher-md .refresher-refreshing .spinner-circles circle,.refresher-md .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;width:24px;height:24px;color:var(--ion-color-primary, #3880ff)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native ion-spinner{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}ion-refresher.refresher-native .spinner-arrow-container{display:inherit}ion-refresher.refresher-native .arrow-container{display:block;position:absolute;width:24px;height:24px}ion-refresher.refresher-native .arrow-container ion-icon{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;left:0;right:0;bottom:-4px;position:absolute;color:var(--ion-color-primary, #3880ff);font-size:12px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native .arrow-container ion-icon{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}ion-refresher.refresher-native.refresher-pulling ion-refresher-content .refresher-pulling,ion-refresher.refresher-native.refresher-ready ion-refresher-content .refresher-pulling{display:-ms-flexbox;display:flex}ion-refresher.refresher-native.refresher-refreshing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-cancelling ion-refresher-content .refresher-refreshing{display:-ms-flexbox;display:flex}ion-refresher.refresher-native .refresher-pulling-icon{-webkit-transform:translateY(calc(-100% - 10px));transform:translateY(calc(-100% - 10px))}ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;border-radius:100%;padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;display:-ms-flexbox;display:flex;border:1px solid #ececec;background:white;-webkit-box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1);box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}\";\n\nconst Refresher = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRefresh = createEvent(this, \"ionRefresh\", 7);\n this.ionPull = createEvent(this, \"ionPull\", 7);\n this.ionStart = createEvent(this, \"ionStart\", 7);\n this.appliedStyles = false;\n this.didStart = false;\n this.progress = 0;\n this.pointerDown = false;\n this.needsCompletion = false;\n this.didRefresh = false;\n this.lastVelocityY = 0;\n this.animations = [];\n this.nativeRefresher = false;\n /**\n * The current state which the refresher is in. The refresher's states include:\n *\n * - `inactive` - The refresher is not being pulled down or refreshing and is currently hidden.\n * - `pulling` - The user is actively pulling down the refresher, but has not reached the point yet that if the user lets go, it'll refresh.\n * - `cancelling` - The user pulled down the refresher and let go, but did not pull down far enough to kick off the `refreshing` state. After letting go, the refresher is in the `cancelling` state while it is closing, and will go back to the `inactive` state once closed.\n * - `ready` - The user has pulled down the refresher far enough that if they let go, it'll begin the `refreshing` state.\n * - `refreshing` - The refresher is actively waiting on the async operation to end. Once the refresh handler calls `complete()` it will begin the `completing` state.\n * - `completing` - The `refreshing` state has finished and the refresher is in the way of closing itself. Once closed, the refresher will go back to the `inactive` state.\n */\n this.state = 1 /* Inactive */;\n /**\n * The minimum distance the user must pull down until the\n * refresher will go into the `refreshing` state.\n * Does not apply when the refresher content uses a spinner,\n * enabling the native refresher.\n */\n this.pullMin = 60;\n /**\n * The maximum distance of the pull until the refresher\n * will automatically go into the `refreshing` state.\n * Defaults to the result of `pullMin + 60`.\n * Does not apply when the refresher content uses a spinner,\n * enabling the native refresher.\n */\n this.pullMax = this.pullMin + 60;\n /**\n * Time it takes to close the refresher.\n * Does not apply when the refresher content uses a spinner,\n * enabling the native refresher.\n */\n this.closeDuration = '280ms';\n /**\n * Time it takes the refresher to to snap back to the `refreshing` state.\n * Does not apply when the refresher content uses a spinner,\n * enabling the native refresher.\n */\n this.snapbackDuration = '280ms';\n /**\n * How much to multiply the pull speed by. To slow the pull animation down,\n * pass a number less than `1`. To speed up the pull, pass a number greater\n * than `1`. The default value is `1` which is equal to the speed of the cursor.\n * If a negative value is passed in, the factor will be `1` instead.\n *\n * For example: If the value passed is `1.2` and the content is dragged by\n * `10` pixels, instead of `10` pixels the content will be pulled by `12` pixels\n * (an increase of 20 percent). If the value passed is `0.8`, the dragged amount\n * will be `8` pixels, less than the amount the cursor has moved.\n *\n * Does not apply when the refresher content uses a spinner,\n * enabling the native refresher.\n */\n this.pullFactor = 1;\n /**\n * If `true`, the refresher will be hidden.\n */\n this.disabled = false;\n }\n disabledChanged() {\n if (this.gesture) {\n this.gesture.enable(!this.disabled);\n }\n }\n checkNativeRefresher() {\n const useNativeRefresher = shouldUseNativeRefresher(this.el, getIonMode(this));\n if (useNativeRefresher && !this.nativeRefresher) {\n const contentEl = this.el.closest('ion-content');\n this.setupNativeRefresher(contentEl);\n }\n else if (!useNativeRefresher) {\n this.destroyNativeRefresher();\n }\n }\n destroyNativeRefresher() {\n if (this.scrollEl && this.scrollListenerCallback) {\n this.scrollEl.removeEventListener('scroll', this.scrollListenerCallback);\n this.scrollListenerCallback = undefined;\n }\n this.nativeRefresher = false;\n }\n async resetNativeRefresher(el, state) {\n this.state = state;\n if (getIonMode(this) === 'ios') {\n await translateElement(el, undefined);\n }\n else {\n await transitionEndAsync(this.el.querySelector('.refresher-refreshing-icon'), 200);\n }\n this.didRefresh = false;\n this.needsCompletion = false;\n this.pointerDown = false;\n this.animations.forEach(ani => ani.destroy());\n this.animations = [];\n this.progress = 0;\n this.state = 1 /* Inactive */;\n }\n async setupiOSNativeRefresher(pullingSpinner, refreshingSpinner) {\n this.elementToTransform = this.scrollEl;\n const ticks = pullingSpinner.shadowRoot.querySelectorAll('svg');\n const MAX_PULL = this.scrollEl.clientHeight * 0.16;\n const NUM_TICKS = ticks.length;\n writeTask(() => ticks.forEach(el => el.style.setProperty('animation', 'none')));\n this.scrollListenerCallback = () => {\n // If pointer is not on screen or refresher is not active, ignore scroll\n if (!this.pointerDown && this.state === 1 /* Inactive */) {\n return;\n }\n readTask(() => {\n // PTR should only be active when overflow scrolling at the top\n const scrollTop = this.scrollEl.scrollTop;\n const refresherHeight = this.el.clientHeight;\n if (scrollTop > 0) {\n /**\n * If refresher is refreshing and user tries to scroll\n * progressively fade refresher out/in\n */\n if (this.state === 8 /* Refreshing */) {\n const ratio = clamp(0, scrollTop / (refresherHeight * 0.5), 1);\n writeTask(() => setSpinnerOpacity(refreshingSpinner, 1 - ratio));\n return;\n }\n writeTask(() => setSpinnerOpacity(pullingSpinner, 0));\n return;\n }\n if (this.pointerDown) {\n if (!this.didStart) {\n this.didStart = true;\n this.ionStart.emit();\n }\n // emit \"pulling\" on every move\n if (this.pointerDown) {\n this.ionPull.emit();\n }\n }\n // delay showing the next tick marks until user has pulled 30px\n const opacity = clamp(0, Math.abs(scrollTop) / refresherHeight, 0.99);\n const pullAmount = this.progress = clamp(0, (Math.abs(scrollTop) - 30) / MAX_PULL, 1);\n const currentTickToShow = clamp(0, Math.floor(pullAmount * NUM_TICKS), NUM_TICKS - 1);\n const shouldShowRefreshingSpinner = this.state === 8 /* Refreshing */ || currentTickToShow === NUM_TICKS - 1;\n if (shouldShowRefreshingSpinner) {\n if (this.pointerDown) {\n handleScrollWhileRefreshing(refreshingSpinner, this.lastVelocityY);\n }\n if (!this.didRefresh) {\n this.beginRefresh();\n this.didRefresh = true;\n hapticImpact({ style: 'light' });\n /**\n * Translate the content element otherwise when pointer is removed\n * from screen the scroll content will bounce back over the refresher\n */\n if (!this.pointerDown) {\n translateElement(this.elementToTransform, `${refresherHeight}px`);\n }\n }\n }\n else {\n this.state = 2 /* Pulling */;\n handleScrollWhilePulling(pullingSpinner, ticks, opacity, currentTickToShow);\n }\n });\n };\n this.scrollEl.addEventListener('scroll', this.scrollListenerCallback);\n this.gesture = (await import('./index-eea61379.js')).createGesture({\n el: this.scrollEl,\n gestureName: 'refresher',\n gesturePriority: 10,\n direction: 'y',\n threshold: 5,\n onStart: () => {\n this.pointerDown = true;\n if (!this.didRefresh) {\n translateElement(this.elementToTransform, '0px');\n }\n },\n onMove: ev => {\n this.lastVelocityY = ev.velocityY;\n },\n onEnd: () => {\n this.pointerDown = false;\n this.didStart = false;\n if (this.needsCompletion) {\n this.resetNativeRefresher(this.elementToTransform, 32 /* Completing */);\n this.needsCompletion = false;\n }\n else if (this.didRefresh) {\n readTask(() => translateElement(this.elementToTransform, `${this.el.clientHeight}px`));\n }\n },\n });\n this.disabledChanged();\n }\n async setupMDNativeRefresher(contentEl, pullingSpinner, refreshingSpinner) {\n const circle = getElementRoot(pullingSpinner).querySelector('circle');\n const pullingRefresherIcon = this.el.querySelector('ion-refresher-content .refresher-pulling-icon');\n const refreshingCircle = getElementRoot(refreshingSpinner).querySelector('circle');\n if (circle !== null && refreshingCircle !== null) {\n writeTask(() => {\n circle.style.setProperty('animation', 'none');\n // This lines up the animation on the refreshing spinner with the pulling spinner\n refreshingSpinner.style.setProperty('animation-delay', '-655ms');\n refreshingCircle.style.setProperty('animation-delay', '-655ms');\n });\n }\n this.gesture = (await import('./index-eea61379.js')).createGesture({\n el: this.scrollEl,\n gestureName: 'refresher',\n gesturePriority: 10,\n direction: 'y',\n threshold: 5,\n canStart: () => this.state !== 8 /* Refreshing */ && this.state !== 32 /* Completing */ && this.scrollEl.scrollTop === 0,\n onStart: (ev) => {\n ev.data = { animation: undefined, didStart: false, cancelled: false };\n },\n onMove: (ev) => {\n if ((ev.velocityY < 0 && this.progress === 0 && !ev.data.didStart) || ev.data.cancelled) {\n ev.data.cancelled = true;\n return;\n }\n if (!ev.data.didStart) {\n ev.data.didStart = true;\n this.state = 2 /* Pulling */;\n writeTask(() => {\n const animationType = getRefresherAnimationType(contentEl);\n const animation = createPullingAnimation(animationType, pullingRefresherIcon);\n ev.data.animation = animation;\n this.scrollEl.style.setProperty('--overflow', 'hidden');\n animation.progressStart(false, 0);\n this.ionStart.emit();\n this.animations.push(animation);\n });\n return;\n }\n // Since we are using an easing curve, slow the gesture tracking down a bit\n this.progress = clamp(0, (ev.deltaY / 180) * 0.5, 1);\n ev.data.animation.progressStep(this.progress);\n this.ionPull.emit();\n },\n onEnd: (ev) => {\n if (!ev.data.didStart) {\n return;\n }\n writeTask(() => this.scrollEl.style.removeProperty('--overflow'));\n if (this.progress <= 0.4) {\n this.gesture.enable(false);\n ev.data.animation\n .progressEnd(0, this.progress, 500)\n .onFinish(() => {\n this.animations.forEach(ani => ani.destroy());\n this.animations = [];\n this.gesture.enable(true);\n this.state = 1 /* Inactive */;\n });\n return;\n }\n const progress = getTimeGivenProgression([0, 0], [0, 0], [1, 1], [1, 1], this.progress)[0];\n const snapBackAnimation = createSnapBackAnimation(pullingRefresherIcon);\n this.animations.push(snapBackAnimation);\n writeTask(async () => {\n pullingRefresherIcon.style.setProperty('--ion-pulling-refresher-translate', `${(progress * 100)}px`);\n ev.data.animation.progressEnd();\n await snapBackAnimation.play();\n this.beginRefresh();\n ev.data.animation.destroy();\n });\n }\n });\n this.disabledChanged();\n }\n async setupNativeRefresher(contentEl) {\n if (this.scrollListenerCallback || !contentEl || this.nativeRefresher || !this.scrollEl) {\n return;\n }\n this.nativeRefresher = true;\n const pullingSpinner = this.el.querySelector('ion-refresher-content .refresher-pulling ion-spinner');\n const refreshingSpinner = this.el.querySelector('ion-refresher-content .refresher-refreshing ion-spinner');\n await contentEl.componentOnReady();\n if (getIonMode(this) === 'ios') {\n this.setupiOSNativeRefresher(pullingSpinner, refreshingSpinner);\n }\n else {\n this.setupMDNativeRefresher(contentEl, pullingSpinner, refreshingSpinner);\n }\n }\n componentDidUpdate() {\n this.checkNativeRefresher();\n }\n async connectedCallback() {\n if (this.el.getAttribute('slot') !== 'fixed') {\n console.error('Make sure you use: <ion-refresher slot=\"fixed\">');\n return;\n }\n const contentEl = this.el.closest('ion-content');\n if (!contentEl) {\n console.error('<ion-refresher> must be used inside an <ion-content>');\n return;\n }\n this.scrollEl = await contentEl.getScrollElement();\n this.backgroundContentEl = getElementRoot(contentEl).querySelector('#background-content');\n if (shouldUseNativeRefresher(this.el, getIonMode(this))) {\n this.setupNativeRefresher(contentEl);\n }\n else {\n this.gesture = (await import('./index-eea61379.js')).createGesture({\n el: contentEl,\n gestureName: 'refresher',\n gesturePriority: 10,\n direction: 'y',\n threshold: 20,\n passive: false,\n canStart: () => this.canStart(),\n onStart: () => this.onStart(),\n onMove: ev => this.onMove(ev),\n onEnd: () => this.onEnd(),\n });\n this.disabledChanged();\n }\n }\n disconnectedCallback() {\n this.destroyNativeRefresher();\n this.scrollEl = undefined;\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n }\n /**\n * Call `complete()` when your async operation has completed.\n * For example, the `refreshing` state is while the app is performing\n * an asynchronous operation, such as receiving more data from an\n * AJAX request. Once the data has been received, you then call this\n * method to signify that the refreshing has completed and to close\n * the refresher. This method also changes the refresher's state from\n * `refreshing` to `completing`.\n */\n async complete() {\n if (this.nativeRefresher) {\n this.needsCompletion = true;\n // Do not reset scroll el until user removes pointer from screen\n if (!this.pointerDown) {\n raf(() => raf(() => this.resetNativeRefresher(this.elementToTransform, 32 /* Completing */)));\n }\n }\n else {\n this.close(32 /* Completing */, '120ms');\n }\n }\n /**\n * Changes the refresher's state from `refreshing` to `cancelling`.\n */\n async cancel() {\n if (this.nativeRefresher) {\n // Do not reset scroll el until user removes pointer from screen\n if (!this.pointerDown) {\n raf(() => raf(() => this.resetNativeRefresher(this.elementToTransform, 16 /* Cancelling */)));\n }\n }\n else {\n this.close(16 /* Cancelling */, '');\n }\n }\n /**\n * A number representing how far down the user has pulled.\n * The number `0` represents the user hasn't pulled down at all. The\n * number `1`, and anything greater than `1`, represents that the user\n * has pulled far enough down that when they let go then the refresh will\n * happen. If they let go and the number is less than `1`, then the\n * refresh will not happen, and the content will return to it's original\n * position.\n */\n getProgress() {\n return Promise.resolve(this.progress);\n }\n canStart() {\n if (!this.scrollEl) {\n return false;\n }\n if (this.state !== 1 /* Inactive */) {\n return false;\n }\n // if the scrollTop is greater than zero then it's\n // not possible to pull the content down yet\n if (this.scrollEl.scrollTop > 0) {\n return false;\n }\n return true;\n }\n onStart() {\n this.progress = 0;\n this.state = 1 /* Inactive */;\n }\n onMove(detail) {\n if (!this.scrollEl) {\n return;\n }\n // this method can get called like a bazillion times per second,\n // so it's built to be as efficient as possible, and does its\n // best to do any DOM read/writes only when absolutely necessary\n // if multi-touch then get out immediately\n const ev = detail.event;\n if (ev.touches && ev.touches.length > 1) {\n return;\n }\n // do nothing if it's actively refreshing\n // or it's in the way of closing\n // or this was never a startY\n if ((this.state & 56 /* _BUSY_ */) !== 0) {\n return;\n }\n const pullFactor = (Number.isNaN(this.pullFactor) || this.pullFactor < 0) ? 1 : this.pullFactor;\n const deltaY = detail.deltaY * pullFactor;\n // don't bother if they're scrolling up\n // and have not already started dragging\n if (deltaY <= 0) {\n // the current Y is higher than the starting Y\n // so they scrolled up enough to be ignored\n this.progress = 0;\n this.state = 1 /* Inactive */;\n if (this.appliedStyles) {\n // reset the styles only if they were applied\n this.setCss(0, '', false, '');\n return;\n }\n return;\n }\n if (this.state === 1 /* Inactive */) {\n // this refresh is not already actively pulling down\n // get the content's scrollTop\n const scrollHostScrollTop = this.scrollEl.scrollTop;\n // if the scrollTop is greater than zero then it's\n // not possible to pull the content down yet\n if (scrollHostScrollTop > 0) {\n this.progress = 0;\n return;\n }\n // content scrolled all the way to the top, and dragging down\n this.state = 2 /* Pulling */;\n }\n // prevent native scroll events\n if (ev.cancelable) {\n ev.preventDefault();\n }\n // the refresher is actively pulling at this point\n // move the scroll element within the content element\n this.setCss(deltaY, '0ms', true, '');\n if (deltaY === 0) {\n // don't continue if there's no delta yet\n this.progress = 0;\n return;\n }\n const pullMin = this.pullMin;\n // set pull progress\n this.progress = deltaY / pullMin;\n // emit \"start\" if it hasn't started yet\n if (!this.didStart) {\n this.didStart = true;\n this.ionStart.emit();\n }\n // emit \"pulling\" on every move\n this.ionPull.emit();\n // do nothing if the delta is less than the pull threshold\n if (deltaY < pullMin) {\n // ensure it stays in the pulling state, cuz its not ready yet\n this.state = 2 /* Pulling */;\n return;\n }\n if (deltaY > this.pullMax) {\n // they pulled farther than the max, so kick off the refresh\n this.beginRefresh();\n return;\n }\n // pulled farther than the pull min!!\n // it is now in the `ready` state!!\n // if they let go then it'll refresh, kerpow!!\n this.state = 4 /* Ready */;\n return;\n }\n onEnd() {\n // only run in a zone when absolutely necessary\n if (this.state === 4 /* Ready */) {\n // they pulled down far enough, so it's ready to refresh\n this.beginRefresh();\n }\n else if (this.state === 2 /* Pulling */) {\n // they were pulling down, but didn't pull down far enough\n // set the content back to it's original location\n // and close the refresher\n // set that the refresh is actively cancelling\n this.cancel();\n }\n }\n beginRefresh() {\n // assumes we're already back in a zone\n // they pulled down far enough, so it's ready to refresh\n this.state = 8 /* Refreshing */;\n // place the content in a hangout position while it thinks\n this.setCss(this.pullMin, this.snapbackDuration, true, '');\n // emit \"refresh\" because it was pulled down far enough\n // and they let go to begin refreshing\n this.ionRefresh.emit({\n complete: this.complete.bind(this)\n });\n }\n close(state, delay) {\n // create fallback timer incase something goes wrong with transitionEnd event\n setTimeout(() => {\n this.state = 1 /* Inactive */;\n this.progress = 0;\n this.didStart = false;\n this.setCss(0, '0ms', false, '');\n }, 600);\n // reset set the styles on the scroll element\n // set that the refresh is actively cancelling/completing\n this.state = state;\n this.setCss(0, this.closeDuration, true, delay);\n // TODO: stop gesture\n }\n setCss(y, duration, overflowVisible, delay) {\n if (this.nativeRefresher) {\n return;\n }\n this.appliedStyles = (y > 0);\n writeTask(() => {\n if (this.scrollEl && this.backgroundContentEl) {\n const scrollStyle = this.scrollEl.style;\n const backgroundStyle = this.backgroundContentEl.style;\n scrollStyle.transform = backgroundStyle.transform = ((y > 0) ? `translateY(${y}px) translateZ(0px)` : '');\n scrollStyle.transitionDuration = backgroundStyle.transitionDuration = duration;\n scrollStyle.transitionDelay = backgroundStyle.transitionDelay = delay;\n scrollStyle.overflow = (overflowVisible ? 'hidden' : '');\n }\n });\n }\n render() {\n const mode = getIonMode(this);\n return (h(Host, { slot: \"fixed\", class: {\n [mode]: true,\n // Used internally for styling\n [`refresher-${mode}`]: true,\n 'refresher-native': this.nativeRefresher,\n 'refresher-active': this.state !== 1 /* Inactive */,\n 'refresher-pulling': this.state === 2 /* Pulling */,\n 'refresher-ready': this.state === 4 /* Ready */,\n 'refresher-refreshing': this.state === 8 /* Refreshing */,\n 'refresher-cancelling': this.state === 16 /* Cancelling */,\n 'refresher-completing': this.state === 32 /* Completing */,\n } }));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"disabled\": [\"disabledChanged\"]\n }; }\n};\nRefresher.style = {\n ios: refresherIosCss,\n md: refresherMdCss\n};\n\nconst RefresherContent = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n }\n componentWillLoad() {\n if (this.pullingIcon === undefined) {\n const mode = getIonMode(this);\n const overflowRefresher = this.el.style.webkitOverflowScrolling !== undefined ? 'lines' : 'arrow-down';\n this.pullingIcon = config.get('refreshingIcon', mode === 'ios' && isPlatform('mobile') ? config.get('spinner', overflowRefresher) : 'circular');\n }\n if (this.refreshingSpinner === undefined) {\n const mode = getIonMode(this);\n this.refreshingSpinner = config.get('refreshingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'circular'));\n }\n }\n render() {\n const pullingIcon = this.pullingIcon;\n const hasSpinner = pullingIcon != null && SPINNERS[pullingIcon] !== undefined;\n const mode = getIonMode(this);\n return (h(Host, { class: mode }, h(\"div\", { class: \"refresher-pulling\" }, this.pullingIcon && hasSpinner &&\n h(\"div\", { class: \"refresher-pulling-icon\" }, h(\"div\", { class: \"spinner-arrow-container\" }, h(\"ion-spinner\", { name: this.pullingIcon, paused: true }), mode === 'md' && this.pullingIcon === 'circular' &&\n h(\"div\", { class: \"arrow-container\" }, h(\"ion-icon\", { name: \"caret-back-sharp\" })))), this.pullingIcon && !hasSpinner &&\n h(\"div\", { class: \"refresher-pulling-icon\" }, h(\"ion-icon\", { icon: this.pullingIcon, lazy: false })), this.pullingText &&\n h(\"div\", { class: \"refresher-pulling-text\", innerHTML: sanitizeDOMString(this.pullingText) })), h(\"div\", { class: \"refresher-refreshing\" }, this.refreshingSpinner &&\n h(\"div\", { class: \"refresher-refreshing-icon\" }, h(\"ion-spinner\", { name: this.refreshingSpinner })), this.refreshingText &&\n h(\"div\", { class: \"refresher-refreshing-text\", innerHTML: sanitizeDOMString(this.refreshingText) }))));\n }\n get el() { return getElement(this); }\n};\n\nexport { Refresher as ion_refresher, RefresherContent as ion_refresher_content };\n"],"sourceRoot":"webpack:///"}