aptechka 0.94.6 → 0.95.0
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/lib/{Animation-DwOegoQA.js → Animation-D5bhzxA5.js} +2 -2
- package/lib/Animation-WtDiwPFQ.cjs +1 -0
- package/lib/Damped-B8unWaEn.cjs +1 -0
- package/lib/{Damped-m3PWu4LD.js → Damped-BZrSNeI7.js} +2 -2
- package/lib/Damped-BxBI6Dds.js +50 -0
- package/lib/Damped-DTVkIAqc.cjs +1 -0
- package/lib/{DerivedArray-CP3QiK6l.cjs → DerivedArray-0qZFAKZ4.cjs} +1 -1
- package/lib/{DerivedArray-DT9yLVm3.js → DerivedArray-BKdK5OWE.js} +1 -1
- package/lib/DragControls-CqNPYkc2.cjs +1 -0
- package/lib/{DragControls-DSG2Orh3.js → DragControls-DDFMqZg4.js} +5 -3
- package/lib/LocalLinks-5-30Z1lF.cjs +1 -0
- package/lib/{LocalLinks-BjyGjtxD.js → LocalLinks-D9RhyFMf.js} +1 -2
- package/lib/{PageAnnouncerElement-Bqbv_gWM.js → PageAnnouncerElement-CI048qxO.js} +2 -2
- package/lib/PageAnnouncerElement-DreveHSN.cjs +1 -0
- package/lib/{PageScroll-DgTMhV1L.js → PageScroll-CrYJVAHA.js} +1 -2
- package/lib/PageScroll-xuHDTIoC.cjs +1 -0
- package/lib/ScrollNavigator-CNKI1Iae.cjs +1 -0
- package/lib/ScrollNavigator-CiZjoiyk.js +83 -0
- package/lib/{SourceElement-DNEy09VX.js → SourceElement-BMinosvj.js} +13 -11
- package/lib/SourceElement-D9iTbecT.cjs +5 -0
- package/lib/Store-BP8tuWzQ.cjs +1 -0
- package/lib/{Store-CAGUSjFX.js → Store-LDYxlJNu.js} +7 -99
- package/lib/Tweened-9ATB544_.js +118 -0
- package/lib/{Tweened-CZeS3EqK.js → Tweened-BAR8oYF3.js} +3 -39
- package/lib/Tweened-BNb6DQ39.cjs +1 -0
- package/lib/Tweened-FpbbJ3xC.cjs +1 -0
- package/lib/Viewport-BdFs1Zsn.cjs +1 -0
- package/lib/{Viewport-B3kVX27H.js → Viewport-CPB14lI1.js} +3 -2
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +2 -2
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/animation-kit/AnimationStore.d.ts +22 -0
- package/lib/animation-kit/Damped.d.ts +14 -0
- package/lib/animation-kit/Spring.d.ts +67 -0
- package/lib/animation-kit/Tweened.d.ts +15 -0
- package/lib/animation-kit/index.cjs +1 -0
- package/lib/animation-kit/index.d.ts +4 -0
- package/lib/animation-kit/index.js +119 -0
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.d.ts +1 -1
- package/lib/api-fetcher/index.js +5 -6
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +3 -2
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +2 -2
- package/lib/browser-B9QXFVgG.js +4 -0
- package/lib/browser-CIp8NsnF.cjs +1 -0
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +3 -3
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +2 -2
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +1 -1
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +2 -2
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/easings-Bgvyia2r.cjs +1 -0
- package/lib/easings-D9LNSyOP.js +41 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.d.ts +1 -1
- package/lib/element-linked-store/index.js +7 -4
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +2 -2
- package/lib/en3/index.cjs +2 -2
- package/lib/en3/index.js +1 -2
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +4 -3
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +5 -4
- package/lib/index-BrasTsja.cjs +1 -0
- package/lib/{index-DAG0CtYo.js → index-Z2Lgb7xU.js} +73 -73
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +2 -2
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.js +6 -5
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +1 -1
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +2 -2
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +1 -2
- package/lib/local-links/LocalLinks.d.ts +3 -2
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +1 -1
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +3 -3
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/morph/Morph.d.ts +3 -2
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +5 -4
- package/lib/need_redo_tweaker/index.cjs +3 -3
- package/lib/need_redo_tweaker/index.js +5 -3
- package/lib/notched/index.cjs +2 -2
- package/lib/notched/index.js +2 -2
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +1 -1
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +1 -1
- package/lib/pixel-perfect/index.cjs +1 -1
- package/lib/pixel-perfect/index.js +2 -3
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +4 -3
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +9 -9
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +1 -2
- package/lib/render-C3udrJln.cjs +1 -0
- package/lib/{render-q67wh8Lw.js → render-D_MhEAJB.js} +4 -3
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +5 -6
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +9 -7
- package/lib/scroll-kit/ScrollNavigator.d.ts +17 -0
- package/lib/scroll-kit/SmoothScrollElement.d.ts +9 -8
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +78 -91
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +4 -3
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +2 -2
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +2 -2
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +6 -6
- package/lib/store/Store.d.ts +2 -4
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +4 -4
- package/lib/string-Bx5N38JG.cjs +1 -0
- package/lib/string-Ct-dy_cs.js +90 -0
- package/lib/stylesheet-B-bI1cZ3.cjs +1 -0
- package/lib/{stylesheet-GIzIJ_Xj.js → stylesheet-BUUjDCDf.js} +2 -1
- package/lib/subtree-observer/index.cjs +1 -1
- package/lib/subtree-observer/index.js +1 -2
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +2 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +104 -106
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +5 -4
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +2 -2
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +5 -3
- package/package.json +9 -1
- package/lib/Animation-CS32dwF1.cjs +0 -1
- package/lib/Damped-B_mVO810.cjs +0 -1
- package/lib/DragControls-DZ0Np8yt.cjs +0 -1
- package/lib/LocalLinks-DJPhk_Gn.cjs +0 -1
- package/lib/PageAnnouncerElement-auvTbYB3.cjs +0 -1
- package/lib/PageScroll-DYsZDt3U.cjs +0 -1
- package/lib/SourceElement-CAukFvLE.cjs +0 -5
- package/lib/Store-B96mD8mD.cjs +0 -1
- package/lib/Tweened-j_TwbxEI.cjs +0 -1
- package/lib/Viewport-Blxv_yl_.cjs +0 -1
- package/lib/index-BoGx2BWX.cjs +0 -1
- package/lib/render-B5iiOqye.cjs +0 -1
- package/lib/scroll-CTDesBpj.cjs +0 -1
- package/lib/scroll-D1MT0QMY.js +0 -60
- package/lib/stylesheet-DQv6_0na.cjs +0 -1
- package/lib/utils/scroll.d.ts +0 -14
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const elementLinkedStore_index=require("./element-linked-store/index.cjs"),loading_index=require("./loading/index.cjs"),Store=require("./Store-B96mD8mD.cjs"),events=require("./events-UlGk63iC.cjs"),metadata=require("./metadata-BrHUfpV9.cjs");require("./index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const order_index=require("./order/index.cjs"),windowResizer_index=require("./window-resizer/index.cjs");var _url,_name,_density,_query,_queryValue,_queryType,_extension;const _Source=class _Source{constructor(url){__privateAdd(this,_url);__privateAdd(this,_name);__privateAdd(this,_density);__privateAdd(this,_query);__privateAdd(this,_queryValue);__privateAdd(this,_queryType);__privateAdd(this,_extension);__privateSet(this,_url,url);let splitted=url.split(".");const xpattern=/\b\d{1,2}x\b/g,xmatch=splitted.find(s=>s.match(xpattern)&&parseInt(s));__privateSet(this,_density,xmatch?parseInt(xmatch):1),xmatch&&(splitted=splitted.slice(0,-1)),__privateSet(this,_name,splitted.length>1?splitted.slice(0,-1).join("."):splitted.join("."));const maxpattern=/\d+max/g,minpattern=/\d+min/g,maxAspectPattern=/\d+mar/g,minAspectPattern=/\d+mir/g,maxmatch=splitted.find(s=>s.match(maxpattern)),minmatch=splitted.find(s=>s.match(minpattern)),maxRatioMatch=splitted.find(s=>s.match(maxAspectPattern)),minRatioMatch=splitted.find(s=>s.match(minAspectPattern));maxRatioMatch?(__privateSet(this,_queryValue,parseInt(maxRatioMatch)),__privateSet(this,_queryType,"max"),__privateSet(this,_query,`(max-aspect-ratio: ${__privateGet(this,_queryValue)})`)):minRatioMatch?(__privateSet(this,_queryValue,parseInt(minRatioMatch)),__privateSet(this,_queryType,"max"),__privateSet(this,_query,`(min-aspect-ratio: ${__privateGet(this,_queryValue)})`)):maxmatch?(__privateSet(this,_queryValue,parseInt(maxmatch)),__privateSet(this,_queryType,"max"),__privateSet(this,_query,`(max-width: ${__privateGet(this,_queryValue)}px)`)):minmatch?(__privateSet(this,_queryValue,parseInt(minmatch)),__privateSet(this,_query,`(min-width: ${__privateGet(this,_queryValue)}px)`),__privateSet(this,_queryType,"min")):(__privateSet(this,_queryValue,0),__privateSet(this,_query,`(min-width: ${__privateGet(this,_queryValue)}px)`),__privateSet(this,_queryType,"min")),__privateSet(this,_name,__privateGet(this,_name).replace(`.${__privateGet(this,_queryValue)}${__privateGet(this,_queryType)}`,"")),__privateSet(this,_extension,splitted[splitted.length-1]===__privateGet(this,_name)?"":"."+splitted[splitted.length-1]),__privateSet(this,_extension,__privateGet(this,_extension).replace(`.${__privateGet(this,_queryValue)}${__privateGet(this,_queryType)}`,""))}get url(){return __privateGet(this,_url)}get name(){return __privateGet(this,_name)}get density(){return __privateGet(this,_density)}get query(){return __privateGet(this,_query)}get extension(){return __privateGet(this,_extension)}get queryType(){return __privateGet(this,_queryType)}get queryValue(){return __privateGet(this,_queryValue)}};_url=new WeakMap,_name=new WeakMap,_density=new WeakMap,_query=new WeakMap,_queryValue=new WeakMap,_queryType=new WeakMap,_extension=new WeakMap,__name(_Source,"Source");let Source=_Source;var _mediaBuckets;const _SourceSet=class _SourceSet{constructor(sourceSet,options){__privateAdd(this,_mediaBuckets);__privateSet(this,_mediaBuckets,new Map);const allowMediaBuckets=(options==null?void 0:options.mediaBuckets)!==!1,mediaBuckets=typeof sourceSet=="string"?allowMediaBuckets?sourceSet.trim().split(",").map(u=>u.trim()).filter(u=>!!u):[sourceSet]:sourceSet,tmp=[];mediaBuckets.forEach(v=>{const source=new Source(v);tmp.push([source.query,source])});const max=tmp.filter(v=>v[1].queryType.includes("max")).sort((a,b)=>b[1].queryValue-a[1].queryValue),min=tmp.filter(v=>v[1].queryType.includes("min")&&v[1].queryValue!==0).sort((a,b)=>a[1].queryValue-b[1].queryValue),defaultMatch=tmp.filter(t=>t[0]==="(min-width: 0px)");(defaultMatch?[...defaultMatch,...max,...min]:[...max,...min]).forEach(v=>{__privateGet(this,_mediaBuckets).has(v[0])||__privateGet(this,_mediaBuckets).set(v[0],[]),__privateGet(this,_mediaBuckets).get(v[0]).push(v[1])})}get mediaBuckets(){return __privateGet(this,_mediaBuckets)}};_mediaBuckets=new WeakMap,__name(_SourceSet,"SourceSet");let SourceSet=_SourceSet;var _srcset,_resizeListener;const _SourceManager=class _SourceManager extends Store.Store{constructor(parameters){super(void 0);__privateAdd(this,_srcset);__privateAdd(this,_resizeListener,__name(()=>{let matchedSources;__privateGet(this,_srcset).mediaBuckets.forEach((sources,query)=>{matchMedia(query).matches&&(matchedSources=sources)});let matchedSouce,maxDensity=0;matchedSources==null||matchedSources.forEach(s=>{s.density>maxDensity&&s.density<=Math.max(devicePixelRatio,1)&&(maxDensity=s.density,matchedSouce=s)}),matchedSources!=null&&matchedSources.length&&!matchedSouce&&(matchedSouce=matchedSources[0]),this.current=matchedSouce},"#resizeListener"));__privateSet(this,_srcset,new SourceSet(parameters.srcset,parameters.sourceSetOptions))}updateSource(parameters){__privateSet(this,_srcset,new SourceSet(parameters.srcset,parameters.sourceSetOptions)),__privateGet(this,_resizeListener).call(this)}close(){super.close(),this.disconnect()}connect(){windowResizer_index.windowResizer.subscribe(__privateGet(this,_resizeListener),order_index.RESIZE_ORDER.SOURCE_MANAGER),__privateGet(this,_resizeListener).call(this)}disconnect(){windowResizer_index.windowResizer.unsubscribe(__privateGet(this,_resizeListener))}};_srcset=new WeakMap,_resizeListener=new WeakMap,__name(_SourceManager,"SourceManager");let SourceManager=_SourceManager,id=0;var _sourceManager,_consumerElement,_consumerHolderElement,_loadTriggerElements,_isFirstLoadHappened,_isLazy,_lazyLoaded,_isManualLoad,_id,_idWithUrl,_status,_intersectionObserver,_clearTimeoutId,_currentURL,_sourceSetOptions,_SourceElement_instances,loadSource_fn,_loadTriggerListener,_intersectionListener,_loadListener,_errorListener,_playListener,_pauseListener,_loadedmetadataListener;const _SourceElement=class _SourceElement extends HTMLElement{constructor(options){super();__privateAdd(this,_SourceElement_instances);__privateAdd(this,_sourceManager,null);__privateAdd(this,_consumerElement,null);__privateAdd(this,_consumerHolderElement,this);__privateAdd(this,_loadTriggerElements,[]);__privateAdd(this,_isFirstLoadHappened,!1);__privateAdd(this,_isLazy,!1);__privateAdd(this,_lazyLoaded,!1);__privateAdd(this,_isManualLoad,!1);__privateAdd(this,_id,"");__privateAdd(this,_idWithUrl,"");__privateAdd(this,_status,new elementLinkedStore_index.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1,playing:!1,metadata:!1}));__privateAdd(this,_intersectionObserver,null);__privateAdd(this,_clearTimeoutId);__privateAdd(this,_currentURL,null);__privateAdd(this,_sourceSetOptions);__privateAdd(this,_loadTriggerListener,__name(()=>{this.triggerLazyLoad()},"#loadTriggerListener"));__privateAdd(this,_intersectionListener,__name(entries=>{const entry=entries[0];__privateGet(this,_isLazy)&&!__privateGet(this,_isManualLoad)&&(!__privateGet(this,_lazyLoaded)||this.hasAttribute("reload-source"))&&entry.isIntersecting&&this.triggerLazyLoad(),entry.isIntersecting?events.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(__privateMethod(this,_SourceElement_instances,loadSource_fn).call(this,void 0),__privateSet(this,_lazyLoaded,!1)),events.dispatchEvent(this,"sourceRelease",{custom:!0}))},"#intersectionListener"));__privateAdd(this,_loadListener,__name(()=>{__privateGet(this,_status).set("loaded",!0),__privateGet(this,_status).set("error",!1),__privateGet(this,_status).set("loading",!1),!__privateGet(this,_isLazy)&&!__privateGet(this,_isFirstLoadHappened)&&loading_index.loading.complete(__privateGet(this,_idWithUrl)),events.dispatchEvent(this,"sourceLoaded",{custom:!0});const clearDuration=getComputedStyle(this).getPropertyValue("--clear-duration");clearDuration?__privateSet(this,_clearTimeoutId,setTimeout(()=>{__privateGet(this,_status).set("clear",!0)},parseFloat(clearDuration)*1e3)):__privateGet(this,_status).set("clear",!0),__privateSet(this,_isFirstLoadHappened,!0)},"#loadListener"));__privateAdd(this,_errorListener,__name(url=>{__privateGet(this,_status).set("loaded",!1),__privateGet(this,_status).set("error",!0),__privateGet(this,_status).set("loading",!1),!__privateGet(this,_isLazy)&&!__privateGet(this,_isFirstLoadHappened)&&loading_index.loading.error(__privateGet(this,_idWithUrl)),events.dispatchEvent(this,"sourceError",{custom:!0}),__privateSet(this,_isFirstLoadHappened,!0)},"#errorListener"));__privateAdd(this,_playListener,__name(()=>{__privateGet(this,_status).set("playing",!0),events.dispatchEvent(this,"sourcePlay",{custom:!0})},"#playListener"));__privateAdd(this,_pauseListener,__name(()=>{__privateGet(this,_status).set("playing",!1),events.dispatchEvent(this,"sourcePause",{custom:!0})},"#pauseListener"));__privateAdd(this,_loadedmetadataListener,__name(()=>{const consumerElement=__privateGet(this,_consumerElement);(consumerElement.tagName==="VIDEO"||consumerElement.tagName==="AUDIO")&&consumerElement.readyState>=1&&(__privateGet(this,_status).set("metadata",!0),events.dispatchEvent(this,"sourceMetadataLoaded",{custom:!0}),this.querySelectorAll("[data-source-duration]").forEach(el=>{el.textContent=metadata.formatMediaDuration(consumerElement.duration)}))},"#loadedmetadataListener"));__privateSet(this,_sourceSetOptions,options==null?void 0:options.sourceSetOptions),Store.isBrowser&&window.IntersectionObserver&&__privateSet(this,_intersectionObserver,new IntersectionObserver(__privateGet(this,_intersectionListener))),__privateGet(this,_status).subscribe(e=>{var _a;const globalClasses=(_a=this.getAttribute("data-global-play-class"))==null?void 0:_a.split(",");globalClasses!=null&&globalClasses.length&&(e.current.playing?globalClasses.forEach(className=>{document.documentElement.classList.add(className.trim())}):globalClasses.forEach(className=>{document.documentElement.classList.remove(className.trim())}))})}get consumerElement(){return __privateGet(this,_consumerElement)}get consumerHolderElement(){return __privateGet(this,_consumerHolderElement)}get sourceManager(){return __privateGet(this,_sourceManager)}get status(){return __privateGet(this,_status)}get isLazy(){return __privateGet(this,_isLazy)}get currentURL(){return __privateGet(this,_currentURL)}get isFirstLoadHappened(){return __privateGet(this,_isFirstLoadHappened)}triggerLazyLoad(){!__privateGet(this,_lazyLoaded)&&__privateGet(this,_sourceManager).current&&__privateGet(this,_sourceManager).current!==__privateGet(this,_sourceManager).previous&&(__privateSet(this,_lazyLoaded,!0),__privateMethod(this,_SourceElement_instances,loadSource_fn).call(this,__privateGet(this,_sourceManager).current))}connectedCallback(){__privateSet(this,_id,`source-consumer-${++id}`);const srcset=this.getAttribute("srcset")||"",notifyElement=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;notifyElement&&__privateGet(this,_status).addElement(notifyElement),__privateSet(this,_consumerHolderElement,this.querySelector("[data-consumer-holder]")||this),this.querySelectorAll(".source-consumer").forEach(el=>el==null?void 0:el.remove()),__privateSet(this,_loadTriggerElements,[...this.querySelectorAll("[data-load-trigger]")]),__privateGet(this,_loadTriggerElements).forEach(el=>{el.addEventListener("click",__privateGet(this,_loadTriggerListener))}),__privateSet(this,_consumerElement,this.createConsumer()),__privateGet(this,_consumerElement).style.cssText=`
|
|
2
|
-
display: block;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
`,__privateGet(this,_consumerElement).classList.add("source-consumer"),__privateGet(this,_consumerElement).addEventListener("play",__privateGet(this,_playListener)),__privateGet(this,_consumerElement).addEventListener("pause",__privateGet(this,_pauseListener)),__privateGet(this,_consumerElement).addEventListener("loadedmetadata",__privateGet(this,_loadedmetadataListener)),__privateGet(this,_loadedmetadataListener).call(this),Array.from(this.attributes).forEach(attr=>{if(attr.name!=="srcset"){const value=attr.nodeValue||"",camelCased=Store.kebabToCamel(attr.name);camelCased in __privateGet(this,_consumerElement)&&(__privateGet(this,_consumerElement)[camelCased]=value||!0)}});for(const key in this.dataset){const value=this.dataset[key],camelCased=Store.kebabToCamel(key);camelCased in __privateGet(this,_consumerElement)&&(__privateGet(this,_consumerElement)[camelCased]=value?value==="false"?!1:value:!0)}__privateGet(this,_consumerHolderElement).appendChild(__privateGet(this,_consumerElement)),__privateSet(this,_sourceManager,new SourceManager({srcset,sourceSetOptions:__privateGet(this,_sourceSetOptions)})),__privateSet(this,_isLazy,this.hasAttribute("lazy")),__privateSet(this,_isManualLoad,this.hasAttribute("manual-load")),__privateGet(this,_sourceManager).subscribe(d=>{(!__privateGet(this,_isLazy)&&!__privateGet(this,_isManualLoad)||__privateGet(this,_isLazy)&&__privateGet(this,_lazyLoaded))&&__privateMethod(this,_SourceElement_instances,loadSource_fn).call(this,d.current)}),__privateGet(this,_sourceManager).connect(),__privateGet(this,_intersectionObserver).observe(this)}disconnectedCallback(){var _a;clearTimeout(__privateGet(this,_clearTimeoutId)),__privateGet(this,_loadTriggerElements).forEach(el=>{el.removeEventListener("click",__privateGet(this,_loadTriggerListener))}),__privateGet(this,_intersectionObserver).disconnect(),(_a=__privateGet(this,_sourceManager))==null||_a.close(),__privateGet(this,_consumerElement)&&(this.consumeSource(null),__privateGet(this,_consumerElement).removeEventListener("play",__privateGet(this,_playListener)),__privateGet(this,_consumerElement).removeEventListener("pause",__privateGet(this,_pauseListener)),__privateGet(this,_consumerElement).removeEventListener("loadedmetadata",__privateGet(this,_loadedmetadataListener)),__privateGet(this,_consumerElement).onloadeddata=null,__privateGet(this,_consumerElement).onload=null,__privateGet(this,_consumerElement).onerror=null,__privateGet(this,_consumerElement).onerror=null,__privateGet(this,_consumerElement).remove()),__privateSet(this,_isFirstLoadHappened,!1),__privateSet(this,_lazyLoaded,!1),__privateGet(this,_status).reset()}};_sourceManager=new WeakMap,_consumerElement=new WeakMap,_consumerHolderElement=new WeakMap,_loadTriggerElements=new WeakMap,_isFirstLoadHappened=new WeakMap,_isLazy=new WeakMap,_lazyLoaded=new WeakMap,_isManualLoad=new WeakMap,_id=new WeakMap,_idWithUrl=new WeakMap,_status=new WeakMap,_intersectionObserver=new WeakMap,_clearTimeoutId=new WeakMap,_currentURL=new WeakMap,_sourceSetOptions=new WeakMap,_SourceElement_instances=new WeakSet,loadSource_fn=__name(function(source){if(clearTimeout(__privateGet(this,_clearTimeoutId)),__privateGet(this,_consumerElement).onloadeddata=null,__privateGet(this,_consumerElement).onload=null,__privateGet(this,_consumerElement).onerror=null,__privateGet(this,_status).set("loaded",!1),__privateGet(this,_status).set("error",!1),__privateGet(this,_status).set("loading",!1),__privateGet(this,_status).set("clear",!1),__privateGet(this,_status).set("playing",!1),__privateGet(this,_status).set("metadata",!1),source){__privateSet(this,_idWithUrl,`${__privateGet(this,_id)}-${source.url}`);const isKeepSourceParameters=this.hasAttribute("keep-source-parameters");__privateGet(this,_status).set("loading",!0),__privateSet(this,_currentURL,isKeepSourceParameters?source.url:source.name+source.extension),this.consumeSource(__privateGet(this,_currentURL)),!__privateGet(this,_isLazy)&&!__privateGet(this,_isFirstLoadHappened)&&!__privateGet(this,_isManualLoad)&&loading_index.loading.add(__privateGet(this,_idWithUrl)),__privateGet(this,_consumerElement).onloadeddata=()=>{__privateGet(this,_loadListener).call(this)},__privateGet(this,_consumerElement).onload=()=>{__privateGet(this,_loadListener).call(this)},__privateGet(this,_consumerElement).onerror=()=>{__privateGet(this,_errorListener).call(this,__privateGet(this,_currentURL))}}else __privateSet(this,_currentURL,null),this.consumeSource(null)},"#loadSource"),_loadTriggerListener=new WeakMap,_intersectionListener=new WeakMap,_loadListener=new WeakMap,_errorListener=new WeakMap,_playListener=new WeakMap,_pauseListener=new WeakMap,_loadedmetadataListener=new WeakMap,__name(_SourceElement,"SourceElement");let SourceElement=_SourceElement;exports.Source=Source;exports.SourceElement=SourceElement;exports.SourceManager=SourceManager;exports.SourceSet=SourceSet;
|
package/lib/Store-B96mD8mD.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const notifier_index=require("./notifier/index.cjs");function kebabToCamel(kebab,capitalize2=!1){let camel="";return kebab.split("-").forEach((part,i)=>{if(i===0&&!capitalize2)camel+=part;else{const firstLetter=part[0],restLetters=part.slice(1),capitalized=firstLetter.toUpperCase()+restLetters;camel+=capitalized}}),camel}__name(kebabToCamel,"kebabToCamel");function camelToKebab(camelCaseString){return camelCaseString.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}__name(camelToKebab,"camelToKebab");function snakeToDotted(snake){return snake.split("_").join(".")}__name(snakeToDotted,"snakeToDotted");function toPascalCase(str){return/^[a-z\d]+$/i.test(str)?str.charAt(0).toUpperCase()+str.slice(1):str.replace(/([a-z\d])([a-z\d]*)/gi,(_,g1,g2)=>g1.toUpperCase()+g2.toLowerCase()).replace(/[^a-z\d]/gi,"")}__name(toPascalCase,"toPascalCase");function sliceAndModifyFirst(string,method){return string.slice(0,1)[method]()+string.slice(1)}__name(sliceAndModifyFirst,"sliceAndModifyFirst");function sliceAndModify(string,everyWord=!1,method){return everyWord?string.split(" ").map(v=>sliceAndModifyFirst(v,method)).join(" "):sliceAndModifyFirst(string,method)}__name(sliceAndModify,"sliceAndModify");function capitalize(string,everyWord=!1){return sliceAndModify(string,everyWord,"toUpperCase")}__name(capitalize,"capitalize");function uncapitalize(string,everyWord=!1){return sliceAndModify(string,everyWord,"toLowerCase")}__name(uncapitalize,"uncapitalize");function generateId(length,characters="abcdefghijklmnopqrstuvwxyz0123456789"){const charactersLength=characters.length,key=crypto.getRandomValues(new Uint8Array(length));let generatedKey="";for(let i=0;i<length;i++)generatedKey+=characters.charAt(key[i]%charactersLength);return generatedKey}__name(generateId,"generateId");function isUppercase(string){return new RegExp("^\\p{Lu}","u").test(string)}__name(isUppercase,"isUppercase");let textarea;function decodeHtmlEntities(html){return textarea||(textarea=document.createElement("textarea")),textarea.innerHTML=html,textarea.value}__name(decodeHtmlEntities,"decodeHtmlEntities");function declension(number,one,few,many){const n=typeof number=="string"?parseInt(number):number;if(n===1)return one;if(n%100>=11&&n%100<=14)return many;const remainder=n%10;return remainder===1?one:remainder>=2&&remainder<=4?few:many}__name(declension,"declension");function getRandomChar(chars){let c=chars||"abcdefghijklmnopqrstuvwxyz1234567890!@#$^&*()…æ_+-=;[]/~`";return c=c[Math.floor(Math.random()*c.length)],Math.random()>.5?c:c.toUpperCase()}__name(getRandomChar,"getRandomChar");const isBrowser=typeof window!="undefined"&&typeof window.document!="undefined";var _loadedState;const _StoreRegistry=class _StoreRegistry{constructor(){__privateAdd(this,_loadedState);this.storage=null,this.name="store-registry",__privateSet(this,_loadedState,null),isBrowser&&(this.storage=localStorage)}get loadedState(){return __privateGet(this,_loadedState)}saveState(){const fullState=this.getState(),stringState=JSON.stringify(fullState);localStorage.setItem(this.name,stringState)}loadState(state=localStorage.getItem(this.name)){state&&(typeof state=="string"?__privateSet(this,_loadedState,JSON.parse(state)):__privateSet(this,_loadedState,state),activeStores.current.forEach(store=>{store.name&&this.updateStore(store)}))}resetState(){activeStores.current.forEach(store=>{store.name&&store.reset()}),this.saveState()}updateStore(store){var _a,_b;if(!Array.isArray((_a=__privateGet(this,_loadedState))==null?void 0:_a.stores))return store;if(store.name){const match=(_b=__privateGet(this,_loadedState))==null?void 0:_b.stores.find(s=>s.name===store.name);match&&(store.current=match.value)}return store}getState(){const state={stores:[]};return activeStores.current.forEach(store=>{store.name&&(state.stores.find(s=>s.name===store.name)||state.stores.push({value:store.current,name:store.name}))}),state}};_loadedState=new WeakMap,__name(_StoreRegistry,"StoreRegistry");let StoreRegistry=_StoreRegistry;const storeRegistry=new StoreRegistry;var _name,_state,_equalityCheck,_notifier,_skipSubscribeNotification,_middlewares,_notifyAndClose,_invisible,_id;const _Store=class _Store{constructor(value,options){__privateAdd(this,_name);__privateAdd(this,_state);__privateAdd(this,_equalityCheck);__privateAdd(this,_notifier,new notifier_index.Notifier);__privateAdd(this,_skipSubscribeNotification);__privateAdd(this,_middlewares);__privateAdd(this,_notifyAndClose);__privateAdd(this,_invisible);__privateAdd(this,_id,"store-"+generateId(10));__privateSet(this,_name,options==null?void 0:options.name),this.__manager=options==null?void 0:options.__manager,__privateSet(this,_state,{initial:value,previous:void 0,current:value}),__privateSet(this,_equalityCheck,(options==null?void 0:options.equalityCheck)||((currentValue,newValue)=>currentValue===newValue)),options!=null&&options.validate&&this.addMiddleware(options.validate),__privateSet(this,_notifyAndClose,(options==null?void 0:options.notifyAndClose)||!1),__privateSet(this,_invisible,(options==null?void 0:options.invisible)||!1),__privateSet(this,_skipSubscribeNotification,(options==null?void 0:options.skipSubscribeNotification)||!1),__privateGet(this,_name)&&storeRegistry.updateStore(this)}get id(){return __privateGet(this,_id)}get name(){return __privateGet(this,_name)}get initial(){return __privateGet(this,_state).initial}get previous(){return __privateGet(this,_state).previous}get current(){return __privateGet(this,_state).current}set current(value){if(!__privateGet(this,_equalityCheck).call(this,__privateGet(this,_state).current,value)){if(__privateGet(this,_state).previous=__privateGet(this,_state).current,__privateGet(this,_middlewares))for(const middleware of __privateGet(this,_middlewares))value=middleware(value);__privateGet(this,_state).current=value,this.notify(),__privateGet(this,_notifyAndClose)&&this.close()}}setCurrent(value){this.current=value}update(callback){this.current=callback(this.current)}add(value){Array.isArray(this.current)&&(this.current=[...this.current,value])}filter(callback){Array.isArray(this.current)&&(this.current=this.current.filter(callback))}get subscribers(){return __privateGet(this,_notifier).subscribers}notify(){__privateGet(this,_notifier).notify(__privateGet(this,_state))}addMiddleware(middleware){__privateGet(this,_middlewares)||__privateSet(this,_middlewares,new Set),__privateGet(this,_middlewares).add(middleware)}removeMiddleware(middleware){var _a,_b;(_a=__privateGet(this,_middlewares))==null||_a.delete(middleware),(_b=__privateGet(this,_middlewares))!=null&&_b.size||__privateSet(this,_middlewares,void 0)}subscribe(callback,order){return!__privateGet(this,_invisible)&&!__privateGet(this,_notifier).size&&shareStore(this),__privateGet(this,_notifier).subscribe(callback,order),__privateGet(this,_skipSubscribeNotification)||callback(__privateGet(this,_state)),()=>{this.unsubscribe(callback)}}unsubscribe(callback){__privateGet(this,_notifier).unsubscribe(callback),__privateGet(this,_notifier).size||unshareStore(this)}reset(){this.current=Array.isArray(this.initial)?[...this.initial]:this.initial}close(){__privateGet(this,_notifier).close(),__privateGet(this,_state).previous=void 0,__privateGet(this,_state).current=__privateGet(this,_state).initial,unshareStore(this)}};_name=new WeakMap,_state=new WeakMap,_equalityCheck=new WeakMap,_notifier=new WeakMap,_skipSubscribeNotification=new WeakMap,_middlewares=new WeakMap,_notifyAndClose=new WeakMap,_invisible=new WeakMap,_id=new WeakMap,__name(_Store,"Store");let Store=_Store;const activeStores=new Store([],{invisible:!0});function shareStore(store){activeStores.current.includes(store)||(activeStores.current=[...activeStores.current,store])}__name(shareStore,"shareStore");function unshareStore(store){activeStores.current.includes(store)&&(activeStores.current=activeStores.current.filter(s=>s!==store))}__name(unshareStore,"unshareStore");exports.Store=Store;exports.activeStores=activeStores;exports.camelToKebab=camelToKebab;exports.capitalize=capitalize;exports.declension=declension;exports.decodeHtmlEntities=decodeHtmlEntities;exports.generateId=generateId;exports.getRandomChar=getRandomChar;exports.isBrowser=isBrowser;exports.isUppercase=isUppercase;exports.kebabToCamel=kebabToCamel;exports.snakeToDotted=snakeToDotted;exports.storeRegistry=storeRegistry;exports.toPascalCase=toPascalCase;exports.uncapitalize=uncapitalize;
|
package/lib/Tweened-j_TwbxEI.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const math=require("./math-C-knY2TL.cjs"),number=require("./number-Bu4sGvW7.cjs"),polyfills=require("./polyfills-DZCuDBkA.cjs"),Animation=require("./Animation-CS32dwF1.cjs"),linear=__name(t=>t,"linear"),easeInQuad=__name(t=>t*t,"easeInQuad"),easeOutQuad=__name(t=>t*(2-t),"easeOutQuad"),easeInOutQuad=__name(t=>t<.5?2*t*t:-1+(4-2*t)*t,"easeInOutQuad"),easeInCubic=__name(t=>t*t*t,"easeInCubic"),easeOutCubic=__name(t=>--t*t*t+1,"easeOutCubic"),easeInOutCubic=__name(t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,"easeInOutCubic"),easeInQuart=__name(t=>t*t*t*t,"easeInQuart"),easeOutQuart=__name(t=>1- --t*t*t*t,"easeOutQuart"),easeInOutQuart=__name(t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,"easeInOutQuart"),easeInQuint=__name(t=>t*t*t*t*t,"easeInQuint"),easeOutQuint=__name(t=>1+--t*t*t*t*t,"easeOutQuint"),easeInOutQuint=__name(t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t,"easeInOutQuint"),easeInExpo=__name(t=>t===0?0:2**(10*(t-1)),"easeInExpo"),easeOutExpo=__name(t=>t===1?1:1-2**(-10*t),"easeOutExpo"),easeInOutExpo=__name(t=>t===0||t===1?t:t<.5?.5*2**(10*2*(t-.5)):.5*(2-Math.abs(2**(-10*2*(t-.5)))),"easeInOutExpo"),easeOvershoot=__name(t=>3*(1-t)*(1-t)*t*.33+3*(1-t)*t*t*1.42+t*t*t*.05,"easeOvershoot"),easings={linear,easeInQuad,easeOutQuad,easeInOutQuad,easeInCubic,easeOutCubic,easeInOutCubic,easeInQuart,easeOutQuart,easeInOutQuart,easeInQuint,easeOutQuint,easeInOutQuint,easeInExpo,easeOutExpo,easeInOutExpo,easeOvershoot};var _easing,_duration;const _Tweened=class _Tweened extends Animation.Animation{constructor(initial,options){super(initial||0,options);__privateAdd(this,_easing,linear);__privateAdd(this,_duration,1e3);this.updateOptions(__spreadProps(__spreadValues({},options),{equalize:!0}))}updateOptions(options){super.updateOptions(options),__privateSet(this,_easing,typeof(options==null?void 0:options.easing)=="function"?options.easing:typeof(options==null?void 0:options.easing)=="string"?easings[options.easing]||easings.linear:__privateGet(this,_easing)),__privateSet(this,_duration,(options==null?void 0:options.duration)===!1?0:polyfills.nullishCoalescing(options==null?void 0:options.duration,__privateGet(this,_duration)))}handleAnimationFrame(e){const t=e.timeElapsedSinceSubscription/1e3/(__privateGet(this,_duration)/1e3)||0,et=__privateGet(this,_easing).call(this,math.clamp(t,0,1));this.current=number.preciseNumber(this.from+(this.target-this.from)*et,6),t>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),super.start()}};_easing=new WeakMap,_duration=new WeakMap,__name(_Tweened,"Tweened");let Tweened=_Tweened;exports.Tweened=Tweened;exports.easeInCubic=easeInCubic;exports.easeInExpo=easeInExpo;exports.easeInOutCubic=easeInOutCubic;exports.easeInOutExpo=easeInOutExpo;exports.easeInOutQuad=easeInOutQuad;exports.easeInOutQuart=easeInOutQuart;exports.easeInOutQuint=easeInOutQuint;exports.easeInQuad=easeInQuad;exports.easeInQuart=easeInQuart;exports.easeInQuint=easeInQuint;exports.easeOutCubic=easeOutCubic;exports.easeOutExpo=easeOutExpo;exports.easeOutQuad=easeOutQuad;exports.easeOutQuart=easeOutQuart;exports.easeOutQuint=easeOutQuint;exports.easeOvershoot=easeOvershoot;exports.easings=easings;exports.linear=linear;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value);const order_index=require("./order/index.cjs"),windowResizer_index=require("./window-resizer/index.cjs"),Store=require("./Store-B96mD8mD.cjs");require("./index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");var _OS,_isMobile,_isTouch,_isWebgl,_isWebp,_isApple;const _Device=class _Device{constructor(){__privateAdd(this,_OS);__privateAdd(this,_isMobile);__privateAdd(this,_isTouch);__privateAdd(this,_isWebgl);__privateAdd(this,_isWebp);__privateAdd(this,_isApple);var _a,_b;if(__privateSet(this,_OS,"unknown"),__privateSet(this,_isMobile,!1),__privateSet(this,_isTouch,!1),__privateSet(this,_isWebgl,!1),__privateSet(this,_isWebp,!1),__privateSet(this,_isApple,!1),this.resize=()=>{__privateSet(this,_isMobile,/Mobi|Android/i.test(navigator.userAgent)),__privateSet(this,_isTouch,"ontouchstart"in window||navigator.maxTouchPoints>0),setTimeout(()=>{__privateSet(this,_isTouch,"ontouchstart"in window||navigator.maxTouchPoints>0)},0)},Store.isBrowser){this.resize(),windowResizer_index.windowResizer.subscribe(this.resize,order_index.RESIZE_ORDER.DEVICE);{const canvas=document.createElement("canvas"),gl=canvas.getContext("webgl")||canvas.getContext("experimental-webgl");__privateSet(this,_isWebgl,gl&&gl instanceof WebGLRenderingContext||!1)}{const canvas=document.createElement("canvas");canvas.getContext("2d")&&__privateSet(this,_isWebp,canvas.toDataURL("image/webp").indexOf("data:image/webp")==0)}const userAgent=window.navigator.userAgent,platform=((_b=(_a=window.navigator)==null?void 0:_a.userAgentData)==null?void 0:_b.platform)||window.navigator.platform,macosPlatforms=["Macintosh","MacIntel","MacPPC","Mac68K","macOS"],windowsPlatforms=["Win32","Win64","Windows","WinCE"],iosPlatforms=["iPhone","iPad","iPod"];macosPlatforms.includes(platform)?(__privateSet(this,_OS,"macOS"),__privateSet(this,_isApple,!0)):iosPlatforms.includes(platform)?(__privateSet(this,_OS,"iOS"),__privateSet(this,_isApple,!0)):windowsPlatforms.includes(platform)?__privateSet(this,_OS,"Windows"):/Android/.test(userAgent)?__privateSet(this,_OS,"Android"):/Linux/.test(platform)?__privateSet(this,_OS,"Linux"):__privateSet(this,_OS,"unknown")}}get OS(){return __privateGet(this,_OS)}get isMobile(){return __privateGet(this,_isMobile)}get isTouch(){return __privateGet(this,_isTouch)}get isWebgl(){return __privateGet(this,_isWebgl)}get isWebp(){return __privateGet(this,_isWebp)}get isApple(){return __privateGet(this,_isApple)}};_OS=new WeakMap,_isMobile=new WeakMap,_isTouch=new WeakMap,_isWebgl=new WeakMap,_isWebp=new WeakMap,_isApple=new WeakMap,__name(_Device,"Device");let Device=_Device;const device=new Device;var ViewportBreakpoints=(ViewportBreakpoints2=>(ViewportBreakpoints2.mobile="600px",ViewportBreakpoints2.tablet="1024px",ViewportBreakpoints2.notebook="1280px",ViewportBreakpoints2.desktop="1281px",ViewportBreakpoints2))(ViewportBreakpoints||{}),ViewportMediaRules=(ViewportMediaRules2=>(ViewportMediaRules2["<=mobile"]="(max-width: 600px)",ViewportMediaRules2[">=mobile"]="(min-width: 601px)",ViewportMediaRules2["<=tablet"]="(max-width: 1024px)",ViewportMediaRules2[">=tablet"]="(min-width: 1025px)",ViewportMediaRules2["<=notebook"]="(max-width: 1280px)",ViewportMediaRules2[">=notebook"]="(min-width: 1281px)",ViewportMediaRules2["<=desktop"]="(max-width: 1280px)",ViewportMediaRules2[">=desktop"]="(min-width: 1281px)",ViewportMediaRules2))(ViewportMediaRules||{}),_width,_height,_pixelRatio,_type;const _Viewport=class _Viewport{constructor(){__privateAdd(this,_width);__privateAdd(this,_height);__privateAdd(this,_pixelRatio);__privateAdd(this,_type);__privateSet(this,_width,0),__privateSet(this,_height,0),__privateSet(this,_pixelRatio,0),__privateSet(this,_type,new Store.Store(void 0)),this.resize=()=>{__privateSet(this,_width,document.documentElement.clientWidth),__privateSet(this,_height,innerHeight),__privateSet(this,_pixelRatio,devicePixelRatio),matchMedia("(max-width: 600px)").matches?__privateGet(this,_type).current="mobile":matchMedia("(max-width: 1024px)").matches?__privateGet(this,_type).current="tablet":matchMedia("(max-width: 1280px)").matches?__privateGet(this,_type).current="notebook":matchMedia("(min-width: 1281px)").matches&&(__privateGet(this,_type).current="desktop")},Store.isBrowser&&(this.resize(),windowResizer_index.windowResizer.subscribe(this.resize,order_index.RESIZE_ORDER.DEVICE))}get width(){return __privateGet(this,_width)}get height(){return __privateGet(this,_height)}get type(){return __privateGet(this,_type)}get pixelRatio(){return __privateGet(this,_pixelRatio)}};_width=new WeakMap,_height=new WeakMap,_pixelRatio=new WeakMap,_type=new WeakMap,__name(_Viewport,"Viewport");let Viewport=_Viewport;const viewport=new Viewport;exports.ViewportBreakpoints=ViewportBreakpoints;exports.ViewportMediaRules=ViewportMediaRules;exports.device=device;exports.viewport=viewport;
|
package/lib/index-BoGx2BWX.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var __privateWrapper=(obj,member,setter,getter)=>({set _(value){__privateSet(obj,member,value,setter)},get _(){return __privateGet(obj,member,getter)}});const Store=require("./Store-B96mD8mD.cjs"),dom=require("./dom-B40i6NXw.cjs");require("construct-style-sheets-polyfill");var _callback,_maxFPS,_order,_timestamp,_lastTimestamp,_subscribeTimestamp,_intersectionTimestamp,_timeBetweenFrames,_isVisible,_intersectionObserver,_intersectionListener;const _TickerSubscriber=class _TickerSubscriber{constructor(callback,options){__privateAdd(this,_callback);__privateAdd(this,_maxFPS);__privateAdd(this,_order);__privateAdd(this,_timestamp,0);__privateAdd(this,_lastTimestamp,0);__privateAdd(this,_subscribeTimestamp,0);__privateAdd(this,_intersectionTimestamp,0);__privateAdd(this,_timeBetweenFrames,0);__privateAdd(this,_isVisible,!1);__privateAdd(this,_intersectionObserver,null);__privateAdd(this,_intersectionListener,__name(entries=>{const entry=entries[0];__privateSet(this,_isVisible,entry.isIntersecting),__privateGet(this,_isVisible)&&__privateSet(this,_intersectionTimestamp,__privateGet(this,_timestamp))},"#intersectionListener"));if(__privateSet(this,_callback,callback),__privateSet(this,_maxFPS,options==null?void 0:options.maxFPS),__privateSet(this,_order,(options==null?void 0:options.order)||0),options!=null&&options.culling&&Store.isBrowser){const element=dom.getElement(options.culling);element&&(__privateSet(this,_intersectionObserver,new IntersectionObserver(__privateGet(this,_intersectionListener))),__privateGet(this,_intersectionObserver).observe(element))}else __privateSet(this,_isVisible,!0)}get callback(){return __privateGet(this,_callback)}get order(){return __privateGet(this,_order)}sync(timestamp){__privateSet(this,_lastTimestamp,timestamp-__privateGet(this,_timeBetweenFrames))}tick(timestamp){if(__privateSet(this,_timestamp,timestamp),__privateSet(this,_timeBetweenFrames,Math.max(0,timestamp-__privateGet(this,_lastTimestamp))),__privateGet(this,_subscribeTimestamp)||__privateSet(this,_subscribeTimestamp,timestamp),__privateGet(this,_maxFPS))if(__privateGet(this,_timeBetweenFrames)>=1e3/__privateGet(this,_maxFPS))__privateSet(this,_lastTimestamp,timestamp-__privateGet(this,_timeBetweenFrames)%__privateGet(this,_maxFPS));else return;else __privateSet(this,_lastTimestamp,timestamp);__privateGet(this,_isVisible)&&__privateGet(this,_callback).call(this,{timeBetweenFrames:__privateGet(this,_timeBetweenFrames),timestamp,subscribeTimestamp:__privateGet(this,_subscribeTimestamp),timeElapsedSinceSubscription:timestamp-__privateGet(this,_subscribeTimestamp),timeElapsedSinceIntersection:timestamp-__privateGet(this,_intersectionTimestamp)})}destroy(){var _a;(_a=__privateGet(this,_intersectionObserver))==null||_a.disconnect()}};_callback=new WeakMap,_maxFPS=new WeakMap,_order=new WeakMap,_timestamp=new WeakMap,_lastTimestamp=new WeakMap,_subscribeTimestamp=new WeakMap,_intersectionTimestamp=new WeakMap,_timeBetweenFrames=new WeakMap,_isVisible=new WeakMap,_intersectionObserver=new WeakMap,_intersectionListener=new WeakMap,__name(_TickerSubscriber,"TickerSubscriber");let TickerSubscriber=_TickerSubscriber;var _idleTime,_timestamp2,_lastFrameId,_lastFrameTime,_currentFPS,_frameCount,_fpsUpdateTime,_isDocumentHidden,_subscribers,_Ticker_instances,requestAnimationFrame_fn,cancelAnimationFrame_fn,_animationFrameListener,updateFPS_fn,_documentVisibilityChangeListener;const _Ticker=class _Ticker{constructor(){__privateAdd(this,_Ticker_instances);__privateAdd(this,_idleTime,0);__privateAdd(this,_timestamp2,0);__privateAdd(this,_lastFrameId);__privateAdd(this,_lastFrameTime,0);__privateAdd(this,_currentFPS,0);__privateAdd(this,_frameCount,0);__privateAdd(this,_fpsUpdateTime,0);__privateAdd(this,_isDocumentHidden,!1);__privateAdd(this,_subscribers,[]);__privateAdd(this,_animationFrameListener,__name(timestamp=>{if(__privateGet(this,_isDocumentHidden)){__privateSet(this,_isDocumentHidden,!1),__privateSet(this,_idleTime,timestamp-__privateGet(this,_timestamp2));for(const subscriber of __privateGet(this,_subscribers))subscriber.sync(__privateGet(this,_timestamp2))}__privateSet(this,_lastFrameId,requestAnimationFrame(__privateGet(this,_animationFrameListener))),__privateSet(this,_timestamp2,timestamp-__privateGet(this,_idleTime)),__privateMethod(this,_Ticker_instances,updateFPS_fn).call(this,timestamp);for(const subscriber of __privateGet(this,_subscribers))subscriber.tick(__privateGet(this,_timestamp2))},"#animationFrameListener"));__privateAdd(this,_documentVisibilityChangeListener,__name(()=>{document.hidden&&(__privateSet(this,_isDocumentHidden,!0),__privateSet(this,_frameCount,0),__privateSet(this,_fpsUpdateTime,0),__privateSet(this,_lastFrameTime,0))},"#documentVisibilityChangeListener"));Store.isBrowser&&document.addEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener))}get fps(){return __privateGet(this,_currentFPS)}subscribe(callback,options){if(!__privateGet(this,_subscribers).find(s=>s.callback===callback)){const subscriber=new TickerSubscriber(callback,options);subscriber.sync(performance.now()),__privateGet(this,_subscribers).push(subscriber),__privateSet(this,_subscribers,__privateGet(this,_subscribers).sort((a,b)=>a.order-b.order))}return __privateMethod(this,_Ticker_instances,requestAnimationFrame_fn).call(this),()=>this.unsubscribe(callback)}unsubscribe(callback){const matches=__privateGet(this,_subscribers).filter(subscriber=>subscriber.callback===callback);matches.length&&(matches.forEach(m=>m.destroy()),__privateSet(this,_subscribers,__privateGet(this,_subscribers).filter(subscriber=>subscriber.callback!==callback)),__privateGet(this,_subscribers).length||__privateMethod(this,_Ticker_instances,cancelAnimationFrame_fn).call(this))}destroy(){Store.isBrowser&&(__privateMethod(this,_Ticker_instances,cancelAnimationFrame_fn).call(this),document.removeEventListener("visibilitychange",__privateGet(this,_documentVisibilityChangeListener)))}};_idleTime=new WeakMap,_timestamp2=new WeakMap,_lastFrameId=new WeakMap,_lastFrameTime=new WeakMap,_currentFPS=new WeakMap,_frameCount=new WeakMap,_fpsUpdateTime=new WeakMap,_isDocumentHidden=new WeakMap,_subscribers=new WeakMap,_Ticker_instances=new WeakSet,requestAnimationFrame_fn=__name(function(){__privateGet(this,_subscribers).length&&!__privateGet(this,_lastFrameId)&&__privateSet(this,_lastFrameId,requestAnimationFrame(__privateGet(this,_animationFrameListener)))},"#requestAnimationFrame"),cancelAnimationFrame_fn=__name(function(){__privateGet(this,_lastFrameId)&&(cancelAnimationFrame(__privateGet(this,_lastFrameId)),__privateSet(this,_lastFrameId,void 0))},"#cancelAnimationFrame"),_animationFrameListener=new WeakMap,updateFPS_fn=__name(function(timestamp){if(__privateGet(this,_lastFrameTime)===0){__privateSet(this,_lastFrameTime,timestamp),__privateSet(this,_fpsUpdateTime,timestamp);return}__privateWrapper(this,_frameCount)._++,timestamp>=__privateGet(this,_fpsUpdateTime)+1e3&&(__privateSet(this,_currentFPS,Math.round(__privateGet(this,_frameCount)*1e3/(timestamp-__privateGet(this,_fpsUpdateTime)))),__privateSet(this,_frameCount,0),__privateSet(this,_fpsUpdateTime,timestamp)),__privateSet(this,_lastFrameTime,timestamp)},"#updateFPS"),_documentVisibilityChangeListener=new WeakMap,__name(_Ticker,"Ticker");let Ticker=_Ticker;const ticker=new Ticker;var _subscribers2,_intersectionObserver2,_intersectionListener2;const _Intersector=class _Intersector{constructor(){__privateAdd(this,_subscribers2,[]);__privateAdd(this,_intersectionObserver2,null);__privateAdd(this,_intersectionListener2,__name(entries=>{__privateGet(this,_subscribers2).map(subscriber=>({subscriber,entry:entries.find(entry=>entry.target===subscriber.element)})).forEach(match=>{match.entry&&(match.subscriber.entry=match.entry,match.subscriber.callback(match.entry))})},"#intersectionListener"));Store.isBrowser&&window.IntersectionObserver&&__privateSet(this,_intersectionObserver2,new IntersectionObserver(__privateGet(this,_intersectionListener2)))}subscribe(elementOrSelector,callback){const element=dom.getElement(elementOrSelector);if(!element)return()=>{};const alreadyObserved=__privateGet(this,_subscribers2).find(sub=>sub.element===element);if(!alreadyObserved)__privateGet(this,_intersectionObserver2).observe(element);else{const alreadyIntersected=__privateGet(this,_subscribers2).find(s=>s.element===element&&s.entry);alreadyIntersected!=null&&alreadyIntersected.entry.isIntersecting&&callback(alreadyIntersected.entry)}return __privateGet(this,_subscribers2).push({element,callback,entry:(alreadyObserved==null?void 0:alreadyObserved.entry)||null}),()=>{this.unsubscribe(callback)}}unsubscribe(callback){const subscriber=__privateGet(this,_subscribers2).find(sub=>sub.callback===callback);subscriber&&(__privateSet(this,_subscribers2,__privateGet(this,_subscribers2).filter(sub=>sub.callback!==callback)),__privateGet(this,_subscribers2).find(sub=>sub.element===subscriber.element)||__privateGet(this,_intersectionObserver2).unobserve(subscriber.element))}};_subscribers2=new WeakMap,_intersectionObserver2=new WeakMap,_intersectionListener2=new WeakMap,__name(_Intersector,"Intersector");let Intersector=_Intersector;const intersector=new Intersector;exports.Intersector=Intersector;exports.Ticker=Ticker;exports.intersector=intersector;exports.ticker=ticker;
|
package/lib/render-B5iiOqye.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);const Store=require("./Store-B96mD8mD.cjs"),attributes=require("./attributes-BADnRZpK.cjs"),morph=require("./morph-Bz2BCWvO.cjs"),object=require("./object-DTY_W6xG.cjs"),ticker_index=require("./index-BoGx2BWX.cjs");require("construct-style-sheets-polyfill");const connector_index=require("./connector/index.cjs"),DerivedArray=require("./DerivedArray-CP3QiK6l.cjs");require("./css-value-parser/index.cjs");require("./window-resizer/index.cjs");require("./element-resizer/index.cjs");const activeComponent={current:null};let previousComponent=null;const componentElementLoadingTypes=["idle","load","visible","constructor","connect"];var _loadCallback,_connectCallbacks,_disconnectCallbacks,_loadingType,_idleId,_windowLoadListener,_idleListener,_intersectionListener,_ComponentElement_instances,connect_fn;const _ComponentElement=class _ComponentElement extends HTMLElement{constructor(){super();__privateAdd(this,_ComponentElement_instances);__privateAdd(this,_loadCallback);__privateAdd(this,_connectCallbacks,[]);__privateAdd(this,_disconnectCallbacks,[]);__privateAdd(this,_loadingType,"idle");__privateAdd(this,_idleId);__privateAdd(this,_windowLoadListener,__name(()=>{window.removeEventListener("load",__privateGet(this,_windowLoadListener)),__privateGet(this,_loadingType)==="load"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#windowLoadListener"));__privateAdd(this,_idleListener,__name(()=>{__privateSet(this,_idleId,void 0),__privateGet(this,_loadingType)==="idle"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#idleListener"));__privateAdd(this,_intersectionListener,__name(entry=>{entry.isIntersecting&&(ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),__privateGet(this,_loadingType)==="visible"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this))},"#intersectionListener"));previousComponent=activeComponent.current,activeComponent.current=this}addLoadCallback(callback){this.hasAttribute("loading")&&componentElementLoadingTypes.includes(this.getAttribute("loading"))?__privateSet(this,_loadingType,this.getAttribute("loading")):__privateSet(this,_loadingType,"constructor"),__privateSet(this,_loadCallback,callback),__privateGet(this,_loadingType)==="constructor"&&__privateGet(this,_loadCallback).call(this)}addConnectCallback(callback){__privateGet(this,_connectCallbacks).push(callback)}addDisconnectCallback(callback){__privateGet(this,_disconnectCallbacks).push(callback)}connectedCallback(){const windowLoadSetup=__name(()=>{document.readyState==="complete"?__privateGet(this,_windowLoadListener).call(this):window.addEventListener("load",__privateGet(this,_windowLoadListener))},"windowLoadSetup");__privateGet(this,_loadingType)==="connect"||__privateGet(this,_loadingType)==="constructor"?__privateMethod(this,_ComponentElement_instances,connect_fn).call(this):__privateGet(this,_loadingType)==="load"?windowLoadSetup():__privateGet(this,_loadingType)==="idle"?window.requestIdleCallback?__privateSet(this,_idleId,window.requestIdleCallback(__privateGet(this,_idleListener))):windowLoadSetup():__privateGet(this,_loadingType)==="visible"&&ticker_index.intersector.subscribe(this,__privateGet(this,_intersectionListener)),activeComponent.current===this&&(activeComponent.current=previousComponent)}disconnectedCallback(){__privateGet(this,_disconnectCallbacks).forEach(callback=>{callback(this)}),__privateSet(this,_connectCallbacks,[]),__privateSet(this,_disconnectCallbacks,[]),activeComponent.current===this&&(activeComponent.current=previousComponent),window.removeEventListener("load",__privateGet(this,_windowLoadListener)),window.cancelIdleCallback&&__privateGet(this,_idleId)&&window.cancelIdleCallback(__privateGet(this,_idleId)),ticker_index.intersector.unsubscribe(__privateGet(this,_intersectionListener))}};_loadCallback=new WeakMap,_connectCallbacks=new WeakMap,_disconnectCallbacks=new WeakMap,_loadingType=new WeakMap,_idleId=new WeakMap,_windowLoadListener=new WeakMap,_idleListener=new WeakMap,_intersectionListener=new WeakMap,_ComponentElement_instances=new WeakSet,connect_fn=__name(function(){var _a;activeComponent.current=this,this.querySelectorAll("[data-fallback]").forEach(el=>{el.remove()}),__privateGet(this,_loadingType)!=="constructor"&&((_a=__privateGet(this,_loadCallback))==null||_a.call(this)),__privateGet(this,_connectCallbacks).forEach(callback=>{const unsub=callback(this);unsub&&__privateGet(this,_disconnectCallbacks).push(unsub)}),activeComponent.current===this&&(activeComponent.current=previousComponent)},"#connect"),__name(_ComponentElement,"ComponentElement");let ComponentElement=_ComponentElement;function subscribeToStore(element,store,callback){const unsubscribe=store.subscribe(e=>{callback(e)});connector_index.connector.subscribe(element,{disconnectCallback:__name(()=>{unsubscribe()},"disconnectCallback"),maxWaitSec:20,unsubscribeAfterDisconnect:!0})}__name(subscribeToStore,"subscribeToStore");function setClassAttribute(element,classes){classes&&(classes instanceof Store.Store?subscribeToStore(element,classes,e=>{e.previous&&element.classList.remove(e.previous.toString()),e.current&&element.classList.add(e.current.toString())}):typeof classes=="object"&&!Array.isArray(classes)?Object.entries(classes).forEach(([key,value])=>{value instanceof Store.Store?subscribeToStore(element,value,e=>{element.classList.toggle(key,!!e.current)}):value&&element.classList.add(key)}):Array.isArray(classes)?classes.forEach(item=>{typeof item=="string"?element.classList.add(item):setClassAttribute(element,item)}):classes.toString().split(" ").map(v=>element.classList.add(v.trim())))}__name(setClassAttribute,"setClassAttribute");function setStyleAttribute(element,value){value&&(typeof value=="object"?Object.entries(value).forEach(([key,value2])=>{value2 instanceof Store.Store?subscribeToStore(element,value2,e=>{var _a;element.style[key]=(_a=e.current)==null?void 0:_a.toString()}):(typeof value2=="number"||typeof value2=="string"||typeof value2=="boolean")&&(element.style[key]=value2.toString())}):typeof value=="string"&&(element.style=value))}__name(setStyleAttribute,"setStyleAttribute");function setAttribute(element,key,value){key==="ref"&&value?Array.isArray(value)?value.forEach(v=>{typeof v=="object"&&"value"in v&&(v.value=element)}):typeof value=="object"&&"value"in value&&(value.value=element):key==="className"||key==="class"?setClassAttribute(element,value):key==="style"?setStyleAttribute(element,value):key==="setHtml"&&value!=null?element.innerHTML=value:typeof value=="number"?key==="tabIndex"?element.setAttribute("tabindex",value.toString()):setAttribute(element,key,value.toString()):typeof value=="string"?key==="htmlFor"?element.setAttribute("for",value):element.setAttribute(key,value):typeof value=="boolean"?value?element.setAttribute(key,""):element.removeAttribute(key):value instanceof Store.Store&&subscribeToStore(element,value,e=>{key in element?element[key]=e.current:setAttribute(element,key,e.current)})}__name(setAttribute,"setAttribute");function setAttributes(ele,attributes2){for(const[key,value]of Object.entries(attributes2!=null?attributes2:{}))typeof value=="function"&&key.startsWith("on")?ele.addEventListener(Store.uncapitalize(key.replace("on","")),value):setAttribute(ele,key,value)}__name(setAttributes,"setAttributes");function createElement(tag,isSVG){return tag==="svg"?document.createElementNS("http://www.w3.org/2000/svg","svg"):isSVG?document.createElementNS("http://www.w3.org/2000/svg",tag):document.createElement(tag)}__name(createElement,"createElement");function filterChildren(children){const filtered=[];return(Array.isArray(children)?children:[children]).forEach(child=>{child!=null&&(typeof child=="number"?filtered.push(child.toString()):Array.isArray(child)?child.forEach(c=>{filtered.push(...filterChildren(c))}):filtered.push(child))}),filtered}__name(filterChildren,"filterChildren");function hydrateTextNode(element,newChild,index){const existingChild=element.childNodes[index];existingChild&&existingChild.nodeType===Node.TEXT_NODE?existingChild.textContent!==String(newChild)&&(console.warn(`Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`),existingChild.textContent=String(newChild)):newChild!=null&&newChild!==""&&element.insertBefore(document.createTextNode(String(newChild)),element.childNodes[index]||null)}__name(hydrateTextNode,"hydrateTextNode");function storeChildren(element,store){const currentChildNodes=[...element.childNodes].filter(node=>node.__storeId===store.id),newChildren=store.current,newChildrenArray=Array.isArray(newChildren)?newChildren:[newChildren],newNodes=[];if(newChildrenArray.forEach(newChild=>{let newNode=null;typeof newChild=="boolean"||typeof newChild=="number"||typeof newChild=="string"?newNode=document.createTextNode(newChild.toString()):newChild instanceof Node&&(newNode=newChild),newNode&&(newNode.__storeId=store.id,newNodes.push(newNode))}),store instanceof DerivedArray.DerivedKeyedArray){const nodesToStay=[];newNodes.forEach((newNode,i)=>{const oldNode=currentChildNodes.find(oldNode2=>oldNode2.__key===newNode.__key);oldNode?oldNode.isEqualNode(newNode)?nodesToStay.push(oldNode):(oldNode.replaceWith(newNode),nodesToStay.push(newNode)):(nodesToStay.push(newNode),element.appendChild(newNode))}),currentChildNodes.forEach(currentNode=>{nodesToStay.includes(currentNode)||currentNode.remove()})}else newNodes.forEach((node,i)=>{var _a;const founded=currentChildNodes[i];if(founded)founded.isEqualNode(node)||(founded.replaceWith(node),currentChildNodes[i]=node);else{const lastChildNode=currentChildNodes[currentChildNodes.length-1];lastChildNode?(_a=lastChildNode.parentNode)==null||_a.insertBefore(node,lastChildNode.nextSibling):element.appendChild(node)}}),currentChildNodes.slice(newNodes.length).forEach(node=>{node.remove()})}__name(storeChildren,"storeChildren");const _Props=class _Props{constructor(tag,attributes2,children){this.tag=tag,this.attributes=attributes2,this.children=children}};__name(_Props,"Props");let Props=_Props;const _ComponentProps=class _ComponentProps extends Props{};__name(_ComponentProps,"ComponentProps");let ComponentProps=_ComponentProps;const _ElementProps=class _ElementProps extends Props{};__name(_ElementProps,"ElementProps");let ElementProps=_ElementProps;const _HeadProps=class _HeadProps extends Props{};__name(_HeadProps,"HeadProps");let HeadProps=_HeadProps;function appendChildren(element,attributes2,children,isSVG=!1){const filteredChildren=filterChildren(children);setAttributes(element,attributes2),filteredChildren.forEach((child,index)=>{handleChild(element,child,index,isSVG)})}__name(appendChildren,"appendChildren");function handleChild(element,child,index,isSVG){child instanceof Store.Store?handleStoreChild(element,child):child instanceof ComponentProps?handleComponentProps(element,child):child instanceof ElementProps?handleElementProps(element,child,index,isSVG):child instanceof HeadProps?handleHeadProps(child):handleTextNode(element,child,index)}__name(handleChild,"handleChild");function handleStoreChild(element,child){subscribeToStore(element,child,()=>{storeChildren(element,child)})}__name(handleStoreChild,"handleStoreChild");function handleComponentProps(element,child){child.tag==="shadow"&&element.shadowRoot?appendChildren(element.shadowRoot,child.attributes,child.children):appendChildren(element,child.attributes,child.children)}__name(handleComponentProps,"handleComponentProps");function handleElementProps(element,child,index,isSVG){let childElement=null;if(isHydrating.value){const existingChild=element.children[index];(existingChild==null?void 0:existingChild.nodeName.toLowerCase())===child.tag?(childElement=existingChild,appendChildren(childElement,child.attributes,child.children,isSVG)):(childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement))}else childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement)}__name(handleElementProps,"handleElementProps");function handleHeadProps(child){const headElement=document.createElement(child.tag);appendChildren(headElement,child.attributes,child.children);const patches=morph.diff(document.head,headElement);morph.patch(document.head,patches)}__name(handleHeadProps,"handleHeadProps");function handleTextNode(element,child,index){isHydrating.value?hydrateTextNode(element,child,index):element.append(child)}__name(handleTextNode,"handleTextNode");function processChildren(attributes2,children){let result=children.filter(Boolean).length?children:attributes2==null?void 0:attributes2.children;return result?result.flat(2):[]}__name(processChildren,"processChildren");function handleStringTag(tag,attributes2,children){switch(tag){case"component":case"shadow":return new ComponentProps(tag,attributes2,children);case"head":return new HeadProps(tag,attributes2,children);default:return new ElementProps(tag,attributes2,children)}}__name(handleStringTag,"handleStringTag");function handleFunctionTag(jsxTag,attributes2,children){return object.isESClass(jsxTag)?createClassElement(jsxTag,attributes2,children):jsxTag===Fragment?Fragment(children):jsxTag.template?jsxTag(__spreadValues({},attributes2)):createCustomElement(jsxTag,attributes2,children)}__name(handleFunctionTag,"handleFunctionTag");function createClassElement(jsxTag,attributes2,children){const element=new jsxTag;return appendChildren(element,attributes2,children),element}__name(createClassElement,"createClassElement");function createCustomElement(jsxTag,attributes2,children){const name=jsxTag.define||`e-${Store.camelToKebab(jsxTag.name)}`,Constructor=getOrDefineCustomElement(name,jsxTag,attributes2);if(attributes2!=null&&attributes2.__onlyDefine)return;const id=generateElementId(jsxTag.name,attributes2),element=getOrCreateElement(name,id,Constructor);return fillComponentElement(element,jsxTag,attributes2,children),element}__name(createCustomElement,"createCustomElement");function getOrDefineCustomElement(name,jsxTag,attributes$1){var _a;let Constructor=customElements.get(name);return Constructor||(Constructor=(_a=class extends ComponentElement{constructor(){super(),attributes$1!=null&&attributes$1.__onlyDefine&&this.addLoadCallback(()=>fillComponentElement(this,jsxTag,attributes.getElementAttributesAdvanced(this),[]))}},__name(_a,"Constructor"),_a.formAssociated=jsxTag.formAssociated,_a),customElements.define(name,Constructor)),Constructor}__name(getOrDefineCustomElement,"getOrDefineCustomElement");function generateElementId(tagName,attributes2){if(attributes2!=null&&attributes2.__hydrationId)return attributes2.__hydrationId;const index=(indexMap.get(tagName)||0)+1;return indexMap.set(tagName,index),`${tagName}-${index}`}__name(generateElementId,"generateElementId");function getOrCreateElement(name,id,Constructor){if(isHydrating.value){const selector=`${name}[data-id="${id}"]`,existingElement=document.querySelector(selector);if(existingElement&&existingElement instanceof Constructor)return existingElement}const element=new Constructor;return element.setAttribute("data-id",id),element}__name(getOrCreateElement,"getOrCreateElement");function fillComponentElement(element,jsxTag,attributes2,children){const props=__spreadProps(__spreadValues({},attributes2),{children}),setHtml=props.setHtml;delete props.setHtml;const result=jsxTag(props);result instanceof ElementProps?appendChildren(element,{setHtml},result):result instanceof ComponentProps&&appendChildren(element,__spreadProps(__spreadValues({},result.attributes),{setHtml}),result.children)}__name(fillComponentElement,"fillComponentElement");const isHydrating={value:!1},indexMap=new Map;function h(jsxTag,attributes2,...children){const processedChildren=processChildren(attributes2,children),processedAttributes=__spreadValues({},attributes2);return delete processedAttributes.children,typeof jsxTag=="string"?handleStringTag(jsxTag,processedAttributes,processedChildren):handleFunctionTag(jsxTag,processedAttributes,processedChildren)}__name(h,"h");function Fragment(children){const fragment=document.createDocumentFragment();return appendChildren(fragment,void 0,children),fragment}__name(Fragment,"Fragment");function render(container,Component,params,children){const element=h(Component,__spreadValues({},params),children);return container.append(element),element}__name(render,"render");function hydrate(Component,params,children){isHydrating.value=!0;const element=h(Component,__spreadValues({},params),children);return isHydrating.value=!1,element}__name(hydrate,"hydrate");exports.Fragment=Fragment;exports.activeComponent=activeComponent;exports.h=h;exports.hydrate=hydrate;exports.indexMap=indexMap;exports.render=render;
|
package/lib/scroll-CTDesBpj.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});const Tweened=require("./Tweened-j_TwbxEI.cjs"),order_index=require("./order/index.cjs"),dom=require("./dom-B40i6NXw.cjs"),layout=require("./layout-rR4-aYTY.cjs");require("construct-style-sheets-polyfill");require("./index-BoGx2BWX.cjs");const scrollToElementTweened={value:null};function scrollToElement(elementOrSelectorOrNumber,{behavior="instant",offset=0,center=!1,scrollElement,scrollCallback,duration,easing,startValue}={}){var _a;let elementPosition,centerElement=scrollElement,scrollContainerElement=scrollElement;if(typeof elementOrSelectorOrNumber=="number")elementPosition=elementOrSelectorOrNumber;else{const element=dom.getElement(elementOrSelectorOrNumber);element&&(centerElement=element,scrollContainerElement=scrollElement||dom.findScrollParentElement(element),elementPosition=layout.getCumulativeOffsetTop(element))}if(centerElement&&scrollContainerElement&&typeof elementPosition=="number"){const offsetValue=typeof offset=="number"?offset:typeof offset=="string"&&!isNaN(parseFloat(offset))?parseFloat(offset):(((_a=dom.getElement(offset))==null?void 0:_a.offsetHeight)||0)*-1,height=centerElement instanceof HTMLElement?centerElement.offsetHeight:innerHeight,centerValue=center?innerHeight/2*-1+height/2:0,top=elementPosition+offsetValue+centerValue,scrollToValue=__name(value=>{scrollContainerElement instanceof HTMLElement&&scrollContainerElement.tagName==="E-SMOOTH-SCROLL"?scrollContainerElement.scrollToValue(value,duration?"instant":behavior):scrollContainerElement.scroll({top:value,behavior:duration?"instant":behavior})},"scrollToValue");if(duration){scrollToElementTweened.value&&scrollToElementTweened.value.close();let tweenedStart=0;startValue?tweenedStart=startValue:scrollContainerElement instanceof HTMLElement?tweenedStart=scrollContainerElement.scrollTop:tweenedStart=window.scrollY,scrollToElementTweened.value=new Tweened.Tweened(tweenedStart,{order:order_index.TICK_ORDER.SCROLL}),scrollToElementTweened.value.subscribe(e=>{scrollCallback?scrollCallback(e.current):scrollToValue(e.current)}),scrollToElementTweened.value.set(top,{duration:Math.min(duration,duration*(Math.abs(tweenedStart-top)/3e3)),easing})}else scrollCallback?scrollCallback(top):scrollToValue(top)}}__name(scrollToElement,"scrollToElement");exports.scrollToElement=scrollToElement;exports.scrollToElementTweened=scrollToElementTweened;
|
package/lib/scroll-D1MT0QMY.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
3
|
-
import { T as Tweened } from "./Tweened-CZeS3EqK.js";
|
|
4
|
-
import { TICK_ORDER } from "./order/index.js";
|
|
5
|
-
import { g as getElement, f as findScrollParentElement } from "./dom-D8D-_9ty.js";
|
|
6
|
-
import { b as getCumulativeOffsetTop } from "./layout-DxOCR4qe.js";
|
|
7
|
-
import "construct-style-sheets-polyfill";
|
|
8
|
-
import "./index-DAG0CtYo.js";
|
|
9
|
-
const scrollToElementTweened = { value: null };
|
|
10
|
-
function scrollToElement(elementOrSelectorOrNumber, {
|
|
11
|
-
behavior = "instant",
|
|
12
|
-
offset = 0,
|
|
13
|
-
center = !1,
|
|
14
|
-
scrollElement,
|
|
15
|
-
scrollCallback,
|
|
16
|
-
duration,
|
|
17
|
-
easing,
|
|
18
|
-
startValue
|
|
19
|
-
} = {}) {
|
|
20
|
-
var _a;
|
|
21
|
-
let elementPosition, centerElement = scrollElement, scrollContainerElement = scrollElement;
|
|
22
|
-
if (typeof elementOrSelectorOrNumber == "number")
|
|
23
|
-
elementPosition = elementOrSelectorOrNumber;
|
|
24
|
-
else {
|
|
25
|
-
const element = getElement(elementOrSelectorOrNumber);
|
|
26
|
-
element && (centerElement = element, scrollContainerElement = scrollElement || findScrollParentElement(element), elementPosition = getCumulativeOffsetTop(element));
|
|
27
|
-
}
|
|
28
|
-
if (centerElement && scrollContainerElement && typeof elementPosition == "number") {
|
|
29
|
-
const offsetValue = typeof offset == "number" ? offset : typeof offset == "string" && !isNaN(parseFloat(offset)) ? parseFloat(offset) : (((_a = getElement(offset)) == null ? void 0 : _a.offsetHeight) || 0) * -1, height = centerElement instanceof HTMLElement ? centerElement.offsetHeight : innerHeight, centerValue = center ? innerHeight / 2 * -1 + height / 2 : 0, top = elementPosition + offsetValue + centerValue, scrollToValue = /* @__PURE__ */ __name((value) => {
|
|
30
|
-
scrollContainerElement instanceof HTMLElement && scrollContainerElement.tagName === "E-SMOOTH-SCROLL" ? scrollContainerElement.scrollToValue(
|
|
31
|
-
value,
|
|
32
|
-
duration ? "instant" : behavior
|
|
33
|
-
) : scrollContainerElement.scroll({
|
|
34
|
-
top: value,
|
|
35
|
-
behavior: duration ? "instant" : behavior
|
|
36
|
-
});
|
|
37
|
-
}, "scrollToValue");
|
|
38
|
-
if (duration) {
|
|
39
|
-
scrollToElementTweened.value && scrollToElementTweened.value.close();
|
|
40
|
-
let tweenedStart = 0;
|
|
41
|
-
startValue ? tweenedStart = startValue : scrollContainerElement instanceof HTMLElement ? tweenedStart = scrollContainerElement.scrollTop : tweenedStart = window.scrollY, scrollToElementTweened.value = new Tweened(tweenedStart, {
|
|
42
|
-
order: TICK_ORDER.SCROLL
|
|
43
|
-
}), scrollToElementTweened.value.subscribe((e) => {
|
|
44
|
-
scrollCallback ? scrollCallback(e.current) : scrollToValue(e.current);
|
|
45
|
-
}), scrollToElementTweened.value.set(top, {
|
|
46
|
-
duration: Math.min(
|
|
47
|
-
duration,
|
|
48
|
-
duration * (Math.abs(tweenedStart - top) / 3e3)
|
|
49
|
-
),
|
|
50
|
-
easing
|
|
51
|
-
});
|
|
52
|
-
} else
|
|
53
|
-
scrollCallback ? scrollCallback(top) : scrollToValue(top);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
__name(scrollToElement, "scrollToElement");
|
|
57
|
-
export {
|
|
58
|
-
scrollToElementTweened as a,
|
|
59
|
-
scrollToElement as s
|
|
60
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});require("construct-style-sheets-polyfill");const Store=require("./Store-B96mD8mD.cjs");function styleToString(object){let text="";for(const key in object){const value=object[key];typeof value=="object"?(text+=`${key} {`,text+=styleToString(value),text+="}"):text+=`${Store.camelToKebab(key)}: ${value};`}return text}__name(styleToString,"styleToString");function createStylesheet(value){if(Store.isBrowser){const styleSheet=new CSSStyleSheet;return styleSheet.replaceSync(typeof value=="string"?value:styleToString(value)),styleSheet}return null}__name(createStylesheet,"createStylesheet");exports.createStylesheet=createStylesheet;exports.styleToString=styleToString;
|
package/lib/utils/scroll.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Tweened, TweenedOptions } from '../animation/Tweened';
|
|
2
|
-
import { ElementOrSelector } from '.';
|
|
3
|
-
export declare const scrollToElementTweened: {
|
|
4
|
-
value: Tweened | null;
|
|
5
|
-
};
|
|
6
|
-
export interface ScrollToElementOptions extends Pick<TweenedOptions, 'duration' | 'easing'> {
|
|
7
|
-
behavior?: ScrollBehavior;
|
|
8
|
-
offset?: number | string | ElementOrSelector<HTMLElement>;
|
|
9
|
-
center?: boolean;
|
|
10
|
-
startValue?: number;
|
|
11
|
-
scrollElement?: HTMLElement | Window;
|
|
12
|
-
scrollCallback?: (value: number) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare function scrollToElement(elementOrSelectorOrNumber: ElementOrSelector<HTMLElement> | number, { behavior, offset, center, scrollElement, scrollCallback, duration, easing, startValue, }?: ScrollToElementOptions): void;
|