File "wc-addons-tour.js"
Full Path: /home/amervokv/ecomlive.net/wp-content/plugins/woocommerce/assets/client/admin/wp-admin-scripts/wc-addons-tour.js
File size: 6.85 KB
MIME-type: text/plain
Charset: utf-8
/*! For license information please see wc-addons-tour.js.LICENSE.txt */
(()=>{"use strict";var e={93359:(e,o,t)=>{var r=t(99196),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};o.jsx=function(e,o,t){var r,l={},i=null,m=null;for(r in void 0!==t&&(i=""+t),void 0!==o.key&&(i=""+o.key),void 0!==o.ref&&(m=o.ref),o)a.call(o,r)&&!s.hasOwnProperty(r)&&(l[r]=o[r]);if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===l[r]&&(l[r]=o[r]);return{$$typeof:n,type:e,key:i,ref:m,props:l,_owner:c.current}}},81514:(e,o,t)=>{e.exports=t(93359)},99196:e=>{e.exports=window.React}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var a=o[r]={exports:{}};return e[r](a,a.exports,t),a.exports}t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{t.r(r);const e=window.wp.element,o=window.wc.components,n=window.wc.tracks,a=window.wp.data,c=window.wc.data,s=e=>{const o=(document.getElementById("wpadminbar")?.offsetHeight||0)+8;e.top<o?window.scrollBy(0,e.top-o):e.bottom>window.innerHeight&&window.scrollBy(0,e.bottom-window.innerHeight)},l=window.wp.i18n;var i=t(81514);const m=()=>{const[t,r]=(0,e.useState)(!0),{updateOptions:m}=(0,a.useDispatch)(c.OPTIONS_STORE_NAME),d=(()=>{const o=(0,e.createElement)("br");return[{referenceElements:{desktop:'#adminmenu a[href="admin.php?page=wc-admin&path=%2Fextensions"]'},focusElement:{desktop:'#adminmenu a[href="admin.php?page=wc-admin&path=%2Fextensions"]'},meta:{name:"wc-extensions-menu-item",heading:(0,l.__)("Welcome to the WooCommerce Marketplace","woocommerce"),descriptions:{desktop:(0,e.createInterpolateElement)((0,l.__)("Power up your store by adding extra functionality with extensions or integrate your store with other software and services.<br/><br/>Here you'll find hundreds of trusted solutions for your store — all reviewed and approved by the Woo team.<br/><br/>You can also browse the Woo Marketplace at WooCommerce.com.","woocommerce"),{br:o})}}},{referenceElements:{desktop:".woocommerce-marketplace__search"},focusElement:{desktop:".woocommerce-marketplace__search"},meta:{name:"wc-extensions-search",heading:(0,l.__)("Find exactly what you need","woocommerce"),descriptions:{desktop:(0,l.__)("Use the search box to find specific extensions or solutions.","woocommerce")}}},{referenceElements:{desktop:".woocommerce-marketplace__tab-browse"},focusElement:{desktop:".woocommerce-marketplace__tab-browse"},meta:{name:"wc-addons-categories",heading:(0,l.__)("Browse for new ideas","woocommerce"),descriptions:{desktop:(0,e.createInterpolateElement)((0,l.__)("Or if you're not sure exactly what you need, you can browse all available extensions by category.","woocommerce"),{br:o})}}},{referenceElements:{desktop:".woocommerce-marketplace__discover:first-child"},focusElement:{desktop:".woocommerce-marketplace__discover:first-child"},meta:{name:"wc-addons-featured",heading:(0,l.__)("Learn more about each product","woocommerce"),descriptions:{desktop:(0,e.createInterpolateElement)((0,l.__)("Scroll down to see all of the relevant extensions and solutions.<br/><br/>Click on any solution to learn more about its features, any installation requirements, and available documentation.","woocommerce"),{br:o})}}},{referenceElements:{desktop:".woocommerce-marketplace__header-meta"},focusElement:{desktop:".woocommerce-marketplace__header-meta"},meta:{name:"wc-addons-my-subscriptions",heading:(0,l.__)("Manage your purchases","woocommerce"),descriptions:{desktop:(0,e.createInterpolateElement)((0,l.__)("All of your Woo Marketplace purchases can be found here, or on WooCommerce.com.<br/><br/>Every purchase is backed by our <a1>30-day money-back guarantee</a1>, and includes <a2>email and live chat support</a2>.<br/><br/>That's it! You're now ready to power up your store.","woocommerce"),{a1:(0,e.createElement)("a",{href:"https://woocommerce.com/refund-policy/","aria-label":(0,l.__)("Refund policy","woocommerce")},(0,l.__)("30-day money-back guarantee","woocommerce")),a2:(0,e.createElement)("a",{href:"https://woocommerce.com/my-account/create-a-ticket/","aria-label":(0,l.__)("Contact support","woocommerce")},(0,l.__)("email and live chat support","woocommerce")),br:o})}}}]})();if((0,e.useEffect)((()=>{if("true"===new URLSearchParams(location.search).get("tutorial")){const e=((e,o,t)=>{const a=document.querySelector(e);let c=a?.getBoundingClientRect().top;const s=setInterval((()=>{const e=a?.getBoundingClientRect().top;c===e&&((()=>{const e=d[0]?.meta?.name;r(!0),(0,n.recordEvent)("in_app_marketplace_tour_started",{step:e})})(),clearInterval(s)),c=e}),500);return s})(d[0].referenceElements?.desktop||"");return()=>clearInterval(e)}}),[]),(0,e.useEffect)((()=>{if(t){function e(){const e=document.querySelector(".tour-kit-frame__container");e&&s(e.getBoundingClientRect())}const o=setTimeout(e,500),r=((e,o,t)=>{const r=document.querySelector(".woocommerce-marketplace");let n=r?.offsetTop;return setInterval((()=>{const e=r?.offsetTop;n!==e&&o(),n=e}),150)})(0,e);return()=>{clearTimeout(o),clearInterval(r)}}}),[t]),!t)return null;const p=(({closeHandler:e,onNextStepHandler:o,autoScrollBlock:t,steps:r})=>{let n=null,a=null;const c="top-start";return{placement:c,options:{effects:{spotlight:{interactivity:{enabled:!0,rootElementSelector:".woocommerce-marketplace"}},autoScroll:{behavior:"auto",block:t}},popperModifiers:[{name:"offset",options:{offset:[20,20]}},{name:"flip",options:{allowedAutoPlacements:["right","bottom","top"],fallbackPlacements:["bottom-start","right"],flipVariations:!1,boundry:"clippingParents"}},{name:"inAppTourPopperModifications",enabled:!0,phase:"read",fn({state:e,instance:o}){if(a!==e.elements.reference){const t=e.elements.reference.closest("#adminmenu")?"right":c;e.placement!==t&&o.setOptions({placement:t})}const t=e.elements.popper.getBoundingClientRect(),r=e.elements.arrow?.getBoundingClientRect(),l=r?.height||0;a!==e.elements.reference&&0!==l&&n!==t.top&&(s(t),n=t.top,a=e.elements.reference)}}],callbacks:{onNextStep:o}},steps:r,closeHandler:e}})({closeHandler:(e,o)=>{r(!1),m({woocommerce_admin_dismissed_in_app_marketplace_tour:"yes"});const t=new URL(window.location.href);if(t.searchParams.delete("tutorial"),window.history.replaceState(null,"",t),d.length-1===o)(0,n.recordEvent)("in_app_marketplace_tour_completed");else{const t=e[o]?.meta?.name;(0,n.recordEvent)("in_app_marketplace_tour_dismissed",{step:t})}},onNextStepHandler:e=>{const o=d[e]?.meta?.name||"";(0,n.recordEvent)("in_app_marketplace_tour_step_viewed",{step:o})},autoScrollBlock:"center",steps:d});return(0,i.jsx)(o.TourKit,{config:p})},d=document.createElement("div");d.setAttribute("id","wc-addons-tour-root"),(0,e.createRoot)(document.body.appendChild(d)).render((0,i.jsx)(m,{}))})(),(window.wc=window.wc||{}).wcAddonsTour=r})();