티스토리 수익 글 보기

티스토리 수익 글 보기

“use strict”;(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([[“883”],{70145:function(e,t,n){n.d(t,{ct:()=>c,ey:()=>d,jN:()=>p});var o=n(69277),r=n(70408),l=n(4006),i=n(17402),a=n(15734),s=n.n(a);let u=(0,i.createContext)({oauthAccessToken:null,isOAuthProvider:!1}),d=()=>(0,i.useContext)(u);function c(e){let t=t=>{let{oauthAccessToken:n}=d();return(0,l.Y)(e,(0,r._)((0,o._)({},t),{oauthAccessToken:n}))};return t.displayName=”WithOAuthEmbed(“.concat(e.displayName||e.name||”Component”,”)”),t}let p=()=>{let{oauthAccessToken:e}=d();return(0,i.useMemo)(()=>{let t=t=>(e&&t.set(“Authorization”,”Bearer “.concat(e)),t);return{get:e=>t(s().get(e)),post:e=>t(s().post(e)),put:e=>t(s().put(e)),delete:e=>t(s().delete(e)),patch:e=>t(s().patch(e))}},[e])}},62578:function(e,t,n){n.d(t,{N:()=>a});var o=n(17402),r=n(46271),l=n(13022),i=n(12501);function a(e){let{editingCommentUserId:t,postPublicationId:n}=e,a=(0,r.Jd)(),s=!!(0,l.Ay)(“enable_notes_admins”),[u,d]=(0,o.useState)(null),{result:c}=(0,i.st)({pathname:”/api/v1/publication_user/notes_permissions”,auto:s}),p=(0,o.useRef)(null!=t?t:null);function m(e){var t;p.current=null!=(t=null==e?void 0:e.id)?t:null,d(e)}(0,o.useEffect)(()=>{if(p.current&&!u&&c&&c.length>1){let e=c.find(e=>e.id===p.current);m(null!=e?e:null)}},[c,u]);let h=null!=c?c:[];return{postAsUserId:p,enableUserSwitcher:s,eligiblePostAsUsers:n?h.filter(e=>{var t;return(null==(t=e.primary_publication)?void 0:t.id)===n||e.id===(null==a?void 0:a.id)}):h,postAsUser:u,handleUpdatePostAsUser:m}}},56878:function(e,t,n){n.d(t,{g:()=>J});var o=n(69277),r=n(70408),l=n(79785),i=n(4006),a=n(32485),s=n.n(a),u=n(75107),d=n(17402),c=n(15734),p=n.n(c),m=n(34746),h=n(5109),f=n(84605),g=n(70145),_=n(58292),v=n(62578),y=n(86500),Y=n(53928),b=n(94729),w=n(68349),C=n(57023),S=n(43954),I=n(25859),E=n(38093),N=n(16993),P=n(84843),O=n(63136),A=n(39318);function k(){let e=(0,l._)([“We’ve sent an email to “,”. Click the magic link or enter the code below:”]);return k=function(){return e},e}function D(){let e=(0,l._)([“We’ve sent an email to “,”. Click the magic link inside to continue.”]);return D=function(){return e},e}function R(e){var t,n;let{isOpen:o,onClose:r,user:l,pub:a,otpLoginEnabled:s,onboardingRedirect:u}=e,{iString:d,iTemplate:c}=(0,f.GO)();return(0,i.FD)(N.aF,{isOpen:o,onClose:r,className:”finish-magic-login-modal”,children:[(0,i.Y)(N.rQ,{icon:(0,i.Y)(P.qx,{icon:(0,i.Y)(S.A,{size:20})}),title:d(“Check your email to continue”),description:s?(0,i.Y)(O.EY,{children:c(k(),null!=(t=null==l?void 0:l.email)?t:”your email address”)}):(0,i.Y)(O.EY,{children:c(D(),null!=(n=null==l?void 0:l.email)?n:”your email address”)}),showClose:!0,alignItems:”center”,onClose:r}),(0,i.Y)(N.cw,{children:s?(0,i.Y)(E.Z,{email:null==l?void 0:l.email,redirect:u||document.location.href}):(0,i.Y)(O.EY.B4,{align:”center”,color:”secondary”,decoration:”underline”,children:(0,i.Y)(I.Yq,{href:(0,A.a7q)({for_pub:a.subdomain,with_password:!0}),children:d(“Sign in with password instead”)})})})]})}var T=n(87087),x=n(89490),F=n(35369),B=n(60322),U=n(8149),L=n(76977),G=n(88774),M=n(81929),W=n(47784),H=n(36372),q=n(56689),z=n(56262),K=n(49807),j=n(82776);function X(){let e=(0,l._)([“Only “,” subscribers can comment on this post”]);return X=function(){return e},e}let V=”commentInput”,J=(0,d.forwardRef)((e,t)=>{let{commentBeingEdited:n,parent:l,post:a,autoFocus:u,formClassName:c,saveEdit:m,onCancel:h,onSuccess:_,user:C,freeSignup:S,freeSignupEmail:I,pub:E,token:N,bannedFromNotes:P,alwaysShowButtons:O,mediaClipId:k}=e,{iString:D}=(0,f.GO)(),x=(0,H.d)(),F=(0,g.jN)(),{isOAuthProvider:B,oauthAccessToken:U}=(0,g.ey)(),[G,M]=(0,d.useState)(!1),[W,z]=(0,d.useState)(null),[X,J]=(0,d.useState)(!1),[Q,Z]=(0,d.useState)(!1),{enableUserSwitcher:$,eligiblePostAsUsers:ee,postAsUser:et,handleUpdatePostAsUser:en}=(0,v.N)({editingCommentUserId:null==n?void 0:n.user_id,postPublicationId:a.publication_id}),eo=(0,d.useMemo)(()=>{if(“undefined”!=typeof localStorage){let e=JSON.parse(localStorage.getItem(V)||”{}”);if(e.postId===a.id)return{value:e.value,alsoShareToNotes:!!e.alsoShareToNotes};localStorage.removeItem(V)}},[]),ei=(0,o._)({value:null==n?void 0:n.body,alsoShareToNotes:!1,loading:!1,error:null},eo),[{value:ea,alsoShareToNotes:es,loading:eu,error:ed},ec]=(0,d.useState)(ei),ep=e=>ec(t=>(0,r._)((0,o._)({},t),{value:e})),em=(0,d.useRef)(null),eh=(0,d.useRef)(null);(0,d.useImperativeHandle)(t,()=>({focus(){var e;null==(e=em.current)||e.focus()},getTextareaRef:()=>em}),[]),(0,d.useEffect)(()=>{if(u){var e;null==(e=em.current)||e.focus()}},[]);let ef=!(null==C?void 0:C.name),[eg,e_]=(0,d.useState)(!1),ev=async()=>{(0,y.u4)(y.qY.COMMENT_PAYWALL_SHOWN,{post_id:a.id,post_type:a.type,parent_id:null==l?void 0:l.id}),(0,Y.jN)(Y.ti.TRACK_PAYWALL_SHOWN),e_(!0)},ey=async()=>{(0,y.u4)(y.qY.FINISH_MAGIC_LOGIN_MODAL_SHOWN,{post_id:a.id,post_type:a.type,parent_id:null==l?void 0:l.id}),await eS(),Z(!0)},[eY,eb]=(0,d.useState)(!1),ew=async()=>{(0,y.u4)(y.qY.PROFILE_UPDATER_SHOWN,{post_id:a.id,parent_id:null==l?void 0:l.id}),eb(!0)},eC=(0,d.useRef)(!1),eS=async()=>{if(!C)return void console.error(“cannot sendLoginEmail, user not defined”);if(!eC.current){eC.current=!0;try{var e;let t=await (0,b.x6)(“/api/v1/email-login”,{method:”POST”,json:{email:C.email,redirect:null==(e=document.location.href.split(“?”)[0])?void 0:e.split(“#”)[0]}});”optional”===t.verification_code&&(M(!0),t.onboarding_redirect&&z(t.onboarding_redirect))}catch(e){alert((0,w.uX)(e))}}},eI=()=>{localStorage.setItem(V,JSON.stringify({postId:a.id,value:ea,alsoShareToNotes:es}))},eE=async()=>{if(n){ec(e=>(0,r._)((0,o._)({},e),{loading:!0}));try{let e=await (null==m?void 0:m(ea));eP(e)}catch(e){ec(t=>(0,r._)((0,o._)({},t),{loading:!1,error:e}))}}else eN()},eN=async function(){var e;let{profileUpdated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(eu)return;if(!(0,j.canPostComments)(C,a,E).canReply){eI(),await ev(),await (0,q.c)(600),ec(e=>(0,r._)((0,o._)({},e),{error:D(“Please sign in.”)}));return}if(ef&&!t){eI(),B?(J(!0),ec(e=>(0,r._)((0,o._)({},e),{loading:!1,error:D(“Please set your profile name to comment.”)}))):(J(!1),await ew(),await (0,q.c)(600),ec(e=>(0,r._)((0,o._)({},e),{error:D(“Please update your profile.”)})));return}ec(e=>(0,r._)((0,o._)({},e),{loading:!0}));let n={body:null==(e=em.current)?void 0:e.value,token:N,postAsUserId:null==et?void 0:et.id};k&&(n.mediaClipId=k);try{let e;if(es){let t=await F.post(“/api/v1/comment/attachment”).send({type:”link”,url:l?(0,T.XB)(a,l,E):(0,A.wu9)(E,a)}),r=null==t?void 0:t.body;if(r){let t=(0,o._)({},n);t.attachmentIds=[r.id],e=await F.post(“/api/v1/comment/feed”).send(t)}else console.warn(“Error creating attachment”)}l&&(n.parent_id=l.id);let t=await F.post(“/api/v1/post/”.concat(a.id,”/comment”)).send(n);if(localStorage.removeItem(V),!(null==C?void 0:C.profile_set_up_at)&&!B){let{body:{count:e}}=await p().get(“/api/v1/user/profile_role_count”);if(e>=2){let e=(0,A.yRP)(“”.concat((0,A.Ewe)(),”/profile/start”),{commentProfileFlow:!0,next:(0,T.XB)(a,t.body,E)});return(0,w.V2)(e,{local_navigation:!1}),!1}}eP({notesComment:e,res:t})}catch(e){e.response&&403===e.response.statusCode&&(C&&C.is_magic?await ey():await ev()),ec(t=>(0,r._)((0,o._)({},t),{loading:!1,error:e}))}},eP=e=>{let{res:t,notesComment:n}=e;if(!1!==t){if(_&&!ef){if(es&&n){let e=(0,K.Zgx)(n.body);x.popToast(()=>(0,i.Y)(H.y,{text:D(“Shared to Notes”),cta:D(“View now”),href:e}))}ep(“”),_(t.body)}else{let e=(0,T.PG)(a,E);B?(0,w.V2)((0,T.EQ)(a,E,null!=U?U:””)):window.location.pathname===e?window.location.reload():(0,w.V2)((0,T.PG)(a,E,es?{feedCommentUrl:(0,K.Zgx)(t.body)}:{}))}ec(e=>(0,r._)((0,o._)({},e),{loading:!1}))}};return(0,i.FD)(L.pT,{“data-test-id”:”comment-input”,flex:”grow”,className:s()({comment:n}),children:[(0,i.Y)(“form”,{className:s()(“form-CkZ7Kt”,c),onSubmit:e=>{e.preventDefault(),eE()},ref:eh,children:(0,i.Y)(el,{user:C,commentBeingEdited:n,post:a,pub:E,value:ea,bodyInputRef:em,onInput:e=>{let t=e.currentTarget.value;if(!(0,j.canPostComments)(C,a,E).canReply){e.preventDefault(),ev();return}ep(t)},onKeyDown:e=>{var t,n;if(null==C?void 0:C.is_magic){e&&e.preventDefault(),ey();return}if(!(0,j.canPostComments)(C,a,E).canReply){e.preventDefault(),ev();return}”Escape”===e.key&&(null==(t=em.current)?void 0:t.value.trim())===””?(null==(n=em.current)||n.blur(),null==h||h()):”Enter”===e.key&&e.metaKey&&eE()},bannedFromNotes:P,alsoShareToNotes:es,onShareToNotesChange:()=>ec(e=>(0,r._)((0,o._)({},e),{alsoShareToNotes:!es})),onCancel:()=>{h?h():ep(“”)},error:ed,loading:eu,alwaysShowButtons:O,isReplying:!!l,showProfileSetupLinkOnError:X,enableUserSwitcher:$,eligiblePostAsUsers:null!=ee?ee:[],postAsUser:et,handleUpdatePostAsUser:en})}),(0,i.Y)(er,{user:C,freeSignup:S,freeSignupEmail:I,pub:E,post:a,token:N,isProfileUpdateModalOpen:eY,setIsProfileUpdateModalOpen:eb,isPaywallModalOpen:eg,setIsPaywallModalOpen:e_,onProfileUpdaterSuccess:e=>”boolean”!=typeof e||!!(e&&eN({profileUpdated:e}))}),(0,i.Y)(R,{isOpen:Q,onClose:()=>Z(!1),user:C,pub:E,otpLoginEnabled:G,onboardingRedirect:W})]})}),Q=e=>{let{error:t,showProfileSetupLinkOnError:n}=e,{iString:o}=(0,f.GO)();if(!t)return null;let r=”string”==typeof t?t:(0,w.uX)(t,”Something went wrong.”);return(0,i.FD)(L.pT,{direction:”column”,gap:4,children:[(0,i.Y)(M.vw,{priority:”secondary”,theme:”error”,flex:”auto”,children:r}),n&&(0,i.Y)(O.EY.B3,{children:(0,i.Y)(“a”,{href:””.concat((0,A.Ewe)(),”/profile/edit”),target:”_blank”,children:o(“Set up profile”)})})]})},Z=e=>{let{alsoShareToNotes:t,onChange:n}=e,{iString:o}=(0,f.GO)();return(0,i.FD)(L.pT,{as:”label”,gap:12,alignItems:”center”,justifyContent:”center”,children:[(0,i.Y)(B.S,{name:”also_feed”,checked:t,onChange:n}),(0,i.Y)(O.EY.B3,{color:”secondary”,children:o(“Also share to Notes”)})]})},$=e=>{let{bodyInputRef:t,value:n,onInput:o,onKeyDown:r,iString:l,disabled:a}=e;return(0,i.Y)(W.A,{ref:t,name:”body”,placeholder:l(“Write a comment…”),defaultRows:4,maxRows:24,value:n||””,onInput:o,onKeyDown:r,className:”input-qHk4bN”,disabled:a,”aria-label”:l(“Write a comment…”)})},ee=e=>{let{isEditing:t,isReplying:n,bannedFromNotes:o,alsoShareToNotes:r,onShareToNotesChange:l,onCancel:a,loading:s,disableSubmit:u}=e;return(0,i.FD)(L.fI,{alignItems:”center”,justifyContent:”space-between”,children:[!t&&!o&&(0,i.Y)(Z,{alsoShareToNotes:r,onChange:l}),(0,i.FD)(et,{children:[(0,i.Y)(en,{onCancel:a}),(0,i.Y)(eo,{isEditing:t,isReplying:n,loading:s,disabled:u})]})]})},et=e=>{let{children:t}=e;return(0,i.Y)(L.fI,{gap:8,justifyContent:”end”,flex:”grow”,children:t})},en=e=>{let{onCancel:t}=e,{iString:n}=(0,f.GO)();return(0,i.Y)(F.$n,{priority:”secondary”,onClick:t,children:n(“Cancel”)})},eo=e=>{let{isEditing:t,isReplying:n,loading:o,disabled:r}=e,{iString:l}=(0,f.GO)();return(0,i.Y)(F.$n,{priority:”primary”,type:”submit”,loading:o,disabled:r,children:l(t?”Save”:n?”Reply”:”Post”)})},er=e=>{let{user:t,freeSignup:n,freeSignupEmail:o,pub:r,post:l,token:a,isProfileUpdateModalOpen:s,setIsProfileUpdateModalOpen:u,isPaywallModalOpen:d,setIsPaywallModalOpen:c,onProfileUpdaterSuccess:p}=e,{iString:g,iTemplate:_}=(0,f.GO)();return(0,i.FD)(i.FK,{children:[(0,i.Y)(h.QL,{isOpen:s,onClose:e=>{u(!1),p(e)},user:t,freeSignup:n,freeSignupEmail:o,optionalPhoto:!0,token:a,text:g(“Save and post comment”)}),(0,i.Y)(m.EH,{isOpen:d,onClose:()=>c(!1),user:t,freeSignup:n,freeSignupEmail:o,publication:r,post:l,title:_(X(),(0,z.isFoundingAudience)(l.audience)?”founding”:”paid”),reauthenticationTitle:g(“To post a comment, please re-authenticate.”)})]})},el=e=>{let{user:t,commentBeingEdited:n,post:o,pub:r,value:l,bodyInputRef:a,onInput:s,onKeyDown:u,bannedFromNotes:d,alsoShareToNotes:c,onShareToNotesChange:p,onCancel:m,error:h,loading:g,alwaysShowButtons:v,isReplying:y,showProfileSetupLinkOnError:Y,enableUserSwitcher:b,eligiblePostAsUsers:w,postAsUser:S,handleUpdatePostAsUser:I}=e,{iString:E}=(0,f.GO)(),N=!(null==l?void 0:l.trim());return(0,i.FD)(i.FK,{children:[b&&w&&w.length>1?(0,i.Y)(ei,{user:null!=S?S:t,eligiblePostAsUsers:w,handleUpdatePostAsUser:I}):(0,i.Y)(_.bB,{size:32,user:t}),(0,i.FD)(L.I1,{flex:”grow”,gap:8,children:[n&&(0,i.Y)(C.P,{comment:n,post:o,pub:r,isCollapsed:!0,userBanned:!1,hideContextMenu:!0,onChange:()=>{},startEdit:()=>{},startReport:()=>{},openBan:()=>{}}),(0,i.Y)($,{bodyInputRef:a,value:l,onInput:s,onKeyDown:u,iString:E,disabled:g}),(0,i.Y)(Q,{error:h,showProfileSetupLinkOnError:Y}),(0,i.Y)(U.N,{open:!N||!!v,children:(0,i.Y)(ee,{isReplying:y,isEditing:!!n,bannedFromNotes:d,alsoShareToNotes:c,onShareToNotesChange:p,onCancel:m,loading:g,disableSubmit:N})})]})]})};function ei(e){let{user:t,eligiblePostAsUsers:n,handleUpdatePostAsUser:o}=e;return(0,i.Y)(G.W1,{trigger:(0,i.FD)(x.az,{className:”postAsUserSwitcher-IPqxbX”,children:[(0,i.Y)(_.bB,{size:32,user:t}),(0,i.Y)(u.A,{size:12,className:”postAsUserSwitcherIcon-Q4hhV0″})]}),children:n.map(e=>(0,i.Y)(G.Dr,{onClick:()=>o(e),children:e.name},e.id))})}},57023:function(e,t,n){n.d(t,{P:()=>E});var o=n(79785),r=n(4006),l=n(69843),i=n.n(l),a=n(17402),s=n(84777),u=n(84605),d=n(46271),c=n(27332),p=n(25859),m=n(58292),h=n(23294),f=n(55347),g=n(87087),_=n(89490),v=n(35369),y=n(76977),Y=n(63136),b=n(16291),w=n(82776),C=n(57324),S=n(70515);function I(){let e=(0,o._)([“Edited”]);return I=function(){return e},e}function E(e){let{post:t,pub:n,comment:o,isCollapsed:l,onProfileClick:i,userBanned:a,toggleCollapse:s,userPendingApproval:u,onChange:p,startEdit:m,startReport:f,openBan:g,hideContextMenu:_}=e,v=(0,d.Jd)();return(0,r.FD)(y.Ye,{children:[(0,r.FD)(T,{children:[(0,r.Y)(c.X6,{children:(0,r.FD)(c.qv,{children:[(0,r.Y)(N,{comment:o,onClick:i}),(0,r.Y)(P,{comment:o}),(0,r.Y)(A,{comment:o,post:t,pub:n}),(0,r.Y)(k,{comment:o})]})}),!l&&(0,r.Y)(R,{comment:o,userBanned:a,userPendingApproval:u}),(0,r.Y)(D,{comment:o,isCollapsed:l,toggleCollapse:s})]}),(0,r.Y)(x,{onClick:s}),!_&&(0,r.Y)(h.f,{comment:o,pub:n,post:t,user:v,onChange:p,startEdit:m,startReport:f,openBan:g,isCollapsed:l,toggleCollapse:s})]})}function N(e){let{comment:t,onClick:n}=e,{iString:o}=(0,u.GO)();if(t.name&&!i()(t.user_id))return(0,r.Y)(Y.EY.B4,{color:”primary”,display:”flex”,gap:6,children:(0,r.Y)(c.wF,{user:(0,g.DH)(t),onClick:n?()=>n(t):void 0})});let l=o(t.hidden?”Comment hidden”:t.deleted?”Comment deleted”:(0,S.Pp)(t)?”Anonymous”:”Comment removed”);return(0,r.Y)(Y.EY.B4,{color:”secondary”,children:l})}function P(e){var t,n,o,l,i;let{comment:a}=e,u=(null==(t=a.metadata)?void 0:t.author_on_other_pub)&&!a.metadata.is_author,d=(null==(o=a.metadata)||null==(n=o.author_on_other_pub)?void 0:n.id)&&!a.hidden;return u?d?(0,r.Y)(s.m,{pubId:null!=(i=null==(l=a.metadata.author_on_other_pub)?void 0:l.id)?i:0,trigger:(0,r.Y)(O,{comment:a})}):(0,r.Y)(O,{comment:a}):null}function O(e){var t;let{comment:n}=e,o=(0,d.Jd)();return n.metadata.author_on_other_pub&&o?(0,r.Y)(Y.EY.B4,{as:”span”,color:”secondary”,weight:”regular”,children:(0,r.Y)(p.RC,{publication:n.metadata.author_on_other_pub,utm_source:C.VU.substackFeedItem,utm_content:C.fL.commentMetadata,user:o,children:(0,r.FD)(“span”,{children:[(0,w.truncateText)(null==(t=n.metadata.author_on_other_pub)?void 0:t.name,32),” “]})})}):null}function A(e){let{comment:t,post:n,pub:o}=e;return(0,r.Y)(Y.Yq,{href:(0,g.XB)(n,t,o),onClick:e=>null===this||void 0===this?void 0:this.onDateClick(e),rel:”nofollow”,native:!0,color:”secondary”,title:c.M6.format((0,b.A)(t.date).toDate()),children:(0,r.Y)(m.iE,{timestamp:t.date})})}function k(e){let{comment:t}=e,{iTemplate:n}=(0,u.GO)();return t.edited_at?(0,r.Y)(Y.EY.B4,{as:”span”,fontStyle:”italic”,decoration:”hover-underline”,cursor:”pointer”,color:”tertiary”,title:c.M6.format((0,b.A)(t.edited_at).toDate()),children:n(I())}):null}function D(e){let{comment:t,toggleCollapse:n,isCollapsed:o}=e,{iString:l}=(0,u.GO)(),[i,s]=(0,a.useState)(!1);if(!o||!n)return null;let d=e=>{var t,n;return(null!=(t=e.children)?t:[]).length+(null!=(n=e.children)?n:[]).reduce((e,t)=>e+d(t),0)},c=d(t),p=l(i?”Loading”:c>0?”Show replies”:”Show comment”);return(0,r.Y)(y.fI,{children:(0,r.Y)(v.$n,{size:”sm”,flex:”auto”,priority:”secondary-outline”,maxHeight:28,onClick:()=>{s(!0),setTimeout(()=>{n(),s(!1)},0)},children:p})})}function R(e){let{comment:t,userBanned:n,userPendingApproval:o}=e,l=(0,f.Ud)({comment:t}),i=(0,f.Q0)({comment:t,userBanned:n}),a=(0,f.GL)({comment:t,userPendingApproval:o});return l||i||a?(0,r.FD)(f.FS,{children:[l,i,a]}):null}let T=(0,_.I4)({display:”flex”,direction:”column”,gap:4}),x=(0,_.I4)({display:”flex”,direction:”column”,flex:”grow”})},47784:function(e,t,n){n.d(t,{A:()=>m});var o=n(69277),r=n(70408),l=n(32641),i=n(4006),a=n(32485),s=n.n(a),u=n(17402),d=n(11587),c=n(65842),p=n(24311);let m=(0,u.forwardRef)((e,t)=>{var{className:n,error:a=!1,defaultRows:m=4,maxRows:h,value:f,onChange:g}=e,_=(0,l._)(e,[“className”,”error”,”defaultRows”,”maxRows”,”value”,”onChange”]);let{innerRef:v,combinedRef:y}=(0,c.N)(t),{value:Y,handleChange:b}=(0,d.u)({value:f,onChange:g}),w=(0,u.useCallback)(()=>{let e=v.current;if(!e)return;let t=window.getComputedStyle(e),n=parseInt(t.borderTopWidth)+parseInt(t.borderBottomWidth),o=parseInt(t.paddingTop)+parseInt(t.paddingBottom),r=parseInt(t.lineHeight);e.style.height=”auto”;let l=h?r*h+n+o:1/0,i=r*m+n+o,a=Math.min(Math.max(e.scrollHeight+n,i),l);e.style.height=””.concat(a,”px”)},[m,h]);return(0,u.useEffect)(()=>{w(),document.fonts&&”loaded”!==document.fonts.status&&document.fonts.ready.then(w)},[w,f]),(0,u.useEffect)(()=>(window.addEventListener(“resize”,w),()=>window.removeEventListener(“resize”,w)),[w]),(0,i.Y)(d.T,(0,r._)((0,o._)({},_),{value:Y,onChange:e=>{b(e),w()},rows:m,className:s()(n,p.A.autogrowing),ref:y,error:a}))})}}]);