1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8267],{6164:(e,t,n)=>{n.d(t,{ClickToShowModal:()=>x,E6:()=>g,Vs:()=>h,aF:()=>p,jL:()=>f});var i=n(54568),r=n(99680),o=n(29306),a=n(39427),s=n(7620),l=n(97509),c=n(28131),d=n(84530),u=n(50392);let h=(0,s.createContext)({modal:null,setModalType:()=>{},goBack:()=>{}}),f="bg-giphyBlack/80 z-modal fixed inset-0 flex items-center justify-center",g="bg-giphyDarkestGrey flex min-h-[390px] w-5/6 max-w-[838px] flex-col p-3 rounded-lg";function p(e){let t,n,h,p=(0,r.c)(14),{children:x,title:m,previousModalId:b,className:y,contentClassName:v,goBack:w,onClose:j,titleBarComponent:C}=e,k=void 0===b?null:b,A=(0,a.A)(),[_]=(0,c.A)("Escape");return p[0]!==_||p[1]!==j?(t=()=>{_&&j?.()},n=[_,j],p[0]=_,p[1]=j,p[2]=t,p[3]=n):(t=p[2],n=p[3]),(0,s.useEffect)(t,n),p[4]!==x||p[5]!==y||p[6]!==v||p[7]!==w||p[8]!==A||p[9]!==j||p[10]!==k||p[11]!==m||p[12]!==C?(h=A?(0,l.createPortal)((0,i.jsx)("div",{className:f,children:(0,i.jsxs)("div",{className:(0,o.cn)(g,y),children:[(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("div",{className:"relative isolate flex items-center justify-between gap-2",children:[k&&(0,i.jsx)("div",{className:"cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),w?.()},children:(0,i.jsx)(u.A,{className:"size-4"})}),(0,i.jsx)("h1",{className:"relative box-border flex max-h-[23px] max-w-[400px] flex-row overflow-hidden text-base whitespace-nowrap select-none",children:m}),C,j&&(0,i.jsx)("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),j?.()},className:"relative cursor-pointer",children:(0,i.jsx)(d.CloseIcon,{className:"size-4"})})]}),(0,i.jsx)("hr",{className:"my-3 w-full border-giphyDarkGrey"})]}),(0,i.jsx)("div",{className:(0,o.cn)("overflow-auto",v),children:x})]})}),document.querySelector("body")):null,p[4]=x,p[5]=y,p[6]=v,p[7]=w,p[8]=A,p[9]=j,p[10]=k,p[11]=m,p[12]=C,p[13]=h):h=p[13],h}let x=e=>{let t,n,o=(0,r.c)(7),{children:a,modal:l,className:c}=e,{setModalType:d}=(0,s.useContext)(h);return o[0]!==l||o[1]!==d?(t=async e=>{e.preventDefault(),e.stopPropagation(),d(l)},o[0]=l,o[1]=d,o[2]=t):t=o[2],o[3]!==a||o[4]!==c||o[5]!==t?(n=(0,i.jsx)("div",{className:c,onClick:t,children:a}),o[3]=a,o[4]=c,o[5]=t,o[6]=n):n=o[6],n}},11166:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(54568),r=n(99680);let o=e=>{let t,n,o=(0,r.c)(4),a=e.color||"white";return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.8507 3.92084L9.36521 17.8648C9.24811 17.9437 9.14272 18 9.0022 18C8.86167 18 8.75628 17.9437 8.63918 17.8648L0.149305 9.68767C-0.0497682 9.50745 -0.0497682 9.18082 0.149305 9.0006L3.18078 5.94301C3.36814 5.7628 3.70773 5.7628 3.8951 5.94301L9.0022 10.6915L20.0075 0.13516C20.1948 -0.0450533 20.5344 -0.0450533 20.7218 0.13516L23.8507 3.23378C24.0498 3.41399 24.0498 3.74063 23.8507 3.92084Z"}),o[0]=t):t=o[0],o[1]!==e||o[2]!==a?(n=(0,i.jsx)("svg",{fill:a,viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",...e,children:t}),o[1]=e,o[2]=a,o[3]=n):n=o[3],n}},13930:(e,t,n)=>{function i(e){switch(e){case"g":return"Content that is appropriate for all ages.";case"pg":return"Content that is generally safe for everyone, but may require parental preview before children can watch.";case"pg13":return"Mild sexual innuendos, mild substance use, mild profanity, or threatening images. May include images of semi-naked people, but DOES NOT show real human genitalia or nudity.";case"r":return"Strong language, strong sexual innuendo, violence, and illegal drug use; not suitable for teens or younger. NO NUDITY.";default:return"Content that has not been rated."}}function r(e){switch(e){case"g":return"indigo-blue";case"pg":return"indigo-purple";case"pg13":return"red-yellow";case"r":return"red-pink";default:return}}function o(e){switch(e){case"g":return"G";case"pg":return"PG";case"pg13":return"PG-13";case"r":return"R";default:return"Unrated"}}function a(e){switch(e.toLowerCase().trim()){case"g":return"g";case"pg":return"pg";case"pg-13":case"pg13":return"pg13";case"r":return"r";default:return"unrated"}}n.d(t,{D9:()=>a,El:()=>r,W6:()=>i,iy:()=>o})}
1,15012:(e,t,n)=>{n.d(t,{k:()=>i});let i=(0,n(7620).createContext)({})},17397:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(54568),r=n(99680),o=n(92805),a=n(20267),s=n(54713);let l=s.Ay.div.withConfig({componentId:"sc-78d3115d-0"})(["background:",";border-bottom-left-radius:","px;border-bottom-right-radius:","px;box-sizing:border-box;color:",";display:flex;filter:drop-shadow(0 0 20px rgba(0,0,0,0.7));min-height:","px;padding:10px 0;width:100%;"],({$gradient:e})=>(0,o.$_)(e),8,8,({$textColor:e})=>e,60),c=s.Ay.div.withConfig({componentId:"sc-78d3115d-1"})(["align-items:center;display:flex;font-size:15px;font-weight:normal;justify-content:center;line-height:1.3;max-width:700px;text-align:center;width:100%;em{font-style:italic;}strong{font-weight:bold;}"]),d=s.Ay.div.withConfig({componentId:"sc-78d3115d-2"})(["align-items:center;display:flex;flex-shrink:0;justify-content:center;width:","px;&:first-child{margin-right:auto;}&:last-child{margin-left:auto;}"],60),u=e=>{let t,n,s,u,h,f=(0,r.c)(15),{children:g,className:p,gradient:x,textColor:m,closeable:b,onClose:y}=e,v=void 0===x?"indigo-purple":x,w=void 0!==b&&b,j=(0,o.Bj)(v,.5),C=(0,o.di)(j)>.5?"#000":"#fff",k=m||C;return f[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(d,{}),f[0]=t):t=f[0],f[1]!==g?(n=(0,i.jsx)(c,{children:g}),f[1]=g,f[2]=n):n=f[2],f[3]!==w||f[4]!==k||f[5]!==y?(s=w&&(0,i.jsx)(a.A,{color:"transparent",icon:"nav-close",iconColor:k,size:"medium",onClick:()=>y?.()}),f[3]=w,f[4]=k,f[5]=y,f[6]=s):s=f[6],f[7]!==s?(u=(0,i.jsx)(d,{children:s}),f[7]=s,f[8]=u):u=f[8],f[9]!==p||f[10]!==k||f[11]!==v||f[12]!==n||f[13]!==u?(h=(0,i.jsxs)(l,{$gradient:v,$textColor:k,className:p,children:[t,n,u]}),f[9]=p,f[10]=k,f[11]=v,f[12]=n,f[13]=u,f[14]=h):h=f[14],h}},18051:(e,t,n)=>{n.d(t,{p:()=>s,E:()=>l});var i=n(54568),r=n(99680),o=n(7620),a=n(95750);let s=(0,o.createContext)({}),l=e=>{let t,n,l,c,d,u,h,f,g=(0,r.c)(17),{children:p}=e,x=(0,o.useRef)(null);g[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],g[0]=t):t=g[0];let m=(0,o.useRef)(t),[b,y]=(0,o.useState)(null),[v,w]=(0,o.useState)(!1);g[1]!==b?(n=b?function(e){let{style:t="default"}=e;return{gradient:function(e){switch(e){case"default":return"purple-indigo";case"error":return"pink-red";case"success":return"blue-green"}}(t)}}(b):{},g[1]=b,g[2]=n):n=g[2];let j=n;g[3]===Symbol.for("react.memo_cache_sentinel")?(l=function(){let e=m.current[0];if(x.current&&clearTimeout(x.current),!e)return void y(null);let{delay:t,persistent:n}=e;y(e),w(!0),void 0!==n&&n||(x.current=window?.setTimeout(()=>{w(!1)},void 0===t?5e3:t))},g[3]=l):l=g[3];let C=l;g[4]===Symbol.for("react.memo_cache_sentinel")?(c=function(){m.current=m.current.slice(1),C()},g[4]=c):c=g[4];let k=c;g[5]!==v?(d=function(e,t){let n=void 0===t?{}:t,i={...n,content:e};if(n.id){let e=m.current.findIndex(e=>e.id===i.id);if(0===e){m.current[0]=i,C();return}e>0&&(m.current=m.current.filter(e=>e.id!==i.id))}m.current.push(i),v||C()},g[5]=v,g[6]=d):d=g[6];let A=d;return g[7]!==A?(u={showMessage:A},g[7]=A,g[8]=u):u=g[8],g[9]!==b||g[10]!==v||g[11]!==j?(h=b&&(0,i.jsx)(a.A,{...j,closeable:!0,isOpen:v,onClose:()=>w(!1),onCloseEnd:()=>k(),children:b.content}),g[9]=b,g[10]=v,g[11]=j,g[12]=h):h=g[12],g[13]!==p||g[14]!==u||g[15]!==h?(f=(0,i.jsxs)(s.Provider,{value:u,children:[p,h]}),g[13]=p,g[14]=u,g[15]=h,g[16]=f):f=g[16],f}}
1,21239:(e,t,n)=>{function i(e){let t=e.getHours(),n=e.getMinutes(),i=`${t}`.padStart(2,"0"),r=`${n}`.padStart(2,"0");return`${i}:${r}`}function r(e=new Date){let t=new Date(e);return t.setHours(0,0,0,0),t}function o(e,t){var n;let i,r,o;return n=new Date(e),r=parseInt((i=t.split(":"))[0]),o=parseInt(i[1]),isNaN(r)||n.setHours(r),isNaN(o)||n.setMinutes(o),n}function a(e,t){let n=r(e),i=r(t);return n.getTime()===i.getTime()}n.d(t,{Fw:()=>i,HC:()=>r,OY:()=>o,ro:()=>a})},22581:(e,t,n)=>{n.d(t,{Y:()=>i});let i=(0,n(7620).createContext)({})},23892:(e,t,n)=>{n.d(t,{FJ:()=>l,N7:()=>c,WF:()=>r,dc:()=>s,e4:()=>a,mo:()=>o});var i=n(90291);function r(e){switch(e){case"content-url":case"no-trend":case"rating":case"slug":case"source-body":case"source-caption":case"username":return!0;default:return!1}}function o(e,t=!1){switch(e){case"no-trend":return!0;case"rating":return!t;default:return!1}}function a(e){switch(e){case"alt-text":return"caption";case"description":return"align-left";case"no-trend":return"search";case"privacy":return"view";case"rating":return"important";case"source":return"source";case"title":return"title";case"username":return"user";default:return}}function s(e){switch(e){case"cta":case"description":case"title":return["clip"];default:return[...i.f]}}function l(e){switch(e){case"alt-text":return"Alt Text";case"content-url":return"Content URL";case"cta":return"Button Title";case"description":return"Description";case"indexed":return"Is Indexed";case"searchable":return"Is Searchable";case"no-trend":return"Eligible for Trending";case"privacy":return"Privacy";case"rating":return"Rating";case"slug":return"Slug";case"source":return"Source";case"source-body":return"Source Body";case"source-caption":return"Source Caption";case"title":return"Title";case"content-type":return"Content Type";case"username":return"Username"}}function c(e){switch(e){case"alt-text":return"alt_text";case"content-url":return"source_content_url";case"content-type":return"content_type";case"cta":return"cta.text";case"description":return"description";case"indexed":return"is_indexable";case"searchable":return"is_searchable";case"no-trend":return"gps_no_trend";case"privacy":return"is_hidden";case"rating":return"rating";case"slug":return"slug";case"source":return"source_post_url";case"source-body":return"source_body";case"source-caption":return"source_caption";case"title":return"title";case"username":return"username"}}},29617:(e,t,n)=>{n.d(t,{BI:()=>b,Ol:()=>j,Om:()=>k,T7:()=>y,U4:()=>C,bV:()=>v,c8:()=>A,cG:()=>w,fL:()=>x,fe:()=>p,qv:()=>h,sS:()=>g,yp:()=>f,zE:()=>u});var i=n(54568),r=n(99680),o=n(90483),a=n(29306),s=n(41798),l=n(7620),c=n(84530),d=n(6164);let u=e=>{let t,n,o,s,l,c,d,u=(0,r.c)(16);u[0]!==e?({className:t,width:o,height:s,...n}=e,u[0]=e,u[1]=t,u[2]=n,u[3]=o,u[4]=s):(t=u[1],n=u[2],o=u[3],s=u[4]);let h=void 0===o?144:o,f=void 0===s?88:s;return u[5]!==t?(l=(0,a.cn)("pointer-events-none block object-cover select-none",t),u[5]=t,u[6]=l):l=u[6],u[7]!==f||u[8]!==h?(c={height:f,width:h},u[7]=f,u[8]=h,u[9]=c):c=u[9],u[10]!==f||u[11]!==n||u[12]!==l||u[13]!==c||u[14]!==h?(d=(0,i.jsx)("img",{width:h,height:f,alt:"",className:l,style:c,...n}),u[10]=f,u[11]=n,u[12]=l,u[13]=c,u[14]=h,u[15]=d):d=u[15],d},h="https://media.giphy.com/media/fTytsfKCVyb6lB75jM/giphy.gif",f="https://giphy.com/static/img/backgrounds/floating-shapes-trans
1parent.gif",g=e=>{let t,n=(0,r.c)(2),{count:o}=e;return n[0]!==o?(t=(0,i.jsxs)("div",{className:"absolute top-2 right-2 rounded-lg border bg-giphyBlack/80 p-1 text-center text-xs font-bold text-giphyWhite",children:["+",o," more"]}),n[0]=o,n[1]=t):t=n[1],t},p=()=>{let e,t=(0,r.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)("div",{className:"absolute top-2 right-2 flex size-5 items-center justify-center rounded-full bg-giphyAqua text-[9px] text-black","data-testid":"collection-selected-badge",children:(0,i.jsx)("i",{className:"ss-check"})}),t[0]=e):e=t[0],e},x=e=>{let t,n,o,s,l=(0,r.c)(9),{channel:c}=e;l[0]!==c.featured_gif||l[1]!==c.is_private?(t=(0,i.jsx)(y,{gif:c.featured_gif,isPrivate:c.is_private}),l[0]=c.featured_gif,l[1]=c.is_private,l[2]=t):t=l[2];let d=c.short_display_name||c.display_name;return l[3]!==d?(n=(0,i.jsx)(v,{label:d}),l[3]=d,l[4]=n):n=l[4],l[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,i.jsx)("div",{className:(0,a.cn)(A,"absolute inset-0")}),l[5]=o):o=l[5],l[6]!==t||l[7]!==n?(s=(0,i.jsxs)(i.Fragment,{children:[t,n,o]}),l[6]=t,l[7]=n,l[8]=s):s=l[8],s},m=e=>{let t,n,o,s=(0,r.c)(9),{channel:c,className:u}=e,{setModalType:h}=(0,l.useContext)(d.Vs);return s[0]!==u?(t=(0,a.cn)("cursor-pointer hover:text-giphyBlue",u),s[0]=u,s[
11]=t):t=s[1],s[2]!==c||s[3]!==h?(n=()=>{h({name:"editCollections",channelId:c.id,title:(0,i.jsx)(b,{channel:c})})},s[2]=c,s[3]=h,s[4]=n):n=s[4],s[5]!==c.display_name||s[6]!==t||s[7]!==n?(o=(0,i.jsx)("span",{className:t,onClick:n,children:c.display_name}),s[5]=c.display_name,s[6]=t,s[7]=n,s[8]=o):o=s[8],o},b=e=>{let t,n=(0,r.c)(3),{channel:s}=e,{data:l}=(0,o.HS)(s.id);if(n[0]!==s||n[1]!==l){let e=l?.ancestors?[...l.ancestors,s]:[s];t=e.map((t,n)=>{let r=n===e.length-1;return(0,i.jsxs)("div",{children:[(0,i.jsx)(m,{channel:t,className:(0,a.cn)(r&&"pointer-events-none text-giphyLightGrey")}),!r&&(0,i.jsx)("span",{className:"mx-1",children:"/"})]},t.id)}),n[0]=s,n[1]=l,n[2]=t}else t=n[2];return t},y=e=>{let t,n,o,l=(0,r.c)(8),{gif:d,isPrivate:h,className:f}=e;return l[0]!==f||l[1]!==d?(t=d?(0,i.jsx)(s.Gif,{className:(0,a.cn)(f,"[&_img]:object-cover"),gif:d,percentWidth:"100%",width:144,height:88,hideAttribution:!0,noLink:!0,borderRadius:0,backgroundColor:d.is_sticker?void 0:"rgba(0,0,0,0)"}):(0,i.jsx)(u,{src:"https://media.giphy.com/media/Id66GDfKacJzxSvhqV/giphy.gif",className:(0,a.cn)(f),width:"100%",height:88}),l[0]=f,l[1]=d,l[2]=t):t=l[2],l[3]!==h?(n=h&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)(c.LockIcon,{height:25,width:40,color:null,className:"fill-giphyRed"})}),l[3]=h,l[4]=n):n=l[4],l[5]!==t||l[6]!==n?(o=(0,i.jsxs)(i.Fragment,{children:[t,n]}),l[5]=t,l[6]=n,l[7]=o):o=l[7],o},v=e=>{let t,n,o,s=(0,r.c)(6),{className:l,label:c}=e;return s[0]!==l?(t=(0,a.cn)("overflow-hidden px-2.5 py-1.5 text-sm font-bold text-ellipsis whitespace-nowrap",l),s[0]=l,s[1]=t):t=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(n={textShadow:"#000 1px 1px 2px"},s[2]=n):n=s[2],s[3]!==c||s[4]!==t?(o=(0,i.jsx)("div",{className:t,style:n,children:c}),s[3]=c,s[4]=t,s[5]=o):o=s[5],o},w=()=>{let e,t=(0,r.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)("hr",{className:"my-3 w-full border-giphyDarkGrey"}),t[0]=e):e=t[0],e},j="bg-giphyDarkGrey text-giphyWhite box-border h-9 border-0 p-2.5",C="relative flex cursor-pointer select-none flex-col overflow-hidden rounded-md border-solid",k=(0,a.cn)("[&:nth-child(1n)]:bg-giphyAqua [&:nth-child(2n)]:bg-giphyRed [&:nth-child(3n)]:bg-giphyIndigo [&:nth-child(4n)]:bg-giphyPink [&:nth-child(5n)]:bg-giphyPurple","hover:[&:nth-child(1n)]:border-giphyAqua hover:[&:nth-child(2n)]:border-giphyRed hover:[&:nth-child(3n)]:border-giphyIndigo hover:[&:nth-child(4n)]:border-giphyPink hover:[&:nth-child(5n)]:border-giphyPurple"),A="box-border border-solid border-inherit group-hover:border-4 rounded-md"},31403:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(54568),r=n(99680),o=n(26274),a=n(7620),s=n(54713),l=n(83500),c=n(15012);let d=s.Ay.button.withConfig({componentId:"sc-6421bdb3-0"})(["all:unset;align-items:center;color:inherit;cursor:pointer;display:inline-flex;gap:0.3em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&:focus-visible{border-radius:2px;outline:2px solid ",";}&:active{opacity:0.8;}"],o.aw),u=e=>{let t,n,o=(0,r.c)(12),{children:s,className:u,href:h,icon:f,style:g,onClick:p}=e,x=void 0===f?"navigate-right":f,{colors:m}=(0,a.useContext)(c.k),b=h?"a":void 0,y=h?"_blank":void 0;return o[0]!==m.labelIcon||o[1]!==x?(t=(0,i.jsx)(l.A,{color:m.labelIcon,height:14,icon:x,width:14}),o[0]=m.labelIcon,o[1]=x,o[2]=t):t=o[2],o[3]!==s||o[4]!==u||o[5]!==h||o[6]!==p||o[7]!==g||o[8]!==b||o[9]!==y||o[10]!==t?(n=(0,i.jsxs)(d,{as:b,className:u,href:h,style:g,target:y,onClick:p,children:[s,t]}),o[3]=s,o[4]=u,o[5]=h,o[6]=p,o[7]=g,o[8]=b,o[9]=y,o[10]=t,o[11]=n):n=o[11],n}},35949:(e,t,n)=>{n.d(t,{b:()=>u,default:()=>d});var i=n(54568),r=n(99680),o=n(29306),a=n(10933),s=n.n(a),l=n(97509);let c="text-giphyWhite bg-gradient-primary font-bold px-4 py-2 cursor-pointer";function d(e){let t,n,a,l,d,u,h=(0,r.c)(12);h[0]!==e?({isExternal:a,className:n,children:t,...l}=e,h[0]=e,h[1]=t,h[2]=n,h[3]=a,h[4]=l):(t=h[1],n=h[2],a=h[3],l=h[4]),h[5]!==n?(d=(0,o.cn)(c,n),h[5]=n,h[6]=d):d=h[6];let f=d;return h[7]!==f||h[8]!==t||h[9]!==a||h[10]!==l?(u=l.href&&!a?(0,i.jsx)(s(),{className:f,...l,children:t}):l.href?(0,i.jsx)("a",{className:f,...l,children:t}):(0,i.jsx)("button",{className:f,...l,children:t}),h[7]=f,h[8]=t,h[9]=a,h[10]=l,h[11]=u):u=h[11],u}function u(e){let t,n,a,s,d,u=(0,r.c)(11);u[0]!==e?({className:n,children:t,...a}=e,u[0]=e,u[1]=t,u[2]=n,u[3]=a):(t=u[1],n=u[2],a=u[3]);let{pending:h}=(0,l.useFormStatus)(),f=h&&"pointer-events-none opacity-50";return u[4]!==n||u[5]!==f?(s=(0,o.cn)(c,n,f),u[4]=n,u[5]=f,u[6]=s):s=u[6],u[7]!==t||u[8]!==a||u[9]!==s?(d=(0,i.jsx)("button",{type:"submit",className:s,...a,children:t}),u[7]=t,u[8]=a,u[9]=s,u[10]=d):d=u[10],d}},36542:(e,t,n)=>{n.d(t,{GB:()=>l,o7:()=>a,rH:()=>s});var i=n(48828),r=n(98062),o=n(16003);n(34874);let a="csrftoken",s="X-CSRFToken",l=async()=>{let e=await (0,o.Ou)({url:`${i.wh}/login/check/`,options:(0,r.fG)()}),{result:{user:t}}=await e.json();return t}},42761:(e,t,n)=>{n.d(t,{YD:()=>h,ZG:()=>f,cf:()=>p,es:()=>g});var i=n(99680),r=n(90483),o=n(76353),a=n(7620),s=n(74595),l=n(8351),c=n(71972);let d={},u=(0,c.v)()(e=>d),h=(e,t)=>{u.setState(n=>({...n,[e]:t}))},f=e=>u.getState()[e]||[],g=(e,t)=>{let n,r=(0,i.c)(2);r[0]!==t?(n=void 0===t?[]:t,r[0]=t,r[1]=n):n=r[1];let o=n;return u(t=>t[e])||o},p=e=>{let t,n,c,d,u,f,p,x=(0,i.c)(21),{data:m,isLoading:b}=(0,r.HS)(e),y=g(e,m?.children);x[0]!==e?(t=async t=>await (0,o.vp)(e,"",{offset:t,limit:20}),x[0]=e,x[1]=t):t=x[1];let v=t;x[2]===Symbol.for("react.memo_cache_sentinel")?(n={rootMargin:"0px 0px 250px 0px"},x[2]=n):n=x[2];let{ref:w,inView:j}=(0,s.Wx)(n);x[3]!==m?.num_children||x[4]!==y?(c=()=>y.length===m?.num_children,x[3]=m?.num_children,x[4]=y,x[5]=c):c=x[5],x[6]!==y||x[7]!==v||x[8]!==j||x[9]!==c?(d={initialData:y,fetchData:v,triggerFetch:j,checkDone:c},x[6]=y,x[7]=v,x[8]=j,x[9]=c,x[10]=d):d=x[10];let{doneFetching:C,gifs:k}=(0,l.A)(d);return x[11]!==e||x[12]!==k?(u=()=>{h(e,k)},f=[e,k],x[11]=e,x[12]=k,x[13]=u,x[14]=f):(u=x[13],f=x[14]),(0,a.useEffect)(u,f),x[15]!==m||x[16]!==y||x[17]!==C||x[18]!==b||x[19]!==w?(p={doneFetching:C,isLoading:b,ref:w,channel:m,children:y},x[15]=m,x[16]=y,x[17]=C,x[18]=b,x[19]=w,x[20]=p):p=x[20],p}},51176:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(54568),r=n(99680);let o="add-icon",a=e=>{let t,n,a,s,l,c=(0,r.c)(11),d=e.color||"white",u=e.id||o;c[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)("stop",{id:"gradient-stop-1",offset:"0%",stopColor:"var(--stop-color-1)"}),n=(0,i.jsx)("stop",{id:"gradient-stop-2",offset:"100%",stopColor:"var(--stop-color-2)"}),c[0]=t,c[1]=n):(t=c[0],n=c[1]),c[2]!==u?(a=(0,i.jsx)("defs",{children:(0,i.jsxs)("linearGradient",{x1:"0%",y1:"10%",x2:"0%",y2:"90%",id:u,children:[t,n]})}),c[2]=u,c[3]=a):a=c[3];
1let h=e.className?.indexOf("--stop-color-1")===-1?"":`url(#${e.id||o})`;return c[4]!==h?(s=(0,i.jsx)("path",{fill:h,fillRule:"evenodd",clipRule:"evenodd",d:"M8.27273 0C7.72044 0 7.27273 0.447715 7.27273 1V7.27273L1 7.27273C0.447716 7.27273 0 7.72044 0 8.27273V11.7273C0 12.2796 0.447716 12.7273 1 12.7273H7.27273V19C7.27273 19.5523 7.72044 20 8.27273 20H11.7273C12.2796 20 12.7273 19.5523 12.7273 19V12.7273H19C19.5523 12.7273 20 12.2796 20 11.7273V8.27273C20 7.72044 19.5523 7.27273 19 7.27273L12.7273 7.27273V1C12.7273 0.447715 12.2796 0 11.7273 0H8.27273Z"}),c[4]=h,c[5]=s):s=c[5],c[6]!==e||c[7]!==d||c[8]!==a||c[9]!==s?(l=(0,i.jsxs)("svg",{fill:d,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",...e,children:[a,s]}),c[6]=e,c[7]=d,c[8]=a,c[9]=s,c[10]=l):l=c[10],l}},52557:(e,t,n)=>{n.d(t,{A:()=>f});var i=n(54568),r=n(26274),o=n(4398),a=n.n(o),s=n(7620),l=n(54713),c=n(45366),d=n(22878);let u=l.Ay.div.withConfig({componentId:"sc-3f59208c-0"})(["align-items:flex-start;display:flex;height:","px;font-size:","px;position:relative;&:before{background:",";bottom:0;content:'';height:1px;left:0;position:absolute;width:100%;}",""],({$size:e})=>(0,d.uN)(e),({$size:e})=>(0,d.Vd)(e),({$dividerColor:e})=>e,({$disabled:e})=>e&&(0,l.AH)(["pointer-events:none;"])),h=l.Ay.button.withConfig({componentId:"sc-3f59208c-1"})(["all:unset;align-items:center;border-bottom:3px solid ",";box-sizing:border-box;color:",";cursor:pointer;display:flex;font-weight:bold;height:100%;justify-content:center;overflow:hidden;padding:0 0.8em;position:relative;text-align:center;transition:border-bottom-color 0.1s ease-out,color 0.1s ease-out;user-select:none;span{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}&:active{opacity:0.9;}&:focus-visible{border-radius:4px;outline:2px solid ",";}",""],({$activeBorderColor:e})=>(0,c.b)(e,0),({$color:e})=>e,r.aw,({$active:e,$activeColor:t,$activeBorderColor:n})=>e&&(0,l.AH)(["border-bottom-color:",";color:",";overflow:visible;"],n,t)),f=({activeColor:e="#fff",activeBorderColor:t=e,className:n,color:o=r.nU,defaultIndex:l=0,disabled:c=!1,dividerColor:d=r.Fl,index:f,labels:g,size:p="small",onChange:x})=>{let m=(0,s.useRef)(a()("tab-control")),b=(0,s.useRef)(l),[y,v]=(0,s.useState)(l);return(0,s.useEffect)(()=>{c||y===b.current||(b.current=void 0,x?.(y))},[y,c]),(0,s.useEffect)(()=>{"number"==typeof f&&f!==y&&v(f)},[f]),(0,i.jsx)(u,{$disabled:c||g.length<2,$dividerColor:d,$size:p,className:n,children:g.map((n,r)=>(0,i.jsx)(h,{$active:!c&&r===y,$activeColor:e,$activeBorderColor:t,$color:o,tabIndex:c||g.length<2?-1:void 0,onClick:()=>v(r),children:(0,i.jsx)("span",{children:n})},`${m.current}-${r}`))})}},56215:(e,t,n)=>{n.d(t,{_Z:()=>o,yR:()=>a});var i=n(65235);function r(e,t){let n=t.split("."),i={...e};return n.forEach(e=>{e in(i||{})&&(i=i[e])}),i}function o(e){let t=(0,i._U)(e[0]);return e.every(e=>(0,i._U)(e)===t)?t:"gif"}function a(e,t,n){let i=function(e,t){if(t){let n=e.find(e=>e.id===t);return n?[n]:[]}return e}(e,n),o=r(i[0],t);if(i.every(e=>r(e,t)===o))return o}},65235:(e,t,n)=>{function i(e){return e.is_sticker?"sticker":"video"===e.type?"clip":"gif"}function r(e){return"video"===e.type?"clip":e.type}function o(e){switch(e){case"clip":return"clip";case"gif":return"gif";case"sticker":return"sticker"}}n.d(t,{PT:()=>o,_U:()=>i,fP:()=>r})},66804:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(54568),r=n(99680),o=n(85922),a=n(77797),s=n(34874),l=n(41798),c=n(7620);let d=e=>{let t,n,s,d,u,h=(0,r.c)(13),{onSelect:f}=e,{fetchChannelSearch:g,term:p,setChannels:x,currentChannels:m,isFocused:b,setSearch:y}=(0,c.useContext)(l.SearchContext),[v,w]=(0,c.useState)(b);return h[0]!==g||h[1]!==x||h[2]!==p?(t=()=>{let e=async()=>{x(await g(0))};p?e():x([])},n=[p,g,x],h[0]=g,h[1]=x,h[2]=p,h[3]=t,h[4]=n):(t=h[3],n=h[4]),(0,c.useEffect)(t,n),h[5]!==b?(s=()=>{let e;return b?w(!0):e=setTimeout(()=>w(!1),100),()=>clearTimeout(e)},d=[b],h[5]=b,h[6]=s,h[7]=d):(s=h[6],d=h[7]),(0,c.useEffect)(s,d),h[8]!==m||h[9]!==v||h[10]!==f||h[11]!==y?(u=v&&m?.length>0?(0,i.jsx)("div",{className:"relative",children:(0,i.jsx)("div",{className:"absolute top-1 z-10 max-h-80 w-full divide-y divide-dashed divide-giphyWhite/20 overflow-auto rounded-md bg-giphyDarkCharcoal *:px-3 *:py-3",children:m?m?.map(e=>(0,i.jsxs)("div",{className:"flex cursor-pointer items-center gap-2 hover:bg-giphyDarkGrey",onClick:t=>{t.preventDefault(),t.stopPropagation(),y(""),f(e)},children:[(0,i.jsx)(o.default,{user:e.user,className:"pointer-events-none size-12"}),(0,i.jsxs)("div",{className:"pointer-events-none text-giphyBlue select-none",children:[(0,i.jsx)("div",{children:e.display_name},e.id),(0,i.jsx)(a.A,{user:e.user})]})]},e.id)):null})}):null,h[8]=m,h[9]=v,h[10]=f,h[11]=y,h[12]=u):u=h[12],u},u=e=>{let t,n,o,a,c=(0,r.c)(7),{onSelect:u}=e,h=(0,s.fq)();
1return c[0]===Symbol.for("react.memo_cache_sentinel")?(t={darkMode:!0},n=(0,i.jsx)(l.SearchBar,{className:"flex w-full flex-1",placeholder:"Search for Channels"}),c[0]=t,c[1]=n):(t=c[0],n=c[1]),c[2]!==u?(o=(0,i.jsx)(d,{onSelect:u}),c[2]=u,c[3]=o):o=c[3],c[4]!==h||c[5]!==o?(a=(0,i.jsxs)(l.SearchContextManager,{apiKey:h,shouldFetchChannels:!1,theme:t,children:[n,o]}),c[4]=h,c[5]=o,c[6]=a):a=c[6],a}},67082:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(54568),r=n(99680),o=n(26274),a=n(7620),s=n(92805),l=n(41112),c=n(54713),d=n(20267);let u=c.Ay.div.withConfig({componentId:"sc-8e4f642f-0"})(["align-items:center;box-sizing:border-box;display:inline-flex;line-height:normal;"," ",""],({$color:e,$gradient:t,$hasThumbnail:n,$removeable:i,$round:r,$size:o,$textColor:a})=>(0,c.AH)(["background:",";border-radius:","px;color:",";font-size:","px;height:","px;min-width:","px;padding-left:",";padding-right:",";"],t?(0,s.$_)(t):e,(0,s.xb)(o,r),a,(0,s.Vd)(o),(0,s.uN)(o),(0,s.uN)(o),n?0:"0.8em",i?0:"0.8em"),({$clickable:e})=>e&&(0,c.AH)(["cursor:pointer;user-select:none;"])),h=c.Ay.span.withConfig({componentId:"sc-8e4f642f-1"})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;"]),f=(0,c.Ay)(d.A).withConfig({componentId:"sc-8e4f642f-2"})(["border-radius:inherit;color:inherit;svg{pointer-events:none;}"]),g=c.Ay.img.withConfig({componentId:"sc-8e4f642f-3"})(["border-radius:inherit;flex-shrink:0;margin:0 0.6em 0 0;object-fit:contain;",""],({$size:e})=>(0,c.AH)(["height:","px;width:","px;"],(0,s.uN)(e),(0,s.uN)(e))),p=e=>{let t,n,c,d,p,x,m,b,y,v,w,j,C,k,A,_,$,I,S,N,z,T,O,E=(0,r.c)(54);E[0]!==e?({children:t,className:n,color:b,gradient:c,removeable:y,removeOptions:v,round:w,size:j,style:m,thumbnail:k,title:A,textColor:C,onClick:d,onRemove:p,...x}=e,E[0]=e,E[1]=t,E[2]=n,E[3]=c,E[4]=d,E[5]=p,E[6]=x,E[7]=m,E[8]=b,E[9]=y,E[10]=v,E[11]=w,E[12]=j,E[13]=C,E[14]=k,E[15]=A):(t=E[1],n=E[2],c=E[3],d=E[4],p=E[5],x=E[6],m=E[7],b=E[8],y=E[9],v=E[10],w=E[11],j=E[12],C=E[13],k=E[14],A=E[15]);let D=void 0===b?o.Hi:b,H=void 0!==y&&y;E[16]!==v?(_=void 0===v?{}:v,E[16]=v,E[17]=_):_=E[17];let M=_,R=void 0!==w&&w,L=void 0===j?"small":j,F=(0,a.useRef)(null);E[18]!==D||E[19]!==c?($=c?(0,s.Bj)(c,.5):D,E[18]=D,E[19]=c,E[20]=$):$=E[20];let G=$;E[21]!==G||E[22]!==c||E[23]!==C?(I=C||(0,l.Y)(G,c?"#fff":"inherit"),E[21]=G,E[22]=c,E[23]=C,E[24]=I):I=E[24];let P=I;E[25]!==d?(S=function(e){d&&e.target!==F.current&&d?.(e)},E[25]=d,E[26]=S):S=E[26];let U=S,W=!!d,q=!!k;return E[27]!==L||E[28]!==k?(N=k&&(0,i.jsx)(g,{$size:L,alt:"",src:k}),E[27]=L,E[28]=k,E[29]=N):N=E[29],E[30]!==t?(z=(0,i.jsx)(h,{children:t}),E[30]=t,E[31]=z):z=E[31],E[32]!==p||E[33]!==M||E[34]!==H||E[35]!==L?(T=H&&(0,i.jsx)(f,{color:"transparent",icon:"close",iconColor:"currentColor",iconScale:.75,ref:F,...M,size:L,onClick:()=>p?.()}),E[32]=p,E[33]=M,E[34]=H,E[35]=L,E[36]=T):T=E[36],E[37]!==n||E[38]!==D||E[39]!==P||E[40]!==c||E[41]!==U||E[42]!==H||E[43]!==x||E[44]!==R||E[45]!==L||E[46]!==m||E[47]!==W||E[48]!==q||E[49]!==N||E[50]!==z||E[51]!==T||E[52]!==A?(O=(0,i.jsxs)(u,{...x,$clickable:W,$color:D,$gradient:c,$hasThumbnail:q,$removeable:H,$round:R,$size:L,$textColor:P,className:n,style:m,title:A,onClick:U,children:[N,z,T]}),E[37]=n,E[38]=D,E[39]=P,E[40]=c,E[41]=U,E[42]=H,E[43]=x,E[44]=R,E[45]=L,E[46]=m,E[47]=W,E[48]=q,E[49]=N,E[50]=z,E[51]=T,E[52]=A,E[53]=O):O=E[53],O}},68236:(e,t,n)=>{n.d(t,{A:()=>z});var i=n(54568),r=n(26274),o=n(4398),a=n.n(o),s=n(7620),l=n(22581),c=n(99680),d=n(21239);function u(e,t){let n,i=(0,c.c)(3);e:{if(t){let r;i[0]!==e||i[1]!==t?(r=(0,d.ro)(e,t),i[0]=e,i[1]=t,i[2]=r):r=i[2],n=r;break e}n=!1}return n}var h=n(54713),f=n(92805),g=n(41112);let p=(0,h.i7)(["0%{opacity:0;}"]),x=(0,h.i7)(["0%{opacity:0;scale:0.5;}100%{opacity:1;scale:1;}"]),m=h.Ay.button.withConfig({componentId:"sc-2079fe1a-0"})(["animation:"," 0.15s ease-out;background:transparent;border:none;border-radius:0;color:inherit;cursor:pointer;padding:0;user-select:none;&:active{opacity:",";}&:focus-visible{border-radius:4px;outline:2px solid ",";}"," "," ",""],p,({$dimmed:e})=>e?.3:.8,r.aw,({$selected:e,$today:t})=>{let n=e||t;return(0,h.AH)(["font-size:","em;font-weight:",";"],n?1:.875,n?"bold":"normal")},({$dimmed:e,$disabled:t})=>(e||t)&&(0,h.AH)(["opacity:",";"],t?.1:.5),({$disabled:e})=>e&&(0,h.AH)(["pointer-events:none;"])),b=h.Ay.div.withConfig({componentId:"sc-2079fe1a-1"})(["align-items:center;animation:"," 0.25s cubic-bezier(0.34,1.56,0.64,1);aspect-ratio:1/1;border-radius:50%;display:flex;height:100%;justify-content:center;",""],x,({$color:e,$gradient:t})=>{let n=t?(0,f.Bj)(t,.5):e,i=(0,g.Y)(n),r=t?(0,f.$_)(t):e;return(0,h.AH)(["background:",";color:",";"],r,i)}),y=e=>{let t,n,r,o,a,h,f=(0,c.c)(24),{date:g,dimmed:p}=e,x=void 0!==p&&p,{colors:y,max:v,min:w,selected:j,time:C,today:k,setSelected:A}=(0,s.useContext)(l.Y),_=function(e,t,n){let i;e:{let r=(0,d.HC)(e);if(t&&r<(0,d.HC)(t)||n&&r>(0,d.HC)(n)){i=!1;break e}i=!0}return i}
1(g,w,v),$=u(g,j),I=u(g,k),S=I?y.highlight:y.default;f[0]!==g?(t=g.getDate(),f[0]=g,f[1]=t):t=f[1];let N=t;f[2]!==g||f[3]!==A||f[4]!==C?(n=function(){A((0,d.OY)(g,C))},f[2]=g,f[3]=A,f[4]=C,f[5]=n):n=f[5];let z=n,T=!_;f[6]!==S?(r={color:S},f[6]=S,f[7]=r):r=f[7];let O=x?-1:0;return f[8]!==z?(o=()=>z(),f[8]=z,f[9]=o):o=f[9],f[10]!==y.gradient||f[11]!==y.highlight||f[12]!==$||f[13]!==N?(a=$?(0,i.jsx)(b,{$color:y.highlight,$gradient:y.gradient,children:N}):N,f[10]=y.gradient,f[11]=y.highlight,f[12]=$,f[13]=N,f[14]=a):a=f[14],f[15]!==x||f[16]!==$||f[17]!==I||f[18]!==T||f[19]!==r||f[20]!==O||f[21]!==o||f[22]!==a?(h=(0,i.jsx)(m,{$dimmed:x,$disabled:T,$selected:$,$today:I,style:r,tabIndex:O,onClick:o,children:a}),f[15]=x,f[16]=$,f[17]=I,f[18]=T,f[19]=r,f[20]=O,f[21]=o,f[22]=a,f[23]=h):h=f[23],h},v=()=>{let e,t,n,r,o=(0,c.c)(19),{id:a,visibleMonth:d}=(0,s.useContext)(l.Y),{dates:u,leading:h,trailing:f}=d;if(o[0]!==a||o[1]!==h){let t;o[3]!==a?(t=e=>(0,i.jsx)(y,{date:e,dimmed:!0},`${a}-date-${e.getTime()}`),o[3]=a,o[4]=t):t=o[4],e=h.map(t),o[0]=a,o[1]=h,o[2]=e}else e=o[2];if(o[5]!==u||o[6]!==a){let e;o[8]!==a?(e=e=>(0,i.jsx)(y,{date:e},`${a}-date-${e.getTime()}`),o[8]=a,o[9]=e):e=o[9],t=u.map(e),o[5]=u,o[6]=a,o[7]=t}else t=o[7];if(o[10]!==a||o[11]!==f){let e;o[13]!==a?(e=e=>(0,i.jsx)(y,{date:e,dimmed:!0},`${a}-date-${e.getTime()}`),o[13]=a,o[14]=e):e=o[14],n=f.map(e),o[10]=a,o[11]=f,o[12]=n}else n=o[12];return o[15]!==e||o[16]!==t||o[17]!==n?(r=(0,i.jsxs)(i.Fragment,{children:[e,t,n]}),o[15]=e,o[16]=t,o[17]=n,o[18]=r):r=o[18],r},w=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],j=()=>{let e,t,n=(0,c.c)(5),{colors:r,id:o}=(0,s.useContext)(l.Y);return n[0]!==r||n[1]!==o?(e=w.map(e=>(0,i.jsx)("div",{style:{color:r.label},children:(0,i.jsx)("strong",{children:function(e){switch(e){case"friday":return"F";case"monday":return"M";case"saturday":case"sunday":return"S";case"thursday":case"tuesday":return"T";case"wednesday":return"W"}}(e)})},`${o}-day-labels-${e}`)),n[0]=r,n[1]=o,n[2]=e):e=n[2],n[3]!==e?(t=(0,i.jsx)(i.Fragment,{children:e}),n[3]=e,n[4]=t):t=n[4],t};var C=n(20267);let k=(0,h.Ay)(C.A).withConfig({componentId:"sc-53147d46-0"})(["flex-shrink:0;width:34px;"]),A=h.Ay.div.withConfig({componentId:"sc-53147d46-1"})(["align-items:flex-end;display:flex;gap:3px;width:100%;"]),_=h.Ay.div.withConfig({componentId:"sc-53147d46-2"})(["font-weight:bold;white-space:nowrap;width:100%;"]),$=e=>{let t,n,r,o,a,u,h,f,p,x,m,b,y=(0,c.c)(39),{className:v,fontFamily:w,fontSize:j}=e,{colors:C,max:$,min:I,visible:S,visibleMonth:N,setVisible:z}=(0,s.useContext)(l.Y),T=function(e,t){let n;e:{if(!t){n=!1;break e}let i=e[e.length-1];if(i&&i.getTime()>=(0,d.HC)(t).getTime()){n=!0;break e}n=!1}return n}(N.dates,$),O=function(e,t){let n;e:{if(!t){n=!1;break e}let i=e[0];if(i&&i.getTime()<=(0,d.HC)(t).getTime()){n=!0;break e}n=!1}return n}(N.dates,I);y[0]!==C.button?(t=(0,g.Y)(C.button),y[0]=C.button,y[1]=t):t=y[1];let E=t;y[2]!==S?(n=S.toLocaleString("default",{month:"short"}),y[2]=S,y[3]=n):n=y[3];let D=n;y[4]!==S?(r=S.getFullYear(),y[4]=S,y[5]=r):r=y[5];let H=r;y[6]!==z||y[7]!==S?(o=function(){let e=new Date(S);e.setMonth(e.getMonth()+1),z(e)},y[6]=z,y[7]=S,y[8]=o):o=y[8];let M=o;y[9]!==z||y[10]!==S?(a=function(){let e=new Date(S);e.setMonth(e.getMonth()-1),z(e)},y[9]=z,y[10]=S,y[11]=a):a=y[11];let R=a;return y[12]!==C.header||y[13]!==w||y[14]!==j?(u={color:C.header,fontFamily:w,fontSize:j},y[12]=C.header,y[13]=w,y[14]=j,y[15]=u):u=y[15],y[16]!==D||y[17]!==u||y[18]!==H?(h=(0,i.jsxs)(_,{style:u,children:[D," ",H]}),y[16]=D,y[17]=u,y[18]=H,y[19]=h):h=y[19],y[20]!==R?(f=()=>R(),y[20]=R,y[21]=f):f=y[21],y[22]!==C.button||y[23]!==E||y[24]!==O||y[25]!==f?(p=(0,i.jsx)(k,{color:C.button,disabled:O,icon:"navigate-left",iconColor:E,size:"mini",onClick:f}),y[22]=C.button,y[23]=E,y[24]=O,y[25]=f,y[26]=p):p=y[26],y[27]!==M?(x=()=>M(),y[27]=M,y[28]=x):x=y[28],y[29]!==C.button||y[30]!==E||y[31]!==T||y[32]!==x?(m=(0,i.jsx)(k,{color:C.button,disabled:T,icon:"navigate-right",iconColor:E,size:"mini",onClick:x}),y[29]=C.button,y[30]=E,y[31]=T,y[32]=x,y[33]=m):m=y[33],y[34]!==v||y[35]!==m||y[36]!==h||y[37]!==p?(b=(0,i.jsxs)(A,{className:v,children:[h,p,m]}),y[34]=v,y[35]=m,y[36]=h,y[37]=p,y[38]=b):b=y[38],b};var I=n(22878);let S=h.Ay.div.withConfig({componentId:"sc-a44b5f-0"})(["display:grid;gap:15px;grid-template-columns:1fr;text-align:left;user-select:none;",""],({$disabled:e})=>e&&(0,h.AH)(["pointer-events:none;opacity:0.5;"])),N=h.Ay.div.withConfig({componentId:"sc-a44b5f-1"})(["display:grid;grid-template-columns:repeat(7,1fr);"," "," > button,> div{align-items:center;display:flex;justify-content:center;strong{font-weight:bold;}}"],({$size:e})=>(0,h.AH)(["font-size:","px;grid-auto-rows:","px;"],(0,I.Vd)(e),(0,I.uN)(e)),({$background:e,$size:t})=>e&&(0,h.AH)(["background:",";border-radius:","px;padding:0.6em;"],e,(0,I.xb)(t))),z=({backgroundColor:e,buttonColor:t=r.bW,children:n,className:o,color:u=r.nU,defaultValue:h,disabled:f=!1,gradient:g,headerColor:p="#fff",headerFontFamily:x,headerFontSize:m=28,highlightColor:b="#fff",labelColor:y=r.xx,max:w,min:C,noHeader:k=!1,size:A="small",style:_,onCh
1ange:I})=>{let z=(0,s.useRef)(a()("calendar")),T=(0,s.useRef)(h),[O]=(0,s.useState)(new Date),[E,D]=(0,s.useState)(h),[H,M]=(0,s.useState)((0,d.Fw)(E||O)),[R,L]=(0,s.useState)(h||O),F=function(e){let t,n=(0,c.c)(2);if(n[0]!==e){let i=new Date(e.getFullYear(),e.getMonth(),1),r=new Date(i),o=i.getDay(),a=[],s=[],l=[];r.setDate(r.getDate()-o);for(let t=0;t<42;t++)r<i?s.push(new Date(r)):r.getMonth()!==e.getMonth()?l.push(new Date(r)):a.push(new Date(r)),r.setDate(r.getDate()+1);t={dates:a,leading:s,trailing:l},n[0]=e,n[1]=t}else t=n[1];return t}(R);return(0,s.useEffect)(()=>{E?.getTime()!==T.current?.getTime()&&(T.current=null,I?.(E))},[E,I]),(0,i.jsx)(l.Y.Provider,{value:{colors:{button:t,default:u,gradient:g,header:p,highlight:b,label:y},id:z.current,max:w,min:C,selected:E,time:H,today:O,visible:R,visibleMonth:F,setSelected:D,setTime:M,setVisible:L},children:(0,i.jsxs)(S,{$disabled:f,className:o,style:_,children:[!k&&(0,i.jsx)($,{fontFamily:x,fontSize:m}),(0,i.jsxs)(N,{$background:e,$size:A,children:[(0,i.jsx)(j,{}),(0,i.jsx)(v,{})]}),n]})})}},68292:(e,t,n)=>{function i(e,t){if(t.staff)return!0;switch(e){case"add-tags":case"copy-all-tags":case"remove-all-tags":case"remove-tag":return t.tag;case"copy-gif-id":return!0;case"delete":return t.delete;case"feature-tag":case"unfeature-tag":return t.featureTag;case"takedown":return t.takedown;default:return t.staff}}function r(e,t){if(t.staff)return!0;switch(e){case"description":case"source":case"title":return!0;case"alt-text":return t.altText;case"cta":return t.cta;case"privacy":return t.privacy;case"rating":return t.rate;default:return t.staff}}function o(e,t){return!!t.staff||"metadata"!==e||t.metadata}n.d(t,{BQ:()=>o,MC:()=>r,aF:()=>i})},70380:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(54568),r=n(99680),o=n(54713),a=n(22878),s=n(41112);let l=o.Ay.div.withConfig({componentId:"sc-916718f0-0"})(["align-items:center;display:flex;font-weight:bold;justify-content:center;"," >
1 svg path{fill:currentColor;}"],({$color:e,$size:t,$textColor:n})=>(0,o.AH)(["background:",";border-radius:","px;color:",";font-size:","px;height:","px;width:","px;"],e,(0,a.xb)(t),n||(0,s.Y)(e),(0,a.Vd)(t),(0,a.uN)(t),(0,a.uN)(t))),c=e=>{let t,n=(0,r.c)(8),{children:o,className:a,color:s,size:c,style:d,textColor:u,title:h}=e;return n[0]!==o||n[1]!==a||n[2]!==s||n[3]!==c||n[4]!==d||n[5]!==u||n[6]!==h?(t=(0,i.jsx)(l,{$color:s,$size:c,$textColor:u,className:a,style:d,title:h,children:o}),n[0]=o,n[1]=a,n[2]=s,n[3]=c,n[4]=d,n[5]=u,n[6]=h,n[7]=t):t=n[7],t}},72594:(e,t,n)=>{n.d(t,{A:()=>g});var i=n(54568),r=n(99680),o=n(26274),a=n(7620),s=n(92805),l=n(41112);function c(e,t,n,i){let o,a=(0,r.c)(12);if(e){let e,t,r;a[5]!==n||a[6]!==i?(e=i?(0,s.tA)(i)[0]:n,a[5]=n,a[6]=i,a[7]=e):e=a[7];let c=e;a[8]!==c?(t=(0,l.Y)(c),a[8]=c,a[9]=t):t=a[9],a[10]!==t?(r={color:t},a[10]=t,a[11]=r):r=a[11],o=r}else if("transparent"!==t){let e,n;a[0]!==t?(e=(0,l.Y)(t),a[0]=t,a[1]=e):e=a[1],a[2]!==e?(n={color:e},a[2]=e,a[3]=n):n=a[3],o=n}else{let e;a[4]===Symbol.for("react.memo_cache_sentinel")?(e={color:"inherit"},a[4]=e):e=a[4],o=e}return o}var d=n(54713);let u=d.Ay.button.withConfig({componentId:"sc-c226ff9b-0"})(["border:none;color:inherit;cursor:pointer;display:flex;font-weight:bold;overflow:hidden;padding:0;position:relative;user-select:none;width:100%;&:active{opacity:0.9;}&:focus-visible{outline:2px solid ",";}"," ",""],o.aw,({$backgroundColor:e,$size:t})=>(0,d.AH)(["background:",";border-radius:","px;height:","px;font-size:","px;"],e,(0,s.xb)(t,!0),(0,s.uN)(t),(0,s.Vd)(t)),({$disabled:e})=>e&&(0,d.AH)(["opacity:0.5;pointer-events:none;"])),h=d.Ay.div.withConfig({componentId:"sc-c226ff9b-1"})(["border-radius:inherit;height:100%;left:0;position:absolute;top:0;transition:background 0.4s ease-out,transform 0.4s cubic-bezier(0.68,-0.55,0.265,1.55);width:50%;"]),f=d.Ay.div.withConfig({componentId:"sc-c226ff9b-2"})(["align-items:center;border-radius:inherit;display:flex;height:100%;justify-content:center;overflow:hidden;padding:0 1em;position:relative;text-align:center;text-overflow:ellipsis;transition:color 0.2s ease-out;white-space:nowrap;width:100%;"]),g=e=>{let t,n,l,d,g,p,x,m=(0,r.c)(26),{backgroundColor:b,className:y,colorOff:v,colorOn:w,disabled:j,gradientOff:C,gradientOn:k,isOn:A,labelOff:_,labelOn:$,size:I,style:S,tabIndex:N,onChange:z,dontManageState:T}=e,O=void 0===b?o.Hi:b,E=void 0===v?"#fff":v,D=void 0===w?"#fff":w,H=void 0!==j&&j,M=void 0!==A&&A,R=void 0===_?"Off":_,L=void 0===$?"On":$,F=void 0===I?"small":I,G=void 0!==T&&T,[P,U]=(0,a.useState)(M),W=P?D:E,q=P?k:C,B=function(e,t,n){let i,o,l,c,d=(0,r.c)(13);d[0]!==t||d[1]!==n?(i=t,n&&(i=(0,s.$_)(n)),d[0]=t,d[1]=n,d[2]=i):i=d[2];let u=`translate3d(${100*!!e}%, 0, 0)`;d[3]!==i||d[4]!==u?(o={background:i,transform:u},d[3]=i,d[4]=u,d[5]=o):o=d[5];let[h,f]=(0,a.useState)(o);return d[6]!==i||d[7]!==u?(l=()=>{f({background:i,transform:u})},d[6]=i,d[7]=u,d[8]=l):l=d[8],d[9]!==i||d[10]!==e||d[11]!==u?(c=[i,u,e],d[9]=i,d[10]=e,d[11]=u,d[12]=c):c=d[12],(0,a.useEffect)(l,c),h}(P,W,q),V=c(!P,O,E,C),J=c(P,O,D,k);m[0]!==G||m[1]!==P||m[2]!==z?(t=function(){let e=!P;G||U(e),z?.(e)},m[0]=G,m[1]=P,m[2]=z,m[3]=t):t=m[3];let Y=t;m[4]!==M?(n=()=>{U(M)},l=[M],m[4]=M,m[5]=n,m[6]=l):(n=m[5],l=m[6]),(0,a.useEffect)(n,l);let K=H?-1:N;return m[7]!==B?(d=(0,i.jsx)(h,{style:B}),m[7]=B,m[8]=d):d=m[8],m[9]!==R||m[10]!==V?(g=(0,i.jsx)(f,{style:V,children:R}),m[9]=R,m[10]=V,m[11]=g):g=m[11],m[12]!==L||m[13]!==J?(p=(0,i.jsx)(f,{style:J,children:L}),m[12]=L,m[13]=J,m[14]=p):p=m[14],m[15]!==O||m[16]!==y||m[17]!==H||m[18]!==Y||m[19]!==F||m[20]!==S||m[21]!==K||m[22]!==d||m[23]!==g||m[24]!==p?(x=(0,i.jsxs)(u,{$backgroundColor:O,$disabled:H,$size:F,className:y,style:S,tabIndex:K,onClick:Y,children:[d,g,p]}),m[15]=O,m[16]=y,m[17]=H,m[18]=Y,m[19]=F,m[20]=S,m[21]=K,m[22]=d,m[23]=g,m[24]=p,m[25]=x):x=m[25],x}},75314:(e,t,n)=>{n.d(t,{c:()=>i});let i=(0,n(7620).createContext)({})},76353:(e,t,n)=>{n.d(t,{C2:()=>v,D$:()=>x,D3:()=>f,Dn:()=>p,OL:()=>_,TT:()=>y,Xr:()=>w,ZJ:()=>u,_2:()=>d,b:()=>g,i3:()=>C,jQ:()=>j,o4:()=>h,vp:()=>k,vq:()=>c,xq:()=>A,yz:()=>m});var i=n(48828),r=n(98062),o=n(34874),a=n(16003);let s="/api/v4/",l=`${s}channels/`,c=async(e,t,n)=>{let r=(0,o.Ri)("csrftoken");return await (0,a.Ou)({url:`${i.wh}/api/v4/channels/${e}/move/`,options:{...(0,o.f5)(r),body:JSON.stringify({position:n,target_channel:t})}})},d=async(e,t)=>{let n;return await (0,a.Ou)({url:`${i.wh}/api/v4/channels/${e}`,options:{...(0,o.f5)((0,o.Ri)("csrftoken"),!0),method:"PATCH",body:(n=new FormData,t.forEach((e,t)=>{"u">typeof File&&e instanceof File&&""===e.name&&0===e.size||n.append(t,e)}),n)}})},u=async e=>await (0,a.Ou)({url:`${i.wh}/api/v4/channels/${e}/`,options:{method:"PATCH",body:new URLSearchParams({id:String(e),banner_image:""}).toString(),headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","X-CSRFToken":(0,o.Ri)("csrftoken"),"X-Requested-With":"XMLHttpRequest"},credentials:"same-origin"}}),h=async(e,t)=>await (0,a.Ou)({url:`${i.wh}/api/v4/channels/${e}`,options:{...(0,o.f5)((0,o.Ri)("csrftoken")),method:"PATCH",body:JSON.stringify(t)}}),f=async e=>await (0,a.Ou)({url:`${i.wh}/api/v4/channels/${e}`,options:{...(0,o.f5)((0,o.Ri)("csrftoken")),method:"DELETE"}}),g=async e=>{let t=await (0,a.Ou)({url:`${i.wh}/api/v4/channel-gifs/?gif=${e}`});return(await t.json()).results};async function p(e,t){let n=(0,o.Ri)("csrftoken");return await (0,a.Ou)({url:`${i.wh}/api/v4/channel-gifs`,options:{...(0,o.f5)(n),body:JSON.stringify({items:e.map(e=>({gif:e,channel:t}))})}})}async function x(e,t){let n=(0,o.Ri)("csrftoken");return await (0,a.Ou)({url:`${i.wh}/api/v4/channel-gifs/remove`,options:{...(0,o.f5)(n),body:JSON.stringify({items:e.map(e=>({gif:e,channel:t}))})}})}let m=async({note:e,reason:t,reporter:n,send_email:r,userToDeactivate:a})=>{try{let s=await fetch(`${i.wh}/api/v3/deactivate-user`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":(0,o.Ri)("csrftoken")},body:JSON.stringify({note:e,reason:t,reporter:n,send_email:r,userToDeactivate:a})});if(!s.ok)throw Error(`Failed to deactivate channel. Status: ${s.status}`);let l=await s.json();if(l?.success)return l;throw Error(l?.message||"Unknown error occurred during deactivation.")}catch(e){throw console.error("Error deactivating channel:",e),Error("There was an issue deactivating the channel.")}},b=async(e,t={},n,l)=>{let c=(0,o.LW)(new URL(`${s}${e}`,i.wh),t),d=await (0,a.Ou)({url:c,options:(0,r.fG)(n),timeout:l});d.ok||console.error(`Failed to fetch ${c}`);let u=await d.json();return(0,o.LR)(u,t.offset||0)},y=async e=>b("artists",e),v=async(e,t,n)=>b(`channels/${e}/clips/feed`,t,n),w=async(e,t,n)=>b(`channels/${e}/feed`,t,n,5e3),j=async(e={},t)=>{let n=(0,o.LW)(new URL(l,i.wh),e),s=await (0,a.Ou)({url:n,options:(0,r.fG)(t),timeout:2500});return await s.json()},C=async(e,t={},n)=>b(`channels/${e}/search/`,t,n),k=async(e,t="",n={})=>b(`channels/${e}/children`,n,t),A=async(e,t)=>{let n=await fetch((0,o.LW)(new URL(`${i.wh}/api/v4/channels/${e}/clips/feed/`),t||{}));return(0,o.LR)(await n.json(),t?.offset||0)},_=async(e,t)=>{let n=new URL(`${l}${e}`,i.wh),o=await (0,a.Ou)({url:n,options:(0,r.fG)(t)});return await o.json()}},81522:(e,t,n)=>{n.d(t,{s:()=>i});let i=(0,n(7620).createContext)({})},88267:(e,t,n)=>{n.d(t,{iO:()=>r$,Ay:()=>rI,UT:()=>r_,jb:()=>rk});var i=n(54568),r=n(99680),o=n(2972);let a=(0,o.createServerReference)("40575cc58ccbd9e29998ef13d08a78880cb3d4cf44",o.callServer,void 0,o.findSourceMapURL,"fetchMetadata"),s=(0,o.createServerReference)("4053a9948fc3a3242d3e7ab5951269d4f3a99658ce",o.callServer,void 0,o.findSourceMapURL,"fetchExtendedMetadata");var l=n(91769),c=n(48828),d=n(98062),u=n(34874);let h="/ajax/gif/labels",f=async e=>{let t=new URLSearchParams({gif_ids:e.join(",")}),n=await fetch(`${c.Dd}${h}?${t}`,(0,d.fG)());if(!n.ok)throw Error(`Unable to load content labels (${n.status})`);let{result:i}=await n.json();if(!i)throw Error("Unable to load content labels");return i},g=async(e,t,n)=>{let i=await fetch(`${c.Dd}${h}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded","X-CSRFToken":(0,u.Ri)("csrftoken"),"X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({gif_ids:e.join(","),action:n,label_id:`${t}`}).toString()});if(!i.ok)throw Error(`Unable to update content labels (${i.status})`)},p=(e,t)=>g(e,t,"add"),x=(e,t)=>g(e,t,"remove");var m=n(6164),b=n(76353),y=n(41198),v=n.n(y),w=n(89905),j=n.n(w),C=n(29306),k=n(36542),A=n(7620),_=n(11166),$=n(35949),I=n(26274);let S={animal_welfare:"Animal welfare",bullying_harassment:"Bullying and harassment",bullying_harassment_women:"Bullying and harassment of women",clips_copyright:"Clips Copyright",coordinated_harm:"Coordinated harm or threat to life",copyright:"Copyright infringement",csam:"CSAM",csam_deepfake:"CSAM deepfake",csam_jokes:"CSAM jokes or mockery",disasters_tragedies:"Disasters and tragedies",discrimination:"Discrimination",eating_disorder:"Eating disorder",epilepsy:"Epilepsy",graphic_medical_content:"Graphic medical content",hate:"Hate",illegal_activity:"Illegal content: Illegal activity",illegal_substances:"Illegal content: Selling illegal substances/service",incitement_violence_women:"Incitement to violence against women",incitement_violence_hate:"Incitement to violence or hate",private_information:"Private information",misinformation:"Misinformation",mutilation:"Mutilation",nonconsensual_deepfake:"Non-consensual deepfake",nonconsensual_image:"Non-consensual image",nudity:"Nudity",perpetrators:"Perpetrators of violence",pornography:"Pornography",public_health:"Public health",real_gore:"Real gore",school_shootings:"School shootings",sexual_violence:"Sexual violence",sexualized_deepfake:"Sexualized deepfake",solicitation:"Solicitation",spam:"Spam",self_harm:"Suicide",terrorism:"Terrorism and violent extremists",threatening_stalking:"Threatening or stalking",threatening_stalking_women:"Threatening or stalking of women",trademark:"Trademark violation",underage_user:"Underage user",violence:"Violence"},N=["animal_welfare","bullying_harassment","bullying_harassment_women","clips_copyright","coordinated_harm","copyright","csam","csam_deepfake","csam_jokes","disasters_tragedies","discrimination","eating_disorder","epilepsy","graphic_medical_content","hate","illegal_activity","illegal_substances","incitement_violence_women","incitement_violence_hate","private_information","misinformation","mutilation","nonconsensual_deepfake","nonconsensual_image","nudity","perpetrators","pornography","public_health","real_gore","school_shootings","sexual_violence","sexualized_deepfake","solicitation","spam","self_harm","terrorism","threatening_stalking","threatening_stalking_women","trademark","underage_user","violence"],z="reason",T="note",O="sendemail",E=({onClose:e,g
1ifIds:t})=>{let[n,r]=(0,A.useState)(!1),[o,a]=(0,A.useState)(!1),[s,l]=(0,A.useState)(""),[d,h]=(0,A.useState)(""),[f,g]=(0,A.useState)(-1),p=d.trim()?N.filter(e=>S[e].toLowerCase().includes(d.trim().toLowerCase())).slice(0,5):N,x=async(e,n)=>{r(!0);try{var i,o,a;let e;await (i=n.get(z),o=n.get(T),a="on"===n.get(O),e={takedowns:t.map(e=>({reason:i,gif_id:e})),send_email:a,note:o||void 0},fetch(`${c.wh}/api/v3/content-takedown/takedown`,{...(0,u.f5)((0,u.Ri)(k.o7),!1),body:JSON.stringify(e)}))}catch(e){if(e instanceof Error)return console.error(e.message),e.message;throw e}finally{r(!1)}return"Success"},[m,b]=(0,A.useActionState)(x,"");return"Success"===m?(0,i.jsx)("div",{className:`flex justify-center p-20 text-center text-lg ${v().variable}`,children:"Gif deleted."}):(0,i.jsxs)("form",{className:(0,C.cn)(`group relative m-4 flex flex-col gap-2 ${j().variable}`,n&&"pointer-events-none opacity-80"),action:b,children:[(0,i.jsx)("h1",{className:"text-lg font-bold",children:"Why are you removing the selected content?"}),(0,i.jsxs)("div",{className:"relative mb-4",children:[(0,i.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2 rounded bg-giphyDarkGrey px-3 py-2 text-left text-base font-medium",onClick:()=>a(e=>!e),children:[s?S[s]:"Select a reason",s&&(0,i.jsx)(_.A,{color:I.DK,width:18,height:18})]}),o&&(0,i.jsxs)("div",{className:"absolute z-10 mt-1 max-h-[40vh] w-full overflow-auto rounded bg-giphyDarkGrey shadow-lg",children:[(0,i.jsxs)("div",{className:"sticky top-0 z-20 flex items-center gap-2 border-b border-giphyLightGrey/20 bg-giphyDarkGrey p-2",children:[(0,i.jsxs)("svg",{className:"text-giphyLightGrey",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeWidth:"2"}),(0,i.jsx)("path",{d:"M15 15L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),(0,i.jsx)("input",{type:"text",value:d,onChange:e=>h(e.target.value),onKeyDown:e=>{if(o)switch(e.key){case"ArrowDown":e.preventDefault(),g(e=>e<p.length-1?e+1:0);break;case"ArrowUp":e.preventDefault(),g(e=>e>0?e-1:p.length-1);break;case"Enter":e.preventDefault(),f>=0&&p[f]&&(l(p[f]),a(!1),h(""),g(-1));break;case"Escape":e.preventDefault(),a(!1),g(-1)}},placeholder:"Search reasons...",className:"w-full rounded border border-giphyDarkGrey bg-giphyDarkGrey px-2 py-1 text-base text-giphyWhite placeholder-giphyWhite outline-none focus:border-giphyGreen",autoFocus:!0})]}),0===p.length?(0,i.jsx)("div",{className:"px-3 py-2 text-base text-giphyLightGrey",children:"No results"}):p.map((e,t)=>(0,i.jsx)("button",{type:"button",className:`w-full cursor-pointer border-b border-giphyDarkGrey/30 px-3 py-2 text-left text-base transition-colors duration-150 last:border-b-0 ${t===f?"bg-giphyLightGrey/20 text-giphyWhite":"hover:bg-giphyLightGrey/10 hover:text-giphyWhite"}`,onClick:()=>{l(e),a(!1),h(""),g(-1)},onMouseEnter:()=>g(t),children:S[e]},e))]}),(0,i.jsx)("input",{type:"hidden",name:z,value:s,required:!0})]}),(0,i.jsx)("h1",{className:"text-lg font-bold",children:"Any additional information?"}),(0,i.jsx)("textarea",{className:"my-1 h-20 w-full resize-none",name:T}),(0,i.jsxs)("div",{className:"my-4 flex gap-2",children:[(0,i.jsx)("input",{type:"checkbox",name:O,id:O})," ",(0,i.jsx)("label",{htmlFor:O,children:"Send email to user"})]}),(0,i.jsxs)("div",{className:"flex flex-col justify-center gap-2",children:[(0,i.jsx)($.default,{type:"submit",className:(0,C.cn)("cursor-pointer bg-gradient-primary",s?"opacity-100":"opacity-50"),disabled:!s,children:"Submit"}),(0,i.jsx)($.default,{onClick:e,className:"bg-giphyDarkCharcoal",children:"Cancel"})]})]})};var D=n(27664),H=n(96211),M=n(47790),R=n(15012),L=n(54713),F=n(90435);let G=L.Ay.div.withConfig({componentId:"sc-35daf288-0"})(["align-items:center;border-radius:inherit;display:flex;justify-content:center;position:relative;&:before{background:",";border-radius:inherit;content:'';height:100%;left:0;opacity:0.9;position:absolute;top:0;width:100%;}"],({$backgroundColor:e})=>e);var P=n(59250),U=n(16003),W=n(20267),q=n(27079),B=n(83500),V=n(8241),J=n(65565);let Y=(0,L.Ay)(J.A).withConfig({componentId:"sc-3d1ef638-0"})(["flex-shrink:0;> span{padding-top:2px;}i,svg{display:inline-block;margin-right:0.6em;margin-top:-2px;vertical-align:middle;}
1"]),K=({children:e,className:t,color:n="transparent",icon:r,iconColor:o,iconGradient:a,iconOnly:s=!1,iconScale:l,label:c,size:d,style:u,textColor:h,title:f,tooltipWidth:g=P.Li})=>{let p=(0,A.useRef)((0,V.$C)("edit-panel-tooltip-button-")),{colors:x}=(0,A.useContext)(R.k),{isOpen:m,listeners:b}=(0,q.fS)({color:x.tooltip,direction:"up",id:p.current,triggerType:"click",width:g}),y={...b,className:t,color:n,size:d,style:u};return(0,i.jsxs)(i.Fragment,{children:[r&&s?(0,i.jsx)(W.A,{...y,color:o,gradient:a,icon:r,iconScale:l,inverted:!0,title:f||("string"==typeof c?c:void 0)}):(0,i.jsxs)(Y,{...y,className:t,textColor:h||x.text,title:f,children:[r&&(0,i.jsx)(B.A,{color:o,gradient:a,height:20,icon:r,width:20}),c]}),(0,i.jsx)(q.mt,{isOpen:m,children:e})]})};var Z=n(68292);let X=["info","metadata","collections"];function Q(e){switch(e){case"collections":return"Collections";case"info":return"Info";case"metadata":return"Metadata"}}var ee=n(45366),et=n(22878),en=n(42880);let ei=(0,A.lazy)(()=>n.e(2247).then(n.bind(n,62247))),er=(0,A.lazy)(()=>n.e(5135).then(n.bind(n,7516))),eo=(0,A.lazy)(()=>Promise.resolve().then(n.bind(n,90296))),ea=(0,A.lazy)(()=>n.e(2992).then(n.bind(n,72992))),es=(0,A.lazy)(()=>n.e(7268).then(n.bind(n,67268))),el=(0,A.lazy)(()=>n.e(5175).then(n.bind(n,45175))),ec=(0,A.lazy)(()=>n.e(8485).then(n.bind(n,28485))),ed=(0,A.lazy)(()=>n.e(3887).then(n.bind(n,13887))),eu=e=>{let t,n,o,a=(0,r.c)(5);a[0]!==e?(t=function(){switch(e.field){case"searchable":return(0,i.jsx)(eo,{...e});case"indexed":return(0,i.jsx)(er,{...e});case"no-trend":return(0,i.jsx)(ei,{...e,inverted:!0});case"privacy":return(0,i.jsx)(ea,{...e});case"rating":return(0,i.jsx)(es,{...e});case"source":return(0,i.jsx)(el,{...e});case"username":return(0,i.jsx)(ed,{...e});default:return(0,i.jsx)(ec,{...e})}},a[0]=e,a[1]=t):t=a[1];let s=t;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(en.A,{size:"small"}),a[2]=n):n=a[2],a[3]!==s?(o=(0,i.jsx)(A.Suspense,{fallback:n,children:s()}),a[3]=s,a[4]=o):o=a[4],o},eh=(0,A.createContext)({}),ef=["copy-all-tags","copy-gif-id"];function eg(e){switch(e){case"add-tags":case"feature-tag":case"remove-all-tags":case"remove-tag":case"unfeature-tag":return"tag";case"copy-all-tags":case"copy-gif-id":return"duplicate";case"delete":return"trash";case"escalate":return"question";case"explicit":case"reports":return"flag";case"queue":return"dragger";case"repair":return"nav-gear";case"schedule":return"calendar";case"takedown":return"important";case"trend":return"add";case"untrend":return"reset"}}function ep(e){return ef.indexOf(e)>-1}function ex(e){switch(e){case"add-tags":return"Add Tags";case"copy-all-tags":return"Copy all Tags";case"copy-gif-id":return"Copy GIF ID";case"delete":return"Delete";case"escalate":return"Escalate";case"explicit":return"Mark as Explicit";case"feature-tag":return"Feature Tag";case"queue":return"Queue";case"remove-all-tags":return"Remove all Tags";case"remove-tag":return"Remove Tag";case"repair":return"Repair Media";case"reports":return"View Reports";case"schedule":return"Schedule";case"takedown":return"Takedown";case"trend":return"Trend";case"untrend":return"Untrend";case"unfeature-tag":return"Unfeature Tag"}}let em=(0,L.Ay)(e=>{let t,n,o,a,s,l,c=(0,r.c)(42),{action:d,children:u,className:h,iconOnly:f,size:g}=e,p=void 0!==f&&f,{colors:x,isCompact:m}=(0,A.useContext)(R.k),{performAction:b}=(0,A.useContext)(eh);c[0]!==d?(t=function(e){switch(e){case"delete":return"red-pink";case"queue":return"red-yellow";case"schedule":return"blue-cyan";case"trend":return"blue-green";case"untrend":return"purple-indigo";default:return}}(d),c[0]=d,c[1]=t):t=c[1];let y=t;c[2]!==d?(n=eg(d),c[2]=d,c[3]=n):n=c[3];let v=n;c[4]!==d?(o=ex(d),c[4]=d,c[5]=o):o=c[5];let w=o;if(c[6]!==d||c[7]!==h||c[8]!==w||c[9]!==b||c[10]!==g){function j(){b(d,void 0)}a={className:h,color:"transparent",size:g,title:w,onClick:()=>j?.()},c[6]=d,c[7]=h,c[8]=w,c[9]=b,c[10]=g,c[11]=a}else a=c[11];if(u){let e,t;return c[12]!==m?(e=m?{padding:0}:{},c[12]=m,c[13]=e):e=c[13],c[14]!==u||c[15]!==x.footer||c[16]!==x.footerIcon||c[17]!==y||c[18]!==v||c[19]!==p||c[20]!==w||c[21]!==g||c[22]!==e?(t=(0,i.jsx)(K,{icon:v,iconColor:x.footerIcon,iconGradient:y,iconOnly:p,label:w,size:g,textColor:x.footer,style:e,children:u}),c[14]=u,c[15]=x.footer,c[16]=x.footerIcon,c[17]=y,c[18]=v,c[19]=p,c[20]=w,c[21]=g,c[22]=e,c[23]=t):t=c[23],t}if(p){let e,t;return c[24]!==m?(e=m?{padding:0}:{}
1,c[24]=m,c[25]=e):e=c[25],c[26]!==a||c[27]!==x.footerIcon||c[28]!==y||c[29]!==v||c[30]!==w||c[31]!==e?(t=(0,i.jsx)(W.A,{...a,color:x.footerIcon,gradient:y,icon:v,inverted:!0,title:w,style:e}),c[26]=a,c[27]=x.footerIcon,c[28]=y,c[29]=v,c[30]=w,c[31]=e,c[32]=t):t=c[32],t}return c[33]!==x.footerIcon||c[34]!==y||c[35]!==v?(s=(0,i.jsx)(B.A,{color:x.footerIcon,gradient:y,height:20,icon:v,width:20}),c[33]=x.footerIcon,c[34]=y,c[35]=v,c[36]=s):s=c[36],c[37]!==a||c[38]!==x.footer||c[39]!==w||c[40]!==s?(l=(0,i.jsxs)(J.A,{...a,textColor:x.footer,children:[s,w]}),c[37]=a,c[38]=x.footer,c[39]=w,c[40]=s,c[41]=l):l=c[41],l}).withConfig({componentId:"sc-af4ecd6e-0"})(["flex-shrink:0;> span{padding-top:2px;}i,svg{display:inline-block;margin-right:0.6em;margin-top:-2px;vertical-align:middle;}"]),eb=L.Ay.div.withConfig({componentId:"sc-af4ecd6e-1"})(["flex-shrink:0;height:20px;width:1px;"]),ey=L.Ay.div.withConfig({componentId:"sc-af4ecd6e-2"})(["align-items:center;bottom:0;display:flex;gap:4px;justify-content:space-between;width:100%;","{background:",";}"," ",""],eb,({$dividerColor:e})=>e,({$backgroundColor:e,$compact:t,$color:n})=>n&&t&&(0,L.AH)(["> button,> div{position:relative;}&:before{background:",";border-radius:","px;content:'';height:100%;left:0;position:absolute;top:0;width:100%;}"],n||e,(0,et.xb)(P.ah)),({$backgroundColor:e,$color:t,$dividerColor:n,$compact:i})=>i?(0,L.AH)(["background:",";padding:6px ","px;"],e,P.LW):(0,L.AH)(["background:",";border-top:1px solid ",";padding:16px 10px;"],t||e,(0,ee.b)(n,.25))),ev=(0,L.Ay)(eu).withConfig({componentId:"sc-af4ecd6e-3"})(["margin-right:auto;max-width:220px;"]);function ew(){let e,t=(0,r.c)(3),{activeId:n,closeTooltip:i}=(0,A.useContext)(H.D);return t[0]!==n||t[1]!==i?(e={activeId:n,closeTooltip:i},t[0]=n,t[1]=i,t[2]=e):e=t[2],e}let ej=(0,L.Ay)(J.A).withConfig({componentId:"sc-548d8090-0"})(["align-items:center;display:flex;font-weight:normal;text-align:left;width:100%;"]),eC=(0,L.Ay)(B.A).withConfig({componentId:"sc-548d8090-1"})(["flex-shrink:0;opacity:0.5;"]),ek=e=>{let t,n,o,a,s,l,c=(0,r.c)(22),{action:d,className:u,iconSize:h,size:f,textColor:g,value:p}=e,x=void 0===h?16:h,{colors:m}=(0,A.useContext)(R.k),{performAction:b}=(0,A.useContext)(eh),{closeTooltip:y}=ew();c[0]!==d?(t=eg(d),c[0]=d,c[1]=t):t=c[1];let v=t;c[2]!==d?(n=ex(d),c[2]=d,c[3]=n):n=c[3];let w=n;c[4]!==d||c[5]!==y||c[6]!==b||c[7]!==p?(o=function(){y(),b(d,p)},c[4]=d,c[5]=y,c[6]=b,c[7]=p,c[8]=o):o=c[8];let j=o,C=void 0!==p&&!p;c[9]!==v||c[10]!==x?(a=(0,i.jsx)(eC,{height:x,icon:v,width:x}),c[9]=v,c[10]=x,c[11]=a):a=c[11];let k=g||m.text;return c[12]!==j?(s=()=>j(),c[12]=j,c[13]=s):s=c[13],c[14]!==u||c[15]!==w||c[16]!==f||c[17]!==C||c[18]!==a||c[19]!==k||c[20]!==s?(l=(0,i.jsx)(ej,{className:u,color:"transparent",disabled:C,icon:a,iconLocation:"right",size:f,textColor:k,onClick:s,children:w}),c[14]=u,c[15]=w,c[16]=f,c[17]=C,c[18]=a,c[19]=k,c[20]=s,c[21]=l):l=c[21],l};function eA(e,t=!1){let n=[];return e.forEach(e=>{e.tags.forEach(e=>{(t||0!==e.indexOf("giphy"))&&0>n.indexOf(e)&&n.push(e)})}),n.sort()}let e_=L.Ay.div.withConfig({componentId:"sc-aea1cfc3-0"})(["padding:10px 5px;"]),e$=({actions:e,className:t})=>{let{gifs:n,permissions:r}=(0,A.useContext)(R.k),o=eA(n,r.staff);return(0,i.jsx)(e_,{className:t,children:e.map(e=>(0,i.jsx)(ek,{action:e,size:"small",value:"copy-all-tags"===e?o.join(","):void 0},`edit-panel-ellipsis-menu-${e}`))})};var eI=n(68236),eS=n(30607);let eN=(0,L.Ay)(eS.A).withConfig({componentId:"sc-81a3fe48-0"})(["font-weight:bold;margin:0;padding:0;width:","px;input{padding:0;text-align:center;}"],({$size:e})=>(0,et.uN)(e)),ez=({className:e,color:t,disabled:n,max:r=59,min:o=0,size:a,value:s,onChange:l})=>{let c=(0,A.useMemo)(()=>`${s}`.padStart(2,"0"),[s]);return(0,i.jsx)(eN,{$size:a,className:e,color:t,delay:800,placeholder:"--",selectOnFocus:!0,size:a,tabIndex:n?-1:void 0,value:c,onChange:function(e){if(!e)return;let t=parseInt(e);isNaN(t)?l(o):l(Math.max(o,Math.min(r,t)))},onKeyPress:function(e,t){let n=t?10:1;"ArrowUp"===e&&(s+n>r?l((s+n)%(r+1)+o):l(s+n)),"ArrowDown"===e&&(s-n<o?l(r+s-n-o+1):l(s-n))}})};var eT=n(72594);let eO=L.Ay.div.withConfig({componentId:"sc-76bb5054-0"})(["align-items:center;display:flex;gap:10px;",""],({$disabled:e})=>e&&(0,L.AH)(["opacity:0.5;pointer-events:none;"])),eE=(0,L.Ay)(eT.A).withConfig({componentId:"sc-76bb5054-1"})(["width:65px;"]),eD=L.Ay.div.withConfig({componentId:"sc-76bb5054-2"})(["align-items:center;display:flex;font-weight:bold;gap:0.3em;",""],({$size:e})=>(0,L.AH)(["font-size:","px;"],(0,et.Vd)(e)));function eH(e){let t=e.split(":"),n=0,i=0;t.length>1&&(n=parseInt(t[0]),i=parseInt(t[1])),n=isNaN(n)?0:n,i=isNaN(i)?0:i;let r=`${n}`.padStart(2,"0"),o=`${i}`.padStart(2,"0");return`${r}:${o}`}function eM(e){let t=eH(e).split(":"),n=parseInt(t[0]);return{hours:n%12,minutes:parseInt(t[1]),isPM:n>=12}}let eR=({children:e,className:t,color:n=I.Hi,defaultValue:r="00:00",disabled:o=!1,size:a="small",style:s,toggleColor:l="#fff",value:c,onChange:d})=>{let u=void 0!==c?c:r,h=(0,A.useRef)(eH(u)),f=eM(h.current||"00:00"),[g,p]=(0,A.useState)(f.hours),[x,m]=(0,A.useState)(f.minutes),[b,y]=(0,A.useState)(f.isPM),v=(0,A.useMemo)(()=>(function(e){let{hours:t,minutes:n,isPM:i}=e,r=12===t?0:t;return r+=12*!!i,`${`${r}`.padStart(2,"0")}:${`${n}`.padStart(2,"0")}`})({hours:g,minutes:x,isPM:b}),[g,x,b]),w=0===g?12:g;return(0,A.useEffect)(()=>
1{if(void 0!==c&&c!==v){let e=eM(c);p(e.hours),m(e.minutes),y(e.isPM)}},[c]),(0,A.useEffect)(()=>{v!==h.current&&(h.current=void 0,d?.(v))},[v]),(0,i.jsxs)(eO,{$disabled:o,className:t,style:s,children:[(0,i.jsxs)(eD,{$size:a,children:[(0,i.jsx)(ez,{color:n,disabled:o,max:12,min:1,size:a,value:w,onChange:e=>p(12===e?0:e)}),":",(0,i.jsx)(ez,{color:n,disabled:o,size:a,value:x,onChange:m})]}),(0,i.jsx)(eE,{backgroundColor:"transparent",colorOff:l,colorOn:l,isOn:b,labelOff:"AM",labelOn:"PM",size:"mini",tabIndex:o?-1:void 0,onChange:y}),e]})};var eL=n(22581),eF=n(21239);let eG=L.Ay.div.withConfig({componentId:"sc-ab8fd425-0"})(["align-items:center;display:flex;justify-content:space-between;width:100%;"]),eP=({className:e,size:t="small",toggleColor:n})=>{let{colors:r,selected:o,time:a,setSelected:s,setTime:l,setVisible:c}=(0,A.useContext)(eL.Y);return(0,i.jsxs)(eG,{className:e,style:{color:r.header},children:[(0,i.jsx)(eR,{color:r.button,size:t,toggleColor:n||r.header,value:a,onChange:function(e){l(e),o&&s((0,eF.OY)(o,e))}}),(0,i.jsx)(J.A,{color:r.button,size:t,onClick:function(){let e=new Date;s(e),l((0,eF.Fw)(e)),c(e)},children:"Now"})]})},eU=(0,L.Ay)(eI.A).withConfig({componentId:"sc-38b22ea0-0"})(["padding:20px 15px 15px;"]),eW=L.Ay.div.withConfig({componentId:"sc-38b22ea0-1"})(["display:flex;flex-direction:column;gap:","px;"],P.__),eq=()=>{let{colors:e}=(0,A.useContext)(R.k),{performAction:t}=(0,A.useContext)(eh),[n,r]=(0,A.useState)(),o=new Date,{closeTooltip:a}=ew();return(0,i.jsxs)(eU,{backgroundColor:e.control,buttonColor:e.button,color:e.buttonText,gradient:e.gradient,headerColor:e.header,labelColor:e.buttonText,min:o,size:"small",onChange:r,children:[(0,i.jsx)(eP,{toggleColor:e.text}),(0,i.jsx)(eW,{children:(0,i.jsx)(J.A,{disabled:!n,gradient:e.gradient,size:"medium",onClick:()=>void(n&&(t("schedule",n),a())),children:"Add to Schedule Queue"})})]})},eB=L.Ay.div.withConfig({componentId:"sc-60d7506a-0"})(["display:flex;align-items:center;",""],e=>e.$isCompact?(0,L.AH)(["justify-content:space-between;flex:1;margin-right:12px;"]):(0,L.AH)(["gap:10px;"]));var eV=n(52557);let eJ=(0,L.Ay)(W.A).withConfig({componentId:"sc-eccbe6ea-0"})(["flex-shrink:0;",""],({$borderColor:e,$hasBackground:t})=>t?(0,L.AH)(["margin-left:","px;"],P.LW):(0,L.AH)(["border-bottom:1px solid ",";border-radius:0;"],e)),eY=L.Ay.div.withConfig({componentId:"sc-eccbe6ea-1"})(["background:",";display:flex;position:sticky;top:0;width:100%;"],({$color:e})=>e),eK=(0,L.Ay)(eV.A).withConfig({componentId:"sc-eccbe6ea-2"})(["width:100%;"]),eZ=(0,L.i7)(["0%{opacity:0;}100%{opacity:1;}"]),eX=L.Ay.div.withConfig({componentId:"sc-72321590-0"})(["flex:1;overflow:auto;padding:","px 0;> div{animation:"," 0.15s ease-out;display:flex;flex-direction:column;gap:","px;}"],P.LW,eZ,P.l$),eQ=L.Ay.div.withConfig({componentId:"sc-72321590-1"})(["border-bottom:1px solid ",";"],({$color:e})=>e),e0=(0,L.Ay)(e=>{let t,n,o,a,s,l,c=(0,r.c)(29),{className:d,closeable:u,showCollections:h,onClose:f}=e,g=void 0!==u&&u,p=void 0!==h&&h,{colors:x,tab:m,permissions:b,setTab:y}=(0,A.useContext)(R.k);if(c[0]!==b||c[1]!==p||c[2]!==m){let e;c[5]!==b?(e=e=>(0,Z.BQ)(e,b),c[5]=b,c[6]=e):e=c[6];let i=(p?X:X.filter(e=>"collections"!==e)).filter(e);n=i.map(Q),t=i.indexOf(m),c[0]=b,c[1]=p,c[2]=m,c[3]=t,c[4]=n}else t=c[3],n=c[4];let v=t;return c[7]!==y?(o=e=>y(X[e]),c[7]=y,c[8]=o):o=c[8],c[9]!==x.divider||c[10]!==x.header||c[11]!==x.headerHighlight||c[12]!==x.headerInactive||c[13]!==o||c[14]!==v||c[15]!==n?(a=(0,i.jsx)(eK,{activeColor:x.header,activeBorderColor:x.headerHighlight,color:x.headerInactive,dividerColor:x.divider,index:v,labels:n,size:P.Ad,onChange:o}),c[9]=x.divider,c[10]=x.header,c[11]=x.headerHighlight,c[12]=x.headerInactive,c[13]=o,c[14]=v,c[15]=n,c[16]=a):a=c[16],c[17]!==g||c[18]!==x.divider||c[19]!==x.header||c[20]!==x.headerClose||c[21]!==x.headerCloseIcon||c[22]!==f?(s=g&&(0,i.jsx)(eJ,{$borderColor:x.divider,$hasBackground:!!x.headerClose,color:x.headerClose||"transparent",icon:"close",iconColor:x.headerCloseIcon||x.header,size:P.Ad,onClick:()=>f?.()}),c[17]=g,c[18]=x.divider,c[19]=x.header,c[20]=x.headerClose,c[21]=x.headerCloseIcon,c[22]=f,c[23]=s):s=c[23],c[24]!==d||c[25]!==x.backgroundColor||c[26]!==a||c[27]!==s?(l=(0,i.jsxs)(eY,{$color:x.backgroundColor,className:d,children:[a,s]}),c[24]=d,c[25]=x.backgroundColor,c[26]=a,c[27]=s,c[28]=l):l=c[28],l}).withConfig({componentId:"sc-72321590-2"})(["flex-shrink:0;z-index:1;"]),e1=(0,L.Ay)(({className:e})=>{let{gifs:t,actions:n,colors:r,isCompact:o,permissions:a,tab:s,width:l}=(0,A.useContext)(R.k),c=o||l<700,[d,u]=(0,A.useState)(!1);(0,A.useEffect)(()=>{(async()=>
1{if(t.length>0)try{let e=t.map(e=>String(e.id)),n=await (0,U.w_)(e),i=n.result?.gifs;u(i.some(e=>e.is_trending))}catch(e){console.error("Failed fetching trending status:",e)}})()},[t]);let h=["explicit","repair","remove-all-tags","copy-all-tags","takedown"].filter(e=>(!!navigator.clipboard||"copy-all-tags"!==e&&"copy-gif-id"!==e)&&(0,Z.aF)(e,a)),f=n.map(e=>"trend"===e&&d?"untrend":e);return(0,i.jsxs)(ey,{$backgroundColor:r.backgroundColor,$color:r.footerBackground,$compact:o,$dividerColor:r.divider,className:e,children:[!o&&(0,Z.MC)("privacy",a)&&(0,i.jsx)(ev,{field:"privacy",size:P.ah}),(0,i.jsx)(eB,{$isCompact:o,children:f.map((e,t)=>(0,i.jsxs)(A.Fragment,{children:[c&&"delete"===e&&f.length>1&&(0,i.jsx)(eb,{}),(0,i.jsx)(em,{action:e,iconOnly:c,size:P.ah,children:"schedule"===e?(0,i.jsx)(eq,{}):void 0})]},`edit-panel-footer-${e}-${t}`))}),h.length>0&&(0,i.jsx)(K,{color:"transparent",icon:"ellipsis",iconColor:r.footerEllipsis,iconOnly:!0,iconScale:1.1,label:"More Options",size:P.ah,style:0===n.length?{marginLeft:"auto"}:void 0,tooltipWidth:P.fu,children:(0,i.jsx)(e$,{actions:h})})]})}).withConfig({componentId:"sc-72321590-3"})(["flex-shrink:0;margin-top:auto;z-index:1;"]),e2=L.Ay.div.withConfig({componentId:"sc-72321590-4"})(["background:",";box-sizing:border-box;color:",";display:flex;flex-direction:column;font-size:15px;min-height:100%;position:relative;overflow:auto;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}scrollbar-width:none;-ms-overflow-style:none;*::-webkit-scrollbar{display:none;}",""],({$color:e})=>e,({$textColor:e})=>e,({$compact:e})=>!e&&(0,L.AH)(["","{padding:","px ","px;}","{margin-top:","px;padding:0 ","px;}"],eX,P.l$,P.LW,e0,P.LW,P.LW)),e3=(0,L.Ay)(e=>{let t,n,o=(0,r.c)(4),{className:a}=e,{colors:s}=(0,A.useContext)(R.k);return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(F.A,{size:"medium",type:"blocks"}),o[0]=t):t=o[0],o[1]!==a||o[2]!==s.backgroundColor?(n=(0,i.jsx)(G,{$backgroundColor:s.backgroundColor,className:a,children:t}),o[1]=a,o[2]=s.backgroundColor,o[3]=n):n=o[3],n}).withConfig({componentId:"sc-72321590-5"})(["height:100%;left:0;position:absolute;top:0;width:100%;z-index:1;"]);var e5=n(23892),e4=n(56215);let e7=(0,L.Ay)(B.A).withConfig({componentId:"sc-6778d474-0"})(["flex-shrink:0;margin:0 2px;transition:all 0.15s ease-out;",""],({$open:e})=>e?(0,L.AH)(["rotate:-180deg;"]):(0,L.AH)(["opacity:0.5;"])),e6=(0,L.Ay)(B.A).withConfig({componentId:"sc-6778d474-1"})(["flex-shrink:0;"]),e8=L.Ay.button.withConfig({componentId:"sc-6778d474-2"})(["all:unset;align-items:center;cursor:pointer;display:flex;font-weight:bold;gap:6px;line-height:normal;user-select:none;white-space:nowrap;&:active{opacity:0.8;}&:focus-visible{border-radius:4px;outline:2px solid ",";}",""],I.aw,({$disabled:e})=>e&&(0,L.AH)(["pointer-events:none;"])),e9=(0,L.i7)(["0%{opacity:0;}100%{opacity:1;}"]),te=L.Ay.div.withConfig({componentId:"sc-227d578b-0"})(["display:grid;gap:6px;grid-template-columns:1fr;"]),tt=L.Ay.div.withConfig({componentId:"sc-227d578b-1"})(["min-width:0;",""],({$ignoreAnimation:e})=>!e&&(0,L.AH)(["animation:"," 0.15s ease-out;"],e9)),tn=L.Ay.div.withConfig({componentId:"sc-227d578b-2"})(["align-items:center;color:",";display:flex;font-size:13px;gap:6px;min-height:","px;"],({$color:e})=>e,(0,et.uN)("mini")),ti=(0,L.Ay)(({arrowColor:e,children:t,className:n,disabled:r=!1,icon:o,iconColor:a,open:s,onToggle:l})=>(0,i.jsxs)(e8,{$disabled:r,as:r?"div":void 0,className:n,onClick:()=>l(!s),children:[o&&(0,i.jsx)(e6,{color:a,height:16,icon:o,width:16}),t,!r&&(0,i.jsx)(e7,{$open:s,color:e,height:14,icon:"navigate-down",width:14})]})).withConfig({componentId:"sc-227d578b-3"})(["margin-right:auto;"]),tr=({arrowColor:e=I.jI,children:t,className:n,color:r=I.nU,defaultOpen:o=!1,disabled:a=!1,icon:s,iconColor:l=I.Zf,open:c,title:d,titleComponent:u,style:h,onToggle:f})=>{let g=(0,A.useRef)(c||o),[p,x]=(0,A.useState)(c||o);return(0,A.useEffect)(()=>{void 0!==c&&x(c)},[c]),(0,A.useEffect)(()=>{p!==g.current&&(g.current=void 0,f?.(p))},[p]),(0,i.jsxs)(te,{className:n,style:h,children:[(0,i.jsxs)(tn,{$color:r,children:[(0,i.jsx)(ti,{arrowColor:e,disabled:a,icon:s,iconColor:l,open:p,onToggle:x,children:d}),u]}),p?(0,i.jsx)(tt,{$ignoreAnimation:!!g.current,children:t}):null]})},to=(0,A.lazy)(()=>n.e(7250).then(n.bind(n,77250))),ta=(0,A.lazy)(()=>n.e(2825).then(n.bind(n,92825))),ts=({field:e,isFieldOpen:t})=>(0,i.jsx)(A.Suspense,{children:function(){switch(e){case"source":return(0,i.jsx)(to,{isFieldOpen:t});case"username":return(0,i.jsx)(ta,{});default:return null}}()}),tl=(0,L.Ay)(eu).withConfig({componentId:"sc-1ca112c1-0"})(["div:has(+ &){margin-right:0;}"]),tc=L.Ay.div.withConfig({componentId:"sc-1ca112c1-1"})(["display:flex;flex-direction:column;gap:","px;"],P.__),td=({className:e,defaultOpen:t=!1,field:n})=>{let{colors:r,isCompact:o}=(0,A.useContext)(R.k),[a,s]=(0,A.useState)(t),l=(0,e5.e4)(n),c=(0,e5.FJ)(n),d=(0,e5.mo)(n,o);return(0,i.jsx)(tr,{arrowColor:r.labelArrow||r.labelIcon,className:e,color:r.label,defaultOpen:t,disabled:d,icon:l,iconColor:r.labelIcon,title:c,titleComponent:(0,i.jsxs)(i.Fragment,{children:[d&&(0,i.jsx)(tl,{field:n}),(0,i.jsx)(ts,{field:n,isFieldOpen:a})]}),onToggle:s,children:!d&&(0,i.jsx)(tc,{children:(0,i.jsx)(tl,{field:n})})})},tu=L.Ay.div.withConfig({componentId:"sc-7dee2e7d-0"})(["display:flex;flex-direction:column;gap:","px;width:100%;"],P.LW);L.Ay.div.withConfig({componentId:"sc-7dee2e7d-1"})(["display:flex;flex-direction:column;gap:","px;"],P.__);let th=e=>{let t,n,o,a,s=(0,r.c)(18),{className:l}=e,{colors:c,fields:d,gifs:u,isCompact:h}=(0,A.useContext)(R.k);
1s[0]!==u?(t=(0,e4._Z)(u),s[0]=u,s[1]=t):t=s[1];let f=t;if(s[2]!==f||s[3]!==d){let e;s[5]!==f?(e=e=>(0,e5.dc)(e).indexOf(f)>-1,s[5]=f,s[6]=e):e=s[6],n=d.filter(e),s[2]=f,s[3]=d,s[4]=n}else n=s[4];let g=n;if(s[7]!==c||s[8]!==g||s[9]!==h){let e;s[11]!==c||s[12]!==g.length||s[13]!==h?(e=(e,t)=>{let n=(0,e5.WF)(e)||g.length<3;return(0,i.jsxs)(A.Fragment,{children:[(0,i.jsx)(td,{defaultOpen:n,field:e}),h&&"description"===e&&(0,i.jsx)(eQ,{$color:c.divider})]},`edit-panel-field-${e}-${t}`)},s[11]=c,s[12]=g.length,s[13]=h,s[14]=e):e=s[14],o=g.map(e),s[7]=c,s[8]=g,s[9]=h,s[10]=o}else o=s[10];return s[15]!==l||s[16]!==o?(a=(0,i.jsx)(tu,{className:l,children:o}),s[15]=l,s[16]=o,s[17]=a):a=s[17],a};var tf=n(89149),tg=n(67082),tp=n(81522),tx=n(62922);let tm=L.Ay.div.withConfig({componentId:"sc-1d2144e0-0"})(["display:flex;gap:","px;margin-bottom:15px;"],P.__),tb=L.Ay.div.withConfig({componentId:"sc-1d2144e0-1"})(["display:flex;flex-wrap:wrap;gap:","px;"],P.__),ty=(0,L.Ay)(tx.A).withConfig({componentId:"sc-1d2144e0-2"})(["max-height:300px;overflow:auto;padding:0;width:100%;"]),tv=L.Ay.p.withConfig({componentId:"sc-1d2144e0-3"})(["color:",";font-size:13px;margin:8px 0 0;opacity:",";"],({$error:e})=>e?"#ff6666":"inherit",({$error:e})=>e?1:.7),tw=()=>{let{addGifLabel:e,fetchGifLabels:t,removeGifLabel:n}=(0,A.useContext)(tp.s),{colors:r,gifIds:o,permissions:a}=(0,A.useContext)(R.k),[s,l]=(0,A.useState)(),[c,d]=(0,A.useState)(""),[u,h]=(0,A.useState)(!1),[f,g]=(0,A.useState)(""),p=o.join(",");(0,A.useEffect)(()=>{if(!a.labels||0===o.length)return;let e=!0;return l(void 0),d(""),t(o).then(t=>e&&l(t)).catch(()=>e&&d("Unable to load content labels.")),()=>{e=!1}},[t,p,a.labels]);let x=(0,A.useMemo)(()=>{let e=new Map;return Object.values(s?.gif_labels||{}).forEach(t=>{t.forEach(t=>{let n=e.get(t.id);e.set(t.id,{...t,count:(n?.count||0)+1})})}),Array.from(e.values()).sort((e,t)=>e.name.localeCompare(t.name))},[s]),m=(0,A.useMemo)(()=>s?.available_labels.filter(e=>o.some(t=>!(s.gif_labels[t]||[]).some(({id:t})=>t===e.id)))||[],[s,o]);if(!a.labels)return null;let b=(e,t,n)=>{l(i=>{if(!i)return i;let r={...i.gif_labels};return t.forEach(t=>{let i=r[t]||[];r[t]=n?i.some(({id:t})=>t===e.id)?i:[...i,e]:i.filter(({id:t})=>t!==e.id)}),{...i,gif_labels:r}})},y=async()=>{if(!s||!f||u)return;let t=s.available_labels.find(({id:e})=>e===Number(f));if(!t)return;let n=o.filter(e=>!(s.gif_labels[e]||[]).some(({id:e})=>e===t.id));if(0!==n.length){h(!0),d("");try{await e(n,t.id),b(t,n,!0),g("")}catch{d("Unable to add the content label.")}finally{h(!1)}}},v=async e=>{if(!s||u)return;let t=o.filter(t=>(s.gif_labels[t]||[]).some(({id:t})=>t===e.id));h(!0),d("");try{await n(t,e.id),b(e,t,!1)}catch{d("Unable to remove the content label.")}finally{h(!1)}};return(0,i.jsxs)(tr,{arrowColor:r.labelArrow||r.labelIcon,color:r.label,defaultOpen:!0,icon:"tag",iconColor:r.labelIcon,title:"Content Labels",children:[(0,i.jsxs)(tm,{children:[(0,i.jsx)(tf.A,{color:r.input,disabled:!s||u,label:m.find(({id:e})=>e===Number(f))?.name||"Add Content Label",size:P.oK,style:{flex:1},textColor:r.backgroundColor,children:(0,i.jsx)(ty,{activeColor:r.button,iconColor:r.buttonText,index:m.findIndex(({id:e})=>e===Number(f)),options:m.map(({name:e})=>e),textColor:r.buttonText,onChange:e=>g(String(m[e].id))})}),(0,i.jsx)(J.A,{color:r.button,disabled:!f||u||0===m.length,loading:u,size:P.oK,textColor:r.buttonText,"aria-label":"Add content label",onClick:y,children:"Add"})]}),(0,i.jsx)(tb,{children:x.map(e=>(0,i.jsxs)(tg.A,{color:e.count===o.length?r.sharedTag:r.control,removeable:!u,removeOptions:{title:`Remove ${e.name}`},round:!0,size:P.oK,onRemove:()=>v(e),children:[e.name,o.length>1?` (${e.count}/${o.length})`:""]},e.id))}),!s&&!c&&(0,i.jsx)(tv,{children:"Loading content labels…"}),s&&0===x.length&&(0,i.jsx)(tv,{children:"No content labels attached."}),c&&(0,i.jsx)(tv,{$error:!0,children:c})]})};var tj=n(49525);function tC(e,t){return new Intl.NumberFormat("en-US",{notation:t?"compact":"standard",maximumFractionDigits:t?1:void 0}).format(e)}var tk=n(90203);let tA=(0,L.AH)(["border-radius:inherit;height:100%;width:100%;"]),t_=L.Ay.div.withConfig({componentId:"sc-9d675fdf-0"})([""," pointer-events:none;position:relative;"],tA),t$=L.Ay.div.withConfig({componentId:"sc-9d675fdf-1"})([""," box-shadow:0px 4px 8px 0px rgba(33,37,41,0.30);left:0;position:absolute;top:0;",""],tA,({$gradient:e})=>(0,L.AH)(["background:",";"],(0,tk.$_)(e))),tI=["pink-red","red-yellow","blue-green"],tS=3*tI.length;var tN=n(16496);let tz=L.Ay.img.withConfig({componentId:"sc-15470b49-0"})(["border-radius:inherit;display:block;",""],({$sticker:e})=>e&&(0,L.AH)(["background-color:#000;background-image:linear-gradient(45deg,#0e0e0e 25%,transparent 25%,transparent 75%,#0e0e0e 75%),linear-gradient(45deg,#0e0e0e 25%,transparent 25%,transparent 75%,#0e0e0e 75%);background-size:24px 24px;background-position:0 0,12px 12px;"])),tT=({gif:e,height:t,width:n})=>{let r=(0,A.useMemo)(()=>(0,tN.k9)(e,n,t),[e.id,t,n]);return(0,i.jsx)(tz,{$sticker:e.is_sticker,alt:"",src:r,style:{height:t,width:n}})},tO=L.Ay.div.withConfig({componentId:"sc-fed221a4-0"})(["align-items:center;border-radius:inherit;display:flex;height:100%;justify-content:center;position:relative;width:100%;"]);L.Ay.img.withConfig({componentId:"sc-fed221a4-1"})(["border-radius:inherit;display:block;",""],({$sticker:e})=>e&&(0,L.AH)(["background-color:#000;background-image:linear-gradient(45deg,#0e0e0e 25%,transparent 25%,transparent 75%,#0e0e0e 75%),linear-gradient(45deg,#0e0e0e 25%,transparent 25%,transparent 75%,#0e0e0e 75%);background-size:24px 24px;background-position:0 0,12px 12px;"]));let tE=(0,L.Ay)(W.A).withConfig({componentId:"sc-2bc3cf02-0"})(["filter:drop-shadow(0px 3px 6px rgba(33,37,41,0.7));left:","px;position:absolute;top:","px;"],3,3),tD=L.Ay.video.withConfig({componentId:"sc-2bc3cf02-1"})(["border-radius:inherit;display:block;height:100%;pointer-events:none;width:100%;"]),tH=L.Ay.div.withConfig({componentId:"sc-2bc3cf02-2"})(["border-radius:inherit;position:relative;"]),tM=({gif:e,height:t,muteColor:n,muteSize:r,width:o})=>{let[a,s]=(0,A.useState)(!0),l=(0,A.useMemo)(()=>(0,tN.sr)(e.video,o,t)?.url||"",[e.id,t,o]);return(0,i.jsxs)(tH,{style:{height:t,width:o},children:[(0,i.jsx)(tD,{autoPlay:!0,loop:!0,muted:a,src:l}),(0,i.jsx)(tE,{color:"transparent",icon:a?"sound-off":"sound-on",iconColor:n,size:r,onClick:()=>s(!a)})]})},tR=({backgroundColor:e,children:t,className:n,gif:r,height:o,muteColor:a,muteSize:s,width:l})=>{let c=r.images.original.width/r.images.original.height,d="video"===r.type&&!!r.video,[u,h]=(0,A.useMemo)(()=>{let e=l,t=Math.round(e/c);return t>o&&(e=Math.round((t=o)*c)),[e,t]},[c,o,l]);return(0,i.jsxs)(tO,{className:n,style:{backgroundColor:e,height:o,width:l},children:[d?(0,i.jsx)(tM,{gif:r,height:h,muteColor:a,muteSize:s,width:u}):(0,i.jsx)(tT,{gif:r,height:h,width:u}),t]})};var tL=n(70380);let tF=(0,L.Ay)(tL.A).withConfig({componentId:"sc-2654d5c0-0"})(["box-shadow:0px 3px 6px 0px rgba(33,37,41,0.3);"]),tG=(0,L.Ay)(({className:e})=>(0,i.jsx)(t_,{className:e,children:[...tI].reverse().map((e,t)=>{let n=(tI.length-t)*3;return(0,i.jsx)(t$,{$gradient:e,style:{translate:`${n}px ${n}px`}},`media-preview-cascade-${e}-${t}`)})})).withConfig({componentId:"sc-2654d5c0-1"})(["left:0;position:absolute;top:0;"]),tP=L.Ay.div.withConfig({componentId:"sc-2654d5c0-2"})(["border-radius:4px;box-sizing:border-box;position:relative;","{position:absolute;right:","px;top:","px;}",""],tF,3,3,({$bulk:e})=>e&&(0,L.AH)(["margin-bottom:","px;margin-right:","px;"],tS,tS)),tU=({backgroundColor:e="#000",badgeColor:t=I.aw,badgeSize:n="medium",children:o,className:a,gifs:s,height:l,muteColor:c="#fff",style:d,width:u})=>{let h=(0,A.useRef)((0,V.$C)("media-preview-")),f=s[0],g=s.length>1,p=function(e,t,n,i){let o,a=(0,r.c)(6),s=void 0!==i&&i,l=e-(s?tS:0),c=t-(s?tS:0);if(s&&l/n-c<12){let e;a[0]!==n||a[1]!==l?(e=Math.round(l/n),a[0]=n,a[1]=l,a[2]=e):e=a[2],c=e}return a[3]!==c||a[4]!==l?(o={height:c,width:l},a[3]=c,a[4]=l,a[5]=o):o=a[5],o}(u,l,f.images.original.width/f.images.original.height,g);return(0,i.jsxs)(tP,{$bulk:g,className:a,style:d,children:[g&&(0,i.jsx)(tG,{}),(0,i.jsxs)(tR,{backgroundColor:e,gif:f,height:p.height,muteColor:c,muteSize:n,width:p.width,children:[g&&(0,i.jsx)(tF,{color:t,size:n,children:s.length}),o]},`${h.current}-${f.id}`)]})},tW=L.Ay.div.withConfig({componentId:"sc-f7d2f0c-0"})(["align-items:center;display:flex;gap:","px;padding-top:","px;width:100%;"],P.LW,P.LW),tq=(0,L.Ay)(tU).withConfig({componentId:"sc-f7d2f0c-1"})(["border-radius:","px;"],(0,et.xb)(P.oK)),tB=(0,L.Ay)(B.A).withConfig({componentId:"sc-f7d2f0c-2"})(["margin-right:6px;"]),tV=L.Ay.div.withConfig({componentId:"sc-f7d2f0c-3"})(["align-items:center;display:flex;flex-shrink:0;&:only-child{margin-left:auto;}"]),tJ=L.Ay.div.withConfig({componentId:"sc-c9ad7f32-0"})(["display:flex;flex-direction:column;gap:","px;"],P.LW),tY=(0,L.Ay)(({className:e})=>{var t;let n,r,{fetchViewCount:o}
1=(0,A.useContext)(tp.s),{colors:a,gifs:s,isCompact:l,permissions:c,width:d}=(0,A.useContext)(R.k),[u,h]=(0,A.useState)(),f=l?d:P.mq,g=(0,A.useMemo)(()=>`${tC(u||0)} Views`,[u,l]),p=(0,A.useMemo)(()=>`${tC(u||0,!0)}${l?"":" Views"}`,[u,l]),x=(0,A.useMemo)(()=>s.map(e=>e.id).join(","),[s]);return(0,tj.A)(async()=>{let e=!1;try{if(0===s.length){e||h(0);return}let t=s[0],n=await o(`${t.id}`);e||h(n||0)}catch(t){e||console.error("error fetching count",t)}return()=>{e=!0}},[x]),(0,i.jsxs)("div",{className:e,children:[(0,i.jsx)(tq,{backgroundColor:a.controlDark,badgeColor:a.badgeColor,gifs:s,height:(t=s[0],n=t.images.original.width/t.images.original.height,r=Math.min(P.Qp,Math.round(f/n)),f-Math.round(r*n)<20&&(r=Math.round(P.mq/n)),r),width:f}),(0,i.jsxs)(tW,{children:[l&&(0,Z.MC)("privacy",c)&&(0,i.jsx)(eu,{field:"privacy",size:P.Gj}),"number"==typeof u&&(0,i.jsxs)(tV,{title:g,children:[(0,i.jsx)(tB,{color:a.labelIcon,icon:"view",height:20,width:20}),p]})]})]})}).withConfig({componentId:"sc-c9ad7f32-1"})(["flex-shrink:0;"]),tK=L.Ay.div.withConfig({componentId:"sc-c9ad7f32-2"})(["display:flex;",""],({$compact:e})=>e?(0,L.AH)(["flex-direction:column;gap:inherit;","{max-width:none;}"],tY):(0,L.AH)(["flex-direction:row-reverse;gap:","px;"],P.l$));function tZ(e){switch(e){case"ar":return["\uD83C\uDDF8\uD83C\uDDE6","Arabic"];case"bn":return["\uD83C\uDDE7\uD83C\uDDE9","Bengali"];case"cs":return["\uD83C\uDDE8\uD83C\uDDFF","Czech"];case"da":return["\uD83C\uDDE9\uD83C\uDDF0","Danish"];case"de":return["\uD83C\uDDE9\uD83C\uDDEA","German"];case"en":return["\uD83C\uDDEC\uD83C\uDDE7","English"];case"es":return["\uD83C\uDDEA\uD83C\uDDF8","Spanish"];case"fa":return["\uD83C\uDDEE\uD83C\uDDF7","Farsi"];case"fi":return["\uD83C\uDDEB\uD83C\uDDEE","Finnish"];case"fr":return["\uD83C\uDDEB\uD83C\uDDF7","French"];case"hi":return["\uD83C\uDDEE\uD83C\uDDF3","Hindi"];case"hu":return["\uD83C\uDDED\uD83C\uDDFA","Hungarian"];case"id":return["\uD83C\uDDEE\uD83C\uDDE9","Indonesian"];case"it":return["\uD83C\uDDEE\uD83C\uDDF9","Italian"];case"iw":return["\uD83C\uDDEE\uD83C\uDDF1","Hebrew"];case"ja":return["\uD83C\uDDEF\uD83C\uDDF5","Japanese"];case"ko":return["\uD83C\uDDF0\uD83C\uDDF7","Korean"];case"ms":return["\uD83C\uDDF2\uD83C\uDDFE","Malay"];case"nl":return["\uD83C\uDDF3\uD83C\uDDF1","Dutch"];case"no":return["\uD83C\uDDF3\uD83C\uDDF4","Norwegian"];case"pl":return["\uD83C\uDDF5\uD83C\uDDF1","Polish"];case"pt":return["\uD83C\uDDF5\uD83C\uDDF9","Portuguese"];case"ro":return["\uD83C\uDDF7\uD83C\uDDF4","Romanian"];case"ru":return["\uD83C\uDDF7\uD83C\uDDFA","Russian"];case"sv":return["\uD83C\uDDF8\uD83C\uDDEA","Swedish"];case"th":return["\uD83C\uDDF9\uD83C\uDDED","Thai"];case"tl":return["\uD83C\uDDF5\uD83C\uDDED","Tagalog"];case"tr":return["\uD83C\uDDF9\uD83C\uDDF7","Turkish"];case"uk":return["\uD83C\uDDFA\uD83C\uDDE6","Ukranian"];case"vi":return["\uD83C\uDDFB\uD83C\uDDF3","Vietnamese"];case"zh-CN":return["\uD83C\uDDE8\uD83C\uDDF3","Chinese Simplified"];case"zh-TW":return["\uD83C\uDDF9\uD83C\uDDFC","Chinese Traditional"]}}function tX(e){return e.trim().replace(/#/g,"").toLowerCase()}let tQ=L.Ay.div.withConfig({componentId:"sc-6b941c51-0"})(["display:flex;gap:","px;margin-bottom:15px;"],P.__),t0=(0,L.Ay)(e=>{let t,n,o,a=(0,r.c)(22),{allowGiphyTags:s,autoFocus:l,buttonColor:c,buttonGradient:d,buttonIconColor:u,children:h,className:f,color:g,defaultValue:p,disabled:x,placeholder:m,size:b,style:y,onAdd:v}=e,w=void 0!==s&&s,j=void 0===c?I.Fl:c,C=void 0===g?"#fff":g,k=void 0===m?"Add Tags":m,_=(0,A.useRef)(null),[$,S]=(0,A.useState)(void 0===p?"":p);a[0]!==w||a[1]!==v||a[2]!==$?(t=function(){if(!$)return;let e=$.split(",").map(tX),t=e.filter((t,n)=>t.length>0&&e.indexOf(t)===n).filter(e=>w||0!==e.indexOf("giphy"));S(`${e}`),_.current?.focus(),v?.(t)},a[0]=w,a[1]=v,a[2]=$,a[3]=t):t=a[3];let N=t;return a[4]!==j||a[5]!==d||a[6]!==u||a[7]!==N||a[8]!==b?(n=(0,i.jsx)(W.A,{color:j,gradient:d,icon:"add",iconColor:u,size:b,onClick:N}),a[4]=j,a[5]=d,a[6]=u,a[7]=N,a[8]=b,a[9]=n):n=a[9],a[10]!==l||a[11]!==h||a[12]!==f||a[13]!==C||a[14]!==x||a[15]!==N||a[16]!==k||a[17]!==b||a[18]!==y||a[19]!==n||a[20]!==$?(o=(0,i.jsxs)(eS.A,{autoFocus:l,className:f,color:C,disabled:x,placeholder:k,ref:_,size:b,spell
1Check:!0,style:y,value:$,onChange:S,onEnterKeyPress:N,children:[h,n]}),a[10]=l,a[11]=h,a[12]=f,a[13]=C,a[14]=x,a[15]=N,a[16]=k,a[17]=b,a[18]=y,a[19]=n,a[20]=$,a[21]=o):o=a[21],o}).withConfig({componentId:"sc-6b941c51-1"})(["width:100%;> button{border-bottom-left-radius:0;border-top-left-radius:0;}"]),t1=({children:e,className:t,language:n})=>{let{colors:r,permissions:o}=(0,A.useContext)(R.k),{performAction:a}=(0,A.useContext)(eh),s=`Add Tags${n?` (${tZ(n)[1]})`:""}`;return(0,i.jsx)(tQ,{className:t,children:(0,i.jsx)(t0,{allowGiphyTags:o.staff,buttonColor:r.button,buttonIconColor:r.buttonText,color:r.input,placeholder:s,size:P.oK,onAdd:function(e){a("add-tags",e.map(e=>({language:n,text:e})))},children:e})})},t2=["en","ko","pt","ru","es","ja","ar","bn","zh-CN","zh-TW","cs","da","nl","fa","fi","fr","de","iw","hi","hu","id","it","ms","no","pl","ro","sv","th","tl","tr","uk","vi"],t3=(0,L.Ay)(K).withConfig({componentId:"sc-d7ed9694-0"})(["border-radius:0;flex-shrink:0;font-size:1.25em;padding:0;"]),t5=L.Ay.span.withConfig({componentId:"sc-d7ed9694-1"})(["font-size:13px;opacity:0.5;"]),t4=(0,L.Ay)(tx.A).withConfig({componentId:"sc-d7ed9694-2"})(["max-height:300px;overflow:auto;padding:0;width:100%;"]),t7=({className:e,defaultValue:t="en",onChange:n})=>{let r=(0,A.useRef)(t),{colors:o}=(0,A.useContext)(R.k),[a,s]=(0,A.useState)(t),{closeTooltip:l}=ew(),c=t2.indexOf(a);return(0,A.useEffect)(()=>{a!==r.current&&(r.current=void 0,n("en"===a?void 0:a))},[a]),(0,i.jsx)(t3,{className:e,color:o.input,label:tZ(a)[0],size:P.oK,title:`${tZ(a)[1]} (${a})`,children:(0,i.jsx)(t4,{iconColor:o.headerHighlight,index:c,options:t2.map(e=>(0,i.jsxs)("span",{children:[tZ(e)[1]," ",(0,i.jsxs)(t5,{children:["(",e,")"]})]})),onChange:function(e){e!==c&&(s(t2[e]),l())}})})},t6="giphygpsnotrend",t8="giphytrending",t9="giphytrendingqueue",ne="blue-green",nt=L.Ay.span.withConfig({componentId:"sc-89bc179b-0"})(["align-items:center;box-sizing:border-box;cursor:pointer;display:flex;user-select:none;"," ",""],({$removeable:e,$size:t})=>(0,L.AH)(["border-radius:","px;height:","px;padding:0 ","em 0 0.8em;border-right:solid 1px rgb(0,0,0,0.2);"],(0,et.xb)(t),(0,et.uN)(t),.8*!e),({$removeable:e})=>e&&(0,L.AH)(["border-bottom-right-radius:0;border-top-right-radius:0;"])),nn=L.Ay.span.withConfig({componentId:"sc-89bc179b-1"})(["display:inline-block;font-size:13px;margin-left:0.4em;opacity:0.5;pointer-events:none;user-select:none;margin-right:12px;"]),ni=L.Ay.p.withConfig({componentId:"sc-89bc179b-2"})(["margin-right:10px;"]),nr=L.Ay.span.withConfig({componentId:"sc-89bc179b-3"})(["display:inline-block;margin-right:0.2em;opacity:0.5;pointer-events:none;user-select:none;vertical-align:middle;"]),no=(0,L.Ay)(tg.A).withConfig({componentId:"sc-89bc179b-4"})([""," ",""],({$highlighted:e,$highlightColor:t})=>e&&(0,L.AH)(["box-shadow:inset 0 0 0 2px ",";"],t),({$clickable:e})=>e&&(0,L.AH)(["padding:0;&:has(",":focus-visible){outline:2px solid ",";}&:has(",":active){opacity:0.8;}button:active{opacity:0.6;}"],nt,I.aw,nt)),na=e=>{let t,n,o,a,s,l,c,d,u,h=(0,r.c)(37),{className:f,color:g,count:p,featured:x,featureable:m,highlightColor:b,highlighted:y,removeable:v,size:w,style:j,text:C,onFeature:k,onRemove:_}=e,$=void 0===g?I.Hi:g,S=void 0!==x&&x,N=void 0!==m&&m,z=void 0===b?I.eZ:b,T=void 0!==v&&v,O=(0,A.useRef)(null),E=S?ne:void 0,[D,H]=(0,A.useState)(E);e:{let e;if("number"!=typeof p){t="";break e}h[0]!==p?(e=new Intl.NumberFormat("en-US").format(p),h[0]=p,h[1]=e):e=h[1],t=e}let M=t;h[2]!==S||h[3]!==k?(n=function(e){"Enter"===e.key&&k?.(!S)},h[2]=S,h[3]=k,h[4]=n):n=h[4];let R=n;h[5]!==E?(o=function(){H(E)},h[5]=E,h[6]=o):o=h[6];let L=o;h[7]!==S?(a=function(e){e.target===O.current?S||H(ne):H("red-pink")},h[7]=S,h[8]=a):a=h[8];let F=a;h[9]!==E?(s=()=>{H(E)},h[9]=E,h[10]=s):s=h[10],h[11]!==S?(l=[S],h[11]=S,h[12]=l):l=h[12],(0,A.useEffect)(s,l);let G=!D&&void 0!==y&&y;h[13]===Symbol.for("react.memo_cache_sentinel")?(c={title:"Remove Tag"},h[13]=c):c=h[13];let P=N?L:void 0,U=N?F:void 0;return h[14]!==M||h[15]!==N||h[16]!==S||h[17]!==k||h[18]!==R||h[19]!==T||h[20]!==w||h[21]!==C?(d=N?(0,i.jsxs)(nt,{$removeable:T,$
1size:w,ref:O,tabIndex:1,title:`${S?"Unfeature":"Feature"} Tag`,onClick:()=>k?.(!S),onKeyDown:R,children:[(0,i.jsx)(nr,{children:"#"}),M?(0,i.jsx)("p",{children:C}):(0,i.jsx)(ni,{children:C}),M?(0,i.jsxs)(nn,{children:["(",M,")"]}):null]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nr,{children:"#"}),C,M?(0,i.jsxs)(nn,{children:["(",M,")"]}):null]}),h[14]=M,h[15]=N,h[16]=S,h[17]=k,h[18]=R,h[19]=T,h[20]=w,h[21]=C,h[22]=d):d=h[22],h[23]!==f||h[24]!==$||h[25]!==N||h[26]!==D||h[27]!==z||h[28]!==_||h[29]!==T||h[30]!==w||h[31]!==j||h[32]!==G||h[33]!==P||h[34]!==U||h[35]!==d?(u=(0,i.jsx)(no,{$clickable:N,$highlighted:G,$highlightColor:z,className:f,color:$,gradient:D,removeable:T,removeOptions:c,round:!0,size:w,style:j,onMouseOut:P,onMouseOver:U,onRemove:_,children:d}),h[23]=f,h[24]=$,h[25]=N,h[26]=D,h[27]=z,h[28]=_,h[29]=T,h[30]=w,h[31]=j,h[32]=G,h[33]=P,h[34]=U,h[35]=d,h[36]=u):u=h[36],u},ns=(0,A.createContext)({}),nl=L.Ay.div.withConfig({componentId:"sc-a5f20682-0"})(["display:flex;flex-wrap:wrap;gap:","px;",""],P.__,({$compact:e})=>e&&(0,L.AH)(["> div{width:100%;}"])),nc=({className:e,language:t})=>{let{fetchLanguageTags:n}=(0,A.useContext)(tp.s),{colors:o,gifs:a,gifIds:s,isCompact:l,permissions:c}=(0,A.useContext)(R.k),{performAction:d}=(0,A.useContext)(eh),[u,h]=(0,A.useState)([]),f=function(){let e,t,n,i,o=(0,r.c)(16),{fetchTagCounts:a}=(0,A.useContext)(tp.s),{showErrorMessage:s}=(0,A.useContext)(ns),{gifs:l,gifIds:c,permissions:d}=(0,A.useContext)(R.k);o[0]===Symbol.for("react.memo_cache_sentinel")?(e={},o[0]=e):e=o[0];let[u,h]=(0,A.useState)(e);o[1]!==l||o[2]!==d.staff?(t=eA(l,d.staff).join(","),o[1]=l,o[2]=d.staff,o[3]=t):t=o[3];let f=t,g=d.tagCounts||d.staff;return o[4]!==a||o[5]!==c[0]||o[6]!==l.length||o[7]!==g||o[8]!==s||o[9]!==f?(n=async()=>{if(g&&1===l.length&&f)try{let e=await a(c[0]);h(e)}catch(e){s("An error occurred while fetching tag counts")}},o[4]=a,o[5]=c[0],o[6]=l.length,o[7]=g,o[8]=s,o[9]=f,o[10]=n):n=o[10],o[11]!==c[0]||o[12]!==l.length||o[13]!==d.staff||o[14]!==f?(i=[c[0],l.length,d.staff,f],o[11]=c[0],o[12]=l.length,o[13]=d.staff,o[14]=f,o[15]=i):i=o[15],(0,tj.A)(n,i),u}(),g=eA(a,c.staff).join(", "),p=(0,Z.aF)("feature-tag",c),x=(0,Z.aF)("remove-tag",c);async function m(){if(!t)return void console.warn("No language provided, exiting function");try{let e,i,r=await n(s,t);h((i=(e=r.flatMap(e=>"tags"in e&&Array.isArray(e.tags)?e.tags:[])).map(e=>e.text),e.filter((e,t)=>i.indexOf(e.text)===t).sort((e,t)=>e.text.localeCompare(t.text)).map(t=>({featured:!1,shared:s.length>1&&s.every(n=>e.findIndex(e=>e.gifId===n)>-1&&e.findIndex(e=>e.text===t.text)>-1),text:t.text||""}))))}catch(e){console.error("Error fetching or processing language tags:",e)}}async function b(e){await d("remove-tag",{language:t,text:e}),m()}return(0,tj.A)(async()=>{t&&"en"!==t?m():h(function(e,t=!1){return eA(e,t).map(t=>({featured:e.every(e=>(e.featured_tags||[]).indexOf(t)>-1),shared:e.length>1&&e.every(e=>e.tags.indexOf(t)>-1),text:t}))}(a,c.staff))},[s,t,c.staff,g]),(0,i.jsx)(nl,{$compact:l,className:e,children:u.map((e,n)=>(0,i.jsx)(na,{color:o.control,count:f[e.text],featured:e.featured,featureable:p&&!t,highlighted:e.shared,highlightColor:o.sharedTag,removeable:x,size:P.oK,text:e.text,onFeature:t=>{d(t?"feature-tag":"unfeature-tag",e.text)},onRemove:()=>b(e.text)},`edit-panel-tag-pill-${e}-${n}`))})},nd=e=>{let t,n,o,a,s=(0,r.c)(14),{className:l}=e,{colors:c,permissions:d}=(0,A.useContext)(R.k),[u,h]=(0,A.useState)(),f=d.languageTags||d.staff;if(!(0,Z.aF)("add-tags",d))return null;let g=c.labelArrow||c.labelIcon;return s[0]!==f?(t=f&&(0,i.jsx)(t7,{onChange:h}),s[0]=f,s[1]=t):t=s[1],s[2]!==u||s[3]!==t?(n=(0,i.jsx)(t1,{language:u,children:t}),s[2]=u,s[3]=t,s[4]=n):n=s[4],s[5]!==u?(o=(0,i.jsx)(nc,{language:u}),s[5]=u,s[6]=o):o=s[6],s[7]!==l||s[8]!==c.label||s[9]!==c.labelIcon||s[10]!==g||s[11]!==n||s[12]!==o?(a=(0,i.jsxs)(tr,{arrowColor:g,className:l,color:c.label,defaultOpen:!0,icon:"tag",iconColor:c.labelIcon,title:"Tags",children:[n,o]}),s[7]=l,s[8]=c.label,s[9]=c.labelIcon,s[10]=g,s[11]=n,s[12]=o,s[13]=a):a=s[13],a},nu=e=>{let t,n,o,a,s,l,c,d,u=(0,r.c)(16),{className:h}=e,{colors:f,gifIds:g,isCompact:p}=(0,A.useContext)(R.k);return u[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(tY,{}),n=(0,i.jsx)(th,{}),u[0]=t,u[1]=n):(t=u[0],n=u[1]),u[2]!==p?(o=(0,i.jsxs)(tK,{$compact:p,children:[t,n]}),u[2]=p,u[3]=o):o=u[3],u[4]!==f.divider?(a=(0,i.jsx)(eQ,{$color:f.divider}),u[4]=f.divider,u[5]=a):a=u[5],u[6]===Symbol.for("react.memo_cache_sentinel")?(s=(0,i.jsx)(nd,{}),u[6]=s):s=u[6],u[7]!==g?(l=g.join(","),u[7]=g,u[8]=l):l=u[8],u[9]!==l?(c=(0,i.jsxs)(tJ,{children:[s,(0,i.jsx)(tw,{},l)]}),u[9]=l,u[10]=c):c=u[10],u[11]!==h||u[12]!==o||u[13]!==a||u[14]!==c?(d=(0,i.jsxs)("div",{className:h,children:[o,a,c]}),u[11]=h,u[12]=o,u[13]=a,u[14]=c,u[15]=d):d=u[15],d};var nh=n(66991),nf=n(92112);let ng=e=>{let t,n,o,a,s=(0,r.c)(15),{className:l,gradient:c,isOpen:d,label:u,onCancel:h,onContinue:f}
1=e,g=void 0!==d&&d,p=void 0===u?P.aD:u,{colors:x}=(0,A.useContext)(R.k);s[0]!==x.button||s[1]!==x.buttonText||s[2]!==h?(t=(0,i.jsx)(J.A,{color:x.button,size:"medium",textColor:x.buttonText,onClick:h,children:P.pO}),s[0]=x.button,s[1]=x.buttonText,s[2]=h,s[3]=t):t=s[3];let m=c||x.gradient;return s[4]!==f?(n=()=>f(),s[4]=f,s[5]=n):n=s[5],s[6]!==p||s[7]!==m||s[8]!==n?(o=(0,i.jsx)(J.A,{gradient:m,size:"medium",onClick:n,children:p}),s[6]=p,s[7]=m,s[8]=n,s[9]=o):o=s[9],s[10]!==l||s[11]!==g||s[12]!==t||s[13]!==o?(a=(0,i.jsxs)(nf.A,{blurred:!0,className:l,isOpen:g,children:[t,o]}),s[10]=l,s[11]=g,s[12]=t,s[13]=o,s[14]=a):a=s[14],a},np=(0,A.createContext)({}),nx={title:""},nm=e=>{let t,n,o,a,s,l,c,d,u,h=(0,r.c)(31),{children:f}=e,g=(0,A.useRef)(nb),{onAction:p}=(0,A.useContext)(tp.s),{gifIds:x,permissions:m}=(0,A.useContext)(R.k),{performInternalAction:b}=(0,A.useContext)(np),{showActionMessage:y,showErrorMessage:v}=(0,A.useContext)(ns),[w,j]=(0,A.useState)(nx),{closeTooltip:C}=ew();h[0]!==w.description||h[1]!==w.title?(t={closeable:!0,description:w.description,title:w.title},h[0]=w.description,h[1]=w.title,h[2]=t):t=h[2];let{isOpen:k,closeAlert:_,openAlert:$}=(0,nh.MW)(t);if(h[3]!==C||h[4]!==x||h[5]!==p||h[6]!==$||h[7]!==b||h[8]!==m||h[9]!==y||h[10]!==v){async function I(e,t){return C(),j({continueGradient:function(e){switch(e){case"delete":case"remove-all-tags":case"remove-tag":return"red-pink";default:return}}(e),continueLabel:ex(e),description:function(e,t,n){let i=1===n?"This GIF":`${n} GIFs`;switch(e){case"delete":return`${i} will be deleted and no longer accessible for any users.`;case"explicit":return`${i} will be marked as explicit.`;case"queue":return`${i} will be added to the trending feed queue.`;case"remove-all-tags":return`${i} will have all tags removed.`;case"schedule":return`${i} will be scheduled to trend on ${t.toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"})} at ${t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})}.`;case"trend":return`${i} will be added to the trending feed.`;case"untrend":return`${i} will be removed from the trending feed.`;default:return}}(e,t,x.length),title:function(e,t){let n=(0,V.td)("GIF",t);switch(e){case"delete":return`Deleting ${n}`;case"explicit":return"Marking as Explicit";case"queue":return`Queuing ${n}`;case"remove-all-tags":return"Removing Tags";case"schedule":return`Scheduling ${n}`;case"trend":return`Trending ${n}`;case"untrend":return`Untrend ${n}`;default:return""}}(e,x.length)}),$(),new Promise(e=>{g.current=e})}n=async function(e,t){if(!(0,Z.aF)(e,m))return void v("You don't have permission to perform this action.","no-permission");(function(e){switch(e){case"delete":case"explicit":case"queue":case"remove-all-tags":case"schedule":case"trend":case"untrend":return!0;default:return!1}})(e)&&await I(e,t);try{ep(e)?await b(e,t):await p(x,e,t),"takedown"!==e&&y(e,t,x.length)}catch(t){console.error(t),v(`An error occurred while attempting to ${ex(e).toLowerCase()}`,e)}},h[3]=C,h[4]=x,h[5]=p,h[6]=$,h[7]=b,h[8]=m,h[9]=y,h[10]=v,h[11]=n}else n=h[11];h[12]!==_?(o=function(){g.current(""),_()},h[12]=_,h[13]=o):o=h[13];let S=o;return h[14]!==k?(a=()=>{k||(g.current=ny,j(nx))},s=[k],h[14]=k,h[15]=a,h[16]=s):(a=h[15],s=h[16]),(0,A.useEffect)(a,s),h[17]!==n?(l={performAction:n},h[17]=n,h[18]=l):l=h[18],h[19]!==_?(c=()=>_(),h[19]=_,h[20]=c):c=h[20],h[21]!==w.continueGradient||h[22]!==w.continueLabel||h[23]!==k||h[24]!==S||h[25]!==c?(d=(0,i.jsx)(ng,{gradient:w.continueGradient,isOpen:k,label:w.continueLabel,onCancel:c,onContinue:S}),h[21]=w.continueGradient,h[22]=w.continueLabel,h[23]=k,h[24]=S,h[25]=c,h[26]=d):d=h[26],h[27]!==f||h[28]!==l||h[29]!==d?(u=(0,i.jsxs)(eh.Provider,{value:l,children:[f,d]}),h[27]=f,h[28]=l,h[29]=d,h[30]=u):u=h[30],u};function nb(){}function ny(){}var nv=n(75314);let nw=e=>{let t,n,o,a,s,l,c,d=(0,r.c)(21),{children:u}=e,{onChange:h}=(0,A.useContext)(tp.s),{gifs:f,gifIds:g,permissions:p}=(0,A.useContext)(R.k),{showFieldMessage:x,showErrorMessage:m}=(0,A.useContext)(ns);if(d[0]!==f){let e=(0,e5.N7)("cta");n=A.useState,t=(0,e4.yR)(f,e),d[0]=f,d[1]=t,d[2]=n}else t=d[1],n=d[2];let[b,y]=n(!!t);d[3]!==g||d[4]!==h||d[5]!==p||d[6]!==m||d[7]!==x?(o=async function(e,t){if(!(0,Z.MC)(e,p))return void m("You don't have permission to change this field.","no-permission");try{await h(g,e,t),x(e,t)}catch(t){m(`An error occurred while changing ${(0,e5.FJ)(e).toLowerCase()}`,e)}},d[3]=g,d[4]=h,d[5]=p,d[6]=m,d[7]=x,d[8]=o):o=d[8];let v=o;return d[9]!==v||d[10]!==f||d[11]!==b?(a=()=>{let e=(0,e5.N7)("cta"),t=(0,e4.yR)(f,e);!b&&t&&v("cta",{link:"",text:""})},d[9]=v,d[10]=f,d[11]=b,d[12]=a):a=d[12],d[13]!==b?(s=[b],d[13]=b,d[14]=s):s=d[14],(0,A.useEffect)(a,s),d[15]!==v||d[16]!==b?(l={isCtaOn:b,changeField:v,setIsCtaOn:y},d[15]=v,d[16]=b,d[17]=l):l=d[17],d[18]!==u||d[19]!==l?(c=(0,i.jsx)(nv.c.Provider,{value:l,children:u}),d[18]=u,d[19]=l,d[20]=c):c=d[20],c},nj=e=>{let t,n,o,a=(0,r.c)(4),{children:s}=e;a[0]===Symbol.for("react.memo_cache_sentinel")?(t=async function(e,t){switch(e){case"copy-all-tags":case"copy-gif-id":return navigator.clipboard.writeText(t)}
1},a[0]=t):t=a[0];let l=t;return a[1]===Symbol.for("react.memo_cache_sentinel")?(n={performInternalAction:l},a[1]=n):n=a[1],a[2]!==s?(o=(0,i.jsx)(np.Provider,{value:n,children:s}),a[2]=s,a[3]=o):o=a[3],o};var nC=n(18051);let nk=e=>{let t,n,o,a,s=(0,r.c)(9),{tags:l}=e;s[0]!==l?(t=(n=void 0===l?[]:l).map(nN).join(", "),s[0]=l,s[1]=t,s[2]=n):(t=s[1],n=s[2]);let c=t;s[3]!==n.length?(o=(0,V.td)("tag",n.length),s[3]=n.length,s[4]=o):o=s[4];let d=o;return s[5]!==n.length||s[6]!==d||s[7]!==c?(a=n.length>70?(0,i.jsxs)("span",{children:["Added"," ",(0,i.jsxs)("strong",{children:[c.length," ",d]})]}):(0,i.jsxs)("span",{children:["Added ",d," ",(0,i.jsx)("em",{children:c})]}),s[5]=n.length,s[6]=d,s[7]=c,s[8]=a):a=s[8],a},nA=e=>{let t,n,o=(0,r.c)(4),{ids:a}=e,s=Math.max(1,a.length);return o[0]!==s?(t=(0,V.td)("GIF",s),o[0]=s,o[1]=t):t=o[1],o[2]!==t?(n=(0,i.jsxs)("span",{children:["Deleted ",t]}),o[2]=t,o[3]=n):n=o[3],n},n_=e=>{let t,n=(0,r.c)(2),{tag:o}=e;return n[0]!==o?(t=(0,i.jsxs)("span",{children:["Featured tag ",(0,i.jsxs)("em",{children:["#",o]})]}),n[0]=o,n[1]=t):t=n[1],t},n$=e=>{let t,n=(0,r.c)(2),{tag:o}=e;return n[0]!==o.text?(t=(0,i.jsxs)("span",{children:["Removed tag ",(0,i.jsxs)("em",{children:["#",o.text]})]}),n[0]=o.text,n[1]=t):t=n[1],t},nI=e=>{let t,n,o,a,s,l=(0,r.c)(11),{date:c}=e;return l[0]!==c?(t=c.toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"}),l[0]=c,l[1]=t):t=l[1],l[2]!==t?(n=(0,i.jsx)("strong",{children:t}),l[2]=t,l[3]=n):n=l[3],l[4]!==c?(o=c.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}),l[4]=c,l[5]=o):o=l[5],l[6]!==o?(a=(0,i.jsx)("strong",{children:o}),l[6]=o,l[7]=a):a=l[7],l[8]!==n||l[9]!==a?(s=(0,i.jsxs)("span",{children:["Scheduled to trend on"," ",n," ","at"," ",a]}),l[8]=n,l[9]=a,l[10]=s):s=l[10],s},nS=e=>{let t,n=(0,r.c)(2),{tag:o}=e;return n[0]!==o?(t=(0,i.jsxs)("span",{children:["Unfeatured tag ",(0,i.jsxs)("em",{children:["#",o]})]}),n[0]=o,n[1]=t):t=n[1],t};function nN(e){return`#${e.text}`}let nz=e=>{let t=(0,r.c)(14),{action:n,value:o,ids:a}=e;switch(n){case"add-tags":{let e,n;return t[0]!==o?(e=o||[],t[0]=o,t[1]=e):e=t[1],t[2]!==e?(n=(0,i.jsx)(nk,{tags:e}),t[2]=e,t[3]=n):n=t[3],n}case"copy-all-tags":return"Copied all tags to clipboard";case"copy-gif-id":return"Copied GIF ID to clipboard";case"delete":{let e;return t[4]!==a?(e=(0,i.jsx)(nA,{ids:a}),t[4]=a,t[5]=e):e=t[5],e}case"escalate":return"Escalated";case"explicit":return"Marked as explicit";case"feature-tag":{let e;return t[6]!==o?(e=(0,i.jsx)(n_,{tag:o}),t[6]=o,t[7]=e):e=t[7],e}case"queue":return"Added to trending queue";case"remove-all-tags":return"All tags removed";case"remove-tag":{let e;return t[8]!==o?(e=(0,i.jsx)(n$,{tag:o}),t[8]=o,t[9]=e):e=t[9],e}case"repair":return"Media repair initiated";case"reports":return"Reports created";case"schedule":{let e;return t[10]!==o?(e=(0,i.jsx)(nI,{date:o}),t[10]=o,t[11]=e):e=t[11],e}case"takedown":return null;case"trend":return"Added to trending feed";case"untrend":return"Removed from trending feed";case"unfeature-tag":{let e;return t[12]!==o?(e=(0,i.jsx)(nS,{tag:o}),t[12]=o,t[13]=e):e=t[13],e}}};var nT=n(13930);let nO=e=>{let t,n=(0,r.c)(2),{cta:o}=e,a=o?.text?"updated":"removed";return n[0]!==a?(t=(0,i.jsxs)("span",{children:["Source button ",a]}),n[0]=a,n[1]=t):t=n[1],t},nE=e=>{let t,n,o=(0,r.c)(5),{field:a,value:s}=e;o[0]!==a?(t=(0,V.ZH)((0,e5.FJ)(a)),o[0]=a,o[1]=t):t=o[1];let l=s?"updated":"removed";return o[2]!==t||o[3]!==l?(n=(0,i.jsxs)("span",{children:[t," ",l]}),o[2]=t,o[3]=l,o[4]=n):n=o[4],n},nD=e=>{let t,n=(0,r.c)(2),{isIndexed:o}=e,a=o?"Added to":"Removed from";return n[0]!==a?(t=(0,i.jsxs)("span",{children:[a," search index"]}),n[0]=a,n[1]=t):t=n[1],t},nH=e=>{let t,n=(0,r.c)(2),{noTrend:o}=e,a=o?"Removed from trending eligibility":"Made eligible for trending";return n[0]!==a?(t=(0,i.jsx)("span",{children:a}),n[0]=a,n[1]=t):t=n[1],t},nM=e=>{let t,n=(0,r.c)(2),{isPrivate:o}=e,a=o?"private":"public";return n[0]!==a?(t=(0,i.jsxs)("span",{children:["Updated to ",(0,i.jsx)("strong",{children:a})]}),n[0]=a,n[1]=t):t=n[1],t},nR=e=>{let t,n=(0,r.c)(2),{rating:o}=e;return n[0]!==o?(t=o&&"unrated"!==o?(0,i.jsxs)("span",{children:["Rating changed to ",(0,i.jsx)("strong",{children:(0,nT.iy)(o)})]}):(0,i.jsx)("span",{children:"Rating removed"}),n[0]=o,n[1]=t):t=n[1],t},nL=e=>{let t,n=(0,r.c)(2),{username:o}=e;return n[0]!==o?(t=o?(0,i.jsxs)("span",{children:["Username changed to ",(0,i.jsxs)("strong",{children:["@",o]})]}):(0,i.jsx)("span",{children:"Username removed"}),n[0]=o,n[1]=t):t=n[1],t},nF=e=>{let t=(0,r.c)(15),{field:n,value:o}=e;switch(n){case"cta":{let e;return t[0]!==o?(e=(0,i.jsx)(nO,{cta:o}),t[0]=o,t[1]=e):e=t[1],e}case"indexed":{let e;return t[2]!==o?(e=(0,i.jsx)(nD,{isIndexed:o}),t[2]=o,t[3]=e):e=t[3],e}case"no-trend":{let e;return t[4]!==o?(e=(0,i.jsx)(nH,{noTrend:o}
1),t[4]=o,t[5]=e):e=t[5],e}case"privacy":{let e;return t[6]!==o?(e=(0,i.jsx)(nM,{isPrivate:o}),t[6]=o,t[7]=e):e=t[7],e}case"rating":{let e;return t[8]!==o?(e=(0,i.jsx)(nR,{rating:o}),t[8]=o,t[9]=e):e=t[9],e}case"username":{let e;return t[10]!==o?(e=(0,i.jsx)(nL,{username:o}),t[10]=o,t[11]=e):e=t[11],e}default:{let e;return t[12]!==n||t[13]!==o?(e=(0,i.jsx)(nE,{field:n,value:o}),t[12]=n,t[13]=o,t[14]=e):e=t[14],e}}},nG="edit-panel-message-",nP=e=>{let t,n,o,a,s,l=(0,r.c)(14),{children:c}=e,{showMessage:d}=(0,A.useContext)(nC.p),{gifIds:u}=(0,A.useContext)(R.k);l[0]!==u||l[1]!==d?(t=function(e,t){d((0,i.jsx)(nz,{action:e,value:t,ids:u}),{id:`${nG}${e}`,style:ep(e)?"default":"success"})},l[0]=u,l[1]=d,l[2]=t):t=l[2];let h=t;l[3]!==d?(n=function(e,t){d((0,i.jsx)(nF,{field:e,value:t}),{id:`${nG}${e}`,style:"success"})},l[3]=d,l[4]=n):n=l[4];let f=n;l[5]!==d?(o=function(e,t){d(e,{id:t?`${nG}${t}`:void 0,style:"error"})},l[5]=d,l[6]=o):o=l[6];let g=o;return l[7]!==h||l[8]!==g||l[9]!==f?(a={showActionMessage:h,showFieldMessage:f,showErrorMessage:g},l[7]=h,l[8]=g,l[9]=f,l[10]=a):a=l[10],l[11]!==c||l[12]!==a?(s=(0,i.jsx)(ns.Provider,{value:a,children:c}),l[11]=c,l[12]=a,l[13]=s):s=l[13],s},nU=e=>{let t,n=(0,r.c)(2),{children:o}=e,{showMessage:a}=(0,A.useContext)(nC.p);return a?o:(n[0]!==o?(t=(0,i.jsx)(nC.E,{children:o}),n[0]=o,n[1]=t):t=n[1],t)},nW=L.Ay.div.withConfig({componentId:"sc-c0ecde4d-0"})(["gap:","px ","px;",""],P.Mr,P.LW,({$compact:e})=>e?(0,L.AH)(["display:flex;flex-direction:column;"]):(0,L.AH)(["display:grid;grid-template-columns:repeat(2,1fr);"])),nq=e=>{let t,n,o=(0,r.c)(11),{className:a,gifId:s}=e,{fields:l,isCompact:c}=(0,A.useContext)(R.k);if(o[0]!==l||o[1]!==s||o[2]!==c){let e;o[4]!==s||o[5]!==c?(e=(e,t)=>{let n=!c,r=n||(0,e5.WF)(e),o=(0,e5.e4)(e),a=(0,e5.FJ)(e);return(0,i.jsx)(tr,{defaultOpen:r,disabled:n,icon:o,title:a,children:(0,i.jsx)(eu,{field:e,gifId:s,size:P.Gj})},`edit-panel-metadata-field-${e}-${t}`)},o[4]=s,o[5]=c,o[6]=e):e=o[6],t=l.map(e),o[0]=l,o[1]=s,o[2]=c,o[3]=t}else t=o[3];return o[7]!==a||o[8]!==c||o[9]!==t?(n=(0,i.jsx)(nW,{$compact:c,className:a,children:t}),o[7]=a,o[8]=c,o[9]=t,o[10]=n):n=o[10],n};var nB=n(65235),nV=n(90296);let nJ=L.Ay.div.withConfig({componentId:"sc-6dbeb649-0"})(["align-items:center;display:flex;"," gap:","px;"],e=>e.isCompact&&(0,L.AH)(["align-items:start;flex-direction:column;"]),P.LW),nY=L.Ay.span.withConfig({componentId:"sc-6dbeb649-1"})(["color:",";flex-shrink:0;font-size:13px;font-weight:bold;"],({$color:e})=>e),nK=L.Ay.div.withConfig({componentId:"sc-6dbeb649-2"})(["align-items:center;display:flex;gap:","px;width:auto;"],P.Mr),nZ=(0,et.uN)(P.fy),nX=["sticker","text","emoji","genie"],nQ=e=>{let t,n,o,a,s,l,c,d=(0,r.c)(26),{className:u,gifId:h,metadata:f}=e,{colors:g,gifs:p,permissions:x,isCompact:m}=(0,A.useContext)(R.k),{changeField:b}=(0,A.useContext)(nv.c);if(d[0]!==h||d[1]!==p){let e;d[3]!==h?(e=e=>e.id===h,d[3]=h,d[4]=e):e=d[4],t=p.find(e),d[0]=h,d[1]=p,d[2]=t}else t=d[2];let y=t;if(d[5]!==b||d[6]!==u||d[7]!==g||d[8]!==y||d[9]!==m||d[10]!==x.staff){let e=y?(0,nB._U)(y):void 0,t=y?(0,nB.fP)(y):"",r=x.staff,l="gif"!==t&&"clip"!==t;n=nJ,o=u,a=m,s=!!e&&(0,i.jsxs)(nK,{children:[(0,i.jsx)(nY,{$color:g.label,children:"Content Type"}),(0,nB.PT)(e)&&(0,i.jsx)(B.A,{color:g.text,height:nZ,icon:(0,nB.PT)(e),width:nZ}),l&&r&&(0,i.jsx)("select",{defaultValue:t.toLowerCase(),style:{padding:10,backgroundColor:I.xx,marginLeft:2},onChange:e=>{b("content-type",e.currentTarget.value)},children:nX.map(n0)})]}),d[5]=b,d[6]=u,d[7]=g,d[8]=y,d[9]=m,d[10]=x.staff,d[11]=n,d[12]=o,d[13]=a,d[14]=s}else n=d[11],o=d[12],a=d[13],s=d[14];return d[15]!==g||d[16]!==h||d[17]!==f||d[18]!==x?(l=(0,Z.MC)("indexed",x)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(nK,{children:[(0,i.jsx)(nY,{$color:g.label,children:(0,e5.FJ)("indexed")}),(0,i.jsx)(eu,{field:"indexed",gifId:h,size:P.fy})]}),(0,i.jsxs)(nK,{children:[(0,i.jsx)(nY,{$color:g.label,children:(0,e5.FJ)("searchable")}),(0,i.jsx)(nV.default,{field:"searchable",gifId:h,size:"medium",metadata:f})]})]}),d[15]=g,d[16]=h,d[17]=f,d[18]=x,d[19]=l):l=d[19],d[20]!==n||d[21]!==o||d[22]!==a||d[23]!==s||d[24]!==l?(c=(0,i.jsxs)(n,{className:o,isCompact:a,children:[s,l]}),d[20]=n,d[21]=o,d[22]=a,d[23]=s,d[24]=l,d[25]=c):c=d[25],c};function n0(e){return(0,i.jsx)("option",{value:e,children:e},e)}var n1=n(81711);let n2=e=>{let t,n,o,a=(0,r.c)(14),{children:s,className:l,label:c,size:d}=e,{colors:u}=(0,A.useContext)(R.k),h=(0,n1.d)(u.control)>.5?I.ni:"inherit";return a[0]!==u.tooltip?(t={color:u.tooltip,width:P.Li},a[0]=u.tooltip,a[1]=t):t=a[1],a[2]!==u.button||a[3]!==u.buttonText?(n={color:u.button,iconColor:u.buttonText},a[2]=u.button,a[3]=u.buttonText,a[4]=n):n=a[4],a[5]!==s||a[6]!==l||a[7]!==u.control||a[8]!==c||a[9]!==d||a[10]!==t||a[11]!==n||a[12]!==h?(o=(0,i.jsx)(tf.A,{className:l,color:u.control,dropdownOptions:t,iconButtonOptions:n,label:c,size:d,textColor:h,children:s}),a[5]=s,a[6]=l,a[7]=u.control,a[8]=c,a[9]=d,a[10]=t,a[11]=n,a[12]=h,a[13]=o):o=a[13],o};var n3=n(31403);let n5=L.Ay.div.withConfig({componentId:"sc-b38f5a23-0"})(["padding-left:1em;"]),n4=L.Ay.span.withConfig({componentId:"sc-b38f5a23-1"})(["opacity:0.5;"]),n7=L.Ay.a.withConfig({componentId:"sc-b38f5a23-2"})(["color:inherit;text-decoration:underline;&:focus-visible{border-radius:2px;outline:2px solid ",";}"],I.aw),n6=/{([^}]*)}/g,n8=/((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g;function n9(e){return Array.isArray(e)?"[":"{"}function ie(e){return Array.isArray(e)?"]":"}"}let it=(0,L.Ay)(B.A).withConfig({componentId:"sc-2b423b8a-0"})(["margin-right:0.25em;opacity:",";transition:all 0.1s ease-out;",""],({$open:e})=>e?.5:.25,({$open:e})=>!e&&(0,L.AH)(["transform:rotate(-90deg);"])),ii=L.Ay.span.withConfig({componentId:"sc-2b423b8a-1"})(["align-items:center;cursor:pointer;display:inline-flex;&:focus-visible{border-radius:2px;outline:2px solid ",";}&:active{opacity:0.8;}"],I.aw),ir=L.Ay.div.withConfig({componentId:"sc-2b423b8a-2"})(["padding-left:20px;"]),io=L.Ay.div.withConfig({componentId:"sc-2b423b8a-3"})(["display:flex;width:100%;","{flex-shrink:0;}"],ii),ia=L.Ay.div.withConfig({componentId:"sc-2b423b8a-4"})(["box-sizing:border-box;opacity:0.25;overflow:hidden;padding-left:0.25em;text-overflow:ellipsis;white-space:nowrap;width:100%;"]),is=({children:e,className:t,defaultOpen:n=!1,label:r,value:o})=>{let[a,s]=(0,A.useState)(n),l=(0,A.useMemo)(()=>{let e;
1return e=(e=(e=(e=JSON.stringify(o,null,2)).substring(1,e.length-2)).replace(n8,"...")).replace(n6,"{...}"),`${n9(o)} ${e} ${ie(o)}`},[o]);return(0,i.jsxs)("div",{className:t,children:[(0,i.jsxs)(io,{children:[(0,i.jsxs)(ii,{title:r,onClick:()=>s(!a),children:[(0,i.jsx)(it,{$open:a,color:"currentColor",icon:"navigate-down",height:10,width:10}),(0,i.jsx)("strong",{children:r}),":"]}),!a&&(0,i.jsx)(ia,{title:l,children:l})]}),a&&(0,i.jsx)(ir,{children:e})]})},il=({children:e,className:t,label:n,value:r})=>{let o=Array.isArray(r),a="object"==typeof r&&!o;return r&&"object"==typeof r&&(o&&r.length||a&&Object.keys(r).length)?(0,i.jsx)(is,{className:t,label:n,value:r,children:e}):(0,i.jsxs)("div",{className:t,children:[(0,i.jsx)("strong",{children:n}),": ",function(e){if(null===e)return(0,i.jsx)(n4,{children:"null"});if(void 0===e)return(0,i.jsx)(n4,{children:"undefined"});if("boolean"==typeof e)return e?"true":(0,i.jsx)(n4,{children:"false"});if(Array.isArray(e))return(0,i.jsx)(n4,{children:"[]"});if("object"==typeof e)return(0,i.jsx)(n4,{});if("string"==typeof e)try{return new URL(e),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n4,{children:'"'}),(0,i.jsx)(n7,{href:e,target:"_blank",title:e,children:e}),(0,i.jsx)(n4,{children:'"'})]})}catch(t){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n4,{children:'"'}),e,(0,i.jsx)(n4,{children:'"'})]})}return e}(r),e]})},ic=({code:e})=>{let t=(0,A.useMemo)(()=>{try{return JSON.parse(e)}catch(e){return}},[e]);return t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n4,{children:n9(t)}),(0,i.jsx)(n5,{children:function e(t){return t?(0,i.jsx)(i.Fragment,{children:Object.keys(t).sort().map((n,r)=>{let o=Math.random().toString(36).substring(2,11);return(0,i.jsx)(il,{label:n,value:t[n],children:"object"==typeof t[n]?e(t[n]):null},`${o}-${n}-${r}`)})}):null}(t)}),(0,i.jsx)(n4,{children:ie(t)})]}):null},id=L.Ay.div.withConfig({componentId:"sc-ccb96836-0"})(["border-radius:4px;box-sizing:border-box;min-height:3em;overflow:auto;padding:0.5em 1em;white-space:pre-wrap;word-wrap:break-word;"," ",""],({$color:e,$textColor:t})=>{let n=(0,n1.d)(e)>.5?I.ni:"inherit";return(0,L.AH)(["background:",";color:",";"],e,t||n)},({$resizeable:e})=>e&&(0,L.AH)(["resize:vertical;"]));(0,L.Ay)(B.A).withConfig({componentId:"sc-60ebbbec-0"})(["display:inline-block;vertical-align:top;"]);let iu=(0,L.Ay)(e=>{let t,n,o,a,s=(0,r.c)(14),{code:l,color:c,className:d,format:u,resizeable:h,style:f,textColor:g}=e,p=void 0===c?I.Hi:c,x=void 0!==h&&h;s[0]!==l?(t="string"==typeof l?l:JSON.stringify(l,null,4),s[0]=l,s[1]=t):t=s[1];let m=t;s[2]!==m||s[3]!==u?(n=function(){return"json"===u?(0,i.jsx)(ic,{code:m}):m},s[2]=m,s[3]=u,s[4]=n):n=s[4];let b=n;return s[5]!==b?(o=b(),s[5]=b,s[6]=o):o=s[6],s[7]!==d||s[8]!==p||s[9]!==x||s[10]!==f||s[11]!==o||s[12]!==g?(a=(0,i.jsx)(id,{$color:p,$resizeable:x,$textColor:g,className:d,style:f,children:o}),s[7]=d,s[8]=p,s[9]=x,s[10]=f,s[11]=o,s[12]=g,s[13]=a):a=s[13],a}).withConfig({componentId:"sc-60ebbbec-1"})(["border-radius:","px;height:100px;"],(0,et.xb)(P.oK)),ih=L.Ay.div.withConfig({componentId:"sc-60ebbbec-2"})(["display:flex;flex-direction:column;gap:","px;"],P.__);(0,L.Ay)(J.A).withConfig({componentId:"sc-60ebbbec-3"})(["padding:0;"]);let ig=/((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g,ip=({children:e,className:t,code:n,placeholder:r="",title:o})=>{let{colors:a}=(0,A.useContext)(R.k),[s,l]=(0,A.useState)(!0),c="object"==typeof n;return(0,i.jsx)(tr,{arrowColor:a.labelArrow||a.labelIcon,className:t,color:a.label,defaultOpen:!0,iconColor:a.labelIcon,title:o,titleComponent:n?(0,i.jsx)(n3.A,{style:s?void 0:{visibility:"hidden"},onClick:()=>void(n&&function(e,t="JSON Viewer"){try{let n=JSON.stringify(e,null,4),i=window.open(),r=`background:${I.ni}; color:${I.xx};`,o=n.replace(ig,'<a href="$&" style="all:unset; cursor:pointer;" target="_blank">$&</a>');i?.document.open(),i?.document.write(`<html> 2 <title>${t}</title> 3 <body style="${r}"> 4 <pre>${o}</pre> 5 </body> 6 </html>`),i?.document.close()}catch(e){}}(n,o)),children:"Open in JSON Viewer"}):void 0,onToggle:l,children:(0,i.jsxs)(ih,{children:[e,(0,i.jsx)(iu,{code:n||r,color:a.control,format:c?"json":void 0,resizeable:!0})]})})},ix=L.Ay.div.withConfig({componentId:"sc-5403bee7-0"})(["display:flex;flex-direction:column;gap:","px;"],P.LW),im=e=>{let t,n,o,a,s,l,c,d,u,h,f,g=(0,r.c)(29),{className:p,gifId:x,metadata:m}=e,{fetchExtendedMetadata:b}
6=(0,A.useContext)(tp.s),{colors:y}=(0,A.useContext)(R.k);g[0]===Symbol.for("react.memo_cache_sentinel")?(t={},g[0]=t):t=g[0];let[v,w]=(0,A.useState)(t),[j,C]=(0,A.useState)(""),[k,_]=(0,A.useState)(!1);g[1]!==v?(n=Object.keys(v),g[1]=v,g[2]=n):n=g[2];let $=n;g[3]!==b||g[4]!==x?(o=()=>{let e=!0;return w({}),C(""),_(!1),x&&b(x).then(t=>{e&&w(t)},()=>{e&&_(!0)}),()=>{e=!1}},a=[x,b],g[3]=b,g[4]=x,g[5]=o,g[6]=a):(o=g[5],a=g[6]),(0,A.useEffect)(o,a),g[7]!==k?(s=k&&(0,i.jsx)("p",{role:"alert",children:"Unable to load extended metadata."}),g[7]=k,g[8]=s):s=g[8],g[9]!==m?(l=(0,i.jsx)(ip,{code:m,title:"Metadata JSON"}),g[9]=m,g[10]=l):l=g[10];let I=v[j],S=j||"Select a field",N=j?$.indexOf(j):void 0;return g[11]!==$?(c=e=>C($[e]),g[11]=$,g[12]=c):c=g[12],g[13]!==y.headerHighlight||g[14]!==$||g[15]!==c||g[16]!==N?(d=(0,i.jsx)(tx.A,{iconColor:y.headerHighlight,index:N,options:$,onChange:c}),g[13]=y.headerHighlight,g[14]=$,g[15]=c,g[16]=N,g[17]=d):d=g[17],g[18]!==d||g[19]!==S?(u=(0,i.jsx)(n2,{label:S,size:P.oK,children:d}),g[18]=d,g[19]=S,g[20]=u):u=g[20],g[21]!==u||g[22]!==I?(h=(0,i.jsx)(ip,{code:I,placeholder:"Select an extended metadata field above...",title:"Extended JSON",children:u}),g[21]=u,g[22]=I,g[23]=h):h=g[23],g[24]!==p||g[25]!==h||g[26]!==s||g[27]!==l?(f=(0,i.jsxs)(ix,{className:p,children:[s,l,h]}),g[24]=p,g[25]=h,g[26]=s,g[27]=l,g[28]=f):f=g[28],f},ib=(0,L.Ay)(W.A).withConfig({componentId:"sc-3f890189-0"})(["flex-shrink:0;width:","px;"],(0,et.uN)("small")),iy=L.Ay.div.withConfig({componentId:"sc-3f890189-1"})(["align-items:center;background:",";border-radius:4px;box-sizing:border-box;display:flex;gap:10px;justify-content:center;padding:4px;user-select:none;width:100%;"],({$color:e})=>e);function iv(e){return e-1}function iw(e){return e+1}let ij=(0,L.Ay)(e=>{let t,n,o,a,s,l,c,d,u,h,f,g,p,x=(0,r.c)(33),{arrowColor:m,arrowIconColor:b,backgroundColor:y,className:v,defaultIndex:w,gifs:j,index:C,previewHeight:k,previewWidth:_,style:$,onChange:S}=e,N=void 0===y?I.bW:y,z=void 0===w?0:w,T=(0,A.useRef)(C||z),[O,E]=(0,A.useState)(C||z),D=j[O];x[0]===Symbol.for("react.memo_cache_sentinel")?(t=function(){E(iv)},x[0]=t):t=x[0];let H=t;x[1]===Symbol.for("react.memo_cache_sentinel")?(n=function(){E(iw)},x[1]=n):n=x[1];let M=n;x[2]!==C?(o=()=>{void 0!==C&&E(C)},a=[C],x[2]=C,x[3]=o,x[4]=a):(o=x[3],a=x[4]),(0,A.useEffect)(o,a),x[5]!==O||x[6]!==S?(s=()=>{O!==T.current&&(T.current=void 0,S?.(O))},x[5]=O,x[6]=S,x[7]=s):s=x[7],x[8]!==O?(l=[O],x[8]=O,x[9]=l):l=x[9],(0,A.useEffect)(s,l);let R=O<=0;x[10]===Symbol.for("react.memo_cache_sentinel")?(c=()=>H(),x[10]=c):c=x[10],x[11]!==m||x[12]!==b||x[13]!==R?(d=(0,i.jsx)(ib,{color:m,disabled:R,icon:"navigate-left",iconColor:b,size:"mini",onClick:c}),x[11]=m,x[12]=b,x[13]=R,x[14]=d):d=x[14],x[15]!==D?(u=[D],x[15]=D,x[16]=u):u=x[16],x[17]!==k||x[18]!==_||x[19]!==u?(h=(0,i.jsx)(tU,{backgroundColor:"transparent",gifs:u,height:k,width:_}),x[17]=k,x[18]=_,x[19]=u,x[20]=h):h=x[20];let L=O>=j.length-1;return x[21]===Symbol.for("react.memo_cache_sentinel")?(f=()=>M(),x[21]=f):f=x[21],x[22]!==m||x[23]!==b||x[24]!==L?(g=(0,i.jsx)(ib,{color:m,disabled:L,icon:"navigate-right",iconColor:b,size:"mini",onClick:f}),x[22]=m,x[23]=b,x[24]=L,x[25]=g):g=x[25],x[26]!==N||x[27]!==v||x[28]!==$||x[29]!==d||x[30]!==h||x[31]!==g?(p=(0,i.jsxs)(iy,{$color:N,className:v,style:$,children:[d,h,g]}),x[26]=N,x[27]=v,x[28]=$,x[29]=d,x[30]=h,x[31]=g,x[32]=p):p=x[32],p}).withConfig({componentId:"sc-879d41fc-0"})(["border-radius:","px;"],(0,et.xb)(P.oK)),iC=(0,L.Ay)(J.A).withConfig({componentId:"sc-7d560f08-0"})(["width:","px;"],P.vE),ik=(0,L.Ay)(eS.A).withConfig({componentId:"sc-7d560f08-1"})(["grid-column:span 2;"]),iA=(0,L.Ay)(B.A).withConfig({componentId:"sc-7d560f08-2"})(["display:inline-block;margin-right:0.5em;vertical-align:top;"]),i_=L.Ay.span.withConfig({componentId:"sc-7d560f08-3"})(["align-items:center;color:",";display:flex;font-size:13px;font-weight:bold;"],({$color:e})=>e),i$=(0,L.Ay)(tg.A).withConfig({componentId:"sc-7d560f08-4"})(["text-align:center;"]),iI=(0,L.Ay)(tg.A).withConfig({componentId:"sc-7d560f08-5"})(["",""],({$compact:e})=>e&&(0,L.AH)(["grid-column:span 2;"])),iS=({className:e,label:t,value:n})=>{let{colors:r}=(0,A.useContext)(R.k),{performAction:o}=(0,A.useContext)(eh);return(0,i.jsxs)("div",{className:e,children:[(0,i.jsx)(i_,{$color:r.label,children:t}),(0,i.jsx)(ik,{color:r.control,readOnly:!0,size:P.Gj,value:n,children:navigator.clipboard&&(0,i.jsx)(iC,{color:r.button,size:P.Gj,textColor:r.buttonText,onClick:()=>void o("copy-gif-id",n),children:"Copy"})})]})},iN=({className:e,label:t,value:n=""})=>{let{colors:r,isCompact:o}=(0,A.useContext)(R.k),a=(0,A.useMemo)(()=>!n||isNaN(Date.parse(n))?null:new Date(n),[n]),[s,l]=(0,A.useMemo)(()=>
6{if(!a)return["--",""];let e=a.toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"}),t=a.toLocaleTimeString("en-US",{hour:o?"numeric":"2-digit",minute:"2-digit"});return o?[`${e} ${t}`,void 0]:[e,t]},[a]);return(0,i.jsxs)("div",{className:e,children:[(0,i.jsx)(i_,{$color:r.label,children:t}),(0,i.jsxs)(iI,{$compact:o||!l,color:r.control,size:P.Gj,title:s,children:[!!a&&(0,i.jsx)(iA,{color:r.labelIcon,icon:"calendar",height:16,width:16}),s]}),l&&(0,i.jsx)(i$,{color:r.control,size:P.Gj,title:l,children:l})]})},iz=L.Ay.div.withConfig({componentId:"sc-8124595-0"})(["display:grid;gap:","px ","px;width:100%;> div{display:grid;gap:","px;grid-template-columns:","px auto ","px;}",""],P.Mr,P.LW,P.__,P.GD,P.vE,({$compact:e})=>e?(0,L.AH)(["display:flex;flex-direction:column;"]):(0,L.AH)(["grid-template-columns:repeat(2,1fr);"])),iT=e=>{let t,n,o,a,s,l=(0,r.c)(15),{className:c,metadata:d}=e,{isCompact:u}=(0,A.useContext)(R.k);return l[0]!==d.id?(t=(0,i.jsx)(iS,{label:"GIF ID",value:d.id}),l[0]=d.id,l[1]=t):t=l[1],l[2]!==d.create_datetime?(n=(0,i.jsx)(iN,{label:"Created",value:d.create_datetime}),l[2]=d.create_datetime,l[3]=n):n=l[3],l[4]!==d.trending_datetime?(o=(0,i.jsx)(iN,{label:"Trended",value:d.trending_datetime}),l[4]=d.trending_datetime,l[5]=o):o=l[5],l[6]!==d.update_datetime?(a=(0,i.jsx)(iN,{label:"Updated",value:d.update_datetime}),l[6]=d.update_datetime,l[7]=a):a=l[7],l[8]!==c||l[9]!==u||l[10]!==t||l[11]!==n||l[12]!==o||l[13]!==a?(s=(0,i.jsxs)(iz,{$compact:u,className:c,children:[t,n,o,a]}),l[8]=c,l[9]=u,l[10]=t,l[11]=n,l[12]=o,l[13]=a,l[14]=s):s=l[14],s},iO=e=>{let t,n,o,a,s,l,c,d,u,h,f,g=(0,r.c)(40),{className:p}=e,{fetchMetadata:x}=(0,A.useContext)(tp.s),{colors:m,fields:b,gifIds:y,gifs:v}=(0,A.useContext)(R.k),[w,j]=(0,A.useState)(0),[C,k]=(0,A.useState)(""),[_,$]=(0,A.useState)(!1);g[0]!==w||g[1]!==x||g[2]!==y?(t=()=>{let e=!0;k(""),$(!1);let t=y[w];return t&&x(t).then(t=>{e&&k(t)},()=>{e&&$(!0)}),()=>{e=!1}},n=[y,w,x],g[0]=w,g[1]=x,g[2]=y,g[3]=t,g[4]=n):(t=g[3],n=g[4]),(0,A.useEffect)(t,n),g[5]!==_?(o=_&&(0,i.jsx)("p",{role:"alert",children:"Unable to load metadata."}),g[5]=_,g[6]=o):o=g[6],g[7]!==w||g[8]!==m.button||g[9]!==m.buttonText||g[10]!==m.controlDark||g[11]!==v?(a=v.length>1&&(0,i.jsx)(ij,{arrowColor:m.button,arrowIconColor:m.buttonText,backgroundColor:m.controlDark,gifs:v,index:w,previewHeight:P.TF,previewWidth:P.EK,onChange:j}),g[7]=w,g[8]=m.button,g[9]=m.buttonText,g[10]=m.controlDark,g[11]=v,g[12]=a):a=g[12],g[13]!==C?(s=(0,i.jsx)(iT,{metadata:C}),g[13]=C,g[14]=s):s=g[14],g[15]!==m.divider?(l=(0,i.jsx)(eQ,{$color:m.divider}),g[15]=m.divider,g[16]=l):l=g[16];let I=y[w];g[17]!==C||g[18]!==I?(c=(0,i.jsx)(nQ,{gifId:I,metadata:C}),g[17]=C,g[18]=I,g[19]=c):c=g[19],g[20]!==m.divider?(d=(0,i.jsx)(eQ,{$color:m.divider}),g[20]=m.divider,g[21]=d):d=g[21],g[22]!==w||g[23]!==m.divider||g[24]!==b.length||g[25]!==y?(u=b.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nq,{gifId:y[w]}),(0,i.jsx)(eQ,{$color:m.divider})]}),g[22]=w,g[23]=m.divider,g[24]=b.length,g[25]=y,g[26]=u):u=g[26];let S=y[w];return g[27]!==C||g[28]!==S?(h=(0,i.jsx)(im,{gifId:S,metadata:C}),g[27]=C,g[28]=S,g[29]=h):h=g[29],g[30]!==p||g[31]!==u||g[32]!==h||g[33]!==o||g[34]!==a||g[35]!==s||g[36]!==l||g[37]!==c||g[38]!==d?(f=(0,i.jsxs)("div",{className:p,children:[o,a,s,l,c,d,u,h]}),g[30]=p,g[31]=u,g[32]=h,g[33]=o,g[34]=a,g[35]=s,g[36]=l,g[37]=c,g[38]=d,g[39]=f):f=g[39],f},iE={badgeColor:I.aw,button:I.Fl,buttonText:I.xx,control:I.Hi,divider:I.Fl,footer:I.xx,footerEllipsis:I.nU,footerIcon:I.Zf,gradient:"indigo-purple",header:"#fff",input:"#fff",label:I.nU,labelIcon:I.Zf,sharedTag:I.eZ,text:I.xx,tooltip:I.bW},iD={...iE,backgroundColor:I.ni,controlDark:I.bW,headerHighlight:I.C2,headerInactive:I.jI},iH={...iE,backgroundColor:I.bW,controlDark:I.Hi,footerBackground:I.ni,headerClose:I.Fl,headerHighlight:"#fff",headerInactive:I.nU},iM=e=>{let t,n,o,a,s,l,c,d,u,h,f,g,p,x,m=(0,r.c)(56),{className:b,closeable:y,colors:v,colorScheme:w,collectionsComponent:j,defaultTab:C,gifs:k,loading:_,permissions:$,style:I,onClose:S}=e,N=void 0!==y&&y;m[0]!==v?(t=void 0===v?{}:v,m[0]=v,m[1]=t):t=m[1];let z=t,T=void 0===w?"panel":w,O=void 0===C?X[0]:C;m[2]!==k?(n=void 0===k?[]:k,m[2]=k,m[3]=n):n=m[3];let E=n,L=void 0!==_&&_,F=(0,A.useRef)(null),[G,P]=(0,A.useState)(O),U=(0,M.Gw)(F),W=U<600;if(m[4]!==$||m[5]!==G){let e;m[7]!==$?(e=e=>(0,Z.aF)(e,$),m[7]=$,m[8]=e):e=m[8],o=(function(e){switch(e){case"collections":return[];case"info":return["trend","schedule","queue","delete"];case"metadata":return["delete"]}})(G).filter(e),m[4]=$,m[5]=G,m[6]=o}else o=m[6];let q=o;if(m[9]!==$||m[10]!==G){let e;m[12]!==$?(e=e=>(0,Z.MC)(e,$),m[12]=$,m[13]=e):e=m[13],a=(function(e){switch(e){case"collections":return[];case"info":return["username","title","description","source","rating","no-trend"];case"metadata":return["source-body","source-caption","slug","content-url"]}})(G).filter(e),m[9]=$,m[10]=G,m[11]=a}else a=m[11];let B=a;m[14]!==E?(s=E.map(iR),m[14]=E,m[15]=s):s=m[15];let V=s;m[16]!==T?(l=function(e){switch(e){case"panel":return iD;case"sidebar":return iH}}(T),m[16]=T,m[17]=l):l=m[17],m[18]!==z||m[19]!==l?(c={...l,...z},m[18]=z,m[19]=l,m[20]=c):c=m[20];let J=c;m[21]!==j||m[22]!==G?(d=function(){switch(G){case"collections":return j;case"info":return(0,i.jsx)(nu,{});case"metadata":return(0,i.jsx)(iO,{})}},m[21]=j,m[22]=G,m[23]=d):d=m[23];let Y=d;return m[24]!==q||m[25]!==J||m[26]!==B||m[27]!==V||m[28]!==E||m[29]!==W||m[30]!==$||m[31]!==G||m[32]!==U?(u={actions:q,colors:J,fields:B,gifIds:V,gifs:E,isCompact:W,permissions:$,tab:G,width:U,setTab:P}
6,m[24]=q,m[25]=J,m[26]=B,m[27]=V,m[28]=E,m[29]=W,m[30]=$,m[31]=G,m[32]=U,m[33]=u):u=m[33],m[34]!==N||m[35]!==j||m[36]!==Y||m[37]!==E.length||m[38]!==S||m[39]!==G?(h=E.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e0,{closeable:N,onClose:S,showCollections:!!j}),(0,i.jsx)(eX,{children:Y()}),"collections"!==G&&(0,i.jsx)(e1,{})]}),m[34]=N,m[35]=j,m[36]=Y,m[37]=E.length,m[38]=S,m[39]=G,m[40]=h):h=m[40],m[41]!==b||m[42]!==J.backgroundColor||m[43]!==J.text||m[44]!==W||m[45]!==I||m[46]!==h?(f=(0,i.jsx)(e2,{$color:J.backgroundColor,$compact:W,$textColor:J.text,className:b,style:I,ref:F,children:h}),m[41]=b,m[42]=J.backgroundColor,m[43]=J.text,m[44]=W,m[45]=I,m[46]=h,m[47]=f):f=m[47],m[48]!==L?(g=L&&(0,i.jsx)(e3,{}),m[48]=L,m[49]=g):g=m[49],m[50]!==f||m[51]!==g?(p=(0,i.jsx)(D.A,{children:(0,i.jsx)(H.default,{children:(0,i.jsx)(nU,{children:(0,i.jsx)(nP,{children:(0,i.jsx)(nj,{children:(0,i.jsx)(nm,{children:(0,i.jsxs)(nw,{children:[f,g]})})})})})})}),m[50]=f,m[51]=g,m[52]=p):p=m[52],m[53]!==u||m[54]!==p?(x=(0,i.jsx)(R.k.Provider,{value:u,children:p}),m[53]=u,m[54]=p,m[55]=x):x=m[55],x};function iR(e){return`${e.id}`}var iL=n(61848),iF=n(39865);let iG=(0,L.i7)(["0%{opacity:0;}100%{opacity:1;}"]),iP=L.Ay.div.withConfig({componentId:"sc-5b0653a6-0"})(["align-items:center;animation:"," 0.1s ease-out;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:",";"],iG,iL.a2+1),iU=L.Ay.div.withConfig({componentId:"sc-5b0653a6-1"})(["background:rgba(0,0,0,0.8);height:100%;left:0;position:absolute;top:0;width:100%;"]),iW=L.Ay.div.withConfig({componentId:"sc-5b0653a6-2"})(["height:90%;max-height:800px;min-height:0;position:relative;width:840px;"]),iq=(0,L.Ay)(iM).withConfig({componentId:"sc-5b0653a6-3"})(["border:1px solid ",";border-radius:6px;height:100%;overflow:auto;width:100%;"],I.bW),iB=e=>{let t,n,o,a,s,l,c=(0,r.c)(26),{gifs:d,loading:u,permissions:h,onClose:f}=e,g=void 0!==u&&u,{user:p}=(0,A.useContext)(iF.A),x=g||d.length>0;if(c[0]!==x?(t=()=>{x?document.documentElement.style.overflow="hidden":document.documentElement.style.overflow=""},n=[x],c[0]=x,c[1]=t,c[2]=n):(t=c[1],n=c[2]),(0,A.useEffect)(t,n),!x)return null;c[3]!==f?(o=(0,i.jsx)(iU,{onClick:()=>f?.()}),c[3]=f,c[4]=o):o=c[4];let m=!!p?.is_verified,b=!!p?.permissions.edit_language_tags,y=!!p?.is_staff,v=!!p?.is_staff,w=!!p?.permissions.can_takedown_content;return c[5]!==h.delete||c[6]!==h.extended_metadata||c[7]!==h.feature_tags||c[8]!==h.hide||c[9]!==h.rate||c[10]!==h.tag||c[11]!==h.tag_counts||c[12]!==m||c[13]!==b||c[14]!==y||c[15]!==v||c[16]!==w?(a={altText:!1,cta:m,delete:h.delete,featureTag:h.feature_tags,languageTags:b,labels:y,metadata:h.extended_metadata,privacy:h.hide,rate:h.rate,staff:v,tag:h.tag,tagCounts:h.tag_counts,takedown:w},c[5]=h.delete,c[6]=h.extended_metadata,c[7]=h.feature_tags,c[8]=h.hide,c[9]=h.rate,c[10]=h.tag,c[11]=h.tag_counts,c[12]=m,c[13]=b,c[14]=y,c[15]=v,c[16]=w,c[17]=a):a=c[17],c[18]!==d||c[19]!==g||c[20]!==f||c[21]!==a?(s=(0,i.jsx)(iW,{children:(0,i.jsx)(iq,{closeable:!0,colorScheme:"panel",gifs:d,loading:g,permissions:a,onClose:f})}),c[18]=d,c[19]=g,c[20]=f,c[21]=a,c[22]=s):s=c[22],c[23]!==s||c[24]!==o?(l=(0,i.jsxs)(iP,{children:[o,s]}),c[23]=s,c[24]=o,c[25]=l):l=c[25],l};var iV=n(90483),iJ=n(42761),iY=n(51176),iK=n(77965),iZ=n(5458),iX=n(77672),iQ=n(66804),i0=n(29617);let i1=e=>{let t,n,o=(0,r.c)(6),{channel:a,setChannel:s}=e,{data:l}=(0,iV.HS)(a.id);o[0]!==a||o[1]!==l?(t=l?.ancestors?[...l.ancestors,a]:[a],o[0]=a,o[1]=l,o[2]=t):t=o[2];let c=t;return o[3]!==c||o[4]!==s?(n=c.map((e,t)=>{let n=t===c.length-1;return(0,i.jsx)("div",{children:(0,i.jsxs)("span",{className:(0,C.cn)("cursor-pointer hover:text-giphyBlue",n&&"pointer-events-none text-giphyLightGrey"),onClick:()=>{s(e.id)},children:[t>0&&" - ",e.display_name]})},e.id)}),o[3]=c,o[4]=s,o[5]=n):n=o[5],n},i2=({gifs:e})=>{let[t,n]=(0,A.useState)([]),[r,o]=(0,A.useState)([]),{showMessage:a}=(0,A.useContext)(iZ.J);return(0,A.useEffect)(()=>{(async()=>{let t=await Promise.all(e.map(e=>(0,b.b)(e.id)));n(t.map(e=>e.map(e=>e.channel.id)).reduce((e,t)=>
6(e.forEach(e=>{t.includes(e)||t.push(e)}),console.groupEnd(),t),[])),o(t)})()},[e]),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map(t=>{let o,s=(r.some(e=>e.some(e=>{let n=e.channel.id===t;return n&&(o=e.channel),n})),o);return s?(0,i.jsxs)("div",{className:"group flex shrink-0 cursor-pointer flex-nowrap items-center gap-2 rounded-3xl bg-gradient-grey px-4 py-3.5 font-bold",onClick:async()=>{let t=!0;e.forEach(async e=>{try{let t=await (0,b.D$)([e.id],s.id);if(console.log("r",t),!t.ok)throw`Error fetching ${t.status}`;a({message:"Removed from channel",type:"success"})}catch(e){t=!1,console.error(e),a({message:"Error removing gifs from channel",type:"error"})}}),t&&n(e=>e.filter(e=>e!==s.id))},children:[(0,i.jsx)("div",{children:s.display_name}),(0,i.jsx)(iK.A,{className:"size-4 fill-giphyWhite group-hover:fill-giphyRed"})]},s.id):null})})},i3=e=>{let t,n,o,a,s,l,c,d=(0,r.c)(28),{channelId:u,gifs:h,setChannel:f}=e,{user:g}=(0,A.useContext)(iF.A),{showStatusMessage:p}=(0,A.useContext)(iZ.J),[x,m]=(0,A.useState)(!1),{channel:y,isLoading:v,ref:w,children:j,doneFetching:k}=(0,iJ.cf)(u);d[0]!==h?(t=(0,i.jsx)(i2,{gifs:h}),d[0]=h,d[1]=t):t=d[1],d[2]!==f||d[3]!==g?.is_staff?(n=g?.is_staff&&(0,i.jsx)(iQ.A,{onSelect:e=>{f(e.id)}}),d[2]=f,d[3]=g?.is_staff,d[4]=n):n=d[4],d[5]!==y||d[6]!==f?(o=y&&(0,i.jsx)("div",{className:"flex flex-col",children:(0,i.jsx)(i1,{channel:y,setChannel:f})}),d[5]=y,d[6]=f,d[7]=o):o=d[7];let _=v?"flex justify-center":"grid grid-cols-[1fr_1fr]";d[8]!==_?(a=(0,C.cn)("mb-20 animate-fade-in gap-4 pt-2",_),d[8]=_,d[9]=a):a=d[9];let $=`container-${v}`;return d[10]!==j||d[11]!==k||d[12]!==h||d[13]!==x||d[14]!==v||d[15]!==w||d[16]!==f||d[17]!==p?(s=v?(0,i.jsx)(iX.A,{}):(0,i.jsxs)(i.Fragment,{children:[j?.map(e=>{let t=(0,C.cn)("cursor-pointer transition-opacity",i0.U4,i0.Om,x&&"pointer-events-none opacity-40");return 0===e.num_children?(0,i.jsxs)("div",{onClick:async()=>{h.length>0&&(m(!0),p("Added to collection","Failed to add to collection",(await (0,b.Dn)(h.map(i4),e.id)).ok),m(!1))},className:(0,C.cn)(t,"group"),children:[(0,i.jsx)(i0.fL,{channel:e}),(0,i.jsxs)("div",{className:"absolute inset-0 hidden flex-col items-center justify-center bg-giphyBlack/75 p-4 group-hover:flex",children:[(0,i.jsx)("div",{className:"text-lg font-bold",children:"Add to channel"}),(0,i.jsx)(iY.A,{className:"size-4 fill-giphyWhite"})]})]},e.id):(0,i.jsxs)("div",{className:t,onClick:()=>{f(e.id)},children:[(0,i.jsx)(i0.fL,{channel:e}),(0,i.jsx)(i0.sS,{count:e.num_children})]},e.id)}),!k&&(0,i.jsx)("div",{ref:w,className:"col-span-2 flex flex-1 justify-center",children:(0,i.jsx)(iX.A,{})})]}),d[10]=j,d[11]=k,d[12]=h,d[13]=x,d[14]=v,d[15]=w,d[16]=f,d[17]=p,d[18]=s):s=d[18],d[19]!==a||d[20]!==$||d[21]!==s?(l=(0,i.jsx)("div",{className:a,children:s},$),d[19]=a,d[20]=$,d[21]=s,d[22]=l):l=d[22],d[23]!==t||d[24]!==n||d[25]!==o||d[26]!==l?(c=(0,i.jsxs)("div",{className:"isolate flex h-full flex-col gap-2 p-2",children:[t,n,o,l]}),d[23]=t,d[24]=n,d[25]=o,d[26]=l,d[27]=c):c=d[27],c},i5=e=>{let t,n=(0,r.c)(3),{channelId:o,gifs:a}=e,{user:s}=(0,A.useContext)(iF.A),[l,c]=(0,A.useState)(o||s?.channel_id);return n[0]!==l||n[1]!==a?(t=l?(0,i.jsx)(i3,{channelId:l,setChannel:c,gifs:a},l):null,n[0]=l,n[1]=a,n[2]=t):t=n[2],t};function i4(e){return e.id}var i7=n(97509),i6=n(28131),i8=n(23305);let i9=e=>{let t,n,o,a,s,l=(0,r.c)(20),{permissions:c,gifs:d,onClose:u}=e,{user:h}=(0,A.useContext)(iF.A),f=(0,i8.Qt)(),g=(0,i8.zW)(),[p]=(0,i6.A)("Escape"),[x,m]=(0,A.useState)(""),b=(0,A.useRef)(!1);return l[0]!==g||l[1]!==p||l[2]!==u?(t=()=>{p&&!b.current&&(b.current=!0,Object.keys(g).length>0?(0,i8.Cl)():u(),setTimeout(()=>{b.current=!1},100))},l[0]=g,l[1]=p,l[2]=u,l[3]=t):t=l[3],l[4]!==p||l[5]!==u?(n=[p,u],l[4]=p,l[5]=u,l[6]=n):n=l[6],(0,A.useEffect)(t,n),l[7]!==x||l[8]!==f?(o=()=>
6(m(document.body.style.overflow),f&&(window.scrollTo(0,0),document.body.scrollTop=0,document.body.style.overflow="hidden"),()=>{document.body.style.overflow=x}),a=[x,f],l[7]=x,l[8]=f,l[9]=o,l[10]=a):(o=l[9],a=l[10]),(0,A.useEffect)(o,a),l[11]!==d||l[12]!==u||l[13]!==c||l[14]!==f||l[15]!==h?.channel_id||l[16]!==h?.is_staff||l[17]!==h?.is_verified||l[18]!==h?.permissions?(s=f?(0,i7.createPortal)((0,i.jsx)("div",{className:"no-scrollbar fixed top-0 right-0 bottom-0 z-modal flex h-full overflow-y-auto bg-giphyBlack ",style:{width:P.gH},children:d?.length>0?(0,i.jsx)(iM,{closeable:!0,className:"mx-4 my-1 flex-1",colorScheme:"panel",gifs:d,loading:!1,collectionsComponent:(0,i.jsx)(i5,{channelId:h?.channel_id,gifs:d}),permissions:{altText:!1,cta:!!h?.is_verified,delete:c.delete,featureTag:c.feature_tags,languageTags:!!h?.permissions.edit_language_tags,labels:!!h?.is_staff,metadata:c.extended_metadata,privacy:c.hide,rate:c.rate,staff:!!h?.is_staff,tag:c.tag,tagCounts:c.tag_counts,takedown:!!h?.permissions.can_takedown_content},onClose:()=>{u()}}):(0,i.jsxs)("div",{className:"flex flex-col bg-giphyDarkestGrey",children:[(0,i.jsx)("div",{className:"flex justify-end p-4",children:(0,i.jsx)(iK.A,{className:"size-8 fill-giphyWhite",onClick:()=>u()})}),(0,i.jsxs)("div",{className:"mx-4 my-40 flex flex-col items-center justify-center p-2",children:[(0,i.jsxs)("div",{className:"relative mb-6 bg-giphyBlack px-6 py-4 text-center font-bold text-pretty text-giphyLightGrey",children:[(0,i.jsx)("div",{className:"absolute top-[-100px] right-0 left-0 flex justify-center",children:(0,i.jsx)("img",{src:"https://giphy.com/static/img/PEEKERS_DIDYOUMEAN.gif",width:"165",height:"198",alt:""})}),(0,i.jsx)("p",{className:"px-4 text-lg",children:"You haven't selected anything for editing yet!"})]}),(0,i.jsx)("pre",{className:"text-[15px] text-pretty",children:(0,i.jsxs)("ol",{children:[(0,i.jsx)("li",{children:"Click to select GIFs"}),(0,i.jsx)("li",{children:"Cmd + Click to multiselect"}),(0,i.jsx)("li",{children:"Escape to close the panel"})]})})]})]})}),document.body):null,l[11]=d,l[12]=u,l[13]=c,l[14]=f,l[15]=h?.channel_id,l[16]=h?.is_staff,l[17]=h?.is_verified,l[18]=h?.permissions,l[19]=s):s=l[19],s};function re(e){return{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded","X-CSRFToken":(0,u.Ri)("csrftoken"),"X-Requested-With":"XMLHttpRequest",credentials:"same-origin"},body:new URLSearchParams(e).toString()}}let rt=async(e,t,n)=>{let i=await fetch(`${c.Dd}/ajax/gif/update`,re({gif_id:e,key:t,value:n})),r=await i.json();if(r.code<200||r.code>=300)throw Error(r.message);return r?.data},rn=async(e,t,n)=>Promise.all(e.map(e=>rt(e,t,n))),ri=async(e,t,n)=>{let i=new FormData;i.append("lang",n.toUpperCase().replace("-","_")),t.forEach(e=>i.append("tags[]",e));let r=await fetch(`${c.Dd}/ajax/gif/${e}/language-tags`,re(i));return await r.json()},rr=async(e,t,n)=>(await fetch(`${c.Dd}/ajax/gif/${e}/language-tags?tag=${encodeURIComponent(t)}&lang=${n.toUpperCase().replace("-","_")}`,{...re({}),method:"DELETE"})).json(),ro=async(e,t)=>{let n=t.map(e=>e.language||"en").filter((e,t,n)=>n.indexOf(e)===t),i=[];return e.forEach(e=>{1===n.length&&"en"!==n[0]?i.push(ri(e,t.map(e=>e.text),n[0])):t.forEach(t=>{t.language&&"en"!==t.language?i.push(ri(e,[t.text],t.language)):i.push(ra([e],[t.text]))})}),Promise.all(i)},ra=async(e,t)=>{let n=[];return e.forEach(e=>{t.forEach(t=>{n.push(rt(e,"create_tag",t))})}),Promise.all(n)},rs=async(e,t)=>Promise.all(e.map(e=>t.language&&"en"!==t.language?rr(e,t.text,t.language):rl([e],t.text))),rl=async(e,t)=>Promise.all(e.map(e=>rt(e,"delete_tag",t))),rc=async e=>ra(e,[t9]),rd=async e=>Promise.all([rl(e,t9),ra(e,[t8])]),ru=async e=>rl(e,t8),{serviceGatewayUrl:rh}=c.OT,rf=`${rh}v1/trendingscheduler`,rg=async(e,t,n,i="")=>{if(!i)throw Error("Missing tagger API key");let r=t.getTime();try{return(await fetch(`${rf}/schedule/?timestamp=${r}&api_key=${i}&access_token=${n}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({gifs:e.map(e=>({id:e.id,is_sticker:e.is_sticker,type:e.type}))})})).json()}catch(e){console.error(e,"Backend error trying to schedule GIFs to trend.")}};async function rp(e,t,n,i="",r=""){let o=e.map(e=>`${e.id}`);switch(t){case"add-tags":return ro(o,n);case"delete":return rn(o,"delete_gif",!0);case"explicit":return rn(o,"mark_explicit",!0);case"feature-tag":return rn(o,"feature_tag",n);case"queue":return rc(o);case"remove-all-tags":return rn(o,"delete_all_tags",!0);case"remove-tag":return rs(o,n);case"repair":return rn(o,"repair_media",!0);case"schedule":return rg(e.filter(e=>o.indexOf(`${e.id}`)>-1),n,i,r);case"trend":return rd(o);case"untrend":return ru(o);case"unfeature-tag":return rn(o,"unfeature_tag",n);default:return Promise.resolve()}}async function rx(e,t){let n=(0,e5.N7)(e),i={};return i[n]=t,i}async function rm(e,t,n){let i=await rx(t,n);return e.map(e=>({...e,...i}))}async function rb(e,t,n){let i=e.map(e=>`${e.id}`),r=(0,e5.N7)(t);return"no-trend"===t?n?ra(i,[t6]):rl(i,t6):rn(i,r,n)}var ry=n(71972);let rv={channel:!1,delete:!1,edit:!1,hide:!1,rate:!1,tag:!1,view:!1,feature_tags:!1,extended_metadata:!1,tag_counts:!1,can_download:!1};function rw(e){return e.permissions}let rj={},rC=(0,ry.v)()(e=>rj),rk=e=>{let t,n=(0,r.c)(2);return n[0]!==e?(t=t=>t[e],n[0]=e,n[1]=t):t=n[1],rC(t)},rA=Symbol("is_deleted"),r_=e=>!!e&&e.isDeleted===rA,r$=(0,A.createContext)({}),rI=({children:e})=>{let{user:t,taggerApiKey:n}=(0,A.useContext)(iF.A),[o,c]=(0,A.useState)(!1),{showMessage:d}=(0,A.useContext)(nC.p),u=(0,i8.zW)(),h=(0,i8.Qt)(),g=(0,A.useMemo)(()=>Object.values(u).map(({gif:e})=>e),[u]),[y,v]=(0,A.useState)([]),[w,j]=(0,A.useState)(!1),[C,k]=(0,A.useState)(!1),_=function(e){let t,n=(0,r.c)(2);e:{let i;if(!e.length){t=rv;break e}if(n[0]!==e){let t=e.map(rw);i={}
6,Object.keys(rv).forEach(e=>{i[e]=t.every(t=>!0===t[e])}),n[0]=e,n[1]=i}else i=n[1];t=i}return t}(y),$=(0,A.useMemo)(()=>y.map(e=>e.gif).reverse(),[y]);async function I(e){if(!(y.findIndex(t=>`${t.gif.id}`==`${e}`)>-1))try{j(!0);let t=await (0,l.Lc)(`${e}`);v(e=>[...e,t])}catch(e){d("An error occurred while loading details.",{style:"error"})}finally{j(!1)}}function S(){(0,i8.vU)(!1),(0,i8.Cl)(),v([])}async function N(e){return await (0,b.jQ)({slug:e}).then(({user:e})=>e)}async function z(e,i,r){await rp($.filter(t=>e.includes(`${t.id}`)),i,r,t?.token,n),"takedown"===i&&k(!0),v(t=>t.map(t=>{if(e.includes(`${t.gif.id}`)){var n,o;let e,a=(e=function(e,t,n){switch(t){case"add-tags":return{tags:[...e.tags,...n.filter(e=>!e.language||"en"===e.language).map(e=>e.text)]};case"feature-tag":return{featured_tags:[...e.featured_tags,n]};case"queue":case"schedule":return{tags:[...e.tags,t9]};case"remove-tag":return{tags:e.tags.filter(e=>e!==n.text)};case"trend":return{tags:[...e.tags.filter(e=>e!==t9)]};case"untrend":return{tags:[...e.tags.filter(e=>e!==t8)]};case"unfeature-tag":return{featured_tags:e.featured_tags.filter(e=>e!==n)};default:return{}}}(n=t.gif,i,r),{...n,...e});return"delete"===i&&(a={...a,isDeleted:rA}),o=a,setTimeout(()=>{var e;e=o,rC.setState(t=>({...t,[e.id]:e}))},10),{...t,gif:a}}return t}))}async function T(e,t,n){let i=$.filter(t=>e.includes(`${t.id}`));await rb(i,t,n),i=await rm(i,t,n),v(e=>e.map(e=>{let t=i.findIndex(t=>t.id===e.gif.id);return t>-1?{...e,gif:i[t]}:e}))}return(0,A.useEffect)(()=>{h&&g.map(e=>e.id).join(",")!==y.map(e=>e.gif.id).join(",")&&(async()=>{j(!0),v(await Promise.all(g.map(async e=>await (0,l.Lc)(`${e.id}`)))),j(!1)})()},[h,g,y,$]),(0,i.jsx)(r$.Provider,{value:{gifs:$,addToEdit:I,closeEdit:S,removeFromEdit:function(e){v(t=>t.filter(t=>t.gif.id!==e))},setStaffMode:c,staffMode:o},children:(0,i.jsxs)(tp.s.Provider,{value:{addGifLabel:p,fetchLanguageTags:l.S_,fetchGifLabels:f,fetchMetadata:a,fetchExtendedMetadata:s,fetchTagCounts:l.Rm,fetchUserByUsern
6ame:N,fetchViewCount:l.Zc,onAction:z,onChange:T,removeGifLabel:x},children:[e,h?(0,i.jsx)(i9,{permissions:_,gifs:$,onClose:S}):(0,i.jsx)(iB,{gifs:$,loading:w,permissions:_,onClose:S}),C&&(0,i.jsx)(m.aF,{onClose:()=>{k(!1)},title:"Content Takedown",children:(0,i.jsx)(E,{gifIds:$.map(e=>e.id),onClose:()=>{k(!1)}})})]})})}},90291:(e,t,n)=>{n.d(t,{V:()=>r,f:()=>i});let i=["clip","gif","sticker"],r=["unrated","g","pg","pg13","r"]},90296:(e,t,n)=>{n.r(t),n.d(t,{default:()=>h});var i=n(54568),r=n(26274),o=n(7620),a=n(54713);let s="rgba(166, 166, 166, .4)",l=a.Ay.div.withConfig({componentId:"sc-6d455137-0"})(["background:transparent;border:2px solid ",";border-radius:50%;box-sizing:border-box;height:","px;left:0;position:relative;top:0;width:","px;&:after{background:",";border-radius:inherit;bottom:2px;content:'';left:2px;position:absolute;right:2px;top:2px;transition:background-color 0.2s ease-out;background-color:transparent;","}pointer-events:none;"],s,22,22,s,({$isChecked:e,$isYes:t})=>t&&e?(0,a.AH)(["background-color:",";"],r.DK):!t&&e?(0,a.AH)(["background-color:",";"],r.ze):(0,a.AH)(["background-color:transparent;"])),c=a.Ay.div.withConfig({componentId:"sc-6d455137-1"})(["display:flex;align-items:center;margin-left:8px;opacity:0.5;"]),d=a.Ay.label.withConfig({componentId:"sc-6d455137-2"})(["margin-left:8px;font-size:0.9em;"]),u=a.Ay.div.withConfig({componentId:"sc-6d455137-3"})(["display:flex;justify-content:center;align-items:center;"]),h=({metadata:e})=>{let t=e.is_searchable;return(0,o.useEffect)(()=>{},[e.is_indexed]),(0,i.jsxs)(u,{children:[(0,i.jsxs)(c,{children:[(0,i.jsx)(l,{$isChecked:!1===t,$isYes:!1}),(0,i.jsx)(d,{children:"No"})]}),(0,i.jsxs)(c,{children:[(0,i.jsx)(l,{$isChecked:!0===t,$isYes:!0}),(0,i.jsx)(d,{children:"Yes"})]})]})}},91769:(e,t,n)=>{n.d(t,{Lc:()=>o,Rm:()=>s,S_:()=>a,Zc:()=>l});var i=n(48828),r=n(98062);let o=async e=>{let t=await fetch(`${i.Dd}/ajax/gif/${e}/detail`,(0,r.fG)()),{result:n}=await t.json();return n},a=async(e,t)=>{let n=e.join(","),o=t.toUpperCase().replace("-","_"),a=`${i.Dd}/ajax/gif/bulk/language-tags`,s=await fetch(`${a}?gif_ids=${n}&lang=${o}`,(0,r.fG)()),{result:l}=await s.json();return l?.gifs||[]},s=async e=>{let t=await fetch(`${i.Dd}/ajax/gif/${e}/tag-counts`,(0,r.fG)()),{result:n}=await t.json();return n?.tag_counts||{}},l=async e=>{let t=await fetch(`${i.Dd}/api/v1/proxy-gif/${e}/view-count/`,(0,r.fG)()),n=await t.json();return n?.viewCount||0}},95750:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(54568),r=n(99680),o=n(83352),a=n(17397),s=n(54713),l=n(61848);let c=(0,s.i7)(["0%{translate:-50% 0;}100%{translate:-50% 100%;}"]),d=s.Ay.div.withConfig({componentId:"sc-4de5a4f0-0"})(["bottom:100%;left:50%;position:fixed;transition:translate 0.3s ease-in-out;translate:-50% 0;width:100%;z-index:",";",""],l.wR+1,({$open:e})=>e&&(0,s.AH)(["animation:"," 0.3s ease-in-out;translate:-50% 100%;transition-delay:0.15s;"],c)),u=e=>{let t,n,s,l,c,u,h,f=(0,r.c)(15);f[0]!==e?({children:t,isOpen:l,onCloseEnd:n,...s}=e,f[0]=e,f[1]=t,f[2]=n,f[3]=s,f[4]=l):(t=f[1],n=f[2],s=f[3],l=f[4]);let g=void 0!==l&&l;f[5]!==g||f[6]!==n?(c=function(){g||n?.()},f[5]=g,f[6]=n,f[7]=c):c=f[7];let p=c;return f[8]!==t||f[9]!==s?(u=(0,i.jsx)(a.A,{...s,children:t}),f[8]=t,f[9]=s,f[10]=u):u=f[10],f[11]!==g||f[12]!==p||f[13]!==u?(h=(0,i.jsx)(o.A,{children:(0,i.jsx)(d,{$open:g,onTransitionEnd:p,children:u})}),f[11]=g,f[12]=p,f[13]=u,f[14]=h):h=f[14],h}}}]); 7//# sourceMappingURL=8267-654a1f8b0232daab.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.