@ssgoi/core 7.0.0-beta.1 → 7.0.0-beta.2
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/internal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Bt=Object.defineProperty;var Ft=(t,e,n)=>e in t?Bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var G=(t,e,n)=>Ft(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("./multi-animation-6124HEke.cjs");class kt extends it.Animation{constructor(){super(...arguments);G(this,"child",null);G(this,"_state","idle");G(this,"_settled",!1);G(this,"listeners",new Set)}attach(n){const o=this.child;if(this.child=n,this._settled=!1,o){const a=o.getPose();o.complete(),n.matchInto(a)}n.playbackRate=this.playbackRate;const s=n.onComplete;n.onComplete=()=>{s==null||s(),this.child===n&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const i=n.onUpdate;n.onUpdate=a=>{var l;i==null||i(a),(l=this.onUpdate)==null||l.call(this,a),this.notify()},this._state==="paused"?n.pause():this._state==="reversing"?n.reverse():(this._state="playing",n.play()),this.notify()}play(){var n;this._state="playing",this._settled=!1,(n=this.child)==null||n.play(),this.notify()}reverse(){var n;this._state="reversing",this._settled=!1,(n=this.child)==null||n.reverse(),this.notify()}pause(){var n;this._state="paused",(n=this.child)==null||n.pause(),this.notify()}complete(){var n;(n=this.child)==null||n.complete(),this.notify()}get isAnimating(){var n;return((n=this.child)==null?void 0:n.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var n;return((n=this.child)==null?void 0:n.isReversing)??this._state==="reversing"}get progress(){var n;return((n=this.child)==null?void 0:n.progress)??0}findTimeForProgress(n){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(n))??null}get playbackRate(){return super.playbackRate}set playbackRate(n){super.playbackRate=n,this.child&&(this.child.playbackRate=n),this.notify()}getPose(){var n;return((n=this.child)==null?void 0:n.getPose())??[]}getTimeline(){var n;return((n=this.child)==null?void 0:n.getTimeline())??[]}matchInto(n){var o;(o=this.child)==null||o.matchInto(n)}get activeChild(){return this.child}subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}notify(){for(const n of this.listeners)n()}}const zt=(t,e)=>{var n;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((n=e==null?void 0:e.scrollOffset)==null?void 0:n.y)??0)}px`,t.style.left="0"},bt=new Set(["auto","scroll","overlay"]),Kt=t=>{let e=t.parentElement;for(;e&&e!==document.body;){const n=window.getComputedStyle(e);if(bt.has(n.overflowY)||bt.has(n.overflowX))return e;e=e.parentElement}return document.documentElement},Xt=t=>{let e=t.parentElement;for(;e&&e!==document.body;){const n=window.getComputedStyle(e).position;if(n==="relative"||n==="absolute"||n==="fixed"||n==="sticky")return e;e=e.parentElement}return document.body};function $t(t){const e=Object.keys(t);return Promise.all(e.map(n=>t[n])).then(n=>{const o={};return e.forEach((s,i)=>{o[s]=n[i]}),o})}const qt=1e6,Et=100,Gt=10,Ut=1;function Vt(t){const e=t.trim(),n=e.indexOf("#"),o=e.indexOf("?"),s=[n,o].filter(i=>i>=0).reduce((i,a)=>Math.min(i,a),e.length);return e.slice(0,s)}function V(t){const e=Vt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))return V(new URL(e).pathname)}catch{}const o=(e.startsWith("/")?e:`/${e}`).replace(/\/+/g,"/");return(o.length>1?o.replace(/\/+$/g,""):o)||"/"}function Yt(t){const e=t.trim();return e==="*"?"/**":V(e)}function ut(t){return t==="/"?[]:t.slice(1).split("/")}function Zt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function Ot(t,e){const n=V(t),o=Yt(e);if(n===o)return{matched:!0,specificity:qt+ut(o).length*Et,pattern:e};const s=ut(n),i=ut(o);let a=0;for(let l=0;l<i.length;l++){const f=i[l],u=s[l],y=l===i.length-1;if(f==="**")return{matched:y&&s.length>=l,specificity:a,pattern:e};if(u===void 0||f===void 0)return{matched:!1,specificity:0,pattern:e};if(f==="*"){a+=Ut;continue}if(Zt(f)){a+=Gt;continue}if(f!==u)return{matched:!1,specificity:0,pattern:e};a+=Et}return{matched:s.length===i.length,specificity:a,pattern:e}}function N(t,e){const n=typeof e=="string"?[e]:e;let o=null;for(const s of n){const i=Ot(t,s);i.matched&&(!o||i.specificity>o.specificity)&&(o=i)}return o}function jt(t,e){return Ot(t,e).matched}const Qt=768,Jt=10,te=10;function ee(t={}){const{preserveScroll:e=v=>v,resolvePath:n=v=>v}=t,o=typeof e=="function"?e:()=>e;let s=null,i=!1,a=!1;const l=()=>{const v=(s==null?void 0:s.clientWidth)??0,g=v>0?v:typeof window<"u"?window.innerWidth:0;return g>0&&g<Qt},f=()=>(a||(i=l(),a=!0),i),u=v=>{var _;const g=n(v),E=o(f());if(E===!1)return{preserves:!1,shared:!1,storageKey:`path:${g}`};if(E===!0)return{preserves:!0,shared:!1,storageKey:`path:${g}`};const P=((_=E.exclude)==null?void 0:_.some(D=>jt(g,D)))??!1,A=!P&&!!E.key;return{preserves:!P,shared:A,storageKey:A?`shared:${E.key}`:`path:${g}`}},y=v=>u(v).preserves;let h=null;const p=new Map;let w=null,O=!1,M=0;const R=()=>{s&&w&&!O&&p.set(u(w).storageKey,{x:s.scrollLeft,y:s.scrollTop})},K=v=>{if(!s)return;const g=u(v);if(g.preserves&&g.shared&&!p.has(g.storageKey))return;const E=g.preserves&&p.has(g.storageKey)?p.get(g.storageKey):{x:0,y:0};let P=0;const A=()=>{if(!s)return;s.scrollTo({top:E.y,left:E.x}),!(Math.abs(s.scrollTop-E.y)<1&&Math.abs(s.scrollLeft-E.x)<1)&&P<Jt&&(P++,requestAnimationFrame(A))};requestAnimationFrame(A)};return{initializeContext:(v,g)=>{O=!0;const E=++M;h=v,s||(s=Kt(v),i=l(),a=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{i=l()}).observe(s),(s===document.documentElement?window:s).addEventListener("scroll",R,{passive:!0})),w=g,K(g);let P=0;const A=()=>{E===M&&(P++,P>=te?O=!1:requestAnimationFrame(A))};requestAnimationFrame(A)},calculateScrollOffset:(v,g)=>{const E=v?u(v).storageKey:null,P=E&&p.has(E)?p.get(E):{x:0,y:0},A=g?u(g):null,_=A!=null&&A.preserves?A.storageKey:null,D=_&&p.has(_)?p.get(_):{x:0,y:0};return{x:-D.x+P.x,y:-D.y+P.y}},evictScrollPosition:v=>{p.delete(u(v).storageKey)},shouldPreserve:y,getScrollContainer:()=>s,getPositionedParentElement:()=>h?Xt(h):document.body,getScrollPosition:v=>{const g=v?u(v).storageKey:null;return g&&p.has(g)?p.get(g):{x:0,y:0}},getIsMobile:f}}const St=30,wt=8,Tt=1.2,Pt=30,ne=600;function ie(){let t=null,e=!1,n=!1,o=null,s=null,i=!1;const a=(b,S)=>{for(let T=0;T<b.length;T++){const k=b.item(T);if(k&&k.identifier===S)return k}return null},l=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{s!==null&&(clearTimeout(s),s=null)},u=()=>{e=!0,n=!0,l(),f(),o=setTimeout(()=>{e=!1,n=!1,o=null},ne)},y=b=>{if(b.touches.length!==1){t=null;return}const S=b.touches.item(0);if(!S){t=null;return}const T=window.innerWidth,k=S.clientX<=St,W=S.clientX>=T-St;if(!k&&!W){t=null;return}t={identifier:S.identifier,startX:S.clientX,startY:S.clientY,fromLeftEdge:k,moved:!1}},h=b=>{if(!t)return;if(b.touches.length!==1){t=null;return}const S=a(b.touches,t.identifier);if(!S){t=null;return}const T=S.clientX-t.startX,k=S.clientY-t.startY,W=Math.abs(T),F=Math.abs(k);if(F>wt&&F>W*Tt){t=null;return}const v=t.fromLeftEdge?T>0:T<0;W>wt&&W>F*Tt&&v&&(t.moved=!0)},p=b=>{if(!t)return;const S=a(b.changedTouches,t.identifier);if(!S){t=null;return}const T=S.clientX-t.startX,k=t.fromLeftEdge?T>0:T<0;if(t.moved&&k&&Math.abs(T)>=Pt){u(),t=null;return}t.moved&&Math.abs(T)>=Pt&&u(),t=null},w=()=>{t&&(t.moved&&u(),t=null)};return{initialize:()=>{if(typeof window>"u"||i)return;i=!0;const b={passive:!0,capture:!0};window.addEventListener("touchstart",y,b),window.addEventListener("touchmove",h,b),window.addEventListener("touchend",p,b),window.addEventListener("touchcancel",w,b)},destroy:()=>{if(typeof window>"u"||!i)return;i=!1;const b={capture:!0};window.removeEventListener("touchstart",y,b),window.removeEventListener("touchmove",h,b),window.removeEventListener("touchend",p,b),window.removeEventListener("touchcancel",w,b),l(),f(),t=null,e=!1,n=!1},isSwipeBack:()=>{const b=e||n;return b&&l(),b},onPageEnter:()=>{e=!1,l(),f(),s=setTimeout(()=>{n=!1,s=null},0)}}}function se(t,e){return e?t.priority!==e.priority?t.priority>e.priority:t.specificity!==e.specificity?t.specificity>e.specificity:t.ruleIndex<e.ruleIndex:!0}function oe(t,e,n,o){let s=null;return n.forEach((i,a)=>{const l=i.priority??0;let f=null;if(i.on!==void 0){const u=i.except!==void 0&&N(t,i.except)!==null,y=i.except!==void 0&&N(e,i.except)!==null,h=u?null:N(t,i.on),p=y?null:N(e,i.on);if(h||p){const w=!h&&p?"forward":h&&!p?"backward":o;f={transition:i.transition,direction:w,ruleIndex:a,priority:l,specificity:Math.max((h==null?void 0:h.specificity)??0,(p==null?void 0:p.specificity)??0),reason:!h&&p?"on-enter":h&&!p?"on-leave":"on-history"}}}else if(i.ordered!==void 0){let u=-1,y=-1,h=-1,p=-1;i.ordered.forEach((w,O)=>{const M=N(t,w);M&&M.specificity>h&&(u=O,h=M.specificity);const R=N(e,w);R&&R.specificity>p&&(y=O,p=R.specificity)}),u>=0&&y>=0&&u!==y&&(f={transition:i.transition,direction:u<y?"forward":"backward",ruleIndex:a,priority:l,specificity:h+p,reason:"ordered"})}else{const u=N(t,i.from),y=N(e,i.to),h=i.bidirectional===!1?null:N(t,i.to),p=i.bidirectional===!1?null:N(e,i.from),w=u&&y,O=h&&p;if(w||O){const M=w?u.specificity+y.specificity:-1,R=O?h.specificity+p.specificity:-1,K=w&&O&&M===R?o:M>=R?"forward":"backward";f={transition:i.transition,direction:K,ruleIndex:a,priority:l,specificity:Math.max(M,R),reason:"pair"}}}f&&se(f,s)&&(s=f)}),s}function re(){const t=[];let e=!1;const n=()=>{e=!0};return typeof window<"u"&&window.addEventListener("popstate",n),{resolve(o,s){const i=V(o),a=V(s);if(t.length===0)t.push(i);else if(t[t.length-1]!==i){const u=t.lastIndexOf(i);u>=0?t.splice(u+1):t.push(i)}const l=t[t.length-2],f=e||l===a?"backward":"forward";if(e=!1,f==="backward"){const u=t.lastIndexOf(a);u>=0?t.splice(u+1):t.push(a)}else t[t.length-1]!==a&&t.push(a);return f},dispose(){typeof window<"u"&&window.removeEventListener("popstate",n)}}}function ce(t={}){let e=null;function n(){var s,i;e&&((s=e.out)==null||s.resolve(null),(i=e.in)==null||i.resolve(null),e=null)}function o(){if(e!=null&&e.out&&e.in){if(e.out.path===e.in.path){n();return}const s={from:e.out.path,to:e.in.path,out:e.out.payload,in:e.in.payload};e.out.resolve(s),e.in.resolve(s),e=null}}return{arrive(s,i,a){return new Promise(l=>{var y,h;i==="out"&&((y=e==null?void 0:e.in)==null?void 0:y.path)===s&&!e.out&&(e.in.resolve(null),e.in=void 0);const f=e==null?void 0:e[i];f&&f.path!==s&&n(),e||(e={});const u=e[i];if(u){if(((h=t.keepCurrent)==null?void 0:h.call(t,{type:i,path:s,current:u.payload,next:a}))??!1){l(null);return}u.resolve(null)}e[i]={path:s,payload:a,resolve:l},o()})},cancel(s){(e!=null&&e.out&&s(e.out.payload)||e!=null&&e.in&&s(e.in.payload))&&n()}}}const le={},$=new Map;let J=null,xt=!1;function Rt(t,e,n){t instanceof HTMLElement&&$.has(t)&&!t.isConnected&&n.set(t,{entry:$.get(t),anchor:e});for(const o of Array.from(t.childNodes))Rt(o,e,n)}function ae(t){const e=new Set(Array.from(t.values(),({entry:n})=>n));for(const[n,{entry:o,anchor:s}]of t){$.delete(n);let i=o.parent,a=!1;for(;i;){if(i.group===o.group&&e.has(i)){a=!0;break}i=i.parent}queueMicrotask(()=>o.callback(s,{emit:!a}))}}function ue(){if(xt||typeof document>"u")return;xt=!0,J=new MutationObserver(e=>{const n=new Map;for(const o of e){const s={parent:o.target,nextSibling:o.nextSibling};for(const i of Array.from(o.removedNodes))Rt(i,s,n)}ae(n)});const t=()=>{J==null||J.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function de(t,e,n=le){ue();let o=t.parentElement,s=null;for(;o;){const i=$.get(o);if((i==null?void 0:i.group)===n){s=i;break}o=o.parentElement}return $.set(t,{element:t,callback:e,group:n,parent:s}),()=>{$.delete(t)}}const dt=new WeakMap;let tt=null;const et="none !important";function U(t){const e=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${e} !important`:e}function fe(){return tt||(tt=new MutationObserver(t=>{for(const e of t){const n=e.target,o=dt.get(n);if(!o)continue;const s=U(n);s!==o.accounted&&(o.accounted=s,s===et?(o.reactHidden=!0,o.onHide()):s!=="none"&&o.reactHidden&&(o.reactHidden=!1,o.onShow()))}}),tt)}function he(t,e){const n=U(t),o={accounted:n,reactHidden:n===et,onHide:e.onHide,onShow:e.onShow};return dt.set(t,o),fe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return U(t)===et},setDisplay(s,i=!1){s===null?t.style.removeProperty("display"):t.style.setProperty("display",s,i?"important":""),o.accounted=U(t)},sync(){o.accounted=U(t),o.reactHidden=o.accounted===et},stop(){dt.delete(t)}}}function pe(t,e={}){const{transitions:n=[],middleware:o=(r,c)=>({from:r,to:c}),preserveScroll:s=r=>r}=t,i=e.host??new kt,a={},l=ce({keepCurrent:({current:r,next:c})=>r.element.contains(c.element)}),f=re(),u=typeof n=="function"?n:()=>n,y=ie();y.initialize();const h=new Map,p=r=>{let c=h.get(r);return c===void 0&&(c=o(r,r).from,h.set(r,c)),c},{initializeContext:w,calculateScrollOffset:O,evictScrollPosition:M,shouldPreserve:R,getScrollContainer:K,getPositionedParentElement:b,getScrollPosition:S,getIsMobile:T}=ee({preserveScroll:s,resolvePath:p}),k=new Map,W=()=>{const r=T();let c=k.get(r);return c||(c=u({isMobile:r}),k.set(r,c)),c},F=new WeakMap,v=r=>{F.set(r,{parent:r.parentNode,nextSibling:r.nextSibling})},g=r=>{const c=F.get(r);return c||{parent:r.parentNode,nextSibling:r.nextSibling}},E=new WeakMap,P=new WeakMap;let A=0;const _=r=>{const c=typeof getComputedStyle<"u"?getComputedStyle(r).display:"";return c&&c!=="none"?c:"block"},D=(r,c)=>{c.visibleDisplay=r.style.getPropertyValue("display"),c.computedDisplay=_(r)},ft=(r,c)=>{if(P.get(r)!==c)return;P.delete(r);const d=E.get(r);d&&(d.savedCss!==null&&(r.style.cssText=d.savedCss,d.savedCss=null),d.intent==="hidden"?d.vis.setDisplay("none",!0):d.visibleDisplay?(d.vis.setDisplay(d.visibleDisplay,!1),D(r,d)):(d.vis.setDisplay(null),D(r,d)))},_t=(r,c,d,C,m,L)=>{const x=m.element,H=L.element,B=(m.mode??"unmount")==="hidden",{parent:Z,nextSibling:st}=m.parent?{parent:m.parent,nextSibling:m.nextSibling}:g(x),j=O(d,C),ot={direction:c,scrollOffset:j,from:{scroll:S(d)},to:{scroll:S(C)},get scrollingElement(){return K()||document.documentElement},get positionedParent(){return b()}};let I;if(B){I=x,I.style.top=`${-1*((j==null?void 0:j.y)??0)}px`;const z=E.get(H);z&&z.savedCss===null&&(z.savedCss=H.style.cssText)}else I=x,zt(I,ot);R(d)||M(d);const Q=B?++A:0;B&&(P.set(H,Q),P.set(x,Q));const mt=Promise.resolve(I),gt=Promise.resolve(H),vt=[],Ht={from:mt,to:gt,context:ot,createElement:((z,rt="div")=>{const q=document.createElement(rt);return q.setAttribute("data-ssgoi-id",z),vt.push(q),q})},Wt=Promise.resolve(r.prepare?r.prepare(Ht):{});$t({from:mt,to:gt,extras:Wt}).then(({from:z,to:rt,extras:q})=>{!B&&Z&&(st&&Z.contains(st)?Z.insertBefore(I,st):Z.appendChild(I));const ct=r.animation({from:z,to:rt,context:ot,...q}),lt=ct.onComplete;ct.onComplete=()=>{lt==null||lt(),B?(ft(x,Q),ft(H,Q)):I.parentNode&&I.parentNode.removeChild(I);for(const at of vt)at.parentNode&&at.parentNode.removeChild(at)},i.attach(ct)})},Y=(r,c,d)=>{const C=y.isSwipeBack();l.arrive(r,c,d).then(m=>{if(c==="in"&&y.onPageEnter(),!m)return;if(C&&c==="in"){const B=o(m.from,m.to);f.resolve(B.from,B.to)}if(C){c==="out"&&m.from&&!R(m.from)&&M(m.from);return}if(c!=="in")return;const{from:L,to:x}=o(m.from,m.to),H=f.resolve(L,x),X=oe(L,x,W(),H);X&&_t(X.transition,X.direction,m.from,m.to,m.out,m.in)})},Dt=(r,c)=>{const d=E.get(r);if(!d)return;const C=d.intent==="hidden";if(d.intent="hidden",d.savedCss===null&&(d.savedCss=r.style.cssText),d.vis.setDisplay(d.computedDisplay||"block",!0),r.style.position="absolute",r.style.width="100%",r.style.left="0",C)return;const m=g(r),L={element:r,parent:m.parent,nextSibling:m.nextSibling,mode:"hidden"},x=r.getAttribute("data-ssgoi-transition")??c;Y(x,"out",L)},It=(r,c)=>{const d=E.get(r);if(!d||d.intent==="visible")return;d.intent="visible",D(r,d),d.savedCss!==null&&(r.style.cssText=d.savedCss,d.visibleDisplay?d.vis.setDisplay(d.visibleDisplay,!1):d.vis.setDisplay(null)),w(r,c);const C={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling},m=r.getAttribute("data-ssgoi-transition")??c;Y(m,"in",C)},Nt=(r,c,d,C=!0)=>{const m=E.get(r);if(m&&(m.vis.stop(),E.delete(r),P.delete(r),m.intent==="hidden")){l.cancel(X=>X.element===r);return}if(!C)return;const L=d??g(r),x={element:r,parent:L.parent,nextSibling:L.nextSibling,mode:"unmount"},H=r.getAttribute("data-ssgoi-transition")??c;Y(H,"out",x)},ht=new WeakSet,pt=(r,c,{enter:d=!0}={})=>{if(ht.has(c))return;ht.add(c),v(c);const C=he(c,{onHide:()=>Dt(c,r),onShow:()=>It(c,r)}),m={vis:C,savedCss:null,intent:C.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};if(E.set(c,m),!C.isHidden&&(D(c,m),d)){w(c,r);const L={element:c,parent:c.parentElement,nextSibling:c.nextElementSibling};Y(r,"in",L)}de(c,(L,x)=>Nt(c,r,L,(x==null?void 0:x.emit)??!0),a)},yt=new Map;return{register:pt,refFor:r=>{let c=yt.get(r);return c||(c=d=>{d&&pt(r,d)},yt.set(r,c)),c}}}const Lt="data-ssgoi-root",ye=`[${Lt}]`,nt="data-ssgoi-transition",At=`[${nt}]`,me="[data-ssgoi-clone]";function ge(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function ve(t){return t.nodeType===Node.ELEMENT_NODE}function be(t){return t instanceof HTMLElement}function Ct(t){let e=0,n=t.parentElement;for(;n;)e++,n=n.parentElement;return e}function Mt(t,e,n=t){const o=Array.from(t).sort((s,i)=>Ct(s)-Ct(i));for(const s of o){const i=s.getAttribute(nt);if(i===null)continue;let a=s.parentElement,l=!1;for(;a;){if(n.has(a)){l=!0;break}a=a.parentElement}e.register(i,s,{enter:!l})}}function Ee(t,e){if(!ge())return()=>{};t.setAttribute(Lt,"");const n=l=>l.closest(ye)===t,o=l=>!be(l)||!n(l)||l.closest(me)||l.getAttribute(nt)===null?null:l,s=(l,f)=>{if(ve(l)){if(l.matches(At)){const u=o(l);u&&f.add(u)}for(const u of l.querySelectorAll(At)){const y=o(u);y&&f.add(y)}}},i=new MutationObserver(l=>{const f=new Set,u=new Set;for(const y of l){if(y.type==="attributes"){const h=o(y.target);h&&f.add(h);continue}for(const h of y.addedNodes)s(h,u)}for(const y of u)f.add(y);Mt(f,e,u)});i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[nt]});const a=new Set;return s(t,a),Mt(a,e),()=>i.disconnect()}exports.Animation=it.Animation;exports.MultiAnimation=it.MultiAnimation;exports.WebAnimation=it.WebAnimation;exports.HostAnimation=kt;exports.createSggoiTransitionContext=pe;exports.observeSsgoiTransitions=Ee;
|
|
1
|
+
"use strict";var Bt=Object.defineProperty;var Ft=(t,e,n)=>e in t?Bt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var G=(t,e,n)=>Ft(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("./multi-animation-6124HEke.cjs");class kt extends it.Animation{constructor(){super(...arguments);G(this,"child",null);G(this,"_state","idle");G(this,"_settled",!1);G(this,"listeners",new Set)}attach(n){const s=this.child;if(this.child=n,this._settled=!1,s){const l=s.getPose();s.complete(),n.matchInto(l)}n.playbackRate=this.playbackRate;const r=n.onComplete;n.onComplete=()=>{r==null||r(),this.child===n&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const i=n.onUpdate;n.onUpdate=l=>{var a;i==null||i(l),(a=this.onUpdate)==null||a.call(this,l),this.notify()},this._state==="paused"?n.pause():this._state==="reversing"?n.reverse():(this._state="playing",n.play()),this.notify()}play(){var n;this._state="playing",this._settled=!1,(n=this.child)==null||n.play(),this.notify()}reverse(){var n;this._state="reversing",this._settled=!1,(n=this.child)==null||n.reverse(),this.notify()}pause(){var n;this._state="paused",(n=this.child)==null||n.pause(),this.notify()}complete(){var n;(n=this.child)==null||n.complete(),this.notify()}get isAnimating(){var n;return((n=this.child)==null?void 0:n.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var n;return((n=this.child)==null?void 0:n.isReversing)??this._state==="reversing"}get progress(){var n;return((n=this.child)==null?void 0:n.progress)??0}findTimeForProgress(n){var s;return((s=this.child)==null?void 0:s.findTimeForProgress(n))??null}get playbackRate(){return super.playbackRate}set playbackRate(n){super.playbackRate=n,this.child&&(this.child.playbackRate=n),this.notify()}getPose(){var n;return((n=this.child)==null?void 0:n.getPose())??[]}getTimeline(){var n;return((n=this.child)==null?void 0:n.getTimeline())??[]}matchInto(n){var s;(s=this.child)==null||s.matchInto(n)}get activeChild(){return this.child}subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}notify(){for(const n of this.listeners)n()}}const zt=(t,e)=>{var n;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((n=e==null?void 0:e.scrollOffset)==null?void 0:n.y)??0)}px`,t.style.left="0"},bt=new Set(["auto","scroll","overlay"]),Kt=t=>{let e=t.parentElement;for(;e&&e!==document.body;){const n=window.getComputedStyle(e);if(bt.has(n.overflowY)||bt.has(n.overflowX))return e;e=e.parentElement}return document.documentElement},Xt=t=>{let e=t.parentElement;for(;e&&e!==document.body;){const n=window.getComputedStyle(e).position;if(n==="relative"||n==="absolute"||n==="fixed"||n==="sticky")return e;e=e.parentElement}return document.body};function $t(t){const e=Object.keys(t);return Promise.all(e.map(n=>t[n])).then(n=>{const s={};return e.forEach((r,i)=>{s[r]=n[i]}),s})}const qt=1e6,Et=100,Gt=10,Ut=1;function Vt(t){const e=t.trim(),n=e.indexOf("#"),s=e.indexOf("?"),r=[n,s].filter(i=>i>=0).reduce((i,l)=>Math.min(i,l),e.length);return e.slice(0,r)}function V(t){const e=Vt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))return V(new URL(e).pathname)}catch{}const s=(e.startsWith("/")?e:`/${e}`).replace(/\/+/g,"/");return(s.length>1?s.replace(/\/+$/g,""):s)||"/"}function Yt(t){const e=t.trim();return e==="*"?"/**":V(e)}function ut(t){return t==="/"?[]:t.slice(1).split("/")}function Zt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function Ot(t,e){const n=V(t),s=Yt(e);if(n===s)return{matched:!0,specificity:qt+ut(s).length*Et,pattern:e};const r=ut(n),i=ut(s);let l=0;for(let a=0;a<i.length;a++){const f=i[a],u=r[a],y=a===i.length-1;if(f==="**")return{matched:y&&r.length>=a,specificity:l,pattern:e};if(u===void 0||f===void 0)return{matched:!1,specificity:0,pattern:e};if(f==="*"){l+=Ut;continue}if(Zt(f)){l+=Gt;continue}if(f!==u)return{matched:!1,specificity:0,pattern:e};l+=Et}return{matched:r.length===i.length,specificity:l,pattern:e}}function N(t,e){const n=typeof e=="string"?[e]:e;let s=null;for(const r of n){const i=Ot(t,r);i.matched&&(!s||i.specificity>s.specificity)&&(s=i)}return s}function jt(t,e){return Ot(t,e).matched}const Qt=768,Jt=10,te=10;function ee(t={}){const{preserveScroll:e=v=>v,resolvePath:n=v=>v}=t,s=typeof e=="function"?e:()=>e;let r=null,i=!1,l=!1;const a=()=>{const v=(r==null?void 0:r.clientWidth)??0,g=v>0?v:typeof window<"u"?window.innerWidth:0;return g>0&&g<Qt},f=()=>(l||(i=a(),l=!0),i),u=v=>{var _;const g=n(v),E=s(f());if(E===!1)return{preserves:!1,shared:!1,storageKey:`path:${g}`};if(E===!0)return{preserves:!0,shared:!1,storageKey:`path:${g}`};const P=((_=E.exclude)==null?void 0:_.some(D=>jt(g,D)))??!1,A=!P&&!!E.key;return{preserves:!P,shared:A,storageKey:A?`shared:${E.key}`:`path:${g}`}},y=v=>u(v).preserves;let p=null;const h=new Map;let S=null,M=!1,k=0;const R=()=>{r&&S&&!M&&h.set(u(S).storageKey,{x:r.scrollLeft,y:r.scrollTop})},K=v=>{if(!r)return;const g=u(v);if(g.preserves&&g.shared&&!h.has(g.storageKey))return;const E=g.preserves&&h.has(g.storageKey)?h.get(g.storageKey):{x:0,y:0};let P=0;const A=()=>{if(!r)return;r.scrollTo({top:E.y,left:E.x}),!(Math.abs(r.scrollTop-E.y)<1&&Math.abs(r.scrollLeft-E.x)<1)&&P<Jt&&(P++,requestAnimationFrame(A))};requestAnimationFrame(A)};return{initializeContext:(v,g)=>{M=!0;const E=++k;p=v,r||(r=Kt(v),i=a(),l=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{i=a()}).observe(r),(r===document.documentElement?window:r).addEventListener("scroll",R,{passive:!0})),S=g,K(g);let P=0;const A=()=>{E===k&&(P++,P>=te?M=!1:requestAnimationFrame(A))};requestAnimationFrame(A)},calculateScrollOffset:(v,g)=>{const E=v?u(v).storageKey:null,P=E&&h.has(E)?h.get(E):{x:0,y:0},A=g?u(g):null,_=A!=null&&A.preserves?A.storageKey:null,D=_&&h.has(_)?h.get(_):{x:0,y:0};return{x:-D.x+P.x,y:-D.y+P.y}},evictScrollPosition:v=>{h.delete(u(v).storageKey)},shouldPreserve:y,getScrollContainer:()=>r,getPositionedParentElement:()=>p?Xt(p):document.body,getScrollPosition:v=>{const g=v?u(v).storageKey:null;return g&&h.has(g)?h.get(g):{x:0,y:0}},getIsMobile:f}}const St=30,wt=8,Tt=1.2,Pt=30,ne=600;function ie(){let t=null,e=!1,n=!1,s=null,r=null,i=!1;const l=(b,w)=>{for(let T=0;T<b.length;T++){const O=b.item(T);if(O&&O.identifier===w)return O}return null},a=()=>{s!==null&&(clearTimeout(s),s=null)},f=()=>{r!==null&&(clearTimeout(r),r=null)},u=()=>{e=!0,n=!0,a(),f(),s=setTimeout(()=>{e=!1,n=!1,s=null},ne)},y=b=>{if(b.touches.length!==1){t=null;return}const w=b.touches.item(0);if(!w){t=null;return}const T=window.innerWidth,O=w.clientX<=St,W=w.clientX>=T-St;if(!O&&!W){t=null;return}t={identifier:w.identifier,startX:w.clientX,startY:w.clientY,fromLeftEdge:O,moved:!1}},p=b=>{if(!t)return;if(b.touches.length!==1){t=null;return}const w=l(b.touches,t.identifier);if(!w){t=null;return}const T=w.clientX-t.startX,O=w.clientY-t.startY,W=Math.abs(T),F=Math.abs(O);if(F>wt&&F>W*Tt){t=null;return}const v=t.fromLeftEdge?T>0:T<0;W>wt&&W>F*Tt&&v&&(t.moved=!0)},h=b=>{if(!t)return;const w=l(b.changedTouches,t.identifier);if(!w){t=null;return}const T=w.clientX-t.startX,O=t.fromLeftEdge?T>0:T<0;if(t.moved&&O&&Math.abs(T)>=Pt){u(),t=null;return}t.moved&&Math.abs(T)>=Pt&&u(),t=null},S=()=>{t&&(t.moved&&u(),t=null)};return{initialize:()=>{if(typeof window>"u"||i)return;i=!0;const b={passive:!0,capture:!0};window.addEventListener("touchstart",y,b),window.addEventListener("touchmove",p,b),window.addEventListener("touchend",h,b),window.addEventListener("touchcancel",S,b)},destroy:()=>{if(typeof window>"u"||!i)return;i=!1;const b={capture:!0};window.removeEventListener("touchstart",y,b),window.removeEventListener("touchmove",p,b),window.removeEventListener("touchend",h,b),window.removeEventListener("touchcancel",S,b),a(),f(),t=null,e=!1,n=!1},isSwipeBack:()=>{const b=e||n;return b&&a(),b},onPageEnter:()=>{e=!1,a(),f(),r=setTimeout(()=>{n=!1,r=null},0)}}}function se(t,e){return e?t.priority!==e.priority?t.priority>e.priority:t.specificity!==e.specificity?t.specificity>e.specificity:t.ruleIndex<e.ruleIndex:!0}function oe(t,e,n,s){let r=null;return n.forEach((i,l)=>{const a=i.priority??0;let f=null;if(i.on!==void 0){const u=i.except!==void 0&&N(t,i.except)!==null,y=i.except!==void 0&&N(e,i.except)!==null,p=u?null:N(t,i.on),h=y?null:N(e,i.on);if(p||h){const S=!p&&h?"forward":p&&!h?"backward":s;f={transition:i.transition,direction:S,ruleIndex:l,priority:a,specificity:Math.max((p==null?void 0:p.specificity)??0,(h==null?void 0:h.specificity)??0),reason:!p&&h?"on-enter":p&&!h?"on-leave":"on-history"}}}else if(i.ordered!==void 0){let u=-1,y=-1,p=-1,h=-1;i.ordered.forEach((S,M)=>{const k=N(t,S);k&&k.specificity>p&&(u=M,p=k.specificity);const R=N(e,S);R&&R.specificity>h&&(y=M,h=R.specificity)}),u>=0&&y>=0&&u!==y&&(f={transition:i.transition,direction:u<y?"forward":"backward",ruleIndex:l,priority:a,specificity:p+h,reason:"ordered"})}else{const u=N(t,i.from),y=N(e,i.to),p=i.bidirectional===!1?null:N(t,i.to),h=i.bidirectional===!1?null:N(e,i.from),S=u&&y,M=p&&h;if(S||M){const k=S?u.specificity+y.specificity:-1,R=M?p.specificity+h.specificity:-1,K=S&&M&&k===R?s:k>=R?"forward":"backward";f={transition:i.transition,direction:K,ruleIndex:l,priority:a,specificity:Math.max(k,R),reason:"pair"}}}f&&se(f,r)&&(r=f)}),r}function re(){const t=[];let e=!1;const n=()=>{e=!0};return typeof window<"u"&&window.addEventListener("popstate",n),{resolve(s,r){const i=V(s),l=V(r);if(t.length===0)t.push(i);else if(t[t.length-1]!==i){const u=t.lastIndexOf(i);u>=0?t.splice(u+1):t.push(i)}const a=t[t.length-2],f=e||a===l?"backward":"forward";if(e=!1,f==="backward"){const u=t.lastIndexOf(l);u>=0?t.splice(u+1):t.push(l)}else t[t.length-1]!==l&&t.push(l);return f},dispose(){typeof window<"u"&&window.removeEventListener("popstate",n)}}}function ce(t={}){let e=null,n=null;function s(){var i,l;e&&((i=e.out)==null||i.resolve(null),(l=e.in)==null||l.resolve(null),e=null)}function r(){if(e!=null&&e.out&&e.in){if(e.out.path===e.in.path){s();return}const i={from:e.out.path,to:e.in.path,out:e.out.payload,in:e.in.payload};n=i,e.out.resolve(i),e.in.resolve(i),e=null}}return{arrive(i,l,a){return new Promise(f=>{var h,S;const u=n===null?null:l==="out"?{path:n.from,payload:n.out}:{path:n.to,payload:n.in};if((u==null?void 0:u.path)===i){f(null);return}l==="out"&&((h=e==null?void 0:e.in)==null?void 0:h.path)===i&&!e.out&&(e.in.resolve(null),e.in=void 0);const y=e==null?void 0:e[l];y&&y.path!==i&&s(),e||(e={});const p=e[l];if(p){if(((S=t.keepCurrent)==null?void 0:S.call(t,{type:l,path:i,current:p.payload,next:a}))??!1){f(null);return}p.resolve(null)}e[l]={path:i,payload:a,resolve:f},r()})},cancel(i){(e!=null&&e.out&&i(e.out.payload)||e!=null&&e.in&&i(e.in.payload))&&s(),(n&&i(n.out)||n&&i(n.in))&&(n=null)}}}const le={},$=new Map;let J=null,xt=!1;function Rt(t,e,n){t instanceof HTMLElement&&$.has(t)&&!t.isConnected&&n.set(t,{entry:$.get(t),anchor:e});for(const s of Array.from(t.childNodes))Rt(s,e,n)}function ae(t){const e=new Set(Array.from(t.values(),({entry:n})=>n));for(const[n,{entry:s,anchor:r}]of t){$.delete(n);let i=s.parent,l=!1;for(;i;){if(i.group===s.group&&e.has(i)){l=!0;break}i=i.parent}queueMicrotask(()=>s.callback(r,{emit:!l}))}}function ue(){if(xt||typeof document>"u")return;xt=!0,J=new MutationObserver(e=>{const n=new Map;for(const s of e){const r={parent:s.target,nextSibling:s.nextSibling};for(const i of Array.from(s.removedNodes))Rt(i,r,n)}ae(n)});const t=()=>{J==null||J.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function de(t,e,n=le){ue();let s=t.parentElement,r=null;for(;s;){const i=$.get(s);if((i==null?void 0:i.group)===n){r=i;break}s=s.parentElement}return $.set(t,{element:t,callback:e,group:n,parent:r}),()=>{$.delete(t)}}const dt=new WeakMap;let tt=null;const et="none !important";function U(t){const e=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${e} !important`:e}function fe(){return tt||(tt=new MutationObserver(t=>{for(const e of t){const n=e.target,s=dt.get(n);if(!s)continue;const r=U(n);r!==s.accounted&&(s.accounted=r,r===et?(s.reactHidden=!0,s.onHide()):r!=="none"&&s.reactHidden&&(s.reactHidden=!1,s.onShow()))}}),tt)}function he(t,e){const n=U(t),s={accounted:n,reactHidden:n===et,onHide:e.onHide,onShow:e.onShow};return dt.set(t,s),fe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return U(t)===et},setDisplay(r,i=!1){r===null?t.style.removeProperty("display"):t.style.setProperty("display",r,i?"important":""),s.accounted=U(t)},sync(){s.accounted=U(t),s.reactHidden=s.accounted===et},stop(){dt.delete(t)}}}function pe(t,e={}){const{transitions:n=[],middleware:s=(o,c)=>({from:o,to:c}),preserveScroll:r=o=>o}=t,i=e.host??new kt,l={},a=ce({keepCurrent:({current:o,next:c})=>o.element.contains(c.element)}),f=re(),u=typeof n=="function"?n:()=>n,y=ie();y.initialize();const p=new Map,h=o=>{let c=p.get(o);return c===void 0&&(c=s(o,o).from,p.set(o,c)),c},{initializeContext:S,calculateScrollOffset:M,evictScrollPosition:k,shouldPreserve:R,getScrollContainer:K,getPositionedParentElement:b,getScrollPosition:w,getIsMobile:T}=ee({preserveScroll:r,resolvePath:h}),O=new Map,W=()=>{const o=T();let c=O.get(o);return c||(c=u({isMobile:o}),O.set(o,c)),c},F=new WeakMap,v=o=>{F.set(o,{parent:o.parentNode,nextSibling:o.nextSibling})},g=o=>{const c=F.get(o);return c||{parent:o.parentNode,nextSibling:o.nextSibling}},E=new WeakMap,P=new WeakMap;let A=0;const _=o=>{const c=typeof getComputedStyle<"u"?getComputedStyle(o).display:"";return c&&c!=="none"?c:"block"},D=(o,c)=>{c.visibleDisplay=o.style.getPropertyValue("display"),c.computedDisplay=_(o)},ft=(o,c)=>{if(P.get(o)!==c)return;P.delete(o);const d=E.get(o);d&&(d.savedCss!==null&&(o.style.cssText=d.savedCss,d.savedCss=null),d.intent==="hidden"?d.vis.setDisplay("none",!0):d.visibleDisplay?(d.vis.setDisplay(d.visibleDisplay,!1),D(o,d)):(d.vis.setDisplay(null),D(o,d)))},_t=(o,c,d,C,m,L)=>{const x=m.element,H=L.element,B=(m.mode??"unmount")==="hidden",{parent:Z,nextSibling:st}=m.parent?{parent:m.parent,nextSibling:m.nextSibling}:g(x),j=M(d,C),ot={direction:c,scrollOffset:j,from:{scroll:w(d)},to:{scroll:w(C)},get scrollingElement(){return K()||document.documentElement},get positionedParent(){return b()}};let I;if(B){I=x,I.style.top=`${-1*((j==null?void 0:j.y)??0)}px`;const z=E.get(H);z&&z.savedCss===null&&(z.savedCss=H.style.cssText)}else I=x,zt(I,ot);R(d)||k(d);const Q=B?++A:0;B&&(P.set(H,Q),P.set(x,Q));const mt=Promise.resolve(I),gt=Promise.resolve(H),vt=[],Ht={from:mt,to:gt,context:ot,createElement:((z,rt="div")=>{const q=document.createElement(rt);return q.setAttribute("data-ssgoi-id",z),vt.push(q),q})},Wt=Promise.resolve(o.prepare?o.prepare(Ht):{});$t({from:mt,to:gt,extras:Wt}).then(({from:z,to:rt,extras:q})=>{!B&&Z&&(st&&Z.contains(st)?Z.insertBefore(I,st):Z.appendChild(I));const ct=o.animation({from:z,to:rt,context:ot,...q}),lt=ct.onComplete;ct.onComplete=()=>{lt==null||lt(),B?(ft(x,Q),ft(H,Q)):I.parentNode&&I.parentNode.removeChild(I);for(const at of vt)at.parentNode&&at.parentNode.removeChild(at)},i.attach(ct)})},Y=(o,c,d)=>{const C=y.isSwipeBack();a.arrive(o,c,d).then(m=>{if(c==="in"&&y.onPageEnter(),!m)return;if(C&&c==="in"){const B=s(m.from,m.to);f.resolve(B.from,B.to)}if(C){c==="out"&&m.from&&!R(m.from)&&k(m.from);return}if(c!=="in")return;const{from:L,to:x}=s(m.from,m.to),H=f.resolve(L,x),X=oe(L,x,W(),H);X&&_t(X.transition,X.direction,m.from,m.to,m.out,m.in)})},Dt=(o,c)=>{const d=E.get(o);if(!d)return;const C=d.intent==="hidden";if(d.intent="hidden",d.savedCss===null&&(d.savedCss=o.style.cssText),d.vis.setDisplay(d.computedDisplay||"block",!0),o.style.position="absolute",o.style.width="100%",o.style.left="0",C)return;const m=g(o),L={element:o,parent:m.parent,nextSibling:m.nextSibling,mode:"hidden"},x=o.getAttribute("data-ssgoi-transition")??c;Y(x,"out",L)},It=(o,c)=>{const d=E.get(o);if(!d||d.intent==="visible")return;d.intent="visible",D(o,d),d.savedCss!==null&&(o.style.cssText=d.savedCss,d.visibleDisplay?d.vis.setDisplay(d.visibleDisplay,!1):d.vis.setDisplay(null)),S(o,c);const C={element:o,parent:o.parentElement,nextSibling:o.nextElementSibling},m=o.getAttribute("data-ssgoi-transition")??c;Y(m,"in",C)},Nt=(o,c,d,C=!0)=>{const m=E.get(o);if(m&&(m.vis.stop(),E.delete(o),P.delete(o),m.intent==="hidden")){a.cancel(X=>X.element===o);return}if(!C)return;const L=d??g(o),x={element:o,parent:L.parent,nextSibling:L.nextSibling,mode:"unmount"},H=o.getAttribute("data-ssgoi-transition")??c;Y(H,"out",x)},ht=new WeakSet,pt=(o,c,{enter:d=!0}={})=>{if(ht.has(c))return;ht.add(c),v(c);const C=he(c,{onHide:()=>Dt(c,o),onShow:()=>It(c,o)}),m={vis:C,savedCss:null,intent:C.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};if(E.set(c,m),!C.isHidden&&(D(c,m),d)){S(c,o);const L={element:c,parent:c.parentElement,nextSibling:c.nextElementSibling};Y(o,"in",L)}de(c,(L,x)=>Nt(c,o,L,(x==null?void 0:x.emit)??!0),l)},yt=new Map;return{register:pt,refFor:o=>{let c=yt.get(o);return c||(c=d=>{d&&pt(o,d)},yt.set(o,c)),c}}}const Lt="data-ssgoi-root",ye=`[${Lt}]`,nt="data-ssgoi-transition",At=`[${nt}]`,me="[data-ssgoi-clone]";function ge(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function ve(t){return t.nodeType===Node.ELEMENT_NODE}function be(t){return t instanceof HTMLElement}function Ct(t){let e=0,n=t.parentElement;for(;n;)e++,n=n.parentElement;return e}function Mt(t,e,n=t){const s=Array.from(t).sort((r,i)=>Ct(r)-Ct(i));for(const r of s){const i=r.getAttribute(nt);if(i===null)continue;let l=r.parentElement,a=!1;for(;l;){if(n.has(l)){a=!0;break}l=l.parentElement}e.register(i,r,{enter:!a})}}function Ee(t,e){if(!ge())return()=>{};t.setAttribute(Lt,"");const n=a=>a.closest(ye)===t,s=a=>!be(a)||!n(a)||a.closest(me)||a.getAttribute(nt)===null?null:a,r=(a,f)=>{if(ve(a)){if(a.matches(At)){const u=s(a);u&&f.add(u)}for(const u of a.querySelectorAll(At)){const y=s(u);y&&f.add(y)}}},i=new MutationObserver(a=>{const f=new Set,u=new Set;for(const y of a){if(y.type==="attributes"){const p=s(y.target);p&&f.add(p);continue}for(const p of y.addedNodes)r(p,u)}for(const y of u)f.add(y);Mt(f,e,u)});i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[nt]});const l=new Set;return r(t,l),Mt(l,e),()=>i.disconnect()}exports.Animation=it.Animation;exports.MultiAnimation=it.MultiAnimation;exports.WebAnimation=it.WebAnimation;exports.HostAnimation=kt;exports.createSggoiTransitionContext=pe;exports.observeSsgoiTransitions=Ee;
|
package/dist/internal.js
CHANGED
|
@@ -2,7 +2,7 @@ var Ht = Object.defineProperty;
|
|
|
2
2
|
var Wt = (t, e, n) => e in t ? Ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var U = (t, e, n) => Wt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { A as Bt } from "./multi-animation-ZFZBDBGr.js";
|
|
5
|
-
import { M as Me, W as
|
|
5
|
+
import { M as Me, W as ke } from "./multi-animation-ZFZBDBGr.js";
|
|
6
6
|
class Ft extends Bt {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
@@ -12,20 +12,20 @@ class Ft extends Bt {
|
|
|
12
12
|
U(this, "listeners", /* @__PURE__ */ new Set());
|
|
13
13
|
}
|
|
14
14
|
attach(n) {
|
|
15
|
-
const
|
|
16
|
-
if (this.child = n, this._settled = !1,
|
|
17
|
-
const
|
|
18
|
-
|
|
15
|
+
const s = this.child;
|
|
16
|
+
if (this.child = n, this._settled = !1, s) {
|
|
17
|
+
const l = s.getPose();
|
|
18
|
+
s.complete(), n.matchInto(l);
|
|
19
19
|
}
|
|
20
20
|
n.playbackRate = this.playbackRate;
|
|
21
|
-
const
|
|
21
|
+
const r = n.onComplete;
|
|
22
22
|
n.onComplete = () => {
|
|
23
|
-
|
|
23
|
+
r == null || r(), this.child === n && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
|
|
24
24
|
};
|
|
25
25
|
const i = n.onUpdate;
|
|
26
|
-
n.onUpdate = (
|
|
27
|
-
var
|
|
28
|
-
i == null || i(
|
|
26
|
+
n.onUpdate = (l) => {
|
|
27
|
+
var a;
|
|
28
|
+
i == null || i(l), (a = this.onUpdate) == null || a.call(this, l), this.notify();
|
|
29
29
|
}, this._state === "paused" ? n.pause() : this._state === "reversing" ? n.reverse() : (this._state = "playing", n.play()), this.notify();
|
|
30
30
|
}
|
|
31
31
|
play() {
|
|
@@ -63,8 +63,8 @@ class Ft extends Bt {
|
|
|
63
63
|
return ((n = this.child) == null ? void 0 : n.progress) ?? 0;
|
|
64
64
|
}
|
|
65
65
|
findTimeForProgress(n) {
|
|
66
|
-
var
|
|
67
|
-
return ((
|
|
66
|
+
var s;
|
|
67
|
+
return ((s = this.child) == null ? void 0 : s.findTimeForProgress(n)) ?? null;
|
|
68
68
|
}
|
|
69
69
|
get playbackRate() {
|
|
70
70
|
return super.playbackRate;
|
|
@@ -81,8 +81,8 @@ class Ft extends Bt {
|
|
|
81
81
|
return ((n = this.child) == null ? void 0 : n.getTimeline()) ?? [];
|
|
82
82
|
}
|
|
83
83
|
matchInto(n) {
|
|
84
|
-
var
|
|
85
|
-
(
|
|
84
|
+
var s;
|
|
85
|
+
(s = this.child) == null || s.matchInto(n);
|
|
86
86
|
}
|
|
87
87
|
/** Currently attached child, or null when nothing is playing. */
|
|
88
88
|
get activeChild() {
|
|
@@ -123,16 +123,16 @@ const zt = (t, e) => {
|
|
|
123
123
|
function $t(t) {
|
|
124
124
|
const e = Object.keys(t);
|
|
125
125
|
return Promise.all(e.map((n) => t[n])).then((n) => {
|
|
126
|
-
const
|
|
127
|
-
return e.forEach((
|
|
128
|
-
|
|
129
|
-
}),
|
|
126
|
+
const s = {};
|
|
127
|
+
return e.forEach((r, i) => {
|
|
128
|
+
s[r] = n[i];
|
|
129
|
+
}), s;
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
const Gt = 1e6, Et = 100, Ut = 10, qt = 1;
|
|
133
133
|
function Vt(t) {
|
|
134
|
-
const e = t.trim(), n = e.indexOf("#"),
|
|
135
|
-
return e.slice(0,
|
|
134
|
+
const e = t.trim(), n = e.indexOf("#"), s = e.indexOf("?"), r = [n, s].filter((i) => i >= 0).reduce((i, l) => Math.min(i, l), e.length);
|
|
135
|
+
return e.slice(0, r);
|
|
136
136
|
}
|
|
137
137
|
function V(t) {
|
|
138
138
|
const e = Vt(t);
|
|
@@ -141,8 +141,8 @@ function V(t) {
|
|
|
141
141
|
return V(new URL(e).pathname);
|
|
142
142
|
} catch {
|
|
143
143
|
}
|
|
144
|
-
const
|
|
145
|
-
return (
|
|
144
|
+
const s = (e.startsWith("/") ? e : `/${e}`).replace(/\/+/g, "/");
|
|
145
|
+
return (s.length > 1 ? s.replace(/\/+$/g, "") : s) || "/";
|
|
146
146
|
}
|
|
147
147
|
function Yt(t) {
|
|
148
148
|
const e = t.trim();
|
|
@@ -154,69 +154,69 @@ function at(t) {
|
|
|
154
154
|
function Zt(t) {
|
|
155
155
|
return t.startsWith(":") || t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
const n = V(t),
|
|
159
|
-
if (n ===
|
|
157
|
+
function kt(t, e) {
|
|
158
|
+
const n = V(t), s = Yt(e);
|
|
159
|
+
if (n === s)
|
|
160
160
|
return {
|
|
161
161
|
matched: !0,
|
|
162
|
-
specificity: Gt + at(
|
|
162
|
+
specificity: Gt + at(s).length * Et,
|
|
163
163
|
pattern: e
|
|
164
164
|
};
|
|
165
|
-
const
|
|
166
|
-
let
|
|
167
|
-
for (let
|
|
168
|
-
const f = i[
|
|
165
|
+
const r = at(n), i = at(s);
|
|
166
|
+
let l = 0;
|
|
167
|
+
for (let a = 0; a < i.length; a++) {
|
|
168
|
+
const f = i[a], u = r[a], y = a === i.length - 1;
|
|
169
169
|
if (f === "**")
|
|
170
170
|
return {
|
|
171
|
-
matched: y &&
|
|
172
|
-
specificity:
|
|
171
|
+
matched: y && r.length >= a,
|
|
172
|
+
specificity: l,
|
|
173
173
|
pattern: e
|
|
174
174
|
};
|
|
175
175
|
if (u === void 0 || f === void 0)
|
|
176
176
|
return { matched: !1, specificity: 0, pattern: e };
|
|
177
177
|
if (f === "*") {
|
|
178
|
-
|
|
178
|
+
l += qt;
|
|
179
179
|
continue;
|
|
180
180
|
}
|
|
181
181
|
if (Zt(f)) {
|
|
182
|
-
|
|
182
|
+
l += Ut;
|
|
183
183
|
continue;
|
|
184
184
|
}
|
|
185
185
|
if (f !== u)
|
|
186
186
|
return { matched: !1, specificity: 0, pattern: e };
|
|
187
|
-
|
|
187
|
+
l += Et;
|
|
188
188
|
}
|
|
189
189
|
return {
|
|
190
|
-
matched:
|
|
191
|
-
specificity:
|
|
190
|
+
matched: r.length === i.length,
|
|
191
|
+
specificity: l,
|
|
192
192
|
pattern: e
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
function N(t, e) {
|
|
196
196
|
const n = typeof e == "string" ? [e] : e;
|
|
197
|
-
let
|
|
198
|
-
for (const
|
|
199
|
-
const i =
|
|
200
|
-
i.matched && (!
|
|
197
|
+
let s = null;
|
|
198
|
+
for (const r of n) {
|
|
199
|
+
const i = kt(t, r);
|
|
200
|
+
i.matched && (!s || i.specificity > s.specificity) && (s = i);
|
|
201
201
|
}
|
|
202
|
-
return
|
|
202
|
+
return s;
|
|
203
203
|
}
|
|
204
204
|
function Qt(t, e) {
|
|
205
|
-
return
|
|
205
|
+
return kt(t, e).matched;
|
|
206
206
|
}
|
|
207
207
|
const jt = 768, Jt = 10, te = 10;
|
|
208
208
|
function ee(t = {}) {
|
|
209
209
|
const {
|
|
210
210
|
preserveScroll: e = (v) => v,
|
|
211
211
|
resolvePath: n = (v) => v
|
|
212
|
-
} = t,
|
|
213
|
-
let
|
|
214
|
-
const
|
|
215
|
-
const v = (
|
|
212
|
+
} = t, s = typeof e == "function" ? e : () => e;
|
|
213
|
+
let r = null, i = !1, l = !1;
|
|
214
|
+
const a = () => {
|
|
215
|
+
const v = (r == null ? void 0 : r.clientWidth) ?? 0, g = v > 0 ? v : typeof window < "u" ? window.innerWidth : 0;
|
|
216
216
|
return g > 0 && g < jt;
|
|
217
|
-
}, f = () => (
|
|
217
|
+
}, f = () => (l || (i = a(), l = !0), i), u = (v) => {
|
|
218
218
|
var _;
|
|
219
|
-
const g = n(v), b =
|
|
219
|
+
const g = n(v), b = s(f());
|
|
220
220
|
if (b === !1)
|
|
221
221
|
return { preserves: !1, shared: !1, storageKey: `path:${g}` };
|
|
222
222
|
if (b === !0)
|
|
@@ -228,61 +228,61 @@ function ee(t = {}) {
|
|
|
228
228
|
storageKey: C ? `shared:${b.key}` : `path:${g}`
|
|
229
229
|
};
|
|
230
230
|
}, y = (v) => u(v).preserves;
|
|
231
|
-
let
|
|
232
|
-
const
|
|
233
|
-
let
|
|
231
|
+
let p = null;
|
|
232
|
+
const h = /* @__PURE__ */ new Map();
|
|
233
|
+
let w = null, k = !1, A = 0;
|
|
234
234
|
const L = () => {
|
|
235
|
-
|
|
236
|
-
x:
|
|
237
|
-
y:
|
|
235
|
+
r && w && !k && h.set(u(w).storageKey, {
|
|
236
|
+
x: r.scrollLeft,
|
|
237
|
+
y: r.scrollTop
|
|
238
238
|
});
|
|
239
239
|
}, K = (v) => {
|
|
240
|
-
if (!
|
|
240
|
+
if (!r) return;
|
|
241
241
|
const g = u(v);
|
|
242
|
-
if (g.preserves && g.shared && !
|
|
242
|
+
if (g.preserves && g.shared && !h.has(g.storageKey))
|
|
243
243
|
return;
|
|
244
|
-
const b = g.preserves &&
|
|
244
|
+
const b = g.preserves && h.has(g.storageKey) ? h.get(g.storageKey) : { x: 0, y: 0 };
|
|
245
245
|
let P = 0;
|
|
246
246
|
const C = () => {
|
|
247
|
-
if (!
|
|
248
|
-
|
|
247
|
+
if (!r) return;
|
|
248
|
+
r.scrollTo({
|
|
249
249
|
top: b.y,
|
|
250
250
|
left: b.x
|
|
251
|
-
}), !(Math.abs(
|
|
251
|
+
}), !(Math.abs(r.scrollTop - b.y) < 1 && Math.abs(r.scrollLeft - b.x) < 1) && P < Jt && (P++, requestAnimationFrame(C));
|
|
252
252
|
};
|
|
253
253
|
requestAnimationFrame(C);
|
|
254
254
|
};
|
|
255
255
|
return {
|
|
256
256
|
initializeContext: (v, g) => {
|
|
257
|
-
|
|
257
|
+
k = !0;
|
|
258
258
|
const b = ++A;
|
|
259
|
-
|
|
260
|
-
i =
|
|
261
|
-
}).observe(
|
|
259
|
+
p = v, r || (r = Kt(v), i = a(), l = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
|
|
260
|
+
i = a();
|
|
261
|
+
}).observe(r), (r === document.documentElement ? window : r).addEventListener("scroll", L, {
|
|
262
262
|
passive: !0
|
|
263
|
-
})),
|
|
263
|
+
})), w = g, K(g);
|
|
264
264
|
let P = 0;
|
|
265
265
|
const C = () => {
|
|
266
|
-
b === A && (P++, P >= te ?
|
|
266
|
+
b === A && (P++, P >= te ? k = !1 : requestAnimationFrame(C));
|
|
267
267
|
};
|
|
268
268
|
requestAnimationFrame(C);
|
|
269
269
|
},
|
|
270
270
|
calculateScrollOffset: (v, g) => {
|
|
271
|
-
const b = v ? u(v).storageKey : null, P = b &&
|
|
271
|
+
const b = v ? u(v).storageKey : null, P = b && h.has(b) ? h.get(b) : { x: 0, y: 0 }, C = g ? u(g) : null, _ = C != null && C.preserves ? C.storageKey : null, D = _ && h.has(_) ? h.get(_) : { x: 0, y: 0 };
|
|
272
272
|
return {
|
|
273
273
|
x: -D.x + P.x,
|
|
274
274
|
y: -D.y + P.y
|
|
275
275
|
};
|
|
276
276
|
},
|
|
277
277
|
evictScrollPosition: (v) => {
|
|
278
|
-
|
|
278
|
+
h.delete(u(v).storageKey);
|
|
279
279
|
},
|
|
280
280
|
shouldPreserve: y,
|
|
281
|
-
getScrollContainer: () =>
|
|
282
|
-
getPositionedParentElement: () =>
|
|
281
|
+
getScrollContainer: () => r,
|
|
282
|
+
getPositionedParentElement: () => p ? Xt(p) : document.body,
|
|
283
283
|
getScrollPosition: (v) => {
|
|
284
284
|
const g = v ? u(v).storageKey : null;
|
|
285
|
-
return g &&
|
|
285
|
+
return g && h.has(g) ? h.get(g) : { x: 0, y: 0 };
|
|
286
286
|
},
|
|
287
287
|
// Same measurement that drives `preserveScroll`'s `isMobile`, exposed so a
|
|
288
288
|
// functional `transitions` config can branch on it too.
|
|
@@ -291,151 +291,151 @@ function ee(t = {}) {
|
|
|
291
291
|
}
|
|
292
292
|
const bt = 30, wt = 8, St = 1.2, Tt = 30, ne = 600;
|
|
293
293
|
function ie() {
|
|
294
|
-
let t = null, e = !1, n = !1,
|
|
295
|
-
const
|
|
294
|
+
let t = null, e = !1, n = !1, s = null, r = null, i = !1;
|
|
295
|
+
const l = (E, S) => {
|
|
296
296
|
for (let T = 0; T < E.length; T++) {
|
|
297
|
-
const
|
|
298
|
-
if (
|
|
297
|
+
const R = E.item(T);
|
|
298
|
+
if (R && R.identifier === S) return R;
|
|
299
299
|
}
|
|
300
300
|
return null;
|
|
301
|
-
},
|
|
302
|
-
o !== null && (clearTimeout(o), o = null);
|
|
303
|
-
}, f = () => {
|
|
301
|
+
}, a = () => {
|
|
304
302
|
s !== null && (clearTimeout(s), s = null);
|
|
303
|
+
}, f = () => {
|
|
304
|
+
r !== null && (clearTimeout(r), r = null);
|
|
305
305
|
}, u = () => {
|
|
306
|
-
e = !0, n = !0,
|
|
307
|
-
e = !1, n = !1,
|
|
306
|
+
e = !0, n = !0, a(), f(), s = setTimeout(() => {
|
|
307
|
+
e = !1, n = !1, s = null;
|
|
308
308
|
}, ne);
|
|
309
309
|
}, y = (E) => {
|
|
310
310
|
if (E.touches.length !== 1) {
|
|
311
311
|
t = null;
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
const
|
|
315
|
-
if (!
|
|
314
|
+
const S = E.touches.item(0);
|
|
315
|
+
if (!S) {
|
|
316
316
|
t = null;
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
const T = window.innerWidth,
|
|
320
|
-
if (!
|
|
319
|
+
const T = window.innerWidth, R = S.clientX <= bt, W = S.clientX >= T - bt;
|
|
320
|
+
if (!R && !W) {
|
|
321
321
|
t = null;
|
|
322
322
|
return;
|
|
323
323
|
}
|
|
324
324
|
t = {
|
|
325
|
-
identifier:
|
|
326
|
-
startX:
|
|
327
|
-
startY:
|
|
328
|
-
fromLeftEdge:
|
|
325
|
+
identifier: S.identifier,
|
|
326
|
+
startX: S.clientX,
|
|
327
|
+
startY: S.clientY,
|
|
328
|
+
fromLeftEdge: R,
|
|
329
329
|
moved: !1
|
|
330
330
|
};
|
|
331
|
-
},
|
|
331
|
+
}, p = (E) => {
|
|
332
332
|
if (!t) return;
|
|
333
333
|
if (E.touches.length !== 1) {
|
|
334
334
|
t = null;
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
|
-
const
|
|
338
|
-
if (!
|
|
337
|
+
const S = l(E.touches, t.identifier);
|
|
338
|
+
if (!S) {
|
|
339
339
|
t = null;
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
const T =
|
|
342
|
+
const T = S.clientX - t.startX, R = S.clientY - t.startY, W = Math.abs(T), F = Math.abs(R);
|
|
343
343
|
if (F > wt && F > W * St) {
|
|
344
344
|
t = null;
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
347
|
const v = t.fromLeftEdge ? T > 0 : T < 0;
|
|
348
348
|
W > wt && W > F * St && v && (t.moved = !0);
|
|
349
|
-
},
|
|
349
|
+
}, h = (E) => {
|
|
350
350
|
if (!t) return;
|
|
351
|
-
const
|
|
352
|
-
if (!
|
|
351
|
+
const S = l(E.changedTouches, t.identifier);
|
|
352
|
+
if (!S) {
|
|
353
353
|
t = null;
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
|
-
const T =
|
|
357
|
-
if (t.moved &&
|
|
356
|
+
const T = S.clientX - t.startX, R = t.fromLeftEdge ? T > 0 : T < 0;
|
|
357
|
+
if (t.moved && R && Math.abs(T) >= Tt) {
|
|
358
358
|
u(), t = null;
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
361
|
t.moved && Math.abs(T) >= Tt && u(), t = null;
|
|
362
|
-
},
|
|
362
|
+
}, w = () => {
|
|
363
363
|
t && (t.moved && u(), t = null);
|
|
364
364
|
};
|
|
365
365
|
return { initialize: () => {
|
|
366
366
|
if (typeof window > "u" || i) return;
|
|
367
367
|
i = !0;
|
|
368
368
|
const E = { passive: !0, capture: !0 };
|
|
369
|
-
window.addEventListener("touchstart", y, E), window.addEventListener("touchmove",
|
|
369
|
+
window.addEventListener("touchstart", y, E), window.addEventListener("touchmove", p, E), window.addEventListener("touchend", h, E), window.addEventListener("touchcancel", w, E);
|
|
370
370
|
}, destroy: () => {
|
|
371
371
|
if (typeof window > "u" || !i) return;
|
|
372
372
|
i = !1;
|
|
373
373
|
const E = { capture: !0 };
|
|
374
|
-
window.removeEventListener("touchstart", y, E), window.removeEventListener("touchmove",
|
|
374
|
+
window.removeEventListener("touchstart", y, E), window.removeEventListener("touchmove", p, E), window.removeEventListener("touchend", h, E), window.removeEventListener("touchcancel", w, E), a(), f(), t = null, e = !1, n = !1;
|
|
375
375
|
}, isSwipeBack: () => {
|
|
376
376
|
const E = e || n;
|
|
377
|
-
return E &&
|
|
377
|
+
return E && a(), E;
|
|
378
378
|
}, onPageEnter: () => {
|
|
379
|
-
e = !1,
|
|
380
|
-
n = !1,
|
|
379
|
+
e = !1, a(), f(), r = setTimeout(() => {
|
|
380
|
+
n = !1, r = null;
|
|
381
381
|
}, 0);
|
|
382
382
|
} };
|
|
383
383
|
}
|
|
384
384
|
function se(t, e) {
|
|
385
385
|
return e ? t.priority !== e.priority ? t.priority > e.priority : t.specificity !== e.specificity ? t.specificity > e.specificity : t.ruleIndex < e.ruleIndex : !0;
|
|
386
386
|
}
|
|
387
|
-
function oe(t, e, n,
|
|
388
|
-
let
|
|
389
|
-
return n.forEach((i,
|
|
390
|
-
const
|
|
387
|
+
function oe(t, e, n, s) {
|
|
388
|
+
let r = null;
|
|
389
|
+
return n.forEach((i, l) => {
|
|
390
|
+
const a = i.priority ?? 0;
|
|
391
391
|
let f = null;
|
|
392
392
|
if (i.on !== void 0) {
|
|
393
|
-
const u = i.except !== void 0 && N(t, i.except) !== null, y = i.except !== void 0 && N(e, i.except) !== null,
|
|
394
|
-
if (
|
|
395
|
-
const
|
|
393
|
+
const u = i.except !== void 0 && N(t, i.except) !== null, y = i.except !== void 0 && N(e, i.except) !== null, p = u ? null : N(t, i.on), h = y ? null : N(e, i.on);
|
|
394
|
+
if (p || h) {
|
|
395
|
+
const w = !p && h ? "forward" : p && !h ? "backward" : s;
|
|
396
396
|
f = {
|
|
397
397
|
transition: i.transition,
|
|
398
|
-
direction:
|
|
399
|
-
ruleIndex:
|
|
400
|
-
priority:
|
|
398
|
+
direction: w,
|
|
399
|
+
ruleIndex: l,
|
|
400
|
+
priority: a,
|
|
401
401
|
specificity: Math.max(
|
|
402
|
-
(
|
|
403
|
-
(
|
|
402
|
+
(p == null ? void 0 : p.specificity) ?? 0,
|
|
403
|
+
(h == null ? void 0 : h.specificity) ?? 0
|
|
404
404
|
),
|
|
405
|
-
reason: !
|
|
405
|
+
reason: !p && h ? "on-enter" : p && !h ? "on-leave" : "on-history"
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
} else if (i.ordered !== void 0) {
|
|
409
|
-
let u = -1, y = -1,
|
|
410
|
-
i.ordered.forEach((
|
|
411
|
-
const A = N(t,
|
|
412
|
-
A && A.specificity >
|
|
413
|
-
const L = N(e,
|
|
414
|
-
L && L.specificity >
|
|
409
|
+
let u = -1, y = -1, p = -1, h = -1;
|
|
410
|
+
i.ordered.forEach((w, k) => {
|
|
411
|
+
const A = N(t, w);
|
|
412
|
+
A && A.specificity > p && (u = k, p = A.specificity);
|
|
413
|
+
const L = N(e, w);
|
|
414
|
+
L && L.specificity > h && (y = k, h = L.specificity);
|
|
415
415
|
}), u >= 0 && y >= 0 && u !== y && (f = {
|
|
416
416
|
transition: i.transition,
|
|
417
417
|
direction: u < y ? "forward" : "backward",
|
|
418
|
-
ruleIndex:
|
|
419
|
-
priority:
|
|
420
|
-
specificity:
|
|
418
|
+
ruleIndex: l,
|
|
419
|
+
priority: a,
|
|
420
|
+
specificity: p + h,
|
|
421
421
|
reason: "ordered"
|
|
422
422
|
});
|
|
423
423
|
} else {
|
|
424
|
-
const u = N(t, i.from), y = N(e, i.to),
|
|
425
|
-
if (
|
|
426
|
-
const A =
|
|
424
|
+
const u = N(t, i.from), y = N(e, i.to), p = i.bidirectional === !1 ? null : N(t, i.to), h = i.bidirectional === !1 ? null : N(e, i.from), w = u && y, k = p && h;
|
|
425
|
+
if (w || k) {
|
|
426
|
+
const A = w ? u.specificity + y.specificity : -1, L = k ? p.specificity + h.specificity : -1, K = w && k && A === L ? s : A >= L ? "forward" : "backward";
|
|
427
427
|
f = {
|
|
428
428
|
transition: i.transition,
|
|
429
429
|
direction: K,
|
|
430
|
-
ruleIndex:
|
|
431
|
-
priority:
|
|
430
|
+
ruleIndex: l,
|
|
431
|
+
priority: a,
|
|
432
432
|
specificity: Math.max(A, L),
|
|
433
433
|
reason: "pair"
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
f && se(f,
|
|
438
|
-
}),
|
|
437
|
+
f && se(f, r) && (r = f);
|
|
438
|
+
}), r;
|
|
439
439
|
}
|
|
440
440
|
function re() {
|
|
441
441
|
const t = [];
|
|
@@ -444,19 +444,19 @@ function re() {
|
|
|
444
444
|
e = !0;
|
|
445
445
|
};
|
|
446
446
|
return typeof window < "u" && window.addEventListener("popstate", n), {
|
|
447
|
-
resolve(
|
|
448
|
-
const i = V(
|
|
447
|
+
resolve(s, r) {
|
|
448
|
+
const i = V(s), l = V(r);
|
|
449
449
|
if (t.length === 0)
|
|
450
450
|
t.push(i);
|
|
451
451
|
else if (t[t.length - 1] !== i) {
|
|
452
452
|
const u = t.lastIndexOf(i);
|
|
453
453
|
u >= 0 ? t.splice(u + 1) : t.push(i);
|
|
454
454
|
}
|
|
455
|
-
const
|
|
455
|
+
const a = t[t.length - 2], f = e || a === l ? "backward" : "forward";
|
|
456
456
|
if (e = !1, f === "backward") {
|
|
457
|
-
const u = t.lastIndexOf(
|
|
458
|
-
u >= 0 ? t.splice(u + 1) : t.push(
|
|
459
|
-
} else t[t.length - 1] !==
|
|
457
|
+
const u = t.lastIndexOf(l);
|
|
458
|
+
u >= 0 ? t.splice(u + 1) : t.push(l);
|
|
459
|
+
} else t[t.length - 1] !== l && t.push(l);
|
|
460
460
|
return f;
|
|
461
461
|
},
|
|
462
462
|
dispose() {
|
|
@@ -465,89 +465,94 @@ function re() {
|
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
467
|
function ce(t = {}) {
|
|
468
|
-
let e = null;
|
|
469
|
-
function
|
|
470
|
-
var
|
|
471
|
-
e && ((
|
|
468
|
+
let e = null, n = null;
|
|
469
|
+
function s() {
|
|
470
|
+
var i, l;
|
|
471
|
+
e && ((i = e.out) == null || i.resolve(null), (l = e.in) == null || l.resolve(null), e = null);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function r() {
|
|
474
474
|
if (e != null && e.out && e.in) {
|
|
475
475
|
if (e.out.path === e.in.path) {
|
|
476
|
-
|
|
476
|
+
s();
|
|
477
477
|
return;
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const i = {
|
|
480
480
|
from: e.out.path,
|
|
481
481
|
to: e.in.path,
|
|
482
482
|
out: e.out.payload,
|
|
483
483
|
in: e.in.payload
|
|
484
484
|
};
|
|
485
|
-
e.out.resolve(
|
|
485
|
+
n = i, e.out.resolve(i), e.in.resolve(i), e = null;
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
return {
|
|
489
|
-
arrive(
|
|
490
|
-
return new Promise((
|
|
491
|
-
var
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
489
|
+
arrive(i, l, a) {
|
|
490
|
+
return new Promise((f) => {
|
|
491
|
+
var h, w;
|
|
492
|
+
const u = n === null ? null : l === "out" ? { path: n.from, payload: n.out } : { path: n.to, payload: n.in };
|
|
493
|
+
if ((u == null ? void 0 : u.path) === i) {
|
|
494
|
+
f(null);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
l === "out" && ((h = e == null ? void 0 : e.in) == null ? void 0 : h.path) === i && !e.out && (e.in.resolve(null), e.in = void 0);
|
|
498
|
+
const y = e == null ? void 0 : e[l];
|
|
499
|
+
y && y.path !== i && s(), e || (e = {});
|
|
500
|
+
const p = e[l];
|
|
501
|
+
if (p) {
|
|
502
|
+
if (((w = t.keepCurrent) == null ? void 0 : w.call(t, {
|
|
503
|
+
type: l,
|
|
504
|
+
path: i,
|
|
505
|
+
current: p.payload,
|
|
501
506
|
next: a
|
|
502
507
|
})) ?? !1) {
|
|
503
|
-
|
|
508
|
+
f(null);
|
|
504
509
|
return;
|
|
505
510
|
}
|
|
506
|
-
|
|
511
|
+
p.resolve(null);
|
|
507
512
|
}
|
|
508
|
-
e[
|
|
513
|
+
e[l] = { path: i, payload: a, resolve: f }, r();
|
|
509
514
|
});
|
|
510
515
|
},
|
|
511
|
-
cancel(
|
|
512
|
-
(e != null && e.out &&
|
|
516
|
+
cancel(i) {
|
|
517
|
+
(e != null && e.out && i(e.out.payload) || e != null && e.in && i(e.in.payload)) && s(), (n && i(n.out) || n && i(n.in)) && (n = null);
|
|
513
518
|
}
|
|
514
519
|
};
|
|
515
520
|
}
|
|
516
521
|
const le = {}, $ = /* @__PURE__ */ new Map();
|
|
517
522
|
let J = null, Pt = !1;
|
|
518
|
-
function
|
|
523
|
+
function At(t, e, n) {
|
|
519
524
|
t instanceof HTMLElement && $.has(t) && !t.isConnected && n.set(t, { entry: $.get(t), anchor: e });
|
|
520
|
-
for (const
|
|
521
|
-
|
|
525
|
+
for (const s of Array.from(t.childNodes))
|
|
526
|
+
At(s, e, n);
|
|
522
527
|
}
|
|
523
528
|
function ae(t) {
|
|
524
529
|
const e = new Set(
|
|
525
530
|
Array.from(t.values(), ({ entry: n }) => n)
|
|
526
531
|
);
|
|
527
|
-
for (const [n, { entry:
|
|
532
|
+
for (const [n, { entry: s, anchor: r }] of t) {
|
|
528
533
|
$.delete(n);
|
|
529
|
-
let i =
|
|
534
|
+
let i = s.parent, l = !1;
|
|
530
535
|
for (; i; ) {
|
|
531
|
-
if (i.group ===
|
|
532
|
-
|
|
536
|
+
if (i.group === s.group && e.has(i)) {
|
|
537
|
+
l = !0;
|
|
533
538
|
break;
|
|
534
539
|
}
|
|
535
540
|
i = i.parent;
|
|
536
541
|
}
|
|
537
|
-
queueMicrotask(() =>
|
|
542
|
+
queueMicrotask(() => s.callback(r, { emit: !l }));
|
|
538
543
|
}
|
|
539
544
|
}
|
|
540
545
|
function ue() {
|
|
541
546
|
if (Pt || typeof document > "u") return;
|
|
542
547
|
Pt = !0, J = new MutationObserver((e) => {
|
|
543
548
|
const n = /* @__PURE__ */ new Map();
|
|
544
|
-
for (const
|
|
545
|
-
const
|
|
546
|
-
parent:
|
|
547
|
-
nextSibling:
|
|
549
|
+
for (const s of e) {
|
|
550
|
+
const r = {
|
|
551
|
+
parent: s.target,
|
|
552
|
+
nextSibling: s.nextSibling
|
|
548
553
|
};
|
|
549
|
-
for (const i of Array.from(
|
|
550
|
-
|
|
554
|
+
for (const i of Array.from(s.removedNodes))
|
|
555
|
+
At(i, r, n);
|
|
551
556
|
}
|
|
552
557
|
ae(n);
|
|
553
558
|
});
|
|
@@ -558,20 +563,20 @@ function ue() {
|
|
|
558
563
|
}
|
|
559
564
|
function de(t, e, n = le) {
|
|
560
565
|
ue();
|
|
561
|
-
let
|
|
562
|
-
for (;
|
|
563
|
-
const i = $.get(
|
|
566
|
+
let s = t.parentElement, r = null;
|
|
567
|
+
for (; s; ) {
|
|
568
|
+
const i = $.get(s);
|
|
564
569
|
if ((i == null ? void 0 : i.group) === n) {
|
|
565
|
-
|
|
570
|
+
r = i;
|
|
566
571
|
break;
|
|
567
572
|
}
|
|
568
|
-
|
|
573
|
+
s = s.parentElement;
|
|
569
574
|
}
|
|
570
575
|
return $.set(t, {
|
|
571
576
|
element: t,
|
|
572
577
|
callback: e,
|
|
573
578
|
group: n,
|
|
574
|
-
parent:
|
|
579
|
+
parent: r
|
|
575
580
|
}), () => {
|
|
576
581
|
$.delete(t);
|
|
577
582
|
};
|
|
@@ -586,36 +591,36 @@ function q(t) {
|
|
|
586
591
|
function fe() {
|
|
587
592
|
return tt || (tt = new MutationObserver((t) => {
|
|
588
593
|
for (const e of t) {
|
|
589
|
-
const n = e.target,
|
|
590
|
-
if (!
|
|
591
|
-
const
|
|
592
|
-
|
|
594
|
+
const n = e.target, s = ut.get(n);
|
|
595
|
+
if (!s) continue;
|
|
596
|
+
const r = q(n);
|
|
597
|
+
r !== s.accounted && (s.accounted = r, r === et ? (s.reactHidden = !0, s.onHide()) : r !== "none" && s.reactHidden && (s.reactHidden = !1, s.onShow()));
|
|
593
598
|
}
|
|
594
599
|
}), tt);
|
|
595
600
|
}
|
|
596
601
|
function he(t, e) {
|
|
597
|
-
const n = q(t),
|
|
602
|
+
const n = q(t), s = {
|
|
598
603
|
accounted: n,
|
|
599
604
|
reactHidden: n === et,
|
|
600
605
|
onHide: e.onHide,
|
|
601
606
|
onShow: e.onShow
|
|
602
607
|
};
|
|
603
|
-
return ut.set(t,
|
|
608
|
+
return ut.set(t, s), fe().observe(t, {
|
|
604
609
|
attributes: !0,
|
|
605
610
|
attributeFilter: ["style"]
|
|
606
611
|
}), {
|
|
607
612
|
get isHidden() {
|
|
608
613
|
return q(t) === et;
|
|
609
614
|
},
|
|
610
|
-
setDisplay(
|
|
611
|
-
|
|
615
|
+
setDisplay(r, i = !1) {
|
|
616
|
+
r === null ? t.style.removeProperty("display") : t.style.setProperty(
|
|
612
617
|
"display",
|
|
613
|
-
|
|
618
|
+
r,
|
|
614
619
|
i ? "important" : ""
|
|
615
|
-
),
|
|
620
|
+
), s.accounted = q(t);
|
|
616
621
|
},
|
|
617
622
|
sync() {
|
|
618
|
-
|
|
623
|
+
s.accounted = q(t), s.reactHidden = s.accounted === et;
|
|
619
624
|
},
|
|
620
625
|
stop() {
|
|
621
626
|
ut.delete(t);
|
|
@@ -625,60 +630,60 @@ function he(t, e) {
|
|
|
625
630
|
function Te(t, e = {}) {
|
|
626
631
|
const {
|
|
627
632
|
transitions: n = [],
|
|
628
|
-
middleware:
|
|
629
|
-
preserveScroll:
|
|
630
|
-
} = t, i = e.host ?? new Ft(),
|
|
633
|
+
middleware: s = (o, c) => ({ from: o, to: c }),
|
|
634
|
+
preserveScroll: r = (o) => o
|
|
635
|
+
} = t, i = e.host ?? new Ft(), l = {}, a = ce({
|
|
631
636
|
// Nested boundaries can be discovered in separate MutationObserver
|
|
632
637
|
// batches (notably when Suspense reveals a child later). When the same
|
|
633
638
|
// side/path repeats before pairing, the outermost DOM boundary owns it.
|
|
634
|
-
keepCurrent: ({ current:
|
|
639
|
+
keepCurrent: ({ current: o, next: c }) => o.element.contains(c.element)
|
|
635
640
|
}), f = re(), u = typeof n == "function" ? n : () => n, y = ie();
|
|
636
641
|
y.initialize();
|
|
637
|
-
const
|
|
638
|
-
let c =
|
|
639
|
-
return c === void 0 && (c = o
|
|
642
|
+
const p = /* @__PURE__ */ new Map(), h = (o) => {
|
|
643
|
+
let c = p.get(o);
|
|
644
|
+
return c === void 0 && (c = s(o, o).from, p.set(o, c)), c;
|
|
640
645
|
}, {
|
|
641
|
-
initializeContext:
|
|
642
|
-
calculateScrollOffset:
|
|
646
|
+
initializeContext: w,
|
|
647
|
+
calculateScrollOffset: k,
|
|
643
648
|
evictScrollPosition: A,
|
|
644
649
|
shouldPreserve: L,
|
|
645
650
|
getScrollContainer: K,
|
|
646
651
|
getPositionedParentElement: E,
|
|
647
|
-
getScrollPosition:
|
|
652
|
+
getScrollPosition: S,
|
|
648
653
|
getIsMobile: T
|
|
649
|
-
} = ee({ preserveScroll:
|
|
650
|
-
const
|
|
651
|
-
let c =
|
|
652
|
-
return c || (c = u({ isMobile:
|
|
653
|
-
}, F = /* @__PURE__ */ new WeakMap(), v = (
|
|
654
|
-
F.set(
|
|
655
|
-
parent:
|
|
656
|
-
nextSibling:
|
|
654
|
+
} = ee({ preserveScroll: r, resolvePath: h }), R = /* @__PURE__ */ new Map(), W = () => {
|
|
655
|
+
const o = T();
|
|
656
|
+
let c = R.get(o);
|
|
657
|
+
return c || (c = u({ isMobile: o }), R.set(o, c)), c;
|
|
658
|
+
}, F = /* @__PURE__ */ new WeakMap(), v = (o) => {
|
|
659
|
+
F.set(o, {
|
|
660
|
+
parent: o.parentNode,
|
|
661
|
+
nextSibling: o.nextSibling
|
|
657
662
|
});
|
|
658
|
-
}, g = (
|
|
659
|
-
const c = F.get(
|
|
663
|
+
}, g = (o) => {
|
|
664
|
+
const c = F.get(o);
|
|
660
665
|
return c || {
|
|
661
|
-
parent:
|
|
662
|
-
nextSibling:
|
|
666
|
+
parent: o.parentNode,
|
|
667
|
+
nextSibling: o.nextSibling
|
|
663
668
|
};
|
|
664
669
|
}, b = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap();
|
|
665
670
|
let C = 0;
|
|
666
|
-
const _ = (
|
|
667
|
-
const c = typeof getComputedStyle < "u" ? getComputedStyle(
|
|
671
|
+
const _ = (o) => {
|
|
672
|
+
const c = typeof getComputedStyle < "u" ? getComputedStyle(o).display : "";
|
|
668
673
|
return c && c !== "none" ? c : "block";
|
|
669
|
-
}, D = (
|
|
670
|
-
c.visibleDisplay =
|
|
671
|
-
}, dt = (
|
|
672
|
-
if (P.get(
|
|
673
|
-
P.delete(
|
|
674
|
-
const d = b.get(
|
|
675
|
-
d && (d.savedCss !== null && (
|
|
676
|
-
}, Lt = (
|
|
677
|
-
const x = m.element, H = O.element, B = (m.mode ?? "unmount") === "hidden", { parent: Z, nextSibling: it } = m.parent ? { parent: m.parent, nextSibling: m.nextSibling } : g(x), Q =
|
|
674
|
+
}, D = (o, c) => {
|
|
675
|
+
c.visibleDisplay = o.style.getPropertyValue("display"), c.computedDisplay = _(o);
|
|
676
|
+
}, dt = (o, c) => {
|
|
677
|
+
if (P.get(o) !== c) return;
|
|
678
|
+
P.delete(o);
|
|
679
|
+
const d = b.get(o);
|
|
680
|
+
d && (d.savedCss !== null && (o.style.cssText = d.savedCss, d.savedCss = null), d.intent === "hidden" ? d.vis.setDisplay("none", !0) : d.visibleDisplay ? (d.vis.setDisplay(d.visibleDisplay, !1), D(o, d)) : (d.vis.setDisplay(null), D(o, d)));
|
|
681
|
+
}, Lt = (o, c, d, M, m, O) => {
|
|
682
|
+
const x = m.element, H = O.element, B = (m.mode ?? "unmount") === "hidden", { parent: Z, nextSibling: it } = m.parent ? { parent: m.parent, nextSibling: m.nextSibling } : g(x), Q = k(d, M), st = {
|
|
678
683
|
direction: c,
|
|
679
684
|
scrollOffset: Q,
|
|
680
|
-
from: { scroll:
|
|
681
|
-
to: { scroll:
|
|
685
|
+
from: { scroll: S(d) },
|
|
686
|
+
to: { scroll: S(M) },
|
|
682
687
|
get scrollingElement() {
|
|
683
688
|
return K() || document.documentElement;
|
|
684
689
|
},
|
|
@@ -705,7 +710,7 @@ function Te(t, e = {}) {
|
|
|
705
710
|
return G.setAttribute("data-ssgoi-id", z), gt.push(G), G;
|
|
706
711
|
})
|
|
707
712
|
}, Nt = Promise.resolve(
|
|
708
|
-
|
|
713
|
+
o.prepare ? o.prepare(It) : {}
|
|
709
714
|
);
|
|
710
715
|
$t({
|
|
711
716
|
from: yt,
|
|
@@ -713,7 +718,7 @@ function Te(t, e = {}) {
|
|
|
713
718
|
extras: Nt
|
|
714
719
|
}).then(({ from: z, to: ot, extras: G }) => {
|
|
715
720
|
!B && Z && (it && Z.contains(it) ? Z.insertBefore(I, it) : Z.appendChild(I));
|
|
716
|
-
const rt =
|
|
721
|
+
const rt = o.animation({
|
|
717
722
|
from: z,
|
|
718
723
|
to: ot,
|
|
719
724
|
context: st,
|
|
@@ -725,12 +730,12 @@ function Te(t, e = {}) {
|
|
|
725
730
|
lt.parentNode && lt.parentNode.removeChild(lt);
|
|
726
731
|
}, i.attach(rt);
|
|
727
732
|
});
|
|
728
|
-
}, Y = (
|
|
733
|
+
}, Y = (o, c, d) => {
|
|
729
734
|
const M = y.isSwipeBack();
|
|
730
|
-
|
|
735
|
+
a.arrive(o, c, d).then((m) => {
|
|
731
736
|
if (c === "in" && y.onPageEnter(), !m) return;
|
|
732
737
|
if (M && c === "in") {
|
|
733
|
-
const B =
|
|
738
|
+
const B = s(m.from, m.to);
|
|
734
739
|
f.resolve(B.from, B.to);
|
|
735
740
|
}
|
|
736
741
|
if (M) {
|
|
@@ -738,7 +743,7 @@ function Te(t, e = {}) {
|
|
|
738
743
|
return;
|
|
739
744
|
}
|
|
740
745
|
if (c !== "in") return;
|
|
741
|
-
const { from: O, to: x } =
|
|
746
|
+
const { from: O, to: x } = s(
|
|
742
747
|
m.from,
|
|
743
748
|
m.to
|
|
744
749
|
), H = f.resolve(
|
|
@@ -759,48 +764,48 @@ function Te(t, e = {}) {
|
|
|
759
764
|
m.in
|
|
760
765
|
);
|
|
761
766
|
});
|
|
762
|
-
}, Ot = (
|
|
763
|
-
const d = b.get(
|
|
767
|
+
}, Ot = (o, c) => {
|
|
768
|
+
const d = b.get(o);
|
|
764
769
|
if (!d) return;
|
|
765
770
|
const M = d.intent === "hidden";
|
|
766
|
-
if (d.intent = "hidden", d.savedCss === null && (d.savedCss =
|
|
767
|
-
const m = g(
|
|
768
|
-
element:
|
|
771
|
+
if (d.intent = "hidden", d.savedCss === null && (d.savedCss = o.style.cssText), d.vis.setDisplay(d.computedDisplay || "block", !0), o.style.position = "absolute", o.style.width = "100%", o.style.left = "0", M) return;
|
|
772
|
+
const m = g(o), O = {
|
|
773
|
+
element: o,
|
|
769
774
|
parent: m.parent,
|
|
770
775
|
nextSibling: m.nextSibling,
|
|
771
776
|
mode: "hidden"
|
|
772
|
-
}, x =
|
|
777
|
+
}, x = o.getAttribute("data-ssgoi-transition") ?? c;
|
|
773
778
|
Y(x, "out", O);
|
|
774
|
-
}, _t = (
|
|
775
|
-
const d = b.get(
|
|
779
|
+
}, _t = (o, c) => {
|
|
780
|
+
const d = b.get(o);
|
|
776
781
|
if (!d || d.intent === "visible") return;
|
|
777
|
-
d.intent = "visible", D(
|
|
782
|
+
d.intent = "visible", D(o, d), d.savedCss !== null && (o.style.cssText = d.savedCss, d.visibleDisplay ? d.vis.setDisplay(d.visibleDisplay, !1) : d.vis.setDisplay(null)), w(o, c);
|
|
778
783
|
const M = {
|
|
779
|
-
element:
|
|
780
|
-
parent:
|
|
781
|
-
nextSibling:
|
|
782
|
-
}, m =
|
|
784
|
+
element: o,
|
|
785
|
+
parent: o.parentElement,
|
|
786
|
+
nextSibling: o.nextElementSibling
|
|
787
|
+
}, m = o.getAttribute("data-ssgoi-transition") ?? c;
|
|
783
788
|
Y(m, "in", M);
|
|
784
|
-
}, Dt = (
|
|
785
|
-
const m = b.get(
|
|
786
|
-
if (m && (m.vis.stop(), b.delete(
|
|
787
|
-
|
|
789
|
+
}, Dt = (o, c, d, M = !0) => {
|
|
790
|
+
const m = b.get(o);
|
|
791
|
+
if (m && (m.vis.stop(), b.delete(o), P.delete(o), m.intent === "hidden")) {
|
|
792
|
+
a.cancel((X) => X.element === o);
|
|
788
793
|
return;
|
|
789
794
|
}
|
|
790
795
|
if (!M) return;
|
|
791
|
-
const O = d ?? g(
|
|
792
|
-
element:
|
|
796
|
+
const O = d ?? g(o), x = {
|
|
797
|
+
element: o,
|
|
793
798
|
parent: O.parent,
|
|
794
799
|
nextSibling: O.nextSibling,
|
|
795
800
|
mode: "unmount"
|
|
796
|
-
}, H =
|
|
801
|
+
}, H = o.getAttribute("data-ssgoi-transition") ?? c;
|
|
797
802
|
Y(H, "out", x);
|
|
798
|
-
}, ft = /* @__PURE__ */ new WeakSet(), ht = (
|
|
803
|
+
}, ft = /* @__PURE__ */ new WeakSet(), ht = (o, c, { enter: d = !0 } = {}) => {
|
|
799
804
|
if (ft.has(c)) return;
|
|
800
805
|
ft.add(c), v(c);
|
|
801
806
|
const M = he(c, {
|
|
802
|
-
onHide: () => Ot(c,
|
|
803
|
-
onShow: () => _t(c,
|
|
807
|
+
onHide: () => Ot(c, o),
|
|
808
|
+
onShow: () => _t(c, o)
|
|
804
809
|
}), m = {
|
|
805
810
|
vis: M,
|
|
806
811
|
savedCss: null,
|
|
@@ -809,25 +814,25 @@ function Te(t, e = {}) {
|
|
|
809
814
|
computedDisplay: "block"
|
|
810
815
|
};
|
|
811
816
|
if (b.set(c, m), !M.isHidden && (D(c, m), d)) {
|
|
812
|
-
|
|
817
|
+
w(c, o);
|
|
813
818
|
const O = {
|
|
814
819
|
element: c,
|
|
815
820
|
parent: c.parentElement,
|
|
816
821
|
nextSibling: c.nextElementSibling
|
|
817
822
|
};
|
|
818
|
-
Y(
|
|
823
|
+
Y(o, "in", O);
|
|
819
824
|
}
|
|
820
825
|
de(
|
|
821
826
|
c,
|
|
822
|
-
(O, x) => Dt(c,
|
|
823
|
-
|
|
827
|
+
(O, x) => Dt(c, o, O, (x == null ? void 0 : x.emit) ?? !0),
|
|
828
|
+
l
|
|
824
829
|
);
|
|
825
830
|
}, pt = /* @__PURE__ */ new Map();
|
|
826
|
-
return { register: ht, refFor: (
|
|
827
|
-
let c = pt.get(
|
|
831
|
+
return { register: ht, refFor: (o) => {
|
|
832
|
+
let c = pt.get(o);
|
|
828
833
|
return c || (c = (d) => {
|
|
829
|
-
d && ht(
|
|
830
|
-
}, pt.set(
|
|
834
|
+
d && ht(o, d);
|
|
835
|
+
}, pt.set(o, c)), c;
|
|
831
836
|
} };
|
|
832
837
|
}
|
|
833
838
|
const Rt = "data-ssgoi-root", pe = `[${Rt}]`, nt = "data-ssgoi-transition", xt = `[${nt}]`, ye = "[data-ssgoi-clone]";
|
|
@@ -847,48 +852,48 @@ function Ct(t) {
|
|
|
847
852
|
return e;
|
|
848
853
|
}
|
|
849
854
|
function Mt(t, e, n = t) {
|
|
850
|
-
const
|
|
851
|
-
(
|
|
855
|
+
const s = Array.from(t).sort(
|
|
856
|
+
(r, i) => Ct(r) - Ct(i)
|
|
852
857
|
);
|
|
853
|
-
for (const
|
|
854
|
-
const i =
|
|
858
|
+
for (const r of s) {
|
|
859
|
+
const i = r.getAttribute(nt);
|
|
855
860
|
if (i === null) continue;
|
|
856
|
-
let
|
|
857
|
-
for (;
|
|
858
|
-
if (n.has(
|
|
859
|
-
|
|
861
|
+
let l = r.parentElement, a = !1;
|
|
862
|
+
for (; l; ) {
|
|
863
|
+
if (n.has(l)) {
|
|
864
|
+
a = !0;
|
|
860
865
|
break;
|
|
861
866
|
}
|
|
862
|
-
|
|
867
|
+
l = l.parentElement;
|
|
863
868
|
}
|
|
864
|
-
e.register(i,
|
|
869
|
+
e.register(i, r, { enter: !a });
|
|
865
870
|
}
|
|
866
871
|
}
|
|
867
872
|
function Pe(t, e) {
|
|
868
873
|
if (!me()) return () => {
|
|
869
874
|
};
|
|
870
875
|
t.setAttribute(Rt, "");
|
|
871
|
-
const n = (
|
|
872
|
-
if (ge(
|
|
873
|
-
if (
|
|
874
|
-
const u =
|
|
876
|
+
const n = (a) => a.closest(pe) === t, s = (a) => !ve(a) || !n(a) || a.closest(ye) || a.getAttribute(nt) === null ? null : a, r = (a, f) => {
|
|
877
|
+
if (ge(a)) {
|
|
878
|
+
if (a.matches(xt)) {
|
|
879
|
+
const u = s(a);
|
|
875
880
|
u && f.add(u);
|
|
876
881
|
}
|
|
877
|
-
for (const u of
|
|
878
|
-
const y =
|
|
882
|
+
for (const u of a.querySelectorAll(xt)) {
|
|
883
|
+
const y = s(u);
|
|
879
884
|
y && f.add(y);
|
|
880
885
|
}
|
|
881
886
|
}
|
|
882
|
-
}, i = new MutationObserver((
|
|
887
|
+
}, i = new MutationObserver((a) => {
|
|
883
888
|
const f = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
884
|
-
for (const y of
|
|
889
|
+
for (const y of a) {
|
|
885
890
|
if (y.type === "attributes") {
|
|
886
|
-
const
|
|
887
|
-
|
|
891
|
+
const p = s(y.target);
|
|
892
|
+
p && f.add(p);
|
|
888
893
|
continue;
|
|
889
894
|
}
|
|
890
|
-
for (const
|
|
891
|
-
|
|
895
|
+
for (const p of y.addedNodes)
|
|
896
|
+
r(p, u);
|
|
892
897
|
}
|
|
893
898
|
for (const y of u) f.add(y);
|
|
894
899
|
Mt(f, e, u);
|
|
@@ -899,14 +904,14 @@ function Pe(t, e) {
|
|
|
899
904
|
attributes: !0,
|
|
900
905
|
attributeFilter: [nt]
|
|
901
906
|
});
|
|
902
|
-
const
|
|
903
|
-
return
|
|
907
|
+
const l = /* @__PURE__ */ new Set();
|
|
908
|
+
return r(t, l), Mt(l, e), () => i.disconnect();
|
|
904
909
|
}
|
|
905
910
|
export {
|
|
906
911
|
Bt as Animation,
|
|
907
912
|
Ft as HostAnimation,
|
|
908
913
|
Me as MultiAnimation,
|
|
909
|
-
|
|
914
|
+
ke as WebAnimation,
|
|
910
915
|
Te as createSggoiTransitionContext,
|
|
911
916
|
Pe as observeSsgoiTransitions
|
|
912
917
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-detector-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/navigation-detector-strategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,CAAC,QAAQ,IAAI;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,QAAQ,CAAC;IACd,EAAE,EAAE,QAAQ,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,IAAI,CAAC;AAEjD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,IAAI;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,QAAQ,IAAI;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC;CACrE,CAAC;AAEF,MAAM,WAAW,kBAAkB,CAAC,QAAQ;IAC1C;;;OAGG;IACH,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,qBAAqB,EAC3B,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;IAE5C;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,GAAG,IAAI,CAAC;CACzD;AAaD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAC/C,OAAO,GAAE,yBAAyB,CAAC,QAAQ,CAAM,GAChD,kBAAkB,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"navigation-detector-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/navigation-detector-strategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,CAAC,QAAQ,IAAI;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,QAAQ,CAAC;IACd,EAAE,EAAE,QAAQ,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,IAAI,CAAC;AAEjD,MAAM,MAAM,mBAAmB,CAAC,QAAQ,IAAI;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,QAAQ,IAAI;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC;CACrE,CAAC;AAEF,MAAM,WAAW,kBAAkB,CAAC,QAAQ;IAC1C;;;OAGG;IACH,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,qBAAqB,EAC3B,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;IAE5C;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,GAAG,IAAI,CAAC;CACzD;AAaD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAC/C,OAAO,GAAE,yBAAyB,CAAC,QAAQ,CAAM,GAChD,kBAAkB,CAAC,QAAQ,CAAC,CA4H9B"}
|