1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6487],{46001:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/tags",function(){return a(86835)}])},26054:function(e,t,a){"use strict";a.d(t,{Y:function(){return c}});var s=a(85893),n=a(67294),r=a(37174),o=a(52435),i=a(79381);const c=n.forwardRef(((e,t)=>{let{className:a,...n}=e;const{data:c,isLoading:l,error:d}=o.S.tenantUser.get.useQuery();return l&&!d?(0,s.jsx)("div",{children:(0,s.jsx)(i.g,{active:l})}):"ADMIN"!==(null===c||void 0===c?void 0:c.role)||!c||d?(0,s.jsxs)("div",{className:"bg-background dark:bg-background-10 text-foreground m-4 rounded-md p-6 shadow sm:overflow-hidden",children:[(0,s.jsx)("h1",{className:"mb-1 text-2xl font-medium",children:"Unable to Access Admin"}),(0,s.jsx)("p",{className:"text-sm",children:"This page is only for administrators, but your user role is not administrator. Please try again later. If this issue keeps happening, contact our customer support."})]}):(0,s.jsx)("div",{ref:t,className:(0,r.cn)("container mb-5 max-w-4xl",a),...n})}));c.displayName="AdminPageContainer"},3014:function(e,t,a){"use strict";a.d(t,{NI:function(){return p},Wi:function(){return u},l0:function(){return l},lX:function(){return f},pf:function(){return h},xJ:function(){return x},zG:function(){return v}});var s=a(85893),n=a(88426),r=a(67294),o=a(87536),i=a(37174),c=a(18396);const l=o.RV,d=r.createContext({}),u=e=>{let{...t}=e;return(0,s.jsx)(d.Provider,{value:{name:t.name},children:(0,s.jsx)(o.Qr,{...t})})},m=()=>{const e=r.useContext(d),t=r.useContext(g),{getFieldState:a,formState:s}=(0,o.Gc)(),n=a(e.name,s);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...n}},g=r.createContext({}),x=r.forwardRef(((e,t)=>{let{className:a,...n}=e;const o=r.useId();return(0,s.jsx)(g.Provider,{value:{id:o},children:(0,s.jsx)("div",{ref:t,className:(0,i.cn)("space-y-2",a),...n})})}));x.displayName="FormItem";const f=r.forwardRef(((e,t)=>{let{className:a,...n}=e;const{error:r,formItemId:o}=m();return(0,s.jsx)(c._,{ref:t,className:(0,i.cn)(r&&"text-destructive",a),htmlFor:o,...n})}));f.displayName="FormLabel";const p=r.forwardRef(((e,t)=>{let{...a}=e;const{error:r,formItemId:o,formDescriptionId:i,formMessageId:c}=m();return(0,s.jsx)(n.g7,{ref:t,id:o,"aria-describedby":r?"".concat(i," ").concat(c):"".concat(i),"aria-invalid":!!r,...a})}));p.displayName="FormControl";const h=r.forwardRef(((e,t)=>{let{className:a,...n}=e;const{formDescriptionId:r}=m();return(0,s.jsx)("p",{ref:t,id:r,className:(0,i.cn)("text-muted-foreground text-sm",a),...n})}));h.displayName="FormDescription";const v=r.forwardRef(((e,t)=>{let{className:a,children:n,...r}=e;const{error:o,formMessageId:c}=m(),l=o?String(null===o||void 0===o?void 0:o.message):n;return l?(0,s.jsx)("p",{ref:t,id:c,className:(0,i.cn)("text-warning text-sm font-medium",a),...r,children:l}):null}));v.displayName="FormMessage"},84472:function(e,t,a){"use strict";a.d(t,{I:function(){return o}});var s=a(85893),n=a(67294),r=a(37174);const o=n.forwardRef(((e,t)=>{let{className:a,type:n,...o}=e;return(0,s.jsx)("input",{type:n,className:(0,r.cn)("box-border block w-full rounded-md py-2 pl-3 pr-3 text-sm transition-all","border-background-20 bg-background dark:bg-background-10 text-foreground rounded-md border border-solid shadow-none transition-all focus:outline-none focus:ring-0","placeholder:text-foreground-10 disabled:text-background-10 disabled:cursor-not-allowed",a),ref:t,...o})}));o.displayName="Input"},86835:function(e,t,a){"use strict";a.r(t);var s=a(85893),n=a(56312),r=a(67294),o=a(87536),i=a(86501),c=a(40163),l=a(52435),d=a(1604),u=a(79570),m=a(26054),g=a(18922),x=a(53766),f=a(5628),p=a(62472),h=a(92395),v=a(77818),j=a(79381),N=a(55268),b=a(76614),w=a(3014),y=a(46292),T=a(84472),S=a(65768);const k=d.z.object({id:d.z.string().optional(),name:d.z.string().optional(),postType:d.z.enum(["POST"]).optional()}),I=e=>{let{tags:t,nameValue:a}=e;return null===t||void 0===t?void 0:t.some((e=>e.value.toLowerCase()===a.toLowerCase()))},C=e=>{let{inputValue:t,setInputValue:a,tags:r}=e;const c=l.S.useContext(),{mutate:d,isLoading:u}=l.S.tags.add.useMutation({onSuccess(){c.invalidate(),i.ZP.success('Tag "'.concat(t,'" added')),a("")},onError(e){i.ZP.error(JSON.parse(e.message)[0].message)}}),m=(0,o.cI)({resolver:(0,n.F)(k)});return(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(w.l0,{...m,children:(0,s.jsxs)("form",{className:"flex gap-3",onSubmit:e=>{e.preventDefault(),d({name:t,tagType:"POST"})},children:[(0,s.jsx)("div",{children:(0,s.jsx)(T.I,{className:"".concat(I({tags:r,nameValue:t})?"border-warning focus:border-warning":""),name:"addTag",value:t,placeholder:"Add/filter topic tags..",onChange:e=>a(e.target.value)})}),(0,s.jsx)(g.z,{loading:u,htmlType:"submit",disabled:I({tags:r,nameValue:t}),children:"Add"})]})}),(0,s.jsx)("p",{className:"text-warning mt-1 text-sm ".concat(I({tags:r,nameValue:t})?"opacity-100":"opacity-0"),children:'Tag with name "'.concat(t,'" already exists. Try with a new name.')})]})},F=()=>{const e=l.S.useContext(),t=(0,f.Z)(),a=(0,u.S)(),{data:c,isLoading:d,refetch:g}=l.S.tags.getTags.useQuery({tagType:"POST"}),{mutate:I,isLoading:F}=l.S.tags.edit.useMutation({onMutate(){M(void 0)},onSuccess(){g(),i.ZP.success("Tag name has been changed")},onError(e){try{JSON.parse(e.message)[0].message}catch(t){return i.ZP.error(e.message)}return i.ZP.error(JSON.parse(e.message)[0].message)}}),[P,_]=(0,r.useState)(""),[L,z]=(0,r.useState)(""),[E,M]=(0,r.useState)(),R=(0,r.useRef)(),{mutate:Z,isLoading:D}
1=l.S.tags.delete.useMutation({onSuccess(){e.invalidate(),i.ZP.success("Tag Deleted")}}),{mutate:O}=l.S.tenant.toggleTagCreation.useMutation({}),V=(0,r.useRef)(null);(0,S.t$)(V,(()=>M("")));const A=(0,o.cI)({resolver:(0,n.F)(k)});return(0,s.jsx)(m.Y,{children:(0,s.jsx)("main",{children:(0,s.jsx)(j.g,{active:d,children:(0,s.jsx)(x.Zb,{className:"sm:overflow-hidden",edgeToEdgeMobile:!0,children:(0,s.jsxs)(x.aY,{className:"space-y-4 ",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h1",{className:"text-xl font-medium",children:"Topic Tags"}),(0,s.jsx)(v.b,{infoFor:"Topic Tags",children:"Examples of Topic Tags for an outdoor travelling community: mountain, hiking, biking, tent, skiing, snow, fire, downhill, tree, campfire, map, and compass."})]}),(0,s.jsx)("div",{className:"flex max-w-4xl text-sm text-gray-800 ",children:(0,s.jsx)("div",{className:"",children:(0,s.jsxs)("p",{children:["Topic Tags are keywords that can be added to your content to enable others to easily find it and related content. For a outdoors community, this could be"," ",(0,s.jsx)("span",{className:"font-medium",children:"skiing"}),","," ",(0,s.jsx)("span",{className:"font-medium",children:"hiking"}),", or"," ",(0,s.jsx)("span",{className:"font-medium",children:"tips"})]})})}),(0,s.jsx)(p.i,{}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("h2",{children:" Topic Tag Creation"}),(0,s.jsx)("p",{className:"text-sm",children:"Let users create their own topic tags while creating content."}),(0,s.jsx)(y.Z,{onChange:()=>O(),defaultChecked:null===a||void 0===a?void 0:a.canUserCreateTags})]}),(0,s.jsx)(p.i,{}),(0,s.jsx)(C,{inputValue:P,setInputValue:_,tags:c}),(0,s.jsx)(j.g,{active:D||F,children:(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:null===c||void 0===c?void 0:c.filter((e=>e.value.toLowerCase().includes(P.toLowerCase()))).map((e=>{const a=e.id===E;return(0,s.jsx)("div",{className:"flex items-center",children:a?(0,s.jsx)(w.l0,{...A,children:(0,s.jsxs)("form",{ref:V,className:"flex gap-3",onKeyDown:e=>"Escape"===e.key&&M(""),onSubmit:()=>{return(t=e).value!==L?I({id:t.id,name:L}):M(void 0);var t},children:[(0,s.jsx)(T.I,{onFocus:()=>{z(e.value)},value:L,size:L.length,autoFocus:!0,className:(0,N.t)({variant:"default"}),onChange:e=>{z(e.target.value)}}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(b.z,{type:"submit",className:"text-accent h-fit p-0 first:p-0",children:(0,s.jsx)(h.NOm,{className:"text-accent w-4"})}),(0,s.jsx)(b.z,{className:"text-warning h-fit p-0 first:p-0",onClick:async()=>{await t({title:"Confirm deletion",description:'Are you sure you want to delete "'.concat(e.value,'" topic tag?'),confirmText:"Delete",variant:"danger"})&&Z({id:e.id})},children:(0,s.jsx)(h.baz,{className:"text-warning w-4"})})]})]})}):(0,s.jsx)(b.z,{onClick:()=>{R.current=void 0,M(e.id)},className:"hover:bg-accent group h-fit hover:border-transparent hover:bg-opacity-30 ".concat((0,N.t)({variant:"default"})),children:(0,s.jsxs)("div",{className:"relative flex gap-1",children:[(0,s.jsx)("p",{children:e.value}),(0,s.jsx)("span",{className:"text-foreground text-xs font-normal group-hover:hidden",children:e._count.posts}),(0,s.jsx)(h.xUH,{className:"hidden h-4 w-4 group-hover:block"})]})})},e.id)}))})})]})})})})})};F.getLayout=function(e){return(0,s.jsx)(c.Z,{children:e})},t.default=F}},function(e){e.O(0,[6911,3662,1664,108,5216,9332,8394,2039,1818,8214,7913,6309,9774,2888,179],(function(){return t=46001,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.