1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2475,23441],{2475:(e,t,n)=>{n.r(t),n.d(t,{CommentsField:()=>V});var l=n(22634),a=n(63380),o=n(73617),i=n(22154),r=n(23978),d=n(16984),c=n(67804),s=n(16068),u=n(30982),p=n(56151),h=n(88146),m=n(76042),f=n(4074),g=n(72226),x=n(52334),C=n(85459),y=n(30951),b=n(64785),I=n(71307),j=n(95938),k=n(391),w=n(64951),v=n(39236),P=n(30197),_=n(33253),D=n(504),S=n(52714),$=n(23441);let A=(0,j.I4)(C.t).withConfig({displayName:"ContentStack",componentId:"sc-tkibmo-0"})`width:320px;`;function N(e){let t,n,i,d,u,p=(0,f.c)(69),{count:h,currentUser:x,fieldTitle:I,isCreatingDataset:j,mentionOptions:w,onChange:v,onClick:P,onClose:_,onCommentAdd:D,onDiscard:N,onInputKeyDown:H,open:M,value:O}=e,{t:V}=(0,l.t)(c.b),{error:z}=(0,s.t)(),E=(0,m.useRef)(null),[L,R]=(0,m.useState)(null),F=(0,m.useRef)(null),K=h>0,T;p[0]!==L||p[1]!==_||p[2]!==M?(T=()=>{M&&(_(),L?.focus())},p[0]=L,p[1]=_,p[2]=M,p[3]=T):T=p[3];let B=T,W;p[4]!==B||p[5]!==D?(W=e=>{D(e),B()},p[4]=B,p[5]=D,p[6]=W):W=p[6];let Y=W,Z;p[7]===O?Z=p[8]:(Z=(0,c.d)(O),p[7]=O,p[8]=Z);let q=Z,G;p[9]!==B||p[10]!==q?(G=()=>{q?F.current?.discardDialogController.open():B()},p[9]=B,p[10]=q,p[11]=G):G=p[11];let J=G,Q;p[12]===H?Q=p[13]:(Q=e=>{e.isDefaultPrevented()||H&&H(e)},p[12]=H,p[13]=Q);let U=Q,X;p[14]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{F.current?.discardDialogController.close()},p[14]=X):X=p[14];let ee=X,et;p[15]!==B||p[16]!==N?(et=()=>{F.current?.discardDialogController.close(),B(),N()},p[15]=B,p[16]=N,p[17]=et):et=p[17];let en=et,el;p[18]===J?el=p[19]:(el=e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),J())},p[18]=J,p[19]=el);let ea=el,eo;if(p[20]===Symbol.for("react.memo_cache_sentinel")?(eo=()=>[E.current],p[20]=eo):eo=p[20],(0,y.t)(M&&J,eo),!K){let e,t,n,l,i,d;p[21]===I?e=p[22]:(e={field:I},p[21]=I,p[22]=e),p[23]!==V||p[24]!==e?(t=(0,g.jsx)(o.t,{t:V,i18nKey:"compose.add-comment-input-placeholder",values:e}),p[23]=V,p[24]=e,p[25]=t):t=p[25];let s=t,u;p[26]!==x||p[27]!==en||p[28]!==U||p[29]!==Y||p[30]!==j||p[31]!==w||p[32]!==v||p[33]!==s||p[34]!==O?(u=(0,g.jsx)(A,{padding:2,gap:4,children:(0,g.jsx)(c.o,{currentUser:x,focusLock:!0,focusOnMount:!0,mentionOptions:w,onChange:v,onDiscardCancel:ee,onDiscardConfirm:en,onKeyDown:U,onSubmit:Y,placeholder:s,readOnly:j,ref:F,value:O})}),p[26]=x,p[27]=en,p[28]=U,p[29]=Y,p[30]=j,p[31]=w,p[32]=v,p[33]=s,p[34]=O,p[35]=u):u=p[35];let h=u,m;p[36]===Symbol.for("react.memo_cache_sentinel")?(m=["bottom-end"],p[36]=m):m=p[36],p[37]===V?n=p[38]:(n=V("field-button.aria-label-add"),p[37]=V,p[38]=n);let f=j||!!z,C;return p[39]===V?C=p[40]:(C=V("field-button.title"),p[39]=V,p[40]=C),p[41]===C?l=p[42]:(l={content:C,placement:"top"},p[41]=C,p[42]=l),p[43]!==P||p[44]!==M||p[45]!==n||p[46]!==f||p[47]!==l?(i=(0,g.jsx)("div",{children:(0,g.jsx)(a.t,{"aria-label":n,disabled:f,icon:$.AddCommentIcon,mode:"bleed",onClick:P,ref:R,selected:M,tooltipProps:l})}),p[43]=P,p[44]=M,p[45]=n,p[46]=f,p[47]=l,p[48]=i):i=p[48],p[49]!==h||p[50]!==ea||p[51]!==M||p[52]!==i?(d=(0,g.jsx)(r.t,{constrainSize:!0,content:h,fallbackPlacements:m,open:M,placement:"right-start",portal:!0,ref:E,onKeyDown:ea,children:i}),p[49]=h,p[50]=ea,p[51]=M,p[52]=i,p[53]=d):d=p[53],d}p[54]!==h||p[55]!==V?(t=V("field-button.content",{count:h}),p[54]=h,p[55]=V,p[56]=t):t=p[56],p[57]===V?n=p[58]:(n=V("field-button.aria-label-open"),p[57]=V,p[58]=n),p[59]===Symbol.for("react.memo_cache_sentinel")?(i=(0,g.jsx)(C.n,{size:1,children:(0,g.jsx)(S.CommentIcon,{})}),p[59]=i):i=p[59];let ei=h>9?"9+":h,er;return p[60]===ei?er=p[61]:(er=(0,g.jsxs)(k.so,{alignItems:"center",gap:2,children:[i,(0,g.jsx)(C.n,{size:0,children:ei})]}),p[60]=ei,p[61]=er),p[62]!==P||p[63]!==n||p[64]!==er?(d=(0,g.jsx)(b.t,{"aria-label":n,mode:"bleed",onClick:P,padding:2,gap:2,children:er}),p[62]=P,p[63]=n,p[64]=er,p[65]=d):d=p[65],p[66]!==d||p[67]!==t?(u=(0,g.jsx)(a.n,{portal:!0,placement:"top",content:t,children:d}),p[66]=d,p[67]=t,p[68]=u):u=p[68],u}let H=new Map,M=[],O={initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}};function V(e){let t,n=(0,f.c)(5),{enabled:l,mode:a}=(0,u.t)();if(!l){let t;return n[0]===e?t=n[1]:(t=e.renderDefault(e),n[0]=e,n[1]=t),t}return n[2]!==a||n[3]!==e?(t=(0,g.jsx)(L,{...e,mode:a}),n[2]=a,n[3]=e,n[4]=t):t=n[4],t}let z=(0,j.I4)(v.PY1.div).withConfig({displayName:"HighlightDiv",componentId:"sc-p1huj2-0"})(({theme:e})=>{let{radius:t,space:n,color:l}=e.sanity,a=_.OZ[c.n][l.dark?900:50].hex;return(0,j.AH)`mix-blend-mode:${l.dark?"screen":"multiply"};border-radius:${t[3]}px;top:-${n[2]}px;left:-${n[2]}px;bottom:-${n[2]}px;right:-${n[2]}px;pointer-events:none;position:absolute;z-index:1;width:calc(100% + ${2*n[2]}px);height:calc(100% + ${2*n[2]}px);background-color:${a};`}),E=(0,j.I4)(C.t).withConfig({displayName:"FieldStack",componentId:"sc-p1huj2-1"})`position:relative;&:empty:not([hidden]){display:none;}`;function L(e){let t,n,l,a,o,r,s,u=(0,f.c)(86),{mode:C}=e,y=(0,i.n)(),{element:b}=(0,I.a)(),j=(0,m.useRef)(null),{comments:k,isCommentsOpen:v,isCreatingDataset:_,mentionOptions:S,onCommentsOpen:$,operation:A,setStatus:V,status:L}=(0,c.t)(),{upsellData:T,handleOpenDialog:B}=(0,h.t)(),{selectedPath:W,setSelectedPath:Y}=(0,p.t)(),{authoringPath:Z,setAuthoringPath:q}=function(){let e=(0,m.useContext)(x.ki);if(!e)throw Error("useCommentsAuthoringPath: missing context value");return e}(),G;u[0]===b?G=u[1]:(G={boundaryElement:b},u[0]=b,u[1]=G);let{scrollToGroup:J}=(0,c.y)(G),Q;u[2]===e.schemaType?Q=u[3]:(Q=(0,d.t)(e.schemaType),u[2]=e.schemaType,u[3]=Q);let U=Q,X;u[4]===e.path?X=u[5]:(X=w.dI(e.path),u[4]=e.path,u[5]=X);let ee=X,et;u[6]===ee?et=u[7]:(et=H.get(ee)||null,u[6]=ee,u[7]=et);let[en,el]=(0,m.useState)(et),ea=Z===ee,eo;u[8]!==v||u[9]!==e.path||u[10]!==W?.fieldPath||u[11]!==W?.origin?(eo=()=>!!v&&W?.origin!=="form"&&W?.origin!=="url"&&K(W?.fieldPath,e.path),u[8]=v,u[9]=e.path,u[10]=W?.fieldPath,u[11]=W?.origin,u[12]=eo):eo=u[12],W?.fieldPath,W?.origin,u[13]===eo?t=u[14]:(t=eo(),u[13]=eo,u[14]=t);let ei=t;if(W?.threadId,u[15]!==k.data.open||u[16]!==W?.threadId){let e;u[18]===W?.threadId?e=u[19]:(e=e=>e.threadId===W?.threadId,u[18]=W?.threadId,u[19]=e),n=k.data.open.filter(e).some(F),u[15]=k.data.open,u[16]=W?.threadId,u[17]=n}else n=u[17];let er=n,ed;if(u[20]!==k.data.open||u[21]!==e.path){let t;u[23]===e.path?t=u[24]:(t=t=>K(t.fieldPath,e.path)?t.commentsCount:0,u[23]=e.path,u[24]=t),ed=k.data.open.map(t).reduce(R,0),u[20]=k.data.open,u[21]=e.path,u[22]=ed}else ed=u[22];let ec=ed||0,es=ec>0,eu;u[25]===ee?eu=u[26]:(eu=()=>{el(null),H.delete(ee)},u[25]=ee,u[26]=eu);let ep=eu,eh;u[27]!==k.data.open||u[28]!==B||u[29]!==es||u[30]!==ea||u[31]!==C||u[32]!==$||u[33]!==e.path||u[34]!==J||u[35]!==q||u[36]!==Y||u[37]!==V||u[38]!==L||u[39]!==ee||u[40]!==T?(eh=()=>{if(es){"resolved"===L&&V("open"),q(null),$?.();let t=k.data.open.find(t=>K(t.fieldPath,e.path));t&&(Y({threadId:t.threadId,origin:"form",fieldPath:t.fieldPath}),J(t.threadId));return}"upsell"===C?T?B("field_action"):$?.():q(ea?null:ee)},u[27]=k.data.open,u[28]=B,u[29]=es,u[30]=ea,u[31]=C,u[32]=$,u[33]=e.path,u[34]=J,u[35]=q,u[36]=Y,u[37]=V,u[38]=L,u[39]=ee,u[40]=T,u[41]=eh):eh=u[41];let em=eh,ef;u[42]!==$||u[43]!==A||u[44]!==e.path||u[45]!==ep||u[46]!==J||u[47]!==Y||u[48]!==V||u[49]!==L?(ef=t=>{if(t){let n=(0,D.A)(),l={type:"field",fieldPath:w.dI(e.path),message:t,parentCommentId:void 0,status:"open",threadId:n,reactions:M};A.create(l),$?.(),"resolved"===L&&V("open"),ep(),Y({threadId:n,origin:"form",fieldPath:w.dI(e.path)}),J(n)}},u[42]=$,u[43]=A,u[44]=e.path,u[45]=ep,u[46]=J,u[47]=Y,u[48]=V,u[49]=L,u[50]=ef):ef=u[50];let eg=ef,ex;u[51]===q?ex=u[52]:(ex=()=>q(null),u[51]=q,u[52]=ex);let eC=ex,ey;u[53]===ee?ey=u[54]:(ey=e=>{el(e),H.set(ee,e)},u[53]=ee,u[54]=ey);let eb=ey,eI;u[55]!==ec||u[56]!==y||u[57]!==U||u[58]!==em||u[59]!==eC||u[60]!==eg||u[61]!==eb||u[62]!==_||u[63]!==ea||u[64]!==S||u[65]!==ep||u[66]!==en?(eI=y&&(0,g.jsx)(N,{count:Number(ec),currentUser:y,fieldTitle:U,isCreatingDataset:_,mentionOptions:S,onChange:eb,onClick:em,onClose:eC,onCommentAdd:eg,onDiscard:ep,open:ea,value:en}),u[55]=ec,u[56]=y,u[57]=U,u[58]=em,u[59]=eC,u[60]=eg,u[61]=eb,u[62]=_,u[63]=ea,u[64]=S,u[65]=ep,u[66]=en,u[67]=eI):eI=u[67],u[68]!==es||u[69]!==ea||u[70]!==eI?(l={button:eI,hasComments:es,isAddingComment:ea},u[68]=es,u[69]=ea,u[70]=eI,u[71]=l):l=u[71];let ej=l,ek;return u[72]===e.path?ek=u[73]:(ek=(0,c.g)(w.dI(e.path)),u[72]=e.path,u[73]=ek),u[74]!==ej||u[75]!==e?(a=e.renderDefault({...e,__internal_comments:ej}),u[74]=ej,u[75]=e,u[76]=a):a=u[76],u[77]!==er||u[78]!==ei?(o=ei&&!er&&(0,g.jsx)(z,{animate:"animate",exit:"exit",initial:"initial",variants:O}),u[77]=er,u[78]=ei,u[79]=o):o=u[79],u[80]===o?r=u[81]:(r=(0,g.jsx)(P.N,{children:o}),u[80]=o,u[81]=r),u[82]!==ek||u[83]!==a||u[84]!==r?(s=(0,g.jsxs)(E,{...ek,ref:j,children:[a,r]}),u[82]=ek,u[83]=a,u[84]=r,u[85]=s):s=u[85],s}function R(e,t){return e+t}function F(e){return(0,c.f)(e.parentComment)}function K(e,t){let n=(0,c.p)(e);return!!n&&w.w1(t,n)}},23441:(e,t,n)=>{n.r(t),n.d(t,{AddCommentIcon:()=>o,default:()=>o});var l=n(76042),a=n(72226);let o=(0,l.forwardRef)(function(e,t){return(0,a.jsx)("svg",{"data-sanity-icon":"add-comment",width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,ref:t,children:(0,a.jsx)("path",{d:"M13 6.5H7.5C6.39543 6.5 5.5 7.39543 5.5 8.5V14.5C5.5 15.6046 6.39543 16.5 7.5 16.5H9.5V20.5L13.5 16.5H16.5C17.6046 16.5 18.5 15.6046 18.5 14.5V12M15 6.5H22M18.5 10V3",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"})})})},88146:(e,t,n)=>{n.d(t,{t:()=>i});var l=n(76042),a=n(4074),o=n(52334);function i(){let e=(0,a.c)(1),t=(0,l.useContext)(o.F8);if(!t){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={upsellData:null,handleOpenDialog:m,handleClose:h,upsellDialogOpen:!1,telemetryLogs:{dialogSecondaryClicked:p,dialogPrimaryClicked:u,panelViewed:s,panelDismissed:c,panelPrimaryClicked:d,panelSecondaryClicked:r}},e[0]=t):t=e[0],t}return t}function r(){return null}function d(){return null}function c(){return null}function s(){return null}function u(){return null}function p(){return null}function h(){return null}function m(){return null}}}]);
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.