PageSourceSearch

https://www.sata-automation.com/theme/663755a7c037d1178b512aae5ff9…-e-j-post-direkt-autocomplete.js?1789403801

js sata-automation.com collected 2026-10-09 00:51:32 UTC 14,757 bytes, 14 lines download raw bytes

1(()=>{var e={202:function(e){var t;t=function(){"use strict";(t=r||(r={})).Buildings="buildings",t.Cities="cities",t.Districts="districts",t.PostalCodes="postalcodes",t.PostalCodesCities="postalcodes_cities",t.PostalCodesCitiesDistricts="postalcodes_cities_districts",t.PostalCodesCitiesDistrictsStreets="postalcodes_cities_districts_streets",t.PostalCodesCitiesStreets="postalcodes_cities_streets";var e,t,r,i,s=r;/*! *****************************************************************************
2    Copyright (c) Microsoft Corporation.
3
4    Permission to use, copy, modify, and/or distribute this software for any
5    purpose with or without fee is hereby granted.
6
7    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13    PERFORMANCE OF THIS SOFTWARE.
14    ***************************************************************************** */class n{async request(e){var t;let r=new Request(e.url,{method:e.method,headers:e.headers}),i=await fetch(r);return i.status>=200&&i.status<300?(null===(t=i.headers.get("Content-Type"))||void 0===t?void 0:t.startsWith("application/json"))?i.json():i.text():400===i.status?i.json().then(e=>{throw Error(`${i.statusText}: ${e.message}`.trim())}):i.text().then(e=>{throw Error(`${i.statusText} ${e}`.trim())})}}class o{static getAdapter(){return new n}}o.baseUrl="https://autocomplete2.postdirekt.de/autocomplete2/",o.headers={Accept:"application/json",Authorization:""};class a{constructor(e,t="GET",r={}){this.url="",this.method="GET",this.headers={},this.url=e,this.method=t,this.headers=r}}class c{constructor(e,t){this.addressTypeSupported=[s.PostalCodesCitiesDistrictsStreets,s.PostalCodesCitiesStreets],this.baseUrl=e,this.accessToken=t}create(e){let{subject:t,country:r}=e,i=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)0>t.indexOf(i[s])&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r}(e,["subject","country"]);return i.address_type&&this.addressTypeSupported.includes(t)||delete i.address_type,new a(this.buildUrl(r,t,i),"GET",Object.assign(Object.assign({},o.headers),{Authorization:"Bearer "+this.accessToken}))}buildUrl(e,t,r){let i=`${this.baseUrl}/${e}`;return`${i}/${t}`+c.buildQueryString(r)}static buildQueryString(e){let t=Object.entries(e).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&");return t&&(t="?"+t),t}}class l{constructor(e,t,r){this.adapter=r,this.requestBuilder=new c(t,e)}async search(e){return await this.adapter.request(e)}}class u extends c{create(e){return super.create(e)}}class d{constructor(e,t,r){this.adapter=r,this.requestBuilder=new u(t,e)}async select(e){return this.adapter.request(e)}}class h{static createSearchService(e){return new l(e,o.baseUrl+"search",o.getAdapter())}static createSelectService(e){return new d(e,o.baseUrl+"select",o.getAdapter())}createSearchService(e){return h.createSearchService(e)}createSelectService(e){return h.createSelectService(e)}}(p=i||(i={})).A="A",p.F="F",p.P="P";var p,y,f=i;class g{constructor(){this.suggestions=[]}getByUuid(e){return this.suggestions.find(t=>t.uuid===e)||null}}class m{constructor(e){this.inputMap=e}get address(){let e={city:"",postalCode:"",street:""};return this.inputMap.forEach((t,r)=>{e[r]=t.value}),e}set address(e){for(let[t,r]of this.inputMap)r.value=e[t],r.dispatchEvent(new Event("change"))}}(v=y||(y={})).ArrowUp="ArrowUp",v.ArrowDown="ArrowDown",v.Enter="Enter",v.Tab="Tab";var v,b,S=y;class w{render(e,t){if(!e.parentElement)throw Error("Input elements without a parent cannot be assigned a suggestion list.");this.remove(),this.currentField=e,e.setAttribute("autocomplete","none");let r=document.createElement("ul");r.setAttribute("id","datalist-"+e.id),r.setAttribute("class","datalist"),r.setAttribute("style",`width:${e.offsetWidth}px; top:${e.offsetHeight}px;`),t.map(e=>
14({id:e.uuid,title:[e.street,e.postalCode,e.city].filter(Boolean).join(", ")})).forEach(e=>{let t=document.createElement("li"),i=document.createTextNode(e.title);t.setAttribute("id",e.id),t.setAttribute("data-value",e.title),t.appendChild(i),r.appendChild(t)}),e.parentElement.appendChild(r),e.parentElement.classList.add("autocomplete-container"),r.addEventListener("mousedown",t=>{let r=t.target;this.itemSelect(r),setTimeout(()=>e.focus(),0)}),e.addEventListener("focusout",this.remove.bind(this)),this.removableEventHandler=this.navigationKeyListener.bind(this),e.addEventListener("keydown",this.removableEventHandler)}remove(){if(!this.removableEventHandler||!this.currentField)return;let e=document.querySelector(`[id="datalist-${this.currentField.id}"]`);e&&e.remove(),this.currentField.removeEventListener("keydown",this.removableEventHandler),this.currentField=void 0}navigationKeyListener(e){e.key in S&&(e.key!==S.Tab&&e.preventDefault(),this.triggerKeydown(e.key))}triggerKeydown(e){if(!this.currentField)return;let t=document.querySelector(`[id="datalist-${this.currentField.id}"]`);if(!t)return;let r=Array.from(t.children),i=t.querySelector("[data-active]"),s=r.find(()=>!0);if(i||e!==S.Enter){if(e!==S.ArrowDown||i){if(i){let s=null,n=null;r.forEach((e,t,r)=>{e===i&&(s=r[t-1],n=r[t+1])}),i.removeAttribute("data-active"),e===S.ArrowUp&&(s?(s.setAttribute("data-active","true"),s.offsetTop<t.scrollTop&&(t.scrollTop-=s.offsetHeight)):r[r.length-1].setAttribute("data-active","true")),e===S.ArrowDown&&(n?n.setAttribute("data-active","true"):r[0].setAttribute("data-active","true")),e===S.Tab&&this.currentField.focus(),[S.Enter,S.Tab].includes(e)&&this.itemSelect(i)}}else s.setAttribute("data-active","true")}}itemSelect(e){this.currentField&&(this.currentField.dataset.suggestionUuid=e.id,this.currentField.dispatchEvent(new Event("autocomplete:datalist-select")),this.remove())}}(e=b||(b={})).City="city",e.Street="street",e.PostalCode="postalCode";var E=b;class C{constructor(e){this.hintText=e}render(e){if(!e.parentElement)throw Error("Input elements without a parent cannot be assigned a infobox.");if(0===this.hintText.length)return;let t=document.createElement("div"),r=document.createElement("span");t.setAttribute("class","autocomplete-infoBox"),t.setAttribute("id","autocomplete-hint"),r.innerHTML=this.hintText,t.appendChild(r),this.infoBox=t,e.parentElement.appendChild(t)}remove(){if(this.infoBox){let e=document.getElementById("autocomplete-hint");e&&e.parentNode&&(e.parentNode.removeChild(e),this.infoBox=void 0)}}}class A{constructor(e,t,r,i,s){this.navigationKeyCodes=["ArrowUp","ArrowDown","Escape","Enter","Space","Tab"],this.typingDelay=500,this.inputMap=e,this.countrySelect=t,this.deCountryId=r,this.searchService=h.createSearchService(i),this.selectService=h.createSelectService(i),this.addressSuggestions=new g,this.domAddress=new m(this.inputMap),this.listRenderer=new w,this.hintRenderer=new C(s)}start(){for(let e of this.inputMap.values())e.addEventListener("keyup",this.handleFieldKeystroke.bind(this)),e.addEventListener("autocomplete:datalist-select",this.handleDatalistSelect.bind(this));this.countrySelect.addEventListener("change",this.handleCountryChange.bind(this))}handleFieldKeystroke(e){this.countrySelect.value===this.deCountryId&&(this.navigationKeyCodes.includes(e.code)||this.triggerDelayedCallback(()=>this.searchAction(e.target),this.typingDelay),"Enter"!==e.code&&this.hintRenderer.remove())}handleDatalistSelect(e){let t=e.target,r=t.dataset.suggestionUuid,i=this.addressSuggestions.getByUuid(r),s=this.inputMap.get(E.Street);i&&(this.domAddress.address=i,this.selectAction(i.uuid),s&&s===t&&this.hintRenderer.render(s))}handleCountryChange(){this.countrySelect.value!==this.deCountryId&&this.listRenderer.remove()}triggerDelayedCallback(e,t){this.timeoutId,clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(e,t)}searchAction(e){let t=this.domAddress.address,r=t.street?s.PostalCodesCitiesStreets:s.PostalCodesCities;""!==Object.values(t).join("").trim()&&this.searchService.search(this.searchService.requestBuilder.create({country:"de",subject:r,combined:Object.values(t).join(" "),address_type:f.A})).then(t=>{this.addressSuggestions.suggestions=t.addresses.filter(e=>!!e.uuid).map(e=>({street:e.street||"",postalCode:e.postalCode||"",city:e.city||"",uuid:e.uuid,district:e.district})),e===document.activeElement&&this.listRenderer.render(e,this.addressSuggestions.suggestions)})}selectAction(e){this.selectService.select(this.selectService.requestBuilder.create({country:"de",subject:s.PostalCodesCitiesStreets,uuid:e}))}}return{init:(e,t,r,i,s,n,o)=>{let a=new A(new Map([[E.Street,e],[E.PostalCode,r],[E.City,t]]),i,s,n,o);return a.start(),a}}},e.exports=t()},697:(e,t)=>{"use strict";
14Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._el=e,e.$emitter=this,this._listeners=[]}return e.prototype.publish=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r=!1);var i=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(i),i},e.prototype.subscribe=function(e,t,r){void 0===r&&(r={});var i=this,s=e.split("."),n=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){var o=n;n=function(t){i.unsubscribe(e),o(t)}}return this.el.addEventListener(s[0],n),this.listeners.push({splitEventName:s,opts:r,cb:n}),!0},e.prototype.unsubscribe=function(e){var t=this,r=e.split(".");return this.listeners=this.listeners.reduce(function(e,i){return i.splitEventName.sort().toString()===r.sort().toString()?t.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),e},[]),!0},e.prototype.reset=function(){var e=this;return this.listeners.forEach(function(t){e.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0},Object.defineProperty(e.prototype,"el",{get:function(){return this._el},set:function(e){this._el=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listeners",{get:function(){return this._listeners},set:function(e){this._listeners=e},enumerable:!1,configurable:!0}),e}();t.default=r},541:function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(r(697)),n=i(r(156)),o=function(){function e(e,t,r){void 0===t&&(t={}),void 0===r&&(r=!1),this.el=e,this.$emitter=new s.default(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}return e.prototype._init=function(){this._initialized||(this.init(),this._initialized=!0)},e.prototype._update=function(){this._initialized&&this.update()},e.prototype.update=function(){},e.prototype._registerInstance=function(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)},e.prototype._getPluginName=function(e){return!1===e?this.constructor.name:e},e.prototype._mergeOptions=function(e){var t=this._pluginName.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase(),r=this.parseJsonOrFail(t),i=this.el.getAttribute("data-".concat(t,"-options"))||"",s=[this.constructor.options,this.options,e];r&&s.push(window.PluginConfigManager.get(this._pluginName,r));try{i&&s.push(JSON.parse(i))}catch(e){throw Error('The data attribute "data-'.concat(t,'-options" could not be parsed to json: ').concat(e.message||""))}return n.default.all(s.filter(function(e){return e instanceof Object&&!(e instanceof Array)}).map(function(e){return e||{}}))},e.prototype.parseJsonOrFail=function(e){var t=this.el.getAttribute("data-".concat(e,"-config"))||"";try{return JSON.parse(t)}catch(e){return t}},e}();t.default=o},156:e=>{"use strict";var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function s(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function n(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||s,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=i;var l,u,d=Array.isArray(r);return d!==Array.isArray(e)?i(r,c):d?c.arrayMerge(e,r,c):(u={},(l=c).isMergeableObject(e)&&n(e).forEach(function(t){u[t]=i(e[t],l)}),n(r).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&l.isMergeableObject(r[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a})(t,l)(e[t],r[t],l):u[t]=i(r[t],l))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})},e.exports=a}},t={};function r(i){var s=t[i];if(void 0!==s)return s.exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.exports}r.n=e=>
14{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(541),t=r.n(e),i=r(202),s=r.n(i);let n={},o=e=>e.split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0);class a extends t(){init(){let e=o(this.options.streetFieldSelector+this.options.cityFieldSelector+this.options.postalCodeFieldSelector+this.options.countryFieldSelector+""),t=document.querySelector(this.options.streetFieldSelector),r=document.querySelector(this.options.cityFieldSelector),i=document.querySelector(this.options.postalCodeFieldSelector),a=document.querySelector(this.options.countryFieldSelector);s().init(t,r,i,a,this.options.deCountryId,this.options.token,this.options.hint),n[e]=e}constructor(...e){super(...e),this.options={token:null,hint:null,streetFieldSelector:null,cityFieldSelector:null,postalCodeFieldSelector:null,countryFieldSelector:null,deCountryId:null}}}window.PluginManager.register("AutocompletePlugin",a,"[data-autocomplete-plugin]")})()})();

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.