https://www.offgridtec.com/theme/7a3143e84cf170a520868b6b5ceb8e54/…/tonur-packstation6.js?1790235785
1(()=>{"use strict";var t={857:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function o(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function r(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||o,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=s;var c,d,h=Array.isArray(i);return h!==Array.isArray(t)?s(i,l):h?l.arrayMerge(t,i,l):(d={},(c=l).isMergeableObject(t)&&n(t).forEach(function(e){d[e]=s(t[e],c)}),n(i).forEach(function(e){(!r(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(r(t,e)&&c.isMergeableObject(i[e])?d[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,c)(t[e],i[e],c):d[e]=s(i[e],c))}),d)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a}},e={};function i(s){var o=e[s];if(void 0!==o)return o.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}(()=>{i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e}})(),(()=>{i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})}})(),(()=>{i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})(),(()=>{class t{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,o=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(o[0],n),this.listeners.push({splitEventName:o,opts:i,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class e{isPackstation(t){return"P"===t.data_type}isPostoffice(t){return"F"===t.data_type}prepareLocations(t){let e=[];return t.forEach(t=>{var i;if(null===t.location.keyword||""===t.location.keyword||null===t.location.keywordId||""===t.location.keywordId)return;let s=null;switch(t.location.type){case"postoffice":case"postbank":case"servicepoint":s="F";break;case"locker":s="P"}if(null===s)return;let o="".concat(t.location.keyword," ").concat(t.location.keywordId).trim(),n={Monday:"http://schema.org/Monday",Tuesday:"http://schema.org/Tuesday",Wednesday:"http://schema.org/Wednesday",Thursday:"http://schema.org/Thursday",Friday:"http://schema.org/Friday",Saturday:"http://schema.org/Saturday",Sunday:"http://schema.org/Sunday"}[new Date().toLocaleString("en-US",{weekday:"long"})],r=t.openingHours.find(t=>t.dayOfWeek===n),a=null;void 0!==r&&(a="".concat(this.snippets.today,": ").concat(r.opens.slice(0,-3)," - ").concat(r.closes.slice(0,-3)," ").concat(this.snippets.time));let l=((i=t.location)===null||void 0===i?void 0:i.leanLocker)===!0,c="\n ".concat(t.name&&""!==t.name?"".concat(t.name,"<br/>"):"","\n ").concat(t.place.address.streetAddress,"<br/>\n ").concat(t.place.address.postalCode," ").concat(t.place.address.addressLocality,"\n ").concat(a?"<br/>".concat(a):"","\n ").concat(l?"<br/><strong>".concat(this.snippets.appRequired,"</strong>"):"").trim();e.push({location:t.place.geo,title:o,description:c,requireApp:l,data_type:s,data_number:t.location.keywordId,data_address:t.place.address})}),e}
1constructor(){if(void 0===this.loadMap)throw TypeError("Must override method loadMap");if(void 0===this.addLocations)throw TypeError("Must override method addLocations");if(void 0===this.clearMap)throw TypeError("Must override method clearMap")}}class s{static addToHead(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((s,o)=>{let n=document.getElementsByTagName("head")[0],r=this.findExistingTag(t,e);if(r){this.waitForTag(r,t,i).then(s).catch(()=>{r.remove(),this.appendTag(n,t,e,i,s,o)});return}this.appendTag(n,t,e,i,s,o)})}static appendTag(t,e,i,s,o,n){let r=this.createTag(e,i);"script"===e&&(r.async=!0);let a=this.attachLoadHandlers(r,e,s,o,n);t.appendChild(r),"link"===e&&window.setTimeout(()=>{a(),o(r)},0)}static attachLoadHandlers(t,e,i,s,o){let n=null,r=()=>{n&&window.clearTimeout(n),t.removeEventListener("load",l),t.removeEventListener("error",c)},a=()=>{if("function"!=typeof i.isReady||i.isReady()){r(),s(t);return}this.waitUntilReady(i).then(()=>{r(),s(t)}).catch(t=>{r(),o(t)})},l=()=>a(),c=t=>{r(),o(t)};return t.addEventListener("load",l),t.addEventListener("error",c),"script"===e&&(n=window.setTimeout(()=>{a()},i.loadTimeout||5e3)),r}static waitForTag(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"function"==typeof i.isReady&&i.isReady()||"link"===e?Promise.resolve(t):this.waitUntilReady(i)}static waitUntilReady(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((e,i)=>{if("function"!=typeof t.isReady){e();return}let s=t.pollInterval||100,o=t.timeout||5e3,n=Date.now(),r=()=>{if(t.isReady()){e();return}if(Date.now()-n>=o){i(Error("Timed out while waiting for external asset readiness."));return}window.setTimeout(r,s)};r()})}static findExistingTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.src||e.href;if(!i)return null;let s=e.src?"src":"href",o=e.src?"data-cmp-src":"data-cmp-href",n=i.replace(/"/g,'\\"');return document.head.querySelector("".concat(t,"[").concat(s,'="').concat(n,'"], ').concat(t,"[").concat(o,'="').concat(n,'"]'))}static createTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=document.createElement(t);return Object.assign(i,e),i}}class o{static getRepertusBingMapsKey(){return"AtjO-nXY_oay1yzbIiQJ9YOMrp6BzvkSM32ufBieSJc6NgBX8Y0lmWdHoX2xWeXD"}static isTestModeKey(t){return t===o.getRepertusBingMapsKey()}static handle(t){t===this.getRepertusBingMapsKey()?this.showOverlay():this.hideOverlay()}static showOverlay(){document.getElementById("packstationTestMode").classList.remove("is--hidden")}static hideOverlay(){document.getElementById("packstationTestMode").classList.add("is--hidden")}}class n extends e{loadMap(){return this.isReady()?Promise.resolve(this.initMap()):new Promise((t,e)=>{s.addToHead("script",{src:this.url,type:"text/javascript"},{isReady:()=>this.isReady()}).then(()=>{if(!this.initMap()){let i=setInterval(()=>{this.initMap()&&(clearInterval(i),t(!0))},700);window.setTimeout(()=>{clearInterval(i),e(Error("Timed out while initializing Bing Map."))},5e3);return}t(!0)}).catch(t=>{console.error("An error occurred while loading script: "+this.url),console.error(t),e(t)})})}isReady(){return!!(window.Microsoft&&window.Microsoft.Maps)}initMap(){try{return this.map=new window.Microsoft.Maps.Map(this.mapContainer,{credentials:this.mapApiKey,enableSearchLogo:!1,enableClickableLogo:!1,showDashboard:!1,showMapTypeSelector:!1,showScalebar:!1,zoom:13}),this.addPushPinLegend(),o.handle(this.mapApiKey),!0}catch(t){return console.error("An error occurred initialing Bing Map."),console.error(t),!1}}addLocations(t){let e=!0,i=new window.Microsoft.Maps.Infobox(new window.Microsoft.Maps.Location(0,0),{visible:!1,offset:new window.Microsoft.Maps.Point(10,20),height:110,width:250,showCloseButton:!0,zIndex:99,actions:[{label:this.snippets.select_packstation,eventHandler:()=>{this._selectLocation(this.target)}}]});this.map.entities.clear();let s={};t.forEach(t=>{s=this.setColorConfig(t,s);let o=new window.Microsoft.Maps.Pushpin(new window.Microsoft.Maps.Location(t.location.latitude,t.location.longitude),s);window.Microsoft.Maps.Events.addHandler(o,"click",()=>
1{this.map.setView({center:o.getLocation()})}),e&&(e=!1,this.map.setView({center:new window.Microsoft.Maps.Location(t.location.latitude,t.location.longitude)})),o.title=t.title,o.description=t.description,o.data_number=t.data_number,o.data_address=t.data_address,o.data_type=t.data_type,this.map.entities.push(o);let n=function(t){if("pushpin"===t.targetType){let e=t.target.getLocation();this.target=t.target,i.setLocation(e),i.setOptions({visible:!0,title:this.target.title,description:this.target.description})}};window.Microsoft.Maps.Events.addHandler(o,"click",n),window.Microsoft.Maps.Events.addHandler(o,"mouseover",n)}),i.setMap(this.map)}clearMap(){this.map.entities.clear()}_selectLocation(t){this.emitter.publish("TonurPackstation_selectLocation-"+this.id,{address:t.data_address,type:t.data_type,number:t.data_number})}setColorConfig(t,e){if(void 0===this.config||!this.config||void 0===this.config.color||!this.config.color)return delete e.color,e;let i=null;return this.isPackstation(t)&&this.config.color.packstation?i=this.config.color.packstation:this.isPostoffice(t)&&this.config.color.postoffice&&(i=this.config.color.postoffice),e.color=i,e}addPushPinLegend(){if(void 0===this.config||null===this.config.shopPushPinLegend||!this.config.shopPushPinLegend)return;let t="";this.config.color.packstation&&(t+='<li><span style="background-color:'+this.config.color.packstation+';"></span>Packstation</li>'),this.config.color.postoffice&&(t+='<li><span style="background-color:'+this.config.color.postoffice+';"></span>Postfiliale</li>'),document.getElementById("packstationLegend").innerHTML='<ul class="legend-labels">'+t+"</ul>"}constructor(e,i,s,o,n){super(),this.url="https://www.bing.com/maps/sdkrelease/mapcontrol",this.mapContainer=e,this.mapApiKey=i,this.snippets=s,this.id=o,this.emitter=new t,this.config=n}}class r extends e{loadMap(){return this.isReady()?Promise.resolve(this.initMap()):new Promise((t,e)=>{s.addToHead("link",{rel:"stylesheet",href:"https://unpkg.com/[email protected]/dist/leaflet.css"}).catch(t=>{console.error("An error occurred while loading stylesheet: https://unpkg.com/[email protected]/dist/leaflet.css"),console.error(t),e(t)}),s.addToHead("script",{src:this.url},{isReady:()=>this.isReady()}).then(()=>{if(!this.initMap()){let i=setInterval(()=>{this.initMap()&&(clearInterval(i),t(!0))},700);window.setTimeout(()=>{clearInterval(i),e(Error("Timed out while initializing Open Street Map."))},5e3);return}t(!0)}).catch(t=>{console.error("An error occurred while loading script: "+this.url),console.error(t),e(t)})})}isReady(){return void 0!==window.L}initMap(){try{return this.map=L.map(this.mapContainer).setView([51,9],13),this.tileLayer=this._createTileLayer(),this._registerTileDebugHandlers(),this._scheduleTileVisibilityRecovery(),this.map.zoomControl.setPosition("topright"),window.setTimeout(()=>{this.map&&this.map.invalidateSize()},150),this.addPushPinLegend(),!0}catch(t){return console.error("An error occurred initialing Open Street Map."),console.error(t),!1}}_createTileLayer(){return L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(this.map)}_registerTileDebugHandlers(){this.tileLayer&&(this.tileLayer.on("tileloadstart",t=>{this._bindTileVisibilityRecovery(t.tile)}),this.tileLayer.on("tileload",t=>{this._forceVisibleTile(t.tile)}))}_getMapNode(){return"string"==typeof this.mapContainer?document.getElementById(this.mapContainer.replace("#","")):this.mapContainer}_scheduleTileVisibilityRecovery(){[50,150,400,1e3].forEach(t=>{window.setTimeout(()=>{this._recoverVisibleTiles()},t)}),window.addEventListener("CookiebotOnAccept",()=>{this._recoverVisibleTiles()},{once:!0}),window.addEventListener("CookiebotOnTagsExecuted",()=>{this._recoverVisibleTiles()},{once:!0})}_recoverVisibleTiles(){let t=this._getMapNode();t&&t.querySelectorAll(".leaflet-tile").forEach(t=>{this._bindTileVisibilityRecovery(t),this._forceVisibleTile(t)})}_bindTileVisibilityRecovery(t){t&&"true"!==t.dataset.tonurTileRecoveryBound&&(t.dataset.tonurTileRecoveryBound="true",t.addEventListener("load",()=>this._forceVisibleTile(t),{once:!0}))}
1_forceVisibleTile(t){t&&t.complete&&0!==t.naturalWidth&&(t.classList.add("leaflet-tile-loaded"),t.style.visibility="inherit")}addLocations(t){this.clearMap();let e={},i={},s=[];t.forEach(t=>{e=this.setColorConfig(t,e),e=this.setIconConfig(t,e);let o=L.divIcon({className:"tonur-custom-pin",iconAnchor:[0,24],labelAnchor:[-6,0],popupAnchor:[0,-36],html:'<span style="'.concat(e.color?"background-color:"+e.color:"",'">\n ').concat(e.icon,"\n </span>")});(i=L.marker([t.location.latitude,t.location.longitude],{icon:o,loc:t}).addTo(this.map)).bindPopup("\n <h4>".concat(t.title,"</h4>\n ").concat(t.description,'<br/>\n <button id="tonur-packstation-select">').concat(this.snippets.select_packstation,"</button>\n ")),i.on("popupopen",t=>{t.popup._contentNode.querySelector("#tonur-packstation-select").addEventListener("click",()=>{this._selectLocation(t.target.options.loc)})}),s.push(i)});let o=L.featureGroup(s);this.map.fitBounds(o.getBounds())}clearMap(){this.map.eachLayer(t=>{t instanceof L.Marker&&t.remove()})}_selectLocation(t){this.emitter.publish("TonurPackstation_selectLocation-"+this.id,{address:t.data_address,type:t.data_type,number:t.data_number})}setColorConfig(t,e){if(void 0===this.config||!this.config||void 0===this.config.color||!this.config.color)return delete e.color,e;let i=null;return this.isPackstation(t)&&this.config.color.packstation?i=this.config.color.packstation:this.isPostoffice(t)&&this.config.color.postoffice&&(i=this.config.color.postoffice),e.color=i,e}setIconConfig(t,e){let i={packstation_lean_locker:{condition:this.isPackstation(t)&&t.requireApp,id:"dhl_icons_packstation_lean_locker",svg:'<svg id="dhl_icons_packstation_lean_locker" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">\n <path fill="'.concat(this.config.color.packstationIcon||"#d70511",'" d="M32,37H42v4H32ZM13.5,26a5.4967,5.4967,0,0,1-5.4747-5C8.01,20.835,8,20.6689,8,20.5A5.5015,5.5015,0,0,1,13.5,15c.1688,0,.3351.01.5.0254v-3c-.1664-.01-.3312-.0254-.5-.0254A8.51,8.51,0,0,0,5,20.5c0,.1687.0156.3335.0253.5H8v8H18V23.6553A5.4623,5.4623,0,0,1,13.5,26ZM32,35H42V31H32Zm0-6H42V19H32ZM18,13v4H44V13Zm2,16H30V19H20ZM8,41H18V37H8Zm0-6H18V31H8Zm12,6H30V37H20Zm0-6H30V31H20ZM13.5,10c.1688,0,.3331.0173.5.0254v-3C13.8327,7.019,13.6688,7,13.5,7A13.5155,13.5155,0,0,0,0,20.5c0,.1687-.0062.3328,0,.5H3s0-.3313,0-.5A10.512,10.512,0,0,1,13.5,10ZM11,20.5A2.5,2.5,0,1,0,13.5,18,2.5,2.5,0,0,0,11,20.5Z"/>\n </svg>')},packstation:{condition:this.isPackstation(t),id:"dhl_icons_packstation",svg:'<svg id="dhl_icons_packstation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">\n <path fill="'.concat(this.config.color.packstationIcon||"#d70511",'" d="M7,39H17V35H7Zm24,0H41V35H31ZM19,39H29V35H19ZM7,33H17V29H7Zm24,0H41V29H31ZM19,15H29V33H19Zm2,12h6V17H21ZM7,27H17V15H7Zm24,0H41V15H31ZM43,9v4H5V9Z"/>\n </svg>')},postoffice:{condition:this.isPostoffice(t),id:"dhl_icons_postoffice",svg:'<svg id="dhl_icons_postoffice" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">\n <path fill="'.concat(this.config.color.postofficeIcon||"#d70511",'" d="M41,44h-6v-19h-10v19h-2v-19h-10v19h-6v-28c0-.6.4-1,1-1h32c.6,0,1,.4,1,1v28ZM22.5,11.6h0l-1.4,1.4h1.3l1.4-1.4h-1.3ZM20.7,11.6h1.3l-1.4,1.4h-1.3l1.4-1.4h0ZM25.5,11.6h0l1.4,1.4h-1.3l-1.4-1.4h1.3ZM27.3,11.6h0l1.4,1.4h-1.3l-1.4-1.4h1.3ZM26.9,5.5c0,.8-.2,1.5-.4,2.3,0-1.5-1.2-2.8-2.8-2.8,0,0,0,0-.1,0-1.6,0-2.9,1.2-2.9,2.8,0,.2,0,.4,0,.6-.5-.8-.7-1.8-.5-2.7l-1,.3c-.2,2.3,1.2,5.4,4.7,5.4,2.9,0,5.3-2.3,5.4-5.2l-2.4-.6ZM23.6,9.8c-1.1,0-1.9-.9-1.9-1.9,0-1.1.9-1.9,1.9-1.9,1.1,0,1.9.9,1.9,1.9,0,1.1-.9,1.9-1.9,1.9h0Z"/>\n </svg>')}};for(let t in i){let s=i[t];if(s.condition)return document.getElementById(s.id)?e.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><use xlink:href="#'.concat(s.id,'"/></svg>'):e.icon=s.svg,e}}addPushPinLegend(){if(void 0===this.config||null===this.config.shopPushPinLegend||!this.config.shopPushPinLegend)return;let t="";this.config.color.packstation&&(t+='<li><span style="background-color:'+this.config.color.packstation+';"></span>Packstation</li>'),this.config.color.postoffice&&(t+='<li><span style="background-color:'+this.config.color.postoffice+';"></span>
1Postfiliale</li>'),document.getElementById("packstationLegend").innerHTML='<ul class="legend-labels">'+t+"</ul>"}constructor(e,i,s,o,n){super(),this.url="https://unpkg.com/[email protected]/dist/leaflet.js",this.mapContainer=e,this.mapApiKey=i,this.snippets=s,this.id=o,this.instanceId=++this.constructor.instanceCounter,this.emitter=new t,this.config=n}}r.instanceCounter=0;class a{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var i of t.entries())e(i[1],i[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(i=>{e(t[i],i)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}let l="loader",c={BEFORE:"before",INNER:"inner"};class d{create(){if(!this.exists()){if(this.position===c.INNER){this.parent.innerHTML=d.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),d.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(l));a.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(l)).length>0}_getPosition(){return this.position===c.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(l,'" role="status">\n <span class="').concat("visually-hidden",'">Loading...</span>\n </div>')}static SELECTOR_CLASS(){return l}constructor(t,e=c.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}}let h="element-loader-backdrop";class p extends d{static create(t){t.classList.add("has-element-loader"),p.exists(t)||(p.appendLoader(t),setTimeout(()=>{let e=t.querySelector(".".concat(h));e&&e.classList.add("element-loader-backdrop-open")},1))}static remove(t){t.classList.remove("has-element-loader");let e=t.querySelector(".".concat(h));e&&e.remove()}static exists(t){return t.querySelectorAll(".".concat(h)).length>0}static getTemplate(){return'\n <div class="'.concat(h,'">\n <div class="loader" role="status">\n <span class="').concat("visually-hidden",'">Loading...</span>\n </div>\n </div>\n ')}static appendLoader(t){t.insertAdjacentHTML("beforeend",p.getTemplate())}}class u{static v4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}}class m{getName(){return this.constructor.adapterName}isAvailable(){return"function"==typeof window.__cmp}openPreferences(){if(this.isAvailable())try{return window.__cmp("showScreenAdvanced"),!0}catch(t){}return window.location.hash="cmpscreencustom",!1}hasConsent(t){let e=this._getConsentData(),i=t.type||"purpose",s=t.key||"";if(!s)return!1;switch(i){case"purpose":case"category":return!!(e.purposeConsents&&e.purposeConsents[s]);case"vendor":return!!(e.vendorConsents&&e.vendorConsents[s]);case"custom":return!!e&&!!s&&!!s.split(".").reduce((t,e)=>{if(t&&Object.prototype.hasOwnProperty.call(t,e))return t[e]},e);default:return!1}}subscribe(t,e){if(!this.isAvailable()||"function"!=typeof t)return()=>{};let i=["settings","consent","consentapproved","consentrejected","consentcustom"],s=()=>{t(this.hasConsent(e),{provider:this.getName(),target:e,source:this._getConsentData()})};return i.forEach(t=>{try{window.__cmp("addEventListener",[t,s,!1],null)}catch(t){return null}}),()=>{this.isAvailable()&&i.forEach(t=>{try{window.__cmp("removeEventListener",[t,s,!1],null)}catch(t){return null}})}}waitUntilReady(t){return Promise.resolve(this.hasConsent(t))}_getConsentData(){if(!this.isAvailable())return{};
1try{return window.__cmp("getCMPData")||{}}catch(t){return{}}}}m.adapterName="consentmanager";let f={"packstation-map-osm":"preferences","packstation-map-bm":"preferences"};class g{getName(){return this.constructor.adapterName}isAvailable(){return!!(window.Cookiebot||document.querySelector('script#Cookiebot, script[data-cbid], script[src*="cookiebot"]'))}openPreferences(){return window.Cookiebot&&"function"==typeof window.Cookiebot.renew?(window.Cookiebot.renew(),!0):!!window.Cookiebot&&"function"==typeof window.Cookiebot.show&&(window.Cookiebot.show(),!0)}hasConsent(t){let e=window.Cookiebot;if(!e)return!1;if("custom"===t.type){var i;return i=t.key,!!e&&!!i&&!!i.split(".").reduce((t,e)=>{if(t&&Object.prototype.hasOwnProperty.call(t,e))return t[e]},e)}let s=this._resolveCategoryKey(t);return!!s&&!!(e.consent&&e.consent[s])}subscribe(t,e){if(!this.isAvailable()||"function"!=typeof t)return()=>{};let i=["CookiebotOnConsentReady","CookiebotOnAccept","CookiebotOnDecline","CookiebotOnTagsExecuted"],s=()=>{t(this.hasConsent(e),{provider:this.getName(),target:e,source:window.Cookiebot||{}})};return i.forEach(t=>{window.addEventListener(t,s)}),()=>{i.forEach(t=>{window.removeEventListener(t,s)})}}waitUntilReady(t){return this.isAvailable()&&this.hasConsent(t)?this.constructor.lastTagsExecutedTimestamp>=this.constructor.lastConsentEventTimestamp?Promise.resolve(!0):new Promise(e=>{let i=()=>{s(),e(this.hasConsent(t))},s=()=>{window.removeEventListener("CookiebotOnTagsExecuted",i),window.clearTimeout(o)},o=window.setTimeout(i,150);window.addEventListener("CookiebotOnTagsExecuted",i,{once:!0})}):Promise.resolve(!1)}_resolveCategoryKey(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.key?Object.prototype.hasOwnProperty.call(f,t.key)?f[t.key]:["category","purpose"].includes(t.type)?t.key:null:null}_initTracking(){if(this.constructor.isTrackingInitialized||"undefined"==typeof window)return;let t=()=>{this.constructor.lastConsentEventTimestamp=Date.now()};window.addEventListener("CookiebotOnConsentReady",t),window.addEventListener("CookiebotOnAccept",t),window.addEventListener("CookiebotOnDecline",t),window.addEventListener("CookiebotOnTagsExecuted",()=>{this.constructor.lastTagsExecutedTimestamp=Date.now()}),this.constructor.isTrackingInitialized=!0}constructor(){this._initTracking()}}g.adapterName="cookiebot",g.lastConsentEventTimestamp=0,g.lastTagsExecutedTimestamp=0,g.isTrackingInitialized=!1;class y{getName(){return this.constructor.adapterName}isAvailable(){return!0}openPreferences(){return!1}hasConsent(){return!1}subscribe(){return()=>{}}waitUntilReady(){return Promise.resolve(!1)}}y.adapterName="noop";class v{static isSupported(){return"undefined"!==document.cookie}static setItem(t,e,i){if(null==t)throw Error("You must specify a key to set a cookie");let s=new Date;s.setTime(s.getTime()+864e5*i);let o="";"https:"===location.protocol&&(o="secure"),document.cookie="".concat(t,"=").concat(e,";expires=").concat(s.toUTCString(),";path=/;sameSite=lax;").concat(o)}static getItem(t){if(!t)return!1;let e=t+"=",i=document.cookie.split(";");for(let t=0;t<i.length;t++){let s=i[t];for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(e))return s.substring(e.length,s.length)}return!1}static removeItem(t){document.cookie="".concat(t,"= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/")}static key(){return""}static clear(){}}class b{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return b.isIPhoneDevice()||b.isIPadDevice()}static isNativeWindowsBrowser(){return b.isIEBrowser()||b.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":b.isTouchDevice(),"is-ios":b.isIOSDevice(),"is-native-windows":b.isNativeWindowsBrowser(),"is-iphone":b.isIPhoneDevice(),"is-ipad":b.isIPadDevice(),"is-ie"
1:b.isIEBrowser(),"is-edge":b.isEdgeBrowser()}}}let w="offcanvas";class k{open(t,e,i,s,o,n,r){this._removeExistingOffCanvas();let a=this._createOffCanvas(i,n,r,s);this.setContent(t,s,o),this._openOffcanvas(a,e)}setContent(t,e){let i=this.getOffCanvas();i[0]&&(i[0].innerHTML=t,this._registerEvents(e))}setAdditionalClassName(t){this.getOffCanvas()[0].classList.add(t)}getOffCanvas(){return document.querySelectorAll(".".concat(w))}close(t){let e=this.getOffCanvas();a.iterate(e,t=>{bootstrap.Offcanvas.getInstance(t).hide()}),setTimeout(()=>{this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:e})},t)}goBackInHistory(){window.history.back()}exists(){return this.getOffCanvas().length>0}_openOffcanvas(t,e){k.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof e&&e()}_registerEvents(t){let e=b.isTouchDevice()?"touchend":"click",i=this.getOffCanvas();a.iterate(i,e=>{let s=()=>{setTimeout(()=>{e.remove(),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:i})},t),e.removeEventListener("hide.bs.offcanvas",s)};e.addEventListener("hide.bs.offcanvas",s)}),window.addEventListener("popstate",this.close.bind(this,t),{once:!0});let s=document.querySelectorAll(".".concat("js-offcanvas-close"));a.iterate(s,i=>i.addEventListener(e,this.close.bind(this,t)))}_removeExistingOffCanvas(){k.bsOffcanvas=null;let t=this.getOffCanvas();return a.iterate(t,t=>t.remove())}_getPositionClass(t){return"left"===t?"offcanvas-start":"right"===t?"offcanvas-end":"offcanvas-".concat(t)}_createOffCanvas(t,e,i,s){let o=document.createElement("div");if(o.classList.add(w),o.classList.add(this._getPositionClass(t)),!0===e&&o.classList.add("is-fullwidth"),i){let t=typeof i;if("string"===t)o.classList.add(i);else if(Array.isArray(i))i.forEach(t=>{o.classList.add(t)});else throw Error('The type "'.concat(t,'" is not supported. Please pass an array or a string.'))}return document.body.appendChild(o),k.bsOffcanvas=new bootstrap.Offcanvas(o,{backdrop:!1!==s||"static"}),o}constructor(){this.$emitter=new t}}let _=Object.freeze(new k);class T{static open(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";_.open(t,e,i,s,o,n,r)}static setContent(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;_.setContent(t,e,i)}static setAdditionalClassName(t){_.setAdditionalClassName(t)}static close(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;_.close(t)}static exists(){return _.exists()}static getOffCanvas(){return _.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}class C{get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",t,i);return this._sendRequest(s,null,e)}post(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("POST",t,s);return this._sendRequest(o,e,i)}delete(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(o,e,i)}patch(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(o,e,i)}abort(){if(this._request)return this._request.abort()}_registerOnLoaded(t,e){e&&t.addEventListener("loadend",()=>{e(t.responseText,t)})}_sendRequest(t,e,i){return this._registerOnLoaded(t,i),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,i){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}constructor(){this._request=null}}let P=null;class M extends T{static open(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",o=!(arguments.length>4)||void 0===arguments[4]||arguments[4],n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:T.REMOVE_OFF_CANVAS_DELAY(),r=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";if(!t)throw Error("A url must be given!");_._removeExistingOffCanvas();let l=_._createOffCanvas(s,r,a,o);this.setContent(t,e,i,o,n),_._openOffcanvas(l)}static setContent(t,e,i,s,o){let n=new C;super.setContent('<div class="offcanvas-body">'.concat(d.getTemplate(),"</div>"),s,o),P&&P.abort();let r=t=>{super.setContent(t,s,o),"function"==typeof i&&i(t)};P=e?n.post(t,e,M.executeCallback.bind(this,r)):n.get(t,M.executeCallback.bind(this,r))}static executeCallback(t,e){"function"==typeof t&&t(e),window.PluginManager.initializePlugins()}}var E=i(857);class S{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=S.toUpperCamelCase(t,e);return S.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>S.ucFirst(t.toLowerCase())).join(""):S.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class A{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!A.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===A.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=e.replace(/^data(|-)/,""),o=S.toLowerCamelCase(s,"-");if(!A.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let n=t.dataset[o];if(void 0===n){if(i)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return n}return S.parsePrimitive(n)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!A.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelector(e)||!1;if(i&&!1===s)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return s}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!A.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelectorAll(e);if(0===s.length&&(s=!1),i&&!1===s)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return s}}let $="CookieConfiguration_Update";window.router["frontend.cookie.offcanvas"];class N{getName(){return this.constructor.adapterName}isAvailable(){return!!(window.useDefaultCookieConsent&&window.router&&window.router["frontend.cookie.offcanvas"])}openPreferences(){var t;let e=(t=window.router)===null||void 0===t?void 0:t["frontend.cookie.offcanvas"];if(!e)return!1;let i=this._getPluginInstances("CookiePermission");if(i.length>0){let t=i[0];t&&"function"==typeof t._hideCookieBar&&t._hideCookieBar(),t&&"function"==typeof t._removeBodyPadding&&t._removeBodyPadding()}let s=this._getPluginInstances("CookieConfiguration");if(s.length>0){let t=s[0];if(t&&"function"==typeof t.openOffCanvas)return t.openOffCanvas(),!0}return M.open(e,!1,()=>{window.PluginManager&&"function"==typeof window.PluginManager.initializePlugins&&window.PluginManager.initializePlugins()},"left"),!0}hasConsent(t){let e=this._resolveCookieName(t);return!!e&&!!v.getItem(e)}subscribe(t,e){let i=this._resolveCookieName(e);
1if(!i||"function"!=typeof t)return()=>{};let s=s=>{let o=s.detail||{};Object.prototype.hasOwnProperty.call(o,i)&&t(!!o[i],{provider:this.getName(),target:e,source:o})};return document.addEventListener($,s),()=>document.removeEventListener($,s)}waitUntilReady(t){return Promise.resolve(this.hasConsent(t))}_resolveCookieName(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.key||""||null}_getPluginInstances(t){if(!window.PluginManager||"function"!=typeof window.PluginManager.getPluginInstances)return[];try{let e=window.PluginManager.getPluginInstances(t)||[];if(Array.isArray(e))return e;if("function"==typeof e.values)return Array.from(e.values());return[]}catch(t){return[]}}}N.adapterName="shopware";let O={required:!0,provider:"auto",targetType:"purpose",targetKey:"packstation-map"};class F{openPreferences(){return!this.isConsentRequired()||this.adapter.openPreferences(this.target)}hasConsent(){return!this.isConsentRequired()||this.adapter.hasConsent(this.target)}subscribe(t){return this.isConsentRequired()?this.adapter.subscribe(t,this.target):()=>{}}waitUntilReady(){return this.isConsentRequired()?"function"!=typeof this.adapter.waitUntilReady?Promise.resolve(this.hasConsent()):this.adapter.waitUntilReady(this.target):Promise.resolve(!0)}isConsentRequired(){return this.options.required}getProviderName(){return this.adapter.getName()}_resolveAdapter(){let t={cookiebot:g,consentmanager:m,shopware:N};if("auto"!==this.options.provider&&Object.prototype.hasOwnProperty.call(t,this.options.provider)){let e=new t[this.options.provider];if(e.isAvailable())return e}return[m,g,N].map(t=>new t).find(t=>t.isAvailable())||new y}_normalizeOptions(t){let e={...O,...t||{}};return e.required=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("boolean"==typeof t)return t;if("number"==typeof t)return 0!==t;if("string"==typeof t){let e=t.trim().toLowerCase();if(["1","true","yes","on"].includes(e))return!0;if(["0","false","no","off",""].includes(e))return!1}return e}(e.required,O.required),e.provider=String(e.provider||O.provider).toLowerCase(),e.targetType=String(e.targetType||O.targetType).toLowerCase(),e.targetKey=String(e.targetKey||O.targetKey),e}constructor(t={}){this.options=this._normalizeOptions(t),this.target={type:this.options.targetType,key:this.options.targetKey},this.adapter=this._resolveAdapter()}}class I{_getBodyTemplate(){let t='<div class="packstation mb-3">\n<div class="alert alert-warning" id="packstationAlert-'+this.id+'" role="alert" hidden>\n<div class="alert-content-container"><div class="alert-content">'+this.options.snippets.no_packstation_found+'</div></div></div> <div class="d-flex gap-2">\n';return this.options.config.useCombinedCityZipField||(t+=' <div class="form-group flex-fill">\n <label class="form-label" for="packstationZip-'+this.id+'">'+this.options.snippets.zip+'*</label>\n <input form="tonur-packstation-search-form" class="form-control lh-sm" name="packstationZip" id="packstationZip-'+this.id+'" type="text" placeholder="'+this.options.snippets.zip+'" required="required"/>\n </div>\n'),t+=' <div class="form-group flex-fill">\n <label class="form-label" for="packstationCity-'+this.id+'">'+(this.options.config.useCombinedCityZipField?this.options.snippets.zip+", "+this.options.snippets.city:this.options.snippets.city)+'*</label>\n <input form="tonur-packstation-search-form" class="form-control lh-sm" name="packstationCity" id="packstationCity-'+this.id+'" type="text" placeholder="'+(this.options.config.useCombinedCityZipField?this.options.snippets.zip+", "+this.options.snippets.city:this.options.snippets.city)+'" required="required"/>\n </div>\n <div class="form-group align-self-end">\n <button form="tonur-packstation-search-form" class="btn btn-primary btn-block" type="button" id="searchPackstation-'+this.id+'">'+this.options.snippets.search+'</button>\n </div>\n </div>\n <div id="packstationLegend" class="legend"></div>\n <div id="packstationTestMode" class="tonur-packstation-map-test-mode-overlay is--hidden">Test mode</div>\n <div id="packstationMap-'+this.id+'"> </div>\n</div>'}async _loadPackstationMap(t){if(this.$element){p.create(this.$element);try{(await this.consentService.waitUntilReady(),"bingMaps"===this.options.mapType)?this.map=new n(t,this.options.mapApiKey,this.options.snippets,this.id,this.options.config):this.map=new r("packstationMap-"+this.id,this.options.mapApiKey,this.options.snippets,this.id,this.options.config),await this.map.loadMap()}finally{this.$element&&p.remove(this.$element)}}}_searchPackstation(t){let e=t.getAttribute("action"),i=new FormData(t),s={};this.$element&&!this.searching&&(this.$element.querySelector("#packstationAlert-"+this.id
1).setAttribute("hidden",!0),this.searching=!0,p.create(this.$element),i.forEach(function(t,e){s[e]=t}),this._doSearch(e,s))}_doSearch(t,e){fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.text()).then(t=>{let e=JSON.parse(t);0===e.length?(this.$element.querySelector("#packstationAlert-"+this.id).removeAttribute("hidden"),this.map.clearMap()):this.map.addLocations(this.map.prepareLocations(e)),p.remove(this.$element),this.searching=!1})}_registerEvents(){let t=this.$element.querySelector("#searchPackstation-"+this.id),e=document.querySelector("#tonur-packstation-search-form");e.addEventListener("submit",t=>{t.preventDefault(),t.stopPropagation(),this.handlePackstationForm(e)}),t.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();let e=t.target.form;this.handlePackstationForm(e)})}handlePackstationForm(t){let e=this.$element.querySelector("#packstationCity-"+this.id),i=e.value;if(e.classList.toggle("is-invalid",!i.trim()),i.trim()){if(!this.options.config.useCombinedCityZipField){let t=this.$element.querySelector("#packstationZip-"+this.id),e=t.value;if(t.classList.toggle("is-invalid",!e.trim()),!e.trim())return}this._searchPackstation(t)}}insertBefore(t){if(null===this.$element)return null;let e=document.createElement("div");e.innerHTML=this._getBodyTemplate();let i=t.parentNode.insertBefore(e,t);return this.$element=i,this._loadPackstationMap("#packstationMap-"+this.id),this._registerEvents.call(this),i}insertAfter(t){if(null===this.$element)return null;let e=document.createElement("div");e.innerHTML=this._getBodyTemplate();let i=t.parentNode.insertBefore(e,t.nextSibling);return this.$element=i,this._loadPackstationMap("#packstationMap-"+this.id),this._registerEvents.call(this),i}append(t){if(null===this.$element)return null;let e=document.createElement("div");return e.innerHTML=this._getBodyTemplate(),t.appendChild(e),this.$element=t,this._loadPackstationMap("#packstationMap-"+this.id),this._registerEvents.call(this),t}remove(){null!==this.$element&&(this.$element.remove(),this.$element=null)}constructor(t,e,i,s,o){this.options={mapType:t,mapApiKey:e,snippets:i,config:o},this.id=s||u.v4(),this.consentService=new F((null==o?void 0:o.consent)||{})}}let q="js-pseudo-modal";class x{open(t){this._hideExistingModal(),this._create(),this._open(t)}close(){let t=this.getModal();this._modalInstance=bootstrap.Modal.getInstance(t),this._modalInstance.hide()}getModal(){return this._modal||this._create(),this._modal}updatePosition(){this._modalInstance.handleUpdate()}updateContent(t,e){this._content=t,this._setModalContent(t),this.updatePosition(),"function"==typeof e&&e.bind(this)()}_hideExistingModal(){try{let t=A.querySelector(document,".".concat(q," .modal"),!1);if(!t)return;let e=bootstrap.Modal.getInstance(t);if(!e)return;e.hide()}catch(t){console.warn("[PseudoModalUtil] Unable to hide existing pseudo modal before opening pseudo modal: ".concat(t.message))}}_open(t){this.getModal(),this._modal.addEventListener("hidden.bs.modal",this._modalWrapper.remove),this._modal.addEventListener("shown.bs.modal",t),this._modalInstance.show()}_create(){this._modalMarkupEl=A.querySelector(document,this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMarkup(),this._modalInstance=new bootstrap.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=A.querySelector(document,".".concat(q),!1),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(q))}_createModalMarkup(){let t=A.querySelector(this._modalWrapper,".modal",!1);if(t)return t;let e=this._modalWrapper.innerHTML;return this._modalWrapper.innerHTML=this._modalMarkupEl.innerHTML,this._setModalContent(e),A.querySelector(this._modalWrapper,".modal")}_setModalTitle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{A.querySelector(this._modalWrapper,this._templateTitleSelector).innerHTML=t}catch(t){}}_setModalContent(t){let e=A.querySelector(this._modalWrapper,this._templateContentSelector);e.innerHTML=t;try{let t=A.querySelector(e,this._templateTitleSelector);t&&(this._setModalTitle(t.innerHTML),t.parentNode.removeChild(t))}catch(t){}}constructor(t,e=!0,i=".".concat("js-pseudo-modal-template"),s=".".concat("js-pseudo-modal-template-content-element"),o=".".concat("js-pseudo-modal-template-title-element")){this._content=t,this._useBackdrop=e,this._templateSelector=i,this._templateContentSelector=s,this._templateTitleSelector=o}}class H{init(t,e,i,s){this.options.mapType=t,this.options.mapApiKey=e,this.options.snippets=i,this.options.config=s,this.options.zipCode=s.zipCode,this.options.city=s.city}_getModalTemplate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return'<div id="repertusPackstationMapModal" class="js-pseudo-modal-template" tabindex="-1" data-id="'+t+'">\n<div class="js-pseudo-modal-template-title-element">'+this.options.snippets.search_packstation_post_office+'</div>\n<div class="js-pseudo-modal-template-content-element"><div id="repertusPackstationMapModalBody" class="modal-body"></div></div>\n</div>'}openModal(t){this._data.$element=new x(t),this._data.$element.open(this.onOpenModal.bind(this))}onOpenModal(){let e=this._data.$element.getModal().querySelector("#repertusPackstationMapModal"),i=e.querySelector("#repertusPackstationMapModalBody"),s=e.dataset.id,o=new I(this.options.mapType,this.options.mapApiKey,this.options.snippets,s,this.options.config);i&&o.append(i),new t().subscribe("TonurPackstation_selectLocation-"+s,()=>{this.hide()}),window.PluginManager.initializePlugins()}show(t){return this.openModal(this._getModalTemplate(t)),!0}hide(){return this._data.$element._modalInstance.hide(),!0}constructor(){return H.instance||(this._data={$element:null}
1,this.options={mapType:null,mapApiKey:null,snippets:null,config:null,useCombinedCityZipField:null},H.instance=this),H.instance}}Object.freeze(new H);let R=window.PluginBaseClass;class V extends R{init(){if(this.$cookieMissingPermissionInfo=this.el.parentElement.querySelector(this.options.cookieMissingPermissionSelector),this.$form=this.el.closest("form"),!this.$form)throw Error("Could not find form!");this.id=this.$form.getAttribute("data-tonur-packstation-form-id"),this.id||(this.id=u.v4(),this.$form.setAttribute("data-tonur-packstation-form-id",this.id)),this.emitter=new t,this.consentService=new F(this.options.consent),this._boundMapClickHandler=this._onMapClick.bind(this),this._isMapInitialized=!1,this.addDataValidation(),this._unsubscribeConsent=this.consentService.subscribe(t=>{this._handleConsentStateChanged(t)}),this._handleConsentStateChanged(this.consentService.hasConsent())}_registerEvents(){this.el.addEventListener("click",this._boundMapClickHandler),this.emitter.subscribe("TonurPackstation_selectLocation-"+this.id,()=>{this._closeMap()}),this._isMapInitialized=!0}_onMapClick(t){if(t.preventDefault(),t.stopPropagation(),1===this._mode){if(this._closeMap())return;this.inlineForm=new I(this.options.mapType,this.getMapApiKey(),this.options.snippets,this.id,this.options),this.inlineForm.insertBefore(this.$form.querySelector(".repertusPackstationAddressFields"))}else this.modal=new H,this.modal.init(this.options.mapType,this.getMapApiKey(),this.options.snippets,this.options),this.modal.show(this.id);window.PluginManager.initializePlugins()}_closeMap(){return this.modal?(this.modal.hide(),this.modal=null,!0):!!this.inlineForm&&(this.inlineForm.remove(),this.inlineForm=null,!0)}_handleConsentStateChanged(t){if(this._applyConsentState(t),t){this.initPackstationMap();return}this._closeMap(),this.removeEvents()}initPackstationMap(){if(!this.options.mapType||!this.getMapApiKey()&&"openStreetMap"!==this.options.mapType)throw Error("The options for the packstation map are incomplete!");let t=this.$form.closest(".modal");this._mode=t?1:2,this._isMapInitialized||this._registerEvents()}removeEvents(){this._isMapInitialized&&(this.el.removeEventListener("click",this._boundMapClickHandler),this.emitter.unsubscribe("TonurPackstation_selectLocation-"+this.id),this._isMapInitialized=!1)}_applyConsentState(t){this.el.disabled=!t,this.$cookieMissingPermissionInfo&&this.$cookieMissingPermissionInfo.classList.toggle("is--hidden",t)}getMapApiKey(){return this.options.testMode?o.getRepertusBingMapsKey():this.options.mapApiKey}addDataValidation(){!this.options.validatePostNumber||this.$form.hasAttribute("data-form-validation")||(this.$form.setAttribute("data-form-validation","true"),window.PluginManager.initializePlugins())}}V.options={mapType:null,mapApiKey:null,snippets:null,cookieMissingPermissionSelector:"#TonurPackstationCookieMissingPermission",color:{packstation:null,postoffice:null,packstationIcon:null,postoffice_Icon:null},consent:{required:!0,provider:"auto",targetType:"purpose",targetKey:"packstation-map"},testMode:!0,validatePostNumber:!1,useCombinedCityZipField:!0};let D={MAIL:"0",PACKSTATION:"1",POST_OFFICE:"2"},B={UNKNOWN:"",PACKSTATION:"P"},j=window.PluginBaseClass;class Z extends j{init(){this._initDefaultValues(),this.emitter=new t,this.formToggleCheckbox=document.querySelector("#differentShippingAddress"),this.formToggleCheckbox&&(this.formFieldTogglePluginEmitter=new t(this.formToggleCheckbox)),this.$el=this.el,this.$form=this.$el.closest(this.options.selectors.formSelector),this.id=this.$form.getAttribute("data-tonur-packstation-form-id"),this.id||(this.id=u.v4(),this.$form.setAttribute("data-tonur-packstation-form-id",this.id)),this.consentService=new F(this.options.consent),this.$addressTypeSelection=this.$el.querySelectorAll(this.options.selectors.addressType),this.$packstationFieldSet=this.$el.querySelector(this.options.selectors.packstationFieldSet),this.$packstationNumberField=this.$el.querySelector(this.options.selectors.packstationNumber),this.$dhlNumberField=this.$el.querySelector(this.options.selectors.dhlNumber),this.$packstationTypeField=this.$el.querySelector(this.options.selectors.packstationType),this.$zipField=this.$form.querySelector(this.options.selectors.zip),this.$cityField=this.$form.querySelector(this.options.selectors.city),this.$countryField=this.$form.querySelector(this.options.selectors.country),this.$countryStateField=this.$form.querySelector(this.options.selectors.countryState),this.$street=this.$form.querySelector(this.options.selectors.street),this.$dhlNumberSaveToField=this.$form.querySelector(this.options.selectors.dhlNumberSaveTo),this.$departmentField=this.$form.querySelector(this.options.selectors.department),this.$vatIdField=this.$form.querySelector(this.options.selectors.vatId),this.$cookieButton=this.$el.querySelector(this.options.selectors.cookieButton),this.dhlNumberOnlyNumericalError=this.el.querySelector(this.options.selectors.dhlNumberOnlyNumericalError),this._registerEvents(),this._handleRelevantDataChanged(!1)}_initDefaultValues(){this.currentAddressType=D.MAIL,this.currentPackstationType=B.UNKNOWN,this.currentDhlNumber="",this.currentPackstationNumber=""}_registerEvents(){this.emitter.subscribe("TonurPackstation_selectLocation-"+this.id,t=>{this._setPackstationDataToForm(t.detail),this._handleRelevantDataChanged()}),this.formToggleCheckbox&&this.formFieldTogglePluginEmitter.subscribe("onChange",()=>{this._updateView()}),this.$addressTypeSelection.forEach(t=>t.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this))),this.$packstationNumberField.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this)),this.$packstationTypeField.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this)),this.$dhlNumberField.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this)),this.$dhlNumberField.addEventListener("input",t=>{isNaN(t.target.value)?(this.dhlNumberOnlyNumericalError.classList.remove("d-none"),t.target.value=t.target.value.replace(/[^0-9]/g,"")):this.dhlNumberOnlyNumericalError.classList.add("d-none")}),this.$cookieButton&&this.$cookieButton.addEventListener("click",t=>{t.preventDefault(),this.consentService.openPreferences()})}_onRelevantDataForStreetChanged(){this._handleRelevantDataChanged()}_handleRelevantDataChanged(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this._updateCurrentValues(),this._calculateStreetValue(),t&&(this._updateFormFields(),this._setCountryToGermanyIfNecessary()),this._updateView()}_updateCurrentValues(){this._updateCurrentAddressType(),this._updateCurrentPackstationType(),this._updateDhlNumber(),this._updatePackstationNumber(),this._updateCurrentZip(),this._updateCurrentCity()}_updateCurrentAddressType(){for(let t=0;t<this.$addressTypeSelection.length;t++)if(this.$addressTypeSelection[t].checked){this.currentAddressType=this.$addressTypeSelection[t].value;break}}_updateCurrentPackstationType(){this.currentPackstationType=this.$packstationTypeField.value}_updateDhlNumber(){this.currentDhlNumber=this.$dhlNumberField.value}_updatePackstationNumber(){this.currentPackstationNumber=this.$packstationNumberField.value}_updateCurrentZip(){this.currentZip=this.$zipField.value}_updateCurrentCity(){this.currentCity=this.$cityField.value}setInputFieldValue(t,e){t&&(t.value=e,t.dispatchEvent(new Event("input",{bubbles:!0})))}_updateFormFields(){this.setInputFieldValue(this.$street,this.currentStreet),this.setInputFieldValue(this.$dhlNumberSaveToField,this.currentDhlNumber),this.setInputFieldValue(this.$packstationNumberField,this.currentPackstationNumber),this.setInputFieldValue(this.$dhlNumberField,this.currentDhlNumber),this.setInputFieldValue(this.$zipField,this.currentZip),this.setInputFieldValue(this.$cityField,this.currentCity),this._setCountryToInitialValue()}_updateView(){let t=this.currentAddressType===D.PACKSTATION||this.currentAddressType===D.POST_OFFICE,e="company"===this.options.config.savePostnumberField;t?(this.$packstationFieldSet&&(this.$packstationFieldSet.classList.remove("d-none"),this.$packstationFieldSet.querySelectorAll("input").forEach(function(t){t.disabled=!1})),this.$street&&(this.$street.parentElement.style.display="none"),this.$dhlNumberSaveToField&&(this.$dhlNumberSaveToField.parentElement.style.display="none"),this.$departmentField&&this.$departmentField.parentElement.classList.add("d-none"),this.$vatIdField&&this.$vatIdField.parentElement.classList.add("d-none")):(this.$packstationFieldSet&&(this.$packstationFieldSet.classList.add("d-none"),this.$packstationFieldSet.querySelectorAll("input").forEach(function(t){t.disabled=!0})),this.$street&&(this.$street.parentElement.style.display="block"),this.$dhlNumberSaveToField&&(this.$dhlNumberSaveToField.parentElement.style.display="block"),this.$departmentField&&this.$departmentField.parentElement.classList.toggle("d-none",e),this.$vatIdField&&this.$vatIdField.parentElement.classList.toggle("d-none",e)),this.$emitter.publish("TonurPackstationForm/updateView",{id:this.id,isPackstationOrPostOffice:t,streetValue:this.currentPackstationType===B.PACKSTATION?this.options.streetValues.packstation:this.options.streetValues.postOffice})}_setCountryToGermanyIfNecessary(){(this.currentAddressType===D.PACKSTATION||this.currentAddressType===D.POST_OFFICE)&&null!==this.options.countryIdGermany&&this.$countryField.value!==this.options.countryIdGermany&&(this.$countryField.value=this.options.countryIdGermany,this._fireChangeEventForDOMElement(this.$countryField[0]))}_setCountryToInitialValue(){if(this.currentAddressType===D.MAIL)try{let t=this.$countryField.dataset.initialCountryId;if(t===this.options.countryIdGermany)return;this.$countryField.value=t,t?this._fireChangeEventForDOMElement(this.$countryField):(this.$countryStateField.parentNode.classList.toggle("d-none",!0),this.$countryStateField.setAttribute("disabled","disabled"))}catch(t){console.error("An error occurred setting country to initial value"),console.error(t)}}_fireChangeEventForDOMElement(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(void 0===t)return;let s=document.createEvent("HTMLEvents");
1s.initEvent("change",e,i),t.dispatchEvent(s)}_setPackstationDataToForm(t){this.setInputFieldValue(this.$packstationNumberField,t.number),this.setInputFieldValue(this.$packstationTypeField,t.type),this.setInputFieldValue(this.$zipField,t.address.postalCode),this.setInputFieldValue(this.$cityField,t.address.addressLocality);let e=Array.from(this.$addressTypeSelection).find(t=>t.value===D.PACKSTATION);e&&(e.checked=!0,this.currentAddressType=D.PACKSTATION,e.click())}_calculateStreetValue(){if(""===this.currentPackstationNumber||this.currentAddressType===D.MAIL){this.street="",this.currentStreet="",this.currentZip="",this.currentCity="",this.currentAddressType===D.MAIL&&(this.currentPackstationNumber="",this.currentDhlNumber="");return}this.currentStreet=this.options.streetValues.packstation,this.currentPackstationType!==B.PACKSTATION&&(this.currentStreet=this.options.streetValues.postOffice),this.currentStreet+=" "+this.currentPackstationNumber}}Z.options={streetValues:{packstation:"Packstation",postOffice:"Postfiliale"},selectors:{formSelector:"form",addressFormSubmit:".address-form-submit",addressType:'input[type="radio"][name="repertusPackstationAddressType"]',addressTypePackstation:"#repertusPackstationAddressType1",packstationFieldSet:".repertusPackstationAddressFields",packstationType:"#repertusPackstationAddressPackstationType",packstationNumber:"#repertusPackstationAddressPackstationNumber",dhlNumber:"#repertusPackstationAddressPostNumber",dhlNumberSaveTo:"#shippingAddressAdditionalField1",city:"",zip:"",street:"",country:"",countryState:"",department:"",vatId:"",cookieButton:"#repertusPackstationOpenCookie",dhlNumberOnlyNumericalError:"#only-numerical-error"},config:{savePostnumberField:"additionalAddressLine1"},consent:{required:!0,provider:"auto",targetType:"purpose",targetKey:"packstation-map"},countryIdGermany:null};let K=window.PluginBaseClass;class z extends K{init(){if(this.AddressPackstationNumberSelector=this.options.selectors.AddressPackstationNumber,this.packstationType=this.options.selectors.packstationType,this.$el=this.el,this.$form=this.$el.closest("form"),this.id=this.$form.getAttribute("data-tonur-packstation-form-id"),void 0===this.id)return;let t=this.el.parentElement.querySelectorAll("div[data-acris-separate-street] input"),e=t[0],i=t[1],s=e.getAttribute("id");s.includes("billingAddress")||s.includes("AddressHouseNumber")||(this.$addressTypeSelection=this.$el.querySelector(this.options.selectors.addressType),this.$houseNumber=null!=i?i:this.$form.querySelector(this.options.selectors.houseNumberLogin),this.$streetAddress=null!=e?e:this.$form.querySelector(this.options.selectors.streetAddressLogin),this.$houseNumberPlaceholderStarttext=this.$houseNumber.placeholder,this.$streetPlaceholderStarttext=this.$streetAddress.placeholder,this.$streetLabel=this.$form.querySelector('label[for="'.concat(this.$streetAddress.id,'"]')),this.$houseNumberLabel=this.$form.querySelector('label[for="'.concat(this.$houseNumber.id,'"]')),this.$streetLabelStartText=this.$streetLabel.textContent,this.$houseNumberLabelStartText=this.$houseNumberLabel.textContent,this._registerEvents(),this.triggerUpdatePackstationView())}_registerEvents(){window.PluginManager.getPluginInstances("TonurPackstationForm").forEach(t=>{t.$emitter.subscribe("TonurPackstationForm/updateView",this._updateView.bind(this))})}_updateView(t){if(this.id!==t.detail.id)return;let e=this.$form.querySelector(this.AddressPackstationNumberSelector),i=this.$form.querySelector(this.packstationType),s=t.detail.isPackstationOrPostOffice,o=this.$form.querySelector('label[for="'.concat(i.id,'"]')),n=this.$form.querySelector('label[for="'.concat(e.id,'"]'));this.$streetAddress.value="",this.$houseNumber.value="",s?(this.$houseNumber.value=e.value,this.$streetAddress.value=t.detail.streetValue,this.$houseNumberLabel.textContent=n.textContent,this.$streetLabel.textContent=o.textContent,this.$houseNumber.placeholder=e.placeholder,this.$streetAddress.placeholder=o.textContent,i.parentNode.style.display="none",e.parentNode.style.display="none",this.$houseNumber.parentNode.style.display="block",this.$streetAddress.parentNode.style.display="block",this._startSyncPackstationNumber(this.$houseNumber,e)):(this.$houseNumberLabel.textContent=this.$houseNumberLabelStartText,this.$streetLabel.textContent=this.$streetLabelStartText,this.$houseNumber.placeholder=this.$houseNumberPlaceholderStarttext,this.$streetAddress.placeholder=this.$streetPlaceholderStarttext,this._stopSyncPackstationNumber(this.$houseNumber))}_startSyncPackstationNumber(t,e){this.syncNumber=function(){e.value=t.value},t.addEventListener("change",this.syncNumber)}_stopSyncPackstationNumber(t){this.syncNumber&&(t.removeEventListener("change",this.syncNumber),this.syncNumber=null)}triggerUpdatePackstationView(){window.PluginManager.getPluginInstances("TonurPackstationForm").forEach(t=>{t.id===this.id&&t._handleRelevantDataChanged(!1)})}}z.options={selectors:{houseNumberLogin:"#addressAddressHouseNumber",streetAddressLogin:"#addressAddressStreet",AddressPackstationNumber:"#repertusPackstationAddressPackstationNumber",packstationType:"#repertusPackstationAddressPackstationType"}};let U=window.PluginManager;U.register("TonurPackstationMap",V,"[data-tonur-packstation-map]"),U.register("TonurPackstationForm",Z,"[data-tonur-packstation-form]"),U.register("TonurPackstationAcrisSeparateStreetCSPlugin",z,"[data-tonur-acris-separate-street]")})()})();
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.