PageSourceSearch

https://www.lomax.dk/dist/assets/gift-voucher-order-vYOcJ_NR.js

js lomax.dk collected 2026-09-25 06:31:10 UTC 25,775 bytes, 1 lines download raw bytes

1import{k as rt,l as lt,m as ut,n as st,p as dt,e as X,o as ht}from"./main-CaodR1qc.js";import{r as ot,a as nt,b as at,c as j,d as pt,e as ft}from"./selector-engine-CuV5Qm1H.js";var G={exports:{}};var gt=G.exports,Z;function _t(){return Z||(Z=1,(function(r,s){(function(l,u){r.exports=u(ot(),nt(),at(),j())})(gt,(function(l,u,c,A){const f=".bs.tab",g=`hide${f}`,_=`hidden${f}`,o=`show${f}`,n=`shown${f}`,d=`click${f}`,v=`keydown${f}`,p=`load${f}`,k="ArrowLeft",O="ArrowRight",q="ArrowUp",b="ArrowDown",L="Home",E="End",S="active",W="fade",N="show",$="dropdown",P=".dropdown-toggle",M=".dropdown-menu",x=`:not(${P})`,I='.list-group, .nav, [role="tablist"]',V=".nav-item, .list-group-item",z=`.nav-link${x}, .list-group-item${x}, [role="tab"]${x}`,R='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',F=`${z}, ${R}`,H=`.${S}[data-bs-toggle="tab"], .${S}[data-bs-toggle="pill"], .${S}[data-bs-toggle="list"]`;class D extends l{constructor(i){super(i),this._parent=this._element.closest(I),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),u.on(this._element,v,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const i=this._element;if(this._elemIsActive(i))return;const t=this._getActiveElem(),e=t?u.trigger(t,g,{relatedTarget:i}):null;u.trigger(i,o,{relatedTarget:t}).defaultPrevented||e&&e.defaultPrevented||(this._deactivate(t,i),this._activate(i,t))}_activate(i,t){if(!i)return;i.classList.add(S),this._activate(c.getElementFromSelector(i));const e=()=>{if(i.getAttribute("role")!=="tab"){i.classList.add(N);return}i.removeAttribute("tabindex"),i.setAttribute("aria-selected",!0),this._toggleDropDown(i,!0),u.trigger(i,n,{relatedTarget:t})};this._queueCallback(e,i,i.classList.contains(W))}_deactivate(i,t){if(!i)return;i.classList.remove(S),i.blur(),this._deactivate(c.getElementFromSelector(i));const e=()=>{if(i.getAttribute("role")!=="tab"){i.classList.remove(N);return}i.setAttribute("aria-selected",!1),i.setAttribute("tabindex","-1"),this._toggleDropDown(i,!1),u.trigger(i,_,{relatedTarget:t})};this._queueCallback(e,i,i.classList.contains(W))}_keydown(i){if(![k,O,q,b,L,E].includes(i.key))return;i.stopPropagation(),i.preventDefault();const t=this._getChildren().filter(a=>!A.isDisabled(a));let e;if([L,E].includes(i.key))e=t[i.key===L?0:t.length-1];else{const a=[O,b].includes(i.key);e=A.getNextActiveElement(t,i.target,a,!0)}e&&(e.focus({preventScroll:!0}),D.getOrCreateInstance(e).show())}_getChildren(){return c.find(F,this._parent)}_getActiveElem(){return this._getChildren().find(i=>this._elemIsActive(i))||null}_setInitialAttributes(i,t){this._setAttributeIfNotExists(i,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(i){i=this._getInnerElement(i);const t=this._elemIsActive(i),e=this._getOuterElement(i);i.setAttribute("aria-selected",t),e!==i&&this._setAttributeIfNotExists(e,"role","presentation"),t||i.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(i,"role","tab"),this._setInitialAttributesOnTargetPanel(i)}_setInitialAttributesOnTargetPanel(i){const t=c.getElementFromSelector(i);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),i.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${i.id}`))}_toggleDropDown(i,t){const e=this._getOuterElement(i);if(!e.classList.contains($))return;const a=(h,y)=>{const C=c.findOne(h,e);C&&C.classList.toggle(y,t)};a(P,S),a(M,N),e.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(i,t,e){i.hasAttribute(t)||i.setAttribute(t,e)}_elemIsActive(i){return i.classList.contains(S)}_getInnerElement(i){return i.matches(F)?i:c.findOne(F,i)}_getOuterElement(i){return i.closest(V)||i}static jQueryInterface(i){return this.each(function(){const t=D.getOrCreateInstance(this);if(typeof i=="string"){if(t[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);t[i]()}})}}return u.on(document,d,R,function(T){["A","AREA"].includes(this.tagName)&&T.preventDefault(),!A.isDisabled(this)&&D.getOrCreateInstance(this).show()}),u.on(window,p,()=>{for(const T of c.find(H))D.getOrCreateInstance(T)}),A.defineJQueryPlugin(D),D}))})(G)),G.exports}var mt=_t();const vt=rt(mt);var K={exports:{}};const bt=lt(ut);var U={exports:{}};var yt=U.exports,tt;function ct(){return tt||(tt=1,(function(r,s){(function(l,u){u(s)})(yt,(function(l){const c={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},A=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),m=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,w=(g,_)=>{const o=g.nodeName.toLowerCase();return _.includes(o)?A.has(o)?!!m.test(g.nodeValue):!0:_.filter(n=>n instanceof RegExp).some(n=>n.test(o))};function f(g,_,o){if(!g.length)return g;if(o&&typeof o=="function")return o(g);const d=new window.DOMParser().parseFromString(g,"text/html"),v=[].concat(...d.body.querySelectorAll("*"));for(const p of v){const k=p.nodeName.toLowerCase();if(!Object.keys(_).includes(k)){p.remove();continue}
1const O=[].concat(...p.attributes),q=[].concat(_["*"]||[],_[k]||[]);for(const b of O)w(b,q)||p.removeAttribute(b.nodeName)}return d.body.innerHTML}l.DefaultAllowlist=c,l.sanitizeHtml=f,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}))})(U,U.exports)),U.exports}var Y={exports:{}};var Et=Y.exports,et;function Tt(){return et||(et=1,(function(r,s){(function(l,u){r.exports=u(at(),pt(),ct(),j())})(Et,(function(l,u,c,A){const m="TemplateFactory",w={allowList:c.DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},f={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},g={entry:"(string|element|function|null)",selector:"(string|element)"};class _ extends u{constructor(n){super(),this._config=this._getConfig(n)}static get Default(){return w}static get DefaultType(){return f}static get NAME(){return m}getContent(){return Object.values(this._config.content).map(n=>this._resolvePossibleFunction(n)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(n){return this._checkContent(n),this._config.content={...this._config.content,...n},this}toHtml(){const n=document.createElement("div");n.innerHTML=this._maybeSanitize(this._config.template);for(const[p,k]of Object.entries(this._config.content))this._setContent(n,k,p);const d=n.children[0],v=this._resolvePossibleFunction(this._config.extraClass);return v&&d.classList.add(...v.split(" ")),d}_typeCheckConfig(n){super._typeCheckConfig(n),this._checkContent(n.content)}_checkContent(n){for(const[d,v]of Object.entries(n))super._typeCheckConfig({selector:d,entry:v},g)}_setContent(n,d,v){const p=l.findOne(v,n);if(p){if(d=this._resolvePossibleFunction(d),!d){p.remove();return}if(A.isElement(d)){this._putElementInTemplate(A.getElement(d),p);return}if(this._config.html){p.innerHTML=this._maybeSanitize(d);return}p.textContent=d}}_maybeSanitize(n){return this._config.sanitize?c.sanitizeHtml(n,this._config.allowList,this._config.sanitizeFn):n}_resolvePossibleFunction(n){return A.execute(n,[void 0,this])}_putElementInTemplate(n,d){if(this._config.html){d.innerHTML="",d.append(n);return}d.textContent=n.textContent}}return _}))})(Y)),Y.exports}var At=K.exports,it;function St(){return it||(it=1,(function(r,s){(function(l,u){r.exports=u(bt,ot(),nt(),ft(),j(),ct(),Tt())})(At,(function(l,u,c,A,m,w,f){function g(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const _=g(l),o="tooltip",n=new Set(["sanitize","allowList","sanitizeFn"]),d="fade",v="modal",p="show",k=".tooltip-inner",O=`.${v}`,q="hide.bs.modal",b="hover",L="focus",E="click",S="manual",W="hide",N="hidden",$="show",P="shown",M="inserted",x="click",I="focusin",V="focusout",z="mouseenter",R="mouseleave",F={AUTO:"auto",TOP:"top",RIGHT:m.isRTL()?"left":"right",BOTTOM:"bottom",LEFT:m.isRTL()?"right":"left"},H={allowList:w.DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},D={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class T extends u{constructor(t,e){if(typeof _>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return H}static get DefaultType(){return D}static get NAME(){return o}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),c.off(this._element.closest(O),q,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const t=c.trigger(this._element,this.constructor.eventName($)),a=(m.findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!a)return;this._disposePopper();const h=this._getTipElement();this._element.setAttribute("aria-describedby",h.getAttribute("id"));const{container:y}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(y.append(h),c.trigger(this._element,this.constructor.eventName(M))),this._popper=this._createPopper(h),h.classList.add(p),"ontouchstart"in document.documentElement)for(const B of[].concat(...document.body.children))c.on(B,"mouseover",m.noop);const C=()=>{c.trigger(this._element,this.constructor.eventName(P)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(C,this.tip,this._isAnimated())}
1hide(){if(!this._isShown()||c.trigger(this._element,this.constructor.eventName(W)).defaultPrevented)return;if(this._getTipElement().classList.remove(p),"ontouchstart"in document.documentElement)for(const h of[].concat(...document.body.children))c.off(h,"mouseover",m.noop);this._activeTrigger[E]=!1,this._activeTrigger[L]=!1,this._activeTrigger[b]=!1,this._isHovered=null;const a=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),c.trigger(this._element,this.constructor.eventName(N)))};this._queueCallback(a,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(d,p),e.classList.add(`bs-${this.constructor.NAME}-auto`);const a=m.getUID(this.constructor.NAME).toString();return e.setAttribute("id",a),this._isAnimated()&&e.classList.add(d),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new f({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[k]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(d)}_isShown(){return this.tip&&this.tip.classList.contains(p)}_createPopper(t){const e=m.execute(this._config.placement,[this,t,this._element]),a=F[e.toUpperCase()];return _.createPopper(this._element,t,this._getPopperConfig(a))}_getOffset(){const{offset:t}=this._config;return typeof t=="string"?t.split(",").map(e=>Number.parseInt(e,10)):typeof t=="function"?e=>t(e,this._element):t}_resolvePossibleFunction(t){return m.execute(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:a=>{this._getTipElement().setAttribute("data-popper-placement",a.state.placement)}}]};return{...e,...m.execute(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if(e==="click")c.on(this._element,this.constructor.eventName(x),this._config.selector,a=>{const h=this._initializeOnDelegatedTarget(a);h._activeTrigger[E]=!(h._isShown()&&h._activeTrigger[E]),h.toggle()});else if(e!==S){const a=e===b?this.constructor.eventName(z):this.constructor.eventName(I),h=e===b?this.constructor.eventName(R):this.constructor.eventName(V);c.on(this._element,a,this._config.selector,y=>{const C=this._initializeOnDelegatedTarget(y);C._activeTrigger[y.type==="focusin"?L:b]=!0,C._enter()}),c.on(this._element,h,this._config.selector,y=>{const C=this._initializeOnDelegatedTarget(y);C._activeTrigger[y.type==="focusout"?L:b]=C._element.contains(y.relatedTarget),C._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},c.on(this._element.closest(O),q,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=A.getDataAttributes(this._element);for(const a of Object.keys(e))n.has(a)&&delete e[a];return t={...e,...typeof t=="object"&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=t.container===!1?document.body:m.getElement(t.container),typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),typeof t.title=="number"&&(t.title=t.title.toString()),typeof t.content=="number"&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,a]of Object.entries(this._config))this.constructor.Default[e]!==a&&(t[e]=a);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const e=T.getOrCreateInstance(this,t);if(typeof t=="string"){if(typeof e[t]>
1"u")throw new TypeError(`No method named "${t}"`);e[t]()}})}}return m.defineJQueryPlugin(T),T}))})(K)),K.exports}var Ct=St();const wt=rt(Ct);function Lt(r){const s=l=>r.dataset[l]??"";return{currency:s("textCurrency"),week:s("textWeek"),yes:s("textYes"),no:s("textNo"),errorAmountRequired:s("textErrorAmountRequired"),errorAmountMin:s("textErrorAmountMin"),errorAmountMax:s("textErrorAmountMax"),errorSelectPrice:s("textErrorSelectPrice"),errorSelectWeek:s("textErrorSelectWeek"),errorServer:s("textErrorServer"),errorMissingFields:s("textErrorMissingFields"),errorNoVouchers:s("textErrorNoVouchers"),errorNoMatch:s("textErrorNoMatch"),errorDeadlinePassed:s("textErrorDeadlinePassed"),physical:s("textPhysical"),digital:s("textDigital")}}function kt(r){return r.toLocaleString("da-DK",{minimumFractionDigits:2,maximumFractionDigits:2})}function Ft(){const r=document.querySelector('[app="gift-voucher-order"]');r&&Nt(r)}function Nt(r){const s=Lt(r),l=r.dataset.orderUrl??"/api/commerce/giftvoucher/order",u=r.dataset.datasourceId??"",c=r.dataset.upperCategory??"",A=r.dataset.wrappingArticle??"",m=r.dataset.wrappingPrice??"0",w=parseFloat(m.replace(",","."))||0,f=r.dataset.deliveryArticle??"",g=r.querySelector('input[name="gvAmount"]:checked'),_=r.querySelector('input[name="gvType"]:checked'),o={antal:0,belob:g?.value??"",type:_?.value??"Digitalt",deliveryWeek:"",deliveryWeekDisplay:"",locationCost:0,wrappingCost:0,wrapping:!1};let n=0;const d=r.querySelector("#gv-order-modal"),v=r.querySelector("#gvStep1"),p=r.querySelector("#gvStep2"),k=r.querySelector("#gvStep3"),O=r.querySelector("#gvProgressFill"),q=[r.querySelector("#gvProgressLabel1"),r.querySelector("#gvProgressLabel2"),r.querySelector("#gvProgressLabel3")],b=r.querySelector("#gvAntalInput"),L=r.querySelector("#gvAntalErrorMessage"),E=r.querySelector("#gvDeliveryWeekSelect"),S=r.querySelector("#gvWeekErrorMessage"),W=r.querySelector("#gvLocationCompany"),N=r.querySelector("#gvWrappingCheckbox"),$=r.querySelector("#gvBackLink"),P=r.querySelector("#gvContinueDesktop"),M=r.querySelector("#gvSubmitDesktop"),x=r.querySelector("#gvBackDesktop");Dt(r),Ot(r),xt(r),It(r),Pt(r),qt(r),r.querySelectorAll(".image-slider").forEach(e=>{e.closest('[id^="gv-proddesc-"]')||st(e)}),r.querySelectorAll('.gift-voucher-order__price-nav [data-bs-toggle="tab"]').forEach(e=>{e.addEventListener("shown.bs.tab",()=>{const a=e.getAttribute("href")?.replace("#gv-tab-","")??"";if(!a)return;const h=d?.querySelector(`input[name="gvAmount"][value="${a}"]`);h&&(h.checked=!0,o.belob=a,T())})}),r.querySelector("#gvNextToStep2")?.addEventListener("click",()=>{V()&&I(1)}),r.querySelector("#gvNextToStep3")?.addEventListener("click",()=>{z()&&I(2)}),P?.addEventListener("click",()=>{n===0&&V()?I(1):n===1&&z()&&t()}),M?.addEventListener("click",()=>t()),$?.addEventListener("click",e=>{e.preventDefault(),I(n-1)}),x?.addEventListener("click",e=>{e.preventDefault(),I(0)}),r.querySelector("#gvSubmitMobile")?.addEventListener("click",()=>t()),b?.addEventListener("input",()=>{o.antal=parseInt(b.value)||0,F(),T()}),r.querySelectorAll('input[name="gvAmount"]').forEach(e=>{e.addEventListener("change",()=>{o.belob=e.value,T()})}),r.querySelectorAll('input[name="gvType"]').forEach(e=>{e.addEventListener("change",()=>{o.type=e.value,T()})}),E?.addEventListener("change",()=>{const e=E.options[E.selectedIndex];o.deliveryWeek=E.value,o.deliveryWeekDisplay=e?.dataset.weekDisplay??E.value,E.classList.remove("is-invalid"),S&&(S.style.display="none"),T()}),r.querySelectorAll('input[name="gvLocation"]').forEach(e=>{e.addEventListener("change",()=>{o.locationCost=parseFloat(e.dataset.cost??"0")||0,T()})}),N?.addEventListener("change",()=>{o.wrapping=N.checked,o.wrappingCost=N.checked?w:0,T()}),T(),d?.addEventListener("close",H);function I(e){n=Math.max(0,Math.min(2,e)),v&&(v.style.display=n===0?"":"none"),p&&(p.style.display=n===1?"":"none"),k&&(k.style.display=n===2?"":"none");const a=n===0?50:n===1?75:100;O&&(O.style.width=a+"%"),q.forEach((h,y)=>{h?.classList.toggle("active",y<=n),h?.classList.toggle("clickable",y<n)}),$&&($.style.display=n>0?"":"none"),P&&M&&x&&(n===0?(P.style.display="",M.style.display="none",x.classList.add("d-none")):(P.style.display="none",M.style.display="",x.classList.remove("d-none"))),T()}function V(){let e=!0;return!o.antal||o.antal<=0?(R(s.errorAmountRequired),e=!1):o.antal<5?(R(s.errorAmountMin),e=!1):o.antal>1e5&&(R(s.errorAmountMax),e=!1),o.belob||(e=!1),e}function z(){let e=!0;return o.deliveryWeek||(E&&E.classList.add("is-invalid"),S&&(S.style.display="block"),e=!1),e}function R(e){b&&b.classList.add("is-invalid"),L&&(L.textContent=e,L.style.display="block")}function F(){b&&b.classList.remove("is-invalid"),L&&(L.style.display="none")}function H(){o.antal=0,o.belob=g?.value??"",o.type=_?.value??"Digitalt",o.deliveryWeek="",o.deliveryWeekDisplay="",o.locationCost=0,o.wrappingCost=0,o.wrapping=!1,b&&(b.value=""),g&&(g.checked=!0),_&&(_.checked=!0),E&&(E.selectedIndex=0),W&&(W.checked=!0),N&&(N.checked=!1),F(),E&&E.classList.remove("is-invalid"),S&&(S.style.display="none"),I(0)}function D(){const e=o.antal*(parseFloat(o.belob)||0),a=o.antal*o.locationCost,h=o.antal*o.wrappingCost;return e+a+h}function T(){const e=D(),a=o.antal>0&&o.belob?kt(e)+" "+s.currency:"...",h=o.antal>0?o.antal.toString():"...",y=o.belob?o.belob+",-":"...",C=o.type==="Fysisk"?s.physical:s.digital,B=o.deliveryWeek?s.week+" "+o.deliveryWeekDisplay:"...",Q=o.locationCost>0?"Medarbejderens adresse":"Firmaets adresse",J=o.wrapping?s.yes:s.no;i("#gvTotalStep1","Total: "+a),i("#gvTotalStep2","Total: "+a),i("#gvFinalAntal",h),i("#gvFinalBelob",y),i("#gvFinalType",C),i("#gvFinalWeek",B),i("#gvFinalLocation",Q),i("#gvFinalWrapping",J),i("#gvFinalTotalVal",a),i("#gvSummaryAntal",h),i("#gvSummaryBelob",y),i("#gvSummaryType",C),i("#gvSummaryWeek",B),i("#gvSummaryLocation",Q),i("#gvSummaryWrapping",J),i("#gvSummaryTotalVal",a)}function i(e,a){const h=d?.querySelector(e);h&&(h.textContent=a)}async function t(){if(!V()||!z())return;const e=o.type==="Fysisk"?"Gavekort":"Pdf",a={price:o.belob,deliveryWeek:o.deliveryWeek,deliveryMethod:e,upperCategory:c,datasourceId:u,quantity:o.antal,wrapping:o.wrapping&&!!A,homeDelivery:o.locationCost>0&&!!f};console.debug("[gift-voucher-order] submit:",a);let h;try{h=await dt(l,a)}catch(y){console.error("[gift-voucher-order] order POST failed:",y),X(s.errorServer);return}if(console.debug("[gift-voucher-order] order response:",h),!h.success){const y={missing_fields:s.errorMissingFields,no_vouchers:s.errorNoVouchers,no_match:s.errorNoMatch,deadline_passed:s.errorDeadlinePassed};X(y[h.errorCode]||s.errorServer);return}window.location.href=document.body.dataset.cartUrl||"/kurv/"}}function Dt(r){r.querySelectorAll('.gift-voucher-order__price-nav [data-bs-toggle="tab"]').forEach(s=>
1{new vt(s),s.addEventListener("shown.bs.tab",()=>{const l=s.dataset.color||"#414141";r.querySelectorAll('.gift-voucher-order__price-btn[data-bs-toggle="tab"]').forEach(u=>{u.classList.remove("active"),u.style.backgroundColor="",u.style.color=""}),s.classList.add("active"),s.style.backgroundColor=l,s.style.color="white"})})}function Ot(r){r.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(s=>{const l=s.querySelector("[data-tooltip-content]"),c={container:s.closest("dialog")??"body",trigger:"hover focus click"};l&&(c.html=!0,c.sanitize=!1,c.title=l.innerHTML),new wt(s,c)})}function xt(r){const s=r.querySelector("#gvCertOnlyBtn");s&&s.addEventListener("click",()=>{const l=s.classList.toggle("active");r.querySelectorAll('[data-is-environmental="false"]').forEach(u=>{u.classList.toggle("d-none",l)})})}function It(r){const s=r.querySelector("#gvScrollToTop");s&&(window.addEventListener("scroll",()=>{s.classList.toggle("show",window.scrollY>400)}),s.addEventListener("click",()=>{window.scrollTo({top:0,behavior:"smooth"})}))}function Pt(r){const s=l=>{const c=l.closest("[data-gv-product]")?.dataset.gvProduct;if(!c)return;const A=document.getElementById(`gv-proddesc-${c}`);if(!A)return;const m=A.innerHTML;ht({name:"gift-voucher-detail",skipFetch:!0,className:"gift-voucher-order__detail-modal",insertContent:w=>{const f=document.createElement("div");f.className="gift-voucher-order__detail-modal-content",f.innerHTML=m;const g=w.querySelector(".btn-close");g&&f.insertBefore(g,f.firstChild),w.appendChild(f);const _=w.querySelector(".image-slider");if(!_)return;const o=st(_);if(!o)return;const n=Array.from(w.querySelectorAll(".gift-voucher-order__thumb"));n.forEach(d=>{d.addEventListener("click",()=>{const v=Number(d.dataset.thumbIndex);Number.isNaN(v)||o.goTo(v)})}),o.subscribe(d=>{n.forEach((v,p)=>v.classList.toggle("is-active",p===d))})}})};r.querySelectorAll(".gift-voucher-order__product-image-trigger").forEach(l=>{l.addEventListener("click",()=>s(l)),l.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s(l))})})}function qt(r){const s=r.querySelector("#gvStickyContainer");if(!s?.parentElement)return;const l=document.createElement("div");l.className="gift-voucher-order__sticky-sentinel",l.setAttribute("aria-hidden","true"),s.parentElement.insertBefore(l,s),new IntersectionObserver(([c])=>{s.classList.toggle("is-scrolled",!c.isIntersecting)},{threshold:0}).observe(l)}export{Ft as default};

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.