1(globalThis["webpackChunkwebsite_js"]=globalThis["webpackChunkwebsite_js"]||[]).push([[564],{3540(e,t,r){"use strict";r.d(t,{A:()=>p});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{attrs:{id:e.containerId}},[e._t("default")],2)},i=[],o=r(15215),n=r(71886);let a=class extends n.lD{constructor(){super(...arguments),this.randNumber=Math.ceil(1e6*Math.random()),this.containerId=`cf-turnstile-${this.randNumber}`,this.theme="auto",this.size="normal",this.autoReset=!1,this.resetTimeout=295e3,this.recaptchaCompat=!1,this.explicitRender=!1,this.appearance="always",this.widgetId=null,this.observer=null}initTurnstile(){const e=document.createElement("script"),t="https://challenges.cloudflare.com/turnstile/v0/api.js",r=`onloadTurnstileCallback${this.randNumber}`,s=this.recaptchaCompat?"&compat=recaptcha":"",i=this.explicitRender?"&render=explicit":"";e.src=`${t}?onload=${r}${s}${i}`,e.async=!0,e.defer=!0,document.head.appendChild(e)}initObserver(){const e=document.getElementById(this.widgetId),t=e?.parentNode;if(t&&e&&!this.observer){const t={attributes:!0,attributeFilter:["style"]},r=()=>{const t={position:"fixed",bottom:"5px",zIndex:"1000"};Object.assign(e.style,t),setTimeout(()=>{e.style.display="none"},5e3)};this.observer=new MutationObserver(r),this.observer.observe(e,t)}}reset(){window.turnstile&&window.turnstile.reset(this.widgetId)}remove(){this.widgetId&&(window.turnstile.remove(this.widgetId),this.widgetId=null)}renderWidget(){this.widgetId=window.turnstile.render(`#${this.containerId}`,{sitekey:this.siteKey,theme:this.theme,size:this.size,appearance:this.appearance,callback:e=>{this.$emit("verified",e),this.remove(),this.autoReset&&setTimeout(()=>{this.reset()},this.resetTimeout)},expiredCallback:()=>{this.reset()},errorCallback:e=>{console.error(`Error callback: ${e}`)}}),void 0!==this.position&&this.initObserver(),this.$emit("rendered")}onloadTurnstileCallback(){window["onloadTurnstileCallback"+this.randNumber]=()=>{this.renderWidget()}}beforeMount(){void 0!==window.turnstile&&window.turnstile||this.initTurnstile()}mounted(){this.$emit("rendering"),void 0!==window.turnstile&&window.turnstile?this.renderWidget():this.onloadTurnstileCallback()}beforeUnmount(){this.observer&&this.observer.disconnect(),this.remove()}};(0,o.Cg)([(0,n.kv)({type:String,required:!0})],a.prototype,"siteKey",void 0),a=(0,o.Cg)([(0,n.uA)({name:"CloudflareTurnstile"})],a);const c=a,l=c;var d=r(81656),u=(0,d.A)(l,s,i,!1,null,null,null);const p=u.exports},4319(e,t,r){var s=r(85001);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("df8d64d0",s,!0,{sourceMap:!1,shadowMode:!1})},8229(e,t,r){var s=r(85683);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("217a7dcc",s,!0,{sourceMap:!1,shadowMode:!1})},9754(e,t,r){var s=r(24324);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("d06c5df6",s,!0,{sourceMap:!1,shadowMode:!1})},24324(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,".delivery-addresses{width:calc(100% - 2px);position:absolute;margin-top:-1px;background:#fff;z-index:1;scrollbar-width:thin;scrollbar-color:#0003 #0000001a;border:1px solid #0000001a;box-shadow:2px 2px 0 #0000000f;border-radius:0;overflow:hidden;max-height:300px;overflow:auto;border-top:0;border-top-left-radius:0;border-top-right-radius:0;clip-path:polygon(-150% 0,150% 0,150% 150%,-150% 150%)}.delivery-addresses::-webkit-scrollbar{width:6px;height:6px}.delivery-addresses::-webkit-scrollbar-track{background:#0000001a}.delivery-addresses::-webkit-scrollbar-thumb{background-color:#0003}.delivery-addresses-item{display:block;padding:5px 10px;color:inherit;line-height:1.1;border-top:1px solid #0000000d}.delivery-addresses-item:focus,.delivery-addresses-item:hover{background-color:#0000000d;outline:none;text-decoration:none}",""]);const c=a},24746(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());
1a.push([e.id,".address-suggestions{width:calc(100% - 2px);position:absolute;margin-top:-1px;background:#fff;z-index:1;scrollbar-width:thin;scrollbar-color:#0003 #0000001a;border:1px solid #0000001a;box-shadow:2px 2px 0 #0000000f;border-radius:0;overflow:hidden;max-height:300px;overflow:auto;border-top:0;border-top-left-radius:0;border-top-right-radius:0;clip-path:polygon(-150% 0,150% 0,150% 150%,-150% 150%)}.address-suggestions::-webkit-scrollbar{width:6px;height:6px}.address-suggestions::-webkit-scrollbar-track{background:#0000001a}.address-suggestions::-webkit-scrollbar-thumb{background-color:#0003}.address-suggestions-item{display:block;padding:3px 10px;color:inherit;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.address-suggestions-item:focus,.address-suggestions-item:hover{background-color:#0000000d;outline:none;text-decoration:none}.address-suggestions-item .text{flex:1;font-size:.85rem;font-weight:600;line-height:1.2}.address-suggestions-item .text .sku{margin-top:3px;font-size:.7rem;color:#0000008a}.address-suggestions-item .pricing{margin-left:10px;font-size:.79rem;font-weight:600}",""]);const c=a},31809(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,".cart-preview-item{display:flex;flex-direction:row;align-items:center;margin-bottom:1rem;font-size:.85rem}.cart-preview-item .cart-preview-item-image{flex:none;width:50px;height:50px;margin-right:1rem}.cart-preview-item .cart-preview-item-image img{display:block;width:100%;height:100%;object-fit:contain}.cart-preview-item .cart-preview-item-product{flex:1;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cart-preview-item .cart-preview-item-product .cart-preview-item-product-quantity{display:block;font-weight:400;font-size:.75rem;color:#00000080}.cart-preview-item .cart-preview-item-product-variant-text{font-size:.7rem;font-weight:400;color:#00000080}.cart-preview-item .cart-preview-item-price{flex:none;text-align:right;font-weight:700;margin-left:1rem}.cart-preview-item-duty{margin-top:-.7rem}.cart-preview-item-duty .cart-preview-item-image{height:auto}.cart-preview-item-duty .cart-preview-item-product{font-weight:400}.cart-preview-addon-item{font-size:85%;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",""]);const c=a},34577(e,t,r){"use strict";r.d(t,{A:()=>p});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("div",{staticClass:"cart-preview-item"},[t("div",{staticClass:"cart-preview-item-image"},[e.cartItem.imageurl?t("img",{attrs:{src:e.cartItem.imageurl}}):t("img",{attrs:{src:e.placeholderImage}})]),t("div",{staticClass:"cart-preview-item-product"},[t("span",{staticClass:"cart-preview-item-product-quantity"},[e._v(" ("+e._s(e.cartItem.quantity)+" "+e._s(e.$t("general.pcs",["pcs"]))+") ")]),e._v(" "+e._s(e.cartItem.name)+" "),e.cartItem.varianttext?t("span",{staticClass:"cart-preview-item-product-variant-text"},[t("br"),e._v(e._s(e.cartItem.varianttext))]):e._e(),e._l(e.addonItems,function(r){return t("div",{key:r.productid,staticClass:"cart-preview-addon-item"},[e._v(" + "+e._s(r.name)+" ")])})],2),t("div",{staticClass:"cart-preview-item-price"},[t("PriceOutput",{attrs:{model:e.cartItem.displaylineprice}})],1)]),e._l(e.cartItem.duties,function(r,s){return t("div",{key:s,staticClass:"cart-preview-item cart-preview-item-duty"},[t("div",{staticClass:"cart-preview-item-image"}),t("div",{staticClass:"cart-preview-item-product"},[e._v(" "+e._s(r.name)+" ")]),t("div",{staticClass:"cart-preview-item-price"},[e._v(" "+e._s(r.rate)+" ")])])})],2)},i=[],o=r(15215),n=r(71886);let a=class extends n.lD{get placeholderImage(){return window.CbxPlaceholderImage}};(0,o.Cg)([(0,n.kv)({type:Object,required:!0})],a.prototype,"cartItem",void 0),(0,o.Cg)([(0,n.kv)({type:Array,required:!1,default:[]})],a.prototype,"addonItems",void 0),a=(0,o.Cg)([(0,n.uA)({name:"CartPreviewItem"})],a);const c=a,l=c;r(56687);var d=r(81656),u=(0,d.A)(l,s,i,!1,null,null,null);const p=u.exports},36202(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());
1a.push([e.id,".checkout-actions .uk-spinner{width:20px;height:20px;margin:10px 0 10px 10px;box-sizing:border-box}.terms-content{max-height:60vh;overflow-y:auto}.terms-container{padding:30px 0}",""]);const c=a},45420(e,t,r){"use strict";r.d(t,{A:()=>i});var s=r(94335);class i{constructor(e={}){this.profileId=window.CbxApiContextKey,e.profileId&&(this.profileId=e.profileId),this.endpoint=`/contextapi/${this.profileId}/v1/voucher`}async validateVoucher(e){try{const t=await s.A.get(`${this.endpoint}/validate?voucherid=${e}`);return t.data}catch(t){return console.log(t),{valid:!1,message:null}}}async addVoucher(e){try{const t=await s.A.get(`${this.endpoint}/add?voucherid=${e}`);return t.data}catch(t){console.log(t)}}async removeVoucher(){try{const e=await s.A.get(`${this.endpoint}/remove`);return e.data}catch(e){console.log(e)}}}},46812(e,t,r){var s=r(53206);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("25cdca8a",s,!0,{sourceMap:!1,shadowMode:!1})},47803(e,t,r){var s=r(53125);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("6fbe210a",s,!0,{sourceMap:!1,shadowMode:!1})},49026(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,".checkout-cart-preview-footer{display:flex;flex-direction:column;padding:1rem}.checkout-cart-preview-footer .total-price{font-size:1.25rem}.checkout-cart-preview-footer>div{display:flex;flex:1}.checkout-cart-preview-footer>div>:first-child{flex:1}",""]);const c=a},52598(e,t,r){"use strict";var s=r(51605),i=r(52929),o=r(24601),n=r(73938),a=r(60938);s({target:"Iterator",proto:!0,real:!0},{find:function(e){n(this),o(e);var t=a(this),r=0;return i(t,function(t,s){if(e(t,r++))return s(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},53125(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,"",""]);const c=a},53206(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,".checkout-newsletter-subscription-description{font-size:85%;padding-top:3px}",""]);const c=a},53765(e,t,r){var s=r(81595);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("def44ba0",s,!0,{sourceMap:!1,shadowMode:!1})},54428(e,t,r){"use strict";r.d(t,{A:()=>g});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.enableVouchers&&!e.containsVoucher?t("div",{staticClass:"add-voucher-to-cart uk-margin-bottom uk-text-right uk-clearfix"},[e.voucherIsOpen?e._e():t("a",{staticClass:"uk-text-primary",on:{click:function(t){e.voucherIsOpen=!0}}},[t("span",{attrs:{"uk-icon":"icon: bolt"}}),e._v(" "+e._s(e.$t("voucher.voucher",["Do you have a voucher?"]))+" ")]),e.voucherIsOpen?t("div",{staticClass:"uk-width-large uk-align-right uk-margin-remove"},[t("div",{attrs:{"uk-grid":""}},[t("div",{staticClass:"uk-width-auto uk-flex uk-flex-middle"},[t("strong",[e._v(e._s(e.$t("voucher.enter-voucher",["Enter voucher"])))])]),t("div",{staticClass:"uk-width-expand"},[t("div",{staticClass:"uk-grid-collapse",attrs:{"uk-grid":""}},[t("div",{staticClass:"uk-width-expand"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.voucher,expression:"voucher"}],staticClass:"uk-input",attrs:{type:"text",required:""},domProps:{value:e.voucher},on:{keyup:function(t){return e.resetError()},input:function(t){t.target.composing||(e.voucher=t.target.value)}}})]),t("div",{staticClass:"uk-grid-auto"},[t("button",{staticClass:"uk-button uk-button-primary",attrs:{type:"button"},on:{click:function(t){return e.addVoucher()}}},[t("span",{attrs:{"uk-icon":"plus"}}),e._v(" "+e._s(e.$t("actions.add",["Add"])))])])])])]),e.voucherError?t("div",{staticClass:"uk-text-danger uk-padding uk-padding-remove-right"},[t("span",{attrs:{"uk-icon":"warning"}}),e._v(" "+e._s(e.voucherErrorMessage))]):e._e()]):e._e()]):e._e()},i=[],o=r(15215),n=r(71886),a=r(45420),c=r(78581);const l=new a.A;let d=class extends n.lD{constructor(){super(...arguments),this.voucherIsOpen=!1,this.voucher="",this.voucherError=!1,this.voucherErrorMessage=null,this.voucherAdded=null}get enableVouchers(){return window.CbxEnableVouchers}get cart(){return c.A.CART}get containsVoucher(){return this.cart?.fees?.find(e=>!0===e.isvoucher)?.isvoucher}async addVoucher(){const e=await l.validateVoucher(this.voucher);this.voucherError=!e.valid,e.valid?this.voucherAdded=await l.addVoucher(this.voucher):this.voucherErrorMessage=e.message}resetError(){this.voucherError=!1,this.voucherErrorMessage=null}reset(){this.voucherAdded=null,this.voucher=null,this.voucherIsOpen=!1,this.resetError()}onVoucherAdded(){null!==this.voucherAdded&&(c.A.GET_CART(),this.reset())}};(0,o.Cg)([(0,n.ox)("voucherAdded")],d.prototype,"onVoucherAdded",null),d=(0,o.Cg)([(0,n.uA)({name:"AddVoucherToCart",components:{}})],d);const u=d,p=u;var h=r(81656),f=(0,h.A)(p,s,i,!1,null,null,null);const g=f.exports},56687(e,t,r){var s=r(31809);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("6d2deb1a",s,!0,{sourceMap:!1,shadowMode:!1})},58508(e,t,r){"use strict";r.d(t,{A:()=>p});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ValidationProvider",{staticClass:"uk-focus-placeholder checkout-text-input",class:{"uk-margin":e.margin},attrs:{tag:"div",rules:e.rules},scopedSlots:e._u([{key:"default",fn:function({errors:r,classes:s}){return[t("input",{staticClass:"uk-input",class:s,attrs:{type:"text",id:e.label,placeholder:e.placeholder},domProps:{value:e.value},on:{input:function(t){return e.$emit("input",t.target.value)},change:function(t){return e.$emit("change",t.target.value)}}}),t("span",{staticClass:"uk-label uk-label-default uk-inline-block uk-position-top-right"},[e._v(e._s(e.label))]),r[0]?t("span",{staticClass:"errors uk-text-danger uk-text-small uk-text-meta"}
1,[e._v(e._s(r[0]))]):e._e()]}}])})},i=[],o=r(15215),n=r(71886);let a=class extends n.lD{get placeholder(){return this.label}};(0,o.Cg)([(0,n.kv)({required:!0,default:""})],a.prototype,"value",void 0),(0,o.Cg)([(0,n.kv)({type:String,required:!1,default:""})],a.prototype,"id",void 0),(0,o.Cg)([(0,n.kv)({type:String,required:!0,default:""})],a.prototype,"label",void 0),(0,o.Cg)([(0,n.kv)({required:!1,default:""})],a.prototype,"rules",void 0),(0,o.Cg)([(0,n.kv)({type:Boolean,required:!1,default:!0})],a.prototype,"margin",void 0),a=(0,o.Cg)([(0,n.uA)({name:"checkoutTextInput"})],a);const c=a,l=c;r(47803);var d=r(81656),u=(0,d.A)(l,s,i,!1,null,null,null);const p=u.exports},60080(e,t,r){var s=r(36202);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("0a2d5dc0",s,!0,{sourceMap:!1,shadowMode:!1})},60564(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>_t});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.translationsReady?t("div",{staticClass:"checkout-section",attrs:{translate:"no"}},[e.hasCartItems?t("div",{staticClass:"uk-container uk-container-large uk-margin-large-bottom"},[t("ValidationObserver",{scopedSlots:e._u([{key:"default",fn:function({validate:e}){return[t("div",{staticClass:"uk-grid-divider",attrs:{"uk-grid":""}},[t("checkout-address"),t("div",{staticClass:"uk-width-2-3@s"},[t("div",{staticClass:"uk-grid-divider",attrs:{"uk-grid":""}},[t("checkout-delivery"),t("checkout-payment"),t("checkout-cart-preview")],1),t("checkout-actions",{attrs:{validate:e}})],1)],1)]}}],null,!1,2017957928)})],1):t("div",[e._v(" "+e._s(e.$t("cart.is-empty",["Cart is empty"]))+" ")])]):e._e()},i=[],o=r(15215),n=r(71886),a=(r(51339),function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"checkout-address uk-width-1-3@s"},[t("h3",{staticClass:"uk-margin-remove-top"},[t("span",{staticClass:"progress-step",class:{invalid:!e.addressIsValid}},[e._v("1")]),t("strong",[e._v(e._s(e.$t("checkout.address-information",["Address information"])))])]),t("div",[t("fieldset",{staticClass:"uk-fieldset"},[t("CheckoutTextInput",{attrs:{label:e.$t("checkout.name",["Name"]),rules:"required"},on:{change:function(t){return e.persist()}},model:{value:e.address.name,callback:function(t){e.$set(e.address,"name",t)},expression:"address.name"}}),t("CheckoutAddressInputSuggest",{attrs:{label:e.$t("checkout.address",["Address"]),rules:"required"},on:{change:function(t){return e.persist()}},model:{value:e.address.address,callback:function(t){e.$set(e.address,"address",t)},expression:"address.address"}}),t("CheckoutTextInput",{attrs:{label:e.$t("checkout.address2",["Address 2"])},on:{change:function(t){return e.persist()}},model:{value:e.address.alternativeaddress,callback:function(t){e.$set(e.address,"alternativeaddress",t)},expression:"address.alternativeaddress"}}),t("div",{staticClass:"uk-grid-small uk-margin",attrs:{"uk-grid":""}},[t("CheckoutTextInput",{staticClass:"uk-width-1-3",attrs:{label:e.$t("checkout.zipcode",["Zip code"]),rules:"required",margin:!1},on:{change:function(t){return e.persist()}},model:{value:e.address.zipcode,callback:function(t){e.$set(e.address,"zipcode",t)},expression:"address.zipcode"}}),t("CheckoutTextInput",{staticClass:"uk-width-2-3",attrs:{label:e.$t("checkout.city",["City"]),rules:"required",margin:!1},on:{change:function(t){return e.persist()}},model:{value:e.address.city,callback:function(t){e.$set(e.address,"city",t)},expression:"address.city"}})],1),t("div",{staticClass:"uk-margin-medium"},[t("ValidationProvider",{staticClass:"uk-focus-placeholder",attrs:{tag:"div",rules:"required"},scopedSlots:e._u([{key:"default",fn:function({errors:r,classes:s}){return[t("select",{directives:[{name:"model",rawName:"v-model",value:e.address.country,expression:"address.country"}],staticClass:"uk-select",class:s,attrs:{id:`${e.$t("checkout.country",["Country"])}`},on:{change:[function(t){var r=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){var t="_value"in e?e._value:e.value;return t});e.$set(e.address,"country",t.target.multiple?r:r[0])},function(t){return e.persist()}]}},[t("option",{domProps:{value:null}},[e._v(e._s(e.$t("checkout.choose-country",["Choose country"])))]),e._l(e.countries,function(r){return t("option",{key:r.code,domProps:{value:r.code}},[e._v(e._s(r.label))])})],2),t("span",{staticClass:"uk-label uk-label-default uk-inline-block uk-position-top-right"},[e._v(e._s(e.$t("checkout.country",["Country"])))]),r[0]?t("span",{staticClass:"errors uk-text-danger uk-text-small uk-text-meta"}
1,[e._v(e._s(r[0]))]):e._e()]}}])})],1)],1),t("hr",{staticClass:"uk-margin-remove-top"}),t("fieldset",{staticClass:"uk-fieldset"},[t("CheckoutTextInput",{attrs:{label:e.$t("checkout.phone",["Phone"]),rules:"required"},on:{change:function(t){return e.persist()}},model:{value:e.address.phone,callback:function(t){e.$set(e.address,"phone",t)},expression:"address.phone"}}),t("CheckoutTextInput",{attrs:{label:e.$t("checkout.email",["E-mail"]),rules:"required|email"},on:{change:function(t){return e.persist()}},model:{value:e.address.email,callback:function(t){e.$set(e.address,"email",t)},expression:"address.email"}}),t("CheckoutNewsletterSubscription")],1),e.isPickupDelivery?e._e():t("hr",{staticClass:"uk-margin-remove-top"}),e.isPickupDelivery?e._e():t("fieldset",{staticClass:"uk-fieldset"},[t("div",{staticClass:"uk-margin"},[t("label",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.address.invoicedetailsisdelivery,expression:"address.invoicedetailsisdelivery"}],staticClass:"uk-checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.address.invoicedetailsisdelivery)?e._i(e.address.invoicedetailsisdelivery,null)>-1:e.address.invoicedetailsisdelivery},on:{change:[function(t){var r=e.address.invoicedetailsisdelivery,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=null,n=e._i(r,o);s.checked?n<0&&e.$set(e.address,"invoicedetailsisdelivery",r.concat([o])):n>-1&&e.$set(e.address,"invoicedetailsisdelivery",r.slice(0,n).concat(r.slice(n+1)))}else e.$set(e.address,"invoicedetailsisdelivery",i)},function(t){return e.persist()}]}}),e._v(" "+e._s(e.$t("checkout.invoice-delivery",["Delivery to invoice address"]))+" ")])]),e.address.invoicedetailsisdelivery?e._e():t("div",{attrs:{id:"alt-delivery"}},[t("CheckoutDeliveryAddressSelect"),t("CheckoutTextInput",{attrs:{label:e.$t("checkout.name",["Name"]),rules:"required"},on:{change:function(t){return e.persist()}},model:{value:e.address.deliveryname,callback:function(t){e.$set(e.address,"deliveryname",t)},expression:"address.deliveryname"}}),t("CheckoutAddressInputSuggest",{attrs:{label:e.$t("checkout.address",["Address"]),rules:"required","address-is-delivery":!0},on:{change:function(t){return e.persist()}},model:{value:e.address.deliveryaddress,callback:function(t){e.$set(e.address,"deliveryaddress",t)},expression:"address.deliveryaddress"}}),t("CheckoutTextInput",{attrs:{label:e.$t("checkout.address2",["Address 2"])},on:{change:function(t){return e.persist()}},model:{value:e.address.deliveryalternativeaddress,callback:function(t){e.$set(e.address,"deliveryalternativeaddress",t)},expression:"address.deliveryalternativeaddress"}}),t("div",{staticClass:"uk-grid-small uk-margin",attrs:{"uk-grid":""}},[t("CheckoutTextInput",{staticClass:"uk-width-1-3",attrs:{label:e.$t("checkout.zipcode",["Zip code"]),rules:"required",margin:!1},on:{change:function(t){return e.persist()}},model:{value:e.address.deliveryzipcode,callback:function(t){e.$set(e.address,"deliveryzipcode",t)},expression:"address.deliveryzipcode"}}),t("CheckoutTextInput",{staticClass:"uk-width-2-3",attrs:{label:e.$t("checkout.city",["City"]),rules:"required",margin:!1},on:{change:function(t){return e.persist()}},model:{value:e.address.deliverycity,callback:function(t){e.$set(e.address,"deliverycity",t)},expression:"address.deliverycity"}})],1),t("div",{staticClass:"uk-margin-medium"},[t("ValidationProvider",{staticClass:"uk-focus-placeholder",attrs:{tag:"div",rules:"required"},scopedSlots:e._u([{key:"default",fn:function({errors:r,classes:s}){return[t("select",{directives:[{name:"model",rawName:"v-model",value:e.address.deliverycountry,expression:"address.deliverycountry"}],staticClass:"uk-select",class:s,attrs:{id:`${e.$t("checkout.country",["Country"])}`},on:{change:[function(t){var r=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){var t="_value"in e?e._value:e.value;return t});e.$set(e.address,"deliverycountry",t.target.multiple?r:r[0])},function(t){return e.persist()}]}},[t("option",{domProps:{value:null}},[e._v(e._s(e.$t("checkout.choose-country",["Choose country"])))]),e._l(e.countries,function(r){return t("option",{key:r.code,domProps:{value:r.code}},[e._v(e._s(r.label))])})],2),t("span",{staticClass:"uk-label uk-label-default uk-inline-block uk-position-top-right"},[e._v(e._s(e.$t("checkout.country",["Country"])))]),r[0]?t("span",{staticClass:"errors uk-text-danger uk-text-small uk-text-meta"}
1,[e._v(e._s(r[0]))]):e._e()]}}],null,!1,2679372565)})],1)],1)]),t("hr",{staticClass:"uk-margin-remove-top"}),t("fieldset",{staticClass:"uk-fieldset"},[t("div",{staticClass:"uk-focus-placeholder checkout-text-input uk-margin"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.address.comment,expression:"address.comment"}],staticClass:"uk-textarea",attrs:{rows:"4",placeholder:e.$t("checkout.comment",["Comment"])},domProps:{value:e.address.comment},on:{change:function(t){return e.persist()},input:function(t){t.target.composing||e.$set(e.address,"comment",t.target.value)}}}),t("span",{staticClass:"uk-label uk-label-default uk-inline-block uk-position-top-right"},[e._v(e._s(e.$t("checkout.comment",["Comment"])))])])]),t("hr",{staticClass:"uk-margin-remove-top"})])])}),c=[],l=r(63749),d=r(58508),u=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ValidationProvider",{directives:[{name:"on-clickaway",rawName:"v-on-clickaway",value:e.handleClickAway,expression:"handleClickAway"}],staticClass:"uk-focus-placeholder checkout-text-input",class:{"uk-margin":e.margin},attrs:{tag:"div",rules:e.rules},scopedSlots:e._u([{key:"default",fn:function({errors:r,classes:s}){return[t("input",{ref:"addressInput",staticClass:"uk-input",class:s,attrs:{type:"text",id:e.label,placeholder:e.placeholder,autocomplete:e.autocomplete},domProps:{value:e.value},on:{keyup:function(t){return e.suggest()},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),t.stopPropagation(),e.setFocus(e.suggestions.length-1))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),e.setFocus(0))}],input:function(t){return e.$emit("input",t.target.value)},change:function(t){return e.$emit("change",t.target.value)}}}),t("span",{staticClass:"uk-label uk-label-default uk-inline-block uk-position-top-right"},[e._v(e._s(e.label))]),r[0]?t("span",{staticClass:"errors uk-text-danger uk-text-small uk-text-meta"},[e._v(e._s(r[0]))]):e._e(),e.suggestions.length?t("div",{staticClass:"address-suggestions",on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.setFocus(-1)}}},e._l(e.suggestions,function(r,s){return t("a",{key:s,ref:`address-suggestion-${s}`,refInFor:!0,staticClass:"address-suggestions-item",attrs:{tabindex:"1234"},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),t.stopPropagation(),e.setFocus(s-1))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),e.setFocus(s+1))}],keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.useSuggestion(r)},click:function(t){return e.useSuggestion(r)}}},[e._v(e._s(r.suggestion))])}),0):e._e()]}}])})},p=[],h=r(53917),f=r(94335);class g{async suggestAddress(e,t){if(""==e||""==t)return[];try{const r=await f.A.get(`/api/thirdparty/${e}/address?query=${t}`);return r.data}catch(Xe){return console.log(Xe),[]}}}var v=r(99499);const m=new g;let y=class extends n.lD{constructor(){super(...arguments),this.suggestions=[]}get placeholder(){return this.label}get countries(){return l.A.COUNTRIES}get address(){return l.A.ADDRESS}get service(){return this.countries?.find(e=>e.code===(this.addressIsDelivery?this.address.deliverycountry:this.address.country))?.service}get autocomplete(){return this.service?"disabled":"on"}setFocus(e){if(this.suggestions?.length){let t;t=e<0||e>this.suggestions.length-1?this.$refs.addressInput:this.$refs[`address-suggestion-${e}`][0],this.$nextTick(()=>t.focus())}}useSuggestion(e){this.addressIsDelivery?e.address1.trim().length>0?(this.address.deliveryaddress=e.address1,e.zip.trim().length>0&&(this.address.deliveryzipcode=e.zip),e.city.trim().length>0&&(this.address.deliverycity=e.city)):this.address.deliveryaddress=e.suggestion:e.address1.trim().length>0?(this.address.address=e.address1,e.zip.trim().length>0&&(this.address.zipcode=e.zip),e.city.trim().length>0&&(this.address.city=e.city)):this.address.address=e.suggestion,l.A.UPDATE_ADDRESS(this.address),this.suggestions=[],this.$refs.addressInput.focus()}async suggest(){const e=this.service;null!=e&&this.value?.length>=3?this.suggestions=await m.suggestAddress(e,this.value):this.suggestions=[]}handleClickAway(e){this.$el.contains(e.relatedTarget)||(this.suggestions=[])}};(0,o.Cg)([(0,n.kv)({required:!0})],y.prototype,"value",void 0),(0,o.Cg)([(0,n.kv)({type:String,required:!1,default:""})],y.prototype,"id",void 0),(0,o.Cg)([(0,n.kv)({type:String,required:!0,default:""})],y.prototype,"label",void 0),(0,o.Cg)([(0,n.kv)({required:!1,default:""})],y.prototype,"rules",void 0),(0,o.Cg)([(0,n.kv)({type:Boolean,required:!1,default:!0})],y.prototype,"margin",void 0),(0,o.Cg)([(0,n.kv)({type:Boolean,required:!1,default:!1})],y.prototype,"addressIsDelivery",void 0),(0,o.Cg)([(0,h.S)(250)],y.prototype,"suggest",null),y=(0,o.Cg)([(0,n.uA)({name:"checkoutTextInput",mixins:[v.co]})],y);const w=y,k=w;r(71928);var _=r(81656),b=(0,_.A)(k,u,p,!1,null,null,null);const A=b.exports;var C=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.deliveryAddresses.length>1?t("div",{directives:[{name:"on-clickaway",rawName:"v-on-clickaway",value:e.handleClickAway,expression:"handleClickAway"}],staticClass:"uk-focus-placeholder checkout-text-input",class:{"uk-margin":e.margin}},[t("span",{staticClass:"uk-form-icon uk-form-icon-flip",attrs:{"uk-icon":"icon: search"}}),t("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],ref:"addressInput",staticClass:"uk-input",attrs:{type:"text",id:"delivery-addresses",placeholder:e.$t("checkout.choose-address",["Choose address"]),autocomplete:"disabled"},domProps:{value:e.value},on:{keyup:function(t){return e.search()},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),e.setFocus(0))},focus:function(t){return e.search()},input:[function(t){t.target.composing||(e.value=t.target.value)},function(t){return e.$emit("input",t.target.value)}],change:function(t){return e.$emit("change",t.target.value)}}}),t("span",{staticClass:"uk-label uk-label-default uk-inline-block uk-position-top-right"},[e._v(e._s(e.$t("checkout.saved-addresses",["Saved addresses"]))
1)]),e.showList&&e.addresses.length?t("div",{staticClass:"delivery-addresses",on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.setFocus(-1)}}},e._l(e.addresses,function(r,s){return t("a",{key:s,ref:`delivery-address-${s}`,refInFor:!0,staticClass:"delivery-addresses-item",attrs:{tabindex:"1234"},domProps:{innerHTML:e._s(e.getFullHtmlAddress(r))},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),t.stopPropagation(),e.setFocus(s-1))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),e.setFocus(s+1))}],keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.useSelection(r)},click:function(t){return e.useSelection(r)}}})}),0):e._e()]):e._e()},E=[];r(83725),r(52598),r(35019);let S=class extends n.lD{constructor(){super(...arguments),this.addresses=[],this.showList=!1,this.value=""}get deliveryAddresses(){return this.countries?l.A.ADDRESSES?.filter(e=>this.countries.find(t=>t.code==e.country))??[]:[]}get countries(){return l.A.COUNTRIES}get address(){return l.A.ADDRESS}getFullAddress(e){let t=e.name+" - "+e.address;return e.alternativeaddress&&e.alternativeaddress.length>0&&(t+=", "+e.alternativeaddress),t+=", "+e.zipcode+" "+e.city+", "+this.countries.find(t=>t.code==e.country).label,t}getFullHtmlAddress(e){let t="<strong>"+e.name+"</strong><br /><small>"+e.address;return e.alternativeaddress&&e.alternativeaddress.length>0&&(t+=", "+e.alternativeaddress),t+=", "+e.zipcode+" "+e.city+", "+this.countries.find(t=>t.code==e.country).label,t+="</small>",t}setFocus(e){if(this.addresses?.length){let t;t=e<0||e>this.addresses.length-1?this.$refs.addressInput:this.$refs[`delivery-address-${e}`][0],this.$nextTick(()=>t.focus())}}useSelection(e){this.address.deliveryname=e.name,this.address.deliveryaddress=e.address,this.address.deliveryalternativeaddress=e.alternativeaddress,this.address.deliveryzipcode=e.zipcode,this.address.deliverycity=e.city,this.address.deliverycountry=e.country,this.value=this.getFullAddress(e),l.A.UPDATE_ADDRESS(this.address),this.reset()}reset(){this.showList=!1,this.addresses=[],this.value=""}async search(){this.value?.length?this.addresses=this.deliveryAddresses.filter(e=>this.getFullAddress(e).toLowerCase().includes(this.value.toLowerCase())):this.addresses=this.deliveryAddresses,this.showList=!0}handleClickAway(e){this.$el.contains(e.relatedTarget)||this.reset()}};(0,o.Cg)([(0,n.kv)({type:Boolean,required:!1,default:!0})],S.prototype,"margin",void 0),(0,o.Cg)([(0,h.S)(250)],S.prototype,"search",null),S=(0,o.Cg)([(0,n.uA)({name:"CheckoutDeliveryAddressSelect",mixins:[v.co]})],S);const T=S,x=T;r(9754);var I=(0,_.A)(x,C,E,!1,null,null,null);const P=I.exports;var R=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.enabled?t("div",{staticClass:"checkout-newsletter-subscription"},[t("label",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.subscribed,expression:"subscribed"}],staticClass:"uk-checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.subscribed)?e._i(e.subscribed,null)>-1:e.subscribed},on:{change:function(t){var r=e.subscribed,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=null,n=e._i(r,o);s.checked?n<0&&(e.subscribed=r.concat([o])):n>-1&&(e.subscribed=r.slice(0,n).concat(r.slice(n+1)))}else e.subscribed=i}}}),e._v(" "+e._s(e.$t("checkout.subscribe-newsletter",["Subscribe to our newsletter"]))+" ")]),t("div",{staticClass:"checkout-newsletter-subscription-description uk-margin-bottom"},[e._v(" "+e._s(e.$t("checkout.subscribe-description",["Receive the best offers or news from us."]))+" ")])]):e._e()},D=[];let M=class extends n.lD{get enabled(){return l.A.SHOW_NEWSLETTER_SUBSCRIPTION}get subscribed(){return l.A.SUBSCRIBED_TO_NEWSLETTER}set subscribed(e){l.A.UPDATE_SUBSCRIBED_TO_NEWSLETTER(e)}async created(){await l.A.GET_SHOW_NEWSLETTER_SUBSCRIPTION(),this.enabled&&await l.A.GET_SUBSCRIBED_TO_NEWSLETTER()}};M=(0,o.Cg)([(0,n.uA)({name:"checkoutNewsletterSubscription",components:{}})],M);const O=M,$=O;r(46812);var L=(0,_.A)($,R,D,!1,null,null,null);const N=L.exports;let U=class extends n.lD{constructor(){super(...arguments),this.deliveryAddress=null}get address(){return l.A.ADDRESS}get countries(){return l.A.COUNTRIES}get addressIsValid(){return l.A.ADDRESS_IS_VALID}get isPickupDelivery(){return l.A.DELIVERY?.ispickup??!1}async persist(){l.A.UPDATE_ADDRESS(this.address)}async created(){await l.A.GET_ADDRESS(),await l.A.GET_ADDRESSES(),await l.A.GET_COUNTRIES()}};(0,o.Cg)([(0,h.S)(250)],U.prototype,"persist",null),U=(0,o.Cg)([(0,n.uA)({name:"checkoutAddress",components:{CheckoutTextInput:d.A,CheckoutAddressInputSuggest:A,CheckoutDeliveryAddressSelect:P,CheckoutNewsletterSubscription:N}})],U);const V=U,B=V;r(4319);var K=(0,_.A)(B,a,c,!1,null,null,null);const H=K.exports;var z=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"checkout-delivery uk-width-1-2@s"},[t("h3",[t("span",{staticClass:"progress-step",class:{invalid:!e.deliveryIsValid}},[e._v("2")]),t("strong",[e._v(e._s(e.$t("checkout.delivery",["Delivery"])))])]),t("fieldset",{staticClass:"uk-fieldset uk-margin-bottom"},e._l(e.deliveryTypes,function(r){return t("div",{key:r.id,staticClass:"uk-input checkout-option",class:{active:e.isActive(r)}},[t("label",[t("div",{staticClass:"primary-info"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.delivery.deliverytype,expression:"delivery.deliverytype"}],staticClass:"uk-radio",attrs:{type:"radio",name:"delivery"}
1,domProps:{value:r.id,checked:e._q(e.delivery.deliverytype,r.id)},on:{change:[function(t){return e.$set(e.delivery,"deliverytype",r.id)},function(t){return e.handleDeliveryChange(r)}]}}),t("span",{staticClass:"title"},[e._v(e._s(e.itemTitle(r)))]),r.icon?t("img",{staticClass:"checkout-icon",attrs:{src:r.icon}}):e._e()])]),e.showSecondaryInfo(r)?t("div",{staticClass:"secondary-info"},[r.description?t("div",{staticClass:"description"},[e._v(" "+e._s(r.description)+" ")]):e._e(),e.isPackageShop(r)&&e.isActive(r)?t("div",{staticClass:"package-shop-info"},[t("ValidationProvider",{attrs:{tag:"div",rules:"required"},scopedSlots:e._u([{key:"default",fn:function({errors:s,classes:i}){return[t("div",{staticClass:"validation",class:i},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.selectedShop,expression:"selectedShop"}],class:i,attrs:{id:e.$t("checkout.pickup-location",["Pickup location"]),type:"hidden"},domProps:{value:e.selectedShop},on:{input:function(t){t.target.composing||(e.selectedShop=t.target.value)}}}),s[0]?t("span",{staticClass:"errors uk-text-danger uk-text-small uk-text-meta"},[e._v(e._s(s[0]))]):e._e(),e.selectedShop?t("PackageShopItem",{attrs:{shop:e.selectedShop,showSecondaryInfo:!0}}):t("div",[e._v(e._s(e.$t("checkout.select-pickup-location",["Select pickup location"])))]),t("button",{staticClass:"uk-button uk-button-default uk-button-small uk-margin-top",on:{click:e.openShopModal}},[e._v(e._s(e.$t("checkout.select-pickup-location",["Select pickup location"])))]),e.shopModalIsopen?t("PackageShop",{attrs:{serviceEndpoint:e.serviceEndpoint(r),streetEnabled:e.streetEnabled(r)},on:{close:e.closeShopModal,update:e.updateSelectedPackageShop}}):e._e()],1)]}}],null,!0)})],1):e._e(),r.displaypriceinfo?t("div",{staticClass:"pricing"},[t("span",{staticClass:"uk-text-bold",class:{"uk-text-strike uk-text-muted":r.freefeelimitappliestodelivery}},[t("PriceOutput",{attrs:{model:r.displaypriceinfo}})],1),r.freefeelimitappliestodelivery?t("span",{staticClass:"uk-text-bold"},[e._v(" "+e._s(e.$t("checkout.free-delivery",["Free"])))]):e._e()]):e._e()]):e._e()])}),0),e.enablePreferredDeliveryDate?t("hr"):e._e(),e.enablePreferredDeliveryDate?t("CheckoutDeliveryDate"):e._e()],1)},F=[],W=r(78581),j=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"uk-modal package-shop-modal uk-open uk-flex",class:{"has-map":e.useMap},on:{click:e.close}},[t("div",{staticClass:"uk-modal-dialog uk-margin-auto-vertical cbx-border uk-modal-body",on:{click:function(e){e.stopPropagation()}}},[t("h2",{staticClass:"uk-modal-title uk-flex"},[t("span",{staticClass:"uk-flex-1"},[e._v(e._s(e.$t("checkout.select-pickup-location",["Select pickup location"])))]),t("button",{staticClass:"uk-button uk-button-link uk-button-small",on:{click:e.close}},[t("span",{attrs:{"uk-icon":"close"}})])]),t("div",{staticClass:"package-shop"},[t("div",{staticClass:"package-shop-search uk-flex"},[e.streetEnabled?t("input",{directives:[{name:"model",rawName:"v-model",value:e.endpointArgs.street,expression:"endpointArgs.street"}],staticClass:"uk-input",attrs:{type:"text",placeholder:e.$t("checkout.enter-address-optional",["Enter address (optional)"])},domProps:{value:e.endpointArgs.street},on:{keyup:e.getShops,input:function(t){t.target.composing||e.$set(e.endpointArgs,"street",t.target.value)}}}):e._e(),t("input",{directives:[{name:"model",rawName:"v-model",value:e.endpointArgs.zipcode,expression:"endpointArgs.zipcode"}],staticClass:"uk-input",attrs:{type:"text",placeholder:e.$t("checkout.enter-zipcode",["Enter zipcode"])},domProps:{value:e.endpointArgs.zipcode},on:{keyup:e.getShops,input:function(t){t.target.composing||e.$set(e.endpointArgs,"zipcode",t.target.value)}}})]),e.shops.length?t("div",{staticClass:"package-shop-results"},[t("div",{staticClass:"shop-list"},e._l(e.shops,function(r){return t("PackageShopItem",{key:r.shopid,ref:`ref_${r.shopid}`,refInFor:!0,class:{selected:e.selectedShop===r},attrs:{shop:r,showSecondaryInfo:e.selectedShop===r},on:{click:function(t){return e.selectShop(r)}}})}),1),e.useMap?t("div",{staticClass:"shop-map"},[t("GmapMap",{ref:"mapRef",staticStyle:{width:"100%",height:"100%"},attrs:{"map-type-id":"roadmap",center:e.mapCenter,zoom:17,options:{zoomControl:!1,mapTypeControl:!1,scaleControl:!1,streetViewControl:!1,rotateControl:!1,fullscreenControl:!1,disableDefaultUi:!0,styles:e.gmapsStyleLight},"resize-bus":null}},[t("GmapCluster",{attrs:{styles:e.gmapsClusterStyles,maxZoom:15}},e._l(e.computedShops,function(r,s){return t("GmapMarker",{key:s,attrs:{position:r.position,icon:e.markerIcon(e.selectedShop===r),clickable:!0,draggable:!1},on:{click:function(t){return e.handleMarkerClick(r)}
1}})}),1)],1)],1):e._e()]):e._e()]),t("p",{staticClass:"uk-text-right"},[t("button",{staticClass:"uk-button uk-button-default uk-modal-close",attrs:{type:"button"},on:{click:e.close}},[e._v(" "+e._s(e.$t("actions.cancel",["Cancel"]))+" ")]),t("button",{staticClass:"uk-button uk-button-primary",attrs:{type:"button"},on:{click:e.confirmShopChoice}},[e._v(" "+e._s(e.$t("actions.save",["Save"]))+" ")])])])])},J=[],q=r(2489);class G{constructor(e={}){this.endpoint="",e.endpoint&&(this.endpoint=e.endpoint)}async getShops(e){try{const{zipcode:t,street:r}=e;if(!t?.length)return[];const s=this.endpoint.replace("###ZIPCODE###",t).replace("###STREET###",r??"").replace("###ID###",""),i=await f.A.get(s);return i.data}catch(Xe){return console.log(Xe),[]}}async getShop(e){try{const{id:t}=e;if(!t?.length)return null;const r=this.endpoint.replace("###ID###",t??"").replace("###ZIPCODE###","").replace("###STREET###",""),s=await f.A.get(r);return s.data[0]}catch(Xe){return console.log(Xe),null}}getShopExtraFieldKeys(){return["packageshop-shopid","packageshop-name","packageshop-address1","packageshop-address2","packageshop-zipcode","packageshop-city","packageshop-country"]}}var Y=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"package-shop-item"},[t("div",{staticClass:"primary-shop-info",on:{click:function(t){return e.$emit("click")}}},[t("div",{staticClass:"shop-name",attrs:{title:e.shop.shopname}},[e._v(e._s(e.shop.shopname))])]),e.showSecondaryInfo?t("div",{staticClass:"secondary-shop-info"},[t("div",{staticClass:"shop-address"},[t("div",[e._v(e._s(e.shop.address1))]),t("div",[e._v(e._s(e.shop.address2))]),t("div",[e._v(e._s(e.shop.zip)+" "+e._s(e.shop.city))])]),t("div",{staticClass:"shop-hours"})]):e._e()])},Z=[];let Q=class extends n.lD{};(0,o.Cg)([(0,n.kv)({type:Object,required:!0,default:null})],Q.prototype,"shop",void 0),(0,o.Cg)([(0,n.kv)({type:Boolean,required:!1,default:!1})],Q.prototype,"showSecondaryInfo",void 0),Q=(0,o.Cg)([(0,n.uA)({name:"packageShopItem"})],Q);const X=Q,ee=X;var te=(0,_.A)(ee,Y,Z,!1,null,null,null);const re=te.exports;r(99078);const se=[{featureType:"water",elementType:"geometry",stylers:[{color:"#e9e9e9"},{lightness:17}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:20}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffffff"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#ffffff"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#ffffff"},{lightness:16}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#f5f5f5"},{lightness:21}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#dedede"},{lightness:21}]},{elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#ffffff"},{lightness:16}]},{elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#333333"},{lightness:40}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#f2f2f2"},{lightness:19}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#fefefe"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#fefefe"},{lightness:17},{weight:1.2}]}],ie=()=>getComputedStyle(document.documentElement).getPropertyValue("--primary-color"),oe='\n <svg width="24" height="30" viewBox="0 0 24 30" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.9551 0C5.39326 0 0 5.37313 0 11.9104C0 21.8507 11.9551 30 11.9551 30C11.9551 30 24 21.2239 24 11.9104C23.9101 5.37313 18.5169 0 11.9551 0Z" fill="__MARKERCOLOR__"/>\n <path d="M12.1642 29.2112C12.0822 29.2754 12.0093 29.3319 11.9461 29.3805C11.8856 29.3367 11.8164 29.286 11.7391 29.2287C11.418 28.9908 10.9575 28.6386 10.4042 28.1848C9.29674 27.2764 7.82116 25.9637 6.3471 24.3461C3.38262 21.0929 0.5 16.6893 0.5 11.9104C0.5 5.65104 5.66764 0.5 11.9551 0.5C18.24 0.5 23.412 5.64927 23.5 11.9139C23.4985 16.3734 20.6004 20.7737 17.6053 24.114C16.118 25.7726 14.6291 27.1454 13.5116 28.1036C12.9532 28.5825 12.4884 28.957 12.1642 29.2112Z" stroke="__OUTLINECOLOR__" stroke-opacity="1"/>\n </svg>\n',ne='\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">\n <circle cx="26" cy="26" r="26" fill="__CLUSTERCOLOR__" fill-opacity="0.75" />\n </svg>
1\n',ae=(e="",t="")=>{if(e.length)t.length||(t="#aaa");else{const r=ie();e=r,t=r}return"data:image/svg+xml;charset=UTF-8;base64,"+btoa(oe.replace("__MARKERCOLOR__",e).replace("__OUTLINECOLOR__",t))},ce=(e="")=>{if(!e.length){const t=ie();e=t}return"data:image/svg+xml;charset=UTF-8;base64,"+btoa(ne.replace("__CLUSTERCOLOR__",e))},le=()=>[50,60,70,80,90].map(function(e){return{width:e,height:e,url:ce(),textColor:"white",textSize:12}});let de=class extends n.lD{constructor(){super(...arguments),this.svc=null,this.gmapsStyleLight=se,this.gmapsClusterStyles=le(),this.shops=[],this.endpointArgs={zipcode:this.address.zipcode,street:this.address.address},this.selectedShop=null}get address(){return l.A.ADDRESS}get delivery(){return l.A.DELIVERY}get selectedShopId(){return this.delivery?.extrafields?.["packageshop-shopid"]??""}get computedShops(){return this.shops.map(e=>{const t=e;return t.position={lat:e.latitude,lng:e.longitude},t})}get mapCenter(){return{lat:this.selectedShop.latitude,lng:this.selectedShop.longitude}}get gApi(){return(0,q.gmapApi)()}get useMap(){return window.CbxGmapsAPIKey?.length&&"mobile"!==this.$screen.breakpoint}markerIcon(e){return{url:e?ae():ae("#ddd"),scaledSize:this.gApi?new this.gApi.maps.Size(24,30):null}}async created(){this.svc=new G({endpoint:this.serviceEndpoint}),this.selectedShopId.length&&(this.endpointArgs.zipcode=this.delivery?.extrafields?.["packageshop-zipcode"]??this.address.zipcode,this.endpointArgs.street=this.delivery?.extrafields?.["packageshop-address1"]??this.address.address),await this.get
1Shops()}async getShops(){null!=this.endpointArgs.zipcode&&this.endpointArgs.zipcode.length>=4&&(this.shops=await this.svc.getShops(this.endpointArgs),this.selectedShop=this.shops.find(e=>e.shopid===this.selectedShopId)??this.shops?.[0],this.scrollListItemIntoView(this.selectedShop))}selectShop(e){this.selectedShop=e}async confirmShopChoice(){await l.A.UPDATE_PACKAGE_SHOP(this.selectedShop),await l.A.UPDATE_DELIVERY(this.delivery),this.$emit("update",this.selectedShop),this.close()}handleMarkerClick(e){this.selectShop(e),this.scrollListItemIntoView(e)}scrollListItemIntoView(e){this.$nextTick(()=>{try{const t=this.$refs[`ref_${e.shopid}`];t[0].$el?.scrollIntoView()}catch(Xe){console.log("failed to scroll item into view")}})}close(){this.$emit("close")}};(0,o.Cg)([(0,n.kv)({type:String,required:!0,default:""})],de.prototype,"serviceEndpoint",void 0),(0,o.Cg)([(0,n.kv)({type:Boolean,required:!1,default:!1})],de.prototype,"streetEnabled",void 0),de=(0,o.Cg)([(0,n.uA)({name:"packageShop",components:{PackageShopItem:re}})],de);const ue=de,pe=ue;r(8229);var he=(0,_.A)(pe,j,J,!1,null,null,null);const fe=he.exports;let ge=class extends n.lD{constructor(){super(...arguments),this.initialized=!1,this.svc=null,this.selectedShop=null,this.shopModalIsopen=!1}get delivery(){return l.A.DELIVERY??{deliverytype:null,ispackageshop:!1,ispickup:!1,extrafields:null}}get deliveryType(){return this.delivery?.deliverytype??""}get deliveryTypes(){return l.A.DELIVERY_TYPES}get selectedDeliveryType(){return l.A.DELIVERY_TYPES?.find(e=>e.id===this.deliveryType)}get deliveryIsValid(){return l.A.DELIVERY_IS_VALID}get selectedShopId(){return this.delivery?.extrafields?.["packageshop-shopid"]??""}get address(){return l.A.ADDRESS}get packageShopInfo(){const e=["packageshop-name","packageshop-address1","packageshop-address2","packageshop-zipcode","packageshop-city","packageshop-country"];return e.map(e=>this.delivery?.extrafields?.[e]??"").filter(e=>e.length).join(", ")}get enablePreferredDeliveryDate(){return window.CbxEnablePreferredDeliveryDate}showSecondaryInfo(e){return e?.description?.length>0||(e?.displaypriceinfo?.priceincvat?.length>0||!(!this.isPackageShop(e)||!this.isActive(e)))}itemTitle(e){return e.title?.length?e.title:e.id}serviceEndpoint(e){return e.extrafields?.serviceendpoint??""}streetEnabled(e){return"1"===e.extrafields?.providerstreetenabled??!1}isPackageShop(e){return!0===e?.ispackageshop&&this.serviceEndpoint(e).length>0}isActive(e){return e.id===this.deliveryType}async created(){await this.ensureDeliveryTypes(),this.initialized=!0}async ensureDeliveryTypes(){await Promise.all([l.A.GET_DELIVERY_TYPES(),l.A.GET_DELIVERY()]),await this.ensurePackageShopData(this.selectedDeliveryType)}async ensurePackageShopData(e){let t=null;if(e.ispackageshop&&(this.svc=new G({endpoint:this.serviceEndpoint(e)}),this.selectedShopId.length&&(t=await this.svc.getShop({id:this.selectedShopId})),!t)){const e=await this.svc.getShops({zipcode:this.address.zipcode,street:this.address.address});t=e?.[0]}this.selectedShop=t,await l.A.UPDATE_PACKAGE_SHOP(this.selectedShop),await l.A.UPDATE_DELIVERY(this.delivery)}async handleDeliveryChange(e){this.delivery.ispackageshop=e.ispackageshop,this.delivery.ispickup=e.ispickup,await this.ensurePackageShopData(e),W.A.GET_CART()}openShopModal(){this.shopModalIsopen=!0}closeShopModal(){this.shopModalIsopen=!1}updateSelectedPackageShop(e){this.selectedShop=e}async onAddressChange(){if(this.initialized){const e=this.deliveryType,t=this.selectedShop;await this.ensureDeliveryTypes(),e!=this.deliveryType&&W.A.GET_CART(),(!this.selectedShop&&this.address.zipcode?.length||this.selectedShop&&t?.shopid!=this.selectedShop.shopid)&&await l.A.UPDATE_DELIVERY(this.delivery)}}};(0,o.Cg)([(0,n.ox)("address")],ge.prototype,"onAddressChange",null),ge=(0,o.Cg)([(0,n.uA)({name:"checkoutDelivery",components:{PackageShop:fe,PackageShopItem:re,CheckoutDeliveryDate:()=>r.e(1835).then(r.bind(r,51835))}})],ge);const ve=ge,me=ve;var ye=(0,_.A)(me,z,F,!1,null,null,null);const we=ye.exports;var ke=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"checkout-payment uk-width-1-2@s"},[t("h3",[t("span",{staticClass:"progress-step",class:{invalid:!e.paymentIsValid}},[e._v("3")]),t("strong",[e._v(e._s(e.$t("checkout.payment",["Payment"])))])]),t("fieldset",{staticClass:"uk-fieldset uk-margin-bottom"},[e.showFailedAttempsError?t("div",{staticClass:"uk-alert-danger",attrs:{"uk-alert":""}},[t("p",[e._v(e._s(e.$t("checkout.alert-payment-attempts-failed",["Payment cancelled due to too many attempts"])))])]):e._e(
1),e.initialized&&!e.paymentTypes.length?t("div",{staticClass:"uk-input checkout-option error"},[t("label",[t("div",{staticClass:"primary-info"},[t("span",{staticClass:"title"},[e._v(e._s(e.$t("checkout.payment-unavailable",["No payment methods available"])))])])]),t("div",{staticClass:"secondary-info"},[t("div",{staticClass:"description"},[e._v(" "+e._s(e.$t("checkout.payment-unavailable-description",["There are no payment methods available. Please contact us for help."]))+" ")])])]):e._e(),e._l(e.paymentTypes,function(r){return t("div",{key:r.id,staticClass:"uk-input checkout-option",class:{active:r.id===e.paymentType}},[t("label",[t("div",{staticClass:"primary-info"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.payment.paymenttype,expression:"payment.paymenttype"}],staticClass:"uk-radio",attrs:{type:"radio",name:"payment"},domProps:{value:r.id,checked:e._q(e.payment.paymenttype,r.id)},on:{change:[function(t){return e.$set(e.payment,"paymenttype",r.id)},function(t){return e.persist()}]}}),t("span",{staticClass:"title"},[e._v(e._s(e.itemTitle(r)))]),r.icon?t("img",{staticClass:"checkout-icon",attrs:{src:r.icon}}):e._e()])]),e.showSecondaryInfo(r)?t("div",{staticClass:"secondary-info"},[r.description?t("div",{staticClass:"description"},[e._v(" "+e._s(r.description)+" ")]):e._e(),e.showEANInput(r)?t("div",{staticClass:"ean-info"},[t("CheckoutTextInput",{attrs:{label:e.$t("checkout.ean-no",["EAN No."]),rules:"required|ean"},on:{change:function(t){return e.persist()}},model:{value:e.payment.transactionid,callback:function(t){e.$set(e.payment,"transactionid",t)},expression:"payment.transactionid"}})],1):e._e(),r.displaypriceinfo?t("div",{staticClass:"pricing"},[t("strong",[t("PriceOutput",{attrs:{model:r.displaypriceinfo}})],1)]):e._e()]):e._e()])})],2)])},_e=[],be=r(35687);let Ae=class extends n.lD{constructor(){super(...arguments),this.initialized=!1,this.showFailedAttempsError=!1}get payment(){return l.A.PAYMENT}get paymentType(){return this.payment?.paymenttype??""}get paymentTypes(){return l.A.PAYMENT_TYPES}get selectedPaymentType(){return this.paymentTypes?.find(e=>e.id===this.paymentType)}get paymentIsValid(){return l.A.PAYMENT_IS_VALID}isActive(e){return e.id===this.paymentType}showSecondaryInfo(e){return!!this.showEANInput(e)||(e?.description?.length>0||e?.displaypriceinfo?.priceincvat?.length>0)}isEANPayment(e){return"ean"===e?.id}showEANInput(e){return this.isEANPayment(e)&&this.isActive(e)}itemTitle(e){return e.title?.length?e.title:e.id}async created(){await l.A.GET_PAYMENT_TYPES(),await l.A.GET_PAYMENT(),this.initialized=!0;const e=new URLSearchParams(window.location.search);this.showFailedAttempsError="too-many-attempts"===e.get("payment-error")}async persist(){if(this.isEANPayment(this.selectedPaymentType)){const e=(0,be.T)(this.payment.transactionid);if(!e)return!1}l.A.UPDATE_PAYMENT(this.payment),this.showFailedAttempsError&&this.removePaymentError()}removePaymentError(){const e=new URLSearchParams(window.location.search);e.delete("payment-error");let t=`${location.pathname}`;const r=e.toString();r.length>0&&(t+=`?${r}`),window.history.replaceState({},"",t),this.showFailedAttempsError=!1}async onPaymentChange(){W.A.GET_CART(),await l.A.GET_DELIVERY_TYPES(),l.A.GET_DELIVERY()}};(0,o.Cg)([(0,n.ox)("payment")],Ae.prototype,"onPaymentChange",null),Ae=(0,o.Cg)([(0,n.uA)({name:"checkoutPayment",components:{CheckoutTextInput:d.A}})],Ae);const Ce=Ae,Ee=Ce;var Se=(0,_.A)(Ee,ke,_e,!1,null,null,null);const Te=Se.exports;var xe=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"checkout-cart-preview uk-width-1-1@s"},[t("hr"),t("h3",{staticClass:"uk-margin-remove-top"},[t("span",{staticClass:"progress-step"},[e._v("4")]),t("strong",[e._v(e._s(e.$t("checkout.review-order",["Review your order"])))]),t("a",{staticClass:"uk-button uk-button-default uk-align-right uk-margin-remove",attrs:{href:e.checkoutLink}},[e._v(e._s(e.$t("checkout.edit-order",["Edit order"])))]),t("AddVoucherToCart")],1),e.cart.itemcount>0?t("div",{staticClass:"checkout-cart-preview-content"},[e._l(e.cartItems,function(r,s){return t("CartPreviewItem",{key:`cartitem_${s}`,attrs:{cartItem:r,"addon-items":e.addonItems(r)}})}),e.cart.fees.length>0?t("div",{staticClass:"cart-fees"},[t("FreeGiftLine",{attrs:{compact:!0}}),e._l(e.cartFees,function(r,s){return t("div",{key:`cartfee_${s}`,staticClass:"cart-fee-item"},[e._v(" "+e._s(r.name)+" "),t("strong",[t("PriceOutput",{attrs:{model:r.displaylineprice}})],1)])})],2):e._e(),t("CheckoutCartPreviewFooter")],2):e._e()])},Ie=[],Pe=r(34577),Re=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"checkout-cart-preview-footer cart-preview-footer"},[t("div",{staticClass:"total-price uk-text-bold"}
1,[0==e.cart.displaytotalprice.vatrateasnumeric?t("small",[e._v(e._s(e.$t("pricing.total",["Total"])))]):e.cart.displaytotalprice.showpricesincvat?t("small",[e._v(e._s(e.$t("pricing.total-inc-vat",["Total inc. VAT"])))]):t("small",[e._v(e._s(e.$t("pricing.total-ex-vat",["Total ex. VAT"])))]),t("span",[t("PriceOutput",{attrs:{model:e.cart.displaytotalprice}})],1)]),e.cart.displaytotalprice.vatrateasnumeric>0?[t("div",[t("small",[e._v(e._s(e.$t("pricing.vat",["VAT"]))+" "+e._s(e.cart.displaytotalprice.vatrate)+"%")]),t("small",{staticClass:"price-output"},[e._v(e._s(e.cart.displaytotalprice.vat))])]),e.cart.displaytotalprice.showpricesincvat?e._e():t("div",[t("small",[e._v(e._s(e.$t("pricing.total-inc-vat",["Total inc. VAT"])))]),t("small",[e._v(e._s(e.cart.displaytotalprice.priceincvat))])])]:e._e()],2)},De=[];let Me=class extends n.lD{get cart(){return W.A.CART}};Me=(0,o.Cg)([(0,n.uA)({name:"CheckoutCartPreviewFooter"})],Me);const Oe=Me,$e=Oe;r(71776);var Le=(0,_.A)($e,Re,De,!1,null,null,null);const Ne=Le.exports;var Ue=r(54428),Ve=r(30362),Be=r(85079);let Ke=class extends n.lD{get cart(){return W.A.CART}get cartItems(){return this.cart?.items?.filter(e=>!e.addonparent)??[]}get cartFees(){return this.cart.fees.filter(e=>!e.isfreegift)}addonItems(e){return this.cart?.items?.filter(t=>t.addonparent==e.productid&&t.variantid==e.variantid)??[]}get checkoutLink(){return Ve.Z.VARIABLES.checkoutpage}};Ke=(0,o.Cg)([(0,n.uA)({name:"checkoutCartPreview",components:{CartPreviewItem:Pe.A,CheckoutCartPreviewFooter:Ne,AddVoucherToCart:Ue.A,FreeGiftLine:Be.A}})],Ke);const He=Ke,ze=He;r(53765);var Fe=(0,_.A)(ze,xe,Ie,!1,null,null,null);const We=Fe.exports;var je=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.translationsReady?t("div",{key:e.renderKey,staticClass:"checkout-actions uk-grid-margin"},[e._m(0),t("fieldset",{staticClass:"uk-fieldset"},[t("div",{staticClass:"uk-margin-medium uk-text-center"},[t("AgeVerificationSection")],1),t("div",{staticClass:"uk-margin-medium uk-text-center"},[t("ValidationProvider",{attrs:{tag:"div",rules:"true"},scopedSlots:e._u([{key:"default",fn:function({errors:r,classes:s}){return[t("div",{staticClass:"terms-container cbx-border",class:s},[t("label",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.termsAccepted,expression:"termsAccepted"}],staticClass:"uk-checkbox",class:s,attrs:{type:"checkbox",id:e.$t("checkout.terms",["terms and conditions"])},domProps:{checked:Array.isArray(e.termsAccepted)?e._i(e.termsAccepted,null)>-1:e.termsAccepted},on:{input:function(t){return e.$emit("input",t.target.value)},change:[function(t){var r=e.termsAccepted,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=null,n=e._i(r,o);s.checked?n<0&&(e.termsAccepted=r.concat([o])):n>-1&&(e.termsAccepted=r.slice(0,n).concat(r.slice(n+1)))}else e.termsAccepted=i},function(t){return e.$emit("change",t.target.value)}]}}),e._v(" "+e._s(e.$t("checkout.i-accept",["I accept the shops"]))+" "),t("a",{staticClass:"uk-text-primary uk-text-bold",attrs:{"uk-toggle":"target: #legal-modal"},on:{click:function(e){e.preventDefault()}}},[e._v(e._s(e.$t("checkout.terms",["terms and conditions"])))]),e._v(" * ")]),r[0]?t("div",{staticClass:"errors uk-text-danger uk-text-small uk-text-meta"},[e._v(e._s(r[0]))]):e._e()])]}}],null,!1,2251662090)})],1),t("div",{staticClass:"uk-margin"},[t("button",{staticClass:"uk-button uk-button-primary uk-button-large uk-align-center",attrs:{disabled:e.isLoading,type:"submit"},on:{click:function(t){return e.processOrder()}}},[e.usePaymentGateway?t("span",[e._v(" "+e._s(e.$t("checkout.proceed-to-payment",["Proceed to payment"]))+" ")]):t("span",[e._v(" "+e._s(e.$t("checkout.place-order",["Place order"]))+" ")]),t("span",{class:{"uk-spinner":e.isLoading},attrs:{"uk-icon":e.isLoading?"icon: spinner;":"icon: arrow-right; ratio: 2;"}})]),e.turnstileSiteKey?t("CloudflareTurnstile",{staticClass:"uk-text-center",attrs:{"site-key":e.turnstileSiteKey},on:{verified:e.onVerify}}):e._e()],1)]),t("div",{attrs:{id:"legal-modal","uk-modal":""}},[t("div",{staticClass:"uk-modal-dialog uk-modal-body"},[t("button",{staticClass:"uk-modal-close-default",attrs:{type:"button","uk-close":""}}),t("h2",{staticClass:"uk-modal-title"},[e._v(e._s(e.$t("checkout.terms-title",["Terms and conditions"])))]),t("div",{staticClass:"terms-content compact-scroll",domProps:{innerHTML:e._s(e.terms)}})])]),e.orderProcessing?t("div",{staticClass:"processing-overlay"}):e._e(),t("PortalTarget",{attrs:{name:"afterCheckoutActions"}}
1)],1):e._e()},Je=[function(){var e=this,t=e._self._c;e._self._setupProxy;return t("h3",[t("span",{staticClass:"progress-step"},[e._v("5")])])}],qe=r(85524),Ge=r(36279),Ye=r(70778),Ze=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.translationsReady&&e.enabled?t("div",{key:e.renderKey,staticClass:"age-verification-section"},[t("div",{staticClass:"terms-container cbx-border"},[t("p",{staticClass:"uk-flex-inline uk-margin-remove-top"},[e._v(" "+e._s(e.$t("checkout.age-verification-heading",["Age verification:"]))+" ")]),t("ValidationProvider",{staticClass:"uk-margin-remove-top",attrs:{tag:"p",rules:"true"},scopedSlots:e._u([{key:"default",fn:function({errors:r,classes:s}){return[t("div",{class:s},[t("label",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.ageVerificationTermsAccepted,expression:"ageVerificationTermsAccepted"}],staticClass:"uk-checkbox",class:s,attrs:{type:"checkbox",id:e.$t("checkout.age-verification-heading",["Age verification:"])},domProps:{checked:Array.isArray(e.ageVerificationTermsAccepted)?e._i(e.ageVerificationTermsAccepted,null)>-1:e.ageVerificationTermsAccepted},on:{input:function(t){return e.$emit("input",t.target.value)},change:[function(t){var r=e.ageVerificationTermsAccepted,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=null,n=e._i(r,o);s.checked?n<0&&(e.ageVerificationTermsAccepted=r.concat([o])):n>-1&&(e.ageVerificationTermsAccepted=r.slice(0,n).concat(r.slice(n+1)))}else e.ageVerificationTermsAccepted=i},function(t){return e.$emit("change",t.target.value)}]}}),e._v(" "+e._s(e.$t("checkout.terms-age",["I confirm that I am over 18 years of age."]))+" ")]),r[0]?t("div",{staticClass:"errors uk-text-danger uk-text-small uk-text-meta"},[e._v(e._s(r[0]))]):e._e()])]}}],null,!1,3425854753)}),t("img",{staticClass:"uk-display-block uk-align-center uk-margin-bottom age-verification-checkout-banner",attrs:{src:"/media/SST-Alkohol-2026.png",alt:e.$t("checkout.sst-image-alt-text",["Alcohol age requirements"])}}),e.isChecked?t("div",{staticClass:"uk-flex-inline uk-text-bold"},[e.ageVerification.is_over_18?t("p",{staticClass:"uk-margin-remove-bottom"},[t("span",{staticClass:"uk-text-success",attrs:{"uk-icon":"icon: check; ratio: 1.5"}}),e._v(" "+e._s(e.$t("checkout.age-verification-success",["Verified"]))+" ")]):t("p",{staticClass:"uk-margin-remove-bottom"},[t("span",{staticClass:"uk-text-danger",attrs:{"uk-icon":"icon: close; ratio: 1.5"}}),e._v(" "+e._s(e.$t("checkout.age-verification-error",["Not verified"]))+" ")])]):[t("p",{staticClass:"uk-flex-inline uk-margin-remove-top uk-margin-small-left"},[e._v(e._s(e.$t("checkout.age-verification-needed",["Please verify that you are above 18 years old"])))]),t("button",{staticClass:"uk-button uk-button-default uk-flex uk-margin-auto",attrs:{disabled:e.processing},on:{click:e.criiptoVerifyAge}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 234 62"}},[t("path",{attrs:{fill:"#ffffff","fill-rule":"evenodd",d:"M188.917.941h10.045C223.578.941 234 14.317 234 31.051c0 16.733-10.422 30.11-35.038 30.11h-10.045V.94Zm-7.513 60.22h-52.597c1.5-18.57 12.62-26.347 26.298-26.347 13.678 0 24.8 7.777 26.299 26.346Zm-11.74-46.576c0 8.054-6.519 14.584-14.559 14.584s-14.558-6.53-14.558-14.584C140.547 6.53 147.065 0 155.105 0s14.558 6.53 14.558 14.585ZM28.49 48.674l-16.698-24.95V61.15H0V3.12h11.227l17.547 27.407L46.227 3.12h11.038v58.03H45.378V23.724l-16.51 24.95h-.377ZM79.533 61.15H67.835V18.902h11.698V61.15ZM92.27 28.354h-6.415v-9.451h6.415V7.467h11.604v11.436h9.245v9.451h-9.245v18.524c0 3.308 1.792 4.82 4.811 4.82 1.793 0 3.774-.566 5.095-1.417v10.396c-1.605.851-4.435 1.323-7.548 1.323-8.585 0-13.962-4.253-13.962-13.61V28.354ZM80.618 6.947c0 3.837-3.104 6.947-6.934 6.947s-6.934-3.11-6.934-6.947S69.854 0 73.684 0s6.934 3.11 6.934 6.947Z"}})]),e._v(" "+e._s(e.$t("checkout.age-verification-button",["Verify with MitID"]))+" "),e.processing?t("span",{attrs:{"uk-spinner":""}}):e._e()])],e.responseError?t("p",{staticClass:"uk-text-danger"},[e._v(" "+e._s(e.$t("checkout.age-verification-service-error",["An error occured during age verification. Please contact customer service."]))+" ")]):e._e(
1)],2)]):e._e()},Qe=[],Xe={987:e=>{var t={single_source_shortest_paths:function(e,r,s){var i={},o={};o[r]=0;var n,a,c,l,d,u,p,h=t.PriorityQueue.make();for(h.push(r,0);!h.empty();)for(c in a=(n=h.pop()).value,l=n.cost,d=e[a]||{})d.hasOwnProperty(c)&&(u=l+d[c],p=o[c],(void 0===o[c]||p>u)&&(o[c]=u,h.push(c,u),i[c]=a));if(void 0!==s&&void 0===o[s]){var f=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(f)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],s=t;s;)r.push(s),e[s],s=e[s];return r.reverse(),r},find_path:function(e,r,s){var i=t.single_source_shortest_paths(e,r,s);return t.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(e){var r,s=t.PriorityQueue,i={};for(r in e=e||{},s)s.hasOwnProperty(r)&&(i[r]=s[r]);return i.queue=[],i.sorter=e.sorter||s.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},378:e=>{e.exports=function(e){for(var t=[],r=e.length,s=0;s<r;s++){var i=e.charCodeAt(s);if(i>=55296&&i<=56319&&r>s+1){var o=e.charCodeAt(s+1);o>=56320&&o<=57343&&(i=1024*(i-55296)+o-56320+65536,s+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},592:(e,t,r)=>{const s=r(138),i=r(115),o=r(907),n=r(776);function a(e,t,r,o,n){const a=[].slice.call(arguments,1),c=a.length,l="function"==typeof a[c-1];if(!l&&!s())throw new Error("Callback required as last argument");if(!l){if(c<1)throw new Error("Too few arguments provided");return 1===c?(r=t,t=o=void 0):2!==c||t.getContext||(o=r,r=t,t=void 0),new Promise(function(s,n){try{const n=i.create(r,o);s(e(n,t,o))}catch(e){n(e)}})}if(c<2)throw new Error("Too few arguments provided");2===c?(n=r,r=t,t=o=void 0):3===c&&(t.getContext&&void 0===n?(n=o,o=void 0):(n=o,o=r,r=t,t=void 0));try{const s=i.create(r,o);n(null,e(s,t,o))}catch(e){n(e)}}t.create=i.create,t.toCanvas=a.bind(null,o.render),t.toDataURL=a.bind(null,o.renderToDataURL),t.toString=a.bind(null,function(e,t,r){return n.render(e,r)})},138:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},845:(e,t,r)=>{const s=r(242).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=s(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),o=[r-7];for(let s=1;s<t-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){const r=[],s=t.getRowColCoords(e),i=s.length;for(let t=0;t<i;t++)for(let e=0;e<i;e++)0===t&&0===e||0===t&&e===i-1||t===i-1&&0===e||r.push([s[t],s[e]]);return r}},260:(e,t,r)=>{const s=r(910),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(e){this.mode=s.ALPHANUMERIC,this.data=e}o.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},e.exports=o},245:e=>{function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},280:e=>{function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,s){const i=e*this.size+t;this.data[i]=r,s&&(this.reservedBit[i]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},424:(e,t,r)=>{const s=r(378),i=r(910);function o(e){this.mode=i.BYTE,"string"==typeof e&&(e=s(e)),this.data=new Uint8Array(e)}o.getBitsLength=function(e){return 8*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},e.exports=o},393:(e,t,r)=>{const s=r(908),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,
vendor: 17,461 bytes, line 1
1192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case s.L:return i[4*(e-1)+0];case s.M:return i[4*(e-1)+1];case s.Q:return i[4*(e-1)+2];case s.H:return i[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case s.L:return o[4*(e-1)+0];case s.M:return o[4*(e-1)+1];case s.Q:return o[4*(e-1)+2];case s.H:return o[4*(e-1)+3];default:return}}},908:(e,t)=>{t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},526:(e,t,r)=>{const s=r(242).getSymbolSize;t.getPositions=function(e){const t=s(e);return[[0,0],[t-7,0],[0,t-7]]}},642:(e,t,r)=>{const s=r(242),i=s.getBCHDigit(1335);t.getEncodedBits=function(e,t){const r=e.bit<<3|t;let o=r<<10;for(;s.getBCHDigit(o)-i>=0;)o^=1335<<s.getBCHDigit(o)-i;return 21522^(r<<10|o)}},729:(e,t)=>{const r=new Uint8Array(512),s=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,s[e]=t,e<<=1,256&e&&(e^=285);for(let t=255;t<512;t++)r[t]=r[t-255]}(),t.log=function(e){if(e<1)throw new Error("log("+e+")");return s[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[s[e]+s[t]]}},442:(e,t,r)=>{const s=r(910),i=r(242);function o(e){this.mode=s.KANJI,this.data=e}o.getBitsLength=function(e){return 13*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=i.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=o},126:(e,t)=>{function r(e,r,s){switch(e){case t.Patterns.PATTERN000:return(r+s)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return s%3==0;case t.Patterns.PATTERN011:return(r+s)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(s/3))%2==0;case t.Patterns.PATTERN101:return r*s%2+r*s%3==0;case t.Patterns.PATTERN110:return(r*s%2+r*s%3)%2==0;case t.Patterns.PATTERN111:return(r*s%3+(r+s)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let r=0,s=0,i=0,o=null,n=null;for(let a=0;a<t;a++){s=i=0,o=n=null;for(let c=0;c<t;c++){let t=e.get(a,c);t===o?s++:(s>=5&&(r+=s-5+3),o=t,s=1),t=e.get(c,a),t===n?i++:(i>=5&&(r+=i-5+3),n=t,i=1)}s>=5&&(r+=s-5+3),i>=5&&(r+=i-5+3)}return r},t.getPenaltyN2=function(e){const t=e.size;let r=0;for(let s=0;s<t-1;s++)for(let i=0;i<t-1;i++){const t=e.get(s,i)+e.get(s,i+1)+e.get(s+1,i)+e.get(s+1,i+1);4!==t&&0!==t||r++}return 3*r},t.getPenaltyN3=function(e){const t=e.size;let r=0,s=0,i=0;for(let o=0;o<t;o++){s=i=0;for(let n=0;n<t;n++)s=s<<1&2047|e.get(o,n),n>=10&&(1488===s||93===s)&&r++,i=i<<1&2047|e.get(n,o),n>=10&&(1488===i||93===i)&&r++}return 40*r},t.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let s=0;s<r;s++)t+=e.data[s];return 10*Math.abs(Math.ceil(100*t/r/5)-10)},t.applyMask=function(e,t){const s=t.size;for(let i=0;i<s;i++)for(let o=0;o<s;o++)t.isReserved(o,i)||t.xor(o,i,r(e,o,i))},t.getBestMask=function(e,r){const s=Object.keys(t.Patterns).length;let i=0,o=1/0;for(let n=0;n<s;n++){r(n),t.applyMask(n,e);const s=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(n,e),s<o&&(o=s,i=n)}return i}},910:(e,t,r)=>{const s=r(114),i=r(7);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!s.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},85:(e,t,r)=>{const s=r(910);function i(e){this.mode=s.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r,s;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),s=parseInt(r,10),e.put(s,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),s=parseInt(r,10),e.put(s,3*i+1))},e.exports=i},143:(e,t,r)=>{const s=r(729);t.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let i=0;i<e.length;i++)for(let o=0;o<t.length;o++)r[i+o]^=s.mul(e[i],t[o]);return r},t.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let o=0;o<t.length;o++)r[o]^=s.mul(t[o],e);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},t.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let i=0;i<e;i++)r=t.mul(r,new Uint8Array([1,s.exp(i)]));return r}},115:(e,t,r)=>{const s=r(242),i=r(908),o=r(245),n=r(280),a=r(845),c=r(526),l=r(126),d=r(393),u=r(882),p=r(103),h=r(642),f=r(910),g=r(130);function v(e,t,r){const s=e.size,i=h.getEncodedBits(t,r);let o,n;for(o=0;o<15;o++)n=1==(i>>o&1),o<6?e.set(o,8,n,!0):o<8?e.set(o+1,8,n,!0):e.set(s-15+o,8,n,!0),o<8?e.set(8,s-o-1,n,!0):o<9?e.set(8,15-o-1+1,n,!0):e.set(8,15-o-1,n,!0);e.set(s-8,8,1,!0)}function m(e,t,r,i){let h;if(Array.isArray(e))h=g.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let s=t;if(!s){const t=g.rawSplit(e);s=p.getBestVersionForData(t,r)}h=g.fromString(e,s||40)}}const m=p.getBestVersionForData(h,r);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<m)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+m+".\n")}else t=m;const y=function(e,t,r){const i=new o;r.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(i)});const n=8*(s.getSymbolTotalCodewords(e)-d.getTotalCodewordsCount(e,t));for(i.getLengthInBits()+4<=n&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const a=(n-i.getLengthInBits())/8;for(let s=0;s<a;s++)i.put(s%2?17:236,8);return function(e,t,r){const i=s.getSymbolTotalCodewords(t),o=i-d.getTotalCodewordsCount(t,r),n=d.getBlocksCount(t,r),a=n-i%n,c=Math.floor(i/n),l=Math.floor(o/n),p=l+1,h=c-l,f=new u(h);let g=0;const v=new Array(n),m=new Array(n);let y=0;const w=new Uint8Array(e.buffer);for(let s=0;s<n;s++){const e=s<a?l:p;v[s]=w.slice(g,g+e),m[s]=f.encode(v[s]),g+=e,y=Math.max(y,e)}const k=new Uint8Array(i);let _,b,A=0;for(_=0;_<y;_++)for(b=0;b<n;b++)_<v[b].length&&(k[A++]=v[b][_]);for(_=0;_<h;_++)for(b=0;b<n;b++)k[A++]=m[b][_];return k}(i,e,t)}(t,r,h),w=s.getSymbolSize(t),k=new n(w);return function(e,t){const r=e.size,s=c.getPositions(t);for(let i=0;i<s.length;i++){const t=s[i][0],o=s[i][1];for(let s=-1;s<=7;s++)if(!(t+s<=-1||r<=t+s))for(let i=-1;i<=7;i++)o+i<=-1||r<=o+i||(s>=0&&s<=6&&(0===i||6===i)||i>=0&&i<=6&&(0===s||6===s)||s>=2&&s<=4&&i>=2&&i<=4?e.set(t+s,o+i,!0,!0):e.set(t+s,o+i,!1,!0))}}(k,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(k),function(e,t){const r=a.getPositions(t);for(let s=0;s<r.length;s++){const t=r[s][0],i=r[s][1];for(let r=-2;r<=2;r++)for(let s=-2;s<=2;s++)-2===r||2===r||-2===s||2===s||0===r&&0===s?e.set(t+r,i+s,!0,!0):e.set(t+r,i+s,!1,!0)}}(k,t),v(k,r,0),t>=7&&function(e,t){const r=e.size,s=p.getEncodedBits(t);let i,o,n;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+r-8-3,n=1==(s>>a&1),e.set(i,o,n,!0),e.set(o,i,n,!0)}(k,t),function(e,t){const r=e.size;let s=-1,i=r-1,o=7,n=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let s=!1;n<t.length&&(s=1==(t[n]>>>o&1)),e.set(i,a-r,s),o--,-1===o&&(n++,o=7)}if(i+=s,i<0||r<=i){i-=s,s=-s;break}}}(k,y),isNaN(i)&&(i=l.getBestMask(k,v.bind(null,k,r))),l.applyMask(i,k),v(k,r,i),{modules:k,version:t,errorCorrectionLevel:r,maskPattern:i,segments:h}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,o,n=i.M;return void 0!==t&&(n=i.from(t.errorCorrectionLevel,i.M),r=p.from(t.version),o=l.from(t.maskPattern),t.toSJISFunc&&s.setToSJISFunction(t.toSJISFunc)),m(e,r,n,o)}},882:(e,t,r)=>{const s=r(143);function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=s.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=s.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const e=new Uint8Array(this.degree);return e.set(r,i),e}return r},e.exports=i},7:(e,t)=>{const r="[0-9]+";let s="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";s=s.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+s+")(?:.|[\r\n]))+";t.KANJI=new RegExp(s,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(i,"g"),t.NUMERIC=new RegExp(r,"g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const o=new RegExp("^"+s+"$"),n=new RegExp("^"+r+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return o.test(e)},t.testNumeric=function(e){return n.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},130:(e,t,r)=>{const s=r(910),i=r(85),o=r(260),n=r(424),a=r(442),c=r(7),l=r(242),d=r(987);function u(e){return unescape(encodeURIComponent(e)).length}function p(e,t,r){const s=[];let i;for(;null!==(i=e.exec(r));)s.push({data:i[0],index:i.index,mode:t,length:i[0].length});return s}function h(e){const t=p(c.NUMERIC,s.NUMERIC,e),r=p(c.ALPHANUMERIC,s.ALPHANUMERIC,e);let i,o;return l.isKanjiModeEnabled()?(i=p(c.BYTE,s.BYTE,e),o=p(c.KANJI,s.KANJI,e)):(i=p(c.BYTE_KANJI,s.BYTE,e),o=[]),t.concat(r,i,o).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case s.NUMERIC:return i.getBitsLength(e);case s.ALPHANUMERIC:return o.getBitsLength(e);case s.KANJI:return a.getBitsLength(e);case s.BYTE:return n.getBitsLength(e)}}function g(e,t){let r;const c=s.getBestModeForData(e);if(r=s.from(t,c),r!==s.BYTE&&r.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+s.toString(r)+".\n Suggested mode is: "+s.toString(c));switch(r!==s.KANJI||l.isKanjiModeEnabled()||(r=s.BYTE),r){case s.NUMERIC:return new i(e);case s.ALPHANUMERIC:return new o(e);case s.KANJI:return new a(e);case s.BYTE:return new n(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},t.fromString=function(e,r){const i=function(e){const t=[];for(let r=0;r<e.length;r++){const i=e[r];switch(i.mode){case s.NUMERIC:t.push([i,{data:i.data,mode:s.ALPHANUMERIC,length:i.length},{data:i.data,mode:s.BYTE,length:i.length}]);break;case s.ALPHANUMERIC:t.push([i,{data:i.data,mode:s.BYTE,length:i.length}]);break;case s.KANJI:t.push([i,{data:i.data,mode:s.BYTE,length:u(i.data)}]);break;case s.BYTE:t.push([{data:i.data,mode:s.BYTE,length:u(i.data)}])}}return t}(h(e,l.isKanjiModeEnabled())),o=function(e,t){const r={},i={start:{}};let o=["start"];for(let n=0;n<e.length;n++){const a=e[n],c=[];for(let e=0;e<a.length;e++){const l=a[e],d=""+n+e;c.push(d),r[d]={node:l,lastCount:0},i[d]={};for(let e=0;e<o.length;e++){const n=o[e];r[n]&&r[n].node.mode===l.mode?(i[n][d]=f(r[n].lastCount+l.length,l.mode)-f(r[n].lastCount,l.mode),r[n].lastCount+=l.length):(r[n]&&(r[n].lastCount=l.length),i[n][d]=f(l.length,l.mode)+4+s.getCharCountIndicator(l.mode,t))}}o=c}for(let s=0;s<o.length;s++)i[o[s]].end=0;return{map:i,table:r}}(i,r),n=d.find_path(o.map,"start","end"),a=[];for(let t=1;t<n.length-1;t++)a.push(o.table[n[t]].node);return t.fromArray(a.reduce(function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[]))},t.rawSplit=function(e){return t.fromArray(h(e,l.isKanjiModeEnabled()))}},242:(e,t)=>{let r;const s=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return s[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},114:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},103:(e,t,r)=>{const s=r(242),i=r(393),o=r(908),n=r(910),a=r(114),c=s.getBCHDigit(7973);function l(e,t){return n.getCharCountIndicator(e,t)+4}function d(e,t){let r=0;return e.forEach(function(e){const s=l(e.mode,t);r+=s+e.getBitsLength()}),r}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=n.BYTE);const o=8*(s.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t));if(r===n.MIXED)return o;const c=o-l(r,e);switch(r){case n.NUMERIC:return Math.floor(c/10*3);case n.ALPHANUMERIC:return Math.floor(c/11*2);case n.KANJI:return Math.floor(c/13);case n.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,r){let s;const i=o.from(r,o.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let s=1;s<=40;s++)if(d(e,s)<=t.getCapacity(s,r,n.MIXED))return s}(e,i);if(0===e.length)return 1;s=e[0]}else s=e;return function(e,r,s){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,s,e))return i}(s.mode,s.getLength(),i)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;s.getBCHDigit(t)-c>=0;)t^=7973<<s.getBCHDigit(t)-c;return e<<12|t}},907:(e,t,r)=>{const s=r(653);t.render=function(e,t,r){let i=r,o=t;void 0!==i||t&&t.getContext||(i=t,t=void 0),t||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=s.getOptions(i);const n=s.getImageWidth(e.modules.size,i),a=o.getContext("2d"),c=a.createImageData(n,n);return s.qrToImageData(c.data,e,i),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,o,n),a.putImageData(c,0,0),o},t.renderToDataURL=function(e,r,s){let i=s;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});const o=t.render(e,r,i),n=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(n,a.quality)}},776:(e,t,r)=>{const s=r(653);function i(e,t){const r=e.a/255,s=t+'="'+e.hex+'"';return r<1?s+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':s}function o(e,t,r){let s=e+t;return void 0!==r&&(s+=" "+r),s}t.render=function(e,t,r){const n=s.getOptions(t),a=e.modules.size,c=e.modules.data,l=a+2*n.margin,d=n.color.light.a?"<path "+i(n.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",u="<path "+i(n.color.dark,"stroke")+' d="'+function(e,t,r){let s="",i=0,n=!1,a=0;for(let c=0;c<e.length;c++){const l=Math.floor(c%t),d=Math.floor(c/t);l||n||(n=!0),e[c]?(a++,c>0&&l>0&&e[c-1]||(s+=n?o("M",l+r,.5+d+r):o("m",i,0),i=0,n=!1),l+1<t&&e[c+1]||(s+=o("h",a),a=0)):i++}return s}(c,a,n.margin)+'"/>',p='viewBox="0 0 '+l+" "+l+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+p+' shape-rendering="crispEdges">
1'+d+u+"</svg>\n";return"function"==typeof r&&r(null,h),h}},653:(e,t)=>{function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,s=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:s,scale:s?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){const s=t.getScale(e,r);return Math.floor((e+2*r.margin)*s)},t.qrToImageData=function(e,r,s){const i=r.modules.size,o=r.modules.data,n=t.getScale(i,s),a=Math.floor((i+2*s.margin)*n),c=s.margin*n,l=[s.color.light,s.color.dark];for(let t=0;t<a;t++)for(let r=0;r<a;r++){let d=4*(t*a+r),u=s.color.light;t>=c&&r>=c&&t<a-c&&r<a-c&&(u=l[o[Math.floor((t-c)/n)*i+Math.floor((r-c)/n)]?1:0]),e[d++]=u.r,e[d++]=u.g,e[d++]=u.b,e[d]=u.a}}}},et={};function tt(e){var t=et[e];if(void 0!==t)return t.exports;var r=et[e]={exports:{}};return Xe[e](r,r.exports,tt),r.exports}tt.d=(e,t)=>{for(var r in t)tt.o(t,r)&&!tt.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},tt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),tt.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var rt={};(()=>{tt.d(rt,{uJ:()=>e,bU:()=>nt,Lk:()=>v,Ul:()=>re,PK:()=>Fe,hs:()=>je,TU:()=>We,q4:()=>ot,Op:()=>a,ZP:()=>at,nN:()=>s,um:()=>n,zi:()=>l,gM:()=>d,NT:()=>o});var e={};tt.r(e),tt.d(e,{IsAckMessage:()=>ve,IsCancelMessage:()=>me,IsOAuth2CodeMessage:()=>ye,IsOAuth2ErrorMessage:()=>we,SendWebsocketDirectMessage:()=>ke,SessionAPI:()=>fe,WebsocketDMSender:()=>_e,arrayBufferToBase64:()=>Se,base64ToArrayBuffer:()=>Te,exportPublicKeyAsBase64:()=>xe,generateClientId:()=>Ae,generateKeyPair:()=>Ee,generateSessionId:()=>Ce,importPublicKeyFromBase64:()=>Ie});const t=["redirect","popup"];function r(e){return globalThis.btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function s(){var e,t,s,i,o;return t=this,s=void 0,o=function*(){const t=new TextEncoder,s=new Uint8Array(32);globalThis.crypto.getRandomValues(s);const i=r(s),o=null!==(e=globalThis.crypto.webkitSubtle)&&void 0!==e?e:globalThis.crypto.subtle;if(!o)throw new Error("SubtleCrypto implementation required to generate PKCE values");const n=yield o.digest("SHA-256",t.encode(i));return{code_verifier:i,code_challenge:r(new Uint8Array(n)),code_challenge_method:"S256"}},new((i=void 0)||(i=Promise))(function(e,r){function n(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i(function(e){e(r)})).then(n,a)}c((o=o.apply(t,s||[])).next())})}const i="@criipto/verify-js:pkce:state";function o(e,t){e.setItem(i,JSON.stringify(t))}function n(e){const t=e.getItem(i);return t?JSON.parse(t):null}function a(e){e.removeItem(i)}function c(e){return e&&e.length?((e.startsWith("?")||e.startsWith("#"))&&(e=e.replace(/^(\?|\#)/,"")),e.split("&").reduce((e,t)=>{const r=t.split("=");return e[r[0]]=decodeURIComponent(r[1]),e},{})):{}}function l(e){var t,r,s,i,o,n,a,c,l,d;const u=new URL(e);return{domain:u.host,clientID:u.searchParams.get("client_id"),acrValues:null!==(r=null===(t=u.searchParams.get("acr_values"))||void 0===t?void 0:t.split(" "))&&void 0!==r?r:void 0,redirectUri:null!==(s=u.searchParams.get("redirect_uri"))&&void 0!==s?s:void 0,responseType:u.searchParams.get("response_type")?u.searchParams.get("response_type"):void 0,responseMode:null!==(i=u.searchParams.get("response_mode"))&&void 0!==i?i:void 0,pkce:u.searchParams.get("code_challenge")?{code_challenge:u.searchParams.get("code_challenge"),code_challenge_method:u.searchParams.get("code_challenge_method")}:void 0,state:null!==(o=u.searchParams.get("state"))&&void 0!==o?o:void 0,loginHint:null!==(n=u.searchParams.get("login_hint"))&&void 0!==n?n:void 0,uiLocales:null!==(a=u.searchParams.get("ui_locales"))&&void 0!==a?a:void 0,scope:null!==(c=u.searchParams.get("scope"))&&void 0!==c?c:void 0,nonce:null!==(l=u.searchParams.get("nonce"))&&void 0!==l?l:void 0,prompt:null!==(d=u.searchParams.get("prompt"))&&void 0!==d?d:void 0}}function d(e){return function(e){return Object.assign(Object.assign({},c(e.search)),c(e.hash))}(e)}function u(e){return c(new URL(e).search)}const p="CRIIPTO_AUTHORIZE_RESPONSE",h="criipto_popup_backdrop",f="criipto_popup_backdrop_button_open",g="criipto_popup_backdrop_button_close";
1class v extends Error{constructor(e,t,r){super(e+(t?` (${t})`:"")),this.name="OAuth2Error",this.error=e,this.error_description=t,this.state=r}}const m=crypto,y=e=>e instanceof CryptoKey,w=new TextEncoder,k=new TextDecoder,_=e=>{let t=e;t instanceof Uint8Array&&(t=k.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r})(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class b extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class A extends b{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class C extends b{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class E extends b{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class S extends b{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class T extends b{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class x extends b{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class I extends b{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class P extends b{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class R extends b{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class D extends b{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class M extends b{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}m.getRandomValues.bind(m);const O=e=>y(e),$=["CryptoKey"],L=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:s,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new S(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new S('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new S('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new S('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new S('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new S('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o=[s,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===s.name)return m.subtle.importKey("raw",_(e.k),...o);const n={...e};return delete n.alg,delete n.use,m.subtle.importKey("jwk",n,...o)};function N(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function U(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const V=(e,...t)=>U("Key must be ",e,...t);function B(e,t,...r){return U(`Key for the ${e} algorithm must be `,t,...r)}function K(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function H(e,t){return e.name===t}function z(e){return parseInt(e.name.slice(4),10)}
1function F(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!H(e.algorithm,"HMAC"))throw K("HMAC");const r=parseInt(t.slice(2),10);if(z(e.algorithm.hash)!==r)throw K(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!H(e.algorithm,"RSASSA-PKCS1-v1_5"))throw K("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(z(e.algorithm.hash)!==r)throw K(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!H(e.algorithm,"RSA-PSS"))throw K("RSA-PSS");const r=parseInt(t.slice(2),10);if(z(e.algorithm.hash)!==r)throw K(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw K("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!H(e.algorithm,"ECDSA"))throw K("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw K(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}async function W(e,t,r){if(e instanceof Uint8Array&&(e=k.decode(e)),"string"!=typeof e)throw new T("Compact JWS must be a string or Uint8Array");const{0:s,1:i,2:o,length:n}=e.split(".");if(3!==n)throw new T("Invalid Compact JWS");const a=await async function(e,t,r){var s;if(!N(e))throw new T("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new T('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new T("JWS Protected Header incorrect type");if(void 0===e.payload)throw new T("JWS Payload missing");if("string"!=typeof e.signature)throw new T("JWS Signature missing or incorrect type");if(void 0!==e.header&&!N(e.header))throw new T("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=_(e.protected);i=JSON.parse(k.decode(t))}catch(e){throw new T("JWS Protected Header is invalid")}if(!((...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const s of t){const e=Object.keys(s);if(r&&0!==r.size)for(const t of e){if(r.has(t))return!1;r.add(t)}else r=new Set(e)}return!0})(i,e.header))throw new T("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let n=!0;if(function(e,t,r,s,i){if(void 0!==i.crit&&void 0===s.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!s||void 0===s.crit)return new Set;if(!Array.isArray(s.crit)||0===s.crit.length||s.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const n of s.crit){if(!o.has(n))throw new S(`Extension Header Parameter "${n}" is not recognized`);if(void 0===i[n])throw new e(`Extension Header Parameter "${n}" is missing`);if(o.get(n)&&void 0===s[n])throw new e(`Extension Header Parameter "${n}" MUST be integrity protected`)}return new Set(s.crit)}(T,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(n=i.b64,"boolean"!=typeof n))throw new T('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:a}=o;if("string"!=typeof a||!a)throw new T('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&((e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)})("algorithms",r.algorithms);if(c&&!c.has(a))throw new E('"alg" (Algorithm) Header Parameter not allowed');if(n){if("string"!=typeof e.payload)throw new T("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new T("JWS Payload must be a string or an Uint8Array instance");let l=!1;"function"==typeof t&&(t=await t(i,e),l=!0),((e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>
1{if(!(t instanceof Uint8Array)){if(!O(t))throw new TypeError(B(e,t,...$,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${$.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!O(t))throw new TypeError(B(e,t,...$));if("secret"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${$.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)})(a,t,"verify");const d=function(...e){const t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t);let s=0;return e.forEach(e=>{r.set(e,s),s+=e.length}),r}(w.encode(null!==(s=e.protected)&&void 0!==s?s:""),w.encode("."),"string"==typeof e.payload?w.encode(e.payload):e.payload);let u,p;try{u=_(e.signature)}catch(e){throw new T("Failed to base64url decode the signature")}if(!await(async(e,t,r,s)=>{const i=await function(e,t,r){if(y(t))return F(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(V(t,...$));return m.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(V(t,...$,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,i);const o=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new S(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,i.algorithm);try{return await m.subtle.verify(o,i,r,s)}catch(e){return!1}})(a,t,u,d))throw new M;if(n)try{p=_(e.payload)}catch(e){throw new T("Failed to base64url decode the payload")}else p="string"==typeof e.payload?w.encode(e.payload):e.payload;const h={payload:p};return void 0!==e.protected&&(h.protectedHeader=i),void 0!==e.header&&(h.unprotectedHeader=e.header),l?{...h,key:t}:h}({payload:i,protected:s,signature:o},t,r),c={payload:a.payload,protectedHeader:a.protectedHeader};return"function"==typeof t?{...c,key:a.key}:c}Symbol();const j=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,J=e=>{const t=j.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}},q=e=>e.toLowerCase().replace(/^application\//,""),G=(e,t,r={})=>{const{typ:s}=r;if(s&&("string"!=typeof e.typ||q(e.typ)!==q(s)))throw new A('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(k.decode(t))}catch(e){}if(!N(i))throw new x("JWT Claims Set must be a top-level JSON object");const{requiredClaims:o=[],issuer:n,subject:a,audience:c,maxTokenAge:l}=r;void 0!==l&&o.push("iat"),void 0!==c&&o.push("aud"),void 0!==a&&o.push("sub"),void 0!==n&&o.push("iss");for(const v of new Set(o.reverse()))if(!(v in i))throw new A(`missing required "${v}" claim`,v,"missing");if(n&&!(Array.isArray(n)?n:[n]).includes(i.iss))throw new A('unexpected "iss" claim value',"iss","check_failed");if(a&&i.sub!==a)throw new A('unexpected "sub" claim value',"sub","check_failed");if(c&&(u="string"==typeof c?[c]:c,!("string"==typeof(d=i.aud)?u.includes(d):Array.isArray(d)&&u.some(Set.prototype.has.bind(new Set(d))))))throw new A('unexpected "aud" claim value',"aud","check_failed");var d,u;let p;switch(typeof r.clockTolerance){case"string":p=J(r.clockTolerance);break;case"number":p=r.clockTolerance;break;case"undefined":p=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,f=(g=h||new Date,Math.floor(g.getTime()/1e3));var g;if((void 0!==i.iat||l)&&"number"!=typeof i.iat)throw new A('"iat" claim must be a number',"iat","invali
1d");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new A('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>f+p)throw new A('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new A('"exp" claim must be a number',"exp","invalid");if(i.exp<=f-p)throw new C('"exp" claim timestamp check failed',"exp","check_failed")}if(l){const e=f-i.iat;if(e-p>("number"==typeof l?l:J(l)))throw new C('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-p)throw new A('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};function Y(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Z)}function Z(e){return N(e)}class Q{constructor(e){if(this._cached=new WeakMap,!Y(e))throw new I("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:s}={...e,...null==t?void 0:t.header},i=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new S('Unsupported "alg" value for a JSON Web Key Set')}}(r),o=this._jwks.keys.filter(e=>{let t=i===e.kty;if(t&&"string"==typeof s&&(t=s===e.kid),t&&"string"==typeof e.alg&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t}),{0:n,length:a}=o;if(0===a)throw new P;if(1!==a){const e=new R,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const s of o)try{yield await X(t,s,r)}catch(e){continue}},e}return X(this._cached,n,r)}}async function X(e,t,r){const s=e.get(t)||e.set(t,{}).get(t);if(void 0===s[r]){const e=await async function(e,t,r){var s;if(!N(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?L({...e,alg:t,ext:null!==(s=e.ext)&&void 0!==s&&s}):_(e.k);case"RSA":if(void 0!==e.oth)throw new S('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return L({...e,alg:t});default:throw new S('Unsupported "kty" (Key Type) Parameter value')}}({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new I("JSON Web Key Set members must be public keys");s[r]=e}return s[r]}class ee extends Q{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(tt){if(tt instanceof P&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw tt}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let s,i,o=!1;"function"==typeof AbortController&&(s=new AbortController,i=setTimeout(()=>{o=!0,s.abort()},t));const n=await fetch(e.href,{signal:s?s.signal:void 0,redirect:"manual",headers:r.headers}).catch(e=>{if(o)throw new D;throw e});if(void 0!==i&&clearTimeout(i),200!==n.status)throw new b("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch(e){throw new b("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then(e=>{if(!Y(e))throw new I("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0}).catch(e=>{throw this._pendingFetch=void 0,e})),await this._pendingFetch}}class te{}const re=class extends te{constructor(e,t){super(),this.authority=e,this.clientID=t}fetchMetadata(){return globalThis.fetch(`${this.authority}/.well-known/openid-configuration?client_id=${this.clientID}`).then(e=>e.json()).then(e=>(Object.assign(this,e),this))}};class se{}const ie=class extends se{constructor(e,t){super(),this.authority=e,this.clientID=t}fetchMetadata(){return globalThis.fetch(`${this.authority}/.well-known/criipto-configuration?client_id=${this.clientID}`).then(e=>e.json()).then(e=>(Object.assign(this,e),this.client=this.clients.find(e=>e.client_id===this.clientID),this))}};class oe{constructor(e){this.criiptoAuth=e,this.store=this.criiptoAuth.store}authorize(e){var t,r,i,n,a;return r=this,i=void 0,a=function*(){const r=e.redirectUri||this.criiptoAuth.options.redirectUri,i=null!==(t=e.responseType)&&void 0!==t?t:"id_token",n=yield e.pkce?Promise.resolve(e.pkce):"id_token"===i?s():Promise.resolve(void 0);o(this.store,n&&"code_verifier"in n?{response_type:"id_token",redirect_uri:r,pkce_code_verifier:n.code_verifier}:{response_type:"code",redirect_uri:r});const a=yield this.criiptoAuth.buildAuthorizeUrl(this.criiptoAuth.buildAuthorizeParams(Object.assign(Object.assign({},e),{responseMode:"query",responseType:"code",pkce:n})));globalThis.location.href=a}
1,new((n=void 0)||(n=Promise))(function(e,t){function s(e){try{c(a.next(e))}catch(e){t(e)}}function o(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(s,o)}c((a=a.apply(r,i||[])).next())})}match(){if(!("location"in globalThis))return Promise.resolve(null);const e=d(globalThis.location);if(!e.code&&!e.error&&!e.id_token)return Promise.resolve(null);if(e.error)return Promise.reject(new v(e.error,e.error_description,e.state));if(e.id_token)return Promise.resolve(e);const t=n(this.store);return t?this.criiptoAuth.processResponse(e,"id_token"===t.response_type?{code_verifier:t.pkce_code_verifier,redirect_uri:t.redirect_uri}:void 0).then(e=>(e&&a(this.store),e)).catch(e=>(a(this.store),Promise.reject(e))):Promise.reject(new Error("No redirect state available"))}hasMatch(){if(!("location"in globalThis))return!1;const e=d(globalThis.location);return!!(e.code||e.error||e.id_token)}}class ne{constructor(e){this.criiptoAuth=e,this.backdrop=new ue(this)}open(e,t){var r,s,i,o,n,a;let{width:c,height:l}=t;c=c||400,l=l||660;const d=null!==(r=window.screenLeft)&&void 0!==r?r:window.screenX,u=null!==(s=window.screenTop)&&void 0!==s?s:window.screenY,p=null!==(o=null!==(i=window.innerWidth)&&void 0!==i?i:document.documentElement.clientWidth)&&void 0!==o?o:screen.width,h=null!==(a=null!==(n=window.innerHeight)&&void 0!==n?n:document.documentElement.clientHeight)&&void 0!==a?a:screen.height,f=p/window.screen.availWidth,g=`width=${c},height=${l},top=${(h-l)/2/f+u},left=${(p-c)/2/f+d}`;return this.window=window.open(e,"CRIIPTO_POPUP_ID",g),!1!==t.backdrop&&(this._latestParams=t,this._latestUrl=e,this.backdrop.render(t)),this.window}listen(e){return new Promise((t,r)=>{this.checker&&clearTimeout(this.checker);const s=r=>!(!(r.code||r.error||r.id_token)||e.state&&e.state!==r.state||(window.removeEventListener("message",i),this.checker&&clearTimeout(this.checker),this.window.close(),t(r),0)),i=e=>{if((e.source===this.window||e.origin===`https://${this.criiptoAuth.domain}`)&&e.data&&"string"==typeof e.data)if((e.data.startsWith(p)?p:null)===p){const t=JSON.parse(e.data.replace(p,""));t&&(t.code||t.id_token||t.error)&&s(t)}else if(e.data.includes("code=")||e.data.includes("id_token=")||e.data.includes("error=")){const t=u(e.data);s(t)}},o=()=>{if(!this.checker)return;if(!e.redirectUri)return;const t=()=>this.checker=window.setTimeout(o,250);try{const r=new URL(e.redirectUri);if(this.window.location.href.replace(this.window.location.search,"")===r.href.replace(r.search,"")){const e=u(this.window.location.href);if(s(e))return}t()}catch(e){t()}};this.checker=window.setTimeout(o,250),window.addEventListener("message",i)}).finally(()=>{this.backdrop.remove()})}buildAuthorizeUrl(e){const t=this.criiptoAuth.buildAuthorizeParams(Object.assign(Object.assign({},e),{responseMode:"post_message"}));return this.criiptoAuth.buildAuthorizeUrl(t).then(e=>({url:e,params:t}))}trigger(e){return this.buildAuthorizeUrl(e).then(({url:t,params:r})=>(this.open(t,e),this.listen(e).then(e=>this.criiptoAuth.processResponse(e,r.pkce&&"code_verifier"in r.pkce?{code_verifier:r.pkce.code_verifier,redirect_uri:r.redirectUri}:void 0).then(e=>e)))).finally(()=>{!1!==e.backdrop&&this.backdrop.remove()})}authorize(e){var t,r,i,o,n;return r=this,i=void 0,n=function*(){const r=null!==(t=e.responseType)&&void 0!==t?t:"id_token",i=yield e.pkce?Promise.resolve(e.pkce):"id_token"===r?s():Promise.resolve(void 0);return this.trigger(Object.assign(Object.assign({},e),{responseType:"code",pkce:i}))},new((o=void 0)||(o=Promise))(function(e,t){function s(e){try{c(n.next(e))}catch(e){t(e)}}function a(e){try{c(n.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o(function(e){e(r)})).then(s,a)}c((n=n.apply(r,i||[])).next())})}close(){this.window.close()}callback(e){if(!e)throw new Error("popup.callback required argument origin");const t=d(window.location);window.opener.postMessage(p+JSON.stringify(t),e),window.close()}}const ae=`\n<div class="criipto-auth-popup-backdrop-background"></div>\n<div class="criipto-auth-popup-backdrop-content">\n <p>Don't see the login popup?</p>\n <button id="${f}">Reopen popup</button>\n <button id="${g}">Cancel</button>\n</div>\n`,ce=`\n<div class="criipto-auth-popup-backdrop-background"></div>\n<div class="criipto-auth-popup-backdrop-content">\n <p>Kan du ikke se pop-uppen?</p>\n <button id="${f}">Ã
ben popup</button>\n <button id="${g}">Fortryd</button>\n</div>\n`,le=`\n<div class="criipto-auth-popup-backdrop-background"></div>\n<div class="criipto-auth-popup-backdrop-content">\n <p>Ser du inte inloggningspopupen?</p>\n <button id="${f}">Ãppna popup igen</button>\n <button id="${g}">Avbryt</button>\n</div>\n`,de=`\n<div class="criipto-auth-popup-backdrop-background"></div>\n<div class="criipto-auth-popup-backdrop-content">\n <p>Ser du ikke popup-dialogboksen for pÃ¥logging?</p>\n <button id="${f}">Ã
pne popup på nytt</button>\n <button id="${g}">Avbryt</button>\n</div>\n`;class ue{constructor(e){this.template=null,this.popup=e,this.enabled=!0}render(e){var t,r,s;const i=document.getElementById(h),o=(null!==(t=this.template)&&void 0!==t?t:"da"==e.uiLocales)?ce:"se"==e.uiLocales||"sv"==e.uiLocales?le:"nb"==e.uiLocales?de:ae;if(!i){const e=document.createElement("div");
1e.id=h,e.className="criipto-auth-popup-backdrop",e.innerHTML=o,document.body.appendChild(e),null===(r=document.getElementById(f))||void 0===r||r.addEventListener("click",()=>this.handleOpen()),null===(s=document.getElementById(g))||void 0===s||s.addEventListener("click",()=>this.handleCancel())}}handleOpen(){this.popup.open(this.popup._latestUrl,this.popup._latestParams)}handleCancel(){this.remove(),this.popup.close()}remove(){const e=document.getElementById(h);e&&document.body.removeChild(e)}}var pe=tt(592),he=function(e,t,r,s){return new(r||(r=Promise))(function(i,o){function n(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(n,a)}c((s=s.apply(e,t||[])).next())})};class fe{constructor(e){if(this.URL=e,!e.includes("{id}"))throw new Error("Expected URL to include {id} template arg.")}get(e){return he(this,void 0,void 0,function*(){const t=this.URL.replace("{id}",e),r=yield fetch(t);if(r.ok)return yield r.json();if(404===r.status)return null;const s=yield r.text();throw new Error(s)})}save(e,t){return he(this,void 0,void 0,function*(){const r=this.URL.replace("{id}",e),s=yield fetch(r,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}});if(s.ok)return;const i=yield s.text();throw new Error(i)})}delete(e){return he(this,void 0,void 0,function*(){const t=this.URL.replace("{id}",e),r=yield fetch(t,{method:"DELETE"});if(r.ok)return;const s=yield r.text();throw new Error(s)})}}var ge=function(e,t,r,s){return new(r||(r=Promise))(function(i,o){function n(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(n,a)}c((s=s.apply(e,t||[])).next())})};function ve(e){return"ACK"===e.type}function me(e){return"CANCEL"===e.type}function ye(e){return"OAUTH2_CODE"===e.type}function we(e){return"OAUTH2_ERROR"===e.type}function ke(e,t,r,s){return ge(this,void 0,void 0,function*(){const i=new TextEncoder,o=yield globalThis.crypto.subtle.encrypt({name:"RSA-OAEP"},t,i.encode(JSON.stringify(s))),n={type:"DM",recipientClientId:r,message:Se(o)};e.send(JSON.stringify(n))})}function _e(e,t,r){return s=>ge(this,void 0,void 0,function*(){return ke(e,t,r,s)})}function be(e){let t=e.toString(16);return 1==t.length?`0${t}`:t}function Ae(){if(void 0===crypto.randomUUID){const e=new Uint8Array(16);return window.crypto.getRandomValues(e),Array.from(e,be).join("")}return crypto.randomUUID().replace(/-/g,"")}function Ce(){return Ae()}function Ee(){return ge(this,void 0,void 0,function*(){const e={name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-512"},t=yield crypto.subtle.generateKey(e,!0,["encrypt","decrypt"]);return{algorithm:"RSA-OAEP",privateKey:t.privateKey,publicKey:t.publicKey}})}function Se(e){let t="",r=new Uint8Array(e),s=r.byteLength;for(let i=0;i<s;i++)t+=String.fromCharCode(r[i]);return window.btoa(t)}function Te(e){const t=window.atob(e),r=new ArrayBuffer(t.length),s=new Uint8Array(r);for(let i=0,o=t.length;i<o;i++)s[i]=t.charCodeAt(i);return r}function xe(e){return ge(this,void 0,void 0,function*(){return Se(yield crypto.subtle.exportKey("spki",e.publicKey))})}function Ie(e,t){return ge(this,void 0,void 0,function*(){const r=Te(e);return yield crypto.subtle.importKey("spki",r,{name:t,hash:"SHA-512"},!1,["encrypt"])})}var Pe,Re,De,Me,Oe,$e,Le,Ne,Ue,Ve,Be=function(e,t,r,s){return new(r||(r=Promise))(function(i,o){function n(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(n,a)}c((s=s.apply(e,t||[])).next())})},Ke=function(e,t,r,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,r):i?i.value=r:t.set(e,r),r},He=function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");
1return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)};const ze=Math.floor(12);class Fe extends Error{constructor(){super("Promise cancelled"),Object.setPrototypeOf(this,Fe.prototype)}}class We extends v{constructor(e,t,r){super(e,t,r)}}class je extends Error{constructor(e){super(e),Object.setPrototypeOf(this,je.prototype)}}class Je extends Promise{constructor(e){let t,r;super((s,i)=>{e(s,i),t=s,r=i}),this.cancelled=!1,this.acknowledged=!1,Pe.set(this,void 0),Re.set(this,void 0),Ke(this,Pe,r,"f")}cancel(){this.cancelled=!0,He(this,Pe,"f").call(this,new Fe),this.onCancel&&this.onCancel()}acknowledge(){this.acknowledged=!0,this.onAcknowledged&&this.onAcknowledged()}}Pe=new WeakMap,Re=new WeakMap;class qe{constructor(e){De.add(this),Me.set(this,void 0),Oe.set(this,void 0),$e.set(this,void 0),Le.set(this,void 0),Ne.set(this,void 0),this.criiptoAuth=e}setup(){return Be(this,void 0,void 0,function*(){return He(this,Le,"f")||Ke(this,Le,Promise.resolve().then(()=>Be(this,void 0,void 0,function*(){Ke(this,Ne,new Image,"f"),He(this,Ne,"f").src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAABoCAYAAAAdHLWhAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEqSURBVHgB7d2rDQIBEEXRgYCkDwT9YZAICsTQBpqETxPs3eQcMQ3cPD0zpG1+5/01JG2HNIHiBIoTKE6gOIHiBIoTKE6gOIHiBIoTKE6gOIHiBIoTKE6gOIHiBIoTKE6gOIHiBIoTKE6gOIHiBIoTKE6gOIHiBIoTKE6gOIHiBIoTKE6gOIHiBIrbzUJul+c87q9Zk+NpP+frYf7JguIEihMoTqA4geIEihMoTqA4geIEihMoTqA4geIEihMoTqA4geIEihMoTqA4geIEihMozv+gOAuKEyhOoDiB4gSKEyhOoDiB4gSKEyhOoDiB4gSKEyhOoDiB4gSKEyhOoDiB4gSKEyhOoDiB4gSKEyhOoDiB4gSKEyhOoDiB4gSKEyhOoDiB4gSKEyjuA1QSDsex8ZN1AAAAAElFTkSuQmCC",Ke(this,Me,Ae(),"f");const e=yield this.criiptoAuth.fetchCriiptoConfiguration();return Ke(this,Oe,new fe(e.csdc_session_url),"f"),Ke(this,$e,new WebSocket(`${e.csdc_wss_url}?clientId=${He(this,Me,"f")}`),"f"),yield new Promise((e,t)=>{He(this,$e,"f").addEventListener("open",e)}),e})),"f"),yield He(this,Le,"f")})}authorize(e,t){const r=new Je((i,o)=>Be(this,void 0,void 0,function*(){var n,a;const c=He(this,De,"m",Ue).call(this,e),l=null!==(n=null==t?void 0:t.responseType)&&void 0!==n?n:"id_token";let d,u=null,p=[];const h=()=>{d&&clearInterval(d),c.parentElement===e&&e.removeChild(c)};try{const e=yield this.setup();if(!e.client.qr_enabled)throw new je("QR is not enabled for this Criipto Application. Please go to https://dashboard.criipto.com and enable it.");const n=null!==(a=e.client.qr_intermediary_url)&&void 0!==a?a:e.qr_intermediary_url,f=n.replace("{id}",""),g=!1!==e.client.qr_branding,m=yield(null==t?void 0:t.pkce)?Promise.resolve(t.pkce):"id_token"===l?s():Promise.resolve(void 0),y=null==t?void 0:t.state,w=yield this.criiptoAuth.buildAuthorizeUrl(this.criiptoAuth.buildAuthorizeParams(Object.assign(Object.assign({},t),{pkce:m,redirectUri:f,responseMode:"query",responseType:"code",prompt:"login"}))),k=()=>Be(this,void 0,void 0,function*(){var e;if(r.acknowledged)return void(d&&clearInterval(d));if(r.cancelled)return void h();const s=yield He(this,De,"m",Ve).call(this,{action:{authorize:w}});p=[s].concat(p).slice(0,ze);const i=n.replace("{id}",s.id),o=yield pe.toCanvas(i,{errorCorrectionLevel:"low",scale:10,width:c.width,margin:null!==(e=null==t?void 0:t.margin)&&void 0!==e?e:4}),a=.15*c.width,l=.15*c.height,u=c.getContext("2d");u.drawImage(o,0,0),g&&(u.imageSmoothingEnabled=!1,u.drawImage(He(this,Ne,"f"),(c.width-a)/2,(c.width-l)/2,a,l))});yield k(),d=setInterval(()=>{k()},2500);const _=e=>Be(this,void 0,void 0,function*(){var t;if(!r.cancelled)if(r.acknowledged){if(u){const r=yield globalThis.crypto.subtle.decrypt({name:u.keyPair.algorithm},u.keyPair.privateKey,Te(e.data)).catch(e=>null);if(!r)return;const s=JSON.parse(atob(Se(r)));ye(s)?(h(),yield this.criiptoAuth.processResponse({code:s.code,state:y},m&&"code_verifier"in m?{redirect_uri:f,code_verifier:m.code_verifier}:void 0).then(e=>{i(e),He(this,$e,"f").removeEventListener("message",_)}).catch(e=>{o(e),He(this,$e,"f").removeEventListener("message",_)})):me(s)?(o(new We("access_denied","User cancelled login.",y)),h()):we(s)&&(o(new v(s.error,null!==(t=s.error_description)&&void 0!==t?t:void 0,y)),He(this,$e,"f").removeEventListener("message",_),h())}}else for(const s of p){const t=yield globalThis.crypto.subtle.decrypt({
1name:s.keyPair.algorithm},s.keyPair.privateKey,Te(e.data)).catch(e=>null);t&&ve(JSON.parse(atob(Se(t))))&&(p=[s],u=s,r.acknowledge())}});He(this,$e,"f").addEventListener("message",_),r.onCancel=()=>{He(this,$e,"f").removeEventListener("message",_),h()}}catch(e){h(),o(e)}}));return r}}Me=new WeakMap,Oe=new WeakMap,$e=new WeakMap,Le=new WeakMap,Ne=new WeakMap,De=new WeakSet,Ue=function(e){const t=getComputedStyle(e),r=document.createElement("canvas");r.setAttribute("data-criipto-id","criiptoqrcanvas"),r.width=e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight),r.height=r.width;const s=e.querySelector('[data-criipto-id="criiptoqrcanvas"]');return s&&e.removeChild(s),e.appendChild(r),r},Ve=function(e){return Be(this,void 0,void 0,function*(){const t=yield this.setup(),r=Ce(),s=yield Ee(),i=yield xe(s);return yield He(this,Oe,"f").save(r,Object.assign({csdc_algo:"RSA-OAEP",csdc_initiator_id:He(this,Me,"f"),csdc_wss:t.csdc_wss_url,csdc_key:i},e)),{id:r,keyPair:s}})};class Ge{constructor(e){this.criiptoAuth=e}open(e){const t=document.createElement("iframe");return t.style.width="0px",t.style.height="0px",t.style.visibility="hidden",t.src=e,document.body.appendChild(t),t}remove(e){(null==e?void 0:e.parentNode)===document.body&&document.body.removeChild(e)}listen(e){return new Promise((t,r)=>{const s=r=>{(r.source===e.contentWindow||r.origin===`https://${this.criiptoAuth.domain}`)&&r.data&&(r.data.includes("code=")||r.data.includes("id_token=")||r.data.includes("error="))&&(window.removeEventListener("message",s),this.remove(e),t(u(r.data)))};window.addEventListener("message",s)})}authorize(e){var t,r,i,o,n;return r=this,i=void 0,n=function*(){const r=e.redirectUri||this.criiptoAuth.options.redirectUri,i=null!==(t=e.responseType)&&void 0!==t?t:"id_token",o=yield"id_token"===i?s():Promise.resolve(void 0),n=yield this.criiptoAuth.buildAuthorizeUrl(this.criiptoAuth.buildAuthorizeParams(Object.assign(Object.assign({},e),{responseMode:"post_message",responseType:"code",pkce:o,prompt:"none"}))),a=e.timeout||1e4,c=this.open(n);return Promise.race([new Promise((e,t)=>{setTimeout(()=>{t("Timed out")},a)}),this.listen(c).then(e=>this.criiptoAuth.processResponse(e,o&&"code_verifier"in o?{code_verifier:o.code_verifier,redirect_uri:r}:void 0).then(e=>e))]).finally(()=>this.remove(c))},new((o=void 0)||(o=Promise))(function(e,t){function s(e){try{c(n.next(e))}catch(e){t(e)}}function a(e){try{c(n.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o(function(e){e(r)})).then(s,a)}c((n=n.apply(r,i||[])).next())})}}var Ye,Ze,Qe,Xe,et=function(e,t,r,s){return new(r||(r=Promise))(function(i,o){function n(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(n,a)}c((s=s.apply(e,t||[])).next())})},st=function(e,t,r,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,r):i?i.value=r:t.set(e,r),r},it=function(e,t,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(e):s?s.value:t.get(e)};const ot="3.7.2";class nt{constructor(e){var t;if(Ye.set(this,void 0),Ze.set(this,void 0),Qe.set(this,void 0),Xe.set(this,void 0),!e.domain||!e.clientID||!e.store)throw new Error("new criipto.Auth({domain, clientID, store}) required");this.options=e,this.domain=e.domain,this.clientID=e.clientID,this.store=e.store,this.popup=new ne(this),this.redirect=new oe(this),this.qr=new qe(this),this.silent=new Ge(this);const r=null!==(t=e.protocol)&&void 0!==t?t:"https";this._openIdConfiguration=new re(`${r}://${this.domain}`,this.clientID),st(this,Qe,new ie(`${r}://${this.domain}`,this.clientID),"f")}_setup(){return it(this,Ye,"f")||st(this,Ye,this._openIdConfiguration.fetchMetadata().then(e=>(st(this,Xe,function(e){const t=new ee(e,void 0);return async function(e,r){return t.getKey(e,r)}}(new URL(e.jwks_uri)),"f"),e)),"f"),it(this,Ye,"f")}fetchOpenIDConfiguration(){return this._setup().then(()=>this._openIdConfiguration)}fetchCriiptoConfiguration(){return it(this,Ze,"f")||st(this,Ze,it(this,Qe,"f").fetchMetadata(),"f"),it(this,Ze,"f")}logout(e){return et(this,void 0,void 0,function*(){const{redirectUri:t,state:r}=e,s=yield this.fetchOpenIDConfiguration(),i=new URL(s.end_session_endpoint);i.searchParams.set("post_logout_redirect_uri",t),r&&i.searchParams.set("state",r),window.location.href=i.href})}authorize(e){return this.redirect.authorize(e)}checkSession(e){return et(this,void 0,void 0,function*(){return this.silent.authorize(e)})}authorizeResponsive(e){let r;for(let[o,n]of Object.entries(e)){if(!t.includes(n.via))throw new Error("Unknown match.via");if(window.matchMedia(o).matches){r=n;break}}if(void 0===r)throw new Error("No media queries matched");const{via:s}=r,i=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(r[s[i]]=e[s[i]])}return r}(r,["via"]);if("redirect"===s)return this.redirect.authorize(i);if("popup"===s)return this.popup.authorize(i);throw new Error("Invalid media query")}buildAuthorizeUrl(e){return this._setup().then(()=>{var t,r,s;const i=this._openIdConfiguration.response_modes_supported.concat(["json","post_message"]);if(!i.includes(e.responseMode))throw new Error(`responseMode must be one of ${i.join(",")}`);
1if(!this._openIdConfiguration.response_types_supported.includes(e.responseType))throw new Error(`responseType must be one of ${this._openIdConfiguration.response_types_supported.join(",")}`);const o=e.acrValues?Array.isArray(e.acrValues)?e.acrValues:e.acrValues.includes(" ")?e.acrValues.split(" "):e.acrValues:void 0;if(!e.redirectUri)throw new Error("redirectUri must be defined");const n=new URL(this._openIdConfiguration.authorization_endpoint);if(n.searchParams.append("scope",e.scope),n.searchParams.append("client_id",this.clientID),o&&n.searchParams.append("acr_values",Array.isArray(o)?o.join(" "):o),n.searchParams.append("redirect_uri",e.redirectUri),n.searchParams.append("response_type",e.responseType),n.searchParams.append("response_mode",e.responseMode),e.pkce&&(n.searchParams.append("code_challenge",e.pkce.code_challenge),n.searchParams.append("code_challenge_method",e.pkce.code_challenge_method)),e.state&&n.searchParams.append("state",e.state),e.nonce&&n.searchParams.append("nonce",e.nonce),e.loginHint&&n.searchParams.append("login_hint",e.loginHint),e.uiLocales&&n.searchParams.append("ui_locales",e.uiLocales),e.prompt&&n.searchParams.append("prompt",e.prompt),e.extraUrlParams)for(let a of Object.entries(e.extraUrlParams))a[1]&&n.searchParams.append(a[0],a[1]);return n.searchParams.set("criipto_sdk",`@criipto/auth-js@${ot}`),void 0!==(null===(t=e.extraUrlParams)||void 0===t?void 0:t.criipto_sdk)&&(null===(null===(r=e.extraUrlParams)||void 0===r?void 0:r.criipto_sdk)?n.searchParams.delete("criipto_sdk"):n.searchParams.set("criipto_sdk",null===(s=e.extraUrlParams)||void 0===s?void 0:s.criipto_sdk)),n.toString()})}processResponse(e,t){if(e.error)return Promise.reject(new v(e.error,e.error_description,e.state));if(e.id_token)return Promise.resolve(e);if(!e.code)return Promise.resolve(null);if(e.code&&!t)return Promise.resolve(e);const r=e.state,s=new URLSearchParams;return s.append("grant_type","authorization_code"),s.append("code",e.code),s.append("client_id",this.clientID),s.append("redirect_uri",t.redirect_uri),s.append("code_verifier",t.code_verifier),this._setup().then(()=>globalThis.fetch(this._openIdConfiguration.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},credentials:"omit",body:s.toString()}).then(e=>e.json()).then(e=>e.id_token?async function(e,t,r){var s;const i=await W(e,t,r);if((null===(s=i.protectedHeader.crit)||void 0===s?void 0:s.includes("b64"))&&!1===i.protectedHeader.b64)throw new x("JWTs MUST NOT use unencoded payload");const o={payload:G(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}(e.id_token,it(this,Xe,"f"),{issuer:this._openIdConfiguration.issuer,audience:this.clientID,clockTolerance:300}).then(({payload:t})=>Object.assign(Object.assign({},e),{state:r,claims:t})):Object.assign(Object.assign({},e),{state:r})))}buildAuthorizeParams(e){const t=e.redirectUri||this.options.redirectUri,r=e.responseType||this.options.responseType||"code",s=e.acrValues||this.options.acrValues,i=e.scope||this.options.scope||"openid";if(!t)throw new Error("redirectUri must be defined");return{redirectUri:t,responseMode:e.responseMode||"query",responseType:r,acrValues:s,pkce:e.pkce,state:e.state,loginHint:e.loginHint,uiLocales:e.uiLocales,extraUrlParams:e.extraUrlParams,scope:i,prompt:e.prompt,nonce:e.nonce}}}Ye=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,Xe=new WeakMap;const at=nt})();rt.uJ,rt.bU,rt.Lk,rt.Ul,rt.PK,rt.hs,rt.TU,rt.q4,rt.Op;var st=rt.ZP;rt.nN,rt.um,rt.zi,rt.gM,rt.NT;let it=class extends n.lD{constructor(){super(...arguments),this.renderKey=String((new Date).getTime()),this.processing=!1,this.criiptoAuth=null,this.responseError=""}get translationsReady(){return!0===this.$root.$data.translationsLoaded}get ageVerificationRequired(){return l.A.AGE_VERIFICATION_REQUIRED}get ageVerification(){return l.A.AGE_VERIFICATION}get ageVerificationTermsAccepted(){return l.A.AGE_VERIFICATION_TERMS_ACCEPTED}set ageVerificationTermsAccepted(e){l.A.SET_AGE_VERIFICATION_TERMS_ACCEPTED(e)}get enabled(){return this.ageVerificationRequired&&!!Ve.Z.VARIABLES.criiptoDomain&&!!Ve.Z.VARIABLES.criiptoClientId}get isChecked(){return!!this.ageVerification?.country&&!!this.ageVerification?.auditid}async criiptoVerifyAge(){this.processing=!0;try{await this.criiptoAuth.redirect.authorize({redirectUri:`${window.location.protocol}//${window.location.host}${window.location.pathname}?callback=ageverification`,acrValues:"urn:age-verification",loginHint:"country:DK",scope:"openid is_over_18",responseType:"id_token"})}catch(e){this.responseError=e.toString(),console.log("Error:",e)}this.processing=!1}async ageVerificationCallback(){try{const e=new URLSearchParams(window.location.search);
1if(e.has("callback")&&"ageverification"===e.get("callback")&&!this.isChecked){const e=await this.criiptoAuth.redirect.match();e&&await l.A.UPDATE_AGE_VERIFICATION(e)}else e.has("error")&&(this.responseError=e.get("error"))}catch(e){this.responseError=e.toString(),console.log("Error:",e)}}async created(){await l.A.GET_AGE_VERIFICATION_REQUIRED(),await l.A.GET_AGE_VERIFICATION(),this.enabled&&(this.criiptoAuth=new st({domain:Ve.Z.VARIABLES.criiptoDomain,clientID:Ve.Z.VARIABLES.criiptoClientId,store:sessionStorage})),await this.ageVerificationCallback()}};it=(0,o.Cg)([(0,n.uA)({name:"AgeVerificationSection"})],it);const ot=it,nt=ot;r(72260);var at=(0,_.A)(nt,Ze,Qe,!1,null,null,null);const ct=at.exports;var lt=r(3540);const dt=new Ge.A,ut=new Ye.A;let pt=class extends n.lD{constructor(){super(...arguments),this.termsAccepted=!1,this.renderKey=String((new Date).getTime()),this.orderProcessing=!1,this.verifyToken=null}get translationsReady(){return!0===this.$root.$data.translationsLoaded}get process(){return l.A.PROCESS}get terms(){return l.A.TERMS}get isLoading(){return qe.A.IS_LOADING||this.orderProcessing||this.awaitingToken}get canContinue(){return!!this.termsAccepted&&(!!l.A.ADDRESS_IS_VALID&&(!!l.A.DELIVERY_IS_VALID&&(!!l.A.PAYMENT_IS_VALID&&!!l.A.AGE_VERIFICATION_IS_VALID)))}get payment(){return l.A.PAYMENT}get paymentType(){return this.payment?.paymenttype??""}get paymentTypes(){return l.A.PAYMENT_TYPES}get selectedPaymentType(){return this.paymentTypes?.find(e=>e.id===this.paymentType)}get usePaymentGateway(){return this.selectedPaymentType?.gateway?.length>0}get turnstileSiteKey(){return Ve.Z.VARIABLES.turnstileSiteKey}get awaitingToken(){return this.turnstileSiteKey?.length&&!this.verifyToken?.length}onVerify(e){this.verifyToken=e}async processOrder(){const e=await this.validate();if(!e)return this.scrollToFirstWarning(),!1;if(!this.canContinue)return l.A.ADDRESS_IS_VALID||alert(this.$t("checkout.alert-invalid-address",["Invalid address. Please contact customer service."])),l.A.DELIVERY_IS_VALID||alert(this.$t("checkout.alert-invalid-delivery",["Invalid delivery selection. Please contact customer service."])),l.A.PAYMENT_IS_VALID||alert(this.$t("checkout.alert-invalid-payment",["Invalid payment selection. Please contact customer service."])),l.A.AGE_VERIFICATION_IS_VALID||alert(this.$t("checkout.alert-invalid-age-verification",["Invalid age verification. Please contact customer service."])),this.scrollToFirstWarning(),!1;if(await ut.trackCheckout(),this.orderProcessing=!0,await l.A.PROCESS_ORDER(this.verifyToken),this.process.isverified&&this.process.isreadyforpayment&&this.process.continueurl.length){if(l.A.SUBSCRIBED_TO_NEWSLETTER){const e=l.A.ADDRESS;await dt.subscribe({name:e.name,email:e.email,checkoutsubscription:!0})}window.location.href=this.process.continueurl}else this.process.isverified||(this.orderProcessing=!1)}scrollToFirstWarning(){const e=document.querySelector(".checkout-section .errors");e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}async created(){l.A.GET_TERMS(),window.addEventListener("visibilitychange",()=>{this.orderProcessing=!1,this.renderKey=String((new Date).getTime())})}};(0,o.Cg)([(0,n.kv)({required:!0,default:null})],pt.prototype,"validate",void 0),(0,o.Cg)([(0,h.S)(500)],pt.prototype,"processOrder",null),pt=(0,o.Cg)([(0,n.uA)({name:"checkoutActions",components:{CloudflareTurnstile:lt.A,AgeVerificationSection:ct}})],pt);const ht=pt,ft=ht;r(60080);var gt=(0,_.A)(ft,je,Je,!1,null,null,null);const vt=gt.exports;let mt=class extends n.lD{get cart(){return W.A.CART}get hasCartItems(){return this.cart?.itemcount>0}get translationsReady(){return!0===this.$root.$data.translationsLoaded}};mt=(0,o.Cg)([(0,n.uA)({name:"checkout",components:{CheckoutAddress:H,CheckoutDelivery:we,CheckoutPayment:Te,CheckoutCartPreview:We,CheckoutActions:vt}})],mt);const yt=mt,wt=yt;r(83234);var kt=(0,_.A)(wt,s,i,!1,null,null,null);const _t=kt.exports},69760(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,"",""]);const c=a},71776(e,t,r){var s=r(49026);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("66b82592",s,!0,{sourceMap:!1,shadowMode:!1})},71928(e,t,r){var s=r(24746);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("4fa7ece3",s,!0,{sourceMap:!1,shadowMode:!1})},72260(e,t,r){var s=r(86166);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("b3cb9f60",s,!0,{sourceMap:!1,shadowMode:!1})},81595(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());
1a.push([e.id,".checkout-cart-preview .add-voucher-to-cart{margin-bottom:0!important;float:right;font-size:.875rem;line-height:32px;padding:0 15px}@media(max-width:960px){.checkout-cart-preview .add-voucher-to-cart{float:none;margin:10px 0;padding:0}}.checkout-cart-preview .add-voucher-to-cart svg{height:1rem}.checkout-cart-preview .add-voucher-to-cart .uk-text-danger{padding:0}.checkout-cart-preview-content{clear:both}.checkout-cart-preview .cart-fees{margin-bottom:1rem;font-size:.85rem}.checkout-cart-preview .cart-fees .cart-fee-item{padding:.5rem 0;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.checkout-cart-preview .cart-fees .cart-fee-item+.cart-fee-item{border-top:1px solid hsla(var(--black-color-hue),var(--black-color-saturation),calc(var(--black-color-lightness) + 90%),100%)}",""]);const c=a},83234(e,t,r){var s=r(69760);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("a0e995e2",s,!0,{sourceMap:!1,shadowMode:!1})},85001(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,"",""]);const c=a},85079(e,t,r){"use strict";r.d(t,{A:()=>h});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.visible?t("div",{staticClass:"free-gift-line",class:{"has-button":e.isRemovable,compact:e.compact}},[t("span",{attrs:{"uk-icon":"icon: fal-gift; ratio: 0.8"}}),e._v(" "+e._s(e.$t("checkout.free-gift-achieved-header",["Free gift!"]))+" "+e._s(e.gift.name)+" "),e.isRemovable?t("button",{staticClass:"uk-button uk-button-default uk-button-small btn-remove",attrs:{type:"button"},on:{click:e.removeGift}},[e._v(" "+e._s(e.buttonText)+" ")]):e._e()]):e._e()},i=[],o=r(15215),n=r(71886),a=r(78581);let c=class extends n.lD{get currentFreeGift(){return a.A.CART_CURRENT_FREE_GIFT}get gift(){return this.currentFreeGift?.products?.find(e=>e.productid===this.giftFee?.productid)}get isRemovable(){return!this.compact&&(this.currentFreeGift.removable||this.currentFreeGift.products.length>1)}get giftFee(){return a.A.CART?.fees?.find(e=>e.isfreegift)}get buttonText(){return this.currentFreeGift.removable?String(String(this.$t("checkout.free-gift-remove",["Remove gift"]))):String(String(this.$t("checkout.free-gift-choose-another",["Choose another gift"])))}get visible(){return this.gift&&!a.A.RESELECT_CART_CURRENT_FREE_GIFT_GIFT}async removeGift(){this.currentFreeGift.removable?(await a.A.REMOVE_CART_CURRENT_FREE_GIFT(),a.A.GET_CART()):a.A.SET_RESELECT_CART_CURRENT_FREE_GIFT(!0)}};(0,o.Cg)([(0,n.kv)({type:Boolean,required:!1,default:!1})],c.prototype,"compact",void 0),c=(0,o.Cg)([n.uA],c);const l=c,d=l;r(96939);var u=r(81656),p=(0,u.A)(d,s,i,!1,null,null,null);const h=p.exports},85683(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,".package-shop-modal .package-shop .package-shop-search{margin-bottom:15px}.package-shop-modal .package-shop .package-shop-results{border:1px solid #0000001a;box-shadow:2px 2px 0 #0000000f;border-radius:0;overflow:hidden;display:flex;flex-direction:row}.package-shop-modal .package-shop .package-shop-results .shop-list{outline:none;flex-basis:100%;max-height:400px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#0003 #0000001a}.package-shop-modal .package-shop .package-shop-results .shop-list::-webkit-scrollbar{width:6px;height:6px}.package-shop-modal .package-shop .package-shop-results .shop-list::-webkit-scrollbar-track{background:#0000001a}.package-shop-modal .package-shop .package-shop-results .shop-list::-webkit-scrollbar-thumb{background-color:#0003}.package-shop-modal .package-shop .package-shop-results .shop-map{flex:1;background:#f2f2f2}.package-shop-modal.has-map .package-shop .package-shop-results .shop-list{flex-basis:40%}",""]);const c=a},86166(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());a.push([e.id,".age-verification-section button{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.age-verification-section button,.age-verification-section button:active,.age-verification-section button:disabled,.age-verification-section button:hover{background-color:#0060e6;color:#fff}.age-verification-section button svg{width:60px}.age-verification-section button .uk-spinner{width:1.25rem;padding-left:.5rem;margin-right:-.25rem}.age-verification-section .age-verification-checkout-banner{max-width:280px;max-height:280px}",""]);const c=a},96939(e,t,r){var s=r(99593);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var i=r(99548).A;i("189cb68f",s,!0,{sourceMap:!1,shadowMode:!1})},99499(e,t,r){"use strict";var s=r(62893);s="default"in s?s["default"]:s;var i="2.2.2",o=/^2\./.test(s.version);o||s.util.warn("VueClickaway "+i+" only supports Vue 2.x, and does not support Vue "+s.version);var n="_vue_clickaway_handler";function a(e,t,r){c(e);var s=r.context,i=t.value;if("function"===typeof i){var o=!1;setTimeout(function(){o=!0},0),e[n]=function(t){var r=t.path||(t.composedPath?t.composedPath():void 0);if(o&&(r?r.indexOf(e)<0:!e.contains(t.target)))return i.call(s,t)},document.documentElement.addEventListener("click",e[n],!1)}}function c(e){document.documentElement.removeEventListener("click",e[n],!1),delete e[n]}var l={bind:a,update:function(e,t){t.value!==t.oldValue&&a(e,t)},unbind:c},d={directives:{onClickaway:l}};t.co=d},99593(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(31601),i=r.n(s),o=r(76314),n=r.n(o),a=n()(i());
1a.push([e.id,".free-gift-line{display:flex;flex-direction:row;align-items:center;gap:5px;padding:0 0 15px;font-weight:700;color:var(--primary-color)}.free-gift-line:not(.compact){margin-top:15px;padding-top:15px;border-top:1px solid hsla(var(--black-color-hue),var(--black-color-saturation),var(--black-lighten-90),1)}.free-gift-line.has-button{padding-bottom:10px}.free-gift-line .btn-remove{color:hsla(var(--black-color-hue),var(--black-color-saturation),var(--black-lighten-20),1);font-weight:400;margin-left:auto}",""]);const c=a}}]); 2//# sourceMappingURL=564.js.map?id=99ad37381e338246
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.