riftt 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rift.js +1 -1
- package/package.json +1 -1
package/dist/rift.js
CHANGED
|
@@ -15,4 +15,4 @@ function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialis
|
|
|
15
15
|
* Subject to the terms at https://gsap.com/standard-license
|
|
16
16
|
* @author: Jack Doyle, jack@greensock.com
|
|
17
17
|
*/
|
|
18
|
-
var Or,Sr,Cr,Mr,Er,Dr,Pr,Nr,Rr={},zr=180/Math.PI,Lr=Math.PI/180,Fr=Math.atan2,Br=/([A-Z])/g,Ir=/(left|right|width|margin|padding|x)/i,qr=/[\s,\(]\S/,jr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},$r=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Yr=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Wr=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},Vr=function(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)},Xr=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Ur=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},Hr=function(t,e,r){return t.style[e]=r},Gr=function(t,e,r){return t.style.setProperty(e,r)},Jr=function(t,e,r){return t._gsap[e]=r},Kr=function(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r},Qr=function(t,e,r,n,i){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(i,s)},Zr=function(t,e,r,n,i){var s=t._gsap;s[e]=r,s.renderTransform(i,s)},tn="transform",en=tn+"Origin",rn=function t(e,r){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Rr&&s){if(this.tfm=this.tfm||{},"transform"===e)return jr.transform.split(",").forEach(function(e){return t.call(n,e,r)});if(~(e=jr[e]||e).indexOf(",")?e.split(",").forEach(function(t){return n.tfm[t]=wn(i,t)}):this.tfm[e]=o.x?o[e]:wn(i,e),e===en&&(this.tfm.zOrigin=o.zOrigin),this.props.indexOf(tn)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(en,r,"")),e=tn}(s||r)&&this.props.push(e,r,s[e])},nn=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},sn=function(){var t,e,r=this.props,n=this.target,i=n.style,s=n._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?n[r[t]](r[t+2]):n[r[t]]=r[t+2]:r[t+2]?i[r[t]]=r[t+2]:i.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(Br,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)s[e]=this.tfm[e];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(t=Pr())&&t.isStart||i[tn]||(nn(i),s.zOrigin&&i[en]&&(i[en]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},on=function(t,e){var r={target:t,props:[],revert:sn,save:rn};return t._gsap||Ar.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(t){return r.save(t)}),r},an=function(t,e){var r=Sr.createElementNS?Sr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Sr.createElement(t);return r&&r.style?r:Sr.createElement(t)},un=function t(e,r,n){var i=getComputedStyle(e);return i[r]||i.getPropertyValue(r.replace(Br,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&t(e,cn(r)||r,1)||""},ln="O,Moz,ms,Ms,Webkit".split(","),cn=function(t,e,r){var n=(e||Er).style,i=5;if(t in n&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);i--&&!(ln[i]+t in n););return i<0?null:(3===i?"ms":i>=0?ln[i]:"")+t},hn=function(){"undefined"!=typeof window&&window.document&&(Or=window,Sr=Or.document,Cr=Sr.documentElement,Er=an("div")||{style:{}},an("div"),tn=cn(tn),en=tn+"Origin",Er.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Nr=!!cn("perspective"),Pr=Ar.core.reverting,Mr=1)},fn=function(t){var e,r=t.ownerSVGElement,n=an("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=t.cloneNode(!0);i.style.display="block",n.appendChild(i),Cr.appendChild(n);try{e=i.getBBox()}catch(t){}return n.removeChild(i),Cr.removeChild(n),e},dn=function(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])},pn=function(t){var e,r;try{e=t.getBBox()}catch(n){e=fn(t),r=1}return e&&(e.width||e.height)||r||(e=fn(t)),!e||e.width||e.x||e.y?e:{x:+dn(t,["x","cx","x1"])||0,y:+dn(t,["y","cy","y1"])||0,width:0,height:0}},mn=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!pn(t))},_n=function(t,e){if(e){var r,n=t.style;e in Rr&&e!==en&&(e=tn),n.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty("--"===r?e:e.replace(Br,"-$1").toLowerCase())):n.removeAttribute(e)}},gn=function(t,e,r,n,i,s){var o=new fr(t._pt,e,r,0,1,s?Ur:Xr);return t._pt=o,o.b=n,o.e=i,t._props.push(r),o},vn={deg:1,rad:1,turn:1},yn={grid:1,flex:1},bn=function t(e,r,n,i){var s,o,a,u,l=parseFloat(n)||0,c=(n+"").trim().substr((l+"").length)||"px",h=Er.style,f=Ir.test(r),d="svg"===e.tagName.toLowerCase(),p=(d?"client":"offset")+(f?"Width":"Height"),m=100,_="px"===i,g="%"===i;if(i===c||!l||vn[i]||vn[c])return l;if("px"!==c&&!_&&(l=t(e,r,n,"px")),u=e.getCTM&&mn(e),(g||"%"===c)&&(Rr[r]||~r.indexOf("adius")))return s=u?e.getBBox()[f?"width":"height"]:e[p],pt(g?l/s*m:l/100*s);if(h[f?"width":"height"]=m+(_?c:i),o="rem"!==i&&~r.indexOf("adius")||"em"===i&&e.appendChild&&!d?e:e.parentNode,u&&(o=(e.ownerSVGElement||{}).parentNode),o&&o!==Sr&&o.appendChild||(o=Sr.body),(a=o._gsap)&&g&&a.width&&f&&a.time===Oe.time&&!a.uncache)return pt(l/a.width*m);if(!g||"height"!==r&&"width"!==r)(g||"%"===c)&&!yn[un(o,"display")]&&(h.position=un(e,"position")),o===e&&(h.position="static"),o.appendChild(Er),s=Er[p],o.removeChild(Er),h.position="absolute";else{var v=e.style[r];e.style[r]=m+i,s=e[p],v?e.style[r]=v:_n(e,r)}return f&&g&&((a=ht(o)).time=Oe.time,a.width=o[p]),pt(_?s*l/m:s&&l?m/s*l:0)},wn=function(t,e,r,n){var i;return Mr||hn(),e in jr&&"transform"!==e&&~(e=jr[e]).indexOf(",")&&(e=e.split(",")[0]),Rr[e]&&"transform"!==e?(i=Nn(t,n),i="transformOrigin"!==e?i[e]:i.svg?i.origin:Rn(un(t,en))+" "+i.zOrigin+"px"):(!(i=t.style[e])||"auto"===i||n||~(i+"").indexOf("calc("))&&(i=On[e]&&On[e](t,e,r)||un(t,e)||ft(t,e)||("opacity"===e?1:0)),r&&!~(i+"").trim().indexOf(" ")?bn(t,e,i,r)+r:i},Tn=function(t,e,r,n){if(!r||"none"===r){var i=cn(e,t,1),s=i&&un(t,i,1);s&&s!==r?(e=i,r=s):"borderColor"===e&&(r=un(t,"borderTopColor"))}var o,a,u,l,c,h,f,d,p,m,_,g=new fr(this._pt,t.style,e,0,1,or),v=0,b=0;if(g.b=r,g.e=n,r+="","var(--"===(n+="").substring(0,6)&&(n=un(t,n.substring(4,n.indexOf(")")))),"auto"===n&&(h=t.style[e],t.style[e]=n,n=un(t,e)||n,h?t.style[e]=h:_n(t,e)),Ae(o=[r,n]),n=o[1],u=(r=o[0]).match(j)||[],(n.match(j)||[]).length){for(;a=j.exec(n);)f=a[0],p=n.substring(v,a.index),c?c=(c+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(c=1),f!==(h=u[b++]||"")&&(l=parseFloat(h)||0,_=h.substr((l+"").length),"="===f.charAt(1)&&(f=_t(l,f)+_),d=parseFloat(f),m=f.substr((d+"").length),v=j.lastIndex-m.length,m||(m=m||y.units[e]||_,v===n.length&&(n+=m,g.e+=m)),_!==m&&(l=bn(t,e,h,m)||0),g._pt={_next:g._pt,p:p||1===b?p:",",s:l,c:d-l,m:c&&c<4||"zIndex"===e?Math.round:0});g.c=v<n.length?n.substring(v,n.length):""}else g.r="display"===e&&"none"===n?Ur:Xr;return Y.test(n)&&(g.e=0),this._pt=g,g},xn={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},kn=function(t){var e=t.split(" "),r=e[0],n=e[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==n&&"right"!==n||(t=r,r=n,n=t),e[0]=xn[r]||r,e[1]=xn[n]||n,e.join(" ")},An=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,n,i,s=e.t,o=s.style,a=e.u,u=s._gsap;if("all"===a||!0===a)o.cssText="",n=1;else for(i=(a=a.split(",")).length;--i>-1;)r=a[i],Rr[r]&&(n=1,r="transformOrigin"===r?en:tn),_n(s,r);n&&(_n(s,tn),u&&(u.svg&&s.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",Nn(s,1),u.uncache=1,nn(o)))}},On={clearProps:function(t,e,r,n,i){if("isFromStart"!==i.data){var s=t._pt=new fr(t._pt,e,r,0,0,An);return s.u=n,s.pr=-10,s.tween=i,t._props.push(r),1}}},Sn=[1,0,0,1,0,0],Cn={},Mn=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},En=function(t){var e=un(t,tn);return Mn(e)?Sn:e.substr(7).match(q).map(pt)},Dn=function(t,e){var r,n,i,s,o=t._gsap||ht(t),a=t.style,u=En(t);return o.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?Sn:u:(u!==Sn||t.offsetParent||t===Cr||o.svg||(i=a.display,a.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(s=1,n=t.nextElementSibling,Cr.appendChild(t)),u=En(t),i?a.display=i:_n(t,"display"),s&&(n?r.insertBefore(t,n):r?r.appendChild(t):Cr.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},Pn=function(t,e,r,n,i,s){var o,a,u,l=t._gsap,c=i||Dn(t,!0),h=l.xOrigin||0,f=l.yOrigin||0,d=l.xOffset||0,p=l.yOffset||0,m=c[0],_=c[1],g=c[2],v=c[3],y=c[4],b=c[5],w=e.split(" "),T=parseFloat(w[0])||0,x=parseFloat(w[1])||0;r?c!==Sn&&(a=m*v-_*g)&&(u=T*(-_/a)+x*(m/a)-(m*b-_*y)/a,T=T*(v/a)+x*(-g/a)+(g*b-v*y)/a,x=u):(T=(o=pn(t)).x+(~w[0].indexOf("%")?T/100*o.width:T),x=o.y+(~(w[1]||w[0]).indexOf("%")?x/100*o.height:x)),n||!1!==n&&l.smooth?(y=T-h,b=x-f,l.xOffset=d+(y*m+b*g)-y,l.yOffset=p+(y*_+b*v)-b):l.xOffset=l.yOffset=0,l.xOrigin=T,l.yOrigin=x,l.smooth=!!n,l.origin=e,l.originIsAbsolute=!!r,t.style[en]="0px 0px",s&&(gn(s,l,"xOrigin",h,T),gn(s,l,"yOrigin",f,x),gn(s,l,"xOffset",d,l.xOffset),gn(s,l,"yOffset",p,l.yOffset)),t.setAttribute("data-svg-origin",T+" "+x)},Nn=function(t,e){var r=t._gsap||new Ie(t);if("x"in r&&!e&&!r.uncache)return r;var n,i,s,o,a,u,l,c,h,f,d,p,m,_,g,v,b,w,T,x,k,A,O,S,C,M,E,D,P,N,R,z,L=t.style,F=r.scaleX<0,B="px",I="deg",q=getComputedStyle(t),j=un(t,en)||"0";return n=i=s=u=l=c=h=f=d=0,o=a=1,r.svg=!(!t.getCTM||!mn(t)),q.translate&&("none"===q.translate&&"none"===q.scale&&"none"===q.rotate||(L[tn]=("none"!==q.translate?"translate3d("+(q.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==q.rotate?"rotate("+q.rotate+") ":"")+("none"!==q.scale?"scale("+q.scale.split(" ").join(",")+") ":"")+("none"!==q[tn]?q[tn]:"")),L.scale=L.rotate=L.translate="none"),_=Dn(t,r.svg),r.svg&&(r.uncache?(C=t.getBBox(),j=r.xOrigin-C.x+"px "+(r.yOrigin-C.y)+"px",S=""):S=!e&&t.getAttribute("data-svg-origin"),Pn(t,S||j,!!S||r.originIsAbsolute,!1!==r.smooth,_)),p=r.xOrigin||0,m=r.yOrigin||0,_!==Sn&&(w=_[0],T=_[1],x=_[2],k=_[3],n=A=_[4],i=O=_[5],6===_.length?(o=Math.sqrt(w*w+T*T),a=Math.sqrt(k*k+x*x),u=w||T?Fr(T,w)*zr:0,(h=x||k?Fr(x,k)*zr+u:0)&&(a*=Math.abs(Math.cos(h*Lr))),r.svg&&(n-=p-(p*w+m*x),i-=m-(p*T+m*k))):(z=_[6],N=_[7],E=_[8],D=_[9],P=_[10],R=_[11],n=_[12],i=_[13],s=_[14],l=(g=Fr(z,P))*zr,g&&(S=A*(v=Math.cos(-g))+E*(b=Math.sin(-g)),C=O*v+D*b,M=z*v+P*b,E=A*-b+E*v,D=O*-b+D*v,P=z*-b+P*v,R=N*-b+R*v,A=S,O=C,z=M),c=(g=Fr(-x,P))*zr,g&&(v=Math.cos(-g),R=k*(b=Math.sin(-g))+R*v,w=S=w*v-E*b,T=C=T*v-D*b,x=M=x*v-P*b),u=(g=Fr(T,w))*zr,g&&(S=w*(v=Math.cos(g))+T*(b=Math.sin(g)),C=A*v+O*b,T=T*v-w*b,O=O*v-A*b,w=S,A=C),l&&Math.abs(l)+Math.abs(u)>359.9&&(l=u=0,c=180-c),o=pt(Math.sqrt(w*w+T*T+x*x)),a=pt(Math.sqrt(O*O+z*z)),g=Fr(A,O),h=Math.abs(g)>2e-4?g*zr:0,d=R?1/(R<0?-R:R):0),r.svg&&(S=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Mn(un(t,tn)),S&&t.setAttribute("transform",S))),Math.abs(h)>90&&Math.abs(h)<270&&(F?(o*=-1,h+=u<=0?180:-180,u+=u<=0?180:-180):(a*=-1,h+=h<=0?180:-180)),e=e||r.uncache,r.x=n-((r.xPercent=n&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-n)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+B,r.y=i-((r.yPercent=i&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+B,r.z=s+B,r.scaleX=pt(o),r.scaleY=pt(a),r.rotation=pt(u)+I,r.rotationX=pt(l)+I,r.rotationY=pt(c)+I,r.skewX=h+I,r.skewY=f+I,r.transformPerspective=d+B,(r.zOrigin=parseFloat(j.split(" ")[2])||!e&&r.zOrigin||0)&&(L[en]=Rn(j)),r.xOffset=r.yOffset=0,r.force3D=y.force3D,r.renderTransform=r.svg?jn:Nr?qn:Ln,r.uncache=0,r},Rn=function(t){return(t=t.split(" "))[0]+" "+t[1]},zn=function(t,e,r){var n=Qt(e);return pt(parseFloat(e)+parseFloat(bn(t,"x",r+"px",n)))+n},Ln=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,qn(t,e)},Fn="0deg",Bn="0px",In=") ",qn=function(t,e){var r=e||this,n=r.xPercent,i=r.yPercent,s=r.x,o=r.y,a=r.z,u=r.rotation,l=r.rotationY,c=r.rotationX,h=r.skewX,f=r.skewY,d=r.scaleX,p=r.scaleY,m=r.transformPerspective,_=r.force3D,g=r.target,v=r.zOrigin,y="",b="auto"===_&&t&&1!==t||!0===_;if(v&&(c!==Fn||l!==Fn)){var w,T=parseFloat(l)*Lr,x=Math.sin(T),k=Math.cos(T);T=parseFloat(c)*Lr,w=Math.cos(T),s=zn(g,s,x*w*-v),o=zn(g,o,-Math.sin(T)*-v),a=zn(g,a,k*w*-v+v)}m!==Bn&&(y+="perspective("+m+In),(n||i)&&(y+="translate("+n+"%, "+i+"%) "),(b||s!==Bn||o!==Bn||a!==Bn)&&(y+=a!==Bn||b?"translate3d("+s+", "+o+", "+a+") ":"translate("+s+", "+o+In),u!==Fn&&(y+="rotate("+u+In),l!==Fn&&(y+="rotateY("+l+In),c!==Fn&&(y+="rotateX("+c+In),h===Fn&&f===Fn||(y+="skew("+h+", "+f+In),1===d&&1===p||(y+="scale("+d+", "+p+In),g.style[tn]=y||"translate(0, 0)"},jn=function(t,e){var r,n,i,s,o,a=e||this,u=a.xPercent,l=a.yPercent,c=a.x,h=a.y,f=a.rotation,d=a.skewX,p=a.skewY,m=a.scaleX,_=a.scaleY,g=a.target,v=a.xOrigin,y=a.yOrigin,b=a.xOffset,w=a.yOffset,T=a.forceCSS,x=parseFloat(c),k=parseFloat(h);f=parseFloat(f),d=parseFloat(d),(p=parseFloat(p))&&(d+=p=parseFloat(p),f+=p),f||d?(f*=Lr,d*=Lr,r=Math.cos(f)*m,n=Math.sin(f)*m,i=Math.sin(f-d)*-_,s=Math.cos(f-d)*_,d&&(p*=Lr,o=Math.tan(d-p),i*=o=Math.sqrt(1+o*o),s*=o,p&&(o=Math.tan(p),r*=o=Math.sqrt(1+o*o),n*=o)),r=pt(r),n=pt(n),i=pt(i),s=pt(s)):(r=m,s=_,n=i=0),(x&&!~(c+"").indexOf("px")||k&&!~(h+"").indexOf("px"))&&(x=bn(g,"x",c,"px"),k=bn(g,"y",h,"px")),(v||y||b||w)&&(x=pt(x+v-(v*r+y*i)+b),k=pt(k+y-(v*n+y*s)+w)),(u||l)&&(o=g.getBBox(),x=pt(x+u/100*o.width),k=pt(k+l/100*o.height)),o="matrix("+r+","+n+","+i+","+s+","+x+","+k+")",g.setAttribute("transform",o),T&&(g.style[tn]=o)},$n=function(t,e,r,n,i){var s,o,a=360,u=M(i),l=parseFloat(i)*(u&&~i.indexOf("rad")?zr:1)-n,c=n+l+"deg";return u&&("short"===(s=i.split("_")[1])&&(l%=a)!==l%180&&(l+=l<0?a:-360),"cw"===s&&l<0?l=(l+36e9)%a-~~(l/a)*a:"ccw"===s&&l>0&&(l=(l-36e9)%a-~~(l/a)*a)),t._pt=o=new fr(t._pt,e,r,n,l,Yr),o.e=c,o.u="deg",t._props.push(r),o},Yn=function(t,e){for(var r in e)t[r]=e[r];return t},Wn=function(t,e,r){var n,i,s,o,a,u,l,c=Yn({},r._gsap),h=r.style;for(i in c.svg?(s=r.getAttribute("transform"),r.setAttribute("transform",""),h[tn]=e,n=Nn(r,1),_n(r,tn),r.setAttribute("transform",s)):(s=getComputedStyle(r)[tn],h[tn]=e,n=Nn(r,1),h[tn]=s),Rr)(s=c[i])!==(o=n[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(a=Qt(s)!==(l=Qt(o))?bn(r,i,s,l):parseFloat(s),u=parseFloat(o),t._pt=new fr(t._pt,n,i,a,u-a,$r),t._pt.u=l||0,t._props.push(i));Yn(n,c)};dt("padding,margin,Width,Radius",function(t,e){var r="Top",n="Right",i="Bottom",s="Left",o=(e<3?[r,n,i,s]:[r+s,r+n,i+n,i+s]).map(function(r){return e<2?t+r:"border"+r+t});On[e>1?"border"+t:t]=function(t,e,r,n,i){var s,a;if(arguments.length<4)return s=o.map(function(e){return wn(t,e,r)}),5===(a=s.join(" ")).split(s[0]).length?s[0]:a;s=(n+"").split(" "),a={},o.forEach(function(t,e){return a[t]=s[e]=s[e]||s[(e-1)/2|0]}),t.init(e,a,i)}});var Vn,Xn,Un,Hn={name:"css",register:hn,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,r,n,i){var s,o,a,u,l,c,h,f,d,p,m,_,g,v,b,w,T=this._props,x=t.style,k=r.vars.startAt;for(h in Mr||hn(),this.styles=this.styles||on(t),w=this.styles.props,this.tween=r,e)if("autoRound"!==h&&(o=e[h],!st[h]||!Xe(h,e,r,n,t,i)))if(l=typeof o,c=On[h],"function"===l&&(l=typeof(o=o.call(r,n,t,i))),"string"===l&&~o.indexOf("random(")&&(o=ce(o)),c)c(this,t,h,o,r)&&(b=1);else if("--"===h.substr(0,2))s=(getComputedStyle(t).getPropertyValue(h)+"").trim(),o+="",xe.lastIndex=0,xe.test(s)||(f=Qt(s),d=Qt(o)),d?f!==d&&(s=bn(t,h,s,d)+d):f&&(o+=f),this.add(x,"setProperty",s,o,n,i,0,0,h),T.push(h),w.push(h,0,x[h]);else if("undefined"!==l){if(k&&h in k?(s="function"==typeof k[h]?k[h].call(r,n,t,i):k[h],M(s)&&~s.indexOf("random(")&&(s=ce(s)),Qt(s+"")||"auto"===s||(s+=y.units[h]||Qt(wn(t,h))||""),"="===(s+"").charAt(1)&&(s=wn(t,h))):s=wn(t,h),u=parseFloat(s),(p="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),a=parseFloat(o),h in jr&&("autoAlpha"===h&&(1===u&&"hidden"===wn(t,"visibility")&&a&&(u=0),w.push("visibility",0,x.visibility),gn(this,x,"visibility",u?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==h&&"transform"!==h&&~(h=jr[h]).indexOf(",")&&(h=h.split(",")[0])),m=h in Rr)if(this.styles.save(h),"string"===l&&"var(--"===o.substring(0,6)&&(o=un(t,o.substring(4,o.indexOf(")"))),a=parseFloat(o)),_||((g=t._gsap).renderTransform&&!e.parseTransform||Nn(t,e.parseTransform),v=!1!==e.smoothOrigin&&g.smooth,(_=this._pt=new fr(this._pt,x,tn,0,1,g.renderTransform,g,0,-1)).dep=1),"scale"===h)this._pt=new fr(this._pt,g,"scaleY",g.scaleY,(p?_t(g.scaleY,p+a):a)-g.scaleY||0,$r),this._pt.u=0,T.push("scaleY",h),h+="X";else{if("transformOrigin"===h){w.push(en,0,x[en]),o=kn(o),g.svg?Pn(t,o,0,v,0,this):((d=parseFloat(o.split(" ")[2])||0)!==g.zOrigin&&gn(this,g,"zOrigin",g.zOrigin,d),gn(this,x,h,Rn(s),Rn(o)));continue}if("svgOrigin"===h){Pn(t,o,1,v,0,this);continue}if(h in Cn){$n(this,g,h,u,p?_t(u,p+o):o);continue}if("smoothOrigin"===h){gn(this,g,"smooth",g.smooth,o);continue}if("force3D"===h){g[h]=o;continue}if("transform"===h){Wn(this,o,t);continue}}else h in x||(h=cn(h)||h);if(m||(a||0===a)&&(u||0===u)&&!qr.test(o)&&h in x)a||(a=0),(f=(s+"").substr((u+"").length))!==(d=Qt(o)||(h in y.units?y.units[h]:f))&&(u=bn(t,h,s,d)),this._pt=new fr(this._pt,m?g:x,h,u,(p?_t(u,p+a):a)-u,m||"px"!==d&&"zIndex"!==h||!1===e.autoRound?$r:Vr),this._pt.u=d||0,f!==d&&"%"!==d&&(this._pt.b=s,this._pt.r=Wr);else if(h in x)Tn.call(this,t,h,s,p?p+o:o);else if(h in t)this.add(t,h,s||t[h],p?p+o:o,n,i);else if("parseTransform"!==h){G(h,o);continue}m||(h in x?w.push(h,0,x[h]):"function"==typeof t[h]?w.push(h,2,t[h]()):w.push(h,1,s||t[h])),T.push(h)}b&&hr(this)},render:function(t,e){if(e.tween._time||!Pr())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:wn,aliases:jr,getSetter:function(t,e,r){var n=jr[e];return n&&n.indexOf(",")<0&&(e=n),e in Rr&&e!==en&&(t._gsap.x||wn(t,"x"))?r&&Dr===r?"scale"===e?Kr:Jr:(Dr=r||{})&&("scale"===e?Qr:Zr):t.style&&!P(t.style[e])?Hr:~e.indexOf("-")?Gr:nr(t,e)},core:{_removeProperty:_n,_getMatrix:Dn}};Ar.utils.checkPrefix=cn,Ar.core.getStyleSaver=on,Un=dt((Vn="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Xn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){Rr[t]=1}),dt(Xn,function(t){y.units[t]="deg",Cn[t]=1}),jr[Un[13]]=Vn+","+Xn,dt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");jr[e[1]]=Un[e[0]]}),dt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){y.units[t]="px"}),Ar.registerPlugin(Hn);var Gn=Ar.registerPlugin(Hn)||Ar;function Jn(t){if(Kn(t)){for(;t&&Kn(t);){t=Qn(t).parent}return null!=t?t:null}return t.parentNode}function Kn(t){return 11===t.nodeType}function Qn(t,e){var r,n,i;const s=t;return null!==(r=s.parent)&&void 0!==r||(s.parent=null!=e?e:null),null!==(n=s.firstChildNode)&&void 0!==n||(s.firstChildNode=t.firstChild),null!==(i=s.lastChildNode)&&void 0!==i||(s.lastChildNode=t.lastChild),s}Gn.core.Tween;const Zn={createElement:function(t,e){return document.createElement(t,e)},createElementNS:function(t,e,r){return document.createElementNS(t,e,r)},createTextNode:function(t){return document.createTextNode(t)},createDocumentFragment:function(){return Qn(document.createDocumentFragment())},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,r){if(Kn(t)){let e=t;for(;e&&Kn(e);){e=Qn(e).parent}t=null!=e?e:t}Kn(e)&&(e=Qn(e,t)),r&&Kn(r)&&(r=Qn(r).firstChildNode),t.insertBefore(e,r)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){Kn(e)&&(e=Qn(e,t)),t.appendChild(e)},parentNode:Jn,nextSibling:function(t){var e;if(Kn(t)){const r=Qn(t),n=Jn(r);if(n&&r.lastChildNode){const t=Array.from(n.childNodes),i=t.indexOf(r.lastChildNode);return null!==(e=t[i+1])&&void 0!==e?e:null}return null}return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},getTextContent:function(t){return t.textContent},isElement:function(t){return 1===t.nodeType},isText:function(t){return 3===t.nodeType},isComment:function(t){return 8===t.nodeType},isDocumentFragment:Kn};function ti(t,e,r,n,i){return{sel:t,data:e,children:r,text:n,elm:i,key:void 0===e?void 0:e.key}}const ei=Array.isArray;function ri(t){return"string"==typeof t||"number"==typeof t||t instanceof String||t instanceof Number}const ni=ti("",{},[],void 0,void 0);function ii(t,e){var r,n;const i=t.key===e.key,s=(null===(r=t.data)||void 0===r?void 0:r.is)===(null===(n=e.data)||void 0===n?void 0:n.is),o=t.sel===e.sel,a=!(!t.sel&&t.sel===e.sel)||typeof t.text==typeof e.text;return o&&i&&s&&a}function si(t,e,r){var n;const i={};for(let s=e;s<=r;++s){const e=null===(n=t[s])||void 0===n?void 0:n.key;void 0!==e&&(i[e]=s)}return i}const oi=["create","update","remove","destroy","pre","post"];function ai(t,e,r){if(t.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==e)for(let t=0;t<e.length;++t){const r=e[t];if("string"==typeof r)continue;const n=r.data;void 0!==n&&ai(n,r.children,r.sel)}}function ui(t,e,r){let n,i,s,o={};if(void 0!==r?(null!==e&&(o=e),ei(r)?n=r:ri(r)?i=r.toString():r&&r.sel&&(n=[r])):null!=e&&(ei(e)?n=e:ri(e)?i=e.toString():e&&e.sel?n=[e]:o=e),void 0!==n)for(s=0;s<n.length;++s)ri(n[s])&&(n[s]=ti(void 0,void 0,void 0,n[s],void 0));return!t.startsWith("svg")||3!==t.length&&"."!==t[3]&&"#"!==t[3]||ai(o,n,t),ti(t,o,n,i,void 0)}function li(t,e){let r;const n=e.elm;let i=t.data.attrs,s=e.data.attrs;if((i||s)&&i!==s){for(r in i=i||{},s=s||{},s){const t=s[r];i[r]!==t&&(!0===t?n.setAttribute(r,""):!1===t?n.removeAttribute(r):120!==r.charCodeAt(0)?n.setAttribute(r,t):58===r.charCodeAt(3)?n.setAttributeNS("http://www.w3.org/XML/1998/namespace",r,t):58===r.charCodeAt(5)?109===r.charCodeAt(1)?n.setAttributeNS("http://www.w3.org/2000/xmlns/",r,t):n.setAttributeNS("http://www.w3.org/1999/xlink",r,t):n.setAttribute(r,t))}for(r in i)r in s||n.removeAttribute(r)}}const ci={create:li,update:li};function hi(t,e){let r,n;const i=e.elm;let s=t.data.class,o=e.data.class;if((s||o)&&s!==o){for(n in s=s||{},o=o||{},s)s[n]&&!Object.prototype.hasOwnProperty.call(o,n)&&i.classList.remove(n);for(n in o)r=o[n],r!==s[n]&&i.classList[r?"add":"remove"](n)}}const fi={create:hi,update:hi};let di,pi=t=>{let e=t;const r=new Set,n={get value(){return di&&di.deps.push(r.add(di)),e},set value(t){if(t!==e){e=t;for(const t of r)t()}},peek:()=>e,toJSON:()=>n.value,then:()=>n.value,toString:()=>n.value,valueOf:()=>n.value};return n},mi=t=>{let e,r;const n=()=>{e&&e.call(),r=di,di=n;try{e=t()}finally{di=r}};return n.deps=[],n(),()=>{let t;for(e&&e.call();t=n.deps.pop();)t.delete(n)}},_i=t=>{const e=pi();let r;const n={get value(){return r||(r=mi(()=>{e.value=t()})),e.value},peek:e.peek,toJSON:()=>n.value,then:()=>n.value,toString:()=>n.value,valueOf:()=>n.value};return n},gi=t=>t(),vi=gi;const yi=Symbol("signals"),bi=Symbol("change"),wi="__",Ti=["push","pop","shift","unshift","splice"],xi=(t,e,r)=>{const n=t[e],i=n?.peek();"_"!==e[0]?n?r!==i&&(n._set?n._set(r):Array.isArray(r)&&Array.isArray(i)?i[bi]?gi(()=>{for(let t=0;t<r.length;t++)i[t]=r[t];i.length=r.length}):n.value=r:n.value=ki(r)):t[e]=r?.peek?r:pi(ki(r)):t[e]=r},ki=(t,e)=>{if(!t)return t;if(t[yi]||t[Symbol.toStringTag])return t;if(t.constructor!==Object)return Array.isArray(t)?Ai(t):t;const r=Object.create(e?.[yi]||{}),n=pi(Object.keys(t).length);let i;const s=new Proxy(r,{get:(t,e)=>e===bi?n:e===yi?r:e===wi?i:e in r?r[e]?.valueOf():globalThis[e],set(t,e,s){if(e===wi)return i=s,!0;const o=e in r;return xi(r,e,s),o||n.value++,!0},deleteProperty(t,e){const i=r[e];return i&&(i[Symbol.dispose]?.(),delete r[e],n.value--),!0},ownKeys:t=>(n.value,Reflect.ownKeys(r)),has:(t,e)=>!0}),o=Object.getOwnPropertyDescriptors(t);for(const e in t){const n=o[e];if(n?.get){const t=_i(n.get.bind(s));t._set=n.set?.bind(s),r[e]=t}else r[e]=null,xi(r,e,t[e])}return s},Ai=t=>{let e;const r=pi(t.length),n=Array(t.length).fill(),i=new Proxy(n,{get:(i,s)=>"symbol"==typeof s?s===bi?r:s===yi?n:n[s]:"length"===s?Ti.includes(e)?r.peek():r.value:(e=s,n[s]||(n[s]=pi(ki(t[s]))),n[s].valueOf()),set(t,e,s){if("length"===e){for(let t=s;t<n.length;t++)delete i[t];return r.value=n.length=s,!0}return xi(n,e,s),e>=r.peek()&&(r.value=n.length=+e+1),!0},deleteProperty:(t,e)=>(n[e]?.[Symbol.dispose]?.(),delete n[e],!0)});return i},Oi=t=>{const e=Li(`${t}=${wi}`);return(t,r)=>{t[wi]=r,e(t)}},Si=Symbol.dispose||=Symbol("dispose"),Ci=Symbol("state"),Mi=Symbol("on"),Ei=Symbol("off"),Di={},Pi={};let Ni,Ri=":";const zi=(t,e,r=Li)=>{Di[t]=(t,n,i,s)=>{const o=e(t,i,n,s),a=r(n,":"+s);return()=>o(a(i))}},Li=(t,e)=>{const r=t.trim();if(Pi[r])return Pi[r];let n;try{n=Ni(r)}catch(t){Fi(t,e,r)}const i=t=>{try{return n(t)}catch(t){Fi(t,e,r)}};return Pi[r]=i,i},Fi=(t,e="",r="")=>{const n=r?`="${r}"\n\n`:"",i=`◆ ${t.message}\n\n${e}${n}`;throw Object.assign(t,{message:i,expr:r})},Bi=(t,e=t.attributes,r,n,i)=>{if(!e)return;let s=0;for(;s<e.length;){const o=e[s],{name:a,value:u}=o;if(a.startsWith(Ri)){t.removeAttribute(a);const e=a.slice(Ri.length).split(":");for(const s of e){const e=(Di[s]||Di.default)(t,u,r,s);if(n.push(e),i.push(mi(e)),null===t[Ci])return}}else s++}for(const e of t.childNodes)1===e.nodeType&&Bi(e,e.attributes,r,n,i)},Ii=(t=document.body,e)=>{if(t[Ci])return Object.assign(t[Ci],e);const r=ki(e||{}),n=[],i=[];return Bi(t,t.attributes,r,i,n),Ci in t||(t[Ci]=r,t[Ei]=()=>{n.forEach(t=>t()),n.length=0},t[Mi]=()=>{n.length=0,n.push(...i.map(t=>mi(t)))},t[Si]=()=>{t[Ei](),t[Ei]=null,t[Mi]=null,t[Si]=null,t[Ci]=null}),r};Ii.use=t=>{var e;t.signal&&(pi=(e=t).signal,mi=e.effect,_i=e.computed,gi=e.batch||gi,vi=e.untracked||vi),t.compile&&(Ni=t.compile),t.prefix&&(Ri=t.prefix)};const qi=t=>{if(!t.nodeType)return t;const e=t.content.cloneNode(!0),r=[...t.attributes],n=document.createTextNode("");e.append(n);const i=[...e.childNodes];return{childNodes:i,content:e,remove(){e.append(...i)},replaceWith(t){t!==n&&(n.before(t),e.append(...i))},attributes:r,removeAttribute(t){const e=r.findIndex(e=>e.name===t);-1!==e&&r.splice(e,1)}}},ji=Symbol("if");zi("if",(t,e)=>{const r=document.createTextNode("");let n,i,s,o=t.nextElementSibling;return t.replaceWith(r),i=t.content?qi(t):t,i[Ci]=null,o?.hasAttribute(":else")?(o.removeAttribute(":else"),o.hasAttribute(":if")||(o.remove(),s=o.content?qi(o):o,s[Ci]=null)):o=null,(a,u=(t[ji]?null:a?i:s))=>{o&&(o[ji]=t[ji]||u==i),n!=u&&(n&&(n.remove(),n[Ei]?.()),(n=u)&&(r.before(n.content||n),null===n[Ci]?(delete n[Ci],Ii(n,e)):n[Mi]()))}}),zi("each",(t,e,r)=>{const[n,i="$"]=r.split(/\bin\b/)[0].trim().split(/\s*,\s*/),s=document.createTextNode("");let o,a,u,l=0;const c=()=>{const r=u,c=r.length;let h=0;if(o&&!o[bi]){for(const t of o[yi]||[])t[Symbol.dispose]();o=null,l=0}if(c<l)o.length=c;else{if(o)for(;h<l;)o[h]=r[h],h++;else o=r;for(;h<c;h++){o[h]=r[h];const u=h,l=ki({[n]:o[yi]?.[u]||o[u],[i]:a?a[u]:u},e),c=t.content?qi(t):t.cloneNode(!0);s.before(c.content||c),Ii(c,l);const f=((o[yi]||=[])[h]||={})[Symbol.dispose];o[yi][h][Symbol.dispose]=()=>{f?.(),c[Symbol.dispose]?.(),c.remove()}}}l=c};return t.replaceWith(s),t[Ci]=null,t=>{a=null,"number"==typeof t?u=Array.from({length:t},(t,e)=>e+1):t?.constructor===Object?(a=Object.keys(t),u=Object.values(t)):u=t||[];let e=0;return mi(()=>{u[bi],e++||(c(),queueMicrotask(()=>{e>1&&c(),e=0}))})}},t=>Li(t.split(/\bin\b/)[1])),zi("ref",(t,e,r)=>"function"==typeof Li(r)(e)?e=>e?.call(null,t):(Oi(r)(e,t),t=>t)),zi("with",(t,e)=>{let r;return n=>{r?Ii(t,n):vi(()=>{r=ki(n,e),Ii(t,r)})}}),zi("text",t=>{if(t.content){const e=qi(t).childNodes[0];t.replaceWith(e),t=e}return e=>{t.textContent=e??""}}),zi("class",t=>{let e=new Set;return r=>{const n=new Set;r&&("string"==typeof r?r.split(" ").forEach(t=>n.add(t)):Array.isArray(r)?r.forEach(t=>t&&n.add(t)):Object.entries(r).forEach(([t,e])=>e&&n.add(t)));for(const r of e)n.has(r)?n.delete(r):t.classList.remove(r);for(const e of n)t.classList.add(e);e=n}}),zi("style",t=>{const e=t.getAttribute("style")||"";return r=>{if("string"==typeof r){const n=e&&!e.trim().endsWith(";"),i=e+(e&&n?"; ":"")+r;return void t.setAttribute("style",i)}e&&t.setAttribute("style",e);for(const e in r){const n=r[e];e.startsWith("-")?t.style.setProperty(e,n):t.style[e]=n}}}),zi("default",(t,e,r,n)=>{if(!n.startsWith("on"))return n?e=>Xi(t,n,e):e=>{for(const r in e)Xi(t,Ui(r),e[r])};const i=n.split("..").map(e=>function(t,e){const r={evt:"",target:e,test:()=>!0};return r.evt=(t.startsWith("on")?t.slice(2):t).replace(/\.(\w+)?-?([-\w]+)?/g,(t,e,n="")=>(r.test=$i[e]?.(r,...n.split("-"))||r.test,"")),r}(e,t)),s=(t,r)=>{const{evt:n,target:i,test:s,defer:o,stop:a,prevent:u,immediate:l,...c}=r,h=r=>{try{if(!s(r))return;a&&(l?r.stopImmediatePropagation():r.stopPropagation()),u&&r.preventDefault(),t?.call(e,r)}catch(e){Fi(e,`:on${n}`,t)}},f=o?o(h):h;return i.addEventListener(n,f,c),()=>i.removeEventListener(n,f,c)};if(1===i.length)return t=>s(t,i[0]);let o,a,u,l=0;const c=t=>{u=s(e=>{u(),a=t?.(e),l=(l+1)%i.length,l?c(a):o&&c(o)},i[l])};return t=>(o=t,u||c(o),()=>{o=null})});const $i={prevent(t){t.prevent=!0},stop(t){t.stop=!0},immediate(t){t.immediate=!0},once(t){t.once=!0},passive(t){t.passive=!0},capture(t){t.capture=!0},window(t){t.target=window},document(t){t.target=document},parent(t){t.target=t.target.parentNode},throttle(t,e=108){t.defer=t=>Wi(t,e)},debounce(t,e=108){t.defer=t=>Vi(t,e)},outside:t=>e=>{const r=t.target;return!r.contains(e.target)&&(!1!==e.target.isConnected&&!(r.offsetWidth<1&&r.offsetHeight<1))},self:t=>e=>e.target===t.target,ctrl:(t,...e)=>t=>Yi.ctrl(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),shift:(t,...e)=>t=>Yi.shift(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),alt:(t,...e)=>t=>Yi.alt(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),meta:(t,...e)=>t=>Yi.meta(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),arrow:()=>Yi.arrow,enter:()=>Yi.enter,esc:()=>Yi.esc,tab:()=>Yi.tab,space:()=>Yi.space,delete:()=>Yi.delete,digit:()=>Yi.digit,letter:()=>Yi.letter,char:()=>Yi.char},Yi={ctrl:t=>t.ctrlKey||"Control"===t.key||"Ctrl"===t.key,shift:t=>t.shiftKey||"Shift"===t.key,alt:t=>t.altKey||"Alt"===t.key,meta:t=>t.metaKey||"Meta"===t.key||"Command"===t.key,arrow:t=>t.key.startsWith("Arrow"),enter:t=>"Enter"===t.key,esc:t=>t.key.startsWith("Esc"),tab:t=>"Tab"===t.key,space:t=>" "===t.key||"Space"===t.key||" "===t.key,delete:t=>"Delete"===t.key||"Backspace"===t.key,digit:t=>/^\d$/.test(t.key),letter:t=>/^\p{L}$/gu.test(t.key),char:t=>/^\S$/.test(t.key)},Wi=(t,e)=>{let r=!1,n=!1;const i=s=>{r=!0,setTimeout(()=>{r=!1,n&&(n=!1,i(s),t(s))},e)};return e=>{if(!r)return i(e),t(e);n=!0}},Vi=(t,e)=>{let r;return n=>{clearTimeout(r),r=setTimeout(()=>{r=null,t(n)},e)}},Xi=(t,e,r)=>{null==r||!1===r?t.removeAttribute(e):t.setAttribute(e,!0===r?"":"number"==typeof r||"string"==typeof r?r:"")},Ui=t=>t.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,(t,e)=>(e?"-":"")+t.toLowerCase());zi("value",(t,e,r)=>{const n=t.type||"",i=t.tagName,s=e=>{const r=e??"";t.value=r,t.setAttribute("value",r)},o=t=>s(t),a=e=>{const r=t.selectionStart,n=t.selectionEnd;s(e),r&&t.setSelectionRange(r,n)},u=e=>{t.checked=e,Xi(t,"checked",e)},l=e=>{t.value===e&&(t.checked=e,Xi(t,"checked",e))},c=e=>{for(const r of t.options)r.value==e?r.setAttribute("selected",""):r.removeAttribute("selected");t.value=e},h=e=>{for(const e of t.options)e.removeAttribute("selected");for(const r of e)t.querySelector(`[value="${r}"]`)?.setAttribute("selected","")},f=e=>{t.value=e},d=(()=>{if("TEXTAREA"===i)return a;switch(n){case"text":case"":return o;case"checkbox":return u;case"radio":return l;case"select-one":return c;case"select-multiple":return h;default:return f}})();try{const i=Oi(r),s="checkbox"===n?()=>i(e,t.checked):"select-multiple"===n?()=>i(e,[...t.selectedOptions].map(t=>t.value)):()=>i(e,t.selectedIndex<0?null:t.value);t.oninput=t.onchange=s,n?.startsWith("select")&&(new MutationObserver(s).observe(t,{childList:!0,subtree:!0,attributes:!0}),Ii(t,e)),Li(r)(e)??s()}catch{}return d}),zi("fx",t=>t=>t),zi("aria",t=>e=>{for(const r in e){const n=e[r];Xi(t,`aria-${Ui(r)}`,null==n?null:String(n))}}),zi("data",t=>e=>{for(const r in e)t.dataset[r]=e[r]}),Ii.use({compile:t=>Ii.constructor(`with (arguments[0]) { return ${t} };`)});const Hi=Symbol("persist"),Gi=t=>{try{return JSON.stringify(t,(t,e)=>{if("function"!=typeof e&&(!e||"object"!=typeof e||e.constructor===Object||Array.isArray(e)))return e})}catch{return"{}"}},Ji=t=>{try{return JSON.parse(t)}catch{return{}}},Ki=(t,e,r={})=>{const n={key:e,storage:globalThis.localStorage,paths:null,debounce:0,serializer:Gi,deserializer:Ji,...r};if(!(t=>{try{const e="__storage_test__";return t.setItem(e,"test"),t.removeItem(e),!0}catch{return!1}})(n.storage))return console.warn(`persistence: ${n.storage===globalThis.localStorage?"localStorage":"storage"} is not available`),()=>{};let i=!1;const s=((t,e)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(...n),e)}})(()=>{if(!i)try{const e=((t,e)=>{const r={};if(e)for(const n of e)n in t&&(r[n]=t[n]);else{const e=t[yi];for(const n in e){const i=e[n];i&&!i._set&&"_"!==n[0]&&(r[n]=t[n])}}return r})(t,n.paths),r=n.serializer(e);n.storage.setItem(n.key,r)}catch(t){console.warn("persistence: failed to save state",t)}},n.debounce),o=()=>{try{const e=n.storage.getItem(n.key);if(!e)return;const r=n.deserializer(e);if(!r||"object"!=typeof r)return;i=!0;for(const e in r)e in t[yi]&&!t[yi][e]?._set&&(t[e]=r[e]);i=!1}catch(t){console.warn("persistence: failed to restore state",t),i=!1}};o();const a=mi(()=>{if(n.paths)for(const e of n.paths)t[e];else{const e=t[yi];for(const r in e){const n=e[r];n&&!n._set&&"_"!==r[0]&&t[r]}}s()});return t[Hi]={config:n,saveState:s,restoreState:o},a},Qi=new Map,Zi={store:(t,e,r={})=>{if(void 0!==e){const n=ki(e);if(Qi.set(t,n),!0===r||r.persist){const e=!0===r?{}:{...r};delete e.persist,((t,e,r={})=>{!0===r&&(r={}),Ki(t,e,r)})(n,t,e)}return n}const n=Qi.get(t);return n||(console.warn(`store "${t}" not found`),{})}};async function ts(t){const e=t.querySelector("script[r-mod]"),r=t.querySelector("[r-scope]");if(!e)return;if(!r)return void console.warn("r-mod found but no r-scope element in container");t.querySelectorAll("[r-scope]").length>1&&console.warn("multiple r-scope elements found, using first one only");const n=e.textContent.trim();if(!n)return;const i=await async function(t){try{const e=`\nconst sprae = window._riftSprae;\nconst { signal, effect, computed } = window._riftSignal;\nconst store = window._riftStore;\nconst r = window.r;\n\n${t}\n`,r=`data:text/javascript;charset=utf-8,${encodeURIComponent(e)}#${Date.now()}`,n=await import(r),i={};for(const[t,e]of Object.entries(n))"default"!==t&&(i[t]=e);return i}catch(t){return console.error("module evaluation error:",t),{}}}(n),s=Ii(r,i);return e.remove(),s}async function es(t){await ts(t)}window.signal=pi,window.r=Zi;const rs=function(t){const e={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=Zn;for(const r of oi)for(const n of t){const t=n[r];void 0!==t&&e[r].push(t)}function n(t){const e=t.id?"#"+t.id:"",n=t.getAttribute("class"),i=n?"."+n.split(" ").join("."):"";return ti(r.tagName(t).toLowerCase()+e+i,{},[],void 0,t)}function i(t){return ti(void 0,{},[],void 0,t)}function s(t,e){return function(){if(0===--e){const e=r.parentNode(t);null!==e&&r.removeChild(e,t)}}}function o(t,n){var i,s,a;let u;const l=t.data,c=null==l?void 0:l.hook;null===(i=null==c?void 0:c.init)||void 0===i||i.call(c,t);const h=t.children,f=t.sel;if("!"===f)null!==(s=t.text)&&void 0!==s||(t.text=""),t.elm=r.createComment(t.text);else if(""===f)t.elm=r.createTextNode(t.text);else if(void 0!==f){const i=f.indexOf("#"),s=f.indexOf(".",i),d=i>0?i:f.length,p=s>0?s:f.length,m=-1!==i||-1!==s?f.slice(0,Math.min(d,p)):f,_=null==l?void 0:l.ns,g=void 0===_?r.createElement(m,l):r.createElementNS(_,m,l);for(t.elm=g,d<p&&g.setAttribute("id",f.slice(d+1,p)),s>0&&g.setAttribute("class",f.slice(p+1).replace(/\./g," ")),u=0;u<e.create.length;++u)e.create[u](ni,t);if(!ri(t.text)||ei(h)&&0!==h.length||r.appendChild(g,r.createTextNode(t.text)),ei(h))for(u=0;u<h.length;++u){const t=h[u];null!=t&&r.appendChild(g,o(t,n))}void 0!==c&&(null===(a=c.create)||void 0===a||a.call(c,ni,t),void 0!==c.insert&&n.push(t))}else t.elm=r.createTextNode(t.text);return t.elm}function a(t,e,n,i,s,a){for(;i<=s;++i){const s=n[i];null!=s&&r.insertBefore(t,o(s,a),e)}}function u(t){var r,n;const i=t.data;if(void 0!==i){null===(n=null===(r=null==i?void 0:i.hook)||void 0===r?void 0:r.destroy)||void 0===n||n.call(r,t);for(let r=0;r<e.destroy.length;++r)e.destroy[r](t);if(void 0!==t.children)for(let e=0;e<t.children.length;++e){const r=t.children[e];null!=r&&"string"!=typeof r&&u(r)}}}function l(t,n,i,o){for(var a,c;i<=o;++i){let o;const h=n[i];if(null!=h)if(void 0!==h.sel){u(h),o=e.remove.length+1;const t=s(h.elm,o);for(let r=0;r<e.remove.length;++r)e.remove[r](h,t);const r=null===(c=null===(a=null==h?void 0:h.data)||void 0===a?void 0:a.hook)||void 0===c?void 0:c.remove;void 0!==r?r(h,t):t()}else h.children?(u(h),l(t,h.children,0,h.children.length-1)):r.removeChild(t,h.elm)}}function c(t,n,i){var s,u,h,f,d,p,m,_;const g=null===(s=n.data)||void 0===s?void 0:s.hook;null===(u=null==g?void 0:g.prepatch)||void 0===u||u.call(g,t,n);const v=n.elm=t.elm;if(t===n)return;if(void 0!==n.data||void 0!==n.text&&n.text!==t.text){null!==(h=n.data)&&void 0!==h||(n.data={}),null!==(f=t.data)&&void 0!==f||(t.data={});for(let r=0;r<e.update.length;++r)e.update[r](t,n);null===(m=null===(p=null===(d=n.data)||void 0===d?void 0:d.hook)||void 0===p?void 0:p.update)||void 0===m||m.call(p,t,n)}const y=t.children,b=n.children;void 0===n.text?void 0!==y&&void 0!==b?y!==b&&function(t,e,n,i){let s,u,h,f,d=0,p=0,m=e.length-1,_=e[0],g=e[m],v=n.length-1,y=n[0],b=n[v];for(;d<=m&&p<=v;)null==_?_=e[++d]:null==g?g=e[--m]:null==y?y=n[++p]:null==b?b=n[--v]:ii(_,y)?(c(_,y,i),_=e[++d],y=n[++p]):ii(g,b)?(c(g,b,i),g=e[--m],b=n[--v]):ii(_,b)?(c(_,b,i),r.insertBefore(t,_.elm,r.nextSibling(g.elm)),_=e[++d],b=n[--v]):ii(g,y)?(c(g,y,i),r.insertBefore(t,g.elm,_.elm),g=e[--m],y=n[++p]):(void 0===s&&(s=si(e,d,m)),u=s[y.key],void 0===u?(r.insertBefore(t,o(y,i),_.elm),y=n[++p]):void 0===s[b.key]?(r.insertBefore(t,o(b,i),r.nextSibling(g.elm)),b=n[--v]):(h=e[u],h.sel!==y.sel?r.insertBefore(t,o(y,i),_.elm):(c(h,y,i),e[u]=void 0,r.insertBefore(t,h.elm,_.elm)),y=n[++p]));p<=v&&(f=null==n[v+1]?null:n[v+1].elm,a(t,f,n,p,v,i)),d<=m&&l(t,e,d,m)}(v,y,b,i):void 0!==b?(void 0!==t.text&&r.setTextContent(v,""),a(v,null,b,0,b.length-1,i)):void 0!==y?l(v,y,0,y.length-1):void 0!==t.text&&r.setTextContent(v,""):t.text!==n.text&&(void 0!==y&&l(v,y,0,y.length-1),r.setTextContent(v,n.text)),null===(_=null==g?void 0:g.postpatch)||void 0===_||_.call(g,t,n)}return function(t,s){let a,u,h;const f=[];for(a=0;a<e.pre.length;++a)e.pre[a]();for(!function(t,e){return t.isElement(e)}(r,t)?function(t,e){return t.isDocumentFragment(e)}(r,t)&&(t=i(t)):t=n(t),ii(t,s)?c(t,s,f):(u=t.elm,h=r.parentNode(u),o(s,f),null!==h&&(r.insertBefore(h,s.elm,r.nextSibling(u)),l(h,[t],0,0))),a=0;a<f.length;++a)f[a].data.hook.insert(f[a]);for(a=0;a<e.post.length;++a)e.post[a]();return s}}([fi,ci]);function ns(t){const e=[],r=t.replace(/:([^/]+)/g,(t,r)=>(e.push(r),"([^/]+)"));return{regex:new RegExp(`^${r}$`),keys:e}}function is(t,e){for(const r of e){const{regex:e,keys:n}=ns(r.path),i=t.match(e);if(i){const t={};return n.forEach((e,r)=>t[e]=i[r+1]),{route:r,params:t}}}return null}function ss(t,e){const r=[],n=t.split("/").filter(Boolean);for(let t=1;t<n.length;t++){const i=`/${n.slice(0,t).join("/")}`;for(const t of e){const{regex:e,keys:n}=ns(t.path),s=i.match(e);if(s){const e={};n.forEach((t,r)=>e[t]=s[r+1]),r.push({route:t,params:e});break}}}return r}function os(t){if(3===t.nodeType)return t.textContent;if(1===t.nodeType){const e={};return t.attributes&&t.attributes.length>0&&(e.attrs={},Array.from(t.attributes).forEach(t=>{e.attrs[t.name]=t.value})),t.className&&(e.class=t.className.split(" ").reduce((t,e)=>(e&&(t[e]=!0),t),{})),ui(t.tagName.toLowerCase(),e,Array.from(t.childNodes).map(t=>os(t)))}return null}async function as(t,e,r,n,i=!1,s=!1){let o="function"==typeof e?e({}):e;n&&(o={...o,dataset:n});const a=await fetch(`/templates/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(t=>t.text());if(s){const t=document.createElement("div");t.innerHTML=a;const e=Array.from(t.querySelectorAll("script")),n=e.map(t=>({element:t,src:t.src,content:t.textContent,attrs:Array.from(t.attributes).reduce((t,e)=>(t[e.name]=e.value,t),{})}));e.forEach(t=>t.remove());const i=r.firstElementChild,s=t.firstElementChild;if(i)if(s)if(i.__snabbdomVNode){const t=os(s);i.__snabbdomVNode=rs(i.__snabbdomVNode,t)}else{os(i);const t=os(s);i.__snabbdomVNode=rs(i,t)}else r.innerHTML=a;else r.innerHTML=t.innerHTML;n.forEach(({src:t,content:e,attrs:n})=>{const i=document.createElement("script");e&&(e.includes("export ")||e.includes("import "))&&(i.type="module"),Object.entries(n).forEach(([t,e])=>{i.setAttribute(t,e)}),t?i.src=t:i.textContent=e,r.appendChild(i)})}else{r.innerHTML=a;const t=r.firstElementChild;t&&t.__snabbdomVNode&&delete t.__snabbdomVNode}await es(r),await ds(r,i),await cs(r,i)}async function us(t,e){if(e)return new Promise(r=>{requestAnimationFrame(()=>{const n={...e,from:void 0};n.onComplete=r,e.from?Gn.fromTo(t,e.from,n):Gn.to(t,n)})})}function ls(t){try{return JSON.parse(t)}catch(e){try{return Function(`"use strict"; return (${t})`)()}catch(t){throw new Error("invalid JSON syntax")}}}async function cs(t,e=!1){if(e)return;const r=[];if(t.hasAttribute("r-transition-stagger-in"))try{const e=ls(t.getAttribute("r-transition-stagger-in")),n=Array.from(t.children);n.length>0&&(Gn.set(n,e.from||{}),r.push(us(n,e)))}catch(t){console.warn("invalid transition data on container stagger element:",t)}const n=t.querySelectorAll("[r-transition-stagger-in]");for(const t of n)try{const e=ls(t.getAttribute("r-transition-stagger-in")),n=Array.from(t.children);n.length>0&&(Gn.set(n,e.from||{}),r.push(us(n,e)))}catch(t){console.warn("invalid transition data on stagger element:",t)}if(t.hasAttribute("r-transition-in"))try{const e=ls(t.getAttribute("r-transition-in"));Gn.set(t,e.from||{}),r.push(us(t,e))}catch(t){console.warn("invalid transition data on container element:",t)}const i=t.querySelectorAll("[r-transition-in]");for(const t of i){const e=t.closest("[r-transition-stagger-in]");if(!e||e===t)try{const e=ls(t.getAttribute("r-transition-in"));Gn.set(t,e.from||{}),r.push(us(t,e))}catch(t){console.warn("invalid transition data on element:",t)}}Promise.all(r)}function hs(t){const e=[];if(t.hasAttribute("r-transition-stagger-in")){const r=ls(t.getAttribute("r-transition-stagger-in")),n=Array.from(t.children);n.length>0&&(e.push({type:"stagger",elements:n,transition:r}),Gn.set(n,r.from||{})),t.removeAttribute("r-transition-stagger-in")}if(t.hasAttribute("r-transition-in")){const r=ls(t.getAttribute("r-transition-in"));e.push({type:"individual",elements:t,transition:r}),Gn.set(t,r.from||{}),t.removeAttribute("r-transition-in")}return e}function fs(t){for(const{elements:e,transition:r}of t)us(e,r)}async function ds(t,e=!1){const r=t.querySelectorAll("[r-tpl]");for(const t of r){const r=t.getAttribute("r-tpl"),n=t.getAttribute("r-tpl-props"),i=t.getAttribute("r-dataset");let s=n?ls(n):{};i&&(s={...s,dataset:i});const o=await fetch(`/templates/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(t=>t.text());t.innerHTML=o,await es(t),await ds(t,e),await cs(t,e)}}function ps(t){const e={},r=new URLSearchParams(t);for(const[t,n]of r)e[t]=n;return e}function ms(t){let e=null;async function r({path:r,initial:n=!1,linkProps:i=null,linkTarget:s=null,linkDataset:o=null}){const[a,u=""]=r.split("?"),l=is(a,t);if(!l)return console.error("rift: route not found:",a);const{route:c,params:h}=l,f=ps(u);let d;if(n&&document.body.classList.add("loading"),c.renders)d=c.renders;else{const n=ss(r,t),i={template:c.template,props:c.props,target:c.target};d=[...n.filter(({route:t})=>!e||!e.startsWith(`${t.path}/`)&&e!==t.path).map(({route:t,params:e})=>({template:t.template,props:t.props,target:t.target,dataset:t.dataset,params:e,skipTransition:!1})),...n.filter(({route:t})=>e?.startsWith(`${t.path}/`)).map(({route:t,params:e})=>({template:t.template,props:t.props,target:t.target,dataset:t.dataset,params:e,skipTransition:!0})),{...i,skipTransition:!1}]}for(const t of d){const e=t.params||h;let r="function"==typeof t.props?t.props(e,f):t.props;i&&(r={...r,...i});const a=s&&document.querySelector(s)||t.target&&document.querySelector(t.target)||document.getElementById("main"),u=o||t.dataset||c.dataset;a.id,Gn.killTweensOf(a),Gn.set(a,{clearProps:"all"}),a.classList.add("loading"),await as(t.template,r,a,u,n||t.skipTransition,c.diff||!1),a.classList.remove("loading")}n&&document.body.classList.remove("loading"),e=r,n=!1,window.dispatchEvent(new CustomEvent("navigate"))}return{navigate:r,init:function(){document.addEventListener("click",t=>{const e=t.target.closest("[r-link]");if(!e)return;t.preventDefault();const n=e.getAttribute("href"),i=e.getAttribute("r-dataset"),s=e.getAttribute("r-dataset-props"),o=e.getAttribute("r-target");history.pushState({},"",n),window.dispatchEvent(new CustomEvent("navigate")),r({path:n,linkProps:s?ls(s):null,linkDataset:i,linkTarget:o})}),window.addEventListener("popstate",()=>r({path:location.pathname+location.search}))},hydrateNestedTemplates:ds,processElementTransitions:cs,captureGlobalTransitions:hs,runGlobalTransitions:fs,refresh:async(e={})=>{const r=async()=>{const{path:r=location.pathname+location.search,parents:n=!1}=e,[i,s=""]=r.split("?"),o=is(i,t);if(!o)return console.error("rift: route not found:",i);const{route:a,params:u}=o,l=ps(s);if(n){const e=[...ss(r,t),{route:a,params:u}],n=new Set;for(let t=e.length-1;t>=0;t--){const r=e[t].route.target||"#main";if(!n.has(r)&&(n.add(r),t<e.length-1)){const{route:n,params:i}=e[t],s=document.querySelector(r)||document.getElementById("main"),o="function"==typeof n.props?n.props(i,l):n.props;await as(n.template,o,s,n.dataset,!0)}}}const c=document.querySelector(a.target)||document.getElementById("main"),h="function"==typeof a.props?a.props(u,l):a.props;await as(a.template,h,c,a.dataset,!0)};document.startViewTransition?document.startViewTransition(r):await r()},refreshTemplate:async(e,r={})=>{const n=[];document.querySelectorAll(`[r-tpl="${e}"]`).forEach(t=>{n.push(async()=>{const n=await fetch(`/templates/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)return console.error("failed to fetch template:",e);const i=await n.text();t.innerHTML=i,await es(t)})});if(t.filter(t=>t.template===e).forEach(t=>{const e=document.querySelector(t.target)||document.getElementById("main");e&&n.push(async()=>{const r=location.pathname+location.search,n=is(r,[t]);if(n){const{params:i}=n,[,s=""]=r.split("?"),o=ps(s),a="function"==typeof t.props?t.props(i,o):t.props;await as(t.template,a,e,t.dataset,!0)}})}),0===n.length)return console.error("no templates found with name:",e);const i=async()=>{await Promise.all(n.map(t=>t()))};document.startViewTransition?document.startViewTransition(i):await i()}}}function _s(){document.addEventListener("mousedown",t=>{const e=t.target.closest(".ripple");if(!e)return;const r=document.createElement("span");r.classList.add("ripple-effect");const n=Math.max(e.clientWidth,e.clientHeight);r.style.width=r.style.height=`${n}px`;const i=e.getBoundingClientRect();r.style.left=t.clientX-i.left-n/2+"px",r.style.top=t.clientY-i.top-n/2+"px",e.appendChild(r),r.addEventListener("animationend",()=>r.remove())})}function gs(t){window._riftRouter=t,document.addEventListener("DOMContentLoaded",async function(){const e=t.captureGlobalTransitions(document.body);await t.hydrateNestedTemplates(document.body,!0),await t.navigate({path:location.pathname+location.search,initial:!0}),document.body.classList.remove("loading"),e.length>0&&requestAnimationFrame(()=>{t.runGlobalTransitions(e)})}),t.init()}function vs(t){const e=ms(t);_s(),gs(e)}window._riftSprae=Ii,window._riftSignal={signal:pi,effect:mi,computed:_i},window._riftStore=ki,window.r=Zi;export{ms as createRouter,vs as default,_s as initRipple,gs as mount,Zi as r,ki as store};
|
|
18
|
+
var Or,Sr,Cr,Mr,Er,Dr,Pr,Nr,Rr={},zr=180/Math.PI,Lr=Math.PI/180,Fr=Math.atan2,Br=/([A-Z])/g,Ir=/(left|right|width|margin|padding|x)/i,qr=/[\s,\(]\S/,jr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},$r=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Yr=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Wr=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},Vr=function(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)},Xr=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Ur=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},Hr=function(t,e,r){return t.style[e]=r},Gr=function(t,e,r){return t.style.setProperty(e,r)},Jr=function(t,e,r){return t._gsap[e]=r},Kr=function(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r},Qr=function(t,e,r,n,i){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(i,s)},Zr=function(t,e,r,n,i){var s=t._gsap;s[e]=r,s.renderTransform(i,s)},tn="transform",en=tn+"Origin",rn=function t(e,r){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Rr&&s){if(this.tfm=this.tfm||{},"transform"===e)return jr.transform.split(",").forEach(function(e){return t.call(n,e,r)});if(~(e=jr[e]||e).indexOf(",")?e.split(",").forEach(function(t){return n.tfm[t]=wn(i,t)}):this.tfm[e]=o.x?o[e]:wn(i,e),e===en&&(this.tfm.zOrigin=o.zOrigin),this.props.indexOf(tn)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(en,r,"")),e=tn}(s||r)&&this.props.push(e,r,s[e])},nn=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},sn=function(){var t,e,r=this.props,n=this.target,i=n.style,s=n._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?n[r[t]](r[t+2]):n[r[t]]=r[t+2]:r[t+2]?i[r[t]]=r[t+2]:i.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(Br,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)s[e]=this.tfm[e];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(t=Pr())&&t.isStart||i[tn]||(nn(i),s.zOrigin&&i[en]&&(i[en]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},on=function(t,e){var r={target:t,props:[],revert:sn,save:rn};return t._gsap||Ar.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(t){return r.save(t)}),r},an=function(t,e){var r=Sr.createElementNS?Sr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Sr.createElement(t);return r&&r.style?r:Sr.createElement(t)},un=function t(e,r,n){var i=getComputedStyle(e);return i[r]||i.getPropertyValue(r.replace(Br,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&t(e,cn(r)||r,1)||""},ln="O,Moz,ms,Ms,Webkit".split(","),cn=function(t,e,r){var n=(e||Er).style,i=5;if(t in n&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);i--&&!(ln[i]+t in n););return i<0?null:(3===i?"ms":i>=0?ln[i]:"")+t},hn=function(){"undefined"!=typeof window&&window.document&&(Or=window,Sr=Or.document,Cr=Sr.documentElement,Er=an("div")||{style:{}},an("div"),tn=cn(tn),en=tn+"Origin",Er.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Nr=!!cn("perspective"),Pr=Ar.core.reverting,Mr=1)},fn=function(t){var e,r=t.ownerSVGElement,n=an("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=t.cloneNode(!0);i.style.display="block",n.appendChild(i),Cr.appendChild(n);try{e=i.getBBox()}catch(t){}return n.removeChild(i),Cr.removeChild(n),e},dn=function(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])},pn=function(t){var e,r;try{e=t.getBBox()}catch(n){e=fn(t),r=1}return e&&(e.width||e.height)||r||(e=fn(t)),!e||e.width||e.x||e.y?e:{x:+dn(t,["x","cx","x1"])||0,y:+dn(t,["y","cy","y1"])||0,width:0,height:0}},mn=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!pn(t))},_n=function(t,e){if(e){var r,n=t.style;e in Rr&&e!==en&&(e=tn),n.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty("--"===r?e:e.replace(Br,"-$1").toLowerCase())):n.removeAttribute(e)}},gn=function(t,e,r,n,i,s){var o=new fr(t._pt,e,r,0,1,s?Ur:Xr);return t._pt=o,o.b=n,o.e=i,t._props.push(r),o},vn={deg:1,rad:1,turn:1},yn={grid:1,flex:1},bn=function t(e,r,n,i){var s,o,a,u,l=parseFloat(n)||0,c=(n+"").trim().substr((l+"").length)||"px",h=Er.style,f=Ir.test(r),d="svg"===e.tagName.toLowerCase(),p=(d?"client":"offset")+(f?"Width":"Height"),m=100,_="px"===i,g="%"===i;if(i===c||!l||vn[i]||vn[c])return l;if("px"!==c&&!_&&(l=t(e,r,n,"px")),u=e.getCTM&&mn(e),(g||"%"===c)&&(Rr[r]||~r.indexOf("adius")))return s=u?e.getBBox()[f?"width":"height"]:e[p],pt(g?l/s*m:l/100*s);if(h[f?"width":"height"]=m+(_?c:i),o="rem"!==i&&~r.indexOf("adius")||"em"===i&&e.appendChild&&!d?e:e.parentNode,u&&(o=(e.ownerSVGElement||{}).parentNode),o&&o!==Sr&&o.appendChild||(o=Sr.body),(a=o._gsap)&&g&&a.width&&f&&a.time===Oe.time&&!a.uncache)return pt(l/a.width*m);if(!g||"height"!==r&&"width"!==r)(g||"%"===c)&&!yn[un(o,"display")]&&(h.position=un(e,"position")),o===e&&(h.position="static"),o.appendChild(Er),s=Er[p],o.removeChild(Er),h.position="absolute";else{var v=e.style[r];e.style[r]=m+i,s=e[p],v?e.style[r]=v:_n(e,r)}return f&&g&&((a=ht(o)).time=Oe.time,a.width=o[p]),pt(_?s*l/m:s&&l?m/s*l:0)},wn=function(t,e,r,n){var i;return Mr||hn(),e in jr&&"transform"!==e&&~(e=jr[e]).indexOf(",")&&(e=e.split(",")[0]),Rr[e]&&"transform"!==e?(i=Nn(t,n),i="transformOrigin"!==e?i[e]:i.svg?i.origin:Rn(un(t,en))+" "+i.zOrigin+"px"):(!(i=t.style[e])||"auto"===i||n||~(i+"").indexOf("calc("))&&(i=On[e]&&On[e](t,e,r)||un(t,e)||ft(t,e)||("opacity"===e?1:0)),r&&!~(i+"").trim().indexOf(" ")?bn(t,e,i,r)+r:i},Tn=function(t,e,r,n){if(!r||"none"===r){var i=cn(e,t,1),s=i&&un(t,i,1);s&&s!==r?(e=i,r=s):"borderColor"===e&&(r=un(t,"borderTopColor"))}var o,a,u,l,c,h,f,d,p,m,_,g=new fr(this._pt,t.style,e,0,1,or),v=0,b=0;if(g.b=r,g.e=n,r+="","var(--"===(n+="").substring(0,6)&&(n=un(t,n.substring(4,n.indexOf(")")))),"auto"===n&&(h=t.style[e],t.style[e]=n,n=un(t,e)||n,h?t.style[e]=h:_n(t,e)),Ae(o=[r,n]),n=o[1],u=(r=o[0]).match(j)||[],(n.match(j)||[]).length){for(;a=j.exec(n);)f=a[0],p=n.substring(v,a.index),c?c=(c+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(c=1),f!==(h=u[b++]||"")&&(l=parseFloat(h)||0,_=h.substr((l+"").length),"="===f.charAt(1)&&(f=_t(l,f)+_),d=parseFloat(f),m=f.substr((d+"").length),v=j.lastIndex-m.length,m||(m=m||y.units[e]||_,v===n.length&&(n+=m,g.e+=m)),_!==m&&(l=bn(t,e,h,m)||0),g._pt={_next:g._pt,p:p||1===b?p:",",s:l,c:d-l,m:c&&c<4||"zIndex"===e?Math.round:0});g.c=v<n.length?n.substring(v,n.length):""}else g.r="display"===e&&"none"===n?Ur:Xr;return Y.test(n)&&(g.e=0),this._pt=g,g},xn={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},kn=function(t){var e=t.split(" "),r=e[0],n=e[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==n&&"right"!==n||(t=r,r=n,n=t),e[0]=xn[r]||r,e[1]=xn[n]||n,e.join(" ")},An=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,n,i,s=e.t,o=s.style,a=e.u,u=s._gsap;if("all"===a||!0===a)o.cssText="",n=1;else for(i=(a=a.split(",")).length;--i>-1;)r=a[i],Rr[r]&&(n=1,r="transformOrigin"===r?en:tn),_n(s,r);n&&(_n(s,tn),u&&(u.svg&&s.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",Nn(s,1),u.uncache=1,nn(o)))}},On={clearProps:function(t,e,r,n,i){if("isFromStart"!==i.data){var s=t._pt=new fr(t._pt,e,r,0,0,An);return s.u=n,s.pr=-10,s.tween=i,t._props.push(r),1}}},Sn=[1,0,0,1,0,0],Cn={},Mn=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},En=function(t){var e=un(t,tn);return Mn(e)?Sn:e.substr(7).match(q).map(pt)},Dn=function(t,e){var r,n,i,s,o=t._gsap||ht(t),a=t.style,u=En(t);return o.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?Sn:u:(u!==Sn||t.offsetParent||t===Cr||o.svg||(i=a.display,a.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(s=1,n=t.nextElementSibling,Cr.appendChild(t)),u=En(t),i?a.display=i:_n(t,"display"),s&&(n?r.insertBefore(t,n):r?r.appendChild(t):Cr.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},Pn=function(t,e,r,n,i,s){var o,a,u,l=t._gsap,c=i||Dn(t,!0),h=l.xOrigin||0,f=l.yOrigin||0,d=l.xOffset||0,p=l.yOffset||0,m=c[0],_=c[1],g=c[2],v=c[3],y=c[4],b=c[5],w=e.split(" "),T=parseFloat(w[0])||0,x=parseFloat(w[1])||0;r?c!==Sn&&(a=m*v-_*g)&&(u=T*(-_/a)+x*(m/a)-(m*b-_*y)/a,T=T*(v/a)+x*(-g/a)+(g*b-v*y)/a,x=u):(T=(o=pn(t)).x+(~w[0].indexOf("%")?T/100*o.width:T),x=o.y+(~(w[1]||w[0]).indexOf("%")?x/100*o.height:x)),n||!1!==n&&l.smooth?(y=T-h,b=x-f,l.xOffset=d+(y*m+b*g)-y,l.yOffset=p+(y*_+b*v)-b):l.xOffset=l.yOffset=0,l.xOrigin=T,l.yOrigin=x,l.smooth=!!n,l.origin=e,l.originIsAbsolute=!!r,t.style[en]="0px 0px",s&&(gn(s,l,"xOrigin",h,T),gn(s,l,"yOrigin",f,x),gn(s,l,"xOffset",d,l.xOffset),gn(s,l,"yOffset",p,l.yOffset)),t.setAttribute("data-svg-origin",T+" "+x)},Nn=function(t,e){var r=t._gsap||new Ie(t);if("x"in r&&!e&&!r.uncache)return r;var n,i,s,o,a,u,l,c,h,f,d,p,m,_,g,v,b,w,T,x,k,A,O,S,C,M,E,D,P,N,R,z,L=t.style,F=r.scaleX<0,B="px",I="deg",q=getComputedStyle(t),j=un(t,en)||"0";return n=i=s=u=l=c=h=f=d=0,o=a=1,r.svg=!(!t.getCTM||!mn(t)),q.translate&&("none"===q.translate&&"none"===q.scale&&"none"===q.rotate||(L[tn]=("none"!==q.translate?"translate3d("+(q.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==q.rotate?"rotate("+q.rotate+") ":"")+("none"!==q.scale?"scale("+q.scale.split(" ").join(",")+") ":"")+("none"!==q[tn]?q[tn]:"")),L.scale=L.rotate=L.translate="none"),_=Dn(t,r.svg),r.svg&&(r.uncache?(C=t.getBBox(),j=r.xOrigin-C.x+"px "+(r.yOrigin-C.y)+"px",S=""):S=!e&&t.getAttribute("data-svg-origin"),Pn(t,S||j,!!S||r.originIsAbsolute,!1!==r.smooth,_)),p=r.xOrigin||0,m=r.yOrigin||0,_!==Sn&&(w=_[0],T=_[1],x=_[2],k=_[3],n=A=_[4],i=O=_[5],6===_.length?(o=Math.sqrt(w*w+T*T),a=Math.sqrt(k*k+x*x),u=w||T?Fr(T,w)*zr:0,(h=x||k?Fr(x,k)*zr+u:0)&&(a*=Math.abs(Math.cos(h*Lr))),r.svg&&(n-=p-(p*w+m*x),i-=m-(p*T+m*k))):(z=_[6],N=_[7],E=_[8],D=_[9],P=_[10],R=_[11],n=_[12],i=_[13],s=_[14],l=(g=Fr(z,P))*zr,g&&(S=A*(v=Math.cos(-g))+E*(b=Math.sin(-g)),C=O*v+D*b,M=z*v+P*b,E=A*-b+E*v,D=O*-b+D*v,P=z*-b+P*v,R=N*-b+R*v,A=S,O=C,z=M),c=(g=Fr(-x,P))*zr,g&&(v=Math.cos(-g),R=k*(b=Math.sin(-g))+R*v,w=S=w*v-E*b,T=C=T*v-D*b,x=M=x*v-P*b),u=(g=Fr(T,w))*zr,g&&(S=w*(v=Math.cos(g))+T*(b=Math.sin(g)),C=A*v+O*b,T=T*v-w*b,O=O*v-A*b,w=S,A=C),l&&Math.abs(l)+Math.abs(u)>359.9&&(l=u=0,c=180-c),o=pt(Math.sqrt(w*w+T*T+x*x)),a=pt(Math.sqrt(O*O+z*z)),g=Fr(A,O),h=Math.abs(g)>2e-4?g*zr:0,d=R?1/(R<0?-R:R):0),r.svg&&(S=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Mn(un(t,tn)),S&&t.setAttribute("transform",S))),Math.abs(h)>90&&Math.abs(h)<270&&(F?(o*=-1,h+=u<=0?180:-180,u+=u<=0?180:-180):(a*=-1,h+=h<=0?180:-180)),e=e||r.uncache,r.x=n-((r.xPercent=n&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-n)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+B,r.y=i-((r.yPercent=i&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+B,r.z=s+B,r.scaleX=pt(o),r.scaleY=pt(a),r.rotation=pt(u)+I,r.rotationX=pt(l)+I,r.rotationY=pt(c)+I,r.skewX=h+I,r.skewY=f+I,r.transformPerspective=d+B,(r.zOrigin=parseFloat(j.split(" ")[2])||!e&&r.zOrigin||0)&&(L[en]=Rn(j)),r.xOffset=r.yOffset=0,r.force3D=y.force3D,r.renderTransform=r.svg?jn:Nr?qn:Ln,r.uncache=0,r},Rn=function(t){return(t=t.split(" "))[0]+" "+t[1]},zn=function(t,e,r){var n=Qt(e);return pt(parseFloat(e)+parseFloat(bn(t,"x",r+"px",n)))+n},Ln=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,qn(t,e)},Fn="0deg",Bn="0px",In=") ",qn=function(t,e){var r=e||this,n=r.xPercent,i=r.yPercent,s=r.x,o=r.y,a=r.z,u=r.rotation,l=r.rotationY,c=r.rotationX,h=r.skewX,f=r.skewY,d=r.scaleX,p=r.scaleY,m=r.transformPerspective,_=r.force3D,g=r.target,v=r.zOrigin,y="",b="auto"===_&&t&&1!==t||!0===_;if(v&&(c!==Fn||l!==Fn)){var w,T=parseFloat(l)*Lr,x=Math.sin(T),k=Math.cos(T);T=parseFloat(c)*Lr,w=Math.cos(T),s=zn(g,s,x*w*-v),o=zn(g,o,-Math.sin(T)*-v),a=zn(g,a,k*w*-v+v)}m!==Bn&&(y+="perspective("+m+In),(n||i)&&(y+="translate("+n+"%, "+i+"%) "),(b||s!==Bn||o!==Bn||a!==Bn)&&(y+=a!==Bn||b?"translate3d("+s+", "+o+", "+a+") ":"translate("+s+", "+o+In),u!==Fn&&(y+="rotate("+u+In),l!==Fn&&(y+="rotateY("+l+In),c!==Fn&&(y+="rotateX("+c+In),h===Fn&&f===Fn||(y+="skew("+h+", "+f+In),1===d&&1===p||(y+="scale("+d+", "+p+In),g.style[tn]=y||"translate(0, 0)"},jn=function(t,e){var r,n,i,s,o,a=e||this,u=a.xPercent,l=a.yPercent,c=a.x,h=a.y,f=a.rotation,d=a.skewX,p=a.skewY,m=a.scaleX,_=a.scaleY,g=a.target,v=a.xOrigin,y=a.yOrigin,b=a.xOffset,w=a.yOffset,T=a.forceCSS,x=parseFloat(c),k=parseFloat(h);f=parseFloat(f),d=parseFloat(d),(p=parseFloat(p))&&(d+=p=parseFloat(p),f+=p),f||d?(f*=Lr,d*=Lr,r=Math.cos(f)*m,n=Math.sin(f)*m,i=Math.sin(f-d)*-_,s=Math.cos(f-d)*_,d&&(p*=Lr,o=Math.tan(d-p),i*=o=Math.sqrt(1+o*o),s*=o,p&&(o=Math.tan(p),r*=o=Math.sqrt(1+o*o),n*=o)),r=pt(r),n=pt(n),i=pt(i),s=pt(s)):(r=m,s=_,n=i=0),(x&&!~(c+"").indexOf("px")||k&&!~(h+"").indexOf("px"))&&(x=bn(g,"x",c,"px"),k=bn(g,"y",h,"px")),(v||y||b||w)&&(x=pt(x+v-(v*r+y*i)+b),k=pt(k+y-(v*n+y*s)+w)),(u||l)&&(o=g.getBBox(),x=pt(x+u/100*o.width),k=pt(k+l/100*o.height)),o="matrix("+r+","+n+","+i+","+s+","+x+","+k+")",g.setAttribute("transform",o),T&&(g.style[tn]=o)},$n=function(t,e,r,n,i){var s,o,a=360,u=M(i),l=parseFloat(i)*(u&&~i.indexOf("rad")?zr:1)-n,c=n+l+"deg";return u&&("short"===(s=i.split("_")[1])&&(l%=a)!==l%180&&(l+=l<0?a:-360),"cw"===s&&l<0?l=(l+36e9)%a-~~(l/a)*a:"ccw"===s&&l>0&&(l=(l-36e9)%a-~~(l/a)*a)),t._pt=o=new fr(t._pt,e,r,n,l,Yr),o.e=c,o.u="deg",t._props.push(r),o},Yn=function(t,e){for(var r in e)t[r]=e[r];return t},Wn=function(t,e,r){var n,i,s,o,a,u,l,c=Yn({},r._gsap),h=r.style;for(i in c.svg?(s=r.getAttribute("transform"),r.setAttribute("transform",""),h[tn]=e,n=Nn(r,1),_n(r,tn),r.setAttribute("transform",s)):(s=getComputedStyle(r)[tn],h[tn]=e,n=Nn(r,1),h[tn]=s),Rr)(s=c[i])!==(o=n[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(a=Qt(s)!==(l=Qt(o))?bn(r,i,s,l):parseFloat(s),u=parseFloat(o),t._pt=new fr(t._pt,n,i,a,u-a,$r),t._pt.u=l||0,t._props.push(i));Yn(n,c)};dt("padding,margin,Width,Radius",function(t,e){var r="Top",n="Right",i="Bottom",s="Left",o=(e<3?[r,n,i,s]:[r+s,r+n,i+n,i+s]).map(function(r){return e<2?t+r:"border"+r+t});On[e>1?"border"+t:t]=function(t,e,r,n,i){var s,a;if(arguments.length<4)return s=o.map(function(e){return wn(t,e,r)}),5===(a=s.join(" ")).split(s[0]).length?s[0]:a;s=(n+"").split(" "),a={},o.forEach(function(t,e){return a[t]=s[e]=s[e]||s[(e-1)/2|0]}),t.init(e,a,i)}});var Vn,Xn,Un,Hn={name:"css",register:hn,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,r,n,i){var s,o,a,u,l,c,h,f,d,p,m,_,g,v,b,w,T=this._props,x=t.style,k=r.vars.startAt;for(h in Mr||hn(),this.styles=this.styles||on(t),w=this.styles.props,this.tween=r,e)if("autoRound"!==h&&(o=e[h],!st[h]||!Xe(h,e,r,n,t,i)))if(l=typeof o,c=On[h],"function"===l&&(l=typeof(o=o.call(r,n,t,i))),"string"===l&&~o.indexOf("random(")&&(o=ce(o)),c)c(this,t,h,o,r)&&(b=1);else if("--"===h.substr(0,2))s=(getComputedStyle(t).getPropertyValue(h)+"").trim(),o+="",xe.lastIndex=0,xe.test(s)||(f=Qt(s),d=Qt(o)),d?f!==d&&(s=bn(t,h,s,d)+d):f&&(o+=f),this.add(x,"setProperty",s,o,n,i,0,0,h),T.push(h),w.push(h,0,x[h]);else if("undefined"!==l){if(k&&h in k?(s="function"==typeof k[h]?k[h].call(r,n,t,i):k[h],M(s)&&~s.indexOf("random(")&&(s=ce(s)),Qt(s+"")||"auto"===s||(s+=y.units[h]||Qt(wn(t,h))||""),"="===(s+"").charAt(1)&&(s=wn(t,h))):s=wn(t,h),u=parseFloat(s),(p="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),a=parseFloat(o),h in jr&&("autoAlpha"===h&&(1===u&&"hidden"===wn(t,"visibility")&&a&&(u=0),w.push("visibility",0,x.visibility),gn(this,x,"visibility",u?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==h&&"transform"!==h&&~(h=jr[h]).indexOf(",")&&(h=h.split(",")[0])),m=h in Rr)if(this.styles.save(h),"string"===l&&"var(--"===o.substring(0,6)&&(o=un(t,o.substring(4,o.indexOf(")"))),a=parseFloat(o)),_||((g=t._gsap).renderTransform&&!e.parseTransform||Nn(t,e.parseTransform),v=!1!==e.smoothOrigin&&g.smooth,(_=this._pt=new fr(this._pt,x,tn,0,1,g.renderTransform,g,0,-1)).dep=1),"scale"===h)this._pt=new fr(this._pt,g,"scaleY",g.scaleY,(p?_t(g.scaleY,p+a):a)-g.scaleY||0,$r),this._pt.u=0,T.push("scaleY",h),h+="X";else{if("transformOrigin"===h){w.push(en,0,x[en]),o=kn(o),g.svg?Pn(t,o,0,v,0,this):((d=parseFloat(o.split(" ")[2])||0)!==g.zOrigin&&gn(this,g,"zOrigin",g.zOrigin,d),gn(this,x,h,Rn(s),Rn(o)));continue}if("svgOrigin"===h){Pn(t,o,1,v,0,this);continue}if(h in Cn){$n(this,g,h,u,p?_t(u,p+o):o);continue}if("smoothOrigin"===h){gn(this,g,"smooth",g.smooth,o);continue}if("force3D"===h){g[h]=o;continue}if("transform"===h){Wn(this,o,t);continue}}else h in x||(h=cn(h)||h);if(m||(a||0===a)&&(u||0===u)&&!qr.test(o)&&h in x)a||(a=0),(f=(s+"").substr((u+"").length))!==(d=Qt(o)||(h in y.units?y.units[h]:f))&&(u=bn(t,h,s,d)),this._pt=new fr(this._pt,m?g:x,h,u,(p?_t(u,p+a):a)-u,m||"px"!==d&&"zIndex"!==h||!1===e.autoRound?$r:Vr),this._pt.u=d||0,f!==d&&"%"!==d&&(this._pt.b=s,this._pt.r=Wr);else if(h in x)Tn.call(this,t,h,s,p?p+o:o);else if(h in t)this.add(t,h,s||t[h],p?p+o:o,n,i);else if("parseTransform"!==h){G(h,o);continue}m||(h in x?w.push(h,0,x[h]):"function"==typeof t[h]?w.push(h,2,t[h]()):w.push(h,1,s||t[h])),T.push(h)}b&&hr(this)},render:function(t,e){if(e.tween._time||!Pr())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:wn,aliases:jr,getSetter:function(t,e,r){var n=jr[e];return n&&n.indexOf(",")<0&&(e=n),e in Rr&&e!==en&&(t._gsap.x||wn(t,"x"))?r&&Dr===r?"scale"===e?Kr:Jr:(Dr=r||{})&&("scale"===e?Qr:Zr):t.style&&!P(t.style[e])?Hr:~e.indexOf("-")?Gr:nr(t,e)},core:{_removeProperty:_n,_getMatrix:Dn}};Ar.utils.checkPrefix=cn,Ar.core.getStyleSaver=on,Un=dt((Vn="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Xn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){Rr[t]=1}),dt(Xn,function(t){y.units[t]="deg",Cn[t]=1}),jr[Un[13]]=Vn+","+Xn,dt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");jr[e[1]]=Un[e[0]]}),dt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){y.units[t]="px"}),Ar.registerPlugin(Hn);var Gn=Ar.registerPlugin(Hn)||Ar;function Jn(t){if(Kn(t)){for(;t&&Kn(t);){t=Qn(t).parent}return null!=t?t:null}return t.parentNode}function Kn(t){return 11===t.nodeType}function Qn(t,e){var r,n,i;const s=t;return null!==(r=s.parent)&&void 0!==r||(s.parent=null!=e?e:null),null!==(n=s.firstChildNode)&&void 0!==n||(s.firstChildNode=t.firstChild),null!==(i=s.lastChildNode)&&void 0!==i||(s.lastChildNode=t.lastChild),s}Gn.core.Tween;const Zn={createElement:function(t,e){return document.createElement(t,e)},createElementNS:function(t,e,r){return document.createElementNS(t,e,r)},createTextNode:function(t){return document.createTextNode(t)},createDocumentFragment:function(){return Qn(document.createDocumentFragment())},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,r){if(Kn(t)){let e=t;for(;e&&Kn(e);){e=Qn(e).parent}t=null!=e?e:t}Kn(e)&&(e=Qn(e,t)),r&&Kn(r)&&(r=Qn(r).firstChildNode),t.insertBefore(e,r)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){Kn(e)&&(e=Qn(e,t)),t.appendChild(e)},parentNode:Jn,nextSibling:function(t){var e;if(Kn(t)){const r=Qn(t),n=Jn(r);if(n&&r.lastChildNode){const t=Array.from(n.childNodes),i=t.indexOf(r.lastChildNode);return null!==(e=t[i+1])&&void 0!==e?e:null}return null}return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},getTextContent:function(t){return t.textContent},isElement:function(t){return 1===t.nodeType},isText:function(t){return 3===t.nodeType},isComment:function(t){return 8===t.nodeType},isDocumentFragment:Kn};function ti(t,e,r,n,i){return{sel:t,data:e,children:r,text:n,elm:i,key:void 0===e?void 0:e.key}}const ei=Array.isArray;function ri(t){return"string"==typeof t||"number"==typeof t||t instanceof String||t instanceof Number}const ni=ti("",{},[],void 0,void 0);function ii(t,e){var r,n;const i=t.key===e.key,s=(null===(r=t.data)||void 0===r?void 0:r.is)===(null===(n=e.data)||void 0===n?void 0:n.is),o=t.sel===e.sel,a=!(!t.sel&&t.sel===e.sel)||typeof t.text==typeof e.text;return o&&i&&s&&a}function si(t,e,r){var n;const i={};for(let s=e;s<=r;++s){const e=null===(n=t[s])||void 0===n?void 0:n.key;void 0!==e&&(i[e]=s)}return i}const oi=["create","update","remove","destroy","pre","post"];function ai(t,e,r){if(t.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==e)for(let t=0;t<e.length;++t){const r=e[t];if("string"==typeof r)continue;const n=r.data;void 0!==n&&ai(n,r.children,r.sel)}}function ui(t,e,r){let n,i,s,o={};if(void 0!==r?(null!==e&&(o=e),ei(r)?n=r:ri(r)?i=r.toString():r&&r.sel&&(n=[r])):null!=e&&(ei(e)?n=e:ri(e)?i=e.toString():e&&e.sel?n=[e]:o=e),void 0!==n)for(s=0;s<n.length;++s)ri(n[s])&&(n[s]=ti(void 0,void 0,void 0,n[s],void 0));return!t.startsWith("svg")||3!==t.length&&"."!==t[3]&&"#"!==t[3]||ai(o,n,t),ti(t,o,n,i,void 0)}function li(t,e){let r;const n=e.elm;let i=t.data.attrs,s=e.data.attrs;if((i||s)&&i!==s){for(r in i=i||{},s=s||{},s){const t=s[r];i[r]!==t&&(!0===t?n.setAttribute(r,""):!1===t?n.removeAttribute(r):120!==r.charCodeAt(0)?n.setAttribute(r,t):58===r.charCodeAt(3)?n.setAttributeNS("http://www.w3.org/XML/1998/namespace",r,t):58===r.charCodeAt(5)?109===r.charCodeAt(1)?n.setAttributeNS("http://www.w3.org/2000/xmlns/",r,t):n.setAttributeNS("http://www.w3.org/1999/xlink",r,t):n.setAttribute(r,t))}for(r in i)r in s||n.removeAttribute(r)}}const ci={create:li,update:li};function hi(t,e){let r,n;const i=e.elm;let s=t.data.class,o=e.data.class;if((s||o)&&s!==o){for(n in s=s||{},o=o||{},s)s[n]&&!Object.prototype.hasOwnProperty.call(o,n)&&i.classList.remove(n);for(n in o)r=o[n],r!==s[n]&&i.classList[r?"add":"remove"](n)}}const fi={create:hi,update:hi};let di,pi=t=>{let e=t;const r=new Set,n={get value(){return di&&di.deps.push(r.add(di)),e},set value(t){if(t!==e){e=t;for(const t of r)t()}},peek:()=>e,toJSON:()=>n.value,then:()=>n.value,toString:()=>n.value,valueOf:()=>n.value};return n},mi=t=>{let e,r;const n=()=>{e&&e.call(),r=di,di=n;try{e=t()}finally{di=r}};return n.deps=[],n(),()=>{let t;for(e&&e.call();t=n.deps.pop();)t.delete(n)}},_i=t=>{const e=pi();let r;const n={get value(){return r||(r=mi(()=>{e.value=t()})),e.value},peek:e.peek,toJSON:()=>n.value,then:()=>n.value,toString:()=>n.value,valueOf:()=>n.value};return n},gi=t=>t(),vi=gi;const yi=Symbol("signals"),bi=Symbol("change"),wi="__",Ti=["push","pop","shift","unshift","splice"],xi=(t,e,r)=>{const n=t[e],i=n?.peek();"_"!==e[0]?n?r!==i&&(n._set?n._set(r):Array.isArray(r)&&Array.isArray(i)?i[bi]?gi(()=>{for(let t=0;t<r.length;t++)i[t]=r[t];i.length=r.length}):n.value=r:n.value=ki(r)):t[e]=r?.peek?r:pi(ki(r)):t[e]=r},ki=(t,e)=>{if(!t)return t;if(t[yi]||t[Symbol.toStringTag])return t;if(t.constructor!==Object)return Array.isArray(t)?Ai(t):t;const r=Object.create(e?.[yi]||{}),n=pi(Object.keys(t).length);let i;const s=new Proxy(r,{get:(t,e)=>e===bi?n:e===yi?r:e===wi?i:e in r?r[e]?.valueOf():globalThis[e],set(t,e,s){if(e===wi)return i=s,!0;const o=e in r;return xi(r,e,s),o||n.value++,!0},deleteProperty(t,e){const i=r[e];return i&&(i[Symbol.dispose]?.(),delete r[e],n.value--),!0},ownKeys:t=>(n.value,Reflect.ownKeys(r)),has:(t,e)=>!0}),o=Object.getOwnPropertyDescriptors(t);for(const e in t){const n=o[e];if(n?.get){const t=_i(n.get.bind(s));t._set=n.set?.bind(s),r[e]=t}else r[e]=null,xi(r,e,t[e])}return s},Ai=t=>{let e;const r=pi(t.length),n=Array(t.length).fill(),i=new Proxy(n,{get:(i,s)=>"symbol"==typeof s?s===bi?r:s===yi?n:n[s]:"length"===s?Ti.includes(e)?r.peek():r.value:(e=s,n[s]||(n[s]=pi(ki(t[s]))),n[s].valueOf()),set(t,e,s){if("length"===e){for(let t=s;t<n.length;t++)delete i[t];return r.value=n.length=s,!0}return xi(n,e,s),e>=r.peek()&&(r.value=n.length=+e+1),!0},deleteProperty:(t,e)=>(n[e]?.[Symbol.dispose]?.(),delete n[e],!0)});return i},Oi=t=>{const e=Li(`${t}=${wi}`);return(t,r)=>{t[wi]=r,e(t)}},Si=Symbol.dispose||=Symbol("dispose"),Ci=Symbol("state"),Mi=Symbol("on"),Ei=Symbol("off"),Di={},Pi={};let Ni,Ri=":";const zi=(t,e,r=Li)=>{Di[t]=(t,n,i,s)=>{const o=e(t,i,n,s),a=r(n,":"+s);return()=>o(a(i))}},Li=(t,e)=>{const r=t.trim();if(Pi[r])return Pi[r];let n;try{n=Ni(r)}catch(t){Fi(t,e,r)}const i=t=>{try{return n(t)}catch(t){Fi(t,e,r)}};return Pi[r]=i,i},Fi=(t,e="",r="")=>{const n=r?`="${r}"\n\n`:"",i=`◆ ${t.message}\n\n${e}${n}`;throw Object.assign(t,{message:i,expr:r})},Bi=(t,e=t.attributes,r,n,i)=>{if(!e)return;let s=0;for(;s<e.length;){const o=e[s],{name:a,value:u}=o;if(a.startsWith(Ri)){t.removeAttribute(a);const e=a.slice(Ri.length).split(":");for(const s of e){const e=(Di[s]||Di.default)(t,u,r,s);if(n.push(e),i.push(mi(e)),null===t[Ci])return}}else s++}for(const e of t.childNodes)1===e.nodeType&&Bi(e,e.attributes,r,n,i)},Ii=(t=document.body,e)=>{if(t[Ci])return Object.assign(t[Ci],e);const r=ki(e||{}),n=[],i=[];return Bi(t,t.attributes,r,i,n),Ci in t||(t[Ci]=r,t[Ei]=()=>{n.forEach(t=>t()),n.length=0},t[Mi]=()=>{n.length=0,n.push(...i.map(t=>mi(t)))},t[Si]=()=>{t[Ei](),t[Ei]=null,t[Mi]=null,t[Si]=null,t[Ci]=null}),r};Ii.use=t=>{var e;t.signal&&(pi=(e=t).signal,mi=e.effect,_i=e.computed,gi=e.batch||gi,vi=e.untracked||vi),t.compile&&(Ni=t.compile),t.prefix&&(Ri=t.prefix)};const qi=t=>{if(!t.nodeType)return t;const e=t.content.cloneNode(!0),r=[...t.attributes],n=document.createTextNode("");e.append(n);const i=[...e.childNodes];return{childNodes:i,content:e,remove(){e.append(...i)},replaceWith(t){t!==n&&(n.before(t),e.append(...i))},attributes:r,removeAttribute(t){const e=r.findIndex(e=>e.name===t);-1!==e&&r.splice(e,1)}}},ji=Symbol("if");zi("if",(t,e)=>{const r=document.createTextNode("");let n,i,s,o=t.nextElementSibling;return t.replaceWith(r),i=t.content?qi(t):t,i[Ci]=null,o?.hasAttribute(":else")?(o.removeAttribute(":else"),o.hasAttribute(":if")||(o.remove(),s=o.content?qi(o):o,s[Ci]=null)):o=null,(a,u=(t[ji]?null:a?i:s))=>{o&&(o[ji]=t[ji]||u==i),n!=u&&(n&&(n.remove(),n[Ei]?.()),(n=u)&&(r.before(n.content||n),null===n[Ci]?(delete n[Ci],Ii(n,e)):n[Mi]()))}}),zi("each",(t,e,r)=>{const[n,i="$"]=r.split(/\bin\b/)[0].trim().split(/\s*,\s*/),s=document.createTextNode("");let o,a,u,l=0;const c=()=>{const r=u,c=r.length;let h=0;if(o&&!o[bi]){for(const t of o[yi]||[])t[Symbol.dispose]();o=null,l=0}if(c<l)o.length=c;else{if(o)for(;h<l;)o[h]=r[h],h++;else o=r;for(;h<c;h++){o[h]=r[h];const u=h,l=ki({[n]:o[yi]?.[u]||o[u],[i]:a?a[u]:u},e),c=t.content?qi(t):t.cloneNode(!0);s.before(c.content||c),Ii(c,l);const f=((o[yi]||=[])[h]||={})[Symbol.dispose];o[yi][h][Symbol.dispose]=()=>{f?.(),c[Symbol.dispose]?.(),c.remove()}}}l=c};return t.replaceWith(s),t[Ci]=null,t=>{a=null,"number"==typeof t?u=Array.from({length:t},(t,e)=>e+1):t?.constructor===Object?(a=Object.keys(t),u=Object.values(t)):u=t||[];let e=0;return mi(()=>{u[bi],e++||(c(),queueMicrotask(()=>{e>1&&c(),e=0}))})}},t=>Li(t.split(/\bin\b/)[1])),zi("ref",(t,e,r)=>"function"==typeof Li(r)(e)?e=>e?.call(null,t):(Oi(r)(e,t),t=>t)),zi("with",(t,e)=>{let r;return n=>{r?Ii(t,n):vi(()=>{r=ki(n,e),Ii(t,r)})}}),zi("text",t=>{if(t.content){const e=qi(t).childNodes[0];t.replaceWith(e),t=e}return e=>{t.textContent=e??""}}),zi("class",t=>{let e=new Set;return r=>{const n=new Set;r&&("string"==typeof r?r.split(" ").forEach(t=>n.add(t)):Array.isArray(r)?r.forEach(t=>t&&n.add(t)):Object.entries(r).forEach(([t,e])=>e&&n.add(t)));for(const r of e)n.has(r)?n.delete(r):t.classList.remove(r);for(const e of n)t.classList.add(e);e=n}}),zi("style",t=>{const e=t.getAttribute("style")||"";return r=>{if("string"==typeof r){const n=e&&!e.trim().endsWith(";"),i=e+(e&&n?"; ":"")+r;return void t.setAttribute("style",i)}e&&t.setAttribute("style",e);for(const e in r){const n=r[e];e.startsWith("-")?t.style.setProperty(e,n):t.style[e]=n}}}),zi("default",(t,e,r,n)=>{if(!n.startsWith("on"))return n?e=>Xi(t,n,e):e=>{for(const r in e)Xi(t,Ui(r),e[r])};const i=n.split("..").map(e=>function(t,e){const r={evt:"",target:e,test:()=>!0};return r.evt=(t.startsWith("on")?t.slice(2):t).replace(/\.(\w+)?-?([-\w]+)?/g,(t,e,n="")=>(r.test=$i[e]?.(r,...n.split("-"))||r.test,"")),r}(e,t)),s=(t,r)=>{const{evt:n,target:i,test:s,defer:o,stop:a,prevent:u,immediate:l,...c}=r,h=r=>{try{if(!s(r))return;a&&(l?r.stopImmediatePropagation():r.stopPropagation()),u&&r.preventDefault(),t?.call(e,r)}catch(e){Fi(e,`:on${n}`,t)}},f=o?o(h):h;return i.addEventListener(n,f,c),()=>i.removeEventListener(n,f,c)};if(1===i.length)return t=>s(t,i[0]);let o,a,u,l=0;const c=t=>{u=s(e=>{u(),a=t?.(e),l=(l+1)%i.length,l?c(a):o&&c(o)},i[l])};return t=>(o=t,u||c(o),()=>{o=null})});const $i={prevent(t){t.prevent=!0},stop(t){t.stop=!0},immediate(t){t.immediate=!0},once(t){t.once=!0},passive(t){t.passive=!0},capture(t){t.capture=!0},window(t){t.target=window},document(t){t.target=document},parent(t){t.target=t.target.parentNode},throttle(t,e=108){t.defer=t=>Wi(t,e)},debounce(t,e=108){t.defer=t=>Vi(t,e)},outside:t=>e=>{const r=t.target;return!r.contains(e.target)&&(!1!==e.target.isConnected&&!(r.offsetWidth<1&&r.offsetHeight<1))},self:t=>e=>e.target===t.target,ctrl:(t,...e)=>t=>Yi.ctrl(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),shift:(t,...e)=>t=>Yi.shift(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),alt:(t,...e)=>t=>Yi.alt(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),meta:(t,...e)=>t=>Yi.meta(t)&&e.every(e=>Yi[e]?Yi[e](t):t.key===e),arrow:()=>Yi.arrow,enter:()=>Yi.enter,esc:()=>Yi.esc,tab:()=>Yi.tab,space:()=>Yi.space,delete:()=>Yi.delete,digit:()=>Yi.digit,letter:()=>Yi.letter,char:()=>Yi.char},Yi={ctrl:t=>t.ctrlKey||"Control"===t.key||"Ctrl"===t.key,shift:t=>t.shiftKey||"Shift"===t.key,alt:t=>t.altKey||"Alt"===t.key,meta:t=>t.metaKey||"Meta"===t.key||"Command"===t.key,arrow:t=>t.key.startsWith("Arrow"),enter:t=>"Enter"===t.key,esc:t=>t.key.startsWith("Esc"),tab:t=>"Tab"===t.key,space:t=>" "===t.key||"Space"===t.key||" "===t.key,delete:t=>"Delete"===t.key||"Backspace"===t.key,digit:t=>/^\d$/.test(t.key),letter:t=>/^\p{L}$/gu.test(t.key),char:t=>/^\S$/.test(t.key)},Wi=(t,e)=>{let r=!1,n=!1;const i=s=>{r=!0,setTimeout(()=>{r=!1,n&&(n=!1,i(s),t(s))},e)};return e=>{if(!r)return i(e),t(e);n=!0}},Vi=(t,e)=>{let r;return n=>{clearTimeout(r),r=setTimeout(()=>{r=null,t(n)},e)}},Xi=(t,e,r)=>{null==r||!1===r?t.removeAttribute(e):t.setAttribute(e,!0===r?"":"number"==typeof r||"string"==typeof r?r:"")},Ui=t=>t.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,(t,e)=>(e?"-":"")+t.toLowerCase());zi("value",(t,e,r)=>{const n=t.type||"",i=t.tagName,s=e=>{const r=e??"";t.value=r,t.setAttribute("value",r)},o=t=>s(t),a=e=>{const r=t.selectionStart,n=t.selectionEnd;s(e),r&&t.setSelectionRange(r,n)},u=e=>{t.checked=e,Xi(t,"checked",e)},l=e=>{t.value===e&&(t.checked=e,Xi(t,"checked",e))},c=e=>{for(const r of t.options)r.value==e?r.setAttribute("selected",""):r.removeAttribute("selected");t.value=e},h=e=>{for(const e of t.options)e.removeAttribute("selected");for(const r of e)t.querySelector(`[value="${r}"]`)?.setAttribute("selected","")},f=e=>{t.value=e},d=(()=>{if("TEXTAREA"===i)return a;switch(n){case"text":case"":return o;case"checkbox":return u;case"radio":return l;case"select-one":return c;case"select-multiple":return h;default:return f}})();try{const i=Oi(r),s="checkbox"===n?()=>i(e,t.checked):"select-multiple"===n?()=>i(e,[...t.selectedOptions].map(t=>t.value)):()=>i(e,t.selectedIndex<0?null:t.value);t.oninput=t.onchange=s,n?.startsWith("select")&&(new MutationObserver(s).observe(t,{childList:!0,subtree:!0,attributes:!0}),Ii(t,e)),Li(r)(e)??s()}catch{}return d}),zi("fx",t=>t=>t),zi("aria",t=>e=>{for(const r in e){const n=e[r];Xi(t,`aria-${Ui(r)}`,null==n?null:String(n))}}),zi("data",t=>e=>{for(const r in e)t.dataset[r]=e[r]}),Ii.use({compile:t=>Ii.constructor(`with (arguments[0]) { return ${t} };`)});const Hi=Symbol("persist"),Gi=t=>{try{return JSON.stringify(t,(t,e)=>{if("function"!=typeof e&&(!e||"object"!=typeof e||e.constructor===Object||Array.isArray(e)))return e})}catch{return"{}"}},Ji=t=>{try{return JSON.parse(t)}catch{return{}}},Ki=(t,e,r={})=>{const n={key:e,storage:globalThis.localStorage,paths:null,debounce:0,serializer:Gi,deserializer:Ji,...r};if(!(t=>{try{const e="__storage_test__";return t.setItem(e,"test"),t.removeItem(e),!0}catch{return!1}})(n.storage))return console.warn(`persistence: ${n.storage===globalThis.localStorage?"localStorage":"storage"} is not available`),()=>{};let i=!1;const s=((t,e)=>{let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(...n),e)}})(()=>{if(!i)try{const e=((t,e)=>{const r={};if(e)for(const n of e)n in t&&(r[n]=t[n]);else{const e=t[yi];for(const n in e){const i=e[n];i&&!i._set&&"_"!==n[0]&&(r[n]=t[n])}}return r})(t,n.paths),r=n.serializer(e);n.storage.setItem(n.key,r)}catch(t){console.warn("persistence: failed to save state",t)}},n.debounce),o=()=>{try{const e=n.storage.getItem(n.key);if(!e)return;const r=n.deserializer(e);if(!r||"object"!=typeof r)return;i=!0;for(const e in r)e in t[yi]&&!t[yi][e]?._set&&(t[e]=r[e]);i=!1}catch(t){console.warn("persistence: failed to restore state",t),i=!1}};o();const a=mi(()=>{if(n.paths)for(const e of n.paths)t[e];else{const e=t[yi];for(const r in e){const n=e[r];n&&!n._set&&"_"!==r[0]&&t[r]}}s()});return t[Hi]={config:n,saveState:s,restoreState:o},a},Qi=new Map,Zi={store:(t,e,r={})=>{if(void 0!==e){const n=ki(e);if(Qi.set(t,n),!0===r||r.persist){const e=!0===r?{}:{...r};delete e.persist,((t,e,r={})=>{!0===r&&(r={}),Ki(t,e,r)})(n,t,e)}return n}const n=Qi.get(t);return n||(console.warn(`store "${t}" not found`),{})}};async function ts(t){const e=t.querySelector("script[r-mod]"),r=t.querySelector("[r-scope]");if(!e)return;if(!r)return void console.warn("r-mod found but no r-scope element in container");t.querySelectorAll("[r-scope]").length>1&&console.warn("multiple r-scope elements found, using first one only");const n=e.textContent.trim();if(!n)return;const i=await async function(t){try{const e=`\nconst sprae = window._riftSprae;\nconst { signal, effect, computed } = window._riftSignal;\nconst store = window._riftStore;\nconst r = window.r;\n\n${t}\n`,r=`data:text/javascript;charset=utf-8,${encodeURIComponent(e)}#${Date.now()}`,n=await import(r),i={};for(const[t,e]of Object.entries(n))"default"!==t&&(i[t]=e);return i}catch(t){return console.error("module evaluation error:",t),{}}}(n),s=Ii(r,i);return e.remove(),s}async function es(t){await ts(t)}window.signal=pi,window.r=Zi;const rs=function(t){const e={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},r=Zn;for(const r of oi)for(const n of t){const t=n[r];void 0!==t&&e[r].push(t)}function n(t){const e=t.id?"#"+t.id:"",n=t.getAttribute("class"),i=n?"."+n.split(" ").join("."):"";return ti(r.tagName(t).toLowerCase()+e+i,{},[],void 0,t)}function i(t){return ti(void 0,{},[],void 0,t)}function s(t,e){return function(){if(0===--e){const e=r.parentNode(t);null!==e&&r.removeChild(e,t)}}}function o(t,n){var i,s,a;let u;const l=t.data,c=null==l?void 0:l.hook;null===(i=null==c?void 0:c.init)||void 0===i||i.call(c,t);const h=t.children,f=t.sel;if("!"===f)null!==(s=t.text)&&void 0!==s||(t.text=""),t.elm=r.createComment(t.text);else if(""===f)t.elm=r.createTextNode(t.text);else if(void 0!==f){const i=f.indexOf("#"),s=f.indexOf(".",i),d=i>0?i:f.length,p=s>0?s:f.length,m=-1!==i||-1!==s?f.slice(0,Math.min(d,p)):f,_=null==l?void 0:l.ns,g=void 0===_?r.createElement(m,l):r.createElementNS(_,m,l);for(t.elm=g,d<p&&g.setAttribute("id",f.slice(d+1,p)),s>0&&g.setAttribute("class",f.slice(p+1).replace(/\./g," ")),u=0;u<e.create.length;++u)e.create[u](ni,t);if(!ri(t.text)||ei(h)&&0!==h.length||r.appendChild(g,r.createTextNode(t.text)),ei(h))for(u=0;u<h.length;++u){const t=h[u];null!=t&&r.appendChild(g,o(t,n))}void 0!==c&&(null===(a=c.create)||void 0===a||a.call(c,ni,t),void 0!==c.insert&&n.push(t))}else t.elm=r.createTextNode(t.text);return t.elm}function a(t,e,n,i,s,a){for(;i<=s;++i){const s=n[i];null!=s&&r.insertBefore(t,o(s,a),e)}}function u(t){var r,n;const i=t.data;if(void 0!==i){null===(n=null===(r=null==i?void 0:i.hook)||void 0===r?void 0:r.destroy)||void 0===n||n.call(r,t);for(let r=0;r<e.destroy.length;++r)e.destroy[r](t);if(void 0!==t.children)for(let e=0;e<t.children.length;++e){const r=t.children[e];null!=r&&"string"!=typeof r&&u(r)}}}function l(t,n,i,o){for(var a,c;i<=o;++i){let o;const h=n[i];if(null!=h)if(void 0!==h.sel){u(h),o=e.remove.length+1;const t=s(h.elm,o);for(let r=0;r<e.remove.length;++r)e.remove[r](h,t);const r=null===(c=null===(a=null==h?void 0:h.data)||void 0===a?void 0:a.hook)||void 0===c?void 0:c.remove;void 0!==r?r(h,t):t()}else h.children?(u(h),l(t,h.children,0,h.children.length-1)):r.removeChild(t,h.elm)}}function c(t,n,i){var s,u,h,f,d,p,m,_;const g=null===(s=n.data)||void 0===s?void 0:s.hook;null===(u=null==g?void 0:g.prepatch)||void 0===u||u.call(g,t,n);const v=n.elm=t.elm;if(t===n)return;if(void 0!==n.data||void 0!==n.text&&n.text!==t.text){null!==(h=n.data)&&void 0!==h||(n.data={}),null!==(f=t.data)&&void 0!==f||(t.data={});for(let r=0;r<e.update.length;++r)e.update[r](t,n);null===(m=null===(p=null===(d=n.data)||void 0===d?void 0:d.hook)||void 0===p?void 0:p.update)||void 0===m||m.call(p,t,n)}const y=t.children,b=n.children;void 0===n.text?void 0!==y&&void 0!==b?y!==b&&function(t,e,n,i){let s,u,h,f,d=0,p=0,m=e.length-1,_=e[0],g=e[m],v=n.length-1,y=n[0],b=n[v];for(;d<=m&&p<=v;)null==_?_=e[++d]:null==g?g=e[--m]:null==y?y=n[++p]:null==b?b=n[--v]:ii(_,y)?(c(_,y,i),_=e[++d],y=n[++p]):ii(g,b)?(c(g,b,i),g=e[--m],b=n[--v]):ii(_,b)?(c(_,b,i),r.insertBefore(t,_.elm,r.nextSibling(g.elm)),_=e[++d],b=n[--v]):ii(g,y)?(c(g,y,i),r.insertBefore(t,g.elm,_.elm),g=e[--m],y=n[++p]):(void 0===s&&(s=si(e,d,m)),u=s[y.key],void 0===u?(r.insertBefore(t,o(y,i),_.elm),y=n[++p]):void 0===s[b.key]?(r.insertBefore(t,o(b,i),r.nextSibling(g.elm)),b=n[--v]):(h=e[u],h.sel!==y.sel?r.insertBefore(t,o(y,i),_.elm):(c(h,y,i),e[u]=void 0,r.insertBefore(t,h.elm,_.elm)),y=n[++p]));p<=v&&(f=null==n[v+1]?null:n[v+1].elm,a(t,f,n,p,v,i)),d<=m&&l(t,e,d,m)}(v,y,b,i):void 0!==b?(void 0!==t.text&&r.setTextContent(v,""),a(v,null,b,0,b.length-1,i)):void 0!==y?l(v,y,0,y.length-1):void 0!==t.text&&r.setTextContent(v,""):t.text!==n.text&&(void 0!==y&&l(v,y,0,y.length-1),r.setTextContent(v,n.text)),null===(_=null==g?void 0:g.postpatch)||void 0===_||_.call(g,t,n)}return function(t,s){let a,u,h;const f=[];for(a=0;a<e.pre.length;++a)e.pre[a]();for(!function(t,e){return t.isElement(e)}(r,t)?function(t,e){return t.isDocumentFragment(e)}(r,t)&&(t=i(t)):t=n(t),ii(t,s)?c(t,s,f):(u=t.elm,h=r.parentNode(u),o(s,f),null!==h&&(r.insertBefore(h,s.elm,r.nextSibling(u)),l(h,[t],0,0))),a=0;a<f.length;++a)f[a].data.hook.insert(f[a]);for(a=0;a<e.post.length;++a)e.post[a]();return s}}([fi,ci]);function ns(t){const e=[],r=t.replace(/:([^/]+)/g,(t,r)=>(e.push(r),"([^/]+)"));return{regex:new RegExp(`^${r}$`),keys:e}}function is(t,e){for(const r of e){const{regex:e,keys:n}=ns(r.path),i=t.match(e);if(i){const t={};return n.forEach((e,r)=>t[e]=i[r+1]),{route:r,params:t}}}return null}function ss(t,e){const r=[],n=t.split("/").filter(Boolean);for(let t=1;t<n.length;t++){const i=`/${n.slice(0,t).join("/")}`;for(const t of e){const{regex:e,keys:n}=ns(t.path),s=i.match(e);if(s){const e={};n.forEach((t,r)=>e[t]=s[r+1]),r.push({route:t,params:e});break}}}return r}function os(t){if(3===t.nodeType)return t.textContent;if(1===t.nodeType){const e={};return t.attributes&&t.attributes.length>0&&(e.attrs={},Array.from(t.attributes).forEach(t=>{e.attrs[t.name]=t.value})),t.className&&(e.class=t.className.split(" ").reduce((t,e)=>(e&&(t[e]=!0),t),{})),ui(t.tagName.toLowerCase(),e,Array.from(t.childNodes).map(t=>os(t)))}return null}async function as(t,e,r,n,i=!1,s=!1){let o="function"==typeof e?e({}):e;n&&(o={...o,dataset:n});const a=await fetch(`/templates/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(t=>t.text());if(s){const t=document.createElement("div");t.innerHTML=a;const e=Array.from(t.querySelectorAll("script")),n=e.map(t=>({element:t,src:t.src,content:t.textContent,attrs:Array.from(t.attributes).reduce((t,e)=>(t[e.name]=e.value,t),{})}));e.forEach(t=>t.remove());const i=r.firstElementChild,s=t.firstElementChild;if(i)if(s)if(i.__snabbdomVNode){const t=os(s);i.__snabbdomVNode=rs(i.__snabbdomVNode,t)}else{os(i);const t=os(s);i.__snabbdomVNode=rs(i,t)}else r.innerHTML=a;else r.innerHTML=t.innerHTML;n.forEach(({src:t,content:e,attrs:n})=>{const i=document.createElement("script");e&&(e.includes("export ")||e.includes("import "))&&(i.type="module"),Object.entries(n).forEach(([t,e])=>{i.setAttribute(t,e)}),t?i.src=t:i.textContent=e,r.appendChild(i)})}else{r.innerHTML=a;const t=r.firstElementChild;t&&t.__snabbdomVNode&&delete t.__snabbdomVNode}await es(r),await ds(r,i),await cs(r,i)}async function us(t,e){if(e)return new Promise(r=>{requestAnimationFrame(()=>{const n={...e,from:void 0};n.onComplete=r,e.from?Gn.fromTo(t,e.from,n):Gn.to(t,n)})})}function ls(t){try{return JSON.parse(t)}catch(e){try{return Function(`"use strict"; return (${t})`)()}catch(t){throw new Error("invalid JSON syntax")}}}async function cs(t,e=!1){if(e)return;const r=[];if(t.hasAttribute("r-transition-stagger-in"))try{const e=ls(t.getAttribute("r-transition-stagger-in")),n=Array.from(t.children);n.length>0&&(Gn.set(n,e.from||{}),r.push(us(n,e)))}catch(t){console.warn("invalid transition data on container stagger element:",t)}const n=t.querySelectorAll("[r-transition-stagger-in]");for(const t of n)try{const e=ls(t.getAttribute("r-transition-stagger-in")),n=Array.from(t.children);n.length>0&&(Gn.set(n,e.from||{}),r.push(us(n,e)))}catch(t){console.warn("invalid transition data on stagger element:",t)}if(t.hasAttribute("r-transition-in"))try{const e=ls(t.getAttribute("r-transition-in"));Gn.set(t,e.from||{}),r.push(us(t,e))}catch(t){console.warn("invalid transition data on container element:",t)}const i=t.querySelectorAll("[r-transition-in]");for(const t of i){const e=t.closest("[r-transition-stagger-in]");if(!e||e===t)try{const e=ls(t.getAttribute("r-transition-in"));Gn.set(t,e.from||{}),r.push(us(t,e))}catch(t){console.warn("invalid transition data on element:",t)}}Promise.all(r)}function hs(t){const e=[];if(t.hasAttribute("r-transition-stagger-in")){const r=ls(t.getAttribute("r-transition-stagger-in")),n=Array.from(t.children);n.length>0&&(e.push({type:"stagger",elements:n,transition:r}),Gn.set(n,r.from||{})),t.removeAttribute("r-transition-stagger-in")}if(t.hasAttribute("r-transition-in")){const r=ls(t.getAttribute("r-transition-in"));e.push({type:"individual",elements:t,transition:r}),Gn.set(t,r.from||{}),t.removeAttribute("r-transition-in")}return e}function fs(t){for(const{elements:e,transition:r}of t)us(e,r)}async function ds(t,e=!1){const r=t.querySelectorAll("[r-tpl]");for(const t of r){const r=t.getAttribute("r-tpl"),n=t.getAttribute("r-tpl-props"),i=t.getAttribute("r-dataset");let s=n?ls(n):{};i&&(s={...s,dataset:i});const o=await fetch(`/templates/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(t=>t.text());t.innerHTML=o,await es(t),await ds(t,e),await cs(t,e)}}function ps(t){const e={},r=new URLSearchParams(t);for(const[t,n]of r)e[t]=n;return e}function ms(t){let e=null;async function r({path:r,initial:n=!1,linkProps:i=null,linkTarget:s=null,linkDataset:o=null}){const[a,u=""]=r.split("?"),l=is(a,t);if(!l)return console.error("rift: route not found:",a);const{route:c,params:h}=l,f=ps(u);let d;if(n&&document.body.classList.add("loading"),c.renders)d=c.renders;else{const n=ss(r,t),i={template:c.template,props:c.props,target:c.target};d=[...n.filter(({route:t})=>!e||!e.startsWith(`${t.path}/`)&&e!==t.path).map(({route:t,params:e})=>({template:t.template,props:t.props,target:t.target,dataset:t.dataset,params:e,skipTransition:!1})),...n.filter(({route:t})=>e?.startsWith(`${t.path}/`)).map(({route:t,params:e})=>({template:t.template,props:t.props,target:t.target,dataset:t.dataset,params:e,skipTransition:!0})),{...i,skipTransition:!1}]}for(const t of d){const e=t.params||h;let r="function"==typeof t.props?t.props(e,f):t.props;i&&(r={...r,...i});const a=s&&document.querySelector(s)||t.target&&document.querySelector(t.target)||document.getElementById("main"),u=o||t.dataset||c.dataset;a.id,Gn.killTweensOf(a),Gn.set(a,{clearProps:"all"}),a.classList.add("loading"),await as(t.template,r,a,u,n||t.skipTransition,c.diff||!1),a.classList.remove("loading")}n&&document.body.classList.remove("loading"),e=r,n=!1,window.dispatchEvent(new CustomEvent("navigate"))}return{navigate:r,init:function(){document.addEventListener("click",t=>{const e=t.target.closest("[r-link]");if(!e)return;t.preventDefault();const n=e.getAttribute("href"),i=e.getAttribute("r-dataset"),s=e.getAttribute("r-dataset-props"),o=e.getAttribute("r-target");history.pushState({},"",n),window.dispatchEvent(new CustomEvent("navigate")),r({path:n,linkProps:s?ls(s):null,linkDataset:i,linkTarget:o})}),window.addEventListener("popstate",()=>r({path:location.pathname+location.search}))},hydrateNestedTemplates:ds,processElementTransitions:cs,captureGlobalTransitions:hs,runGlobalTransitions:fs,refresh:async(e={})=>{const r=async()=>{const{path:r=location.pathname+location.search,parents:n=!1,diff:i=!1}=e,[s,o=""]=r.split("?"),a=is(s,t);if(!a)return console.error("rift: route not found:",s);const{route:u,params:l}=a,c=ps(o);if(n){const e=[...ss(r,t),{route:u,params:l}],n=new Set;for(let t=e.length-1;t>=0;t--){const r=e[t].route.target||"#main";if(!n.has(r)&&(n.add(r),t<e.length-1)){const{route:n,params:s}=e[t],o=document.querySelector(r)||document.getElementById("main"),a="function"==typeof n.props?n.props(s,c):n.props;await as(n.template,a,o,n.dataset,!0,i||n.diff||!1)}}}const h=document.querySelector(u.target)||document.getElementById("main"),f="function"==typeof u.props?u.props(l,c):u.props;await as(u.template,f,h,u.dataset,!0,i||u.diff||!1)};document.startViewTransition?document.startViewTransition(r):await r()},refreshTemplate:async(e,r={},n={})=>{const{diff:i=!1}=n,s=[];document.querySelectorAll(`[r-tpl="${e}"]`).forEach(t=>{s.push(async()=>{const n=await fetch(`/templates/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)return console.error("failed to fetch template:",e);const s=await n.text();i?await as(e,r,t,null,!0,!0):(t.innerHTML=s,await es(t))})});if(t.filter(t=>t.template===e).forEach(t=>{const e=document.querySelector(t.target)||document.getElementById("main");e&&s.push(async()=>{const r=location.pathname+location.search,n=is(r,[t]);if(n){const{params:s}=n,[,o=""]=r.split("?"),a=ps(o),u="function"==typeof t.props?t.props(s,a):t.props;await as(t.template,u,e,t.dataset,!0,i||t.diff||!1)}})}),0===s.length)return console.error("no templates found with name:",e);const o=async()=>{await Promise.all(s.map(t=>t()))};document.startViewTransition?document.startViewTransition(o):await o()}}}function _s(){document.addEventListener("mousedown",t=>{const e=t.target.closest(".ripple");if(!e)return;const r=document.createElement("span");r.classList.add("ripple-effect");const n=Math.max(e.clientWidth,e.clientHeight);r.style.width=r.style.height=`${n}px`;const i=e.getBoundingClientRect();r.style.left=t.clientX-i.left-n/2+"px",r.style.top=t.clientY-i.top-n/2+"px",e.appendChild(r),r.addEventListener("animationend",()=>r.remove())})}function gs(t){window._riftRouter=t,document.addEventListener("DOMContentLoaded",async function(){const e=t.captureGlobalTransitions(document.body);await t.hydrateNestedTemplates(document.body,!0),await t.navigate({path:location.pathname+location.search,initial:!0}),document.body.classList.remove("loading"),e.length>0&&requestAnimationFrame(()=>{t.runGlobalTransitions(e)})}),t.init()}function vs(t){const e=ms(t);_s(),gs(e)}window._riftSprae=Ii,window._riftSignal={signal:pi,effect:mi,computed:_i},window._riftStore=ki,window.r=Zi;export{ms as createRouter,vs as default,_s as initRipple,gs as mount,Zi as r,ki as store};
|