https://www.tally.xyz/_next/static/chunks/pages/gov/[governanceId]/delegate/edit-e62d3e1f089e8cfa.js
1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="24a6286e-a512-49f8-ab37-453798435547",e._sentryDebugIdIdentifier="sentry-dbid-24a6286e-a512-49f8-ab37-453798435547")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4807],{5823:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__N_SSP:()=>eo,default:()=>ed});var r=n(96690),l=n(31672),i=n(67336),a=n(13254),s=n(3641),o=n(57050),d=n(78153),c=n(97395),u=n(96405),m=n(43964),g=n(87849),x=n(78616),h=n(96419),p=n(27875),y=n(5170),j=n(14432),f=n(68731),b=n(95378),v=n(13296),A=n(22489),S=n(38776),E=n(42586),_=n(20182),C=n(43611),w=n(8253),I=n(81336),T=n(49540),D=n(29940),O=n(61884),P=n(11673),k=n(48331),B=n(35043),L=n(97726),M=n(89905),z=n(51499),W=n(12152),N=n(70274),F=n(83003),R=n(16597),U=n(47717),Y=n(8272),$=n(22011),q=n(47141);let H=e=>{let{statement:t,isLoading:n,organization:i,governanceName:a}=e,{query:o,push:p}=(0,D.r)(),y=(0,A.jE)(),{redirect:j}=o,{toast:f}=(0,O.dj)(),[b,v]=(0,E.useState)(!0),{mutate:k,isPending:z}=(0,N.kQ5)({onSuccess:e=>{e&&(["DelegateStatement"].forEach(e=>y.invalidateQueries({queryKey:[e]})),f({status:"success",title:"Your changes have been saved"}),setTimeout(()=>{p(er)},1e3))}}),[W,U]=(0,E.useState)([]),{errors:Y,handleChange:$,touched:H,values:Q,handleSubmit:V,setFieldValue:Z,setValues:J,isValid:K}=(0,S.Wx)({initialValues:{isMember:!0,statement:(0,B.Z)(i.id),statementSummary:""},validationSchema:_.Ik({statement:_.Yj().trim().max(1e4,"The statement cannot be more than ".concat(1e4," characters")),statementSummary:_.Yj().trim().max(140,"The summary cannot be more than ".concat(140," characters"))}),onSubmit(){let e=W.filter(e=>e.id).map(e=>e.id);k({input:{organizationId:i.id,statement:Q.statement,isMember:Q.isMember,statementSummary:Q.statementSummary,issueIds:e}})}});(0,E.useEffect)(()=>{if(t){var e,n,r;v(!1),J({statement:null==t?void 0:t.statement,statementSummary:null!=(e=null==t?void 0:t.statementSummary)?e:"",isMember:null==(n=null==t?void 0:t.isMember)||n}),U(null!=(r=null==t?void 0:t.issues)?r:[]),setTimeout(()=>{v(!0)},100)}},[t,J]);let ee=i?(0,L.v)(i.id):void 0,et=(0,E.useMemo)(()=>{var e;return(null==ee||null==(e=ee.delegate)?void 0:e.isMember)?Q.isMember?ee.delegate.isMember.on:ee.delegate.isMember.off:"As an active delegate, you are responsible for keeping up with governance discussions and proposals"},[ee,Q.isMember]);if(n)return null;let en=t?"Edit ".concat(a," Delegate Profile"):"Create ".concat(a," Delegate Profile"),er=j||s.ROUTES.user.yourDAOs();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("form",{onSubmit:V,children:(0,r.jsx)(w.A,{title:en,topRight:(0,r.jsxs)(l.B,{direction:"row",display:{base:"none",sm:"flex"},spacing:2,children:[(0,r.jsx)(I.A,{href:er,children:(0,r.jsx)(d.$,{"data-qa":"delegateprofilepage-cancel-btn",isDisabled:z,variant:"secondary",children:"Cancel"})}),(0,r.jsx)(d.$,{"data-qa":"delegateprofilepage-save-btn",isDisabled:!K,isLoading:z,type:"submit",variant:"primary",children:"Save"})]}),children:(0,r.jsxs)(l.B,{pt:{base:6,sm:0},spacing:6,children:[(0,q.j)(i)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F.A,{errors:Y,fontWeight:"bold",label:(0,M.a)(i.id,"Active delegate"),name:"isMember",onChange:$,touched:H,values:Q}),(0,r.jsx)(C.A,{isDisplayingIcon:!1,status:"info",children:(0,r.jsx)(T.A,{content:et})}),(0,r.jsx)(c.c,{})]}),(0,r.jsxs)(u.MJ,{isInvalid:!!(null==Y?void 0:Y.statement),children:[(0,r.jsx)(m.l,{color:"gray.700",fontWeight:"bold",children:"Full Statement"}),(0,r.jsx)(g.E,{color:"gray.500",mb:2,textStyle:"md",children:"Why do you wish to be a delegate? Share what members can expect from you if they delegate to you."}),b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P.A,{onChange:e=>Z("statement",e),placeholder:"Enter a statement",value:Q.statement}),(null==Y?void 0:Y.statement)?(0,r.jsx)(x.Wt,{children:Y.statement}):null," "]}):null]}),(0,r.jsxs)(u.MJ,{isInvalid:!!(null==Y?void 0:Y.statementSummary),children:[(0,r.jsx)(l.B,{direction:"row",children:(0,r.jsxs)(h.s,{direction:"column",flex:1,children:[(0,r.jsx)(m.l,{color:"gray.700",fontWeight:"bold",children:"Statement Summary"}),(0,r.jsxs)(g.E,{color:"gray.500",mb:2,textStyle:"md",children:["Displayed in profile preview cards. Max"," ",140," characters."]})]})}),(0,r.jsx)(R.A,{errors:Y,name:"statementSummary",onChange:$,placeholder:"Enter a summary of your delegation statement",touched:H,values:Q}),(null==Y?void 0:Y.statementSummary)?(0,r.jsx)(x.Wt,{children:Y.statementSummary}):null]}),(0,r.jsx)(G,{handleAddOrganizationIssue:e=>{W.length<3&&(W.some(t=>t.id===e.id)||U([...W,e]))},handleDeleteOrganizationIssue:e=>{U(W.filter(t=>t.id!==e.id))},organizationId:i.id,selectedIssues:W}),(0,r.jsxs)(l.B,{bg:"white",borderTop:"gray.dark",bottom:0,direction:"column",display:{base:"flex",sm:"none"},left:0,position:"fixed",py:4,right:0,spacing:2,zIndex:5,children:[(0,r.jsx)(h.s,{px:5,children:(0,r.jsx)(X,{})}),(0,r.jsx)(c.c,{}),(0,r.jsxs)(l.B,{direction:"column",px:5,children:[(0,r.jsx)(I.A,{href:er,children:(0,r.jsx)(d.$,{isDisabled:z,variant:"secondary",width:"100%",children:"Cancel"})}),(0,r.jsx)(d.$,{isDisabled:!K,isLoading:z,type:"submit",variant:"primary",children:"Save"})]})]})]})})}),(0,r.jsx)(w.A,{display:{base:"none",sm:"block"},pt:{base:4,sm:0},children:(0,r.jsx)(X,{textAlign:"center"})})]})},G=e=>{let{organizationId:t,selectedIssues:n,handleAddOrganizationIssue:i,handleDeleteOrganizationIssue:a}=e,{isFeatureFlagOn:s}=(0,W.Z5)(),{data:c}=(0,N.pYY)({input:{filters:{organizationId:t}}}),u=(null==c?void 0:c.issues)?(0,z.sv)(c.issues,s(W.TO.CustomFocusAreasOnly)):void 0;return(null==u?void 0:u.length)?(0,r.jsxs)(h.s,{direction:"column",children:[(0,r.jsxs)(h.s,{align:"center",justify:"space-between",children:[(0,r.jsx)(g.E,{color:"gray.700",fontWeight:"bold",children:"Focus Areas"}),(0,r.jsx)(p.W,{children:e=>{let{isOpen:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.I,{as:d.$,"data-qa":"delegateprofilepage-ad
1dissue-btn",isActive:t,variant:"tertiary",children:(0,r.jsxs)(j.z,{spacing:1,children:[(0,r.jsx)(f.I,{as:Y.F,fill:"gray.700",h:3,w:3}),(0,r.jsx)(g.E,{fontStyle:"md",children:"Add Focus Area"})]})}),(0,r.jsx)(b.c,{children:u.map((e,t)=>(0,r.jsx)(v.D,{onClick:()=>{e&&i(e)},children:(0,r.jsx)(g.E,{textStyle:"md",children:null==e?void 0:e.name})},"organization_issue_".concat(t)))})]})}})]}),(0,r.jsx)(g.E,{color:"gray.500",textStyle:"md",children:"Choose up to 3. Potential delegators can filter based on these items on the explore page."}),(0,r.jsx)(l.B,{mt:4,children:n.length?n.map(e=>(0,r.jsxs)(h.s,{align:"center",justify:"space-between",children:[(0,r.jsxs)(j.z,{align:"center",bg:"taxonomy.bg",borderRadius:"md",px:4,py:2,children:[(0,r.jsx)(f.I,{as:U.R,color:"taxonomy.text",fill:"taxonomy.text"}),(0,r.jsx)(g.E,{color:"taxonomy.text",fontWeight:"bold",textStyle:"md",children:e.name})]}),(0,r.jsx)(d.$,{bg:"none",onClick:()=>a(e),children:(0,r.jsx)(f.I,{as:o.d})})]},"selectedIssues_".concat(e.id))):(0,r.jsx)(g.E,{color:"gray.500",textAlign:"center",textStyle:"sm",children:"No focus area added"})})]}):null},X=e=>{let{...t}=e;return(0,r.jsxs)(g.E,{color:"gray.500",textStyle:"sm",...t,children:["Looking to edit your name and profile picture?"," ",(0,r.jsx)(I.A,{href:s.ROUTES.user.settings(),prefetch:!1,children:(0,r.jsx)(d.$,{variant:"link",children:"Click here"})})]})},Q=e=>{let{address:t,onSkipPrecondition:n,organization:i}=e;return(0,r.jsx)(h.s,{align:"center",flex:1,justify:"center",children:(0,r.jsx)(w.A,{maxW:"md",title:"â ï¸ No received delegations",children:(0,r.jsxs)(l.B,{spacing:4,children:[(0,r.jsx)(g.E,{color:"gray.700",textAlign:"left",textStyle:"md",children:"You must receive at least one delegation before you appear as a delegate in the explore page."}),(0,r.jsx)(g.E,{color:"gray.700",textAlign:"left",textStyle:"md",children:"If you delegated recently, it may still be processing."}),(0,r.jsxs)(l.B,{pt:2,spacing:3,children:[(0,r.jsx)(k.A,{delegateAddress:t,organization:i,variant:"primary",children:"Delegate to yourself"}),(0,r.jsx)(d.$,{color:"gray.700","data-qa":"governance-delegationprecondition-proceed-btn",onClick:n,textAlign:"center",textStyle:"md",variant:"tertiary",width:"100%",children:"Proceed anyway"})]})]})})})},V=e=>{var t;let{governors:n,organization:l,governanceName:i}=e,a=(0,$.yj)(),[s,o]=(0,E.useState)(!1),{data:d,isLoading:c}=(0,N.y6$)({input:{address:null==a?void 0:a.address,organizationId:l.id}},{enabled:!!(null==a?void 0:a.address)&&!!(null==l?void 0:l.id)});(0,E.useEffect)(()=>{!s&&(null==d?void 0:d.delegate)&&o(!0)},[d,s]);let u=null==d||null==(t=d.delegate)?void 0:t.statement;return!a||c?null:!s&&n&&n.length>0?(0,r.jsx)(Q,{address:a.address,onSkipPrecondition:()=>o(!0),organization:l}):(0,r.jsx)(H,{governanceName:i,isLoading:c,organization:l,statement:u})};var Z=n(87821),J=n(6581),K=n(58614),ee=n(61928),et=n(97681),en=n(37766),er=n(52309),el=n(5383),ei=n(78517),ea=n(42915),es=n(60618),eo=!0;let ed=e=>{let{organization:t,governors:n,isWhiteLabel:o}=e,{slug:d,name:c}=t,u=(0,ea.U)(),[m]=n,g=o?"".concat(c," | Delegate"):"Cactus | ".concat(c," | Delegate"),x={title:g,image:(0,z.KB)(t),description:"Manage your delegate profile."},h=(null==n?void 0:n.length)>0,p=o?(0,es.Lc)(a.i.governance.delegateProfileEdit(d,c,null!=u?u:"",o,h)):a.i.governance.delegateProfileEdit(d,c,null!=u?u:"",o,h);return(0,r.jsx)(i.Ay,{section:"DelegateProfileEdit",children:(0,r.jsx)(W.TS,{organization:t,children:(0,r.jsx)(Z.Ay,{governor:m,children:(0,r.jsxs)(et.A,{children:[(0,r.jsx)(el.A,{preview:x,title:g}),(0,r.jsx)(ei.A,{activeOrganizationMenu:ee.OrganizationMenu.DelegateProfile,isWhiteLabel:o,organization:t,redirectTo:{logout:s.ROUTES.explore()}}),(0,r.jsx)(K.A,{breadcrumb:p}),(0,r.jsx)(en.A,{children:(0,r.jsx)(l.B,{spacing:J.Y.containerGap,children:(0,r.jsx)(i.Ay,{section:"GovernanceDelegateProfileForm",children:(null==t?void 0:t.id)?(0,r.jsx)(V,{governanceName:c,governors:n,organization:t}):null})})}),(0,r.jsx)(er.A,{isWhiteLabel:o})]})})})})}},42288:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/gov/[governanceId]/delegate/edit",function(){return n(5823)}])},49540:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(96690),l=n(56147),i=n(93691),a=n(77502),s=n(97080),o=n(54952),d=n(49619),c=n(79394);let u=e=>{let{content:t,style:n={}}=e,u=(0,l.D)();return t?(0,r.jsx)(i.a,{className:"markdown-viewer",children:(0,r.jsx)(s.oz,{children:t,components:{a:e=>{let{node:t,...n}=e,l=(null==n?void 0:n.href)==="url"?String(Array.isArray(n.children)?n.children[0]:""):String(null==n?void 0:n.href);return l?(0,r.jsx)("a",{style:{color:u.colors.text.link},target:"_blank",...n,href:l}):(0,r.jsx)("span",{children:null==n?void 0:n.href})},h1:e=>{let{node:t,...n}=e;return(0,r.jsx)("h1",{style:{fontWeight:"bold",fontSize:"2em",marginBottom:"0.5em",marginTop:"0.5em"},...n})},h2:e=>{let{node:t,...n}=e;return(0,r.jsx)("h2",{style:{fontWeight:"bold",fontSize:"1.4em",marginBottom:"0.3em",marginTop:"0.5em"},...n})}
1,h3:e=>{let{node:t,...n}=e;return(0,r.jsx)("h3",{style:{fontWeight:"bold",fontSize:"1.1em",marginBottom:"0.3em",marginTop:"0.5em"},...n})},h4:e=>{let{node:t,...n}=e;return(0,r.jsx)("h4",{style:{fontWeight:"bold",marginBottom:"0.4em"},...n})},p:e=>{let{node:t,...l}=e;return(0,r.jsx)("p",{style:{marginBottom:"0.5em",...n},...l})},ul:e=>{let{node:t,...n}=e;return(0,r.jsx)("ul",{style:{listStyleType:"circle",marginLeft:"20px",marginBottom:"16px"},...n})},ol:e=>{let{node:t,...n}=e;return(0,r.jsx)("ol",{style:{marginLeft:"20px",marginBottom:"16px"},...n})},blockquote:e=>{let{node:t,...n}=e;return(0,r.jsx)("blockquote",{style:{background:"#f9f9f9",borderLeft:"10px solid #ccc",margin:"1.5em 10px",padding:"0.7em 10px 0.1em 10px"},...n})},code:e=>{let{node:t,...n}=e;return(0,r.jsx)("code",{style:{marginBottom:"3px",marginTop:"1px"},...n})},pre:e=>{let{node:t,...n}=e;return(0,r.jsx)("pre",{style:{marginBottom:"3px",marginTop:"1px",padding:"5px",backgroundColor:u.colors.gray[100]},...n})},img:e=>{var t,n;let{node:l,...i}=e,s=null==i?void 0:i.src;"string"==typeof s&&s.startsWith("ipfs://")&&(s="https://cloudflare-ipfs.com/"+s.replace(":/",""));let o=(null==(t=i.title)?void 0:t.charAt(0))===":"?"25px":"100%";return(0,r.jsx)(a._,{style:{marginBottom:"10px",maxWidth:o,width:null!=(n=i.width)?n:o,height:i.height?i.height:"auto"},...i,src:"string"==typeof s?s:void 0})},table:e=>{let{node:t,...n}=e;return(0,r.jsx)(i.a,{mb:4,overflowX:"auto",children:(0,r.jsx)("table",{style:{borderCollapse:"collapse",width:"100%",marginBottom:"10px"},...n})})},thead:e=>{let{node:t,...n}=e;return(0,r.jsx)("thead",{style:{backgroundColor:u.colors.gray[100]},...n})},th:e=>{let{node:t,...n}=e;return(0,r.jsx)("th",{style:{border:"1px solid ".concat(u.colors.gray[300]),padding:"8px",textAlign:"left",fontWeight:"bold"},...n})},td:e=>{let{node:t,...n}=e;return(0,r.jsx)("td",{style:{border:"1px solid ".concat(u.colors.gray[300]),padding:"8px"},...n})}},rehypePlugins:[o.A,d.A],remarkPlugins:[c.A]})}):null}},87821:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>c,LY:()=>o,QM:()=>d,TO:()=>a});var r=n(96690),l=n(42586),i=n(70274),a=function(e){return e.DisplayExecuteBtnOnActiveStatus="DISPLAY_EXECUTE_BTN_ON_ACTIVE_STATUS",e.HideCreateProposal="HIDE_CREATE_PROPOSAL",e.HideCancelProposal="HIDE_CANCEL_PROPOSAL",e.Council="COUNCIL",e.L2Execution="L2EXECUTION",e.HideSimulation="HIDE_SIMULATION",e.OzGovernorCancelWithMultipleParams="OZ_GOVERNOR_CANCEL_WITH_MULTIPLE_PARAMS",e}({});let s=(0,l.createContext)(void 0),o=()=>{let e=(0,l.useContext)(s);if(!e)throw Error("GovernanceContext must be used within GovernanceProvider");return e},d=(e,t)=>{let n=null==e?void 0:e.find(e=>e.name.toLowerCase()===t.toLowerCase());return!!n&&n.enabled},c=e=>{let{children:t,governor:n}=e,l=null==n?void 0:n.id,{data:a}=(0,i.NuB)({input:{id:null!=l?l:""}},{enabled:!!l});return(0,r.jsx)(s.Provider,{value:{isFeatureFlagOn:e=>{var t;return d(null==a||null==(t=a.governor)?void 0:t.features,e)},governor:n},children:t})}}},e=>{e.O(0,[1310,6824,5029,3456,4527,2492,5222,5657,6198,8584,182,6360,1006,3309,5248,581,6041,8849,7110,2782,8279,1431,1199,1928,7547,2159,8331,6730,8295,636,6593,8792],()=>e(e.s=42288)),_N_E=e.O()}]); 2//# sourceMappingURL=edit-e62d3e1f089e8cfa.js.map
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.