File "edit-product-page.js"

Full Path: /home/jlklyejr/public_html/wp-content/test/wp-content/plugins/woocommerce/assets/client/admin/chunks/edit-product-page.js
File size: 20.81 KB
MIME-type: text/plain
Charset: utf-8

"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[3307],{89097:(e,t,o)=>{o.d(t,{Z:()=>a});var r=o(69307),n=o(70444);const a=(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(n.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"}))},85797:(e,t,o)=>{o.d(t,{Z:()=>a});var r=o(69307),n=o(70444);const a=(0,r.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(n.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}))},43032:(e,t,o)=>{o.r(t),o.d(t,{default:()=>h});var r=o(69307),n=o(14599),a=o(9818),c=o(55609),i=o(67221),l=o(8001),s=o(51393),m=o(65736),d=o(86020);const u=({onClose:e})=>{const t={placement:"auto",options:{effects:{spotlight:{interactivity:{enabled:!1}},liveResize:{mutation:!0,resize:!0}}},steps:[{referenceElements:{desktop:".woocommerce-product-form-tab__general .woocommerce-form-section__content"},meta:{name:"story",heading:(0,m.__)("📣 Tell a story about your product","woocommerce"),descriptions:{desktop:(0,m.__)("The product form will help you describe your product field by field—from basic details like name and description to attributes the customers can use to find it on your store.","woocommerce")}}},{referenceElements:{desktop:"#tab-panel-0-pricing"},meta:{name:"tabs",heading:(0,m.__)("✍️ Set up pricing & more","woocommerce"),descriptions:{desktop:(0,m.__)("When done, use the tabs to switch between other details and settings. In the future, you’ll also find here extensions and plugins.","woocommerce")}}},{referenceElements:{desktop:".woocommerce-product-form-actions"},meta:{name:"actions",heading:(0,m.__)("🔍 Preview and publish","woocommerce"),descriptions:{desktop:(0,m.__)("With all the details in place, use the buttons at the top to easily preview and publish your product. Click the arrow button for more options.","woocommerce")}}},{referenceElements:{desktop:".woocommerce-product-form-more-menu"},meta:{name:"more",heading:(0,m.__)("⚙️ Looking for more?","woocommerce"),descriptions:{desktop:(0,m.__)("If the form doesn’t yet have all the features you need —it’s still in development— you can switch to the classic editor anytime.","woocommerce")}}}],closeHandler:e};return(0,r.createElement)(d.TourKit,{config:t})},p=o.p+"46f3be5272a3932c5a1a.png",_=({onClose:e,onStart:t})=>(0,r.createElement)(c.Modal,{bodyOpenClassName:"woocommerce-product-tour-modal__modal-open",className:"woocommerce-product-tour-modal",onRequestClose:()=>e(),overlayClassName:"woocommerce-product-tour-modal__overlay",shouldCloseOnClickOutside:!1,title:(0,m.__)("Meet the product editing form","woocommerce")},(0,r.createElement)("div",{className:"woocommerce-product-tour-modal__header-img"},(0,r.createElement)("img",{src:p,alt:(0,m.__)("Product editing tour","woocommerce")})),(0,r.createElement)("div",{className:"woocommerce-product-tour-modal__content"},(0,r.createElement)("p",null,(0,m.__)("Let us show you how to navigate the form and create this product from start to finish in no time.","woocommerce")),(0,r.createElement)("div",{className:"woocommerce-product-tour-modal__actions"},(0,r.createElement)(c.Button,{variant:"tertiary",onClick:()=>e()},(0,m.__)("I'll explore on my own","woocommerce")),(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>{t()}},(0,m.__)("Show me around (10s)","woocommerce"))))),w="woocommerce_product_tour_modal_hidden",E=()=>{const{dismissModal:e,endTour:t,isModalHidden:o,isTouring:n,startTour:c}=(()=>{const[e,t]=(0,r.useState)(!1),{updateOptions:o}=(0,a.useDispatch)(i.OPTIONS_STORE_NAME),{isModalHidden:n}=(0,a.useSelect)((e=>{const{getOption:t,hasFinishedResolution:o}=e(i.OPTIONS_STORE_NAME);return{isModalHidden:"yes"===t(w)||!o("getOption",[w])}})),c=()=>{o({[w]:"yes"})};return{dismissModal:c,endTour:()=>{t(!1)},isModalHidden:n,isTouring:e,startTour:()=>{c(),t(!0)}}})(),{maybeShowFeedbackBar:l}=(0,s.__experimentalUseFeedbackBar)();return n?(0,r.createElement)(u,{onClose:()=>{t(),l()}}):o?null:(0,r.createElement)(_,{onClose:()=>{e(),l()},onStart:c})},h=()=>{const{isLoading:e}=(0,a.useSelect)((e=>{const{hasFinishedResolution:t}=e(i.EXPERIMENTAL_PRODUCT_FORM_STORE_NAME);return{isLoading:!t("getProductForm")}}));return(0,r.useEffect)((()=>{(0,n.recordEvent)("view_new_product_management_experience")}),[]),(0,r.createElement)("div",{className:"woocommerce-add-product"},e?(0,r.createElement)("div",{className:"woocommerce-edit-product__spinner"},(0,r.createElement)(c.Spinner,null)):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(l.H,null),(0,r.createElement)(E,null)))}},28574:(e,t,o)=>{o.r(t),o.d(t,{default:()=>N});var r=o(69307),n=o(65736),a=o(67221),c=o(14599),i=o(9818),l=o(86020),s=o(85597),m=o(8001),d=o(35048),u=o(12314),p=o(98817),_=o(23374),w=o(70444);const E=(0,r.createElement)(w.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(w.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));var h=o(89097),g=o(87608),v=o.n(g);function f({actionLabel:e,actionHref:t,prevHref:o,prevLabel:a,nextHref:c,nextLabel:i,className:s,...m}){const d={className:"posts-navigation__prev","aria-label":null!=a?a:(0,n.__)("Previous post","woocommerce"),children:(0,r.createElement)(_.Z,{icon:E,size:24,fill:"currentColor"})},p={className:"posts-navigation__next","aria-label":null!=i?i:(0,n.__)("Next post","woocommerce"),children:(0,r.createElement)(_.Z,{icon:h.Z,size:24,fill:"currentColor"})};return(0,r.createElement)("nav",(0,u.Z)({},m,{className:v()(s,"posts-navigation")}),o?(0,r.createElement)(l.Link,(0,u.Z)({},d,{type:"wc-admin",href:o})):(0,r.createElement)("div",(0,u.Z)({},d,{tabIndex:-1,role:"button","aria-disabled":"true"})),(0,r.createElement)(l.Link,{className:"posts-navigation__action",type:"wc-admin",href:t},e),c?(0,r.createElement)(l.Link,(0,u.Z)({},p,{type:"wc-admin",href:c})):(0,r.createElement)("div",(0,u.Z)({},p,{tabIndex:-1,role:"button","aria-disabled":"true"})))}var b=o(94725),P=o(1236);const y=()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(P.t,null));var S=o(10431);const T=({product:e,productVariation:t})=>{const o=(0,r.useRef)(),a=(0,r.useRef)(null),c=function({product:e,productVariation:t}){var o;const{variations:r}=e,n=null!=r?r:[],a=n.indexOf(null!==(o=t.id)&&void 0!==o?o:-1),c=a>0,i=a<n.length-1,l=c?n[a-1]:void 0,s=i?n[a+1]:void 0,m=(0,S.getPersistedQuery)();return{actionHref:(0,S.getNewPath)(m,`/product/${e.id}`,{}),prevHref:l?(0,S.getNewPath)(m,`/product/${e.id}/variation/${l}`,{}):void 0,nextHref:s?(0,S.getNewPath)(m,`/product/${e.id}/variation/${s}`,{}):void 0}}({product:e,productVariation:t});return(0,r.useEffect)((()=>{t&&o.current!==t.id&&(a.current?.resetForm(t),o.current=t.id)}),[t]),(0,r.createElement)(l.SlotContextProvider,null,(0,r.createElement)(l.Form,{initialValues:t,errors:{},ref:a},(0,r.createElement)(y,null),(0,r.createElement)(d.a,{key:t.id,id:"variation",product:t}),(0,r.createElement)(b.H,null),(0,r.createElement)("div",{className:"product-variation-form__navigation"},(0,r.createElement)(f,(0,u.Z)({},c,{actionLabel:(0,n.__)("Return to main product","woocommerce"),prevLabel:(0,n.__)("Previous product variation","woocommerce"),nextLabel:(0,n.__)("Next product variation","woocommerce")}))),(0,r.createElement)(p.PluginArea,{scope:"woocommerce-product-editor"})))},N=()=>{const{productId:e,variationId:t}=(0,s.UO)(),o=!!t,u=(0,r.useRef)(),p=(0,r.useRef)(null),{product:_,isLoading:w,isPendingAction:E,productVariation:h}=(0,i.useSelect)((r=>{const{getProduct:n,hasFinishedResolution:c,isPending:i,getPermalinkParts:l}=r(a.PRODUCTS_STORE_NAME),{hasFinishedResolution:s}=r(a.EXPERIMENTAL_PRODUCT_FORM_STORE_NAME),{getProductVariation:m,hasFinishedResolution:d}=r(a.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME);if(e){const r=n(parseInt(e,10),void 0);return{product:l(parseInt(e,10))&&r?r:void 0,productVariation:o&&m({id:parseInt(t,10),product_id:parseInt(e,10)}),isLoading:!(c("getProduct",[parseInt(e,10)])&&c("getPermalinkParts",[parseInt(e,10)])&&o&&d("getProductVariation",[parseInt(t,10)])&&s("getProductForm")),isPendingAction:i("createProduct")||i("deleteProduct",parseInt(e,10))||i("updateProduct",parseInt(e,10))}}return{isLoading:!1,isPendingAction:!1}}));(0,r.useEffect)((()=>{u.current&&_&&u.current.id!==_.id&&p.current&&p.current.resetForm(_),u.current=_}),[_]),(0,r.useEffect)((()=>{(0,c.recordEvent)("view_new_product_management_experience")}),[]);const g=u.current?.id===_?.id&&"trash"!==u.current?.status&&"trash"===_?.status;return(0,r.createElement)("div",{className:"woocommerce-edit-product"},w&&!_?(0,r.createElement)("div",{className:"woocommerce-edit-product__spinner"},(0,r.createElement)(l.Spinner,null)):null,_&&"trash"===_.status&&!E&&!g&&(0,r.createElement)(d.a,{id:"error"},(0,r.createElement)("div",{className:"woocommerce-edit-product__error"},(0,n.__)("You cannot edit this item because it is in the Trash. Please restore it and try again.","woocommerce"))),window.wcAdminFeatures["product-variation-management"]&&h&&_&&(0,r.createElement)(T,{product:_,productVariation:h}),!o&&_&&("trash"!==_.status||g)&&(0,r.createElement)(m.H,{formRef:p,product:_}))}},94725:(e,t,o)=>{o.d(t,{H:()=>a});var r=o(69307),n=o(51393);const a=({product:e})=>(0,r.createElement)(r.Fragment,null,e&&(0,r.createElement)(n.__experimentalProductMVPCESFooter,{productType:e.type}),(0,r.createElement)(n.__experimentalProductMVPFeedbackModalContainer,null))},35048:(e,t,o)=>{o.d(t,{a:()=>m});var r=o(69307),n=o(65736),a=o(55609),c=o(10431),i=o(51393),l=o(87608),s=o.n(l);const m=({id:e,product:t})=>{const o=(0,c.getQuery)();(0,r.useEffect)((()=>(window.document.body.classList.add("woocommerce-admin-product-layout"),()=>{window.document.body.classList.remove("woocommerce-admin-product-layout")})),[]);const{adminBarHeight:l,headerHeight:m}=(()=>{const[e,t]=(0,r.useState)(60),[o,n]=(0,r.useState)(32);return(0,r.useEffect)((()=>{const e=document.querySelector("#wpbody"),o=new MutationObserver((()=>{t(parseInt(e.style.marginTop,10))}));return o.observe(e,{attributes:!0}),()=>{o.disconnect()}}),[]),(0,r.useLayoutEffect)((()=>{const e=()=>{const e=document.querySelector("#wpadminbar");n(e.clientHeight)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),{adminBarHeight:o,headerHeight:e}})();(0,r.useEffect)((()=>{const e=document.querySelector(".product-form-layout .components-tab-panel__tabs");e&&(e.style.top=l+m+"px")}),[l,m]);const d=e=>e.map((e=>({name:e.name,title:e.disabled?(0,r.createElement)(a.Tooltip,{text:(0,n.__)("Manage individual variation details in the Options tab.","woocommerce")},(0,r.createElement)("span",{className:"woocommerce-product-form-tab__item-inner"},(0,r.createElement)("span",{className:"woocommerce-product-form-tab__item-inner-text"},e.title))):(0,r.createElement)("span",{className:"woocommerce-product-form-tab__item-inner"},(0,r.createElement)("span",{className:"woocommerce-product-form-tab__item-inner-text"},e.title)),disabled:e.disabled})));return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.__experimentalWooProductTabItem.Slot,{template:"tab/"+e,fillProps:{product:t}},((e,n)=>{var i;return e.length>0?(0,r.createElement)(a.TabPanel,{className:"product-form-layout",activeClass:"is-active",tabs:d(e),initialTabName:null!==(i=o.tab)&&void 0!==i?i:e[0].name,onSelect:e=>{window.document.documentElement.scrollTop=0,(0,c.navigateTo)({url:(0,c.getNewPath)({tab:e})})}},(e=>{const o=s()("woocommerce-product-form-tab","woocommerce-product-form-tab__"+e.name),a=n[e.name];return(0,r.createElement)("div",{className:o,key:e.name},"function"==typeof a?a(t):a)})):null})))}},8001:(e,t,o)=>{o.d(t,{H:()=>C});var r=o(69307),n=o(86020),a=o(98817),c=o(65736),i=o(55609),l=o(9818),s=o(46530),m=o(85797),d=o(67221),u=o(75606),p=o(72243);const _=()=>{const{values:e}=(0,n.useFormContext)(),{resolving:t}=(0,l.useSelect)((e=>{const{hasFinishedResolution:t}=e(d.OPTIONS_STORE_NAME);return{resolving:!t("getOption",[u.ALLOW_TRACKING_OPTION_NAME])}}));return t?null:(0,r.createElement)(s.WooHeaderItem,null,(0,r.createElement)(i.DropdownMenu,{className:"woocommerce-product-form-more-menu",label:(0,c.__)("More product options","woocommerce"),icon:m.Z},(({onClose:t})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(p.b,{onClick:t}),(0,r.createElement)(p.U_,{productId:e.id,onClick:t})))))};var w=o(12314),E=o(70444);const h=(0,r.createElement)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(E.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));var g=o(28601),v=o(51393);const f=()=>{const{getCheckboxControlProps:e,getInputProps:t}=(0,n.useFormContext)(),[o,a]=(0,r.useState)(!1);return(0,r.createElement)(s.WooHeaderItem,null,(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.Button,{"aria-label":(0,c.__)("Settings","woocommerce"),icon:h,isPressed:o,onClick:()=>a(!o),className:"woocommerce-product-settings__toggle"}),o&&(0,r.createElement)(i.Panel,{className:"woocommerce-product-settings__panel"},(0,r.createElement)(i.PanelHeader,{label:(0,c.__)("Settings","woocommerce")},(0,r.createElement)(i.Button,{icon:g.Z,onClick:()=>a(!1),"aria-label":(0,c.__)("Close settings","woocommerce")})),(0,r.createElement)(i.PanelBody,{title:(0,c.__)("Advanced","woocommerce")},(0,r.createElement)(i.CheckboxControl,(0,w.Z)({label:(0,c.__)("Enable reviews","woocommerce")},e("reviews_allowed",(0,v.getCheckboxTracks)("reviews_allowed")))),(0,r.createElement)(i.TextControl,(0,w.Z)({label:(0,c.__)("Menu order","woocommerce"),type:"number"},t("menu_order")))))))};var b=o(1236);const P=()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(b.t,null),(0,r.createElement)(f,null),(0,r.createElement)(_,null));var y=o(35048),S=o(76292),T=o.n(S);function N(e){const t={},o=T()(e.date_on_sale_from_gmt,T().ISO_8601,!0),r=T()(e.date_on_sale_to_gmt,T().ISO_8601,!0);return e.date_on_sale_from_gmt&&!o.isValid()&&(t.date_on_sale_from_gmt=(0,c.__)("Please enter a valid date.","woocommerce")),e.date_on_sale_to_gmt&&!r.isValid()&&(t.date_on_sale_to_gmt=(0,c.__)("Please enter a valid date.","woocommerce")),o.isAfter(r)&&(t.date_on_sale_from_gmt=(0,c.__)("The start date of the sale must be before the end date.","woocommerce")),r.isBefore(o)&&(t.date_on_sale_to_gmt=(0,c.__)("The end date of the sale must be after the start date.","woocommerce")),t}const k=e=>{let t={};var o,r;return t=((e,t)=>{const o={...t};return e.stock_quantity&&e.stock_quantity<0&&(o.stock_quantity=(0,c.__)("Stock quantity must be a positive number.","woocommerce")),e.low_stock_amount&&e.low_stock_amount<0&&(o.low_stock_amount=(0,c.__)("Stock quantity must be a positive number.","woocommerce")),o})(e,t),e.name?.length||(t.name=(0,c.__)("This field is required.","woocommerce")),e.name&&e.name.length>120&&(t.name=(0,c.__)("Please enter a product name shorter than 120 characters.","woocommerce")),e.regular_price&&!/^[0-9.,]+$/.test(e.regular_price)&&(t.regular_price=(0,c.__)("Please enter a price with one monetary decimal point without thousand separators and currency symbols.","woocommerce")),e.sale_price&&!/^[0-9.,]+$/.test(e.sale_price)&&(t.sale_price=(0,c.__)("Please enter a price with one monetary decimal point without thousand separators and currency symbols.","woocommerce")),e.sale_price&&(!e.regular_price||parseFloat(e.sale_price)>=parseFloat(e?.regular_price))&&(t.sale_price=(0,c.__)("Sale price cannot be equal to or higher than list price.","woocommerce")),t={...t,...N(e)},e.dimensions?.width&&+e.dimensions.width<=0&&(t.dimensions={width:(0,c.__)("Width must be higher than zero.","woocommerce")}),e.dimensions?.length&&+e.dimensions.length<=0&&(t.dimensions={...null!==(o=t.dimensions)&&void 0!==o?o:{},length:(0,c.__)("Length must be higher than zero.","woocommerce")}),e.dimensions?.height&&+e.dimensions.height<=0&&(t.dimensions={...null!==(r=t.dimensions)&&void 0!==r?r:{},height:(0,c.__)("Height must be higher than zero.","woocommerce")}),e.weight&&+e.weight<=0&&(t.weight=(0,c.__)("Weight must be higher than zero.","woocommerce")),t};var I=o(94725);const C=({product:e,formRef:t})=>(0,r.createElement)(n.SlotContextProvider,null,(0,r.createElement)(n.Form,{initialValues:e||{backorders:"no",name:"",reviews_allowed:!0,sku:"",stock_quantity:0,stock_status:"instock"},ref:t,errors:{},validate:k},(0,r.createElement)(P,null),(0,r.createElement)(y.a,{id:"general",product:e}),(0,r.createElement)(I.H,{product:e}),(0,r.createElement)(a.PluginArea,{scope:"woocommerce-product-editor"})))},1236:(e,t,o)=>{o.d(t,{t:()=>f});var r=o(69307),n=o(65736),a=o(46530),c=o(67221),i=o(74617),l=o(10431),s=o(51393),m=o(86020),d=o(85597),u=o(9818),p=o(23374),_=o(70444);const w=(0,r.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(_.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),E=({breadcrumbs:e})=>{const t=e.length>3?[e[0],{title:(0,r.createElement)(r.Fragment,null,"…")},e[e.length-1]]:e;return(0,r.createElement)("span",{className:"woocommerce-product-breadcrumbs"},t.map((e=>{const{href:t,title:o,type:n}=e;return(0,r.createElement)(r.Fragment,{key:t},(0,r.createElement)("span",{className:"woocommerce-product-breadcrumbs__item"},t?(0,r.createElement)(m.Link,{href:t,type:n||"wp-admin"},o):o),(0,r.createElement)("span",{className:"woocommerce-product-breadcrumbs__separator"},(0,r.createElement)(p.Z,{icon:w})))})))};var h=o(87608),g=o.n(h);const v=()=>{const{productId:e}=(0,d.UO)(),t=(0,u.useSelect)((t=>e?t(c.PRODUCTS_STORE_NAME).getProduct(parseInt(e,10),void 0):void 0)),o=(0,s.getProductStatus)(t);return(0,r.createElement)(m.Pill,{className:g()("woocommerce-product-status",`is-${o}`)},s.PRODUCT_STATUS_LABELS[o])},f=()=>{const{values:e}=(0,m.useFormContext)(),{productId:t,variationId:o}=(0,d.UO)(),{isLoading:p,persistedName:_,productVariation:w}=(0,u.useSelect)((e=>{const{getProduct:r,hasFinishedResolution:n}=e(c.PRODUCTS_STORE_NAME),{getProductVariation:a,hasFinishedResolution:i}=e(c.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME),l=t?r(parseInt(t,10)):null,s=o&&t?a({id:parseInt(o,10),product_id:parseInt(t,10)}):null,m=t&&!n("getProduct",[parseInt(t,10)]),d=o&&t&&!i("getProductVariation",[{id:parseInt(o,10),product_id:parseInt(t,10)}]);return{persistedName:l?.name,productVariation:s,isLoading:m||d}})),h=(0,s.getProductTitle)(e.name,e.type,_),g=w&&(0,s.getProductVariationTitle)(w),f=[{href:(0,i.getAdminLink)("edit.php?post_type=product"),title:(0,n.__)("Products","woocommerce")},{href:(0,l.getNewPath)({},"/product/"+t),type:"wc-admin",title:(0,r.createElement)(r.Fragment,null,h,(0,r.createElement)(v,null))},g&&{title:(0,r.createElement)("span",{title:g},(0,s.getTruncatedProductVariationTitle)(w))}].filter((e=>!!e)),b=f.pop();return p?null:(0,r.createElement)(a.WooHeaderPageTitle,null,(0,r.createElement)("span",{className:"woocommerce-product-title"},(0,r.createElement)(E,{breadcrumbs:f}),(0,r.createElement)("span",{className:"woocommerce-product-title__wrapper"},b?.title)))}},8286:(e,t,o)=>{o.r(t),o.d(t,{default:()=>u});var r=o(69307),n=o(51393),a=o(14599),c=o(46530),i=o(98817),l=o(85597),s=o(69220),m=o(9818),d=o(72243);function u(){const{productId:e,variationId:t}=(0,l.UO)(),o=function(e){const[t,o]=(0,r.useState)(void 0);return(0,r.useEffect)((()=>{(0,m.resolveSelect)("core").getEntityRecord("postType","product_variation",Number.parseInt(e,10)).then((e=>{o(e)})).catch((e=>{throw o(void 0),e}))}),[e]),t}(t);return(0,r.useEffect)((()=>{(0,i.registerPlugin)("wc-admin-more-menu",{scope:"woocommerce-product-block-editor",render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(n.__experimentalWooProductMoreMenuItem,null,(({onClose:e})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(d.XG,{onClose:e}),(0,r.createElement)(s.e,{productType:"product_variation",onClose:e})))))});const e=(0,n.__experimentalInitBlocks)();return()=>{(0,i.unregisterPlugin)("wc-admin-more-menu"),e()}}),[]),(0,r.useEffect)((function(){e?(0,a.recordEvent)("product_edit_view",{source:n.TRACKS_SOURCE,product_id:e}):(0,a.recordEvent)("product_add_view",{source:n.TRACKS_SOURCE})}),[e]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(n.__experimentalEditor,{product:o,productType:"product_variation"}),(0,r.createElement)(c.WooFooterItem,{order:0},(0,r.createElement)(r.Fragment,null,(0,r.createElement)(n.__experimentalVariationSwitcherFooter,{parentId:o?.parent_id,variationId:o?.id}),(0,r.createElement)(n.__experimentalProductMVPFeedbackModalContainer,{productId:o?.parent_id}))))}(0,n.productApiFetchMiddleware)()}}]);