UNPKG

bottom-sheet

Version:

Bottom Sheet implemented as a Vanilla Web Component

1 lines 38.4 kB
const t=window.BottomSheet.h;var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]])}return n}var i,u=function(){return(u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},s=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},a=function(t){return function(e){return"string"==typeof e&&0===e.indexOf(t)}},c=function(t){return t%1?Number(t.toFixed(5)):t},f={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},p=u({},f,{transform:s(0,1)}),l=u({},f,{default:1}),d=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},h=d("deg"),v=d("%"),g=d("px"),m=d("vh"),y=d("vw"),b=s(0,255),w=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,O=function(t){return void 0!==t.red},x=function(t){return void 0!==t.hue},C=function(t){var e=t.length;return function(n){if("string"!=typeof n)return n;for(var r,o={},i=function(t){return"string"==typeof t?t.split(/,\s*/):[t]}((r=n).substring(r.indexOf("(")+1,r.lastIndexOf(")"))),u=0;u<e;u++)o[t[u]]=void 0!==i[u]?parseFloat(i[u]):1;return o}},M=u({},f,{transform:function(t){return Math.round(b(t))}}),P=a("rgb"),S={test:function(t){return"string"==typeof t?P(t):O(t)},parse:C(["red","green","blue","alpha"]),transform:function(t){var e=t.green,n=t.blue,r=t.alpha;return function(t){var e=t.alpha;return"rgba("+t.red+", "+t.green+", "+t.blue+", "+(void 0===e?1:e)+")"}({red:M.transform(t.red),green:M.transform(e),blue:M.transform(n),alpha:c(r)})}},k=a("hsl"),E={test:function(t){return"string"==typeof t?k(t):x(t)},parse:C(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.saturation,n=t.lightness,r=t.alpha;return function(t){var e=t.alpha;return"hsla("+t.hue+", "+t.saturation+", "+t.lightness+", "+(void 0===e?1:e)+")"}({hue:Math.round(t.hue),saturation:v.transform(c(e)),lightness:v.transform(c(n)),alpha:c(r)})}},R=u({},S,{test:a("#"),parse:function(t){var e="",n="",r="";return t.length>4?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),e+=e,n+=n,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),L={test:function(t){return"string"==typeof t&&w.test(t)||S.test(t)||E.test(t)||R.test(t)},parse:function(t){return S.test(t)?S.parse(t):E.test(t)?E.parse(t):R.test(t)?R.parse(t):t},transform:function(t){return O(t)?S.transform(t):x(t)?E.transform(t):t}},Y=/(-)?(\d[\d\.]*)/g,T=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,A=function(t){var e=t,n=[],r=e.match(T);r&&(e=e.replace(T,"${c}"),n.push.apply(n,r.map(L.parse)));var o=e.match(Y);return o&&n.push.apply(n,o.map(f.parse)),n},B=function(t){var e=t,n=0,r=t.match(T),o=r?r.length:0;if(r)for(var i=0;i<o;i++)e=e.replace(r[i],"${c}"),n++;var u=e.match(Y),s=u?u.length:0;if(u)for(i=0;i<s;i++)e=e.replace(u[i],"${n}"),n++;return function(t){for(var r=e,i=0;i<n;i++)r=r.replace(i<o?"${c}":"${n}",i<o?L.transform(t[i]):c(t[i]));return r}},V=0,j="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),n=Math.max(0,16.7-(e-V));V=e+n,setTimeout(function(){return t(V)},n)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(i||(i={}));var D=1/60*1e3,X=!0,H=!1,F=!1,z={delta:0,timestamp:0},W=[i.Read,i.Update,i.Render,i.PostRender],$=function(t){return H=t},_=W.reduce(function(t,e){var n,r,o,i,u,s,a,c,f,p=(n=$,r=[],o=[],i=0,u=!1,s=0,a=new WeakSet,c=new WeakSet,f={cancel:function(t){var e=o.indexOf(t);a.add(t),-1!==e&&o.splice(e,1)},process:function(t){var e,p;if(u=!0,r=(e=[o,r])[0],(o=e[1]).length=0,i=r.length)for(s=0;s<i;s++)(p=r[s])(t),!0!==c.has(p)||a.has(p)||(f.schedule(p),n(!0));u=!1},schedule:function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var s=n&&u,f=s?r:o;a.delete(t),e&&c.add(t),-1===f.indexOf(t)&&(f.push(t),s&&(i=r.length))}});return t.sync[e]=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=!1),H||G(),p.schedule(t,e,n),t},t.cancelSync[e]=function(t){return p.cancel(t)},t.steps[e]=p,t},{steps:{},sync:{},cancelSync:{}}),q=_.steps,U=_.sync,I=_.cancelSync,Z=function(t){return q[t].process(z)},N=function(t){H=!1,z.delta=X?D:Math.max(Math.min(t-z.timestamp,40),1),X||(D=z.delta),z.timestamp=t,F=!0,W.forEach(Z),F=!1,H&&(X=!1,j(N))},G=function(){H=!0,X=!0,F||j(N)},K=function(t){return t},J=function(t){return function(e){return 1-t(1-e)}}(function(t){return function(t){return Math.pow(t,2)}}()),Q=8,tt=.001,et=1e-7,nt=10,rt=11,ot=1/(rt-1),it="undefined"!=typeof Float32Array,ut=function(t,e){return 1-3*e+3*t},st=function(t,e){return 3*e-6*t},at=function(t){return 3*t},ct=function(t,e,n){return 3*ut(e,n)*t*t+2*st(e,n)*t+at(e)},ft=function(t,e,n){return((ut(e,n)*t+st(e,n))*t+at(e))*t};function pt(t,e,n,r){var o=it?new Float32Array(rt):new Array(rt);return function(){for(var e=0;e<rt;++e)o[e]=ft(e*ot,t,n)}(),function(i){return t===e&&n===r?i:0===i?0:1===i?1:ft(function(e){for(var r,i,u=0,s=1,a=rt-1;s!==a&&o[s]<=e;++s)u+=ot;return(i=ct(r=u+(e-o[--s])/(o[s+1]-o[s])*ot,t,n))>=tt?function(e,r){for(var o=0,i=0;o<Q;++o){if(0===(i=ct(r,t,n)))return r;r-=(ft(r,t,n)-e)/i}return r}(e,r):0===i?r:function(e,r,o){var i,u,s=0;do{(i=ft(u=r+(o-r)/2,t,n)-e)>0?o=u:r=u}while(Math.abs(i)>et&&++s<nt);return u}(e,u,u+ot)}(i),e,r)}}var lt,dt={x:0,y:0,z:0},ht=function(t){return"number"==typeof t},vt=function(t){return 180*t/Math.PI},gt=function(t,e){return void 0===e&&(e=dt),vt(Math.atan2(e.y-t.y,e.x-t.x))},mt=function(t,e){var n=!0;return void 0===e&&(e=t,n=!1),function(r){return n?r-t+e:(t=r,n=!0,e)}},yt=function(t){return function(e,n,r){return void 0!==r?t(e,n,r):function(r){return t(e,n,r)}}},bt=yt(function(t,e,n){return Math.min(Math.max(n,t),e)}),wt=function(t){return t*Math.PI/180},Ot=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},xt=function(t){return Ot(t)&&t.hasOwnProperty("z")},Ct=function(t,e){return Math.abs(t-e)},Mt=function(t,e){if(void 0===e&&(e=dt),ht(t)&&ht(e))return Ct(t,e);if(Ot(t)&&Ot(e)){var n=Ct(t.x,e.x),r=Ct(t.y,e.y),o=xt(t)&&xt(e)?Ct(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(o,2))}return 0},Pt=function(t,e,n){var r=e-t;return 0===r?1:(n-t)/r},St=function(t,e,n){return-n*t+n*e+t},kt=function(){return(kt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Et=function(t,e,n){var r=t*t;return Math.sqrt(n*(e*e-r)+r)},Rt=[R,S,E],Lt=function(t){return Rt.find(function(e){return e.test(t)})},Yt=function(t,e){var n=Lt(t),r=Lt(e),o=n.parse(t),i=r.parse(e),u=kt({},o),s=n===E?St:Et;return function(t){for(var e in u)"alpha"!==e&&(u[e]=s(o[e],i[e],t));return u.alpha=St(o.alpha,i.alpha,t),n.transform(u)}},Tt=function(t,e){return function(n){return e(t(n))}},At=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Tt)},Bt=function(t,e){var n=t.slice(),r=n.length,o=t.map(function(t,n){var r=e[n];return ht(t)?function(e){return St(t,r,e)}:L.test(t)?Yt(t,r):Vt(t,r)});return function(t){for(var e=0;e<r;e++)n[e]=o[e](t);return n}},Vt=function(t,e){var n=B(t);return n(t),B(e)(t),At(Bt(A(t),A(e)),n)},jt=(yt(St),function(t,e,n,r){return void 0===r&&(r=0),o=t+n*(e-t)/Math.max(r,n),void 0===i&&(i=2),i=Math.pow(10,i),Math.round(o*i)/i;var o,i}),Dt=function(t){return t},Xt=function(t){return void 0===t&&(t=Dt),yt(function(e,n,r){var o=n-r,i=-(0-e+1)*(0-t(Math.abs(o)));return o<=0?n+i:n-i})},Ht=(Xt(),Xt(Math.sqrt),function(t,e){return e?t*(1e3/e):0}),Ft=(yt(function(t,e,n){var r=e-t;return((n-t)%r+r)%r+t}),bt(0,1),function(){return(Ft=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),zt=function(t){var e=t.onRead,n=t.onRender,r=t.uncachedValues,o=void 0===r?new Set:r,i=t.useCache,u=void 0===i||i;return function(t){var r={},i=[],s=!1,a=function(t,e){var n=r[t];r[t]=e,r[t]!==n&&(-1===i.indexOf(t)&&i.push(t),s||(s=!0,U.render(c)))};function c(e){return void 0===e&&(e=!1),(!0===e||s)&&(n(r,t,i),s=!1,i.length=0),this}return{get:function(n){return n?u&&!o.has(n)&&void 0!==r[n]?r[n]:e(n,t):r},set:function(t,e){if("string"==typeof t){if(void 0===e)return function(e){return a(t,e)};a(t,e)}else for(var n in t)t.hasOwnProperty(n)&&a(n,t[n]);return this},render:c}}},Wt=/([a-z])([A-Z])/g,$t=function(t){return t.replace(Wt,"$1-$2").toLowerCase()},_t=new Map,qt=new Map,Ut=["Webkit","Moz","O","ms",""],It=Ut.length,Zt="undefined"!=typeof document,Nt=function(t,e){return qt.set(t,$t(e))},Gt=function(t,e){void 0===e&&(e=!1);var n=e?qt:_t;return n.has(t)||(Zt?function(t){lt=lt||document.createElement("div");for(var e=0;e<It;e++){var n=Ut[e],r=""===n,o=r?t:n+t.charAt(0).toUpperCase()+t.slice(1);(o in lt.style||r)&&(_t.set(t,o),Nt(t,(r?"":"-")+$t(o)))}}(t):function(t){Nt(t,t)}(t)),n.get(t)||t},Kt=["","X","Y","Z"],Jt=["scale","rotate","skew","transformPerspective"].reduce(function(t,e){return Kt.reduce(function(t,n){return t.push(e+n),t},t)},["x","y","z"]),Qt=Jt.reduce(function(t,e){return t[e]=!0,t},{}),te=function(t){return!0===Qt[t]},ee=function(t,e){return Jt.indexOf(t)-Jt.indexOf(e)},ne=function(t){return"originX"===t||"originY"===t},re={color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,borderWidth:g,borderTopWidth:g,borderRightWidth:g,borderBottomWidth:g,borderLeftWidth:g,borderRadius:g,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomRightRadius:g,borderBottomLeftRadius:g,width:g,maxWidth:g,height:g,maxHeight:g,top:g,right:g,bottom:g,left:g,padding:g,paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g,margin:g,marginTop:g,marginRight:g,marginBottom:g,marginLeft:g,rotate:h,rotateX:h,rotateY:h,rotateZ:h,scale:l,scaleX:l,scaleY:l,scaleZ:l,skew:h,skewX:h,skewY:h,distance:g,x:g,y:g,z:g,perspective:g,opacity:p,originX:v,originY:v,originZ:g},oe=function(t){return re[t]},ie=new Set(["scrollLeft","scrollTop"]),ue=new Set(["scrollLeft","scrollTop","transform"]),se={x:"translateX",y:"translateY",z:"translateZ"},ae=function(t){return"function"==typeof t},ce=function(t){void 0===t&&(t=!0);var e={},n={},r={},o=[];return function(i){return o.length=0,function(t,e,n,r,o,i,u){void 0===e&&(e=!0),void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===u&&(u=!1);var s=!0,a=!1,c=!1;for(var f in t){var p=t[f],l=oe(f),d="number"==typeof p&&l?l.transform(p):p;te(f)?(a=!0,r[f]=d,i.push(f),s&&(l.default&&p!==l.default||!l.default&&0!==p)&&(s=!1)):ne(f)?(o[f]=d,c=!0):ue.has(f)&&ae(d)||(n[Gt(f,u)]=d)}if(s)a&&(n.transform="none");else{var h="";if(ae(t.transform))h=t.transform(r);else{var v=!1;i.sort(ee);for(var g=i.length,m=0;m<g;m++)h+=(se[f=i[m]]||f)+"("+r[f]+") ",v="z"===f||v;!v&&e?h+="translateZ(0)":h=h.trim()}n.transform=h}c&&(n.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0))}(i,t,e,n,r,o,!0),e}},fe=zt({onRead:function(t,e){var n=e.element,r=e.preparseOutput,o=oe(t);if(te(t))return o&&o.default||0;if(ie.has(t))return n[t];var i=window.getComputedStyle(n,null).getPropertyValue(Gt(t,!0))||0;return r&&o&&o.parse?o.parse(i):i},onRender:function(t,e,n){var r=e.element;Object.assign(r.style,(0,e.buildStyles)(t)),-1!==n.indexOf("scrollLeft")&&(r.scrollLeft=t.scrollLeft),-1!==n.indexOf("scrollTop")&&(r.scrollTop=t.scrollTop)},uncachedValues:ie}),pe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),le=function(t,e){return t/100*e+"px"},de=Ft({},f,{transform:Math.round}),he={fill:L,stroke:L,scale:l,scaleX:l,scaleY:l,opacity:p,fillOpacity:p,strokeOpacity:p,numOctaves:de},ve=zt({onRead:function(t,e){var n=e.element;if(te(t)){var r=function(t){return he[t]}(t);return r?r.default:0}return n.getAttribute(t)},onRender:function(t,e){!function(t,e){for(var n in e)e.hasOwnProperty(n)&&t.setAttribute(n,e[n])}(e.element,function(t,e,n,r){var o=!1,i=!1,u={},s=n?{pathLength:"0",pathSpacing:""+r}:void 0,a=void 0!==t.scale?t.scale||1e-7:t.scaleX||1,c=void 0!==t.scaleY?t.scaleY||1e-7:a||1,f=e.width*((t.originX||50)/100)+e.x,p=e.height*((t.originY||50)/100)+e.y,l={translate:"translate("+t.x+", "+t.y+") ",scale:"translate("+1*a*-f+", "+1*c*-p+") scale("+a+", "+c+") translate("+f/a+", "+p/c+") ",rotate:"rotate("+t.rotate+", "+f+", "+p+") ",skewX:"skewX("+t.skewX+") ",skewY:"skewY("+t.skewY+") "};for(var d in t)if(t.hasOwnProperty(d)){var h=t[d];te(d)?o=!0:!n||"pathLength"!==d&&"pathSpacing"!==d||"number"!=typeof h?n&&"pathOffset"===d?u["stroke-dashoffset"]=le(-h,r):u[pe.has(d)?d:$t(d)]=h:(i=!0,s[d]=le(h,r))}if(i&&(u["stroke-dasharray"]=s.pathLength+" "+s.pathSpacing),o)for(var d in u.transform="",l)l.hasOwnProperty(d)&&(u.transform+=l[d].replace(/undefined/g,"scale"===d?"1":"0"));return u}(t,e.dimensions,e.isPath,e.pathLength))}}),ge=zt({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,n=t.scrollLeft;return window.scrollTo(void 0===n?0:n,void 0===e?0:e)}}),me=new WeakMap,ye=function(t,e){var n;return t instanceof HTMLElement?n=function(t,e){void 0===e&&(e={});var n=e.enableHardwareAcceleration,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]])}return n}(e,["enableHardwareAcceleration"]);return fe(Ft({element:t,buildStyles:ce(n),preparseOutput:!0},r))}(t,e):t instanceof SVGElement?n=function(t){var e=function(t){try{return function(t){return"function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}(t)}catch(t){return{x:0,y:0,width:0,height:0}}}(t),n={element:t,dimensions:e,isPath:!1};return"path"===t.tagName&&(n.isPath=!0,n.pathLength=t.getTotalLength()),ve(n)}(t):t===window&&(n=ge(t)),me.set(t,n),n},be=function(t,e){return me.has(t)?me.get(t):ye(t,e)},we=function(){function t(t){void 0===t&&(t={}),this.props=t}return t.prototype.applyMiddleware=function(t){return this.create(r({},this.props,{middleware:this.props.middleware?[t].concat(this.props.middleware):[t]}))},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=1===t.length?t[0]:At.apply(void 0,t);return this.applyMiddleware(function(t){return function(e){return t(n(e))}})},t.prototype.while=function(t){return this.applyMiddleware(function(e,n){return function(r){return t(r)?e(r):n()}})},t.prototype.filter=function(t){return this.applyMiddleware(function(e){return function(n){return t(n)&&e(n)}})},t}(),Oe=function(){return function(t,e){var n=t.middleware,r=t.onComplete,o=this;this.isActive=!0,this.update=function(t){o.observer.update&&o.updateObserver(t)},this.complete=function(){o.observer.complete&&o.isActive&&o.observer.complete(),o.onComplete&&o.onComplete(),o.isActive=!1},this.error=function(t){o.observer.error&&o.isActive&&o.observer.error(t),o.isActive=!1},this.observer=e,this.updateObserver=function(t){return e.update(t)},this.onComplete=r,e.update&&n&&n.length&&n.forEach(function(t){return o.updateObserver=t(o.updateObserver,o.complete)})}}(),xe=function(t,e,n){return new Oe({middleware:e.middleware,onComplete:n},"function"==typeof t?{update:t}:t)},Ce=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.start=function(t){void 0===t&&(t={});var e=!1,n={stop:function(){}},i=this.props,u=i.init,s=o(i,["init"]),a=u(xe(t,s,function(){e=!0,n.stop()}));return n=a?r({},n,a):n,t.registerParent&&t.registerParent(n),e&&n.stop(),n},e}(we),Me=function(t){return new Ce({init:t})},Pe=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.subscribers=[],e}return n(e,t),e.prototype.complete=function(){this.subscribers.forEach(function(t){return t.complete()})},e.prototype.error=function(t){this.subscribers.forEach(function(e){return e.error(t)})},e.prototype.update=function(t){for(var e=0;e<this.subscribers.length;e++)this.subscribers[e].update(t)},e.prototype.subscribe=function(t){var e=this,n=xe(t,this.props);return this.subscribers.push(n),{unsubscribe:function(){var t=e.subscribers.indexOf(n);-1!==t&&e.subscribers.splice(t,1)}}},e.prototype.stop=function(){this.parent&&this.parent.stop()},e.prototype.registerParent=function(t){this.stop(),this.parent=t},e}(we),Se=Object.freeze({angle:gt,degreesToRadians:wt,distance:Mt,isPoint3D:xt,isPoint:Ot,dilate:St,getValueFromProgress:St,pointFromAngleAndDistance:function(t,e,n){return e=wt(e),{x:n*Math.cos(e)+t.x,y:n*Math.sin(e)+t.y}},getProgressFromValue:Pt,radiansToDegrees:vt,smooth:jt,speedPerFrame:function(t,e){return ht(t)?t/(1e3/e):0},speedPerSecond:Ht,stepProgress:function(t,e){var n=1/(t-1),r=1/(2*(t-1)),o=Math.min(e,1);return Math.floor((o/r+1)/2)*n}}),ke=function(t){return Array.isArray(t)},Ee=function(t){var e=typeof t;return"string"===e||"number"===e},Re=function(t){function e(e){var n=t.call(this,e)||this;return n.scheduleVelocityCheck=function(){return U.postRender(n.velocityCheck)},n.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current)},n.prev=n.current=e.value||0,Ee(n.current)?(n.updateCurrent=function(t){return n.current=t},n.getVelocityOfCurrent=function(){return n.getSingleVelocity(n.current,n.prev)}):ke(n.current)?(n.updateCurrent=function(t){return n.current=t.slice()},n.getVelocityOfCurrent=function(){return n.getListVelocity()}):(n.updateCurrent=function(t){for(var e in n.current={},t)t.hasOwnProperty(e)&&(n.current[e]=t[e])},n.getVelocityOfCurrent=function(){return n.getMapVelocity()}),e.initialSubscription&&n.subscribe(e.initialSubscription),n}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.get=function(){return this.current},e.prototype.getVelocity=function(){return this.getVelocityOfCurrent()},e.prototype.update=function(e){t.prototype.update.call(this,e),this.prev=this.current,this.updateCurrent(e);var n=z.timestamp;this.timeDelta=z.delta,this.lastUpdated=n,U.postRender(this.scheduleVelocityCheck)},e.prototype.subscribe=function(e){var n=t.prototype.subscribe.call(this,e);return this.subscribers[this.subscribers.length-1].update(this.current),n},e.prototype.getSingleVelocity=function(t,e){return"number"==typeof t&&"number"==typeof e?Ht(t-e,this.timeDelta):Ht(parseFloat(t)-parseFloat(e),this.timeDelta)||0},e.prototype.getListVelocity=function(){var t=this;return this.current.map(function(e,n){return t.getSingleVelocity(e,t.prev[n])})},e.prototype.getMapVelocity=function(){var t={};for(var e in this.current)this.current.hasOwnProperty(e)&&(t[e]=this.getSingleVelocity(this.current[e],this.prev[e]));return t},e}(Pe),Le=function(t,e){return new Re({value:t,initialSubscription:e})},Ye=function(t){var e=t.getCount,n=t.getFirst,r=t.getOutput,o=t.mapApi,i=t.setProp,u=t.startActions;return function(t){return Me(function(s){var a=s.update,c=s.complete,f=s.error,p=e(t),l=r(),d=function(){return a(l)},h=0,v=u(t,function(t,e){var n=!1;return t.start({complete:function(){n||(n=!0,++h===p&&U.update(c))},error:f,update:function(t){i(l,e,t),U.update(d,!1,!0)}})});return Object.keys(n(v)).reduce(function(t,e){return t[e]=o(v,e),t},{})})}},Te=Ye({getOutput:function(){return{}},getCount:function(t){return Object.keys(t).length},getFirst:function(t){return t[Object.keys(t)[0]]},mapApi:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Object.keys(t).reduce(function(r,o){var i;return t[o][e]&&(r[o]=n[0]&&void 0!==n[0][o]?t[o][e](n[0][o]):(i=t[o])[e].apply(i,n)),r},{})}},setProp:function(t,e,n){return t[e]=n},startActions:function(t,e){return Object.keys(t).reduce(function(n,r){return n[r]=e(t[r],r),n},{})}}),Ae=Ye({getOutput:function(){return[]},getCount:function(t){return t.length},getFirst:function(t){return t[0]},mapApi:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.map(function(t,r){if(t[e])return Array.isArray(n[0])?t[e](n[0][r]):t[e].apply(t,n)})}},setProp:function(t,e,n){return t[e]=n},startActions:function(t,e){return t.map(function(t,n){return e(t,n)})}}),Be=[g,v,h,m,y],Ve=function(t){return Be.find(function(e){return e.test(t)})},je=function(t,e){return t(e)},De=function(t,e,n){var o=e[n[0]].map(function(o,i){var u=n.reduce(function(t){return function(e,n){return e[n]=e[n][t],e}}(i),r({},e));return $e(o)(t,u)});return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ae(t)}.apply(void 0,o)},Xe=function(t,e,n){var o=n[0],i=Object.keys(e[o]).reduce(function(i,u){var s=n.reduce(function(t){return function(e,n){return e[n]=e[n][t],e}}(u),r({},e));return i[u]=$e(e[o][u])(t,s),i},{});return Te(i)},He=function(t,e){var n=e.from,i=e.to,u=o(e,["from","to"]),s=Ve(n)||Ve(i),a=s.transform,c=s.parse;return t(r({},u,{from:"string"==typeof n?c(n):n,to:"string"==typeof i?c(i):i})).pipe(a)},Fe=function(t,e){var n=e.from,i=e.to,u=o(e,["from","to"]);return t(r({},u,{from:0,to:1})).pipe(Yt(n,i),L.transform)},ze=function(t,e){var n=e.from,i=e.to,u=o(e,["from","to"]),s=B(n);return s(n),B(i)(n),t(r({},u,{from:0,to:1})).pipe(Bt(A(n),A(i)),s)},We=function(t,e){var n=function(t){var e=Object.keys(t),n=function(e,n){return void 0!==e&&!t[n](e)};return{getVectorKeys:function(t){return e.reduce(function(e,r){return n(t[r],r)&&e.push(r),e},[])},testVectorProps:function(t){return t&&e.some(function(e){return n(t[e],e)})}}}(e),r=n.testVectorProps,o=n.getVectorKeys;return function(e){if(!r(e))return t(e);var n=o(e);return $e(e[n[0]])(t,e,n)}},$e=function(t){var e=je;return"number"==typeof t?e=je:Array.isArray(t)?e=De:function(t){return Boolean(Ve(t))}(t)?e=He:L.test(t)?e=Fe:function(t){if("string"!=typeof t||!isNaN(t))return!1;var e=0,n=t.match(Y),r=t.match(T);return n&&(e+=n.length),r&&(e+=r.length),e>0}(t)?e=ze:"object"==typeof t&&(e=Xe),e},_e=We(function(t){return void 0===t&&(t={}),Me(function(e){var n=e.complete,r=e.update,o=t.velocity,i=t.from,u=t.power,s=t.timeConstant,a=void 0===s?350:s,c=t.restDelta,f=void 0===c?.5:c,p=t.modifyTarget,l=0,d=(void 0===u?.8:u)*(void 0===o?0:o),h=Math.round((void 0===i?0:i)+d),v=void 0===p?h:p(h),g=U.update(function(t){var e=-d*Math.exp(-(l+=t.delta)/a),o=e>f||e<-f;r(o?v+e:v),o||(I.update(g),n())},!0);return{stop:function(){return I.update(g)}}})},{from:f.test,modifyTarget:function(t){return"function"==typeof t},velocity:f.test}),qe=We(function(t){return void 0===t&&(t={}),Me(function(e){var n=e.update,r=e.complete,o=t.velocity,i=void 0===o?0:o,u=t.from,s=void 0===u?0:u,a=t.to,c=void 0===a?0:a,f=t.stiffness,p=void 0===f?100:f,l=t.damping,d=void 0===l?10:l,h=t.mass,v=void 0===h?1:h,g=t.restSpeed,m=void 0===g?.01:g,y=t.restDelta,b=void 0===y?.01:y,w=i?-i/1e3:0,O=0,x=c-s,C=s,M=C,P=U.update(function(t){var e=t.delta;O+=e;var o=d/(2*Math.sqrt(p*v)),u=Math.sqrt(p/v)/1e3;if(M=C,o<1){var s=Math.exp(-o*u*O),a=u*Math.sqrt(1-o*o);C=c-s*((w+o*u*x)/a*Math.sin(a*O)+x*Math.cos(a*O))}else s=Math.exp(-u*O),C=c-s*(x+(w+u*x)*O);i=Ht(C-M,e);var f=Math.abs(i)<=m,l=Math.abs(c-C)<=b;f&&l?(n(C=c),I.update(P),r()):n(C)},!0);return{stop:function(){return I.update(P)}}})},{from:f.test,to:f.test,stiffness:f.test,damping:f.test,mass:f.test,velocity:f.test}),Ue=We(function(t){var e=t.from,n=void 0===e?0:e,o=t.velocity,i=void 0===o?0:o,u=t.min,s=t.max,a=t.power,c=void 0===a?.8:a,f=t.timeConstant,p=void 0===f?700:f,l=t.bounceStiffness,d=void 0===l?500:l,h=t.bounceDamping,v=void 0===h?10:h,g=t.restDelta,m=void 0===g?1:g,y=t.modifyTarget;return Me(function(t){var e,o=t.update,a=t.complete,f=Le(n),l=!1,h=function(t){return void 0!==u&&t<=u},g=function(t){return void 0!==s&&t>=s},b=function(t){return h(t)||g(t)},w=function(t,e){return h(t)&&e<0||g(t)&&e>0},O=function(t,n){e&&e.stop(),e=t.start({update:function(t){return f.update(t)},complete:function(){a(),n&&n()}})},x=function(t){l=!0,O(qe(r({},t,{to:h(t.from)?u:s,stiffness:d,damping:v,restDelta:m})))};if(f.subscribe(function(t){o(t);var n=f.getVelocity();e&&!l&&w(t,n)&&x({from:t,velocity:n})}),b(n)&&0===i||w(n,i))x({from:n,velocity:i});else{var C=_e({from:n,velocity:i,timeConstant:p,power:c,restDelta:b(n)?20:m,modifyTarget:y});O(C,function(){var t=f.get();b(t)&&x({from:t,velocity:f.getVelocity()})})}return{stop:function(){return e&&e.stop()}}})},{from:f.test,velocity:f.test,min:f.test,max:f.test,damping:f.test,stiffness:f.test,modifyTarget:function(t){return"function"==typeof t}}),Ie=We(function(t){var e=t.from,n=void 0===e?0:e,r=t.to,o=void 0===r?1:r,i=t.ease,u=void 0===i?K:i;return Me(function(t){var e=t.update;return{seek:function(t){return e(t)}}}).pipe(u,function(t){return St(n,o,t)})},{ease:function(t){return"function"==typeof t},from:f.test,to:f.test}),Ze=bt(0,1),Ne=function(t){return void 0===t&&(t={}),Me(function(e){var n,r=e.update,o=e.complete,i=t.duration,u=void 0===i?300:i,s=t.ease,a=void 0===s?J:s,c=t.flip,f=void 0===c?0:c,p=t.loop,l=void 0===p?0:p,d=t.yoyo,h=void 0===d?0:d,v=t.from,g=void 0===v?0:v,m=t.to,y=void 0===m?1:m,b=t.elapsed,w=void 0===b?0:b,O=t.playDirection,x=void 0===O?1:O,C=t.flipCount,M=void 0===C?0:C,P=t.yoyoCount,S=void 0===P?0:P,k=t.loopCount,E=void 0===k?0:k,R=Ie({from:g,to:y,ease:a}).start(r),L=0,Y=!1,T=function(){return x*=-1},A=function(){L=Ze(Pt(0,u,w)),R.seek(L)},B=function(){Y=!0,n=U.update(function(t){w+=t.delta*x,A(),function(){var t,e=1===x?Y&&w>=u:Y&&w<=0;if(!e)return!1;if(e&&!l&&!f&&!h)return!0;var n=!1;return l&&E<l?(w=0,E++,n=!0):f&&M<f?(w=u-w,R=Ie({from:g=(t=[y,g])[0],to:y=t[1],ease:a}).start(r),M++,n=!0):h&&S<h&&(T(),S++,n=!0),!n}()&&o&&(I.update(n),U.update(o,!1,!0))},!0)},V=function(){Y=!1,n&&I.update(n)};return B(),{isActive:function(){return Y},getElapsed:function(){return bt(0,u,w)},getProgress:function(){return L},stop:function(){V()},pause:function(){return V(),this},resume:function(){return Y||B(),this},seek:function(t){return w=St(0,u,t),U.update(A,!1,!0),this},reverse:function(){return T(),this}}})},Ge=function(t,e,n){return Me(function(r){var o=r.update,i=e.split(" ").map(function(e){return t.addEventListener(e,o,n),e});return{stop:function(){return i.forEach(function(e){return t.removeEventListener(e,o,n)})}}})},Ke=function(){return{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}},Je=function(t,e){return void 0===e&&(e={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),e.clientX=e.x=t.clientX,e.clientY=e.y=t.clientY,e.pageX=t.pageX,e.pageY=t.pageY,e},Qe=[Ke()],tn=!1;"undefined"!=typeof document&&Ge(document,"touchstart touchmove",{passive:!0,capture:!0}).start(function(t){var e=t.touches;tn=!0;var n=e.length;Qe.length=0;for(var r=0;r<n;r++)Qe.push(Je(e[r]))});var en=Ke(),nn=!1;"undefined"!=typeof document&&Ge(document,"mousedown mousemove",!0).start(function(t){nn=!0,Je(t,en)});var rn=function(t){return t[0]},on=function(t){return void 0===t&&(t={}),tn?(e=t,n=void 0===e?{}:e,r=n.preventDefault,o=void 0===r||r,i=n.scale,u=void 0===i?1:i,s=n.rotate,a=void 0===s?0:s,Me(function(t){var e=t.update,n={touches:Qe,scale:u,rotate:a},r=0,i=0,s=Qe.length>1;if(s){var c=Qe[0],f=Qe[1];r=Mt(c,f),i=gt(c,f)}var p=function(){if(s){var t=Qe[0],o=Qe[1],c=Mt(t,o),f=gt(t,o);n.scale=u*(c/r),n.rotate=a+(f-i)}e(n)},l=Ge(document,"touchmove",{passive:!o}).start(function(t){(o||t.touches.length>1)&&t.preventDefault(),U.update(p)});return tn&&U.update(p),{stop:function(){I.update(p),l.stop()}}})).pipe(function(t){return t.touches},rn):function(e){var n=(void 0===t?{}:t).preventDefault,r=void 0===n||n;return Me(function(t){var e=t.update,n=function(){return e(en)},o=Ge(document,"mousemove").start(function(t){r&&t.preventDefault(),U.update(n)});return nn&&U.update(n),{stop:function(){I.update(n),o.stop()}}})}();var e,n,r,o,i,u,s,a},un=function(t){void 0===t&&(t={});var e=t.x,n=t.y,r=o(t,["x","y"]);if(void 0!==e||void 0!==n){var i=mt(e||0),u=mt(n||0),s={x:0,y:0};return on(r).pipe(function(t){return s.x=i(t.x),s.y=u(t.y),s})}return on(r)};let sn=!1;if("undefined"!=typeof window){const t={get passive(){sn=!0}};window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}const an="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&/iP(ad|hone|od)/.test(window.navigator.platform);let cn,fn,pn=[],ln=!1,dn=-1;const hn=t=>pn.some(e=>!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))),vn=t=>{const e=t||window.event;return!!hn(e.target)||e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1)},gn=()=>{setTimeout(()=>{void 0!==fn&&(document.body.style.paddingRight=fn,fn=void 0),void 0!==cn&&(document.body.style.overflow=cn,cn=void 0)})},mn=(t,e)=>{if(an){if(!t)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(t&&!pn.some(e=>e.targetElement===t)){const n={targetElement:t,options:e||{}};pn=[...pn,n],t.ontouchstart=(t=>{1===t.targetTouches.length&&(dn=t.targetTouches[0].clientY)}),t.ontouchmove=(e=>{1===e.targetTouches.length&&((t,e)=>{const n=t.targetTouches[0].clientY-dn;!hn(t.target)&&(e&&0===e.scrollTop&&n>0?vn(t):(t=>!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight)(e)&&n<0?vn(t):t.stopPropagation())})(e,t)}),ln||(document.addEventListener("touchmove",vn,sn?{passive:!1}:void 0),ln=!0)}}else{(t=>{setTimeout(()=>{if(void 0===fn){const e=window.innerWidth-document.documentElement.clientWidth;t&&!0===t.reserveScrollBarGap&&e>0&&(fn=document.body.style.paddingRight,document.body.style.paddingRight=`${e}px`)}void 0===cn&&(cn=document.body.style.overflow,document.body.style.overflow="hidden")})})(e);const n={targetElement:t,options:e||{}};pn=[...pn,n]}},yn=()=>{an?(pn.forEach(t=>{t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null}),ln&&(document.removeEventListener("touchmove",vn,sn?{passive:!1}:void 0),ln=!1),pn=[],dn=-1):(gn(),pn=[])},bn=t=>{if(an){if(!t)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");t.ontouchstart=null,t.ontouchmove=null,pn=pn.filter(e=>e.targetElement!==t),ln&&0===pn.length&&(document.removeEventListener("touchmove",vn,sn?{passive:!1}:void 0),ln=!1)}else 1===pn.length&&pn[0].targetElement===t?(gn(),pn=[]):pn=pn.filter(e=>e.targetElement!==t)},wn=Se.getValueFromProgress;class On{constructor(){this.subscriptions=[],this.dragging=!1,this.progress=0,this.arrow=!1,this.initialPosition="bottom",this.onValueChange=(t=>{this.progress=1-t/this.boundaryHeight,this._screen.progress=this.progress}),this.boundaryHeight=0,this.setBoundariesHeight=(()=>{this.boundaryHeight=this.containerEl.getBoundingClientRect().height-this.sheetEl.getBoundingClientRect().height})}draggingChanged(){(this.dragging?mn:bn)(this.containerEl)}async animateSheet(t,e){const n=this.sheetY,r=n.get();return r===t?Promise.resolve():new Promise(o=>{const i=Object.assign({from:r,to:t},e),u=this.sheetY.subscribe(t=>{if(t===i.to)return o(),void u.unsubscribe()});Ne(i).start(n)})}async open(){return this.animateSheet(0,{ease:pt(.23,1,.32,1)})}async close(){return this.animateSheet(this.boundaryHeight,{ease:pt(.23,1,.32,1)})}async componentWillLoad(){this._screen=await this.screen.componentOnReady()}componentDidLoad(){var t,e;this._screen.connectedBottomSheet=this.element,this.setBoundariesHeight(),this.sheetStyler=(e="string"==typeof(t=this.sheetEl)?document.querySelector(t):t,be(e,void 0)),this.sheetY=Le("bottom"===this.initialPosition?this.boundaryHeight:0,t=>this.sheetStyler.set("y",t)),this.subscriptions=[...this.subscriptions,this.sheetY.subscribe(this.onValueChange)],Ge(this.sheetEl,"mousedown touchstart").start(()=>{this.dragging=!0;const t=this.boundaryHeight;this.pointer=un({y:this.sheetY.get()}).pipe(({y:t})=>t,e=>e<0?wn(0,e,.2):e>t?wn(t,e,.2):e),this.pointer.start(this.sheetY)}),Ge(document,"mouseup touchend").start(()=>{this.dragging=!1,this.intertia=Ue({min:0,max:this.boundaryHeight,from:this.sheetY.get(),velocity:this.sheetY.getVelocity(),power:.2,bounceStiffness:400,bounceDamping:22.5}),this.intertia.start(this.sheetY)})}componentDidUnload(){for(const t of this.subscriptions)t.unsubscribe();this.subscriptions=void 0,yn()}resizeHandler(){console.log("resize"),this.setBoundariesHeight()}hostData(){return{class:{"is-dragging":this.dragging,"is-closed":this.progress<=.09,"is-open":this.progress>=.99},style:{"--progress":`${this.progress}`}}}render(){return t("div",{class:"container",ref:t=>this.containerEl=t},t("div",{class:"sheet",ref:t=>this.sheetEl=t},t("div",{class:"sheet-header"},this.arrow&&t("bottom-sheet-indicator",null),t("slot",{name:"sheet-header"})),t("div",{class:"sheet-content"},t("slot",null))))}static get is(){return"bottom-sheet"}static get encapsulation(){return"shadow"}static get properties(){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"}}}static get listeners(){return[{name:"window:resize",method:"resizeHandler",passive:!0}]}static get style(){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}"}}class xn{render(){return t("div",null,t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("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"})))}static get is(){return"bottom-sheet-indicator"}static get encapsulation(){return"shadow"}static get style(){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}"}}class Cn{constructor(){this.enabled=!1,this.progress=0}connectedBottomSheetChanged(){const{connectedBottomSheet:t}=this;console.log("connectedBottomSheet changed to ",t)}componentDidLoad(){this.connectedBottomSheetChanged()}progressChanged(){this.enabled=this.progress>0,console.log(this.enabled,this.progress)}enable(){this.enabled=!0}disable(){this.enabled=!1}clickHandler(){this.connectedBottomSheet.close()}hostData(){return{style:{pointerEvents:this.enabled?"all":"none",opacity:`${this.progress}`}}}static get is(){return"bottom-sheet-screen"}static get encapsulation(){return"shadow"}static get properties(){return{connectedBottomSheet:{type:"Any",attr:"connected-bottom-sheet",watchCallbacks:["connectedBottomSheetChanged"]},disable:{method:!0},enable:{method:!0},enabled:{state:!0},progress:{type:Number,attr:"progress",watchCallbacks:["progressChanged"]}}}static get listeners(){return[{name:"click",method:"clickHandler"}]}static get style(){return":host{display:block;position:absolute;top:0;right:0;bottom:0;left:0;z-index:calc(var(--sheet-z-index, 9) - 1);background-color:var(--sheet-screen-background,rgba(0,0,0,.4))}"}}export{On as BottomSheet,xn as BottomSheetIndicator,Cn as BottomSheetScreen};