@finsweet/attributes-cmscore
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -1,1 +0,1 @@ | ||
[{"version":"v1.6.2","date":"10 April 2022","markdown":"- Added [API docs](https://www.npmjs.com/package/@finsweet/attributes-cmscore).\r\n"},{"version":"v1.6.1","date":"03 March 2022","markdown":"- Renamed `CMSList.pageCount` and `CMSList.addPageCount()` to `CMSList.visibleCount` and `CMSList.addVisibleCount()`.\r\n"},{"version":"v1.6.0","date":"03 March 2022","markdown":"- Added `CMSList.pageCount` and `CMSList.addPageCount()` helpers.\r\n This sets the bases for the new `fs-cmsload-element=\"page-count\"` attribute.\r\n"},{"version":"v1.5.7","date":"13 February 2022","markdown":"- Added some extra rendering logic to ensure all images are loaded correctly on `iOS` devices.\r\n"},{"version":"v1.5.6","date":"19 January 2022","markdown":"- Internal: updated `@finsweet/ts-utils` to fix an issue with the `restartWebflow` helper.\r\n Now the 'ix2' state dispatch is awaited, as it was conflicting with other modules restart.\r\n"},{"version":"v1.5.5","date":"19 December 2021","markdown":"- Fixed Webflow modules not restarting correctly.\r\n"},{"version":"v1.5.4","date":"19 December 2021","markdown":"- Added `CMSList.restartSliders` and `CMSList.restartTabs` props to use the built-in `Webflow.require('slider' | 'tabs').redraw()` methods from Webflow instead of restarting the whole instance.\r\n"},{"version":"v1.5.3","date":"15 December 2021","markdown":"- Removed deprecated `CMSList.addPaginationPrevious()` method in favor of `CMSList.addPaginationButton()`.\r\n- Added new `animateList` param to `CMSList.renderItems()` to allow further control over the list animation.\r\n- Set `CMSList.emptyState` prop to `false` on component instantiation.\r\n"},{"version":"v1.5.2","date":"9 December 2021","markdown":"- Added new `CMSList.initialElement` prop.\n- Made sure items are set to `opacity: 1` when using `CMSList.displayElement` without animations.\n"},{"version":"v1.5.1","date":"8 December 2021","markdown":"- Fixed `Empty State` element potentially being retrieved from a native empty Nested Collection, causing the `empty` element from `cmsfilter` not working correctly.\n"},{"version":"v1.5.0","date":"8 December 2021","markdown":"- Added support to use pagination query params.\n Now `cmscore` will extract each `CMSList` pages query (example: `5f7457b3_page`) to be able to consume it with other packages like `cmsload`.\n This has involved several internal changes:\n - Added new `storePaginationData` util. The method is `async` and while running it stores a Promise in `CMSList.extractingPaginationData`.\n - Added new `CMSList.originalItemsPerPage`, `CMSList.pagesQuery` and `CMSList.showPaginationQuery` props.\n - Now `CMSList.currentPage` will no longer be used as the reference to slice rendered items. Instead, a new `CMSList.paginationActive` is used as the reference.\n - Modified `CMSList.switchPage()` to define if it should trigger a rendering cycle.\n - Added new `CMSList.initPagination()` method.\n - Deprecated `CMSList.addPaginationPrevious()` in favor of a new `CMSList.addPaginationButton()` method.\n- Refactored: Moved `CMSList.updateItemsCount()` to be an external util.\n"},{"version":"v1.4.2","date":"1 December 2021","markdown":"- Renamed `window.fsAttributes.cms.lists` to `window.fsAttributes.cms.listInstances` to keep consistency.\n"},{"version":"v1.4.1","date":"1 December 2021","markdown":"- Added support for creating `list` instances that have no items.\n Some users were trying to instantiate lists that were at `Empty State`, causing `cmscore` to crash in some ocasions.\n"},{"version":"v1.4.0","date":"29 November 2021","markdown":"- Added `CMSList.originalItemsOrder` prop.\n- Added `CMSList.clearItems()` method.\n"},{"version":"v1.3.1","date":"23 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to include `lightbox` module support.\n"},{"version":"v1.3.0","date":"23 November 2021","markdown":"- Replaced `CMSItem.needsXXXRestart` props to a single `CMSItem.needsWebflowRestart`, as they were redundant.\n- Added `CMSList.restartWebflow` prop.\n- Improved `restartWebflowModules` and added support for `CMSList.restartWebflow`.\n"},{"version":"v1.2.0","date":"17 November 2021","markdown":"- Included the `package.version` in the exports.\n- Forced `trim` and `toLowerCase` to all prop field keys.\n- Added support for `cmscore` versioning.\n"},{"version":"v1.1.2","date":"15 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to support persisting state after reinitializing the `ix2` module.\n"},{"version":"v1.1.1","date":"11 November 2021","markdown":"- Added a `100ms` timeout to the `CMSList.scrollToAnchor` method to avoid it being cancelled by the browser's smoo scrolling.\n"},{"version":"v1.1.0","date":"11 November 2021","markdown":"- Switched `CMSList.validItems` prop from `boolean` to an array of the valid `CMSItem` instanced.\n- Internal refactors.\n"},{"version":"v1.0.24","date":"11 November 2021","markdown":"- Fixed rendering issues caused by the `Empty State` not being correctly displayed in some situations.\n"},{"version":"v1.0.23","date":"9 November 2021","markdown":"- Improved Webflow Modules restarting in the `render` workflow.\n"},{"version":"v1.0.22","date":"9 November 2021","markdown":"- Updated `ts-utils` to add support for `commerce` sites.\n"},{"version":"v1.0.21","date":"9 November 2021","markdown":"- Added `highlightValues` optional prop in each `CMSItemProp` object. Used for `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.20","date":"9 November 2021","markdown":"- Now the `originalHTML` is stored in each `CMSItemProp.elements` record. Used to reset the elements after having mutated them in actions like `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.19","date":"9 November 2021","markdown":"- Refactored `CMSList.itemsCount` usage.\n"},{"version":"v1.0.18","date":"9 November 2021","markdown":"- Added `CMSItemProp.elements` property that stores the value holders.\n"},{"version":"v1.0.17","date":"9 November 2021","markdown":"- Added optional `scrollToAnchor` param to the `CMSList.switchPage()` method.\n"},{"version":"v1.0.16","date":"9 November 2021","markdown":"- Added `CMSList.itemsCount` and `CMSList.addItemsCount()` to display the amount of items of the list.\n"},{"version":"v1.0.15","date":"9 November 2021","markdown":"- `CMSList.switchPage()` now triggers a `scrollToAnchor` action, if the anchor element exists.\n"},{"version":"v1.0.14","date":"8 November 2021","markdown":"- Fixed `renderitems` and `additems` events fire order.\n- Added `CMSList.resetIx` prop that is used in the `render` function.\n"},{"version":"v1.0.13","date":"8 November 2021","markdown":"- Added `CMSList.totalPages` prop.\n"},{"version":"v1.0.12","date":"8 November 2021","markdown":"- Added optional `animate` param to `CMSList.renderItems`.\n"},{"version":"v1.0.11","date":"5 November 2021","markdown":"- Awaited `renderitems` event emit on `CMSList.renderItems`.\n"},{"version":"v1.0.10","date":"5 November 2021","markdown":"- Added `CMSList.paginationCount` prop.\n"},{"version":"v1.0.9","date":"5 November 2021","markdown":"- Added `CMSList.scrollAnchor` prop + `CMSList.scrollToAnchor()` method.\n"},{"version":"v1.0.8","date":"27 October 2021","markdown":"- Added new methods to `CMSList`.\n"},{"version":"v1.0.7","date":"27 October 2021","markdown":"- Published missing updates.\n"},{"version":"v1.0.6","date":"27 October 2021","markdown":"- Improved rendering logic.\n"},{"version":"v1.0.5","date":"27 October 2021","markdown":"- `cmscore`: Removed `CMSList.initialItems` prop.\n"},{"version":"v1.0.4","date":"27 October 2021","markdown":"- `cmscore`: Added `CMSList.initialItems` prop.\n"},{"version":"v1.0.3","date":"26 October 2021","markdown":"- Changed `CMSItemProps.mode` to `CMSItemProps.range`.\n"},{"version":"v1.0.2","date":"26 October 2021","markdown":"- Modified `CMSItem.props` value type to a `Set` instead of `Array`.\n"},{"version":"v1.0.1","date":"26 October 2021","markdown":"- `CMSItem`: Added `mode` in `props` property.\n"},{"version":"v1.0.0","date":"25 October 2021","markdown":"- Created Attribute package.\n"}] | ||
[{"version":"v1.6.3","date":"10 April 2022","markdown":"- Made `removeElements` argument in `CMSList.clearItems()` default to `true`.\r\n"},{"version":"v1.6.2","date":"10 April 2022","markdown":"- Added [API docs](https://www.npmjs.com/package/@finsweet/attributes-cmscore).\r\n"},{"version":"v1.6.1","date":"03 March 2022","markdown":"- Renamed `CMSList.pageCount` and `CMSList.addPageCount()` to `CMSList.visibleCount` and `CMSList.addVisibleCount()`.\r\n"},{"version":"v1.6.0","date":"03 March 2022","markdown":"- Added `CMSList.pageCount` and `CMSList.addPageCount()` helpers.\r\n This sets the bases for the new `fs-cmsload-element=\"page-count\"` attribute.\r\n"},{"version":"v1.5.7","date":"13 February 2022","markdown":"- Added some extra rendering logic to ensure all images are loaded correctly on `iOS` devices.\r\n"},{"version":"v1.5.6","date":"19 January 2022","markdown":"- Internal: updated `@finsweet/ts-utils` to fix an issue with the `restartWebflow` helper.\r\n Now the 'ix2' state dispatch is awaited, as it was conflicting with other modules restart.\r\n"},{"version":"v1.5.5","date":"19 December 2021","markdown":"- Fixed Webflow modules not restarting correctly.\r\n"},{"version":"v1.5.4","date":"19 December 2021","markdown":"- Added `CMSList.restartSliders` and `CMSList.restartTabs` props to use the built-in `Webflow.require('slider' | 'tabs').redraw()` methods from Webflow instead of restarting the whole instance.\r\n"},{"version":"v1.5.3","date":"15 December 2021","markdown":"- Removed deprecated `CMSList.addPaginationPrevious()` method in favor of `CMSList.addPaginationButton()`.\r\n- Added new `animateList` param to `CMSList.renderItems()` to allow further control over the list animation.\r\n- Set `CMSList.emptyState` prop to `false` on component instantiation.\r\n"},{"version":"v1.5.2","date":"9 December 2021","markdown":"- Added new `CMSList.initialElement` prop.\n- Made sure items are set to `opacity: 1` when using `CMSList.displayElement` without animations.\n"},{"version":"v1.5.1","date":"8 December 2021","markdown":"- Fixed `Empty State` element potentially being retrieved from a native empty Nested Collection, causing the `empty` element from `cmsfilter` not working correctly.\n"},{"version":"v1.5.0","date":"8 December 2021","markdown":"- Added support to use pagination query params.\n Now `cmscore` will extract each `CMSList` pages query (example: `5f7457b3_page`) to be able to consume it with other packages like `cmsload`.\n This has involved several internal changes:\n - Added new `storePaginationData` util. The method is `async` and while running it stores a Promise in `CMSList.extractingPaginationData`.\n - Added new `CMSList.originalItemsPerPage`, `CMSList.pagesQuery` and `CMSList.showPaginationQuery` props.\n - Now `CMSList.currentPage` will no longer be used as the reference to slice rendered items. Instead, a new `CMSList.paginationActive` is used as the reference.\n - Modified `CMSList.switchPage()` to define if it should trigger a rendering cycle.\n - Added new `CMSList.initPagination()` method.\n - Deprecated `CMSList.addPaginationPrevious()` in favor of a new `CMSList.addPaginationButton()` method.\n- Refactored: Moved `CMSList.updateItemsCount()` to be an external util.\n"},{"version":"v1.4.2","date":"1 December 2021","markdown":"- Renamed `window.fsAttributes.cms.lists` to `window.fsAttributes.cms.listInstances` to keep consistency.\n"},{"version":"v1.4.1","date":"1 December 2021","markdown":"- Added support for creating `list` instances that have no items.\n Some users were trying to instantiate lists that were at `Empty State`, causing `cmscore` to crash in some ocasions.\n"},{"version":"v1.4.0","date":"29 November 2021","markdown":"- Added `CMSList.originalItemsOrder` prop.\n- Added `CMSList.clearItems()` method.\n"},{"version":"v1.3.1","date":"23 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to include `lightbox` module support.\n"},{"version":"v1.3.0","date":"23 November 2021","markdown":"- Replaced `CMSItem.needsXXXRestart` props to a single `CMSItem.needsWebflowRestart`, as they were redundant.\n- Added `CMSList.restartWebflow` prop.\n- Improved `restartWebflowModules` and added support for `CMSList.restartWebflow`.\n"},{"version":"v1.2.0","date":"17 November 2021","markdown":"- Included the `package.version` in the exports.\n- Forced `trim` and `toLowerCase` to all prop field keys.\n- Added support for `cmscore` versioning.\n"},{"version":"v1.1.2","date":"15 November 2021","markdown":"- Updated `restartWebflow` from `@finsweet/ts-utils` to support persisting state after reinitializing the `ix2` module.\n"},{"version":"v1.1.1","date":"11 November 2021","markdown":"- Added a `100ms` timeout to the `CMSList.scrollToAnchor` method to avoid it being cancelled by the browser's smoo scrolling.\n"},{"version":"v1.1.0","date":"11 November 2021","markdown":"- Switched `CMSList.validItems` prop from `boolean` to an array of the valid `CMSItem` instanced.\n- Internal refactors.\n"},{"version":"v1.0.24","date":"11 November 2021","markdown":"- Fixed rendering issues caused by the `Empty State` not being correctly displayed in some situations.\n"},{"version":"v1.0.23","date":"9 November 2021","markdown":"- Improved Webflow Modules restarting in the `render` workflow.\n"},{"version":"v1.0.22","date":"9 November 2021","markdown":"- Updated `ts-utils` to add support for `commerce` sites.\n"},{"version":"v1.0.21","date":"9 November 2021","markdown":"- Added `highlightValues` optional prop in each `CMSItemProp` object. Used for `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.20","date":"9 November 2021","markdown":"- Now the `originalHTML` is stored in each `CMSItemProp.elements` record. Used to reset the elements after having mutated them in actions like `fs-cmsfilter-highlight`.\n"},{"version":"v1.0.19","date":"9 November 2021","markdown":"- Refactored `CMSList.itemsCount` usage.\n"},{"version":"v1.0.18","date":"9 November 2021","markdown":"- Added `CMSItemProp.elements` property that stores the value holders.\n"},{"version":"v1.0.17","date":"9 November 2021","markdown":"- Added optional `scrollToAnchor` param to the `CMSList.switchPage()` method.\n"},{"version":"v1.0.16","date":"9 November 2021","markdown":"- Added `CMSList.itemsCount` and `CMSList.addItemsCount()` to display the amount of items of the list.\n"},{"version":"v1.0.15","date":"9 November 2021","markdown":"- `CMSList.switchPage()` now triggers a `scrollToAnchor` action, if the anchor element exists.\n"},{"version":"v1.0.14","date":"8 November 2021","markdown":"- Fixed `renderitems` and `additems` events fire order.\n- Added `CMSList.resetIx` prop that is used in the `render` function.\n"},{"version":"v1.0.13","date":"8 November 2021","markdown":"- Added `CMSList.totalPages` prop.\n"},{"version":"v1.0.12","date":"8 November 2021","markdown":"- Added optional `animate` param to `CMSList.renderItems`.\n"},{"version":"v1.0.11","date":"5 November 2021","markdown":"- Awaited `renderitems` event emit on `CMSList.renderItems`.\n"},{"version":"v1.0.10","date":"5 November 2021","markdown":"- Added `CMSList.paginationCount` prop.\n"},{"version":"v1.0.9","date":"5 November 2021","markdown":"- Added `CMSList.scrollAnchor` prop + `CMSList.scrollToAnchor()` method.\n"},{"version":"v1.0.8","date":"27 October 2021","markdown":"- Added new methods to `CMSList`.\n"},{"version":"v1.0.7","date":"27 October 2021","markdown":"- Published missing updates.\n"},{"version":"v1.0.6","date":"27 October 2021","markdown":"- Improved rendering logic.\n"},{"version":"v1.0.5","date":"27 October 2021","markdown":"- `cmscore`: Removed `CMSList.initialItems` prop.\n"},{"version":"v1.0.4","date":"27 October 2021","markdown":"- `cmscore`: Added `CMSList.initialItems` prop.\n"},{"version":"v1.0.3","date":"26 October 2021","markdown":"- Changed `CMSItemProps.mode` to `CMSItemProps.range`.\n"},{"version":"v1.0.2","date":"26 October 2021","markdown":"- Modified `CMSItem.props` value type to a `Set` instead of `Array`.\n"},{"version":"v1.0.1","date":"26 October 2021","markdown":"- `CMSItem`: Added `mode` in `props` property.\n"},{"version":"v1.0.0","date":"25 October 2021","markdown":"- Created Attribute package.\n"}] |
var xe=Object.create;var j=Object.defineProperty,Ce=Object.defineProperties,Ee=Object.getOwnPropertyDescriptor,Pe=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertyNames,v=Object.getOwnPropertySymbols,Me=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var R=(r,e,t)=>e in r?j(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,W=(r,e)=>{for(var t in e||(e={}))k.call(e,t)&&R(r,t,e[t]);if(v)for(var t of v(e))N.call(e,t)&&R(r,t,e[t]);return r},ee=(r,e)=>Ce(r,Pe(e));var te=(r,e)=>{var t={};for(var i in r)k.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&v)for(var i of v(r))e.indexOf(i)<0&&N.call(r,i)&&(t[i]=r[i]);return t};var Ie=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Ae=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Le(e))!k.call(r,n)&&n!==t&&j(r,n,{get:()=>e[n],enumerable:!(i=Ee(e,n))||i.enumerable});return r};var Te=(r,e,t)=>(t=r!=null?xe(Me(r)):{},Ae(e||!r||!r.__esModule?j(t,"default",{value:r,enumerable:!0}):t,r));var re=(r,e,t)=>(R(r,typeof e!="symbol"?e+"":e,t),t);var c=(r,e,t)=>new Promise((i,n)=>{var o=l=>{try{a(t.next(l))}catch(m){n(m)}},s=l=>{try{a(t.throw(l))}catch(m){n(m)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(r,e)).next())});var le=Ie((Et,ae)=>{"use strict";var y=new WeakMap,_=new WeakMap,M=new WeakMap,G=Symbol("anyProducer"),ie=Promise.resolve(),q=Symbol("listenerAdded"),H=Symbol("listenerRemoved"),z=!1;function C(r){if(typeof r!="string"&&typeof r!="symbol")throw new TypeError("eventName must be a string or a symbol")}function D(r){if(typeof r!="function")throw new TypeError("listener must be a function")}function E(r,e){let t=_.get(r);return t.has(e)||t.set(e,new Set),t.get(e)}function I(r,e){let t=typeof e=="string"||typeof e=="symbol"?e:G,i=M.get(r);return i.has(t)||i.set(t,new Set),i.get(t)}function je(r,e,t){let i=M.get(r);if(i.has(e))for(let n of i.get(e))n.enqueue(t);if(i.has(G)){let n=Promise.all([e,t]);for(let o of i.get(G))o.enqueue(n)}}function ne(r,e){e=Array.isArray(e)?e:[e];let t=!1,i=()=>{},n=[],o={enqueue(s){n.push(s),i()},finish(){t=!0,i()}};for(let s of e)I(r,s).add(o);return{next(){return c(this,null,function*(){return n?n.length===0?t?(n=void 0,this.next()):(yield new Promise(s=>{i=s}),this.next()):{done:!1,value:yield n.shift()}:{done:!0}})},return(a){return c(this,arguments,function*(s){n=void 0;for(let l of e)I(r,l).delete(o);return i(),arguments.length>0?{done:!0,value:yield s}:{done:!0}})},[Symbol.asyncIterator](){return this}}}function oe(r){if(r===void 0)return se;if(!Array.isArray(r))throw new TypeError("`methodNames` must be an array of strings");for(let e of r)if(!se.includes(e))throw typeof e!="string"?new TypeError("`methodNames` element must be a string"):new Error(`${e} is not Emittery method`);return r}var U=r=>r===q||r===H,w=class{static mixin(e,t){return t=oe(t),i=>{if(typeof i!="function")throw new TypeError("`target` must be function");for(let s of t)if(i.prototype[s]!==void 0)throw new Error(`The property \`${s}\` already exists on \`target\``);function n(){return Object.defineProperty(this,e,{enumerable:!1,value:new w}),this[e]}Object.defineProperty(i.prototype,e,{enumerable:!1,get:n});let o=s=>function(...a){return this[e][s](...a)};for(let s of t)Object.defineProperty(i.prototype,s,{enumerable:!1,value:o(s)});return i}}static get isDebugEnabled(){if(typeof process!="object")return z;let{env:e}=process||{env:{}};return e.DEBUG==="emittery"||e.DEBUG==="*"||z}static set isDebugEnabled(e){z=e}constructor(e={}){y.set(this,new Set),_.set(this,new Map),M.set(this,new Map),this.debug=e.debug||{},this.debug.enabled===void 0&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(t,i,n,o)=>{o=JSON.stringify(o),typeof n=="symbol"&&(n=n.toString());let s=new Date,a=`${s.getHours()}:${s.getMinutes()}:${s.getSeconds()}.${s.getMilliseconds()}`;console.log(`[${a}][emittery:${t}][${i}] Event Name: ${n} | ||
data: ${o}`)})}logIfDebugEnabled(e,t,i){(w.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,i)}on(e,t){D(t),e=Array.isArray(e)?e:[e];for(let i of e)C(i),E(this,i).add(t),this.logIfDebugEnabled("subscribe",i,void 0),U(i)||this.emit(q,{eventName:i,listener:t});return this.off.bind(this,e,t)}off(e,t){D(t),e=Array.isArray(e)?e:[e];for(let i of e)C(i),E(this,i).delete(t),this.logIfDebugEnabled("unsubscribe",i,void 0),U(i)||this.emit(H,{eventName:i,listener:t})}once(e){return new Promise(t=>{let i=this.on(e,n=>{i(),t(n)})})}events(e){e=Array.isArray(e)?e:[e];for(let t of e)C(t);return ne(this,e)}emit(e,t){return c(this,null,function*(){C(e),this.logIfDebugEnabled("emit",e,t),je(this,e,t);let i=E(this,e),n=y.get(this),o=[...i],s=U(e)?[]:[...n];yield ie,yield Promise.all([...o.map(a=>c(this,null,function*(){if(i.has(a))return a(t)})),...s.map(a=>c(this,null,function*(){if(n.has(a))return a(e,t)}))])})}emitSerial(e,t){return c(this,null,function*(){C(e),this.logIfDebugEnabled("emitSerial",e,t);let i=E(this,e),n=y.get(this),o=[...i],s=[...n];yield ie;for(let a of o)i.has(a)&&(yield a(t));for(let a of s)n.has(a)&&(yield a(e,t))})}onAny(e){return D(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),y.get(this).add(e),this.emit(q,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return ne(this)}offAny(e){D(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(H,{listener:e}),y.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(let t of e)if(this.logIfDebugEnabled("clear",t,void 0),typeof t=="string"||typeof t=="symbol"){E(this,t).clear();let i=I(this,t);for(let n of i)n.finish();i.clear()}else{y.get(this).clear();for(let i of _.get(this).values())i.clear();for(let i of M.get(this).values()){for(let n of i)n.finish();i.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(let i of e){if(typeof i=="string"){t+=y.get(this).size+E(this,i).size+I(this,i).size+I(this).size;continue}typeof i!="undefined"&&C(i),t+=y.get(this).size;for(let n of _.get(this).values())t+=n.size;for(let n of M.get(this).values())t+=n.size}return t}bindMethods(e,t){if(typeof e!="object"||e===null)throw new TypeError("`target` must be an object");t=oe(t);for(let i of t){if(e[i]!==void 0)throw new Error(`The property \`${i}\` already exists on \`target\``);Object.defineProperty(e,i,{enumerable:!1,value:this[i].bind(this)})}}},se=Object.getOwnPropertyNames(w.prototype).filter(r=>r!=="constructor");Object.defineProperty(w,"listenerAdded",{value:q,writable:!1,enumerable:!0,configurable:!1});Object.defineProperty(w,"listenerRemoved",{value:H,writable:!1,enumerable:!0,configurable:!1});ae.exports=w});var We="1.6.2";var P=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,t){if(this.alertsActivated&&window.alert(e),t==="error")throw new Error(e)}};re(P,"alertsActivated",!1);var x={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var B=r=>{let e=r.split("-"),t=parseInt(e[e.length-1]);if(!isNaN(t))return t};var F=r=>new Promise(e=>setTimeout(e,r));var V=r=>r!=null;var{wrapper:Oe,list:De,paginationWrapper:_e,paginationNext:qe,paginationPrevious:He,emptyState:$e,pageCount:Re}=x;function d(r,e,t=document){let i=typeof r=="string"?t.querySelector(r):r;if(!i)return;let n=i.closest(`.${Oe}`);if(!n)return;let o=n.querySelector(`.${De}`);return e==="wrapper"?n:e==="list"?o:e==="items"?[...(o==null?void 0:o.children)||[]]:e==="pageCount"?n.querySelector(`.${Re}`):e==="empty"?n.querySelector(`:scope > .${$e}`):e==="pagination"?n.querySelector(`.${_e}`):n.querySelector(`.${e==="next"?qe:He}`)}var L=(r,e=document)=>{r=r.filter(o=>o);let t=r.join(", ")||`.${x.wrapper}`;return[...e.querySelectorAll(t)].reduce((o,s)=>{if(!s)return o;let a=d(s,"wrapper");return!a||o.includes(a)||o.push(a),o},[])};var Q=()=>document.documentElement.getAttribute("data-wf-site");var O=r=>c(void 0,null,function*(){var t,i,n;let{Webflow:e}=window;if(!(!e||!("destroy"in e)||!("ready"in e)||!("require"in e))&&!(r&&!r.length)){if(r||(e.destroy(),e.ready()),!r||r.includes("ix2")){let o=e.require("ix2");if(o){let{store:s,actions:a}=o,{eventState:l}=s.getState().ixSession,m=Object.entries(l);r||o.destroy(),o.init(),yield Promise.all(m.map(f=>s.dispatch(a.eventStateChanged(...f))))}}if(!r||r.includes("commerce")){let o=e.require("commerce"),s=Q();o&&s&&(o.destroy(),o.init({siteId:s,apiUrl:"https://render.webflow.com"}))}return r!=null&&r.includes("lightbox")&&((t=e.require("lightbox"))==null||t.ready()),r!=null&&r.includes("slider")&&((i=e.require("slider"))==null||i.redraw()),r!=null&&r.includes("tabs")&&((n=e.require("tabs"))==null||n.redraw()),new Promise(o=>e.push(()=>o(void 0)))}});var we=Te(le(),1);var J=(r,e)=>{let t=r.getAttribute(e);return t?B(t):void 0};function ce(r){return r==null?void 0:r.trim().toLowerCase()}var A=class{constructor(e,t,i){this.element=e;this.list=t;this.currentIndex=i;this.props={};this.valid=!0;var o;this.href=(o=e.querySelector("a"))==null?void 0:o.href;let n=typeof i=="number";this.needsWebflowRestart=!n}collectProps({fieldKey:e,typeKey:t,rangeKey:i}){let{element:n,props:o}=this,s=[...n.querySelectorAll(`[${e}]`)];for(let a of s){let l=ce(a.getAttribute(e));if(!l)return;let{textContent:m,innerHTML:f}=a;if(!m)continue;let h=t?a.getAttribute(t):void 0,u=i?a.getAttribute(i):void 0;o[l]||(o[l]={type:h,range:u,values:new Set,elements:new Map});let g=o[l],{values:p,elements:b}=g;if(u==="from"||u==="to"){let S=[...p];S[u==="from"?0:1]=m,g.values=new Set(S)}p.add(m),b.has(m)||b.set(m,{element:a,originalHTML:f})}}};var K=(r,e)=>{r.textContent=`${e}`};var ke=new DOMParser,ue=r=>c(void 0,null,function*(){let t=yield(yield fetch(r)).text();return ke.parseFromString(t,"text/html")});var{location:me,history:Be}=window,pe,fe=r=>{if(!r)return;let{href:e}=r,{searchParams:t}=new URL(e);return[...t.entries()]},Fe=i=>c(void 0,[i],function*({paginationNext:r,paginationPrevious:e,index:t}){let n=fe(r||e);if(!n||!n.length)return;let o,s;if(n.length===1){let[l]=n;if(!l)return;[o,s]=l}else try{let{origin:l,pathname:m}=me;pe||(pe=ue(l+m));let f=yield pe,u=L([],f)[t];if(!u)return;let g=d(u,"next"),[p]=fe(g)||[];if(!p)return;[o]=p,[,s]=n.find(([b])=>b===o)||[]}catch(l){return}if(!o||!s)return;let a=parseInt(s);return[o,a]}),de=r=>{let{paginationNext:e}=r;r.extractingPaginationData=new Promise(t=>c(void 0,null,function*(){let i=yield Fe(r);if(!i){t();return}let[n,o]=i;r.pagesQuery=n,r.currentPage=e?o-1:o+1,t()}))},ge=({currentPage:r,pagesQuery:e})=>{if(!e||!r)return;let t=new URL(me.href),{searchParams:i}=t;i.set(e,`${r}`),Be.replaceState(null,"",t.toString())};var be=(l,m)=>c(void 0,[l,m],function*(r,{items:e,restartWebflow:t,restartIx:i,restartCommerce:n,restartLightbox:o,restartSliders:s,restartTabs:a}){let f=[[i,"ix2"],[n,"commerce"],[o,"lightbox"],[s,"slider"],[a,"tabs"]];if(!t&&!f.some(([u])=>u)||!r.some(({needsWebflowRestart:u})=>u))return;for(let u of e){let g=r.includes(u);u.needsWebflowRestart=!g}if(t){yield O();return}let h=f.reduce((u,[g,p])=>(g&&u.push(p),u),[]);yield O(h)});var ye=(r,e=!1,t=!0)=>c(void 0,null,function*(){let{items:i,itemsPerPage:n,paginationActive:o,currentPage:s,emptyState:a}=r,l=[],m=[],f=[];for(let p of i){let{valid:b,currentIndex:S}=p,T=typeof S=="number";if(b){if(l.push(p),!o||!s){f.push(p);continue}l.length>(s-1)*n&&l.length<=s*n?f.push(p):T&&m.push(p)}else T&&m.push(p)}r.validItems=l,r.totalPages=Math.ceil(l.length/n)||1;let h=!l.length;r.emptyState=h;let u=[];f.forEach((p,b)=>{p.currentIndex!==b&&u.push([p,b,f[b-1]])});let g=t&&!e||a!==h;return g&&(yield r.displayElement(a?"emptyElement":"list",!1)),yield Promise.all([...Ve(m,r,e),...Qe(u,r,e)]),yield r.emitSerial("renderitems",f),yield be(f,r),g&&(yield r.displayElement(h?"emptyElement":"list")),f}),Ve=(r,{itemsAnimation:e},t)=>r.map(i=>c(void 0,null,function*(){let{element:n}=i;if(t&&e){let{animateOut:o,options:s}=e;yield o(n,W({remove:!0},s))}else n.remove();i.currentIndex=void 0})),Qe=(r,{list:e,itemsAnimation:t},i)=>e?r.map((l,m)=>c(void 0,[l,m],function*([n,o,s],a){n.animating=new Promise(f=>c(void 0,null,function*(){n.rendering=new Promise(h=>c(void 0,null,function*(){yield s==null?void 0:s.rendering;let{element:u,currentIndex:g}=n,p=(s==null?void 0:s.element)||null;if(typeof g!="number"&&i&&t){let{prepareIn:S,animateIn:T,options:X}=t,b=X||{},{stagger:Y}=b,Se=te(b,["stagger"]),Z=W({target:e,insertAfter:p},Se);S(u,Z),he(u),h(),Y&&(yield F(Y*a)),yield T(u,ee(W({},Z),{prepared:!0}))}else p?e.insertBefore(u,p.nextSibling):e.prepend(u),he(u),h();f()}))})),yield n.rendering,n.currentIndex=o})):[],he=r=>{if(!/apple/i.test(navigator.vendor))return;let e=r.querySelectorAll("img");for(let t of e)t.outerHTML=t.outerHTML};var $=class extends we.default{constructor(e,t){super();this.wrapper=e;this.index=t;this.emptyState=!1;this.paginationActive=!1;this.showPaginationQuery=!1;this.restartWebflow=!1;this.restartIx=!1;this.restartCommerce=!1;this.restartLightbox=!1;this.restartSliders=!1;this.restartTabs=!1;let i=d(e,"list");this.list=i,this.paginationWrapper=d(e,"pagination"),this.paginationNext=d(e,"next"),this.paginationPrevious=d(e,"previous"),this.paginationCount=d(e,"pageCount"),this.emptyElement=d(e,"empty");let n=d(e,"items");this.itemsPerPage=this.originalItemsPerPage=n.length,this.totalPages=1,de(this);let o=[];i&&o.push(...n.map((s,a)=>new A(s,i,a))),this.items=o,this.validItems=o,this.originalItemsOrder=[...o]}addItems(e,t="push"){return c(this,null,function*(){let{items:i,list:n,originalItemsOrder:o}=this;if(!n)return;let s=e.map(a=>new A(a,n));for(let a of[i,o])a[t](...s);yield this.emit("shouldnest",s),yield this.emit("shouldcollectprops",s),yield this.emit("shouldsort",s),yield this.emit("shouldfilter"),yield this.renderItems(!0),yield this.emit("additems",s)})}restoreItemsOrder(){this.items=[...this.originalItemsOrder]}clearItems(e){if(e)for(let{element:t}of this.items)t.remove();this.items=[],this.originalItemsOrder=[]}renderItems(e,t){return c(this,null,function*(){return yield this.renderingQueue,new Promise(i=>c(this,null,function*(){let n=ye(this,e,t);this.renderingQueue=n;let o=yield n;i(o)}))})}displayElement(e,t=!0,i=!0){return c(this,null,function*(){let{listAnimation:n}=this,o=this[e];if(!!o)if(n&&i){let{animateIn:s,animateOut:a,options:l}=n;yield(t?s:a)(o,l)}else o.style.display=t?"":"none",o.style.opacity=t?"1":"0"})}switchPage(e,t=!0){return c(this,null,function*(){let{currentPage:i,showPaginationQuery:n}=this;e!==i&&(yield this.emit("switchpage",e),this.currentPage=e,this.scrollToAnchor(),n&&ge(this),t&&(yield this.renderItems()))})}initPagination(e){this.paginationActive=!0,this.showPaginationQuery=!!e}addPaginationButton(e,t,i){let{paginationWrapper:n}=this;!n||this[t]||i<0||(e.style.display="none",n.insertBefore(e,n.children[i]),this[t]=e)}addEmptyElement(e){let{wrapper:t,list:i,emptyElement:n}=this;n||(e.style.display="none",t.insertBefore(e,(i==null?void 0:i.nextSibling)||null),this.emptyElement=e)}addLoader(e){let{loader:t}=this;t||(e.style.display="none",this.loader=e)}addItemsCount(e){if(this.itemsCount)return;this.itemsCount=e;let t=()=>K(e,this.items.length);t(),this.on("additems",t)}addVisibleCount(e){if(this.visibleCount)return;this.visibleCount=e;let t=()=>K(e,Math.min(this.itemsPerPage,this.validItems.length));t(),this.on("renderitems",t)}scrollToAnchor(){let{scrollAnchor:e}=this;!e||window.setTimeout(()=>e.scrollIntoView({behavior:"smooth"}),100)}getAttribute(e){let{wrapper:t,list:i}=this;return t.getAttribute(e)||(i==null?void 0:i.getAttribute(e))}getInstanceIndex(e){let{wrapper:t,list:i}=this;return J(t,e)||(i?J(i,e):void 0)}};var ze=r=>L(r).map(Ue).filter(V),Ue=r=>{var s,a;let e=d(r,"wrapper");if(!e){P.alert("The element is not a Collection List.","error");return}let{fsAttributes:t}=window;(s=t.cms).listInstances||(s.listInstances=[]),(a=t.cms).listElements||(a.listElements=[...document.querySelectorAll(`.${x.wrapper}`)]);let{listInstances:i,listElements:n}=t.cms,o=n.indexOf(e);if(o!==-1)return i[o]||(i[o]=new $(e,o)),i[o]};export{A as CMSItem,$ as CMSList,ze as createCMSListInstances,We as version}; | ||
data: ${o}`)})}logIfDebugEnabled(e,t,i){(w.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,i)}on(e,t){D(t),e=Array.isArray(e)?e:[e];for(let i of e)C(i),E(this,i).add(t),this.logIfDebugEnabled("subscribe",i,void 0),U(i)||this.emit(q,{eventName:i,listener:t});return this.off.bind(this,e,t)}off(e,t){D(t),e=Array.isArray(e)?e:[e];for(let i of e)C(i),E(this,i).delete(t),this.logIfDebugEnabled("unsubscribe",i,void 0),U(i)||this.emit(H,{eventName:i,listener:t})}once(e){return new Promise(t=>{let i=this.on(e,n=>{i(),t(n)})})}events(e){e=Array.isArray(e)?e:[e];for(let t of e)C(t);return ne(this,e)}emit(e,t){return c(this,null,function*(){C(e),this.logIfDebugEnabled("emit",e,t),je(this,e,t);let i=E(this,e),n=y.get(this),o=[...i],s=U(e)?[]:[...n];yield ie,yield Promise.all([...o.map(a=>c(this,null,function*(){if(i.has(a))return a(t)})),...s.map(a=>c(this,null,function*(){if(n.has(a))return a(e,t)}))])})}emitSerial(e,t){return c(this,null,function*(){C(e),this.logIfDebugEnabled("emitSerial",e,t);let i=E(this,e),n=y.get(this),o=[...i],s=[...n];yield ie;for(let a of o)i.has(a)&&(yield a(t));for(let a of s)n.has(a)&&(yield a(e,t))})}onAny(e){return D(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),y.get(this).add(e),this.emit(q,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return ne(this)}offAny(e){D(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(H,{listener:e}),y.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(let t of e)if(this.logIfDebugEnabled("clear",t,void 0),typeof t=="string"||typeof t=="symbol"){E(this,t).clear();let i=I(this,t);for(let n of i)n.finish();i.clear()}else{y.get(this).clear();for(let i of _.get(this).values())i.clear();for(let i of M.get(this).values()){for(let n of i)n.finish();i.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(let i of e){if(typeof i=="string"){t+=y.get(this).size+E(this,i).size+I(this,i).size+I(this).size;continue}typeof i!="undefined"&&C(i),t+=y.get(this).size;for(let n of _.get(this).values())t+=n.size;for(let n of M.get(this).values())t+=n.size}return t}bindMethods(e,t){if(typeof e!="object"||e===null)throw new TypeError("`target` must be an object");t=oe(t);for(let i of t){if(e[i]!==void 0)throw new Error(`The property \`${i}\` already exists on \`target\``);Object.defineProperty(e,i,{enumerable:!1,value:this[i].bind(this)})}}},se=Object.getOwnPropertyNames(w.prototype).filter(r=>r!=="constructor");Object.defineProperty(w,"listenerAdded",{value:q,writable:!1,enumerable:!0,configurable:!1});Object.defineProperty(w,"listenerRemoved",{value:H,writable:!1,enumerable:!0,configurable:!1});ae.exports=w});var We="1.6.3";var P=class{static activateAlerts(){this.alertsActivated=!0}static alert(e,t){if(this.alertsActivated&&window.alert(e),t==="error")throw new Error(e)}};re(P,"alertsActivated",!1);var x={wrapper:"w-dyn-list",list:"w-dyn-items",item:"w-dyn-item",paginationWrapper:"w-pagination-wrapper",paginationNext:"w-pagination-next",paginationPrevious:"w-pagination-previous",pageCount:"w-page-count",emptyState:"w-dyn-empty"};var B=r=>{let e=r.split("-"),t=parseInt(e[e.length-1]);if(!isNaN(t))return t};var F=r=>new Promise(e=>setTimeout(e,r));var V=r=>r!=null;var{wrapper:Oe,list:De,paginationWrapper:_e,paginationNext:qe,paginationPrevious:He,emptyState:$e,pageCount:Re}=x;function d(r,e,t=document){let i=typeof r=="string"?t.querySelector(r):r;if(!i)return;let n=i.closest(`.${Oe}`);if(!n)return;let o=n.querySelector(`.${De}`);return e==="wrapper"?n:e==="list"?o:e==="items"?[...(o==null?void 0:o.children)||[]]:e==="pageCount"?n.querySelector(`.${Re}`):e==="empty"?n.querySelector(`:scope > .${$e}`):e==="pagination"?n.querySelector(`.${_e}`):n.querySelector(`.${e==="next"?qe:He}`)}var L=(r,e=document)=>{r=r.filter(o=>o);let t=r.join(", ")||`.${x.wrapper}`;return[...e.querySelectorAll(t)].reduce((o,s)=>{if(!s)return o;let a=d(s,"wrapper");return!a||o.includes(a)||o.push(a),o},[])};var Q=()=>document.documentElement.getAttribute("data-wf-site");var O=r=>c(void 0,null,function*(){var t,i,n;let{Webflow:e}=window;if(!(!e||!("destroy"in e)||!("ready"in e)||!("require"in e))&&!(r&&!r.length)){if(r||(e.destroy(),e.ready()),!r||r.includes("ix2")){let o=e.require("ix2");if(o){let{store:s,actions:a}=o,{eventState:l}=s.getState().ixSession,m=Object.entries(l);r||o.destroy(),o.init(),yield Promise.all(m.map(f=>s.dispatch(a.eventStateChanged(...f))))}}if(!r||r.includes("commerce")){let o=e.require("commerce"),s=Q();o&&s&&(o.destroy(),o.init({siteId:s,apiUrl:"https://render.webflow.com"}))}return r!=null&&r.includes("lightbox")&&((t=e.require("lightbox"))==null||t.ready()),r!=null&&r.includes("slider")&&((i=e.require("slider"))==null||i.redraw()),r!=null&&r.includes("tabs")&&((n=e.require("tabs"))==null||n.redraw()),new Promise(o=>e.push(()=>o(void 0)))}});var we=Te(le(),1);var J=(r,e)=>{let t=r.getAttribute(e);return t?B(t):void 0};function ce(r){return r==null?void 0:r.trim().toLowerCase()}var A=class{constructor(e,t,i){this.element=e;this.list=t;this.currentIndex=i;this.props={};this.valid=!0;var o;this.href=(o=e.querySelector("a"))==null?void 0:o.href;let n=typeof i=="number";this.needsWebflowRestart=!n}collectProps({fieldKey:e,typeKey:t,rangeKey:i}){let{element:n,props:o}=this,s=[...n.querySelectorAll(`[${e}]`)];for(let a of s){let l=ce(a.getAttribute(e));if(!l)return;let{textContent:m,innerHTML:f}=a;if(!m)continue;let h=t?a.getAttribute(t):void 0,u=i?a.getAttribute(i):void 0;o[l]||(o[l]={type:h,range:u,values:new Set,elements:new Map});let g=o[l],{values:p,elements:b}=g;if(u==="from"||u==="to"){let S=[...p];S[u==="from"?0:1]=m,g.values=new Set(S)}p.add(m),b.has(m)||b.set(m,{element:a,originalHTML:f})}}};var K=(r,e)=>{r.textContent=`${e}`};var ke=new DOMParser,ue=r=>c(void 0,null,function*(){let t=yield(yield fetch(r)).text();return ke.parseFromString(t,"text/html")});var{location:me,history:Be}=window,pe,fe=r=>{if(!r)return;let{href:e}=r,{searchParams:t}=new URL(e);return[...t.entries()]},Fe=i=>c(void 0,[i],function*({paginationNext:r,paginationPrevious:e,index:t}){let n=fe(r||e);if(!n||!n.length)return;let o,s;if(n.length===1){let[l]=n;if(!l)return;[o,s]=l}else try{let{origin:l,pathname:m}=me;pe||(pe=ue(l+m));let f=yield pe,u=L([],f)[t];if(!u)return;let g=d(u,"next"),[p]=fe(g)||[];if(!p)return;[o]=p,[,s]=n.find(([b])=>b===o)||[]}catch(l){return}if(!o||!s)return;let a=parseInt(s);return[o,a]}),de=r=>{let{paginationNext:e}=r;r.extractingPaginationData=new Promise(t=>c(void 0,null,function*(){let i=yield Fe(r);if(!i){t();return}let[n,o]=i;r.pagesQuery=n,r.currentPage=e?o-1:o+1,t()}))},ge=({currentPage:r,pagesQuery:e})=>{if(!e||!r)return;let t=new URL(me.href),{searchParams:i}=t;i.set(e,`${r}`),Be.replaceState(null,"",t.toString())};var be=(l,m)=>c(void 0,[l,m],function*(r,{items:e,restartWebflow:t,restartIx:i,restartCommerce:n,restartLightbox:o,restartSliders:s,restartTabs:a}){let f=[[i,"ix2"],[n,"commerce"],[o,"lightbox"],[s,"slider"],[a,"tabs"]];if(!t&&!f.some(([u])=>u)||!r.some(({needsWebflowRestart:u})=>u))return;for(let u of e){let g=r.includes(u);u.needsWebflowRestart=!g}if(t){yield O();return}let h=f.reduce((u,[g,p])=>(g&&u.push(p),u),[]);yield O(h)});var ye=(r,e=!1,t=!0)=>c(void 0,null,function*(){let{items:i,itemsPerPage:n,paginationActive:o,currentPage:s,emptyState:a}=r,l=[],m=[],f=[];for(let p of i){let{valid:b,currentIndex:S}=p,T=typeof S=="number";if(b){if(l.push(p),!o||!s){f.push(p);continue}l.length>(s-1)*n&&l.length<=s*n?f.push(p):T&&m.push(p)}else T&&m.push(p)}r.validItems=l,r.totalPages=Math.ceil(l.length/n)||1;let h=!l.length;r.emptyState=h;let u=[];f.forEach((p,b)=>{p.currentIndex!==b&&u.push([p,b,f[b-1]])});let g=t&&!e||a!==h;return g&&(yield r.displayElement(a?"emptyElement":"list",!1)),yield Promise.all([...Ve(m,r,e),...Qe(u,r,e)]),yield r.emitSerial("renderitems",f),yield be(f,r),g&&(yield r.displayElement(h?"emptyElement":"list")),f}),Ve=(r,{itemsAnimation:e},t)=>r.map(i=>c(void 0,null,function*(){let{element:n}=i;if(t&&e){let{animateOut:o,options:s}=e;yield o(n,W({remove:!0},s))}else n.remove();i.currentIndex=void 0})),Qe=(r,{list:e,itemsAnimation:t},i)=>e?r.map((l,m)=>c(void 0,[l,m],function*([n,o,s],a){n.animating=new Promise(f=>c(void 0,null,function*(){n.rendering=new Promise(h=>c(void 0,null,function*(){yield s==null?void 0:s.rendering;let{element:u,currentIndex:g}=n,p=(s==null?void 0:s.element)||null;if(typeof g!="number"&&i&&t){let{prepareIn:S,animateIn:T,options:X}=t,b=X||{},{stagger:Y}=b,Se=te(b,["stagger"]),Z=W({target:e,insertAfter:p},Se);S(u,Z),he(u),h(),Y&&(yield F(Y*a)),yield T(u,ee(W({},Z),{prepared:!0}))}else p?e.insertBefore(u,p.nextSibling):e.prepend(u),he(u),h();f()}))})),yield n.rendering,n.currentIndex=o})):[],he=r=>{if(!/apple/i.test(navigator.vendor))return;let e=r.querySelectorAll("img");for(let t of e)t.outerHTML=t.outerHTML};var $=class extends we.default{constructor(e,t){super();this.wrapper=e;this.index=t;this.emptyState=!1;this.paginationActive=!1;this.showPaginationQuery=!1;this.restartWebflow=!1;this.restartIx=!1;this.restartCommerce=!1;this.restartLightbox=!1;this.restartSliders=!1;this.restartTabs=!1;let i=d(e,"list");this.list=i,this.paginationWrapper=d(e,"pagination"),this.paginationNext=d(e,"next"),this.paginationPrevious=d(e,"previous"),this.paginationCount=d(e,"pageCount"),this.emptyElement=d(e,"empty");let n=d(e,"items");this.itemsPerPage=this.originalItemsPerPage=n.length,this.totalPages=1,de(this);let o=[];i&&o.push(...n.map((s,a)=>new A(s,i,a))),this.items=o,this.validItems=o,this.originalItemsOrder=[...o]}addItems(e,t="push"){return c(this,null,function*(){let{items:i,list:n,originalItemsOrder:o}=this;if(!n)return;let s=e.map(a=>new A(a,n));for(let a of[i,o])a[t](...s);yield this.emit("shouldnest",s),yield this.emit("shouldcollectprops",s),yield this.emit("shouldsort",s),yield this.emit("shouldfilter"),yield this.renderItems(!0),yield this.emit("additems",s)})}restoreItemsOrder(){this.items=[...this.originalItemsOrder]}clearItems(e=!0){if(e)for(let{element:t}of this.items)t.remove();this.items=[],this.originalItemsOrder=[]}renderItems(e,t){return c(this,null,function*(){return yield this.renderingQueue,new Promise(i=>c(this,null,function*(){let n=ye(this,e,t);this.renderingQueue=n;let o=yield n;i(o)}))})}displayElement(e,t=!0,i=!0){return c(this,null,function*(){let{listAnimation:n}=this,o=this[e];if(!!o)if(n&&i){let{animateIn:s,animateOut:a,options:l}=n;yield(t?s:a)(o,l)}else o.style.display=t?"":"none",o.style.opacity=t?"1":"0"})}switchPage(e,t=!0){return c(this,null,function*(){let{currentPage:i,showPaginationQuery:n}=this;e!==i&&(yield this.emit("switchpage",e),this.currentPage=e,this.scrollToAnchor(),n&&ge(this),t&&(yield this.renderItems()))})}initPagination(e){this.paginationActive=!0,this.showPaginationQuery=!!e}addPaginationButton(e,t,i){let{paginationWrapper:n}=this;!n||this[t]||i<0||(e.style.display="none",n.insertBefore(e,n.children[i]),this[t]=e)}addEmptyElement(e){let{wrapper:t,list:i,emptyElement:n}=this;n||(e.style.display="none",t.insertBefore(e,(i==null?void 0:i.nextSibling)||null),this.emptyElement=e)}addLoader(e){let{loader:t}=this;t||(e.style.display="none",this.loader=e)}addItemsCount(e){if(this.itemsCount)return;this.itemsCount=e;let t=()=>K(e,this.items.length);t(),this.on("additems",t)}addVisibleCount(e){if(this.visibleCount)return;this.visibleCount=e;let t=()=>K(e,Math.min(this.itemsPerPage,this.validItems.length));t(),this.on("renderitems",t)}scrollToAnchor(){let{scrollAnchor:e}=this;!e||window.setTimeout(()=>e.scrollIntoView({behavior:"smooth"}),100)}getAttribute(e){let{wrapper:t,list:i}=this;return t.getAttribute(e)||(i==null?void 0:i.getAttribute(e))}getInstanceIndex(e){let{wrapper:t,list:i}=this;return J(t,e)||(i?J(i,e):void 0)}};var ze=r=>L(r).map(Ue).filter(V),Ue=r=>{var s,a;let e=d(r,"wrapper");if(!e){P.alert("The element is not a Collection List.","error");return}let{fsAttributes:t}=window;(s=t.cms).listInstances||(s.listInstances=[]),(a=t.cms).listElements||(a.listElements=[...document.querySelectorAll(`.${x.wrapper}`)]);let{listInstances:i,listElements:n}=t.cms,o=n.indexOf(e);if(o!==-1)return i[o]||(i[o]=new $(e,o)),i[o]};export{A as CMSItem,$ as CMSList,ze as createCMSListInstances,We as version}; |
{ | ||
"name": "@finsweet/attributes-cmscore", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "Core functionalities of all cms Attributes.", | ||
@@ -5,0 +5,0 @@ "main": "cmscore.js", |
34888