芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/woocommerce/assets/client/admin/chunks/edit-product-page.js
"use strict";(self.webpackChunk_wcAdmin_webpackJsonp=self.webpackChunk_wcAdmin_webpackJsonp||[]).push([[3307],{75080:function(e,t,r){var n=r(69307),a=r(70444);const o=(0,n.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(a.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"}));t.Z=o},97829:function(e,t,r){r.r(t),r.d(t,{default:function(){return O}});var n=r(69307),a=r(65736),o=r(67221),i=r(14599),c=r(9818),s=r(86020),l=r(85597),u=r(67435),d=r(36279),m=r(5267),p=r(98817),v=r(62907),_=r(70444),E=(0,n.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(_.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"})),w=r(75080),f=r(83849),g=r.n(f);function P(e){let{actionLabel:t,actionHref:r,prevHref:o,prevLabel:i,nextHref:c,nextLabel:l,className:u,...d}=e;const p={className:"posts-navigation__prev","aria-label":null!=i?i:(0,a.__)("Previous post","woocommerce"),children:(0,n.createElement)(v.Z,{icon:E,size:24,fill:"currentColor"})},_={className:"posts-navigation__next","aria-label":null!=l?l:(0,a.__)("Next post","woocommerce"),children:(0,n.createElement)(v.Z,{icon:w.Z,size:24,fill:"currentColor"})};return(0,n.createElement)("nav",(0,m.Z)({},d,{className:g()(u,"posts-navigation")}),o?(0,n.createElement)(s.Link,(0,m.Z)({},p,{type:"wc-admin",href:o})):(0,n.createElement)("div",(0,m.Z)({},p,{tabIndex:-1,role:"button","aria-disabled":"true"})),(0,n.createElement)(s.Link,{className:"posts-navigation__action",type:"wc-admin",href:r},t),c?(0,n.createElement)(s.Link,(0,m.Z)({},_,{type:"wc-admin",href:c})):(0,n.createElement)("div",(0,m.Z)({},_,{tabIndex:-1,role:"button","aria-disabled":"true"})))}var h=r(19132),N=r(55609),b=r(8573),R=r(48701),I=r(91920);const k=()=>{const{productId:e,variationId:t}=(0,l.UO)(),{isDirty:r,isValidForm:i,values:u}=(0,s.useFormContext)(),{updateProductVariation:d}=(0,c.useDispatch)(o.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME),{createNotice:m}=(0,c.useDispatch)("core/notices"),[p,v]=(0,n.useState)(!1);(0,R.Z)(r,b.$);const _=async()=>{v(!0),d({id:t,product_id:e,context:"edit"},{...u,manage_stock:"parent"===u.manage_stock||null==u?void 0:u.manage_stock}).then((()=>{m("success",`🎉 ${(0,a.__)("Product variation successfully updated.","woocommerce")}`)})).catch((()=>{m("error",(0,a.__)("Failed to updated product variation.","woocommerce"))})).finally((()=>{v(!1)}))};return(0,n.createElement)(I.Nw,null,(()=>(0,n.createElement)("div",{className:"woocommerce-product-form-actions is-variation"},(0,n.createElement)(N.Button,{href:u.permalink+"?preview=true",disabled:!i||!u.permalink,target:"_blank",className:"woocommerce-product-form-actions__preview"},(0,a.__)("Preview","woocommerce")),(0,n.createElement)(N.ButtonGroup,{className:"woocommerce-product-form-actions__publish-button-group"},(0,n.createElement)(N.Button,{onClick:_,variant:"primary",isBusy:p,disabled:!i||!r},(0,a.__)("Save","woocommerce"))))))};(0,p.registerPlugin)("product-variation-action-buttons-header-item",{render:k,icon:"admin-generic"});var x=r(35723);const A=()=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)(x.t,null),(0,n.createElement)(k,null));var L=r(10431);const V=e=>{let{product:t,productVariation:r}=e;const o=(0,n.useRef)(),i=(0,n.useRef)(null),c=function(e){var t;let{product:r,productVariation:n}=e;const{variations:a}=r,o=null!=a?a:[],i=o.indexOf(null!==(t=n.id)&&void 0!==t?t:-1),c=i>0,s=i
{var e;r&&o.current!==r.id&&(null===(e=i.current)||void 0===e||e.resetForm(r),o.current=r.id)}),[r]),(0,n.createElement)(s.SlotContextProvider,null,(0,n.createElement)(s.Form,{initialValues:r,errors:{},ref:i},(0,n.createElement)(A,null),(0,n.createElement)(d.a,{key:r.id,id:"variation",product:r}),(0,n.createElement)(h.H,null),(0,n.createElement)("div",{className:"product-variation-form__navigation"},(0,n.createElement)(P,(0,m.Z)({},c,{actionLabel:(0,a.__)("Return to main product","woocommerce"),prevLabel:(0,a.__)("Previous product variation","woocommerce"),nextLabel:(0,a.__)("Next product variation","woocommerce")}))),(0,n.createElement)(p.PluginArea,{scope:"woocommerce-product-editor"})))};r(36313);var O=()=>{var e,t;const{productId:r,variationId:m}=(0,l.UO)(),p=!!m,v=(0,n.useRef)(),_=(0,n.useRef)(null),{product:E,isLoading:w,isPendingAction:f,productVariation:g}=(0,c.useSelect)((e=>{const{getProduct:t,hasFinishedResolution:n,isPending:a,getPermalinkParts:i}=e(o.PRODUCTS_STORE_NAME),{hasFinishedResolution:c}=e(o.EXPERIMENTAL_PRODUCT_FORM_STORE_NAME),{getProductVariation:s,hasFinishedResolution:l}=e(o.EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME);if(r){const e=t(parseInt(r,10),void 0);return{product:i(parseInt(r,10))&&e?e:void 0,productVariation:p&&s({id:parseInt(m,10),product_id:parseInt(r,10)}),isLoading:!(n("getProduct",[parseInt(r,10)])&&n("getPermalinkParts",[parseInt(r,10)])&&p&&l("getProductVariation",[parseInt(m,10)])&&c("getProductForm")),isPendingAction:a("createProduct")||a("deleteProduct",parseInt(r,10))||a("updateProduct",parseInt(r,10))}}return{isLoading:!1,isPendingAction:!1}}));(0,n.useEffect)((()=>{v.current&&E&&v.current.id!==E.id&&_.current&&_.current.resetForm(E),v.current=E}),[E]),(0,n.useEffect)((()=>{(0,i.recordEvent)("view_new_product_management_experience")}),[]);const P=(null===(e=v.current)||void 0===e?void 0:e.id)===(null==E?void 0:E.id)&&"trash"!==(null===(t=v.current)||void 0===t?void 0:t.status)&&"trash"===(null==E?void 0:E.status);return(0,n.createElement)("div",{className:"woocommerce-edit-product"},w&&!E?(0,n.createElement)("div",{className:"woocommerce-edit-product__spinner"},(0,n.createElement)(s.Spinner,null)):null,E&&"trash"===E.status&&!f&&!P&&(0,n.createElement)(d.a,{id:"error"},(0,n.createElement)("div",{className:"woocommerce-edit-product__error"},(0,a.__)("You cannot edit this item because it is in the Trash. Please restore it and try again.","woocommerce"))),window.wcAdminFeatures["product-variation-management"]&&g&&E&&(0,n.createElement)(V,{product:E,productVariation:g}),!p&&E&&("trash"!==E.status||P)&&(0,n.createElement)(u.H,{formRef:_,product:E}))}}}]);