/*! For license information please see klarna.js.LICENSE.txt */ (()=>{"use strict";var e,t,n={3056:(e,t,n)=>{n.d(t,{A:()=>s});const r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var o,i=new Uint8Array(16);function a(){if(!o&&!(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(i)}for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).slice(1));const s=function(e,t,n){if(r.randomUUID&&!t&&!e)return r.randomUUID();var o=(e=e||{}).random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=o[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]}(o)}},4984:(e,t,n)=>{n.d(t,{Je:()=>s,Qy:()=>h,RO:()=>d,SQ:()=>l,UT:()=>p,V_:()=>u,dI:()=>c,qh:()=>y,s$:()=>b,sK:()=>f,u_:()=>v});var r,o=n(6994);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c={AU:["en"],NZ:["en"],AT:["en","de"],BE:["nl","en","fr"],CH:["en","de","it","fr"],CZ:["en","cs"],DE:["de","en"],DK:["da","en"],ES:["es","en"],FI:["fi","sv","en"],FR:["fr","en"],GB:["en"],GR:["en","el"],IE:["en"],IT:["en","it"],NL:["nl","en"],NO:["no","nb","en"],PL:["en","pl"],PT:["en","pt"],RO:["en","ro"],SE:["sv","en"],CA:["en","fr"],MX:["es","en"],US:["en","es"],HU:["en","hu"],SK:["en","sk"]},u=["top-strip-promotion-standard","credit-promotion-standard","credit-promotion-small","info-page-standard","info-page-auto-size"],s=(a(a(a(a(a(a(a(a(a(a(r={},o.iC.FOOTER_PROMOTION_AUTO_SIZE,"static"),o.iC.SIDEBAR_PROMOTION_AUTO_SIZE,"static"),o.iC.CHECKOUT,"json"),o.iC.CREDIT_PROMOTION_AUTO_SIZE,"json"),o.iC.CREDIT_PROMOTION_BADGE,"json"),o.iC.CREDIT_PROMOTION_STANDARD,"json"),o.iC.CREDIT_PROMOTION_SMALL,"json"),o.iC.TOP_STRIP_PROMOTION_BADGE,"json"),o.iC.HOMEPAGE_PROMOTION_TALL,"json"),o.iC.HOMEPAGE_PROMOTION_WIDE,"json"),a(a(a(a(a(a(a(a(a(a(r,o.iC.HOMEPAGE_PROMOTION_BOX,"json"),o.iC.TOP_STRIP_PROMOTION_AUTO_SIZE,"json"),o.iC.TOP_STRIP_PROMOTION_STANDARD,"json"),o.iC.INFO_PAGE,"json"),o.iC.CUSTOM_TYPE_0,"json"),o.iC.CUSTOM_TYPE_1,"json"),o.iC.CUSTOM_TYPE_1_335_AUTO,"json"),o.iC.PRODUCT,"json"),o.iC.HEADER,"json"),o.iC.CART,"json"),a(a(a(a(a(r,o.iC.CREDIT_PROMOTION_INLINE,"html"),o.iC.CUSTOM_TYPE_2_INLINE,"html"),o.iC.CUSTOM_TYPE_3_INLINE,"html"),o.iC.CUSTOM_TYPE_0_INLINE,"html"),o.iC.CUSTOM_TYPE_3_335_AUTO,"html")),l=["default","dark","custom","light"],f={production:{oc:"https://osm.klarnaservices.com",eu:"https://osm.klarnaservices.com",na:"https://osm.klarnaservices.com"},playground:{oc:"https://oc-assets.playground.klarnaservices.com",eu:"https://eu-assets.playground.klarnaservices.com",na:"https://na-assets.playground.klarnaservices.com"},staging:{oc:"https://s3.int.klarna.net/pre-purchase/library/global",eu:"https://s3.int.klarna.net/pre-purchase/library/global",na:"https://s3.int.klarna.net/pre-purchase/library/global"},development:{oc:"https://oc-assets.klarnaservices.com",eu:"https://eu-assets.klarnaservices.com",na:"https://na-assets.klarnaservices.com"}},d="/messaging",p="/s",v="/i",b="web",y={IMPRESSIONS:50,AGR_IMPRESSIONS:10,PERFORMANCE:5,STYLING_ISSUES:2,LEGACY_RENDERING:1},h=["2353e544-2ff2-59c2-b212-1bf4f3464e4c","8881c1ea-b112-5bac-af6e-8d7673373121","69ae9909-fa83-5679-9b79-e3152d192025","8a9301af-27eb-579f-9680-ce15f71b6b0a","1e91f355-200d-5918-9a94-e89ab9989159","55253bbc-5618-57c1-9537-dcb976a96121","90182b69-f31b-5041-8277-82b3a07eae17","5c1f8dc6-5298-5c13-abef-6a253ea06ea5","da5a1c6d-c02c-514c-b40d-73b0d676d464","67a23d03-8270-5475-a8a0-babe4ba86687","4f39e2bc-5713-52f1-8c90-570f7ddd4781","5c067b36-6a15-5c22-9fba-1402e1393748","a9e8fb36-aa4e-589d-bd62-7c8c99e46092","cce1bc9a-2ba6-59ab-88ea-ba0b767aab8b","e8880bde-72dd-5de0-8876-4dc28a556ff9","a9c619b7-b577-54d7-aa7b-adeadc7fc5ee","ce4123ca-9676-51b5-8db5-76d854d54c88","723d3bf3-0a90-5aae-8140-310d9fa478bd","78384c12-9830-508f-9046-f45b93ede7a1","52de8130-3107-59f9-aaa1-5a90bf0cdf13","ecb0e555-fd5f-554e-966a-bf58f1f72a8e","c6406cbf-893d-59c1-816d-086e9ca7c5c7","76424947-b4c8-5f11-9125-46bff698a0f8","58a92553-dc92-5af4-af7e-65693266e81c","a84c8537-64a5-5f76-a0ff-6d9b934088ec","601ee633-997e-5b4e-867a-a5a13c4c5f63","c782324b-2ee6-5130-9606-c7f112a0fe23","78bdf5e2-8292-54ee-9e27-dea8fb4aacf6","fc432336-af8d-571e-8a4c-15d0efcf7f67","663643dc-79c8-5ecd-ba91-86403fef3965","67472e2d-1d9a-5311-87ef-9e93ea03f399","fce97b2a-8c6a-5ba5-a107-948485bc2e83","0b42169a-608f-5c81-b17a-29900c8c66a4","ca810ec7-49ec-5b63-9183-accae4bf3307","c68e9833-599c-5e14-bc57-f78c822b12ad","bfd35799-3d4c-5582-b71b-c3e963568427","1a13d8c3-3c33-51ee-a722-e45955c20fa6","d3e8cc9b-a1ad-51b9-96a7-05fe230edce3","49a82178-2eba-54ce-b8c1-2531a004a138","71d3225b-aa87-5f0e-9904-876af56d6c66","e4708f00-bd5a-5e18-bd66-f4621c238887","f6186bbc-da96-57ed-affd-c0978a613268","991fe595-2850-5cbc-adba-989fc270713f","3a543f47-e295-5ea0-93ab-61dfb0dae37a","addb8461-59ed-5e10-b577-9abcbd197d84","6ca24f4c-0c64-5517-adb2-fd5eda9701aa","738bf438-6a08-50db-92e1-acfdc06706c2","9ce697be-c972-53b9-88bb-cac352b69f47","a897c548-029d-5d34-9b59-813ceb9d7264","c7a1c0da-0b49-5732-913b-0a47a3e1a60e","9ee94060-75f8-5f0e-99bb-3954fcf3a62f","db8aa4d5-8069-5218-933c-de7e3b494f89","a264dbba-6c2d-59b9-9167-c3f4a9791f21","008032f1-657e-5cca-a105-f3edd2bbe84f","af16f814-4a20-5c20-ad2d-942ad93f3590","e36cb7cd-c699-555c-a80d-0fcd56d7f303","ba76a301-1323-5e62-aac3-6b3ce95623ee","0904ad5a-0fb5-5069-bca9-12dbae8d8e5d","6b01ee08-344c-5e9b-ae46-b31a477259f0","f53b110c-50fa-5540-8225-bad651221124","23aec4ae-cd98-5f0a-b4d5-0df5c4a223c6","17e2e730-3d33-585a-b9e7-c5a75e966127","203b5252-c6b6-56a1-8e9d-d0caafebb88c","63ae67c6-ab0e-575e-9f1c-712b9027cc6c","a17591c7-36f9-526b-92a5-f2ff0449a3fc","9766ad09-9605-58a9-aed8-0cd3011da25e","fd6d2432-21c6-5928-86ad-eb0566325c12","32198a5b-390c-59f6-b1b8-b318f945a14f","d8a32f56-c17e-5e88-bc50-b9b35b9ced2d","6600934b-c14a-54d5-a447-6dc4b146f321","7cfbaac4-729a-5930-ba1a-ad3504155e8e","f46705b8-e9e5-5070-80c6-389dcc32f0d4","6d98ac83-11a1-584b-9aa4-e4374ea442e6","19cf327c-7c49-5b82-853b-83d93c0fa116"]},6994:(e,t,n)=>{n.d(t,{D3:()=>r,Id:()=>a,Lj:()=>o,O4:()=>c,iC:()=>i});var r=function(e){return e.PAYMENT_BUTTON="klarna-payment-button",e.IDENTITY_BUTTON="klarna-identity-button",e.PLACEMENT="klarna-placement",e}({}),o=function(e){return e.CHECKOUT="checkout",e.CONTINUE="continue",e.CONNECT="connect",e.DONATE="donate",e.SIGNIN="signin",e.SIGNUP="signup",e.SUBSCRIBE="subscribe",e.PAY="pay",e}({}),i=function(e){return e.CHECKOUT="checkout",e.CUSTOM_TYPE_0="custom-type0",e.CUSTOM_TYPE_1="custom-type1",e.CUSTOM_TYPE_0_INLINE="custom-type0-inline",e.CUSTOM_TYPE_2_INLINE="custom-type2-inline",e.CUSTOM_TYPE_3_INLINE="custom-type3-inline",e.CUSTOM_TYPE_1_335_AUTO="custom-type1-335-auto",e.CUSTOM_TYPE_3_335_AUTO="custom-type3-335-auto",e.TOP_STRIP_PROMOTION_AUTO_SIZE="top-strip-promotion-auto-size",e.TOP_STRIP_PROMOTION_STANDARD="top-strip-promotion-standard",e.TOP_STRIP_PROMOTION_BADGE="top-strip-promotion-badge",e.CREDIT_PROMOTION_SMALL="credit-promotion-small",e.CREDIT_PROMOTION_STANDARD="credit-promotion-standard",e.CREDIT_PROMOTION_INLINE="credit-promotion-inline",e.CREDIT_PROMOTION_AUTO_SIZE="credit-promotion-auto-size",e.CREDIT_PROMOTION_BADGE="credit-promotion-badge",e.SIDEBAR_PROMOTION_AUTO_SIZE="sidebar-promotion-auto-size",e.FOOTER_PROMOTION_AUTO_SIZE="footer-promotion-auto-size",e.INFO_PAGE="info-page",e.HOMEPAGE_PROMOTION_TALL="homepage-promotion-tall",e.HOMEPAGE_PROMOTION_WIDE="homepage-promotion-wide",e.HOMEPAGE_PROMOTION_BOX="homepage-promotion-box",e.PRODUCT="product",e.HEADER="header",e.CART="cart",e}({}),a={production:"https://js.klarna.com",playground:"https://js.playground.klarna.com",staging:"https://x.nonprod.us1.js.klarna.net",development:"https://x.nonprod.us1.js.klarna.net"},c=function(e){return e.LIVE="live",e.TEST="test",e}({})},8334:(e,t,n)=>{n.d(t,{$:()=>r,s:()=>o});var r={INIT:5,MERCHANT_WARN:5},o=function(e){return 100*Math.random(){n.d(t,{A:()=>c,v:()=>a});var r=n(8334),o=n(1331),i="version",a=function(){try{var e=(0,o.n)(i);return null==e?void 0:e.get("rolloutVariant")}catch(e){return"none"}};const c=function(e){if(!e)throw new Error("Missing runtime config");try{var t,n,a=(0,o.n)(i);e.lib.defaultVersion!==(null===(t=e.lib)||void 0===t?void 0:t.canaryVersion)&&"true"!==(null===(n=e.lib)||void 0===n?void 0:n.flushVersion)||(null==a||a.remove("version"),null==a||a.remove("rolloutVariant"),null==a||a.remove("ttl"));var c=null==a?void 0:a.get("version");if(c)return c;var u=function(e){var t=e.defaultVersion,n=e.canaryVersion,a=e.canaryWeight,c=void 0===a?0:a,u=(0,o.n)(i),s=Date.now()+864e5;return null==u||u.set("ttl",s.toString()),(0,r.s)(100*c)?(0,r.s)(50)?(null==u||u.set("rolloutVariant","canary"),null==u||u.set("version",n),n):(null==u||u.set("rolloutVariant","control"),null==u||u.set("version",t),t):(null==u||u.set("rolloutVariant","none"),null==u||u.set("version",t),t)}(e.lib);if(u)return u;throw new Error("Failed to set rollout and version")}catch(t){if(e.lib.defaultVersion)return e.lib.defaultVersion;throw new Error("Failed to get version: ".concat(t.message))}}},9604:(e,t,n)=>{function r(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/-/g,"").toLowerCase();return/^[0-9a-f]{32}$/i.test(e)}n.d(t,{f:()=>r})},3398:(e,t,n)=>{n.d(t,{L:()=>r});var r=function(){return!1}},3308:(e,t,n)=>{n.d(t,{J:()=>i});var r=n(4984);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:r.dI;if(!e)return!1;var n,i,a=(n=e.split("-"),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(n,i)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=a[0],u=void 0===c?"":c,s=a[1],l=void 0===s?"":s;if(!l||!u)return!1;var f=l.toUpperCase(),d=u.toLowerCase();return!!t[f]&&t[f].includes(d)}},6624:(e,t,n)=>{n.d(t,{vV:()=>w,JE:()=>S});var r=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{E:()=>a});var a=function(e){var t=function(e){for(var t=1;t{n.d(t,{G:()=>o});var r=n(8392);function o(e){var t="string"==typeof e?new Error(e):e;(0,r.Nj)().report(t)}},8392:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;tH,r$:()=>q}),function(e){e.fatal="fatal",e.error="error",e.warning="warning",e.log="log",e.info="info",e.debug="debug",e.critical="critical"}(s||(s={}));var l=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,f=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,d=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,p="?",v=/^(?:(\w+):)\/\/(?:([\w-]+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function b(e){return(e&&e.message||"No error message").split("\n").filter((function(e){return!!e}))[0]}function y(e){try{var t=function(e){if(!e.stack)return null;for(var t,n,r=[],o=e.stack.split("\n"),i=0;ie.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:N();!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=I(this,t,[e])).options=e,n.window=r,n.destroyed=!1,n._state={};var o=n.options||{},i=o.plugins,a=void 0===i?[]:i,c=o.beforeSend,u=void 0===c?function(e){return e}:c,s=o.beforeBreadcrumb,l=void 0===s?function(e){return e}:s,f=o.blacklistUrls,d=void 0===f?[]:f,p=o.ignoreErrors,v=void 0===p?[]:p,b=o.release,y=void 0===b?void 0:b;return n.plugins=a.map((function(e){return new e(n)})),n.beforeSend=u,n.beforeBreadcrumb=l,n.blacklistUrls=d,n.ignoreErrors=v,n.release=y,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(t,e),n=t,(r=[{key:"state",get:function(){return this._state}},{key:"clearState",value:function(){this._state={}}},{key:"setTags",value:function(e){return this.setKeyState("tags",w({},e)),this}},{key:"setTag",value:function(e,t){return this.extendState({tags:S({},e,t)}),this}},{key:"setExtra",value:function(e,t){return this.extendState({extra:S({},e,t)}),this}},{key:"setExtras",value:function(e){return this.setKeyState("extra",w({},e)),this}},{key:"setUser",value:function(e){return this.setKeyState("user",e?w({},e):void 0),this}},{key:"clone",value:function(){var e=new t(w(w({},this.options),{},{plugins:[]}));return e.extendState(this.state),e}},{key:"withScope",value:function(e){var t=this.clone();e(t),t.destroy(),this.setBreadcrumbs(void 0)}},{key:"addBreadcrumb",value:function(e){var t=this.beforeBreadcrumb(e);t&&this.extendState({breadcrumbs:[w({timestamp:Date.now()/1e3},t)]})}},{key:"setBreadcrumbs",value:function(e){this.setKeyState("breadcrumbs",e)}},{key:"captureMessage",value:function(e,t){this.send(w(w({},this.getRequestBlank()),{},{message:e,level:t}))}},{key:"destroy",value:function(){this.destroyed=!0,this.plugins.forEach((function(e){e.destroy&&e.destroy()}))}},{key:"isIgnoredError",value:function(e){var t=this;return!!this.ignoreErrors.length&&this.getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){return P(e,t)}))}))}},{key:"extractQueryString",value:function(e){var t=e;if(t){t.startsWith("/")&&(t="http://prefix".concat(t));try{var n=new URL(t).search.slice(1);return n.length?n:void 0}catch(e){return}}}},{key:"getRequestBlank",value:function(){var e=this.window.location.toString();return w(w({request:{url:e,query_string:this.extractQueryString(e),headers:{"User-Agent":this.window.navigator.userAgent}}},T(j(t.prototype),"getRequestBlank",this).call(this)),{},{sdk:{name:"micro-sentry.javascript.browser",version:"0.0.0"}},this.state)}},{key:"send",value:function(e){if(!(this.destroyed||this.isDeniedUrl(e)||this.isIgnoredError(e))){var n=this.beforeSend(w({release:this.release},e));n&&(T(j(t.prototype),"send",this).call(this,n),this.setBreadcrumbs(void 0))}}},{key:"getPossibleEventMessages",value:function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,o=t.value,i=void 0===o?"":o;return["".concat(i),"".concat(r,": ").concat(i)]}catch(e){return[]}return[]}},{key:"isDeniedUrl",value:function(e){if(!this.blacklistUrls.length)return!1;var t=this.getEventFilterUrl(e);return!!t&&this.blacklistUrls.some((function(e){return P(t,e)}))}},{key:"getEventFilterUrl",value:function(e){try{if(e.exception){var t=e.exception.values&&e.exception.values[0].stacktrace&&e.exception.values[0].stacktrace.frames;return t&&t[t.length-1].filename||null}return null}catch(e){return null}}},{key:"extendState",value:function(e){var t=this;this._state=Object.keys(e).reduce((function(n,r){var o=t._state[r],i=Array.isArray(o)?o:null,a=e[r],c=Array.isArray(a)?a:null;return w(w({},n),{},S({},r,i||c?[].concat(m(i||[]),m(c||[])):w(w({},"string"!=typeof o?o:{}),"string"!=typeof a?a:{})))}),this._state)}},{key:"setKeyState",value:function(e,t){this._state[e]=t}}])&&E(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(function(){return e=function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&t.dsn){var n=v.exec(t.dsn),r=n?n.slice(1):[],o=r[5].split("/"),i=o.slice(0,-1).join("/");this.apiUrl=r[0]+"://"+r[3]+(r[4]?":"+r[4]:"")+(i?"/"+i:"")+"/api/"+o.pop()+"/store/",this.authHeader="Sentry sentry_version=7,sentry_key="+r[1]+(r[2]?",sentry_secret="+r[2]:"")}this.environment=t&&t.environment},(t=[{key:"prepare",value:function(e){return i(i({},this.getRequestBlank()),{},{exception:{values:[y(e)]}})}},{key:"report",value:function(e){this.send(this.prepare(e))}},{key:"send",value:function(e){this.apiUrl&&e&&this.createRequest(e)}},{key:"createRequest",value:function(e){var t=new XMLHttpRequest;t.open("POST",this.apiUrl,!0),t.setRequestHeader("Content-type","application/json"),t.setRequestHeader("X-Sentry-Auth",this.authHeader||""),t.send(JSON.stringify(e))}},{key:"getRequestBlank",value:function(){return{platform:"javascript",event_id:"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),sdk:{name:"micro-sentry.javascript.core",version:"0.0.0"},timestamp:Date.now()/1e3,environment:this.environment}}}])&&c(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()),C=function(e){return e.SENTRY_NOT_CONFIGURED="sentry_not_configured",e}({}),L=n(3398),R=n(5298),M=n(5492),D=[],U=function(e){var t,n=!1;return null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t||t.forEach((function(e){var t=e.value;D.forEach((function(e){e&&t.includes(e)&&(n=!0)}))})),n?null:e},K=function(e){return e.sessionStorageNotSupported="sessionStorage-not-supported",e.localStorageNotSupported="localStorage-not-supported",e.dynamicImportFailed="dynamic-import-failed",e.multipleCustomElementsWithSameTagName="multiple-custom-elements-same-tag-name",e.unexpectedTokenMethodParamsList="unexpected-token-method-params-list",e.missingColonAfterPropertyId="missing-colon-after-property-id",e.unexpectedTokenEqual="unexpected-token-equal",e.expectedExpressionGotEqual="expected-expression-got-equal",e.performanceNotDefined="performance-is-not-defined",e.undefinedIsNotAnObjectRenderOptions="undefined-is-not-an-object-render-options",e.renderOptionsIsUndefined="render-options-is-undefined",e.nullIsNotAnObjectParentNodeInsertBefore="null-is-not-an-object-parent-node-insert-before",e.failedToFetchOSMAPI="failed-to-fetch-osm-api",e.cannotReadPropertiesOfNull="cannot-read-properties-of-null",e.failedToExecuteInvokeOnCreateHTMLCallback="failed-to-execute-invoke-on-create-html-callback",e.performanceMarkIsNotAFunction="performance-mark-is-not-a-function",e.backendBridgeInitFailed="backend-bridge-init-failed",e.globalThisIsNotDefined="globalThisIsNotDefined",e.identityNaClientIdsNotFound="identity-na-client-ids-not-found",e.chunkLoadErrorObjectNotExtensible="chunk-load-error-object-not-extensible",e}(K||{}),B=n(6806),F=n(8334),W=["Unexpected token '","Storage type: ","Failed to fetch dynamically imported module","Missing runtime config","Failed to execute 'define","Importing a module script failed.","NetworkError when attempting to fetch resource","Loading chunk"],G=function(e){var t,n=!0;return null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t||t.forEach((function(e){var t=e.value;W.forEach((function(e){t.includes(e)&&(n=(0,F.s)(5))}))})),n?e:null};function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&void 0!==arguments[2]?arguments[2]:R.T.websdk,r=(0,M.A)(n);try{r.event("error",{message:t,name_1:e})}catch(e){}}(C.SENTRY_NOT_CONFIGURED,"Sentry client not initialized"),Y)},q=function(e){return(0,L.L)()?$=Y:$||($=function(e){return new A({dsn:"https://6fdc8e6e634d4a998b6f0dbfd7b025e1@o24547.ingest.sentry.io/4505471301713920",release:e.version,environment:e.environment,beforeSend:function(e){var t;null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t||t.forEach((function(t){var n=t.value;e.fingerprint=function(e){var t,n,r,o,i,a,c,u,s,l,f,d,p,v,b,y,h;switch(e){case"Storage type: sessionStorage not supported":return[K.sessionStorageNotSupported];case"Storage type: localStorage not supported":return[K.localStorageNotSupported];case"Cannot define multiple custom elements with the same tag name":return[K.multipleCustomElementsWithSameTagName];case"Unexpected token ';'. Expected an opening '(' before a method's parameter list.":return[K.unexpectedTokenMethodParamsList];case null===(t=e.match(/Failed to fetch dynamically imported module/))||void 0===t?void 0:t.input:return[K.dynamicImportFailed];case null===(n=e.match("missing : after property id"))||void 0===n?void 0:n.input:return[K.missingColonAfterPropertyId];case null===(r=e.match("Unexpected token '='"))||void 0===r?void 0:r.input:return[K.unexpectedTokenEqual];case null===(o=e.match("expected expression, got '='"))||void 0===o?void 0:o.input:return[K.expectedExpressionGotEqual];case null===(i=e.match(/error loading dynamically imported module/))||void 0===i?void 0:i.input:return[K.dynamicImportFailed];case null===(a=e.match(/performance is not defined/))||void 0===a?void 0:a.input:return[K.performanceNotDefined];case null===(c=e.match(/performance?.mark is not a function/))||void 0===c?void 0:c.input:return[K.performanceMarkIsNotAFunction];case null===(u=e.match(/undefined is not an object (evaluating 'this.renderOptions.renderBefore')/))||void 0===u?void 0:u.input:return[K.undefinedIsNotAnObjectRenderOptions];case null===(s=e.match(/this.renderOptions is undefined/))||void 0===s?void 0:s.input:return[K.renderOptionsIsUndefined];case null===(l=e.match(/Cannot read properties of null (reading 'insertBefore')/))||void 0===l?void 0:l.input:return[K.cannotReadPropertiesOfNull];case null===(f=e.match(/null is not an object (evaluating 'this._$AA.parentNode.insertBefore')/))||void 0===f?void 0:f.input:return[K.nullIsNotAnObjectParentNodeInsertBefore];case null===(d=e.match(/Failed to execute 'invoke' on 'CreateHTMLCallback': The provided callback is no longer runnable./))||void 0===d?void 0:d.input:return[K.failedToExecuteInvokeOnCreateHTMLCallback];case null===(p=e.match("Failed to fetch: GET https://js.klarna.com/na/cma/"))||void 0===p?void 0:p.input:return[K.failedToFetchOSMAPI];case null===(v=e.match("BackendBridge: init failed"))||void 0===v?void 0:v.input:return[K.backendBridgeInitFailed];case null===(b=e.match("globalThis is not defined"))||void 0===b?void 0:b.input:return[K.globalThisIsNotDefined];case null===(y=e.match("Identity naClientIds list not found"))||void 0===y?void 0:y.input:return[K.identityNaClientIdsNotFound];case null===(h=e.match("Cannot add property timelineEnd, object is not extensible"))||void 0===h?void 0:h.input:return[K.chunkLoadErrorObjectNotExtensible]}}(n)}));var n,r,o=function(e){var t,n=!0;return null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t||t.forEach((function(e){var t,r=e.stacktrace;null==r||null===(t=r.frames)||void 0===t||t.forEach((function(e){var t=e.filename;n=!(0,B.i)(t)}))})),n?null:e}(e);return o?(n=G,r=U,function(e){return n(r(e))})(o):null},blacklistUrls:[/pagead\/js/i,/graph\.facebook\.com/i,/connect\.facebook\.net\/en_US\/all\.js/i,/extensions\//i,/^chrome:\/\//i,/metrics\.itunes\.apple\.com\.edgesuite\.net\//i]})}(e)),e.tags&&Object.entries(e.tags).forEach((function(e){var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,n)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];i&&$.setTag(o,i.toString())})),$}},1331:(e,t,n)=>{n.d(t,{n:()=>a,s:()=>c});var r=n(4074),o="__klarna_sdk_",i=function(e){return e.localStorage="localStorage",e.sessionStorage="sessionStorage",e.klarnaIframeStorage="klarnaIframeStorage",e}({}),a=function(e){var t="".concat(o).concat(e);try{return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(null==t||!t.localStorage)throw new Error("client does not support ".concat(i.localStorage));var n=function(){return JSON.parse(t.localStorage.getItem(e)||"{}")},r={get:function(e){var t=n(),o=null==t?void 0:t[e];if(!o)return null;var i=null==t?void 0:t.ttl;return i&&i1&&void 0!==arguments[1]?arguments[1]:window;if(null==t||!t.sessionStorage)throw new Error("client does not support ".concat(i.sessionStorage));var n=function(){return JSON.parse(t.sessionStorage.getItem(e)||"{}")},r={get:function(e){var t=n();return(null==t?void 0:t[e])||null},set:function(r,o){var i=n();return null===o?delete i[r]:i[r]=o,t.sessionStorage.setItem(e,JSON.stringify(i))},remove:function(e){return r.set(e,null)},flush:function(){return t.sessionStorage.removeItem(e)}};return r}(t)}catch(e){return void(0,r.G)("Storage type: sessionStorage not supported")}}},5298:(e,t,n)=>{n.d(t,{T:()=>r});var r=function(e){return e.websdk="websdk",e.osm="osm-client-script",e.identitySdk="sign-in-with-klarna",e}({})},5492:(e,t,n)=>{n.d(t,{A:()=>E});var r={};n.r(r),n.d(r,{ALL:()=>a,DEBUG:()=>u,ERROR:()=>f,FATAL:()=>d,INFO:()=>s,OFF:()=>p,TRACE:()=>c,WARN:()=>l});const o={create:function(e,t){(new e.Image).src=t}},i={create:function(e,t,n){e.navigator.sendBeacon(t,JSON.stringify(n))}};var a=0,c=0,u=1,s=2,l=3,f=4,d=5,p=6;function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}var b=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:s;a1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t)}};return{configure:function(t){var r=t.options,v=t.data,m=void 0===v?{}:v,g=t.instanceId,w=void 0===g?void 0:g;n=m,S[e]||(S[e]=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if("object"!==(void 0===e?"undefined":y(e))||!e)throw new TypeError("expected configuration object");var n=e.baseUrl,r=void 0===n?"https://eu.klarnaevt.com":n,v=e.client,m=e.clientVersion,g=e.sessionId,O=e.commonData,w=void 0===O?{}:O,S=e.instanceId,E=void 0===S?Math.floor(9e3*Math.random())+1e3:S,k=e.logLevel||a;if("string"!=typeof v)throw new TypeError("expected `client` in the configuration object");if("string"!=typeof m)throw new TypeError("expected `clientVersion` in the configuration object");if("string"!=typeof g)throw new TypeError("expected `sessionId` in the configuration object");if("number"!=typeof k||kp)throw new TypeError("invalid `logLevel` ("+k+")");function I(e){return Object.keys(e).sort().map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function _(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments[2];if(!(k>(arguments.length>3&&void 0!==arguments[3]?arguments[3]:a))){if(!e)throw new TypeError("expected `name` as first parameter");var u=function(e,t){return""+r+h+v+"/"+m+"/"+e+"?"+I(t)}(e,n=b({},w,n,{iid:E,sid:g,timestamp:n.timestamp||(new Date).getTime()}));try{i.create(t,u,c)}catch(e){c&&(u+="&"+I(c)),o.create(t,u)}}}return{event:_,trace:function(e,t,n){_(e,t,n,c)},debug:function(e,t,n){_(e,t,n,u)},info:function(e,t,n){_(e,t,n,s)},warn:function(e,t,n){_(e,t,n,l)},error:function(e,t,n){_(e,t,n,f)},fatal:function(e,t,n){_(e,t,n,d)},setLogLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;if("number"!=typeof e||ep)throw new TypeError("invalid `logLevel` ("+e+")");k=e},getConfig:function(){return{baseUrl:r,client:v,clientVersion:m,sessionId:g,instanceId:E,logLevel:k}}}}(k(O(O({},r),{},{instanceId:w}))))},event:v,trace:m(v,c),debug:m(v,u),info:m(v,s),warn:m(v,l),error:m(v,f),fatal:m(v,d),setLogLevel:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ALL";try{var o=n.toUpperCase();t=o in r?r[o]:a,S[e]&&S[e].setLogLevel(t)}catch(e){}},removeInstance:function(){S[e]&&delete S[e]}}}var k=function(e){var t=e.client,n=void 0===t?"sdk":t,r=e.clientVersion,o=void 0===r?"":r,i=e.sessionId,a=void 0===i?"":i,c=e.instanceId,u=e.baseUrl;return{client:n,clientVersion:o,environment:"production",sessionId:a,instanceId:c,baseUrl:void 0===u?"":u}}},6806:(e,t,n)=>{n.d(t,{i:()=>o});var r=["https://s3.int.klarna.net","https://js.klarna.com","https://x.klarnacdn.net","https://x.nonprod.us1.js.klarna.net","https://osm.klarnaservices.com","https://eu-assets.playground.klarnaservices.com","https://na-assets.playground.klarnaservices.com","https://ap-assets.playground.klarnaservices.com","https://oc-assets.playground.klarnaservices.com"],o=function(e){return r.some((function(t){return e.startsWith(t)}))}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=n,o.amdD=function(){throw new Error("define cannot be used indirect")},o.amdO={},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>"0.0.324/"+({1249:"sdk",4328:"klarna-test-drive-badge"}[e]||e)+".chunk.js",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@klarna-web-sdk/lib:",o.l=(n,r,i,a)=>{if(e[n])e[n].push(r);else{var c,u;if(void 0!==i)for(var s=document.getElementsByTagName("script"),l=0;l{c.onerror=c.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=d.bind(null,c.onerror),c.onload=d.bind(null,c.onload),u&&document.head.appendChild(c)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="https://na-library.klarnaservices.com/v1/",(()=>{var e={4396:0};o.f.j=(t,n)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=i);var a=o.p+o.u(t),c=new Error;o.l(a,(n=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",c.name="ChunkLoadError",c.type=i,c.request=a,r[1](c)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[a,c,u]=n,s=0;if(a.some((t=>0!==e[t]))){for(r in c)o.o(c,r)&&(o.m[r]=c[r]);u&&u(o)}for(t&&t(n);s0&&void 0!==arguments[0]?arguments[0]:document;return null!==(e=null==r?void 0:r.currentScript)&&void 0!==e?e:null==r||null===(t=r.scripts)||void 0===t?void 0:t[(null==r||null===(n=r.scripts)||void 0===n?void 0:n.length)-1]};var f=o(7971),d=o(3398);function p(e){var t=/^klarna_(test|live)_(api)_[A-Za-z0-9_-]+={0,2}$/.test(e),n=/^klarna_(test|live)_(client)_[A-Za-z0-9_-]+={0,2}$/.test(e);return t?[!1,"API_KEY"]:n?[!0,""]:[!1,"INVALID_FORMAT"]}var v=o(3308),b=o(8392),y=o(4074);const h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,t=!!e.Klarna,n=!!function(e){return e.Klarna&&e.Klarna.Credit&&e.Klarna.DirectBankTransfer&&e.Klarna.DirectDebit&&e.Klarna.Payments}(e),r=!!function(e){return e.Klarna&&e.Klarna.Identity&&e.Klarna.Messaging&&e.Klarna.OnsiteMessaging&&e.Klarna.Payment}(e);return{isKlarnaNamespaceAvailable:t,isKPLibAvailable:n,isWebSDKAvailable:r}};var m=o(3056);function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function O(){O=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),c=new N(r||[]);return o(a,"_invoke",{value:T(e,n,c)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",p="executing",v="completed",b={};function y(){}function h(){}function m(){}var w={};s(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==n&&r.call(E,a)&&(w=E);var k=m.prototype=y.prototype=Object.create(w);function I(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(o,i,a,c){var u=f(e[o],e,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==g(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function T(t,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=j(c,r);if(u){if(u===b)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(t,n,r);if("normal"===s.type){if(o=r.done?v:"suspendedYield",s.arg===b)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=v,r.method="throw",r.arg=s.arg)}}}function j(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,j(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),b;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,b;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,b):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,b)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function A(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:A(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},t}function w(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}var S={lib:{defaultVersion:"0.0.324"},lastUpdated:(new Date).toISOString()},E=function(){var e,t=(e=O().mark((function e(t){var n,r,o,a,c=arguments;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>2&&void 0!==c[2]?c[2]:3,o="production"===(n=c.length>1&&void 0!==c[1]?c[1]:"production")?"runtime-config":"runtime-config-".concat(n),"development"!==n){e.next=5;break}return e.abrupt("return",{lib:{defaultVersion:"v1"},lastUpdated:(new Date).toISOString()});case 5:return e.prev=5,e.next=8,fetch("".concat(t,"config/").concat(o,".json"));case 8:if((a=e.sent).ok){e.next=11;break}throw new Error("Failed to fetch configuration. Server responded with status ".concat(a.status,": ").concat(a.statusText));case 11:return e.next=13,a.json();case 13:return e.abrupt("return",e.sent);case 16:if(e.prev=16,e.t0=e.catch(5),!(r>0)){e.next=22;break}return e.abrupt("return",E(t,n,r-1));case 22:return(0,i.vV)("Failed to fetch runtime configuration after multiple attempts, relying on the FALLBACK_CONFIG instead"),e.abrupt("return",S);case 24:case"end":return e.stop()}}),e,null,[[5,16]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){w(i,r,o,a,c,"next",e)}function c(e){w(i,r,o,a,c,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}();const k=E;function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function _(e,t){for(var n=0;n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),b}},t}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function K(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==N[0]?N[0]:window).Klarna=o.Klarna||{},a=l(),c=(null==a?void 0:a.dataset)||{},u=c.accountId,s=c.clientId,f=c.clientKey,d=c.clientToken,p=c.environment,v=c.version,b=c.additionalIdentifier,y=c.clientInstanceName,m=c.locale,g=c.shoppingSessionId,!y||/^[a-z0-9]+$/.test(y)){e.next=8;break}throw(0,i.vV)("Invalid clientInstanceName attribute. Only lowercase letters from a-z and numbers are allowed."),new Error("Invalid clientInstanceName attribute. Only lowercase letters from a-z and numbers are allowed.");case 8:if(O="KlarnaWebSDKScriptLoaded",y&&(O="KlarnaWebSDKScript".concat(y,"Loaded")),o[O]||(o[O]=0),o[O]++,o[O]>1&&!y&&console.warn("\n Another Klarna Web SDK was already included into the page, \n please consider using data-client-instance-name attribute\n on klarna.js script tag to avoid conflicts.\n "),w=s||f,S=new URL(null==a?void 0:a.src),E=null==S||null===(t=S.searchParams)||void 0===t?void 0:t.get("ready"),k=null!==(n=null!==(r=E&&o[E])&&void 0!==r?r:o["KlarnaSDKCallback_".concat(y)])&&void 0!==n?n:o.KlarnaSDKCallback,I="KlarnaSDKCallbackTriggered",E?I="".concat(E,"Triggered"):y&&(I="KlarnaSDKCallback".concat(y,"Triggered")),w||d){e.next=31;break}e.prev=20,_=function(e){var t=e.accountId,n=e.clientId,r=e.clientToken,o=e.version,i=e.environment,a=e.clientInstanceName,c=e.additionalIdentifier,u=e.locale,s=e.shoppingSessionId;return Y({accountId:t,clientId:n,clientToken:r,version:o,environment:i,clientInstanceName:a,additionalIdentifier:c,locale:u,shoppingSessionId:s})},o.Klarna.init=_,o[I]||"function"!=typeof k||(T={get:function(e,t,n){if("init"===t)return Reflect.get(e,t,n);throw new Error("Klarna SDK is not initialized. Please call window.Klarna.init() with your credentials first.")}},o[I]=!0,k(new Proxy({init:_},T))),e.next=29;break;case 26:throw e.prev=26,e.t0=e.catch(20),new Error("Klarna Web SDK init failed");case 29:e.next=41;break;case 31:if(j=h(o),x=j.isWebSDKAvailable,R(o),!(x||o[O]>1)){e.next=36;break}return o[I]||"function"!=typeof k||(o[I]=!0,k(o.Klarna)),e.abrupt("return");case 36:return e.next=38,Y({accountId:u,clientId:w,clientToken:d,version:v,environment:p,clientInstanceName:y,additionalIdentifier:b,locale:m,shoppingSessionId:g});case 38:P=e.sent,o.Klarna=Object.assign(P,o.Klarna),o[I]||"function"!=typeof k||(o[I]=!0,k(o.Klarna));case 41:case"end":return e.stop()}}),e,null,[[20,26]])}))),$.apply(this,arguments)}var Y=function(){var e=V(D().mark((function e(t){var n,r,l,h,g,O,w,S,E,I,_,T,j,x,P,N,A,C,L,R,M,U,B,W,G,V,$,Y,H,q,z,J,Z;return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.accountId,r=t.clientId,l=t.clientToken,h=t.version,g=t.environment,O=t.additionalIdentifier,w=t.clientInstanceName,S=void 0===w?"default":w,E=t.locale,I=t.shoppingSessionId,r||l){e.next=3;break}throw new Error("Missing `client-id` attribute that is required for the SDK to work");case 3:if(E&&!(0,v.J)(E)&&((0,i.JE)("Invalid `locale` attribute. Please provide a valid locale."),E=""),_=p(r),T=F(_,2),j=T[0],x=T[1],!r||j||(0,a.f)(r)){e.next=11;break}if("API_KEY"!==x){e.next=10;break}throw new Error("Invalid `client-id` attribute. An API key was passed but is not allowed in the `client-id` attribute. Please revoke your API key immediately as it may have been leaked if it was deployed to a public environment.");case 10:throw new Error('Invalid `client-id` attribute. Expected format: "klarna___" or an UUID for legacy OSM integrations.');case 11:P=h,N={lib:{defaultVersion:""},identity:{naClientIds:[],nonPKCEClientIds:[]},lastUpdated:""},A="https://na-library.klarnaservices.com/",C=(0,m.A)(),L=(0,c.E)({accountId:n,clientId:r,clientToken:l,clientInstanceName:S,additionalIdentifier:O}),R=null!=r&&r.includes("_")?r.split("_"):[],(M=F(R,2))[0],U=M[1],"playground"==(g=(0,d.L)()?"staging":(0,a.f)(r)||!r&&l?"playground"===(null===(B=g)||void 0===B?void 0:B.toLowerCase())?"playground":"production":(null==U?void 0:U.toLowerCase())===u.O4.TEST?"playground":"production")&&(A=A.replace("js.","js.playground.")),e.prev=19,e.next=36;break;case 23:if(e.t1=W=e.sent,e.t0=null!==e.t1,!e.t0){e.next=27;break}e.t0=void 0!==W;case 27:if(!e.t0){e.next=31;break}e.t2=W,e.next=32;break;case 31:e.t2=N;case 32:(N=e.t2).lib.defaultVersion="development",e.next=49;break;case 36:return e.next=38,k(A,g);case 38:if(e.t4=G=e.sent,e.t3=null!==e.t4,!e.t3){e.next=42;break}e.t3=void 0!==G;case 42:if(!e.t3){e.next=46;break}e.t5=G,e.next=47;break;case 46:e.t5=N;case 47:N=e.t5,P?(N.lib.defaultVersion=P,A+=s(P)?"v1/".concat(P,"/"):"".concat(P,"/")):(P=(0,f.A)(N),A+="v1/".concat(P,"/"));case 49:return V=K(K({},L),{},{product:"entrypoint",sessionId:C,shoppingSessionId:I}),(0,b.r$)({environment:g,version:P,tags:V}),$="".concat(A,"sdk.js"),e.next=54,import($);case 54:return Y=e.sent,H=Y.default,q=new H(K(K({},L),{},{baseUrl:A,version:P,environment:g,sessionId:C,shoppingSessionId:I,runtimeConfig:N,clientInstanceName:S,locale:E})),e.abrupt("return",q.getPublicAPI());case 60:return e.prev=60,e.t6=e.catch(19),e.prev=62,e.next=65,Promise.all([o.e(8765),o.e(1249)]).then(o.bind(o,646));case 65:return z=e.sent,J=z.default,Z=new J(K(K({},L),{},{baseUrl:"".concat("https://na-library.klarnaservices.com/").concat("0.0.324","/"),version:"0.0.324",environment:g,sessionId:C,shoppingSessionId:I,runtimeConfig:N,clientInstanceName:S,locale:E})),e.abrupt("return",Z.getPublicAPI());case 71:throw e.prev=71,e.t7=e.catch(62),(0,i.vV)("Failed to load SDK: "+e.t7.message),(0,y.G)(e.t7),new Error("Failed to load SDK");case 76:case"end":return e.stop()}}),e,null,[[19,60],[62,71]])})));return function(t){return e.apply(this,arguments)}}();(function(){return $.apply(this,arguments)})().catch((function(){}))})();