// source --> https://miniandme-handmade.de/wp-content/plugins/woocommerce-germanized/build/static/unit-price-observer.js?ver=3.18.6 
/******/ (function() { // webpackBootstrap
var __webpack_exports__ = {};
/*global wc_gzd_unit_price_observer_params, accounting */
;
(function ($, window, document, undefined) {
  var GermanizedUnitPriceObserver = function ($wrapper) {
    var self = this;
    self.params = wc_gzd_unit_price_observer_params;
    self.$wrapper = $wrapper.closest(self.params.wrapper);
    self.$form = self.$wrapper.find('.variations_form, .cart').length > 0 ? self.$wrapper.find('.variations_form, .cart') : false;
    self.isVar = self.$form ? self.$form.hasClass('variations_form') : false;
    self.$product = self.$wrapper.closest('.product');
    self.requests = [];
    self.observer = {};
    self.timeout = false;
    self.priceData = false;
    self.productId = 0;
    if (self.$wrapper.length <= 0) {
      self.$wrapper = self.$product;
    }
    self.replacePrice = self.$wrapper.hasClass('bundled_product') ? false : self.params.replace_price;
    if ("MutationObserver" in window || "WebKitMutationObserver" in window || "MozMutationObserver" in window) {
      self.$wrapper.addClass('has-unit-price-observer');
      self.initObservers(self);
      if (self.isVar && self.$form) {
        self.productId = parseInt(self.$form.find('input[name=product_id]').length > 0 ? self.$form.find('input[name=product_id]').val() : self.$form.data('product_id'));
        self.variationId = parseInt(self.$form.find('input[name=variation_id]').length > 0 ? self.$form.find('input[name=variation_id]').val() : 0);
        if (self.$form.find('input[name=variation_id]').length <= 0) {
          self.variationId = parseInt(self.$form.find('input.variation_id').length > 0 ? self.$form.find('input.variation_id').val() : 0);
        }
        self.$form.on('reset_data.unit-price-observer', {
          GermanizedUnitPriceObserver: self
        }, self.onResetVariation);
        self.$form.on('found_variation.unit-price-observer', {
          GermanizedUnitPriceObserver: self
        }, self.onFoundVariation);
      } else {
        if (self.$form && self.$form.find('*[name=add-to-cart][type=submit]').length > 0) {
          self.productId = parseInt(self.$form.find('*[name=add-to-cart][type=submit]').val());
        } else if (self.$form && self.$form.data('product_id')) {
          self.productId = parseInt(self.$form.data('product_id'));
        } else {
          var classList = self.$product.attr('class').split(/\s+/);

          /**
           * Check whether we may find the post/product by a class added by Woo, e.g. post-64
           */
          $.each(classList, function (index, item) {
            if ('post-' === item.substring(0, 5)) {
              var postId = parseInt(item.substring(5).replace(/[^0-9]/g, ''));
              if (postId > 0) {
                self.productId = postId;
                return true;
              }
            }
          });

          /**
           * Do only use the add to cart button attribute as fallback as there might be a lot of
           * other product/add to cart buttons within a single product main product wrap (e.g. related products).
           */
          if (self.productId <= 0 && 1 === self.$product.find('a.ajax_add_to_cart[data-product_id], a.add_to_cart_button[data-product_id]').length) {
            self.productId = parseInt(self.$product.find('a.ajax_add_to_cart, a.add_to_cart_button').data('product_id'));
          }
        }
      }
      if (self.productId <= 0) {
        self.destroy(self);
        return false;
      }
      if (self.params.refresh_on_load) {
        $.each(self.params.price_selector, function (priceSelector, priceArgs) {
          var isPrimary = priceArgs.hasOwnProperty('is_primary_selector') ? priceArgs['is_primary_selector'] : false,
            $price = self.getPriceNode(self, priceSelector, isPrimary),
            $unitPrice = self.getUnitPriceNode(self, $price);

          /**
           * Do only refresh primary price nodes on load.
           */
          if (!isPrimary) {
            return;
          }
          if ($unitPrice.length > 0) {
            self.stopObserver(self, priceSelector);
            self.setUnitPriceLoading(self, $unitPrice);
            setTimeout(function () {
              self.stopObserver(self, priceSelector);
              var priceData = self.getCurrentPriceData(self, priceSelector, priceArgs['is_total_price'], isPrimary, priceArgs['quantity_selector']);
              if (priceData) {
                self.refreshUnitPrice(self, priceData, priceSelector, isPrimary);
              } else if ($unitPrice.length > 0) {
                self.unsetUnitPriceLoading(self, $unitPrice);
              }
              self.startObserver(self, priceSelector, isPrimary);
            }, 250);
          }
        });
      }
    }
    $wrapper.data('unitPriceObserver', self);
  };
  GermanizedUnitPriceObserver.prototype.destroy = function (self) {
    self = self || this;
    self.cancelObservers(self);
    if (self.$form) {
      self.$form.off('.unit-price-observer');
    }
    self.$wrapper.removeClass('has-unit-price-observer');
  };
  GermanizedUnitPriceObserver.prototype.getTextWidth = function ($element) {
    var htmlOrg = $element.html();
    var html_calc = '<span>' + htmlOrg + '</span>';
    $element.html(html_calc);
    var textWidth = $element.find('span:first').width();
    $element.html(htmlOrg);
    return textWidth;
  };
  GermanizedUnitPriceObserver.prototype.getPriceNode = function (self, priceSelector, isPrimarySelector) {
    isPrimarySelector = typeof isPrimarySelector === 'undefined' ? false : isPrimarySelector;
    var $node = self.$wrapper.find(priceSelector + ':not(.price-unit):visible').not('.variations_form .single_variation .price').first();
    if (isPrimarySelector && self.isVar && ($node.length <= 0 || !self.replacePrice)) {
      $node = self.$wrapper.find('.woocommerce-variation-price span.price:not(.price-unit):visible:last');
    } else if (isPrimarySelector && $node.length <= 0) {
      $node = self.$wrapper.find('.price:not(.price-unit):visible:last');
    }
    return $node;
  };
  GermanizedUnitPriceObserver.prototype.getObserverNode = function (self, priceSelector, isPrimarySelector) {
    var $node = self.getPriceNode(self, priceSelector, isPrimarySelector);
    if (isPrimarySelector && self.isVar && !self.replacePrice) {
      $node = self.$wrapper.find('.single_variation:last');
    }
    return $node;
  };
  GermanizedUnitPriceObserver.prototype.getUnitPriceNode = function (self, $price) {
    if ($price.length <= 0) {
      return [];
    }
    var isSingleProductBlock = $price.parents('.wp-block-woocommerce-product-price[data-is-descendent-of-single-product-template]').length > 0;
    if ('SPAN' === $price[0].tagName) {
      return self.$wrapper.find('.price-unit');
    } else {
      if (isSingleProductBlock) {
        return self.$wrapper.find('.wp-block-woocommerce-gzd-product-unit-price[data-is-descendent-of-single-product-template] .price-unit');
      } else {
        return self.$wrapper.find('.price-unit:not(.wc-gzd-additional-info-placeholder, .wc-gzd-additional-info-loop)');
      }
    }
  };
  GermanizedUnitPriceObserver.prototype.stopObserver = function (self, priceSelector) {
    var observer = self.getObserver(self, priceSelector);
    if (observer) {
      observer.disconnect();
    }
  };
  GermanizedUnitPriceObserver.prototype.startObserver = function (self, priceSelector, isPrimary) {
    var observer = self.getObserver(self, priceSelector),
      $node = self.getObserverNode(self, priceSelector, isPrimary);
    if (observer) {
      self.stopObserver(self, priceSelector);
      if ($node.length > 0) {
        observer.observe($node[0], {
          childList: true,
          subtree: true,
          characterData: true
        });
      }
      return true;
    }
    return false;
  };
  GermanizedUnitPriceObserver.prototype.initObservers = function (self) {
    if (Object.keys(self.observer).length !== 0) {
      return;
    }
    $.each(self.params.price_selector, function (priceSelector, priceArgs) {
      var isPrimary = priceArgs.hasOwnProperty('is_primary_selector') ? priceArgs['is_primary_selector'] : false,
        $observerNode = self.getObserverNode(self, priceSelector, isPrimary),
        currentObserver = false;
      if ($observerNode.length > 0) {
        // Callback function to execute when mutations are observed
        var callback = function (mutationsList, observer) {
          var $node = self.getPriceNode(self, priceSelector, isPrimary);

          /**
           * Clear the timeout and abort open AJAX requests as
           * a new mutation has been observed
           */
          if (self.timeout) {
            clearTimeout(self.timeout);
          }
          if ($node.length <= 0) {
            return false;
          }
          var $unitPrice = self.getUnitPriceNode(self, $node),
            hasRefreshed = false;
          self.stopObserver(self, priceSelector);
          if ($unitPrice.length > 0) {
            self.setUnitPriceLoading(self, $unitPrice);
          }

          /**
           * Need to use a tweak here to make sure our variation listener
           * has already adjusted the variationId (in case necessary).
           */
          self.timeout = setTimeout(function () {
            self.stopObserver(self, priceSelector);
            var priceData = self.getCurrentPriceData(self, priceSelector, priceArgs['is_total_price'], isPrimary, priceArgs['quantity_selector']);
            if (priceData) {
              /**
               * Do only fire AJAX requests in case no other requests (e.g. from other plugins) are currently running.
               */
              if ($.active <= 0) {
                hasRefreshed = true;
                self.refreshUnitPrice(self, priceData, priceSelector, isPrimary);
              }
            }
            if (!hasRefreshed && $unitPrice.length > 0) {
              self.unsetUnitPriceLoading(self, $unitPrice);
            }
            self.startObserver(self, priceSelector, isPrimary);
          }, 500);
        };
        if ("MutationObserver" in window) {
          currentObserver = new window.MutationObserver(callback);
        } else if ("WebKitMutationObserver" in window) {
          currentObserver = new window.WebKitMutationObserver(callback);
        } else if ("MozMutationObserver" in window) {
          currentObserver = new window.MozMutationObserver(callback);
        }
        if (currentObserver) {
          self.observer[priceSelector] = currentObserver;
          self.startObserver(self, priceSelector, isPrimary);
        }
      }
    });
  };
  GermanizedUnitPriceObserver.prototype.getObserver = function (self, priceSelector) {
    if (self.observer.hasOwnProperty(priceSelector)) {
      return self.observer[priceSelector];
    }
    return false;
  };
  GermanizedUnitPriceObserver.prototype.cancelObservers = function (self) {
    for (var key in self.observer) {
      if (self.observer.hasOwnProperty(key)) {
        self.observer[key].disconnect();
        delete self.observer[key];
      }
    }
  };

  /**
   * Reset all fields.
   */
  GermanizedUnitPriceObserver.prototype.onResetVariation = function (event) {
    var self = event.data.GermanizedUnitPriceObserver;
    self.variationId = 0;
  };
  GermanizedUnitPriceObserver.prototype.onFoundVariation = function (event, variation) {
    var self = event.data.GermanizedUnitPriceObserver;
    if (variation.hasOwnProperty('variation_id')) {
      self.variationId = parseInt(variation.variation_id);
    }
    self.initObservers(self);
  };
  GermanizedUnitPriceObserver.prototype.getCurrentPriceData = function (self, priceSelector, isTotalPrice, isPrimary, quantitySelector) {
    quantitySelector = quantitySelector && '' !== quantitySelector ? quantitySelector : self.params.qty_selector;
    var $price = self.getPriceNode(self, priceSelector, isPrimary);
    if ($price.length > 0) {
      // Add a tmp hidden class to detect hidden elements in cloned obj
      $price.find(':hidden').addClass('wc-gzd-is-hidden');
      var $unit_price = self.getUnitPriceNode(self, $price),
        $priceCloned = $price.clone();

      // Remove price suffix from cloned DOM element to prevent finding the wrong (sale) price
      $priceCloned.find('.woocommerce-price-suffix').remove();
      $priceCloned.find('.wc-gzd-is-hidden').remove();
      var sale_price = '',
        $priceInner = $priceCloned.find('.amount:first'),
        $qty = $(self.params.wrapper + ' ' + quantitySelector + ':first'),
        qty = 1;
      if ($qty.length > 0) {
        qty = parseFloat($qty.val());
      }

      /**
       * In case the price element does not contain the default Woo price structure
       * search the whole element.
       */
      if ($priceInner.length <= 0) {
        if ($priceCloned.find('.price').length > 0) {
          $priceInner = $priceCloned.find('.price');
        } else {
          $priceInner = $priceCloned;
        }
      }
      var price = self.getRawPrice($priceInner, self.params.price_decimal_sep);

      /**
       * Is sale?
       */
      if ($priceCloned.find('.amount').length > 1) {
        // The second .amount element is the sale price
        var $sale_price = $($priceCloned.find('.amount')[1]);
        sale_price = self.getRawPrice($sale_price, self.params.price_decimal_sep);
      }
      $price.find('.wc-gzd-is-hidden').removeClass('wc-gzd-is-hidden');
      if ($unit_price.length > 0 && price) {
        if (isTotalPrice) {
          price = parseFloat(price) / qty;
          if (sale_price) {
            sale_price = parseFloat(sale_price) / qty;
          }
        }
        return {
          'price': price,
          'unit_price': $unit_price,
          'sale_price': sale_price,
          'quantity': qty
        };
      }
    }
    return false;
  };
  GermanizedUnitPriceObserver.prototype.getCurrentProductId = function (self) {
    var productId = self.productId;
    if (self.variationId > 0) {
      productId = self.variationId;
    }
    return parseInt(productId);
  };
  GermanizedUnitPriceObserver.prototype.getRawPrice = function ($el, decimal_sep) {
    var price_raw = $el.length > 0 ? $el.text() : '',
      price = false;
    try {
      price = accounting.unformat(price_raw, decimal_sep);
    } catch (e) {
      price = false;
    }
    return price;
  };
  GermanizedUnitPriceObserver.prototype.setUnitPriceLoading = function (self, $unit_price) {
    var unitPriceOrg = $unit_price.html();
    if (!$unit_price.hasClass('wc-gzd-loading')) {
      var textWidth = self.getTextWidth($unit_price),
        textHeight = $unit_price.find('span').length > 0 ? $unit_price.find('span').innerHeight() : $unit_price.height();
      /**
       * @see https://github.com/zalog/placeholder-loading
       */
      $unit_price.html('<span class="wc-gzd-placeholder-loading"><span class="wc-gzd-placeholder-row" style="height: ' + $unit_price.height() + 'px;"><span class="wc-gzd-placeholder-row-col-4" style="width: ' + textWidth + 'px; height: ' + textHeight + 'px;"></span></span></span>');
      $unit_price.addClass('wc-gzd-loading');
      $unit_price.data('org-html', unitPriceOrg);
    } else {
      unitPriceOrg = $unit_price.data('org-html');
    }
    return unitPriceOrg;
  };
  GermanizedUnitPriceObserver.prototype.unsetUnitPriceLoading = function (self, $unit_price, newHtml) {
    newHtml = newHtml || $unit_price.data('org-html');
    $unit_price.html(newHtml);
    if ($unit_price.hasClass('wc-gzd-loading')) {
      $unit_price.removeClass('wc-gzd-loading');
    }
    if (typeof newHtml === "string" && newHtml.length > 0) {
      $unit_price.show();
    }
  };
  GermanizedUnitPriceObserver.prototype.refreshUnitPrice = function (self, priceData, priceSelector, isPrimary) {
    germanized.unit_price_observer_queue.add(self, self.getCurrentProductId(self), priceData, priceSelector, isPrimary);
  };

  /**
   * Function to call wc_gzd_variation_form on jquery selector.
   */
  $.fn.wc_germanized_unit_price_observer = function () {
    if ($(this).data('unitPriceObserver')) {
      $(this).data('unitPriceObserver').destroy();
    }
    new GermanizedUnitPriceObserver(this);
    return this;
  };
  $(function () {
    if (typeof wc_gzd_unit_price_observer_params !== 'undefined') {
      $(wc_gzd_unit_price_observer_params.wrapper).each(function () {
        if ($(this).is('body')) {
          return;
        }
        $(this).wc_germanized_unit_price_observer();
      });
    }
  });
})(jQuery, window, document);
window.germanized = window.germanized || {};
((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["unit-price-observer"] = __webpack_exports__;
/******/ })()
;
// source --> https://miniandme-handmade.de/wp-content/uploads/dynamic_avia/avia-head-scripts-1d96794713bdafc3a0c4f6582e44d6a9---69b3864a007b1.js 
;var aviaJS=aviaJS||{};(function(){'use strict';if(!aviaJS.aviaJSHelpers){class aviaJSHelpers{constructor(){this.wpHooks()};debounce(callback,wait,immediate){var i;return function(){var e=this,s=arguments,t=function(){i=null;if(!immediate){callback.apply(e,s)}},l=immediate&&!i;clearTimeout(i);i=setTimeout(t,wait);if(l){callback.apply(e,s)}}};wpHooks(){if(window['wp']&&wp.hooks){return};if(!window['wp']){window['wp']={hooks:{}}}
else{window['wp'].hooks={}};let obj=window['wp'].hooks;obj.applyFilters=this.wpHooks_applyFilters;obj.doAction=this.wpHooks_applyFilters;obj.hasFilter=this.wpHooks_hasFilters;obj.hasAction=this.wpHooks_hasFilters};wpHooks_applyFilters(handle,value){return value};wpHooks_hasFilters(handle,namespace){return!1}};aviaJS.aviaJSHelpers=new aviaJSHelpers()};if(!aviaJS.aviaPlugins){class aviaPlugins{plugins=[];defaultPlugin={classFactory:null,selector:''};constructor(){this.plugins=[]};register(classFactory,selector){if('function'!=typeof classFactory){return!1};let newPlugin=Object.assign({},this.defaultPlugin);if('string'!=typeof selector){selector='body'};newPlugin.classFactory=classFactory;newPlugin.selector=selector;this.plugins.push(newPlugin);this.check_bind()};check_bind(){if(document.readyState==='complete'){this.bind_plugins()}
else{document.addEventListener('readystatechange',this.bind_plugins.bind(this))}};bind_plugins(e){if(document.readyState!=='complete'){return};let plugins=this.plugins;this.plugins=[];for(let plugin of plugins){let elements=document.querySelectorAll(plugin.selector);for(let element of elements){plugin.classFactory(element)}}}};aviaJS.aviaPlugins=new aviaPlugins()}})();