System.register([],(function(e,o){"use strict";return{execute:function(){e({a:r,b:function(e,o){jQuery("#tag-name").val(e),jQuery("#tag-description").val(o)},p:function(e){return e.reduce(((e,o)=>{if(!o.value)return e;if(o.name.endsWith("[]")){var t;const r=o.name.slice(0,-2);e[r]=null!==(t=e[r])&&void 0!==t?t:[],e[r].push(o.value)}else e[o.name]=o.value;return e}),{})},u:function(e,o){jQuery("#name").val(e),jQuery("#description").val(o)},v:function(e){const o={};return Object.keys(t).forEach((t=>{const n=r(e.find(`.saai-category-description-form-step-${t}`));Object.assign(o,n.errors)})),{isValid:0===Object.keys(o).length,errors:o}}});const{__:o}=wp.i18n,t=e("S",{1:{product_name:o("Product Name","storeagent-ai-for-woocommerce")},2:{"tones[]":o("Tones","storeagent-ai-for-woocommerce")},3:{"characteristics[]":o("Common Characteristics","storeagent-ai-for-woocommerce")},4:{"age_focus[]":o("Age Focus","storeagent-ai-for-woocommerce")},5:{"target_audiences[]":o("Target Audience","storeagent-ai-for-woocommerce")},6:{"keywords[]":o("Keywords","storeagent-ai-for-woocommerce")}});function r(e){const r=e.data("step"),n=t[r]||{},a={};return Object.entries(n).forEach((([t,r])=>{const n=e.find(`[name="${t}"]`);if(n.length)if(t.endsWith("[]"))n.is(":checkbox")?0===n.filter(":checked").length&&(a[t]=o(`Please select at least one ${r} option`,"storeagent-ai-for-woocommerce")):0===n.map(((e,o)=>jQuery(o).val())).get().filter(Boolean).length&&(a[t]=o(`Please input at least one ${r}`,"storeagent-ai-for-woocommerce"));else{const e=n.val();(!e||"string"==typeof e&&""===e.trim())&&(a[t]=o(`${r} is required`,"storeagent-ai-for-woocommerce"))}})),{isValid:0===Object.keys(a).length,errors:a}}}}}));
