PageSourceSearch

https://s3sw-live.paulmann.com/plm-live/theme/1c76ce584aec88ab9a47…/js/pali-faq/pali-faq.js?1790261198

js paulmann.com collected 2026-09-24 20:58:37 UTC 10,978 bytes, 1 lines download raw bytes

1(()=>{"use strict";var t={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)?o(Array.isArray(t)?[]:{},t,e):t}function n(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function r(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function o(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=s;var h,u,c=Array.isArray(i);return c!==Array.isArray(t)?s(i,l):c?l.arrayMerge(t,i,l):(u={},(h=l).isMergeableObject(t)&&r(t).forEach(function(e){u[e]=s(t[e],h)}),r(i).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&h.isMergeableObject(i[e])?u[e]=(function(t,e){if(!e.customMerge)return o;var i=e.customMerge(t);return"function"==typeof i?i:o})(e,h)(t[e],i[e],h):u[e]=s(i[e],h))}),u)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return o(t,i,e)},{})},t.exports=o}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.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);var s=i(156),n=i.n(s);class r{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=r.toUpperCamelCase(t,e);return r.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.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{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,n=t.split("."),r=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=r;r=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(n[0],r),this.listeners.push({splitEventName:n,opts:i,cb:r}),!0}unsubscribe(t){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${t}.MyCustomPlugin"`);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}}class o{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 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(){}destroy(){}
1_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()),n().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=r.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=r.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}}window.PluginManager.register("PaliFaqSearch",class extends o{init(){if(this._datalistId=this.el.getAttribute("list"),!this._datalistId)return;this._datalist=document.getElementById(this._datalistId),this._minLength=this.el.minLength>0?this.el.minLength:0,this._activeOption=null,this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onKeydown=this._onKeydown.bind(this),this._onFocusOut=this._onFocusOut.bind(this);let t=this.el.dataset.suggestList;this._suggestList=t?document.getElementById(t):null,this._suggestEmpty=this._suggestList?document.getElementById(t.replace("list","empty")):null,this._emptyTimer=null,this._suggestList?(this.el.removeAttribute("list"),this._options=[...this._suggestList.querySelectorAll(".pali-faq-suggest-option")],this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-expanded","false"),this.el.setAttribute("aria-controls",this._suggestList.id),this.el.setAttribute("aria-autocomplete","list"),this._suggestList.addEventListener("mousedown",t=>{t.preventDefault()}),this._suggestList.addEventListener("click",t=>{let e=t.target.closest(".pali-faq-suggest-option");e&&this._pick(e)}),this.el.addEventListener("keydown",this._onKeydown),this.el.addEventListener("focusout",this._onFocusOut)):this.el.removeAttribute("list"),this.el.addEventListener("input",this._onInput),this.el.addEventListener("change",this._onChange)}destroy(){this._clearEmptyTimer(),this.el.removeEventListener("input",this._onInput),this.el.removeEventListener("change",this._onChange),this.el.removeEventListener("keydown",this._onKeydown),this.el.removeEventListener("focusout",this._onFocusOut)}_onInput(){if(this._suggestList){this._filter();return}this.el.value.length>=this._minLength?this.el.setAttribute("list",this._datalistId):this.el.removeAttribute("list")}_onChange(){if(!this._datalist)return;let t=this.el.value;[...this._datalist.options].some(e=>e.value===t)&&this.el.form?.requestSubmit()}_filter(){let t=this.el.value.trim().toLowerCase(),e=0;if(this._setActive(null),t.length<this._minLength){this._close();return}this._options.forEach(i=>{let s=e<8&&i.dataset.value.toLowerCase().includes(t);i.hidden=!s,s&&(e+=1)}),e>0?this._open():(this._close(),this._showEmptyAfterDelay(t))}_showEmptyAfterDelay(t){this._clearEmptyTimer(),this._suggestEmpty&&(this._emptyTimer=window.setTimeout(()=>{this.el.value.trim().toLowerCase()===t&&0===this._visibleOptions().length&&(this._suggestEmpty.hidden=!1)},1e3))}_clearEmptyTimer(){null!==this._emptyTimer&&(window.clearTimeout(this._emptyTimer),this._emptyTimer=null),this._suggestEmpty&&(this._suggestEmpty.hidden=!0)}_open(){this._suggestList.hidden=!1,this.el.setAttribute("aria-expanded","true")}_close(){this._clearEmptyTimer(),this._suggestList.hidden=!0,this.el.setAttribute("aria-expanded","false"),this._setActive(null)}_visibleOptions(){return this._options.filter(t=>!t.hidden)}_setActive(t){this._activeOption?.classList.remove("pali-faq-suggest-option-active"),this._activeOption=t??null,this._activeOption?(this._activeOption.classList.add("pali-faq-suggest-option-active"),this.el.setAttribute("aria-activedescendant",this._activeOption.id)):this.el.removeAttribute("aria-activedescendant")}_pick(t){this.el.value=t.dataset.value,this._close(),this.el.form?.requestSubmit()}_onKeydown(t){if(this._suggestList.hidden)return;let e=this._visibleOptions();if(0===e.length)return;let i=this._activeOption?e.indexOf(this._activeOption):-1;switch(t.key){case"ArrowDown":t.preventDefault(),this._setActive(e[(i+1)%e.length]);break;case"ArrowUp":t.preventDefault(),this._setActive(e[(i-1+e.length)%e.length]);break;case"Enter":this._activeOption&&(t.preventDefault(),this._pick(this._activeOption));break;case"Escape":this._close()}}_onFocusOut(){this._close()}}
1,"[data-pali-faq-search]"),window.PluginManager.register("PaliFaqReveal",class extends o{init(){this._onClick=this._onClick.bind(this),this.el.addEventListener("click",this._onClick)}_onClick(t){let e=t.target.closest(".pali-faq-more");if(!e)return;let i=e.getAttribute("href");if(!i||!i.startsWith("#"))return;t.preventDefault();let{scrollX:s,scrollY:n}=window;window.location.hash=i,window.scrollTo(s,n)}},"[data-pali-faq-reveal]"),window.PluginManager.register("PaliFaqImageModal",class extends o{init(){this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this),this.el.addEventListener("click",this.onClick)}destroy(){this.el.removeEventListener("click",this.onClick),this.close()}onClick(t){let e=t.target.closest(".pali-faq-answer img");e&&this.el.contains(e)&&(t.preventDefault(),this.open(e))}onKeydown(t){"Escape"===t.key&&this.close()}open(t){this.close();let e=document.createElement("div");e.className="pali-faq-image-modal",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.el.dataset.paliFaqImageModalLabel),e.addEventListener("click",t=>{t.target===e&&this.close()});let i=document.createElement("button");i.className="pali-faq-image-modal-close",i.type="button",i.setAttribute("aria-label",this.el.dataset.paliFaqImageModalClose),i.textContent="×",i.addEventListener("click",()=>this.close());let s=document.createElement("img");s.src=t.currentSrc||t.src,s.alt=t.alt,e.append(i,s),document.body.append(e),document.addEventListener("keydown",this.onKeydown),document.body.classList.add("pali-faq-image-modal-open"),i.focus(),this.modal=e}close(){this.modal&&(this.modal.remove(),this.modal=null,document.removeEventListener("keydown",this.onKeydown),document.body.classList.remove("pali-faq-image-modal-open"))}},"[data-pali-faq-image-modal]")})();

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.