PageSourceSearch

https://www.granngarden.se/dist/Component.ProductCardFooter.2f9c9336.js

js granngarden.se collected 2026-09-24 18:17:48 UTC 12,222 bytes, 1 lines download raw bytes

1"use strict";(self.fkaWebpackJsonp=self.fkaWebpackJsonp||[]).push([[2305,6944],{3165:(t,e,r)=>{var o;r.d(e,{U:()=>o}),function(t){t[t.None=0]="None",t[t.InventoryInStock=1]="InventoryInStock",t[t.InventoryNotInStock=2]="InventoryNotInStock",t[t.ContactSales=3]="ContactSales",t[t.ForcedPurchaseButton=4]="ForcedPurchaseButton",t[t.StoreOnly=5]="StoreOnly",t[t.TemporarilyOutOfStock=12]="TemporarilyOutOfStock",t[t.OutOfWebStock=13]="OutOfWebStock",t[t.OrderAndBuyInStore=14]="OrderAndBuyInStore"}(o||(o={}))},1626:(t,e,r)=>{var o;r.d(e,{S:()=>o}),function(t){t[t.None=0]="None",t[t.Inherit=1]="Inherit",t[t.Row=2]="Row",t[t.Single=3]="Single",t[t.Double=4]="Double",t[t.Grid=5]="Grid"}(o||(o={}))},5862:(t,e,r)=>{var o;r.d(e,{l:()=>o}),function(t){t[t.None=0]="None",t[t.Product=1]="Product",t[t.Cart=2]="Cart"}(o||(o={}))},7541:(t,e,r)=>{r.d(e,{B:()=>n});var o=r(641),i=r(9590),u=r(8857);const n=(0,o.pM)({props:{productNumber:{type:String,required:!0},initialInventory:Object},computed:{___productInventoryShouldFetch:()=>!0,productInventory(){return{value:this.___productInventoryValue,hasFailed:this.___productInventoryHasFailed,isEmpty:this.___productInventoryQueueStatus===u.an.Fetched&&!this.___productInventoryValue,isFetching:this.___productInventoryIsFetching,queueStatus:this.___productInventoryQueueStatus}},___productInventoryValue(){const{$store:t,initialInventory:e,productNumber:r}=this;return e||(t?(0,i.xy)(t)[r]:void 0)},___productInventoryQueueStatus(){const{$store:t,productNumber:e}=this;if(!t||!e)return null;const r=(0,i.Qf)(t);return Object.prototype.hasOwnProperty.call(r,e)?r[e]:null},___productInventoryIsFetching(){return(0,u.h8)(this.___productInventoryQueueStatus)&&!this.___productInventoryValue},___productInventoryHasFailed(){return this.___productInventoryQueueStatus===u.an.Failed&&!this.___productInventoryValue},___productInventoryIsEmpty(){return this.___productInventoryQueueStatus===u.an.Fetched&&!this.___productInventoryValue}},mounted(){const{$store:t,productNumber:e,productInventory:r}=this;t&&e&&this.___productInventoryShouldFetch&&!r.value&&(0,i.n$)(t,[e])}})},1229:(t,e,r)=>{r.d(e,{m:()=>n});var o=r(641),i=r(9635),u=r(8857);const n=(0,o.pM)({props:{productNumber:{type:String,required:!0}},data:()=>({productVariantNumber:null}),watch:{___productPriceValue(){this.productVariantNumber=this.___productPriceValue?.variantNumber??null}},computed:{___productPriceShouldFetch:()=>!0,productPrice(){return{value:this.___productPriceValue,hasFailed:this.___productPriceHasFailed,isEmpty:this.___productPriceQueueStatus===u.an.Fetched&&!this.___productPriceValue,isFetching:this.___productPriceIsFetching,queueStatus:this.___productPriceQueueStatus,fetched:this.___productPriceFetched}},___productPriceValue(){const{$store:t,productNumber:e,productVariantNumber:r}=this;if(t)return r?(0,i.RP)(t).find((t=>t.productNumber===e&&t.variantNumber===r)):(0,i.RP)(t).find((t=>t.productNumber===e))},___productPriceQueueStatus(){const{$store:t,productNumber:e}=this;if(!t||!e)return null;const r=(0,i.Qf)(t);return Object.prototype.hasOwnProperty.call(r,e)?r[e]:null},___productPriceIsFetching(){return(0,u.h8)(this.___productPriceQueueStatus)&&!this.___productPriceValue},___productPriceHasFailed(){return this.___productPriceQueueStatus===u.an.Failed&&!this.___productPriceValue},___productPriceIsEmpty(){return this.___productPriceQueueStatus===u.an.Fetched&&!this.___productPriceValue},___productPriceFetched(){return(this.___productPriceQueueStatus===u.an.Fetched||this.___productPriceQueueStatus===u.an.Failed)??!1}},mounted(){const{$store:t,productNumber:e,productPrice:r}=this;t&&e&&this.___productPriceShouldFetch&&!r.value&&(0,i.fA)(t,[e])}})},9004:(t,e,r)=>{r.r(e),r.d(e,{default:()=>w});var o=r(641),i=r(33),u=r(3751);const n={key:0,class:"product-card__inventory"},c={key:0,class:"product-card__price--small product-card__price--original"},a={class:"sr-only"},s=["aria-label"],l={class:"product-card__quick-buy--button-text sr-only"},d={key:1,class:"product-card__quick-buy-loading",src:"/UI/Icons/loading-white.svg",alt:"",width:"24",height:"6"},p={class:"sr-only"};var h=r(4324),_=r(1229),y=r(7541),v=r(1626),b=r(3165),m=r(2908),k=r(6998),S=r(9635),g=r(9590),P=r(5052),f=r(5862);
1const I=new Set,N=new Set,B=(0,o.pM)({name:"ProductCardFooter",mixins:[_.m,y.B,(0,h.m)()],emits:["product-status"],components:{Icon:P.A},props:{variant:{type:Number,default:v.S.Row},ticket:String,recommendations:Number,requiresConsent:Boolean,hideBuyButton:Boolean,listName:String,listIndex:Number,productNumber:String,variantNumber:String,stopped:Boolean,sellKfp:Boolean,sellPall:Boolean,quantity:Number},data:()=>({expanded:!1,addingToCart:!1}),watch:{productStatus(){this.$emit("product-status",this.productStatus)}},computed:{___productPriceShouldFetch(){return!this.variantNumber},___productInventoryShouldFetch(){return!this.variantNumber},___productPriceValue(){if(!this.$store)return;if(!this.variantNumber)return this.productVariantNumber?(0,S.RP)(this.$store).find((t=>t.productNumber===this.productNumber&&t.variantNumber===this.productVariantNumber)):(0,S.RP)(this.$store).find((t=>t.productNumber===this.productNumber));const t=(0,S.RP)(this.$store);for(let e=t.length-1;e>=0;e--){const r=t[e];if(r.productNumber===this.productNumber&&r.variantNumber===this.variantNumber)return r}},___productInventoryValue(){return this.variantNumber?this.$store?(0,g.hj)(this.$store)[this.variantNumber]:void 0:this.initialInventory?this.initialInventory:this.$store?(0,g.xy)(this.$store)[this.productNumber]:void 0},isPriceZero(){return!this.productPrice?.value||0===this.productPrice.value?.price},hasVariants(){const{productPrice:t}=this;return null!==t.value?.variantNumber},productStatus(){const{productInventory:t}=this;if(!t.value||!t.value.availabilityInfo?.availabilityStatus)return"loading";switch(t.value.availabilityInfo?.availabilityStatus){case b.U.ContactSales:return"contact-sales";case b.U.StoreOnly:case b.U.OrderAndBuyInStore:return"store-only";case b.U.ForcedPurchaseButton:return"in-stock";case b.U.OutOfWebStock:return"out-of-web-stock";case b.U.TemporarilyOutOfStock:return"temporarily-out-of-stock"}if(this.stopped)return"temporarily-out-of-stock";const{showStoreInventoryStatus:e,showWebInventoryStatus:r}=t.value.availabilityInfo;if(!r&&!e)return"none";let o=null;return o=r?t.value.webInventoryStatus:t.value.storeInventoryStatus,o===m.R.NotInStock?"not-in-stock":o===m.R.FewInStock?"few-in-stock":"in-stock"},inventory(){const{variant:t,productStatus:e,translate:r}=this;switch(e){case"few-in-stock":return{text:r("availability","fewInStock"),class:"availability--few-in-stock"};case"store-only":case"out-of-web-stock":return{text:r("availability","onlyInStore"),class:"availability--store-only"};case"not-in-stock":return{text:r("availability","notInStock"),class:"availability--not-in-stock"};case"upcoming":return{text:r("availability","upcoming"),class:"availability--not-in-stock"};case"temporarily-out-of-stock":return{text:r("availability","temporarilyOutOfStockUnknownDate"),class:"availability--not-in-stock"};case"in-stock":return t===v.S.Row?{text:r("availability","inStock"),class:"availability--in-stock"}:{};default:return{}}},priceText(){const{productStatus:t,productPrice:e,translate:r}=this;return"upcoming"===t?r("price","alertMe"):e.fetched?e.hasFailed?r("price","failedMessage"):e.isEmpty?r("price","choose"):!this.variantNumber&&e.value?.variantNumber?r("price","fromPrice")+" "+e.value.formattedPriceWithDiscount:e.value?e.value.formattedPriceWithDiscount:"":`${r("price","fetching")} ${r("price","price")}`},priceClasses(){const{productPrice:t,inventory:e}=this;return{"product-card__price--short":e.text,"product-card__price--trade-agreement":t.value?.isTradeAgreementPrice,"product-card__price--original":!t.value?.isTradeAgreementPrice&&!t.value?.discountAmount,"product-card__price--discounted":!t.value?.isTradeAgreementPrice&&t.value?.discountAmount}},quickBuyButton(){const{productStatus:t,requiresConsent:e,hasVariants:r,isPriceZero:o,translate:i}=this;if(r||e)return{color:"green",icon:"arrow-right-light",is:"span",text:i("buy")};if(o)return{color:"green",icon:"arrow-right-light",is:"span",text:i("availability","missingPriceOnline")};switch(t){case"in-stock":case"few-in-stock":return{color:"green",icon:"shopping-cart",is:"button",text:i("buy")};case"store-only":return{color:"green",icon:"arrow-right-light",is:"span",text:i("buy"),ariaLabel:i("availability","onlyInStore")};case"not-in-stock":return{color:"white",icon:"cross-small-black",is:"span",text:i("availability","notInStock")};case"temporarily-out-of-stock":return{color:"white",icon:"cross-small-black",is:"span",text:i("availability","temporarilyOutOfStock")};case"out-of-web-stock":return{color:"green",icon:"arrow-right-light",is:"span",text:i("availability","outOfWebStock")};case"upcoming":return{color:"green",icon:"arrow-right-light",is:"span",text:i("availability","upcoming")};case"contact-sales":return{color:"green",icon:"phone",is:"span",text:i("availability","callToOrder")};case"none":return{color:"green",icon:"arrow-right-light",is:"span",text:i("price","choose")};default:return{color:"white",is:"span",text:"",icon:"arrow-right-light"}}}},mounted(){this.$store&&this.productNumber&&this.variantNumber&&(this.productPrice.value||I.has(this.productNumber)||(I.add(this.productNumber),Promise.resolve((0,S.Ro)(this.$store,[this.productNumber])).finally((()=>I.delete(this.productNumber)))),this.productInventory.value||N.has(this.productNumber)||(N.add(this.productNumber),Promise.resolve((0,g.DQ)(this.$store,[this.productNumber])).finally((()=>N.delete(this.productNumber)))))},methods:{async quickBuy(t){t?.preventDefault(),t?.stopPropagation();const{productNumber:e}=this,r=[{lineId:"",productNumber:e,quantity:this.quantity??1}];this.addingToCart=!0,await(0,k.kM)(this.$store,{items:r,addingToCart:!0,recommendations:this.recommendations??f.l.None,listName:this.listName??"",listIndex:this.listIndex??0}),this.addingToCart=!1,this.expanded=!1}}});const w=(0,r(6262).A)(B,[["render",function(t,e,r,h,_,y){const v=(0,o.g2)("icon");return(0,o.uX)(),(0,o.CE)("div",{class:(0,i.C4)(["product-card__footer",{"product-card__footer--show-inventory":t.inventory.text}])},[t.inventory.text?((0,o.uX)(),(0,o.CE)("p",n,[t.inventory.class?((0,o.uX)(),(0,o.CE)("span",{key:0,class:(0,i.C4)(["availability",t.inventory.class])},(0,i.v_)(t.inventory.text),3)):(0,o.Q3)("",!0)])):(0,o.Q3)("",!0),(0,o.Lk)("p",{class:(0,i.C4)(["product-card__price",t.priceClasses])},[(0,o.Lk)("strong",{class:(0,i.C4)({"text--placeholder":!t.productPrice.fetched}
1)},(0,i.v_)(t.priceText),3),void 0!==t.productPrice.value&&t.productPrice.fetched&&!t.productPrice.value.isTradeAgreementPrice&&t.productPrice.value.discountAmount>0&&t.productPrice.value.formattedBestPriceLast30Days&&t.productPrice.value.bestPriceLast30Days>0?((0,o.uX)(),(0,o.CE)("small",c,[(0,o.Lk)("span",a,(0,i.v_)(t.translate("previousLowestPrice")),1),(0,o.Lk)("s",null,(0,i.v_)(t.productPrice.value.formattedBestPriceLast30Days),1)])):(0,o.Q3)("",!0)],2),(0,o.bo)((0,o.Lk)("button",{"aria-haspopup":"dialog",class:(0,i.C4)(["product-card__quick-buy",{"product-card__quick-buy--green":"green"===t.quickBuyButton.color,"product-card__quick-buy--white":"white"===t.quickBuyButton.color}]),"aria-label":t.quickBuyButton.ariaLabel,onClick:e[0]||(e[0]=(...e)=>t.quickBuy&&t.quickBuy(...e))},[(0,o.Lk)("span",l,(0,i.v_)(t.quickBuyButton.text),1),t.addingToCart||""===t.quickBuyButton.icon?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(v,{key:0,"aria-hidden":!0,icon:t.quickBuyButton.icon,width:"24",height:"24"},null,8,["icon"])),t.addingToCart?((0,o.uX)(),(0,o.CE)("img",d)):(0,o.Q3)("",!0)],10,s),[[u.aG,!t.hideBuyButton&&"button"===t.quickBuyButton.is]]),(0,o.bo)((0,o.Lk)("div",{class:(0,i.C4)(["product-card__quick-buy product-card__quick-buy-text",{"product-card__quick-buy--white":"white"===t.quickBuyButton.color}])},[t.addingToCart||""===t.quickBuyButton.icon?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.Wv)(v,{key:0,"aria-hidden":!0,icon:t.quickBuyButton.icon,width:"24",height:"24"},null,8,["icon"])),(0,o.Lk)("span",p,(0,i.v_)(t.quickBuyButton.text),1)],2),[[u.aG,!t.hideBuyButton&&"span"===t.quickBuyButton.is]])],2)}]])}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.