PageSourceSearch

https://smh.re/PostEdit-632f2e.bundle.js

js smh.re collected 2026-09-24 10:46:34 UTC 4,997 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksmarpshare_frontend=self.webpackChunksmarpshare_frontend||[]).push([[8769],{4876:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{PostEditContainer:()=>PostEditContainer});var react=__webpack_require__(96540),es=__webpack_require__(49924),dist=__webpack_require__(71287),use_document_title=__webpack_require__(10207),post_edit_dialog=__webpack_require__(63576),post_detail_service=__webpack_require__(99725),labs=__webpack_require__(25231),use_router=__webpack_require__(15935),use_get_text=__webpack_require__(87914),use_session=__webpack_require__(84280),effects=__webpack_require__(19856),redux_effects=__webpack_require__(42013),deprecated_socnets_util=__webpack_require__(14562);const usePostEdit=({postId,defaultPostData,isEditedByCreator})=>{const dispatch=(0,es.wA)(),{session}=(0,use_session.w)(),[post,setPost]=react.useState(),[isPostPristine,setIsPostPristine]=react.useState(!0);react.useEffect((()=>{if(!defaultPostData||defaultPostData.isPostOnBehalf)return void dispatch((0,redux_effects.b$)(postId));const newPost=new post_detail_service.L4;newPost.initEdit(defaultPostData,session.company),isEditedByCreator&&(newPost.fullChannelList=newPost.fullChannelList.map((channel=>({...channel,status:dist.d8c.IStatusEnum.Proposed})))),newPost.socnetList=(0,deprecated_socnets_util.mR)(newPost.socnetList),setPost(newPost)}),[defaultPostData,dispatch,postId,session.company,isEditedByCreator]);return{post,isPostPristine,changePost:partialPost=>{setPost(((post={})=>({...post,...partialPost}))),setIsPostPristine(!1)}}};var selectors=__webpack_require__(23181),components=__webpack_require__(66931);const PostEditContainer=({autoShow,cancel,postId:postIdProp})=>{const{params:{postId:postIdParam}}=(0,use_router.r)(),dispatch=(0,es.wA)(),{session}=(0,use_session.w)(),{gettext}=(0,use_get_text.z)(),feedType=(0,es.d4)((state=>state.Post.filter.type)),postId=postIdProp||postIdParam,isEditedByCreator=feedType===dist.sjy.Own,[showEditDialog,setShowEditDialog]=react.useState(autoShow),[showCloseWarningDialog,setShowCloseWarningDialog]=react.useState(!1),defaultPostData=(0,es.d4)(selectors.Tp.getAllPosts)[postId],{post,isPostPristine,changePost}=usePostEdit({postId,defaultPostData,isEditedByCreator});(0,use_document_title.r)({title:gettext(`Edit post: ${null==post?void 0:post.title}`)});const cancelCloseWarningDialog=()=>{setShowEditDialog(!0),setShowCloseWarningDialog(!1)},closeEditDialog=()=>{setShowEditDialog(!1),setShowCloseWarningDialog(!1),cancel()};return post?react.createElement(react.Fragment,null,showEditDialog&&react.createElement(post_edit_dialog.h,{showDialog:showEditDialog,changePost,onClose:closeEditDialog,onCancel:isPostPristine?closeEditDialog:()=>{setShowEditDialog(!1),setShowCloseWarningDialog(!0)},post,submit:async post=>{const{archivedAt,publishedAt}=(0,post_detail_service.zG)(session.company.defaultPostExpiration),updatePost={...post,archivedAt:post.archivedAt||archivedAt,publishedAt:post.publishedAt||publishedAt};session.company.isChannelManagerEnabled||(updatePost.fullChannelList=post.fullChannelList.map(approveProposedChannel)),await(async post=>{var _a;const isScheduling=new Date(post.publishedAt||"")>new Date,request=(0,post_detail_service.x1)(post,session.company,isScheduling?post_detail_service.YA.Schedule:post_detail_service.YA.Update,(labName=>(0,labs.xv)(labName,session.user))),isOwnPost=feedType===dist.sjy.Own,msgTitle=gettext(isOwnPost?"Thanks for resubmitting! You will be notified once the admin has reviewed your post":"Post updated"),msgBody=gettext(isOwnPost?post.title:"This post's been updated."),successMsg={closeOnClick:!0,imageUrl:null===(_a=post.imageMetadataList[0])||void 0===_a?void 0:_a.url,title:msgTitle,message:msgBody};await dispatch((0,redux_effects.lD)(request,successMsg,isOwnPost)),await dispatch((0,effects.i)()),cancel()})(updatePost)},isEditedByCreator,isCreateMode:!1,isUploading:!1}),react.createElement(components.Au,{show:showCloseWarningDialog,onClose:cancelCloseWarningDialog,width:640},react.createElement(components.Au.Header,{title:gettext("Do you really want to close?")}),react.createElement(components.Au.Content,null,react.createElement(components.P,null,gettext("You are trying to close post creation dialog everything will be removed."))),react.createElement(components.Au.FooterActions,null,react.createElement(components.$n,{style:"link",text:gettext("No, take me back"),type:"button",onClick:cancelCloseWarningDialog,dataTestId:"cancelUsubscribePrivate-id"}),react.createElement(components.hK,{size:"s",dir:"x"}),react.createElement(components.$n,{style:"primary",text:gettext("Yes, close it"),type:"button",onClick:closeEditDialog,dataTestId:"confirmUnsubscribePrivate-id"})))):null};
1function approveProposedChannel(channel){return{...channel,status:channel.status===dist.d8c.IStatusEnum.Proposed?dist.d8c.IStatusEnum.Approved:channel.status}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.