"use strict";(self.webpackChunklite=self.webpackChunklite||[]).push([[6834],{48642:(e,t,n)=>{n.d(t,{A:()=>l});var a,i=n(96540);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.d(t,{A:()=>l});var a,i=n(96540);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.d(t,{hP:()=>k,ht:()=>g,tS:()=>f});var a,i=n(64467),r=n(80296),l=n(96540),o=n(51260),c=n(50684),s=n(15371),u=n(17756);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function m(e){for(var t=1;t{n.d(t,{o:()=>G});var a=n(58168),i=n(80296),r=n(96540),l=n(52764),o=n(14782),c=n(24960),s=n(20036),u=n(24809),d=n(60603),m=n(64467),p=n(54239),v=n(26118),f=n(41370),g=n(64314),k=n(52290),b=n(56942),h=n(36557),E=function(e){var t=e.isVisible,n=e.hide,a=e.onConfirm,i=e.loading,l=e.confirmText,o=e.title,c=e.text,s=e.isDestructiveAction;return r.createElement(g.m,{isVisible:t,hide:n,confirmText:r.createElement(f.G,{loading:i,text:l}),isDestructiveAction:s,onConfirm:a,disableConfirm:i,hideOnConfirm:!1},r.createElement(k.a,{paddingBottom:"6px"},r.createElement(b.DZ,{scale:"L"},o)),r.createElement(k.a,{paddingBottom:"32px"},r.createElement(h.kZ,{scale:"L"},c)))};function y(e){var t=e.isVisible,n=e.hide,a=e.deleteCatalog,i=e.loading;return r.createElement(E,{isVisible:t,hide:n,confirmText:"Delete",isDestructiveAction:!0,onConfirm:a,loading:i,title:"Delete list",text:"Deleting this list will remove it from Your library. If others have saved this list, it will also be deleted and removed from their library. Deleting this list will not delete any stories in it."})}var w=n(97213),C=function(e){var t=e.isVisible,n=e.hide,a=e.onConfirm;return r.createElement(E,{isVisible:t,hide:n,loading:!1,text:"If others have saved this list, it will be removed from their library.",confirmText:"Make private",title:"Make list private",onConfirm:a})},O=n(85764),S=n(46844),N=n(86527),I=n(53424),A=n(39410),D=n(42976);function R(e){var t=e.isVisible,n=e.hide,a=e.catalog,l=e.updateCatalog,o=e.loading,c=a.name,s=a.description,u=a.visibility,m=a.id,p=a.type,v=(0,d.e)(!1),b=(0,i.A)(v,3),E=b[0],y=b[1],w=b[2],R=(0,r.useState)(c),P=(0,i.A)(R,2),x=P[0],V=P[1],L=(0,r.useState)(!!s),T=(0,i.A)(L,2),j=T[0],F=T[1],M=(0,r.useState)(s),B=(0,i.A)(M,2),_=B[0],U=B[1],q=(0,r.useState)(u),H=(0,i.A)(q,2),z=H[0],X=H[1],Y=a.type===D.Mh.PREDEFINED_LIST,G=(0,r.useCallback)((function(e){V(e.target.value)}),[]),J=(0,r.useCallback)((function(e){U(e.target.value)}),[]),Z=(0,r.useCallback)((function(){X((function(e){return e===D.y_.PRIVATE?D.y_.PUBLIC:D.y_.PRIVATE}))}),[]),K=(0,r.useCallback)((function(){var e=x.trim(),t=null==_?void 0:_.trim();l({variables:{catalogId:m,attributes:{type:p,title:e!==c?e:null,description:t!==s?t:null,visibility:z!==u?z:null}}})}),[x,_,z,l,m,p,c,s,u]),W=(0,r.useCallback)((function(){z===D.y_.PRIVATE&&u===D.y_.PUBLIC?y():K()}),[K,y,z,u]),$=(0,r.useCallback)((function(){w(),K()}),[w,K]),Q=x.trim(),ee=(null!==_?_.trim():null)===s&&Q===c&&z===u;return E?r.createElement(C,{hide:w,onConfirm:$,isVisible:!0}):r.createElement(g.m,{isVisible:t,hide:n,confirmText:r.createElement(f.G,{loading:o}),isDestructiveAction:!1,onConfirm:W,disableConfirm:!Y&&!Q||o||ee||(0,O.dX)(x)||(0,O.JX)(_),hideOnConfirm:!1},r.createElement(k.a,{height:"400px"},r.createElement(k.a,{paddingBottom:"60px"},r.createElement(A.hE,{scale:"L"},"Edit list")),r.createElement(k.a,{textAlign:"left",width:"400px",sm:{width:"100%"}},!Y&&r.createElement(k.a,{paddingBottom:"20px"},r.createElement(S.A,{value:x,onChange:G,placeholder:"Give it a name",characterCountLimit:O.OW})),r.createElement(k.a,{paddingBottom:"20px"},j?r.createElement(k.a,{maxHeight:"170px",overflow:"auto"},r.createElement(S.A,{value:null!=_?_:void 0,onChange:J,placeholder:"Description",isMultiline:!0,autoFocus:!0,characterCountLimit:O.Ke})):r.createElement(N.N,{onClick:function(){return F(!0)}},r.createElement(h.kZ,{scale:"L",color:"ACCENT"},"Add a description"))),r.createElement(k.a,null,r.createElement(I.S,{checked:z===D.y_.PRIVATE,onChange:Z,textScale:"L"},"Make it private")))))}var P=n(22036),x=n(46455),V=n(5419),L=n(51260),T=n(91830),j=n(39160),F=n(17756),M=n(46879);function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function _(e){for(var t=1;t1&&r.createElement(o.q3,null,r.createElement(N.N,{"aria-controls":l,"aria-expanded":a,onClick:Be},"Remove items")),r.createElement(o.q3,null,r.createElement(N.N,{"aria-controls":l,"aria-expanded":a,onClick:Fe},"Make list ",s===D.y_.PUBLIC?"private":"public")),g>1&&r.createElement(o.q3,null,r.createElement(N.N,{"aria-controls":l,"aria-expanded":a,onClick:Me},"Reorder items")),r.createElement(o.q3,null,r.createElement(P.n,{isVisible:ke,hide:he,onConfirm:_e,entityTypename:"Catalog"}),r.createElement(N.N,{"aria-controls":l,"aria-expanded":a,onClick:k?Ue:be},k?"Show responses":"Hide responses")),t.type!==D.Mh.PREDEFINED_LIST&&r.createElement(o.q3,null,r.createElement(y,{isVisible:me,hide:ve,deleteCatalog:Ve,loading:Le}),r.createElement(N.N,{"aria-controls":l,"aria-expanded":a,onClick:pe},r.createElement(h.kZ,{scale:"M",color:"ERROR"},"Delete list"))),r.createElement(C,{isVisible:we,hide:Oe,onConfirm:je}))},H=n(72130),z=n(49287),X=function(e){var t=e.catalog,n=e.ariaExpanded,a=e.hidePopover,i=t.id,l=t.viewerEdge.clapCount,c=(0,w.Ug)().clapCatalog,s=(0,w.yn)().flagCatalog,u=(0,H.$L)(),d=(0,z.jI)(),m=(0,j.d4)((function(e){return e.config.authDomain})),p=(0,M.n1u)(t,m),v=r.useCallback((function(){l&&(c({catalogId:i,numClaps:-l}),u.event("list.clientUnvote",{listId:i,unvoteCount:l,source:d}),a())}),[i,l,d,c,a]),f=r.useCallback((function(){s({catalogId:i}),a()}),[i,s,a]);return r.createElement(r.Fragment,null,r.createElement(o.Ni,null,p&&r.createElement(V.P,{mediumUrl:p,onClick:a}),0!==l&&r.createElement(o.q3,null,r.createElement(N.N,{onClick:v,"aria-expanded":n},"Undo applause for this list")),r.createElement(o.q3,null,r.createElement(N.N,{onClick:f,"aria-expanded":n},"Report this list"))))},Y=function(e){var t=e.catalog,n=e.viewer,a=e.isResponsive,l=(0,d.e)(!1),m=(0,i.A)(l,4),p=m[0],v=m[2],f=m[3],g="catalogContentMenu",k=p?"true":"false",b=n.id===t.creator.id,h=r.useCallback((function(){return r.createElement(o.Ni,null,b?r.createElement(q,{catalog:t,ariaExpanded:k,ariaId:g,hidePopover:v,viewer:n}):r.createElement(X,{catalog:t,ariaExpanded:k,hidePopover:v}))}),[b,t,k,v,n]);return r.createElement(c.A,{ariaId:g,isVisible:p,hide:v,popoverRenderFn:h},r.createElement(s.u,{onClick:f,ariaLabel:"More options",icon:r.createElement(u.A,null),text:a?"More":void 0,tooltipText:"More"}))},G=function(e){return r.createElement(l.c,null,(function(t){return t?r.createElement(Y,(0,a.A)({viewer:t},e)):null}))}},46455:(e,t,n)=>{n.d(t,{H7:()=>u,Jw:()=>s,lL:()=>d,od:()=>m});var a=n(80296),i=n(95420),r=n(42976),l=n(91830),o={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateCatalogLockResponsesMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"catalogId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"attributes"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateCatalogInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCatalog"},arguments:[{kind:"Argument",name:{kind:"Name",value:"catalogId"},value:{kind:"Variable",name:{kind:"Name",value:"catalogId"}}},{kind:"Argument",name:{kind:"Name",value:"attributes"},value:{kind:"Variable",name:{kind:"Name",value:"attributes"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Catalog"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"responsesLocked"}}]}}]}}]}}]},c={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateCatalogDisallowResponsesMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"catalogId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"attributes"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateCatalogInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCatalog"},arguments:[{kind:"Argument",name:{kind:"Name",value:"catalogId"},value:{kind:"Variable",name:{kind:"Name",value:"catalogId"}}},{kind:"Argument",name:{kind:"Name",value:"attributes"},value:{kind:"Variable",name:{kind:"Name",value:"attributes"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Catalog"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"disallowResponses"}}]}}]}}]}}]},s=function(e){var t=(0,l.zF)();return(0,i.n)(c,{variables:{catalogId:e,attributes:{type:r.Mh.LISTS,disallowResponses:!0}},onCompleted:function(){t({message:"Responses are now hidden for this list."})}})},u=function(e){var t=(0,l.zF)();return(0,i.n)(c,{variables:{catalogId:e,attributes:{type:r.Mh.LISTS,disallowResponses:!1}},onCompleted:function(){t({message:"Responses are now shown for this list."})}})},d=function(e,t,n,l){var c=(0,i.n)(o,{variables:{catalogId:l,attributes:{type:r.Mh.LISTS,responsesLocked:!0}},onCompleted:function(){e.event("responses.locked",{catalogId:l,source:t}),n()}});return(0,a.A)(c,1)[0]},m=function(e,t){var n=(0,i.n)(o,{variables:{catalogId:t,attributes:{type:r.Mh.LISTS,responsesLocked:!1}},onCompleted:function(){e()}});return(0,a.A)(n,1)[0]}},5419:(e,t,n)=>{n.d(t,{P:()=>g,X:()=>f});var a=n(64467),i=n(96540),r=n(52290),l=n(86527),o=n(72130),c=n(91830),s=n(48642),u=n(14782);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function m(e){for(var t=1;t{n.d(t,{b:()=>w});var a,i,r=n(96540),l=n(97213),o=n(27721),c=n(43634),s=n(52290),u=n(5600),d=n(20036),m=n(51260),p=n(89547);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t