bottom-sheet
Version:
Bottom Sheet implemented as a Vanilla Web Component
1 lines • 51 kB
JavaScript
import*as tslib_1 from"../polyfills/tslib.js";import{h}from"../bottom-sheet.core.js";var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function __extends(e,t){function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __rest(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(r[n[o]]=e[n[o]])}return r}var StepId,__assign$1=function(){return(__assign$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},clamp=function(e,t){return function(r){return Math.max(Math.min(r,t),e)}},isFirstChars=function(e){return function(t){return"string"==typeof t&&0===t.indexOf(e)}},getValueFromFunctionString=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))},splitCommaDelimited=function(e){return"string"==typeof e?e.split(/,\s*/):[e]},sanitize=function(e){return e%1?Number(e.toFixed(5)):e},number={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},alpha=__assign$1({},number,{transform:clamp(0,1)}),scale=__assign$1({},number,{default:1}),createUnitType=function(e){return{test:function(t){return"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),clampRgbUnit=clamp(0,255),onlyColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,isRgba=function(e){return void 0!==e.red},isHsla=function(e){return void 0!==e.hue},splitColorValues=function(e){var t=e.length;return function(r){if("string"!=typeof r)return r;for(var n={},o=splitCommaDelimited(getValueFromFunctionString(r)),i=0;i<t;i++)n[e[i]]=void 0!==o[i]?parseFloat(o[i]):1;return n}},rgbaTemplate=function(e){var t=e.alpha;return"rgba("+e.red+", "+e.green+", "+e.blue+", "+(void 0===t?1:t)+")"},hslaTemplate=function(e){var t=e.alpha;return"hsla("+e.hue+", "+e.saturation+", "+e.lightness+", "+(void 0===t?1:t)+")"},rgbUnit=__assign$1({},number,{transform:function(e){return Math.round(clampRgbUnit(e))}}),testRgbaString=isFirstChars("rgb"),rgba={test:function(e){return"string"==typeof e?testRgbaString(e):isRgba(e)},parse:splitColorValues(["red","green","blue","alpha"]),transform:function(e){var t=e.green,r=e.blue,n=e.alpha;return rgbaTemplate({red:rgbUnit.transform(e.red),green:rgbUnit.transform(t),blue:rgbUnit.transform(r),alpha:sanitize(n)})}},testHslaString=isFirstChars("hsl"),hsla={test:function(e){return"string"==typeof e?testHslaString(e):isHsla(e)},parse:splitColorValues(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.saturation,r=e.lightness,n=e.alpha;return hslaTemplate({hue:Math.round(e.hue),saturation:percent.transform(sanitize(t)),lightness:percent.transform(sanitize(r)),alpha:sanitize(n)})}},hex=__assign$1({},rgba,{test:isFirstChars("#"),parse:function(e){var t="",r="",n="";return e.length>4?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),t+=t,r+=r,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),color={test:function(e){return"string"==typeof e&&onlyColorRegex.test(e)||rgba.test(e)||hsla.test(e)||hex.test(e)},parse:function(e){return rgba.test(e)?rgba.parse(e):hsla.test(e)?hsla.parse(e):hex.test(e)?hex.parse(e):e},transform:function(e){return isRgba(e)?rgba.transform(e):isHsla(e)?hsla.transform(e):e}},floatRegex=/(-)?(\d[\d\.]*)/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,COLOR_TOKEN="${c}",NUMBER_TOKEN="${n}",complex={test:function(e){if("string"!=typeof e||!isNaN(e))return!1;var t=0,r=e.match(floatRegex),n=e.match(colorRegex);return r&&(t+=r.length),n&&(t+=n.length),t>0},parse:function(e){var t=e,r=[],n=t.match(colorRegex);n&&(t=t.replace(colorRegex,COLOR_TOKEN),r.push.apply(r,n.map(color.parse)));var o=t.match(floatRegex);return o&&r.push.apply(r,o.map(number.parse)),r},createTransformer:function(e){var t=e,r=0,n=e.match(colorRegex),o=n?n.length:0;if(n)for(var i=0;i<o;i++)t=t.replace(n[i],COLOR_TOKEN),r++;var a=t.match(floatRegex),s=a?a.length:0;if(a)for(i=0;i<s;i++)t=t.replace(a[i],NUMBER_TOKEN),r++;return function(e){for(var n=t,i=0;i<r;i++)n=n.replace(i<o?COLOR_TOKEN:NUMBER_TOKEN,i<o?color.transform(e[i]):sanitize(e[i]));return n}}},invariant=function(){},prevTime=0,onNextFrame="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),r=Math.max(0,16.7-(t-prevTime));prevTime=t+r,setTimeout(function(){return e(prevTime)},r)},createStep=function(e){var t=[],r=[],n=0,o=!1,i=0,a=new WeakSet,s=new WeakSet,u={cancel:function(e){var t=r.indexOf(e);a.add(e),-1!==t&&r.splice(t,1)},process:function(c){var l,p;if(o=!0,t=(l=[r,t])[0],(r=l[1]).length=0,n=t.length)for(i=0;i<n;i++)(p=t[i])(c),!0!==s.has(p)||a.has(p)||(u.schedule(p),e(!0));o=!1},schedule:function(e,i,u){void 0===i&&(i=!1),void 0===u&&(u=!1),invariant("function"==typeof e,"Argument must be a function");var c=u&&o,l=c?t:r;a.delete(e),i&&s.add(e),-1===l.indexOf(e)&&(l.push(e),c&&(n=t.length))}};return u};!function(e){e.Read="read",e.Update="update",e.Render="render",e.PostRender="postRender",e.FixedUpdate="fixedUpdate"}(StepId||(StepId={}));var maxElapsed=40,defaultElapsed=1/60*1e3,useDefaultElapsed=!0,willRunNextFrame=!1,isProcessing=!1,frame={delta:0,timestamp:0},stepsOrder=[StepId.Read,StepId.Update,StepId.Render,StepId.PostRender],setWillRunNextFrame=function(e){return willRunNextFrame=e},_a=stepsOrder.reduce(function(e,t){var r=createStep(setWillRunNextFrame);return e.sync[t]=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!1),willRunNextFrame||startLoop(),r.schedule(e,t,n),e},e.cancelSync[t]=function(e){return r.cancel(e)},e.steps[t]=r,e},{steps:{},sync:{},cancelSync:{}}),steps=_a.steps,sync=_a.sync,cancelSync=_a.cancelSync,processStep=function(e){return steps[e].process(frame)},processFrame=function(e){willRunNextFrame=!1,frame.delta=useDefaultElapsed?defaultElapsed:Math.max(Math.min(e-frame.timestamp,maxElapsed),1),useDefaultElapsed||(defaultElapsed=frame.delta),frame.timestamp=e,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,willRunNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=function(){willRunNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)},getFrameData=function(){return frame},reversed=function(e){return function(t){return 1-e(1-t)}},createExpoIn=function(e){return function(t){return Math.pow(t,e)}},linear=function(e){return e},easeIn=createExpoIn(2),easeOut=reversed(easeIn),NEWTON_ITERATIONS=8,NEWTON_MIN_SLOPE=.001,SUBDIVISION_PRECISION=1e-7,SUBDIVISION_MAX_ITERATIONS=10,K_SPLINE_TABLE_SIZE=11,K_SAMPLE_STEP_SIZE=1/(K_SPLINE_TABLE_SIZE-1),FLOAT_32_SUPPORTED="undefined"!=typeof Float32Array,a=function(e,t){return 1-3*t+3*e},b=function(e,t){return 3*t-6*e},c=function(e){return 3*e},getSlope=function(e,t,r){return 3*a(t,r)*e*e+2*b(t,r)*e+c(t)},calcBezier=function(e,t,r){return((a(t,r)*e+b(t,r))*e+c(t))*e};function cubicBezier(e,t,r,n){var o=FLOAT_32_SUPPORTED?new Float32Array(K_SPLINE_TABLE_SIZE):new Array(K_SPLINE_TABLE_SIZE);return function(){for(var t=0;t<K_SPLINE_TABLE_SIZE;++t)o[t]=calcBezier(t*K_SAMPLE_STEP_SIZE,e,r)}(),function(i){return e===t&&r===n?i:0===i?0:1===i?1:calcBezier(function(t){for(var n,i,a=0,s=1,u=K_SPLINE_TABLE_SIZE-1;s!==u&&o[s]<=t;++s)a+=K_SAMPLE_STEP_SIZE;return(i=getSlope(n=a+(t-o[--s])/(o[s+1]-o[s])*K_SAMPLE_STEP_SIZE,e,r))>=NEWTON_MIN_SLOPE?function(t,n){for(var o=0,i=0;o<NEWTON_ITERATIONS;++o){if(0===(i=getSlope(n,e,r)))return n;n-=(calcBezier(n,e,r)-t)/i}return n}(t,n):0===i?n:function(t,n,o){var i,a,s=0;do{(i=calcBezier(a=n+(o-n)/2,e,r)-t)>0?o=a:n=a}while(Math.abs(i)>SUBDIVISION_PRECISION&&++s<SUBDIVISION_MAX_ITERATIONS);return a}(t,a,a+K_SAMPLE_STEP_SIZE)}(i),t,n)}}var zeroPoint={x:0,y:0,z:0},isNum=function(e){return"number"==typeof e},radiansToDegrees=function(e){return 180*e/Math.PI},angle=function(e,t){return void 0===t&&(t=zeroPoint),radiansToDegrees(Math.atan2(t.y-e.y,t.x-e.x))},applyOffset=function(e,t){var r=!0;return void 0===t&&(t=e,r=!1),function(n){return r?n-e+t:(e=n,r=!0,t)}},curryRange=function(e){return function(t,r,n){return void 0!==n?e(t,r,n):function(n){return e(t,r,n)}}},clamp$1=function(e,t,r){return Math.min(Math.max(r,e),t)},clamp$1$1=curryRange(clamp$1),conditional=function(e,t){return function(r){return e(r)?t(r):r}},degreesToRadians=function(e){return e*Math.PI/180},isPoint=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},isPoint3D=function(e){return isPoint(e)&&e.hasOwnProperty("z")},distance1D=function(e,t){return Math.abs(e-t)},distance=function(e,t){if(void 0===t&&(t=zeroPoint),isNum(e)&&isNum(t))return distance1D(e,t);if(isPoint(e)&&isPoint(t)){var r=distance1D(e.x,t.x),n=distance1D(e.y,t.y),o=isPoint3D(e)&&isPoint3D(t)?distance1D(e.z,t.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}return 0},progress=function(e,t,r){var n=t-e;return 0===n?1:(r-e)/n},mix=function(e,t,r){return-r*e+r*t+e},__assign$2=function(){return(__assign$2=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},mixLinearColor=function(e,t,r){var n=e*e;return Math.sqrt(r*(t*t-n)+n)},colorTypes=[hex,rgba,hsla],getColorType=function(e){return colorTypes.find(function(t){return t.test(e)})},mixColor=function(e,t){var r=getColorType(e),n=getColorType(t);invariant(r.transform===n.transform,"Both colors must be Hex and/or RGBA, or both must be HSLA");var o=r.parse(e),i=n.parse(t),a=__assign$2({},o),s=r===hsla?mix:mixLinearColor;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(o[t],i[t],e));return a.alpha=mix(o.alpha,i.alpha,e),r.transform(a)}},combineFunctions=function(e,t){return function(r){return t(e(r))}},pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(combineFunctions)},mixArray=function(e,t){var r=e.slice(),n=r.length,o=e.map(function(e,r){var n=t[r];return isNum(e)?function(t){return mix(e,n,t)}:color.test(e)?mixColor(e,n):mixComplex(e,n)});return function(e){for(var t=0;t<n;t++)r[t]=o[t](e);return r}},mixComplex=function(e,t){var r=complex.createTransformer(e);return invariant(r(e)===complex.createTransformer(t)(e),"Values '"+e+"' and '"+t+"' are of different format, or a value might have changed value type."),pipe(mixArray(complex.parse(e),complex.parse(t)),r)},mixNumber=curryRange(mix),getMixer=function(e){return"number"==typeof e?mixNumber:color.test(e)?mixColor:mixComplex},createMixers=function(e,t){return Array(e.length-1).fill(getMixer(e[0])).map(function(r,n){var o=r(e[n],e[n+1]);if(t){var i=Array.isArray(t)?t[n]:t;return pipe(i,o)}return o})},fastInterpolate=function(e,t){var r=e[0],n=e[1],o=t[0];return function(e){return o(progress(r,n,e))}},slowInterpolate=function(e,t){var r=e.length,n=r-1;return function(o){var i=0,a=!1;if(o<=e[0]?a=!0:o>=e[n]&&(i=n-1,a=!0),!a){for(var s=1;s<r&&!(e[s]>o||s===n);s++);i=s-1}var u=progress(e[i],e[i+1],o);return t[i](u)}},interpolate=function(e,t,r){var n=void 0===r?{}:r,o=n.clamp,i=void 0===o||o,a=n.ease,s=e.length;invariant(s===t.length,"Both input and output ranges must be the same length"),invariant(!a||!Array.isArray(a)||a.length===e.length-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),e[0]>e[s-1]&&(e=e.slice(),t=t.slice(),e.reverse(),t.reverse());var u=createMixers(t,a),c=2===s?fastInterpolate(e,u):slowInterpolate(e,u);return i?pipe(clamp$1$1(e[0],e[s-1]),c):c},pointFromVector=function(e,t,r){return t=degreesToRadians(t),{x:r*Math.cos(t)+e.x,y:r*Math.sin(t)+e.y}},toDecimal=function(e,t){return void 0===t&&(t=2),t=Math.pow(10,t),Math.round(e*t)/t},smoothFrame=function(e,t,r,n){return void 0===n&&(n=0),toDecimal(e+r*(t-e)/Math.max(n,r))},smooth=function(e){void 0===e&&(e=50);var t=0,r=0;return function(n){var o=getFrameData().timestamp,i=o!==r?o-r:0,a=i?smoothFrame(t,n,i,e):t;return r=o,t=a,a}},snap=function(e){if("number"==typeof e)return function(t){return Math.round(t/e)*e};var t=0,r=e.length;return function(n){var o=Math.abs(e[0]-n);for(t=1;t<r;t++){var i=e[t],a=Math.abs(i-n);if(0===a)return i;if(a>o)return e[t-1];if(t===r-1)return i;o=a}}},identity=function(e){return e},springForce=function(e){return void 0===e&&(e=identity),curryRange(function(t,r,n){var o=r-n,i=-(0-t+1)*(0-e(Math.abs(o)));return o<=0?r+i:r-i})},springForceLinear=springForce(),springForceExpo=springForce(Math.sqrt),velocityPerFrame=function(e,t){return isNum(e)?e/(1e3/t):0},velocityPerSecond=function(e,t){return t?e*(1e3/t):0},wrap=function(e,t,r){var n=t-e;return((r-e)%n+n)%n+e},wrap$1=curryRange(wrap),clampProgress=clamp$1$1(0,1),__assign$3=function(){return(__assign$3=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __rest$1(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(r[n[o]]=e[n[o]])}return r}var testElement,createStyler=function(e){var t=e.onRead,r=e.onRender,n=e.uncachedValues,o=void 0===n?new Set:n,i=e.useCache,a=void 0===i||i;return function(e){var n={},i=[],s=!1,u=function(e,t){var r=n[e];n[e]=t,n[e]!==r&&(-1===i.indexOf(e)&&i.push(e),s||(s=!0,sync.render(c)))};function c(t){return void 0===t&&(t=!1),(!0===t||s)&&(r(n,e,i),s=!1,i.length=0),this}return{get:function(r){return r?a&&!o.has(r)&&void 0!==n[r]?n[r]:t(r,e):n},set:function(e,t){if("string"==typeof e){if(void 0===t)return function(t){return u(e,t)};u(e,t)}else for(var r in e)e.hasOwnProperty(r)&&u(r,e[r]);return this},render:c}}},CAMEL_CASE_PATTERN=/([a-z])([A-Z])/g,REPLACE_TEMPLATE="$1-$2",camelToDash=function(e){return e.replace(CAMEL_CASE_PATTERN,REPLACE_TEMPLATE).toLowerCase()},setDomAttrs=function(e,t){for(var r in t)t.hasOwnProperty(r)&&e.setAttribute(r,t[r])},camelCache=new Map,dashCache=new Map,prefixes=["Webkit","Moz","O","ms",""],numPrefixes=prefixes.length,isBrowser="undefined"!=typeof document,setDashPrefix=function(e,t){return dashCache.set(e,camelToDash(t))},testPrefix=function(e){testElement=testElement||document.createElement("div");for(var t=0;t<numPrefixes;t++){var r=prefixes[t],n=""===r,o=n?e:r+e.charAt(0).toUpperCase()+e.slice(1);(o in testElement.style||n)&&(camelCache.set(e,o),setDashPrefix(e,(n?"":"-")+camelToDash(o)))}},setServerProperty=function(e){return setDashPrefix(e,e)},prefixer=function(e,t){void 0===t&&(t=!1);var r=t?dashCache:camelCache;return r.has(e)||(isBrowser?testPrefix(e):setServerProperty(e)),r.get(e)||e},axes=["","X","Y","Z"],order=["scale","rotate","skew","transformPerspective"],transformProps=order.reduce(function(e,t){return axes.reduce(function(e,r){return e.push(t+r),e},e)},["x","y","z"]),transformPropDictionary=transformProps.reduce(function(e,t){return e[t]=!0,e},{}),isTransformProp=function(e){return!0===transformPropDictionary[e]},sortTransformProps=function(e,t){return transformProps.indexOf(e)-transformProps.indexOf(t)},isTransformOriginProp=function(e){return"originX"===e||"originY"===e},valueTypes={color:color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale:scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,x:px,y:px,z:px,perspective:px,opacity:alpha,originX:percent,originY:percent,originZ:px},getValueType=function(e){return valueTypes[e]},SCROLL_LEFT="scrollLeft",SCROLL_TOP="scrollTop",scrollKeys=new Set([SCROLL_LEFT,SCROLL_TOP]),blacklist=new Set([SCROLL_LEFT,SCROLL_TOP,"transform"]),aliasMap={x:"translateX",y:"translateY",z:"translateZ"},isCustomTemplate=function(e){return"function"==typeof e},buildStyleProperty=function(e,t,r,n,o,i,a){void 0===t&&(t=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===a&&(a=!1);var s=!0,u=!1,c=!1;for(var l in e){var p=e[l],f=getValueType(l),d="number"==typeof p&&f?f.transform(p):p;isTransformProp(l)?(u=!0,n[l]=d,i.push(l),s&&(f.default&&p!==f.default||!f.default&&0!==p)&&(s=!1)):isTransformOriginProp(l)?(o[l]=d,c=!0):blacklist.has(l)&&isCustomTemplate(d)||(r[prefixer(l,a)]=d)}if(s)u&&(r.transform="none");else{var h="";if(isCustomTemplate(e.transform))h=e.transform(n);else{var m=!1;i.sort(sortTransformProps);for(var g=i.length,v=0;v<g;v++)h+=(aliasMap[l=i[v]]||l)+"("+n[l]+") ",m="z"===l||m;!m&&t?h+="translateZ(0)":h=h.trim()}r.transform=h}return c&&(r.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0)),r},createStyleBuilder=function(e){void 0===e&&(e=!0);var t={},r={},n={},o=[];return function(i){return o.length=0,buildStyleProperty(i,e,t,r,n,o,!0),t}},cssStyler=createStyler({onRead:function(e,t){var r=t.element,n=t.preparseOutput,o=getValueType(e);if(isTransformProp(e))return o&&o.default||0;if(scrollKeys.has(e))return r[e];var i=window.getComputedStyle(r,null).getPropertyValue(prefixer(e,!0))||0;return n&&o&&o.parse?o.parse(i):i},onRender:function(e,t,r){var n=t.element;Object.assign(n.style,(0,t.buildStyles)(e)),-1!==r.indexOf(SCROLL_LEFT)&&(n.scrollLeft=e.scrollLeft),-1!==r.indexOf(SCROLL_TOP)&&(n.scrollTop=e.scrollTop)},uncachedValues:scrollKeys}),css=function(e,t){void 0===t&&(t={});var r=t.enableHardwareAcceleration,n=__rest$1(t,["enableHardwareAcceleration"]);return cssStyler(__assign$3({element:e,buildStyles:createStyleBuilder(r),preparseOutput:!0},n))},camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),ZERO_NOT_ZERO=1e-7,percentToPixels=function(e,t){return e/100*t+"px"},build=function(e,t,r,n){var o=!1,i=!1,a={},s=r?{pathLength:"0",pathSpacing:""+n}:void 0,u=void 0!==e.scale?e.scale||ZERO_NOT_ZERO:e.scaleX||1,c=void 0!==e.scaleY?e.scaleY||ZERO_NOT_ZERO:u||1,l=t.width*((e.originX||50)/100)+t.x,p=t.height*((e.originY||50)/100)+t.y,f={translate:"translate("+e.x+", "+e.y+") ",scale:"translate("+1*u*-l+", "+1*c*-p+") scale("+u+", "+c+") translate("+l/u+", "+p/c+") ",rotate:"rotate("+e.rotate+", "+l+", "+p+") ",skewX:"skewX("+e.skewX+") ",skewY:"skewY("+e.skewY+") "};for(var d in e)if(e.hasOwnProperty(d)){var h=e[d];isTransformProp(d)?o=!0:!r||"pathLength"!==d&&"pathSpacing"!==d||"number"!=typeof h?r&&"pathOffset"===d?a["stroke-dashoffset"]=percentToPixels(-h,n):a[camelCaseAttributes.has(d)?d:camelToDash(d)]=h:(i=!0,s[d]=percentToPixels(h,n))}if(i&&(a["stroke-dasharray"]=s.pathLength+" "+s.pathSpacing),o)for(var d in a.transform="",f)f.hasOwnProperty(d)&&(a.transform+=f[d].replace(/undefined/g,"scale"===d?"1":"0"));return a},int=__assign$3({},number,{transform:Math.round}),valueTypes$1={fill:color,stroke:color,scale:scale,scaleX:scale,scaleY:scale,opacity:alpha,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int},getValueType$1=function(e){return valueTypes$1[e]},getDimensions=function(e){return"function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()},getSVGElementDimensions=function(e){try{return getDimensions(e)}catch(e){return{x:0,y:0,width:0,height:0}}},svgStyler=createStyler({onRead:function(e,t){var r=t.element;if(isTransformProp(e)){var n=getValueType$1(e);return n?n.default:0}return r.getAttribute(e)},onRender:function(e,t){setDomAttrs(t.element,build(e,t.dimensions,t.isPath,t.pathLength))}}),svg=function(e){var t={element:e,dimensions:getSVGElementDimensions(e),isPath:!1};return"path"===e.tagName&&(t.isPath=!0,t.pathLength=e.getTotalLength()),svgStyler(t)},viewport=createStyler({useCache:!1,onRead:function(e){return"scrollTop"===e?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,r=e.scrollLeft;return window.scrollTo(void 0===r?0:r,void 0===t?0:t)}}),cache=new WeakMap,createDOMStyler=function(e,t){var r;return e instanceof HTMLElement?r=css(e,t):e instanceof SVGElement?r=svg(e):e===window&&(r=viewport(e)),invariant(void 0!==r,"No valid node provided. Node must be HTMLElement, SVGElement or window."),cache.set(e,r),r},getStyler=function(e,t){return cache.has(e)?cache.get(e):createDOMStyler(e,t)};function index(e,t){var r="string"==typeof e?document.querySelector(e):e;return getStyler(r,t)}var Chainable=function(){function e(e){void 0===e&&(e={}),this.props=e}return e.prototype.applyMiddleware=function(e){return this.create(__assign({},this.props,{middleware:this.props.middleware?[e].concat(this.props.middleware):[e]}))},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=1===e.length?e[0]:pipe.apply(void 0,e);return this.applyMiddleware(function(e){return function(t){return e(r(t))}})},e.prototype.while=function(e){return this.applyMiddleware(function(t,r){return function(n){return e(n)?t(n):r()}})},e.prototype.filter=function(e){return this.applyMiddleware(function(t){return function(r){return e(r)&&t(r)}})},e}(),Observer=function(){return function(e,t){var r=e.middleware,n=e.onComplete,o=this;this.isActive=!0,this.update=function(e){o.observer.update&&o.updateObserver(e)},this.complete=function(){o.observer.complete&&o.isActive&&o.observer.complete(),o.onComplete&&o.onComplete(),o.isActive=!1},this.error=function(e){o.observer.error&&o.isActive&&o.observer.error(e),o.isActive=!1},this.observer=t,this.updateObserver=function(e){return t.update(e)},this.onComplete=n,t.update&&r&&r.length&&r.forEach(function(e){return o.updateObserver=e(o.updateObserver,o.complete)})}}(),createObserver=function(e,t,r){return new Observer({middleware:t.middleware,onComplete:r},"function"==typeof e?{update:e}:e)},Action=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.create=function(e){return new t(e)},t.prototype.start=function(e){void 0===e&&(e={});var t=!1,r={stop:function(){}},n=this.props,o=n.init,i=__rest(n,["init"]),a=o(createObserver(e,i,function(){t=!0,r.stop()}));return r=a?__assign({},r,a):r,e.registerParent&&e.registerParent(r),t&&r.stop(),r},t}(Chainable),action=function(e){return new Action({init:e})},BaseMulticast=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.subscribers=[],t}return __extends(t,e),t.prototype.complete=function(){this.subscribers.forEach(function(e){return e.complete()})},t.prototype.error=function(e){this.subscribers.forEach(function(t){return t.error(e)})},t.prototype.update=function(e){for(var t=0;t<this.subscribers.length;t++)this.subscribers[t].update(e)},t.prototype.subscribe=function(e){var t=this,r=createObserver(e,this.props);return this.subscribers.push(r),{unsubscribe:function(){var e=t.subscribers.indexOf(r);-1!==e&&t.subscribers.splice(e,1)}}},t.prototype.stop=function(){this.parent&&this.parent.stop()},t.prototype.registerParent=function(e){this.stop(),this.parent=e},t}(Chainable),Multicast=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.create=function(e){return new t(e)},t}(BaseMulticast),stepProgress=function(e,t){var r=1/(e-1),n=1/(2*(e-1)),o=Math.min(t,1);return Math.floor((o/n+1)/2)*r},calc=Object.freeze({angle:angle,degreesToRadians:degreesToRadians,distance:distance,isPoint3D:isPoint3D,isPoint:isPoint,dilate:mix,getValueFromProgress:mix,pointFromAngleAndDistance:pointFromVector,getProgressFromValue:progress,radiansToDegrees:radiansToDegrees,smooth:smoothFrame,speedPerFrame:velocityPerFrame,speedPerSecond:velocityPerSecond,stepProgress:stepProgress}),isValueList=function(e){return Array.isArray(e)},isSingleValue=function(e){var t=typeof e;return"string"===t||"number"===t},ValueReaction=function(e){function t(t){var r=e.call(this,t)||this;return r.scheduleVelocityCheck=function(){return sync.postRender(r.velocityCheck)},r.velocityCheck=function(e){e.timestamp!==r.lastUpdated&&(r.prev=r.current)},r.prev=r.current=t.value||0,isSingleValue(r.current)?(r.updateCurrent=function(e){return r.current=e},r.getVelocityOfCurrent=function(){return r.getSingleVelocity(r.current,r.prev)}):isValueList(r.current)?(r.updateCurrent=function(e){return r.current=e.slice()},r.getVelocityOfCurrent=function(){return r.getListVelocity()}):(r.updateCurrent=function(e){for(var t in r.current={},e)e.hasOwnProperty(t)&&(r.current[t]=e[t])},r.getVelocityOfCurrent=function(){return r.getMapVelocity()}),t.initialSubscription&&r.subscribe(t.initialSubscription),r}return __extends(t,e),t.prototype.create=function(e){return new t(e)},t.prototype.get=function(){return this.current},t.prototype.getVelocity=function(){return this.getVelocityOfCurrent()},t.prototype.update=function(t){e.prototype.update.call(this,t),this.prev=this.current,this.updateCurrent(t);var r=getFrameData(),n=r.timestamp;this.timeDelta=r.delta,this.lastUpdated=n,sync.postRender(this.scheduleVelocityCheck)},t.prototype.subscribe=function(t){var r=e.prototype.subscribe.call(this,t);return this.subscribers[this.subscribers.length-1].update(this.current),r},t.prototype.getSingleVelocity=function(e,t){return"number"==typeof e&&"number"==typeof t?velocityPerSecond(e-t,this.timeDelta):velocityPerSecond(parseFloat(e)-parseFloat(t),this.timeDelta)||0},t.prototype.getListVelocity=function(){var e=this;return this.current.map(function(t,r){return e.getSingleVelocity(t,e.prev[r])})},t.prototype.getMapVelocity=function(){var e={};for(var t in this.current)this.current.hasOwnProperty(t)&&(e[t]=this.getSingleVelocity(this.current[t],this.prev[t]));return e},t}(BaseMulticast),value=function(e,t){return new ValueReaction({value:e,initialSubscription:t})},multi=function(e){var t=e.getCount,r=e.getFirst,n=e.getOutput,o=e.mapApi,i=e.setProp,a=e.startActions;return function(e){return action(function(s){var u=s.update,c=s.complete,l=s.error,p=t(e),f=n(),d=function(){return u(f)},h=0,m=a(e,function(e,t){var r=!1;return e.start({complete:function(){r||(r=!0,++h===p&&sync.update(c))},error:l,update:function(e){i(f,t,e),sync.update(d,!1,!0)}})});return Object.keys(r(m)).reduce(function(e,t){return e[t]=o(m,t),e},{})})}},composite=multi({getOutput:function(){return{}},getCount:function(e){return Object.keys(e).length},getFirst:function(e){return e[Object.keys(e)[0]]},mapApi:function(e,t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Object.keys(e).reduce(function(n,o){var i;return e[o][t]&&(n[o]=r[0]&&void 0!==r[0][o]?e[o][t](r[0][o]):(i=e[o])[t].apply(i,r)),n},{})}},setProp:function(e,t,r){return e[t]=r},startActions:function(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=t(e[n],n),r},{})}}),parallel=multi({getOutput:function(){return[]},getCount:function(e){return e.length},getFirst:function(e){return e[0]},mapApi:function(e,t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.map(function(e,n){if(e[t])return Array.isArray(r[0])?e[t](r[0][n]):e[t].apply(e,r)})}},setProp:function(e,t,r){return e[t]=r},startActions:function(e,t){return e.map(function(e,r){return t(e,r)})}}),parallel$1=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return parallel(e)},createVectorTests=function(e){var t=Object.keys(e),r=function(t,r){return void 0!==t&&!e[r](t)};return{getVectorKeys:function(e){return t.reduce(function(t,n){return r(e[n],n)&&t.push(n),t},[])},testVectorProps:function(e){return e&&t.some(function(t){return r(e[t],t)})}}},unitTypes=[px,percent,degrees,vh,vw],findUnitType=function(e){return unitTypes.find(function(t){return t.test(e)})},isUnitProp=function(e){return Boolean(findUnitType(e))},createAction=function(e,t){return e(t)},reduceArrayValue=function(e){return function(t,r){return t[r]=t[r][e],t}},createArrayAction=function(e,t,r){var n=t[r[0]].map(function(n,o){var i=r.reduce(reduceArrayValue(o),__assign({},t));return getActionCreator(n)(e,i)});return parallel$1.apply(void 0,n)},reduceObjectValue=function(e){return function(t,r){return t[r]=t[r][e],t}},createObjectAction=function(e,t,r){var n=r[0],o=Object.keys(t[n]).reduce(function(o,i){var a=r.reduce(reduceObjectValue(i),__assign({},t));return o[i]=getActionCreator(t[n][i])(e,a),o},{});return composite(o)},createUnitAction=function(e,t){var r=t.from,n=t.to,o=__rest(t,["from","to"]),i=findUnitType(r)||findUnitType(n),a=i.transform,s=i.parse;return e(__assign({},o,{from:"string"==typeof r?s(r):r,to:"string"==typeof n?s(n):n})).pipe(a)},createColorAction=function(e,t){var r=t.from,n=t.to,o=__rest(t,["from","to"]);return e(__assign({},o,{from:0,to:1})).pipe(mixColor(r,n),color.transform)},createComplexAction=function(e,t){var r=t.from,n=t.to,o=__rest(t,["from","to"]),i=complex.createTransformer(r);return invariant(i(r)===complex.createTransformer(n)(r),"Values '"+r+"' and '"+n+"' are of different format, or a value might have changed value type."),e(__assign({},o,{from:0,to:1})).pipe(mixArray(complex.parse(r),complex.parse(n)),i)},createVectorAction=function(e,t){var r=createVectorTests(t),n=r.testVectorProps,o=r.getVectorKeys;return function(t){if(!n(t))return e(t);var r=o(t);return getActionCreator(t[r[0]])(e,t,r)}},getActionCreator=function(e){var t=createAction;return"number"==typeof e?t=createAction:Array.isArray(e)?t=createArrayAction:isUnitProp(e)?t=createUnitAction:color.test(e)?t=createColorAction:complex.test(e)?t=createComplexAction:"object"==typeof e&&(t=createObjectAction),t},decay=function(e){return void 0===e&&(e={}),action(function(t){var r=t.complete,n=t.update,o=e.velocity,i=e.from,a=e.power,s=e.timeConstant,u=void 0===s?350:s,c=e.restDelta,l=void 0===c?.5:c,p=e.modifyTarget,f=0,d=(void 0===a?.8:a)*(void 0===o?0:o),h=Math.round((void 0===i?0:i)+d),m=void 0===p?h:p(h),g=sync.update(function(e){var t=-d*Math.exp(-(f+=e.delta)/u),o=t>l||t<-l;n(o?m+t:m),o||(cancelSync.update(g),r())},!0);return{stop:function(){return cancelSync.update(g)}}})},vectorDecay=createVectorAction(decay,{from:number.test,modifyTarget:function(e){return"function"==typeof e},velocity:number.test}),spring=function(e){return void 0===e&&(e={}),action(function(t){var r=t.update,n=t.complete,o=e.velocity,i=void 0===o?0:o,a=e.from,s=void 0===a?0:a,u=e.to,c=void 0===u?0:u,l=e.stiffness,p=void 0===l?100:l,f=e.damping,d=void 0===f?10:f,h=e.mass,m=void 0===h?1:h,g=e.restSpeed,v=void 0===g?.01:g,y=e.restDelta,b=void 0===y?.01:y,x=i?-i/1e3:0,S=0,O=c-s,P=s,_=P,w=sync.update(function(e){var t=e.delta;S+=t;var o=d/(2*Math.sqrt(p*m)),a=Math.sqrt(p/m)/1e3;if(_=P,o<1){var s=Math.exp(-o*a*S),u=a*Math.sqrt(1-o*o);P=c-s*((x+o*a*O)/u*Math.sin(u*S)+O*Math.cos(u*S))}else s=Math.exp(-a*S),P=c-s*(O+(x+a*O)*S);i=velocityPerSecond(P-_,t);var l=Math.abs(i)<=v,f=Math.abs(c-P)<=b;l&&f?(r(P=c),cancelSync.update(w),n()):r(P)},!0);return{stop:function(){return cancelSync.update(w)}}})},vectorSpring=createVectorAction(spring,{from:number.test,to:number.test,stiffness:number.test,damping:number.test,mass:number.test,velocity:number.test}),inertia=function(e){var t=e.from,r=void 0===t?0:t,n=e.velocity,o=void 0===n?0:n,i=e.min,a=e.max,s=e.power,u=void 0===s?.8:s,c=e.timeConstant,l=void 0===c?700:c,p=e.bounceStiffness,f=void 0===p?500:p,d=e.bounceDamping,h=void 0===d?10:d,m=e.restDelta,g=void 0===m?1:m,v=e.modifyTarget;return action(function(e){var t,n=e.update,s=e.complete,c=value(r),p=!1,d=function(e){return void 0!==i&&e<=i},m=function(e){return void 0!==a&&e>=a},y=function(e){return d(e)||m(e)},b=function(e,t){return d(e)&&t<0||m(e)&&t>0},x=function(e,r){t&&t.stop(),t=e.start({update:function(e){return c.update(e)},complete:function(){s(),r&&r()}})},S=function(e){p=!0,x(vectorSpring(__assign({},e,{to:d(e.from)?i:a,stiffness:f,damping:h,restDelta:g})))};if(c.subscribe(function(e){n(e);var r=c.getVelocity();t&&!p&&b(e,r)&&S({from:e,velocity:r})}),y(r)&&0===o||b(r,o))S({from:r,velocity:o});else{var O=vectorDecay({from:r,velocity:o,timeConstant:l,power:u,restDelta:y(r)?20:g,modifyTarget:v});x(O,function(){var e=c.get();y(e)&&S({from:e,velocity:c.getVelocity()})})}return{stop:function(){return t&&t.stop()}}})},index$1=createVectorAction(inertia,{from:number.test,velocity:number.test,min:number.test,max:number.test,damping:number.test,stiffness:number.test,modifyTarget:function(e){return"function"==typeof e}}),scrubber=function(e){var t=e.from,r=void 0===t?0:t,n=e.to,o=void 0===n?1:n,i=e.ease,a=void 0===i?linear:i;return action(function(e){var t=e.update;return{seek:function(e){return t(e)}}}).pipe(a,function(e){return mix(r,o,e)})},vectorScrubber=createVectorAction(scrubber,{ease:function(e){return"function"==typeof e},from:number.test,to:number.test}),clampProgress$1=clamp$1$1(0,1),tween=function(e){return void 0===e&&(e={}),action(function(t){var r,n=t.update,o=t.complete,i=e.duration,a=void 0===i?300:i,s=e.ease,u=void 0===s?easeOut:s,c=e.flip,l=void 0===c?0:c,p=e.loop,f=void 0===p?0:p,d=e.yoyo,h=void 0===d?0:d,m=e.from,g=void 0===m?0:m,v=e.to,y=void 0===v?1:v,b=e.elapsed,x=void 0===b?0:b,S=e.playDirection,O=void 0===S?1:S,P=e.flipCount,_=void 0===P?0:P,w=e.yoyoCount,T=void 0===w?0:w,E=e.loopCount,C=void 0===E?0:E,A=vectorScrubber({from:g,to:y,ease:u}).start(n),R=0,L=!1,M=function(){return O*=-1},D=function(){R=clampProgress$1(progress(0,a,x)),A.seek(R)},B=function(){L=!0,r=sync.update(function(e){x+=e.delta*O,D(),function(){var e,t=1===O?L&&x>=a:L&&x<=0;if(!t)return!1;if(t&&!f&&!l&&!h)return!0;var r=!1;return f&&C<f?(x=0,C++,r=!0):l&&_<l?(x=a-x,A=vectorScrubber({from:g=(e=[y,g])[0],to:y=e[1],ease:u}).start(n),_++,r=!0):h&&T<h&&(M(),T++,r=!0),!r}()&&o&&(cancelSync.update(r),sync.update(o,!1,!0))},!0)},I=function(){L=!1,r&&cancelSync.update(r)};return B(),{isActive:function(){return L},getElapsed:function(){return clamp$1$1(0,a,x)},getProgress:function(){return R},stop:function(){I()},pause:function(){return I(),this},resume:function(){return L||B(),this},seek:function(e){return x=mix(0,a,e),sync.update(D,!1,!0),this},reverse:function(){return M(),this}}})},clampProgress$1$1=clamp$1$1(0,1),listen=function(e,t,r){return action(function(n){var o=n.update,i=t.split(" ").map(function(t){return e.addEventListener(t,o,r),t});return{stop:function(){return i.forEach(function(t){return e.removeEventListener(t,o,r)})}}})},defaultPointerPos=function(){return{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}},eventToPoint=function(e,t){return void 0===t&&(t=defaultPointerPos()),t.clientX=t.x=e.clientX,t.clientY=t.y=e.clientY,t.pageX=e.pageX,t.pageY=e.pageY,t},points=[defaultPointerPos()],isTouchDevice=!1;if("undefined"!=typeof document){var updatePointsLocation=function(e){var t=e.touches;isTouchDevice=!0;var r=t.length;points.length=0;for(var n=0;n<r;n++)points.push(eventToPoint(t[n]))};listen(document,"touchstart touchmove",{passive:!0,capture:!0}).start(updatePointsLocation)}var multitouch=function(e){var t=void 0===e?{}:e,r=t.preventDefault,n=void 0===r||r,o=t.scale,i=void 0===o?1:o,a=t.rotate,s=void 0===a?0:a;return action(function(e){var t=e.update,r={touches:points,scale:i,rotate:s},o=0,a=0,u=points.length>1;if(u){var c=points[0],l=points[1];o=distance(c,l),a=angle(c,l)}var p=function(){if(u){var e=points[0],n=points[1],c=distance(e,n),l=angle(e,n);r.scale=i*(c/o),r.rotate=s+(l-a)}t(r)},f=listen(document,"touchmove",{passive:!n}).start(function(e){(n||e.touches.length>1)&&e.preventDefault(),sync.update(p)});return isTouchDevice&&sync.update(p),{stop:function(){cancelSync.update(p),f.stop()}}})},getIsTouchDevice=function(){return isTouchDevice},point=defaultPointerPos(),isMouseDevice=!1;if("undefined"!=typeof document){var updatePointLocation=function(e){isMouseDevice=!0,eventToPoint(e,point)};listen(document,"mousedown mousemove",!0).start(updatePointLocation)}var mouse=function(e){var t=(void 0===e?{}:e).preventDefault,r=void 0===t||t;return action(function(e){var t=e.update,n=function(){return t(point)},o=listen(document,"mousemove").start(function(e){r&&e.preventDefault(),sync.update(n)});return isMouseDevice&&sync.update(n),{stop:function(){cancelSync.update(n),o.stop()}}})},getFirstTouch=function(e){return e[0]},pointer=function(e){return void 0===e&&(e={}),getIsTouchDevice()?multitouch(e).pipe(function(e){return e.touches},getFirstTouch):mouse(e)},index$1$1=function(e){void 0===e&&(e={});var t=e.x,r=e.y,n=__rest(e,["x","y"]);if(void 0!==t||void 0!==r){var o=applyOffset(t||0),i=applyOffset(r||0),a={x:0,y:0};return pointer(n).pipe(function(e){return a.x=o(e.x),a.y=i(e.y),a})}return pointer(n)},appendUnit=function(e){return function(t){return""+t+e}},steps$2=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),function(n){var o=progress(t,r,n);return mix(t,r,stepProgress(e,o))}},transformMap=function(e){return function(t){var r=__assign({},t);for(var n in e)e.hasOwnProperty(n)&&(r[n]=(0,e[n])(t[n]));return r}},transformers=Object.freeze({applyOffset:applyOffset,clamp:clamp$1$1,conditional:conditional,interpolate:interpolate,blendArray:mixArray,blendColor:mixColor,pipe:pipe,smooth:smooth,snap:snap,generateStaticSpring:springForce,nonlinearSpring:springForceExpo,linearSpring:springForceLinear,wrap:wrap$1,appendUnit:appendUnit,steps:steps$2,transformMap:transformMap}),hasPassiveEvents=!1;if("undefined"!=typeof window){var passiveTestOptions={get passive(){hasPassiveEvents=!0}};window.addEventListener("testPassive",null,passiveTestOptions),window.removeEventListener("testPassive",null,passiveTestOptions)}var previousBodyOverflowSetting,previousBodyPaddingRight,isIosDevice="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&/iP(ad|hone|od)/.test(window.navigator.platform),locks=[],documentListenerAdded=!1,initialClientY=-1,allowTouchMove=function(e){return locks.some(function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))})},preventDefault=function(e){var t=e||window.event;return!!allowTouchMove(t.target)||t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1)},setOverflowHidden=function(e){setTimeout(function(){if(void 0===previousBodyPaddingRight){var t=window.innerWidth-document.documentElement.clientWidth;e&&!0===e.reserveScrollBarGap&&t>0&&(previousBodyPaddingRight=document.body.style.paddingRight,document.body.style.paddingRight=t+"px")}void 0===previousBodyOverflowSetting&&(previousBodyOverflowSetting=document.body.style.overflow,document.body.style.overflow="hidden")})},restoreOverflowSetting=function(){setTimeout(function(){void 0!==previousBodyPaddingRight&&(document.body.style.paddingRight=previousBodyPaddingRight,previousBodyPaddingRight=void 0),void 0!==previousBodyOverflowSetting&&(document.body.style.overflow=previousBodyOverflowSetting,previousBodyOverflowSetting=void 0)})},isTargetElementTotallyScrolled=function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight},handleScroll=function(e,t){var r=e.targetTouches[0].clientY-initialClientY;return!allowTouchMove(e.target)&&(t&&0===t.scrollTop&&r>0?preventDefault(e):isTargetElementTotallyScrolled(t)&&r<0?preventDefault(e):(e.stopPropagation(),!0))},disableBodyScroll=function(e,t){if(isIosDevice){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");e&&!locks.some(function(t){return t.targetElement===e})&&(locks=locks.concat([{targetElement:e,options:t||{}}]),e.ontouchstart=function(e){1===e.targetTouches.length&&(initialClientY=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&handleScroll(t,e)},documentListenerAdded||(document.addEventListener("touchmove",preventDefault,hasPassiveEvents?{passive:!1}:void 0),documentListenerAdded=!0))}else setOverflowHidden(t),locks=locks.concat([{targetElement:e,options:t||{}}])},clearAllBodyScrollLocks=function(){isIosDevice?(locks.forEach(function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null}),documentListenerAdded&&(document.removeEventListener("touchmove",preventDefault,hasPassiveEvents?{passive:!1}:void 0),documentListenerAdded=!1),locks=[],initialClientY=-1):(restoreOverflowSetting(),locks=[])},enableBodyScroll=function(e){if(isIosDevice){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,locks=locks.filter(function(t){return t.targetElement!==e}),documentListenerAdded&&0===locks.length&&(document.removeEventListener("touchmove",preventDefault,hasPassiveEvents?{passive:!1}:void 0),documentListenerAdded=!1)}else 1===locks.length&&locks[0].targetElement===e?(restoreOverflowSetting(),locks=[]):locks=locks.filter(function(t){return t.targetElement!==e})},mix$1=calc.getValueFromProgress,BottomSheet=function(){function e(){var e=this;this.subscriptions=[],this.dragging=!1,this.progress=0,this.arrow=!1,this.initialPosition="bottom",this.onValueChange=function(t){e.progress=1-t/e.boundaryHeight,e._screen.progress=e.progress},this.boundaryHeight=0,this.setBoundariesHeight=function(){e.boundaryHeight=e.containerEl.getBoundingClientRect().height-e.sheetEl.getBoundingClientRect().height}}return e.prototype.draggingChanged=function(){(this.dragging?disableBodyScroll:enableBodyScroll)(this.containerEl)},e.prototype.animateSheet=function(e,t){return tslib_1.__awaiter(this,void 0,void 0,function(){var r,n,o=this;return tslib_1.__generator(this,function(i){return(n=(r=this.sheetY).get())===e?[2,Promise.resolve()]:[2,new Promise(function(i){var a=Object.assign({from:n,to:e},t),s=o.sheetY.subscribe(function(e){if(e===a.to)return i(),void s.unsubscribe()});tween(a).start(r)})]})})},e.prototype.open=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(e){return[2,this.animateSheet(0,{ease:cubicBezier(.23,1,.32,1)})]})})},e.prototype.close=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){return tslib_1.__generator(this,function(e){return[2,this.animateSheet(this.boundaryHeight,{ease:cubicBezier(.23,1,.32,1)})]})})},e.prototype.componentWillLoad=function(){return tslib_1.__awaiter(this,void 0,void 0,function(){var e;return tslib_1.__generator(this,function(t){switch(t.label){case 0:return e=this,[4,this.screen.componentOnReady()];case 1:return e._screen=t.sent(),[2]}})})},e.prototype.componentDidLoad=function(){var e=this;this._screen.connectedBottomSheet=this.element,this.setBoundariesHeight(),this.sheetStyler=index(this.sheetEl),this.sheetY=value("bottom"===this.initialPosition?this.boundaryHeight:0,function(t){return e.sheetStyler.set("y",t)}),this.subscriptions=this.subscriptions.concat([this.sheetY.subscribe(this.onValueChange)]),listen(this.sheetEl,"mousedown touchstart").start(function(){e.dragging=!0;var t=e.boundaryHeight;e.pointer=index$1$1({y:e.sheetY.get()}).pipe(function(e){return e.y},function(e){return e<0?mix$1(0,e,.2):e>t?mix$1(t,e,.2):e}),e.pointer.start(e.sheetY)}),listen(document,"mouseup touchend").start(function(){e.dragging=!1,e.intertia=index$1({min:0,max:e.boundaryHeight,from:e.sheetY.get(),velocity:e.sheetY.getVelocity(),power:.2,bounceStiffness:400,bounceDamping:22.5}),e.intertia.start(e.sheetY)})},e.prototype.componentDidUnload=function(){for(var e=0,t=this.subscriptions;e<t.length;e++)t[e].unsubscribe();this.subscriptions=void 0,clearAllBodyScrollLocks()},e.prototype.resizeHandler=function(){console.log("resize"),this.setBoundariesHeight()},e.prototype.hostData=function(){return{class:{"is-dragging":this.dragging,"is-closed":this.progress<=.09,"is-open":this.progress>=.99},style:{"--progress":""+this.progress}}},e.prototype.render=function(){var e=this;return h("div",{class:"container",ref:function(t){return e.containerEl=t}},h("div",{class:"sheet",ref:function(t){return e.sheetEl=t}},h("div",{class:"sheet-header"},this.arrow&&h("bottom-sheet-indicator",null),h("slot",{name:"sheet-header"})),h("div",{class:"sheet-content"},h("slot",null))))},Object.defineProperty(e,"is",{get:function(){return"bottom-sheet"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{arrow:{type:Boolean,attr:"arrow"},close:{method:!0},dragging:{state:!0,watchCallbacks:["draggingChanged"]},element:{elementRef:!0},initialPosition:{type:String,attr:"initial-position"},open:{method:!0},progress:{state:!0},screen:{connect:"bottom-sheet-screen"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"listeners",{get:function(){return[{name:"window:resize",method:"resizeHandler",passive:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return"*{-webkit-box-sizing:border-box;box-sizing:border-box}:host{--snap-top-offset:15vh;--snap-bottom-height:64px;--sheet-max-width:none;--sheet-box-shadow:0 -2px 4px 0 rgba(0,0,0,0.03),0 -6px 12px 0 rgba(0,0,0,0.03);--sheet-box-shadow-closed:var(--sheet-box-shadow);--sheet-box-shadow-open:var(--sheet-box-shadow);--sheet-background-color:#fff;--sheet-border-radius:8px;--sheet-content-padding:12px;--sheet-content-padding-top:var(--sheet-content-padding);--sheet-content-padding-right:var(--sheet-content-padding);--sheet-content-padding-bottom:var(--sheet-content-padding);--sheet-content-padding-left:var(--sheet-content-padding);--sheet-indicator-size:24px;--sheet-indicator-color:rgba(0,0,0,0.54);--sheet-z-index:9;display:block;position:fixed;top:var(--snap-top-offset);right:0;bottom:calc(-100vh + calc(var(--snap-top-offset) - var(--snap-bottom-height)));left:0;pointer-events:none;z-index:var(--sheet-z-index)}.container{height:100%;margin:0 auto;max-width:var(--sheet-max-width)}.sheet{pointer-events:all;display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--sheet-background-color);height:calc(calc(100vh + calc(var(--snap-bottom-height) * 2)) - var(--snap-top-offset));padding-bottom:var(--snap-bottom-height);overflow:hidden;border-top-left-radius:var(--sheet-border-radius);border-top-right-radius:var(--sheet-border-radius);-webkit-box-shadow:var(--sheet-box-shadow);box-shadow:var(--sheet-box-shadow)}:host(.is-closed) .sheet{-webkit-box-shadow:var(--sheet-box-shadow-closed);box-shadow:var(--sheet-box-shadow-closed)}:host(.is-open) .sheet{-webkit-box-shadow:var(--sheet-box-shadow-open);box-shadow:var(--sheet-box-shadow-open)}.sheet-header{padding:var(--sheet-content-padding-top) var(--sheet-content-padding-right) 0 var(--sheet-content-padding-left)}.sheet-content{-ms-flex-positive:1;flex-grow:1;margin-bottom:var(--snap-bottom-height);padding:0 var(--sheet-content-padding-right) var(--sheet-content-padding-bottom) var(--sheet-content-padding-left)}h1{margin:0}"},enumerable:!0,configurable:!0}),e}(),BottomSheetIndicator=function(){function e(){}return e.prototype.render=function(){return h("div",null,h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},h("path",{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"})))},Object.defineProperty(e,"is",{get:function(){return"bottom-sheet-indicator"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return":host{display:block}div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:0 auto var(--sheet-content-padding-bottom) auto;-webkit-transform:rotate(calc(var(--progress) * -180deg));transform:rotate(calc(var(--progress) * -180deg));color:var(--sheet-indicator-color)}div,svg{width:var(--sheet-indicator-size);height:var(--sheet-indicator-size)}svg{fill:currentColor}"},enumerable:!0,configurable:!0}),e}(),BottomSheetScreen=function(){function e(){this.enabled=!1,this.progress=0}return e.prototype.connectedBottomSheetChanged=function(){console.log("connectedBottomSheet changed to ",this.connectedBottomSheet)},e.prototype.componentDidLoad=function(){this.connectedBottomSheetChanged()},e.prototype.progressChanged=function(){this.enabled=this.progress>0,console.log(this.enabled,this.progress)},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.clickHandler=function(){this.connectedBottomSheet.close()},e.prototype.hostData=function(){return{style:{pointerEvents:this.enabled?"all":"none",opacity:""+this.progress}}},Object.defineProperty(e,"is",{g