/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
woocommerce
/
assets
/
js
/
admin
/
Upload File
HOME
!function(h,v,d){h(function(){if(void 0!==v){window.wcTracks=window.wcTracks||{},window.wcTracks.recordEvent=window.wcTracks.recordEvent||function(){};var l=!1;v.suggestions_data&&(!function t(d){var u=[];h(".marketplace-suggestions-container").each(function(){var a=this.dataset.marketplaceSuggestionsContext,t=function c(t,e){var a=_.filter(t,function(t){return _.isArray(t.context)?_.contains(t.context,e):e===t.context});return a=_.filter(a,function(t){return!_.contains(v.dismissed_suggestions,t.slug)}),a=_.filter(a,function(t){return!_.contains(v.active_plugins,t.product)}),a=_.filter(a,function(t){return!t["show-if-active"]||0<_.intersection(v.active_plugins,t["show-if-active"]).length})}(d,a),s=_.sample(t,5);for(var e in s){var n=s[e]["link-text"],o=!0;s[e]["link-text"]&&(n=s[e]["link-text"],o=!1);var i=!0;!1===s[e]["allow-dismiss"]&&(i=!1);var r=p(a,s[e].product,s[e].promoted,s[e].slug,s[e].icon,s[e].title,s[e].copy,s[e].url,n,o,i);h(this).append(r),h(this).addClass("showing-suggestion"),u.push(a),m(a)||window.wcTracks.recordEvent("marketplace_suggestion_displayed",{suggestion_slug:s[e].slug,context:a,product:s[e].product||"",promoted:s[e].promoted||"",target:s[e].url||""})}h("ul.product_data_tabs li.marketplace-suggestions_options a").click(function(t){if(t.preventDefault(),"#marketplace_suggestions"!==l&&m(a))for(var e in s)window.wcTracks.recordEvent("marketplace_suggestion_displayed",{suggestion_slug:s[e].slug,context:a,product:s[e].product||"",promoted:s[e].promoted||"",target:s[e].url||""})})}),function a(t){var e=0<_.intersection(t,["products-list-empty-body","orders-list-empty-body"]).length;e&&(h("#screen-meta-links").hide(),h("#wpfooter").hide()),e||(h('.marketplace-suggestions-container[data-marketplace-suggestions-context="products-list-empty-header"]').hide(),h('.marketplace-suggestions-container[data-marketplace-suggestions-context="products-list-empty-footer"]').hide(),h('.marketplace-suggestions-container[data-marketplace-suggestions-context="orders-list-empty-header"]').hide(),h('.marketplace-suggestions-container[data-marketplace-suggestions-context="orders-list-empty-footer"]').hide())}(u),g()}(v.suggestions_data),h("ul.product_data_tabs").on("click","li a",function(t){t.preventDefault(),l=h(this).attr("href")})),function e(){h("a.marketplace-suggestion-manage-link").on("click",function(){window.wcTracks.recordEvent("marketplace_suggestions_manage_clicked")})}()}function f(e,a,s,n,o){var t=document.createElement("a");return t.classList.add("suggestion-dismiss"),t.setAttribute("title",v.i18n_marketplace_suggestions_dismiss_tooltip),t.setAttribute("href","#"),t.onclick=function(t){t.preventDefault(),function c(t,e,a,s,n){if(h("[data-suggestion-slug="+n+"]").fadeOut(function(){h(this).remove(),g()}),jQuery.post(d,{action:"woocommerce_add_dismissed_marketplace_suggestion",_wpnonce:v.dismiss_suggestion_nonce,slug:n}),_.contains(["products-list-inline"],t)){var o="woocommerce_snooze_suggestions__"+t;Cookies.set(o,"true",{expires:2});var i="woocommerce_dismissed_suggestions__"+t,r=parseInt(Cookies.get(i),10)||0;Cookies.set(i,r+1,{expires:31})}window.wcTracks.recordEvent("marketplace_suggestion_dismissed",{suggestion_slug:n,context:t,product:e||"",promoted:a||"",target:s||""})}(e,a,s,n,o)},t}function k(t,e,a,s,n,o,i){var r=document.createElement("a"),c=function u(e,t){var a=v.in_app_purchase_params;a.utm_source="unknown",a.utm_campaign="marketplacesuggestions",a.utm_medium="product";var s=_.findKey({productstable:["products-list-inline"],productsempty:["products-list-empty-header","products-list-empty-footer","products-list-empty-body"],ordersempty:["orders-list-empty-header","orders-list-empty-footer","orders-list-empty-body"],editproduct:["product-edit-meta-tab-header","product-edit-meta-tab-footer","product-edit-meta-tab-body"]},function(t){return _.contains(t,e)});return s&&(a.utm_source=s),t+"?"+jQuery.param(a)}(t,n);r.setAttribute("href",c);if(_.includes(["product-edit-meta-tab-header","product-edit-meta-tab-footer","product-edit-meta-tab-body"],t)&&r.setAttribute("target","blank"),r.textContent=o,r.onclick=function(){window.wcTracks.recordEvent("marketplace_suggestion_clicked",{suggestion_slug:s,context:t,product:e||"",promoted:a||"",target:n||""})},i)r.classList.add("button");else{r.classList.add("linkout");var d=document.createElement("span");d.classList.add("dashicons","dashicons-external"),r.appendChild(d)}return r}function p(t,e,a,s,n,o,i,r,c,d,u){var l=document.createElement("div");l.classList.add("marketplace-suggestion-container"),l.dataset.suggestionSlug=s;var p=function g(t){if(!t)return null;var e=document.createElement("img");return e.src=t,e.classList.add("marketplace-suggestion-icon"),e}(n);return p&&l.appendChild(p),l.appendChild(function m(t,e,a){var s=document.createElement("div");if(s.classList.add("marketplace-suggestion-container-content"),e){var n=document.createElement("h4");n.textContent=e,s.appendChild(n)}if(a){var o=document.createElement("p");o.textContent=a,s.appendChild(o)}if(-1!==["product-edit-empty-footer-browse-all","product-edit-meta-tab-footer-browse-all"].indexOf(t)){s.classList.add("has-manage-link");var i=document.createElement("a");i.classList.add("marketplace-suggestion-manage-link","linkout"),i.setAttribute("href",v.manage_suggestions_url),i.textContent=v.i18n_marketplace_suggestions_manage_suggestions,s.appendChild(i)}return s}(s,o,i)),l.appendChild(function _(t,e,a,s,n,o,i,r){var c=document.createElement("div");if(o||(o=v.i18n_marketplace_suggestions_default_cta),c.classList.add("marketplace-suggestion-container-cta"),n&&o){var d=k(t,e,a,s,n,o,i);c.appendChild(d)}return r&&c.appendChild(f(t,e,a,n,s)),c}(t,e,a,s,r,c,d,u)),l}function g(){if(h('.marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-body"]').children().length<=0){', .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-header"]',', .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-footer"]',h('.marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-body"], .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-header"], .marketplace-suggestions-container[data-marketplace-suggestions-context="product-edit-meta-tab-footer"]').fadeOut({complete:function(){h(".marketplace-suggestions-metabox-nosuggestions-placeholder").fadeIn()}})}}function m(t){return _.includes(["product-edit-meta-tab-header","product-edit-meta-tab-body","product-edit-meta-tab-footer"],t)}})}(jQuery,marketplace_suggestions,ajaxurl);