PageSourceSearch

https://cosyworld.com/theme/3ffbddcf8ecc0f64aa68da8fcd427b96/js/ko…/kommora-withdrawal-button.js?1789980521

js cosyworld.com collected 2026-09-26 11:10:21 UTC 7,980 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!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function n(t,e,r){return t.concat(e).map(function(t){return o(t,r)})}function i(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function s(t,e){try{return e in t}catch(t){return!1}}function a(t,r,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=o;var c,u,h=Array.isArray(r);return h!==Array.isArray(t)?o(r,l):h?l.arrayMerge(t,r,l):(u={},(c=l).isMergeableObject(t)&&i(t).forEach(function(e){u[e]=o(t[e],c)}),i(r).forEach(function(e){(!s(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(s(t,e)&&c.isMergeableObject(r[e])?u[e]=(function(t,e){if(!e.customMerge)return a;var r=e.customMerge(t);return"function"==typeof r?r:a})(e,c)(t[e],r[e],c):u[e]=o(r[e],c))}),u)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return a(t,r,e)},{})},t.exports=a}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var o=r(156),n=r.n(o);
1class i{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 r=i.toUpperCamelCase(t,e);return i.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>i.ucFirst(t.toLowerCase())).join(""):i.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}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]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(o),o}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this,n=t.split("."),i=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=i;i=function(r){o.unsubscribe(t),e(r)}}return this.el.addEventListener(n[0],i),this.listeners.push({splitEventName:n,opts:r,cb:i}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),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 a{constructor(t,e={},r=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${r}".`);return}this.el=t,this.$emitter=new s(this.el),this._pluginName=this._getPluginName(r),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()),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=i.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${e}-config`);return r?window.PluginConfigManager.get(this._pluginName,r):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=i.toDashCase(this._pluginName),r=this.el.getAttribute(`data-${e}-options`);if(r)try{return JSON.parse(r)}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}}class l extends a{static #t=this.options={url:"/kommora/withdrawal",label:"",buttonColor:"#dc3545",buttonTextColor:"#ffffff",customSelector:""};init(){if(document.querySelector(".kommora-withdrawal-footer-link")||!this.options.url||!this.options.label)return;let t=this._findAnchor();t&&t.appendChild(this._buildButton())}_findAnchor(){if(this.options.customSelector){let t=document.querySelector(this.options.customSelector);if(t)return t}let t=document.querySelector(".footer-column-hotline .footer-column-content-inner")||document.querySelector(".footer-contact-hotline")||document.querySelector(".footer-column-hotline");if(t)return t;let e=document.querySelector("footer.footer-main")||document.querySelector("footer");if(!e)return null;let r=e.querySelectorAll("h3, h4, h5, .footer-column-headline, [class*=headline]"),o=["hotline","service","kontakt","contact","support","help","hilfe","reach"];for(let t of r){let e=(t.textContent||"").toLowerCase();if(o.some(t=>-1!==e.indexOf(t))){let e=t.closest(".footer-column, [class*=footer-column], [class*=col-]");if(e)return e.querySelector(".footer-column-content-inner, .footer-column-content, [class*=column-content]")||e}}let n=e.querySelectorAll(".footer-column-content-inner");return n.length?n[n.length-1]:e}_buildButton(){let t=document.createElement("div");t.className="kommora-withdrawal-footer-link",t.style.marginTop="16px";let e=document.createElement("a");return e.href=this.options.url,e.className="btn btn-sm",e.textContent=this.options.label,e.style.backgroundColor=this.options.buttonColor,e.style.color=this.options.buttonTextColor,e.style.borderColor=this.options.buttonColor,t.appendChild(e),t}}class c extends a{static #t=this.options={url:"/kommora/withdrawal",label:"Widerruf",buttonColor:"#dc3545",buttonTextColor:"#ffffff"};
1init(){if(document.querySelector("[data-kommora-cart-btn]")||!this.options.url)return;let t=this._findCartAnchor();if(!t)return;let e=this._buildButton();t.parentNode.insertBefore(e,t)}_findCartAnchor(){let t=document.querySelector(".header-cart .header-cart-btn, [data-offcanvas-cart]");return t?t.closest(".header-actions-btn, .cart-widget, li, .header-action")||t:document.querySelector(".twt-element-cart, .themeware-cart-icon")||document.querySelector("[data-cart-icon], [data-cart-trigger]")}_buildButton(){let t=document.createElement("div");t.className="kommora-withdrawal-cart-action",t.setAttribute("data-kommora-cart-btn","1");let e=document.createElement("a");return e.href=this.options.url,e.className="kommora-withdrawal-cart-btn",e.setAttribute("aria-label",this.options.label),e.setAttribute("title",this.options.label),e.style.backgroundColor=this.options.buttonColor,e.style.color=this.options.buttonTextColor,e.innerHTML='<span aria-hidden="true" style="font-size: 18px; line-height: 1;">&#x21BA;</span>',t.appendChild(e),t}}let u=window.PluginManager;u.register("KommoraWithdrawalFooter",l,"[data-kommora-withdrawal-footer]"),u.register("KommoraWithdrawalCart",c,"[data-kommora-withdrawal-cart]")})();

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.