@amityco/ui-kit-open-source 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +52 -54
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +52 -54
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -71,7 +71,7 @@ as for instance in your render method then you may be running into this limitati
|
|
|
71
71
|
|
|
72
72
|
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
|
|
73
73
|
Has styled-components' style tag been unmounted or altered by another script?
|
|
74
|
-
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function kh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o=e[0],r=[],n=1,i=e.length;n<i;n+=1)r.push(e[n]);return r.forEach(function(a){o=o.replace(/%[a-z]/,a);}),o}function Re(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(kh.apply(void 0,ir([Lh[e]],t,!1)).trim())}var Fh=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t;}return e.prototype.indexOfGroup=function(t){for(var o=0,r=0;r<t;r++)o+=this.groupSizes[r];return o},e.prototype.insertRules=function(t,o){if(t>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;t>=i;)if((i<<=1)<0)throw Re(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var a=n;a<i;a++)this.groupSizes[a]=0;}for(var l=this.indexOfGroup(t+1),m=(a=0,o.length);a<m;a++)this.tag.insertRule(l,o[a])&&(this.groupSizes[t]++,l++);},e.prototype.clearGroup=function(t){if(t<this.length){var o=this.groupSizes[t],r=this.indexOfGroup(t),n=r+o;this.groupSizes[t]=0;for(var i=r;i<n;i++)this.tag.deleteRule(r);}},e.prototype.getGroup=function(t){var o="";if(t>=this.length||this.groupSizes[t]===0)return o;for(var r=this.groupSizes[t],n=this.indexOfGroup(t),i=n+r,a=n;a<i;a++)o+="".concat(this.tag.getRule(a)).concat(Fa);return o},e}(),s1=new Map,d1=new Map,a1=1,r1=function(e){if(s1.has(e))return s1.get(e);for(;d1.has(a1);)a1++;var t=a1++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw Re(16,"".concat(t));return s1.set(e,t),d1.set(t,e),t},Ah=function(e,t){a1=t+1,s1.set(e,t),d1.set(t,e);},Dh="style[".concat(co,"][").concat(l1,'="').concat(Hr,'"]'),Bh=new RegExp("^".concat(co,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),zh=function(e,t,o){for(var r,n=o.split(","),i=0,a=n.length;i<a;i++)(r=n[i])&&e.registerName(t,r);},Oh=function(e,t){for(var o,r=((o=t.textContent)!==null&&o!==void 0?o:"").split(Fa),n=[],i=0,a=r.length;i<a;i++){var l=r[i].trim();if(l){var m=l.match(Bh);if(m){var p=0|parseInt(m[1],10),u=m[2];p!==0&&(Ah(u,p),zh(e,u,m[3]),e.getTag().insertRules(p,n)),n.length=0;}else n.push(l);}}};function Na(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:null}var ym=function(e){var t=document.head,o=e||t,r=document.createElement("style"),n=function(l){var m=Array.from(l.querySelectorAll("style[".concat(co,"]")));return m[m.length-1]}(o),i=n!==void 0?n.nextSibling:null;r.setAttribute(co,dm),r.setAttribute(l1,Hr);var a=Na();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},Uh=function(){function e(t){this.element=ym(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var r=document.styleSheets,n=0,i=r.length;n<i;n++){var a=r[n];if(a.ownerNode===o)return a}throw Re(17)}(this.element),this.length=0;}return e.prototype.insertRule=function(t,o){try{return this.sheet.insertRule(o,t),this.length++,!0}catch(r){return !1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--;},e.prototype.getRule=function(t){var o=this.sheet.cssRules[t];return o&&o.cssText?o.cssText:""},e}(),jh=function(){function e(t){this.element=ym(t),this.nodes=this.element.childNodes,this.length=0;}return e.prototype.insertRule=function(t,o){if(t<=this.length&&t>=0){var r=document.createTextNode(o);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return !1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),Hh=function(){function e(t){this.rules=[],this.length=0;}return e.prototype.insertRule=function(t,o){return t<=this.length&&(this.rules.splice(t,0,o),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),rm=c1,Vh={isServer:!c1,useCSSOMInjection:!gh},Yn=function(){function e(t,o,r){t===void 0&&(t=Vr),o===void 0&&(o={});var n=this;this.options=Ee(Ee({},Vh),t),this.gs=o,this.names=new Map(r),this.server=!!t.isServer,!this.server&&c1&&rm&&(rm=!1,function(i){for(var a=document.querySelectorAll(Dh),l=0,m=a.length;l<m;l++){var p=a[l];p&&p.getAttribute(co)!==dm&&(Oh(i,p),p.parentNode&&p.parentNode.removeChild(p));}}(this)),Da(this,function(){return function(i){for(var a=i.getTag(),l=a.length,m="",p=function(c){var g=function(h){return d1.get(h)}(c);if(g===void 0)return "continue";var f=i.names.get(g),C=a.getGroup(c);if(f===void 0||C.length===0)return "continue";var v="".concat(co,".g").concat(c,'[id="').concat(g,'"]'),y="";f!==void 0&&f.forEach(function(h){h.length>0&&(y+="".concat(h,","));}),m+="".concat(C).concat(v,'{content:"').concat(y,'"}').concat(Fa);},u=0;u<l;u++)p(u);return m}(n)});}return e.registerId=function(t){return r1(t)},e.prototype.reconstructWithOptions=function(t,o){return o===void 0&&(o=!0),new e(Ee(Ee({},this.options),t),this.gs,o&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(o){var r=o.useCSSOMInjection,n=o.target;return o.isServer?new Hh(n):r?new Uh(n):new jh(n)}(this.options),new Fh(t)));var t;},e.prototype.hasNameForId=function(t,o){return this.names.has(t)&&this.names.get(t).has(o)},e.prototype.registerName=function(t,o){if(r1(t),this.names.has(t))this.names.get(t).add(o);else {var r=new Set;r.add(o),this.names.set(t,r);}},e.prototype.insertRules=function(t,o,r){this.registerName(t,o),this.getTag().insertRules(r1(t),r);},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear();},e.prototype.clearRules=function(t){this.getTag().clearGroup(r1(t)),this.clearNames(t);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),$h=/&/g,Gh=/^\s*\/\/.*$/gm;function vm(e,t){return e.map(function(o){return o.type==="rule"&&(o.value="".concat(t," ").concat(o.value),o.value=o.value.replaceAll(",",",".concat(t," ")),o.props=o.props.map(function(r){return "".concat(t," ").concat(r)})),Array.isArray(o.children)&&o.type!=="@keyframes"&&(o.children=vm(o.children,t)),o})}function xm(e){var t,o,r,n=e===void 0?Vr:e,i=n.options,a=i===void 0?Vr:i,l=n.plugins,m=l===void 0?u1:l,p=function(g,f,C){return C.startsWith(o)&&C.endsWith(o)&&C.replaceAll(o,"").length>0?".".concat(t):g},u=m.slice();u.push(function(g){g.type===et.RULESET&&g.value.includes("&")&&(g.props[0]=g.props[0].replace($h,o).replace(r,p));}),a.prefix&&u.push(et.prefixer),u.push(et.stringify);var c=function(g,f,C,v){f===void 0&&(f=""),C===void 0&&(C=""),v===void 0&&(v="&"),t=v,o=f,r=new RegExp("\\".concat(o,"\\b"),"g");var y=g.replace(Gh,""),h=et.compile(C||f?"".concat(C," ").concat(f," { ").concat(y," }"):y);a.namespace&&(h=vm(h,a.namespace));var x=[];return et.serialize(h,et.middleware(u.concat(et.rulesheet(function(T){return x.push(T)})))),x};return c.hash=m.length?m.reduce(function(g,f){return f.name||Re(15),sr(g,f.name)},pm).toString():"",c}var _h=new Yn,Ea=xm(),Ba=B.createContext({shouldForwardProp:void 0,styleSheet:_h,stylis:Ea});Ba.Consumer;B.createContext(void 0);function La(){return useContext(Ba)}var nm=function(){function e(t,o){var r=this;this.inject=function(n,i){i===void 0&&(i=Ea);var a=r.name+i.hash;n.hasNameForId(r.id,a)||n.insertRules(r.id,a,i(r.rules,a,"@keyframes"));},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=o,Da(this,function(){throw Re(12,String(r.name))});}return e.prototype.getName=function(t){return t===void 0&&(t=Ea),this.name+t.hash},e}(),Zh=function(e){return e>="A"&&e<="Z"};function im(e){for(var t="",o=0;o<e.length;o++){var r=e[o];if(o===1&&r==="-"&&e[0]==="-")return e;Zh(r)?t+="-"+r.toLowerCase():t+=r;}return t.startsWith("ms-")?"-"+t:t}var Mm=function(e){return e==null||e===!1||e===""},bm=function(e){var t,o,r=[];for(var n in e){var i=e[n];e.hasOwnProperty(n)&&!Mm(i)&&(Array.isArray(i)&&i.isCss||lr(i)?r.push("".concat(im(n),":"),i,";"):$r(i)?r.push.apply(r,ir(ir(["".concat(n," {")],bm(i),!1),["}"],!1)):r.push("".concat(im(n),": ").concat((t=n,(o=i)==null||typeof o=="boolean"||o===""?"":typeof o!="number"||o===0||t in W0||t.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function zo(e,t,o,r){if(Mm(e))return [];if(Aa(e))return [".".concat(e.styledComponentId)];if(lr(e)){if(!lr(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return [e];var n=e(t);return process.env.NODE_ENV==="production"||typeof n!="object"||Array.isArray(n)||n instanceof nm||$r(n)||n===null||console.error("".concat(um(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),zo(n,t,o,r)}var i;return e instanceof nm?o?(e.inject(o,r),[e.getName(r)]):[e]:$r(e)?bm(e):Array.isArray(e)?Array.prototype.concat.apply(u1,e.map(function(a){return zo(a,t,o,r)})):[e.toString()]}function Im(e){for(var t=0;t<e.length;t+=1){var o=e[t];if(lr(o)&&!Aa(o))return !1}return !0}var Qh=cm(Hr),Wh=function(){function e(t,o,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&Im(t),this.componentId=o,this.baseHash=sr(Qh,o),this.baseStyle=r,Yn.registerId(o);}return e.prototype.generateAndInjectStyles=function(t,o,r){var n=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,o,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&o.hasNameForId(this.componentId,this.staticRulesId))n=ar(n,this.staticRulesId);else {var i=m1(zo(this.rules,t,o,r)),a=Sa(sr(this.baseHash,i)>>>0);if(!o.hasNameForId(this.componentId,a)){var l=r(i,".".concat(a),void 0,this.componentId);o.insertRules(this.componentId,a,l);}n=ar(n,a),this.staticRulesId=a;}else {for(var m=sr(this.baseHash,r.hash),p="",u=0;u<this.rules.length;u++){var c=this.rules[u];if(typeof c=="string")p+=c,process.env.NODE_ENV!=="production"&&(m=sr(m,c));else if(c){var g=m1(zo(c,t,o,r));m=sr(m,g+u),p+=g;}}if(p){var f=Sa(m>>>0);o.hasNameForId(this.componentId,f)||o.insertRules(this.componentId,f,r(p,".".concat(f),void 0,this.componentId)),n=ar(n,f);}}return n},e}(),p1=B.createContext(void 0);p1.Consumer;function wm(e){var t=B.useContext(p1),o=useMemo(function(){return function(r,n){if(!r)throw Re(14);if(lr(r)){var i=r(n);if(process.env.NODE_ENV!=="production"&&(i===null||Array.isArray(i)||typeof i!="object"))throw Re(7);return i}if(Array.isArray(r)||typeof r!="object")throw Re(8);return n?Ee(Ee({},n),r):r}(e.theme,t)},[e.theme,t]);return e.children?B.createElement(p1.Provider,{value:o},e.children):null}var wa={},sm=new Set;function Kh(e,t,o){var r=Aa(e),n=e,i=!Ia(e),a=t.attrs,l=a===void 0?u1:a,m=t.componentId,p=m===void 0?function(S,b){var w=typeof S!="string"?"sc":X0(S);wa[w]=(wa[w]||0)+1;var N="".concat(w,"-").concat(Mh(Hr+w+wa[w]));return b?"".concat(b,"-").concat(N):N}(t.displayName,t.parentComponentId):m,u=t.displayName,c=u===void 0?function(S){return Ia(S)?"styled.".concat(S):"Styled(".concat(um(S),")")}(e):u,g=t.displayName&&t.componentId?"".concat(X0(t.displayName),"-").concat(t.componentId):t.componentId||p,f=r&&n.attrs?n.attrs.concat(l).filter(Boolean):l,C=t.shouldForwardProp;if(r&&n.shouldForwardProp){var v=n.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;C=function(S,b){return v(S,b)&&y(S,b)};}else C=v;}var h=new Wh(o,g,r?n.componentStyle:void 0);function x(S,b){return function(w,N,A){var V=w.attrs,q=w.componentStyle,D=w.defaultProps,_=w.foldedComponentIds,k=w.styledComponentId,ce=w.target,se=B.useContext(p1),xe=La(),Te=w.shouldForwardProp||xe.shouldForwardProp;process.env.NODE_ENV!=="production"&&useDebugValue(k);var Ve=hh(N,se,D)||Vr,Ne=function(ie,Ie,Ze){for(var ut,ge=Ee(Ee({},Ie),{className:void 0,theme:Ze}),qn=0;qn<ie.length;qn+=1){var rr=lr(ut=ie[qn])?ut(ge):ut;for(var Wt in rr)ge[Wt]=Wt==="className"?ar(ge[Wt],rr[Wt]):Wt==="style"?Ee(Ee({},ge[Wt]),rr[Wt]):rr[Wt];}return Ie.className&&(ge.className=ar(ge.className,Ie.className)),ge}(V,N,Ve),ze=Ne.as||ce,Me={};for(var be in Ne)Ne[be]===void 0||be[0]==="$"||be==="as"||be==="theme"&&Ne.theme===Ve||(be==="forwardedAs"?Me.as=Ne.forwardedAs:Te&&!Te(be,ze)||(Me[be]=Ne[be],Te||process.env.NODE_ENV!=="development"||Y0(be)||sm.has(be)||!Pa.has(ze)||(sm.add(be),console.warn('styled-components: it looks like an unknown prop "'.concat(be,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var pt=function(ie,Ie){var Ze=La(),ut=ie.generateAndInjectStyles(Ie,Ze.styleSheet,Ze.stylis);return process.env.NODE_ENV!=="production"&&useDebugValue(ut),ut}(q,Ne);process.env.NODE_ENV!=="production"&&w.warnTooManyClasses&&w.warnTooManyClasses(pt);var ct=ar(_,k);return pt&&(ct+=" "+pt),Ne.className&&(ct+=" "+Ne.className),Me[Ia(ze)&&!Pa.has(ze)?"class":"className"]=ct,Me.ref=A,createElement(ze,Me)}(T,S,b)}x.displayName=c;var T=B.forwardRef(x);return T.attrs=f,T.componentStyle=h,T.displayName=c,T.shouldForwardProp=C,T.foldedComponentIds=r?ar(n.foldedComponentIds,n.styledComponentId):"",T.styledComponentId=g,T.target=r?n.target:e,Object.defineProperty(T,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(S){this._foldedDefaultProps=r?function(b){for(var w=[],N=1;N<arguments.length;N++)w[N-1]=arguments[N];for(var A=0,V=w;A<V.length;A++)Ta(b,V[A],!0);return b}({},n.defaultProps,S):S;}}),process.env.NODE_ENV!=="production"&&(Ch(c,g),T.warnTooManyClasses=function(S,b){var w={},N=!1;return function(A){if(!N&&(w[A]=!0,Object.keys(w).length>=200)){var V=b?' with the id of "'.concat(b,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(S).concat(V,`.
|
|
74
|
+
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function kh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o=e[0],r=[],n=1,i=e.length;n<i;n+=1)r.push(e[n]);return r.forEach(function(a){o=o.replace(/%[a-z]/,a);}),o}function Re(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(kh.apply(void 0,ir([Lh[e]],t,!1)).trim())}var Fh=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t;}return e.prototype.indexOfGroup=function(t){for(var o=0,r=0;r<t;r++)o+=this.groupSizes[r];return o},e.prototype.insertRules=function(t,o){if(t>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;t>=i;)if((i<<=1)<0)throw Re(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var a=n;a<i;a++)this.groupSizes[a]=0;}for(var l=this.indexOfGroup(t+1),m=(a=0,o.length);a<m;a++)this.tag.insertRule(l,o[a])&&(this.groupSizes[t]++,l++);},e.prototype.clearGroup=function(t){if(t<this.length){var o=this.groupSizes[t],r=this.indexOfGroup(t),n=r+o;this.groupSizes[t]=0;for(var i=r;i<n;i++)this.tag.deleteRule(r);}},e.prototype.getGroup=function(t){var o="";if(t>=this.length||this.groupSizes[t]===0)return o;for(var r=this.groupSizes[t],n=this.indexOfGroup(t),i=n+r,a=n;a<i;a++)o+="".concat(this.tag.getRule(a)).concat(Fa);return o},e}(),s1=new Map,d1=new Map,a1=1,r1=function(e){if(s1.has(e))return s1.get(e);for(;d1.has(a1);)a1++;var t=a1++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw Re(16,"".concat(t));return s1.set(e,t),d1.set(t,e),t},Ah=function(e,t){a1=t+1,s1.set(e,t),d1.set(t,e);},Dh="style[".concat(co,"][").concat(l1,'="').concat(Hr,'"]'),Bh=new RegExp("^".concat(co,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),zh=function(e,t,o){for(var r,n=o.split(","),i=0,a=n.length;i<a;i++)(r=n[i])&&e.registerName(t,r);},Oh=function(e,t){for(var o,r=((o=t.textContent)!==null&&o!==void 0?o:"").split(Fa),n=[],i=0,a=r.length;i<a;i++){var l=r[i].trim();if(l){var m=l.match(Bh);if(m){var p=0|parseInt(m[1],10),u=m[2];p!==0&&(Ah(u,p),zh(e,u,m[3]),e.getTag().insertRules(p,n)),n.length=0;}else n.push(l);}}};function Na(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:null}var ym=function(e){var t=document.head,o=e||t,r=document.createElement("style"),n=function(l){var m=Array.from(l.querySelectorAll("style[".concat(co,"]")));return m[m.length-1]}(o),i=n!==void 0?n.nextSibling:null;r.setAttribute(co,dm),r.setAttribute(l1,Hr);var a=Na();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},Uh=function(){function e(t){this.element=ym(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(o){if(o.sheet)return o.sheet;for(var r=document.styleSheets,n=0,i=r.length;n<i;n++){var a=r[n];if(a.ownerNode===o)return a}throw Re(17)}(this.element),this.length=0;}return e.prototype.insertRule=function(t,o){try{return this.sheet.insertRule(o,t),this.length++,!0}catch(r){return !1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--;},e.prototype.getRule=function(t){var o=this.sheet.cssRules[t];return o&&o.cssText?o.cssText:""},e}(),jh=function(){function e(t){this.element=ym(t),this.nodes=this.element.childNodes,this.length=0;}return e.prototype.insertRule=function(t,o){if(t<=this.length&&t>=0){var r=document.createTextNode(o);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return !1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),Hh=function(){function e(t){this.rules=[],this.length=0;}return e.prototype.insertRule=function(t,o){return t<=this.length&&(this.rules.splice(t,0,o),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--;},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),rm=c1,Vh={isServer:!c1,useCSSOMInjection:!gh},Yn=function(){function e(t,o,r){t===void 0&&(t=Vr),o===void 0&&(o={});var n=this;this.options=Ee(Ee({},Vh),t),this.gs=o,this.names=new Map(r),this.server=!!t.isServer,!this.server&&c1&&rm&&(rm=!1,function(i){for(var a=document.querySelectorAll(Dh),l=0,m=a.length;l<m;l++){var p=a[l];p&&p.getAttribute(co)!==dm&&(Oh(i,p),p.parentNode&&p.parentNode.removeChild(p));}}(this)),Da(this,function(){return function(i){for(var a=i.getTag(),l=a.length,m="",p=function(c){var g=function(h){return d1.get(h)}(c);if(g===void 0)return "continue";var f=i.names.get(g),C=a.getGroup(c);if(f===void 0||C.length===0)return "continue";var v="".concat(co,".g").concat(c,'[id="').concat(g,'"]'),y="";f!==void 0&&f.forEach(function(h){h.length>0&&(y+="".concat(h,","));}),m+="".concat(C).concat(v,'{content:"').concat(y,'"}').concat(Fa);},u=0;u<l;u++)p(u);return m}(n)});}return e.registerId=function(t){return r1(t)},e.prototype.reconstructWithOptions=function(t,o){return o===void 0&&(o=!0),new e(Ee(Ee({},this.options),t),this.gs,o&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(o){var r=o.useCSSOMInjection,n=o.target;return o.isServer?new Hh(n):r?new Uh(n):new jh(n)}(this.options),new Fh(t)));var t;},e.prototype.hasNameForId=function(t,o){return this.names.has(t)&&this.names.get(t).has(o)},e.prototype.registerName=function(t,o){if(r1(t),this.names.has(t))this.names.get(t).add(o);else {var r=new Set;r.add(o),this.names.set(t,r);}},e.prototype.insertRules=function(t,o,r){this.registerName(t,o),this.getTag().insertRules(r1(t),r);},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear();},e.prototype.clearRules=function(t){this.getTag().clearGroup(r1(t)),this.clearNames(t);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),$h=/&/g,Gh=/^\s*\/\/.*$/gm;function vm(e,t){return e.map(function(o){return o.type==="rule"&&(o.value="".concat(t," ").concat(o.value),o.value=o.value.replaceAll(",",",".concat(t," ")),o.props=o.props.map(function(r){return "".concat(t," ").concat(r)})),Array.isArray(o.children)&&o.type!=="@keyframes"&&(o.children=vm(o.children,t)),o})}function xm(e){var t,o,r,n=e===void 0?Vr:e,i=n.options,a=i===void 0?Vr:i,l=n.plugins,m=l===void 0?u1:l,p=function(g,f,C){return C.startsWith(o)&&C.endsWith(o)&&C.replaceAll(o,"").length>0?".".concat(t):g},u=m.slice();u.push(function(g){g.type===et.RULESET&&g.value.includes("&")&&(g.props[0]=g.props[0].replace($h,o).replace(r,p));}),a.prefix&&u.push(et.prefixer),u.push(et.stringify);var c=function(g,f,C,v){f===void 0&&(f=""),C===void 0&&(C=""),v===void 0&&(v="&"),t=v,o=f,r=new RegExp("\\".concat(o,"\\b"),"g");var y=g.replace(Gh,""),h=et.compile(C||f?"".concat(C," ").concat(f," { ").concat(y," }"):y);a.namespace&&(h=vm(h,a.namespace));var x=[];return et.serialize(h,et.middleware(u.concat(et.rulesheet(function(T){return x.push(T)})))),x};return c.hash=m.length?m.reduce(function(g,f){return f.name||Re(15),sr(g,f.name)},pm).toString():"",c}var _h=new Yn,Ea=xm(),Ba=B.createContext({shouldForwardProp:void 0,styleSheet:_h,stylis:Ea});Ba.Consumer;B.createContext(void 0);function La(){return useContext(Ba)}var nm=function(){function e(t,o){var r=this;this.inject=function(n,i){i===void 0&&(i=Ea);var a=r.name+i.hash;n.hasNameForId(r.id,a)||n.insertRules(r.id,a,i(r.rules,a,"@keyframes"));},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=o,Da(this,function(){throw Re(12,String(r.name))});}return e.prototype.getName=function(t){return t===void 0&&(t=Ea),this.name+t.hash},e}(),Zh=function(e){return e>="A"&&e<="Z"};function im(e){for(var t="",o=0;o<e.length;o++){var r=e[o];if(o===1&&r==="-"&&e[0]==="-")return e;Zh(r)?t+="-"+r.toLowerCase():t+=r;}return t.startsWith("ms-")?"-"+t:t}var Mm=function(e){return e==null||e===!1||e===""},bm=function(e){var t,o,r=[];for(var n in e){var i=e[n];e.hasOwnProperty(n)&&!Mm(i)&&(Array.isArray(i)&&i.isCss||lr(i)?r.push("".concat(im(n),":"),i,";"):$r(i)?r.push.apply(r,ir(ir(["".concat(n," {")],bm(i),!1),["}"],!1)):r.push("".concat(im(n),": ").concat((t=n,(o=i)==null||typeof o=="boolean"||o===""?"":typeof o!="number"||o===0||t in W0||t.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function zo(e,t,o,r){if(Mm(e))return [];if(Aa(e))return [".".concat(e.styledComponentId)];if(lr(e)){if(!lr(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return [e];var n=e(t);return process.env.NODE_ENV==="production"||typeof n!="object"||Array.isArray(n)||n instanceof nm||$r(n)||n===null||console.error("".concat(um(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),zo(n,t,o,r)}var i;return e instanceof nm?o?(e.inject(o,r),[e.getName(r)]):[e]:$r(e)?bm(e):Array.isArray(e)?Array.prototype.concat.apply(u1,e.map(function(a){return zo(a,t,o,r)})):[e.toString()]}function Im(e){for(var t=0;t<e.length;t+=1){var o=e[t];if(lr(o)&&!Aa(o))return !1}return !0}var Qh=cm(Hr),Wh=function(){function e(t,o,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&Im(t),this.componentId=o,this.baseHash=sr(Qh,o),this.baseStyle=r,Yn.registerId(o);}return e.prototype.generateAndInjectStyles=function(t,o,r){var n=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,o,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&o.hasNameForId(this.componentId,this.staticRulesId))n=ar(n,this.staticRulesId);else {var i=m1(zo(this.rules,t,o,r)),a=Sa(sr(this.baseHash,i)>>>0);if(!o.hasNameForId(this.componentId,a)){var l=r(i,".".concat(a),void 0,this.componentId);o.insertRules(this.componentId,a,l);}n=ar(n,a),this.staticRulesId=a;}else {for(var m=sr(this.baseHash,r.hash),p="",u=0;u<this.rules.length;u++){var c=this.rules[u];if(typeof c=="string")p+=c,process.env.NODE_ENV!=="production"&&(m=sr(m,c));else if(c){var g=m1(zo(c,t,o,r));m=sr(m,g+u),p+=g;}}if(p){var f=Sa(m>>>0);o.hasNameForId(this.componentId,f)||o.insertRules(this.componentId,f,r(p,".".concat(f),void 0,this.componentId)),n=ar(n,f);}}return n},e}(),p1=B.createContext(void 0);p1.Consumer;function wm(e){var t=B.useContext(p1),o=useMemo(function(){return function(r,n){if(!r)throw Re(14);if(lr(r)){var i=r(n);if(process.env.NODE_ENV!=="production"&&(i===null||Array.isArray(i)||typeof i!="object"))throw Re(7);return i}if(Array.isArray(r)||typeof r!="object")throw Re(8);return n?Ee(Ee({},n),r):r}(e.theme,t)},[e.theme,t]);return e.children?B.createElement(p1.Provider,{value:o},e.children):null}var wa={},sm=new Set;function Kh(e,t,o){var r=Aa(e),n=e,i=!Ia(e),a=t.attrs,l=a===void 0?u1:a,m=t.componentId,p=m===void 0?function(S,b){var w=typeof S!="string"?"sc":X0(S);wa[w]=(wa[w]||0)+1;var N="".concat(w,"-").concat(Mh(Hr+w+wa[w]));return b?"".concat(b,"-").concat(N):N}(t.displayName,t.parentComponentId):m,u=t.displayName,c=u===void 0?function(S){return Ia(S)?"styled.".concat(S):"Styled(".concat(um(S),")")}(e):u,g=t.displayName&&t.componentId?"".concat(X0(t.displayName),"-").concat(t.componentId):t.componentId||p,f=r&&n.attrs?n.attrs.concat(l).filter(Boolean):l,C=t.shouldForwardProp;if(r&&n.shouldForwardProp){var v=n.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;C=function(S,b){return v(S,b)&&y(S,b)};}else C=v;}var h=new Wh(o,g,r?n.componentStyle:void 0);function x(S,b){return function(w,N,D){var V=w.attrs,G=w.componentStyle,F=w.defaultProps,q=w.foldedComponentIds,k=w.styledComponentId,ce=w.target,se=B.useContext(p1),xe=La(),Te=w.shouldForwardProp||xe.shouldForwardProp;process.env.NODE_ENV!=="production"&&useDebugValue(k);var Ve=hh(N,se,F)||Vr,Ne=function(ie,Ie,Ze){for(var ut,ge=Ee(Ee({},Ie),{className:void 0,theme:Ze}),qn=0;qn<ie.length;qn+=1){var rr=lr(ut=ie[qn])?ut(ge):ut;for(var Wt in rr)ge[Wt]=Wt==="className"?ar(ge[Wt],rr[Wt]):Wt==="style"?Ee(Ee({},ge[Wt]),rr[Wt]):rr[Wt];}return Ie.className&&(ge.className=ar(ge.className,Ie.className)),ge}(V,N,Ve),ze=Ne.as||ce,Me={};for(var be in Ne)Ne[be]===void 0||be[0]==="$"||be==="as"||be==="theme"&&Ne.theme===Ve||(be==="forwardedAs"?Me.as=Ne.forwardedAs:Te&&!Te(be,ze)||(Me[be]=Ne[be],Te||process.env.NODE_ENV!=="development"||Y0(be)||sm.has(be)||!Pa.has(ze)||(sm.add(be),console.warn('styled-components: it looks like an unknown prop "'.concat(be,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var pt=function(ie,Ie){var Ze=La(),ut=ie.generateAndInjectStyles(Ie,Ze.styleSheet,Ze.stylis);return process.env.NODE_ENV!=="production"&&useDebugValue(ut),ut}(G,Ne);process.env.NODE_ENV!=="production"&&w.warnTooManyClasses&&w.warnTooManyClasses(pt);var ct=ar(q,k);return pt&&(ct+=" "+pt),Ne.className&&(ct+=" "+Ne.className),Me[Ia(ze)&&!Pa.has(ze)?"class":"className"]=ct,Me.ref=D,createElement(ze,Me)}(T,S,b)}x.displayName=c;var T=B.forwardRef(x);return T.attrs=f,T.componentStyle=h,T.displayName=c,T.shouldForwardProp=C,T.foldedComponentIds=r?ar(n.foldedComponentIds,n.styledComponentId):"",T.styledComponentId=g,T.target=r?n.target:e,Object.defineProperty(T,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(S){this._foldedDefaultProps=r?function(b){for(var w=[],N=1;N<arguments.length;N++)w[N-1]=arguments[N];for(var D=0,V=w;D<V.length;D++)Ta(b,V[D],!0);return b}({},n.defaultProps,S):S;}}),process.env.NODE_ENV!=="production"&&(Ch(c,g),T.warnTooManyClasses=function(S,b){var w={},N=!1;return function(D){if(!N&&(w[D]=!0,Object.keys(w).length>=200)){var V=b?' with the id of "'.concat(b,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(S).concat(V,`.
|
|
75
75
|
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
|
|
76
76
|
Example:
|
|
77
77
|
const Component = styled.div.attrs(props => ({
|
|
@@ -358,7 +358,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
358
358
|
color: ${({theme:e})=>e.palette.neutral.shade2};
|
|
359
359
|
}
|
|
360
360
|
${({active:e,theme:t})=>e&&`color: ${t.palette.primary.shade1};`}
|
|
361
|
-
`;var uv=r=>{var n=r,{variant:e,fullWidth:t=!1}=n,o=M(n,["variant","fullWidth"]);switch(e){case"primary":return B.createElement(Z,P(d({},o),{fullWidth:t}));case"secondary":return B.createElement(ye,P(d({},o),{fullWidth:t}));default:return B.createElement(j3,P(d({},o),{fullWidth:t}))}},
|
|
361
|
+
`;var uv=r=>{var n=r,{variant:e,fullWidth:t=!1}=n,o=M(n,["variant","fullWidth"]);switch(e){case"primary":return B.createElement(Z,P(d({},o),{fullWidth:t}));case"secondary":return B.createElement(ye,P(d({},o),{fullWidth:t}));default:return B.createElement(j3,P(d({},o),{fullWidth:t}))}},A=uv;var V3=s(bt).attrs({width:18,height:18})`
|
|
362
362
|
padding: 0 6px;
|
|
363
363
|
cursor: pointer;
|
|
364
364
|
margin-left: auto;
|
|
@@ -432,7 +432,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
432
432
|
&:hover {
|
|
433
433
|
background: ${({theme:e})=>e.palette.alert.main};
|
|
434
434
|
}
|
|
435
|
-
`,J3=s(
|
|
435
|
+
`,J3=s(A)`
|
|
436
436
|
margin-right: 10px;
|
|
437
437
|
`;var vv=({"data-qa-anchor":e="",className:t,title:o,content:r,okText:n="Ok",onOk:i,OkButton:a=K3,cancelText:l="Cancel",CancelButton:m=J3,onCancel:p,type:u="confirm"})=>B.createElement(Q3,{"data-qa-anchor":`confirm-modal-${e}`,clean:!0,className:t,title:o,footer:B.createElement(W3,null,u==="confirm"&&B.createElement(m,{"data-qa-anchor":"confirm-modal-cancel-button",onClick:p},l),B.createElement(a,{"data-qa-anchor":`confirm-modal-${e}-ok-button`,onClick:i},n)),onCancel:p},r),S2,X3=()=>{let[e,t]=useState(null);if(S2=n=>{t(n);},!e)return null;let o=()=>t(null),r=n=>()=>{o(),n&&n();};return B.createElement(vv,P(d({},e),{onCancel:r(e.onCancel),onOk:r(e.onOk)}))},re=e=>S2(P(d({},e),{type:"confirm"})),gt=e=>S2(P(d({},e),{type:"info",OkButton:Z}));var R3={socialCommunityCreationButtonVisible:!0},e4=createContext(R3),t4=()=>useContext(e4);function T2({children:e,config:t}){let o=useMemo(()=>d(d({},R3),t),[t]);return B.createElement(e4.Provider,{value:o},e)}var o4={"general.action.cancel":"Cancel","general.action.accept":"Accept","general.action.decline":"Decline","general.action.discard":"Discard","general.error.tryAgainLater":"Something went wrong. Please try again later.",hello:"Hello World","plural.like":"{amount, plural, one {like} other {likes}}",comment:"Comment","plural.comment":"{amount, plural, one {comment} other {comments}}","plural.member":"{amount, plural, one {member} other {members}}",selectACategory:"Select a category",todaysTrendingTitle:"Today's Trending",loadMore:"Load More",categoryList:"Categories",recommendedList:"Recommended for you","exploreHeader.searchCommunityTitle":"Explore communities","exploreHeader.searchCommunityPlaceholder":"Search communities...","exploreHeader.createCommunityTitle":"or create your own!","exploreHeader.createCommunityButton":"Create community",backTitle:"Back",createCommunity:"Create Community",moderator:"Moderator","moderatorMenu.promoteToModerator":"Promote to moderator","moderatorMenu.dismissModerator":"Dismiss moderator","moderatorMenu.removeFromCommunity":"Remove from community","post.readMore":"...Read more","post.editPost":"Edit post","post.deletePost":"Delete post","post.confirmDelete":"This post will be permanently deleted. You\u2019ll no longer to see and find this post. Continue?","post.confirmPendingDelete":"This post will be permanently deleted from the pending list","post.edited":"Edited","post.like":"Like","post.liked":"Liked","post.unknownPost.description":"We couldn\u2019t recognize this post.","post.unknownPost.title":"Something went wrong","post.renderingError.description":"We couldn\u2019t render this post.","post.renderingError.title":"Something went wrong","post.community":"Community","post.myTimeline":"My Timeline","post.wasLive":"was live","post.success.approved":"Post approved","post.success.declined":"Post declined","post.success.submittedToReview":"Your post has been submitted to review by moderator","post.error.cannotReview.title":"Post is not available","post.error.cannotReview.description":"The post has been reviewed by another moderator","post.discard.title":"Discard post?","post.discard.content":"Do you want to discard your post?","collapsible.viewAll":"View all","collapsible.viewAllFiles":"View all files","collapsible.viewMoreComments":"View more comments","collapsible.viewMoreReplies":"View more replies","community.createSuccess":"Your community was successfully created","community.updateSuccess":"Your community was successfully updated","community.editProfile":"Edit profile","community.join":"Join","community.communitySettings":"Community Settings","community.returnTo":"Return to {communityName}","community.leaveCommunityTitle":"Leave community?","community.leaveCommunityBody":"You won\u2019t no longer be able to post and interact in this community after leaving.","community.leaveCommunityBodyLastMember":"As you\u2019re the last moderator and member, choose close community to leave.","community.leaveCommunityBodyOnlyModerator":"You\u2019re the only moderator in this group. Nominate other members before leaving community.","community.leaveCommunityButtonText":"Leave","community.leaveCommunityButtonOK":"OK","community.cannotInteract":"Join community to interact with all posts","community.removeUserFromCommunityTitle":"Remove user from community","community.removeUserFromCommunityBody":"This user won't no longer be able to search, post. Continue?","community.name":"Community name","community.about":"About","community.category":"Category","community.onlyadmincanpost":">Only admin can post","community.onlyadmins":"Choose to allow Only Admins to create posts in this community.","community.categorypermission":"Community permission","community.addmembers":"Add members","community.posts":"posts","community.members":"members","community.settings":"Settings","community.leaveCommunity":"Leave Community","CommunityMembers.members":"Members","CommunityMembers.moderators":"Moderators","EmptyFeed.TargetType.globalFeed":"This feed is empty","EmptyFeed.TargetType.communityFeed":"This community's feed is empty","EmptyFeed.TargetType.userFeed":"This user's feed is empty","EmptyFeed.TargetType.myFeed":"Your feed is empty. Start your first post","EmptyFeed.exploreCommunity":"Explore Community","UserFeed.tabs.timeline":"Timeline","community.exploreCommunities":"Explore Community","community.permissions.postReview":"Post review","community.permissions.storyComments":"Story comments","community.permissions.approvePosts":"Approve member posts","community.permissions.allowStoryComments":"Allow comments on community stories","community.permissions.approvePosts.prompt":"Posts by members have to be reviewed and approved by community moderator.","community.permissions.storyComments.prompt":"Turn on to receive comments on stories in this community.","community.permissions.error.needApprovalOnPostCreation.turnOn":"Unable to turn on post review","community.permissions.error.needApprovalOnPostCreation.turnOff":"Unable to turn off post review","community.permissions.error.storyComments.turnOn":"Unable to turn on post review","community.permissions.error.storyComments.turnOff":"Unable to turn off post review","community.review.declinePendingPosts":"Decline pending post will permanently delete the selected post from community.","community.pendingPostsBanner.title":"Pending posts","community.pendingPostsBanner.pendingForReview":"Your posts are pending for review","community.pendingPostsBanner.needApproval":"{formattedAmount} {amount, plural, one {post needs} other {posts need}} approval","communityCreatedModal.title":"Customize your community","communityCreatedModal.message":"You\u2019ve successfully created a community! Now let's manage permissions that work best for you","communityCreatedModal.goToSettings":"Community settings","communityCreatedModal.skip":"Skip for now",post:"Post","upload.attachmentLimit":"You reached the maximum attachment of {maxFiles}","upload.fileSizeLimit":"One of the selected file is larger than 1GB. Please select a new file.","user.editProfile":"Edit profile","user.message":"Message","follow.placeholder.noFollowings":"No followings found","follow.placeholder.noFollowers":"No followers found","ProfileSettings.editProfile":"Edit profile","ProfileSettings.returnTo":"Return to ","SideSectionMyCommunity.myCommunity":"My Community","file.reUpload":"Click to re-upload the file","UserProfileForm.displayname":"Display name","UserProfileForm.about":"About","UserProfileForm.title":"General","UserProfileForm.namePlaceholder":"Enter user display name","UserProfileForm.requiredDisplayName":"Display name is required","UserProfileForm.requiredDescription":"Enter something about yourself","UserSelector.placeholder":"Select user...","report.reportUser":"Report user","report.unreportUser":"Unreport user","report.reportComment":"Report comment","report.unreportComment":"Unreport comment","report.reportSent":"Report sent","report.unreportSent":"Unreport sent","comment.deleted":"This comment has been deleted","comment.delete":"Delete comment","comment.edit":"Edit comment","comment.deleteConfirmContent":"This comment will be permanently deleted. Continue?","comment.deleteConfirmCancelText":"Cancel","comment.deleteConfirmOkText":"Delete","dropdown.first":"First","dropdown.second":"Second","layout.logout":"Log Out","layout.username":"Jackies","chat.details.chatDetailes":"Chat Detail","chat.details.communityName":"Community Name","message.flag":"flag","message.unflag":"Unflag","message.edit":"Edit","message.delete":"Delete","message.deleted":"deleted","message.unsupportedFormat":"Unsupported message format","message.saveOptionsError":"There was an error processing your request","MessageComposeBar.placeholder":"Type your message...","RecentChat.chats":"Chats","AddMemberModal.addMembers":"Add members","AddMemberModal.membersValidationError":"Please select at least one member",add:"Add",save:"Save",close:"Close",reply:"Reply",delete:"Delete",create:"Create",cancel:"Cancel",loading:"Loading...",anonymous:"Anonymous","comment.edited":"Edited","comment.readmore":"...Read more","communities.nocommunityfound":"No community found","profile.setting":"Profile Settings","sidesectioncommunity.newfeed":"NewsFeed","sidesectioncommunity.explore":"Explore","sidesectioncommunity.community":"Community","communityFeed.join":"Join community to interact with all posts","communityFeed.members":"Members","communityFeed.moderators":"Moderators","files.all":"View all files","sidebar.community":"Community","CategoryCommunitiesList.emptyTitle":"It's empty here...","CategoryCommunitiesList.emptyDescription":"No community found in this category","CommentComposeBar.addComment":"Add comment","CommentComposeBar.replayTo":"Reply to ","CommentComposeBar.saySomething":"Say something nice","CommentComposeBar.unableToPost":"Unable to post","CommentComposeBar.overCharacter":"You have reached maximum 50,000 characters in a post.","CommentComposeBar.done":"Done","CommentComposeBar.unableToMention":"Unable to mention","CommentComposeBar.overMentionees":"You have reached maximum 30 mentioned users in a post.","CommentComposeBar.okText":"OK","CommunityCreationModal.title":"Leave without finishing?","CommunityCreationModal.content":"Your progress won\u2019t be saved. Are you sure to leave this page now?","CommunityCreationModal.cancelText":"Continue editing","CommunityCreationModal.okText":"Leave","PostAsCommunity.title":"Post as community","PostAsCommunity.caption":"Enable this will publish the post on behalf of community account","AddMemberAction.title":"Add members","AddMemberAction.description":"Add your friends to this community to participate in group conversations","CloseCommunityAction.closeConfirm.title":"Close community?","CloseCommunityAction.closeConfirm.description":"All members will be removed from the community. All posts, messages, reactions and media shared in community will be deleted. This cannot be undone.","CloseCommunityAction.title":"Close community","CloseCommunityAction.description":"Closing this community will remove the community page and all its content and comments. This cannot be undone.","report.doReport":"Report","report.undoReport":"Undo Report","comment.deleteBody":"This comment will be permanently deleted. Continue?","reply.delete":"Delete reply","reply.deleteBody":"This reply will be permanently deleted. Continue?","reply.edit":"Edit reply","reply.deleted":"This reply has been deleted","tabs.editProfile":"Edit profile","tabs.timeline":"Timeline","tabs.followers":"Followers","tabs.followings":"Followings","tabs.pending":"Pending","tabs.members":"Members","tabs.moderators":"Moderators","tabs.pendingPosts":"Pending {amount, select, 0 {} other { ({formattedAmount})}}","tabs.permissions":"Permissions","tabs.gallery":"Gallery","tabs.images":"Photos","tabs.videos":"Videos","tabs.liveStreams":"Livestreams","feed.emptyFeed":"This feed is empty","feed.emptyCommunityPublicFeed":"This community's feed is empty","feed.emptyCommunityReviewingFeed":"No pending posts","feed.emptyJoinedCommunityPublicFeed":"Your feed is empty. Start you first post","feed.emptyUserFeed":"No posts yet","feed.emptyMyFeed":"Your feed is empty. Start your first post","chat.groupSetting":"Group settings","chat.message.deleted":"Message was deleted","chat.message.unsupported":"Unsupported message type","chat.chats":"Chats","chat.details.header":"Chat Details","chat.details.chatName":"Chat Name","chat.leaveChat":"Leave chat","chat.leaveChat.confirm.title":"Leave chat","chat.leaveChat.confirm.content":"Are you sure you want to leave the chat?","chat.leaveChat.confirm.okButton":"Leave","chat.leaveChat.success":"You successfully left chat","chat.leaveChat.error":"Attempt to leave a chat has failed","chat.members.return":"Return to controls","chat.members.count":"{count} members","chat.create.modalTitle":"Create new chat","userSelector.placeholder":"Enter name or email addresses","userSelector.emptyState.title":"It's empty here...","userSelector.emptyState.description":"No contact found here","groupChat.createPopup.fieldName":"Group name","groupChat.createPopup.placeholder":"Please input group name","general.cancel.capital":"Cancel","general.create.capital":"Create","general.done.capital":"Done","chat.member.addMore":"Add or Remove user","video.notReady":"The video is being processed. Please try again later.","liveStream.idle":"This stream is currently unavailable","liveStream.ended.caption":"This liveStream has ended.","liveStream.ended.message":"Playback will be available for you to watch shortly.","user.follow":"Follow","user.unfollow":"Unfollow","user.unfollow.confirm.title":"Unfollow {displayName}","user.unfollow.confirm.body":"You\u2019ll have to send a request again to follow {displayName}. Continue?","user.cancel_follow":"Cancel request","placeholder.noResults":"No results found","request.accept":"Accept","request.decline":"Decline","follower.title.removeUser":"Remove {displayName} from followers?","follower.body.removeUser":"We will not notify {displayName} that they've been removed from your followers","follower.menuItem.removeUser":"Remove user","follower.menuItem.unfollow":"Unfollow","buttonText.cancel":"Cancel","buttonText.remove":"Remove","follow.pendingNotification.title":"Pending requests","follow.pendingNotification.body":"Your requests are waiting for review","notification.done":"Done","counter.followings":"following","counter.followers":"followers","buttonText.unfollow":"Unfollow","privateFeed.title":"This account is private","privateFeed.body":"Follow this user to see all posts","navigationBlocker.title":"Unsaved changes","navigationBlocker.content":"Your changes won`t be saved. Are you sure you want to leave this page now?","user.unfollow.confirm.title.thisUser":"Unfollow this user","mediaGallery.images.empty":"No photos yet","mediaGallery.liveStreams.empty":"No liveStreams yet","mediaGallery.videos.empty":"No videos yet","user.unfollow.confirm.body.thisUser":"You\u2019ll have to send a request again to follow this user. Continue?","navigationBlocker.okText":"Leave","options_composer.button.add":"Add Option","options_composer.title":"Create at least 2 options","poll_modal.answer_type.title":"Selection type","poll_modal.answer_type.body":"Choose to vote with one or multiple options","poll_modal.closed_in.title":"Schedule poll (Optional)","poll_modal.closed_in.body":"Poll will be automatically closed at the end of chosen time frame (UTC)","select.answerType.item":"{answerType} selection","poll_composer.question.label":"Poll options","poll_composer.question.placeholder":"What\u2019s your poll question?","poll_composer.poll_options.label":"Options","poll_modal.title":"Create poll","poll.votes":"{voteCount} votes","poll.vote.closedIn":"Poll ends in {closedIn} days","poll.vote.finalResults":"Final results","poll.vote.submit":"Submit vote","poll.error.deletedOrClosed":"This poll has been closed or deleted.","poll.close":"Close poll","postCreator.unableToPost":"Unable to post","postCreator.overCharacter":"You have reached maximum 50,000 characters in a post.","postCreator.done":"Done","postCreator.unableToMention":"Unable to mention","postCreator.overMentionees":"You have reached maximum 30 mentioned users in a post.","postCreator.okText":"OK","pollComposer.unableToMention":"Unable to mention","pollComposer.overMentionees":"You have reached maximum 30 mentioned users in a post.","pollComposer.okText":"OK","storyViewer.actions.deleteStory":"Delete story","storyViewer.action.confirmModal.title":"Delete this story?","storyViewer.action.confirmModal.content":"This story will be permanently deleted. You\u2019ll no longer to see and find this story.","storyViewer.notification.deleted":"Story deleted","storyViewer.notification.success":"Successfully shared story","storyViewer.notification.error":"Failed to share story","storyViewer.footer.failed":"Failed to upload","storyViewer.footer.uploading":"Uploading...","storyDraft.button.shareStory":"Share story","select.chatType.item":"{answerType} type","chatComposer.label.channelId":"Channel ID","chatComposer.label.displayName":"Display Name","chatComposer.label.type":"Channel Type","chatComposer.addUsers":"Add users","chat_modal.title":"Create chat","chat_composer.placeholder.displayName":"Enter display name here","chat_composer.placeholder.channelId":"Enter channel ID here","editChatMembersModal.title":"Add/Edit chat members","editChatMembersModal.confirm.title":"Leave without finishing?","editChatMembersModal.confirm.content":"Your progress won\u2019t be saved. Are you sure to leave this page now?","editChatMembersModal.confirm.cancelText":"Continue editing","editChatMembersModal.confirm.okText":"Leave"};var T1={en:o4};var r4="en",Tv=({locale:e,children:t})=>{let o=T1[e]?T1[e]:T1[r4];return B.createElement(IntlProvider,{defaultLocale:r4,locale:e,messages:o},t)},n4=Tv;var Nv={palette:{alert:"#FA4D30",base:"#292B32",primary:"#1054DE",secondary:"#FFD400",tertiary:"#FF305A",neutral:"#17181C",highlight:"#1054DE",system:{borders:"#ebecef",background:"#fff"}},typography:{global:{fontFamily:"Inter, -apple-system, BlinkMacSystemFont, Arial, sans-serif",fontStyle:"normal"},headline:{fontWeight:600,fontSize:"20px"},title:{fontWeight:600,fontSize:"16px"},body:{fontWeight:"normal",fontSize:"14px"},bodyBold:{fontWeight:600,fontSize:"14px"},caption:{fontWeight:"normal",fontSize:"12px"},captionBold:{fontWeight:600,fontSize:"12px"}}},i4=Nv;function N1(e){return (e==null?void 0:e.communityMembership)==="member"}function E1(e){return (e==null?void 0:e.userPrivacySetting)==="private"}function s4(e){return (e||[]).map((t,o)=>{var r;return {id:t.userId,display:(r=t.displayName)!=null?r:t.userId,avatar:t.avatarCustomUrl,isLastItem:(e==null?void 0:e.length)===o+1}})}var L1=1;function Lv(e,t,o){let r=o+L1,n=r+t;return e.substring(r,n)}function k1(e){return e?e.sort((o,r)=>o.index-r.index).map(({index:o,length:r})=>({start:o,end:o+r+L1,highlight:!0})):[]}function F1(e){let t={},o=[];return (e==null?void 0:e.length)>0?(t.mentioned=[...e.sort((r,n)=>r.plainTextIndex-n.plainTextIndex).map(({plainTextIndex:r,id:n,display:i})=>({index:r,length:i.length-L1,type:"user",userId:n}))],o.push({type:"user",userIds:e.map(({id:r})=>r)})):o.push({type:"user",userIds:[]}),{metadata:t,mentionees:o}}function A1(e,t){if(!e||Ev(t==null?void 0:t.mentioned))return e;let o=e;return ((t||{}).mentioned||[]).sort((r,n)=>n.index-r.index).forEach(({userId:r,length:n,index:i})=>{let a=`@[${Lv(e,n,i)}](${r})`;o=o.replace(new RegExp(`(.{${i}}).{${n+L1}}`),`$1${a}`);}),o}function ue(e){return e!=null}var m4=e=>e.toFixed(1),a4=e=>{let t=Math.min(e*100,100);return m4(t)};function Fv(e){return e.alpha!==void 0}var d4=e=>{let{hue:t,saturation:o,lightness:r}=e,n=[`${m4(t)}`,`${a4(o)}%`,`${a4(r)}%`];return Fv(e)?`hsla(${[...n,e.alpha].filter(ue).join(",")})`:`hsl(${n.filter(ue).join(",")})`},Av=e=>{let t=parseToHsl(e);return d4(t)},Dv=(e,t)=>{let o=parseToHsl(t),{lightness:r}=o,n=P(d({},o),{lightness:Math.min(1,r+e)});return d4(n)},Bv=[.25,.4,.5,.75],p4=e=>{let i=e,{system:t}=i,o=M(i,["system"]),r=Object.keys(o).reduce((a,l)=>(a[l]={main:Av(o[l])},a),d({},o)),n=Object.keys(r).reduce((a,l)=>{let m=o[l],p=Bv.reduce((c,g,f)=>{let C=`shade${f+1}`;return c[C]=Dv(g,m),c},{}),u=r[l];return u&&typeof u=="object"?a[l]=d(d({},p),u):a[l]=P(d({},p),{main:u}),a},d({},r));return P(d({},n),{system:t})};var zv=["fontFamily","fontStyle","fontWeight","fontSize"],Ov=e=>Object.keys(e).reduce((o,r)=>{let n=e[r];return r&&n&&zv.includes(r)&&(o[r]=n),o},{}),c4=e=>Object.keys(e).reduce((o,r)=>(o[r]=Ov(d(d({},e.global),e[r])),o),{});var jv=(e={})=>{let t=Uv(i4,e),o=p4(t.palette),r=c4(t.typography);return P(d({},t),{palette:o,typography:r})},u4=jv;var f4=s.div`
|
|
438
438
|
${({theme:e})=>e.typography.body};
|
|
@@ -454,16 +454,16 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
454
454
|
& pre {
|
|
455
455
|
${({theme:e})=>e.typography.body}
|
|
456
456
|
}
|
|
457
|
-
`;var D1=createContext({client:null,currentUserId:void 0,userRoles:[]});var B1=()=>useContext(D1),
|
|
457
|
+
`;var D1=createContext({client:null,currentUserId:void 0,userRoles:[]});var B1=()=>useContext(D1),_=B1;var g4=createContext({subscribe:({fetcher:e,params:t,callback:o,config:r})=>({unsubscribe:()=>{}})}),E2=()=>useContext(g4);function L2({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=_();function i(l,m){return `${n}.${l}.${JSON.stringify(m)}`}useEffect(()=>()=>{Object.values(o.current).forEach(l=>l());},[]);let a=({fetcher:l,params:m,callback:p,config:u})=>{if(n==null)return {unsubscribe(){}};let c=i(l.name,m);if(t.current[c]&&r.current[c])p==null||p(r.current[c]),t.current[c].push(p);else {t.current[c]=[p];let g=l(m,f=>{r.current[c]=f,(t.current[c]||[]).forEach(v=>v(f));},u);o.current[c]=g;}return {unsubscribe(){let g=t.current[c].find(f=>f===p);g&&(t.current[c]=t.current[c].filter(f=>f!==g));}}};return B.createElement(g4.Provider,{value:{subscribe:a}},e)}var C4=createContext({subscribe:({fetcher:e,params:t,callback:o=()=>{},options:r})=>({unsubscribe:()=>{}})}),F2=()=>useContext(C4);function A2({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=_();function i(l,m){return `${n}.${l}.${JSON.stringify(m)}`}useEffect(()=>()=>{Object.values(o.current).forEach(l=>l());},[]);let a=({fetcher:l,params:m,callback:p=()=>{},options:u})=>{if(n==null)return {unsubscribe(){}};let c=i(l.name,m);if(t.current[c])p(r.current[c]),t.current[c].push(p);else {t.current[c]=[p];let g=l(m,f=>{r.current[c]=f,(t.current[c]||[]).forEach(v=>v(f));},u);o.current[c]=g;}return {unsubscribe(){let g=t.current[c].find(f=>f===p);g&&(t.current[c]=t.current[c].filter(f=>f!==g));}}};return B.createElement(C4.Provider,{value:{subscribe:a}},e)}var y4=createContext({fetch:o=>I(void 0,[o],function*({fetchFn:e,params:t}){return yield Promise.resolve({})})}),D2=()=>useContext(y4);function B2({children:e}){let t=useRef({}),o=useRef({});function r(i,a){return `${i}.${JSON.stringify(a)}`}let n=({fetchFn:i,params:a})=>{var c;let l=r(i.name,a);if(((c=t.current[l])==null?void 0:c.length)>0){if(o.current[l]!=null)return Promise.resolve(o.current[l]);let g=()=>{},f=()=>{},C=new Promise((v,y)=>{g=v,f=y;});return t.current[l].push({resolve:g,reject:f}),C}let m=()=>{},p=()=>{},u=new Promise((g,f)=>{m=g,p=f;});return t.current[l]=[{resolve:m,reject:p}],i(...a).then(g=>{o.current[l]=g,t.current[l].forEach(({resolve:f})=>f(g));}).catch(g=>{t.current[l].forEach(({reject:f})=>f(g));}).finally(()=>{setTimeout(()=>{o.current[l]=null,t.current[l]=[];},500);}),u};return B.createElement(y4.Provider,{value:{fetch:n}},e)}var x4=createContext({subscribe:({topic:e,callback:t})=>({unsubscribe:()=>{}})}),M4=()=>useContext(x4);function z2({children:e}){let t=useRef({}),o=useRef({});useEffect(()=>()=>{Object.values(o.current).forEach(n=>n());},[]);let r=({topic:n,callback:i})=>{if(t.current[n])t.current[n].push(i);else {t.current[n]=[i];let a=subscribeTopic(n,(...l)=>{(t.current[n]||[]).forEach(p=>p(...l));});o.current[n]=a;}return {unsubscribe(){let a=t.current[n].find(l=>l===i);a&&(t.current[n]=t.current[n].filter(l=>l!==a));}}};return B.createElement(x4.Provider,{value:{subscribe:r}},e)}function O2({children:e}){return B.createElement(L2,null,B.createElement(A2,null,B.createElement(z2,null,B.createElement(B2,null,e))))}function lx({fetcher:e,params:t,callback:o=()=>{},options:r,shouldCall:n=()=>!0,getSubscribedTopic:i}){let{subscribe:a}=F2(),[l,m]=useState(null),p=useRef(null),u=useCallback(c=>{n&&!n()||t!=null&&(c.data&&m(c.data),o(c));},[n,o]);return useEffect(()=>(i&&(p.current=subscribeTopic(i())),()=>{var c;(c=p.current)==null||c.call(p);}),[i]),useEffect(()=>{if(t==null||n&&!n())return;let{unsubscribe:c}=a({fetcher:e,params:t,callback:u,options:r});return ()=>{c();}},[t,n]),l}var ke=lx;function Ct({fetcher:e,params:t,callback:o=()=>{},options:r,shouldSubscribe:n=()=>!0,getSubscribedTopic:i}){let{subscribe:a}=M4(),l=useRef(null);return ke({fetcher:e,params:t,callback:m=>{let{error:p,loading:u}=m;if(u)return;if(p)throw p;let{unsubscribe:c}=a({topic:i(m),callback:o});l.current=c;},options:r,shouldCall:n}),useEffect(()=>()=>{var m;(m=l.current)==null||m.call(l);},[l]),{unsubscribe:()=>{var m;return (m=l.current)==null?void 0:m.call(l)}}}function go({userId:e,level:t,shouldSubscribe:o=()=>!0,callback:r}){return Ct({fetcher:UserRepository.getUser,params:e,callback:r,shouldSubscribe:()=>!!e&&o(),getSubscribedTopic:({data:n})=>getUserTopic(n,t)})}var gx=e=>(go({userId:e,level:SubscriptionLevels.USER}),ke({fetcher:UserRepository.getUser,params:e,shouldCall:()=>!!e})),U=gx;var Qr=Object.freeze({MEMBER:"member",MODERATOR:"moderator",SUPER_MODERATOR:"super-moderator",COMMUNITY_MODERATOR:"community-moderator",CHANNEL_MODERATOR:"channel-moderator"}),I4=30,w4=Object.freeze({Uploaded:"uploaded",Transcoding:"transcoding",Transcoded:"transcoded",TranscodeFailed:"transcodeFailed"}),P4="video/mp4";var T4={page:{type:"newsfeed",communityId:void 0},onChangePage:e=>{},onClickCategory:e=>{},onClickCommunity:e=>{},onClickUser:e=>{},onCommunityCreated:e=>{},onEditCommunity:e=>{},onEditUser:e=>{},onMessageUser:e=>{},setNavigationBlocker:()=>{},onBack:()=>{}},xx=o=>{var r=o,{onSuccess:e}=r,t=M(r,["onSuccess"]);return re(P(d({},t),{onOk:e}))};process.env.NODE_ENV!=="production"&&(T4={page:{type:"newsfeed",communityId:void 0},onChangePage:e=>console.log(`NavigationContext onChangePage(${e})`),onClickCategory:e=>console.log(`NavigationContext onClickCategory(${e})`),onClickCommunity:e=>console.log(`NavigationContext onClickCommunity(${e})`),onClickUser:e=>console.log(`NavigationContext onClickUser(${e})`),onCommunityCreated:e=>console.log(`NavigationContext onCommunityCreated(${e})`),onEditCommunity:e=>console.log(`NavigationContext onEditCommunity({${e})`),onEditUser:e=>console.log(`NavigationContext onEditUser(${e})`),onMessageUser:e=>console.log(`NavigationContext onMessageUser(${e})`),onBack:()=>console.log("NavigationContext onBack()")});var N4=createContext(T4),O=()=>useContext(N4);function U2({askForConfirmation:e=xx,children:t,onChangePage:o,onClickCategory:r,onClickCommunity:n,onClickUser:i,onCommunityCreated:a,onEditCommunity:l,onEditUser:m,onMessageUser:p}){let[u,c]=useState([{type:"newsfeed",communityId:void 0}]),g=useMemo(()=>u[u.length-1],[u]),[f,C]=useState(),v=useCallback(()=>I(this,null,function*(){return f?new Promise(F=>{e(P(d({},f),{onSuccess:()=>{C==null||C(void 0),F(!0);},onCancel:()=>F(!1)}));}):!0}),[e,f]),y=useCallback(F=>I(this,null,function*(){(yield v())&&c(q=>[...q,F]);}),[v]),h=()=>{c(F=>F.length>1?F.slice(0,-1):F);},x=o?F=>I(this,null,function*(){(yield v())&&o(F);}):null,T=useCallback(F=>{console.log("handleChangePage",F),y({type:F});},[y]),S=useCallback(F=>{let q={type:"communityfeed",communityId:F};if(x)return x(q);if(n)return n(F);console.log("handleClickCommunity",{communityId:F}),y(q);},[x,n,y]),b=useCallback(F=>{let q={type:"communityfeed",communityId:F,isNewCommunity:!0};if(x)return x(q);if(a)return a(F);console.log("handleCommunityCreated",{communityId:F}),y(q);},[x,a,y]),w=useCallback(F=>{let q={type:"category",categoryId:F};if(x)return x(q);if(r)return r(F);console.log("handleClickCategory",{categoryId:F}),y(q);},[x,r,y]),N=useCallback((F,q)=>{let k={type:q!=null?q:"userfeed",userId:F};if(x)return x(k);if(i)return i(F);console.log("handleClickUser",{userId:F}),y(k);},[x,i,y]),D=useCallback(F=>{let q={type:"useredit",userId:F};if(x)return x(q);if(m)return m(F);console.log("handleEditUser",{userId:F}),y(q);},[x,m,y]),V=useCallback((F,q)=>{let k={type:"communityedit",communityId:F,tab:q};if(x)return x(k);if(l)return l(F,{tab:q});console.log("handleEditCommunity",{communityId:F,tab:q}),y(k);},[x,l,y]),G=useCallback(F=>{let q={type:"conversation",userId:F};if(x)return x(q);if(p)return p(F);console.log("handleMessageUser",{userId:F});},[x,p]);return B.createElement(N4.Provider,{value:{page:g,onChangePage:T,onClickCategory:w,onClickCommunity:S,onClickUser:N,onCommunityCreated:b,onEditCommunity:V,onEditUser:D,onMessageUser:G,onBack:h,setNavigationBlocker:C}},t)}var E4=createContext({}),E=e=>useContext(E4)[e]||null;function j2({children:e,config:t}){return B.createElement(E4.Provider,{value:t},e)}var Px=e=>ke({fetcher:PostRepository.getPost,params:e,shouldCall:()=>!!e}),ot=Px;var k4=L`
|
|
458
458
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
459
459
|
`,F4=s(ye)`
|
|
460
460
|
${({active:e})=>e&&k4}
|
|
461
|
-
`,A4=s(_r)`
|
|
461
|
+
`,A4=s(_r).attrs({width:16,height:16})`
|
|
462
462
|
font-size: 16px;
|
|
463
463
|
margin-right: 5px;
|
|
464
464
|
`,Sx=s(A4)`
|
|
465
465
|
${k4}
|
|
466
|
-
`,D4=({isLiked:e})=>e?B.createElement(Sx,null):B.createElement(A4,null);var Nx=({onClick:e,isActive:t,isDisabled:o})=>B.createElement(F4,{active:t,disabled:o,"data-qa-anchor":t?"post-liked-button":"post-like-button",onClick:e},B.createElement(D4,{isLiked:t})," ",B.createElement(FormattedMessage,{id:t?"post.liked":"post.like"})),B4=e=>{let t=E("PostLikeButton");return t?t(e):B.createElement(Nx,d({},e))};var zt="like";function O4(e){var t,o;return e==null||((t=e.myReactions)==null?void 0:t.length)===0?!1:(o=e==null?void 0:e.myReactions)==null?void 0:o.includes(zt)}var Fx=({postId:e,onLikeSuccess:t,onUnlikeSuccess:o})=>{let r=ot(e),[n,i]=useState(O4(r));useEffect(()=>{i(O4(r));},[r==null?void 0:r.myReactions]);let a=()=>I(void 0,null,function*(){r!=null&&(n?(yield ReactionRepository.removeReaction("post",r.postId,zt),o==null||o(r),i(!n)):(yield ReactionRepository.addReaction("post",r.postId,zt),t==null||t(r),i(!n)));});return B.createElement(B4,{isActive:n,isDisabled:r==null,onClick:a})},U4=Fx;var Dx=e=>ke({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:()=>!!e}),Ce=Dx;var Hx=({targetId:e,targetType:t,remoteText:o,remoteMarkup:r})=>{let n=t==="community",i=Ce(e),[a,l]=useState(o!=null?o:""),[m,p]=useState(r!=null?r:o),[u,c]=useState([]);useEffect(()=>{l(o||""),p(r!=null?r:"");},[o,r]);let g=({text:x,plainText:T,mentions:S})=>{l(T),p(x),c(S);},f=()=>{l(""),p(""),c([]);},C=()=>{l(o||""),p(r),c([]);},v=useCallback(x=>I(void 0,null,function*(){let T,S=x||"",b;return (S.match(/^@$/)||S==="")&&(S=void 0),n&&!(i!=null&&i.isPublic)&&e!=null?T=yield new Promise(w=>{b==null||b(),b=CommunityRepository.Membership.getMembers({communityId:e,search:S,limit:20},N=>{N.loading||w(N.data.map(({user:
|
|
466
|
+
`,D4=({isLiked:e})=>e?B.createElement(Sx,null):B.createElement(A4,null);var Nx=({onClick:e,isActive:t,isDisabled:o})=>B.createElement(F4,{active:t,disabled:o,"data-qa-anchor":t?"post-liked-button":"post-like-button",onClick:e},B.createElement(D4,{isLiked:t})," ",B.createElement(FormattedMessage,{id:t?"post.liked":"post.like"})),B4=e=>{let t=E("PostLikeButton");return t?t(e):B.createElement(Nx,d({},e))};var zt="like";function O4(e){var t,o;return e==null||((t=e.myReactions)==null?void 0:t.length)===0?!1:(o=e==null?void 0:e.myReactions)==null?void 0:o.includes(zt)}var Fx=({postId:e,onLikeSuccess:t,onUnlikeSuccess:o})=>{let r=ot(e),[n,i]=useState(O4(r));useEffect(()=>{i(O4(r));},[r==null?void 0:r.myReactions]);let a=()=>I(void 0,null,function*(){r!=null&&(n?(yield ReactionRepository.removeReaction("post",r.postId,zt),o==null||o(r),i(!n)):(yield ReactionRepository.addReaction("post",r.postId,zt),t==null||t(r),i(!n)));});return B.createElement(B4,{isActive:n,isDisabled:r==null,onClick:a})},U4=Fx;var Dx=e=>ke({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:()=>!!e}),Ce=Dx;var Hx=({targetId:e,targetType:t,remoteText:o,remoteMarkup:r})=>{let n=t==="community",i=Ce(e),[a,l]=useState(o!=null?o:""),[m,p]=useState(r!=null?r:o),[u,c]=useState([]);useEffect(()=>{l(o||""),p(r!=null?r:"");},[o,r]);let g=({text:x,plainText:T,mentions:S})=>{l(T),p(x),c(S);},f=()=>{l(""),p(""),c([]);},C=()=>{l(o||""),p(r),c([]);},v=useCallback(x=>I(void 0,null,function*(){let T,S=x||"",b;return (S.match(/^@$/)||S==="")&&(S=void 0),n&&!(i!=null&&i.isPublic)&&e!=null?T=yield new Promise(w=>{b==null||b(),b=CommunityRepository.Membership.getMembers({communityId:e,search:S,limit:20},N=>{N.loading||w(N.data.map(({user:D})=>D).filter(ue));});}):T=yield new Promise(w=>{b==null||b(),b=UserRepository.getUsers({displayName:S,limit:20,sortBy:"displayName"},N=>{N.loading||w(N.data);});}),s4(T)}),[n,i==null?void 0:i.isPublic,e]),{mentionees:y,metadata:h}=useMemo(()=>{let{mentionees:x,metadata:T}=F1(u);return {mentionees:x,metadata:T}},[u]);return {text:a,markup:m,mentions:u,mentionees:y,metadata:h,onChange:g,clearAll:f,resetState:C,queryMentionees:v}},Jt=Hx;var Wr=s.div.attrs(({progress:e})=>({style:{width:`${e||0}%`}}))`
|
|
467
467
|
background: ${({lightMode:e,theme:t})=>e?t.palette.primary.main:t.palette.base.shade4};
|
|
468
468
|
position: absolute;
|
|
469
469
|
left: 0;
|
|
@@ -601,7 +601,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
601
601
|
${G2}
|
|
602
602
|
resize: vertical;
|
|
603
603
|
}
|
|
604
|
-
`,EM=forwardRef(({"data-qa-anchor":e="",id:t,name:o="",value:r="",placeholder:n="",multiline:i=!1,disabled:a=!1,invalid:l=!1,rows:m=1,maxRows:p=3,prepend:u,append:c,onChange:g,onClear:f,onClick:C,onKeyPress:v,className:y,mentionAllowed:h=!1,queryMentionees:x,loadMoreMentionees:T},S)=>{let[b,w]=useState([]),N=useRef(null),
|
|
604
|
+
`,EM=forwardRef(({"data-qa-anchor":e="",id:t,name:o="",value:r="",placeholder:n="",multiline:i=!1,disabled:a=!1,invalid:l=!1,rows:m=1,maxRows:p=3,prepend:u,append:c,onChange:g,onClear:f,onClick:C,onKeyPress:v,className:y,mentionAllowed:h=!1,queryMentionees:x,loadMoreMentionees:T},S)=>{let[b,w]=useState([]),N=useRef(null),D=useRef(null),V=(k,[,],ce,se)=>{var Ve;let xe=ce.split(" ").pop(),Te=((Ve=xe==null?void 0:xe[0])==null?void 0:Ve.match(/^@/g))||!1;g({text:k.target.value,plainText:ce,lastMentionText:Te?xe:void 0,mentions:se});},G=k=>{k.key==="Backspace"&&(r==null?void 0:r.length)===0&&(f==null||f());},F=l6(y,{disabled:a,invalid:l}),q={id:t,name:o,value:r,placeholder:n,disabled:a,className:F,"data-qa-anchor":e};return B.createElement(IM,{ref:D,className:F},u,B.createElement("div",{ref:N,id:"mention-input"}),i&&h&&B.createElement(NM,P(d({allowSuggestionsAboveCursor:!0,inputRef:S,rows:m,style:SM},q),{onKeyDown:k=>G(k),onChange:V,onClick:C,onKeyPress:k=>v==null?void 0:v(k)}),B.createElement(Mention,{trigger:"@",data:(k,ce)=>{if(!x)return ce([]);x(k).then(se=>{ce(se);});},style:TM,renderSuggestion:({id:k},ce,se,xe,Te)=>{var Ve;return B.createElement(Z4,{focused:Te,id:typeof k=="number"?`${k}`:k,isLastItem:k===((Ve=b[b.length-1])==null?void 0:Ve.id),containerRef:D,rootEl:N,loadMore:()=>T==null?void 0:T(ce)})},displayTransform:(k,ce)=>`@${ce}`,appendSpaceOnAdd:!0,onAdd:()=>{}})),i?!h&&B.createElement(PM,P(d({ref:S,minRows:m,maxRows:p},q),{onChange:k=>g==null?void 0:g({text:k.target.value,plainText:k.target.value,lastMentionText:"",mentions:[]}),onKeyDown:k=>G(k),onClick:C})):B.createElement(wM,P(d({ref:S},q),{onChange:k=>g==null?void 0:g({text:k.target.value,plainText:k.target.value,lastMentionText:"",mentions:[]}),onKeyDown:k=>G(k),onClick:C})),c)}),W4=EM;var FM=forwardRef((e,t)=>B.createElement(W4,P(d({},e),{ref:t}))),Ge=FM;var K4=s(J)`
|
|
605
605
|
margin-right: 8px;
|
|
606
606
|
`,J4=s.div`
|
|
607
607
|
padding-top: 16px;
|
|
@@ -619,7 +619,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
619
619
|
height: 40px;
|
|
620
620
|
padding: 10px 16px;
|
|
621
621
|
margin-left: 12px;
|
|
622
|
-
`;var zM=30,OM=5e4,UM=({className:e,userToReply:t,onSubmit:o,postId:r})=>{let n=ot(r),{currentUserId:i}=
|
|
622
|
+
`;var zM=30,OM=5e4,UM=({className:e,userToReply:t,onSubmit:o,postId:r})=>{let n=ot(r),{currentUserId:i}=_(),a=U(i),l=j({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"}),{text:m,markup:p,mentions:u,mentionees:c,metadata:g,onChange:f,clearAll:C,queryMentionees:v}=Jt({targetId:n==null?void 0:n.targetId,targetType:n==null?void 0:n.targetType}),{formatMessage:y}=useIntl(),h=useRef(null);if(useEffect(()=>{var w;(w=h.current)==null||w.focus();},[]),n==null)return B.createElement(Wr,null);let x=()=>{if(m!==""){if(u&&(u==null?void 0:u.length)>zM)return gt({title:B.createElement(FormattedMessage,{id:"CommentComposeBar.unableToMention"}),content:B.createElement(FormattedMessage,{id:"CommentComposeBar.overMentionees"}),okText:B.createElement(FormattedMessage,{id:"CommentComposeBar.okText"})});if((m==null?void 0:m.length)>OM)return gt({title:B.createElement(FormattedMessage,{id:"CommentComposeBar.unableToPost"}),content:B.createElement(FormattedMessage,{id:"CommentComposeBar.overCharacter"}),okText:B.createElement(FormattedMessage,{id:"CommentComposeBar.done"})});o==null||o(m,c,g),C==null||C();}},T=m==="",S=t?y({id:"CommentComposeBar.replayTo"})+t:y({id:"CommentComposeBar.saySomething"}),b=y(t?{id:"reply"}:{id:"CommentComposeBar.addComment"});return B.createElement(J4,{className:e},B.createElement(K4,{avatar:l,backgroundImage:ae}),B.createElement(X4,{ref:h,"data-qa-anchor":"comment-compose-bar-textarea",placeholder:S,value:p,multiline:!0,mentionAllowed:!0,queryMentionees:v,onChange:w=>f==null?void 0:f(w),onKeyPress:w=>w.key==="Enter"&&x()}),B.createElement(R4,{"data-qa-anchor":t?"comment-compose-bar-reply-button":"comment-compose-bar-add-comment-button",disabled:T,onClick:x},b))},Xr=e=>{let t=E("CommentComposerBar");return t?t(e):B.createElement(UM,d({},e))};var ed=s.div`
|
|
623
623
|
color: ${({theme:e})=>e.palette.neutral.shade1};
|
|
624
624
|
${({theme:e})=>e.typography.body}
|
|
625
625
|
`,td=s.div`
|
|
@@ -646,9 +646,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
646
646
|
> :not(:first-child) {
|
|
647
647
|
margin-left: 5px;
|
|
648
648
|
}
|
|
649
|
-
`,sd=s(_r)`
|
|
650
|
-
font-size: 16px;
|
|
651
|
-
`,GM=s(sd)`
|
|
649
|
+
`,sd=s(_r).attrs({width:16,height:16})``,GM=s(sd)`
|
|
652
650
|
${id}
|
|
653
651
|
`,_M=({isLiked:e})=>e?B.createElement(GM,null):B.createElement(sd,null),qM=({onClick:e,isActive:t,isDisabled:o,totalLikes:r})=>B.createElement($M,{active:t,disabled:o,onClick:e},B.createElement(_M,{isLiked:t})," ",r&&r>0?B.createElement("span",null,r):""),ad=qM;var YM=({comment:e,onLikeSuccess:t,onUnlikeSuccess:o})=>{let r=!!(e&&e.myReactions&&e.myReactions.includes(zt)),n=(e==null?void 0:e.reactions[zt])||0,i=()=>I(void 0,null,function*(){if(e!=null)try{r?(yield ReactionRepository.removeReaction("comment",e.commentId,zt),o==null||o(e)):(yield ReactionRepository.addReaction("comment",e.commentId,zt),t==null||t(e));}catch(a){console.error("Can't toggle like",a);}});return B.createElement(ad,{isActive:r,isDisabled:e==null,totalLikes:n,onClick:i})},dd=e=>{let t=E("CommentLikeButton");return t?t(e):B.createElement(YM,d({},e))};function ri({userId:e,callback:t,shouldSubscribe:o}){return go({userId:e,level:SubscriptionLevels.POST_AND_COMMENT,shouldSubscribe:o,callback:t})}function Co({communityId:e,level:t,shouldSubscribe:o=()=>!0,callback:r}){return Ct({fetcher:CommunityRepository.getCommunity,params:e,callback:r,shouldSubscribe:()=>!!e&&o(),getSubscribedTopic:({data:n})=>getCommunityTopic(n,t)})}function ni({communityId:e,shouldSubscribe:t=()=>!0,callback:o}){return Co({communityId:e,level:SubscriptionLevels.POST_AND_COMMENT,shouldSubscribe:t,callback:o})}var XM=({commentId:e,onLikeSuccess:t,onUnlikeSuccess:o})=>{let r=j1(e);return ri({userId:r==null?void 0:r.targetId,shouldSubscribe:()=>(r==null?void 0:r.targetType)==="user"}),ni({communityId:r==null?void 0:r.targetId,shouldSubscribe:()=>(r==null?void 0:r.targetType)==="community"}),B.createElement(dd,{comment:r,onLikeSuccess:t,onUnlikeSuccess:o})},pd=XM;var eb=s.span`
|
|
654
652
|
cursor: pointer;
|
|
@@ -683,7 +681,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
683
681
|
`}
|
|
684
682
|
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
|
|
685
683
|
border-radius: 4px;
|
|
686
|
-
`;var gb=200,Cb=e=>B.createElement(
|
|
684
|
+
`;var gb=200,Cb=e=>B.createElement(A,d({},e),B.createElement(Dt,{height:14,width:14})),hb=({"data-qa-anchor":e="",isOpen:t,renderTrigger:o=Cb,children:r,position:n=gr,align:i=Rr,handleClose:a,fullSized:l=!1,scrollable:m=!1,scrollableHeight:p=gb,parentContainer:u=null,disabled:c=!1,className:g=""})=>{let[f,C]=useState(t),[v,y]=useState(n),[h,x]=ii(t),[T,S]=gd(),b=useCallback(()=>{a?t&&a():C(!1);},[a,t]),w=U1(h.current,{root:u,rootMargin:u?`0px 0px -${Math.ceil(p*100/(u.getBoundingClientRect().height-S))}% 0px`:void 0}),N={onClick:()=>C(!f),disabled:c};return useEffect(()=>{x||b();},[b,x]),useEffect(()=>{C(t);},[t]),useEffect(()=>{var D;(w==null?void 0:w.isIntersecting)===!1?((D=w.boundingClientRect)==null?void 0:D.top)<0?y(gr):y(_2):y(n);},[w,n]),B.createElement(hd,{ref:h,className:g},B.createElement(Cd,{ref:T},o(P(d({},N),{"data-qa-anchor":e}))),(t||f)&&B.createElement(yd,null,B.createElement(vd,{position:v,align:i,fullSized:l,scrollable:m,scrollableHeight:p},r)))},_1=hb;var Md=s(v1).attrs({width:16,height:16})`
|
|
687
685
|
cursor: pointer;
|
|
688
686
|
margin-left: auto;
|
|
689
687
|
`,bd=s(ye)`
|
|
@@ -834,10 +832,10 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
834
832
|
border-radius: 4px;
|
|
835
833
|
resize: none;
|
|
836
834
|
${({theme:e})=>e.typography.global}
|
|
837
|
-
`;var Eb=8,Lb=({text:e,className:t,mentionees:o,maxLines:r=Eb})=>{let[n,i]=useState(!1),a=useMemo(()=>G1(e||"",k1(o)),[o,e]),l=()=>i(!0),m=e?B.createElement(Fd,{"data-qa-anchor":"comment-content",className:t},B.createElement(Gd.Atom,null,a.map(p=>{let u=`${e}-${p.start}-${p.end}`,c=e.substring(p.start,p.end);if(p.highlight){let g=o==null?void 0:o.find(f=>f.index===p.start);return g?B.createElement($1,{key:u,mentionee:g},c):B.createElement("span",{key:u},c)}return B.createElement(en,{key:u},c)}))):null;return n?m:m?B.createElement(Gd,{lines:r,ellipsis:B.createElement(Dd,{onClick:l},B.createElement(FormattedMessage,{id:"comment.readmore"}))},m):null},el=Lb;var Fb=({commentId:e,authorName:t,authorAvatar:o,canDelete:r=!1,canEdit:n=!1,canLike:i=!0,canReply:a=!1,canReport:l=!0,createdAt:m,editedAt:p,text:u,markup:c,onClickReply:g,handleReportComment:f,handleEdit:C,startEditing:v,cancelEditing:y,handleDelete:h,isEditing:x,onChange:T,queryMentionees:S,isReported:b,isReplyComment:w,isBanned:N,mentionees:
|
|
835
|
+
`;var Eb=8,Lb=({text:e,className:t,mentionees:o,maxLines:r=Eb})=>{let[n,i]=useState(!1),a=useMemo(()=>G1(e||"",k1(o)),[o,e]),l=()=>i(!0),m=e?B.createElement(Fd,{"data-qa-anchor":"comment-content",className:t},B.createElement(Gd.Atom,null,a.map(p=>{let u=`${e}-${p.start}-${p.end}`,c=e.substring(p.start,p.end);if(p.highlight){let g=o==null?void 0:o.find(f=>f.index===p.start);return g?B.createElement($1,{key:u,mentionee:g},c):B.createElement("span",{key:u},c)}return B.createElement(en,{key:u},c)}))):null;return n?m:m?B.createElement(Gd,{lines:r,ellipsis:B.createElement(Dd,{onClick:l},B.createElement(FormattedMessage,{id:"comment.readmore"}))},m):null},el=Lb;var Fb=({commentId:e,authorName:t,authorAvatar:o,canDelete:r=!1,canEdit:n=!1,canLike:i=!0,canReply:a=!1,canReport:l=!0,createdAt:m,editedAt:p,text:u,markup:c,onClickReply:g,handleReportComment:f,handleEdit:C,startEditing:v,cancelEditing:y,handleDelete:h,isEditing:x,onChange:T,queryMentionees:S,isReported:b,isReplyComment:w,isBanned:N,mentionees:D,metadata:V})=>{let{formatMessage:G}=useIntl(),F=[n?{name:G(w?{id:"reply.edit"}:{id:"comment.edit"}),action:v}:null,l?{name:G(b?{id:"report.undoReport"}:{id:"report.doReport"}),action:f}:null,r?{name:G(w?{id:"reply.delete"}:{id:"comment.delete"}),action:h}:null].filter(ue);return B.createElement(B.Fragment,null,B.createElement(Sd,{avatar:o,backgroundImage:ae}),B.createElement(Ld,null,B.createElement(Gd,{ellipsis:B.createElement("span",null,"...",B.createElement(Q2,{date:m==null?void 0:m.getTime()}),((p==null?void 0:p.getTime())||0)-((m==null?void 0:m.getTime())||0)>0&&B.createElement(W2,null,B.createElement(FormattedMessage,{id:"comment.edited"}))),lines:2},B.createElement(kd,null,B.createElement(Ad,null,t),B.createElement(Gd.Atom,null,B.createElement(B.Fragment,null,N&&B.createElement(Xt,{style:{marginLeft:"0.265rem",marginTop:"1px"}}),B.createElement(Q2,{date:m==null?void 0:m.getTime()}),((p==null?void 0:p.getTime())||0)-((m==null?void 0:m.getTime())||0)>0&&B.createElement(W2,null,B.createElement(FormattedMessage,{id:"comment.edited"})))))),x?B.createElement(Hd,null,B.createElement($d,{multiline:!0,mentionAllowed:!0,value:c,queryMentionees:S,onChange:q=>T==null?void 0:T(q)}),B.createElement(Vd,null,B.createElement(A,{"data-qa-anchor":"comment-cancel-edit-button",onClick:y},B.createElement(FormattedMessage,{id:"cancel"})),B.createElement(Z,{"data-qa-anchor":"comment-save-edit-button",onClick:()=>C==null?void 0:C(u)},B.createElement(FormattedMessage,{id:"save"})))):B.createElement(el,{text:u,mentionees:D}),!x&&(i||a||F.length>0)&&B.createElement(Bd,null,i&&B.createElement(pd,{commentId:e}),a&&B.createElement(jd,{"data-qa-anchor":"comment-reply-button",onClick:g},B.createElement(Ud,null)," ",B.createElement(FormattedMessage,{id:"reply"})),B.createElement(Td,{"data-qa-anchor":"comment-options-button",options:F,pullRight:!1,align:Rr}))))},qd=Fb;var Db=e=>{let[t,o]=useState(!0),[r,n]=useState(!1);useEffect(()=>{e&&CommentRepository.isCommentFlaggedByMe(e).then(m=>{n(m),o(!1);});},[e]);let i=()=>I(void 0,null,function*(){if(e!=null)try{n(!0),yield CommentRepository.flagComment(e);}catch(m){n(!1);}}),a=()=>I(void 0,null,function*(){if(e!=null)try{n(!1),yield CommentRepository.unflagComment(e);}catch(m){n(!0);}});return {isLoading:t,isFlaggedByMe:r,flagComment:i,unflagComment:a,toggleFlagComment:()=>I(void 0,null,function*(){e!=null&&(r?a():i());})}},Zd=Db;var Bb="global-admin",{COMMUNITY_MODERATOR:zb,CHANNEL_MODERATOR:Ob,MODERATOR:Ub,SUPER_MODERATOR:jb}=Qr,Ot=e=>{if(!(e!=null&&e.length))return !1;let t=[zb,Ob,Ub,jb];return e.some(o=>t.includes(o))},Cr=e=>e!=null&&e.length?e.includes(Bb):!1;var Hb=(e,t=!1,o=[])=>{let{currentUserId:r}=_(),n=(e==null?void 0:e.userId)===r,i=!!(e!=null&&e.parentId);return {canDelete:!t&&n||Ot(o),canEdit:!t&&n,canLike:!t,canReply:!t&&!i,canReport:!t&&!n}},Qd=Hb;function ol({commentId:e,shouldSubscribe:t=()=>!0,callback:o}){return Ct({fetcher:CommentRepository.getComment,params:e,callback:o,shouldSubscribe:()=>!!e&&t(),getSubscribedTopic:({data:r})=>getCommentTopic(r)})}var qb=5,Yb=()=>B.createElement(zd,{"data-qa-anchor":"comment-deleted-comment"},B.createElement(J2,null,B.createElement(K2,null)),B.createElement(X2,null,B.createElement(R2,{"data-qa-anchor":"comment-deleted-comment-text"},B.createElement(FormattedMessage,{id:"comment.deleted"})))),Zb=()=>B.createElement("div",null,B.createElement(Od,{"data-qa-anchor":"reply-deleted-reply"},B.createElement(J2,{className:"reply"},B.createElement(K2,null)),B.createElement(X2,null,B.createElement(R2,{"data-qa-anchor":"reply-deleted-reply-text"},B.createElement(FormattedMessage,{id:"reply.deleted"})))));function Wd(e){var t;return e==null?"":typeof e.data=="string"?e.data:((t=e==null?void 0:e.data)==null?void 0:t.text)||""}var Qb=({commentId:e,readonly:t})=>{var ct;let o=j1(e),r=ot(o==null?void 0:o.referenceId),n=U(o==null?void 0:o.userId),i=Ue(n==null?void 0:n.avatarFileId),{userRoles:a}=_(),{toggleFlagComment:l,isFlaggedByMe:m}=Zd(e),[p,u]=useState(!1),[c,g]=useState(!1),{formatMessage:f}=useIntl(),[C,v]=useState(!1);ol({commentId:e});let{text:y,markup:h,mentions:x,onChange:T,queryMentionees:S,resetState:b,clearAll:w}=Jt({targetId:r==null?void 0:r.targetId,targetType:r==null?void 0:r.targetType,remoteText:Wd(o),remoteMarkup:A1(Wd(o),(o==null?void 0:o.metadata)||{})}),{canDelete:N,canEdit:D,canLike:V,canReply:G,canReport:F}=Qd(o,t,a);if(r==null||o==null)return B.createElement(Wr,null);let q=()=>I(void 0,null,function*(){return l()}),k=(ie,Ie,Ze)=>I(void 0,null,function*(){if(!(o!=null&&o.referenceType)||!(o!=null&&o.referenceId))return;let{referenceType:ut,referenceId:ge}=o;yield CommentRepository.createComment({referenceType:ut,referenceId:ge,data:{text:ie},parentId:e,metadata:Ze,mentionees:Ie});}),ce=(ie,Ie,Ze)=>I(void 0,null,function*(){return e&&CommentRepository.updateComment(e,{data:{text:ie},metadata:Ze,mentionees:Ie})}),se=()=>I(void 0,null,function*(){return e&&CommentRepository.deleteComment(e)}),xe=()=>I(void 0,null,function*(){try{yield q(),m?Y.success({content:f({id:"report.unreportSent"})}):Y.success({content:f({id:"report.reportSent"})});}catch(ie){ie instanceof Error&&Y.error({content:ie.message});}}),Te=()=>{u(ie=>!ie);},Ve=()=>{g(!0);},Ne=()=>{g(!1),b();},ze=()=>{let{metadata:ie,mentionees:Ie}=F1(x);ce(y,Ie,ie),w(),g(!1);},Me=!!(o!=null&&o.parentId),be=()=>{re({"data-qa-anchor":"delete-comment",title:B.createElement(FormattedMessage,{id:Me?"reply.delete":"comment.delete"}),content:B.createElement(FormattedMessage,{id:Me?"reply.deleteBody":"comment.deleteBody"}),cancelText:f({id:"comment.deleteConfirmCancelText"}),okText:f({id:"comment.deleteConfirmOkText"}),onOk:se});};if(o==null)return null;if(o!=null&&o.isDeleted)return Me?B.createElement(Zb,null):B.createElement(Z2,null,B.createElement(Yb,null));let pt=B.createElement(qd,{commentId:o==null?void 0:o.commentId,authorName:(n==null?void 0:n.displayName)||(n==null?void 0:n.userId)||f({id:"anonymous"}),authorAvatar:i==null?void 0:i.fileUrl,canDelete:N,canEdit:D,canLike:V,canReply:G,canReport:F,isBanned:n==null?void 0:n.isGlobalBanned,createdAt:o!=null&&o.createdAt?new Date(o.createdAt):void 0,editedAt:o!=null&&o.editedAt?new Date(o==null?void 0:o.editedAt):void 0,mentionees:(ct=o==null?void 0:o.metadata)==null?void 0:ct.mentioned,metadata:o==null?void 0:o.metadata,text:y,markup:h,handleReportComment:xe,startEditing:Ve,cancelEditing:Ne,handleEdit:ze,handleDelete:be,isEditing:c,queryMentionees:S,isReported:m,isReplyComment:Me,onClickReply:Te,onChange:T});return Me?B.createElement(Ed,{"data-qa-anchor":"reply"},pt):B.createElement(Z2,null,B.createElement(Nd,{"data-qa-anchor":"comment"},pt),B.createElement(li,{parentId:o.commentId,referenceType:o.referenceType,referenceId:o.referenceId,readonly:t,isExpanded:C,limit:qb}),p&&B.createElement(Xr,{postId:r==null?void 0:r.postId,userToReply:n==null?void 0:n.displayName,onSubmit:(ie,Ie,Ze)=>{k(ie,Ie,Ze),u(!1),v(!0);}}))},Kd=memo(e=>{let t=E("Comment");return t?t(e):B.createElement(Qb,d({},e))});var Jd=s(ja).attrs({height:"16px",width:"16px"})``,Xd=s.div`
|
|
838
836
|
display: flex;
|
|
839
837
|
margin-right: 8px;
|
|
840
|
-
`;var il=s(
|
|
838
|
+
`;var il=s(A)`
|
|
841
839
|
width: 100%;
|
|
842
840
|
&.text-center {
|
|
843
841
|
justify-content: center;
|
|
@@ -1090,14 +1088,14 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1090
1088
|
display: flex;
|
|
1091
1089
|
align-items: center;
|
|
1092
1090
|
justify-content: center;
|
|
1093
|
-
`,X1=()=>B.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min((e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0);return B.createElement(BI,null,B.createElement(W,{borderRadius:0,height:t,width:t,style:{display:"block"}}))}),Mp=s(
|
|
1091
|
+
`,X1=()=>B.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min((e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0);return B.createElement(BI,null,B.createElement(W,{borderRadius:0,height:t,width:t,style:{display:"block"}}))}),Mp=s(A).attrs({variant:"secondary",children:B.createElement(Oe,null)})`
|
|
1094
1092
|
position: absolute;
|
|
1095
1093
|
top: 0.5em;
|
|
1096
1094
|
right: 0.5em;
|
|
1097
1095
|
`,zI=s(Bt).attrs({width:24,height:24})`
|
|
1098
1096
|
z-index: 2;
|
|
1099
1097
|
opacity: 0.7;
|
|
1100
|
-
`,bp=s(
|
|
1098
|
+
`,bp=s(A).attrs({variant:"secondary",children:B.createElement(zI,null)})`
|
|
1101
1099
|
position: absolute;
|
|
1102
1100
|
top: 50%;
|
|
1103
1101
|
left: 50%;
|
|
@@ -1144,14 +1142,14 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1144
1142
|
display: flex;
|
|
1145
1143
|
align-items: center;
|
|
1146
1144
|
justify-content: center;
|
|
1147
|
-
`,kp=()=>B.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min(e.width||0,e.height||0);return B.createElement(YI,null,B.createElement(W,{height:t,width:t,style:{display:"block"}}))}),Fp=s(
|
|
1145
|
+
`,kp=()=>B.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min(e.width||0,e.height||0);return B.createElement(YI,null,B.createElement(W,{height:t,width:t,style:{display:"block"}}))}),Fp=s(A).attrs({variant:"secondary",children:Oe})`
|
|
1148
1146
|
position: absolute;
|
|
1149
1147
|
top: 0.5em;
|
|
1150
1148
|
right: 0.5em;
|
|
1151
1149
|
`,ZI=s(Bt).attrs({width:24,height:24})`
|
|
1152
1150
|
z-index: 2;
|
|
1153
1151
|
opacity: 0.7;
|
|
1154
|
-
`,Ap=s(
|
|
1152
|
+
`,Ap=s(A).attrs({variant:"secondary",icon:ZI})`
|
|
1155
1153
|
position: absolute;
|
|
1156
1154
|
top: 50%;
|
|
1157
1155
|
left: 50%;
|
|
@@ -1169,7 +1167,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1169
1167
|
position: absolute;
|
|
1170
1168
|
top: 1rem;
|
|
1171
1169
|
left: 1rem;
|
|
1172
|
-
`;var KI=({url:e,progress:t=-1,mediaFit:o,noBorder:r,onRemove:n,isRejected:i,onRetry:a,mimeType:l,autoPlay:m,isLive:p})=>{let u=useCallback(C=>{C.preventDefault(),C.stopPropagation(),n&&n();},[n]),c=useCallback(C=>{C.preventDefault(),C.stopPropagation(),a&&a();},[a]),[g,f]=useState(null);return useEffect(()=>{if(!(!g||!e||!e.includes("m3u8"))&&!(g!=null&&g.canPlayType("application/vnd.apple.mpegurl"))&&ui.isSupported()){let C=new ui;return C.loadSource(e),C.attachMedia(g),C.on(ui.Events.ERROR,(v,y)=>{if(y.fatal)switch(y.type){case ui.ErrorTypes.NETWORK_ERROR:C.startLoad();break;case ui.ErrorTypes.MEDIA_ERROR:C.recoverMediaError();break;}}),()=>C.destroy()}},[g,p,e]),B.createElement(ho,{border:!r},B.createElement(Np,null,e?B.createElement(Lp,{key:e,ref:C=>f(C),className:i?"darken":void 0,mediaFit:o,mimeType:l,src:e,autoPlay:m}):B.createElement(kp,null),B.createElement(Dp,null,p&&B.createElement(Bp,null),!!i&&B.createElement(Ap,{onClick:c}),!!n&&B.createElement(Fp,{onClick:u}))),!Number.isNaN(t)&&B.createElement(rn,{progress:(t||0)*100}))},nn=KI;var XI=o=>{var r=o,{file:e}=r,t=M(r,["file"]);if(e==null)return null;let n=URL.createObjectURL(e);return B.createElement(nn,d({url:n},t))},Op=XI;var ew=o=>{var r=o,{fileId:e}=r,t=M(r,["fileId"]);let n=Ue(e);if(n==null)return null;let i=(()=>{if(n.status===w4.Transcoded){let{videoUrl:a}=n;return (a==null?void 0:a["1080p"])||(a==null?void 0:a["720p"])||(a==null?void 0:a["480p"])||(a==null?void 0:a["360p"])||(a==null?void 0:a.original)||n.fileUrl}return n.fileUrl})();return B.createElement(nn,d({url:i,mimeType:P4},t))},Up=ew;function vo(e){return "fileId"in e?B.createElement(Up,d({},e)):"file"in e?B.createElement(Op,d({},e)):null}var $p=s(
|
|
1170
|
+
`;var KI=({url:e,progress:t=-1,mediaFit:o,noBorder:r,onRemove:n,isRejected:i,onRetry:a,mimeType:l,autoPlay:m,isLive:p})=>{let u=useCallback(C=>{C.preventDefault(),C.stopPropagation(),n&&n();},[n]),c=useCallback(C=>{C.preventDefault(),C.stopPropagation(),a&&a();},[a]),[g,f]=useState(null);return useEffect(()=>{if(!(!g||!e||!e.includes("m3u8"))&&!(g!=null&&g.canPlayType("application/vnd.apple.mpegurl"))&&ui.isSupported()){let C=new ui;return C.loadSource(e),C.attachMedia(g),C.on(ui.Events.ERROR,(v,y)=>{if(y.fatal)switch(y.type){case ui.ErrorTypes.NETWORK_ERROR:C.startLoad();break;case ui.ErrorTypes.MEDIA_ERROR:C.recoverMediaError();break;}}),()=>C.destroy()}},[g,p,e]),B.createElement(ho,{border:!r},B.createElement(Np,null,e?B.createElement(Lp,{key:e,ref:C=>f(C),className:i?"darken":void 0,mediaFit:o,mimeType:l,src:e,autoPlay:m}):B.createElement(kp,null),B.createElement(Dp,null,p&&B.createElement(Bp,null),!!i&&B.createElement(Ap,{onClick:c}),!!n&&B.createElement(Fp,{onClick:u}))),!Number.isNaN(t)&&B.createElement(rn,{progress:(t||0)*100}))},nn=KI;var XI=o=>{var r=o,{file:e}=r,t=M(r,["file"]);if(e==null)return null;let n=URL.createObjectURL(e);return B.createElement(nn,d({url:n},t))},Op=XI;var ew=o=>{var r=o,{fileId:e}=r,t=M(r,["fileId"]);let n=Ue(e);if(n==null)return null;let i=(()=>{if(n.status===w4.Transcoded){let{videoUrl:a}=n;return (a==null?void 0:a["1080p"])||(a==null?void 0:a["720p"])||(a==null?void 0:a["480p"])||(a==null?void 0:a["360p"])||(a==null?void 0:a.original)||n.fileUrl}return n.fileUrl})();return B.createElement(nn,d({url:i,mimeType:P4},t))},Up=ew;function vo(e){return "fileId"in e?B.createElement(Up,d({},e)):"file"in e?B.createElement(Op,d({},e)):null}var $p=s(A).attrs({variant:"secondary",children:B.createElement(Oe,null)})`
|
|
1173
1171
|
position: absolute;
|
|
1174
1172
|
top: 0.5em;
|
|
1175
1173
|
right: 0.5em;
|
|
@@ -1287,7 +1285,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1287
1285
|
`,bw=s(Bt).attrs({width:14,height:14})`
|
|
1288
1286
|
fill: ${({theme:e})=>e.palette.alert.main};
|
|
1289
1287
|
z-index: 2;
|
|
1290
|
-
`,u5=e=>B.createElement(
|
|
1288
|
+
`,u5=e=>B.createElement(A,P(d({},e),{variant:"secondary"}),B.createElement(B.Fragment,null,B.createElement(bw,null)," ",B.createElement(FormattedMessage,{id:"file.reUpload"}))),f5=s.div`
|
|
1291
1289
|
grid-area: name;
|
|
1292
1290
|
padding: 0 0.5em;
|
|
1293
1291
|
overflow: hidden;
|
|
@@ -1301,9 +1299,9 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1301
1299
|
`,Iw=s(Oe)`
|
|
1302
1300
|
grid-area: remove;
|
|
1303
1301
|
z-index: 2;
|
|
1304
|
-
`,C5=e=>B.createElement(
|
|
1302
|
+
`,C5=e=>B.createElement(A,P(d({},e),{variant:"secondary"}),B.createElement(Iw,null)),h5=s.div`
|
|
1305
1303
|
display: flex;
|
|
1306
|
-
`;var Sw=({"data-qa-anchor":e="",name:t,url:o,type:r,size:n,progress:i=-1,onRemove:a,isRejected:l,onRetry:m})=>{useIntl();let u=useCallback(f=>{f.preventDefault(),f.stopPropagation(),a&&a();},[a]),c=useCallback(f=>{f.preventDefault(),f.stopPropagation(),m&&m();},[m]),g=r==null?void 0:r.includes("image");return B.createElement(m5,{href:o,download:!0,"data-qa-anchor":e},B.createElement(d5,null,g&&o?B.createElement(p5,{src:o}):B.createElement(c5,{file:{name:t,type:r},width:null,height:"100%"}),B.createElement(f5,null,t)," ",B.createElement(g5,null,ww(n||0,{base:2})),B.createElement(h5,null,!!l&&B.createElement(u5,{onClick:c}),!!a&&B.createElement(C5,{"data-qa-anchor":"uploaders-file-remove-button",onClick:u}))),!Number.isNaN(i)&&B.createElement(rn,{progress:(i||0)*100}))},os=Sw;var Nw=({"data-qa-anchor":e="",file:t,progress:o=-1,onRemove:r,isRejected:n,retry:i=()=>{}})=>{if(t==null)return null;let a=t.type.includes("image")?URL.createObjectURL(t):void 0;return B.createElement(os,{"data-qa-anchor":e,name:t.name,size:t.size,type:t.type,url:a,progress:o,isRejected:n,onRemove:r,onRetry:()=>i()})},v5=Nw;var kw=({"data-qa-anchor":e="",fileId:t,onRemove:o})=>{let r=Ue(t);if(!r)return null;let n=FileRepository.fileUrlWithSize(r==null?void 0:r.fileUrl,"small");return B.createElement(os,{"data-qa-anchor":e,name:r.attributes.name,size:isNaN(Number(r.attributes.size))?0:Number(r.attributes.size),type:r.attributes.mimeType,url:n,onRemove:o})},x5=kw;function Pt(e){return "fileId"in e?B.createElement(x5,d({},e)):"file"in e?B.createElement(v5,d({},e)):null}var Dw=5,Bw=e=>B.createElement(
|
|
1304
|
+
`;var Sw=({"data-qa-anchor":e="",name:t,url:o,type:r,size:n,progress:i=-1,onRemove:a,isRejected:l,onRetry:m})=>{useIntl();let u=useCallback(f=>{f.preventDefault(),f.stopPropagation(),a&&a();},[a]),c=useCallback(f=>{f.preventDefault(),f.stopPropagation(),m&&m();},[m]),g=r==null?void 0:r.includes("image");return B.createElement(m5,{href:o,download:!0,"data-qa-anchor":e},B.createElement(d5,null,g&&o?B.createElement(p5,{src:o}):B.createElement(c5,{file:{name:t,type:r},width:null,height:"100%"}),B.createElement(f5,null,t)," ",B.createElement(g5,null,ww(n||0,{base:2})),B.createElement(h5,null,!!l&&B.createElement(u5,{onClick:c}),!!a&&B.createElement(C5,{"data-qa-anchor":"uploaders-file-remove-button",onClick:u}))),!Number.isNaN(i)&&B.createElement(rn,{progress:(i||0)*100}))},os=Sw;var Nw=({"data-qa-anchor":e="",file:t,progress:o=-1,onRemove:r,isRejected:n,retry:i=()=>{}})=>{if(t==null)return null;let a=t.type.includes("image")?URL.createObjectURL(t):void 0;return B.createElement(os,{"data-qa-anchor":e,name:t.name,size:t.size,type:t.type,url:a,progress:o,isRejected:n,onRemove:r,onRetry:()=>i()})},v5=Nw;var kw=({"data-qa-anchor":e="",fileId:t,onRemove:o})=>{let r=Ue(t);if(!r)return null;let n=FileRepository.fileUrlWithSize(r==null?void 0:r.fileUrl,"small");return B.createElement(os,{"data-qa-anchor":e,name:r.attributes.name,size:isNaN(Number(r.attributes.size))?0:Number(r.attributes.size),type:r.attributes.mimeType,url:n,onRemove:o})},x5=kw;function Pt(e){return "fileId"in e?B.createElement(x5,d({},e)):"file"in e?B.createElement(v5,d({},e)):null}var Dw=5,Bw=e=>B.createElement(A,{onClick:e},B.createElement(FormattedMessage,{id:"collapsible.viewAll"})),zw=({items:e=[],onExpand:t=()=>{},visibleAmount:o=Dw,renderTrigger:r=Bw,renderItem:n})=>{let i=o<e.length?e.slice(0,o):e,[a,l]=useState(o>=e.length),m=()=>{l(!0),t();};return a?B.createElement(B.Fragment,null,e.map(p=>n(p))):B.createElement(B.Fragment,null,i.map(p=>n(p)),r(m))},b5=zw;var Uw=s.div`
|
|
1307
1305
|
display: grid;
|
|
1308
1306
|
grid-template-columns: 100%;
|
|
1309
1307
|
grid-gap: 0.5rem;
|
|
@@ -1485,7 +1483,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1485
1483
|
`,K5=s(Z)`
|
|
1486
1484
|
padding: 10px 16px;
|
|
1487
1485
|
margin-left: auto;
|
|
1488
|
-
`;var yP=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return I(this,null,function*(){if(e.length===0||!e||(e==null?void 0:e.length)===0)return;let n=yield PostRepository.getPostByIds(e);o(n.data);})}r();},[e]),t},is=yP;var X5=({postId:e,onSave:t})=>{var b,w;let o=ot(e),r=is(o==null?void 0:o.children),{text:n,markup:i,mentions:a,mentionees:l,metadata:m,clearAll:p,onChange:u,queryMentionees:c}=Jt({targetId:o==null?void 0:o.targetId,targetType:o==null?void 0:o.targetType,remoteText:typeof(o==null?void 0:o.data)=="string"?o==null?void 0:o.data:(b=o==null?void 0:o.data)==null?void 0:b.text,remoteMarkup:A1(typeof(o==null?void 0:o.data)=="string"?o==null?void 0:o.data:(w=o==null?void 0:o.data)==null?void 0:w.text,o==null?void 0:o.metadata)}),[g,f]=useState([]),C=useMemo(()=>r.filter(N=>!g.includes(N.postId)),[r,g]),v=N=>{f(
|
|
1486
|
+
`;var yP=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return I(this,null,function*(){if(e.length===0||!e||(e==null?void 0:e.length)===0)return;let n=yield PostRepository.getPostByIds(e);o(n.data);})}r();},[e]),t},is=yP;var X5=({postId:e,onSave:t})=>{var b,w;let o=ot(e),r=is(o==null?void 0:o.children),{text:n,markup:i,mentions:a,mentionees:l,metadata:m,clearAll:p,onChange:u,queryMentionees:c}=Jt({targetId:o==null?void 0:o.targetId,targetType:o==null?void 0:o.targetType,remoteText:typeof(o==null?void 0:o.data)=="string"?o==null?void 0:o.data:(b=o==null?void 0:o.data)==null?void 0:b.text,remoteMarkup:A1(typeof(o==null?void 0:o.data)=="string"?o==null?void 0:o.data:(w=o==null?void 0:o.data)==null?void 0:w.text,o==null?void 0:o.metadata)}),[g,f]=useState([]),C=useMemo(()=>r.filter(N=>!g.includes(N.postId)),[r,g]),v=N=>{f(D=>[...D,N]);},y=()=>I(void 0,null,function*(){g.forEach(N=>{PostRepository.deletePost(N);}),yield PostRepository.updatePost(o.postId,{data:{text:n},mentionees:l,metadata:m}),p(),t();}),h=(n==null?void 0:n.trim())===""&&!C.length,x=useMemo(()=>C.filter(N=>N.dataType==="file"),[C]),T=useMemo(()=>C.filter(N=>N.dataType==="image"),[C]),S=useMemo(()=>C.filter(N=>N.dataType==="video"),[C]);return {text:n,markup:i,mentions:a,post:o,childrenPosts:C,clearAll:p,onChange:u,queryMentionees:c,childVideoPosts:S,childFilePosts:x,childImagePosts:T,handleRemoveChild:v,isEmpty:h,handleSave:y}};var bP=({postId:e,placeholder:t="What's going on...",className:o,onSave:r})=>{let{post:n,markup:i,onChange:a,queryMentionees:l,childVideoPosts:m,childFilePosts:p,childImagePosts:u,handleRemoveChild:c,isEmpty:g,handleSave:f}=X5({postId:e,onSave:r});return n==null?null:B.createElement(Z5,{className:o},B.createElement(Q5,null,B.createElement(xi,{"data-qa-anchor":"post-editor-textarea",data:i,dataType:"text",placeholder:t,queryMentionees:l,onChangeText:a}),u.length>0&&B.createElement(xi,{data:u,dataType:"image",onRemoveChild:c}),m.length>0&&B.createElement(xi,{data:m,dataType:"video",onRemoveChild:c}),p.length>0&&B.createElement(xi,{data:p,dataType:"file",onRemoveChild:c})),B.createElement(W5,null,B.createElement(K5,{"data-qa-anchor":"post-editor-save-button",disabled:g,onClick:f},B.createElement(FormattedMessage,{id:"save"}))))},R5=memo(bP);var e6=s.div`
|
|
1489
1487
|
display: flex;
|
|
1490
1488
|
align-items: center;
|
|
1491
1489
|
`,t6=s.div`
|
|
@@ -1542,7 +1540,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1542
1540
|
color: ${({theme:e})=>e.palette.neutral.main};
|
|
1543
1541
|
white-space: pre-wrap;
|
|
1544
1542
|
${({theme:e})=>e.typography.body}
|
|
1545
|
-
`,HP=s(
|
|
1543
|
+
`,HP=s(A).attrs({variant:"secondary"})`
|
|
1546
1544
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
1547
1545
|
padding: 4px;
|
|
1548
1546
|
display: inline-block;
|
|
@@ -1577,7 +1575,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1577
1575
|
margin-left: 12px;
|
|
1578
1576
|
}
|
|
1579
1577
|
}
|
|
1580
|
-
`,b6=()=>B.createElement(B.Fragment,null,B.createElement("div",null,B.createElement(W,{style:{fontSize:8,maxWidth:374}})),B.createElement("div",null,B.createElement(W,{style:{fontSize:8,maxWidth:448}})),B.createElement("div",{style:{paddingBottom:50}},B.createElement(W,{style:{fontSize:8,maxWidth:279}})));var tS=8,oS=3,rS="Post has been reviewed",nS=({childrenPosts:e=[],className:t,handleDeletePost:o,handleReportPost:r,handleUnreportPost:n,handleApprovePost:i,handleDeclinePost:a,handleClosePoll:l,isPollClosed:m,hidePostTarget:p,isFlaggedByMe:u,readonly:c,post:g,loading:f})=>{var Ie,Ze,ut;let{formatMessage:C}=useIntl(),[v,y]=useState(!1),h=()=>y(!0),x=()=>y(!1);function T(ge){if(ge instanceof Error)if(ge.message.includes(rS))gt({title:B.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:B.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw ge}let S=g==null?void 0:g.targetId,b=Ce(S),{currentUserId:w}=
|
|
1578
|
+
`,b6=()=>B.createElement(B.Fragment,null,B.createElement("div",null,B.createElement(W,{style:{fontSize:8,maxWidth:374}})),B.createElement("div",null,B.createElement(W,{style:{fontSize:8,maxWidth:448}})),B.createElement("div",{style:{paddingBottom:50}},B.createElement(W,{style:{fontSize:8,maxWidth:279}})));var tS=8,oS=3,rS="Post has been reviewed",nS=({childrenPosts:e=[],className:t,handleDeletePost:o,handleReportPost:r,handleUnreportPost:n,handleApprovePost:i,handleDeclinePost:a,handleClosePoll:l,isPollClosed:m,hidePostTarget:p,isFlaggedByMe:u,readonly:c,post:g,loading:f})=>{var Ie,Ze,ut;let{formatMessage:C}=useIntl(),[v,y]=useState(!1),h=()=>y(!0),x=()=>y(!1);function T(ge){if(ge instanceof Error)if(ge.message.includes(rS))gt({title:B.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:B.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw ge}let S=g==null?void 0:g.targetId,b=Ce(S),{currentUserId:w}=_();Ut({postId:g==null?void 0:g.postId,level:SubscriptionLevels.POST});let[N,D]=useState(!1),[V,G]=useState(!1),{canEdit:F,canReview:q,canDelete:k,canReport:ce,isPostUnderReview:se}=as({community:b,post:g,childrenPosts:e,userId:w||void 0}),xe=()=>I(void 0,null,function*(){yield r==null?void 0:r(),Y.success({content:B.createElement(FormattedMessage,{id:"report.reportSent"})});}),Te=()=>I(void 0,null,function*(){yield n==null?void 0:n(),Y.success({content:B.createElement(FormattedMessage,{id:"report.unreportSent"})});}),Ve=()=>I(void 0,null,function*(){try{D(!0),yield i==null?void 0:i(),Y.success({content:B.createElement(FormattedMessage,{id:"post.success.approved"})});}catch(ge){T(ge);}finally{D(!1);}}),Ne=()=>I(void 0,null,function*(){try{G(!0),yield a==null?void 0:a(),Y.success({content:B.createElement(FormattedMessage,{id:"post.success.declined"})});}catch(ge){T(ge);}finally{G(!1);}}),ze=()=>re({title:C({id:"post.deletePost"}),content:C({id:se?"post.confirmPendingDelete":"post.confirmDelete"}),okText:C({id:"delete"}),onOk:o}),Me=e.find(ge=>ge.dataType==="poll"),be=[F?{name:C({id:"post.editPost"}),action:h}:null,k?{name:C({id:"post.deletePost"}),action:ze}:null,ce?{name:C(u?{id:"report.undoReport"}:{id:"report.doReport"}),action:u?Te:xe}:null,Me&&!m?{name:C({id:"poll.close"}),action:l}:null].filter(ue),pt=e.length>0,ct=pt?oS:tS,ie=e.find(ge=>ge.dataType==="liveStream");return B.createElement(Ii,{"data-qa-anchor":"post",className:t},B.createElement(x6,null,B.createElement(c6,{postId:g==null?void 0:g.postId,hidePostTarget:p,loading:f}),!f&&B.createElement(v6,{options:be,"data-qa-anchor":"post-options-button"})),f?B.createElement(b6,null):B.createElement(B.Fragment,null,B.createElement(y6,{data:(Ie=ie==null?void 0:ie.data)!=null?Ie:g==null?void 0:g.data,dataType:(Ze=ie==null?void 0:ie.dataType)!=null?Ze:g==null?void 0:g.dataType,postMaxLines:ct,mentionees:(ut=g==null?void 0:g.metadata)==null?void 0:ut.mentioned}),pt&&B.createElement(U5,{contents:e}),!se&&B.createElement(al,{readonly:c,postId:g==null?void 0:g.postId}),se&&q&&B.createElement(M6,{"data-qa-anchor":"post-review"},B.createElement(Z,{"data-qa-anchor":"post-review-accept-button",disabled:N||V,onClick:Ve},B.createElement(FormattedMessage,{id:"general.action.accept"})),B.createElement(A,{"data-qa-anchor":"post-review-decline-button",disabled:N||V,onClick:Ne},B.createElement(FormattedMessage,{id:"general.action.decline"}))),v&&B.createElement(Le,{"data-qa-anchor":"post-editor-modal",title:C({id:"post.editPost"}),onCancel:x},B.createElement(R5,{postId:g==null?void 0:g.postId,onSave:x}))))},Qe=B.memo(nS);var I6=s.div`
|
|
1581
1579
|
color: ${({theme:e})=>e.palette.base.shade3};
|
|
1582
1580
|
display: flex;
|
|
1583
1581
|
align-items: center;
|
|
@@ -1591,7 +1589,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1591
1589
|
margin-top: 8px;
|
|
1592
1590
|
`,P6=s.div`
|
|
1593
1591
|
${({theme:e})=>e.typography.body}
|
|
1594
|
-
`;var iS=({className:e,icon:t,title:o,description:r,children:n})=>B.createElement(I6,{className:e},t,B.createElement(w6,null,o),B.createElement(P6,null,r),n),to=iS;var sS=()=>B.createElement(Ii,null,B.createElement(to,{title:B.createElement(FormattedMessage,{id:"post.unknownPost.title"}),icon:B.createElement(Va,null)},B.createElement(FormattedMessage,{id:"post.unknownPost.description"}))),T6=sS;var ms={[PostContentType.FILE]:e=>B.createElement(Qe,d({},e)),[PostContentType.IMAGE]:e=>B.createElement(Qe,d({},e)),[PostContentType.LIVESTREAM]:e=>B.createElement(Qe,d({},e)),[PostContentType.POLL]:e=>B.createElement(Qe,d({},e)),[PostContentType.TEXT]:e=>B.createElement(Qe,d({},e)),[PostContentType.VIDEO]:e=>B.createElement(Qe,d({},e)),[PostContentType.CUSTOM]:e=>B.createElement(Qe,d({},e))},E6=createContext(ms),L6=e=>{let t=useContext(E6);return useMemo(()=>e==null?o=>null:t[e]||ms[e]||(o=>B.createElement(T6,null)),[e])};function vl({children:e,config:t}){let o=useMemo(()=>t==null?ms:d(d({},ms),t),[t]);return B.createElement(E6.Provider,{value:o},e)}var pS=({apiKey:e,apiRegion:t,apiEndpoint:o,
|
|
1592
|
+
`;var iS=({className:e,icon:t,title:o,description:r,children:n})=>B.createElement(I6,{className:e},t,B.createElement(w6,null,o),B.createElement(P6,null,r),n),to=iS;var sS=()=>B.createElement(Ii,null,B.createElement(to,{title:B.createElement(FormattedMessage,{id:"post.unknownPost.title"}),icon:B.createElement(Va,null)},B.createElement(FormattedMessage,{id:"post.unknownPost.description"}))),T6=sS;var ms={[PostContentType.FILE]:e=>B.createElement(Qe,d({},e)),[PostContentType.IMAGE]:e=>B.createElement(Qe,d({},e)),[PostContentType.LIVESTREAM]:e=>B.createElement(Qe,d({},e)),[PostContentType.POLL]:e=>B.createElement(Qe,d({},e)),[PostContentType.TEXT]:e=>B.createElement(Qe,d({},e)),[PostContentType.VIDEO]:e=>B.createElement(Qe,d({},e)),[PostContentType.CUSTOM]:e=>B.createElement(Qe,d({},e))},E6=createContext(ms),L6=e=>{let t=useContext(E6);return useMemo(()=>e==null?o=>null:t[e]||ms[e]||(o=>B.createElement(T6,null)),[e])};function vl({children:e,config:t}){let o=useMemo(()=>t==null?ms:d(d({},ms),t),[t]);return B.createElement(E6.Provider,{value:o},e)}var pS=({apiKey:e,apiRegion:t,apiEndpoint:o,userId:r,displayName:n,customComponents:i={},postRendererConfig:a,theme:l={},children:m,socialCommunityCreationButtonVisible:p,actionHandlers:u,onConnectionStatusChange:c,onDisconnected:g,getAuthToken:f})=>{let[C,v]=useState(!1),[y,h]=useState(null),x=useRef(null),T=useRef(null),S=U(r),b=useMemo(()=>{var N;return {client:y||null,currentUserId:r||void 0,userRoles:(N=S==null?void 0:S.roles)!=null?N:[]}},[y,r,S==null?void 0:S.roles]);function w(){return I(this,null,function*(){try{let D=Client.getActiveClient();h(D);}catch(D){let V=Client.createClient(e,t,o?{apiEndpoint:o}:{});h(V);}if(!Client.isConnected()){let D={userId:r,displayName:n};if(f){let G=yield f();D=P(d({},D),{authToken:G});}yield Client.login(D,{sessionWillRenewAccessToken(G){return I(this,null,function*(){if(f){let F=yield f();G.renewWithAuthToken(F);return}G.renew();})}});}v(!0),x.current==null&&(x.current=Client.onSessionStateChange(D=>{c==null||c(D);})),T.current==null&&(T.current=Client.onClientDisconnected(()=>{g&&g();}));})}return useEffect(()=>(w(),()=>{var N,D;(N=x.current)==null||N.call(x),(D=T.current)==null||D.call(T);}),[r]),y==null?B.createElement(B.Fragment,null):C?B.createElement(n4,{locale:"en"},B.createElement(wm,{theme:u4(l)},B.createElement(f4,null,B.createElement(D1.Provider,{value:b},B.createElement(O2,null,B.createElement(j2,{config:i},B.createElement(T2,{config:{socialCommunityCreationButtonVisible:p||!0}},B.createElement(vl,{config:a},B.createElement(U2,d({},u),m))),B.createElement(U3,null),B.createElement(X3,null))))))):B.createElement(B.Fragment,null)},cS=pS;var gS=()=>{let[e,t]=useState(null);return useEffect(()=>{e&&(Y.error({content:e}),t(null));},[e]),[t]},A6=gS;var hS=1073741824,yS=1,xl=s.label`
|
|
1595
1593
|
cursor: pointer;
|
|
1596
1594
|
background: rgb(235 236 239 / 60%);
|
|
1597
1595
|
transition: background 0.1s;
|
|
@@ -1621,7 +1619,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1621
1619
|
&&& {
|
|
1622
1620
|
display: none;
|
|
1623
1621
|
}
|
|
1624
|
-
`,xS=({className:e="","data-qa-anchor":t="",mimeType:o,multiple:r,disabled:n,onChange:i,onMaxFilesLimit:a,onFileSizeLimit:l,fileLimitRemaining:m=0,children:p})=>{let[u]=useState(`_${(Date.now()*Math.random()).toString(36)}`),[c,g]=useState(!1),f=useCallback(b=>b.slice(0,r?m:yS),[m,r]),C=b=>b.some(w=>w.size>hS),v=useCallback(b=>(m||0)<b.length,[m]),y=useCallback(b=>{b.preventDefault(),b.stopPropagation(),!n&&(b.dataTransfer.setData(o,u),g(!0));},[n,o,u]),h=useCallback(b=>{b.preventDefault(),b.stopPropagation(),!n&&g(!1);},[n]),x=useCallback(b=>{if(b.preventDefault(),b.stopPropagation(),n)return;let w=b.target.files?[...b.target.files]:[],N=C(w),
|
|
1622
|
+
`,xS=({className:e="","data-qa-anchor":t="",mimeType:o,multiple:r,disabled:n,onChange:i,onMaxFilesLimit:a,onFileSizeLimit:l,fileLimitRemaining:m=0,children:p})=>{let[u]=useState(`_${(Date.now()*Math.random()).toString(36)}`),[c,g]=useState(!1),f=useCallback(b=>b.slice(0,r?m:yS),[m,r]),C=b=>b.some(w=>w.size>hS),v=useCallback(b=>(m||0)<b.length,[m]),y=useCallback(b=>{b.preventDefault(),b.stopPropagation(),!n&&(b.dataTransfer.setData(o,u),g(!0));},[n,o,u]),h=useCallback(b=>{b.preventDefault(),b.stopPropagation(),!n&&g(!1);},[n]),x=useCallback(b=>{if(b.preventDefault(),b.stopPropagation(),n)return;let w=b.target.files?[...b.target.files]:[],N=C(w),D=v(w),V=f(w);N?l==null||l():V.length&&(i==null||i(V)),D&&(a==null||a());},[v,n,f,i,l,a]),T=useCallback(b=>{if(b.preventDefault(),b.stopPropagation(),n)return;let w=(o||"").split(",").map(V=>V.replace("*",".*")).map(V=>new RegExp(V)),N=Array.from(b.dataTransfer.files).filter(V=>w.some(G=>G.test(V.type))),D=f(N);D.length&&(i==null||i(D)),g(!1);},[n,f,o,i]),S=b=>{};return B.createElement(xl,{"data-qa-anchor":`${t}`,id:u,className:l6(e,{hover:c,disabled:n}),onDragEnter:y,onDragOver:y,onDragLeave:h,onDrop:T},B.createElement(vS,{accept:o,multiple:r,disabled:n,onChange:x,onClick:S}),p)},ds=xS;var z6=s.div`
|
|
1625
1623
|
border-radius: 4px;
|
|
1626
1624
|
border: 1px solid ${({theme:e})=>e.palette.base.shade4};
|
|
1627
1625
|
`,Ke=s.div`
|
|
@@ -1660,7 +1658,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1660
1658
|
> * {
|
|
1661
1659
|
margin: 0 3px;
|
|
1662
1660
|
}
|
|
1663
|
-
`;var IS=({value:e})=>B.createElement("div",null,e),wS=r=>{var n=r,{placeholder:e,selected:t}=n,o=M(n,["placeholder","selected"]);return B.createElement(O6,d({},o),t&&t.length?B.createElement(U6,null,t.map(({name:i,value:a})=>B.createElement("span",{key:a},i))):B.createElement("div",null,e),B.createElement(Dt,{height:14,width:14}))},PS=({value:e=[],onSelect:t=()=>{},options:o=[],multiple:r,disabled:n,parentContainer:i=null,renderItem:a=IS,renderTrigger:l=wS,isOpen:m,handleClose:p,placeholder:u="Select...",className:c="","data-qa-anchor":g=""})=>{let[f,C]=useState(m),[v,y]=useState(e),h=()=>C(!f),x=()=>p?p():C(!1),T=(w,N)=>{y(
|
|
1661
|
+
`;var IS=({value:e})=>B.createElement("div",null,e),wS=r=>{var n=r,{placeholder:e,selected:t}=n,o=M(n,["placeholder","selected"]);return B.createElement(O6,d({},o),t&&t.length?B.createElement(U6,null,t.map(({name:i,value:a})=>B.createElement("span",{key:a},i))):B.createElement("div",null,e),B.createElement(Dt,{height:14,width:14}))},PS=({value:e=[],onSelect:t=()=>{},options:o=[],multiple:r,disabled:n,parentContainer:i=null,renderItem:a=IS,renderTrigger:l=wS,isOpen:m,handleClose:p,placeholder:u="Select...",className:c="","data-qa-anchor":g=""})=>{let[f,C]=useState(m),[v,y]=useState(e),h=()=>C(!f),x=()=>p?p():C(!1),T=(w,N)=>{y(D=>{let V=D.filter(G=>G.value!==w.value);return N&&N(V.map(G=>G.value)),V});};nt("Escape",x),useEffect(()=>{C(m);},[m]);let S=w=>{if(t(w),r){let N=v.findIndex(D=>D.value===w.value);N>=0?T(v[N]):y([...v,w]);}else y([w]),x();},b=w=>{w.preventDefault(),h();};return B.createElement(_1,{"data-qa-anchor":`${g}-select-dropdown`,isOpen:m||f,renderTrigger:w=>l(P(d({},w),{onClick:b,selected:v,remove:T,placeholder:u})),handleClose:x,fullSized:!0,scrollable:!0,parentContainer:i,disabled:n,className:c},o&&o.length>0&&B.createElement(oo,null,o.map(w=>B.createElement(Ke,{key:w.value,"data-qa-anchor":`${g}-select-menu-item`,active:v.find(N=>N.value===w.value)!=null,onClick:()=>S(w)},a(w)))))},ro=memo(PS);var NS=s.div`
|
|
1664
1662
|
margin-top: 8px;
|
|
1665
1663
|
color: ${({theme:e})=>e.palette.alert.main};
|
|
1666
1664
|
${({theme:e})=>e.typography.caption}
|
|
@@ -1685,7 +1683,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1685
1683
|
background: ${({theme:e})=>e.palette.base.shade4};
|
|
1686
1684
|
width: 100%;
|
|
1687
1685
|
padding-right: 60px;
|
|
1688
|
-
`,Y6=s(Za)``,Z6=s(
|
|
1686
|
+
`,Y6=s(Za)``,Z6=s(A)`
|
|
1689
1687
|
background: transparent;
|
|
1690
1688
|
border: none;
|
|
1691
1689
|
outline: none;
|
|
@@ -1850,7 +1848,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1850
1848
|
`,hc=s.div`
|
|
1851
1849
|
display: flex;
|
|
1852
1850
|
align-items: center;
|
|
1853
|
-
`;var vc=200,FS=({option:e,removeOption:t,updateOption:o})=>{let[r,n]=useState(e.text);return B.createElement(G6,null,B.createElement(ec,null,B.createElement(q6,{"data-qa-anchor":"poll-composer-option-item-input",value:r,maxLength:vc,onChange:a=>{n(a.target.value),o(a.target.value);}}),B.createElement(pn,null,`${r.length}/${vc}`)),B.createElement(Z6,{"data-qa-anchor":"poll-composer-option-item-close-button",onClick:t},B.createElement(Y6,{height:16})))},AS=({onChange:e,optionsLimit:t})=>{let[o,r]=useState([]),n=!t||t&&o.length<t,i=p=>{e(p.map(({text:u})=>({dataType:"text",data:u})));},a=()=>{if(n){let p=[...o,{text:"",id:v4()}];r(p),i(p);}},l=(p,u)=>{let c=o.map(g=>g.id===p?P(d({},g),{text:u}):g);r(c),i(c);},m=p=>{let u=o.findIndex(g=>g.id===p),c=[...o.slice(0,u),...o.slice(u+1)];r(c),i(c);};return B.createElement($6,null,B.createElement(tc,null,B.createElement(FormattedMessage,{id:"options_composer.title"})),o.map(p=>B.createElement(FS,{key:p.id,option:p,removeOption:()=>m(p.id),updateOption:u=>l(p.id,u)})),B.createElement("div",null,B.createElement(
|
|
1851
|
+
`;var vc=200,FS=({option:e,removeOption:t,updateOption:o})=>{let[r,n]=useState(e.text);return B.createElement(G6,null,B.createElement(ec,null,B.createElement(q6,{"data-qa-anchor":"poll-composer-option-item-input",value:r,maxLength:vc,onChange:a=>{n(a.target.value),o(a.target.value);}}),B.createElement(pn,null,`${r.length}/${vc}`)),B.createElement(Z6,{"data-qa-anchor":"poll-composer-option-item-close-button",onClick:t},B.createElement(Y6,{height:16})))},AS=({onChange:e,optionsLimit:t})=>{let[o,r]=useState([]),n=!t||t&&o.length<t,i=p=>{e(p.map(({text:u})=>({dataType:"text",data:u})));},a=()=>{if(n){let p=[...o,{text:"",id:v4()}];r(p),i(p);}},l=(p,u)=>{let c=o.map(g=>g.id===p?P(d({},g),{text:u}):g);r(c),i(c);},m=p=>{let u=o.findIndex(g=>g.id===p),c=[...o.slice(0,u),...o.slice(u+1)];r(c),i(c);};return B.createElement($6,null,B.createElement(tc,null,B.createElement(FormattedMessage,{id:"options_composer.title"})),o.map(p=>B.createElement(FS,{key:p.id,option:p,removeOption:()=>m(p.id),updateOption:u=>l(p.id,u)})),B.createElement("div",null,B.createElement(A,{"data-qa-anchor":"poll-composer-add-option-button",fullWidth:!0,disabled:!n,onClick:p=>{p.preventDefault(),a();}},B.createElement(ps,null)," ",B.createElement(FormattedMessage,{id:"options_composer.button.add"}))))},Mc=AS;var bc=s.div`
|
|
1854
1852
|
display: flex;
|
|
1855
1853
|
align-items: center;
|
|
1856
1854
|
width: 100%;
|
|
@@ -1873,7 +1871,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1873
1871
|
cursor: pointer;
|
|
1874
1872
|
}
|
|
1875
1873
|
}
|
|
1876
|
-
`,Pc=s(qa).attrs({width:24,height:24})``,Sc=s(ft).attrs({width:24,height:24})``;var Sl="{counter}",Tc=({icon:e=null,onClick:t,disabled:o})=>B.createElement(wc,{disabled:o,onClick:t},e),BS=({output:e=""})=>B.createElement(Ic,null,e),zS=({renderDecButton:e=Tc,renderIncButton:t=Tc,renderResult:o=BS,resultFormat:r="{counter}",defaultValue:n=0,onChange:i,onlyPositiveNumber:a=!0})=>{let[l,m]=useState(n);return B.createElement(bc,null,e({onClick:p=>{p.preventDefault();let u=l-1;m(u),i(u);},icon:B.createElement(Pc,null),disabled:a&&l-1<0}),o({output:r.replace(Sl,l)}),t({onClick:p=>{p.preventDefault();let u=l+1;m(u),i(u);},icon:B.createElement(Sc,null)}))},Nc=zS;var US=({onChange:e,parentContainer:t=null})=>{let{formatMessage:o}=useIntl(),r=Object.values(["single","multiple"]).map(n=>({name:o({id:"select.answerType.item"},{answerType:n}),value:n}));return B.createElement(R6,{options:r,value:[r[0]],parentContainer:t,renderItem:({name:n})=>B.createElement("div",null,n),onSelect:({value:n})=>e(n)})},Lc=US;var kc=500,Ei=2,cn=10,_S=864e5,qS=({children:e})=>B.createElement(W6,null,B.createElement(Q6,null,e)),YS=({className:e="",targetId:t,targetType:o,onCancel:r=()=>{},onSubmit:n=(a,l,m)=>{},onIsDirtyChange:i})=>{var
|
|
1874
|
+
`,Pc=s(qa).attrs({width:24,height:24})``,Sc=s(ft).attrs({width:24,height:24})``;var Sl="{counter}",Tc=({icon:e=null,onClick:t,disabled:o})=>B.createElement(wc,{disabled:o,onClick:t},e),BS=({output:e=""})=>B.createElement(Ic,null,e),zS=({renderDecButton:e=Tc,renderIncButton:t=Tc,renderResult:o=BS,resultFormat:r="{counter}",defaultValue:n=0,onChange:i,onlyPositiveNumber:a=!0})=>{let[l,m]=useState(n);return B.createElement(bc,null,e({onClick:p=>{p.preventDefault();let u=l-1;m(u),i(u);},icon:B.createElement(Pc,null),disabled:a&&l-1<0}),o({output:r.replace(Sl,l)}),t({onClick:p=>{p.preventDefault();let u=l+1;m(u),i(u);},icon:B.createElement(Sc,null)}))},Nc=zS;var US=({onChange:e,parentContainer:t=null})=>{let{formatMessage:o}=useIntl(),r=Object.values(["single","multiple"]).map(n=>({name:o({id:"select.answerType.item"},{answerType:n}),value:n}));return B.createElement(R6,{options:r,value:[r[0]],parentContainer:t,renderItem:({name:n})=>B.createElement("div",null,n),onSelect:({value:n})=>e(n)})},Lc=US;var kc=500,Ei=2,cn=10,_S=864e5,qS=({children:e})=>B.createElement(W6,null,B.createElement(Q6,null,e)),YS=({className:e="",targetId:t,targetType:o,onCancel:r=()=>{},onSubmit:n=(a,l,m)=>{},onIsDirtyChange:i})=>{var q;let{text:a,markup:l,mentions:m,mentionees:p,metadata:u,queryMentionees:c,onChange:g}=Jt({targetId:t||void 0,targetType:o}),[f,C]=useState(!1),v={question:"",answers:[],answerType:"single",closedIn:0},{handleSubmit:y,setError:h,watch:x,control:T,formState:{errors:S,isDirty:b}}=useForm({defaultValues:v}),{formatMessage:w}=useIntl(),N=x("question",""),D=x("answers",[]);useEffect(()=>i==null?void 0:i(b),[b]);let V=k=>I(void 0,null,function*(){var ce,se,xe;try{if(C(!0),!k.question.trim()){h("question",{message:"Question cannot be empty"});return}if(((ce=k==null?void 0:k.answers)==null?void 0:ce.length)<Ei){h("answers",{message:`Minimum amount of answers should be ${Ei}`});return}if(((se=k==null?void 0:k.answers)==null?void 0:se.length)>cn){h("answers",{message:`Maximum amount of answers should be ${cn}`});return}let Te={question:k==null?void 0:k.question,answers:(xe=k==null?void 0:k.answers)!=null&&xe.length?k.answers:[],answerType:(k==null?void 0:k.answerType)||"single",closedIn:k&&k.closedIn?k.closedIn*_S:void 0};yield n(Te,p,u);}finally{C(!1);}}),G=!b||(N==null?void 0:N.length)===0||f,F=useRef(null);return B.createElement(H6,null,B.createElement(V6,{className:e,onSubmit:y(V)},B.createElement(K6,{ref:F},B.createElement(qS,null,B.createElement(Pi,null,B.createElement(bl,null,B.createElement(Ti,null,B.createElement(Si,{className:"required"},B.createElement(FormattedMessage,{id:"poll_composer.question.label"}))),B.createElement(pn,null,`${(q=a==null?void 0:a.length)!=null?q:0}/${kc}`)),B.createElement(Controller,{control:T,name:"question",rules:{required:"Question is required",maxLength:{value:kc,message:"Question is too long"}},render:Te=>{var{field:Ve}=Te,Ne=Ve,{value:k,ref:ce,onChange:se}=Ne,xe=M(Ne,["value","ref","onChange"]);return B.createElement(_6,P(d({},xe),{ref:ce,"data-qa-anchor":"poll-composer-options-textarea",mentionAllowed:!0,multiline:!0,value:l,queryMentionees:c,placeholder:w({id:"poll_composer.question.placeholder"}),onChange:pt=>{var ct=pt,{plainText:ze,mentions:Me}=ct,be=M(ct,["plainText","mentions"]);if((Me==null?void 0:Me.length)>I4)return gt({title:B.createElement(FormattedMessage,{id:"pollComposer.unableToMention"}),content:B.createElement(FormattedMessage,{id:"pollComposer.overMentionees"}),okText:B.createElement(FormattedMessage,{id:"pollComposer.okText"}),type:"info"});g(d({plainText:ze,mentions:Me},be)),se(ze);}}))}}),B.createElement(Ml,{errors:S,name:"question"})),B.createElement(Pi,null,B.createElement(bl,null,B.createElement(Ti,null,B.createElement(Si,{className:"required"},B.createElement(FormattedMessage,{id:"poll_composer.poll_options.label"}))),B.createElement(pn,null,`${D.length}/${cn}`)),B.createElement(Controller,{rules:{required:`There should be at least ${Ei} answers`,minLength:{value:Ei,message:`There should be at least ${Ei} answers`},maxLength:{value:cn,message:`There can be only ${cn} answers maximum`}},name:"answers",control:T,render:({field:k})=>B.createElement(Mc,d({optionsLimit:cn},k))}),B.createElement(Ml,{errors:S,name:"answers"})),B.createElement(Pi,{horizontal:!0,separate:!0},B.createElement(wl,null,B.createElement(Ti,null,B.createElement(Si,null,B.createElement(FormattedMessage,{id:"poll_modal.answer_type.title"})),B.createElement("div",null,B.createElement(FormattedMessage,{id:"poll_modal.answer_type.body"}))),B.createElement(Il,null,B.createElement(Controller,{rules:{required:"Answer type is required"},name:"answerType",render:({field:k})=>B.createElement(Lc,d({parentContainer:F.current},k)),control:T})))),B.createElement(Pi,{horizontal:!0,separate:!0},B.createElement(wl,null,B.createElement(Ti,null,B.createElement(Si,null,B.createElement(FormattedMessage,{id:"poll_modal.closed_in.title"})),B.createElement("div",null,B.createElement(FormattedMessage,{id:"poll_modal.closed_in.body"}))),B.createElement(Il,null,B.createElement(Controller,{name:"closedIn",render:({field:k})=>B.createElement(Nc,P(d({},k),{onlyPositiveNumber:!0,resultFormat:`${Sl} days`})),control:T})))))),B.createElement(J6,null,B.createElement(A,{onClick:k=>{k.preventDefault(),r();}},B.createElement(FormattedMessage,{id:"cancel"})),B.createElement(X6,{"data-qa-anchor":"poll-composer-post-button",disabled:G},B.createElement(FormattedMessage,{id:"post"})))))},Fc=YS;var KS=({targetId:e,targetType:t,onClose:o,onCreatePoll:r})=>{let[n,i]=useState(!1),{formatMessage:a}=useIntl(),l=(p,u,c)=>I(void 0,null,function*(){let g=yield PollRepository.createPoll(p);yield r(g.data.pollId,p.question,u,c),o();}),m=()=>re({title:a({id:"CommunityCreationModal.title"}),content:a({id:"CommunityCreationModal.content"}),cancelText:a({id:"CommunityCreationModal.cancelText"}),okText:a({id:"CommunityCreationModal.okText"}),onOk:o});return B.createElement(Le,{"data-qa-anchor":"poll-composer-modal",title:a({id:"poll_modal.title"}),clean:!1,onCancel:n?m:o},B.createElement(Fc,{targetId:e,targetType:t,onIsDirtyChange:p=>i(p),onCancel:m,onSubmit:l}))},Dc=KS;var eT=n=>{var i=n,{className:e,fixed:t=!1,children:o}=i,r=M(i,["className","fixed","children"]);return B.createElement(Popover,d({containerClassName:l6(e,{fixed:t})},r),o)},Bc=s(eT)`
|
|
1877
1875
|
${({theme:e})=>e.typography.body}
|
|
1878
1876
|
z-index: 10000;
|
|
1879
1877
|
background: ${({theme:e})=>e.palette.system.background};
|
|
@@ -1959,9 +1957,9 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
1959
1957
|
min-height: 1em;
|
|
1960
1958
|
margin-bottom: 1rem;
|
|
1961
1959
|
${({uploadLoading:e})=>e&&"cursor: wait !important;"}
|
|
1962
|
-
`,IT=({uploading:e,uploaded:t,progress:o,removeFile:r,uploadLoading:n,rejected:i,retry:a,rowDataQaAnchor:l})=>B.createElement(bT,{uploadLoading:n},t.map(m=>B.createElement(Pt,{key:m.fileId,"data-qa-anchor":l,fileId:m.fileId,onRemove:()=>r(m)})),e.map(m=>B.createElement(Pt,{key:m.name,"data-qa-anchor":l,file:m,progress:o[m.name],isRejected:i.includes(m.name),onRemove:()=>r(m)}))),wT=({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,uploadLoading:n,onError:i,rowDataQaAnchor:a="post-creator-uploaded-file"})=>{let l=Sr({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,onError:i}),{allFiles:m}=l;return m.length===0?null:B.createElement(IT,P(d({},l),{uploadLoading:n,rowDataQaAnchor:a}))},ys=wT;var ST=e=>B.createElement(ys,P(d({},e),{rowDataQaAnchor:"post-creator-uploaded-video"})),e8=ST;var BT=({targetId:e,targetType:t})=>{let[o,r]=useState(null),[n,i]=useState(null),a=useRef(null);return useEffect(()=>{if(!(e==null||e===""))return a.current&&a.current(),(t==="communityFeed"||t==="community")&&(a.current=CommunityRepository.getCommunity(e,l=>{r(l.data);})),a.current=UserRepository.getUser(e,l=>{i(l.data);}),()=>{var l;(l=a.current)==null||l.call(a);}},[e,t]),{community:o,user:n}},zT=10,OT=()=>gt({title:B.createElement(FormattedMessage,{id:"postCreator.unableToPost"}),content:B.createElement(FormattedMessage,{id:"postCreator.overCharacter"}),okText:B.createElement(FormattedMessage,{id:"postCreator.done"}),type:"info"}),UT=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:l,onCreateSuccess:m,maxFiles:p=zT})=>{var H0,V0;let{currentUserId:u}=
|
|
1960
|
+
`,IT=({uploading:e,uploaded:t,progress:o,removeFile:r,uploadLoading:n,rejected:i,retry:a,rowDataQaAnchor:l})=>B.createElement(bT,{uploadLoading:n},t.map(m=>B.createElement(Pt,{key:m.fileId,"data-qa-anchor":l,fileId:m.fileId,onRemove:()=>r(m)})),e.map(m=>B.createElement(Pt,{key:m.name,"data-qa-anchor":l,file:m,progress:o[m.name],isRejected:i.includes(m.name),onRemove:()=>r(m)}))),wT=({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,uploadLoading:n,onError:i,rowDataQaAnchor:a="post-creator-uploaded-file"})=>{let l=Sr({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,onError:i}),{allFiles:m}=l;return m.length===0?null:B.createElement(IT,P(d({},l),{uploadLoading:n,rowDataQaAnchor:a}))},ys=wT;var ST=e=>B.createElement(ys,P(d({},e),{rowDataQaAnchor:"post-creator-uploaded-video"})),e8=ST;var BT=({targetId:e,targetType:t})=>{let[o,r]=useState(null),[n,i]=useState(null),a=useRef(null);return useEffect(()=>{if(!(e==null||e===""))return a.current&&a.current(),(t==="communityFeed"||t==="community")&&(a.current=CommunityRepository.getCommunity(e,l=>{r(l.data);})),a.current=UserRepository.getUser(e,l=>{i(l.data);}),()=>{var l;(l=a.current)==null||l.call(a);}},[e,t]),{community:o,user:n}},zT=10,OT=()=>gt({title:B.createElement(FormattedMessage,{id:"postCreator.unableToPost"}),content:B.createElement(FormattedMessage,{id:"postCreator.overCharacter"}),okText:B.createElement(FormattedMessage,{id:"postCreator.done"}),type:"info"}),UT=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:l,onCreateSuccess:m,maxFiles:p=zT})=>{var H0,V0;let{currentUserId:u}=_(),{setNavigationBlocker:c}=O(),g=U(u);(t==="global"||t==="myFeed")&&(t="user",o=u||"");let[f,C]=useState({targetType:t,targetId:o}),{user:v,community:y}=BT({targetId:f.targetId,targetType:f.targetType}),{moderators:h}=Mo(y==null?void 0:y.communityId);useEffect(()=>{C({targetType:t,targetId:o});},[t,o]);let x=j({fileId:(v==null?void 0:v.avatarFileId)||(y==null?void 0:y.avatarFileId)||""}),[T,S]=useState([]),[b,w]=useState([]),[N,D]=useState([]),[V,G]=useState([]),[F,q]=useState([]),[k,ce]=useState([]),[se,xe]=useState(!1),[Te]=A6(),{mentionees:Ve,metadata:Ne,text:ze,markup:Me,onChange:be,queryMentionees:pt,clearAll:ct}=Jt({targetType:f.targetType,targetId:f.targetId||void 0}),[ie,Ie]=useState(!1);function Ze(){return I(this,null,function*(){var $e;if(f.targetId)try{Ie(!0);let Xe={},Ft=[];if(ze&&(Xe.text=ze),T.length&&Ft.push(...T.map(nr=>({fileId:nr.fileId,type:FileType.IMAGE}))),b.length&&Ft.push(...b.map(nr=>({fileId:nr.fileId,type:FileType.VIDEO}))),N.length&&Ft.push(...N.map(nr=>({fileId:nr.fileId,type:FileType.FILE}))),($e=Xe.text)!=null&&$e.length&&Xe.text.length>5e4){OT();return}let va={targetId:f.targetId,targetType:f.targetType,data:Xe,dataType:"text",attachments:Ft,metadata:Ne,mentionees:Ve},$0=(yield PostRepository.createPost(va)).data;if(m==null||m($0),ct(),S([]),w([]),D([]),G([]),q([]),ce([]),y){let nr=(h||[]).find(JC=>JC.userId===$0.postedUserId)!=null;y.postSetting===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED&&!nr&&Y.success({content:B.createElement(FormattedMessage,{id:"post.success.submittedToReview"})});}}finally{Ie(!1);}})}let ut=()=>{Y.info({content:B.createElement(FormattedMessage,{id:"upload.attachmentLimit",values:{maxFiles:p}})});},ge=()=>{Y.info({content:B.createElement(FormattedMessage,{id:"upload.fileSizeLimit"})});},qn=f.targetType==="community"?tt:ae,rr=B.createElement(jc,{avatar:(v==null?void 0:v.avatarCustomUrl)||x||void 0,backgroundImage:qn}),Wt=!ze&&T.length===0&&b.length===0&&N.length===0||se||ie,O0=!(!ze&&T.length===0&&b.length===0&&N.length===0);useEffect(()=>{O0?c==null||c({title:B.createElement(FormattedMessage,{id:"post.discard.title"}),content:B.createElement(FormattedMessage,{id:"post.discard.content"}),okText:B.createElement(FormattedMessage,{id:"general.action.discard"})}):c==null||c(null);},[O0,c]);let[WC,U0]=useState(!1),KC=()=>U0(!0),j0=(H0=f==null?void 0:f.targetType)!=null?H0:t,ya=(V0=f==null?void 0:f.targetId)!=null?V0:o;return B.createElement(Hc,{className:l6("postComposeBar",e)},WC&&B.createElement(Dc,{targetId:ya||void 0,targetType:j0,onCreatePoll:($e,Xe,Ft,va)=>I(void 0,null,function*(){ya&&(yield PostRepository.createPost({targetId:ya,targetType:j0,data:{pollId:$e,text:Xe},dataType:"poll",mentionees:Ft,metadata:va}));}),onClose:()=>U0(!1)}),r&&g?B.createElement(Uc,{user:g,communities:n,hasMoreCommunities:a,loadMoreCommunities:l,currentTargetId:f.targetId,onChange:C},rr):rr,B.createElement($c,null,B.createElement(qc,{"data-qa-anchor":"post-creator-textarea",multiline:!0,value:Me,placeholder:i,mentionAllowed:!0,queryMentionees:pt,loadMoreMentionees:$e=>pt($e),append:B.createElement(_c,null,B.createElement(Rc,{files:V,uploadedFiles:T,uploadLoading:se,onLoadingChange:xe,onChange:({uploaded:$e,uploading:Xe})=>{S($e),G(Xe);},onError:Te}),B.createElement(e8,{files:F,uploadedFiles:b,uploadLoading:se,onLoadingChange:xe,onChange:({uploaded:$e,uploading:Xe})=>{w($e),q(Xe);},onError:Te}),B.createElement(ys,{files:k,uploadedFiles:N,uploadLoading:se,onLoadingChange:xe,onChange:({uploaded:$e,uploading:Xe})=>{D($e),ce(Xe);},onError:Te})),onChange:({text:$e,plainText:Xe,mentions:Ft})=>{if((Ft==null?void 0:Ft.length)>30)return gt({title:B.createElement(FormattedMessage,{id:"postCreator.unableToMention"}),content:B.createElement(FormattedMessage,{id:"postCreator.overMentionees"}),okText:B.createElement(FormattedMessage,{id:"postCreator.okText"}),type:"info"});be({text:$e,plainText:Xe,mentions:Ft});}}),B.createElement(Vc,{"data-qa-anchor":"post-creator-footer"},B.createElement(Wc,{imageUploadDisabled:N.length>0||b.length>0||se,videoUploadDisabled:N.length>0||T.length>0||se,fileUploadDisabled:T.length>0||b.length>0||se,fileLimitRemaining:p-N.length-T.length-b.length,uploadLoading:se,onChangeImages:$e=>G($e),onChangeVideos:q,onChangeFiles:ce,onMaxFilesLimit:ut,onFileSizeLimit:ge}),B.createElement(Zc,{"data-qa-anchor":"post-creator-poll-button",onClick:KC},B.createElement(xl,null,B.createElement(Qc,null))),B.createElement(Gc,{disabled:Wt,"data-qa-anchor":"post-creator-post-button",onClick:Ze},B.createElement(FormattedMessage,{id:"post"})))))},Li=memo(UT);var VT=e=>{let[t,o]=useState(!0),[r,n]=useState(!1),{currentUserId:i}=_(),a=(e==null?void 0:e.postId)||void 0,l=useMemo(()=>(e==null?void 0:e.creatorId)===i,[e,i]);useEffect(()=>{!a||l||PostRepository.isPostFlaggedByMe(a).then(c=>{n(c),o(!1);});},[a]);let m=()=>I(void 0,null,function*(){if(!(a==null||l))try{n(!0),yield PostRepository.flagPost(a);}catch(c){n(!1);}}),p=()=>I(void 0,null,function*(){if(!(a==null||l))try{n(!1),yield PostRepository.unflagPost(a);}catch(c){n(!0);}});return {isLoading:t,isFlaggedByMe:r,isUnableToFlag:l,flagPost:m,unflagPost:p,toggleFlagPost:()=>I(void 0,null,function*(){a==null||l||(r?p():m());})}},r8=VT;var qT=({postId:e,className:t,hidePostTarget:o,readonly:r,onDeleted:n})=>{var b;let i=ot(e),a=U(i==null?void 0:i.postedUserId),l=j({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"}),m=is(i==null?void 0:i.children),{userRoles:p}=_(),{isFlaggedByMe:u,toggleFlagPost:c}=r8(i),g=L6(i==null?void 0:i.dataType),{currentUserId:f}=_();Ut({postId:e,level:SubscriptionLevels.POST}),mi({targetType:i==null?void 0:i.targetType,targetId:i==null?void 0:i.targetId,shouldSubscribe:()=>!!i});let C=(m||[]).find(w=>w.dataType==="poll"),v=ns((b=C==null?void 0:C.data)==null?void 0:b.pollId),y=(v==null?void 0:v.status)==="closed",h=()=>I(void 0,null,function*(){v!=null&&(yield PollRepository.closePoll(v.pollId));}),x=()=>I(void 0,null,function*(){i!=null&&(yield PostRepository.deletePost(i.postId),n==null||n(i.postId));}),T=()=>I(void 0,null,function*(){i!=null&&(yield PostRepository.approvePost(i.postId));}),S=()=>I(void 0,null,function*(){i!=null&&(yield PostRepository.declinePost(i.postId));});return i==null||g==null?B.createElement(Qe,{loading:!0}):B.createElement(B.Fragment,null,g({childrenPosts:m||[],handleClosePoll:h,isPollClosed:y,avatarFileUrl:l,user:a,poll:v,className:t,currentUserId:f||void 0,hidePostTarget:o,post:i,userRoles:p,readonly:r,isFlaggedByMe:u,handleReportPost:c,handleUnreportPost:c,handleApprovePost:T,handleDeclinePost:S,handleDeletePost:x}))},ki=memo(e=>{let t=E("Post");return t?t(e):B.createElement(qT,d({},e))});var YT=s(M2).attrs({width:48,height:48})`
|
|
1963
1961
|
margin: 10px;
|
|
1964
|
-
`,ZT=s(
|
|
1962
|
+
`,ZT=s(A)`
|
|
1965
1963
|
font-size: 14px;
|
|
1966
1964
|
margin-top: 8px;
|
|
1967
1965
|
`,QT=s(pr).attrs({width:16,height:16})`
|
|
@@ -2026,7 +2024,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2026
2024
|
`,m8=s.div`
|
|
2027
2025
|
font-size: 14px;
|
|
2028
2026
|
color: ${({theme:e})=>e.palette.base.shade1};
|
|
2029
|
-
`;var eN=()=>B.createElement(i8,null,B.createElement(s8,null,B.createElement(a8,null)),B.createElement(l8,null,B.createElement(FormattedMessage,{id:"privateFeed.title"})),B.createElement(m8,null,B.createElement(FormattedMessage,{id:"privateFeed.body"}))),Di=eN;var nN=()=>{let[e,t]=useState([]),[o,r]=useState(!1),[n,i]=useState(null),[a,l]=useState(!1);function m(){return I(this,null,function*(){try{let f=yield FeedRepository.queryGlobalFeed({limit:10,queryToken:n||void 0});i(f.paging.next||null),t(C=>[...C,...f.data]);}finally{r(!1);}})}useEffect(()=>{m();},[]);let p=f=>{t(C=>[f,...C]);},u=f=>{let C=e.filter(v=>v.postId!==f);t(C);},c=useMemo(()=>n!==null,[n]);return {contents:e,isLoading:o,prependItem:p,removeItem:u,loadMore:()=>{l(!0),c&&m();},hasMore:c,loadMoreHasBeenCalled:a}},p8=nN;function no(e,t){let n=ee({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:()=>!!e&&(t?t==null?void 0:t():!0)}),{items:o}=n,r=M(n,["items"]);return d({communities:o},r)}var mN=({className:e="",feedType:t,showPostCreator:o=!1,goToExplore:r,readonly:n=!1,isHiddenProfile:i=!1})=>{let{currentUserId:a}=
|
|
2027
|
+
`;var eN=()=>B.createElement(i8,null,B.createElement(s8,null,B.createElement(a8,null)),B.createElement(l8,null,B.createElement(FormattedMessage,{id:"privateFeed.title"})),B.createElement(m8,null,B.createElement(FormattedMessage,{id:"privateFeed.body"}))),Di=eN;var nN=()=>{let[e,t]=useState([]),[o,r]=useState(!1),[n,i]=useState(null),[a,l]=useState(!1);function m(){return I(this,null,function*(){try{let f=yield FeedRepository.queryGlobalFeed({limit:10,queryToken:n||void 0});i(f.paging.next||null),t(C=>[...C,...f.data]);}finally{r(!1);}})}useEffect(()=>{m();},[]);let p=f=>{t(C=>[f,...C]);},u=f=>{let C=e.filter(v=>v.postId!==f);t(C);},c=useMemo(()=>n!==null,[n]);return {contents:e,isLoading:o,prependItem:p,removeItem:u,loadMore:()=>{l(!0),c&&m();},hasMore:c,loadMoreHasBeenCalled:a}},p8=nN;function no(e,t){let n=ee({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:()=>!!e&&(t?t==null?void 0:t():!0)}),{items:o}=n,r=M(n,["items"]);return d({communities:o},r)}var mN=({className:e="",feedType:t,showPostCreator:o=!1,goToExplore:r,readonly:n=!1,isHiddenProfile:i=!1})=>{let{currentUserId:a}=_(),{contents:l,isLoading:m,loadMore:p,prependItem:u,removeItem:c,hasMore:g,loadMoreHasBeenCalled:f}=p8();function C(){return new Array(3).fill(3).map((v,y)=>B.createElement(Qe,{key:y,loading:!0}))}return B.createElement(Ai,{className:e,dataLength:l.length,next:p,hasMore:g,loader:null},i?B.createElement(Di,null):B.createElement(B.Fragment,null,o?B.createElement(Li,{"data-qa-anchor":"feed-post-creator-textarea",targetType:"user",targetId:a||void 0,enablePostTargetPicker:!1,onCreateSuccess:v=>u(v)}):null,m&&!f?C():null,(!m||f)&&l.length>0&&B.createElement(_e,{hasMore:g,loadMore:p,className:"load-more no-border",contentSlot:l.map(v=>B.createElement(ki,{key:v.postId,postId:v.postId,hidePostTarget:!1,readonly:n,onDeleted:y=>c(y)}))}),!m&&l.length===0&&B.createElement(Fi,{targetType:"global",goToExplore:r,canPost:o,feedType:t}),m&&f?C():null))},dN=({className:e="",feedType:t,targetType:o="myFeed",onPostCreated:r,goToExplore:n,readonly:i=!1,isHiddenProfile:a=!1})=>{let{currentUserId:l}=_(),m=l||void 0,{posts:p,hasMore:u,loadMore:c,isLoading:g,loadMoreHasBeenCalled:f}=Vt({targetType:"user",targetId:m,feedType:t}),{communities:C,hasMore:v,loadMore:y}=no({membership:"member"}),h=useCallback(()=>{y==null||y();},[y]);function x(){return new Array(3).fill(3).map((T,S)=>B.createElement(Qe,{key:S,loading:!0}))}return B.createElement(Ai,{className:e,dataLength:p.length,next:c,hasMore:u,loader:null},a?B.createElement(Di,null):B.createElement(B.Fragment,null,B.createElement(Li,{"data-qa-anchor":"feed-post-creator-textarea",targetType:"user",targetId:m||void 0,communities:C,enablePostTargetPicker:!1,hasMoreCommunities:v,loadMoreCommunities:h,onCreateSuccess:r}),g&&!f?x():null,(!g||f)&&p.length>0&&B.createElement(_e,{hasMore:u,loadMore:c,className:"load-more no-border",contentSlot:B.createElement(B.Fragment,null,p.map(T=>B.createElement(ki,{key:T.postId,postId:T.postId,hidePostTarget:!0,readonly:i})))}),!g&&p.length===0&&B.createElement(Fi,{targetType:o,goToExplore:n,canPost:!0,feedType:t}),g&&f?x():null))},pN=({className:e="",targetType:t,targetId:o="",feedType:r,showPostCreator:n=!1,onPostCreated:i,goToExplore:a,readonly:l=!1,isHiddenProfile:m=!1})=>{let{posts:p,hasMore:u,loadMore:c,isLoading:g,loadMoreHasBeenCalled:f}=Vt({targetType:t,targetId:o||void 0,feedType:r});Co({communityId:o,level:SubscriptionLevels.COMMUNITY});function C(){return new Array(3).fill(3).map((v,y)=>B.createElement(Qe,{key:y,loading:!0}))}return B.createElement(Ai,{className:e,dataLength:p.length,next:c,hasMore:u,loader:null},m?B.createElement(Di,null):B.createElement(B.Fragment,null,n?B.createElement(Li,{"data-qa-anchor":"feed-post-creator-textarea",targetType:t,targetId:o,enablePostTargetPicker:!1,onCreateSuccess:i}):null,g&&!f?C():null,!g&&p.length>0&&B.createElement(_e,{hasMore:u,loadMore:c,className:"load-more no-border",contentSlot:B.createElement(B.Fragment,null,p.map(v=>B.createElement(ki,{key:v.postId,postId:v.postId,hidePostTarget:!0,readonly:l})))}),!g&&p.length===0&&B.createElement(Fi,{targetType:t,goToExplore:a,canPost:n}),g&&f?C():null))},cN=({className:e="",feedType:t,targetType:o,targetId:r="",showPostCreator:n=!1,onPostCreated:i,goToExplore:a,readonly:l=!1,isHiddenProfile:m=!1})=>{let{posts:p,hasMore:u,loadMore:c,isLoading:g,loadMoreHasBeenCalled:f}=Vt({targetType:o,targetId:r||void 0,feedType:t}),{communities:C,hasMore:v,loadMore:y}=no({membership:"member"});function h(){return new Array(3).fill(3).map((x,T)=>B.createElement(Qe,{key:T,loading:!0}))}return B.createElement(Ai,{className:e,dataLength:p.length,next:c,hasMore:u,loader:null},m?B.createElement(Di,null):B.createElement(B.Fragment,null,n&&B.createElement(Li,{"data-qa-anchor":"feed-post-creator-textarea",targetType:o,targetId:r,communities:C,enablePostTargetPicker:!1,hasMoreCommunities:v,loadMoreCommunities:y,onCreateSuccess:i}),g&&!f?h():null,!g&&p.length>0&&B.createElement(_e,{hasMore:u,loadMore:c,className:"load-more no-border",contentSlot:B.createElement(B.Fragment,null,p.map(x=>B.createElement(ki,{key:x.postId,postId:x.postId,hidePostTarget:!0,readonly:l})))}),!g&&p.length===0&&B.createElement(Fi,{targetType:o,goToExplore:a,canPost:n,feedType:t}),g&&f?h():null))},uN=e=>e==="communityFeed"?"community":e==="userFeed"?"user":e==="globalFeed"||e==="global"?"feed":e||"myFeed",fN=e=>{let n=e,{targetType:t}=n,o=M(n,["targetType"]),r=uN(t);return r==="feed"?B.createElement(mN,d({},o)):r==="myFeed"?B.createElement(dN,P(d({},o),{targetType:r})):r==="community"?B.createElement(pN,P(d({},o),{targetType:r})):B.createElement(cN,P(d({},o),{targetType:r}))},Go=memo(e=>{let t=E("Feed");return t?t(e):B.createElement(fN,d({},e))});var gN=s.div`
|
|
2030
2028
|
overflow: hidden;
|
|
2031
2029
|
display: grid;
|
|
2032
2030
|
grid-template-areas: 'side main' 'none main';
|
|
@@ -2450,7 +2448,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2450
2448
|
margin: 0 0.5rem;
|
|
2451
2449
|
`,V8=s(Oe).attrs({width:12,height:12})`
|
|
2452
2450
|
fill: ${({theme:e})=>e.palette.base.shade1};
|
|
2453
|
-
`,$8=s(
|
|
2451
|
+
`,$8=s(A)`
|
|
2454
2452
|
padding: 0.4rem 0.55rem;
|
|
2455
2453
|
border-radius: 10rem;
|
|
2456
2454
|
`;var pE=({categoryId:e,name:t,fileUrl:o,onClick:r,onRemove:n})=>{let i=useCallback(l=>{l.stopPropagation(),e&&(r==null||r(e));},[r,e]),a=useCallback(l=>{l.stopPropagation(),e&&(n==null||n(e));},[n,e]);return B.createElement(j8,{onClick:i},B.createElement(J,{size:"tiny",avatar:o,backgroundImage:f1}),B.createElement(H8,null,t),!!n&&B.createElement($8,{onClick:a},B.createElement(V8,null)))},_8=pE;var uE=({categoryId:e,onClick:t,onRemove:o})=>{let r=Qo(e),n=j({fileId:r==null?void 0:r.avatarFileId,imageSize:"small"});return r==null?null:B.createElement(_8,{categoryId:r.categoryId,name:r.name,fileUrl:n,onClick:i=>t==null?void 0:t(i),onRemove:o})},q8=uE;function Ui(e){let r=ee({fetcher:CategoryRepository.getCategories,params:e}),{items:t}=r,o=M(r,["items"]);return d({categories:t},o)}var hE=({"data-qa-anchor":e="",value:t,onChange:o,parentContainer:r=null})=>{let n=t!=null?t:[],[i,a]=useState(!1),[l,m]=useState(""),p=()=>a(!i),{formatMessage:u}=useIntl(),c=useRef(null),g=h=>{var x;m(h),a(!!h),h&&((x=c.current)==null||x.focus());},f=()=>{m(""),a(!1);},{categories:C}=Ui({includeDeleted:!1,limit:100}),v=C.filter(h=>l?h.name.includes(l):!0).map(h=>({name:h.name,value:h.categoryId})),y=n.map(h=>{var x;return {name:((x=C.find(T=>T.categoryId===h))==null?void 0:x.name)||"",value:h}});return B.createElement(ro,{"data-qa-anchor":`${e}-category`,value:y,options:v,renderTrigger:S=>{var b=S,{selected:h,remove:x}=b,T=M(b,["selected","remove"]);return B.createElement(z8,P(d({},T),{onClick:p,"data-qa-anchor":`${e}-category-selector`}),h.map(w=>B.createElement(q8,{key:w.value,categoryId:w.value,onRemove:()=>x(w,o)})),B.createElement(U8,{ref:c,"data-qa-anchor":"category-selector-input",type:"text",value:l,placeholder:u({id:"selectACategory"}),onChange:w=>g(w.target.value)}),B.createElement(O8,null))},renderItem:({value:h})=>B.createElement(B8,{categoryId:h}),parentContainer:r,isOpen:i,handleClose:f,multiple:!0,onSelect:({value:h})=>{var x;m(""),(x=c.current)==null||x.focus(),o==null||o([...new Set([...n,h])]);}})},Ls=e=>{let t=E("CategorySelector");return t?t(e):B.createElement(hE,d({},e))};var xE=1,Fs=(e,t=xE)=>{let[o,r]=useState([]),[n,i]=useState(!1),[a,l]=useState(!1),[m,p]=useState(!1),u=useRef(null),c=useRef(null),g=()=>{u.current&&(u.current(),p(!0));};return useEffect(()=>{if(e.length<t)return;c.current&&(c.current(),c.current=null);let f=UserRepository.searchUserByDisplayName({displayName:e,limit:10},C=>{l(C.hasNextPage||!1),i(C.loading),u.current=C.onNextPage||null,r(C.data);});return c.current=f,()=>{var C;(C=c.current)==null||C.call(c),c.current=null;}},[e,t]),{users:o,isLoading:n,hasMore:a,loadMore:g,loadMoreHasBeenCalled:m}};var Q8=s.div`
|
|
@@ -2493,7 +2491,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2493
2491
|
margin: 0 0.5rem;
|
|
2494
2492
|
`;s(Oe).attrs({width:12,height:12})`
|
|
2495
2493
|
fill: ${({theme:e})=>e.palette.base.shade1};
|
|
2496
|
-
`;var e7=s(
|
|
2494
|
+
`;var e7=s(A)`
|
|
2497
2495
|
padding: 0.4rem 0.55rem;
|
|
2498
2496
|
border-radius: 10rem;
|
|
2499
2497
|
`;var wE=({userId:e,displayName:t="Anonymous",fileUrl:o,onClick:r,onRemove:n})=>{let i=useCallback(l=>{l.stopPropagation(),e&&(r==null||r(e));},[r,e]),a=useCallback(l=>{l.stopPropagation(),e&&(n==null||n(e));},[n,e]);return B.createElement(X8,{onClick:i},B.createElement(J,{size:"tiny",avatar:o,backgroundImage:ae}),B.createElement(R8,null,t),!!n&&B.createElement(e7,{onClick:a},B.createElement(bt,null)))},o7=e=>{let t=E("UserChip");return t?t(e):B.createElement(wE,d({},e))};var SE=({userId:e,onClick:t,onRemove:o})=>{let r=U(e),n=j({fileId:r==null?void 0:r.avatarFileId,imageSize:"small"});return r==null?null:B.createElement(o7,{userId:r.userId,displayName:r.displayName,fileUrl:n,onClick:i=>t==null?void 0:t(i),onRemove:o})},r7=SE;var n7=s.div`
|
|
@@ -2514,7 +2512,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2514
2512
|
outline: none;
|
|
2515
2513
|
border: none;
|
|
2516
2514
|
width: 100%;
|
|
2517
|
-
`;var LE=({value:e,onChange:t,parentContainer:o=null})=>{let r=e!=null?e:[],{currentUserId:n}=
|
|
2515
|
+
`;var LE=({value:e,onChange:t,parentContainer:o=null})=>{let r=e!=null?e:[],{currentUserId:n}=_(),[i,a]=useState(!1),[l,m]=useState(""),{users:p=[]}=Fs(l),{formatMessage:u}=useIntl(),c=p.filter(({displayName:y,userId:h})=>(y==null?void 0:y.toLowerCase().includes(l.toLowerCase()))&&h!==n).map(({displayName:y,userId:h})=>({name:y,value:h})),g=r.map(y=>{var h;return {name:((h=p.find(x=>x.userId===y))==null?void 0:h.displayName)||"",value:y}}),f=()=>{a(!1),m("");},C=useRef(null),v=y=>{var h;m(y),a(!!y),y&&((h=C.current)==null||h.focus());};return B.createElement(ro,{"data-qa-anchor":"user",value:g,options:l?c:[],renderTrigger:T=>{var S=T,{selected:y,remove:h}=S,x=M(S,["selected","remove"]);return B.createElement(n7,d({},x),y.map(b=>B.createElement(r7,{key:b.value,userId:b.value,onRemove:()=>h(b,t)})),B.createElement(i7,{ref:C,"data-qa-anchor":"user-selector-input",type:"text",value:l,placeholder:u({id:"UserSelector.placeholder"}),onChange:b=>v(b.target.value)}))},renderItem:({value:y})=>B.createElement(io,{userId:y}),parentContainer:o,isOpen:i,handleClose:f,multiple:!0,onSelect:({value:y})=>{var h;t==null||t([...new Set([...r,y])]),(h=C.current)==null||h.focus(),m("");}})},Ro=memo(e=>{let t=E("UserSelector");return t?t(e):B.createElement(LE,d({},e))});var m7=_t.object({displayName:_t.string().max(30),description:_t.string().max(180),categoryIds:_t.string().array().min(1),avatarFileId:_t.string().nullable().optional(),tags:_t.string().array().optional(),isPublic:_t.boolean()}),kE=m7.extend({userIds:_t.string().array().optional()}).refine(e=>{var t;return !(!e.isPublic&&((t=e.userIds)==null?void 0:t.length)===0)}),FE=m7.partial(),d7=()=>useForm({defaultValues:{avatarFileId:void 0,description:"",displayName:"",isPublic:!0,tags:[],userIds:[],categoryIds:[]},resolver:zodResolver(kE)}),p7=e=>useForm({defaultValues:{avatarFileId:e.avatarFileId,description:e.description,displayName:e.displayName,isPublic:e.isPublic,tags:e.tags,categoryIds:e.categoryIds},resolver:zodResolver(FE)});var Vl=({title:e,children:t})=>B.createElement(Ko,null,B.createElement(Jo,null,t)),c7=({type:e,description:t,icon:o})=>B.createElement(Ts,null,B.createElement(Ps,null,o),B.createElement("div",null,e,B.createElement(Ns,null,t))),zE=({"data-qa-anchor":e="",className:t,onSubmit:o,onCancel:r})=>{let[n,i]=useState(!1),{register:a,handleSubmit:l,setError:m,watch:p,control:u,formState:c,setValue:g,getValues:f}=d7(),{errors:C}=c,v=p("displayName"),y=p("description"),h=p("isPublic"),x=useRef(null),T=w=>I(void 0,null,function*(){var N;try{if(i(!0),!w.isPublic&&((N=w.userIds)==null?void 0:N.length)===0){m("userIds",{message:"Please select at least one member"});return}yield o==null?void 0:o(P(d({},w),{displayName:w.displayName||"",avatarFileId:w.avatarFileId||void 0}));}finally{i(!1);}}),S=!c.isValid||n,b=x.current&&x.current.scrollHeight-x.current.clientHeight-x.current.scrollTop;return B.useLayoutEffect(()=>{b!=null&&x.current&&b<10&&x.current.scrollHeight-x.current.clientHeight-x.current.scrollTop>10&&x.current.scrollTo({top:x.current.scrollHeight});},[x.current,b,c]),B.createElement(Wo,{className:t,onSubmit:l(T)},B.createElement(Xo,{ref:x},B.createElement(Vl,{title:"General"},B.createElement(at,null,B.createElement(Controller,{name:"avatarFileId",control:u,render:D=>{var {field:V}=D,G=V,N=M(G,["ref"]);return B.createElement(Zo,P(d({mimeType:"image/png, image/jpeg"},N),{"data-qa-anchor":e}))}})),B.createElement(at,{error:C.displayName},B.createElement(No,null,B.createElement(Tt,{htmlFor:"displayName",className:"required"},B.createElement(FormattedMessage,{id:"community.name"})),B.createElement(To,null,v.length,"/30")),B.createElement(Lr,P(d({},a("displayName")),{"data-qa-anchor":`${e}-community-name-input`,placeholder:"Enter community name"})),B.createElement(st,{errors:C,name:"displayName"})),B.createElement(at,{error:C.description},B.createElement(No,null,B.createElement(Tt,{htmlFor:"description"},B.createElement(FormattedMessage,{id:"community.about"})),B.createElement(To,null,(y==null?void 0:y.length)||0,"/180")),B.createElement(Er,P(d({},a("description",{maxLength:{value:180,message:"Description text is too long"}})),{"data-qa-anchor":`${e}-community-description-textarea`,placeholder:"Enter description"})),B.createElement(st,{errors:C,name:"description"})),B.createElement(at,{error:C.categoryIds},B.createElement(Tt,{htmlFor:"categoryIds",className:"required"},B.createElement(FormattedMessage,{id:"community.category"})),B.createElement(Controller,{rules:{required:"Category is required"},name:"categoryIds",render:V=>{var {field:G}=V,F=G,D=M(F,["ref","onChange"]);return B.createElement(Ls,P(d({parentContainer:x.current,onChange:q=>g("categoryIds",q,{shouldValidate:!0})},D),{"data-qa-anchor":`${e}`}))},control:u}),B.createElement(st,{errors:C,name:"category"}))),B.createElement(Vl,{title:B.createElement(FormattedMessage,{id:"community.categorypermission"})},B.createElement(Controller,{name:"isPublic",render:({field:w})=>B.createElement(B.Fragment,null,B.createElement(hn,P(d({},w),{value:w.value===!0,onChange:N=>w.onChange(N.target.checked),"data-qa-anchor":"community-form-public-type-community-type",label:"Public",renderer:()=>B.createElement(c7,{type:"Public",description:"Anyone can join, view and search the posts in this page.",icon:B.createElement(Is,null)})})),B.createElement(hn,P(d({},w),{value:w.value===!1,onChange:N=>w.onChange(!N.target.checked),"data-qa-anchor":"community-form-private-type-community-type",label:"Private",renderer:()=>B.createElement(c7,{type:"Private",description:"Only members invited by the moderators can join, view, and search the posts in this page.",icon:B.createElement(ws,null)})}))),control:u})),!h&&B.createElement(Vl,{title:"Community members"},B.createElement(Es,{error:C.userIds},B.createElement(Tt,{className:"required"},B.createElement(FormattedMessage,{id:"community.addmembers"})),B.createElement(Controller,{name:"userIds",render:D=>{var {field:V}=D,G=V,N=M(G,["ref"]);return B.createElement(Ro,d({parentContainer:x.current,"data-qa-anchor":e},N))},control:u}),B.createElement(st,{errors:C,name:"userIds"})))),B.createElement(xn,null,B.createElement(A,{onClick:w=>{w.preventDefault(),r==null||r();}},B.createElement(FormattedMessage,{id:"cancel"})),B.createElement(vn,{"data-qa-anchor":`${e}-save-button`,disabled:S},B.createElement(FormattedMessage,{id:"create"}))))},Bs=memo(zE);var HE=({isOpen:e,onClose:t})=>{let{formatMessage:o}=useIntl();if(!e)return null;let r=()=>re({title:o({id:"CommunityCreationModal.title"}),content:o({id:"CommunityCreationModal.content"}),cancelText:o({id:"CommunityCreationModal.cancelText"}),okText:o({id:"CommunityCreationModal.okText"}),onOk:t});return B.createElement(Le,{"data-qa-anchor":"community-creation-modal",title:"Create community",onCancel:r},B.createElement(Bs,{"data-qa-anchor":"community-creation",onCancel:r,onSubmit:i=>I(void 0,null,function*(){let a=yield CommunityRepository.createCommunity(i);t(a.data.communityId);})}))},u7=memo(e=>{let t=E("CommunityCreationModal");return t?t(e):B.createElement(HE,d({},e))});var GE=({className:e,activeCommunity:t})=>{let{socialCommunityCreationButtonVisible:o}=t4(),{onCommunityCreated:r}=O(),[n,i]=useState(!1);return B.createElement(bs,{heading:B.createElement(FormattedMessage,{id:"SideSectionMyCommunity.myCommunity"})},o&&B.createElement(Bi,{"data-qa-anchor":"side-section-my-community-create-community-button",icon:B.createElement(ft,{height:"20px"}),element:"button",onClick:()=>i(!0)},B.createElement(FormattedMessage,{id:"createCommunity"})),B.createElement(N8,{className:e,communitiesQueryParam:{membership:"member",limit:20},activeCommunity:t}),B.createElement(u7,{isOpen:n,onClose:m=>{i(!1),m&&r(m);}}))},g7=memo(GE);var ZE=s.div`
|
|
2518
2516
|
flex: 1 1 auto;
|
|
2519
2517
|
z-index: 1;
|
|
2520
2518
|
position: relative;
|
|
@@ -2544,7 +2542,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2544
2542
|
top: calc(100% + 0.25rem);
|
|
2545
2543
|
width: 100%;
|
|
2546
2544
|
color: ${({theme:e})=>e.palette.base.main};
|
|
2547
|
-
`;var h7=({value:e,disabled:t})=>{let[o,r]=useState(!1),[n,i]=ii(o),a=()=>r(!1),l=()=>r(!0);return useEffect(()=>{t||e&&e.length>0&&r(!0);},[e,t]),useEffect(()=>{!i&&a();},[i]),nt("Escape",a),{isOpen:o,open:l,close:a,containerRef:n}},RE=({"data-qa-anchor":e="",items:t,value:o,searchValue:r,placeholder:n,loadMore:i,prepend:a,append:l,invalid:m,disabled:p,renderItem:u,onSearchValueChange:c,onClear:g,onChange:f})=>{let[C,v]=useState(!1),[y,h]=ii(C),x=()=>v(!1);return useEffect(()=>{p||r.length>0&&v(!0);},[r,p]),useEffect(()=>{!h&&x();},[h]),nt("Escape",x),B.createElement(JE,{ref:y},B.createElement(Ge,{"data-qa-anchor":e,value:r,invalid:m,disabled:p,prepend:a,append:l,placeholder:n,onClear:g,onChange:b=>c==null?void 0:c(b.plainText),onClick:()=>v(!0)}),C&&B.createElement(XE,null,B.createElement(ji,{items:t,append:i&&B.createElement(
|
|
2545
|
+
`;var h7=({value:e,disabled:t})=>{let[o,r]=useState(!1),[n,i]=ii(o),a=()=>r(!1),l=()=>r(!0);return useEffect(()=>{t||e&&e.length>0&&r(!0);},[e,t]),useEffect(()=>{!i&&a();},[i]),nt("Escape",a),{isOpen:o,open:l,close:a,containerRef:n}},RE=({"data-qa-anchor":e="",items:t,value:o,searchValue:r,placeholder:n,loadMore:i,prepend:a,append:l,invalid:m,disabled:p,renderItem:u,onSearchValueChange:c,onClear:g,onChange:f})=>{let[C,v]=useState(!1),[y,h]=ii(C),x=()=>v(!1);return useEffect(()=>{p||r.length>0&&v(!0);},[r,p]),useEffect(()=>{!h&&x();},[h]),nt("Escape",x),B.createElement(JE,{ref:y},B.createElement(Ge,{"data-qa-anchor":e,value:r,invalid:m,disabled:p,prepend:a,append:l,placeholder:n,onClear:g,onChange:b=>c==null?void 0:c(b.plainText),onClick:()=>v(!0)}),C&&B.createElement(XE,null,B.createElement(ji,{items:t,append:i&&B.createElement(A,{fullWidth:!0,onClick:i},B.createElement(FormattedMessage,{id:"loadMore"})),onPick:b=>{f==null||f(t[b].value),v(!1),c==null||c("");},renderItem:b=>u(b)})))},y7=RE;var v7=s.div`
|
|
2548
2546
|
display: flex;
|
|
2549
2547
|
align-items: center;
|
|
2550
2548
|
padding-left: 20px;
|
|
@@ -2618,7 +2616,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2618
2616
|
top: calc(100% + 0.25rem);
|
|
2619
2617
|
width: 100%;
|
|
2620
2618
|
color: ${({theme:e})=>e.palette.base.main};
|
|
2621
|
-
`,rL=({searchValue:e,isOpen:t})=>{let{onClickCommunity:o}=O(),{communities:r,hasMore:n,loadMore:i}=no({displayName:e}),a=r.filter(ue),l=a.map(m=>m.displayName);return t?B.createElement(I7,null,B.createElement(ji,{items:l,append:n&&i?B.createElement(
|
|
2619
|
+
`,rL=({searchValue:e,isOpen:t})=>{let{onClickCommunity:o}=O(),{communities:r,hasMore:n,loadMore:i}=no({displayName:e}),a=r.filter(ue),l=a.map(m=>m.displayName);return t?B.createElement(I7,null,B.createElement(ji,{items:l,append:n&&i?B.createElement(A,{fullWidth:!0,onClick:i},B.createElement(FormattedMessage,{id:"loadMore"})):null,onPick:m=>a[m]?o(a[m].communityId):null,renderItem:m=>{let p=r.find(u=>u.displayName===m);return p&&B.createElement(zi,{communityId:p.communityId})}})):null},nL=({searchValue:e,isOpen:t})=>{let{onClickUser:o}=O(),{users:r,hasMore:n,loadMore:i}=Fs(e),a=r.filter(ue),l=a.map(m=>m.displayName);return t?B.createElement(I7,null,B.createElement(ji,{items:l,append:n&&i?B.createElement(A,{fullWidth:!0,onClick:i},B.createElement(FormattedMessage,{id:"loadMore"})):null,onPick:m=>a[m]?o(a[m].userId):null,renderItem:m=>{let p=r.find(u=>u.displayName===m);return p&&B.createElement(io,{userId:p.userId,isBanned:p==null?void 0:p.isGlobalBanned})}})):null},iL=({className:e,sticky:t=!1,searchBy:o})=>{let[r,n]=useState(""),[i,a]=useState(o),{open:l,close:m,isOpen:p,containerRef:u}=h7({value:r});function c(){n("");}return B.createElement(M7,{className:e,sticky:t},B.createElement(FormattedMessage,{id:"exploreHeader.searchCommunityPlaceholder"},([g])=>B.createElement(oL,{ref:u},B.createElement(Ge,{"data-qa-anchor":"social-search-input",value:r,prepend:B.createElement(v7,null,B.createElement(x7,null)),placeholder:typeof g=="string"?g:void 0,onClear:c,onChange:f=>n==null?void 0:n(f.plainText),onClick:()=>l()}),p?B.createElement(lt,{tabs:[{value:"communities",label:"Communities"},{value:"accounts",label:"Accounts"}],activeTab:i,onChange:f=>a(f)}):null,i==="communities"?B.createElement(rL,{searchValue:r,isOpen:p}):null,i==="accounts"?B.createElement(nL,{searchValue:r,isOpen:p}):null)))},w7=e=>{let t=E("SocialSearch");return t?t(e):B.createElement(iL,d({},e))};var sL=s(w7)`
|
|
2622
2620
|
background: ${({theme:e})=>e.palette.system.background};
|
|
2623
2621
|
padding: 0.5rem;
|
|
2624
2622
|
`,aL=({className:e,activeCommunity:t})=>B.createElement(u8,{"data-qa-anchor":"community-side-menu",className:e},B.createElement(sL,{sticky:!0,searchBy:"communities"}),B.createElement(y8,null),B.createElement(g7,{activeCommunity:t})),P7=aL;var ql=16,cL={720:1,1024:2,1280:3,1440:4,1800:5},uL=s.div`
|
|
@@ -2633,7 +2631,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2633
2631
|
`,gL=s.div`
|
|
2634
2632
|
display: flex;
|
|
2635
2633
|
gap: 20px;
|
|
2636
|
-
`,T7=s(
|
|
2634
|
+
`,T7=s(A).attrs({variant:"secondary"})`
|
|
2637
2635
|
width: 28px;
|
|
2638
2636
|
padding: 2px;
|
|
2639
2637
|
|
|
@@ -2988,7 +2986,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
2988
2986
|
`,Eu=s.div`
|
|
2989
2987
|
${({theme:e})=>e.typography.caption};
|
|
2990
2988
|
color: ${({theme:e})=>e.palette.base.shade1};
|
|
2991
|
-
`;var Lu=({canReviewPosts:e,postsCount:t})=>B.createElement(Su,null,B.createElement(Tu,null,B.createElement(Nu,null),B.createElement(FormattedMessage,{id:"community.pendingPostsBanner.title"})),B.createElement(Eu,null,e?B.createElement(FormattedMessage,{id:"community.pendingPostsBanner.needApproval",values:{amount:t,formattedAmount:tp(t)}}):B.createElement(FormattedMessage,{id:"community.pendingPostsBanner.pendingForReview"})));var yk=({communityId:e,communityCategories:t,pendingPostsCount:o,postsCount:r,membersCount:n,description:i,isJoined:a,isOfficial:l,isPublic:m,avatarFileUrl:p,canEditCommunity:u,onEditCommunity:c,joinCommunity:g,onClickLeaveCommunity:f,canLeaveCommunity:C,canReviewPosts:v,name:y,postSetting:h})=>{let{formatMessage:x}=useIntl();return B.createElement(gu,{"data-qa-anchor":"community-info"},B.createElement(Cu,{backgroundImage:p!=null?p:h1},B.createElement(hu,null,B.createElement(yu,{"data-qa-anchor":"community-info",isOfficial:l,isPublic:m,isTitle:!0,name:y,truncate:2}),B.createElement(Mu,null,(t||[]).join(", ")))),B.createElement(vu,null,B.createElement(xu,null,B.createElement(Pu,null,B.createElement(Rl,null,B.createElement("div",{className:"countNumber"},tp(r||0)),B.createElement("div",{className:"countType"},B.createElement(FormattedMessage,{id:"community.posts"}))),B.createElement(bu,null),B.createElement(Rl,null,B.createElement("div",{className:"countNumber"},tp(n||0)),B.createElement("div",{className:"countType"},B.createElement(FormattedMessage,{id:"community.members"})))),a&&B.createElement(fu,{"data-qa-anchor":"community-info-options-button",options:[u?{name:x({id:"community.settings"}),action:()=>c(e),dataQaAnchorMenuItem:"settings"}:null,C?{name:x({id:"community.leaveCommunity"}),action:()=>f(e),dataQaAnchorMenuItem:"leave-community"}:null].filter(ue)})),i&&B.createElement(Gd,{lines:3},B.createElement(Iu,{"data-qa-anchor":"community-info-description"},i)),!a&&B.createElement(wu,{"data-qa-anchor":"community-info-join-button",onClick:()=>g(e)},B.createElement(cu,null)," ",B.createElement(FormattedMessage,{id:"community.join"})),a&&u&&B.createElement(
|
|
2989
|
+
`;var Lu=({canReviewPosts:e,postsCount:t})=>B.createElement(Su,null,B.createElement(Tu,null,B.createElement(Nu,null),B.createElement(FormattedMessage,{id:"community.pendingPostsBanner.title"})),B.createElement(Eu,null,e?B.createElement(FormattedMessage,{id:"community.pendingPostsBanner.needApproval",values:{amount:t,formattedAmount:tp(t)}}):B.createElement(FormattedMessage,{id:"community.pendingPostsBanner.pendingForReview"})));var yk=({communityId:e,communityCategories:t,pendingPostsCount:o,postsCount:r,membersCount:n,description:i,isJoined:a,isOfficial:l,isPublic:m,avatarFileUrl:p,canEditCommunity:u,onEditCommunity:c,joinCommunity:g,onClickLeaveCommunity:f,canLeaveCommunity:C,canReviewPosts:v,name:y,postSetting:h})=>{let{formatMessage:x}=useIntl();return B.createElement(gu,{"data-qa-anchor":"community-info"},B.createElement(Cu,{backgroundImage:p!=null?p:h1},B.createElement(hu,null,B.createElement(yu,{"data-qa-anchor":"community-info",isOfficial:l,isPublic:m,isTitle:!0,name:y,truncate:2}),B.createElement(Mu,null,(t||[]).join(", ")))),B.createElement(vu,null,B.createElement(xu,null,B.createElement(Pu,null,B.createElement(Rl,null,B.createElement("div",{className:"countNumber"},tp(r||0)),B.createElement("div",{className:"countType"},B.createElement(FormattedMessage,{id:"community.posts"}))),B.createElement(bu,null),B.createElement(Rl,null,B.createElement("div",{className:"countNumber"},tp(n||0)),B.createElement("div",{className:"countType"},B.createElement(FormattedMessage,{id:"community.members"})))),a&&B.createElement(fu,{"data-qa-anchor":"community-info-options-button",options:[u?{name:x({id:"community.settings"}),action:()=>c(e),dataQaAnchorMenuItem:"settings"}:null,C?{name:x({id:"community.leaveCommunity"}),action:()=>f(e),dataQaAnchorMenuItem:"leave-community"}:null].filter(ue)})),i&&B.createElement(Gd,{lines:3},B.createElement(Iu,{"data-qa-anchor":"community-info-description"},i)),!a&&B.createElement(wu,{"data-qa-anchor":"community-info-join-button",onClick:()=>g(e)},B.createElement(cu,null)," ",B.createElement(FormattedMessage,{id:"community.join"})),a&&u&&B.createElement(A,{fullWidth:!0,"data-qa-anchor":"community-info-edit-button",onClick:()=>c(e)},B.createElement(uu,null)," ",B.createElement(FormattedMessage,{id:"community.editProfile"})),h===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED&&a&&o>0&&B.createElement(Lu,{canReviewPosts:v,postsCount:o})))},Fu=e=>{let t=E("UICommunityInfo");return t?t(e):B.createElement(yk,d({},e))};var Au=({onOk:e})=>re({"data-qa-anchor":"leave-community",title:B.createElement(FormattedMessage,{id:"community.leaveCommunityTitle"}),content:B.createElement(FormattedMessage,{id:"community.leaveCommunityBody"}),okText:B.createElement(FormattedMessage,{id:"community.leaveCommunityButtonText"}),onOk:()=>e()});var vk=({community:e})=>{let{currentUserId:t,userRoles:o}=_(),{moderators:r}=Mo(e==null?void 0:e.communityId),n=r.find(l=>l.userId===t),i=o.find(l=>l==="global-admin")!=null,a=n!=null;return {isModerator:a,canEdit:i||a,canReview:i||a}},Js=vk;var Du=e=>{let{onEditCommunity:t}=O(),o=Ce(e),r=j({fileId:o==null?void 0:o.avatarFileId,imageSize:"medium"}),{posts:n}=Vt({targetType:"community",targetId:e,feedType:"reviewing"}),i=Sn(o==null?void 0:o.categoryIds),{canReview:a,canEdit:l}=Js({community:o}),m=useMemo(()=>(n==null?void 0:n.length)||0,[n]);return {community:o,reviewingPosts:n,avatarFileUrl:r,communityCategories:i,pendingPostsCount:m,canEditCommunity:l,canReviewCommunityPosts:a,onEditCommunity:t,joinCommunity:()=>e&&CommunityRepository.joinCommunity(e),leaveCommunity:()=>e&&CommunityRepository.leaveCommunity(e),updateCommunity:f=>e&&CommunityRepository.updateCommunity(e,f),closeCommunity:()=>e&&CommunityRepository.deleteCommunity(e)}};var Ik=({communityId:e})=>{var v;let{community:t,communityCategories:o,avatarFileUrl:r,canEditCommunity:n,onEditCommunity:i,joinCommunity:a,leaveCommunity:l,pendingPostsCount:m,canReviewCommunityPosts:p}=Du(e),u=(o||[]).map(y=>y.name);if(t==null)return null;let c=t.isJoined||!1,{membersCount:g,description:f,isJoined:C}=t;return B.createElement(Fu,{communityId:e,communityCategories:u,pendingPostsCount:m,postsCount:(v=t.postsCount)!=null?v:0,membersCount:g,description:f||"",isJoined:C||!1,isOfficial:t.isOfficial||!1,isPublic:t.isPublic||!1,avatarFileUrl:r||null,joinCommunity:a,canEditCommunity:n,canLeaveCommunity:c||!1,canReviewPosts:p,name:t.displayName,postSetting:t.postSetting||CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED,onEditCommunity:i,onClickLeaveCommunity:()=>Au({onOk:()=>l()})})};var Bu=Ik;var zu=s(lt)`
|
|
2992
2990
|
margin-bottom: 14px;
|
|
2993
2991
|
border-radius: 0;
|
|
2994
2992
|
border-right: 0;
|
|
@@ -3010,7 +3008,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3010
3008
|
display: flex;
|
|
3011
3009
|
align-items: center;
|
|
3012
3010
|
cursor: pointer;
|
|
3013
|
-
`;var Pk=e=>{let[t,o]=useState(!0),[r,n]=useState(!1),i=()=>I(void 0,null,function*(){e&&UserRepository.isUserFlaggedByMe(e).then(p=>{n(p),o(!1);});});useEffect(()=>{e&&i();},[e]);let a=()=>I(void 0,null,function*(){if(e!=null)try{yield UserRepository.flagUser(e),n(!0);}catch(p){n(!1);}finally{i();}}),l=()=>I(void 0,null,function*(){if(e!=null)try{yield UserRepository.unflagUser(e),n(!1);}catch(p){n(!0);}finally{i();}});return {isLoading:t,isFlaggedByMe:r,flagUser:a,unflagUser:l,toggleFlagUser:()=>I(void 0,null,function*(){e!=null&&(r?l():a());})}},tr=Pk;var{COMMUNITY_MODERATOR:$u,CHANNEL_MODERATOR:Gu}=Qr,Nk=({userId:e,currentUserId:t,onClick:o,roles:r=[],assignRolesToUsers:n,hasModeratorPermissions:i,removeRolesFromUsers:a,removeMembers:l,isJoined:m,isBanned:p})=>{let u=U(e),{formatMessage:c}=useIntl(),{isFlaggedByMe:g,toggleFlagUser:f}=tr(e),C=u==null?void 0:u.isGlobalBanned;go({userId:e,level:SubscriptionLevels.USER});let v=()=>I(void 0,null,function*(){return f()}),y=()=>{v(),Y.success({content:B.createElement(FormattedMessage,{id:"report.reportSent"})});},h=()=>n([$u,Gu],[e]),x=()=>a([$u,Gu],[e]),T=()=>{re({"data-qa-anchor":"remove-user",title:B.createElement(FormattedMessage,{id:"community.removeUserFromCommunityTitle"}),content:B.createElement(FormattedMessage,{id:"community.removeUserFromCommunityBody"}),cancelText:"Cancel",okText:"Remove",onOk:()=>l([e])});},S=Ot(r);return B.createElement(ju,{"data-qa-anchor":"community-member-item"},B.createElement(Hu,null,B.createElement(io,{userId:e,isBanned:p||C,onClick:o})),!(t===e)&&m&&B.createElement(rt,{"data-qa-anchor":"community-members-option-menu",options:[{name:c(g?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:y},i&&!S&&!C?{name:c({id:"moderatorMenu.promoteToModerator"}),action:h}:null,i&&S?{name:c({id:"moderatorMenu.dismissModerator"}),action:x}:null,i?{name:c({id:"moderatorMenu.removeFromCommunity"}),action:T,className:"danger-zone"}:null].filter(ue)}))},i0=Nk;var En={MEMBERS:"MEMBERS",MODERATORS:"MODERATORS"};[{value:En.MEMBERS,label:B.createElement(FormattedMessage,{id:"tabs.members"})},{value:En.MODERATORS,label:B.createElement(FormattedMessage,{id:"tabs.moderators"})}];var Ak=({community:e,members:t,loadMore:o,hasMore:r})=>{let n=e==null?void 0:e.communityId,{currentUserId:i}=
|
|
3011
|
+
`;var Pk=e=>{let[t,o]=useState(!0),[r,n]=useState(!1),i=()=>I(void 0,null,function*(){e&&UserRepository.isUserFlaggedByMe(e).then(p=>{n(p),o(!1);});});useEffect(()=>{e&&i();},[e]);let a=()=>I(void 0,null,function*(){if(e!=null)try{yield UserRepository.flagUser(e),n(!0);}catch(p){n(!1);}finally{i();}}),l=()=>I(void 0,null,function*(){if(e!=null)try{yield UserRepository.unflagUser(e),n(!1);}catch(p){n(!0);}finally{i();}});return {isLoading:t,isFlaggedByMe:r,flagUser:a,unflagUser:l,toggleFlagUser:()=>I(void 0,null,function*(){e!=null&&(r?l():a());})}},tr=Pk;var{COMMUNITY_MODERATOR:$u,CHANNEL_MODERATOR:Gu}=Qr,Nk=({userId:e,currentUserId:t,onClick:o,roles:r=[],assignRolesToUsers:n,hasModeratorPermissions:i,removeRolesFromUsers:a,removeMembers:l,isJoined:m,isBanned:p})=>{let u=U(e),{formatMessage:c}=useIntl(),{isFlaggedByMe:g,toggleFlagUser:f}=tr(e),C=u==null?void 0:u.isGlobalBanned;go({userId:e,level:SubscriptionLevels.USER});let v=()=>I(void 0,null,function*(){return f()}),y=()=>{v(),Y.success({content:B.createElement(FormattedMessage,{id:"report.reportSent"})});},h=()=>n([$u,Gu],[e]),x=()=>a([$u,Gu],[e]),T=()=>{re({"data-qa-anchor":"remove-user",title:B.createElement(FormattedMessage,{id:"community.removeUserFromCommunityTitle"}),content:B.createElement(FormattedMessage,{id:"community.removeUserFromCommunityBody"}),cancelText:"Cancel",okText:"Remove",onOk:()=>l([e])});},S=Ot(r);return B.createElement(ju,{"data-qa-anchor":"community-member-item"},B.createElement(Hu,null,B.createElement(io,{userId:e,isBanned:p||C,onClick:o})),!(t===e)&&m&&B.createElement(rt,{"data-qa-anchor":"community-members-option-menu",options:[{name:c(g?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:y},i&&!S&&!C?{name:c({id:"moderatorMenu.promoteToModerator"}),action:h}:null,i&&S?{name:c({id:"moderatorMenu.dismissModerator"}),action:x}:null,i?{name:c({id:"moderatorMenu.removeFromCommunity"}),action:T,className:"danger-zone"}:null].filter(ue)}))},i0=Nk;var En={MEMBERS:"MEMBERS",MODERATORS:"MODERATORS"};[{value:En.MEMBERS,label:B.createElement(FormattedMessage,{id:"tabs.members"})},{value:En.MODERATORS,label:B.createElement(FormattedMessage,{id:"tabs.moderators"})}];var Ak=({community:e,members:t,loadMore:o,hasMore:r})=>{let n=e==null?void 0:e.communityId,{currentUserId:i}=_(),a=t.find(f=>f.userId===i),l=U(i),m=Ot(a==null?void 0:a.roles),p=N1(a)&&m||Ot(l==null?void 0:l.roles)||Cr(l==null?void 0:l.roles);return {community:e,members:t,currentUserId:i,hasMoreMembers:r,loadMoreMembers:o,hasModeratorPermissions:p,assignRolesToUsers:(f,C)=>n&&CommunityRepository.Moderation.addRoles(n,f,C),removeRolesFromUsers:(f,C)=>n&&CommunityRepository.Moderation.removeRoles(n,f,C),removeMembers:f=>n&&CommunityRepository.Membership.removeMembers(n,f)}},Dk=({community:e,members:t,loadMore:o,hasMore:r})=>{let{onClickUser:n}=O(),{hasMoreMembers:i,loadMoreMembers:a,hasModeratorPermissions:l,currentUserId:m,assignRolesToUsers:p,removeRolesFromUsers:u,removeMembers:c}=Ak({community:e,hasMore:r,loadMore:o,members:t});return t.length===0?null:B.createElement(_e,{hasMore:i,loadMore:a,contentSlot:t.map(({userId:g,roles:f,isBanned:C})=>B.createElement(i0,{key:g,userId:g,currentUserId:m||"",roles:f,assignRolesToUsers:p,removeRolesFromUsers:u,removeMembers:c,hasModeratorPermissions:l,isJoined:e==null?void 0:e.isJoined,isBanned:C,onClick:()=>n(g)}))})},Bk=({community:e})=>{let t=e==null?void 0:e.communityId,{currentUserId:o}=_(),{moderators:r,hasMore:n,loadMore:i}=Mo(t),a=r.find(f=>f.userId===o),l=U(o),m=Ot(a==null?void 0:a.roles),p=N1(a)&&m||Ot(l==null?void 0:l.roles)||Cr(l==null?void 0:l.roles);return {moderators:r,currentUserId:o,hasMoreModerators:n,loadMoreModerators:i,hasModeratorPermissions:p,assignRolesToUsers:(f,C)=>t&&CommunityRepository.Moderation.addRoles(t,f,C),removeRolesFromUsers:(f,C)=>t&&CommunityRepository.Moderation.removeRoles(t,f,C),removeMembers:f=>t&&CommunityRepository.Membership.removeMembers(t,f)}},zk=({community:e})=>{let{onClickUser:t}=O(),{currentUserId:o,moderators:r,hasMoreModerators:n,loadMoreModerators:i,hasModeratorPermissions:a,assignRolesToUsers:l,removeRolesFromUsers:m,removeMembers:p}=Bk({community:e});return r.length===0?null:B.createElement(_e,{hasMore:n,loadMore:i,contentSlot:r.map(({userId:u,roles:c,isBanned:g})=>B.createElement(i0,{key:u,userId:u,currentUserId:o||"",roles:c,assignRolesToUsers:l,removeRolesFromUsers:m,removeMembers:p,hasModeratorPermissions:a,isJoined:e==null?void 0:e.isJoined,isBanned:g,onClick:f=>f&&t(f)}))})},Ok=({communityId:e})=>{let{formatMessage:t}=useIntl();Co({level:SubscriptionLevels.COMMUNITY,communityId:e});let{hasMore:o,loadMore:r,loadMoreHasBeenCalled:n,isLoading:i,members:a}=Mi(e),l=Ce(e),m=[{value:"MEMBERS",label:t({id:"CommunityMembers.members"})},{value:"MODERATORS",label:t({id:"CommunityMembers.moderators"})}],[p,u]=useState(En.MEMBERS);return B.createElement(Ou,null,B.createElement(Uu,null,"Community Members \u2022 ",a.length||0),B.createElement(zu,{tabs:m,activeTab:p,onChange:u}),p===En.MEMBERS&&B.createElement(Dk,{community:l,hasMore:o,loadMore:r,members:a}),p===En.MODERATORS&&B.createElement(zk,{community:l}))},Rs=memo(e=>{let t=E("CommunityMembers");return t?t(e):B.createElement(Ok,d({},e))});var jk=s(lt)`
|
|
3014
3012
|
background: ${({theme:e})=>e.palette.system.background};
|
|
3015
3013
|
border-radius: 4px 4px 0 0;
|
|
3016
3014
|
border: 1px solid #edeef2;
|
|
@@ -3077,7 +3075,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3077
3075
|
outline: none;
|
|
3078
3076
|
color: ${({theme:e})=>e.palette.base.shade2};
|
|
3079
3077
|
text-align: center;
|
|
3080
|
-
`;function ko({onClick:e}){return B.createElement(Zk,{onClick:t=>{t.preventDefault(),e==null||e();}},B.createElement(FormattedMessage,{id:"loadMore"})," ",B.createElement(Dt,{height:".8em"}))}function $i({userId:e,callback:t}){let o=U(e),r=useRef(null);useEffect(()=>{if(o!=null)return r.current=subscribeTopic(s5(o),t),()=>{var n;(n=r.current)==null||n.call(r);}},[]);}function a0({userId:e,status:t}){let n=ee({fetcher:UserRepository.Relationship.getFollowings,params:{userId:e,status:t!=null?t:void 0},shouldCall:()=>!!e}),{items:o}=n,r=M(n,["items"]);return d({followings:o},r)}var tF=({profileUserId:e,currentUserId:t,userId:o,onClick:r})=>{let n=U(o),{onClickUser:i}=O(),{formatMessage:a}=useIntl(),{isFlaggedByMe:l,toggleFlagUser:m}=tr(o),p=()=>I(void 0,null,function*(){yield m(),Y.success({content:B.createElement(FormattedMessage,{id:"report.reportSent"})});}),u=()=>UserRepository.Relationship.unfollow(o),c=e===t,g=t===o,f=()=>{let y=n!=null&&n.displayName?a({id:"user.unfollow.confirm.title"},{displayName:n.displayName}):a({id:"user.unfollow.confirm.title.thisUser"}),h=n!=null&&n.displayName?a({id:"user.unfollow.confirm.body"},{displayName:n.displayName}):a({id:"user.unfollow.confirm.body.thisUser"});re({title:y,content:h,cancelText:a({id:"buttonText.cancel"}),okText:a({id:"buttonText.unfollow"}),onOk:u});},C=useCallback(()=>{i(o);},[i,o]),v=useMemo(()=>{let y=[];return g||y.push({name:a(l?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:p}),c&&y.push({name:a({id:"follower.menuItem.unfollow"}),action:f}),y},[l,c,g,f,p]);return B.createElement(kn,{key:o},B.createElement(ra,null,B.createElement(io,{userId:o,onClick:C}),B.createElement(rt,{options:v})))};function oF({userId:e}){let{followings:t,isLoading:o,loadMore:r,hasMore:n,loadMoreHasBeenCalled:i}=a0({userId:e,status:"all"});return $i({userId:e}),{items:useMemo(()=>{function l(){return new Array(5).fill(1).map((m,p)=>({skeleton:!0}))}return o&&!i?l():o&&i?[...t,...l()]:t},[t,o,i]),isLoading:o,hasMore:n,loadMore:r,loadMoreHasBeenCalled:i}}var rF=({userId:e,onItemClick:t})=>{let{formatMessage:o}=useIntl(),{currentUserId:r}=
|
|
3078
|
+
`;function ko({onClick:e}){return B.createElement(Zk,{onClick:t=>{t.preventDefault(),e==null||e();}},B.createElement(FormattedMessage,{id:"loadMore"})," ",B.createElement(Dt,{height:".8em"}))}function $i({userId:e,callback:t}){let o=U(e),r=useRef(null);useEffect(()=>{if(o!=null)return r.current=subscribeTopic(s5(o),t),()=>{var n;(n=r.current)==null||n.call(r);}},[]);}function a0({userId:e,status:t}){let n=ee({fetcher:UserRepository.Relationship.getFollowings,params:{userId:e,status:t!=null?t:void 0},shouldCall:()=>!!e}),{items:o}=n,r=M(n,["items"]);return d({followings:o},r)}var tF=({profileUserId:e,currentUserId:t,userId:o,onClick:r})=>{let n=U(o),{onClickUser:i}=O(),{formatMessage:a}=useIntl(),{isFlaggedByMe:l,toggleFlagUser:m}=tr(o),p=()=>I(void 0,null,function*(){yield m(),Y.success({content:B.createElement(FormattedMessage,{id:"report.reportSent"})});}),u=()=>UserRepository.Relationship.unfollow(o),c=e===t,g=t===o,f=()=>{let y=n!=null&&n.displayName?a({id:"user.unfollow.confirm.title"},{displayName:n.displayName}):a({id:"user.unfollow.confirm.title.thisUser"}),h=n!=null&&n.displayName?a({id:"user.unfollow.confirm.body"},{displayName:n.displayName}):a({id:"user.unfollow.confirm.body.thisUser"});re({title:y,content:h,cancelText:a({id:"buttonText.cancel"}),okText:a({id:"buttonText.unfollow"}),onOk:u});},C=useCallback(()=>{i(o);},[i,o]),v=useMemo(()=>{let y=[];return g||y.push({name:a(l?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:p}),c&&y.push({name:a({id:"follower.menuItem.unfollow"}),action:f}),y},[l,c,g,f,p]);return B.createElement(kn,{key:o},B.createElement(ra,null,B.createElement(io,{userId:o,onClick:C}),B.createElement(rt,{options:v})))};function oF({userId:e}){let{followings:t,isLoading:o,loadMore:r,hasMore:n,loadMoreHasBeenCalled:i}=a0({userId:e,status:"all"});return $i({userId:e}),{items:useMemo(()=>{function l(){return new Array(5).fill(1).map((m,p)=>({skeleton:!0}))}return o&&!i?l():o&&i?[...t,...l()]:t},[t,o,i]),isLoading:o,hasMore:n,loadMore:r,loadMoreHasBeenCalled:i}}var rF=({userId:e,onItemClick:t})=>{let{formatMessage:o}=useIntl(),{currentUserId:r}=_(),{items:n,loadMore:i,hasMore:a}=oF({userId:e}),l=()=>a?B.createElement(ko,{onClick:()=>i==null?void 0:i()}):null;return n.length===0?B.createElement(B.Fragment,null,B.createElement(Fn,null,B.createElement(na,{icon:B.createElement(mr,{width:48,height:48}),title:"It's empty here...",description:o({id:"follow.placeholder.noFollowings"})})),l()):B.createElement(B.Fragment,null,B.createElement(Fn,null,n.map(m=>wt(m)?B.createElement(W,{style:{fontSize:8}}):B.createElement(tF,{key:`${m.from}-${m.to}`,userId:m.to,profileUserId:e,currentUserId:r,onClick:()=>t(m.to)}))),l())},t9=rF;function Gi({userId:e,callback:t}){let o=U(e),r=useRef(null);useEffect(()=>{if(o!=null)return r.current=subscribeTopic(i5(o),t),()=>{var n;(n=r.current)==null||n.call(r);}},[]);}function Fo({userId:e,status:t}){let n=ee({fetcher:UserRepository.Relationship.getFollowers,params:{userId:e,status:t!=null?t:void 0},shouldCall:()=>!!e}),{items:o}=n,r=M(n,["items"]);return d({followers:o},r)}var dF=({profileUserId:e,currentUserId:t,userId:o,onClick:r})=>{let n=U(o),i=j({fileId:n==null?void 0:n.avatarFileId,imageSize:"small"}),{onClickUser:a}=O(),{formatMessage:l}=useIntl(),{isFlaggedByMe:m,toggleFlagUser:p}=tr(o||void 0),u=()=>I(void 0,null,function*(){yield p(),Y.success({content:B.createElement(FormattedMessage,{id:"report.reportSent"})});}),c=()=>{o&&UserRepository.Relationship.declineMyFollower(o);},g=e===t,f=t===o,C=()=>{re({title:B.createElement(FormattedMessage,{id:"follower.title.removeUser",values:{displayName:n==null?void 0:n.displayName}}),content:B.createElement(FormattedMessage,{id:"follower.body.removeUser",values:{displayName:n==null?void 0:n.displayName}}),cancelText:l({id:"buttonText.cancel"}),okText:l({id:"buttonText.remove"}),onOk:c});},v=useCallback(()=>{o!=null&&a(o);},[a,o]),y=useMemo(()=>{let h=[];return f||h.push({name:l(m?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:u}),g&&h.push({name:l({id:"follower.menuItem.removeUser"}),action:C}),h},[m,g,f,C,u]);return B.createElement(kn,{key:o},B.createElement(ra,null,B.createElement(As,{userId:n==null?void 0:n.userId,displayName:n==null?void 0:n.displayName,avatarFileUrl:i,onClick:v}),B.createElement(rt,{options:y})))};function pF({userId:e}){let{followers:t,isLoading:o,loadMore:r,hasMore:n,loadMoreHasBeenCalled:i}=Fo({userId:e,status:"all"});return Gi({userId:e}),{items:useMemo(()=>{function l(){return new Array(5).fill(1).map((m,p)=>({skeleton:!0}))}return o&&!i?l():o&&i?[...t,...l()]:t},[t,o,i]),isLoading:o,hasMore:n,loadMore:r,loadMoreHasBeenCalled:i}}var cF=({userId:e,onItemClick:t})=>{let{formatMessage:o}=useIntl(),{items:r,loadMore:n,hasMore:i}=pF({userId:e}),{currentUserId:a}=_(),l=()=>i?B.createElement(ko,{onClick:()=>n==null?void 0:n()}):null;return r.length===0?B.createElement(B.Fragment,null,B.createElement(Fn,null,B.createElement(na,{icon:B.createElement(mr,{width:48,height:48}),title:"It's empty here...",description:o({id:"follow.placeholder.noFollowers"})})),l()):B.createElement(B.Fragment,null,B.createElement(Fn,null,r.map(m=>wt(m)?B.createElement(W,{style:{fontSize:8}}):B.createElement(dF,{key:`${m.from}-${m.to}`,userId:m.from,profileUserId:e,currentUserId:a,onClick:()=>t(m.to)}))),l())},n9=cF;var An=s.div`
|
|
3081
3079
|
display: flex;
|
|
3082
3080
|
flex-direction: row;
|
|
3083
3081
|
flex-wrap: wrap;
|
|
@@ -3085,13 +3083,13 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3085
3083
|
`,i9=s(to)`
|
|
3086
3084
|
margin-right: auto;
|
|
3087
3085
|
margin-left: auto;
|
|
3088
|
-
`;var fF=({userId:e})=>B.createElement(kn,null,B.createElement(io,{userId:e}),B.createElement(Xu,null,B.createElement(Z,{fullWidth:!0,onClick:()=>I(void 0,null,function*(){e&&(yield UserRepository.Relationship.acceptMyFollower(e),Y.success({content:B.createElement(FormattedMessage,{id:"notification.done"})}));})},B.createElement(FormattedMessage,{id:"request.accept"})),B.createElement(
|
|
3086
|
+
`;var fF=({userId:e})=>B.createElement(kn,null,B.createElement(io,{userId:e}),B.createElement(Xu,null,B.createElement(Z,{fullWidth:!0,onClick:()=>I(void 0,null,function*(){e&&(yield UserRepository.Relationship.acceptMyFollower(e),Y.success({content:B.createElement(FormattedMessage,{id:"notification.done"})}));})},B.createElement(FormattedMessage,{id:"request.accept"})),B.createElement(A,{fullWidth:!0,onClick:()=>I(void 0,null,function*(){e&&(yield UserRepository.Relationship.declineMyFollower(e),Y.success({content:B.createElement(FormattedMessage,{id:"notification.done"})}));})},B.createElement(FormattedMessage,{id:"request.decline"})))),gF=({userId:e})=>{let{followers:t,hasMore:o,loadMore:r,isLoading:n,loadMoreHasBeenCalled:i}=Fo({userId:e,status:"pending"}),a=useMemo(()=>{function m(){return new Array(5).fill(1).map((p,u)=>({userId:u,skeleton:!0}))}return n&&!i?m():n&&i?[...t,...m()]:t},[t,n,i]),l=()=>o?B.createElement(ko,{onClick:()=>r()}):null;return a.length===0?B.createElement(B.Fragment,null,B.createElement(An,null,null),l()):B.createElement(B.Fragment,null,B.createElement(An,null,a.map(m=>wt(m)?B.createElement(W,{style:{fontSize:8}}):B.createElement(fF,{key:`${m.from}-${m.to}`,userId:m.to}))),l())},a9=gF;var Lt={FOLLOWINGS:"Followings",FOLLOWERS:"Followers"},Dn="Pending";[{value:Lt.FOLLOWINGS,label:B.createElement(FormattedMessage,{id:"tabs.followings"})},{value:Lt.FOLLOWERS,label:B.createElement(FormattedMessage,{id:"tabs.followers"})},{value:Dn,label:B.createElement(FormattedMessage,{id:"tabs.pending"})}];var vF=({userId:e,activeTab:t,socialSettings:o,onTabChange:r,onFollowingListClick:n,onFollowerListClick:i})=>{let{currentUserId:a}=_(),l=E1(o),{formatMessage:m}=useIntl(),[p,u]=useState(Object.values(Lt).map(f=>({value:f,label:f}))),{followers:c}=Fo({userId:e,status:"pending"}),g=a===e;return useEffect(()=>{c!=null&&c.length&&g&&l?u(Object.values(Lt).map(f=>({value:f,label:f})).concat({value:Dn,label:m({id:"tabs.pending"})})):u(Object.values(Lt).map(f=>({value:f,label:f})));},[m,g,c,r]),B.createElement("div",null,B.createElement(Ju,{tabs:p,activeTab:t,onChange:r}),t===Lt.FOLLOWINGS&&B.createElement(t9,{userId:e,onItemClick:f=>n(f)}),t===Lt.FOLLOWERS&&B.createElement(n9,{userId:e,onItemClick:f=>i(f)}),t.includes(Dn)&&g&&B.createElement(a9,{userId:e}))},l9=vF;var Je={TIMELINE:"TIMELINE",GALLERY:"GALLERY",FOLLOWERS:"FOLLOWERS"},u0=[{value:Je.TIMELINE,label:B.createElement(FormattedMessage,{id:"tabs.timeline"})},{value:Je.GALLERY,label:B.createElement(FormattedMessage,{id:"tabs.gallery"})},{value:Je.FOLLOWERS,label:B.createElement(FormattedMessage,{id:"tabs.followers"})}];var m9=s.div`
|
|
3089
3087
|
height: 100%;
|
|
3090
3088
|
max-width: 550px;
|
|
3091
3089
|
margin: 0 auto;
|
|
3092
3090
|
padding: 28px 0;
|
|
3093
3091
|
overflow-y: auto;
|
|
3094
|
-
`;var MF=e=>{let[t,o]=useState(0),[r,n]=useState(0),[i,a]=useState(0);return ke({fetcher:UserRepository.Relationship.getFollowInfo,params:e,callback:l=>{l.data&&(o(l.data.followerCount),n(l.data.followingCount),a(l.data.pendingCount));},shouldCall:()=>!!e}),{followerCount:t,followingCount:r,pendingCount:i}},d9=MF;var IF=e=>{var o;let t=ke({fetcher:UserRepository.Relationship.getFollowInfo,params:e});return (o=t==null?void 0:t.status)!=null?o:"none"},sa=IF;var SF=({userId:e,currentUserId:t,fileUrl:o,displayName:r,description:n,isMyProfile:i,onEditUser:a,onFollowRequest:l,onFollowDecline:m,onUnFollow:p,onPendingNotificationClick:u,onFollowingCountClick:c,onFollowerCountClick:g,onReportClick:f,isFollowPending:C,isFollowNone:v,isFollowAccepted:y,followerCount:h=0,followingCount:x=0,isPrivateNetwork:T})=>{let S=U(e),{formatMessage:b}=useIntl(),{isFlaggedByMe:w}=tr(e||void 0),{followers:N}=Fo({userId:t,status:"pending"}),
|
|
3092
|
+
`;var MF=e=>{let[t,o]=useState(0),[r,n]=useState(0),[i,a]=useState(0);return ke({fetcher:UserRepository.Relationship.getFollowInfo,params:e,callback:l=>{l.data&&(o(l.data.followerCount),n(l.data.followingCount),a(l.data.pendingCount));},shouldCall:()=>!!e}),{followerCount:t,followingCount:r,pendingCount:i}},d9=MF;var IF=e=>{var o;let t=ke({fetcher:UserRepository.Relationship.getFollowInfo,params:e});return (o=t==null?void 0:t.status)!=null?o:"none"},sa=IF;var SF=({userId:e,currentUserId:t,fileUrl:o,displayName:r,description:n,isMyProfile:i,onEditUser:a,onFollowRequest:l,onFollowDecline:m,onUnFollow:p,onPendingNotificationClick:u,onFollowingCountClick:c,onFollowerCountClick:g,onReportClick:f,isFollowPending:C,isFollowNone:v,isFollowAccepted:y,followerCount:h=0,followingCount:x=0,isPrivateNetwork:T})=>{let S=U(e),{formatMessage:b}=useIntl(),{isFlaggedByMe:w}=tr(e||void 0),{followers:N}=Fo({userId:t,status:"pending"}),D=S!=null&&S.displayName?b({id:"user.unfollow.confirm.title"},{displayName:S.displayName}):b({id:"user.unfollow.confirm.title.thisUser"}),V=S!=null&&S.displayName?b({id:"user.unfollow.confirm.body"},{displayName:S.displayName}):b({id:"user.unfollow.confirm.body.thisUser"}),G=[y&&!i?{name:b({id:"user.unfollow"}),action:()=>re({title:D,content:V,cancelText:b({id:"buttonText.cancel"}),okText:b({id:"buttonText.unfollow"}),onOk:()=>I(void 0,null,function*(){yield p==null?void 0:p();})})}:void 0,i?void 0:{name:b(w?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:()=>{f==null||f();}}].filter(ue);return B.createElement(ic,{"data-qa-anchor":"user-info"},B.createElement(sc,null,B.createElement(ac,{"data-qa-anchor":"user-info-profile-image",avatar:o,backgroundImage:ae}),B.createElement(lc,null,i?B.createElement(A,{"data-qa-anchor":"user-info-edit-profile-button",onClick:()=>(S==null?void 0:S.userId)&&(a==null?void 0:a(S.userId))},B.createElement(nc,null)," ",B.createElement(FormattedMessage,{id:"user.editProfile"})):B.createElement(B.Fragment,null,T&&C&&B.createElement(A,{onClick:()=>m==null?void 0:m()},B.createElement(oc,null,B.createElement(rc,null)),B.createElement(FormattedMessage,{id:"user.cancel_follow"})),v&&B.createElement(Z,{onClick:()=>l==null?void 0:l()},B.createElement(ps,null)," ",B.createElement(FormattedMessage,{id:"user.follow"})))),B.createElement(cc,{options:G,pullRight:!1})),B.createElement(hc,null,B.createElement(Gd,{lines:3},B.createElement(mc,{"data-qa-anchor":"user-info-profile-name"},r)),S!=null&&S.isGlobalBanned?B.createElement(Xt,{style:{marginLeft:"0.265rem",marginTop:"1px"}}):null),B.createElement(dc,null,B.createElement(Pl,{onClick:()=>{c==null||c();}},tp(x)),B.createElement(FormattedMessage,{id:"counter.followings"}),B.createElement(Pl,{onClick:()=>{g==null||g();}},tp(h)),B.createElement(FormattedMessage,{id:"counter.followers"})),B.createElement(pc,{"data-qa-anchor":"user-info-description"},n),i&&N.length>0&&T&&B.createElement(uc,{onClick:()=>{u==null||u();}},B.createElement(fc,null,B.createElement(Cc,null),B.createElement(FormattedMessage,{id:"follow.pendingNotification.title"})),B.createElement(gc,null,B.createElement(FormattedMessage,{id:"follow.pendingNotification.body"}))))},c9=e=>{let t=E("UIUserInfo");return t?t(e):B.createElement(SF,d({},e))};var LF=({userId:e,onUnFollow:t,onFollowingCountClick:o,onFollowerCountClick:r,onPendingNotificationClick:n,isPrivateNetwork:i})=>{let{currentUserId:a}=_(),{formatMessage:l}=useIntl(),{onEditUser:m}=O(),p=U(e),u=j({fileId:p==null?void 0:p.avatarFileId,imageSize:"small"});go({userId:e,level:SubscriptionLevels.USER}),Gi({userId:a}),$i({userId:a});let c=sa(e),g=()=>I(void 0,null,function*(){e&&(yield UserRepository.Relationship.declineMyFollower(e),Y.success({content:B.createElement(FormattedMessage,{id:"notification.done"})}));}),f=()=>I(void 0,null,function*(){e&&(yield UserRepository.Relationship.unfollow(e),t==null||t(),Y.success({content:B.createElement(FormattedMessage,{id:"notification.done"})}));}),{followerCount:C,followingCount:v}=d9(e),y=()=>I(void 0,null,function*(){e&&(yield UserRepository.Relationship.follow(e));});if(c==null)return null;let h=c==="none",x=c==="accepted",T=c==="pending";return B.createElement(c9,{userId:e,currentUserId:a,fileUrl:(p==null?void 0:p.avatarCustomUrl)||u,displayName:(p==null?void 0:p.displayName)||l({id:"anonymous"}),description:p==null?void 0:p.description,onFollowerCountClick:r,onFollowingCountClick:o,onPendingNotificationClick:n,onFollowDecline:g,onFollowRequest:y,onUnFollow:f,onEditUser:m,isMyProfile:e===a,isFollowPending:T,isPrivateNetwork:i,isFollowNone:h,isFollowAccepted:x,followerCount:C,followingCount:v})},f9=memo(LF);var kF=({userId:e,socialSettings:t})=>{let{currentUserId:o}=_(),[r,n]=useState(Je.TIMELINE),[i,a]=useState(Lt.FOLLOWINGS),l=sa(e),m=e===o,p=()=>I(void 0,null,function*(){n(Je.TIMELINE);}),u=l==="accepted",c=E1(t)&&!u&&!m,g=c?u0.filter(({value:f})=>f===Je.TIMELINE):u0;return e?B.createElement(m9,null,B.createElement(f9,{key:e,userId:e,onUnFollow:p,onPendingNotificationClick:()=>{n(Je.FOLLOWERS),a(Dn);},onFollowingCountClick:()=>{n(Je.FOLLOWERS),a(Lt.FOLLOWINGS);},onFollowerCountClick:()=>{n(Je.FOLLOWERS),a(Lt.FOLLOWERS);}}),B.createElement(ea,{"data-qa-anchor":"user-feed-header",tabs:g,activeTab:r,onChange:n}),r===Je.TIMELINE&&B.createElement(Go,{targetType:m?"myFeed":"user",targetId:e,showPostCreator:m,isHiddenProfile:c}),r===Je.GALLERY&&B.createElement(Ws,{targetType:"user",targetId:e}),r===Je.FOLLOWERS&&!c&&B.createElement(l9,{userId:e,activeTab:i,socialSettings:t,onFollowingListClick:f=>n(Je.TIMELINE),onFollowerListClick:f=>n(Je.TIMELINE),onTabChange:f=>a(f)})):null},C9=kF;var h9=s.div`
|
|
3095
3093
|
max-width: 1160px;
|
|
3096
3094
|
margin: 0 auto;
|
|
3097
3095
|
padding: 30px 0;
|
|
@@ -3102,7 +3100,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3102
3100
|
margin-bottom: 1rem;
|
|
3103
3101
|
`,v9=s.div`
|
|
3104
3102
|
${({theme:e})=>e.typography.headline}
|
|
3105
|
-
`,x9=s(
|
|
3103
|
+
`,x9=s(A).attrs({variant:"secondary"})`
|
|
3106
3104
|
width: 28px;
|
|
3107
3105
|
padding: 2px;
|
|
3108
3106
|
|
|
@@ -3183,7 +3181,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3183
3181
|
${({theme:e})=>e.typography.bodyBold}
|
|
3184
3182
|
`,D9=s.div`
|
|
3185
3183
|
color: ${({theme:e})=>e.palette.base.shade2};
|
|
3186
|
-
`;var zF=({onChange:e,value:t})=>B.createElement(k9,null,B.createElement(F9,null,B.createElement(A9,null,B.createElement(FormattedMessage,{id:"community.permissions.approvePosts"})),B.createElement(D9,null,B.createElement(FormattedMessage,{id:"community.permissions.approvePosts.prompt"}))),B.createElement(T9,{value:t,"data-qa-anchor":"community-permissions",onChange:e})),z9=zF;function UF({needApprovalOnPostCreation:e,onNeedApprovalOnPostCreationChange:t}){return B.createElement(N9,null,B.createElement(E9,null,B.createElement(FormattedMessage,{id:"community.permissions.postReview"})),B.createElement(L9,null,B.createElement(z9,{value:e,onChange:o=>t==null?void 0:t(o)})))}var O9=e=>{let t=E("CommunityPermissions");return t?t(e):B.createElement(UF,d({},e))};function qF(e,t){return e==="needApprovalOnPostCreation"?(t==null?void 0:t.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED:!1}function YF(e,t){return e==="needApprovalOnPostCreation"?{postSetting:t?CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED:CommunityPostSettings.ANYONE_CAN_POST}:{[e]:t}}function U9({communityId:e,key:t}){let o=Ce(e),r=qF(t,o),[n,i]=useState(r);useEffect(()=>i(r),[r]);let a=useCallback(l=>I(this,null,function*(){try{if(i(l),e==null)return;yield CommunityRepository.updateCommunity(e,YF(t,l));}catch(m){i(r),m instanceof Error&>({title:B.createElement(FormattedMessage,{id:`community.permissions.error.${t}.${l?"turnOn":"turnOff"}`}),content:m.message});}}),[t,r]);return [n,a]}var QF=({communityId:e})=>{let[t,o]=U9({communityId:e,key:"needApprovalOnPostCreation"});return B.createElement(O9,{needApprovalOnPostCreation:t,onNeedApprovalOnPostCreationChange:o})},j9=QF;var H9=({title:e,children:t})=>B.createElement(Ko,{edit:!0},e&&B.createElement(Ss,null,e),B.createElement(Jo,null,t)),V9=({type:e,description:t,icon:o})=>B.createElement(Ts,null,B.createElement(Ps,null,o),B.createElement("div",null,e,B.createElement(Ns,null,t))),XF=({community:e,"data-qa-anchor":t="",className:o,onSubmit:r,onCancel:n})=>{let[i,a]=useState(!1),{register:l,handleSubmit:m,setError:p,watch:u,control:c,formState:g}=p7(e),{errors:f,isValid:C}=g,v=u("displayName"),y=u("description"),h=useRef(null),x=b=>I(void 0,null,function*(){try{a(!0),yield r==null?void 0:r(P(d({},b),{avatarFileId:b.avatarFileId||void 0})),Y.success({content:B.createElement(FormattedMessage,{id:"community.updateSuccess"})});}finally{a(!1);}}),T=!g.isValid||i,S=h.current&&h.current.scrollHeight-h.current.clientHeight-h.current.scrollTop;return B.useLayoutEffect(()=>{S!=null&&h.current&&S<10&&h.current.scrollHeight-h.current.clientHeight-h.current.scrollTop>10&&h.current.scrollTo({top:h.current.scrollHeight});},[h.current,S,g]),B.createElement(Wo,{className:o,onSubmit:m(x)},B.createElement(Xo,{ref:h},B.createElement(H9,{title:"General"},B.createElement(at,null,B.createElement(Controller,{name:"avatarFileId",control:c,render:N=>{var {field:
|
|
3184
|
+
`;var zF=({onChange:e,value:t})=>B.createElement(k9,null,B.createElement(F9,null,B.createElement(A9,null,B.createElement(FormattedMessage,{id:"community.permissions.approvePosts"})),B.createElement(D9,null,B.createElement(FormattedMessage,{id:"community.permissions.approvePosts.prompt"}))),B.createElement(T9,{value:t,"data-qa-anchor":"community-permissions",onChange:e})),z9=zF;function UF({needApprovalOnPostCreation:e,onNeedApprovalOnPostCreationChange:t}){return B.createElement(N9,null,B.createElement(E9,null,B.createElement(FormattedMessage,{id:"community.permissions.postReview"})),B.createElement(L9,null,B.createElement(z9,{value:e,onChange:o=>t==null?void 0:t(o)})))}var O9=e=>{let t=E("CommunityPermissions");return t?t(e):B.createElement(UF,d({},e))};function qF(e,t){return e==="needApprovalOnPostCreation"?(t==null?void 0:t.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED:!1}function YF(e,t){return e==="needApprovalOnPostCreation"?{postSetting:t?CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED:CommunityPostSettings.ANYONE_CAN_POST}:{[e]:t}}function U9({communityId:e,key:t}){let o=Ce(e),r=qF(t,o),[n,i]=useState(r);useEffect(()=>i(r),[r]);let a=useCallback(l=>I(this,null,function*(){try{if(i(l),e==null)return;yield CommunityRepository.updateCommunity(e,YF(t,l));}catch(m){i(r),m instanceof Error&>({title:B.createElement(FormattedMessage,{id:`community.permissions.error.${t}.${l?"turnOn":"turnOff"}`}),content:m.message});}}),[t,r]);return [n,a]}var QF=({communityId:e})=>{let[t,o]=U9({communityId:e,key:"needApprovalOnPostCreation"});return B.createElement(O9,{needApprovalOnPostCreation:t,onNeedApprovalOnPostCreationChange:o})},j9=QF;var H9=({title:e,children:t})=>B.createElement(Ko,{edit:!0},e&&B.createElement(Ss,null,e),B.createElement(Jo,null,t)),V9=({type:e,description:t,icon:o})=>B.createElement(Ts,null,B.createElement(Ps,null,o),B.createElement("div",null,e,B.createElement(Ns,null,t))),XF=({community:e,"data-qa-anchor":t="",className:o,onSubmit:r,onCancel:n})=>{let[i,a]=useState(!1),{register:l,handleSubmit:m,setError:p,watch:u,control:c,formState:g}=p7(e),{errors:f,isValid:C}=g,v=u("displayName"),y=u("description"),h=useRef(null),x=b=>I(void 0,null,function*(){try{a(!0),yield r==null?void 0:r(P(d({},b),{avatarFileId:b.avatarFileId||void 0})),Y.success({content:B.createElement(FormattedMessage,{id:"community.updateSuccess"})});}finally{a(!1);}}),T=!g.isValid||i,S=h.current&&h.current.scrollHeight-h.current.clientHeight-h.current.scrollTop;return B.useLayoutEffect(()=>{S!=null&&h.current&&S<10&&h.current.scrollHeight-h.current.clientHeight-h.current.scrollTop>10&&h.current.scrollTo({top:h.current.scrollHeight});},[h.current,S,g]),B.createElement(Wo,{className:o,onSubmit:m(x)},B.createElement(Xo,{ref:h},B.createElement(H9,{title:"General"},B.createElement(at,null,B.createElement(Controller,{name:"avatarFileId",control:c,render:N=>{var {field:D}=N,V=D,w=M(V,["ref"]);return B.createElement(Zo,P(d({mimeType:"image/png, image/jpeg"},w),{"data-qa-anchor":t}))}})),B.createElement(at,{error:f.displayName},B.createElement(No,null,B.createElement(Tt,{htmlFor:"displayName",className:"required"},B.createElement(FormattedMessage,{id:"community.name"})),B.createElement(To,null,v.length,"/30")),B.createElement(Lr,P(d({},l("displayName")),{"data-qa-anchor":`${t}-community-name-input`,placeholder:"Enter community name"})),B.createElement(st,{errors:f,name:"displayName"})),B.createElement(at,{error:f.description},B.createElement(No,null,B.createElement(Tt,{htmlFor:"description"},B.createElement(FormattedMessage,{id:"community.about"})),B.createElement(To,null,(y==null?void 0:y.length)||0,"/180")),B.createElement(Er,P(d({},l("description",{maxLength:{value:180,message:"Description text is too long"}})),{"data-qa-anchor":`${t}-community-description-textarea`,placeholder:"Enter description"})),B.createElement(st,{errors:f,name:"description"})),B.createElement(at,{error:f.categoryIds},B.createElement(Tt,{htmlFor:"categoryIds",className:"required"},B.createElement(FormattedMessage,{id:"community.category"})),B.createElement(Controller,{rules:{required:"Category is required"},name:"categoryIds",render:N=>{var {field:D}=N,V=D,w=M(V,["ref"]);return B.createElement(Ls,P(d({parentContainer:h.current},w),{"data-qa-anchor":`${t}`}))},control:c}),B.createElement(st,{errors:f,name:"category"}))),B.createElement(H9,{title:B.createElement(FormattedMessage,{id:"community.categorypermission"})},B.createElement(Controller,{name:"isPublic",render:({field:b})=>B.createElement(B.Fragment,null,B.createElement(hn,P(d({},b),{value:b.value===!0,onChange:w=>b.onChange(w.target.checked),"data-qa-anchor":"community-form-public-type-community-type",label:"Public",renderer:()=>B.createElement(V9,{type:"Public",description:"Anyone can join, view and search the posts in this page.",icon:B.createElement(Is,null)})})),B.createElement(hn,P(d({},b),{value:b.value===!1,onChange:w=>b.onChange(!w.target.checked),"data-qa-anchor":"community-form-private-type-community-type",label:"Private",renderer:()=>B.createElement(V9,{type:"Private",description:"Only members invited by the moderators can join, view, and search the posts in this page.",icon:B.createElement(ws,null)})}))),control:c}))),B.createElement(xn,{edit:!0},B.createElement(vn,{"data-qa-anchor":`${t}-save-button`,disabled:T,edit:!0},B.createElement(FormattedMessage,{id:"save"}))))},$9=memo(XF);var eA=r=>{var n=r,{edit:e,community:t}=n,o=M(n,["edit","community"]);return e?t==null?null:B.createElement($9,P(d({},o),{community:t})):B.createElement(Bs,d({},o))},G9=memo(e=>{let t=E("CommunityForm");return t?t(e):B.createElement(eA,d({},e))});var _9=s.div`
|
|
3187
3185
|
border-bottom: 1px solid ${({theme:e})=>e.palette.base.shade4};
|
|
3188
3186
|
`;var iA=({children:e})=>B.createElement(Ko,null,B.createElement(Jo,null,e)),q9=({className:e="",closeConfirm:t,onSubmit:o})=>{let{formatMessage:r}=useIntl(),{formState:{errors:n},control:i,setError:a,handleSubmit:l}=useForm({defaultValues:{members:[]}}),m=p=>I(void 0,null,function*(){if(p.members.length===0){a("members",{message:r({id:"AddMemberModal.membersValidationError"})});return}o(p.members);});return B.createElement(Le,{"data-qa-anchor":"add-member-modal",title:r({id:"AddMemberModal.addMembers"}),onCancel:t},B.createElement(_9,null,B.createElement(Wo,{className:e,onSubmit:l(m)},B.createElement(Xo,null,B.createElement(iA,null,B.createElement(Es,{error:n.members},B.createElement(Controller,{name:"members",render:({field:p})=>B.createElement(Ro,P(d({},p),{"data-qa-anchor":"add-member-modal"})),control:i}),B.createElement(st,{errors:n,name:"members"})))),B.createElement(xn,null,B.createElement(vn,null,B.createElement(FormattedMessage,{id:"add"}))))))};var sA=s.div`
|
|
3189
3187
|
display: grid;
|
|
@@ -3275,7 +3273,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3275
3273
|
padding: 10px 16px;
|
|
3276
3274
|
justify-content: center;
|
|
3277
3275
|
width: 100%;
|
|
3278
|
-
`,tf=s(
|
|
3276
|
+
`,tf=s(A)`
|
|
3279
3277
|
padding: 10px 16px;
|
|
3280
3278
|
justify-content: center;
|
|
3281
3279
|
width: 100%;
|
|
@@ -3283,7 +3281,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3283
3281
|
margin-right: 8px;
|
|
3284
3282
|
`;var rf=({title:e,bodyText:t,actionButton:o})=>B.createElement(K9,null,B.createElement(J9,null,e),B.createElement(X9,null,B.createElement("div",null,t),B.createElement(R9,null,o))),MA=({onClick:e})=>B.createElement(ef,{"data-qa-anchor":"community-edit-add-member-button",onClick:e},B.createElement(of,null),B.createElement(FormattedMessage,{id:"add"})),bA=o=>{var r=o,{onClick:e}=r,t=M(r,["onClick"]);return B.createElement(tf,P(d({},t),{onClick:e}),B.createElement(FormattedMessage,{id:"close"}))},nf=({action:e})=>B.createElement(rf,{title:B.createElement(FormattedMessage,{id:"AddMemberAction.title"}),bodyText:B.createElement(FormattedMessage,{id:"AddMemberAction.description"}),actionButton:B.createElement(MA,{onClick:e})}),sf=({communityId:e,onCommunityClosed:t})=>{let{formatMessage:o}=useIntl();return B.createElement(rf,{title:B.createElement(FormattedMessage,{id:"CloseCommunityAction.title"}),bodyText:B.createElement(FormattedMessage,{id:"CloseCommunityAction.description"}),actionButton:B.createElement(bA,{"data-qa-anchor":"community-edit-close-community-button",onClick:()=>re({"data-qa-anchor":"close-community",title:o({id:"CloseCommunityAction.closeConfirm.title"}),content:o({id:"CloseCommunityAction.closeConfirm.description"}),cancelText:o({id:"cancel"}),okText:o({id:"close"}),onOk:()=>I(void 0,null,function*(){e&&(yield CommunityRepository.deleteCommunity(e),t==null||t());})})})})};var wA=({communityId:e,tab:t=Nt.EDIT_PROFILE})=>{let{onChangePage:o}=O(),[r,n]=useState(t),[i,a]=useState(!1),l=()=>a(!0),m=()=>a(!1);useEffect(()=>n(t),[t]);let{onClickCommunity:p}=O(),u=Ce(e),c=j({fileId:u==null?void 0:u.avatarFileId,imageSize:"medium"}),g=()=>e&&p(e),f=y=>I(void 0,null,function*(){e!=null&&(yield CommunityRepository.updateCommunity(e,y),g());}),C=y=>I(void 0,null,function*(){e!=null&&(yield CommunityRepository.Membership.addMembers(e,y),m());});return B.createElement(Y9,{aside:(()=>{switch(r){case Nt.EDIT_PROFILE:return B.createElement(sf,{communityId:e,onCommunityClosed:()=>o("newsfeed")});case Nt.MEMBERS:return B.createElement(B.Fragment,null,B.createElement(nf,{action:l}),i&&B.createElement(q9,{closeConfirm:m,onSubmit:C}));default:return null}})(),header:B.createElement(W9,{avatarFileUrl:c,communityName:u==null?void 0:u.displayName,tabs:X7,activeTab:r,onTabChange:y=>n(y),onReturnToCommunity:g})},r===Nt.EDIT_PROFILE&&!!(u!=null&&u.communityId)&&B.createElement(G9,{"data-qa-anchor":"community-edit",community:u,edit:!0,onSubmit:y=>f(P(d({},y),{avatarFileId:y.avatarFileId||void 0}))}),r===Nt.MEMBERS&&B.createElement(Rs,{communityId:e}),r===Nt.PERMISSIONS&&B.createElement(j9,{communityId:e}))},mf=wA;var EA=s.div`
|
|
3285
3283
|
margin-top: 16px;
|
|
3286
|
-
`,LA=({title:e,children:t})=>B.createElement(Ko,null,B.createElement(Ss,null,e),B.createElement(Jo,null,t)),kA=({user:e,onSubmit:t,className:o})=>{var C,v;let{currentUserId:r}=
|
|
3284
|
+
`,LA=({title:e,children:t})=>B.createElement(Ko,null,B.createElement(Ss,null,e),B.createElement(Jo,null,t)),kA=({user:e,onSubmit:t,className:o})=>{var C,v;let{currentUserId:r}=_(),n=U(r),{formatMessage:i}=useIntl(),{register:a,handleSubmit:l,formState:{errors:m},watch:p,control:u}=useForm({defaultValues:{displayName:e.displayName,description:(C=e.description)!=null?C:"",avatarFileId:(v=e.avatarFileId)!=null?v:void 0}}),c=Cr(n==null?void 0:n.roles),g=p("description"),f=p("displayName");return B.createElement(Wo,{className:o,onSubmit:l(y=>{t(c?y:{description:y.description,avatarFileId:y.avatarFileId});})},B.createElement(Xo,null,B.createElement(LA,{title:B.createElement(FormattedMessage,{id:"UserProfileForm.title"})},B.createElement(Controller,{name:"avatarFileId",render:x=>{var {field:T}=x,S=T,h=M(S,["ref"]);return B.createElement(Zo,P(d({},h),{"data-qa-anchor":"user-profile-form-avatar-uploader"}))},control:u}),B.createElement(at,{error:m.displayName},B.createElement(No,null,B.createElement(Tt,{htmlFor:"displayName",className:"required"},B.createElement(FormattedMessage,{id:"UserProfileForm.displayname"})),B.createElement(To,null,(f==null?void 0:f.length)||0,"/100")),B.createElement(Lr,P(d({},a("displayName",{required:i({id:"UserProfileForm.requiredDisplayName"})})),{"data-qa-anchor":"user-profile-form-display-name-input",placeholder:i({id:"UserProfileForm.namePlaceholder"}),maxLength:100,disabled:!c})),B.createElement(st,{errors:m,name:"displayName"})),B.createElement(at,{error:m.description},B.createElement(No,null,B.createElement(Tt,{htmlFor:"description"},B.createElement(FormattedMessage,{id:"UserProfileForm.about"})),B.createElement(To,null,g.length,"/180")),B.createElement(Er,P(d({},a("description")),{"data-qa-anchor":"user-profile-form-description-textarea",placeholder:i({id:"UserProfileForm.requiredDescription"}),maxLength:180})),B.createElement(st,{errors:m,name:"description"})),B.createElement(EA,null,B.createElement(Z,{"data-qa-anchor":"user-profile-form-save-button",type:"submit"},B.createElement(FormattedMessage,{id:"save"}))))))},df=memo(kA);var pf=s.button.attrs({role:"button"})`
|
|
3287
3285
|
color: ${({theme:e})=>e.palette.base.shade1};
|
|
3288
3286
|
font-size: 14px;
|
|
3289
3287
|
border: none;
|
|
@@ -3346,7 +3344,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3346
3344
|
padding: 10px 16px;
|
|
3347
3345
|
justify-content: center;
|
|
3348
3346
|
width: 100%;
|
|
3349
|
-
`;s(
|
|
3347
|
+
`;s(A)`
|
|
3350
3348
|
padding: 10px 16px;
|
|
3351
3349
|
justify-content: center;
|
|
3352
3350
|
width: 100%;
|
|
@@ -3357,7 +3355,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3357
3355
|
width: 100%;
|
|
3358
3356
|
`,GA=s(P7)`
|
|
3359
3357
|
min-height: 100%;
|
|
3360
|
-
`,_A=()=>{let{page:e}=O(),{client:t}=
|
|
3358
|
+
`,_A=()=>{let{page:e}=O(),{client:t}=_(),[o,r]=B.useState(null);return useEffect(()=>{if(t==null)return;function n(){return I(this,null,function*(){let i=yield t==null?void 0:t.getSocialSettings();i&&r(i);})}n();},[t]),B.createElement($A,null,B.createElement(c8,{aside:B.createElement(GA,{activeCommunity:e.communityId})},e.type==="explore"&&B.createElement(Q7,null),e.type==="newsfeed"&&B.createElement(J7,null),e.type==="communityfeed"&&B.createElement(Ku,{communityId:e.communityId,isNewCommunity:e.isNewCommunity}),e.type==="communityedit"&&B.createElement(mf,{communityId:e.communityId,tab:e.tab}),e.type==="category"&&B.createElement(w9,{categoryId:e.categoryId}),e.type==="userfeed"&&B.createElement(C9,{userId:e.userId,socialSettings:o}),e.type==="useredit"&&B.createElement(wf,{userId:e.userId})))},qA=_A;var Sf={DIRECT_CHAT:2,ONLY_ME_CHAT:1};function KA(e,t){var i,a,l;if((i=e==null?void 0:e.metadata)!=null&&i.isDirectChat&&(e==null?void 0:e.memberCount)===Sf.ONLY_ME_CHAT)return "Me";if(!((a=e==null?void 0:e.metadata)!=null&&a.isDirectChat)&&(e!=null&&e.displayName))return e==null?void 0:e.displayName;let{firstname:o="",lastname:r=""}=(l=t==null?void 0:t.metadata)!=null?l:{},n=trim(`${o}${r}`);return (t==null?void 0:t.displayName)||n||(t==null?void 0:t.userId)||e.channelId}function M0(o){return I(this,arguments,function*({avatarFileId:e,avatarCustomUrl:t}){if(t)return t;if(e){let r=yield FileRepository.getFile(e);return FileRepository.fileUrlWithSize(r.data.fileUrl,"small")}return null})}function JA(e,t,o){return I(this,null,function*(){var r,n;return (e==null?void 0:e.memberCount)===Sf.ONLY_ME_CHAT?M0({avatarCustomUrl:o==null?void 0:o.avatarUrl}):(r=e==null?void 0:e.metadata)!=null&&r.isDirectChat&&(t!=null&&t.avatarUrl)?M0({avatarCustomUrl:t.avatarUrl}):M0({avatarFileId:e==null?void 0:e.avatarFileId,avatarCustomUrl:(n=e==null?void 0:e.metadata)==null?void 0:n.avatarCustomUrl})})}function XA({channel:e}){var u,c,g;let{currentUserId:t}=B1(),[o,r]=useState(null),n=(u=e==null?void 0:e.metadata)!=null&&u.isDirectChat?((g=(c=e==null?void 0:e.metadata)==null?void 0:c.userIds)!=null?g:[]).find(f=>f!==t):null,i=U(t),a=U(n),l=j({fileId:i==null?void 0:i.avatarFileId}),m=j({fileId:a==null?void 0:a.avatarFileId});return useEffect(()=>{function f(){return I(this,null,function*(){r(null);let C=yield JA(e,{avatarUrl:(a==null?void 0:a.avatarCustomUrl)||m},{avatarUrl:(i==null?void 0:i.avatarCustomUrl)||l});r(C);})}f();},[a==null?void 0:a.avatarCustomUrl,e,l,i==null?void 0:i.avatarCustomUrl]),{chatName:useMemo(()=>e==null?void 0:KA(e,a),[e,a]),chatAvatar:o,type:e==null?void 0:e.type}}var Vn=XA;var Tf=s(ye)`
|
|
3361
3359
|
display: flex;
|
|
3362
3360
|
align-items: center;
|
|
3363
3361
|
width: 100%;
|
|
@@ -3548,7 +3546,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3548
3546
|
display: flex;
|
|
3549
3547
|
flex-direction: column-reverse;
|
|
3550
3548
|
padding: 0 20px;
|
|
3551
|
-
`;function N0(e){let r=ee({fetcher:MessageRepository.getMessages,params:e,shouldCall:()=>!!e.subChannelId}),{items:t}=r,o=M(r,["items"]);return d({messages:t},o)}var $D=({message:e,isConsequent:t,isIncoming:o,containerRef:r})=>{let n=U(e.creatorId),i=j({fileId:n==null?void 0:n.avatarFileId,imageSize:"small"});return B.createElement(fg,{key:e.messageId,avatar:i||"",messageId:e.messageId,data:(e==null?void 0:e.data)||"",type:e.dataType,createdAt:new Date(e.createdAt),isDeleted:e.isDeleted,userDisplayName:(n==null?void 0:n.displayName)||"",isConsequent:t,isIncoming:o,containerRef:r})},GD=({channelId:e})=>{let{client:t}=
|
|
3549
|
+
`;function N0(e){let r=ee({fetcher:MessageRepository.getMessages,params:e,shouldCall:()=>!!e.subChannelId}),{items:t}=r,o=M(r,["items"]);return d({messages:t},o)}var $D=({message:e,isConsequent:t,isIncoming:o,containerRef:r})=>{let n=U(e.creatorId),i=j({fileId:n==null?void 0:n.avatarFileId,imageSize:"small"});return B.createElement(fg,{key:e.messageId,avatar:i||"",messageId:e.messageId,data:(e==null?void 0:e.data)||"",type:e.dataType,createdAt:new Date(e.createdAt),isDeleted:e.isDeleted,userDisplayName:(n==null?void 0:n.displayName)||"",isConsequent:t,isIncoming:o,containerRef:r})},GD=({channelId:e})=>{let{client:t}=_(),o=useRef(null),{messages:r,hasMore:n,loadMore:i,isLoading:a}=N0({subChannelId:e,sortBy:"segmentDesc",limit:20});return qi({channelId:e}),B.createElement(gg,{ref:o},o.current?B.createElement(iT,{scrollableTarget:o.current,scrollThreshold:.7,hasMore:n,next:i,loader:a?B.createElement("span",{key:0},"Loading..."):null,inverse:!0,dataLength:r.length,style:{display:"flex",flexDirection:"column-reverse"},height:o.current.clientHeight},B.createElement(Cg,{ref:o,"data-qa-anchor":"message-list"},r.map((l,m)=>{let p=r[m+1],u=p&&p.creatorId===l.creatorId,c=l.creatorId!==(t==null?void 0:t.userId);return !(l!=null&&l.data)||!l.createdAt?B.createElement(B.Fragment,null):B.createElement($D,{key:l.messageId,message:l,isConsequent:u,isIncoming:c,containerRef:o})}))):null)},hg=e=>{let t=E("MessageList");return t?t(e):B.createElement(GD,d({},e))};var yg=s(c2).attrs({width:28,height:28})`
|
|
3552
3550
|
cursor: pointer;
|
|
3553
3551
|
margin-left: 12px;
|
|
3554
3552
|
margin-right: 8px;
|
|
@@ -3810,7 +3808,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3810
3808
|
display: flex;
|
|
3811
3809
|
height: 100%;
|
|
3812
3810
|
width: 100%;
|
|
3813
|
-
`;var bB=({name:e})=>B.createElement("div",{"data-qa-anchor":`chat-type-selector-item-${e}`},e),IB=({onChange:e,parentContainer:t})=>{let{formatMessage:o}=useIntl(),r=["live","community","conversation","broadcast"].map(n=>({name:o({id:"select.chatType.item"},{answerType:n}),value:n}));return B.createElement(Fg,{"data-qa-anchor":"chat-type",options:r,value:[r[0]],parentContainer:t,renderItem:bB,onSelect:({value:n})=>e(n)})},NC=IB;var TB=({children:e})=>B.createElement(kg,null,B.createElement(Lg,null,e)),NB=({className:e,onCancel:t,onSubmit:o})=>{let{formatMessage:r}=useIntl(),[n,i]=B.useState(!1),a={type:"live",displayName:void 0,avatarFileId:void 0,userIds:[],tags:[]},{register:l,handleSubmit:m,watch:p,control:u,formState:{errors:c,isDirty:g}}=useForm({defaultValues:a}),f=p("userIds"),C=h=>I(void 0,null,function*(){i(!0);try{let x={displayName:h.displayName,type:(h==null?void 0:h.type)||"community",avatarFileId:(h==null?void 0:h.avatarFileId)||void 0,userIds:h==null?void 0:h.userIds,tags:h==null?void 0:h.tags};yield o==null?void 0:o(x);}finally{i(!1);}}),v=!g||f.length===0||n,y=useRef(null);return B.createElement(Dg,null,B.createElement(Og,{className:e,onSubmit:m(C)},B.createElement(zg,{ref:y},B.createElement(TB,null,B.createElement(Yi,null,B.createElement(L0,null,B.createElement(E0,null,B.createElement(ga,null,B.createElement(FormattedMessage,{id:"chatComposer.label.type"})))),B.createElement(Ug,null,B.createElement(Controller,{name:"type",rules:{required:"Channel type is required"},render:T=>{var {field:S}=T,b=S,x=M(b,["ref"]);return B.createElement(NC,d({parentContainer:y.current},x))},control:u,defaultValue:""}))),B.createElement(Yi,null,B.createElement(L0,null,B.createElement(E0,null,B.createElement(ga,null,B.createElement(FormattedMessage,{id:"chatComposer.label.displayName"})))),B.createElement(Ag,P(d({},l("displayName")),{placeholder:r({id:"chat_composer.placeholder.displayName"}),"data-qa-anchor":"chat-composer-display-name-input"})),B.createElement(k0,{errors:c,name:"displayName"})),B.createElement(Yi,null,B.createElement(Controller,{name:"avatarFileId",control:u,render:T=>{var {field:S}=T,b=S,x=M(b,["ref"]);return B.createElement(Zo,d({mimeType:"image/png, image/jpeg"},x))},defaultValue:void 0})),B.createElement(Yi,null,B.createElement(ga,{className:"required"},B.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),B.createElement(Controller,{name:"userIds",render:T=>{var {field:S}=T,b=S,x=M(b,["ref"]);return B.createElement(Ro,P(d({parentContainer:y.current},x),{"data-qa-anchor":"chat-composer-select-user-input"}))},control:u}),B.createElement(k0,{errors:c,name:"userIds"})))),B.createElement(Bg,null,B.createElement(
|
|
3811
|
+
`;var bB=({name:e})=>B.createElement("div",{"data-qa-anchor":`chat-type-selector-item-${e}`},e),IB=({onChange:e,parentContainer:t})=>{let{formatMessage:o}=useIntl(),r=["live","community","conversation","broadcast"].map(n=>({name:o({id:"select.chatType.item"},{answerType:n}),value:n}));return B.createElement(Fg,{"data-qa-anchor":"chat-type",options:r,value:[r[0]],parentContainer:t,renderItem:bB,onSelect:({value:n})=>e(n)})},NC=IB;var TB=({children:e})=>B.createElement(kg,null,B.createElement(Lg,null,e)),NB=({className:e,onCancel:t,onSubmit:o})=>{let{formatMessage:r}=useIntl(),[n,i]=B.useState(!1),a={type:"live",displayName:void 0,avatarFileId:void 0,userIds:[],tags:[]},{register:l,handleSubmit:m,watch:p,control:u,formState:{errors:c,isDirty:g}}=useForm({defaultValues:a}),f=p("userIds"),C=h=>I(void 0,null,function*(){i(!0);try{let x={displayName:h.displayName,type:(h==null?void 0:h.type)||"community",avatarFileId:(h==null?void 0:h.avatarFileId)||void 0,userIds:h==null?void 0:h.userIds,tags:h==null?void 0:h.tags};yield o==null?void 0:o(x);}finally{i(!1);}}),v=!g||f.length===0||n,y=useRef(null);return B.createElement(Dg,null,B.createElement(Og,{className:e,onSubmit:m(C)},B.createElement(zg,{ref:y},B.createElement(TB,null,B.createElement(Yi,null,B.createElement(L0,null,B.createElement(E0,null,B.createElement(ga,null,B.createElement(FormattedMessage,{id:"chatComposer.label.type"})))),B.createElement(Ug,null,B.createElement(Controller,{name:"type",rules:{required:"Channel type is required"},render:T=>{var {field:S}=T,b=S,x=M(b,["ref"]);return B.createElement(NC,d({parentContainer:y.current},x))},control:u,defaultValue:""}))),B.createElement(Yi,null,B.createElement(L0,null,B.createElement(E0,null,B.createElement(ga,null,B.createElement(FormattedMessage,{id:"chatComposer.label.displayName"})))),B.createElement(Ag,P(d({},l("displayName")),{placeholder:r({id:"chat_composer.placeholder.displayName"}),"data-qa-anchor":"chat-composer-display-name-input"})),B.createElement(k0,{errors:c,name:"displayName"})),B.createElement(Yi,null,B.createElement(Controller,{name:"avatarFileId",control:u,render:T=>{var {field:S}=T,b=S,x=M(b,["ref"]);return B.createElement(Zo,d({mimeType:"image/png, image/jpeg"},x))},defaultValue:void 0})),B.createElement(Yi,null,B.createElement(ga,{className:"required"},B.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),B.createElement(Controller,{name:"userIds",render:T=>{var {field:S}=T,b=S,x=M(b,["ref"]);return B.createElement(Ro,P(d({parentContainer:y.current},x),{"data-qa-anchor":"chat-composer-select-user-input"}))},control:u}),B.createElement(k0,{errors:c,name:"userIds"})))),B.createElement(Bg,null,B.createElement(A,{onClick:h=>{h.preventDefault(),t==null||t();}},B.createElement(FormattedMessage,{id:"cancel"})),B.createElement(jg,{"data-qa-anchor":"chat-composer-submit-button",disabled:v},B.createElement(FormattedMessage,{id:"create"})))))},EC=NB;var kB=({onClose:e})=>{let{formatMessage:t}=useIntl(),o=n=>I(void 0,null,function*(){try{yield ChannelRepository.createChannel(n),e();}catch(i){i instanceof Error&&Y.error({content:i.message});}}),r=()=>re({title:t({id:"CommunityCreationModal.title"}),content:t({id:"CommunityCreationModal.content"}),cancelText:t({id:"CommunityCreationModal.cancelText"}),okText:t({id:"CommunityCreationModal.okText"}),onOk:e});return B.createElement(Le,{"data-qa-anchor":"create-chat-modal",title:t({id:"chat_modal.title"}),onCancel:r},B.createElement(EC,{onSubmit:o,onCancel:r}))},kC=kB;s.div`
|
|
3814
3812
|
display: flex;
|
|
3815
3813
|
flex-direction: column;
|
|
3816
3814
|
flex-grow: 1;
|
|
@@ -3873,6 +3871,6 @@ See https://s-c.sh/2BAXzed for more info.`),window[n1]+=1);var f1=`url("data:ima
|
|
|
3873
3871
|
min-width: 100px;
|
|
3874
3872
|
margin-left: 0;
|
|
3875
3873
|
`};
|
|
3876
|
-
`;var UB=({children:e})=>B.createElement(AC,null,B.createElement(FC,null,e)),jB=({channelId:e,className:t,memberIds:o,onCancel:r,onSubmit:n})=>{let[i,a]=B.useState(!1),l={userIds:o},{register:m,handleSubmit:p,watch:u,control:c,formState:{errors:g,isDirty:f}}=useForm({defaultValues:l}),C=u("userIds"),v=T=>I(void 0,[T],function*({userIds:x}){a(!0);try{n==null||n(x);let S=o.filter(w=>!x.includes(w)),b=x.filter(w=>!o.includes(w));return Promise.all([b.length>0?ChannelRepository.Membership.addMembers(e,b):null,S.length>0?ChannelRepository.Membership.removeMembers(e,S):null].filter(ue))}catch(S){S instanceof Error&&Y.error({content:S.message});}finally{a(!1);}}),y=!f||C.length===0||i,h=useRef(null);return B.createElement(BC,null,B.createElement(HC,{className:t,onSubmit:p(v)},B.createElement(jC,{ref:h},B.createElement(UB,null,B.createElement(zC,null,B.createElement(DC,{className:"required"},B.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),B.createElement(Controller,{name:"userIds",render:S=>{var {field:b}=S,w=b,T=M(w,["ref"]);return B.createElement(Ro,P(d({parentContainer:h.current},T),{"data-qa-anchor":"edit-chat-members-composer-select-user-input"}))},control:c}),B.createElement(OC,{errors:g,name:"userIds"})))),B.createElement(UC,null,B.createElement(
|
|
3874
|
+
`;var UB=({children:e})=>B.createElement(AC,null,B.createElement(FC,null,e)),jB=({channelId:e,className:t,memberIds:o,onCancel:r,onSubmit:n})=>{let[i,a]=B.useState(!1),l={userIds:o},{register:m,handleSubmit:p,watch:u,control:c,formState:{errors:g,isDirty:f}}=useForm({defaultValues:l}),C=u("userIds"),v=T=>I(void 0,[T],function*({userIds:x}){a(!0);try{n==null||n(x);let S=o.filter(w=>!x.includes(w)),b=x.filter(w=>!o.includes(w));return Promise.all([b.length>0?ChannelRepository.Membership.addMembers(e,b):null,S.length>0?ChannelRepository.Membership.removeMembers(e,S):null].filter(ue))}catch(S){S instanceof Error&&Y.error({content:S.message});}finally{a(!1);}}),y=!f||C.length===0||i,h=useRef(null);return B.createElement(BC,null,B.createElement(HC,{className:t,onSubmit:p(v)},B.createElement(jC,{ref:h},B.createElement(UB,null,B.createElement(zC,null,B.createElement(DC,{className:"required"},B.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),B.createElement(Controller,{name:"userIds",render:S=>{var {field:b}=S,w=b,T=M(w,["ref"]);return B.createElement(Ro,P(d({parentContainer:h.current},T),{"data-qa-anchor":"edit-chat-members-composer-select-user-input"}))},control:c}),B.createElement(OC,{errors:g,name:"userIds"})))),B.createElement(UC,null,B.createElement(A,{onClick:x=>{x.preventDefault(),r==null||r();},disabled:f},B.createElement(FormattedMessage,{id:"cancel"})),B.createElement(VC,{"data-qa-anchor":"edit-chat-members-composer-submit-button",disabled:y},B.createElement(FormattedMessage,{id:"save"})))))};function z0(e){let m=e,{channelId:t}=m,o=M(m,["channelId"]),{isLoading:r,channelMembers:n,hasMore:i,loadMore:a}=Xi(t),l=n.map(p=>p.userId);return r||t==null?null:B.createElement(jB,P(d({},o),{channelId:t,memberIds:l}))}var VB=({channelId:e,onClose:t})=>{let{formatMessage:o}=useIntl(),r=i=>I(void 0,null,function*(){try{t();}catch(a){a instanceof Error&&Y.error({content:a.message});}}),n=()=>re({title:o({id:"editChatMembersModal.confirm.title"}),content:o({id:"editChatMembersModal.confirm.content"}),cancelText:o({id:"editChatMembersModal.confirm.cancelText"}),okText:o({id:"editChatMembersModal.confirm.okText"}),onOk:t});return B.createElement(Le,{"data-qa-anchor":"edit-chat-members-modal",title:o({id:"editChatMembersModal.title"}),onCancel:n},B.createElement(z0,{channelId:e,onSubmit:r,onCancel:n}))},_C=VB;var _B=({membershipFilter:e="all",defaultChannelId:t,onMemberSelect:o,onChannelSelect:r,onAddNewChannel:n,onEditChatMember:i})=>{let{formatMessage:a}=useIntl(),[l,m]=useState(null),[p,u]=useState(!1),c=()=>u(!0),g=()=>u(!1),[f,C]=useState(!1),[v,y]=useState(!1),h=()=>C(!0),x=S=>{(l==null?void 0:l.channelId)!==(S==null?void 0:S.channelId)&&(g(),m(S),r==null||r(S));},T=()=>I(void 0,null,function*(){if(l!=null&&l.channelId)try{yield ChannelRepository.leaveChannel(l.channelId),Y.success({content:a({id:"chat.leaveChat.success"})}),m(null);}catch(S){Y.error({content:a({id:"chat.leaveChat.error"})});}});return useEffect(()=>{function S(){return I(this,null,function*(){return Client.startUnreadSync()})}return S(),()=>{Client.stopUnreadSync();}},[]),useEffect(()=>{t&&x({channelId:t,type:"standard"});},[t]),B.createElement(SC,null,B.createElement(Gf,{selectedChannelId:l==null?void 0:l.channelId,membershipFilter:e,onChannelSelect:x,onAddNewChannelClick:()=>{h(),n==null||n();}}),l?B.createElement(Vg,{channelId:l.channelId,shouldShowChatDetails:p,onChatDetailsClick:c}):null,p&&l?B.createElement(PC,{channelId:l.channelId,leaveChat:T,onEditChatMemberClick:S=>{y(!0),i==null||i(S);},onMemberSelect:o,onClose:g}):null,f?B.createElement(kC,{onClose:()=>C(!1)}):null,v&&l?B.createElement(_C,{channelId:l==null?void 0:l.channelId,onClose:()=>y(!1)}):null)},qB=_B;var ZC=(e,t)=>I(void 0,null,function*(){return ChannelRepository.Membership.addMembers(e,t)});var QC=(e,t)=>I(void 0,null,function*(){return ChannelRepository.Membership.removeMembers(e,t)});
|
|
3877
3875
|
|
|
3878
3876
|
export { J as AmityAvatar, el as AmityExpandableText, Ii as AmityPostContainer, al as AmityPostEngagementBar, qB as AmityUiKitChat, Go as AmityUiKitFeed, cS as AmityUiKitProvider, qA as AmityUiKitSocial, ZC as amityAddChatMembers, QC as amityRemoveChatMembers, O as useAmityNavigation, B1 as useAmitySDK, U as useAmityUser };
|