1import{bt as l,S as u,C as d}from"./storefrontApp.CsApItsi.min.js";import{$ as m,e as n}from"./chunk-vendor-lit.NvY0u02.js";import{S as f}from"./chunk-storefront_base_lit_element.lX23Jvc.js";import{P as h}from"./chunk-product_stock_changed_handler.C3zWS6V.js";import"./chunk-vendor-di.Bh23gdA.js";import"./chunk-storefront_settings_constants.DIF02Gz.js";import"./chunk-vendor-rxjs.Dp7kflo.js";import"./chunk-vendor-lodash.CWHFt7Z.js";import"./chunk-vendor-phoenix.cdKS79L.js";import"./chunk-product_events_constants.BHFu5GP.js";var y=Object.defineProperty,o=(i,t,r,p)=>{for(var e=void 0,s=i.length-1,c;s>=0;s--)(c=i[s])&&(e=c(t,r,e)||e);return e&&y(t,r,e),e};class a extends f{constructor(){super(...arguments),this.locale="",this.bannerStyle=""}static{this.moduleName=l.component}firstUpdated(t){super.firstUpdated(t),new h(r=>this._updateBanner(r))}_updateBanner({body:t}){if(!t?.productId||t.productId!==this.productId)return;const{gross:r,net:p}=t.price,e=this.isNet?p.final.float:r.final.float;this.purchaseAmount=this._convertPriceToMinorUnitFractions(e)}_convertPriceToMinorUnitFractions(t){return t*100}render(){return m` 2 <klarna-placement 3 data-key="credit-promotion-badge" 4 data-locale="${this.locale}" 5 data-theme="${this.bannerStyle}" 6 data-purchase-amount="${this.purchaseAmount}" 7 class="klarna-banner" 8 ></klarna-placement> 9 `}}o([n({type:Number,reflect:!0,attribute:"product-id"})],a.prototype,"productId");o([n({type:Boolean,attribute:"is-net"})],a.prototype,"isNet");o([n({type:String,attribute:"locale"})],a.prototype,"locale");o([n({type:String,attribute:"banner-style"})],a.prototype,"bannerStyle");o([n({type:Number,attribute:"purchase-amount"})],a.prototype,"purchaseAmount");class E extends u{static{this.featureName=l.feature}init(){return{cores:[{type:d,instance:[a]}]}}}export{E as KlarnaBannerInitializer};
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.