PageSourceSearch

https://comosava.m-newsletter.com/_next/static/chunks/commons-c2c5ef89-29a680997d4856d5.js

js m-newsletter.com collected 2026-10-04 16:39:40 UTC 27,132 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="611f968f-7de8-48eb-be76-825521790cea",e._sentryDebugIdIdentifier="sentry-dbid-611f968f-7de8-48eb-be76-825521790cea")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[547],{1250:(e,t,n)=>{n.d(t,{A:()=>j});var i=n(16927),s=n(3576),l=n(62701),o=n(37876),r=n(14232),d=n(54404),a=n(52763),c=n(74748),m=n(5068),p=n(18334),u=n(29454),h=n(89099),g=n(5571),y=n(4411),x=n(96584),f=n(71941),v=n(79324),k=n(83710),b=n(91600),R=n(97027),C=n(74754);function j(e){var t,n,j,w,E,D,U,{selectionData:L,postId:N,onClose:S,existingComments:I=[],highlightIds:_=[],allComments:O=[],commentLikesFromParent:T={},highlightLiked:$=!1,likedDataFromParent:A,autoLike:B=!1,isOpen:H,newsletterOwnerId:P=null}=e,K=_.length>0&&!L,{state:z}=(0,r.useContext)(a.i),[M,Z]=(0,r.useState)(""),[F,W]=(0,r.useState)(null),[X,V]=(0,r.useState)(!0),[J,Y]=(0,r.useState)(0),[G,Q]=(0,r.useState)(0),[q,ee]=(0,r.useState)(!1),[et,en]=(0,r.useState)({}),ei=(0,h.useRouter)(),es=(0,f.X)(),[el,{loading:eo,error:er,data:ed}]=(0,d.n_)("\n  mutation saveComment(\n    $id: ID,\n    $postId: ID!,\n    $body: String,\n    $nodeUuid: String,\n    $startOffset: Int,\n    $endOffset: Int,\n    $highlightedText: String,\n  ) {\n    saveComment(input: {\n        id: $id,\n        postId: $postId,\n        body: $body,\n        nodeUuid: $nodeUuid,\n        startOffset: $startOffset,\n        endOffset: $endOffset,\n        highlightedText: $highlightedText,\n      }) {\n      comment {\n        id\n        body\n        highlight {\n          id\n          nodeUuid\n          startOffset\n          endOffset\n          cachedText\n        }\n      }\n    }\n  }\n"),[ea]=(0,d.n_)("\n  mutation likeHighlight(\n    $postId: ID!,\n    $nodeUuid: String!,\n    $startOffset: Int!,\n    $endOffset: Int!,\n    $highlightedText: String!,\n    $like: Boolean!,\n  ) {\n    likeHighlight(input: {\n        postId: $postId,\n        nodeUuid: $nodeUuid,\n        startOffset: $startOffset,\n        endOffset: $endOffset,\n        highlightedText: $highlightedText,\n        like: $like,\n      }) {\n      highlight {\n        id\n        nodeUuid\n        startOffset\n        endOffset\n        cachedText\n      }\n      liked\n    }\n  }\n"),[ec]=(0,d.n_)("\n  mutation saveCommentReply(\n    $id: ID,\n    $commentId: ID!,\n    $body: String,\n  ) {\n    saveCommentReply(input: {\n        id: $id,\n        commentId: $commentId,\n        body: $body,\n      }) {\n      commentReply {\n        id\n      }\n    }\n  }\n"),[em]=(0,d.n_)("\n  mutation saveCommentReply(\n    $id: ID!,\n    $commentId: ID!,\n  ) {\n    saveCommentReply(input: {\n        id: $id,\n        commentId: $commentId,\n        destroy: true,\n      }) {\n      commentReply {\n        id\n      }\n    }\n  }\n"),[ep,{data:eu,error:eh}]=(0,d.n_)("\n  mutation saveLike(\n    $likableId: ID!,\n    $likableType: String!,\n    $like: Boolean!,\n  ) {\n    saveLike(input: {\n        likableId: $likableId,\n        likableType: $likableType,\n        like: $like,\n      }) {\n      result\n    }\n  }\n"),[eg]=(0,d.n_)("\n  mutation saveComment(\n    $id: ID,\n    $postId: ID!,\n  ) {\n    saveComment(input: {\n        id: $id,\n        postId: $postId,\n        destroy: true,\n      }) {\n      comment {\n        id\n      }\n    }\n  }\n"),[ey]=(0,d.n_)("\n  mutation saveComment(\n    $id: ID!,\n    $postId: ID!,\n    $hot: Boolean!,\n  ) {\n    saveComment(input: {\n        id: $id,\n        postId: $postId,\n        hot: $hot,\n      }) {\n      comment {\n        id\n        hot\n      }\n    }\n  }\n"),[ex,ef]=(0,r.useState)({}),ev=(null==(t=z.currentUser)?void 0:t.id)===P,ek=(e,t)=>(0,i._)(function*(){try{ef(n=>(0,l._)((0,s._)({},n),{[e]:t})),yield ey({variables:{id:e,postId:N,hot:t}})}catch(n){ef(n=>(0,l._)((0,s._)({},n),{[e]:!t})),p.Cp(n)}})(),[eb,{data:eR}]=(0,d.W3)("\n  query fetchPost($id: ID!) {\n    post(id: $id) {\n      id\n      comments(first: 100) {\n        nodes {\n          id\n          liked\n          like
1sCount\n          highlight {\n            id\n            liked\n            likesCount\n          }\n          commentReplies(first: 12) {\n            nodes {\n              id\n              liked\n            }\n          }\n        }\n      }\n      highlights(first: 100) {\n        nodes {\n          id\n          liked\n          likesCount\n        }\n      }\n    }\n  }\n",{variables:{id:N}}),eC=A||eR,{highlightData:ej,highlightComments:ew,clickedHighlightComment:eE,clickedHighlightId:eD,clickedHighlightComments:eU,otherComments:eL}=(0,v.M)({isExistingHighlight:K,selectionData:L,highlightIds:_,allComments:O,existingComments:I,deletedComments:es.deletedComments,optimisticComments:es.optimisticComments});(0,r.useEffect)(()=>{if(ej&&O)if(K){var e=O.find(e=>e&&_.some(t=>String(t)===String(e.id)));if(null==e?void 0:e.highlight){var t=e.highlight.likesCount||0;Y(1),Q(t)}else Y(0),Q(0)}else Y(0),Q(0)},[ej,K,O,_]);var eN=r.useRef(!1);(0,r.useEffect)(()=>{A||eN.current||(eN.current=!0,eb().then(()=>{}).catch(()=>{eN.current=!1}))},[A,eb]);var eS=r.useMemo(()=>{var e,t=O.find(e=>e&&_.some(t=>String(t)===String(e.id)));return null==t||null==(e=t.highlight)?void 0:e.id},[O,_]);(0,r.useEffect)(()=>{if(null==eC?void 0:eC.post){var e,t,n={},i=null,s={};if((null==(e=eC.post.comments)?void 0:e.nodes)&&eC.post.comments.nodes.forEach(e=>{var t;e.id&&(n[e.id]=e.liked||!1),(null==(t=e.commentReplies)?void 0:t.nodes)&&e.commentReplies.nodes.forEach(e=>{e.id&&(s[e.id]=e.liked||!1)}),e.highlight&&eS&&e.highlight.id==eS&&(i=e.highlight.liked||!1,e.highlight.id)}),null===i&&(null==(t=eC.post.highlights)?void 0:t.nodes)&&eS){var l=eC.post.highlights.nodes.find(e=>e.id==eS);l&&(i=l.liked||!1,l.id)}eO.setCommentLikes(n),eO.setReplyLikes(s),null!==i&&K&&eO.setIsHighlightLiked(i)}},[eC,eS,K]),(0,r.useEffect)(()=>{Object.keys(T).length>0&&eO.setCommentLikes(e=>(0,s._)({},T,e))},[T]),(0,r.useEffect)(()=>{(null==eC?void 0:eC.post)||eO.setIsHighlightLiked($)},[$,eC]),(0,r.useEffect)(()=>{V(!0)},[]),(0,r.useEffect)(()=>{eh&&p.Cp(eh)},[eu,eh]),(0,r.useEffect)(()=>{(0,i._)(function*(){var e,t;if(ed&&(null==ed||null==(t=ed.saveComment)||null==(e=t.comment)?void 0:e.id))try{var n,i,s,l,o,r,d,a,c,u,h,g,x,f,v,k,b,R=ed.saveComment.comment,C=R.highlight,j=new Date,w=(0,y.XA)(),E=(0,y.Fv)(w),D={id:R.id,body:R.body||null,createdAt:E,likesCount:0,badge:null,commentableType:"Post",highlight:C?{id:C.id,nodeUuid:C.nodeUuid,startOffset:C.startOffset,endOffset:C.endOffset,cachedText:C.cachedText,status:null,likesCount:0,createdAt:j.toISOString(),updatedAt:j.toISOString()}:null,subscriber:{id:null==(n=z.currentUser)?void 0:n.id,userIcon:(null==(i=z.currentUser)?void 0:i.imageUrl)||(null==(s=z.currentUser)?void 0:s.image)||null,icon:(null==(r=z.currentUser)||null==(o=r.displayName)||null==(l=o.charAt(0))?void 0:l.toUpperCase())||(null==(c=z.currentUser)||null==(a=c.name)||null==(d=a.charAt(0))?void 0:d.toUpperCase())||(null==(g=z.currentUser)||null==(h=g.email)||null==(u=h.charAt(0))?void 0:u.toUpperCase())||"U",user:{id:null==(x=z.currentUser)?void 0:x.id,displayName:(null==(f=z.currentUser)?void 0:f.displayName)||(null==(v=z.currentUser)?void 0:v.name)||null,imageUrl:(null==(k=z.currentUser)?void 0:k.imageUrl)||(null==(b=z.currentUser)?void 0:b.image)||null}},commentReplies:[],liked:!1};C&&window.dispatchEvent(new CustomEvent("highlightCreated",{detail:{highlightId:C.id,highlightData:C,optimisticComment:D,postId:N}})),es.setOptimisticComments(e=>e.map(e=>e.body===R.body&&String(e.id).startsWith("optimistic-")?D:e)),yield m.A.get("https://fastly.m-newsletter.com/api/v1/posts/"+N),V(!0)}catch(e){p.Cp(e,{extra:{component:"HighlightDrawer"}})}})()},[ed,N,z.currentUser,es.setOptimisticComments]),(0,r.useEffect)(()=>{er&&(p.Cp(er),W("コメントの送信に失敗しました。もう一度お試しください。"),ee(!1),es.setOptimisticComments([]))},[er,es.setOptimisticComments]);var eI=()=>{u.A.set("login_url",window.location.href,{expires:1}),ei.push("/login").then(()=>window.scrollTo(0,0))},e_=()=>{es.setOptimisticComments([]),es.setOptimisticEdits({}),void 0!==H?S():(V(!1),setTimeout(S,300))},eO=(0,k.q)({postId:N,currentUser:z.currentUser,saveLike:ep,likeHighlight:ea,highlightLiked:$,commentLikesFromParent:T,highlightData:ej,isExistingHighlight:K,allComments:O,highlightIds:_,setLoginTooltipOpen:en,fetchLiked:eb,handleLogin:eI,setHighlightTotalLikes:Q,setErrorMessage:W}),eT=(0,b.K)({postId:N,highlightData:ej,isExistingHighlight:K,currentUser:z.currentUser,saveComment:el,deleteComment:eg,setOptimisticComments:es.setOptimisticComments,optimisticComments:es.optimisticComments,setOptimisticEdits:es.setOptimisticEdits,optimisticEdits:es.optimisticEdits,setDeletedComments:es.setDeletedComments,clickedHighlightComments:eU,otherComments:eL,body:M,setBody:Z,setErrorMessage:W,setIsSubmitting:ee}),e$=(0,R.Z)({postId:N,currentUser:z.currentUser,saveReply:ec,deleteReply:em,setOptimisticReplies:es.setOptimisticReplies,optimisticReplies:es.optimisticReplies,setOptimisticReplyEdits:es.setOptimisticReplyEdits,optimisticReplyEdits:es.optimisticReplyEdits,setDeletedReplies:es.setDeletedReplies,setLoginTooltipOpen:en,setErrorMessage:W}),eA=r.useRef(!1);return(0,r.useEffect)(()=>{B&&!K&&L&&!eA.current&&(eA.current=!0,eO.handleHighlightLike())},[B,K,L,eO]),(0,o.jsx)(g.Drawer,{placement:"right",open:void 0!==H?H:X,onClose:e_,size:420,className:"p-0 backdrop-blur-none w-[90vw] md:w-[520px]",overlay:!0,overlayProps:{className:"fixed inset-0 bg-black bg-opacity-30 z-50 backdrop-blur-none"},"data-sentry-element":"Drawer","data-sentry-component":"HighlightDrawer","data-sentry-source-file":"HighlightDrawer.tsx",children:(0,o.jsxs)("div",{className:"flex flex-col h-full relative",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),"data-testid":"dialog",children:[(0,o.jsx)("button",{onClick:e_,className:"fixed top-4 right-4 z-[9999] p-2 dark:text-stone-50","aria-label":"close",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-5 h-5 text-stone-600 dar
1k:text-stone-200","data-sentry-element":"svg","data-sentry-source-file":"HighlightDrawer.tsx",children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12","data-sentry-element":"path","data-sentry-source-file":"HighlightDrawer.tsx"})})}),(0,o.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 pt-6 pb-6 bg-stone-50 dark:bg-stone-900",children:[(0,o.jsx)("div",{className:"mb-4 relative",children:z.currentUser?(0,o.jsxs)("button",{onClick:e=>eO.handleHighlightLike(e),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),className:"transition-all hover:scale-110 flex items-center space-x-1 dark:text-stone-50","aria-label":"like highlight","data-testid":"highlight-like-button",children:[(0,o.jsx)("img",{src:eO.isHighlightLiked?"/images/icons/heart-color.svg":"/images/icons/heart-white.svg",className:"w-6 h-6"+(eO.isHighlightLiked?"":" dark:invert"),alt:"like"}),G>0&&(0,o.jsx)("span",{className:"text-sm font-medium text-stone-700 dark:text-stone-100",children:G})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),en(e=>(0,l._)((0,s._)({},e),{"highlight-like":!e["highlight-like"]}))},onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),className:"transition-all hover:scale-110 flex items-center space-x-1","aria-label":"like highlight","data-testid":"highlight-like-button",children:[(0,o.jsx)("img",{src:"/images/icons/heart-white.svg",className:"w-6 h-6 dark:invert",alt:"like"}),G>0&&(0,o.jsx)("span",{className:"text-sm font-medium text-stone-700 dark:text-stone-100",children:G})]}),et["highlight-like"]&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>en(e=>(0,l._)((0,s._)({},e),{"highlight-like":!1}))}),(0,o.jsxs)("div",{className:"absolute left-0 top-10 z-50 p-4 bg-stone-50 dark:bg-stone-900 text-stone-700 dark:text-stone-100 border shadow-xl rounded text-sm max-w-sm",children:[(0,o.jsx)("div",{className:"mb-8",children:"いいねボタンを押すにはログインが必要です"}),(0,o.jsx)("div",{className:"flex w-fit mx-auto",children:(0,o.jsx)(g.Button,{size:"sm",variant:"outlined",className:"bg-stone-50 dark:bg-stone-900 w-28 whitespace-nowrap dark:text-stone-50",onClick:()=>{u.A.set("login_url",window.location.href,{expires:1}),ei.push("/login").then(()=>window.scrollTo(0,0))},children:"ログイン"})})]})]})]})}),z.currentUser?(0,o.jsxs)("div",{className:"flex items-center mb-2",children:[z.currentUser.imageUrl&&!z.currentUser.imageUrl.endsWith("/images/user.png")?(0,o.jsx)("img",{src:z.currentUser.imageUrl,className:"w-6 h-6 rounded-full mr-2 object-cover",alt:"user"}):(0,o.jsx)("div",{className:"rounded-full w-6 h-6 mr-2 bg-stone-600 dar
1k:bg-stone-200 text-white dark:text-stone-900 text-sm flex justify-center items-center",children:(null==(j=z.currentUser.displayName)||null==(n=j.charAt(0))?void 0:n.toUpperCase())||(null==(E=z.currentUser.name)||null==(w=E.charAt(0))?void 0:w.toUpperCase())||(null==(U=z.currentUser.email)||null==(D=U.charAt(0))?void 0:D.toUpperCase())||"@"}),(0,o.jsx)("span",{className:"font-semibold text-sm text-stone-900 dark:text-stone-100",children:z.currentUser.displayName||"メールアドレス購読"})]}):(0,o.jsx)(o.Fragment,{}),(0,o.jsxs)("div",{className:"bg-stone-100 dark:bg-stone-700 p-2",children:[ej&&(0,o.jsx)("div",{className:"bg-stone-50 dark:bg-stone-900 rounded leading-tight p-3 sticky top-0 z-10 shadow-sm border border-stone-200 dark:border-stone-600",children:(0,o.jsx)("span",{className:"bg-blue-100 dark:bg-blue-700 text-sm text-stone-900 dark:text-stone-50 px-1 py-0.5 rounded",children:K?ej.cachedText:ej.selectedText})}),z.currentUser?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.A,{className:"w-full mb-2 p-3 min-h-32 rounded bg-stone-100 dark:bg-stone-700 outline-none text-sm text-stone-700 dark:text-stone-100 leading-normal",placeholder:"ハイライトにコメント...",value:M,onChange:e=>{e.preventDefault(),e.target.value.length<1e3?(Z(e.target.value),W(null)):W("コメントは1000文字以内で入力してください")},autoFocus:!0}),F&&(0,o.jsx)("div",{className:"text-stone-900 dark:text-stone-50 text-sm mb-2 bg-stone-100 dark:bg-stone-700 border border-stone-400 p-2 rounded",children:F}),(0,o.jsxs)("div",{className:"flex justify-end space-x-2 mt-2",children:[(0,o.jsx)(g.Button,{variant:"text",className:"bg-stone-50 dark:bg-stone-900 text-stone-600 dar
1k:text-stone-200 hover:text-stone-900 dark:hover:text-white",onClick:e_,disabled:q,"data-testid":"cancel-comment-button",children:"キャンセル"}),(0,o.jsx)(g.Button,{className:"bg-stone-900 dark:bg-white text-white dark:text-stone-900 hover:bg-stone-800 dark:hover:bg-stone-50",onClick:eT.handleSubmit,disabled:q||!M.trim(),"data-testid":"submit-comment-button",children:q?"送信中...":"コメントする"})]})]}):(0,o.jsxs)("div",{className:"bg-stone-50 dark:bg-stone-800 border border-stone-300 dark:border-stone-500 rounded p-4 text-center",children:[(0,o.jsx)("p",{className:"text-sm text-stone-900 dark:text-stone-200 mb-4",children:"コメントするにはログインが必要です"}),(0,o.jsx)(g.Button,{size:"sm",className:"bg-stone-900 dark:bg-white text-white dark:text-stone-900 hover:bg-stone-800 dark:hover:bg-stone-50",onClick:eI,children:"ログイン"})]})]}),null,es.optimisticComments.length>0&&(0,o.jsx)("div",{className:"mt-4 space-y-3",children:es.optimisticComments.map(e=>{if(!e||es.deletedComments.has(e.id))return null;var t,n,i=eO.commentLikes[e.id]||!1,s=e.likesCount||0,l=(0,x.T5)(e,z.currentUser),r=eT.editingComment===e.id,d=null!=(t=null!=(n=ex[e.id])?n:e.hot)&&t;return(0,o.jsx)(C.LB,{comment:e,isOwner:l,isEditing:r,isLiked:i,displayLikesCount:s,onEdit:eT.handleEditComment,onDelete:eT.handleDeleteComment,onLike:eO.handleLike,onReply:e$.handleReply,onReplyClick:e$.handleReplyClick,commentDraft:eT.commentDraft,setCommentDraft:eT.setCommentDraft,onSaveEdit:eT.handleSaveEdit,onCancelEdit:eT.handleCancelEdit,replyingTo:e$.replyingTo,setReplyingTo:e$.setReplyingTo,replyBody:e$.replyBody,setReplyBody:e$.setReplyBody,onSaveReply:e$.handleReply,optimisticReplies:es.optimisticReplies[e.id]||[],currentUser:z.currentUser,optimisticBody:es.optimisticEdits[e.id],loginTooltipOpen:et,setLoginTooltipOpen:en,handleLogin:eI,deletedReplies:es.deletedReplies,editingReply:e$.editingReply,editReplyBody:e$.editReplyBody,setEditReplyBody:e$.setEditReplyBody,optimisticReplyEdits:es.optimisticReplyEdits,onEditReply:e$.handleEditReply,onDeleteReply:e$.handleDeleteReply,onSaveEditReply:e$.handleSaveEditReply,onCancelEditReply:e$.handleCancelEditReply,replyLikes:eO.replyLikes,onLikeReply:eO.handleLikeReply,isNewsletterOwner:ev,isHot:d,onHot:ek},e.id)})}),eU.length>0&&(0,o.jsx)("div",{className:"mt-4 space-y-3",children:eU.map((e,t)=>{if(!e||es.deletedComments.has(e.id))return null;var n,i,s,l,r,d,a,c,m,p,u=(null==eC||null==(d=eC.post)||null==(r=d.comments)||null==(l=r.nodes)||null==(s=l.find(t=>t.id===e.id))?void 0:s.likesCount)||0,h=(null==eC||null==(p=eC.post)||null==(m=p.comments)||null==(c=m.nodes)||null==(a=c.find(t=>t.id===e.id))?void 0:a.liked)||!1,g=e.id in eO.commentLikes?eO.commentLikes[e.id]:h,y=(0,x.MX)(u,h,g),f=(0,x.T5)(e,z.currentUser),v=eT.editingComment===e.id,k=null!=(n=null!=(i=ex[e.id])?i:e.hot)&&n;return(0,o.jsx)(C.LB,{comment:e,isOwner:f,isEditing:v,isLiked:g,displayLikesCount:y,onEdit:eT.handleEditComment,onDelete:eT.handleDeleteComment,onLike:eO.handleLike,onReply:e$.handleReply,onReplyClick:e$.handleReplyClick,commentDraft:eT.commentDraft,setCommentDraft:eT.setCommentDraft,onSaveEdit:eT.handleSaveEdit,onCancelEdit:eT.handleCancelEdit,replyingTo:e$.replyingTo,setReplyingTo:e$.setReplyingTo,replyBody:e$.replyBody,setReplyBody:e$.setReplyBody,onSaveReply:e$.handleReply,optimisticReplies:es.optimisticReplies[e.id]||[],currentUser:z.currentUser,optimisticBody:es.optimisticEdits[e.id],loginTooltipOpen:et,setLoginTooltipOpen:en,handleLogin:eI,deletedReplies:es.deletedReplies,editingReply:e$.editingReply,editReplyBody:e$.editReplyBody,setEditReplyBody:e$.setEditReplyBody,optimisticReplyEdits:es.optimisticReplyEdits,onEditReply:e$.handleEditReply,onDeleteReply:e$.handleDeleteReply,onSaveEditReply:e$.handleSaveEditReply,onCancelEditReply:e$.handleCancelEditReply,replyLikes:eO.replyLikes,onLikeReply:eO.handleLikeReply,isNewsletterOwner:ev,isHot:k,onHot:ek},e.id)})}),eL.length>0&&(0,o.jsxs)("div",{className:"mt-6 pt-6",children:[(0,o.jsxs)("h3",{className:"text-sm font-semibold text-stone-900 dark:text-stone-100 mb-4",children:["その他のコメント (",eL.length,")"]}),(0,o.jsx)("div",{className:"space-y-4",children:Object.entries(eL.reduce((e,t)=>
1{if(!t)return e;var n,i=(null==(n=t.highlight)?void 0:n.cachedText)||"no-highlight";return e[i]||(e[i]=[]),e[i].push(t),e},{})).map((e,t)=>{var[n,i]=e;return(0,o.jsxs)("div",{className:"mb-6",children:["no-highlight"!==n&&(0,o.jsx)("div",{className:"mb-3 bg-stone-50 dark:bg-stone-900 border border-stone-300 dark:border-stone-500 rounded sticky top-0 z-10 leading-tight p-3 shadow-sm",children:(0,o.jsx)("span",{className:"text-sm text-stone-700 dark:text-stone-100 bg-blue-100 dark:bg-blue-700 px-1 py-0.5 rounded",children:n})}),i.map((e,t)=>{if(!e||es.deletedComments.has(e.id))return null;var n,i,s,l,r,d=null==eC||null==(r=eC.post)||null==(l=r.comments)||null==(s=l.nodes)?void 0:s.find(t=>t.id===e.id),a=(null==d?void 0:d.likesCount)||0,c=(null==d?void 0:d.liked)||!1,m=e.id in eO.commentLikes?eO.commentLikes[e.id]:c,p=(0,x.T5)(e,z.currentUser),u=eT.editingComment===e.id,h=null!=(n=null!=(i=ex[e.id])?i:e.hot)&&n;return(0,o.jsx)(C.LB,{comment:e,isOwner:p,isEditing:u,isLiked:m,displayLikesCount:a+(m!==c?m?1:-1:0),onEdit:eT.handleEditComment,onDelete:eT.handleDeleteComment,onLike:eO.handleLike,onReply:e$.handleReply,onReplyClick:e$.handleReplyClick,commentDraft:eT.commentDraft,setCommentDraft:eT.setCommentDraft,onSaveEdit:eT.handleSaveEdit,onCancelEdit:eT.handleCancelEdit,replyingTo:e$.replyingTo,setReplyingTo:e$.setReplyingTo,replyBody:e$.replyBody,setReplyBody:e$.setReplyBody,onSaveReply:e$.handleReply,optimisticReplies:es.optimisticReplies[e.id]||[],currentUser:z.currentUser,optimisticBody:es.optimisticEdits[e.id],loginTooltipOpen:et,setLoginTooltipOpen:en,handleLogin:eI,deletedReplies:es.deletedReplies,editingReply:e$.editingReply,editReplyBody:e$.editReplyBody,setEditReplyBody:e$.setEditReplyBody,onEditReply:e$.handleEditReply,onDeleteReply:e$.handleDeleteReply,onSaveEditReply:e$.handleSaveEditReply,onCancelEditReply:e$.handleCancelEditReply,optimisticReplyEdits:es.optimisticReplyEdits,replyLikes:eO.replyLikes,onLikeReply:eO.handleLikeReply,variant:"compact",isNewsletterOwner:ev,isHot:h,onHot:ek},e.id)})]},"group-".concat(t))})})]})]})]})})}},4411:(e,t,n)=>{function i(e){return new Date(e).toLocaleDateString("ja-JP")}function s(){return new Date(new Date().toLocaleString("en-US",{timeZone:"Asia/Tokyo"}))}function l(e){return e.toISOString().split("T")[0]}n.d(t,{Fv:()=>l,T_:()=>i,XA:()=>s})},42069:(e,t,n)=>{n.r(t),n.d(t,{LexicalViewer:()=>eS,default:()=>eI,pageConfig:()=>eU});var i=n(3576),s=n(62701),l=n(37876),o=n(14232),r=n(18334),d=n(75574),a=n(63228),c=n(36258),m=n(46109),p=n(83206),u=n(43588),h=n(38559),g=n(34131),y=n(2074),x=n(84498),f=n(87613),v=n(19458),k=n(53857),b=n(5493),R=n(84917),C=n(98998),j=n(64655),w=n(82312),E=n(16087),D=n(5965),U=n(75961),L=n(5270),N=n(77354),S=n(34356),I=n(11009),_=n(25544),O=n(96359),T=n(19698),$=n(53298),A=n(43629),B=n(80804),H=n(10520),P=n(69226),K=n(86373),z=n(39925),M=n(13321),Z=n(63639),F=n(61787),W=n(44210),X=n(63941),V=n(76805),J=n(66772),Y=n(40849),G=n(39549),Q=n(6852),q=n(42155),ee=n(81557),et=n(51102),en=n(30636),ei=n(6915),es=n(31236),el=n(12020),eo=n(82676),er=n(41959),ed=n(30454),ea=n(44505),ec=n(60532),em=n(39419),ep=n(68531),eu=n(29733),eh=n(12782),eg=n(32791),ey=n(42658),ex=n(10598),ef=n(30640),ev=n(36395),ek=n(53885),eb=n(1105),eR=n(35791),eC=n(75060),ej=n(57081),ew=n(47685),eE=n(48231),eD=n(25578),eU={theme:eD.C,onError(e){throw e},nodes:[w.bv,{replace:c.Ey8,with:e=>new w.bv(e.__text)},g.jL,x.v5,x.YW,g.dJ,f.iK,f.yy,y.HA,y.B9,y.py,v.k_,v.Db,E.ZP,{replace:v.Db,with:e=>new E.ZP(e.__url,{rel:e.__rel,target:e.__target,title:e.__title}),withKlass:E.ZP},D.KD,U.ed,L.fS,N.Gg,S.K1,I.K$,_.RY,O.y4,T.zr,$.d9,A.Qc,B.H9,H.tX,P.Hi,K.KH,z.HT,M.Mo,Z.R3,F.E,W.io,X.Vc,V.rp,J.HS,Y.k4,G.Af,Q.f,q.d7],editable:!1},eL=e=>{var{children:t}=e;return(0,l.jsx)(p.R,{onError:e=>(r.Cp(e,{tags:{location:"lexical_boundary",type:"boundary_error"},extra:{errorInfo:e.toString(),stack:e.stack}}),(0,l.jsx)("div",{className:"text-red-600 p-4 border border-red-300 rounded",children:"Error loading editor content. The error has been reported."})),"data-sentry-element":"LexicalErrorBoundary","data-sentry-component":"CustomErrorBoundary","data-sentry-source-file":"LexicalViewer.jsx",children:t})},eN={theme:eD.C,onError(e){r.Cp(e,{tags:{location:"lexical_editor",type:"editor_error"},extra:{errorInfo:e.toString(),stack:e.stack}})},nodes:[w.bv,{replace:c.Ey8,with:e=>new w.bv(e.__text)},g.jL,x.v5,x.YW,g.dJ,f.iK,f.yy,y.HA,y.B9,y.py,v.k_,v.Db,E.ZP,{replace:v.Db,with:e=>new E.ZP(e.__url,{rel:e.__rel,target:e.__target,title:e.__title}),withKlass:E.ZP},D.KD,U.ed,L.fS,N.Gg,S.K1,I.K$,_.RY,O.y4,T.zr,$.d9,A.Qc,B.H9,H.tX,P.Hi,K.KH,z.HT,M.Mo,Z.R3,F.E,W.i
1o,X.Vc,V.rp,J.HS,Y.k4,G.Af,Q.f,q.d7],editable:!1,namespace:"lexical-viewer"},eS=e=>{var{body:t,error:n,postId:c,comments:p=[],highlights:g=[],commentLikes:y={},urlHighlightNodeUuid:x=null,onHighlightDrawerClose:f=null,newsletterOwnerId:v=null,hasPaidContent:w=!1}=e,[E,D]=(0,o.useState)(!1),[U,L]=(0,o.useState)("v1"),N=o.useMemo(()=>{var e=p.filter(e=>e&&e.highlight).map(e=>e.highlight.id);return[...p,...g.filter(t=>!e.includes(t.id)).map(e=>({id:e.id,body:null,highlight:{id:e.id,nodeUuid:e.nodeUuid,startOffset:e.startOffset,endOffset:e.endOffset,cachedText:e.cachedText,likesCount:e.likesCount,liked:e.liked||!1},subscriber:{user:null,icon:null},commentReplies:[],likesCount:0}))]},[p,g]);if((0,o.useEffect)(()=>{(0,ee.resetImageRenderCounter)(),L((e=>{try{var t="string"==typeof e?JSON.parse(e):e;return(null==t?void 0:t.version)==="v2"?"v2":"v1"}catch(e){return"v1"}})(t)),(0,o.startTransition)(()=>{D(!0)})},[t]),n)return r.Cp(n,{tags:{location:"lexical_viewer",type:"content_error"},extra:{errorInfo:n.toString()}}),(0,l.jsx)("div",{className:"text-red-600 p-4 border border-red-300 rounded",children:"Error loading content. The error has been reported."});if(!t||!E)return(0,l.jsx)("div",{children:"Loading..."});var S=(0,s._)((0,i._)({},eN),{editorState:t});return(0,l.jsx)(eL,{"data-sentry-element":"CustomErrorBoundary","data-sentry-component":"LexicalViewer","data-sentry-source-file":"LexicalViewer.jsx",children:E&&(0,l.jsx)(d.n,{initialConfig:S,children:(0,l.jsx)(u.Gt,{children:(0,l.jsxs)("div",{className:"editor-inner relative flex bg-stone-50 dark:bg-stone-900",children:[(0,l.jsx)(a.$,{contentEditable:(0,l.jsx)("div",{className:"w-full max-w-full lg:flex-grow mx-auto relative","aria-label":"newsletter",children:(0,l.jsx)(m.a,{className:"lexical-ssr ".concat("v2"===U?"lexical-ssr-v2":""," editor-input").trim(),"aria-label":"Newsletter content"})}),placeholder:null,ErrorBoundary:eL}),(0,l.jsx)(b.Q,{}),(0,l.jsx)(k.W,{}),(0,l.jsx)(j.A,{}),(0,l.jsx)(C.A,{}),(0,l.jsx)(ew.A,{}),(0,l.jsx)(R.A,{maxDepth:7}),(0,l.jsx)(h.A,{}),(0,l.jsx)(eb.A,{edit:!1,hasPaidContent:w}),(0,l.jsx)(et.A,{}),(0,l.jsx)(en.A,{}),(0,l.jsx)(ei.A,{}),(0,l.jsx)(es.A,{}),(0,l.jsx)(el.A,{}),(0,l.jsx)(eo.A,{}),(0,l.jsx)(er.A,{}),(0,l.jsx)(ed.A,{}),(0,l.jsx)(ea.A,{}),(0,l.jsx)(ec.A,{}),(0,l.jsx)(em.A,{}),(0,l.jsx)(ep.A,{}),(0,l.jsx)(eu.A,{}),(0,l.jsx)(eh.A,{}),(0,l.jsx)(eg.A,{}),(0,l.jsx)(ey.A,{}),(0,l.jsx)(ex.A,{}),(0,l.jsx)(ef.A,{}),(0,l.jsx)(ev.A,{}),(0,l.jsx)(ek.Ay,{}),(0,l.jsx)(eR.A,{}),c&&(0,l.jsx)(eC.A,{postId:c,comments:p}),(0,l.jsx)(eE.A,{}),N&&(0,l.jsx)(ej.A,{comments:N,pureComments:p,postId:c,commentLikes:y,urlHighlightNodeUuid:x,onHighlightDrawerClose:f,newsletterOwnerId:v})]})})})})};let eI=eS},96584:(e,t,n)=>{function i(e,t){var n,i,s,l,o,r;return{id:"optimistic-reply-".concat(Date.now()),body:e,createdAt:new Date().toISOString(),subscriber:{id:t.id,user:{id:t.id,displayName:t.displayName||t.name||null,imageUrl:t.imageUrl||t.image||null,name:t.name,email:t.email,image:t.image},icon:(null==(i=t.displayName)||null==(n=i.charAt(0))?void 0:n.toUpperCase())||(null==(l=t.name)||null==(s=l.charAt(0))?void 0:s.toUpperCase())||(null==(r=t.email)||null==(o=r.charAt(0))?void 0:o.toUpperCase())||"U"}}}function s(e,t){var n,i,s;return!!t&&[null==(n=e.subscriber)?void 0:n.id,null==(s=e.subscriber)||null==(i=s.user)?void 0:i.id].includes(t.id)}function l(e,t,n){return e+(n!==t?n?1:-1:0)}n.d(t,{MX:()=>l,T5:()=>s,gz:()=>i})}}]);

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.