PageSourceSearch

https://www.megaflis.no/assets/6013.chunk.cacf58b83c86066df3a4.js

js megaflis.no collected 2026-09-26 08:27:56 UTC 13,195 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunknitro5_app=self.webpackChunknitro5_app||[]).push([[6013],{6013(t,e,n){n.r(e),n.d(e,{addDiscountCode:()=>_,addGiftCard:()=>B,addToCart:()=>T,completePurchase:()=>ft,hideModal:()=>yt,lockPage:()=>dt,lookupAddress:()=>tt,onStateChange:()=>G,registerCompletePurchaseHandler:()=>ht,registerPurchaseParameterProvider:()=>pt,registerPurchaseProcessor:()=>mt,reload:()=>at,reloadCart:()=>st,reloadCheckout:()=>ut,removeDiscountCode:()=>Q,removeFromCart:()=>$,removeGiftCardCode:()=>F,setAdditionalData:()=>rt,setBillingAddress:()=>nt,setEmail:()=>X,setIdentificationNumber:()=>Z,setPaymentGatewayData:()=>J,setPaymentMethodId:()=>z,setPhoneNumber:()=>Y,setShippingAddress:()=>it,setShippingMethodId:()=>K,setShippingPluginAdditionalData:()=>ot,setState:()=>U,setValidationErrors:()=>ct,showModal:()=>vt,unlockPage:()=>lt,updateCartItemQuantity:()=>V,useDifferentShippingAddress:()=>et});var i=n(4156),r=n.n(i),o=function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function a(t){try{s(i.next(t))}catch(t){o(t)}}function u(t){try{s(i.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,u)}s((i=i.apply(t,e||[])).next())})};
1let a=Promise.resolve(),u=[],s=Promise.resolve();const c=[],d={isInSyncWithServer:!0,isUpdating:!1};function l(t){let e=!1;Object.keys(t).forEach(n=>{d[n]!==t[n]&&(e=!0,d[n]=t[n])}),e&&c.forEach(e=>e(t))}function f(){return 0===u.length}function h(){if(!u.length)return null;let t={};return u.forEach(e=>t=r()(t,e)),t}function p(t){a=a.then(e=>t.then(()=>e,()=>e),e=>t.then(()=>Promise.reject(e),()=>e))}function m(t){-1===u.indexOf(t)&&(l({isInSyncWithServer:!1}),u.push(t))}function v(t){return u.length&&(a=a.then(()=>w(t,0),()=>w(t,0))),a}let y,g=Promise.resolve();const P=()=>(g=new Promise(t=>{y=t}),y);let C,b,k;const S=()=>{k=new Promise((t,e)=>{C=t,b=e})};S();let D=null;function w(t){return o(this,arguments,void 0,function*(t,e=0){return null!==D&&(clearTimeout(D),D=null),D=setTimeout(()=>o(this,void 0,void 0,function*(){if(f())return s.then(C,b),void S();const n=h(),i=u;u=[],l({isInSyncWithServer:!1,isUpdating:!0}),s=t(n);try{const e=yield s;if(u.length)return s=w(t,0);l({isInSyncWithServer:!0,isUpdating:!1}),C(e),S()}catch(n){++e>3?(l({isInSyncWithServer:!1,isUpdating:!1}),b(n),S()):(u=i.concat(u),s=w(t,e).then(C,b))}}),0),k})}var A=n(667);var j=function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function a(t){try{s(i.next(t))}catch(t){o(t)}}function u(t){try{s(i.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,u)}s((i=i.apply(t,e||[])).next())})};const O=[],E={isUpdating:!1,isInSyncWithServer:!0,validationErrors:[],isLocked:!1,activeModal:null},M={completePurchaseHandlers:{},purchaseParameterProviders:{},purchaseProcessors:{}};var I;function U(t){const e=E,n=t(E);if(n===e)throw new Error("Don't mutate the state passed into the setState callback, return a new object");let i=!1;return Object.keys(n).forEach(t=>{void 0!==n[t]&&n[t]!==E[t]&&(E[t]=n[t],i=!0)}),i?Promise.all(O.map(t=>t(E))):Promise.resolve()}function G(t,e){return j(this,void 0,void 0,function*(){return"undefined"==typeof document?()=>null:(O.push(t),()=>{const e=O.indexOf(t);O.splice(e,1)})})}function x(t,e,n){if(R(t))return t!==e;if(Array.isArray(t)){if(!Array.isArray(e))return!0;if(t.length!==e.length)return!0;for(let i=0;i<t.length;i++)if(x(t[i],e[i],n))return!0}else if("object"==typeof t){if("object"!=typeof e||!e)return!0;for(const i of Object.keys(t))if(-1===n.indexOf(i)&&x(t[i],e[i],n))return!0}return!1}function W(t,e){return j(this,void 0,void 0,function*(){var n;if(E.isLocked)return null;t.fromCheckout=null!==e.getCheckoutData();const i=!!!!(null===(n=e.shouldSkipOptimisticUpdate)||void 0===n?void 0:n.call(e,t))||function(t,e){if(E.isLocked)return;const n=function(t,e){let n=!1,i=!1,o=!1;const a=e.getCart();if(t.items&&a){const o=r()({},a);if(n=N(o.items,t.items),n&&(U(t=>({isInSyncWithServer:!1,isUpdating:!0})),e.setCart(o)),!n){const e=o.items.filter(t=>!t.isGift).map(t=>t.code);i=Object.keys(t.items).some(t=>-1===e.indexOf(t))}}t.additional&&(o=!a||Object.keys(t.additional).some(e=>t.additional[e]!==a.additional[e]));return n||i||o}(t,e),i=function(t,e){let n=e.getCheckoutData();if(!n)return!1;n=r()({},n);const i=H(n,t);i&&(U(t=>({isInSyncWithServer:!1,isUpdating:!0})),e.setCheckoutData(n));return i}(t,e);if(n||i)return m(t),!0;return!1}(t,e);if(!i)return null;const o=P(),u=yield(s=t,c=e.postUpdate,m(s),a=a.then(()=>w(c,0),()=>w(c,0)),a);var s,c;if(t.fromCheckout){const t=u;return L(null,t.checkoutData),e.setCart(null),yield q(e,t.checkoutData),o(),t}{const t=u;return L(t.cart,null),e.setCart(t.cart),o(),t}})}function q(t,e){return j(this,void 0,void 0,function*(){yield(0,A.$MH)(e),yield t.setCheckoutData(e)})}function L(t,e){const n=h();n&&(t&&n.items&&N(t.items,n.items),e&&H(e,n))}function N(t,e){let n=!1;return Object.keys(e).forEach(i=>{let o=t.find(t=>!t.isGift&&t.code===i);if(o&&o.quantity!==e[i].quantity&&(o.quantity=e[i].quantity,n=!0),o&&o.quantity<=0){const e=t.indexOf(o);t.splice(e,1),o=void 0}o&&e[i].additional&&(o.additional?x(e[i].additional,o.additional,[])&&(o.additional=r()(o.additional,e[i].additional),n=!0):(o.additional=r()({},e[i].additional),n=!0))}),n}function H(t,e){let n=!1;if(x(e,t,["fromCheckout"])&&(Object.keys(e).forEach(n=>{!(n in t)||e.items&&e[n]===e.items||(!(n in t)||R(e[n])?t[n]=e[n]:t[n]=r()(t[n],e[n]))}),n=!0),e.items){const i=N(t.items,e.items);n||(n=i)}return n}function R(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t}function T(t,e,n){return j(this,void 0,void 0,function*(){let i=n.getCart();i||(i=yield n.loadCart());const r=i.items.find(e=>!e.isGift&&e.code===t);return r&&(e.quantity+=r.quantity),W({items:{[t]:e}},n)})}function V(t,e,n){return j(this,void 0,void 0,function*(){return W({items:{[t]:e}},n)})}function $(t,e){return j(this,void 0,void 0,function*(){return W({items:{[t]:{quantity:0}}},e)})}function B(t,e,n){return j(this,void 0,void 0,function*(){return W({giftCards:{[t]:{additional:e}}},n)})}function F(t,e){return j(this,void 0,void 0,function*(){return W({removedGiftCardCodes:[t]},e)})}function _(t,e){return j(this,void 0,void 0,function*(){return W({addedDiscountCodes:[t]},e)})}function Q(t,e){return j(this,void 0,void 0,function*(){return W({removedDiscountCodes:[t]},e)})}function z(t,e){return j(this,void 0,void 0,function*(){return W({paymentMethodId:t},e)})}function J(t,e){return j(this,void 0,void 0,function*(){return W({paymentGatewayData:t},e)})}function K(t,e){return j(this,void 0,void 0,function*(){return W({shippingMethodId:t},e)})}function X(t,e){return j(this,void 0,void 0,function*(){return W({email:t},e)})}function Y(t,e){return j(this,void 0,void 0,function*(){return W({phoneNumber:t},e)})}function Z(t,e){return j(this,void 0,void 0,function*(){return W({identificationNumber:t},e)})}function tt(t){return j(this,void 0,void 0,function*(){const e=yield W({},t);return!e||!e.checkoutData.billingAddress.isVerified||e.checkoutData.useDifferentShippingAddress&&!e.checkoutData.shippingAddress.isVerified?Promise.reject(null):e})}function et(t,e){return j(this,void 0,void 0,function*(){return W({useDifferentShippingAddress:t},e)})}function nt(t,e){return j(this,void 0,void 0,function*(){return W({billingAddress:t},e)})}function it(t,e){return j(this,void 0,void 0,function*(){return W({shippingAddress:t},e)})}function rt(t,e){return j(this,void 0,void 0,function*(){return W({additional:t},e)})}function ot(t,e){return j(this,void 0,void 0,function*(){return W({shippingPluginAdditional:t},e)})}function at(t,e){return j(this,void 0,void 0,function*(){null!=e.getCheckoutData()&&(yield ut(e)),t||null!=e.getCart()&&(yield st(e))})}function ut(t){return j(this,void 0,void 0,function*(){if(!t.getCheckoutData()&&f())return Promise.resolve();yield v(t.postUpdate);
1const e=new Promise((e,n)=>j(this,void 0,void 0,function*(){try{const n=yield t.loadCheckoutData();L(null,n),yield q(t,n),e(n)}catch(t){n(t)}}));p(e),yield e})}function st(t){return j(this,void 0,void 0,function*(){if(!t.getCart()&&f())return Promise.resolve();yield v(t.postUpdate);const e=new Promise((e,n)=>j(this,void 0,void 0,function*(){try{const n=yield t.loadCart();L(n,null),t.setCart(n),e(n)}catch(t){n(t)}}));p(e),yield e})}function ct(t,e){return j(this,void 0,void 0,function*(){return U(e=>({validationErrors:t}))})}function dt(t){return j(this,void 0,void 0,function*(){return U(t=>({isLocked:!0}))})}function lt(t){return j(this,void 0,void 0,function*(){return U(t=>({isLocked:!1}))})}function ft(t){return j(this,void 0,void 0,function*(){if(E.isLocked)return Promise.reject();U(t=>({isLocked:!0}));try{f()||(yield v(t.postUpdate)),yield a,yield g;const e={},n={},i=t.getCheckoutData();if(!i.canProceedWithPurchase)return Promise.reject();i.items.filter(t=>!t.isGift).forEach(t=>e[t.code]={quantity:t.quantity,additional:t.additional}),i.giftCardPayments.forEach(t=>n[t.code]={additional:t.additional});const r={fromCheckout:!0,items:e,shippingAddress:i.shippingAddress,billingAddress:i.billingAddress,useDifferentShippingAddress:i.useDifferentShippingAddress,email:i.email,phoneNumber:i.phoneNumber,identificationNumber:i.identificationNumber,shippingMethodId:i.shippingMethodId,paymentMethodId:i.paymentMethodId,paymentGatewayData:i.paymentGatewayData,paymentCompletePurchaseParams:{},giftCards:n,removedGiftCardCodes:[],addedDiscountCodes:i.discountCodes,removedDiscountCodes:[],additional:i.additional,shippingPluginAdditional:i.shippingPluginAdditional};if(r.paymentMethodId in M.completePurchaseHandlers)return yield M.completePurchaseHandlers[r.paymentMethodId]();{r.paymentMethodId in M.purchaseParameterProviders&&(r.paymentCompletePurchaseParams=yield M.purchaseParameterProviders[r.paymentMethodId]());const e=yield t.postCompletePurchase(r);if(e.validationErrors&&e.validationErrors.length?U(t=>({validationErrors:e.validationErrors})):E.validationErrors.length&&U(t=>({validationErrors:[]})),e.paymentGatewayData){const n=yield M.purchaseProcessors[r.paymentMethodId](e.paymentGatewayData);if(n.orderConfirmationPageUrl)return t.setCart(null),t.pushState(n.orderConfirmationPageUrl),new Promise(()=>{})}else{if(e.paymentRedirectUrl)return e.paymentPostData?function(t,e,n){const i=document.createElement("form");(0,A.lTB)()&&(document.charset=n),i.acceptCharset=n,i.style.display="none",i.method="post",i.action=t,Object.keys(e).forEach(t=>{const n=document.createElement("input");n.type="hidden",n.value=e[t],n.name=t,i.appendChild(n)}),document.body.appendChild(i),i.submit()}(e.paymentRedirectUrl,e.paymentPostData,e.paymentFormEncoding):window.location.href=e.paymentRedirectUrl,new Promise(t=>null);if(e.orderConfirmationRedirectUrl)return t.setCart(null),t.pushState(e.orderConfirmationRedirectUrl),new Promise(t=>null);if(e.newCheckoutData)return t.setCheckoutData(e.newCheckoutData),yield q(t,e.newCheckoutData),Promise.reject(e)}}}finally{U(t=>({isLocked:!1}))}})}function ht(t,e,n){return j(this,void 0,void 0,function*(){M.completePurchaseHandlers[t]=e})}function pt(t,e,n){return j(this,void 0,void 0,function*(){M.purchaseParameterProviders[t]=e})}function mt(t,e,n){return j(this,void 0,void 0,function*(){M.purchaseProcessors[t]=e})}function vt(t,e){return j(this,void 0,void 0,function*(){U(e=>({activeModal:t}))})}function yt(t){return j(this,void 0,void 0,function*(){U(t=>({activeModal:null}))})}I=t=>U(e=>({isInSyncWithServer:t.isInSyncWithServer,isUpdating:t.isUpdating})),"undefined"==typeof document||c.push(I)},4156(t){var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===n}(t)}(t)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?s((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function r(t,e,n){return t.concat(e).map(function(t){return i(t,n)})}function o(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}(t))}function a(t,e){try{return e in t}catch(t){return!1}}function u(t,e,n){var r={};return n.isMergeableObject(t)&&o(t).forEach(function(e){r[e]=i(t[e],n)}),o(e).forEach(function(o){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,o)||(a(t,o)&&n.isMergeableObject(e[o])?r[o]=function(t,e){if(!e.customMerge)return s;var n=e.customMerge(t);return"function"==typeof n?n:s}(o,n)(t[o],e[o],n):r[o]=i(e[o],n))}),r}function s(t,n,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||e,o.cloneUnlessOtherwiseSpecified=i;var a=Array.isArray(n);return a===Array.isArray(t)?a?o.arrayMerge(t,n,o):u(t,n,o):i(n,o)}s.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,n){return s(t,n,e)},{})};var c=s;t.exports=c}}]);
2//# sourceMappingURL=6013.chunk.cacf58b83c86066df3a4.js.map

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.