/*global ajaxurl, wc_product_import_params */ ;(function ( $, window ) { /** * productImportForm handles the import process. */ var productImportForm = function( $form ) { this.$form = $form; this.xhr = false; this.mapping = wc_product_import_params.mapping; this.position = 0; this.file = wc_product_import_params.file; this.update_existing = wc_product_import_params.update_existing; this.delimiter = wc_product_import_params.delimiter; this.security = wc_product_import_params.import_nonce; // Number of import successes/failures. this.imported = 0; this.failed = 0; this.updated = 0; this.skipped = 0; // Initial state. this.$form.find('.woocommerce-importer-progress').val( 0 ); this.run_import = this.run_import.bind( this ); // Start importing. this.run_import(); }; /** * Run the import in batches until finished. */ productImportForm.prototype.run_import = function() { var $this = this; $.ajax( { type: 'POST', url: ajaxurl, data: { action : 'woocommerce_do_ajax_product_import', position : $this.position, mapping : $this.mapping, file : $this.file, update_existing : $this.update_existing, delimiter : $this.delimiter, security : $this.security }, dataType: 'json', success: function( response ) { if ( response.success ) { $this.position = response.data.position; $this.imported += response.data.imported; $this.failed += response.data.failed; $this.updated += response.data.updated; $this.skipped += response.data.skipped; $this.$form.find('.woocommerce-importer-progress').val( response.data.percentage ); if ( 'done' === response.data.position ) { var file_name = wc_product_import_params.file.split( '/' ).pop(); window.location = response.data.url + '&products-imported=' + parseInt( $this.imported, 10 ) + '&products-failed=' + parseInt( $this.failed, 10 ) + '&products-updated=' + parseInt( $this.updated, 10 ) + '&products-skipped=' + parseInt( $this.skipped, 10 ) + '&file-name=' + file_name; } else { $this.run_import(); } } } } ).fail( function( response ) { window.console.log( response ); } ); }; /** * Function to call productImportForm on jQuery selector. */ $.fn.wc_product_importer = function() { new productImportForm( this ); return this; }; $( '.woocommerce-importer' ).wc_product_importer(); })( jQuery, window ); /*! elementor-pro - v3.15.0 - 09-08-2023 */ @keyframes e-hotspot-soft-beat{0%{transform:scale(1)}to{transform:scale(1.1)}}@keyframes e-hotspot-expand{0%{transform:scale(.5);opacity:1}to{transform:scale(1.5);opacity:0}}.elementor-widget-hotspot{display:flex;justify-content:var(--background-align)}.elementor-widget-hotspot .elementor-widget-container{position:relative;display:inline-block;width:var(--container-width);max-width:var(--container-max-width);height:var(--container-height)}.elementor-widget-hotspot .elementor-widget-container>img{display:block;width:var(--image-width,auto);height:var(--container-height);opacity:var(--opacity,1)}.e-hotspot{z-index:1;display:flex;align-items:center;justify-content:center;position:absolute}.e-hotspot--position-left.e-hotspot--position-top{transform:translate(calc(-1 * var(--hotspot-translate-x)),calc(-1 * var(--hotspot-translate-y)))}.e-hotspot--position-left.e-hotspot--position-bottom{transform:translate(calc(-1 * var(--hotspot-translate-x)),var(--hotspot-translate-y))}.e-hotspot--position-right.e-hotspot--position-top{transform:translate(var(--hotspot-translate-x),calc(-1 * var(--hotspot-translate-y)))}.e-hotspot--position-right.e-hotspot--position-bottom{transform:translate(var(--hotspot-translate-x),var(--hotspot-translate-y))}.e-hotspot--active{z-index:2}.e-hotspot__inner-circle,.e-hotspot__outer-circle{content:"";display:inline-block;box-sizing:content-box;border-radius:50%}.e-hotspot__inner-circle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:var(--hotspot-color);padding:calc(var(--hotspot-size, 18px) / 2)}.e-hotspot__outer-circle{background-color:var(--hotspot-color);padding:var(--hotspot-padding,4px)}.e-hotspot--icon .e-hotspot__button,.e-hotspot__outer-circle{width:var(--hotspot-size,18px);height:var(--hotspot-size,18px)}.e-hotspot--icon .e-hotspot__button{line-height:0;box-sizing:content-box;font-size:var(--hotspot-size,18px)}.e-hotspot__icon,.e-hotspot__label{display:flex;justify-content:center;align-items:center}.e-hotspot__icon svg,.e-hotspot__label svg{height:var(--hotspot-size,18px);width:auto}.e-hotspot__button{cursor:pointer;position:relative;display:grid;grid-auto-flow:column;justify-content:center;color:var(--hotspot-color);font-size:var(--hotspot-size,18px);min-width:var(--hotspot-button-width);min-height:var(--hotspot-button-height)}.e-hotspot__button:before{z-index:-2;content:"";width:100%;height:100%;left:-5px;top:-5px;position:absolute;padding:5px;box-sizing:content-box}.e-hotspot__button svg{fill:var(--hotspot-color)}.e-hotspot:not(.e-hotspot--circle) .e-hotspot__button{min-width:var(--hotspot-min-width);min-height:var(--hotspot-min-height);background-color:var(--hotspot-box-color);padding:var(--hotspot-padding,4px);border-radius:var(--hotspot-border-radius,3px)}.e-hotspot:not(.e-hotspot--circle) .e-hotspot__button:before{border-radius:var(--hotspot-border-radius,3px)}.e-hotspot:not(.e-hotspot--circle) .e-hotspot--expand:before{background-color:var(--hotspot-box-color)}.e-hotspot--overlay{opacity:.7;transition:opacity .2s}.e-hotspot--active .e-hotspot--overlay,.e-hotspot--overlay:hover{opacity:1}.e-hotspot--soft-beat{animation:e-hotspot-soft-beat .7s infinite alternate;animation-timing-function:ease}.e-hotspot--expand .e-hotspot__outer-circle{animation:e-hotspot-expand 2s infinite}.e-hotspot:not(.e-hotspot--circle) .e-hotspot--expand:before{content:"";width:100%;height:100%;position:absolute;z-index:-1;opacity:0;animation:e-hotspot-expand 2s infinite}.e-hotspot--sequenced{animation:fadeIn .3s;animation-iteration-count:1;animation-fill-mode:both}.e-hotspot__direction-mask{overflow:hidden;position:absolute;pointer-events:none}.e-hotspot__tooltip{white-space:var(--white-space,nowrap);transition-property:transform,opacity;transition-duration:var(--tooltip-transition-duration,.5s);transform-origin:center center;position:absolute;pointer-events:none;color:var(--tooltip-text-color,#fff);text-align:var(--tooltip-align);min-width:var(--tooltip-min-width);padding:var(--tooltip-padding,8px);border-radius:var(--tooltip-border-radius);background-color:var(--tooltip-color)}.e-hotspot__tooltip p:last-of-type{margin-bottom:0}.e-hotspot__direction-mask .e-hotspot__tooltip{box-shadow:none!important;position:static}.e-hotspot--active .e-hotspot__tooltip{pointer-events:visible}.e-hotspot--fade-in-out{opacity:0}.e-hotspot--active .e-hotspot--fade-in-out{opacity:1}.e-hotspot--fade-grow{opacity:0;transform:scale(0)}.e-hotspot--active .e-hotspot--fade-grow{opacity:1;transform:scale(1)}.e-hotspot--override-tooltip-animation-from-top,.e-hotspot--tooltip-animation-from-top{transform:translateY(calc(-100% - 1px))}.e-hotspot--override-tooltip-animation-from-left,.e-hotspot--tooltip-animation-from-left{transform:translate(calc(-100% - 1px))}.e-hotspot--override-tooltip-animation-from-right,.e-hotspot--tooltip-animation-from-right{transform:translate(calc(100% + 1px))}.e-hotspot--override-tooltip-animation-from-bottom,.e-hotspot--tooltip-animation-from-bottom{transform:translateY(calc(100% + 1px))}.e-hotspot--fade-direction{opacity:0}.e-hotspot--active .e-hotspot--fade-direction,.e-hotspot--active .e-hotspot--slide-direction{transform:translate(0) scale(1);opacity:1}.e-hotspot--show-tooltip{transition:none;opacity:1;pointer-events:visible;transform:translate(0)}