PageSourceSearch

https://www.editions-narayana.fr/theme/c12d69325ce565365dff79f72a3…ackstation.packstation-map.plugin.6b450b.js

js editions-narayana.fr collected 2026-09-29 02:47:39 UTC 19,277 bytes, 48 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[26636],{156: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)?l(Array.isArray(t)?[]:{},t,e):t}function o(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function a(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function n(t,e){try{return e in t}catch(t){return!1}}function l(t,i,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||e,r.cloneUnlessOtherwiseSpecified=s;var c,d,p=Array.isArray(i);return p!==Array.isArray(t)?s(i,r):p?r.arrayMerge(t,i,r):(d={},(c=r).isMergeableObject(t)&&a(t).forEach(function(e){d[e]=s(t[e],c)}),a(i).forEach(function(e){(!n(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(n(t,e)&&c.isMergeableObject(i[e])?d[e]=(function(t,e){if(!e.customMerge)return l;var i=e.customMerge(t);return"function"==typeof i?i:l})(e,c)(t[e],i[e],c):d[e]=s(i[e],c))}),d)}l.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return l(t,i,e)},{})},t.exports=l},636:(t,e,i)=>{i.r(e),i.d(e,{default:()=>a});var s=i(335);let o={packstation:t=>`<svg class="intedia-packstation-marker-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="${t}" d="M7,39H17V35H7Zm24,0H41V35H31ZM19,39H29V35H19ZM7,33H17V29H7Zm24,0H41V29H31ZM19,15H29V33H19Zm2,12h6V17H21ZM7,27H17V15H7Zm24,0H41V15H31ZM43,9v4H5V9Z"/></svg>`,packstation_lean_locker:t=>`<svg class="intedia-packstation-marker-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="${t}" 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"/></svg>`,postoffice:t=>`<svg class="intedia-packstation-marker-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="${t}" 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"/></svg>`};class a extends s.A{static #t=this.options={mapType:"openStreetMap",snippets:{},color:{},validatePostNumber:!1,useCombinedCityZipField:!0};init(){try{let t=this.el.getAttribute("data-intedia-packstation-map-options");if(t){let e=JSON.parse(t);if(Object.assign(this.options,e),"string"==typeof this.options.useCombinedCityZipField){let t=this.options.useCombinedCityZipField;this.options.useCombinedCityZipField="true"===t||"1"===t}}}catch(t){}this._formId=this.el.closest("form")?.getAttribute("data-intedia-packstation-form-id")||null,this.el.addEventListener("click",this._onButtonClick.bind(this))}_onButtonClick(t){t.preventDefault(),t.stopPropagation(),this._openModal()}_openModal(){if(this._modal){this._showModal();return}let t=this.options.snippets||{},e=t.search_packstation_post_office||"Packstation/Postfiliale suchen",i=t.zip||"PLZ",s=t.city||"Ort",o=t.search||"Suche",a=t.select_packstation||"Als Lieferadresse übernehmen",n=t.no_packstation_found||"Keine Packstation gefunden",l="intedia-packstation-modal-"+(this._formId||Date.now()),r=!1!==this.options.useCombinedCityZipField,c=r?`
2                        <div class="mb-3">
3                            <label for="${l}-zipcity" class="form-label">${i} / ${s}</label>
4                            <input type="text" id="${l}-zipcity" class="form-control" placeholder="z.B. 10115 Berlin" maxlength="100">
5                        </div>
6            `:`
7                        <div class="mb-3">
8                            <label for="${l}-zip" class="form-label">${i}</label>
9                            <input type="text" id="${l}-zip" class="form-control" placeholder="${i}" maxlength="10">
10                        </div>
11                        <div class="mb-3">
12                            <label for="${l}-city" class="form-label">${s}</label>
13                            <input type="text" id="${l}-city" class="form-control" placeholder="${s}">
14                        </div>
15            `;this._modal=document.createElement("div"),this._modal.className="modal fade",this._modal.id=l,this._modal.setAttribute("tabindex","-1"),this._modal.setAttribute("aria-labelledby",l+"-label"),this._modal.setAttribute("aria-hidden","true"),this._modal.innerHTML=`
16            <div class="modal-dialog modal-dialog-centered modal
16-dialog-scrollable modal-lg">
17                <div class="modal-content">
18                    <div class="modal-header">
19                        <h5 class="modal-title" id="${l}-label">${e}</h5>
20                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
21                    </div>
22                    <div class="modal-body">
23                        ${c}
24                        <button type="button" class="btn btn-primary mb-3" id="${l}-search">${o}</button>
25                        <div id="${l}-loading" class="d-none">Lade...</div>
26                        <div id="${l}-map" class="mb-3" style="height:280px;min-height:280px;display:none;"></div>
27                        <div id="${l}-results" class="list-group"></div>
28                        <div id="${l}-no-results" class="d-none text-muted small">${n}</div>
29                    </div>
30                </div>
31            </div>
32        `,document.body.appendChild(this._modal);let d=this._modal.querySelector(`#${l}-zip`),p=this._modal.querySelector(`#${l}-city`),h=this._modal.querySelector(`#${l}-zipcity`),u=this._modal.querySelector(`#${l}-search`),m=this._modal.querySelector(`#${l}-loading`),g=this._modal.querySelector(`#${l}-results`),y=this._modal.querySelector(`#${l}-no-results`),b=this._modal.querySelector(`#${l}-map`);u.addEventListener("click",()=>this._doSearch(r?h:d,r?null:p,r,m,g,y,b,a)),(h||d).addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),u.click())}),p&&p.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),u.click())});let f=window.bootstrap?.Modal?new window.bootstrap.Modal(this._modal):null;this._modal._bsModal=f,this._showModal()}_showModal(){if(this._modal._bsModal)this._modal._bsModal.show();else{this._modal.classList.add("show"),this._modal.style.display="block",this._modal.classList.remove("d-none"),document.body.classList.add("modal-open");let t=document.createElement("div");t.className="modal-backdrop fade show",t.id="intedia-packstation-backdrop",document.body.appendChild(t)}}_parseCombinedZipCity(t){let e=(t||"").trim();if(!e)return{zip:"",city:""};let i=e.match(/^(\d{4,5})\s+(.+)$/);return i?{zip:i[1],city:i[2].trim()}:/^\d+$/.test(e)?{zip:e,city:""}:{zip:"",city:e}}_doSearch(t,e,i,s,o,a,n,l){let r,c;if(i&&t){let e=this._parseCombinedZipCity(t.value);r=e.zip,c=e.city}else r=(t?.value||"").trim(),c=(e?.value||"").trim();if(!r&&!c)return;s.classList.remove("d-none"),o.innerHTML="",a.classList.add("d-none"),n&&(n.style.display="none",n.innerHTML="");let d=this.options.searchUrl||"/intedia/packstation/search",p=new FormData;p.append("packstationZip",r),p.append("packstationCity",c),p.append("countryCode","DE"),fetch(d,{method:"POST",body:p,headers:{"X-Requested-With":"XMLHttpRequest"}}).then(t=>t.json()).then(t=>{if(s.classList.add("d-none"),!Array.isArray(t)||0===t.length){a.classList.remove("d-none");return}t.forEach(t=>this._renderLocation(t,o,l)),this._showMapWithLocations(n,t)}).catch(()=>{s.classList.add("d-none"),a.classList.remove("d-none"),a.textContent="Suche fehlgeschlagen. Bitte später erneut versuchen."})}_getLocationCoords(t){let e=t.place||t,i=e.geo||e.location||e.position||t,s=i.latitude??i.lat??t.latitude??t.lat,o=i.longitude??i.lng??t.longitude??t.lng;return null!=s&&null!=o?{lat:Number(s),lng:Number(o)}:null}_isPackstation(t){let e=((t.place||{}).location||t.location||{}).type||t.locationType||t.type;return"locker"===e||"P"===e}_isPostoffice(t){let e=(((t.place||{}).location||t.location||{}).type||t.locationType||t.type||"").toLowerCase();return"postoffice"===e||"postbank"===e||"servicepoint"===e||"f"===e||"postfiliale"===e}_isRequireApp(t){let e=t.place&&t.place.location||t.location||{};return!0===e.leanLocker||!0===e.requireApp}_getOpeningHoursToday(t){let e=t.openingHours||t.place&&t.place.openingHours||[];if(!Array.isArray(e)||!e.length)return null;let i={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"}
32[new Date().toLocaleString("en-US",{weekday:"long"})],s=e.find(t=>t.dayOfWeek===i);if(!s||!s.opens||!s.closes)return null;let o=this.options.snippets||{},a=o.today||"Heute",n=o.time||"Uhr",l=(s.opens||"").slice(0,5),r=(s.closes||"").slice(0,5);return`${a}: ${l} - ${r} ${n}`}_getDhlIconConfig(t){let e=this.options.color||{},i=e.packstationIcon||"#d70511",s=e.postofficeIcon||"#d70511",a=e.packstation||"#ffcc00",n=e.postoffice||"#f0b429",l=!!(t.place&&t.place.location&&t.place.location.requireApp)||!!(t.location&&t.location.requireApp);return this._isPackstation(t)&&l?{icon:o.packstation_lean_locker(i),bg:a}:this._isPackstation(t)?{icon:o.packstation(i),bg:a}:this._isPostoffice(t)?{icon:o.postoffice(s),bg:n}:{icon:o.packstation(i),bg:a}}_buildPopupDescription(t){let e=t.place||{},i=t.address||e.address||t,s=i.streetAddress||i.street_address||"",o=[i.postalCode,i.addressLocality].filter(Boolean).join(" "),a=t.name||(e.location?`${e.location.keyword||""} ${e.location.keywordId||""}`.trim():"")||"",n=this._getOpeningHoursToday(t),l=this.options.snippets&&this.options.snippets.appRequired||"Hinweis: Nur per App bedienbar.",r=this._isRequireApp(t),c=[];return a&&c.push(a),s&&c.push(s),o&&c.push(o),n&&c.push(n),r&&c.push(`<strong>${l}</strong>`),c.join("<br/>")||"Standort"}_injectMapPinStyles(){if(document.getElementById("intedia-packstation-map-pin-styles"))return;let t=document.createElement("style");t.id="intedia-packstation-map-pin-styles",t.textContent=`
33            .intedia-packstation-custom-pin { background: none !important; border: none !important; width: 48px !important; height: 48px !important; }
34            .intedia-packstation-custom-pin span {
35                display: flex; justify-content: center; align-items: center;
36                width: 48px; height: 48px; position: relative; border-radius: 50%;
37                border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
38            }
39            .intedia-packstation-custom-pin .intedia-packstation-marker-svg { width: 40px; height: 40px; }
40        `,document.head.appendChild(t)}_showMapWithLocations(t,e){if(!t||!e.length)return;let i=this,s=i.options.snippets&&i.options.snippets.select_packstation||"Als Lieferadresse übernehmen";(window.L?Promise.resolve():new Promise((t,e)=>{let i=document.createElement("link");i.rel="stylesheet",i.href="https://unpkg.com/[email protected]/dist/leaflet.css",i.crossOrigin="anonymous",document.head.appendChild(i);let s=document.createElement("script");s.src="https://unpkg.com/[email protected]/dist/leaflet.js",s.crossOrigin="anonymous",s.onload=()=>t(),s.onerror=()=>e(Error("Leaflet load failed")),document.head.appendChild(s)})).then(()=>{i._injectMapPinStyles(),t.style.display="block";let o=window.L,a=[];if(e.forEach(t=>{let e=i._getLocationCoords(t);e&&a.push({lat:e.lat,lng:e.lng,loc:t})}),0===a.length){t.style.display="none";return}let n={lat:a[0].lat,lng:a[0].lng},l=o.map(t).setView([n.lat,n.lng],a.length?14:6);if(o.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(l),a.forEach(t=>{let e=t.loc,a=i._getDhlIconConfig(e),n=o.divIcon({className:"intedia-packstation-custom-pin",iconSize:[48,48],iconAnchor:[24,48],popupAnchor:[0,-48],html:`<span style="background-color:${a.bg}">${a.icon}</span>`}),r=o.marker([t.lat,t.lng],{icon:n,loc:e}).addTo(l),c=e.place||{},d=e.name||(c.location?`${c.location.keyword||""} ${c.location.keywordId||""}`.trim():"")||"Standort",p=i._buildPopupDescription(e),h=document.createElement("div");h.innerHTML=`<div class="mb-2"><strong>${d}</strong></div><div class="small text-muted mb-2">${p}</div><button type="button" class="btn btn-sm btn-primary intedia-packstation-select-from-map">${s}</button>`;let u=h.querySelector(".intedia-packstation-select-from-map"),m=i._normalizeLocation(e);u.addEventListener("click",()=>{i._selectLocation(m),i._modal._bsModal?i._modal._bsModal.hide():i._hideModalFallback()}),r.bindPopup(h)}),a.length>1){let t=o.latLngBounds(a.map(t=>[t.lat,t.lng]));l.fitBounds(t.pad(.15))}i._modal._leafletMap=l}).catch(()=>{t.style.display="none"})}_normalizeLocation(t){let e=t.place||{},i=t.address||e.address||t.place||t,s=t.location||{},o=s.type||t.locationType||t.type,a=String(s.keywordId||t.number||t.packstationNumber||"").trim();if(!a&&(t.name||t.title||s.keyword)){let e=(t.name||t.title||s.keyword||"").match(/\d{3,}/);e&&(a=e[0].slice(-3))}return{number:a,type:"locker"===o||"P"===o?"P":"F",address:{postalCode:i.postalCode||i.postal_code||"",addressLocality:i.addressLocality||i.address_locality||i.city||""}}}
40_renderLocation(t,e,i){let s=this._normalizeLocation(t),o=t.place||{},a=t.address||o.address||t,n=[a.streetAddress||a.street_address||t.name||(o.location?`${o.location.keyword||""} ${o.location.keywordId||""}`.trim():"")||"",[s.address.postalCode,s.address.addressLocality].filter(Boolean).join(" ")].filter(Boolean).join(", ")||t.name||"Standort",l=this.options.snippets&&this.options.snippets.appRequired||"Hinweis: Nur per App bedienbar.",r=this._isRequireApp(t),c=this._getOpeningHoursToday(t),d=document.createElement("div");d.className="list-group-item list-group-item-action d-flex justify-content-between align-items-center",d.innerHTML=`
41            <div>
42                <div class="fw-bold">${n}</div>
43                ${s.number?`<small class="text-muted">Nr. ${s.number}</small>`:""}
44                ${c?`<div class="small text-muted">${c}</div>`:""}
45                ${r?`<div class="small"><strong>${l}</strong></div>`:""}
46            </div>
47            <button type="button" class="btn btn-sm btn-outline-primary">${i}</button>
48        `,d.querySelector("button").addEventListener("click",t=>{t.preventDefault(),this._selectLocation(s),this._modal._bsModal?this._modal._bsModal.hide():this._hideModalFallback()}),e.appendChild(d)}_selectLocation(t){let e=this._formId||this.el.closest("form")?.getAttribute("data-intedia-packstation-form-id");e&&document.dispatchEvent(new CustomEvent("IntediaPackstation_selectLocation-"+e,{detail:t}))}_hideModalFallback(){if(!this._modal)return;this._modal.classList.remove("show"),this._modal.style.display="none",document.body.classList.remove("modal-open");let t=document.getElementById("intedia-packstation-backdrop");t&&t.remove()}}},308:(t,e,i)=>{i.d(e,{A:()=>s});class s{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}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("."),a=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=a;a=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(o[0],a),this.listeners.push({splitEventName:o,opts:i,cb:a}),!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}}},335:(t,e,i)=>{i.d(e,{A:()=>l});var s=i(156),o=i.n(s);class a{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=a.toUpperCamelCase(t,e);return a.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>a.ucFirst(t.toLowerCase())).join(""):a.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}var n=i(308);class l{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new n.A(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),o().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=a.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=a.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}}}]);

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.