@appmate/wishlist
Advanced tools
Comparing version 4.15.5 to 4.15.6
@@ -7,2 +7,2 @@ var O=Object.create;var E=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var H=(s,i)=>()=>(i||s((i={exports:{}}).exports,i),i.exports);var G=(s,i,t,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of V(i))!z.call(s,r)&&r!==t&&E(s,r,{get:()=>i[r],enumerable:!(e=K(i,r))||e.enumerable});return s};var J=(s,i,t)=>(t=s!=null?O(B(s)):{},G(i||!s||!s.__esModule?E(t,"default",{value:s,enumerable:!0}):t,s));var C=H((Ut,q)=>{"use strict";var rt=function(){function s(t,e){if(typeof t!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+t+"."));this._batchLoadFn=t,this._maxBatchSize=ot(e),this._batchScheduleFn=ct(e),this._cacheKeyFn=ht(e),this._cacheMap=lt(e),this._batch=null}var i=s.prototype;return i.load=function(e){if(e==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(e)+"."));var r=nt(this),n=this._cacheMap,a=this._cacheKeyFn(e);if(n){var o=n.get(a);if(o){var h=r.cacheHits||(r.cacheHits=[]);return new Promise(function(p){h.push(function(){p(o)})})}}r.keys.push(e);var c=new Promise(function(p,u){r.callbacks.push({resolve:p,reject:u})});return n&&n.set(a,c),c},i.loadMany=function(e){if(!N(e))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+e+"."));for(var r=[],n=0;n<e.length;n++)r.push(this.load(e[n]).catch(function(a){return a}));return Promise.all(r)},i.clear=function(e){var r=this._cacheMap;if(r){var n=this._cacheKeyFn(e);r.delete(n)}return this},i.clearAll=function(){var e=this._cacheMap;return e&&e.clear(),this},i.prime=function(e,r){var n=this._cacheMap;if(n){var a=this._cacheKeyFn(e);if(n.get(a)===void 0){var o;r instanceof Error?(o=Promise.reject(r),o.catch(function(){})):o=Promise.resolve(r),n.set(a,o)}}return this},s}(),st=typeof process=="object"&&typeof process.nextTick=="function"?function(s){P||(P=Promise.resolve()),P.then(function(){process.nextTick(s)})}:typeof setImmediate=="function"?function(s){setImmediate(s)}:function(s){setTimeout(s)},P;function nt(s){var i=s._batch;if(i!==null&&!i.hasDispatched&&i.keys.length<s._maxBatchSize&&(!i.cacheHits||i.cacheHits.length<s._maxBatchSize))return i;var t={hasDispatched:!1,keys:[],callbacks:[]};return s._batch=t,s._batchScheduleFn(function(){at(s,t)}),t}function at(s,i){if(i.hasDispatched=!0,i.keys.length===0){T(i);return}var t=s._batchLoadFn(i.keys);if(!t||typeof t.then!="function")return F(s,i,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(t)+".")));t.then(function(e){if(!N(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(e)+"."));if(e.length!==i.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(` | ||
Values: | ||
`+String(e)));T(i);for(var r=0;r<i.callbacks.length;r++){var n=e[r];n instanceof Error?i.callbacks[r].reject(n):i.callbacks[r].resolve(n)}}).catch(function(e){F(s,i,e)})}function F(s,i,t){T(i);for(var e=0;e<i.keys.length;e++)s.clear(i.keys[e]),i.callbacks[e].reject(t)}function T(s){if(s.cacheHits)for(var i=0;i<s.cacheHits.length;i++)s.cacheHits[i]()}function ot(s){var i=!s||s.batch!==!1;if(!i)return 1;var t=s&&s.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}function ct(s){var i=s&&s.batchScheduleFn;if(i===void 0)return st;if(typeof i!="function")throw new TypeError("batchScheduleFn must be a function: "+i);return i}function ht(s){var i=s&&s.cacheKeyFn;if(i===void 0)return function(t){return t};if(typeof i!="function")throw new TypeError("cacheKeyFn must be a function: "+i);return i}function lt(s){var i=!s||s.cache!==!1;if(!i)return null;var t=s&&s.cacheMap;if(t===void 0)return new Map;if(t!==null){var e=["get","set","delete","clear"],r=e.filter(function(n){return t&&typeof t[n]!="function"});if(r.length!==0)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}function N(s){return typeof s=="object"&&s!==null&&typeof s.length=="number"&&(s.length===0||s.length>0&&Object.prototype.hasOwnProperty.call(s,s.length-1))}q.exports=rt});import{of as M}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var{ga:d}=window,m=class{constructor(){this.eventNames=new Map([["addToWishlist","WK Added Product"],["removeFromWishlist","WK Removed Product"],["addToCart","WK Added to Cart"],["shareWishlist","WK Shared Wishlist"],["clearWishlist","WK Cleared Wishlist"]])}track({eventName:i,product:t,variant:e,quantity:r=1}){var a;let n=this.eventNames.get(i);return!n||!(d!=null&&d.loaded)||!t?M(!1):(d("ec:addProduct",{id:(a=(e==null?void 0:e.sku)||(e==null?void 0:e.id))!=null?a:t.id,name:t.title,category:t.type,brand:t.vendor,variant:e==null?void 0:e.title,quantity:r}),d("send",{eventAction:n,hitType:"event",eventCategory:"Wishlist",eventLabel:"Wishlist King"}),M(!0))}};import{of as L}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var f=class{constructor({urlUtil:i,moneyUtil:t}){this.urlUtil=i,this.moneyUtil=t,this.eventNames=new Map([["addToWishlist","Added To Wishlist"],["removeFromWishlist","Removed From Wishlist"],["clearWishlist","Cleared Wishlist"]])}track({eventName:i,wishlist:t,product:e,variant:r,quantity:n=1}){let a=this.eventNames.get(i);return!a||!t||!e?L(!1):(window._learnq||(window._learnq=[]),window._learnq.push(["track",a,{URL:this.urlUtil.getVariantUrl(e.url,r==null?void 0:r.id),Name:e.title,ProductID:e.id,VariantID:r==null?void 0:r.id,SKU:r==null?void 0:r.sku,Tags:e.tags,Brand:e.vendor,ImageURL:this.urlUtil.getImageUrl(e,{width:1e3}),Price:r==null?void 0:r.price,PriceFormatted:r?this.moneyUtil.formatMoney(r.price):null,CompareAtPrice:r==null?void 0:r.compare_at_price,CompareAtPriceFormatted:r!=null&&r.compare_at_price?this.moneyUtil.formatMoney(r.compare_at_price):null,Quantity:n,WishlistUrl:this.urlUtil.getPublicWishlistUrl(t.id)}]),L(!0))}};import{of as j}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var{fbq:U}=window,g=class{constructor({currency:i}){this.currency=i,this.eventNames=new Map([["addToWishlist","AddToWishlist"]])}track({eventName:i,product:t,variant:e}){let r=this.eventNames.get(i);return!r||typeof U!="function"||!t?j(!1):(U("track",r,{value:e==null?void 0:e.price,currency:this.currency,content_ids:[t.id],content_name:[t.title,e==null?void 0:e.title].filter(n=>!!n).join(" - "),content_category:t.type,content_type:"product_group",num_items:1}),j(!0))}};import{catchError as $,map as Q,of as R}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";import{fromFetch as X}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/fetch/+esm";var y=class{constructor({host:i,shop:t,sessionId:e,customerId:r}){this.host=i,this.shop=t,this.customerId=r,this.sessionId=e,this.eventNames=new Map([["viewWishlist","wishlist_viewed"],["addToCart","product_added_to_cart"],["shareWishlist","wishlist_shared"]])}track({eventName:i,wishlist:t,product:e,variant:r,quantity:n,source:a}){var h,c;let o=this.eventNames.get(i);return!o||!t?R(!1):X(this.host+"/notify",{method:"POST",headers:{"content-type":"application/json","x-appmate-shp":this.shop,"x-appmate-sid":this.sessionId,"x-appmate-cid":(c=(h=this.customerId)==null?void 0:h.toString())!=null?c:""},body:JSON.stringify({event:o,wid:t.publicId,pid:e==null?void 0:e.id,vid:r==null?void 0:r.id,qty:n,src:a})}).pipe(Q(()=>!0),$(()=>R(!1)))}getQuerystring(i){if(!i)return"";let t=new URLSearchParams;return Object.entries(i).forEach(([e,r])=>{Array.isArray(r)?r.forEach(n=>t.append(e,n)):r&&t.append(e,r)}),"?"+t.toString()}};import{fromFetch as Y}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/fetch/+esm";import{switchMap as Z}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/operators/+esm";var l=class{constructor(i){this.host=i.host,this.headers={"content-type":"application/json"}}fetch({path:i,method:t="GET",query:e,body:r,headers:n={}}){return Y(this.host+i+this.getQuerystring(e),{method:t,headers:{...this.headers,...n},body:r}).pipe(Z(a=>{if(a.ok)return a.json();throw Error(`Error ${a.status}`)}))}getQuerystring(i){if(!i)return"";let t=new URLSearchParams;return Object.entries(i).forEach(([e,r])=>{Array.isArray(r)?r.forEach(n=>t.append(e,n)):r&&t.append(e,r)}),"?"+t.toString()}get({path:i,query:t,headers:e}){return this.fetch({method:"GET",path:i,query:t,headers:e})}post({path:i,query:t,body:e,headers:r}){return this.fetch({method:"POST",path:i,query:t,body:e?JSON.stringify(e):void 0,headers:r})}put({path:i,query:t,body:e,headers:r}){return this.fetch({method:"PUT",path:i,query:t,body:e?JSON.stringify(e):void 0,headers:r})}delete({path:i,query:t,body:e,headers:r}){return this.fetch({method:"DELETE",path:i,query:t,body:e?JSON.stringify(e):void 0,headers:r})}};var _=class extends l{loadProduct({productHandle:i}){return this.get({path:`/products/${i}.js`})}addToCart(i){return this.post({path:"/cart/add.js",body:i})}};import{forkJoin as tt,lastValueFrom as et,of as it}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var v=class{constructor({settings:i,events:t,notifyHost:e,utils:r,shop:n,sessionId:a,customerId:o}){this.utils=r,this.services=[],i.appmateAnalytics&&this.services.push(new y({host:e,shop:n,customerId:o,sessionId:a})),i.klaviyo&&this.services.push(new f({urlUtil:this.utils.url,moneyUtil:this.utils.money})),i.facebookPixel&&this.services.push(new g({currency:window.Shopify.currency.active})),i.googleAnalytics&&this.services.push(new m);let h=this.utils.route.parse(window.location.pathname).pageType,c=p=>u=>{var W,S,A,x;return et(this.track({eventName:p,source:h,wishlist:(W=u.data)==null?void 0:W.wishlist,product:(S=u.data)==null?void 0:S.product,variant:(A=u.data)==null?void 0:A.variant,quantity:(x=u.data)==null?void 0:x.quantity}))};t.subscribeMany({"wk:wishlist:add-to-cart:success":c("addToCart"),"wk:wishlist:add:success":c("addToWishlist"),"wk:wishlist:change-variant:success":c("changeVariant"),"wk:wishlist:clear:success":c("clearWishlist"),"wk:wishlist:remove:success":c("removeFromWishlist"),"wk:wishlist:share:success":c("shareWishlist"),"wk:wishlist:page-view":c("viewWishlist")})}track(i){return this.services.length?tt(this.services.map(t=>t.track(i))):it([])}};var w=J(C());import{from as I,lastValueFrom as b}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var D="4.15.5";var k=class extends l{constructor(t){var e,r,n;super(t);this.headers={"content-type":"application/json","x-appmate-shp":t.shop,"x-appmate-tkv":D,"x-appmate-sid":t.sessionId,"x-appmate-cid":(r=(e=t.customerId)==null?void 0:e.toString())!=null?r:"","x-appmate-src":(n=t.trackingSource)!=null?n:""},this.wishlistLoader=this.createWishlistLoader(),this.productInfoLoader=this.createProductInfoLoader(),this.wishlistItemLoader=this.createWishlistItemLoader()}createWishlistLoader(){return new w.default(async t=>{let e=t.map(n=>n.split("-")).reduce((n,[a,o])=>(n[a]||(n[a]=[]),n[a].push(o),n),{}),r=await Promise.all(Object.entries(e).map(([n,a])=>b(this.get({path:`/wishlists/${n}`,query:{format:a.includes("all")?"all":"minimal"}})))).then(n=>n.map(a=>a.wishlist));return t.map((n,a)=>{var h;let[o]=n.split("-");return(h=r.find(c=>o==="mine"?c.isMine:c.publicId===o))!=null?h:new Error("Wishlist not found")})},{cache:!0,batchScheduleFn:t=>setTimeout(t,250)})}createProductInfoLoader(){return new w.default(async t=>{let{productInfo:e}=await b(this.get({path:"/wishlists/mine/product-info",headers:{"X-Appmate-IDS":t.join(",")}}));return t.map(r=>{var n;return(n=e.find(a=>a.productId===r))!=null?n:{productId:r,wishlistItems:[]}})},{cache:!0,batchScheduleFn:t=>setTimeout(t,250)})}createWishlistItemLoader(){return new w.default(async t=>{let e=t.map(n=>n.split("-")).reduce((n,[a,o])=>(n[a]||(n[a]=[]),n[a].push(o),n),{}),r=await Promise.all(Object.entries(e).map(([n,a])=>b(this.get({path:`/wishlists/${n}/items`,headers:{"X-Appmate-IDS":a.join(",")}})))).then(n=>n.flatMap(a=>a.items));return t.map(n=>{var o;let[,a]=n.split("-");return(o=r.find(h=>h.id===a))!=null?o:new Error("Wishlist item not found")})},{cache:!0,batchScheduleFn:t=>setTimeout(t,250)})}loadWishlist({wishlistId:t,format:e}){return I(this.wishlistLoader.load([t,e].join("-")).then(r=>({wishlist:r})))}loadProductInfo({productId:t}){return I(this.productInfoLoader.load(t).then(e=>({productInfo:e})))}loadWishlistItem({wishlistId:t,wishlistItemId:e}){return I(this.wishlistItemLoader.load([t,e].join("-")).then(r=>({wishlistItem:r})))}loadWishlistItems({wishlistId:t,wishlistItemIds:e}){return b(this.get({path:`/wishlists/${t}/items`,headers:{"X-Appmate-IDS":e.join(",")}}))}addItem({productId:t,variantId:e}){return typeof t=="string"&&(t=parseInt(t)),typeof e=="string"&&(e=parseInt(e)),this.post({path:"/wishlists/mine/items",body:{productId:t,variantId:e}})}updateItem({wishlistItemId:t,changes:e}){return this.put({path:"/wishlists/mine/items",body:{changes:{...e,wishlistItemId:t}}})}removeItem({wishlistId:t,wishlistItemId:e}){return this.delete({path:`/wishlists/${t}/items`,body:{wishlistItemId:e}})}clearWishlist(){return this.delete({path:"/wishlists/mine"})}};export{m as GoogleAnalytics,f as KlaviyoTracking,g as MetaPixel,y as NotifyApi,l as RestApi,_ as ShopifyApi,v as TrackingApi,k as WishlistApi}; | ||
`+String(e)));T(i);for(var r=0;r<i.callbacks.length;r++){var n=e[r];n instanceof Error?i.callbacks[r].reject(n):i.callbacks[r].resolve(n)}}).catch(function(e){F(s,i,e)})}function F(s,i,t){T(i);for(var e=0;e<i.keys.length;e++)s.clear(i.keys[e]),i.callbacks[e].reject(t)}function T(s){if(s.cacheHits)for(var i=0;i<s.cacheHits.length;i++)s.cacheHits[i]()}function ot(s){var i=!s||s.batch!==!1;if(!i)return 1;var t=s&&s.maxBatchSize;if(t===void 0)return 1/0;if(typeof t!="number"||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}function ct(s){var i=s&&s.batchScheduleFn;if(i===void 0)return st;if(typeof i!="function")throw new TypeError("batchScheduleFn must be a function: "+i);return i}function ht(s){var i=s&&s.cacheKeyFn;if(i===void 0)return function(t){return t};if(typeof i!="function")throw new TypeError("cacheKeyFn must be a function: "+i);return i}function lt(s){var i=!s||s.cache!==!1;if(!i)return null;var t=s&&s.cacheMap;if(t===void 0)return new Map;if(t!==null){var e=["get","set","delete","clear"],r=e.filter(function(n){return t&&typeof t[n]!="function"});if(r.length!==0)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}function N(s){return typeof s=="object"&&s!==null&&typeof s.length=="number"&&(s.length===0||s.length>0&&Object.prototype.hasOwnProperty.call(s,s.length-1))}q.exports=rt});import{of as M}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var{ga:d}=window,m=class{constructor(){this.eventNames=new Map([["addToWishlist","WK Added Product"],["removeFromWishlist","WK Removed Product"],["addToCart","WK Added to Cart"],["shareWishlist","WK Shared Wishlist"],["clearWishlist","WK Cleared Wishlist"]])}track({eventName:i,product:t,variant:e,quantity:r=1}){var a;let n=this.eventNames.get(i);return!n||!(d!=null&&d.loaded)||!t?M(!1):(d("ec:addProduct",{id:(a=(e==null?void 0:e.sku)||(e==null?void 0:e.id))!=null?a:t.id,name:t.title,category:t.type,brand:t.vendor,variant:e==null?void 0:e.title,quantity:r}),d("send",{eventAction:n,hitType:"event",eventCategory:"Wishlist",eventLabel:"Wishlist King"}),M(!0))}};import{of as L}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var f=class{constructor({urlUtil:i,moneyUtil:t}){this.urlUtil=i,this.moneyUtil=t,this.eventNames=new Map([["addToWishlist","Added To Wishlist"],["removeFromWishlist","Removed From Wishlist"],["clearWishlist","Cleared Wishlist"]])}track({eventName:i,wishlist:t,product:e,variant:r,quantity:n=1}){let a=this.eventNames.get(i);return!a||!t||!e?L(!1):(window._learnq||(window._learnq=[]),window._learnq.push(["track",a,{URL:this.urlUtil.getVariantUrl(e.url,r==null?void 0:r.id),Name:e.title,ProductID:e.id,VariantID:r==null?void 0:r.id,SKU:r==null?void 0:r.sku,Tags:e.tags,Brand:e.vendor,ImageURL:this.urlUtil.getImageUrl(e,{width:1e3}),Price:r==null?void 0:r.price,PriceFormatted:r?this.moneyUtil.formatMoney(r.price):null,CompareAtPrice:r==null?void 0:r.compare_at_price,CompareAtPriceFormatted:r!=null&&r.compare_at_price?this.moneyUtil.formatMoney(r.compare_at_price):null,Quantity:n,WishlistUrl:this.urlUtil.getPublicWishlistUrl(t.id)}]),L(!0))}};import{of as j}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var{fbq:U}=window,g=class{constructor({currency:i}){this.currency=i,this.eventNames=new Map([["addToWishlist","AddToWishlist"]])}track({eventName:i,product:t,variant:e}){let r=this.eventNames.get(i);return!r||typeof U!="function"||!t?j(!1):(U("track",r,{value:e==null?void 0:e.price,currency:this.currency,content_ids:[t.id],content_name:[t.title,e==null?void 0:e.title].filter(n=>!!n).join(" - "),content_category:t.type,content_type:"product_group",num_items:1}),j(!0))}};import{catchError as $,map as Q,of as R}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";import{fromFetch as X}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/fetch/+esm";var y=class{constructor({host:i,shop:t,sessionId:e,customerId:r}){this.host=i,this.shop=t,this.customerId=r,this.sessionId=e,this.eventNames=new Map([["viewWishlist","wishlist_viewed"],["addToCart","product_added_to_cart"],["shareWishlist","wishlist_shared"]])}track({eventName:i,wishlist:t,product:e,variant:r,quantity:n,source:a}){var h,c;let o=this.eventNames.get(i);return!o||!t?R(!1):X(this.host+"/notify",{method:"POST",headers:{"content-type":"application/json","x-appmate-shp":this.shop,"x-appmate-sid":this.sessionId,"x-appmate-cid":(c=(h=this.customerId)==null?void 0:h.toString())!=null?c:""},body:JSON.stringify({event:o,wid:t.publicId,pid:e==null?void 0:e.id,vid:r==null?void 0:r.id,qty:n,src:a})}).pipe(Q(()=>!0),$(()=>R(!1)))}getQuerystring(i){if(!i)return"";let t=new URLSearchParams;return Object.entries(i).forEach(([e,r])=>{Array.isArray(r)?r.forEach(n=>t.append(e,n)):r&&t.append(e,r)}),"?"+t.toString()}};import{fromFetch as Y}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/fetch/+esm";import{switchMap as Z}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/operators/+esm";var l=class{constructor(i){this.host=i.host,this.headers={"content-type":"application/json"}}fetch({path:i,method:t="GET",query:e,body:r,headers:n={}}){return Y(this.host+i+this.getQuerystring(e),{method:t,headers:{...this.headers,...n},body:r}).pipe(Z(a=>{if(a.ok)return a.json();throw Error(`Error ${a.status}`)}))}getQuerystring(i){if(!i)return"";let t=new URLSearchParams;return Object.entries(i).forEach(([e,r])=>{Array.isArray(r)?r.forEach(n=>t.append(e,n)):r&&t.append(e,r)}),"?"+t.toString()}get({path:i,query:t,headers:e}){return this.fetch({method:"GET",path:i,query:t,headers:e})}post({path:i,query:t,body:e,headers:r}){return this.fetch({method:"POST",path:i,query:t,body:e?JSON.stringify(e):void 0,headers:r})}put({path:i,query:t,body:e,headers:r}){return this.fetch({method:"PUT",path:i,query:t,body:e?JSON.stringify(e):void 0,headers:r})}delete({path:i,query:t,body:e,headers:r}){return this.fetch({method:"DELETE",path:i,query:t,body:e?JSON.stringify(e):void 0,headers:r})}};var _=class extends l{loadProduct({productHandle:i}){return this.get({path:`/products/${i}.js`})}addToCart(i){return this.post({path:"/cart/add.js",body:i})}};import{forkJoin as tt,lastValueFrom as et,of as it}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var v=class{constructor({settings:i,events:t,notifyHost:e,utils:r,shop:n,sessionId:a,customerId:o}){this.utils=r,this.services=[],i.appmateAnalytics&&this.services.push(new y({host:e,shop:n,customerId:o,sessionId:a})),i.klaviyo&&this.services.push(new f({urlUtil:this.utils.url,moneyUtil:this.utils.money})),i.facebookPixel&&this.services.push(new g({currency:window.Shopify.currency.active})),i.googleAnalytics&&this.services.push(new m);let h=this.utils.route.parse(window.location.pathname).pageType,c=p=>u=>{var W,S,A,x;return et(this.track({eventName:p,source:h,wishlist:(W=u.data)==null?void 0:W.wishlist,product:(S=u.data)==null?void 0:S.product,variant:(A=u.data)==null?void 0:A.variant,quantity:(x=u.data)==null?void 0:x.quantity}))};t.subscribeMany({"wk:wishlist:add-to-cart:success":c("addToCart"),"wk:wishlist:add:success":c("addToWishlist"),"wk:wishlist:change-variant:success":c("changeVariant"),"wk:wishlist:clear:success":c("clearWishlist"),"wk:wishlist:remove:success":c("removeFromWishlist"),"wk:wishlist:share:success":c("shareWishlist"),"wk:wishlist:page-view":c("viewWishlist")})}track(i){return this.services.length?tt(this.services.map(t=>t.track(i))):it([])}};var w=J(C());import{from as I,lastValueFrom as b}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";var D="4.15.6";var k=class extends l{constructor(t){var e,r,n;super(t);this.headers={"content-type":"application/json","x-appmate-shp":t.shop,"x-appmate-tkv":D,"x-appmate-sid":t.sessionId,"x-appmate-cid":(r=(e=t.customerId)==null?void 0:e.toString())!=null?r:"","x-appmate-src":(n=t.trackingSource)!=null?n:""},this.wishlistLoader=this.createWishlistLoader(),this.productInfoLoader=this.createProductInfoLoader(),this.wishlistItemLoader=this.createWishlistItemLoader()}createWishlistLoader(){return new w.default(async t=>{let e=t.map(n=>n.split("-")).reduce((n,[a,o])=>(n[a]||(n[a]=[]),n[a].push(o),n),{}),r=await Promise.all(Object.entries(e).map(([n,a])=>b(this.get({path:`/wishlists/${n}`,query:{format:a.includes("all")?"all":"minimal"}})))).then(n=>n.map(a=>a.wishlist));return t.map((n,a)=>{var h;let[o]=n.split("-");return(h=r.find(c=>o==="mine"?c.isMine:c.publicId===o))!=null?h:new Error("Wishlist not found")})},{cache:!0,batchScheduleFn:t=>setTimeout(t,250)})}createProductInfoLoader(){return new w.default(async t=>{let{productInfo:e}=await b(this.get({path:"/wishlists/mine/product-info",headers:{"X-Appmate-IDS":t.join(",")}}));return t.map(r=>{var n;return(n=e.find(a=>a.productId===r))!=null?n:{productId:r,wishlistItems:[]}})},{cache:!0,batchScheduleFn:t=>setTimeout(t,250)})}createWishlistItemLoader(){return new w.default(async t=>{let e=t.map(n=>n.split("-")).reduce((n,[a,o])=>(n[a]||(n[a]=[]),n[a].push(o),n),{}),r=await Promise.all(Object.entries(e).map(([n,a])=>b(this.get({path:`/wishlists/${n}/items`,headers:{"X-Appmate-IDS":a.join(",")}})))).then(n=>n.flatMap(a=>a.items));return t.map(n=>{var o;let[,a]=n.split("-");return(o=r.find(h=>h.id===a))!=null?o:new Error("Wishlist item not found")})},{cache:!0,batchScheduleFn:t=>setTimeout(t,250)})}loadWishlist({wishlistId:t,format:e}){return I(this.wishlistLoader.load([t,e].join("-")).then(r=>({wishlist:r})))}loadProductInfo({productId:t}){return I(this.productInfoLoader.load(t).then(e=>({productInfo:e})))}loadWishlistItem({wishlistId:t,wishlistItemId:e}){return I(this.wishlistItemLoader.load([t,e].join("-")).then(r=>({wishlistItem:r})))}loadWishlistItems({wishlistId:t,wishlistItemIds:e}){return b(this.get({path:`/wishlists/${t}/items`,headers:{"X-Appmate-IDS":e.join(",")}}))}addItem({productId:t,variantId:e}){return typeof t=="string"&&(t=parseInt(t)),typeof e=="string"&&(e=parseInt(e)),this.post({path:"/wishlists/mine/items",body:{productId:t,variantId:e}})}updateItem({wishlistItemId:t,changes:e}){return this.put({path:"/wishlists/mine/items",body:{changes:{...e,wishlistItemId:t}}})}removeItem({wishlistId:t,wishlistItemId:e}){return this.delete({path:`/wishlists/${t}/items`,body:{wishlistItemId:e}})}clearWishlist(){return this.delete({path:"/wishlists/mine"})}};export{m as GoogleAnalytics,f as KlaviyoTracking,g as MetaPixel,y as NotifyApi,l as RestApi,_ as ShopifyApi,v as TrackingApi,k as WishlistApi}; |
@@ -1,1 +0,1 @@ | ||
var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=(p,s,o,l)=>{for(var t=l>1?void 0:l?h(s,o):s,n=p.length-1,r;n>=0;n--)(r=p[n])&&(t=(l?r(s,o,t):r(t))||t);return l&&t&&f(s,o,t),t};import{LitElement as y}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as m,property as a}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as u}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as c}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import{FloatingUiController as g}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/controllers.js";var e=class extends y{constructor(){super(...arguments);this.text="";this.layout="text-only";this.parentheses=!1;this.hiddenIfEmpty=!1;this.floatingUi=new g(this)}updated(o){o.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var t,n,r;let o={"wk-badge":!0,"wk-parentheses":!!this.parentheses,"wk-pill":(n=(t=this.layout)==null?void 0:t.includes("pill"))!=null?n:!1};if(this.hiddenIfEmpty&&(!this.text||parseInt(this.text)===0))return;let l=(r=this.layout)!=null&&r.includes("text")?this.text:"";return u`<span class=${c(o)}>${l}</span>`}createRenderRoot(){return this}};i([a({type:String})],e.prototype,"text",2),i([a({type:String})],e.prototype,"layout",2),i([a({type:Boolean})],e.prototype,"parentheses",2),i([a({type:Boolean,attribute:"hidden-if-empty"})],e.prototype,"hiddenIfEmpty",2),i([a({type:Object})],e.prototype,"floating",2),e=i([m("wk-badge")],e);export{e as Badge}; | ||
var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=(p,s,o,l)=>{for(var t=l>1?void 0:l?h(s,o):s,n=p.length-1,r;n>=0;n--)(r=p[n])&&(t=(l?r(s,o,t):r(t))||t);return l&&t&&f(s,o,t),t};import{LitElement as y}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as m,property as a}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as u}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as c}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import{FloatingUiController as g}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/controllers.js";var e=class extends y{constructor(){super(...arguments);this.text="";this.layout="text-only";this.parentheses=!1;this.hiddenIfEmpty=!1;this.floatingUi=new g(this)}updated(o){o.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var t,n,r;let o={"wk-badge":!0,"wk-parentheses":!!this.parentheses,"wk-pill":(n=(t=this.layout)==null?void 0:t.includes("pill"))!=null?n:!1};if(this.hiddenIfEmpty&&(!this.text||parseInt(this.text)===0))return;let l=(r=this.layout)!=null&&r.includes("text")?this.text:"";return u`<span class=${c(o)}>${l}</span>`}createRenderRoot(){return this}};i([a({type:String})],e.prototype,"text",2),i([a({type:String})],e.prototype,"layout",2),i([a({type:Boolean})],e.prototype,"parentheses",2),i([a({type:Boolean,attribute:"hidden-if-empty"})],e.prototype,"hiddenIfEmpty",2),i([a({type:Object})],e.prototype,"floating",2),e=i([m("wk-badge")],e);export{e as Badge}; |
@@ -1,14 +0,14 @@ | ||
var y=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var e=(o,n,t,i)=>{for(var a=i>1?void 0:i?m(n,t):n,s=o.length-1,g;s>=0;s--)(g=o[s])&&(a=(i?g(n,t,a):g(a))||a);return i&&a&&y(n,t,a),a};import{LitElement as L}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as T,property as l}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as h}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as c}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";var d=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function b(o,n){return!!(o===n||d(o)&&d(n))}function x(o,n){if(o.length!==n.length)return!1;for(var t=0;t<o.length;t++)if(!b(o[t],n[t]))return!1;return!0}function u(o,n){n===void 0&&(n=x);var t=null;function i(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(t&&t.lastThis===this&&n(a,t.lastArgs))return t.lastResult;var g=o.apply(this,a);return t={lastResult:g,lastArgs:a,lastThis:this},g}return i.clear=function(){t=null},i}import{FloatingUiController as U}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/controllers.js";import{LitElement as S}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as w,property as p}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as $}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as k}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import{FloatingUiController as F}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/controllers.js";var f=class extends S{constructor(){super(...arguments);this.text="";this.layout="text-only";this.parentheses=!1;this.hiddenIfEmpty=!1;this.floatingUi=new F(this)}updated(t){t.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var a,s,g;let t={"wk-badge":!0,"wk-parentheses":!!this.parentheses,"wk-pill":(s=(a=this.layout)==null?void 0:a.includes("pill"))!=null?s:!1};if(this.hiddenIfEmpty&&(!this.text||parseInt(this.text)===0))return;let i=(g=this.layout)!=null&&g.includes("text")?this.text:"";return $`<span class=${k(t)}>${i}</span>`}createRenderRoot(){return this}};e([p({type:String})],f.prototype,"text",2),e([p({type:String})],f.prototype,"layout",2),e([p({type:Boolean})],f.prototype,"parentheses",2),e([p({type:Boolean,attribute:"hidden-if-empty"})],f.prototype,"hiddenIfEmpty",2),e([p({type:Object})],f.prototype,"floating",2),f=e([w("wk-badge")],f);var r=class extends L{constructor(){super(...arguments);this.text="";this.hint="";this.selected=!1;this.disabled=!1;this.layout="icon-and-text";this.outline=!1;this.fullWidth=!1;this.alignment="center";this.badgeParentheses=!1;this.badgeHiddenIfEmpty=!1;this.floatingUi=new U(this);this.getBadgeFloating=u((t,i)=>{if(!(!t||!i))return{...t,reference:i}})}updated(t){t.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var a,s,g;let t=(a=this.alignment)!=null?a:"center",i={"wk-button":!0,"wk-selected":!!this.selected,"wk-outline":!!this.outline,"wk-full-width":!!this.fullWidth,[`wk-align-${t}`]:!0};return this.href?h` | ||
var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=(o,i,e,n)=>{for(var a=n>1?void 0:n?p(i,e):i,s=o.length-1,g;s>=0;s--)(g=o[s])&&(a=(n?g(i,e,a):g(a))||a);return n&&a&&c(i,e,a),a};import{LitElement as m}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as x,property as l}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as d}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as u}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";var f=Number.isNaN||function(i){return typeof i=="number"&&i!==i};function b(o,i){return!!(o===i||f(o)&&f(i))}function y(o,i){if(o.length!==i.length)return!1;for(var e=0;e<o.length;e++)if(!b(o[e],i[e]))return!1;return!0}function h(o,i){i===void 0&&(i=y);var e=null;function n(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(e&&e.lastThis===this&&i(a,e.lastArgs))return e.lastResult;var g=o.apply(this,a);return e={lastResult:g,lastArgs:a,lastThis:this},g}return n.clear=function(){e=null},n}import{FloatingUiController as $}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/controllers.js";import"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/components/badge.js";import"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/components/icon.js";var t=class extends m{constructor(){super(...arguments);this.text="";this.hint="";this.selected=!1;this.disabled=!1;this.layout="icon-and-text";this.outline=!1;this.fullWidth=!1;this.alignment="center";this.badgeParentheses=!1;this.badgeHiddenIfEmpty=!1;this.floatingUi=new $(this);this.getBadgeFloating=h((e,n)=>{if(!(!e||!n))return{...e,reference:n}})}updated(e){e.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var a,s,g;let e=(a=this.alignment)!=null?a:"center",n={"wk-button":!0,"wk-selected":!!this.selected,"wk-outline":!!this.outline,"wk-full-width":!!this.fullWidth,[`wk-align-${e}`]:!0};return this.href?d` | ||
<a | ||
href=${this.href} | ||
aria-label=${(s=this.hint)!=null?s:""} | ||
class=${c(i)} | ||
class=${u(n)} | ||
> | ||
${this.renderIcon()}${this.renderText()}${this.renderBadge()} | ||
</a> | ||
`:h` | ||
`:d` | ||
<button | ||
type="button" | ||
aria-label=${(g=this.hint)!=null?g:""} | ||
class=${c(i)} | ||
class=${u(n)} | ||
?disabled=${this.disabled} | ||
@@ -18,3 +18,3 @@ > | ||
</button> | ||
`}renderIcon(){var i;let t=(i=this.layout)!=null?i:"icon-and-text";if(!(!(t!=null&&t.includes("icon"))||!this.icon))return h`<wk-icon icon=${this.icon} class="wk-icon"></wk-icon>`}renderText(){var i;let t=(i=this.layout)!=null?i:"icon-and-text";if(!!(t!=null&&t.includes("text")))return h`<span class="wk-text">${this.text}</span>`}renderBadge(){if(!(!this.badgeLayout||this.badgeText===void 0))return h`<wk-badge | ||
`}renderIcon(){var n;let e=(n=this.layout)!=null?n:"icon-and-text";if(!(!(e!=null&&e.includes("icon"))||!this.icon))return d`<wk-icon icon=${this.icon} class="wk-icon"></wk-icon>`}renderText(){var n;let e=(n=this.layout)!=null?n:"icon-and-text";if(!!(e!=null&&e.includes("text")))return d`<span class="wk-text">${this.text}</span>`}renderBadge(){if(!(!this.badgeLayout||this.badgeText===void 0))return d`<wk-badge | ||
.text=${this.badgeText} | ||
@@ -25,2 +25,2 @@ .layout=${this.badgeLayout} | ||
.floating=${this.getBadgeFloating(this.badgeFloating,this)} | ||
></wk-badge>`}createRenderRoot(){return this}};e([l({type:String})],r.prototype,"href",2),e([l({type:String})],r.prototype,"text",2),e([l({type:String})],r.prototype,"hint",2),e([l({type:Boolean})],r.prototype,"selected",2),e([l({type:Boolean})],r.prototype,"disabled",2),e([l({type:String})],r.prototype,"layout",2),e([l({type:String})],r.prototype,"icon",2),e([l({type:Boolean})],r.prototype,"outline",2),e([l({type:Boolean,attribute:"full-width"})],r.prototype,"fullWidth",2),e([l({type:String})],r.prototype,"alignment",2),e([l({type:Object})],r.prototype,"floating",2),e([l({type:String,attribute:"badge-text"})],r.prototype,"badgeText",2),e([l({type:String,attribute:"badge-layout"})],r.prototype,"badgeLayout",2),e([l({type:Boolean,attribute:"badge-parentheses"})],r.prototype,"badgeParentheses",2),e([l({type:Boolean,attribute:"badge-hidden-if-empty"})],r.prototype,"badgeHiddenIfEmpty",2),e([l({type:Object,attribute:"badge-floating"})],r.prototype,"badgeFloating",2),r=e([T("wk-button")],r);export{r as Button}; | ||
></wk-badge>`}createRenderRoot(){return this}};r([l({type:String})],t.prototype,"href",2),r([l({type:String})],t.prototype,"text",2),r([l({type:String})],t.prototype,"hint",2),r([l({type:Boolean})],t.prototype,"selected",2),r([l({type:Boolean})],t.prototype,"disabled",2),r([l({type:String})],t.prototype,"layout",2),r([l({type:String})],t.prototype,"icon",2),r([l({type:Boolean})],t.prototype,"outline",2),r([l({type:Boolean,attribute:"full-width"})],t.prototype,"fullWidth",2),r([l({type:String})],t.prototype,"alignment",2),r([l({type:Object})],t.prototype,"floating",2),r([l({type:String,attribute:"badge-text"})],t.prototype,"badgeText",2),r([l({type:String,attribute:"badge-layout"})],t.prototype,"badgeLayout",2),r([l({type:Boolean,attribute:"badge-parentheses"})],t.prototype,"badgeParentheses",2),r([l({type:Boolean,attribute:"badge-hidden-if-empty"})],t.prototype,"badgeHiddenIfEmpty",2),r([l({type:Object,attribute:"badge-floating"})],t.prototype,"badgeFloating",2),t=r([x("wk-button")],t);export{t as Button}; |
@@ -1,2 +0,2 @@ | ||
var p=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var r=(a,n,t,i)=>{for(var o=i>1?void 0:i?c(n,t):n,s=a.length-1,d;s>=0;s--)(d=a[s])&&(o=(i?d(n,t,o):d(o))||o);return i&&o&&p(n,t,o),o};import{LitElement as f,css as u}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as w,state as m,property as l}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as v}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as g}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import{FloatingUiController as x}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/controllers.js";var e=class extends f{constructor(){super(...arguments);this.text="";this.autoShow=!1;this.autoHide=!1;this.floatingUi=new x(this)}get added(){return!!this.parentElement}get showing(){return this.transition==="show"}get hiding(){return this.transition==="hide"}updated(t){t.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var i;let t={"wk-popover":!0,"wk-show":this.transition==="show","wk-hide":this.transition==="hide"};return this.elementClass&&(t[this.elementClass]=!0),v` | ||
var p=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var r=(a,n,t,i)=>{for(var o=i>1?void 0:i?c(n,t):n,s=a.length-1,d;s>=0;s--)(d=a[s])&&(o=(i?d(n,t,o):d(o))||o);return i&&o&&p(n,t,o),o};import{LitElement as f,css as u}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as w,state as m,property as l}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as v}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as g}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import{FloatingUiController as x}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/controllers.js";var e=class extends f{constructor(){super(...arguments);this.text="";this.autoShow=!1;this.autoHide=!1;this.floatingUi=new x(this)}get added(){return!!this.parentElement}get showing(){return this.transition==="show"}get hiding(){return this.transition==="hide"}updated(t){t.has("floating")&&(this.floating?this.floatingUi.float(this.floating):this.floatingUi.destroy())}render(){var i;let t={"wk-popover":!0,"wk-show":this.transition==="show","wk-hide":this.transition==="hide"};return this.elementClass&&(t[this.elementClass]=!0),v` | ||
<div class=${g(t)}> | ||
@@ -3,0 +3,0 @@ <div class="wk-text">${this.getText()}</div> |
@@ -1,2 +0,2 @@ | ||
var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var n=(a,o,t,e)=>{for(var r=e>1?void 0:e?g(o,t):o,l=a.length-1,d;l>=0;l--)(d=a[l])&&(r=(e?d(o,t,r):d(r))||r);return e&&r&&m(o,t,r),r};import{LitElement as w}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as v,property as c}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as b}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as $}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import M from"https://cdn.jsdelivr.net/npm/short-unique-id@4.4.4/+esm";import{LitElement as h}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as u,property as f}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{svg as k,html as p}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/static/+esm";var i=class extends h{constructor(){super(...arguments);this.icon=""}static setIcons(t){i.icons=t}static addIcons(t){Object.assign(i.icons,t)}static removeIcons(t){Object.entries(i.icons).filter(([e])=>!t.includes(e))}render(){var e;if(!this.icon)return p`<!-- icon not defined -->`;let t=(e=i.icons[this.icon])!=null?e:p`<!-- icon not found -->`;return k`${t}`}createRenderRoot(){return this}};i.icons={},n([f({type:String})],i.prototype,"icon",2),i=n([u("wk-icon")],i);var x=new M({length:10}),s=class extends w{constructor(){super();this.icon="caret";this.label="";this.text="";this.name="";this.options=[];this.inputId=`wk-select-${x()}`}connectedCallback(){super.connectedCallback();for(let t of this.children)t instanceof HTMLOptionElement&&this.options.push(t);this.innerHTML=""}render(){let t=$({"wk-select":!0,"wk-single-option":this.options.length===1});return b` | ||
var p=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var n=(l,s,t,o)=>{for(var i=o>1?void 0:o?d(s,t):s,c=l.length-1,a;c>=0;c--)(a=l[c])&&(i=(o?a(s,t,i):a(i))||i);return o&&i&&p(s,t,i),i};import{LitElement as m}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as h,property as r}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as u}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as g}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import k from"https://cdn.jsdelivr.net/npm/short-unique-id@4.4.4/+esm";import{Icon as w}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/components/icon.js";var f=new k({length:10}),e=class extends m{constructor(){super();this.icon="caret";this.label="";this.text="";this.name="";this.options=[];this.inputId=`wk-select-${f()}`}connectedCallback(){super.connectedCallback();for(let t of this.children)t instanceof HTMLOptionElement&&this.options.push(t);this.innerHTML=""}render(){let t=g({"wk-select":!0,"wk-single-option":this.options.length===1});return u` | ||
<div class=${t}> | ||
@@ -14,6 +14,6 @@ <label class="wk-label" for=${this.inputId}>${this.label}</label> | ||
</div> | ||
`}createRenderRoot(){return this}};n([c({type:String})],s.prototype,"icon",2),n([c({type:String})],s.prototype,"label",2),n([c({type:String})],s.prototype,"text",2),n([c({type:String})],s.prototype,"name",2),s=n([v("wk-select")],s);i.addIcons({caret:` | ||
`}createRenderRoot(){return this}};n([r({type:String})],e.prototype,"icon",2),n([r({type:String})],e.prototype,"label",2),n([r({type:String})],e.prototype,"text",2),n([r({type:String})],e.prototype,"name",2),e=n([h("wk-select")],e);w.addIcons({caret:` | ||
<svg aria-hidden="true" focusable="false" role="presentation" viewBox="0 0 24 24"> | ||
<path d="M6 9l6 6 6-6" /> | ||
</svg> | ||
`});export{s as Select}; | ||
`});export{e as Select}; |
@@ -1,27 +0,10 @@ | ||
var h=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var e=(a,o,s,l)=>{for(var r=l>1?void 0:l?u(o,s):o,d=a.length-1,p;d>=0;d--)(p=a[d])&&(r=(l?p(o,s,r):p(r))||r);return l&&r&&h(o,s,r),r};import{LitElement as $}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{html as I}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{customElement as v,property as m}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{classMap as L}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import M from"https://cdn.jsdelivr.net/npm/short-unique-id@4.4.4/+esm";import{LitElement as g}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{customElement as f,property as i}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{html as c}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{classMap as b}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import{styleMap as k}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/style-map/+esm";import y from"https://cdn.jsdelivr.net/npm/short-unique-id@4.4.4/+esm";var w=new y({length:10}),t=class extends g{constructor(){super();this.label="";this.name="";this.value="";this.selected=!1;this.disabled=!1;this.unavailable=!1;this.inputId=`wk-swatches-${w()}`}render(){let s=b({"wk-swatch":!0,"wk-disabled":this.disabled||this.unavailable,"wk-selected":this.selected,"wk-has-color":!!this.color,"wk-has-image":!!this.image});return c` | ||
<div class=${s}> | ||
${this.renderLabel()} | ||
<input | ||
id=${this.inputId} | ||
class="wk-radio" | ||
type="radio" | ||
?checked=${this.selected} | ||
?disabled=${this.disabled} | ||
value=${this.value} | ||
name=${this.name} | ||
/> | ||
</div> | ||
`}renderLabel(){let s={backgroundColor:this.color?this.color:void 0,backgroundImage:this.image?`url(${this.image})`:void 0};return c` | ||
<label class="wk-label" style=${k(s)} for=${this.inputId} | ||
>${this.label}</label | ||
> | ||
`}createRenderRoot(){return this}};e([i({type:String})],t.prototype,"label",2),e([i({type:String})],t.prototype,"name",2),e([i({type:String})],t.prototype,"value",2),e([i({type:Boolean})],t.prototype,"selected",2),e([i({type:Boolean})],t.prototype,"disabled",2),e([i({type:Boolean})],t.prototype,"unavailable",2),e([i({type:String})],t.prototype,"image",2),e([i({type:String})],t.prototype,"color",2),t=e([f("wk-swatch")],t);var x=new M({length:10}),n=class extends ${constructor(){super();this.label="";this.name="";this.options=[];this.inputId=`wk-swatch-${x()}`}connectedCallback(){super.connectedCallback();for(let s of this.children)s instanceof t&&this.options.push(s);this.innerHTML=""}render(){let s=L({"wk-swatches":!0,"wk-single-option":this.options.length===1});return I` | ||
<div class=${s}> | ||
var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var o=(r,n,t,s)=>{for(var e=s>1?void 0:s?m(n,t):n,l=r.length-1,a;l>=0;l--)(a=r[l])&&(e=(s?a(n,t,e):a(e))||e);return s&&e&&p(n,t,e),e};import{LitElement as d}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{html as h}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{customElement as f,property as c}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{classMap as u}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/directives/class-map/+esm";import g from"https://cdn.jsdelivr.net/npm/short-unique-id@4.4.4/+esm";import{Swatch as w}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/components/swatch.js";var k=new g({length:10}),i=class extends d{constructor(){super();this.label="";this.name="";this.options=[];this.inputId=`wk-swatch-${k()}`}connectedCallback(){super.connectedCallback();for(let t of this.children)t instanceof w&&this.options.push(t);this.innerHTML=""}render(){let t=u({"wk-swatches":!0,"wk-single-option":this.options.length===1});return h` | ||
<div class=${t}> | ||
<fieldset class="wk-fieldset"> | ||
<label class="wk-label" for=${this.inputId}>${this.label}</label> | ||
<div class="wk-options"> | ||
${this.options.map(l=>Object.assign(l,{name:this.name}))} | ||
${this.options.map(s=>Object.assign(s,{name:this.name}))} | ||
</div> | ||
</fieldset> | ||
</div> | ||
`}createRenderRoot(){return this}};e([m({type:String})],n.prototype,"label",2),e([m({type:String})],n.prototype,"name",2),n=e([v("wk-swatches")],n);export{n as Swatches}; | ||
`}createRenderRoot(){return this}};o([c({type:String})],i.prototype,"label",2),o([c({type:String})],i.prototype,"name",2),i=o([f("wk-swatches")],i);export{i as Swatches}; |
@@ -12,2 +12,2 @@ var V=class{constructor(t){this.mapWishlistState=(t,i="minimal")=>{var r;return{id:t.id,public_id:t.publicId,is_mine:t.isMine,num_items:t.numItems,items:i==="all"?(r=t.items)==null?void 0:r.map(s=>({id:s.id})):void 0}};this.mapProductInfo=t=>({product_id:t.productId,variant_id:t.variantId,in_wishlist:t.inWishlist,wishlist_item_id:t.wishlistItemId});this.mapWishlistItem=t=>{var i,r,s,n;return{id:t.id,loading:!((i=t.product)!=null&&i.url)&&!((r=t.product)!=null&&r.hidden),hidden:!!((s=t.product)!=null&&s.hidden),selected_variant_id:t.selectedVariantId,product:(n=t.product)!=null&&n.url?this.mapShopifyProduct(t):t.product}};this.utils=t.utils}mapShopifyProduct(t){var o;let i=t.product,r=this.utils.product.getFirstAvailableVariant({product:i}),s=this.utils.product.getSelectedVariant({product:i,selectedVariantId:t.selectedVariantId}),n=(o=s!=null?s:r)!=null?o:i.variants[0];return{...i,selected_variant:s,first_available_variant:r,selected_or_first_available_variant:n,has_only_default_variant:i.variants.length===1}}camelToSnakeCase(t){return t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`)}objectToSnakeCase(t){return typeof t!="object"?t:Object.fromEntries(Object.entries(t).map(([i,r])=>{if(typeof r=="function")return[i,null];let s=this.camelToSnakeCase(i);return Array.isArray(r)?[s,r.map(n=>this.objectToSnakeCase(n))]:r&&typeof r=="object"?[s,this.objectToSnakeCase(r)]:[s,r]}))}};var X=function(){return X=Object.assign||function(t){for(var i,r=1,s=arguments.length;r<s;r++){i=arguments[r];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},X.apply(this,arguments)};function F(e,t,i,r){function s(n){return n instanceof i?n:new i(function(o){o(n)})}return new(i||(i=Promise))(function(n,o){function l(d){try{u(r.next(d))}catch(y){o(y)}}function a(d){try{u(r.throw(d))}catch(y){o(y)}}function u(d){d.done?n(d.value):s(d.value).then(l,a)}u((r=r.apply(e,t||[])).next())})}var x=class{liquidMethodMissing(t){}},At=Object.prototype.toString,tt=String.prototype.toLowerCase,ft=Object.hasOwnProperty;function L(e){return typeof e=="string"}function q(e){return typeof e=="function"}function Mt(e){return e&&q(e.then)}function K(e){return e&&q(e.next)&&q(e.throw)&&q(e.return)}function Ct(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function c(e){return e=h(e),L(e)?e:I(e)?"":T(e)?e.map(t=>c(t)).join(""):String(e)}function h(e){return e instanceof x&&q(e.valueOf)?e.valueOf():e}function De(e){return typeof e=="number"}function gt(e){return e&&q(e.toLiquid)?gt(e.toLiquid()):e}function I(e){return e==null}function T(e){return At.call(e)==="[object Array]"}function $t(e){return Ve(e)&&Symbol.iterator in e}function le(e,t){e=e||{};for(let i in e)if(ft.call(e,i)&&t(e[i],i,e)===!1)break;return e}function We(e){return e[e.length-1]}function Ve(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function mt(e,t,i=1){let r=[];for(let s=e;s<t;s+=i)r.push(s);return r}function ee(e,t,i=" "){return wt(e,t,i,(r,s)=>s+r)}function Ut(e,t,i=" "){return wt(e,t,i,(r,s)=>r+s)}function wt(e,t,i,r){e=String(e);let s=t-e.length;for(;s-- >0;)e=r(e,i);return e}function yt(e){return e}function ue(e){return e.replace(/(\w?)([A-Z])/g,(t,i,r)=>(i?i+"_":"")+r.toLowerCase())}function zt(e){return[...e].some(i=>i>="a"&&i<="z")?e.toUpperCase():e.toLowerCase()}function Dt(e,t){return e.length>t?e.slice(0,t-3)+"...":e}function it(e,t){return e==null&&t==null?0:e==null?1:t==null||(e=tt.call(e),t=tt.call(t),e<t)?-1:e>t?1:0}function v(e){return(...t)=>e(...t.map(h))}function Be(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var B=class{constructor(t,i,r,s){this.key=t,this.value=i,this.next=r,this.prev=s}},te=class{constructor(t,i=0){this.limit=t,this.size=i,this.cache={},this.head=new B("HEAD",null,null,null),this.tail=new B("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(t,i){if(this.cache[t])this.cache[t].value=i;else{let r=new B(t,i,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[t]=r,this.size++,this.ensureLimit()}}read(t){if(!this.cache[t])return;let{value:i}=this.cache[t];return this.remove(t),this.write(t,i),i}remove(t){let i=this.cache[t];i.prev.next=i.next,i.next.prev=i.prev,delete this.cache[t],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}};function Tt(e,t){let i=document.createElement("base");i.href=e;let r=document.getElementsByTagName("head")[0];r.insertBefore(i,r.firstChild);let s=document.createElement("a");s.href=t;let n=s.href;return r.removeChild(i),n}function Wt(e,t,i){return e.length&&We(e)!=="/"&&(e+="/"),Tt(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,(s,n,o)=>{let l=o.split("/").pop();return/\.\w+$/.test(l)?s:n+o+i})}function Vt(e){return F(this,void 0,void 0,function*(){return new Promise((t,i)=>{let r=new XMLHttpRequest;r.onload=()=>{r.status>=200&&r.status<300?t(r.responseText):i(new Error(r.statusText))},r.onerror=()=>{i(new Error("An error occurred whilst receiving the response."))},r.open("GET",e),r.send()})})}function Bt(e){let t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||t.status>=300)throw new Error(t.statusText);return t.responseText}function jt(e){return F(this,void 0,void 0,function*(){return!0})}function Ht(e){return!0}function Qt(e){return Tt(e,".")}var Yt="/",Jt=Object.freeze({__proto__:null,resolve:Wt,readFile:Vt,readFileSync:Bt,exists:jt,existsSync:Ht,dirname:Qt,sep:Yt});function b(e){return e&&q(e.equals)}function N(e,t){return!je(e,t)}function je(e,t){return t.opts.jsTruthy?!e:e===!1||e===void 0||e===null}var rt={"==":(e,t)=>b(e)?e.equals(t):b(t)?t.equals(e):h(e)===h(t),"!=":(e,t)=>b(e)?!e.equals(t):b(t)?!t.equals(e):h(e)!==h(t),">":(e,t)=>b(e)?e.gt(t):b(t)?t.lt(e):h(e)>h(t),"<":(e,t)=>b(e)?e.lt(t):b(t)?t.gt(e):h(e)<h(t),">=":(e,t)=>b(e)?e.geq(t):b(t)?t.leq(e):h(e)>=h(t),"<=":(e,t)=>b(e)?e.leq(t):b(t)?t.geq(e):h(e)<=h(t),contains:(e,t)=>(e=h(e),t=h(t),e&&q(e.indexOf)?e.indexOf(t)>-1:!1),and:(e,t,i)=>N(h(e),i)&&N(h(t),i),or:(e,t,i)=>N(h(e),i)||N(h(t),i)},p=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],He=1,ae=4,st=8,bt=16,Gt=32,Zt=64;p[160]=p[5760]=p[6158]=p[8192]=p[8193]=p[8194]=p[8195]=p[8196]=p[8197]=p[8198]=p[8199]=p[8200]=p[8201]=p[8202]=p[8232]=p[8233]=p[8239]=p[8287]=p[12288]=ae;function _t(e){let t={};for(let[i,r]of Object.entries(e)){let s=t;for(let n=0;n<i.length;n++){let o=i[n];s[o]=s[o]||{},n===i.length-1&&p[i.charCodeAt(n)]&He&&(s[o].needBoundary=!0),s=s[o]}s.handler=r,s.end=!0}return t}var Xt={"&":"&","<":"<",">":">",'"':""","'":"'"},Kt={"&":"&","<":"<",">":">",""":'"',"'":"'"};function vt(e){return c(e).replace(/&|<|>|"|'/g,t=>Xt[t])}function ei(e){return c(e).replace(/&(amp|lt|gt|#34|#39);/g,t=>Kt[t])}function ti(e){return vt(ei(c(e)))}function ii(e){return c(e).replace(/\n/g,`<br /> | ||
`&&e.trimLeft++}var ye=class extends _{constructor(t,i){super(f.Number,t.input,t.begin,i?i.end:t.end,t.file),this.whole=t,this.decimal=i}},U=class extends _{constructor(t,i,r,s){super(f.Word,t,i,r,s),this.input=t,this.begin=i,this.end=r,this.file=s,this.content=this.getText()}isNumber(t=!1){let i=t&&p[this.input.charCodeAt(this.begin)]&Zt?this.begin+1:this.begin;for(let r=i;r<this.end;r++)if(!(p[this.input.charCodeAt(r)]&Gt))return!1;return!0}},Te=class extends _{constructor(t,i,r,s){super(f.Literal,t,i,r,s),this.input=t,this.begin=i,this.end=r,this.file=s,this.literal=this.getText()}},ht={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},be=class extends _{constructor(t,i,r,s){super(f.Operator,t,i,r,s),this.input=t,this.begin=i,this.end=r,this.file=s,this.operator=this.getText()}getPrecedence(){let t=this.getText();return t in ht?ht[t]:1}},re=class extends _{constructor(t,i,r){super(f.PropertyAccess,t.input,t.begin,r,t.file),this.variable=t,this.props=i,this.propertyName=this.variable instanceof U?this.variable.getText():Pt(this.variable.getText())}},_e=class extends _{constructor(t,i,r,s,n,o){super(f.Filter,r,s,n,o),this.name=t,this.args=i}},ve=class extends _{constructor(t,i,r,s,n,o){super(f.Hash,t,i,r,o),this.input=t,this.begin=i,this.end=r,this.name=s,this.value=n,this.file=o}},qe=class extends _{constructor(t,i,r,s){super(f.Quoted,t,i,r,s),this.input=t,this.begin=i,this.end=r,this.file=s}},se=class extends _{constructor(t,i,r,s){super(f.HTML,t,i,r,s),this.input=t,this.begin=i,this.end=r,this.file=s,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}},ke=class extends _{constructor(t,i,r,s,n,o){super(f.Range,t,i,r,o),this.input=t,this.begin=i,this.end=r,this.lhs=s,this.rhs=n,this.file=o}},Se=class extends Q{constructor(t,i,r,s,n){let{trimOutputLeft:o,trimOutputRight:l,outputDelimiterLeft:a,outputDelimiterRight:u}=s,d=t.slice(i+a.length,r-u.length);super(f.Output,d,t,i,r,o,l,n)}};function xr(e,t,i,r=e.length){let s=i,n=t,o;for(;s[e[n]]&&n<r;)s=s[e[n++]],s.end&&(o=s);return!o||o.needBoundary&&p[e.charCodeAt(n)]&He?-1:n}var Le=class extends Q{constructor(t,i,r,s,n){let o=t.slice(i,r);if(super(f.Tag,o,t,i,r,!1,!1,n),!/\S/.test(o))this.name="",this.args="";else{let l=new m(this.content,s.operatorsTrie);if(this.name=l.readTagName(),!this.name)throw new H("illegal liquid tag syntax",this);l.skipBlank(),this.args=l.remaining()}}},m=class{constructor(t,i=E.operatorsTrie,r=""){this.input=t,this.trie=i,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=t.length}readExpression(){return new we(this.readExpressionTokens())}*readExpressionTokens(){let t=this.readValue();if(!!t)for(yield t;this.p<this.N;){let i=this.readOperator();if(!i)return;let r=this.readValue();if(!r)return;yield i,yield r}}readOperator(){this.skipBlank();let t=xr(this.input,this.p,this.trie);if(t!==-1)return new be(this.input,this.p,this.p=t,this.file)}readFilters(){let t=[];for(;;){let i=this.readFilter();if(!i)return t;t.push(i)}}readFilter(){if(this.skipBlank(),this.end())return null;g(this.peek()==="|",()=>`unexpected token at ${this.snapshot()}`),this.p++;let t=this.p,i=this.readIdentifier();if(!i.size())return null;let r=[];if(this.skipBlank(),this.peek()===":")do{++this.p;let s=this.readFilterArg();s&&r.push(s),this.skipBlank(),g(this.end()||this.peek()===","||this.peek()==="|",()=>`unexpected character ${this.snapshot()}`)}while(this.peek()===",");return new _e(i.getText(),r,this.input,t,this.p,this.file)}readFilterArg(){let t=this.readValue();if(!t)return;if(this.skipBlank(),this.peek()!==":")return t;++this.p;let i=this.readValue();return[t.getText(),i]}readTopLevelTokens(t=E){let i=[];for(;this.p<this.N;){let r=this.readTopLevelToken(t);i.push(r)}return Fr(i,t),i}readTopLevelToken(t){let{tagDelimiterLeft:i,outputDelimiterLeft:r}=t;return this.rawBeginAt>-1?this.readEndrawOrRawContent(t):this.match(i)?this.readTagToken(t):this.match(r)?this.readOutputToken(t):this.readHTMLToken([i,r])}readHTMLToken(t){let i=this.p;for(;this.p<this.N&&!t.some(r=>this.match(r));)++this.p;return new se(this.input,i,this.p,this.file)}readTagToken(t=E){let{file:i,input:r}=this,s=this.p;if(this.readToDelimiter(t.tagDelimiterRight)===-1)throw this.mkError(`tag ${this.snapshot(s)} not closed`,s);let n=new ne(r,s,this.p,t,i);return n.name==="raw"&&(this.rawBeginAt=s),n}readToDelimiter(t){for(;this.p<this.N;){if(this.peekType()&st){this.readQuoted();continue}if(++this.p,this.rmatch(t))return this.p}return-1}readOutputToken(t=E){let{file:i,input:r}=this,{outputDelimiterRight:s}=t,n=this.p;if(this.readToDelimiter(s)===-1)throw this.mkError(`output ${this.snapshot(n)} not closed`,n);return new Se(r,n,this.p,t,i)}readEndrawOrRawContent(t){let{tagDelimiterLeft:i,tagDelimiterRight:r}=t,s=this.p,n=this.readTo(i)-i.length;for(;this.p<this.N;){if(this.readIdentifier().getText()!=="endraw"){n=this.readTo(i)-i.length;continue}for(;this.p<=this.N;){if(this.rmatch(r)){let o=this.p;return s===n?(this.rawBeginAt=-1,new ne(this.input,s,o,t,this.file)):(this.p=n,new se(this.input,s,n,this.file))}if(this.rmatch(i))break;this.p++}}throw this.mkError(`raw ${this.snapshot(this.rawBeginAt)} not closed`,s)}readLiquidTagTokens(t=E){let i=[];for(;this.p<this.N;){let r=this.readLiquidTagToken(t);r.name&&i.push(r)}return i}readLiquidTagToken(t){let{file:i,input:r}=this,s=this.p,n=this.N;return this.readToDelimiter(` | ||
`)!==-1&&(n=this.p),new Le(r,s,n,t,i)}mkError(t,i){return new H(t,new U(this.input,i,this.N,this.file))}snapshot(t=this.p){return JSON.stringify(Dt(this.input.slice(t),16))}readWord(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()}readIdentifier(){this.skipBlank();let t=this.p;for(;this.peekType()&He;)++this.p;return new U(this.input,t,this.p,this.file)}readTagName(){return this.skipBlank(),this.input[this.p]==="#"?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){let i=[];for(;;){let r=this.readHash(t);if(!r)return i;i.push(r)}}readHash(t){this.skipBlank(),this.peek()===","&&++this.p;let i=this.p,r=this.readIdentifier();if(!r.size())return;let s;this.skipBlank();let n=t?"=":":";return this.peek()===n&&(++this.p,s=this.readValue()),new ve(this.input,i,this.p,r,s,this.file)}remaining(){return this.input.slice(this.p)}advance(t=1){this.p+=t}end(){return this.p>=this.N}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){let t=this.readQuoted()||this.readRange();if(t)return t;if(this.peek()==="["){this.p++;let n=this.readQuoted();return!n||this.peek()!=="]"?void 0:(this.p++,new re(n,[],this.p))}let i=this.readIdentifier();if(!i.size())return;let r=i.isNumber(!0),s=[];for(;;)if(this.peek()==="["){r=!1,this.p++;let n=this.readValue()||new U(this.input,this.p,this.p,this.file);this.readTo("]"),s.push(n)}else if(this.peek()==="."&&this.peek(1)!=="."){this.p++;let n=this.readIdentifier();if(!n.size())break;n.isNumber()||(r=!1),s.push(n)}else break;return!s.length&&xt.hasOwnProperty(i.content)?new Te(this.input,i.begin,i.end,this.file):r?new ye(i,s[0]):new re(i,s,this.p)}readRange(){this.skipBlank();let t=this.p;if(this.peek()!=="(")return;++this.p;let i=this.readValueOrThrow();this.p+=2;let r=this.readValueOrThrow();return++this.p,new ke(this.input,t,this.p,i,r,this.file)}readValueOrThrow(){let t=this.readValue();return g(t,()=>`unexpected token ${this.snapshot()}, value expected`),t}readQuoted(){this.skipBlank();let t=this.p;if(!(this.peekType()&st))return;++this.p;let i=!1;for(;this.p<this.N&&(++this.p,!(this.input[this.p-1]===this.input[t]&&!i));)i?i=!1:this.input[this.p-1]==="\\"&&(i=!0);return new qe(this.input,t,this.p,this.file)}*readFileNameTemplate(t){let{outputDelimiterLeft:i}=t,r=[","," ",i],s=new Set(r);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(i)?this.readOutputToken(t):this.readHTMLToken(r)}match(t){for(let i=0;i<t.length;i++)if(t[i]!==this.input[this.p+i])return!1;return!0}rmatch(t){for(let i=0;i<t.length;i++)if(t[t.length-1-i]!==this.input[this.p-1-i])return!1;return!0}peekType(t=0){return p[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.input[this.p+t]}skipBlank(){for(;this.peekType()&ae;)++this.p}},ne=class extends Q{constructor(t,i,r,s,n){let{trimTagLeft:o,trimTagRight:l,tagDelimiterLeft:a,tagDelimiterRight:u}=s,d=t.slice(i+a.length,r-u.length);super(f.Tag,d,t,i,r,o,l,n);let y=new m(this.content,s.operatorsTrie);if(this.name=y.readTagName(),!this.name)throw new H("illegal tag syntax",this);y.skipBlank(),this.args=y.remaining()}},Fe=class{constructor(t,i){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=i}on(t,i){return this.handlers[t]=i,this}trigger(t,i){let r=this.handlers[t];return r?(r.call(this,i),!0):!1}start(){this.trigger("start");let t;for(;!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t)||Je(t)&&this.trigger(`tag:${t.name}`,t))continue;let i=this.parseToken(t,this.tokens);this.trigger("template",i)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}},P=class{constructor(t,i){this.hash={};let r=new m(t,{});for(let s of r.readHashes(i))this.hash[s.name.content]=s.value}*render(t){let i={};for(let r of Object.keys(this.hash))i[r]=this.hash[r]===void 0?!0:yield w(this.hash[r],t);return i}};function Pr(e){return T(e)}var Y=class{constructor(t,i,r,s){this.name=t,this.impl=i||yt,this.args=r,this.liquid=s}*render(t,i){let r=[];for(let s of this.args)Pr(s)?r.push([s[0],yield w(s[1],i)]):r.push(yield w(s,i));return this.impl.apply({context:i,liquid:this.liquid},[t,...r])}},k=class{constructor(t,i){this.filters=[];let r=new m(t,i.options.operatorsTrie);this.initial=r.readExpression(),this.filters=r.readFilters().map(({name:s,args:n})=>new Y(s,i.filters.get(s),n,i))}*value(t,i){i=i||t.opts.lenientIf&&this.filters.length>0&&this.filters[0].name==="default";let r=yield this.initial.evaluate(t,i);for(let s of this.filters)r=yield s.render(r,t);return r}},Ir={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie);this.key=t.readIdentifier().content,t.skipBlank(),g(t.peek()==="=",()=>`illegal token ${e.getText()}`),t.advance(),this.value=new k(t.remaining(),this.liquid)},render:function*(e){e.bottom()[this.key]=yield this.value.value(e,this.liquid.options.lenientIf)}},J=class extends x{constructor(t,i,r){super(),this.i=0,this.length=t,this.name=`${r}-${i}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return this.i===0}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}},dt=["offset","limit","reversed"],Er={type:"block",parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie),r=i.readIdentifier(),s=i.readIdentifier(),n=i.readValue();g(r.size()&&s.content==="in"&&n,()=>`illegal tag: ${e.getText()}`),this.variable=r.content,this.collection=n,this.hash=new P(i.remaining()),this.templates=[],this.elseTemplates=[];let o,l=this.liquid.parser.parseStream(t).on("start",()=>o=this.templates).on("tag:else",()=>o=this.elseTemplates).on("tag:endfor",()=>l.stop()).on("template",a=>o.push(a)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});l.start()},render:function*(e,t){let i=this.liquid.renderer,r=Qe(yield w(this.collection,e));if(!r.length){yield i.renderTemplates(this.elseTemplates,e,t);return}let s="continue-"+this.variable+"-"+this.collection.getText();e.push({continue:e.getRegister(s)});let n=yield this.hash.render(e);e.pop(),r=(this.liquid.options.orderedFilterParameters?Object.keys(n).filter(a=>dt.includes(a)):dt.filter(a=>n[a]!==void 0)).reduce((a,u)=>u==="offset"?Ar(a,n.offset):u==="limit"?Mr(a,n.limit):Nr(a),r),e.setRegister(s,(n.offset||0)+r.length);let l={forloop:new J(r.length,this.collection.getText(),this.variable)};e.push(l);for(let a of r){if(l[this.variable]=a,yield i.renderTemplates(this.templates,e,t),t.break){t.break=!1;break}t.continue=!1,l.forloop.next()}e.pop()}};function Nr(e){return[...e].reverse()}function Ar(e,t){return e.slice(t)}function Mr(e,t){return e.slice(0,t)}var Cr={parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie);this.variable=$r(i),g(this.variable,()=>`${e.args} not valid identifier`),this.templates=[];let r=this.liquid.parser.parseStream(t);r.on("tag:endcapture",()=>r.stop()).on("template",s=>this.templates.push(s)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}),r.start()},render:function*(e){let i=yield this.liquid.renderer.renderTemplates(this.templates,e);e.bottom()[this.variable]=i}};function $r(e){let t=e.readIdentifier().content;if(t)return t;let i=e.readQuoted();if(i)return Ge(i)}var Ur={parse:function(e,t){this.cond=new k(e.args,this.liquid),this.cases=[],this.elseTemplates=[];let i=[],r=this.liquid.parser.parseStream(t).on("tag:when",s=>{i=[];let n=new m(s.args,this.liquid.options.operatorsTrie);for(;!n.end();){let o=n.readValue();this.cases.push({val:o,templates:i}),n.readTo(",")}}).on("tag:else",()=>i=this.elseTemplates).on("tag:endcase",()=>r.stop()).on("template",s=>i.push(s)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});r.start()},render:function*(e,t){let i=this.liquid.renderer,r=h(yield this.cond.value(e,e.opts.lenientIf));for(let s of this.cases)if((yield w(s.val,e,e.opts.lenientIf))===r){yield i.renderTemplates(s.templates,e,t);return}yield i.renderTemplates(this.elseTemplates,e,t)}},zr={parse:function(e,t){let i=this.liquid.parser.parseStream(t);i.on("token",r=>{r.name==="endcomment"&&i.stop()}).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}),i.start()}},Oe;(function(e){e[e.OUTPUT=0]="OUTPUT",e[e.STORE=1]="STORE"})(Oe||(Oe={}));var j=Oe,Dr={parseFilePath:Ze,renderFilePath:Xe,parse:function(e){let t=e.args,i=new m(t,this.liquid.options.operatorsTrie);for(this.file=this.parseFilePath(i,this.liquid),this.currentFile=e.file;!i.end();){i.skipBlank();let r=i.p,s=i.readIdentifier();if((s.content==="with"||s.content==="for")&&(i.skipBlank(),i.peek()!==":")){let n=i.readValue();if(n){let o=i.p,l=i.readIdentifier(),a;l.content==="as"?a=i.readIdentifier():i.p=o,this[s.content]={value:n,alias:a&&a.content},i.skipBlank(),i.peek()===","&&i.advance();continue}}i.p=r;break}this.hash=new P(i.remaining())},render:function*(e,t){let{liquid:i,hash:r}=this,s=yield this.renderFilePath(this.file,e,i);g(s,()=>`illegal filename "${s}"`);let n=new C({},e.opts,{sync:e.sync,globals:e.globals,strictVariables:e.strictVariables}),o=n.bottom();if(X(o,yield r.render(e)),this.with){let{value:l,alias:a}=this.with;o[a||s]=yield w(l,e)}if(this.for){let{value:l,alias:a}=this.for,u=yield w(l,e);u=Qe(u),o.forloop=new J(u.length,l.getText(),a);for(let d of u){o[a]=d;let y=yield i._parsePartialFile(s,n.sync,this.currentFile);yield i.renderer.renderTemplates(y,n,t),o.forloop.next()}}else{let l=yield i._parsePartialFile(s,n.sync,this.currentFile);yield i.renderer.renderTemplates(l,n,t)}}};function Ze(e,t){if(t.options.dynamicPartials){let s=e.readValue();if(s===void 0)throw new TypeError(`illegal argument "${e.input}"`);if(s.getText()==="none")return null;if(Rt(s)){let n=t.parse(Ge(s));return pt(n)}return s}let i=[...e.readFileNameTemplate(t.options)],r=pt(t.parser.parseTokens(i));return r==="none"?null:r}function pt(e){return e.length===1&&Ye(e[0].token)?e[0].token.getContent():e}function*Xe(e,t,i){return typeof e=="string"?e:Array.isArray(e)?i.renderer.renderTemplates(e,t):yield w(e,t)}var Wr={parseFilePath:Ze,renderFilePath:Xe,parse:function(e){let t=e.args,i=new m(t,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(i,this.liquid),this.currentFile=e.file;let r=i.p;i.readIdentifier().content==="with"?(i.skipBlank(),i.peek()!==":"?this.withVar=i.readValue():i.p=r):i.p=r,this.hash=new P(i.remaining(),this.liquid.options.jekyllInclude)},render:function*(e,t){let{liquid:i,hash:r,withVar:s}=this,{renderer:n}=i,o=yield this.renderFilePath(this.file,e,i);g(o,()=>`illegal filename "${o}"`);let l=e.saveRegister("blocks","blockMode");e.setRegister("blocks",{}),e.setRegister("blockMode",j.OUTPUT);let a=yield r.render(e);s&&(a[o]=yield w(s,e));let u=yield i._parsePartialFile(o,e.sync,this.currentFile);e.push(e.opts.jekyllInclude?{include:a}:a),yield n.renderTemplates(u,e,t),e.pop(),e.restoreRegister(l)}},Vr={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie);this.variable=t.readIdentifier().content},render:function(e,t){let i=e.environments;De(i[this.variable])||(i[this.variable]=0),t.write(c(--i[this.variable]))}},Br={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie),i=t.readValue();for(t.skipBlank(),this.candidates=[],i&&(t.peek()===":"?(this.group=i,t.advance()):this.candidates.push(i));!t.end();){let r=t.readValue();r&&this.candidates.push(r),t.readTo(",")}g(this.candidates.length,()=>`empty candidates: ${e.getText()}`)},render:function*(e,t){let r=`cycle:${yield w(this.group,e)}:`+this.candidates.join(","),s=e.getRegister("cycle"),n=s[r];n===void 0&&(n=s[r]=0);let o=this.candidates[n];n=(n+1)%this.candidates.length,s[r]=n;let l=yield w(o,e);t.write(l)}},jr={parse:function(e,t){this.branches=[],this.elseTemplates=[];let i;this.liquid.parser.parseStream(t).on("start",()=>this.branches.push({predicate:new k(e.args,this.liquid),templates:i=[]})).on("tag:elsif",r=>this.branches.push({predicate:new k(r.args,this.liquid),templates:i=[]})).on("tag:else",()=>i=this.elseTemplates).on("tag:endif",function(){this.stop()}).on("template",r=>i.push(r)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}).start()},render:function*(e,t){let i=this.liquid.renderer;for(let{predicate:r,templates:s}of this.branches){let n=yield r.value(e,e.opts.lenientIf);if(N(n,e)){yield i.renderTemplates(s,e,t);return}}yield i.renderTemplates(this.elseTemplates,e,t)}},Hr={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie);this.variable=t.readIdentifier().content},render:function(e,t){let i=e.environments;De(i[this.variable])||(i[this.variable]=0);let r=i[this.variable];i[this.variable]++,t.write(c(r))}},Qr={parseFilePath:Ze,renderFilePath:Xe,parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(i,this.liquid),this.currentFile=e.file,this.hash=new P(i.remaining()),this.tpls=this.liquid.parser.parseTokens(t)},render:function*(e,t){let{liquid:i,hash:r,file:s}=this,{renderer:n}=i;if(s===null){e.setRegister("blockMode",j.OUTPUT),yield n.renderTemplates(this.tpls,e,t);return}let o=yield this.renderFilePath(this.file,e,i);g(o,()=>`illegal filename "${o}"`);let l=yield i._parseLayoutFile(o,e.sync,this.currentFile);e.setRegister("blockMode",j.STORE);let a=yield n.renderTemplates(this.tpls,e),u=e.getRegister("blocks");u[""]===void 0&&(u[""]=(d,y)=>y.write(a)),e.setRegister("blockMode",j.OUTPUT),e.push(yield r.render(e)),yield n.renderTemplates(l,e,t),e.pop()}},oe=class extends x{constructor(t=()=>""){super(),this.superBlockRender=t}super(){return this.superBlockRender()}},Yr={parse(e,t){let i=/\w+/.exec(e.args);this.block=i?i[0]:"",this.tpls=[],this.liquid.parser.parseStream(t).on("tag:endblock",function(){this.stop()}).on("template",r=>this.tpls.push(r)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}).start()},*render(e,t){let i=this.getBlockRender(e);e.getRegister("blockMode")===j.STORE?e.getRegister("blocks")[this.block]=i:yield i(new oe,t)},getBlockRender(e){let{liquid:t,tpls:i}=this,r=e.getRegister("blocks")[this.block],s=function*(n,o){e.push({block:n}),yield t.renderer.renderTemplates(i,e,o),e.pop()};return r?(n,o)=>r(new oe(()=>s(n,o)),o):s}},Jr={parse:function(e,t){this.tokens=[];let i=this.liquid.parser.parseStream(t);i.on("token",r=>{r.name==="endraw"?i.stop():this.tokens.push(r)}).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}),i.start()},render:function(){return this.tokens.map(e=>e.getText()).join("")}},Re=class extends J{constructor(t,i,r,s){super(t,r,s),this.length=t,this.cols=i}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return this.col0()===0}col_last(){return this.col()===this.cols}},Gr={parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie),r=i.readIdentifier();i.skipBlank();let s=i.readIdentifier();g(s&&s.content==="in",()=>`illegal tag: ${e.getText()}`),this.variable=r.content,this.collection=i.readValue(),this.hash=new P(i.remaining()),this.templates=[];let n,o=this.liquid.parser.parseStream(t).on("start",()=>n=this.templates).on("tag:endtablerow",()=>o.stop()).on("template",l=>n.push(l)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});o.start()},render:function*(e,t){let i=Qe(yield w(this.collection,e)),r=yield this.hash.render(e),s=r.offset||0,n=r.limit===void 0?i.length:r.limit;i=i.slice(s,s+n);let o=r.cols||i.length,l=this.liquid.renderer,a=new Re(i.length,o,this.collection.getText(),this.variable),u={tablerowloop:a};e.push(u);for(let d=0;d<i.length;d++,a.next())u[this.variable]=i[d],a.col0()===0&&(a.row()!==1&&t.write("</tr>"),t.write(`<tr class="row${a.row()}">`)),t.write(`<td class="col${a.col()}">`),yield l.renderTemplates(this.templates,e,t),t.write("</td>");i.length&&t.write("</tr>"),e.pop()}},Zr={parse:function(e,t){this.branches=[],this.elseTemplates=[];let i;this.liquid.parser.parseStream(t).on("start",()=>this.branches.push({predicate:new k(e.args,this.liquid),test:je,templates:i=[]})).on("tag:elsif",r=>this.branches.push({predicate:new k(r.args,this.liquid),test:N,templates:i=[]})).on("tag:else",()=>i=this.elseTemplates).on("tag:endunless",function(){this.stop()}).on("template",r=>i.push(r)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}).start()},render:function*(e,t){let i=this.liquid.renderer;for(let{predicate:r,test:s,templates:n}of this.branches){let o=yield r.value(e,e.opts.lenientIf);if(s(o,e)){yield i.renderTemplates(n,e,t);return}}yield i.renderTemplates(this.elseTemplates,e,t)}},Xr={render:function(e,t){t.break=!0}},Kr={render:function(e,t){t.continue=!0}},es={parse:function(e){this.value=new k(e.args,this.liquid)},render:function*(e,t){let i=yield this.value.value(e,!1);t.write(i)}},ts={parse:function(e){let i=new m(e.args,this.liquid.options.operatorsTrie).readLiquidTagTokens(this.liquid.options);this.tpls=this.liquid.parser.parseTokens(i)},render:function*(e,t){yield this.liquid.renderer.renderTemplates(this.tpls,e,t)}},is={parse:function(e,t){if(e.args.search(/\n\s*[^#\s]/g)!==-1)throw new Error("every line of an inline comment must start with a '#' character")}},rs={assign:Ir,for:Er,capture:Cr,case:Ur,comment:zr,include:Wr,render:Dr,decrement:Vr,increment:Hr,cycle:Br,if:jr,layout:Qr,block:Yr,raw:Jr,tablerow:Gr,unless:Zr,break:Xr,continue:Kr,echo:es,liquid:ts,"#":is};var It=new Map;le(Ft,(e,t)=>{It.set(ue(t),e)});var E={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,cache:void 0,extname:"",fs:Jt,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!1,lenientIf:!1,globals:{},keepOutputType:!1,operators:rt,operatorsTrie:_t(rt)};function ss(e){if(e.hasOwnProperty("operators")&&(e.operatorsTrie=_t(e.operators)),e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")){let t;typeof e.cache=="number"?t=e.cache>0?new te(e.cache):void 0:typeof e.cache=="object"?t=e.cache:t=e.cache?new te(1024):void 0,e.cache=t}return e=Object.assign(Object.assign(Object.assign({},E),e.jekyllInclude?{dynamicPartials:!1}:{}),e),!e.fs.dirname&&e.relativeReference&&(console.warn("[LiquidJS] `fs.dirname` is required for relativeReference, set relativeReference to `false` to suppress this warning, or provide implementation for `fs.dirname`"),e.relativeReference=!1),e.root=Z(e.root),e.partials=Z(e.partials),e.layouts=Z(e.layouts),e.outputEscape=e.outputEscape&&ns(e.outputEscape),e}function ns(e){if(L(e)){let t=It.get(e);return g(q(t),`filter "${e}" not found`),t}else return g(q(e),"`outputEscape` need to be of type string or function"),e}function Z(e){let t=[];return T(e)&&(t=e),L(e)&&(t=[e]),t}var C=class{constructor(t={},i=E,r={}){var s,n;this.scopes=[{}],this.registers={},this.sync=!!r.sync,this.opts=i,this.globals=(s=r.globals)!==null&&s!==void 0?s:i.globals,this.environments=t,this.strictVariables=(n=r.strictVariables)!==null&&n!==void 0?n:this.opts.strictVariables}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,i){return this.registers[t]=i}saveRegister(...t){return t.map(i=>[i,this.getRegister(i)])}restoreRegister(t){return t.forEach(([i,r])=>this.setRegister(i,r))}getAll(){return[this.globals,this.environments,...this.scopes].reduce((t,i)=>X(t,i),{})}get(t){return M(this._get(t))}*_get(t){let i=this.findScope(t[0]);return yield this._getFromScope(i,t)}getFromScope(t,i){return M(this._getFromScope(t,i))}*_getFromScope(t,i){L(i)&&(i=i.split("."));for(let r=0;r<i.length;r++)if(t=yield os(t,i[r],this.opts.ownPropertyOnly),I(t)&&this.strictVariables)throw new pe(i.slice(0,r+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}findScope(t){for(let i=this.scopes.length-1;i>=0;i--){let r=this.scopes[i];if(t in r)return r}return t in this.environments?this.environments:this.globals}};function os(e,t,i){if(I(e))return e;if(e=gt(e),T(e)&&t<0)return e[e.length+ +t];let r=as(e,t,i);return r===void 0&&e instanceof x?e.liquidMethodMissing(t):q(r)?r.call(e):t==="size"?cs(e):t==="first"?ls(e):t==="last"?us(e):r}function as(e,t,i){if(!(i&&!Object.hasOwnProperty.call(e,t)))return e[t]}function ls(e){return T(e)?e[0]:e.first}function us(e){return T(e)?e[e.length-1]:e.last}function cs(e){if(e.hasOwnProperty("size")||e.size!==void 0)return e.size;if(T(e)||L(e))return e.length;if(typeof e=="object")return Object.keys(e).length}var $;(function(e){e.Partials="partials",e.Layouts="layouts",e.Root="root"})($||($={}));var xe=class{constructor(t){if(this.options=t,t.relativeReference){let i=t.fs.sep;g(i,"`fs.sep` is required for relative reference");let r=new RegExp(["."+i,".."+i,"./","../"].map(s=>Ct(s)).join("|"));this.shouldLoadRelative=s=>r.test(s)}else this.shouldLoadRelative=i=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,i,r,s){let{fs:n}=this.options,o=this.options[i];for(let l of this.candidates(t,o,s,i!==$.Root))if(r?n.existsSync(l):yield n.exists(l))return l;throw this.lookupError(t,o)}*candidates(t,i,r,s){let{fs:n,extname:o}=this.options;if(this.shouldLoadRelative(t)&&r){let l=n.resolve(this.dirname(r),t,o);for(let a of i)if(!s||this.contains(a,l)){yield l;break}}for(let l of i){let a=n.resolve(l,t,o);(!s||this.contains(l,a))&&(yield a)}if(n.fallback!==void 0){let l=n.fallback(t);l!==void 0&&(yield l)}}dirname(t){let i=this.options.fs;return g(i.dirname,"`fs.dirname` is required for relative reference"),i.dirname(t)}lookupError(t,i){let r=new Error("ENOENT");return r.message=`ENOENT: Failed to lookup "${t}" in "${i}"`,r.code="ENOENT",r}},Pe=class{constructor(){this.buffer=""}write(t){this.buffer+=c(t)}},Ie=class{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}},Ee=class{constructor(){this.buffer=""}write(t){t=h(t),typeof t!="string"&&this.buffer===""?this.buffer=t:this.buffer=c(this.buffer)+c(t)}},Ne=class{renderTemplatesToNodeStream(t,i){let r=new Ie;return Promise.resolve().then(()=>A(this.renderTemplates(t,i,r))).then(()=>r.end(),s=>r.error(s)),r.stream}*renderTemplates(t,i,r){r||(r=i.opts.keepOutputType?new Ee:new Pe);for(let s of t)try{let n=yield s.render(i,r);if(n&&r.write(n),r.break||r.continue)break}catch(n){throw ie.is(n)?n:new ie(n,s)}return r.buffer}},G=class{constructor(t){this.token=t}},Ae=class extends G{constructor(t,i,r){super(t),this.name=t.name;let s=r.tags.get(t.name);this.impl=Object.create(s),this.impl.liquid=r,this.impl.parse&&this.impl.parse(t,i)}*render(t,i){let r=yield new P(this.token.args).render(t),s=this.impl;if(q(s.render))return yield s.render(t,i,r)}},Me=class extends G{constructor(t,i){super(t),this.value=new k(t.content,i);let r=this.value.filters,s=i.options.outputEscape;r.length&&r[r.length-1].name==="raw"?r.pop():s&&r.push(new Y(toString.call(s),s,[],i))}*render(t,i){let r=yield this.value.value(t,!1);i.write(r)}},Ce=class extends G{constructor(t){super(t),this.str=t.getContent()}*render(t,i){i.write(this.str)}},$e=class{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new xe(this.liquid.options)}parse(t,i){let s=new m(t,this.liquid.options.operatorsTrie,i).readTopLevelTokens(this.liquid.options);return this.parseTokens(s)}parseTokens(t){let i,r=[];for(;i=t.shift();)r.push(this.parseToken(i,t));return r}parseToken(t,i){try{return Je(t)?new Ae(t,i,this.liquid):fr(t)?new Me(t,this.liquid):new Ce(t)}catch(r){throw new he(r,t)}}parseStream(t){return new Fe(t,(i,r)=>this.parseToken(i,r))}*_parseFileCached(t,i,r=$.Root,s){let n=this.cache,o=this.loader.shouldLoadRelative(t)?s+","+t:r+":"+t,l=yield n.read(o);if(l)return l;let a=this._parseFile(t,i,r,s),u=i?yield a:A(a);n.write(o,u);try{return yield u}catch(d){throw n.remove(o),d}}*_parseFile(t,i,r=$.Root,s){let n=yield this.loader.lookup(t,r,i,s);return this.liquid.parse(i?this.fs.readFileSync(n):yield this.fs.readFile(n),n)}},Ue=class{constructor(){this.impls={}}get(t){let i=this.impls[t];return g(i,()=>`tag "${t}" not found`),i}set(t,i){this.impls[t]=i}},ze=class{constructor(t,i){this.strictFilters=t,this.liquid=i,this.impls={}}get(t){let i=this.impls[t];return g(i||!this.strictFilters,()=>`undefined filter: ${t}`),i}set(t,i){this.impls[t]=i}create(t,i){return new Y(t,this.get(t),i,this.liquid)}};var W=class{constructor(t={}){this.options=ss(t),this.parser=new $e(this),this.renderer=new Ne,this.filters=new ze(this.options.strictFilters,this),this.tags=new Ue,le(rs,(i,r)=>this.registerTag(ue(r),i)),le(Ft,(i,r)=>this.registerFilter(ue(r),i))}parse(t,i){return this.parser.parse(t,i)}_render(t,i,r){let s=new C(i,this.options,r);return this.renderer.renderTemplates(t,s)}render(t,i,r){return F(this,void 0,void 0,function*(){return A(this._render(t,i,Object.assign(Object.assign({},r),{sync:!1})))})}renderSync(t,i,r){return M(this._render(t,i,Object.assign(Object.assign({},r),{sync:!0})))}renderToNodeStream(t,i,r={}){let s=new C(i,this.options,r);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,i,r){let s=this.parse(t);return this._render(s,i,r)}parseAndRender(t,i,r){return F(this,void 0,void 0,function*(){return A(this._parseAndRender(t,i,Object.assign(Object.assign({},r),{sync:!1})))})}parseAndRenderSync(t,i,r){return M(this._parseAndRender(t,i,Object.assign(Object.assign({},r),{sync:!0})))}_parsePartialFile(t,i,r){return this.parser.parseFile(t,i,$.Partials,r)}_parseLayoutFile(t,i,r){return this.parser.parseFile(t,i,$.Layouts,r)}parseFile(t){return F(this,void 0,void 0,function*(){return A(this.parser.parseFile(t,!1))})}parseFileSync(t){return M(this.parser.parseFile(t,!0))}renderFile(t,i,r){return F(this,void 0,void 0,function*(){let s=yield this.parseFile(t);return this.render(s,i,r)})}renderFileSync(t,i,r){let s=this.parseFileSync(t);return this.renderSync(s,i,r)}renderFileToNodeStream(t,i,r){return F(this,void 0,void 0,function*(){let s=yield this.parseFile(t);return this.renderToNodeStream(s,i,r)})}_evalValue(t,i){let r=new k(t,this),s=i instanceof C?i:new C(i,this.options);return r.value(s,!1)}evalValue(t,i){return F(this,void 0,void 0,function*(){return A(this._evalValue(t,i))})}evalValueSync(t,i){return M(this._evalValue(t,i))}registerFilter(t,i){this.filters.set(t,i)}registerTag(t,i){this.tags.set(t,i)}plugin(t){return t.call(this,W)}express(){let t=this,i=!0;return function(r,s,n){if(i){i=!1;let o=Z(this.root);t.options.root.unshift(...o),t.options.layouts.unshift(...o),t.options.partials.unshift(...o)}t.renderFile(r,s).then(o=>n(null,o),n)}}};import{html as hs}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{unsafeStatic as ds}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/static/+esm";var Ke=e=>function(){let t=a=>{var u;return e.utils.url.getVariantUrl(a.url,(u=a.selected_variant)==null?void 0:u.id)},i=(a,...u)=>e.utils.url.getImageUrl(a,Et(u)),r=(a="")=>e.utils.url.getFileUrl(a),s=(a="",u)=>e.utils.url.getImageUrl({src:e.utils.url.getFileUrl(a.replace(".",`_${u}.`))}),n=a=>e.utils.money.formatMoney(a),o=(a,...u)=>u.length?this.parseAndRenderSync(e.utils.locale.translate(a),Et(u)):e.utils.locale.translate(a),l=(a="")=>a.toLowerCase().trim().replace(/[^a-zA-Z0-9]/g,"-").replace(/[-]{2,}/g,"-");this.registerFilter("variant_url",t),this.registerFilter("image_url",i),this.registerFilter("file_url",r),this.registerFilter("file_img_url",s),this.registerFilter("money",n),this.registerFilter("t",o),this.registerFilter("handle",l),this.registerFilter("handleize",l)},Et=e=>e.reduce((t,[i,r])=>r?{...t,[i]:r}:t,{});import{WishlistElement as ps}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/wishlist-element.js";var et=class extends ps{static get properties(){return{}}init(){super.init(),this.dataUtil=new V({utils:this.app.utils}),this.globals={settings:{login_required:this.app.settings.loginRequired},customer:this.app.customer,shop:{currency:this.app.config.shop.currency,customer_accounts_enabled:this.app.config.shop.customerAccountsEnabled,domain:this.app.config.shop.domain,money_format:this.app.config.shop.moneyFormat,name:this.app.config.shop.name,permanent_domain:this.app.config.shop.permanentDomain},routes:{root_url:this.app.routes.rootUrl,wishlist_url:this.app.routes.wishlistUrl,account_url:this.app.routes.accountUrl,account_login_url:this.app.routes.accountLoginUrl,account_logout_url:this.app.routes.accountLogoutUrl,account_register_url:this.app.routes.accountRegisterUrl,account_addresses_url:this.app.routes.accountAddressesUrl,collections_url:this.app.routes.collectionsUrl,all_products_collection_url:this.app.routes.allProductsCollectionUrl,search_url:this.app.routes.searchUrl,predictive_search_url:this.app.routes.predictiveSearchUrl,cart_url:this.app.routes.cartUrl,cart_add_url:this.app.routes.cartAddUrl,cart_change_url:this.app.routes.cartChangeUrl,cart_clear_url:this.app.routes.cartClearUrl,cart_update_url:this.app.routes.cartUpdateUrl,product_recommendations_url:this.app.routes.productRecommendationsUrl}},this.liquidEngine=new W({cache:!0,relativeReference:!1}),this.liquidEngine.plugin(Ke(this.app)),this.initTemplate()}disconnectedCallback(){super.disconnectedCallback(),this.parsedTemplates=void 0}getLiquidTemplate(){return""}getLiquidData(){return{}}initTemplate(){if(this.parsedTemplates)return this.parsedTemplates;if(!this.liquidEngine)throw new Error("Liquid engine not initialized");return this.parsedTemplates=this.liquidEngine.parse(this.getLiquidTemplate()),this.parsedTemplates}render(){var l,a;if(!this.parsedTemplates||!this.liquidEngine||!this.dataUtil)return;let{wishlist:i,wishlistItem:r,productInfo:s}=(l=this.state)!=null?l:{},n={...this.dataUtil.objectToSnakeCase(this.getLiquidData()),wishlist:i?this.dataUtil.mapWishlistState(i,(a=this.stateCtrl.stateConfig.wishlist)==null?void 0:a.format):void 0,wishlist_item:r?this.dataUtil.mapWishlistItem(r):void 0,product_info:s?this.dataUtil.mapProductInfo(s):void 0},o=this.liquidEngine.renderSync(this.parsedTemplates,n,{globals:this.globals});return hs`${ds(o)}`}};export{V as LiquidDataUtil,et as LiquidElement,Ke as liquidShopifyFilters}; | ||
`)!==-1&&(n=this.p),new Le(r,s,n,t,i)}mkError(t,i){return new H(t,new U(this.input,i,this.N,this.file))}snapshot(t=this.p){return JSON.stringify(Dt(this.input.slice(t),16))}readWord(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()}readIdentifier(){this.skipBlank();let t=this.p;for(;this.peekType()&He;)++this.p;return new U(this.input,t,this.p,this.file)}readTagName(){return this.skipBlank(),this.input[this.p]==="#"?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(t){let i=[];for(;;){let r=this.readHash(t);if(!r)return i;i.push(r)}}readHash(t){this.skipBlank(),this.peek()===","&&++this.p;let i=this.p,r=this.readIdentifier();if(!r.size())return;let s;this.skipBlank();let n=t?"=":":";return this.peek()===n&&(++this.p,s=this.readValue()),new ve(this.input,i,this.p,r,s,this.file)}remaining(){return this.input.slice(this.p)}advance(t=1){this.p+=t}end(){return this.p>=this.N}readTo(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1}readValue(){let t=this.readQuoted()||this.readRange();if(t)return t;if(this.peek()==="["){this.p++;let n=this.readQuoted();return!n||this.peek()!=="]"?void 0:(this.p++,new re(n,[],this.p))}let i=this.readIdentifier();if(!i.size())return;let r=i.isNumber(!0),s=[];for(;;)if(this.peek()==="["){r=!1,this.p++;let n=this.readValue()||new U(this.input,this.p,this.p,this.file);this.readTo("]"),s.push(n)}else if(this.peek()==="."&&this.peek(1)!=="."){this.p++;let n=this.readIdentifier();if(!n.size())break;n.isNumber()||(r=!1),s.push(n)}else break;return!s.length&&xt.hasOwnProperty(i.content)?new Te(this.input,i.begin,i.end,this.file):r?new ye(i,s[0]):new re(i,s,this.p)}readRange(){this.skipBlank();let t=this.p;if(this.peek()!=="(")return;++this.p;let i=this.readValueOrThrow();this.p+=2;let r=this.readValueOrThrow();return++this.p,new ke(this.input,t,this.p,i,r,this.file)}readValueOrThrow(){let t=this.readValue();return g(t,()=>`unexpected token ${this.snapshot()}, value expected`),t}readQuoted(){this.skipBlank();let t=this.p;if(!(this.peekType()&st))return;++this.p;let i=!1;for(;this.p<this.N&&(++this.p,!(this.input[this.p-1]===this.input[t]&&!i));)i?i=!1:this.input[this.p-1]==="\\"&&(i=!0);return new qe(this.input,t,this.p,this.file)}*readFileNameTemplate(t){let{outputDelimiterLeft:i}=t,r=[","," ",i],s=new Set(r);for(;this.p<this.N&&!s.has(this.peek());)yield this.match(i)?this.readOutputToken(t):this.readHTMLToken(r)}match(t){for(let i=0;i<t.length;i++)if(t[i]!==this.input[this.p+i])return!1;return!0}rmatch(t){for(let i=0;i<t.length;i++)if(t[t.length-1-i]!==this.input[this.p-1-i])return!1;return!0}peekType(t=0){return p[this.input.charCodeAt(this.p+t)]}peek(t=0){return this.input[this.p+t]}skipBlank(){for(;this.peekType()&ae;)++this.p}},ne=class extends Q{constructor(t,i,r,s,n){let{trimTagLeft:o,trimTagRight:l,tagDelimiterLeft:a,tagDelimiterRight:u}=s,d=t.slice(i+a.length,r-u.length);super(f.Tag,d,t,i,r,o,l,n);let y=new m(this.content,s.operatorsTrie);if(this.name=y.readTagName(),!this.name)throw new H("illegal tag syntax",this);y.skipBlank(),this.args=y.remaining()}},Fe=class{constructor(t,i){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=i}on(t,i){return this.handlers[t]=i,this}trigger(t,i){let r=this.handlers[t];return r?(r.call(this,i),!0):!1}start(){this.trigger("start");let t;for(;!this.stopRequested&&(t=this.tokens.shift());){if(this.trigger("token",t)||Je(t)&&this.trigger(`tag:${t.name}`,t))continue;let i=this.parseToken(t,this.tokens);this.trigger("template",i)}return this.stopRequested||this.trigger("end"),this}stop(){return this.stopRequested=!0,this}},P=class{constructor(t,i){this.hash={};let r=new m(t,{});for(let s of r.readHashes(i))this.hash[s.name.content]=s.value}*render(t){let i={};for(let r of Object.keys(this.hash))i[r]=this.hash[r]===void 0?!0:yield w(this.hash[r],t);return i}};function Pr(e){return T(e)}var Y=class{constructor(t,i,r,s){this.name=t,this.impl=i||yt,this.args=r,this.liquid=s}*render(t,i){let r=[];for(let s of this.args)Pr(s)?r.push([s[0],yield w(s[1],i)]):r.push(yield w(s,i));return this.impl.apply({context:i,liquid:this.liquid},[t,...r])}},k=class{constructor(t,i){this.filters=[];let r=new m(t,i.options.operatorsTrie);this.initial=r.readExpression(),this.filters=r.readFilters().map(({name:s,args:n})=>new Y(s,i.filters.get(s),n,i))}*value(t,i){i=i||t.opts.lenientIf&&this.filters.length>0&&this.filters[0].name==="default";let r=yield this.initial.evaluate(t,i);for(let s of this.filters)r=yield s.render(r,t);return r}},Ir={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie);this.key=t.readIdentifier().content,t.skipBlank(),g(t.peek()==="=",()=>`illegal token ${e.getText()}`),t.advance(),this.value=new k(t.remaining(),this.liquid)},render:function*(e){e.bottom()[this.key]=yield this.value.value(e,this.liquid.options.lenientIf)}},J=class extends x{constructor(t,i,r){super(),this.i=0,this.length=t,this.name=`${r}-${i}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return this.i===0}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}},dt=["offset","limit","reversed"],Er={type:"block",parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie),r=i.readIdentifier(),s=i.readIdentifier(),n=i.readValue();g(r.size()&&s.content==="in"&&n,()=>`illegal tag: ${e.getText()}`),this.variable=r.content,this.collection=n,this.hash=new P(i.remaining()),this.templates=[],this.elseTemplates=[];let o,l=this.liquid.parser.parseStream(t).on("start",()=>o=this.templates).on("tag:else",()=>o=this.elseTemplates).on("tag:endfor",()=>l.stop()).on("template",a=>o.push(a)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});l.start()},render:function*(e,t){let i=this.liquid.renderer,r=Qe(yield w(this.collection,e));if(!r.length){yield i.renderTemplates(this.elseTemplates,e,t);return}let s="continue-"+this.variable+"-"+this.collection.getText();e.push({continue:e.getRegister(s)});let n=yield this.hash.render(e);e.pop(),r=(this.liquid.options.orderedFilterParameters?Object.keys(n).filter(a=>dt.includes(a)):dt.filter(a=>n[a]!==void 0)).reduce((a,u)=>u==="offset"?Ar(a,n.offset):u==="limit"?Mr(a,n.limit):Nr(a),r),e.setRegister(s,(n.offset||0)+r.length);let l={forloop:new J(r.length,this.collection.getText(),this.variable)};e.push(l);for(let a of r){if(l[this.variable]=a,yield i.renderTemplates(this.templates,e,t),t.break){t.break=!1;break}t.continue=!1,l.forloop.next()}e.pop()}};function Nr(e){return[...e].reverse()}function Ar(e,t){return e.slice(t)}function Mr(e,t){return e.slice(0,t)}var Cr={parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie);this.variable=$r(i),g(this.variable,()=>`${e.args} not valid identifier`),this.templates=[];let r=this.liquid.parser.parseStream(t);r.on("tag:endcapture",()=>r.stop()).on("template",s=>this.templates.push(s)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}),r.start()},render:function*(e){let i=yield this.liquid.renderer.renderTemplates(this.templates,e);e.bottom()[this.variable]=i}};function $r(e){let t=e.readIdentifier().content;if(t)return t;let i=e.readQuoted();if(i)return Ge(i)}var Ur={parse:function(e,t){this.cond=new k(e.args,this.liquid),this.cases=[],this.elseTemplates=[];let i=[],r=this.liquid.parser.parseStream(t).on("tag:when",s=>{i=[];let n=new m(s.args,this.liquid.options.operatorsTrie);for(;!n.end();){let o=n.readValue();this.cases.push({val:o,templates:i}),n.readTo(",")}}).on("tag:else",()=>i=this.elseTemplates).on("tag:endcase",()=>r.stop()).on("template",s=>i.push(s)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});r.start()},render:function*(e,t){let i=this.liquid.renderer,r=h(yield this.cond.value(e,e.opts.lenientIf));for(let s of this.cases)if((yield w(s.val,e,e.opts.lenientIf))===r){yield i.renderTemplates(s.templates,e,t);return}yield i.renderTemplates(this.elseTemplates,e,t)}},zr={parse:function(e,t){let i=this.liquid.parser.parseStream(t);i.on("token",r=>{r.name==="endcomment"&&i.stop()}).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}),i.start()}},Oe;(function(e){e[e.OUTPUT=0]="OUTPUT",e[e.STORE=1]="STORE"})(Oe||(Oe={}));var j=Oe,Dr={parseFilePath:Ze,renderFilePath:Xe,parse:function(e){let t=e.args,i=new m(t,this.liquid.options.operatorsTrie);for(this.file=this.parseFilePath(i,this.liquid),this.currentFile=e.file;!i.end();){i.skipBlank();let r=i.p,s=i.readIdentifier();if((s.content==="with"||s.content==="for")&&(i.skipBlank(),i.peek()!==":")){let n=i.readValue();if(n){let o=i.p,l=i.readIdentifier(),a;l.content==="as"?a=i.readIdentifier():i.p=o,this[s.content]={value:n,alias:a&&a.content},i.skipBlank(),i.peek()===","&&i.advance();continue}}i.p=r;break}this.hash=new P(i.remaining())},render:function*(e,t){let{liquid:i,hash:r}=this,s=yield this.renderFilePath(this.file,e,i);g(s,()=>`illegal filename "${s}"`);let n=new C({},e.opts,{sync:e.sync,globals:e.globals,strictVariables:e.strictVariables}),o=n.bottom();if(X(o,yield r.render(e)),this.with){let{value:l,alias:a}=this.with;o[a||s]=yield w(l,e)}if(this.for){let{value:l,alias:a}=this.for,u=yield w(l,e);u=Qe(u),o.forloop=new J(u.length,l.getText(),a);for(let d of u){o[a]=d;let y=yield i._parsePartialFile(s,n.sync,this.currentFile);yield i.renderer.renderTemplates(y,n,t),o.forloop.next()}}else{let l=yield i._parsePartialFile(s,n.sync,this.currentFile);yield i.renderer.renderTemplates(l,n,t)}}};function Ze(e,t){if(t.options.dynamicPartials){let s=e.readValue();if(s===void 0)throw new TypeError(`illegal argument "${e.input}"`);if(s.getText()==="none")return null;if(Rt(s)){let n=t.parse(Ge(s));return pt(n)}return s}let i=[...e.readFileNameTemplate(t.options)],r=pt(t.parser.parseTokens(i));return r==="none"?null:r}function pt(e){return e.length===1&&Ye(e[0].token)?e[0].token.getContent():e}function*Xe(e,t,i){return typeof e=="string"?e:Array.isArray(e)?i.renderer.renderTemplates(e,t):yield w(e,t)}var Wr={parseFilePath:Ze,renderFilePath:Xe,parse:function(e){let t=e.args,i=new m(t,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(i,this.liquid),this.currentFile=e.file;let r=i.p;i.readIdentifier().content==="with"?(i.skipBlank(),i.peek()!==":"?this.withVar=i.readValue():i.p=r):i.p=r,this.hash=new P(i.remaining(),this.liquid.options.jekyllInclude)},render:function*(e,t){let{liquid:i,hash:r,withVar:s}=this,{renderer:n}=i,o=yield this.renderFilePath(this.file,e,i);g(o,()=>`illegal filename "${o}"`);let l=e.saveRegister("blocks","blockMode");e.setRegister("blocks",{}),e.setRegister("blockMode",j.OUTPUT);let a=yield r.render(e);s&&(a[o]=yield w(s,e));let u=yield i._parsePartialFile(o,e.sync,this.currentFile);e.push(e.opts.jekyllInclude?{include:a}:a),yield n.renderTemplates(u,e,t),e.pop(),e.restoreRegister(l)}},Vr={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie);this.variable=t.readIdentifier().content},render:function(e,t){let i=e.environments;De(i[this.variable])||(i[this.variable]=0),t.write(c(--i[this.variable]))}},Br={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie),i=t.readValue();for(t.skipBlank(),this.candidates=[],i&&(t.peek()===":"?(this.group=i,t.advance()):this.candidates.push(i));!t.end();){let r=t.readValue();r&&this.candidates.push(r),t.readTo(",")}g(this.candidates.length,()=>`empty candidates: ${e.getText()}`)},render:function*(e,t){let r=`cycle:${yield w(this.group,e)}:`+this.candidates.join(","),s=e.getRegister("cycle"),n=s[r];n===void 0&&(n=s[r]=0);let o=this.candidates[n];n=(n+1)%this.candidates.length,s[r]=n;let l=yield w(o,e);t.write(l)}},jr={parse:function(e,t){this.branches=[],this.elseTemplates=[];let i;this.liquid.parser.parseStream(t).on("start",()=>this.branches.push({predicate:new k(e.args,this.liquid),templates:i=[]})).on("tag:elsif",r=>this.branches.push({predicate:new k(r.args,this.liquid),templates:i=[]})).on("tag:else",()=>i=this.elseTemplates).on("tag:endif",function(){this.stop()}).on("template",r=>i.push(r)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}).start()},render:function*(e,t){let i=this.liquid.renderer;for(let{predicate:r,templates:s}of this.branches){let n=yield r.value(e,e.opts.lenientIf);if(N(n,e)){yield i.renderTemplates(s,e,t);return}}yield i.renderTemplates(this.elseTemplates,e,t)}},Hr={parse:function(e){let t=new m(e.args,this.liquid.options.operatorsTrie);this.variable=t.readIdentifier().content},render:function(e,t){let i=e.environments;De(i[this.variable])||(i[this.variable]=0);let r=i[this.variable];i[this.variable]++,t.write(c(r))}},Qr={parseFilePath:Ze,renderFilePath:Xe,parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(i,this.liquid),this.currentFile=e.file,this.hash=new P(i.remaining()),this.tpls=this.liquid.parser.parseTokens(t)},render:function*(e,t){let{liquid:i,hash:r,file:s}=this,{renderer:n}=i;if(s===null){e.setRegister("blockMode",j.OUTPUT),yield n.renderTemplates(this.tpls,e,t);return}let o=yield this.renderFilePath(this.file,e,i);g(o,()=>`illegal filename "${o}"`);let l=yield i._parseLayoutFile(o,e.sync,this.currentFile);e.setRegister("blockMode",j.STORE);let a=yield n.renderTemplates(this.tpls,e),u=e.getRegister("blocks");u[""]===void 0&&(u[""]=(d,y)=>y.write(a)),e.setRegister("blockMode",j.OUTPUT),e.push(yield r.render(e)),yield n.renderTemplates(l,e,t),e.pop()}},oe=class extends x{constructor(t=()=>""){super(),this.superBlockRender=t}super(){return this.superBlockRender()}},Yr={parse(e,t){let i=/\w+/.exec(e.args);this.block=i?i[0]:"",this.tpls=[],this.liquid.parser.parseStream(t).on("tag:endblock",function(){this.stop()}).on("template",r=>this.tpls.push(r)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}).start()},*render(e,t){let i=this.getBlockRender(e);e.getRegister("blockMode")===j.STORE?e.getRegister("blocks")[this.block]=i:yield i(new oe,t)},getBlockRender(e){let{liquid:t,tpls:i}=this,r=e.getRegister("blocks")[this.block],s=function*(n,o){e.push({block:n}),yield t.renderer.renderTemplates(i,e,o),e.pop()};return r?(n,o)=>r(new oe(()=>s(n,o)),o):s}},Jr={parse:function(e,t){this.tokens=[];let i=this.liquid.parser.parseStream(t);i.on("token",r=>{r.name==="endraw"?i.stop():this.tokens.push(r)}).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}),i.start()},render:function(){return this.tokens.map(e=>e.getText()).join("")}},Re=class extends J{constructor(t,i,r,s){super(t,r,s),this.length=t,this.cols=i}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return this.col0()===0}col_last(){return this.col()===this.cols}},Gr={parse:function(e,t){let i=new m(e.args,this.liquid.options.operatorsTrie),r=i.readIdentifier();i.skipBlank();let s=i.readIdentifier();g(s&&s.content==="in",()=>`illegal tag: ${e.getText()}`),this.variable=r.content,this.collection=i.readValue(),this.hash=new P(i.remaining()),this.templates=[];let n,o=this.liquid.parser.parseStream(t).on("start",()=>n=this.templates).on("tag:endtablerow",()=>o.stop()).on("template",l=>n.push(l)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)});o.start()},render:function*(e,t){let i=Qe(yield w(this.collection,e)),r=yield this.hash.render(e),s=r.offset||0,n=r.limit===void 0?i.length:r.limit;i=i.slice(s,s+n);let o=r.cols||i.length,l=this.liquid.renderer,a=new Re(i.length,o,this.collection.getText(),this.variable),u={tablerowloop:a};e.push(u);for(let d=0;d<i.length;d++,a.next())u[this.variable]=i[d],a.col0()===0&&(a.row()!==1&&t.write("</tr>"),t.write(`<tr class="row${a.row()}">`)),t.write(`<td class="col${a.col()}">`),yield l.renderTemplates(this.templates,e,t),t.write("</td>");i.length&&t.write("</tr>"),e.pop()}},Zr={parse:function(e,t){this.branches=[],this.elseTemplates=[];let i;this.liquid.parser.parseStream(t).on("start",()=>this.branches.push({predicate:new k(e.args,this.liquid),test:je,templates:i=[]})).on("tag:elsif",r=>this.branches.push({predicate:new k(r.args,this.liquid),test:N,templates:i=[]})).on("tag:else",()=>i=this.elseTemplates).on("tag:endunless",function(){this.stop()}).on("template",r=>i.push(r)).on("end",()=>{throw new Error(`tag ${e.getText()} not closed`)}).start()},render:function*(e,t){let i=this.liquid.renderer;for(let{predicate:r,test:s,templates:n}of this.branches){let o=yield r.value(e,e.opts.lenientIf);if(s(o,e)){yield i.renderTemplates(n,e,t);return}}yield i.renderTemplates(this.elseTemplates,e,t)}},Xr={render:function(e,t){t.break=!0}},Kr={render:function(e,t){t.continue=!0}},es={parse:function(e){this.value=new k(e.args,this.liquid)},render:function*(e,t){let i=yield this.value.value(e,!1);t.write(i)}},ts={parse:function(e){let i=new m(e.args,this.liquid.options.operatorsTrie).readLiquidTagTokens(this.liquid.options);this.tpls=this.liquid.parser.parseTokens(i)},render:function*(e,t){yield this.liquid.renderer.renderTemplates(this.tpls,e,t)}},is={parse:function(e,t){if(e.args.search(/\n\s*[^#\s]/g)!==-1)throw new Error("every line of an inline comment must start with a '#' character")}},rs={assign:Ir,for:Er,capture:Cr,case:Ur,comment:zr,include:Wr,render:Dr,decrement:Vr,increment:Hr,cycle:Br,if:jr,layout:Qr,block:Yr,raw:Jr,tablerow:Gr,unless:Zr,break:Xr,continue:Kr,echo:es,liquid:ts,"#":is};var It=new Map;le(Ft,(e,t)=>{It.set(ue(t),e)});var E={root:["."],layouts:["."],partials:["."],relativeReference:!0,jekyllInclude:!1,cache:void 0,extname:"",fs:Jt,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!1,lenientIf:!1,globals:{},keepOutputType:!1,operators:rt,operatorsTrie:_t(rt)};function ss(e){if(e.hasOwnProperty("operators")&&(e.operatorsTrie=_t(e.operators)),e.hasOwnProperty("root")&&(e.hasOwnProperty("partials")||(e.partials=e.root),e.hasOwnProperty("layouts")||(e.layouts=e.root)),e.hasOwnProperty("cache")){let t;typeof e.cache=="number"?t=e.cache>0?new te(e.cache):void 0:typeof e.cache=="object"?t=e.cache:t=e.cache?new te(1024):void 0,e.cache=t}return e=Object.assign(Object.assign(Object.assign({},E),e.jekyllInclude?{dynamicPartials:!1}:{}),e),!e.fs.dirname&&e.relativeReference&&(console.warn("[LiquidJS] `fs.dirname` is required for relativeReference, set relativeReference to `false` to suppress this warning, or provide implementation for `fs.dirname`"),e.relativeReference=!1),e.root=Z(e.root),e.partials=Z(e.partials),e.layouts=Z(e.layouts),e.outputEscape=e.outputEscape&&ns(e.outputEscape),e}function ns(e){if(L(e)){let t=It.get(e);return g(q(t),`filter "${e}" not found`),t}else return g(q(e),"`outputEscape` need to be of type string or function"),e}function Z(e){let t=[];return T(e)&&(t=e),L(e)&&(t=[e]),t}var C=class{constructor(t={},i=E,r={}){var s,n;this.scopes=[{}],this.registers={},this.sync=!!r.sync,this.opts=i,this.globals=(s=r.globals)!==null&&s!==void 0?s:i.globals,this.environments=t,this.strictVariables=(n=r.strictVariables)!==null&&n!==void 0?n:this.opts.strictVariables}getRegister(t){return this.registers[t]=this.registers[t]||{}}setRegister(t,i){return this.registers[t]=i}saveRegister(...t){return t.map(i=>[i,this.getRegister(i)])}restoreRegister(t){return t.forEach(([i,r])=>this.setRegister(i,r))}getAll(){return[this.globals,this.environments,...this.scopes].reduce((t,i)=>X(t,i),{})}get(t){return M(this._get(t))}*_get(t){let i=this.findScope(t[0]);return yield this._getFromScope(i,t)}getFromScope(t,i){return M(this._getFromScope(t,i))}*_getFromScope(t,i){L(i)&&(i=i.split("."));for(let r=0;r<i.length;r++)if(t=yield os(t,i[r],this.opts.ownPropertyOnly),I(t)&&this.strictVariables)throw new pe(i.slice(0,r+1).join("."));return t}push(t){return this.scopes.push(t)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}findScope(t){for(let i=this.scopes.length-1;i>=0;i--){let r=this.scopes[i];if(t in r)return r}return t in this.environments?this.environments:this.globals}};function os(e,t,i){if(I(e))return e;if(e=gt(e),T(e)&&t<0)return e[e.length+ +t];let r=as(e,t,i);return r===void 0&&e instanceof x?e.liquidMethodMissing(t):q(r)?r.call(e):t==="size"?cs(e):t==="first"?ls(e):t==="last"?us(e):r}function as(e,t,i){if(!(i&&!Object.hasOwnProperty.call(e,t)))return e[t]}function ls(e){return T(e)?e[0]:e.first}function us(e){return T(e)?e[e.length-1]:e.last}function cs(e){if(e.hasOwnProperty("size")||e.size!==void 0)return e.size;if(T(e)||L(e))return e.length;if(typeof e=="object")return Object.keys(e).length}var $;(function(e){e.Partials="partials",e.Layouts="layouts",e.Root="root"})($||($={}));var xe=class{constructor(t){if(this.options=t,t.relativeReference){let i=t.fs.sep;g(i,"`fs.sep` is required for relative reference");let r=new RegExp(["."+i,".."+i,"./","../"].map(s=>Ct(s)).join("|"));this.shouldLoadRelative=s=>r.test(s)}else this.shouldLoadRelative=i=>!1;this.contains=this.options.fs.contains||(()=>!0)}*lookup(t,i,r,s){let{fs:n}=this.options,o=this.options[i];for(let l of this.candidates(t,o,s,i!==$.Root))if(r?n.existsSync(l):yield n.exists(l))return l;throw this.lookupError(t,o)}*candidates(t,i,r,s){let{fs:n,extname:o}=this.options;if(this.shouldLoadRelative(t)&&r){let l=n.resolve(this.dirname(r),t,o);for(let a of i)if(!s||this.contains(a,l)){yield l;break}}for(let l of i){let a=n.resolve(l,t,o);(!s||this.contains(l,a))&&(yield a)}if(n.fallback!==void 0){let l=n.fallback(t);l!==void 0&&(yield l)}}dirname(t){let i=this.options.fs;return g(i.dirname,"`fs.dirname` is required for relative reference"),i.dirname(t)}lookupError(t,i){let r=new Error("ENOENT");return r.message=`ENOENT: Failed to lookup "${t}" in "${i}"`,r.code="ENOENT",r}},Pe=class{constructor(){this.buffer=""}write(t){this.buffer+=c(t)}},Ie=class{constructor(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")}},Ee=class{constructor(){this.buffer=""}write(t){t=h(t),typeof t!="string"&&this.buffer===""?this.buffer=t:this.buffer=c(this.buffer)+c(t)}},Ne=class{renderTemplatesToNodeStream(t,i){let r=new Ie;return Promise.resolve().then(()=>A(this.renderTemplates(t,i,r))).then(()=>r.end(),s=>r.error(s)),r.stream}*renderTemplates(t,i,r){r||(r=i.opts.keepOutputType?new Ee:new Pe);for(let s of t)try{let n=yield s.render(i,r);if(n&&r.write(n),r.break||r.continue)break}catch(n){throw ie.is(n)?n:new ie(n,s)}return r.buffer}},G=class{constructor(t){this.token=t}},Ae=class extends G{constructor(t,i,r){super(t),this.name=t.name;let s=r.tags.get(t.name);this.impl=Object.create(s),this.impl.liquid=r,this.impl.parse&&this.impl.parse(t,i)}*render(t,i){let r=yield new P(this.token.args).render(t),s=this.impl;if(q(s.render))return yield s.render(t,i,r)}},Me=class extends G{constructor(t,i){super(t),this.value=new k(t.content,i);let r=this.value.filters,s=i.options.outputEscape;r.length&&r[r.length-1].name==="raw"?r.pop():s&&r.push(new Y(toString.call(s),s,[],i))}*render(t,i){let r=yield this.value.value(t,!1);i.write(r)}},Ce=class extends G{constructor(t){super(t),this.str=t.getContent()}*render(t,i){i.write(this.str)}},$e=class{constructor(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new xe(this.liquid.options)}parse(t,i){let s=new m(t,this.liquid.options.operatorsTrie,i).readTopLevelTokens(this.liquid.options);return this.parseTokens(s)}parseTokens(t){let i,r=[];for(;i=t.shift();)r.push(this.parseToken(i,t));return r}parseToken(t,i){try{return Je(t)?new Ae(t,i,this.liquid):fr(t)?new Me(t,this.liquid):new Ce(t)}catch(r){throw new he(r,t)}}parseStream(t){return new Fe(t,(i,r)=>this.parseToken(i,r))}*_parseFileCached(t,i,r=$.Root,s){let n=this.cache,o=this.loader.shouldLoadRelative(t)?s+","+t:r+":"+t,l=yield n.read(o);if(l)return l;let a=this._parseFile(t,i,r,s),u=i?yield a:A(a);n.write(o,u);try{return yield u}catch(d){throw n.remove(o),d}}*_parseFile(t,i,r=$.Root,s){let n=yield this.loader.lookup(t,r,i,s);return this.liquid.parse(i?this.fs.readFileSync(n):yield this.fs.readFile(n),n)}},Ue=class{constructor(){this.impls={}}get(t){let i=this.impls[t];return g(i,()=>`tag "${t}" not found`),i}set(t,i){this.impls[t]=i}},ze=class{constructor(t,i){this.strictFilters=t,this.liquid=i,this.impls={}}get(t){let i=this.impls[t];return g(i||!this.strictFilters,()=>`undefined filter: ${t}`),i}set(t,i){this.impls[t]=i}create(t,i){return new Y(t,this.get(t),i,this.liquid)}};var W=class{constructor(t={}){this.options=ss(t),this.parser=new $e(this),this.renderer=new Ne,this.filters=new ze(this.options.strictFilters,this),this.tags=new Ue,le(rs,(i,r)=>this.registerTag(ue(r),i)),le(Ft,(i,r)=>this.registerFilter(ue(r),i))}parse(t,i){return this.parser.parse(t,i)}_render(t,i,r){let s=new C(i,this.options,r);return this.renderer.renderTemplates(t,s)}render(t,i,r){return F(this,void 0,void 0,function*(){return A(this._render(t,i,Object.assign(Object.assign({},r),{sync:!1})))})}renderSync(t,i,r){return M(this._render(t,i,Object.assign(Object.assign({},r),{sync:!0})))}renderToNodeStream(t,i,r={}){let s=new C(i,this.options,r);return this.renderer.renderTemplatesToNodeStream(t,s)}_parseAndRender(t,i,r){let s=this.parse(t);return this._render(s,i,r)}parseAndRender(t,i,r){return F(this,void 0,void 0,function*(){return A(this._parseAndRender(t,i,Object.assign(Object.assign({},r),{sync:!1})))})}parseAndRenderSync(t,i,r){return M(this._parseAndRender(t,i,Object.assign(Object.assign({},r),{sync:!0})))}_parsePartialFile(t,i,r){return this.parser.parseFile(t,i,$.Partials,r)}_parseLayoutFile(t,i,r){return this.parser.parseFile(t,i,$.Layouts,r)}parseFile(t){return F(this,void 0,void 0,function*(){return A(this.parser.parseFile(t,!1))})}parseFileSync(t){return M(this.parser.parseFile(t,!0))}renderFile(t,i,r){return F(this,void 0,void 0,function*(){let s=yield this.parseFile(t);return this.render(s,i,r)})}renderFileSync(t,i,r){let s=this.parseFileSync(t);return this.renderSync(s,i,r)}renderFileToNodeStream(t,i,r){return F(this,void 0,void 0,function*(){let s=yield this.parseFile(t);return this.renderToNodeStream(s,i,r)})}_evalValue(t,i){let r=new k(t,this),s=i instanceof C?i:new C(i,this.options);return r.value(s,!1)}evalValue(t,i){return F(this,void 0,void 0,function*(){return A(this._evalValue(t,i))})}evalValueSync(t,i){return M(this._evalValue(t,i))}registerFilter(t,i){this.filters.set(t,i)}registerTag(t,i){this.tags.set(t,i)}plugin(t){return t.call(this,W)}express(){let t=this,i=!0;return function(r,s,n){if(i){i=!1;let o=Z(this.root);t.options.root.unshift(...o),t.options.layouts.unshift(...o),t.options.partials.unshift(...o)}t.renderFile(r,s).then(o=>n(null,o),n)}}};import{html as hs}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/lit-html/+esm";import{unsafeStatic as ds}from"https://cdn.jsdelivr.net/npm/lit-html@2.4.0/static/+esm";var Ke=e=>function(){let t=a=>{var u;return e.utils.url.getVariantUrl(a.url,(u=a.selected_variant)==null?void 0:u.id)},i=(a,...u)=>e.utils.url.getImageUrl(a,Et(u)),r=(a="")=>e.utils.url.getFileUrl(a),s=(a="",u)=>e.utils.url.getImageUrl({src:e.utils.url.getFileUrl(a.replace(".",`_${u}.`))}),n=a=>e.utils.money.formatMoney(a),o=(a,...u)=>u.length?this.parseAndRenderSync(e.utils.locale.translate(a),Et(u)):e.utils.locale.translate(a),l=(a="")=>a.toLowerCase().trim().replace(/[^a-zA-Z0-9]/g,"-").replace(/[-]{2,}/g,"-");this.registerFilter("variant_url",t),this.registerFilter("image_url",i),this.registerFilter("file_url",r),this.registerFilter("file_img_url",s),this.registerFilter("money",n),this.registerFilter("t",o),this.registerFilter("handle",l),this.registerFilter("handleize",l)},Et=e=>e.reduce((t,[i,r])=>r?{...t,[i]:r}:t,{});import{WishlistElement as ps}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/wishlist-element.js";var et=class extends ps{static get properties(){return{}}init(){super.init(),this.dataUtil=new V({utils:this.app.utils}),this.globals={settings:{login_required:this.app.settings.loginRequired},customer:this.app.customer,shop:{currency:this.app.config.shop.currency,customer_accounts_enabled:this.app.config.shop.customerAccountsEnabled,domain:this.app.config.shop.domain,money_format:this.app.config.shop.moneyFormat,name:this.app.config.shop.name,permanent_domain:this.app.config.shop.permanentDomain},routes:{root_url:this.app.routes.rootUrl,wishlist_url:this.app.routes.wishlistUrl,account_url:this.app.routes.accountUrl,account_login_url:this.app.routes.accountLoginUrl,account_logout_url:this.app.routes.accountLogoutUrl,account_register_url:this.app.routes.accountRegisterUrl,account_addresses_url:this.app.routes.accountAddressesUrl,collections_url:this.app.routes.collectionsUrl,all_products_collection_url:this.app.routes.allProductsCollectionUrl,search_url:this.app.routes.searchUrl,predictive_search_url:this.app.routes.predictiveSearchUrl,cart_url:this.app.routes.cartUrl,cart_add_url:this.app.routes.cartAddUrl,cart_change_url:this.app.routes.cartChangeUrl,cart_clear_url:this.app.routes.cartClearUrl,cart_update_url:this.app.routes.cartUpdateUrl,product_recommendations_url:this.app.routes.productRecommendationsUrl}},this.liquidEngine=new W({cache:!0,relativeReference:!1}),this.liquidEngine.plugin(Ke(this.app)),this.initTemplate()}disconnectedCallback(){super.disconnectedCallback(),this.parsedTemplates=void 0}getLiquidTemplate(){return""}getLiquidData(){return{}}initTemplate(){if(this.parsedTemplates)return this.parsedTemplates;if(!this.liquidEngine)throw new Error("Liquid engine not initialized");return this.parsedTemplates=this.liquidEngine.parse(this.getLiquidTemplate()),this.parsedTemplates}render(){var l,a;if(!this.parsedTemplates||!this.liquidEngine||!this.dataUtil)return;let{wishlist:i,wishlistItem:r,productInfo:s}=(l=this.state)!=null?l:{},n={...this.dataUtil.objectToSnakeCase(this.getLiquidData()),wishlist:i?this.dataUtil.mapWishlistState(i,(a=this.stateCtrl.stateConfig.wishlist)==null?void 0:a.format):void 0,wishlist_item:r?this.dataUtil.mapWishlistItem(r):void 0,product_info:s?this.dataUtil.mapProductInfo(s):void 0},o=this.liquidEngine.renderSync(this.parsedTemplates,n,{globals:this.globals});return hs`${ds(o)}`}};export{V as LiquidDataUtil,et as LiquidElement,Ke as liquidShopifyFilters}; |
{ | ||
"name": "@appmate/wishlist", | ||
"version": "4.15.5", | ||
"version": "4.15.6", | ||
"description": "Wishlist King SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,1 +0,1 @@ | ||
import{lastValueFrom as r}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";import{WishlistState as m}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/state.js";import{ShopifyApi as p,WishlistApi as u,TrackingApi as g}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/api.js";import{RouteUtil as y,SessionUtil as W,LocaleUtil as f,MoneyUtil as P,UrlUtil as w,ProductUtil as U,WishlistEvents as v,DomUtil as I}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/utils.js";var d=class{constructor({settings:t,stylesheets:a,...i}){this.stylesLoaded=!1;var o,e;this.config=this.parseConfig(i),this.settings={...t,loginRequired:!!t.loginRequired&&!this.config.customer.id},this.events=new v,this.routes=this.parseRoutes(),this.customer=this.config.customer.id?{id:this.config.customer.id,email:this.config.customer.email}:null,this.utils=this.initUtils(),this.apis={wishlist:new u({host:this.config.routes.apiHost,shop:window.Shopify.shop,customerId:(o=this.config.customer.id)!=null?o:void 0,sessionId:this.utils.session.getSessionId(),trackingSource:this.utils.route.parse(window.location.pathname).pageType}),shopify:new p({host:window.Shopify.routes.root.substring(0,window.Shopify.routes.root.length-1)}),tracking:new g({notifyHost:this.config.routes.apiHost,events:this.events,shop:window.Shopify.shop,customerId:(e=this.config.customer.id)!=null?e:void 0,sessionId:this.utils.session.getSessionId(),utils:this.utils,settings:t})},this.state=new m({wishlistApi:this.apis.wishlist,shopifyApi:this.apis.shopify,settings:this.settings,events:this.events,utils:this.utils}),this.addToCart=(...s)=>r(this.state.addToCart(...s)),this.addAllToCart=(...s)=>r(this.state.addAllToCart(...s)),this.addWishlistItem=(...s)=>r(this.state.addWishlistItem(...s)),this.clearWishlist=(...s)=>r(this.state.clearWishlist(...s)),this.loadProductInfo=(...s)=>r(this.state.loadProductInfo(...s)),this.loadShopifyProduct=(...s)=>r(this.state.loadShopifyProduct(...s)),this.loadWishlist=(...s)=>r(this.state.loadWishlist(...s)),this.loadWishlistItem=(...s)=>r(this.state.loadWishlistItem(...s)),this.loadWishlistProduct=(...s)=>r(this.state.loadWishlistProduct(...s)),this.publishWishlistEvent=(...s)=>r(this.state.publishWishlistEvent(...s)),this.publishWishlistItemEvent=(...s)=>r(this.state.publishWishlistItemEvent(...s)),this.removeWishlistItem=(...s)=>r(this.state.removeWishlistItem(...s)),this.shareWishlist=(...s)=>r(this.state.shareWishlist(...s)),this.updateWishlistItem=(...s)=>r(this.state.updateWishlistItem(...s)),this.initStyles(a),this.initUrlChangeEvents(),this.trackCurrentPage(),requestAnimationFrame(()=>{this.events.publish({name:"wk:app:ready"})})}async initStyles(t){if(!(t!=null&&t.length)){this.onStylesLoaded();return}try{await Promise.all(t.map(a=>new Promise((i,o)=>{let e=document.createElement("link");e.rel="stylesheet",e.href=a,e.onload=i,e.onerror=o,document.head.appendChild(e)}))),this.onStylesLoaded()}catch(a){console.warn(a),this.events.publish({name:"wk:app:load-styles:error"})}}trackCurrentPage(){let t=this.utils.route.parse(window.location.pathname).pageType;if(t!=null&&t.includes("wishlist")){let a=this.utils.url.getWishlistIdFromUrl(window.location.pathname);a&&this.publishWishlistEvent({eventName:"wk:wishlist:page-view",wishlistId:a})}}onStylesLoaded(){this.stylesLoaded=!0,this.events.publish({name:"wk:app:load-styles:success"})}initUtils(){let t=this.config.shop.domain,a=this.config.products.fallbackImage,i=this.config.shop.moneyFormat,o=this.config.locale,e=new y({wishlistUrl:this.routes.wishlistUrl});return{url:new w({rootUrl:this.routes.rootUrl,wishlistUrl:this.routes.wishlistUrl,shopDomain:t,placeholderImageUrl:a,fileUrl:this.routes.fileUrl}),money:new P({moneyFormat:i,currencyRate:parseFloat(window.Shopify.currency.rate),activeCurrency:window.Shopify.currency.active}),product:new U,locale:new f({locale:o}),route:e,dom:new I({routeUtil:e}),session:new W}}initUrlChangeEvents(){let t=history.replaceState,a=({productHandle:i,variantId:o})=>{this.events.publish({name:"wk:product:change-variant:success",data:{productHandle:i,variantId:o}})};history.replaceState=(...i)=>{let o=`${window.location.protocol}//${window.location.host}`,e=typeof i[2]=="string"?new URL(i[2],o):i[2],s=t.apply(history,i);if(!e)return s;let l=this.utils.url.getProductHandleFromUrl(e),n=e.searchParams.get("variant");if(!l||!n)return s;a({productHandle:l,variantId:parseInt(n)})}}parseConfig({config:t,locale:a}){var i,o,e,s,l,n,h,c;return{customer:{id:t.customerId?parseInt(t.customerId):null,email:(i=t.customerEmail)!=null?i:""},shop:{name:(o=t.shopName)!=null?o:"",domain:(e=t.shopDomain)!=null?e:"",permanentDomain:(s=t.shopPermanentDomain)!=null?s:"",currency:(l=t.shopCurrency)!=null?l:"",moneyFormat:(n=t.shopMoneyFormat)!=null?n:"",customerAccountsEnabled:t.shopCustomerAccountsEnabled?t.shopCustomerAccountsEnabled==="true":!1},routes:{apiHost:(h=t.apiHost)!=null?h:"https://api.appmate.io/v2",rootUrl:window.Shopify.routes.root,fileUrl:t.fileUrl},products:{fallbackImage:(c=t.productFallbackImage)!=null?c:"//cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_large.png?format=webp&v=1530129081"},locale:a}}parseRoutes(){var i;let t=this.config.routes.rootUrl,a=(i=this.settings.wishlistPath)!=null?i:"/apps/wishlist";return{rootUrl:t,fileUrl:this.config.routes.fileUrl,wishlistUrl:t+a.split("/").filter(o=>!!o).join("/"),accountUrl:t+"account",accountLoginUrl:t+"account/login",accountLogoutUrl:t+"account/logout",accountRegisterUrl:t+"account/register",accountAddressesUrl:t+"account/addresses",collectionsUrl:t+"collections",allProductsCollectionUrl:t+"collections/all",searchUrl:t+"search",predictiveSearchUrl:t+"search/suggest",cartUrl:t+"cart",cartAddUrl:t+"cart/add",cartChangeUrl:t+"cart/change",cartClearUrl:t+"cart/clear",cartUpdateUrl:t+"cart/update",productRecommendationsUrl:t+"recommendations/products"}}};export{d as WishlistApp}; | ||
import{lastValueFrom as r}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";import{WishlistState as m}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/state.js";import{ShopifyApi as p,WishlistApi as u,TrackingApi as g}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/api.js";import{RouteUtil as y,SessionUtil as W,LocaleUtil as f,MoneyUtil as P,UrlUtil as w,ProductUtil as U,WishlistEvents as v,DomUtil as I}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/utils.js";var d=class{constructor({settings:t,stylesheets:a,...i}){this.stylesLoaded=!1;var o,e;this.config=this.parseConfig(i),this.settings={...t,loginRequired:!!t.loginRequired&&!this.config.customer.id},this.events=new v,this.routes=this.parseRoutes(),this.customer=this.config.customer.id?{id:this.config.customer.id,email:this.config.customer.email}:null,this.utils=this.initUtils(),this.apis={wishlist:new u({host:this.config.routes.apiHost,shop:window.Shopify.shop,customerId:(o=this.config.customer.id)!=null?o:void 0,sessionId:this.utils.session.getSessionId(),trackingSource:this.utils.route.parse(window.location.pathname).pageType}),shopify:new p({host:window.Shopify.routes.root.substring(0,window.Shopify.routes.root.length-1)}),tracking:new g({notifyHost:this.config.routes.apiHost,events:this.events,shop:window.Shopify.shop,customerId:(e=this.config.customer.id)!=null?e:void 0,sessionId:this.utils.session.getSessionId(),utils:this.utils,settings:t})},this.state=new m({wishlistApi:this.apis.wishlist,shopifyApi:this.apis.shopify,settings:this.settings,events:this.events,utils:this.utils}),this.addToCart=(...s)=>r(this.state.addToCart(...s)),this.addAllToCart=(...s)=>r(this.state.addAllToCart(...s)),this.addWishlistItem=(...s)=>r(this.state.addWishlistItem(...s)),this.clearWishlist=(...s)=>r(this.state.clearWishlist(...s)),this.loadProductInfo=(...s)=>r(this.state.loadProductInfo(...s)),this.loadShopifyProduct=(...s)=>r(this.state.loadShopifyProduct(...s)),this.loadWishlist=(...s)=>r(this.state.loadWishlist(...s)),this.loadWishlistItem=(...s)=>r(this.state.loadWishlistItem(...s)),this.loadWishlistProduct=(...s)=>r(this.state.loadWishlistProduct(...s)),this.publishWishlistEvent=(...s)=>r(this.state.publishWishlistEvent(...s)),this.publishWishlistItemEvent=(...s)=>r(this.state.publishWishlistItemEvent(...s)),this.removeWishlistItem=(...s)=>r(this.state.removeWishlistItem(...s)),this.shareWishlist=(...s)=>r(this.state.shareWishlist(...s)),this.updateWishlistItem=(...s)=>r(this.state.updateWishlistItem(...s)),this.initStyles(a),this.initUrlChangeEvents(),this.trackCurrentPage(),requestAnimationFrame(()=>{this.events.publish({name:"wk:app:ready"})})}async initStyles(t){if(!(t!=null&&t.length)){this.onStylesLoaded();return}try{await Promise.all(t.map(a=>new Promise((i,o)=>{let e=document.createElement("link");e.rel="stylesheet",e.href=a,e.onload=i,e.onerror=o,document.head.appendChild(e)}))),this.onStylesLoaded()}catch(a){console.warn(a),this.events.publish({name:"wk:app:load-styles:error"})}}trackCurrentPage(){let t=this.utils.route.parse(window.location.pathname).pageType;if(t!=null&&t.includes("wishlist")){let a=this.utils.url.getWishlistIdFromUrl(window.location.pathname);a&&this.publishWishlistEvent({eventName:"wk:wishlist:page-view",wishlistId:a})}}onStylesLoaded(){this.stylesLoaded=!0,this.events.publish({name:"wk:app:load-styles:success"})}initUtils(){let t=this.config.shop.domain,a=this.config.products.fallbackImage,i=this.config.shop.moneyFormat,o=this.config.locale,e=new y({wishlistUrl:this.routes.wishlistUrl});return{url:new w({rootUrl:this.routes.rootUrl,wishlistUrl:this.routes.wishlistUrl,shopDomain:t,placeholderImageUrl:a,fileUrl:this.routes.fileUrl}),money:new P({moneyFormat:i,currencyRate:parseFloat(window.Shopify.currency.rate),activeCurrency:window.Shopify.currency.active}),product:new U,locale:new f({locale:o}),route:e,dom:new I({routeUtil:e}),session:new W}}initUrlChangeEvents(){let t=history.replaceState,a=({productHandle:i,variantId:o})=>{this.events.publish({name:"wk:product:change-variant:success",data:{productHandle:i,variantId:o}})};history.replaceState=(...i)=>{let o=`${window.location.protocol}//${window.location.host}`,e=typeof i[2]=="string"?new URL(i[2],o):i[2],s=t.apply(history,i);if(!e)return s;let l=this.utils.url.getProductHandleFromUrl(e),n=e.searchParams.get("variant");if(!l||!n)return s;a({productHandle:l,variantId:parseInt(n)})}}parseConfig({config:t,locale:a}){var i,o,e,s,l,n,h,c;return{customer:{id:t.customerId?parseInt(t.customerId):null,email:(i=t.customerEmail)!=null?i:""},shop:{name:(o=t.shopName)!=null?o:"",domain:(e=t.shopDomain)!=null?e:"",permanentDomain:(s=t.shopPermanentDomain)!=null?s:"",currency:(l=t.shopCurrency)!=null?l:"",moneyFormat:(n=t.shopMoneyFormat)!=null?n:"",customerAccountsEnabled:t.shopCustomerAccountsEnabled?t.shopCustomerAccountsEnabled==="true":!1},routes:{apiHost:(h=t.apiHost)!=null?h:"https://api.appmate.io/v2",rootUrl:window.Shopify.routes.root,fileUrl:t.fileUrl},products:{fallbackImage:(c=t.productFallbackImage)!=null?c:"//cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_large.png?format=webp&v=1530129081"},locale:a}}parseRoutes(){var i;let t=this.config.routes.rootUrl,a=(i=this.settings.wishlistPath)!=null?i:"/apps/wishlist";return{rootUrl:t,fileUrl:this.config.routes.fileUrl,wishlistUrl:t+a.split("/").filter(o=>!!o).join("/"),accountUrl:t+"account",accountLoginUrl:t+"account/login",accountLogoutUrl:t+"account/logout",accountRegisterUrl:t+"account/register",accountAddressesUrl:t+"account/addresses",collectionsUrl:t+"collections",allProductsCollectionUrl:t+"collections/all",searchUrl:t+"search",predictiveSearchUrl:t+"search/suggest",cartUrl:t+"cart",cartAddUrl:t+"cart/add",cartChangeUrl:t+"cart/change",cartClearUrl:t+"cart/clear",cartUpdateUrl:t+"cart/update",productRecommendationsUrl:t+"recommendations/products"}}};export{d as WishlistApp}; |
@@ -1,1 +0,1 @@ | ||
var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var u=(o,a,t,e)=>{for(var n=e>1?void 0:e?v(a,t):a,s=o.length-1,i;s>=0;s--)(i=o[s])&&(n=(e?i(a,t,n):i(n))||n);return e&&n&&f(a,t,n),n};import{from as g,fromEvent as c,isObservable as h,of as d}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";import{filter as y,first as b,switchMap as m,tap as p}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/operators/+esm";import{state as C}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{LitElement as S}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{WishlistStateController as E}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.5/controllers.js";var l=class extends S{constructor(){super();this.connected=!1;this.cleanupMethods=[];this.eventPending=!1;this.state={};this.stateCtrl=new E(this)}get app(){return this.stateCtrl.app}static get observedAttributes(){return[...super.observedAttributes,"data-wishlist-id","data-wishlist-item-id","data-product-handle","data-product-id","data-variant-id"]}appReadyCallback(){}beforeNextState(t){}connect(){if(!this.connected){if(!window.WishlistKing){c(document,"wk:app:ready").pipe(b()).subscribe(()=>this.connect());return}if(!this.app.stylesLoaded){c(document,"wk:app:load-styles:success").pipe(b()).subscribe(()=>this.connect());return}this.connected=!0,this.init(),this.appReadyCallback()}}getStateConfig(){return{}}getTranslation(t){var e;return(e=window.WishlistKing)!=null&&e.utils.locale?window.WishlistKing.utils.locale.translate(t):t}init(){let{loading:t}=this.getStateConfig();t==="lazy"?(this.initFallbackState(),this.initObserver()):this.initState()}updateState(t){var e;this.state={...(e=this.state)!=null?e:{},...t}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.innerHTML="",this.initEvents(),this.connect()}disconnectedCallback(){var t,e;super.disconnectedCallback(),this.connected=!1,this.cleanupMethods.forEach(n=>n()),(t=this.subscription)==null||t.unsubscribe(),(e=this.observer)==null||e.disconnect()}attributeChangedCallback(t,e,n){super.attributeChangedCallback(t,e,n),this.connected&&this.initState("cache-first")}shouldUpdate(t){return this.connected?super.shouldUpdate(t):!1}initState(t){this.subscription&&this.subscription.unsubscribe(),this.subscription=this.stateCtrl.observe(t).subscribe(e=>{this.updateState(e)})}initFallbackState(){let t=this.stateCtrl.getFallback();t&&this.updateState(t)}initObserver(){this.observer=new IntersectionObserver(t=>this.handleIntersect(t),{root:null,rootMargin:"0px"}),this.observer.observe(this)}handleIntersect([t]){var e;t.isIntersecting&&((e=this.observer)==null||e.disconnect(),this.initState())}getEventConfig(){return{}}initEvents(){let t=this.getEventConfig();if(!t)return;let e=Object.entries(t).map(([n,s])=>{let[i,r]=n.split(/ (.*)/s);return this.subscribeToEvent({eventName:i,selector:r,handler:s})});this.cleanupMethods.push(()=>e.forEach(n=>n.unsubscribe()))}subscribeToEvent({eventName:t,handler:e,selector:n}){return c(this,t).pipe(p(s=>{this.eventPending&&s.preventDefault()}),y(()=>!this.eventPending),p(()=>{this.eventPending=!0}),m(s=>{let i=null;if(n&&s.target instanceof HTMLElement&&(i=s.target.closest(n)),n&&!i)return d(null);let r=e.bind(this)(s,n?i:s.currentTarget);return h(r)?r:typeof(r==null?void 0:r.then)=="function"?g(r):d(r)})).subscribe(()=>{this.eventPending=!1})}unlessEventPending(t){let e=()=>this.eventPending=!0,n=()=>this.eventPending=!1;return s=>{if(this.eventPending){t.preventDefault();return}e();let i=s.bind(this)(t);h(i)?i.subscribe(()=>n()):typeof(i==null?void 0:i.then)=="function"?i.then(()=>n()).catch(r=>{throw n(),r}):n()}}};u([C()],l.prototype,"state",2);export{l as WishlistElement}; | ||
var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var u=(o,a,t,e)=>{for(var n=e>1?void 0:e?v(a,t):a,s=o.length-1,i;s>=0;s--)(i=o[s])&&(n=(e?i(a,t,n):i(n))||n);return e&&n&&f(a,t,n),n};import{from as g,fromEvent as c,isObservable as h,of as d}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/+esm";import{filter as y,first as b,switchMap as m,tap as p}from"https://cdn.jsdelivr.net/npm/rxjs@7.5.6/operators/+esm";import{state as C}from"https://cdn.jsdelivr.net/npm/@lit/reactive-element@1.4.2/decorators/+esm";import{LitElement as S}from"https://cdn.jsdelivr.net/npm/lit-element@3.2.2/lit-element/+esm";import{WishlistStateController as E}from"https://cdn.jsdelivr.net/npm/@appmate/wishlist@4.15.6/controllers.js";var l=class extends S{constructor(){super();this.connected=!1;this.cleanupMethods=[];this.eventPending=!1;this.state={};this.stateCtrl=new E(this)}get app(){return this.stateCtrl.app}static get observedAttributes(){return[...super.observedAttributes,"data-wishlist-id","data-wishlist-item-id","data-product-handle","data-product-id","data-variant-id"]}appReadyCallback(){}beforeNextState(t){}connect(){if(!this.connected){if(!window.WishlistKing){c(document,"wk:app:ready").pipe(b()).subscribe(()=>this.connect());return}if(!this.app.stylesLoaded){c(document,"wk:app:load-styles:success").pipe(b()).subscribe(()=>this.connect());return}this.connected=!0,this.init(),this.appReadyCallback()}}getStateConfig(){return{}}getTranslation(t){var e;return(e=window.WishlistKing)!=null&&e.utils.locale?window.WishlistKing.utils.locale.translate(t):t}init(){let{loading:t}=this.getStateConfig();t==="lazy"?(this.initFallbackState(),this.initObserver()):this.initState()}updateState(t){var e;this.state={...(e=this.state)!=null?e:{},...t}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.innerHTML="",this.initEvents(),this.connect()}disconnectedCallback(){var t,e;super.disconnectedCallback(),this.connected=!1,this.cleanupMethods.forEach(n=>n()),(t=this.subscription)==null||t.unsubscribe(),(e=this.observer)==null||e.disconnect()}attributeChangedCallback(t,e,n){super.attributeChangedCallback(t,e,n),this.connected&&this.initState("cache-first")}shouldUpdate(t){return this.connected?super.shouldUpdate(t):!1}initState(t){this.subscription&&this.subscription.unsubscribe(),this.subscription=this.stateCtrl.observe(t).subscribe(e=>{this.updateState(e)})}initFallbackState(){let t=this.stateCtrl.getFallback();t&&this.updateState(t)}initObserver(){this.observer=new IntersectionObserver(t=>this.handleIntersect(t),{root:null,rootMargin:"0px"}),this.observer.observe(this)}handleIntersect([t]){var e;t.isIntersecting&&((e=this.observer)==null||e.disconnect(),this.initState())}getEventConfig(){return{}}initEvents(){let t=this.getEventConfig();if(!t)return;let e=Object.entries(t).map(([n,s])=>{let[i,r]=n.split(/ (.*)/s);return this.subscribeToEvent({eventName:i,selector:r,handler:s})});this.cleanupMethods.push(()=>e.forEach(n=>n.unsubscribe()))}subscribeToEvent({eventName:t,handler:e,selector:n}){return c(this,t).pipe(p(s=>{this.eventPending&&s.preventDefault()}),y(()=>!this.eventPending),p(()=>{this.eventPending=!0}),m(s=>{let i=null;if(n&&s.target instanceof HTMLElement&&(i=s.target.closest(n)),n&&!i)return d(null);let r=e.bind(this)(s,n?i:s.currentTarget);return h(r)?r:typeof(r==null?void 0:r.then)=="function"?g(r):d(r)})).subscribe(()=>{this.eventPending=!1})}unlessEventPending(t){let e=()=>this.eventPending=!0,n=()=>this.eventPending=!1;return s=>{if(this.eventPending){t.preventDefault();return}e();let i=s.bind(this)(t);h(i)?i.subscribe(()=>n()):typeof(i==null?void 0:i.then)=="function"?i.then(()=>n()).catch(r=>{throw n(),r}):n()}}};u([C()],l.prototype,"state",2);export{l as WishlistElement}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 8 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 5 instances in 1 package
66
237034
1046