@amityco/ulta-ui-kit 1.0.0-alpha.4 → 1.0.0-alpha.6
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 +5 -5
- package/dist/index.js +5 -5
- 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
|
@@ -100,7 +100,7 @@ as for instance in your render method then you may be running into this limitati
|
|
|
100
100
|
|
|
101
101
|
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
|
|
102
102
|
Has styled-components' style tag been unmounted or altered by another script?
|
|
103
|
-
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function dF(){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 Zo(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(dF.apply(void 0,zi([mF[e]],t,!1)).trim())}var cF=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 Zo(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 s=this.indexOfGroup(t+1),l=(a=0,o.length);a<l;a++)this.tag.insertRule(s,o[a])&&(this.groupSizes[t]++,s++);},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(eu);return o},e}(),pF=1<<30,fc=new Map,hc=new Map,gc=1,cc=function(e){if(fc.has(e))return fc.get(e);for(;hc.has(gc);)gc++;var t=gc++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>pF))throw Zo(16,"".concat(t));return fc.set(e,t),hc.set(t,e),t},uF=function(e,t){gc=t+1,fc.set(e,t),hc.set(t,e);},fF="style[".concat(ii,"][").concat(yc,'="').concat(b1,'"]'),gF=new RegExp("^".concat(ii,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),yF=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);},hF=function(e,t){for(var o,r=((o=t.textContent)!==null&&o!==void 0?o:"").split(eu),n=[],i=0,a=r.length;i<a;i++){var s=r[i].trim();if(s){var l=s.match(gF);if(l){var c=0|parseInt(l[1],10),p=l[2];c!==0&&(uF(p,c),yF(e,p,l[3]),e.getTag().insertRules(c,n)),n.length=0;}else n.push(s);}}};function Q5(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:null}var Yg=function(e){var t=document.head,o=e||t,r=document.createElement("style"),n=function(s){var l=Array.from(s.querySelectorAll("style[".concat(ii,"]")));return l[l.length-1]}(o),i=n!==void 0?n.nextSibling:null;r.setAttribute(ii,Ug),r.setAttribute(yc,b1);var a=Q5();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},CF=function(){function e(t){this.element=Yg(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 Zo(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}(),vF=function(){function e(t){this.element=Yg(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}(),xF=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}(),Lg=vc,bF={isServer:!vc,useCSSOMInjection:!QB},Dm=function(){function e(t,o,r){t===void 0&&(t=I1),o===void 0&&(o={});var n=this;this.options=jt(jt({},bF),t),this.gs=o,this.names=new Map(r),this.server=!!t.isServer,!this.server&&vc&&Lg&&(Lg=!1,function(i){for(var a=document.querySelectorAll(fF),s=0,l=a.length;s<l;s++){var c=a[s];c&&c.getAttribute(ii)!==Ug&&(hF(i,c),c.parentNode&&c.parentNode.removeChild(c));}}(this)),ou(this,function(){return function(i){for(var a=i.getTag(),s=a.length,l="",c=function(u){var f=function(v){return hc.get(v)}(u);if(f===void 0)return "continue";var g=i.names.get(f),y=a.getGroup(u);if(g===void 0||y.length===0)return "continue";var h="".concat(ii,".g").concat(u,'[id="').concat(f,'"]'),C="";g!==void 0&&g.forEach(function(v){v.length>0&&(C+="".concat(v,","));}),l+="".concat(y).concat(h,'{content:"').concat(C,'"}').concat(eu);},p=0;p<s;p++)c(p);return l}(n)});}return e.registerId=function(t){return cc(t)},e.prototype.reconstructWithOptions=function(t,o){return o===void 0&&(o=!0),new e(jt(jt({},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 xF(n):r?new CF(n):new vF(n)}(this.options),new cF(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(cc(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(cc(t),r);},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear();},e.prototype.clearRules=function(t){this.getTag().clearGroup(cc(t)),this.clearNames(t);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),IF=/&/g,MF=/^\s*\/\/.*$/gm;function Qg(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=Qg(o.children,t)),o})}function Kg(e){var t,o,r,n=I1,i=n.options,a=i===void 0?I1:i,s=n.plugins,l=s===void 0?xc:s,c=function(f,g,y){return y.startsWith(o)&&y.endsWith(o)&&y.replaceAll(o,"").length>0?".".concat(t):f},p=l.slice();p.push(function(f){f.type===qo.RULESET&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(IF,o).replace(r,c));}),a.prefix&&p.push(qo.prefixer),p.push(qo.stringify);var u=function(f,g,y,h){g===void 0&&(g=""),y===void 0&&(y=""),h===void 0&&(h="&"),t=h,o=g,r=new RegExp("\\".concat(o,"\\b"),"g");var C=f.replace(MF,""),v=qo.compile(y||g?"".concat(y," ").concat(g," { ").concat(C," }"):C);a.namespace&&(v=Qg(v,a.namespace));var w=[];return qo.serialize(v,qo.middleware(p.concat(qo.rulesheet(function(x){return w.push(x)})))),w};return u.hash=l.length?l.reduce(function(f,g){return g.name||Zo(15),es(f,g.name)},zg).toString():"",u}var wF=new Dm,K5=Kg(),ru=re.createContext({shouldForwardProp:void 0,styleSheet:wF,stylis:K5});ru.Consumer;re.createContext(void 0);function J5(){return useContext(ru)}var X5=function(){function e(t,o){var r=this;this.inject=function(n,i){i===void 0&&(i=K5);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,ou(this,function(){throw Zo(12,String(r.name))});}return e.prototype.getName=function(t){return t===void 0&&(t=K5),this.name+t.hash},e}(),_F=function(e){return e>="A"&&e<="Z"};function Bg(e){for(var t="",o=0;o<e.length;o++){var r=e[o];if(o===1&&r==="-"&&e[0]==="-")return e;_F(r)?t+="-"+r.toLowerCase():t+=r;}return t.startsWith("ms-")?"-"+t:t}var Jg=function(e){return e==null||e===!1||e===""},Xg=function(e){var t,o,r=[];for(var n in e){var i=e[n];e.hasOwnProperty(n)&&!Jg(i)&&(Array.isArray(i)&&i.isCss||os(i)?r.push("".concat(Bg(n),":"),i,";"):M1(i)?r.push.apply(r,zi(zi(["".concat(n," {")],Xg(i),!1),["}"],!1)):r.push("".concat(Bg(n),": ").concat((t=n,(o=i)==null||typeof o=="boolean"||o===""?"":typeof o!="number"||o===0||t in Pg||t.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function Hi(e,t,o,r){if(Jg(e))return [];if(tu(e))return [".".concat(e.styledComponentId)];if(os(e)){if(!os(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 X5||M1(n)||n===null||console.error("".concat(Gg(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.")),Hi(n,t,o,r)}var i;return e instanceof X5?o?(e.inject(o,r),[e.getName(r)]):[e]:M1(e)?Xg(e):Array.isArray(e)?Array.prototype.concat.apply(xc,e.map(function(a){return Hi(a,t,o,r)})):[e.toString()]}function Rg(e){for(var t=0;t<e.length;t+=1){var o=e[t];if(os(o)&&!tu(o))return !1}return !0}var TF=Hg(b1),NF=function(){function e(t,o,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&Rg(t),this.componentId=o,this.baseHash=es(TF,o),this.baseStyle=r,Dm.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=ts(n,this.staticRulesId);else {var i=Fm(Hi(this.rules,t,o,r)),a=W5(es(this.baseHash,i)>>>0);if(!o.hasNameForId(this.componentId,a)){var s=r(i,".".concat(a),void 0,this.componentId);o.insertRules(this.componentId,a,s);}n=ts(n,a),this.staticRulesId=a;}else {for(var l=es(this.baseHash,r.hash),c="",p=0;p<this.rules.length;p++){var u=this.rules[p];if(typeof u=="string")c+=u,process.env.NODE_ENV!=="production"&&(l=es(l,u));else if(u){var f=Fm(Hi(u,t,o,r));l=es(l,f+p),c+=f;}}if(c){var g=W5(l>>>0);o.hasNameForId(this.componentId,g)||o.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),n=ts(n,g);}}return n},e}(),Cc=re.createContext(void 0);Cc.Consumer;function e9(e){var t=re.useContext(Cc),o=useMemo(function(){return function(r,n){if(!r)throw Zo(14);if(os(r)){var i=r(n);if(process.env.NODE_ENV!=="production"&&(i===null||Array.isArray(i)||typeof i!="object"))throw Zo(7);return i}if(Array.isArray(r)||typeof r!="object")throw Zo(8);return n?jt(jt({},n),r):r}(e.theme,t)},[e.theme,t]);return e.children?re.createElement(Cc.Provider,{value:o},e.children):null}var Z5={},Fg=new Set;function kF(e,t,o){var r=tu(e),n=e,i=!$5(e),a=t.attrs,s=a===void 0?xc:a,l=t.componentId,c=l===void 0?function(P,b){var I=typeof P!="string"?"sc":Tg(P);Z5[I]=(Z5[I]||0)+1;var T="".concat(I,"-").concat(jg(b1+I+Z5[I]));return b?"".concat(b,"-").concat(T):T}(t.displayName,t.parentComponentId):l,p=t.displayName,u=p===void 0?function(P){return $5(P)?"styled.".concat(P):"Styled(".concat(Gg(P),")")}(e):p,f=t.displayName&&t.componentId?"".concat(Tg(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&n.attrs?n.attrs.concat(s).filter(Boolean):s,y=t.shouldForwardProp;if(r&&n.shouldForwardProp){var h=n.shouldForwardProp;if(t.shouldForwardProp){var C=t.shouldForwardProp;y=function(P,b){return h(P,b)&&C(P,b)};}else y=h;}var v=new NF(o,f,r?n.componentStyle:void 0);function w(P,b){return function(I,T,N){var B=I.attrs,D=I.componentStyle,A=I.defaultProps,q=I.foldedComponentIds,$=I.styledComponentId,U=I.target,Q=re.useContext(Cc),G=J5(),L=I.shouldForwardProp||G.shouldForwardProp;process.env.NODE_ENV!=="production"&&useDebugValue($);var O=JB(T,Q,A)||I1,j=function(ee,pe,ce){for(var je,Lt=jt(jt({},pe),{className:void 0,theme:ce}),Te=0;Te<ee.length;Te+=1){var $o=os(je=ee[Te])?je(Lt):je;for(var po in $o)Lt[po]=po==="className"?ts(Lt[po],$o[po]):po==="style"?jt(jt({},Lt[po]),$o[po]):$o[po];}return pe.className&&(Lt.className=ts(Lt.className,pe.className)),Lt}(B,T,O),Z=j.as||U,K={};for(var E in j)j[E]===void 0||E[0]==="$"||E==="as"||E==="theme"&&j.theme===O||(E==="forwardedAs"?K.as=j.forwardedAs:L&&!L(E,Z)||(K[E]=j[E],L||process.env.NODE_ENV!=="development"||Ig(E)||Fg.has(E)||!q5.has(Z)||(Fg.add(E),console.warn('styled-components: it looks like an unknown prop "'.concat(E,'" 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 V=function(ee,pe){var ce=J5(),je=ee.generateAndInjectStyles(pe,ce.styleSheet,ce.stylis);return process.env.NODE_ENV!=="production"&&useDebugValue(je),je}(D,j);process.env.NODE_ENV!=="production"&&I.warnTooManyClasses&&I.warnTooManyClasses(V);var Y=ts(q,$);return V&&(Y+=" "+V),j.className&&(Y+=" "+j.className),K[$5(Z)&&!q5.has(Z)?"class":"className"]=Y,K.ref=N,createElement(Z,K)}(x,P,b)}w.displayName=u;var x=re.forwardRef(w);return x.attrs=g,x.componentStyle=v,x.displayName=u,x.shouldForwardProp=y,x.foldedComponentIds=r?ts(n.foldedComponentIds,n.styledComponentId):"",x.styledComponentId=f,x.target=r?n.target:e,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(P){this._foldedDefaultProps=r?function(b){for(var I=[],T=1;T<arguments.length;T++)I[T-1]=arguments[T];for(var N=0,B=I;N<B.length;N++)Y5(b,B[N],!0);return b}({},n.defaultProps,P):P;}}),process.env.NODE_ENV!=="production"&&(KB(u,f),x.warnTooManyClasses=function(P,b){var I={},T=!1;return function(N){if(!T&&(I[N]=!0,Object.keys(I).length>=200)){var B=b?' with the id of "'.concat(b,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(P).concat(B,`.
|
|
103
|
+
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function dF(){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 Zo(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(dF.apply(void 0,zi([mF[e]],t,!1)).trim())}var cF=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 Zo(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 s=this.indexOfGroup(t+1),l=(a=0,o.length);a<l;a++)this.tag.insertRule(s,o[a])&&(this.groupSizes[t]++,s++);},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(eu);return o},e}(),pF=1<<30,fc=new Map,hc=new Map,gc=1,cc=function(e){if(fc.has(e))return fc.get(e);for(;hc.has(gc);)gc++;var t=gc++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>pF))throw Zo(16,"".concat(t));return fc.set(e,t),hc.set(t,e),t},uF=function(e,t){gc=t+1,fc.set(e,t),hc.set(t,e);},fF="style[".concat(ii,"][").concat(yc,'="').concat(b1,'"]'),gF=new RegExp("^".concat(ii,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),yF=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);},hF=function(e,t){for(var o,r=((o=t.textContent)!==null&&o!==void 0?o:"").split(eu),n=[],i=0,a=r.length;i<a;i++){var s=r[i].trim();if(s){var l=s.match(gF);if(l){var c=0|parseInt(l[1],10),p=l[2];c!==0&&(uF(p,c),yF(e,p,l[3]),e.getTag().insertRules(c,n)),n.length=0;}else n.push(s);}}};function Q5(){return typeof __webpack_nonce__!="undefined"?__webpack_nonce__:null}var Yg=function(e){var t=document.head,o=e||t,r=document.createElement("style"),n=function(s){var l=Array.from(s.querySelectorAll("style[".concat(ii,"]")));return l[l.length-1]}(o),i=n!==void 0?n.nextSibling:null;r.setAttribute(ii,Ug),r.setAttribute(yc,b1);var a=Q5();return a&&r.setAttribute("nonce",a),o.insertBefore(r,i),r},CF=function(){function e(t){this.element=Yg(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 Zo(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}(),vF=function(){function e(t){this.element=Yg(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}(),xF=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}(),Lg=vc,bF={isServer:!vc,useCSSOMInjection:!QB},Dm=function(){function e(t,o,r){t===void 0&&(t=I1),o===void 0&&(o={});var n=this;this.options=jt(jt({},bF),t),this.gs=o,this.names=new Map(r),this.server=!!t.isServer,!this.server&&vc&&Lg&&(Lg=!1,function(i){for(var a=document.querySelectorAll(fF),s=0,l=a.length;s<l;s++){var c=a[s];c&&c.getAttribute(ii)!==Ug&&(hF(i,c),c.parentNode&&c.parentNode.removeChild(c));}}(this)),ou(this,function(){return function(i){for(var a=i.getTag(),s=a.length,l="",c=function(u){var f=function(v){return hc.get(v)}(u);if(f===void 0)return "continue";var g=i.names.get(f),y=a.getGroup(u);if(g===void 0||y.length===0)return "continue";var h="".concat(ii,".g").concat(u,'[id="').concat(f,'"]'),C="";g!==void 0&&g.forEach(function(v){v.length>0&&(C+="".concat(v,","));}),l+="".concat(y).concat(h,'{content:"').concat(C,'"}').concat(eu);},p=0;p<s;p++)c(p);return l}(n)});}return e.registerId=function(t){return cc(t)},e.prototype.reconstructWithOptions=function(t,o){return o===void 0&&(o=!0),new e(jt(jt({},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 xF(n):r?new CF(n):new vF(n)}(this.options),new cF(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(cc(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(cc(t),r);},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear();},e.prototype.clearRules=function(t){this.getTag().clearGroup(cc(t)),this.clearNames(t);},e.prototype.clearTag=function(){this.tag=void 0;},e}(),IF=/&/g,MF=/^\s*\/\/.*$/gm;function Qg(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=Qg(o.children,t)),o})}function Kg(e){var t,o,r,n=I1,i=n.options,a=i===void 0?I1:i,s=n.plugins,l=s===void 0?xc:s,c=function(f,g,y){return y.startsWith(o)&&y.endsWith(o)&&y.replaceAll(o,"").length>0?".".concat(t):f},p=l.slice();p.push(function(f){f.type===qo.RULESET&&f.value.includes("&")&&(f.props[0]=f.props[0].replace(IF,o).replace(r,c));}),a.prefix&&p.push(qo.prefixer),p.push(qo.stringify);var u=function(f,g,y,h){g===void 0&&(g=""),y===void 0&&(y=""),h===void 0&&(h="&"),t=h,o=g,r=new RegExp("\\".concat(o,"\\b"),"g");var C=f.replace(MF,""),v=qo.compile(y||g?"".concat(y," ").concat(g," { ").concat(C," }"):C);a.namespace&&(v=Qg(v,a.namespace));var w=[];return qo.serialize(v,qo.middleware(p.concat(qo.rulesheet(function(x){return w.push(x)})))),w};return u.hash=l.length?l.reduce(function(f,g){return g.name||Zo(15),es(f,g.name)},zg).toString():"",u}var wF=new Dm,K5=Kg(),ru=re.createContext({shouldForwardProp:void 0,styleSheet:wF,stylis:K5});ru.Consumer;re.createContext(void 0);function J5(){return useContext(ru)}var X5=function(){function e(t,o){var r=this;this.inject=function(n,i){i===void 0&&(i=K5);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,ou(this,function(){throw Zo(12,String(r.name))});}return e.prototype.getName=function(t){return t===void 0&&(t=K5),this.name+t.hash},e}(),_F=function(e){return e>="A"&&e<="Z"};function Bg(e){for(var t="",o=0;o<e.length;o++){var r=e[o];if(o===1&&r==="-"&&e[0]==="-")return e;_F(r)?t+="-"+r.toLowerCase():t+=r;}return t.startsWith("ms-")?"-"+t:t}var Jg=function(e){return e==null||e===!1||e===""},Xg=function(e){var t,o,r=[];for(var n in e){var i=e[n];e.hasOwnProperty(n)&&!Jg(i)&&(Array.isArray(i)&&i.isCss||os(i)?r.push("".concat(Bg(n),":"),i,";"):M1(i)?r.push.apply(r,zi(zi(["".concat(n," {")],Xg(i),!1),["}"],!1)):r.push("".concat(Bg(n),": ").concat((t=n,(o=i)==null||typeof o=="boolean"||o===""?"":typeof o!="number"||o===0||t in Pg||t.startsWith("--")?String(o).trim():"".concat(o,"px")),";")));}return r};function Hi(e,t,o,r){if(Jg(e))return [];if(tu(e))return [".".concat(e.styledComponentId)];if(os(e)){if(!os(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 X5||M1(n)||n===null||console.error("".concat(Gg(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.")),Hi(n,t,o,r)}var i;return e instanceof X5?o?(e.inject(o,r),[e.getName(r)]):[e]:M1(e)?Xg(e):Array.isArray(e)?Array.prototype.concat.apply(xc,e.map(function(a){return Hi(a,t,o,r)})):[e.toString()]}function Rg(e){for(var t=0;t<e.length;t+=1){var o=e[t];if(os(o)&&!tu(o))return !1}return !0}var TF=Hg(b1),NF=function(){function e(t,o,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&Rg(t),this.componentId=o,this.baseHash=es(TF,o),this.baseStyle=r,Dm.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=ts(n,this.staticRulesId);else {var i=Fm(Hi(this.rules,t,o,r)),a=W5(es(this.baseHash,i)>>>0);if(!o.hasNameForId(this.componentId,a)){var s=r(i,".".concat(a),void 0,this.componentId);o.insertRules(this.componentId,a,s);}n=ts(n,a),this.staticRulesId=a;}else {for(var l=es(this.baseHash,r.hash),c="",p=0;p<this.rules.length;p++){var u=this.rules[p];if(typeof u=="string")c+=u,process.env.NODE_ENV!=="production"&&(l=es(l,u));else if(u){var f=Fm(Hi(u,t,o,r));l=es(l,f+p),c+=f;}}if(c){var g=W5(l>>>0);o.hasNameForId(this.componentId,g)||o.insertRules(this.componentId,g,r(c,".".concat(g),void 0,this.componentId)),n=ts(n,g);}}return n},e}(),Cc=re.createContext(void 0);Cc.Consumer;function e9(e){var t=re.useContext(Cc),o=useMemo(function(){return function(r,n){if(!r)throw Zo(14);if(os(r)){var i=r(n);if(process.env.NODE_ENV!=="production"&&(i===null||Array.isArray(i)||typeof i!="object"))throw Zo(7);return i}if(Array.isArray(r)||typeof r!="object")throw Zo(8);return n?jt(jt({},n),r):r}(e.theme,t)},[e.theme,t]);return e.children?re.createElement(Cc.Provider,{value:o},e.children):null}var Z5={},Fg=new Set;function kF(e,t,o){var r=tu(e),n=e,i=!$5(e),a=t.attrs,s=a===void 0?xc:a,l=t.componentId,c=l===void 0?function(P,b){var I=typeof P!="string"?"sc":Tg(P);Z5[I]=(Z5[I]||0)+1;var T="".concat(I,"-").concat(jg(b1+I+Z5[I]));return b?"".concat(b,"-").concat(T):T}(t.displayName,t.parentComponentId):l,p=t.displayName,u=p===void 0?function(P){return $5(P)?"styled.".concat(P):"Styled(".concat(Gg(P),")")}(e):p,f=t.displayName&&t.componentId?"".concat(Tg(t.displayName),"-").concat(t.componentId):t.componentId||c,g=r&&n.attrs?n.attrs.concat(s).filter(Boolean):s,y=t.shouldForwardProp;if(r&&n.shouldForwardProp){var h=n.shouldForwardProp;if(t.shouldForwardProp){var C=t.shouldForwardProp;y=function(P,b){return h(P,b)&&C(P,b)};}else y=h;}var v=new NF(o,f,r?n.componentStyle:void 0);function w(P,b){return function(I,T,N){var B=I.attrs,D=I.componentStyle,A=I.defaultProps,q=I.foldedComponentIds,$=I.styledComponentId,U=I.target,Q=re.useContext(Cc),G=J5(),L=I.shouldForwardProp||G.shouldForwardProp;process.env.NODE_ENV!=="production"&&useDebugValue($);var O=JB(T,Q,A)||I1,j=function(ee,pe,ce){for(var je,Lt=jt(jt({},pe),{className:void 0,theme:ce}),Ne=0;Ne<ee.length;Ne+=1){var $o=os(je=ee[Ne])?je(Lt):je;for(var po in $o)Lt[po]=po==="className"?ts(Lt[po],$o[po]):po==="style"?jt(jt({},Lt[po]),$o[po]):$o[po];}return pe.className&&(Lt.className=ts(Lt.className,pe.className)),Lt}(B,T,O),Z=j.as||U,K={};for(var E in j)j[E]===void 0||E[0]==="$"||E==="as"||E==="theme"&&j.theme===O||(E==="forwardedAs"?K.as=j.forwardedAs:L&&!L(E,Z)||(K[E]=j[E],L||process.env.NODE_ENV!=="development"||Ig(E)||Fg.has(E)||!q5.has(Z)||(Fg.add(E),console.warn('styled-components: it looks like an unknown prop "'.concat(E,'" 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 V=function(ee,pe){var ce=J5(),je=ee.generateAndInjectStyles(pe,ce.styleSheet,ce.stylis);return process.env.NODE_ENV!=="production"&&useDebugValue(je),je}(D,j);process.env.NODE_ENV!=="production"&&I.warnTooManyClasses&&I.warnTooManyClasses(V);var Y=ts(q,$);return V&&(Y+=" "+V),j.className&&(Y+=" "+j.className),K[$5(Z)&&!q5.has(Z)?"class":"className"]=Y,K.ref=N,createElement(Z,K)}(x,P,b)}w.displayName=u;var x=re.forwardRef(w);return x.attrs=g,x.componentStyle=v,x.displayName=u,x.shouldForwardProp=y,x.foldedComponentIds=r?ts(n.foldedComponentIds,n.styledComponentId):"",x.styledComponentId=f,x.target=r?n.target:e,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(P){this._foldedDefaultProps=r?function(b){for(var I=[],T=1;T<arguments.length;T++)I[T-1]=arguments[T];for(var N=0,B=I;N<B.length;N++)Y5(b,B[N],!0);return b}({},n.defaultProps,P):P;}}),process.env.NODE_ENV!=="production"&&(KB(u,f),x.warnTooManyClasses=function(P,b){var I={},T=!1;return function(N){if(!T&&(I[N]=!0,Object.keys(I).length>=200)){var B=b?' with the id of "'.concat(b,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(P).concat(B,`.
|
|
104
104
|
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
|
|
105
105
|
Example:
|
|
106
106
|
const Component = styled.div.attrs(props => ({
|
|
@@ -1693,7 +1693,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[pc]+=1);var bc=`url("data:ima
|
|
|
1693
1693
|
margin-left: 12px;
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
|
-
`,yb=()=>re.createElement(re.Fragment,null,re.createElement("div",null,re.createElement(he,{style:{fontSize:8,maxWidth:374}})),re.createElement("div",null,re.createElement(he,{style:{fontSize:8,maxWidth:448}})),re.createElement("div",{style:{paddingBottom:50}},re.createElement(he,{style:{fontSize:8,maxWidth:279}})));var J$=e=>{let[t,o]=useState(!1),{currentUserId:r}=oe(),n=(e==null?void 0:e.postId)||void 0,i=useMemo(()=>(e==null?void 0:e.creatorId)===r,[e,r]),{data:a,isLoading:s,refetch:l}=useQuery({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",n],queryFn:()=>PostRepository.isPostFlaggedByMe(n),enabled:e!=null});useEffect(()=>{a!=null&&o(a);},[a]);let c=()=>S(void 0,null,function*(){if(!(n==null||i))try{yield PostRepository.flagPost(n);}catch(f){o(!1);}finally{l();}}),p=()=>S(void 0,null,function*(){if(!(n==null||i))try{yield PostRepository.unflagPost(n);}catch(f){o(!0);}finally{l();}});return {isLoading:s,isFlaggedByMe:t,isUnableToFlag:i,flagPost:c,unflagPost:p,toggleFlagPost:()=>S(void 0,null,function*(){n==null||i||(t?p():c());})}},hb=J$;var eZ=8,tZ=3,oZ="Post has been reviewed",rZ=({childrenPosts:e=[],handleDeletePost:t,handleReportPost:o,handleUnreportPost:r,handleClosePoll:n,isPollClosed:i,post:a,onEditPostClick:s,onClose:l,buttonContainerHeight:c})=>{let{formatMessage:p}=useIntl(),{info:u,confirm:f}=xe(),g=ve(),{isFlaggedByMe:y,toggleFlagPost:h}=hb(a),C=a==null?void 0:a.targetId,v=it(C),{currentUserId:w}=oe(),x=useRef(null),{currentPosition:P,align:b,scrollableHeight:I}=r0({dropdownRef:x,buttonContainerHeight:c,position:an,align:V1}),{canEdit:T,canReview:N,canDelete:B,canReport:D,isPostUnderReview:A}=g2({community:v,post:a,childrenPosts:e,userId:w||void 0}),q=e.find(L=>L.dataType==="poll"),$=()=>S(void 0,null,function*(){h(),yield o==null?void 0:o(),g.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});}),U=()=>S(void 0,null,function*(){h(),yield r==null?void 0:r(),g.success({content:re.createElement(FormattedMessage,{id:"report.unreportSent"})});}),Q=()=>{f({title:p({id:"post.deletePost"}),content:p({id:A?"post.confirmPendingDelete":"post.confirmDelete"}),okText:p({id:"delete"}),onOk:()=>t==null?void 0:t(a==null?void 0:a.postId)});},G=[T?{name:p({id:"post.editPost"}),action:()=>s()}:null,B?{name:p({id:"post.deletePost"}),action:Q}:null,D?{name:p(y?{id:"report.undoReport"}:{id:"report.doReport"}),action:y?U:$}:null,q&&!i?{name:p({id:"poll.close"}),action:n}:null].filter(Ze);return re.createElement(ub,{ref:x},re.createElement(z1,null,re.createElement(H1,{position:P,align:b,scrollableHeight:I},G.map(({name:L,action:O})=>re.createElement(Z1,{key:L,"data-qa-anchor":`post-options-button-${L}`,onClick:()=>{O==null||O(),l();}},L)))))},nZ=e=>{var K,E,V;let{childrenPosts:t=[],className:o,handleApprovePost:r,handleDeclinePost:n,hidePostTarget:i,readonly:a,post:s,loading:l}=e,{formatMessage:c}=useIntl(),[p,u]=useState(!1),f=()=>u(!0),g=()=>u(!1),{info:y,confirm:h}=xe(),C=ve(),[v,w]=useState(!1),[x,P]=U1(),[b,I]=useState(!1),[T,N]=useState(!1),B=()=>w(Y=>!Y);useEffect(()=>(v?document.addEventListener("click",B):document.removeEventListener("click",B),()=>{document.removeEventListener("click",B);}),[v]);function D(Y){if(Y instanceof Error)if(Y.message.includes(oZ))y({title:re.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:re.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw Y}let A=s==null?void 0:s.targetId,q=it(A),{currentUserId:$}=oe(),{canReview:U,isPostUnderReview:Q}=g2({community:q,post:s,childrenPosts:t,userId:$||void 0}),G=()=>S(void 0,null,function*(){try{I(!0),yield r==null?void 0:r(),C.success({content:re.createElement(FormattedMessage,{id:"post.success.approved"})});}catch(Y){D(Y);}finally{I(!1);}}),L=()=>S(void 0,null,function*(){try{N(!0),yield n==null?void 0:n(),C.success({content:re.createElement(FormattedMessage,{id:"post.success.declined"})});}catch(Y){D(Y);}finally{N(!1);}}),O=t.length>0,j=O?tZ:eZ,Z=t.find(Y=>Y.dataType==="liveStream");return re.createElement(h2,{"data-qa-anchor":"post",className:o},re.createElement(fb,null,re.createElement(ib,{postId:s==null?void 0:s.postId,hidePostTarget:i,loading:l}),!l&&re.createElement(pb,null,re.createElement("div",{ref:x},re.createElement($1,{onClick:Y=>{Y.stopPropagation(),B();},className:o},re.createElement(G1,null))),v&&re.createElement(rZ,k(m({},e),{onApprove:G,onDecline:L,onClose:B,onEditPostClick:()=>f(),buttonContainerHeight:P})))),l?re.createElement(yb,null):re.createElement(re.Fragment,null,re.createElement(cb,{data:(K=Z==null?void 0:Z.data)!=null?K:s==null?void 0:s.data,dataType:(E=Z==null?void 0:Z.dataType)!=null?E:s==null?void 0:s.dataType,postMaxLines:j,mentionees:(V=s==null?void 0:s.metadata)==null?void 0:V.mentioned}),O&&re.createElement(Ax,{contents:t}),!Q&&re.createElement(j4,{readonly:a,postId:s==null?void 0:s.postId}),Q&&U&&re.createElement(gb,{"data-qa-anchor":"post-review"},re.createElement(ue,{"data-qa-anchor":"post-review-accept-button",disabled:b||T,onClick:G},re.createElement(FormattedMessage,{id:"general.action.accept"})),re.createElement(J,{"data-qa-anchor":"post-review-decline-button",disabled:b||T,onClick:L},re.createElement(FormattedMessage,{id:"general.action.decline"}))),p&&re.createElement(Gt,{"data-qa-anchor":"post-editor-modal",title:c({id:"post.editPost"}),onCancel:g},re.createElement(qx,{postId:s==null?void 0:s.postId,onSave:g}))))},Jo=re.memo(nZ);var vb=d.div`
|
|
1696
|
+
`,yb=()=>re.createElement(re.Fragment,null,re.createElement("div",null,re.createElement(he,{style:{fontSize:8,maxWidth:374}})),re.createElement("div",null,re.createElement(he,{style:{fontSize:8,maxWidth:448}})),re.createElement("div",{style:{paddingBottom:50}},re.createElement(he,{style:{fontSize:8,maxWidth:279}})));var J$=e=>{let[t,o]=useState(!1),{currentUserId:r}=oe(),n=(e==null?void 0:e.postId)||void 0,i=useMemo(()=>(e==null?void 0:e.creatorId)===r,[e,r]),{data:a,isLoading:s,refetch:l}=useQuery({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",n],queryFn:()=>PostRepository.isPostFlaggedByMe(n),enabled:e!=null});useEffect(()=>{a!=null&&o(a);},[a]);let c=()=>S(void 0,null,function*(){if(!(n==null||i))try{yield PostRepository.flagPost(n);}catch(f){o(!1);}finally{l();}}),p=()=>S(void 0,null,function*(){if(!(n==null||i))try{yield PostRepository.unflagPost(n);}catch(f){o(!0);}finally{l();}});return {isLoading:s,isFlaggedByMe:t,isUnableToFlag:i,flagPost:c,unflagPost:p,toggleFlagPost:()=>S(void 0,null,function*(){n==null||i||(t?p():c());})}},hb=J$;var eZ=8,tZ=3,oZ="Post has been reviewed",rZ=({childrenPosts:e=[],handleDeletePost:t,handleReportPost:o,handleUnreportPost:r,handleClosePoll:n,isPollClosed:i,post:a,onEditPostClick:s,onClose:l,buttonContainerHeight:c})=>{let{formatMessage:p}=useIntl(),{info:u,confirm:f}=xe(),g=ve(),{isFlaggedByMe:y,toggleFlagPost:h}=hb(a),C=a==null?void 0:a.targetId,v=it(C),{currentUserId:w}=oe(),x=useRef(null),{currentPosition:P,align:b,scrollableHeight:I}=r0({dropdownRef:x,buttonContainerHeight:c,position:an,align:V1}),{canEdit:T,canReview:N,canDelete:B,canReport:D,isPostUnderReview:A}=g2({community:v,post:a,childrenPosts:e,userId:w||void 0}),q=e.find(L=>L.dataType==="poll"),$=()=>S(void 0,null,function*(){h(),yield o==null?void 0:o(),g.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});}),U=()=>S(void 0,null,function*(){h(),yield r==null?void 0:r(),g.success({content:re.createElement(FormattedMessage,{id:"report.unreportSent"})});}),Q=()=>{f({title:p({id:"post.deletePost"}),content:p({id:A?"post.confirmPendingDelete":"post.confirmDelete"}),okText:p({id:"delete"}),onOk:()=>t==null?void 0:t(a==null?void 0:a.postId)});},G=[T?{name:p({id:"post.editPost"}),action:()=>s()}:null,B?{name:p({id:"post.deletePost"}),action:Q}:null,D?{name:p(y?{id:"report.undoReport"}:{id:"report.doReport"}),action:y?U:$}:null,q&&!i?{name:p({id:"poll.close"}),action:n}:null].filter(Ze);return re.createElement(ub,{ref:x},re.createElement(z1,null,re.createElement(H1,{position:P,align:b,scrollableHeight:I},G.map(({name:L,action:O})=>re.createElement(Z1,{key:L,"data-qa-anchor":`post-options-button-${L}`,onClick:()=>{O==null||O(),l();}},L)))))},nZ=e=>{var K,E,V;let{childrenPosts:t=[],className:o,handleApprovePost:r,handleDeclinePost:n,hidePostTarget:i,readonly:a,post:s,loading:l}=e,{formatMessage:c}=useIntl(),[p,u]=useState(!1),f=()=>u(!0),g=()=>u(!1),{info:y,confirm:h}=xe(),C=ve(),[v,w]=useState(!1),[x,P]=U1(),[b,I]=useState(!1),[T,N]=useState(!1),B=()=>w(Y=>!Y);useEffect(()=>(v?document.addEventListener("click",B):document.removeEventListener("click",B),()=>{document.removeEventListener("click",B);}),[v]);function D(Y){if(Y instanceof Error)if(Y.message.includes(oZ))y({title:re.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:re.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw Y}let A=s==null?void 0:s.targetId,q=it(A),{currentUserId:$}=oe(),{canReview:U,isPostUnderReview:Q}=g2({community:q,post:s,childrenPosts:t,userId:$||void 0}),G=()=>S(void 0,null,function*(){try{I(!0),yield r==null?void 0:r(),C.success({content:re.createElement(FormattedMessage,{id:"post.success.approved"})});}catch(Y){D(Y);}finally{I(!1);}}),L=()=>S(void 0,null,function*(){try{N(!0),yield n==null?void 0:n(),C.success({content:re.createElement(FormattedMessage,{id:"post.success.declined"})});}catch(Y){D(Y);}finally{N(!1);}}),O=t.length>0,j=O?tZ:eZ,Z=t.find(Y=>Y.dataType==="liveStream");return re.createElement("div",{style:{marginTop:8}},re.createElement(h2,{"data-qa-anchor":"post",className:o},re.createElement(fb,null,re.createElement(ib,{postId:s==null?void 0:s.postId,hidePostTarget:i,loading:l}),!l&&re.createElement(pb,null,re.createElement("div",{ref:x},re.createElement($1,{onClick:Y=>{Y.stopPropagation(),B();},className:o},re.createElement(G1,null))),v&&re.createElement(rZ,k(m({},e),{onApprove:G,onDecline:L,onClose:B,onEditPostClick:()=>f(),buttonContainerHeight:P})))),l?re.createElement(yb,null):re.createElement(re.Fragment,null,re.createElement(cb,{data:(K=Z==null?void 0:Z.data)!=null?K:s==null?void 0:s.data,dataType:(E=Z==null?void 0:Z.dataType)!=null?E:s==null?void 0:s.dataType,postMaxLines:j,mentionees:(V=s==null?void 0:s.metadata)==null?void 0:V.mentioned}),O&&re.createElement(Ax,{contents:t}),!Q&&re.createElement(j4,{readonly:a,postId:s==null?void 0:s.postId}),Q&&U&&re.createElement(gb,{"data-qa-anchor":"post-review"},re.createElement(ue,{"data-qa-anchor":"post-review-accept-button",disabled:b||T,onClick:G},re.createElement(FormattedMessage,{id:"general.action.accept"})),re.createElement(J,{"data-qa-anchor":"post-review-decline-button",disabled:b||T,onClick:L},re.createElement(FormattedMessage,{id:"general.action.decline"}))),p&&re.createElement(Gt,{"data-qa-anchor":"post-editor-modal",title:c({id:"post.editPost"}),onCancel:g},re.createElement(qx,{postId:s==null?void 0:s.postId,onSave:g})))))},Jo=re.memo(nZ);var vb=d.div`
|
|
1697
1697
|
color: ${({theme:e})=>e.palette.base.shade3};
|
|
1698
1698
|
display: flex;
|
|
1699
1699
|
align-items: center;
|
|
@@ -2079,7 +2079,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[pc]+=1);var bc=`url("data:ima
|
|
|
2079
2079
|
background: none;
|
|
2080
2080
|
border: none;
|
|
2081
2081
|
padding: 0;
|
|
2082
|
-
`;d(fu)``;var Uq=({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,s=>{r(s.data);})),a.current=UserRepository.getUser(e,s=>{i(s.data);}),()=>{var s;(s=a.current)==null||s.call(a);}},[e,t]),{community:o,user:n}},zq=10,Hq=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:s,onCreateSuccess:l,maxFiles:c=zq})=>{var ni,Ra;let{currentUserId:p}=oe(),{setNavigationBlocker:u}=X(),f=ie(p),{info:g}=xe(),y=ve();(t==="global"||t==="myFeed")&&(t="user",o=p||"");let[h,C]=useState({targetType:t,targetId:o}),{user:v,community:w}=Uq({targetId:h.targetId,targetType:h.targetType}),{moderators:x}=pi(w==null?void 0:w.communityId);useEffect(()=>{C({targetType:t,targetId:o});},[t,o]);let P=R({fileId:(v==null?void 0:v.avatarFileId)||(w==null?void 0:w.avatarFileId)||""}),[b,I]=useState([]),[T,N]=useState([]),[B,D]=useState([]),[A,q]=useState([]),[$,U]=useState([]),[Q,G]=useState([]),[L,O]=useState(!1),[j]=Nb(),{mentionees:Z,metadata:K,text:E,markup:V,onChange:Y,queryMentionees:ee,clearAll:pe}=Ar({targetType:h.targetType,targetId:h.targetId||void 0}),[ce,je]=useState(!1),Lt=()=>{g({title:re.createElement(FormattedMessage,{id:"postCreator.unableToPost"}),content:re.createElement(FormattedMessage,{id:"postCreator.overCharacter"}),okText:re.createElement(FormattedMessage,{id:"postCreator.done"}),type:"info"});};function
|
|
2082
|
+
`;d(fu)``;var Uq=({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,s=>{r(s.data);})),a.current=UserRepository.getUser(e,s=>{i(s.data);}),()=>{var s;(s=a.current)==null||s.call(a);}},[e,t]),{community:o,user:n}},zq=10,Hq=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:s,onCreateSuccess:l,maxFiles:c=zq})=>{var ni,Ra;let{currentUserId:p}=oe(),{setNavigationBlocker:u}=X(),f=ie(p),{info:g}=xe(),y=ve();(t==="global"||t==="myFeed")&&(t="user",o=p||"");let[h,C]=useState({targetType:t,targetId:o}),{user:v,community:w}=Uq({targetId:h.targetId,targetType:h.targetType}),{moderators:x}=pi(w==null?void 0:w.communityId);useEffect(()=>{C({targetType:t,targetId:o});},[t,o]);let P=R({fileId:(v==null?void 0:v.avatarFileId)||(w==null?void 0:w.avatarFileId)||""}),[b,I]=useState([]),[T,N]=useState([]),[B,D]=useState([]),[A,q]=useState([]),[$,U]=useState([]),[Q,G]=useState([]),[L,O]=useState(!1),[j]=Nb(),{mentionees:Z,metadata:K,text:E,markup:V,onChange:Y,queryMentionees:ee,clearAll:pe}=Ar({targetType:h.targetType,targetId:h.targetId||void 0}),[ce,je]=useState(!1),Lt=()=>{g({title:re.createElement(FormattedMessage,{id:"postCreator.unableToPost"}),content:re.createElement(FormattedMessage,{id:"postCreator.overCharacter"}),okText:re.createElement(FormattedMessage,{id:"postCreator.done"}),type:"info"});};function Ne(We){return S(this,null,function*(){if(h.targetId)try{je(!0);let eo=(yield PostRepository.createPost(We)).data;if(l==null||l(eo),pe(),I([]),N([]),D([]),q([]),U([]),G([]),w){let Ae=(x||[]).find(fo=>fo.userId===eo.postedUserId)!=null;w.postSetting===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED&&!Ae&&y.success({content:re.createElement(FormattedMessage,{id:"post.success.submittedToReview"})});}}catch(Re){Re instanceof Error&&Re.message===Yi.CONTAIN_BLOCKED_WORD&&y.error({content:re.createElement(FormattedMessage,{id:"notification.error.blockedWord"})});}finally{je(!1);}})}function $o(){return S(this,null,function*(){var Ae;if(!h.targetId)return;let We={},Re=[];if(E&&(We.text=E),b.length&&Re.push(...b.map(fo=>({fileId:fo.fileId,type:FileType.IMAGE}))),T.length&&Re.push(...T.map(fo=>({fileId:fo.fileId,type:FileType.VIDEO}))),B.length&&Re.push(...B.map(fo=>({fileId:fo.fileId,type:FileType.FILE}))),(Ae=We.text)!=null&&Ae.length&&We.text.length>5e4){Lt();return}let eo={targetId:h.targetId,targetType:h.targetType,data:We,dataType:"text",attachments:Re,metadata:K,mentionees:Z};return Ne(eo)})}let po=()=>{y.info({content:re.createElement(FormattedMessage,{id:"upload.attachmentLimit",values:{maxFiles:c}})});},Ja=()=>{y.info({content:re.createElement(FormattedMessage,{id:"upload.fileSizeLimit"})});},Xa=h.targetType==="community"?Wo:Ge,en=re.createElement(zI,{avatar:(v==null?void 0:v.avatarCustomUrl)||P||void 0,backgroundImage:Xa}),Sn=!E&&b.length===0&&T.length===0&&B.length===0||L||ce,ri=!(!E&&b.length===0&&T.length===0&&B.length===0);useEffect(()=>{ri?u==null||u({title:re.createElement(FormattedMessage,{id:"post.discard.title"}),content:re.createElement(FormattedMessage,{id:"post.discard.content"}),okText:re.createElement(FormattedMessage,{id:"general.action.discard"}),onOk:()=>{pe(),I([]),N([]),D([]),q([]),U([]),G([]),u==null||u(null);}}):u==null||u(null);},[ri,u]);let [ye,ft]=useState(!1),ko=(ni=h==null?void 0:h.targetType)!=null?ni:t,uo=(Ra=h==null?void 0:h.targetId)!=null?Ra:o;return re.createElement(HI,{className:Kn("postComposeBar",e)},ye&&re.createElement(_I,{targetId:uo||void 0,targetType:ko,onCreatePoll:(We,Re,eo,Ae)=>S(void 0,null,function*(){uo&&Ne({targetId:uo,targetType:ko,data:{pollId:We,text:Re},dataType:"poll",mentionees:eo,metadata:Ae});}),onClose:()=>ft(!1)}),r&&f?re.createElement(EI,{user:f,communities:n,hasMoreCommunities:a,loadMoreCommunities:s,currentTargetId:h.targetId,onChange:C},en):en,re.createElement(GI,null,re.createElement(qI,{"data-qa-anchor":"post-creator-textarea",multiline:!0,value:V,placeholder:i,mentionAllowed:!0,queryMentionees:ee,loadMoreMentionees:We=>ee(We),append:re.createElement(ZI,null,re.createElement(VI,{files:A,uploadedFiles:b,uploadLoading:L,onLoadingChange:O,onChange:({uploaded:We,uploading:Re})=>{I(We),q(Re);},onError:j}),re.createElement(UI,{files:$,uploadedFiles:T,uploadLoading:L,onLoadingChange:O,onChange:({uploaded:We,uploading:Re})=>{N(We),U(Re);},onError:j}),re.createElement(A0,{files:Q,uploadedFiles:B,uploadLoading:L,onLoadingChange:O,onChange:({uploaded:We,uploading:Re})=>{D(We),G(Re);},onError:j})),onChange:({text:We,plainText:Re,mentions:eo})=>{if((eo==null?void 0:eo.length)>30)return g({title:re.createElement(FormattedMessage,{id:"postCreator.unableToMention"}),content:re.createElement(FormattedMessage,{id:"postCreator.overMentionees"}),okText:re.createElement(FormattedMessage,{id:"postCreator.okText"}),type:"info"});Y({text:We,plainText:Re,mentions:eo});}}),re.createElement(jI,{"data-qa-anchor":"post-creator-footer"},re.createElement(BI,{imageUploadDisabled:B.length>0||T.length>0||L,videoUploadDisabled:B.length>0||b.length>0||L,fileUploadDisabled:b.length>0||T.length>0||L,fileLimitRemaining:c-B.length-b.length-T.length,uploadLoading:L,onChangeImages:We=>q(We),onChangeVideos:U,onChangeFiles:G,onMaxFilesLimit:po,onFileSizeLimit:Ja}),re.createElement($I,{disabled:Sn,"data-qa-anchor":"post-creator-post-button",onClick:$o},re.createElement(FormattedMessage,{id:"post"})))))},P2=memo(Hq);var $q=({postId:e,className:t,hidePostTarget:o,readonly:r,onDeleted:n})=>{var x;let i=Yo(e),a=ie(i==null?void 0:i.postedUserId),s=R({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"}),l=ta(i==null?void 0:i.children),{userRoles:c}=oe(),p=Sb(i==null?void 0:i.dataType),{currentUserId:u}=oe(),f=(l||[]).find(P=>P.dataType==="poll"),g=C0((x=f==null?void 0:f.data)==null?void 0:x.pollId),y=(g==null?void 0:g.status)==="closed",h=()=>S(void 0,null,function*(){g!=null&&(yield PollRepository.closePoll(g.pollId));}),C=()=>S(void 0,null,function*(){i!=null&&(yield PostRepository.deletePost(i.postId),n==null||n(i.postId));}),v=()=>S(void 0,null,function*(){i!=null&&(yield PostRepository.approvePost(i.postId));}),w=()=>S(void 0,null,function*(){i!=null&&(yield PostRepository.declinePost(i.postId));});return i==null||p==null?re.createElement(Jo,{loading:!0}):re.createElement(re.Fragment,null,p({childrenPosts:l||[],handleClosePoll:h,isPollClosed:y,avatarFileUrl:s,user:a,poll:g,className:t,currentUserId:u||void 0,hidePostTarget:o,post:i,userRoles:c,readonly:r,handleApprovePost:v,handleDeclinePost:w,handleDeletePost:C}))},S2=memo(e=>{let t=H("Post");return t?t(e):re.createElement($q,m({},e))});var Zq=d(Gu).attrs({width:48,height:48})`
|
|
2083
2083
|
margin: 10px;
|
|
2084
2084
|
`,qq=d(J)`
|
|
2085
2085
|
font-size: 14px;
|
|
@@ -3784,7 +3784,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[pc]+=1);var bc=`url("data:ima
|
|
|
3784
3784
|
}
|
|
3785
3785
|
`,HN=d.svg`
|
|
3786
3786
|
animation: ${lae} 2s linear infinite;
|
|
3787
|
-
`;var Ai=e=>re.createElement(HN,m({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"}));function pae(e){return e.fileId!==void 0}function Ad({files:e=[],uploadedFiles:t=[],onChange:o=i=>{},onLoadingChange:r=i=>{},onError:n=i=>{}}){let[i,a]=useState([]),s=useMemo(()=>Array.isArray(e)?e:Array.from(e),[e]),l=useCallback(()=>{o({uploaded:[],uploading:[]});},[o]),c=useCallback(()=>{a([]);},[]),p=useCallback((f,g)=>{if(pae(f)){let y=t.filter(h=>h.fileId!==f.fileId);o({uploaded:y,uploading:s});}else if(g!==void 0){let y=t.filter((h,C)=>C!==g);o({uploaded:y,uploading:s});}else {let y=s.filter(h=>h.name!==f.name);o({uploaded:t,uploading:y});}},[o,t,s]);return useEffect(()=>{if(!s.length)return;function f(){return S(this,null,function*(){r(!0);try{let g=yield Promise.all(s.map(h=>S(this,null,function*(){let C=new FormData;C.append("files",h);let v=yield S(this,null,function*(){if(h.type.includes(FileType.IMAGE))return FileRepository.createImage(C);if(h.type.includes(FileType.VIDEO))return FileRepository.createVideo(C)});return v&&v.data.length>0?v.data[0]:null}))),y=[...t,...g].filter(Ze);o({uploaded:y,uploading:[]}),a([]);}catch(g){a(s.map(y=>y.name)),n(!0);}finally{r(!1);}})}f();},[s]),{allFiles:[...t,...s],uploading:s,uploaded:t,removeFile:p,reset:l,rejected:i,retry:c}}function g7({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,uploadLoading:n,onError:i,isErrorUpload:a}){let s=Ad({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,onError:i}),{allFiles:l,removeFile:c}=s;return l.length===0?null:l&&re.createElement("div",{"data-images-amount":Math.min(l.length,3),className:s1.thumbnail__container},l==null?void 0:l.map((p,u)=>{var f;return re.createElement("div",{key:u,"data-images-height":l.length>2,className:s1.thumbnail__wrapper},n?re.createElement("div",{className:s1.icon__status},re.createElement(Ai,null)):a?re.createElement("div",{className:s1.icon__status},re.createElement(Ft,null)):re.createElement(re.Fragment,null,re.createElement("img",{className:s1.thumbnail,src:FileRepository.fileUrlWithSize(p==null?void 0:p.fileUrl,"medium"),alt:(f=p.attributes)==null?void 0:f.name}),re.createElement("button",{type:"reset",onClick:()=>c(p)},re.createElement(ho,{className:s1.closeIcon}))))}))}var Li={thumbnail__container:"p",thumbnail__wrapper:"jl",thumbnail__wrapper_item_3:"zl",thumbnail:"Xl",closeIcon:"Yl",icon__status:"Al",playIcon:"Cl"};var y7=({files:e,uploadedFiles:t,onLoadingChange:o,onChange:r,uploadLoading:n,onError:i,videoThumbnail:a,removeThumbnail:s,isErrorUpload:l})=>{let c=Ad({files:e,uploadedFiles:t,onChange:r,onLoadingChange:o,onError:i}),{allFiles:p,removeFile:u}=c;if(p.length===0)return null;let f=(g,y)=>{u(g,y),s(y);};return a?re.createElement("div",{"data-images-amount":Math.min(a.length,3),className:Li.thumbnail__container},a==null?void 0:a.map((g,y)=>re.createElement("div",{key:g.videoUrl,className:Kn(Li.thumbnail__wrapper,a.length>2&&Li.thumbnail__wrapper_item_3)},n?re.createElement("div",{className:Li.icon__status},re.createElement(Ai,null)):l?re.createElement("div",{className:Li.icon__status},re.createElement(Ft,null)):re.createElement(re.Fragment,null,re.createElement("img",{className:Li.thumbnail,src:g.thumbnail}),re.createElement("button",{type:"reset",onClick:()=>{f(g.file,y);}},re.createElement(ho,{className:Li.closeIcon})),re.createElement("div",{className:Li.playIcon},re.createElement(yo,null)))))):null};function x7({community:e,targetType:t,targetId:o}){let r="post_composer_page",{themeStyles:n}=tt({pageId:r}),i="6.75rem",a="8.5rem",s="11rem",l="14.5rem",c=useRef(null),{AmityPostComposerPageBehavior:p}=At(),{confirm:u}=$e(),[f,g]=useState(i),[y]=useState(!0),h=useRef(null),{prependItem:C}=za(),[v,w]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),[x,P]=useState([]),[b,I]=useState([]),[T,N]=useState([]),[B,D]=useState([]),[A,q]=useState(!1),[$,U]=useState([]),[Q,G]=useState(!1),[L,O]=useState(!0),[j,Z]=useState(!0),[K,E]=useState(!1),[V,Y]=useState([]),ee=useRef(null),pe=()=>useMutation({mutationFn:ye=>S(this,null,function*(){return PostRepository.createPost(ye)}),onSuccess:ye=>{var ft;(ft=p==null?void 0:p.goToSocialHomePage)==null||ft.call(p),C(ye.data);},onError:ye=>{console.error("Failed to create post",ye);}}),{mutateAsync:ce,isPending:je,isError:Lt}=pe(),{handleSubmit:Te}=useForm(),$o=()=>{let ye=x.map(ko=>({type:"image",fileId:ko.fileId})),ft=b.map(ko=>({type:"video",fileId:ko.fileId})),_n=[...ye,...ft];ce({targetId:o,targetType:t,data:{text:v.text},dataType:"text",metadata:{mentioned:v.mentioned},mentionees:v.mentionees,attachments:_n});},po=ye=>{w(ye);},Ja=ye=>{f===i&&ye==="0px"||g(ye);},Xa=()=>{u({pageId:r,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{var ye;(ye=p==null?void 0:p.goToSocialHomePage)==null||ye.call(p);},okText:"Discard",cancelText:"Keep editing"});};useEffect(()=>{x.length>0?(O(!0),Z(!1)):b.length>0&&V.length>0?(O(!1),Z(!0)):(x.length==0||V.length==0)&&(O(!0),Z(!0));},[x,b,L,j,V]),useEffect(()=>{PN()?G(!0):G(!1);},[]),useEffect(()=>{g(!Q&&L&&j||Q&&L&&!j||Q&&!L&&j?s:!Q&&L&&!j||!Q&&!L&&j?a:l);},[Q,L,j]);let en=ye=>{Y(ft=>ft.filter((_n,ko)=>ko!==ye));},Sn=ye=>{if(ye.length+$.length>10){u({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 images. Any additional images will not be saved. ",okText:"Close"});return}ye.length>0&&(U(ft=>[...ft,...ye]),N(ye));},ri=ye=>S(this,null,function*(){let ft=V?V.length:0;if(ye.length+ft>10){u({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 videos. Any additional videos will not be saved. ",okText:"Close"});return}if(ye.length>0){D==null||D(ye);let _n=ye.map(uo=>({file:uo,videoUrl:URL.createObjectURL(uo),thumbnail:void 0})),ko=yield Promise.all(_n.map(uo=>S(this,null,function*(){let ni=yield SN(uo.file);return k(m({},uo),{thumbnail:ni})})));Y(uo=>[...uo,...ko]);}});return re.createElement("div",{className:Ei.createPost,style:n},re.createElement("form",{onSubmit:Te($o),"data-from-media":f==i,className:Ei.createPost__formMediaAttachment},re.createElement("div",{className:Ei.createPost__topBar},re.createElement(sr,{pageId:r,onPress:Xa}),re.createElement(_i,{pageId:r,community:e}),re.createElement(c7,{pageId:r,onSubmit:Te($o),isValid:v.text.length>0||x.length>0||b.length>0})),re.createElement(Ed,{ref:c,onChange:po,communityId:o,onChangeSnap:f==i?0:f==l?2:1,mentionContainer:ee.current,dataValue:{data:{text:v.text}}}),re.createElement(g7,{files:T,uploadedFiles:x,uploadLoading:A,onLoadingChange:q,onChange:({uploaded:ye,uploading:ft})=>{P(ye),N(ft);},onError:E,isErrorUpload:K}),re.createElement("div",{ref:ee}),re.createElement(y7,{files:B,uploadedFiles:b,uploadLoading:A,onLoadingChange:q,onChange:({uploaded:ye,uploading:ft})=>{I(ye),D(ft);},onError:E,isErrorUpload:K,videoThumbnail:V,removeThumbnail:en}),re.createElement("div",{ref:ee})),re.createElement("div",{ref:h}),h.current?Ite.createPortal(re.createElement(Drawer.Root,{snapPoints:[i,a,s,l],activeSnapPoint:f,setActiveSnapPoint:Ja,open:y,modal:!1},re.createElement(Drawer.Portal,{container:h.current},re.createElement(Drawer.Content,{className:Ei.drawer__content},re.createElement("div",{className:Ei.createPost__notiWrap},je&&re.createElement(ms,{content:"Posting...",icon:re.createElement(Ai,null),className:Ei.createPost__status}),Lt&&re.createElement(ms,{content:"Failed to create post",icon:re.createElement(N1,{className:Ei.createPost_infoIcon}),className:Ei.createPost__status,duration:3e3})),f==a||f==s||f==l?re.createElement(k3,{pageId:r,isVisibleCamera:Q,isVisibleImage:L,isVisibleVideo:j,onVideoFileChange:ri,onImageFileChange:Sn}):re.createElement(N3,{pageId:r,isVisibleCamera:Q,isVisibleImage:L,isVisibleVideo:j,onVideoFileChange:ri,onImageFileChange:Sn})))),h.current):null)}var ja={editPost:"Ml",editPost__topBar:"Sl",editPost__status:"El",editPost_infoIcon:"Fl",editPost__notiWrap:"Il",editPost__formMediaAttachment:"Me",drawer__content:"Rl"};var $N={editPostButton:"Se"};function b7(r){var n=r,{pageId:e="*",componentId:t="*"}=n,o=M(n,["pageId","componentId"]);let i="edit_post_button",{config:a,isExcluded:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:i});return s?null:re.createElement(z,m({style:l,className:$N.editPostButton},o),a.text)}var ZN={editPostTitle:"Ul"};function I7({pageId:e="*",componentId:t="*"}){let o="edit_post_title",{config:r,isExcluded:n,themeStyles:i}=F({pageId:e,componentId:t,elementId:o});return n?null:re.createElement("div",{style:i,className:ZN.editPostTitle},r.text)}var Tae=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return S(this,null,function*(){if(!e||(e==null?void 0:e.length)===0)return;let n=yield PostRepository.getPostByIds(e);o(n.data);})}r();},[e]),t},qN=Tae;var l1={thumbnail__container:"f",thumbnail__wrapper:"Ee",thumbnail:"Bl",thumbnail__closeButton:"Hl",thumbnail__closeIcon:"Ll",icon__status:"Tl",playIcon:"Vl"};var kae=({fieldId:e,onRemove:t,type:o})=>{let r=Je({fileId:e});return r?re.createElement(re.Fragment,null,re.createElement("img",{className:l1.thumbnail,src:r,alt:"thumbnail"}),re.createElement(z,{type:"reset",onPress:()=>t(),className:l1.thumbnail__closeButton},re.createElement(ho,{className:l1.thumbnail__closeIcon})),o===PostContentType.VIDEO&&re.createElement("div",{className:l1.playIcon,"data-image":"test"},re.createElement(yo,null))):null},w7=({postMedia:e,onRemove:t})=>e.length==0?null:re.createElement("div",{"data-images-amount":Math.min(e.length,3),className:l1.thumbnail__container},e==null?void 0:e.map((o,r)=>re.createElement("div",{key:r,"data-images-height":e.length>2,className:l1.thumbnail__wrapper},re.createElement(kae,{type:o.dataType,key:r,fieldId:o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.thumbnailFileId,onRemove:()=>t(o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.videoFileId.original)}))));var P7=(e,t)=>{if(e.length!==t.length)return !1;let o=[...e].sort(),r=[...t].sort();for(let n=0;n<o.length;n++)if(o[n]!==r[n])return !1;return !0};function S7({post:e}){var Q;let t="post_composer_page",{themeStyles:o}=tt({pageId:t}),r=useRef(null),{AmityPostComposerPageBehavior:n}=At(),{confirm:i}=$e(),{updateItem:a}=za(),[s,l]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),[c,p]=useState([]),[u,f]=useState([]),[g,y]=useState([]),[h,C]=useState([]),v=useRef(null),w=()=>useMutation({mutationFn:G=>S(this,null,function*(){return yield PostRepository.editPost(e.postId,G)}),onSuccess:G=>{var L;(L=n==null?void 0:n.goToSocialHomePage)==null||L.call(n),a(G.data);},onError:G=>{console.error("Failed to edit post",G);}}),{mutateAsync:x,isPending:P,isError:b}=w(),{handleSubmit:I}=useForm(),T=qN((e==null?void 0:e.children)||[]);useEffect(()=>{let G=T.filter(O=>O.dataType==="image");y(G),p(G);let L=T.filter(O=>O.dataType==="video");C(L),f(L);},[T]);let N=G=>{p(L=>L.filter(O=>O.data.fileId!==G));},B=G=>{f(L=>L.filter(O=>O.data.videoFileId.original!==G));},D=()=>{var j,Z;let G=c.map(K=>({fileId:K.data.fileId,type:PostContentType.IMAGE})),L=u.map(K=>({fileId:K.data.videoFileId.original,type:"video"})),O=[...G,...L];s&&x({data:{text:s.text},metadata:{mentioned:(j=s.mentioned)!=null?j:[]},mentionees:(Z=s.mentionees)!=null?Z:[],attachments:O});},A=G=>{l(G);},q=()=>{i({pageId:t,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{var G;(G=n==null?void 0:n.goToSocialHomePage)==null||G.call(n);},okText:"Discard",cancelText:"Keep editing"});},$=!P7(g,c),U=!P7(h,u);return re.createElement("div",{className:ja.editPost,style:o},re.createElement("form",{onSubmit:I(D),className:ja.editPost__formMediaAttachment},re.createElement("div",{className:ja.editPost__topBar},re.createElement(sr,{pageId:t,onPress:q}),re.createElement(I7,{pageId:t}),re.createElement(b7,{pageId:t,type:"submit",onPress:()=>I(D),isDisabled:e.data.text==s.text&&!$&&!U||!(s.text.length>0||c.length>0||u.length>0)})),re.createElement(Ed,{ref:r,onChange:A,mentionContainer:v.current,dataValue:{data:{text:e.data.text},metadata:{mentioned:((Q=e.metadata)==null?void 0:Q.mentioned)||[]},mentionees:e.mentionees}}),re.createElement(w7,{postMedia:c,onRemove:N}),re.createElement(w7,{postMedia:u,onRemove:B}),re.createElement("div",{ref:v}),re.createElement("div",{className:ja.editPost__notiWrap},P&&re.createElement(ms,{content:"Posting...",icon:re.createElement(Ai,null),className:ja.editPost__status}),b&&re.createElement(ms,{content:"Failed to edit post",icon:re.createElement(Ft,{className:ja.editPost_infoIcon}),className:ja.editPost__status,duration:3e3}))))}var Dae=e=>e.mode==="create";function _7(e){if(Dae(e)){let{targetId:t,targetType:o,community:r}=e;return re.createElement(x7,{mode:"create",targetId:t,targetType:o,community:r})}else {let{post:t}=e;return re.createElement(S7,{mode:"edit",post:t})}}var Uae=e=>re.createElement("svg",m({width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M18.3804 2.25391C19.2593 3.13281 19.2593 4.53906 18.3804 5.41797L15.7437 8.05469L14.5483 9.25L5.97021 17.8281L1.9624 18.25C1.92725 18.25 1.89209 18.25 1.85693 18.25C1.36475 18.25 0.978027 17.8281 1.04834 17.3359L1.47021 13.3281L10.0483 4.75L11.2437 3.55469L13.8804 0.917969C14.3022 0.496094 14.8999 0.25 15.4624 0.25C16.0249 0.25 16.6226 0.496094 17.0444 0.917969L18.3804 2.25391ZM5.19678 16.2109L13.353 8.08984L14.4429 7L12.2983 4.85547L11.2085 5.94531L3.0874 14.1016L2.84131 16.457L5.19678 16.2109ZM17.1851 4.22266C17.396 4.01172 17.396 3.66016 17.1851 3.44922L15.8491 2.11328C15.7085 1.97266 15.5327 1.9375 15.4624 1.9375C15.3921 1.9375 15.2163 1.97266 15.0757 2.11328L13.4937 3.66016L15.6382 5.80469L17.1851 4.22266Z"})),zae=e=>re.createElement("svg",m({width:"16",height:"19",viewBox:"0 0 16 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M15.3608 3.0625C15.6421 3.0625 15.9233 3.34375 15.9233 3.625V4.1875C15.9233 4.50391 15.6421 4.75 15.3608 4.75H14.7983L14.0249 16.668C13.9897 17.5469 13.2163 18.25 12.3374 18.25H3.72412C2.84521 18.25 2.07178 17.5469 2.03662 16.668L1.29834 4.75H0.73584C0.419434 4.75 0.17334 4.50391 0.17334 4.1875V3.625C0.17334 3.34375 0.419434 3.0625 0.73584 3.0625H3.61865L4.81396 1.09375C5.09521 0.636719 5.72803 0.25 6.25537 0.25H9.80615C10.3335 0.25 10.9663 0.636719 11.2476 1.09375L12.4429 3.0625H15.3608ZM6.25537 1.9375L5.5874 3.0625H10.4741L9.80615 1.9375H6.25537ZM12.3374 16.5625L13.0757 4.75H2.98584L3.72412 16.5625H12.3374Z"})),Hae=e=>re.createElement("svg",m({width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M12.3125 3.0625C13.543 3.0625 14.8789 2.64062 16.1445 2.07812C17.2344 1.62109 18.5 2.42969 18.5 3.625V12.0625C18.5 12.6602 18.1836 13.1875 17.7266 13.5039C16.7773 14.1016 15.2656 14.875 13.1914 14.875C10.8008 14.875 9.21875 13.75 7.49609 13.75C5.52734 13.75 4.33203 14.1719 3.03125 14.7695V17.6875C3.03125 18.0039 2.75 18.25 2.46875 18.25H1.90625C1.58984 18.25 1.34375 18.0039 1.34375 17.6875V3.41406C0.816406 3.13281 0.5 2.57031 0.5 1.9375C0.5 0.988281 1.30859 0.214844 2.29297 0.285156C3.10156 0.320312 3.76953 0.953125 3.83984 1.76172C3.83984 1.79688 3.875 1.90234 3.875 1.9375C3.875 2.11328 3.80469 2.35938 3.76953 2.5C4.54297 2.18359 5.49219 1.9375 6.61719 1.9375C9.00781 1.9375 10.5898 3.0625 12.3125 3.0625ZM16.8125 12.0625V3.625C15.6875 4.15234 13.8242 4.75 12.3125 4.75C10.2031 4.75 8.72656 3.625 6.61719 3.625C5.14062 3.625 3.76953 4.22266 3.03125 4.75V12.9062C4.12109 12.4141 5.98438 12.0625 7.49609 12.0625C9.60547 12.0625 11.082 13.1875 13.1914 13.1875C14.668 13.1875 16.0391 12.625 16.8125 12.0625Z"})),$3=({post:e,pageId:t="*",componentId:o="*",elementId:r="*",onCloseMenu:n,onPostDeleted:i})=>{let{success:a,error:s}=Co(),l=useMemo(()=>(e==null?void 0:e.targetType)==="community",[e==null?void 0:e.targetType]),{community:c}=xi({communityId:e==null?void 0:e.targetId,shouldCall:l}),{isCommunityModerator:p,isOwner:u}=IN({post:e,community:c}),{AmityPostContentComponentBehavior:f}=At(),{removeDrawerData:g}=cm(),{showEditPostButton:y,showDeletePostButton:h,showReportPostButton:C}=useMemo(()=>p?u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!1,showReportPostButton:!0},[p,u]),{isFlaggedByMe:v,isLoading:w,mutateReportPost:x,mutateUnReportPost:P}=wN({post:e,isFlaggable:C,onReportSuccess:()=>{a({content:"Post reported"});},onReportError:()=>{s({content:"Failed to report post"});},onUnreportSuccess:()=>{a({content:"Post unreported"});},onUnreportError:()=>{s({content:"Failed to unreport post"});}}),{confirm:b}=$e(),{mutateAsync:I}=useMutation({mutationFn:()=>S(void 0,null,function*(){return n(),PostRepository.hardDeletePost(e.postId)}),onSuccess:()=>{a({content:"Post deleted"}),i==null||i(e);},onError:()=>{s({content:"Failed to delete post"});}}),T=()=>{n(),b({title:"Delete post",content:"This post will be permanently deleted.",cancelText:"Cancel",okText:"Delete",onOk:()=>I(),pageId:t,componentId:o});};return re.createElement("div",{className:vn.postMenu},C&&!w?re.createElement(z,{className:vn.postMenu__item,onPress:()=>{v?P():x();}},re.createElement(Hae,{className:vn.postMenu__reportPost__icon}),re.createElement("span",{className:vn.postMenu__reportPost__text},v?"Unreport post":"Report post")):null,y?re.createElement(z,{className:vn.postMenu__item,onPress:()=>{var N;g(),(N=f==null?void 0:f.goToPostComposerPage)==null||N.call(f,{mode:"edit",post:e});}},re.createElement(Uae,{className:vn.postMenu__editPost__icon}),re.createElement("span",{className:vn.postMenu__editPost__text},"Edit post")):null,h?re.createElement(z,{className:vn.postMenu__item,onPress:()=>T()},re.createElement(zae,{className:vn.postMenu__deletePost__icon}),re.createElement("span",{className:vn.postMenu__deletePost__text},"Delete post")):null)};var XN=({post:e,community:t})=>{let{currentUserId:o}=Ee(),r=useMemo(()=>(e==null?void 0:e.targetType)==="community"&&(e==null?void 0:e.targetId)===(t==null?void 0:t.communityId),[e==null?void 0:e.targetType,t==null?void 0:t.communityId]),{moderators:n}=Nd({communityId:t==null?void 0:t.communityId,shouldCall:r}),i=useMemo(()=>r?n.some(s=>s.userId===(e==null?void 0:e.postedUserId)):!1,[n,r,e==null?void 0:e.postedUserId]),a=(e==null?void 0:e.postedUserId)===o;return {isCommunityModerator:i,isOwner:a}};var RN=({threshold:e,elementRef:t})=>{let[o,r]=useState(!1);return useEffect(()=>{if(!t.current)return;let n=new IntersectionObserver(i=>{i.forEach(a=>{let s=a.isIntersecting;r(s);});},{threshold:e});return n.observe(t.current),()=>{n.disconnect();}},[e,t]),{isVisible:o}};var Wae=({pageId:e,post:t})=>{let o=useMemo(()=>(t==null?void 0:t.targetType)==="community",[t==null?void 0:t.targetType]),{community:r}=xi({communityId:t==null?void 0:t.targetId,shouldCall:o}),{user:n}=Mo(t.postedUserId),{onClickCommunity:i,onClickUser:a}=ot();return r?re.createElement("div",{className:Pe.postTitle},n&&re.createElement(z,{onPress:()=>a(n.userId)},re.createElement(_.BodyBold,{className:Pe.postTitle__text},n.displayName)),r&&re.createElement(re.Fragment,null,re.createElement(Sd,{className:Pe.postTitle__icon}),re.createElement(z,{onPress:()=>{i(r.communityId);}},re.createElement(_.BodyBold,{className:Pe.postTitle__text},r.displayName)))):re.createElement(z,{onPress:()=>n&&a(n.userId)},re.createElement(_.BodyBold,{className:Pe.postTitle__text},n==null?void 0:n.displayName))};var Yae=({post:e,onImageClick:t,onVideoClick:o})=>re.createElement(re.Fragment,null,re.createElement(l7,{post:e,onImageClick:t}),re.createElement(m7,{post:e,onVideoClick:o})),um=({pageId:e="*",post:t,type:o,drawerRef:r,onClick:n,onPostDeleted:i})=>{var Lt;let a="post_content",{themeStyles:s}=te({pageId:e,componentId:a}),{post:l}=Wr(t==null?void 0:t.postId),{setDrawerData:c,removeDrawerData:p}=cm(),[u,f]=useState(!1),[g,y]=useState(!1),[h,C]=useState(!1),[v,w]=useState(null),[x,P]=useState(null),[b,I]=useState(null),[T,N]=useState(0),{page:B}=ot(),D=useRef(null),A=useMemo(()=>{if(t!=null&&l!=null)return Zr(t==null?void 0:t.updatedAt).unix()>Zr(l==null?void 0:l.updatedAt).unix()?t:l;if(l!=null)return l;if(t!=null)return t},[t,l]);pd({postId:A==null?void 0:A.postId,level:SubscriptionLevels.POST,shouldSubscribe:u});let q=useMemo(()=>(A==null?void 0:A.targetType)==="community",[A==null?void 0:A.targetType]),{community:$}=xi({communityId:A==null?void 0:A.targetId,shouldCall:q}),{isCommunityModerator:U}=XN({post:A,community:$});useEffect(()=>{var Te;A!=null&&I(((Te=A.myReactions)==null?void 0:Te[0])||null);},[A==null?void 0:A.myReactions]),useEffect(()=>{A!=null&&N((A==null?void 0:A.reactionsCount)||0);},[A==null?void 0:A.reactionsCount]);let{mutateAsync:Q}=useMutation({mutationFn:Te=>S(void 0,null,function*(){if(b&&b!==Te)try{yield ReactionRepository.removeReaction("post",A==null?void 0:A.postId,b);}catch($o){console.log();}return ReactionRepository.addReaction("post",A==null?void 0:A.postId,Te)}),onMutate:Te=>{f(!0),N(T+1),I(Te);}}),{mutateAsync:G}=useMutation({mutationFn:Te=>S(void 0,null,function*(){return ReactionRepository.removeReaction("post",A==null?void 0:A.postId,Te)}),onMutate:()=>{f(!0),N(Math.max(0,T-1)),I(null);}}),L=Te=>{b?G(b):Q(Te);},O=Te=>{y(!0),w(Te);},j=()=>{y(!1),w(null);},Z=Te=>{C(!0),P(Te);},K=()=>{C(!1),P(null);},E=(A==null?void 0:A.reactions.like)>0,V=(A==null?void 0:A.reactions.love)>0,Y=(A==null?void 0:A.reactions.fire)>0,ee=(A==null?void 0:A.reactions.happy)>0,pe=(A==null?void 0:A.reactions.crying)>0,ce=E||V||Y||ee||pe,{isVisible:je}=RN({threshold:.6,elementRef:D});return useEffect(()=>{var Te;B.type!=="PostDetailPage"&&je&&((Te=A.analytics)==null||Te.markAsViewed());},[A,je,B.type]),re.createElement("div",{ref:D,className:Pe.postContent,style:s},re.createElement("div",{className:Pe.postContent__bar,"data-type":o},re.createElement("div",{className:Pe.postContent__bar__userAvatar},re.createElement(ro,{userId:A==null?void 0:A.postedUserId})),re.createElement("div",null,re.createElement("div",null,re.createElement(Wae,{post:A})),re.createElement("div",{className:Pe.postContent__bar__information__subtitle},U?re.createElement("div",{className:Pe.postContent__bar__information__subtitle__moderator},re.createElement(Qs,{pageId:e,componentId:a}),re.createElement("span",{className:Pe.postContent__bar__information__subtitle__separator},"\u2022")):null,re.createElement(Ks,{timestamp:A.createdAt}),A.createdAt!==A.editedAt&&re.createElement(_.Caption,{className:Pe.postContent__bar__information__editedTag},"(edited)"))),re.createElement("div",{className:Pe.postContent__bar__actionButton},o==="feed"?re.createElement(Pd,{pageId:e,componentId:a,onClick:()=>c({content:re.createElement($3,{post:A,onCloseMenu:()=>p(),pageId:e,componentId:a,onPostDeleted:i})})}):null)),re.createElement("div",{className:Pe.postContent__content_and_reactions},re.createElement("div",{className:Pe.postContent__content},re.createElement(s7,{text:A.data.text,mentionees:(Lt=A==null?void 0:A.metadata)==null?void 0:Lt.mentioned}),A.children.length>0?re.createElement(Yae,{post:A,onImageClick:O,onVideoClick:Z}):null),o==="detail"?re.createElement("div",{className:Pe.postContent__reactions_and_comments},re.createElement("div",{className:Pe.postContent__reactionsBar,onClick:()=>c({content:re.createElement(tm,{pageId:e,referenceId:A.postId,referenceType:"post"})})},ce?re.createElement("div",{className:Pe.postContent__reactionsBar__reactions},pe&&re.createElement(aN,{className:Pe.postContent__reactionsBar__reactions__icon}),ee&&re.createElement(sN,{className:Pe.postContent__reactionsBar__reactions__icon}),Y&&re.createElement(lN,{className:Pe.postContent__reactionsBar__reactions__icon}),V&&re.createElement(mN,{className:Pe.postContent__reactionsBar__reactions__icon}),E&&re.createElement(dN,{className:Pe.postContent__reactionsBar__reactions__icon})):null,re.createElement(_.Caption,{className:Pe.postContent__reactionsBar__reactions__count},`${ov((A==null?void 0:A.reactionsCount)||0)} ${(A==null?void 0:A.reactionsCount)===1?"like":"likes"}`)),re.createElement(_.Caption,{className:Pe.postContent__commentsCount},`${(A==null?void 0:A.commentsCount)||0} ${(A==null?void 0:A.commentsCount)===1?"comment":"comments"}`)):null,re.createElement("div",{className:Pe.postContent__divider}),re.createElement("div",{className:Pe.postContent__reactionBar},re.createElement("div",{className:Pe.postContent__reactionBar__leftPane},re.createElement(e3,{pageId:e,componentId:a,reactionsCount:o==="feed"?T:void 0,myReaction:b,defaultIconClassName:Pe.postContent__reactionBar__leftPane__icon,imgIconClassName:Pe.postContent__reactionBar__leftPane__iconImg,onReactionClick:L}),re.createElement(o7,{pageId:e,componentId:a,commentsCount:o==="feed"?A.commentsCount:void 0,defaultIconClassName:Pe.postContent__reactionBar__leftPane__icon,imgIconClassName:Pe.postContent__reactionBar__leftPane__iconImg,onPress:()=>n==null?void 0:n()})),re.createElement("div",{className:Pe.postContent__reactionBar__rightPane},re.createElement(t7,{pageId:e,componentId:a})))),g&&typeof v=="number"?re.createElement(CN,{post:A,onClose:j,initialImageIndex:v}):null,h&&typeof x=="number"?re.createElement(xN,{post:A,onClose:K,initialVideoIndex:x}):null)};var bt={postContentSkeleton:"ql",postContentSkeleton__bar:"Dl",postContentSkeleton__bar__information:"Gl",postContentSkeleton__content:"Jl",postContentSkeleton__animation:"Kl","skeleton-pulse":"Fe",postContentSkeleton__bar__userAvatar:"Nl",postContentSkeleton__bar__information__title:"Ol",postContentSkeleton__bar__information__subtitle:"Pl",postContentSkeleton__content__bar1:"Ql",postContentSkeleton__content__bar2:"Wl",postContentSkeleton__content__bar3:"Zl"};var Bd=({pageId:e="*"})=>{let t="post_content",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return re.createElement("div",{"data-qa-anchor":o,style:s,className:Kn(bt.postContentSkeleton,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__bar,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__userAvatar,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__information,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__information__title,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__information__subtitle,bt.postContentSkeleton__animation)}))),re.createElement("div",{className:Kn(bt.postContentSkeleton__content,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__content__bar1,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__content__bar2,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__content__bar3,bt.postContentSkeleton__animation)})))};function d1({queryParams:e,shouldCall:t=!0}){let n=oo({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=n,r=M(n,["items"]);return m({communities:o},r)}var ok={myCommunitiesList:"_l"};var Z3=({pageId:e="*"})=>{let t="my_communities",{themeStyles:o}=te({pageId:e,componentId:t}),{communities:r,hasMore:n,loadMore:i,isLoading:a}=d1({queryParams:{sortBy:"displayName",limit:20,membership:"member"}});return re.createElement("div",{style:o,className:ok.myCommunitiesList},re.createElement(Da,{pageId:e,communityCollection:r,isLoading:a,onLoadMore:()=>{n&&a===!1&&i();}}))};var Xae=()=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},re.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),re.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),re.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),re.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),re.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),re.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),re.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),re.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),re.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),re.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),re.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),re.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),re.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),Rae=()=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"160",viewBox:"0 0 161 160",fill:"none"},re.createElement("path",{d:"M130.452 24H34.4521C30.0339 24 26.4521 27.5817 26.4521 32V128C26.4521 132.418 30.0339 136 34.4521 136H130.452C134.87 136 138.452 132.418 138.452 128V32C138.452 27.5817 134.87 24 130.452 24Z",fill:"#EBECEF"}),re.createElement("path",{d:"M44.0522 67.7H44.5522H152.052C152.981 67.7 153.871 68.0688 154.527 68.7251C155.184 69.3815 155.552 70.2718 155.552 71.2V91.2C155.552 92.1283 155.184 93.0185 154.527 93.6749C153.871 94.3313 152.981 94.7 152.052 94.7H44.0522C43.124 94.7 42.2337 94.3313 41.5774 93.6749C40.921 93.0185 40.5522 92.1283 40.5522 91.2V71.2C40.5522 70.2718 40.921 69.3815 41.5774 68.7251C42.2337 68.0688 43.124 67.7 44.0522 67.7Z",fill:"white",stroke:"#EBECEF"}),re.createElement("path",{opacity:"0.3",d:"M91.2523 73.6H70.4522C69.1268 73.6 68.0522 74.6745 68.0522 76C68.0522 77.3255 69.1268 78.4 70.4522 78.4H91.2523C92.5777 78.4 93.6523 77.3255 93.6523 76C93.6523 74.6745 92.5777 73.6 91.2523 73.6Z",fill:"#A5A9B5"}),re.createElement("path",{opacity:"0.15",d:"M105.652 84H70.4522C69.1268 84 68.0522 85.0745 68.0522 86.4C68.0522 87.7255 69.1268 88.8 70.4522 88.8H105.652C106.978 88.8 108.052 87.7255 108.052 86.4C108.052 85.0745 106.978 84 105.652 84Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M54.0521 88.8C58.2495 88.8 61.6521 85.3974 61.6521 81.2C61.6521 77.0027 58.2495 73.6 54.0521 73.6C49.8548 73.6 46.4521 77.0027 46.4521 81.2C46.4521 85.3974 49.8548 88.8 54.0521 88.8Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M9.65234 102.1H10.1523H117.652C118.581 102.1 119.471 102.469 120.127 103.125C120.784 103.782 121.152 104.672 121.152 105.6V125.6C121.152 126.528 120.784 127.419 120.127 128.075C119.471 128.731 118.581 129.1 117.652 129.1H9.65234C8.72409 129.1 7.83385 128.731 7.17747 128.075C6.52109 127.419 6.15234 126.528 6.15234 125.6V105.6C6.15234 104.672 6.52109 103.782 7.17747 103.125C7.83385 102.469 8.72409 102.1 9.65234 102.1Z",fill:"white",stroke:"#EBECEF"}),re.createElement("path",{opacity:"0.3",d:"M56.8523 108H36.0523C34.7269 108 33.6523 109.075 33.6523 110.4C33.6523 111.725 34.7269 112.8 36.0523 112.8H56.8523C58.1778 112.8 59.2523 111.725 59.2523 110.4C59.2523 109.075 58.1778 108 56.8523 108Z",fill:"#A5A9B5"}),re.createElement("path",{opacity:"0.15",d:"M71.2523 118.4H36.0523C34.7269 118.4 33.6523 119.475 33.6523 120.8C33.6523 122.126 34.7269 123.2 36.0523 123.2H71.2523C72.5778 123.2 73.6523 122.126 73.6523 120.8C73.6523 119.475 72.5778 118.4 71.2523 118.4Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M19.6522 123.2C23.8496 123.2 27.2522 119.797 27.2522 115.6C27.2522 111.403 23.8496 108 19.6522 108C15.4549 108 12.0522 111.403 12.0522 115.6C12.0522 119.797 15.4549 123.2 19.6522 123.2Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M9.65234 33.3H117.652C119.585 33.3 121.152 34.867 121.152 36.8V56.8C121.152 58.733 119.585 60.3 117.652 60.3H9.65234C7.71935 60.3 6.15234 58.733 6.15234 56.8V36.8C6.15234 34.867 7.71935 33.3 9.65234 33.3Z",fill:"white",stroke:"#EBECEF"}),re.createElement("path",{opacity:"0.3",d:"M55.2522 39.2H34.4522C33.1268 39.2 32.0522 40.2745 32.0522 41.6C32.0522 42.9255 33.1268 44 34.4522 44H55.2522C56.5777 44 57.6522 42.9255 57.6522 41.6C57.6522 40.2745 56.5777 39.2 55.2522 39.2Z",fill:"#A5A9B5"}),re.createElement("path",{opacity:"0.15",d:"M69.6522 49.6H34.4522C33.1268 49.6 32.0522 50.6745 32.0522 52C32.0522 53.3255 33.1268 54.4 34.4522 54.4H69.6522C70.9777 54.4 72.0522 53.3255 72.0522 52C72.0522 50.6745 70.9777 49.6 69.6522 49.6Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M19.6522 54.4C23.8496 54.4 27.2522 50.9974 27.2522 46.8C27.2522 42.6026 23.8496 39.2 19.6522 39.2C15.4549 39.2 12.0522 42.6026 12.0522 46.8C12.0522 50.9974 15.4549 54.4 19.6522 54.4Z",fill:"#A5A9B5"})),E7=({pageId:e="*",componentId:t="*"})=>{let o="illustration",{currentTheme:r,accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:c}=F({pageId:e,componentId:t,elementId:o});return s?null:re.createElement(ae,{defaultIconName:a.icon,configIconName:i.icon,imgIcon:()=>re.createElement("img",{src:i.icon,alt:l,"data-qa-anchor":n}),defaultIcon:()=>re.createElement("div",{"data-qa-anchor":n},r==="light"?re.createElement(Rae,null):re.createElement(Xae,null))})};var nk={description:"ed"};function A7({pageId:e="*",componentId:t="*"}){let o="description",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:o});return a?null:re.createElement(_.Caption,{className:nk.description,style:l,"data-qa-anchor":r},n.text)}var ik={title:"rd"};function c1({pageId:e="*",componentId:t="*",titleClassName:o}){let r="title",{accessibilityId:n,config:i,isExcluded:a,themeStyles:s}=F({pageId:e,componentId:t,elementId:r});return a?null:re.createElement(_.Title,{className:Kn(ik.title,o),style:s,"data-qa-anchor":n},i.text)}var q3={exploreCommunitiesButton:"ad",exploreCommunitiesButton__icon:"od",exploreCommunitiesButton__text:"td"};var ase=e=>re.createElement("svg",m({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M7.85254 0.25C12.1338 0.25 15.6025 3.71875 15.6025 8C15.6025 12.2812 12.1338 15.75 7.85254 15.75C3.57129 15.75 0.102539 12.2812 0.102539 8C0.102539 3.71875 3.57129 0.25 7.85254 0.25ZM13.4463 5.25C12.79 3.9375 11.6963 2.90625 10.3525 2.3125C10.79 3.125 11.1338 4.125 11.3525 5.25H13.4463ZM7.85254 1.75C7.25879 1.75 6.32129 3.0625 5.85254 5.25H9.82129C9.35254 3.0625 8.41504 1.75 7.85254 1.75ZM1.60254 8C1.60254 8.4375 1.63379 8.875 1.72754 9.25H4.13379C4.10254 8.84375 4.10254 8.4375 4.10254 8C4.10254 7.59375 4.10254 7.1875 4.13379 6.75H1.72754C1.63379 7.15625 1.60254 7.59375 1.60254 8ZM2.22754 10.75C2.88379 12.0625 3.97754 13.125 5.32129 13.7188C4.88379 12.9062 4.54004 11.9062 4.32129 10.75H2.22754ZM4.32129 5.25C4.54004 4.125 4.88379 3.125 5.32129 2.3125C3.97754 2.90625 2.88379 3.9375 2.22754 5.25H4.32129ZM7.85254 14.25C8.41504 14.25 9.35254 12.9688 9.82129 10.75H5.85254C6.32129 12.9688 7.25879 14.25 7.85254 14.25ZM10.04 9.25C10.0713 8.875 10.1025 8.4375 10.1025 8C10.1025 7.5625 10.0713 7.15625 10.04 6.75H5.63379C5.60254 7.15625 5.60254 7.5625 5.60254 8C5.60254 8.4375 5.60254 8.875 5.63379 9.25H10.04ZM10.3525 13.7188C11.6963 13.125 12.79 12.0625 13.4463 10.75H11.3525C11.1338 11.9062 10.79 12.9062 10.3525 13.7188ZM11.54 9.25H13.9775C14.04 8.875 14.1025 8.4375 14.1025 8C14.1025 7.59375 14.04 7.15625 13.9775 6.75H11.54C11.5713 7.1875 11.6025 7.59375 11.6025 8C11.6025 8.4375 11.5713 8.84375 11.54 9.25Z"}));function L7({pageId:e="*",componentId:t="*"}){let o="explore_communities_button",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:o});return a?null:re.createElement("div",{className:q3.exploreCommunitiesButton,"data-qa-anchor":r,style:l},re.createElement(ase,{className:q3.exploreCommunitiesButton__icon}),re.createElement(_.BodyBold,{className:q3.exploreCommunitiesButton__text},n.text))}var ak={createCommunityButton:"id"};function B7({pageId:e="*",componentId:t="*",onClick:o}){let r="create_community_button",{accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:c}=F({pageId:e,componentId:t,elementId:r});return s?null:re.createElement("div",{className:ak.createCommunityButton,onClick:()=>o(),"data-qa-anchor":n,style:c},re.createElement(ae,{defaultIcon:()=>re.createElement(re.Fragment,null),imgIcon:()=>re.createElement("img",{src:i.icon,alt:l}),configIconName:i.icon,defaultIconName:a.icon}),re.createElement(_.Body,null,i.text))}var F7={emptyNewsfeed:"sd",emptyNewsfeed__text:"cd"};function gm({pageId:e="*"}){let t="empty_newsfeed",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return i?null:re.createElement("div",{className:F7.emptyNewsfeed},re.createElement(E7,{pageId:e,componentId:t}),re.createElement("div",{className:F7.emptyNewsfeed__text},re.createElement(c1,{pageId:e,componentId:t}),re.createElement(A7,{pageId:e,componentId:t})),re.createElement(L7,{pageId:e,componentId:t}),re.createElement(B7,{pageId:e,componentId:t,onClick:()=>{}}))}var u1={global_feed:"nd",global_feed__postContainer:"ld",global_feed__postSkeletonContainer:"dd",global_feed__pullToRefresh:"md",global_feed__post__reactionBar__leftPane__icon:"gd",global_feed__post__reactionBar__leftPane__iconImg:"hd",global_feed__pullToRefresh__spinner:"pd",spin:"Ie",global_feed__divider:"fd",global_feed__post__divider:"ud",global_feed__post__reactionBar:"bd",global_feed__post__reactionBar__leftPane:"vd",global_feed__post__reactionBar__rightPane:"xd",global_feed__intersection:"wd",global_feed__commentContainer:"yd"};var Vt={container:"kd",innerContainer:"jd",header:"zd",header__title:"Xd",header__avatar:"Yd",header__detail:"Ad",content__text:"Cd",content__imageContainer:"Md",content__image:"Sd",footer:"Re",footer__content__description:"Ed",footer__content__headline:"Fd",footer__left:"Id",footer__right:"Rd",footer__content__button:"Ud",footer__content__button__text:"Bd",infoIcon__button:"Hd",infoIcon:"Ld"};var sk=({ad:e,avatarUrl:t,adImageUrl:o,themeStyles:r,onCallToActionClick:n})=>{var l;let[i,a]=useState(!1),s=()=>{n==null||n(e.callToActionUrl);};return re.createElement("div",{className:Vt.container,style:r},re.createElement("div",{className:Vt.innerContainer},re.createElement("div",{className:Vt.header},re.createElement("div",{className:Vt.header__avatar},re.createElement(yt,{avatarUrl:t,defaultImage:re.createElement(Jl,null)})),re.createElement("div",{className:Vt.header__detail},re.createElement(_.BodyBold,{className:Vt.header__title},(l=e.advertiser)==null?void 0:l.name),re.createElement(Kl,null))),re.createElement("div",null,re.createElement(_.Body,{className:Vt.content__text},e.body),re.createElement("div",{className:Vt.content__imageContainer},re.createElement("img",{className:Vt.content__image,src:o})))),re.createElement(z,{className:Vt.infoIcon__button,onPress:()=>a(!0)},re.createElement(qr,{className:Vt.infoIcon})),re.createElement("div",{className:Vt.footer,"data-has-url":!!e.callToActionUrl,onClick:s},re.createElement("div",{className:Vt.footer__left},re.createElement(_.Body,{className:Vt.footer__content__description},e.description),re.createElement(_.BodyBold,{className:Vt.footer__content__headline},e.headline)),e.callToActionUrl?re.createElement("div",{className:Vt.footer__right},re.createElement(z,{className:Vt.footer__content__button,onPress:s},re.createElement(_.CaptionBold,{className:Vt.footer__content__button__text},e.callToAction))):null),re.createElement(y3,{ad:e,isOpen:i,onOpenChange:c=>a(c)}))};var lk=({pageId:e="*",ad:t})=>{var c,p,u,f,g,y;let o="post_content",{themeStyles:r}=te({pageId:e,componentId:o}),i=Je({fileId:(p=(c=t.advertiser)==null?void 0:c.avatar)==null?void 0:p.fileId})||((f=(u=t.advertiser)==null?void 0:u.avatar)==null?void 0:f.fileUrl)||"",s=Je({fileId:(g=t.image1_1)==null?void 0:g.fileId})||((y=t.image1_1)==null?void 0:y.fileUrl)||"";return re.createElement(sk,{themeStyles:r,avatarUrl:i,adImageUrl:s,ad:t,onCallToActionClick:h=>{window==null||window.open(h,"_blank");}})};var D7=e=>(e==null?void 0:e.adId)!==void 0,W3=({pageId:e="*",componentId:t="*",items:o,isLoading:r,onFeedReachBottom:n,onPostDeleted:i})=>{let{accessibilityId:a,themeStyles:s}=te({pageId:e,componentId:t}),l=useRef(null),{AmityGlobalFeedComponentBehavior:c}=At();if(mr({ref:l,onIntersect:()=>{n();}}),o.length===0&&!r)return re.createElement(gm,{pageId:e});let p=(u,f)=>D7(u)?f&&D7(f)?`${f.adId}-${u.adId}`:`${f.postId}-${u.adId}`:u.postId;return re.createElement("div",{className:u1.global_feed,style:s,"data-qa-anchor":a},o.map((u,f)=>re.createElement("div",{key:p(u,o[Math.max(0,f-1)])},f!==0?re.createElement("div",{className:u1.global_feed__divider}):null,D7(u)?re.createElement(lk,{ad:u}):re.createElement("div",{className:u1.global_feed__postContainer},re.createElement(um,{pageId:e,post:u,type:"feed",onClick:()=>{var g;(g=c==null?void 0:c.goToPostDetailPage)==null||g.call(c,{postId:u.postId});},onPostDeleted:i})))),r?Array.from({length:2}).map((u,f)=>re.createElement("div",{key:f},re.createElement("div",{className:u1.global_feed__divider}),re.createElement("div",{className:u1.global_feed__postSkeletonContainer},re.createElement(Bd,null)))):null,!r&&re.createElement("div",{ref:l,className:u1.global_feed__intersection}))};var ym={newsfeed:"Td",newsfeed__postList:"Vd",newsfeed__postContainer:"qd",newsfeed__pullToRefresh:"Dd",newsfeed__post__reactionBar__leftPane__icon:"Gd",newsfeed__post__reactionBar__leftPane__iconImg:"Jd",newsfeed__pullToRefresh__spinner:"Kd",spin:"Ue",newsfeed__divider:"Nd",newsfeed__post__divider:"Od",newsfeed__post__reactionBar:"Pd",newsfeed__post__reactionBar__leftPane:"Qd",newsfeed__post__reactionBar__rightPane:"Wd",newsfeed__intersection:"Zd"};var Cse=e=>re.createElement("div",{className:ym.newsfeed__pullToRefresh__spinner},re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},re.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1122 5C11.1122 5.39449 10.7924 5.71429 10.3979 5.71429C10.0035 5.71429 9.68366 5.39449 9.68366 5V0.714286C9.68366 0.319797 10.0035 0 10.3979 0C10.7924 0 11.1122 0.319797 11.1122 0.714286V5ZM8.25509 6.28846C8.59673 6.09122 8.71378 5.65437 8.51654 5.31273L6.37368 1.60119C6.17644 1.25955 5.73959 1.1425 5.39795 1.33975C5.05631 1.53699 4.93926 1.97384 5.1365 2.31548L7.27936 6.02702C7.4766 6.36865 7.91346 6.48571 8.25509 6.28846ZM6.42496 6.88141C6.7666 7.07865 6.88366 7.51551 6.68641 7.85714C6.48917 8.19878 6.05232 8.31583 5.71068 8.11859L1.99914 5.97573C1.6575 5.77849 1.54045 5.34164 1.7377 5C1.93494 4.65836 2.37179 4.54131 2.71343 4.73855L6.42496 6.88141ZM6.11224 10C6.11224 9.60551 5.79244 9.28571 5.39795 9.28571H1.11223C0.717746 9.28571 0.397949 9.60551 0.397949 10C0.397949 10.3945 0.717746 10.7143 1.11224 10.7143H5.39795C5.79244 10.7143 6.11224 10.3945 6.11224 10ZM5.71068 11.8814C6.05232 11.6842 6.48917 11.8012 6.68641 12.1429C6.88366 12.4845 6.7666 12.9213 6.42497 13.1186L2.71343 15.2614C2.37179 15.4587 1.93494 15.3416 1.7377 15C1.54045 14.6584 1.6575 14.2215 1.99914 14.0243L5.71068 11.8814ZM8.25509 13.7115C7.91345 13.5143 7.4766 13.6313 7.27936 13.973L5.1365 17.6845C4.93926 18.0262 5.05631 18.463 5.39795 18.6603C5.73959 18.8575 6.17644 18.7404 6.37368 18.3988L8.51654 14.6873C8.71378 14.3456 8.59673 13.9088 8.25509 13.7115ZM10.3979 14.2857C10.0035 14.2857 9.68366 14.6055 9.68366 15V19.2857C9.68366 19.6802 10.0035 20 10.3979 20C10.7924 20 11.1122 19.6802 11.1122 19.2857V15C11.1122 14.6055 10.7924 14.2857 10.3979 14.2857ZM12.5408 6.28846C12.8824 6.48571 13.3193 6.36865 13.5165 6.02702L15.6594 2.31548C15.8566 1.97384 15.7396 1.53699 15.3979 1.33975C15.0563 1.1425 14.6195 1.25956 14.4222 1.60119L12.2794 5.31273C12.0821 5.65437 12.1992 6.09122 12.5408 6.28846ZM15.0852 8.11859C14.7436 8.31583 14.3067 8.19878 14.1095 7.85714C13.9122 7.51551 14.0293 7.07866 14.3709 6.88141L18.0825 4.73855C18.4241 4.54131 18.861 4.65836 19.0582 5C19.2554 5.34164 19.1384 5.77849 18.7968 5.97573L15.0852 8.11859ZM14.6837 10C14.6837 10.3945 15.0035 10.7143 15.3979 10.7143H19.6837C20.0782 10.7143 20.3979 10.3945 20.3979 10C20.3979 9.60551 20.0782 9.28571 19.6837 9.28571H15.3979C15.0035 9.28571 14.6837 9.60551 14.6837 10ZM14.3709 13.1186C14.0293 12.9213 13.9122 12.4845 14.1095 12.1429C14.3067 11.8012 14.7436 11.6842 15.0852 11.8814L18.7968 14.0243C19.1384 14.2215 19.2554 14.6584 19.0582 15C18.861 15.3416 18.4241 15.4587 18.0825 15.2614L14.3709 13.1186ZM12.5408 13.7115C12.1992 13.9088 12.0821 14.3456 12.2794 14.6873L14.4222 18.3988C14.6195 18.7404 15.0563 18.8575 15.3979 18.6603C15.7396 18.463 15.8566 18.0262 15.6594 17.6845L13.5165 13.973C13.3193 13.6313 12.8824 13.5143 12.5408 13.7115Z",fill:"url(#paint0_angular_1709_10374)"}),re.createElement("defs",null,re.createElement("radialGradient",{id:"paint0_angular_1709_10374",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.3979 10) scale(10)"},re.createElement("stop",{offset:"0.669733",stopColor:"#595F67"}),re.createElement("stop",{offset:"0.716307",stopColor:"#262626",stopOpacity:"0.01"}))))),Y3=({pageId:e="*"})=>{let t="newsfeed",{themeStyles:o}=te({pageId:e,componentId:t}),r=useRef(0),[n,i]=useState(0),{itemWithAds:a,hasMore:s,isLoading:l,loadMore:c,fetch:p,refetch:u,removeItem:f}=za();useEffect(()=>{p();},[]);let g=()=>{s&&!l&&c();};return a.length===0&&!l?re.createElement(gm,{pageId:e}):re.createElement("div",{className:ym.newsfeed,style:o,onDrag:y=>y.stopPropagation(),onTouchStart:y=>{r.current=y.touches[0].clientY;},onTouchMove:y=>{let h=y.touches[0].clientY;r.current>h||i(Math.min(h-r.current,100));},onTouchEnd:y=>{r.current=0,n>=75&&u(),i(0);}},re.createElement("div",{style:{"--asc-pull-to-refresh-height":`${n}px`},className:ym.newsfeed__pullToRefresh},re.createElement(Cse,null)),re.createElement("div",{className:ym.newsfeed__divider}),re.createElement(w3,{type:"globalFeed",pageId:e}),a.length>0&&re.createElement("div",{className:ym.newsfeed__divider}),re.createElement(W3,{isLoading:l,items:a,pageId:e,componentId:t,onFeedReachBottom:()=>g(),onPostDeleted:y=>f(y.postId)}))};var Q3={postCreationButton:"_d",postCreationButton__icon:"em"};var xse=e=>re.createElement("svg",m({style:{pointerEvents:"none"},width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M13.0002 5.96667C13.5314 5.96667 14.0002 6.43542 14.0002 6.96667V7.96667C14.0002 8.52917 13.5314 8.96667 13.0002 8.96667H8.50016V13.4667C8.50016 14.0292 8.03141 14.4667 7.50016 14.4667H6.50016C5.93766 14.4667 5.50016 14.0292 5.50016 13.4667V8.96667H1.00016C0.437662 8.96667 0.000162125 8.52917 0.000162125 7.96667V6.96667C0.000162125 6.43542 0.437662 5.96667 1.00016 5.96667H5.50016V1.46667C5.50016 0.935425 5.93766 0.466675 6.50016 0.466675H7.50016C8.03141 0.466675 8.50016 0.935425 8.50016 1.46667V5.96667H13.0002Z"}));function O7({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onClick:n}){let i="post_creation_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return c?null:re.createElement(ae,{defaultIcon:()=>re.createElement(z,{style:u,className:Q3.postCreationButton,onPress:n,"data-qa-anchor":a},re.createElement(xse,{className:Kn(Q3.postCreationButton__icon,o)})),imgIcon:()=>re.createElement("img",{src:s.icon,alt:p,className:Kn(Q3.postCreationButton,r),onClick:n,"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon})}var Dd={globalSearchButton:"rm",globalSearchButton__icon:"am",globalSearchButton__svg:"om"};var Ise=e=>re.createElement("svg",m({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M15.7814 14.3104C16.0627 14.6229 16.0627 15.0917 15.7502 15.3729L14.8752 16.2479C14.5939 16.5604 14.1252 16.5604 13.8127 16.2479L10.7189 13.1542C10.5627 12.9979 10.5002 12.8104 10.5002 12.6229V12.0917C9.37516 12.9667 8.00016 13.4667 6.50016 13.4667C2.90641 13.4667 0.000162125 10.5604 0.000162125 6.96667C0.000162125 3.40417 2.90641 0.466675 6.50016 0.466675C10.0627 0.466675 13.0002 3.40417 13.0002 6.96667C13.0002 8.49792 12.4689 9.87292 11.6252 10.9667H12.1252C12.3127 10.9667 12.5002 11.0604 12.6564 11.1854L15.7814 14.3104ZM6.50016 10.9667C8.68766 10.9667 10.5002 9.18542 10.5002 6.96667C10.5002 4.77917 8.68766 2.96667 6.50016 2.96667C4.28141 2.96667 2.50016 4.77917 2.50016 6.96667C2.50016 9.18542 4.28141 10.9667 6.50016 10.9667Z"}));function V7({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n}){let i="global_search_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return c?null:re.createElement(z,{style:u,"data-qa-anchor":a,className:Dd.globalSearchButton,onPress:n},re.createElement(ae,{defaultIcon:()=>re.createElement("div",{className:Dd.globalSearchButton__icon},re.createElement(Ise,{className:Kn(Dd.globalSearchButton__svg,o)})),imgIcon:()=>re.createElement("img",{style:u,src:s.icon,alt:p,className:Kn(Dd.globalSearchButton__icon,r),"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon}))}var ck={headerLabel:"tm"};function U7({pageId:e="*",componentId:t="*"}){let o="header_label",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:o});return a?null:re.createElement(_.Heading,{className:ck.headerLabel,style:l,"data-qa-anchor":r},n.text)}var K3={topNavigation:"im",topNavigationLeftPane:"sm",topNavigationRightPane:"cm"};var g1={socialHomePage:"nm",socialHomePage__topBar:"lm",socialHomePage__topNavigation:"dm",socialHomePage__tabs:"Be",socialHomePage__contents:"He",socialHomePage__createPostMenu:"mm"};var J3={tabButton:"Le",tabButton__text:"gm"};function y1(a){var s=a,{pageId:e="*",componentId:t="*",elementId:o="*",children:r,isActive:n=!1}=s,i=M(s,["pageId","componentId","elementId","children","isActive"]);let{accessibilityId:l,config:c,defaultConfig:p,isExcluded:u,uiReference:f,themeStyles:g}=F({pageId:e,componentId:t,elementId:o});return re.createElement(z,m({style:g,className:J3.tabButton,"data-active":n,"data-qa-anchor":l},i),n?re.createElement(_.Title,{"data-active":n,className:J3.tabButton__text},r):re.createElement(_.Caption,{"data-active":n,className:J3.tabButton__text},r))}function H7({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="newsfeed_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:c,themeStyles:p}=F({pageId:e,componentId:t,elementId:n});return l?null:re.createElement(y1,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}function j7({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="explore_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:c,themeStyles:p}=F({pageId:e,componentId:t,elementId:n});return l?null:re.createElement(y1,{pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r(),"data-qa-anchor":i},a.text)}function G7({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="my_communities_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:c,themeStyles:p}=F({pageId:e,componentId:t,elementId:n});return l?null:re.createElement(y1,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}var X3=(r=>(r.Newsfeed="Newsfeed",r.Explore="Explore",r.MyCommunities="My communities",r))(X3||{});function $7(){let e="social_home_page",{themeStyles:t}=tt({pageId:e}),{scrollPosition:o,onScroll:r}=za(),[n,i]=useState("Newsfeed"),[a,s]=useState(!1),l=useRef(null),c=useRef(!0);useEffect(()=>{l.current&&(l.current.scrollTop=o,setTimeout(()=>{c.current=!1;},100));},[l.current]);let p=()=>{s(f=>!f);},u=f=>{c.current||r(f);};return useEffect(()=>{let f=()=>{a&&s(!1);};a?document.addEventListener("mousedown",f):document.removeEventListener("mousedown",f);},[a]),re.createElement("div",{className:g1.socialHomePage,style:t},re.createElement("div",{className:g1.socialHomePage__topBar},re.createElement("div",{className:g1.socialHomePage__topNavigation},re.createElement(R3,{pageId:e,selectedTab:n,onClickPostCreationButton:p})),re.createElement("div",{className:g1.socialHomePage__tabs},re.createElement(H7,{pageId:e,isActive:n==="Newsfeed",onClick:()=>i("Newsfeed")}),re.createElement(j7,{pageId:e,isActive:n==="Explore",onClick:()=>i("Explore")}),re.createElement(G7,{pageId:e,isActive:n==="My communities",onClick:()=>i("My communities")}))),re.createElement("div",{className:g1.socialHomePage__contents,ref:l,onScroll:u},n==="Newsfeed"&&re.createElement(Y3,{pageId:e}),n==="Explore"&&re.createElement(O2,{isOpen:!1,toggleOpen:()=>{},hideSideMenu:!0}),n==="My communities"&&re.createElement(Z3,{pageId:e})),a&&re.createElement("div",{className:g1.socialHomePage__createPostMenu},re.createElement(S3,{pageId:e})))}function R3({pageId:e="*",selectedTab:t,onClickPostCreationButton:o}){let r="top_navigation",{goToSocialGlobalSearchPage:n,goToMyCommunitiesSearchPage:i}=ot(),{isExcluded:a,themeStyles:s}=te({pageId:e,componentId:r}),l=()=>{switch(t){case"Newsfeed":n();break;case"Explore":break;case"My communities":i();break}};return a?null:re.createElement("div",{className:K3.topNavigation,style:s},re.createElement("div",{className:K3.topNavigationLeftPane},re.createElement(U7,{pageId:e,componentId:r})),re.createElement("div",{className:K3.topNavigationRightPane},re.createElement(V7,{pageId:e,componentId:r,onPress:l}),t!=="Explore"&&re.createElement(O7,{pageId:e,componentId:r,onClick:o})))}var Ese=w1`
|
|
3787
|
+
`;var Ai=e=>re.createElement(HN,m({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"}));function pae(e){return e.fileId!==void 0}function Ad({files:e=[],uploadedFiles:t=[],onChange:o=i=>{},onLoadingChange:r=i=>{},onError:n=i=>{}}){let[i,a]=useState([]),s=useMemo(()=>Array.isArray(e)?e:Array.from(e),[e]),l=useCallback(()=>{o({uploaded:[],uploading:[]});},[o]),c=useCallback(()=>{a([]);},[]),p=useCallback((f,g)=>{if(pae(f)){let y=t.filter(h=>h.fileId!==f.fileId);o({uploaded:y,uploading:s});}else if(g!==void 0){let y=t.filter((h,C)=>C!==g);o({uploaded:y,uploading:s});}else {let y=s.filter(h=>h.name!==f.name);o({uploaded:t,uploading:y});}},[o,t,s]);return useEffect(()=>{if(!s.length)return;function f(){return S(this,null,function*(){r(!0);try{let g=yield Promise.all(s.map(h=>S(this,null,function*(){let C=new FormData;C.append("files",h);let v=yield S(this,null,function*(){if(h.type.includes(FileType.IMAGE))return FileRepository.createImage(C);if(h.type.includes(FileType.VIDEO))return FileRepository.createVideo(C)});return v&&v.data.length>0?v.data[0]:null}))),y=[...t,...g].filter(Ze);o({uploaded:y,uploading:[]}),a([]);}catch(g){a(s.map(y=>y.name)),n(!0);}finally{r(!1);}})}f();},[s]),{allFiles:[...t,...s],uploading:s,uploaded:t,removeFile:p,reset:l,rejected:i,retry:c}}function g7({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,uploadLoading:n,onError:i,isErrorUpload:a}){let s=Ad({files:e,uploadedFiles:t,onChange:o,onLoadingChange:r,onError:i}),{allFiles:l,removeFile:c}=s;return l.length===0?null:l&&re.createElement("div",{"data-images-amount":Math.min(l.length,3),className:s1.thumbnail__container},l==null?void 0:l.map((p,u)=>{var f;return re.createElement("div",{key:u,"data-images-height":l.length>2,className:s1.thumbnail__wrapper},n?re.createElement("div",{className:s1.icon__status},re.createElement(Ai,null)):a?re.createElement("div",{className:s1.icon__status},re.createElement(Ft,null)):re.createElement(re.Fragment,null,re.createElement("img",{className:s1.thumbnail,src:FileRepository.fileUrlWithSize(p==null?void 0:p.fileUrl,"medium"),alt:(f=p.attributes)==null?void 0:f.name}),re.createElement("button",{type:"reset",onClick:()=>c(p)},re.createElement(ho,{className:s1.closeIcon}))))}))}var Li={thumbnail__container:"p",thumbnail__wrapper:"jl",thumbnail__wrapper_item_3:"zl",thumbnail:"Xl",closeIcon:"Yl",icon__status:"Al",playIcon:"Cl"};var y7=({files:e,uploadedFiles:t,onLoadingChange:o,onChange:r,uploadLoading:n,onError:i,videoThumbnail:a,removeThumbnail:s,isErrorUpload:l})=>{let c=Ad({files:e,uploadedFiles:t,onChange:r,onLoadingChange:o,onError:i}),{allFiles:p,removeFile:u}=c;if(p.length===0)return null;let f=(g,y)=>{u(g,y),s(y);};return a?re.createElement("div",{"data-images-amount":Math.min(a.length,3),className:Li.thumbnail__container},a==null?void 0:a.map((g,y)=>re.createElement("div",{key:g.videoUrl,className:Kn(Li.thumbnail__wrapper,a.length>2&&Li.thumbnail__wrapper_item_3)},n?re.createElement("div",{className:Li.icon__status},re.createElement(Ai,null)):l?re.createElement("div",{className:Li.icon__status},re.createElement(Ft,null)):re.createElement(re.Fragment,null,re.createElement("img",{className:Li.thumbnail,src:g.thumbnail}),re.createElement("button",{type:"reset",onClick:()=>{f(g.file,y);}},re.createElement(ho,{className:Li.closeIcon})),re.createElement("div",{className:Li.playIcon},re.createElement(yo,null)))))):null};function x7({community:e,targetType:t,targetId:o}){let r="post_composer_page",{themeStyles:n}=tt({pageId:r}),i="6.75rem",a="8.5rem",s="11rem",l="14.5rem",c=useRef(null),{AmityPostComposerPageBehavior:p}=At(),{confirm:u}=$e(),[f,g]=useState(i),[y]=useState(!0),h=useRef(null),{prependItem:C}=za(),[v,w]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),[x,P]=useState([]),[b,I]=useState([]),[T,N]=useState([]),[B,D]=useState([]),[A,q]=useState(!1),[$,U]=useState([]),[Q,G]=useState(!1),[L,O]=useState(!0),[j,Z]=useState(!0),[K,E]=useState(!1),[V,Y]=useState([]),ee=useRef(null),pe=()=>useMutation({mutationFn:ye=>S(this,null,function*(){return PostRepository.createPost(ye)}),onSuccess:ye=>{var ft;(ft=p==null?void 0:p.goToSocialHomePage)==null||ft.call(p),C(ye.data);},onError:ye=>{console.error("Failed to create post",ye);}}),{mutateAsync:ce,isPending:je,isError:Lt}=pe(),{handleSubmit:Ne}=useForm(),$o=()=>{let ye=x.map(ko=>({type:"image",fileId:ko.fileId})),ft=b.map(ko=>({type:"video",fileId:ko.fileId})),_n=[...ye,...ft];ce({targetId:o,targetType:t,data:{text:v.text},dataType:"text",metadata:{mentioned:v.mentioned},mentionees:v.mentionees,attachments:_n});},po=ye=>{w(ye);},Ja=ye=>{f===i&&ye==="0px"||g(ye);},Xa=()=>{u({pageId:r,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{var ye;(ye=p==null?void 0:p.goToSocialHomePage)==null||ye.call(p);},okText:"Discard",cancelText:"Keep editing"});};useEffect(()=>{x.length>0?(O(!0),Z(!1)):b.length>0&&V.length>0?(O(!1),Z(!0)):(x.length==0||V.length==0)&&(O(!0),Z(!0));},[x,b,L,j,V]),useEffect(()=>{PN()?G(!0):G(!1);},[]),useEffect(()=>{g(!Q&&L&&j||Q&&L&&!j||Q&&!L&&j?s:!Q&&L&&!j||!Q&&!L&&j?a:l);},[Q,L,j]);let en=ye=>{Y(ft=>ft.filter((_n,ko)=>ko!==ye));},Sn=ye=>{if(ye.length+$.length>10){u({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 images. Any additional images will not be saved. ",okText:"Close"});return}ye.length>0&&(U(ft=>[...ft,...ye]),N(ye));},ri=ye=>S(this,null,function*(){let ft=V?V.length:0;if(ye.length+ft>10){u({pageId:r,type:"info",title:"Maximum upload limit reached",content:"You\u2019ve reached the upload limit of 10 videos. Any additional videos will not be saved. ",okText:"Close"});return}if(ye.length>0){D==null||D(ye);let _n=ye.map(uo=>({file:uo,videoUrl:URL.createObjectURL(uo),thumbnail:void 0})),ko=yield Promise.all(_n.map(uo=>S(this,null,function*(){let ni=yield SN(uo.file);return k(m({},uo),{thumbnail:ni})})));Y(uo=>[...uo,...ko]);}});return re.createElement("div",{className:Ei.createPost,style:n},re.createElement("form",{onSubmit:Ne($o),"data-from-media":f==i,className:Ei.createPost__formMediaAttachment},re.createElement("div",{className:Ei.createPost__topBar},re.createElement(sr,{pageId:r,onPress:Xa}),re.createElement(_i,{pageId:r,community:e}),re.createElement(c7,{pageId:r,onSubmit:Ne($o),isValid:v.text.length>0||x.length>0||b.length>0})),re.createElement(Ed,{ref:c,onChange:po,communityId:o,onChangeSnap:f==i?0:f==l?2:1,mentionContainer:ee.current,dataValue:{data:{text:v.text}}}),re.createElement(g7,{files:T,uploadedFiles:x,uploadLoading:A,onLoadingChange:q,onChange:({uploaded:ye,uploading:ft})=>{P(ye),N(ft);},onError:E,isErrorUpload:K}),re.createElement("div",{ref:ee}),re.createElement(y7,{files:B,uploadedFiles:b,uploadLoading:A,onLoadingChange:q,onChange:({uploaded:ye,uploading:ft})=>{I(ye),D(ft);},onError:E,isErrorUpload:K,videoThumbnail:V,removeThumbnail:en}),re.createElement("div",{ref:ee})),re.createElement("div",{ref:h}),h.current?Ite.createPortal(re.createElement(Drawer.Root,{snapPoints:[i,a,s,l],activeSnapPoint:f,setActiveSnapPoint:Ja,open:y,modal:!1},re.createElement(Drawer.Portal,{container:h.current},re.createElement(Drawer.Content,{className:Ei.drawer__content},re.createElement("div",{className:Ei.createPost__notiWrap},je&&re.createElement(ms,{content:"Posting...",icon:re.createElement(Ai,null),className:Ei.createPost__status}),Lt&&re.createElement(ms,{content:"Failed to create post",icon:re.createElement(N1,{className:Ei.createPost_infoIcon}),className:Ei.createPost__status,duration:3e3})),f==a||f==s||f==l?re.createElement(k3,{pageId:r,isVisibleCamera:Q,isVisibleImage:L,isVisibleVideo:j,onVideoFileChange:ri,onImageFileChange:Sn}):re.createElement(N3,{pageId:r,isVisibleCamera:Q,isVisibleImage:L,isVisibleVideo:j,onVideoFileChange:ri,onImageFileChange:Sn})))),h.current):null)}var ja={editPost:"Ml",editPost__topBar:"Sl",editPost__status:"El",editPost_infoIcon:"Fl",editPost__notiWrap:"Il",editPost__formMediaAttachment:"Me",drawer__content:"Rl"};var $N={editPostButton:"Se"};function b7(r){var n=r,{pageId:e="*",componentId:t="*"}=n,o=M(n,["pageId","componentId"]);let i="edit_post_button",{config:a,isExcluded:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:i});return s?null:re.createElement(z,m({style:l,className:$N.editPostButton},o),a.text)}var ZN={editPostTitle:"Ul"};function I7({pageId:e="*",componentId:t="*"}){let o="edit_post_title",{config:r,isExcluded:n,themeStyles:i}=F({pageId:e,componentId:t,elementId:o});return n?null:re.createElement("div",{style:i,className:ZN.editPostTitle},r.text)}var Tae=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return S(this,null,function*(){if(!e||(e==null?void 0:e.length)===0)return;let n=yield PostRepository.getPostByIds(e);o(n.data);})}r();},[e]),t},qN=Tae;var l1={thumbnail__container:"f",thumbnail__wrapper:"Ee",thumbnail:"Bl",thumbnail__closeButton:"Hl",thumbnail__closeIcon:"Ll",icon__status:"Tl",playIcon:"Vl"};var kae=({fieldId:e,onRemove:t,type:o})=>{let r=Je({fileId:e});return r?re.createElement(re.Fragment,null,re.createElement("img",{className:l1.thumbnail,src:r,alt:"thumbnail"}),re.createElement(z,{type:"reset",onPress:()=>t(),className:l1.thumbnail__closeButton},re.createElement(ho,{className:l1.thumbnail__closeIcon})),o===PostContentType.VIDEO&&re.createElement("div",{className:l1.playIcon,"data-image":"test"},re.createElement(yo,null))):null},w7=({postMedia:e,onRemove:t})=>e.length==0?null:re.createElement("div",{"data-images-amount":Math.min(e.length,3),className:l1.thumbnail__container},e==null?void 0:e.map((o,r)=>re.createElement("div",{key:r,"data-images-height":e.length>2,className:l1.thumbnail__wrapper},re.createElement(kae,{type:o.dataType,key:r,fieldId:o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.thumbnailFileId,onRemove:()=>t(o.dataType===PostContentType.IMAGE?o.data.fileId:o.data.videoFileId.original)}))));var P7=(e,t)=>{if(e.length!==t.length)return !1;let o=[...e].sort(),r=[...t].sort();for(let n=0;n<o.length;n++)if(o[n]!==r[n])return !1;return !0};function S7({post:e}){var Q;let t="post_composer_page",{themeStyles:o}=tt({pageId:t}),r=useRef(null),{AmityPostComposerPageBehavior:n}=At(),{confirm:i}=$e(),{updateItem:a}=za(),[s,l]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),[c,p]=useState([]),[u,f]=useState([]),[g,y]=useState([]),[h,C]=useState([]),v=useRef(null),w=()=>useMutation({mutationFn:G=>S(this,null,function*(){return yield PostRepository.editPost(e.postId,G)}),onSuccess:G=>{var L;(L=n==null?void 0:n.goToSocialHomePage)==null||L.call(n),a(G.data);},onError:G=>{console.error("Failed to edit post",G);}}),{mutateAsync:x,isPending:P,isError:b}=w(),{handleSubmit:I}=useForm(),T=qN((e==null?void 0:e.children)||[]);useEffect(()=>{let G=T.filter(O=>O.dataType==="image");y(G),p(G);let L=T.filter(O=>O.dataType==="video");C(L),f(L);},[T]);let N=G=>{p(L=>L.filter(O=>O.data.fileId!==G));},B=G=>{f(L=>L.filter(O=>O.data.videoFileId.original!==G));},D=()=>{var j,Z;let G=c.map(K=>({fileId:K.data.fileId,type:PostContentType.IMAGE})),L=u.map(K=>({fileId:K.data.videoFileId.original,type:"video"})),O=[...G,...L];s&&x({data:{text:s.text},metadata:{mentioned:(j=s.mentioned)!=null?j:[]},mentionees:(Z=s.mentionees)!=null?Z:[],attachments:O});},A=G=>{l(G);},q=()=>{i({pageId:t,type:"confirm",title:"Discard this post?",content:"The post will be permanently deleted. It cannot be undone.",onOk:()=>{var G;(G=n==null?void 0:n.goToSocialHomePage)==null||G.call(n);},okText:"Discard",cancelText:"Keep editing"});},$=!P7(g,c),U=!P7(h,u);return re.createElement("div",{className:ja.editPost,style:o},re.createElement("form",{onSubmit:I(D),className:ja.editPost__formMediaAttachment},re.createElement("div",{className:ja.editPost__topBar},re.createElement(sr,{pageId:t,onPress:q}),re.createElement(I7,{pageId:t}),re.createElement(b7,{pageId:t,type:"submit",onPress:()=>I(D),isDisabled:e.data.text==s.text&&!$&&!U||!(s.text.length>0||c.length>0||u.length>0)})),re.createElement(Ed,{ref:r,onChange:A,mentionContainer:v.current,dataValue:{data:{text:e.data.text},metadata:{mentioned:((Q=e.metadata)==null?void 0:Q.mentioned)||[]},mentionees:e.mentionees}}),re.createElement(w7,{postMedia:c,onRemove:N}),re.createElement(w7,{postMedia:u,onRemove:B}),re.createElement("div",{ref:v}),re.createElement("div",{className:ja.editPost__notiWrap},P&&re.createElement(ms,{content:"Posting...",icon:re.createElement(Ai,null),className:ja.editPost__status}),b&&re.createElement(ms,{content:"Failed to edit post",icon:re.createElement(Ft,{className:ja.editPost_infoIcon}),className:ja.editPost__status,duration:3e3}))))}var Dae=e=>e.mode==="create";function _7(e){if(Dae(e)){let{targetId:t,targetType:o,community:r}=e;return re.createElement(x7,{mode:"create",targetId:t,targetType:o,community:r})}else {let{post:t}=e;return re.createElement(S7,{mode:"edit",post:t})}}var Uae=e=>re.createElement("svg",m({width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M18.3804 2.25391C19.2593 3.13281 19.2593 4.53906 18.3804 5.41797L15.7437 8.05469L14.5483 9.25L5.97021 17.8281L1.9624 18.25C1.92725 18.25 1.89209 18.25 1.85693 18.25C1.36475 18.25 0.978027 17.8281 1.04834 17.3359L1.47021 13.3281L10.0483 4.75L11.2437 3.55469L13.8804 0.917969C14.3022 0.496094 14.8999 0.25 15.4624 0.25C16.0249 0.25 16.6226 0.496094 17.0444 0.917969L18.3804 2.25391ZM5.19678 16.2109L13.353 8.08984L14.4429 7L12.2983 4.85547L11.2085 5.94531L3.0874 14.1016L2.84131 16.457L5.19678 16.2109ZM17.1851 4.22266C17.396 4.01172 17.396 3.66016 17.1851 3.44922L15.8491 2.11328C15.7085 1.97266 15.5327 1.9375 15.4624 1.9375C15.3921 1.9375 15.2163 1.97266 15.0757 2.11328L13.4937 3.66016L15.6382 5.80469L17.1851 4.22266Z"})),zae=e=>re.createElement("svg",m({width:"16",height:"19",viewBox:"0 0 16 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M15.3608 3.0625C15.6421 3.0625 15.9233 3.34375 15.9233 3.625V4.1875C15.9233 4.50391 15.6421 4.75 15.3608 4.75H14.7983L14.0249 16.668C13.9897 17.5469 13.2163 18.25 12.3374 18.25H3.72412C2.84521 18.25 2.07178 17.5469 2.03662 16.668L1.29834 4.75H0.73584C0.419434 4.75 0.17334 4.50391 0.17334 4.1875V3.625C0.17334 3.34375 0.419434 3.0625 0.73584 3.0625H3.61865L4.81396 1.09375C5.09521 0.636719 5.72803 0.25 6.25537 0.25H9.80615C10.3335 0.25 10.9663 0.636719 11.2476 1.09375L12.4429 3.0625H15.3608ZM6.25537 1.9375L5.5874 3.0625H10.4741L9.80615 1.9375H6.25537ZM12.3374 16.5625L13.0757 4.75H2.98584L3.72412 16.5625H12.3374Z"})),Hae=e=>re.createElement("svg",m({width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M12.3125 3.0625C13.543 3.0625 14.8789 2.64062 16.1445 2.07812C17.2344 1.62109 18.5 2.42969 18.5 3.625V12.0625C18.5 12.6602 18.1836 13.1875 17.7266 13.5039C16.7773 14.1016 15.2656 14.875 13.1914 14.875C10.8008 14.875 9.21875 13.75 7.49609 13.75C5.52734 13.75 4.33203 14.1719 3.03125 14.7695V17.6875C3.03125 18.0039 2.75 18.25 2.46875 18.25H1.90625C1.58984 18.25 1.34375 18.0039 1.34375 17.6875V3.41406C0.816406 3.13281 0.5 2.57031 0.5 1.9375C0.5 0.988281 1.30859 0.214844 2.29297 0.285156C3.10156 0.320312 3.76953 0.953125 3.83984 1.76172C3.83984 1.79688 3.875 1.90234 3.875 1.9375C3.875 2.11328 3.80469 2.35938 3.76953 2.5C4.54297 2.18359 5.49219 1.9375 6.61719 1.9375C9.00781 1.9375 10.5898 3.0625 12.3125 3.0625ZM16.8125 12.0625V3.625C15.6875 4.15234 13.8242 4.75 12.3125 4.75C10.2031 4.75 8.72656 3.625 6.61719 3.625C5.14062 3.625 3.76953 4.22266 3.03125 4.75V12.9062C4.12109 12.4141 5.98438 12.0625 7.49609 12.0625C9.60547 12.0625 11.082 13.1875 13.1914 13.1875C14.668 13.1875 16.0391 12.625 16.8125 12.0625Z"})),$3=({post:e,pageId:t="*",componentId:o="*",elementId:r="*",onCloseMenu:n,onPostDeleted:i})=>{let{success:a,error:s}=Co(),l=useMemo(()=>(e==null?void 0:e.targetType)==="community",[e==null?void 0:e.targetType]),{community:c}=xi({communityId:e==null?void 0:e.targetId,shouldCall:l}),{isCommunityModerator:p,isOwner:u}=IN({post:e,community:c}),{AmityPostContentComponentBehavior:f}=At(),{removeDrawerData:g}=cm(),{showEditPostButton:y,showDeletePostButton:h,showReportPostButton:C}=useMemo(()=>p?u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:u?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!1,showReportPostButton:!0},[p,u]),{isFlaggedByMe:v,isLoading:w,mutateReportPost:x,mutateUnReportPost:P}=wN({post:e,isFlaggable:C,onReportSuccess:()=>{a({content:"Post reported"});},onReportError:()=>{s({content:"Failed to report post"});},onUnreportSuccess:()=>{a({content:"Post unreported"});},onUnreportError:()=>{s({content:"Failed to unreport post"});}}),{confirm:b}=$e(),{mutateAsync:I}=useMutation({mutationFn:()=>S(void 0,null,function*(){return n(),PostRepository.hardDeletePost(e.postId)}),onSuccess:()=>{a({content:"Post deleted"}),i==null||i(e);},onError:()=>{s({content:"Failed to delete post"});}}),T=()=>{n(),b({title:"Delete post",content:"This post will be permanently deleted.",cancelText:"Cancel",okText:"Delete",onOk:()=>I(),pageId:t,componentId:o});};return re.createElement("div",{className:vn.postMenu},C&&!w?re.createElement(z,{className:vn.postMenu__item,onPress:()=>{v?P():x();}},re.createElement(Hae,{className:vn.postMenu__reportPost__icon}),re.createElement("span",{className:vn.postMenu__reportPost__text},v?"Unreport post":"Report post")):null,y?re.createElement(z,{className:vn.postMenu__item,onPress:()=>{var N;g(),(N=f==null?void 0:f.goToPostComposerPage)==null||N.call(f,{mode:"edit",post:e});}},re.createElement(Uae,{className:vn.postMenu__editPost__icon}),re.createElement("span",{className:vn.postMenu__editPost__text},"Edit post")):null,h?re.createElement(z,{className:vn.postMenu__item,onPress:()=>T()},re.createElement(zae,{className:vn.postMenu__deletePost__icon}),re.createElement("span",{className:vn.postMenu__deletePost__text},"Delete post")):null)};var XN=({post:e,community:t})=>{let{currentUserId:o}=Ee(),r=useMemo(()=>(e==null?void 0:e.targetType)==="community"&&(e==null?void 0:e.targetId)===(t==null?void 0:t.communityId),[e==null?void 0:e.targetType,t==null?void 0:t.communityId]),{moderators:n}=Nd({communityId:t==null?void 0:t.communityId,shouldCall:r}),i=useMemo(()=>r?n.some(s=>s.userId===(e==null?void 0:e.postedUserId)):!1,[n,r,e==null?void 0:e.postedUserId]),a=(e==null?void 0:e.postedUserId)===o;return {isCommunityModerator:i,isOwner:a}};var RN=({threshold:e,elementRef:t})=>{let[o,r]=useState(!1);return useEffect(()=>{if(!t.current)return;let n=new IntersectionObserver(i=>{i.forEach(a=>{let s=a.isIntersecting;r(s);});},{threshold:e});return n.observe(t.current),()=>{n.disconnect();}},[e,t]),{isVisible:o}};var Wae=({pageId:e,post:t})=>{let o=useMemo(()=>(t==null?void 0:t.targetType)==="community",[t==null?void 0:t.targetType]),{community:r}=xi({communityId:t==null?void 0:t.targetId,shouldCall:o}),{user:n}=Mo(t.postedUserId),{onClickCommunity:i,onClickUser:a}=ot();return r?re.createElement("div",{className:Pe.postTitle},n&&re.createElement(z,{onPress:()=>a(n.userId)},re.createElement(_.BodyBold,{className:Pe.postTitle__text},n.displayName)),r&&re.createElement(re.Fragment,null,re.createElement(Sd,{className:Pe.postTitle__icon}),re.createElement(z,{onPress:()=>{i(r.communityId);}},re.createElement(_.BodyBold,{className:Pe.postTitle__text},r.displayName)))):re.createElement(z,{onPress:()=>n&&a(n.userId)},re.createElement(_.BodyBold,{className:Pe.postTitle__text},n==null?void 0:n.displayName))};var Yae=({post:e,onImageClick:t,onVideoClick:o})=>re.createElement(re.Fragment,null,re.createElement(l7,{post:e,onImageClick:t}),re.createElement(m7,{post:e,onVideoClick:o})),um=({pageId:e="*",post:t,type:o,drawerRef:r,onClick:n,onPostDeleted:i})=>{var Lt;let a="post_content",{themeStyles:s}=te({pageId:e,componentId:a}),{post:l}=Wr(t==null?void 0:t.postId),{setDrawerData:c,removeDrawerData:p}=cm(),[u,f]=useState(!1),[g,y]=useState(!1),[h,C]=useState(!1),[v,w]=useState(null),[x,P]=useState(null),[b,I]=useState(null),[T,N]=useState(0),{page:B}=ot(),D=useRef(null),A=useMemo(()=>{if(t!=null&&l!=null)return Zr(t==null?void 0:t.updatedAt).unix()>Zr(l==null?void 0:l.updatedAt).unix()?t:l;if(l!=null)return l;if(t!=null)return t},[t,l]);pd({postId:A==null?void 0:A.postId,level:SubscriptionLevels.POST,shouldSubscribe:u});let q=useMemo(()=>(A==null?void 0:A.targetType)==="community",[A==null?void 0:A.targetType]),{community:$}=xi({communityId:A==null?void 0:A.targetId,shouldCall:q}),{isCommunityModerator:U}=XN({post:A,community:$});useEffect(()=>{var Ne;A!=null&&I(((Ne=A.myReactions)==null?void 0:Ne[0])||null);},[A==null?void 0:A.myReactions]),useEffect(()=>{A!=null&&N((A==null?void 0:A.reactionsCount)||0);},[A==null?void 0:A.reactionsCount]);let{mutateAsync:Q}=useMutation({mutationFn:Ne=>S(void 0,null,function*(){if(b&&b!==Ne)try{yield ReactionRepository.removeReaction("post",A==null?void 0:A.postId,b);}catch($o){console.log();}return ReactionRepository.addReaction("post",A==null?void 0:A.postId,Ne)}),onMutate:Ne=>{f(!0),N(T+1),I(Ne);}}),{mutateAsync:G}=useMutation({mutationFn:Ne=>S(void 0,null,function*(){return ReactionRepository.removeReaction("post",A==null?void 0:A.postId,Ne)}),onMutate:()=>{f(!0),N(Math.max(0,T-1)),I(null);}}),L=Ne=>{b?G(b):Q(Ne);},O=Ne=>{y(!0),w(Ne);},j=()=>{y(!1),w(null);},Z=Ne=>{C(!0),P(Ne);},K=()=>{C(!1),P(null);},E=(A==null?void 0:A.reactions.like)>0,V=(A==null?void 0:A.reactions.love)>0,Y=(A==null?void 0:A.reactions.fire)>0,ee=(A==null?void 0:A.reactions.happy)>0,pe=(A==null?void 0:A.reactions.crying)>0,ce=E||V||Y||ee||pe,{isVisible:je}=RN({threshold:.6,elementRef:D});return useEffect(()=>{var Ne;B.type!=="PostDetailPage"&&je&&((Ne=A.analytics)==null||Ne.markAsViewed());},[A,je,B.type]),re.createElement("div",{ref:D,className:Pe.postContent,style:s},re.createElement("div",{className:Pe.postContent__bar,"data-type":o},re.createElement("div",{className:Pe.postContent__bar__userAvatar},re.createElement(ro,{userId:A==null?void 0:A.postedUserId})),re.createElement("div",null,re.createElement("div",null,re.createElement(Wae,{post:A})),re.createElement("div",{className:Pe.postContent__bar__information__subtitle},U?re.createElement("div",{className:Pe.postContent__bar__information__subtitle__moderator},re.createElement(Qs,{pageId:e,componentId:a}),re.createElement("span",{className:Pe.postContent__bar__information__subtitle__separator},"\u2022")):null,re.createElement(Ks,{timestamp:A.createdAt}),A.createdAt!==A.editedAt&&re.createElement(_.Caption,{className:Pe.postContent__bar__information__editedTag},"(edited)"))),re.createElement("div",{className:Pe.postContent__bar__actionButton},o==="feed"?re.createElement(Pd,{pageId:e,componentId:a,onClick:()=>c({content:re.createElement($3,{post:A,onCloseMenu:()=>p(),pageId:e,componentId:a,onPostDeleted:i})})}):null)),re.createElement("div",{className:Pe.postContent__content_and_reactions},re.createElement("div",{className:Pe.postContent__content},re.createElement(s7,{text:A.data.text,mentionees:(Lt=A==null?void 0:A.metadata)==null?void 0:Lt.mentioned}),A.children.length>0?re.createElement(Yae,{post:A,onImageClick:O,onVideoClick:Z}):null),o==="detail"?re.createElement("div",{className:Pe.postContent__reactions_and_comments},re.createElement("div",{className:Pe.postContent__reactionsBar,onClick:()=>c({content:re.createElement(tm,{pageId:e,referenceId:A.postId,referenceType:"post"})})},ce?re.createElement("div",{className:Pe.postContent__reactionsBar__reactions},pe&&re.createElement(aN,{className:Pe.postContent__reactionsBar__reactions__icon}),ee&&re.createElement(sN,{className:Pe.postContent__reactionsBar__reactions__icon}),Y&&re.createElement(lN,{className:Pe.postContent__reactionsBar__reactions__icon}),V&&re.createElement(mN,{className:Pe.postContent__reactionsBar__reactions__icon}),E&&re.createElement(dN,{className:Pe.postContent__reactionsBar__reactions__icon})):null,re.createElement(_.Caption,{className:Pe.postContent__reactionsBar__reactions__count},`${ov((A==null?void 0:A.reactionsCount)||0)} ${(A==null?void 0:A.reactionsCount)===1?"like":"likes"}`)),re.createElement(_.Caption,{className:Pe.postContent__commentsCount},`${(A==null?void 0:A.commentsCount)||0} ${(A==null?void 0:A.commentsCount)===1?"comment":"comments"}`)):null,re.createElement("div",{className:Pe.postContent__divider}),re.createElement("div",{className:Pe.postContent__reactionBar},re.createElement("div",{className:Pe.postContent__reactionBar__leftPane},re.createElement(e3,{pageId:e,componentId:a,reactionsCount:o==="feed"?T:void 0,myReaction:b,defaultIconClassName:Pe.postContent__reactionBar__leftPane__icon,imgIconClassName:Pe.postContent__reactionBar__leftPane__iconImg,onReactionClick:L}),re.createElement(o7,{pageId:e,componentId:a,commentsCount:o==="feed"?A.commentsCount:void 0,defaultIconClassName:Pe.postContent__reactionBar__leftPane__icon,imgIconClassName:Pe.postContent__reactionBar__leftPane__iconImg,onPress:()=>n==null?void 0:n()})),re.createElement("div",{className:Pe.postContent__reactionBar__rightPane},re.createElement(t7,{pageId:e,componentId:a})))),g&&typeof v=="number"?re.createElement(CN,{post:A,onClose:j,initialImageIndex:v}):null,h&&typeof x=="number"?re.createElement(xN,{post:A,onClose:K,initialVideoIndex:x}):null)};var bt={postContentSkeleton:"ql",postContentSkeleton__bar:"Dl",postContentSkeleton__bar__information:"Gl",postContentSkeleton__content:"Jl",postContentSkeleton__animation:"Kl","skeleton-pulse":"Fe",postContentSkeleton__bar__userAvatar:"Nl",postContentSkeleton__bar__information__title:"Ol",postContentSkeleton__bar__information__subtitle:"Pl",postContentSkeleton__content__bar1:"Ql",postContentSkeleton__content__bar2:"Wl",postContentSkeleton__content__bar3:"Zl"};var Bd=({pageId:e="*"})=>{let t="post_content",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return re.createElement("div",{"data-qa-anchor":o,style:s,className:Kn(bt.postContentSkeleton,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__bar,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__userAvatar,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__information,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__information__title,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__bar__information__subtitle,bt.postContentSkeleton__animation)}))),re.createElement("div",{className:Kn(bt.postContentSkeleton__content,bt.postContentSkeleton__animation)},re.createElement("div",{className:Kn(bt.postContentSkeleton__content__bar1,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__content__bar2,bt.postContentSkeleton__animation)}),re.createElement("div",{className:Kn(bt.postContentSkeleton__content__bar3,bt.postContentSkeleton__animation)})))};function d1({queryParams:e,shouldCall:t=!0}){let n=oo({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=n,r=M(n,["items"]);return m({communities:o},r)}var ok={myCommunitiesList:"_l"};var Z3=({pageId:e="*"})=>{let t="my_communities",{themeStyles:o}=te({pageId:e,componentId:t}),{communities:r,hasMore:n,loadMore:i,isLoading:a}=d1({queryParams:{sortBy:"displayName",limit:20,membership:"member"}});return re.createElement("div",{style:o,className:ok.myCommunitiesList},re.createElement(Da,{pageId:e,communityCollection:r,isLoading:a,onLoadMore:()=>{n&&a===!1&&i();}}))};var Xae=()=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},re.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),re.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),re.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),re.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),re.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),re.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),re.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),re.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),re.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),re.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),re.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),re.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),re.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),Rae=()=>re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"160",viewBox:"0 0 161 160",fill:"none"},re.createElement("path",{d:"M130.452 24H34.4521C30.0339 24 26.4521 27.5817 26.4521 32V128C26.4521 132.418 30.0339 136 34.4521 136H130.452C134.87 136 138.452 132.418 138.452 128V32C138.452 27.5817 134.87 24 130.452 24Z",fill:"#EBECEF"}),re.createElement("path",{d:"M44.0522 67.7H44.5522H152.052C152.981 67.7 153.871 68.0688 154.527 68.7251C155.184 69.3815 155.552 70.2718 155.552 71.2V91.2C155.552 92.1283 155.184 93.0185 154.527 93.6749C153.871 94.3313 152.981 94.7 152.052 94.7H44.0522C43.124 94.7 42.2337 94.3313 41.5774 93.6749C40.921 93.0185 40.5522 92.1283 40.5522 91.2V71.2C40.5522 70.2718 40.921 69.3815 41.5774 68.7251C42.2337 68.0688 43.124 67.7 44.0522 67.7Z",fill:"white",stroke:"#EBECEF"}),re.createElement("path",{opacity:"0.3",d:"M91.2523 73.6H70.4522C69.1268 73.6 68.0522 74.6745 68.0522 76C68.0522 77.3255 69.1268 78.4 70.4522 78.4H91.2523C92.5777 78.4 93.6523 77.3255 93.6523 76C93.6523 74.6745 92.5777 73.6 91.2523 73.6Z",fill:"#A5A9B5"}),re.createElement("path",{opacity:"0.15",d:"M105.652 84H70.4522C69.1268 84 68.0522 85.0745 68.0522 86.4C68.0522 87.7255 69.1268 88.8 70.4522 88.8H105.652C106.978 88.8 108.052 87.7255 108.052 86.4C108.052 85.0745 106.978 84 105.652 84Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M54.0521 88.8C58.2495 88.8 61.6521 85.3974 61.6521 81.2C61.6521 77.0027 58.2495 73.6 54.0521 73.6C49.8548 73.6 46.4521 77.0027 46.4521 81.2C46.4521 85.3974 49.8548 88.8 54.0521 88.8Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M9.65234 102.1H10.1523H117.652C118.581 102.1 119.471 102.469 120.127 103.125C120.784 103.782 121.152 104.672 121.152 105.6V125.6C121.152 126.528 120.784 127.419 120.127 128.075C119.471 128.731 118.581 129.1 117.652 129.1H9.65234C8.72409 129.1 7.83385 128.731 7.17747 128.075C6.52109 127.419 6.15234 126.528 6.15234 125.6V105.6C6.15234 104.672 6.52109 103.782 7.17747 103.125C7.83385 102.469 8.72409 102.1 9.65234 102.1Z",fill:"white",stroke:"#EBECEF"}),re.createElement("path",{opacity:"0.3",d:"M56.8523 108H36.0523C34.7269 108 33.6523 109.075 33.6523 110.4C33.6523 111.725 34.7269 112.8 36.0523 112.8H56.8523C58.1778 112.8 59.2523 111.725 59.2523 110.4C59.2523 109.075 58.1778 108 56.8523 108Z",fill:"#A5A9B5"}),re.createElement("path",{opacity:"0.15",d:"M71.2523 118.4H36.0523C34.7269 118.4 33.6523 119.475 33.6523 120.8C33.6523 122.126 34.7269 123.2 36.0523 123.2H71.2523C72.5778 123.2 73.6523 122.126 73.6523 120.8C73.6523 119.475 72.5778 118.4 71.2523 118.4Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M19.6522 123.2C23.8496 123.2 27.2522 119.797 27.2522 115.6C27.2522 111.403 23.8496 108 19.6522 108C15.4549 108 12.0522 111.403 12.0522 115.6C12.0522 119.797 15.4549 123.2 19.6522 123.2Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M9.65234 33.3H117.652C119.585 33.3 121.152 34.867 121.152 36.8V56.8C121.152 58.733 119.585 60.3 117.652 60.3H9.65234C7.71935 60.3 6.15234 58.733 6.15234 56.8V36.8C6.15234 34.867 7.71935 33.3 9.65234 33.3Z",fill:"white",stroke:"#EBECEF"}),re.createElement("path",{opacity:"0.3",d:"M55.2522 39.2H34.4522C33.1268 39.2 32.0522 40.2745 32.0522 41.6C32.0522 42.9255 33.1268 44 34.4522 44H55.2522C56.5777 44 57.6522 42.9255 57.6522 41.6C57.6522 40.2745 56.5777 39.2 55.2522 39.2Z",fill:"#A5A9B5"}),re.createElement("path",{opacity:"0.15",d:"M69.6522 49.6H34.4522C33.1268 49.6 32.0522 50.6745 32.0522 52C32.0522 53.3255 33.1268 54.4 34.4522 54.4H69.6522C70.9777 54.4 72.0522 53.3255 72.0522 52C72.0522 50.6745 70.9777 49.6 69.6522 49.6Z",fill:"#A5A9B5"}),re.createElement("path",{d:"M19.6522 54.4C23.8496 54.4 27.2522 50.9974 27.2522 46.8C27.2522 42.6026 23.8496 39.2 19.6522 39.2C15.4549 39.2 12.0522 42.6026 12.0522 46.8C12.0522 50.9974 15.4549 54.4 19.6522 54.4Z",fill:"#A5A9B5"})),E7=({pageId:e="*",componentId:t="*"})=>{let o="illustration",{currentTheme:r,accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:c}=F({pageId:e,componentId:t,elementId:o});return s?null:re.createElement(ae,{defaultIconName:a.icon,configIconName:i.icon,imgIcon:()=>re.createElement("img",{src:i.icon,alt:l,"data-qa-anchor":n}),defaultIcon:()=>re.createElement("div",{"data-qa-anchor":n},r==="light"?re.createElement(Rae,null):re.createElement(Xae,null))})};var nk={description:"ed"};function A7({pageId:e="*",componentId:t="*"}){let o="description",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:o});return a?null:re.createElement(_.Caption,{className:nk.description,style:l,"data-qa-anchor":r},n.text)}var ik={title:"rd"};function c1({pageId:e="*",componentId:t="*",titleClassName:o}){let r="title",{accessibilityId:n,config:i,isExcluded:a,themeStyles:s}=F({pageId:e,componentId:t,elementId:r});return a?null:re.createElement(_.Title,{className:Kn(ik.title,o),style:s,"data-qa-anchor":n},i.text)}var q3={exploreCommunitiesButton:"ad",exploreCommunitiesButton__icon:"od",exploreCommunitiesButton__text:"td"};var ase=e=>re.createElement("svg",m({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M7.85254 0.25C12.1338 0.25 15.6025 3.71875 15.6025 8C15.6025 12.2812 12.1338 15.75 7.85254 15.75C3.57129 15.75 0.102539 12.2812 0.102539 8C0.102539 3.71875 3.57129 0.25 7.85254 0.25ZM13.4463 5.25C12.79 3.9375 11.6963 2.90625 10.3525 2.3125C10.79 3.125 11.1338 4.125 11.3525 5.25H13.4463ZM7.85254 1.75C7.25879 1.75 6.32129 3.0625 5.85254 5.25H9.82129C9.35254 3.0625 8.41504 1.75 7.85254 1.75ZM1.60254 8C1.60254 8.4375 1.63379 8.875 1.72754 9.25H4.13379C4.10254 8.84375 4.10254 8.4375 4.10254 8C4.10254 7.59375 4.10254 7.1875 4.13379 6.75H1.72754C1.63379 7.15625 1.60254 7.59375 1.60254 8ZM2.22754 10.75C2.88379 12.0625 3.97754 13.125 5.32129 13.7188C4.88379 12.9062 4.54004 11.9062 4.32129 10.75H2.22754ZM4.32129 5.25C4.54004 4.125 4.88379 3.125 5.32129 2.3125C3.97754 2.90625 2.88379 3.9375 2.22754 5.25H4.32129ZM7.85254 14.25C8.41504 14.25 9.35254 12.9688 9.82129 10.75H5.85254C6.32129 12.9688 7.25879 14.25 7.85254 14.25ZM10.04 9.25C10.0713 8.875 10.1025 8.4375 10.1025 8C10.1025 7.5625 10.0713 7.15625 10.04 6.75H5.63379C5.60254 7.15625 5.60254 7.5625 5.60254 8C5.60254 8.4375 5.60254 8.875 5.63379 9.25H10.04ZM10.3525 13.7188C11.6963 13.125 12.79 12.0625 13.4463 10.75H11.3525C11.1338 11.9062 10.79 12.9062 10.3525 13.7188ZM11.54 9.25H13.9775C14.04 8.875 14.1025 8.4375 14.1025 8C14.1025 7.59375 14.04 7.15625 13.9775 6.75H11.54C11.5713 7.1875 11.6025 7.59375 11.6025 8C11.6025 8.4375 11.5713 8.84375 11.54 9.25Z"}));function L7({pageId:e="*",componentId:t="*"}){let o="explore_communities_button",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:o});return a?null:re.createElement("div",{className:q3.exploreCommunitiesButton,"data-qa-anchor":r,style:l},re.createElement(ase,{className:q3.exploreCommunitiesButton__icon}),re.createElement(_.BodyBold,{className:q3.exploreCommunitiesButton__text},n.text))}var ak={createCommunityButton:"id"};function B7({pageId:e="*",componentId:t="*",onClick:o}){let r="create_community_button",{accessibilityId:n,config:i,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:c}=F({pageId:e,componentId:t,elementId:r});return s?null:re.createElement("div",{className:ak.createCommunityButton,onClick:()=>o(),"data-qa-anchor":n,style:c},re.createElement(ae,{defaultIcon:()=>re.createElement(re.Fragment,null),imgIcon:()=>re.createElement("img",{src:i.icon,alt:l}),configIconName:i.icon,defaultIconName:a.icon}),re.createElement(_.Body,null,i.text))}var F7={emptyNewsfeed:"sd",emptyNewsfeed__text:"cd"};function gm({pageId:e="*"}){let t="empty_newsfeed",{accessibilityId:o,config:r,defaultConfig:n,isExcluded:i,uiReference:a,themeStyles:s}=te({pageId:e,componentId:t});return i?null:re.createElement("div",{className:F7.emptyNewsfeed},re.createElement(E7,{pageId:e,componentId:t}),re.createElement("div",{className:F7.emptyNewsfeed__text},re.createElement(c1,{pageId:e,componentId:t}),re.createElement(A7,{pageId:e,componentId:t})),re.createElement(L7,{pageId:e,componentId:t}),re.createElement(B7,{pageId:e,componentId:t,onClick:()=>{}}))}var u1={global_feed:"nd",global_feed__postContainer:"ld",global_feed__postSkeletonContainer:"dd",global_feed__pullToRefresh:"md",global_feed__post__reactionBar__leftPane__icon:"gd",global_feed__post__reactionBar__leftPane__iconImg:"hd",global_feed__pullToRefresh__spinner:"pd",spin:"Ie",global_feed__divider:"fd",global_feed__post__divider:"ud",global_feed__post__reactionBar:"bd",global_feed__post__reactionBar__leftPane:"vd",global_feed__post__reactionBar__rightPane:"xd",global_feed__intersection:"wd",global_feed__commentContainer:"yd"};var Vt={container:"kd",innerContainer:"jd",header:"zd",header__title:"Xd",header__avatar:"Yd",header__detail:"Ad",content__text:"Cd",content__imageContainer:"Md",content__image:"Sd",footer:"Re",footer__content__description:"Ed",footer__content__headline:"Fd",footer__left:"Id",footer__right:"Rd",footer__content__button:"Ud",footer__content__button__text:"Bd",infoIcon__button:"Hd",infoIcon:"Ld"};var sk=({ad:e,avatarUrl:t,adImageUrl:o,themeStyles:r,onCallToActionClick:n})=>{var l;let[i,a]=useState(!1),s=()=>{n==null||n(e.callToActionUrl);};return re.createElement("div",{className:Vt.container,style:r},re.createElement("div",{className:Vt.innerContainer},re.createElement("div",{className:Vt.header},re.createElement("div",{className:Vt.header__avatar},re.createElement(yt,{avatarUrl:t,defaultImage:re.createElement(Jl,null)})),re.createElement("div",{className:Vt.header__detail},re.createElement(_.BodyBold,{className:Vt.header__title},(l=e.advertiser)==null?void 0:l.name),re.createElement(Kl,null))),re.createElement("div",null,re.createElement(_.Body,{className:Vt.content__text},e.body),re.createElement("div",{className:Vt.content__imageContainer},re.createElement("img",{className:Vt.content__image,src:o})))),re.createElement(z,{className:Vt.infoIcon__button,onPress:()=>a(!0)},re.createElement(qr,{className:Vt.infoIcon})),re.createElement("div",{className:Vt.footer,"data-has-url":!!e.callToActionUrl,onClick:s},re.createElement("div",{className:Vt.footer__left},re.createElement(_.Body,{className:Vt.footer__content__description},e.description),re.createElement(_.BodyBold,{className:Vt.footer__content__headline},e.headline)),e.callToActionUrl?re.createElement("div",{className:Vt.footer__right},re.createElement(z,{className:Vt.footer__content__button,onPress:s},re.createElement(_.CaptionBold,{className:Vt.footer__content__button__text},e.callToAction))):null),re.createElement(y3,{ad:e,isOpen:i,onOpenChange:c=>a(c)}))};var lk=({pageId:e="*",ad:t})=>{var c,p,u,f,g,y;let o="post_content",{themeStyles:r}=te({pageId:e,componentId:o}),i=Je({fileId:(p=(c=t.advertiser)==null?void 0:c.avatar)==null?void 0:p.fileId})||((f=(u=t.advertiser)==null?void 0:u.avatar)==null?void 0:f.fileUrl)||"",s=Je({fileId:(g=t.image1_1)==null?void 0:g.fileId})||((y=t.image1_1)==null?void 0:y.fileUrl)||"";return re.createElement(sk,{themeStyles:r,avatarUrl:i,adImageUrl:s,ad:t,onCallToActionClick:h=>{window==null||window.open(h,"_blank");}})};var D7=e=>(e==null?void 0:e.adId)!==void 0,W3=({pageId:e="*",componentId:t="*",items:o,isLoading:r,onFeedReachBottom:n,onPostDeleted:i})=>{let{accessibilityId:a,themeStyles:s}=te({pageId:e,componentId:t}),l=useRef(null),{AmityGlobalFeedComponentBehavior:c}=At();if(mr({ref:l,onIntersect:()=>{n();}}),o.length===0&&!r)return re.createElement(gm,{pageId:e});let p=(u,f)=>D7(u)?f&&D7(f)?`${f.adId}-${u.adId}`:`${f.postId}-${u.adId}`:u.postId;return re.createElement("div",{className:u1.global_feed,style:s,"data-qa-anchor":a},o.map((u,f)=>re.createElement("div",{key:p(u,o[Math.max(0,f-1)])},f!==0?re.createElement("div",{className:u1.global_feed__divider}):null,D7(u)?re.createElement(lk,{ad:u}):re.createElement("div",{className:u1.global_feed__postContainer},re.createElement(um,{pageId:e,post:u,type:"feed",onClick:()=>{var g;(g=c==null?void 0:c.goToPostDetailPage)==null||g.call(c,{postId:u.postId});},onPostDeleted:i})))),r?Array.from({length:2}).map((u,f)=>re.createElement("div",{key:f},re.createElement("div",{className:u1.global_feed__divider}),re.createElement("div",{className:u1.global_feed__postSkeletonContainer},re.createElement(Bd,null)))):null,!r&&re.createElement("div",{ref:l,className:u1.global_feed__intersection}))};var ym={newsfeed:"Td",newsfeed__postList:"Vd",newsfeed__postContainer:"qd",newsfeed__pullToRefresh:"Dd",newsfeed__post__reactionBar__leftPane__icon:"Gd",newsfeed__post__reactionBar__leftPane__iconImg:"Jd",newsfeed__pullToRefresh__spinner:"Kd",spin:"Ue",newsfeed__divider:"Nd",newsfeed__post__divider:"Od",newsfeed__post__reactionBar:"Pd",newsfeed__post__reactionBar__leftPane:"Qd",newsfeed__post__reactionBar__rightPane:"Wd",newsfeed__intersection:"Zd"};var Cse=e=>re.createElement("div",{className:ym.newsfeed__pullToRefresh__spinner},re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},re.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1122 5C11.1122 5.39449 10.7924 5.71429 10.3979 5.71429C10.0035 5.71429 9.68366 5.39449 9.68366 5V0.714286C9.68366 0.319797 10.0035 0 10.3979 0C10.7924 0 11.1122 0.319797 11.1122 0.714286V5ZM8.25509 6.28846C8.59673 6.09122 8.71378 5.65437 8.51654 5.31273L6.37368 1.60119C6.17644 1.25955 5.73959 1.1425 5.39795 1.33975C5.05631 1.53699 4.93926 1.97384 5.1365 2.31548L7.27936 6.02702C7.4766 6.36865 7.91346 6.48571 8.25509 6.28846ZM6.42496 6.88141C6.7666 7.07865 6.88366 7.51551 6.68641 7.85714C6.48917 8.19878 6.05232 8.31583 5.71068 8.11859L1.99914 5.97573C1.6575 5.77849 1.54045 5.34164 1.7377 5C1.93494 4.65836 2.37179 4.54131 2.71343 4.73855L6.42496 6.88141ZM6.11224 10C6.11224 9.60551 5.79244 9.28571 5.39795 9.28571H1.11223C0.717746 9.28571 0.397949 9.60551 0.397949 10C0.397949 10.3945 0.717746 10.7143 1.11224 10.7143H5.39795C5.79244 10.7143 6.11224 10.3945 6.11224 10ZM5.71068 11.8814C6.05232 11.6842 6.48917 11.8012 6.68641 12.1429C6.88366 12.4845 6.7666 12.9213 6.42497 13.1186L2.71343 15.2614C2.37179 15.4587 1.93494 15.3416 1.7377 15C1.54045 14.6584 1.6575 14.2215 1.99914 14.0243L5.71068 11.8814ZM8.25509 13.7115C7.91345 13.5143 7.4766 13.6313 7.27936 13.973L5.1365 17.6845C4.93926 18.0262 5.05631 18.463 5.39795 18.6603C5.73959 18.8575 6.17644 18.7404 6.37368 18.3988L8.51654 14.6873C8.71378 14.3456 8.59673 13.9088 8.25509 13.7115ZM10.3979 14.2857C10.0035 14.2857 9.68366 14.6055 9.68366 15V19.2857C9.68366 19.6802 10.0035 20 10.3979 20C10.7924 20 11.1122 19.6802 11.1122 19.2857V15C11.1122 14.6055 10.7924 14.2857 10.3979 14.2857ZM12.5408 6.28846C12.8824 6.48571 13.3193 6.36865 13.5165 6.02702L15.6594 2.31548C15.8566 1.97384 15.7396 1.53699 15.3979 1.33975C15.0563 1.1425 14.6195 1.25956 14.4222 1.60119L12.2794 5.31273C12.0821 5.65437 12.1992 6.09122 12.5408 6.28846ZM15.0852 8.11859C14.7436 8.31583 14.3067 8.19878 14.1095 7.85714C13.9122 7.51551 14.0293 7.07866 14.3709 6.88141L18.0825 4.73855C18.4241 4.54131 18.861 4.65836 19.0582 5C19.2554 5.34164 19.1384 5.77849 18.7968 5.97573L15.0852 8.11859ZM14.6837 10C14.6837 10.3945 15.0035 10.7143 15.3979 10.7143H19.6837C20.0782 10.7143 20.3979 10.3945 20.3979 10C20.3979 9.60551 20.0782 9.28571 19.6837 9.28571H15.3979C15.0035 9.28571 14.6837 9.60551 14.6837 10ZM14.3709 13.1186C14.0293 12.9213 13.9122 12.4845 14.1095 12.1429C14.3067 11.8012 14.7436 11.6842 15.0852 11.8814L18.7968 14.0243C19.1384 14.2215 19.2554 14.6584 19.0582 15C18.861 15.3416 18.4241 15.4587 18.0825 15.2614L14.3709 13.1186ZM12.5408 13.7115C12.1992 13.9088 12.0821 14.3456 12.2794 14.6873L14.4222 18.3988C14.6195 18.7404 15.0563 18.8575 15.3979 18.6603C15.7396 18.463 15.8566 18.0262 15.6594 17.6845L13.5165 13.973C13.3193 13.6313 12.8824 13.5143 12.5408 13.7115Z",fill:"url(#paint0_angular_1709_10374)"}),re.createElement("defs",null,re.createElement("radialGradient",{id:"paint0_angular_1709_10374",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.3979 10) scale(10)"},re.createElement("stop",{offset:"0.669733",stopColor:"#595F67"}),re.createElement("stop",{offset:"0.716307",stopColor:"#262626",stopOpacity:"0.01"}))))),Y3=({pageId:e="*"})=>{let t="newsfeed",{themeStyles:o}=te({pageId:e,componentId:t}),r=useRef(0),[n,i]=useState(0),{itemWithAds:a,hasMore:s,isLoading:l,loadMore:c,fetch:p,refetch:u,removeItem:f}=za();useEffect(()=>{p();},[]);let g=()=>{s&&!l&&c();};return a.length===0&&!l?re.createElement(gm,{pageId:e}):re.createElement("div",{className:ym.newsfeed,style:o,onDrag:y=>y.stopPropagation(),onTouchStart:y=>{r.current=y.touches[0].clientY;},onTouchMove:y=>{let h=y.touches[0].clientY;r.current>h||i(Math.min(h-r.current,100));},onTouchEnd:y=>{r.current=0,n>=75&&u(),i(0);}},re.createElement("div",{style:{"--asc-pull-to-refresh-height":`${n}px`},className:ym.newsfeed__pullToRefresh},re.createElement(Cse,null)),re.createElement("div",{className:ym.newsfeed__divider}),re.createElement(w3,{type:"globalFeed",pageId:e}),a.length>0&&re.createElement("div",{className:ym.newsfeed__divider}),re.createElement(W3,{isLoading:l,items:a,pageId:e,componentId:t,onFeedReachBottom:()=>g(),onPostDeleted:y=>f(y.postId)}))};var Q3={postCreationButton:"_d",postCreationButton__icon:"em"};var xse=e=>re.createElement("svg",m({style:{pointerEvents:"none"},width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M13.0002 5.96667C13.5314 5.96667 14.0002 6.43542 14.0002 6.96667V7.96667C14.0002 8.52917 13.5314 8.96667 13.0002 8.96667H8.50016V13.4667C8.50016 14.0292 8.03141 14.4667 7.50016 14.4667H6.50016C5.93766 14.4667 5.50016 14.0292 5.50016 13.4667V8.96667H1.00016C0.437662 8.96667 0.000162125 8.52917 0.000162125 7.96667V6.96667C0.000162125 6.43542 0.437662 5.96667 1.00016 5.96667H5.50016V1.46667C5.50016 0.935425 5.93766 0.466675 6.50016 0.466675H7.50016C8.03141 0.466675 8.50016 0.935425 8.50016 1.46667V5.96667H13.0002Z"}));function O7({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onClick:n}){let i="post_creation_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return c?null:re.createElement(ae,{defaultIcon:()=>re.createElement(z,{style:u,className:Q3.postCreationButton,onPress:n,"data-qa-anchor":a},re.createElement(xse,{className:Kn(Q3.postCreationButton__icon,o)})),imgIcon:()=>re.createElement("img",{src:s.icon,alt:p,className:Kn(Q3.postCreationButton,r),onClick:n,"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon})}var Dd={globalSearchButton:"rm",globalSearchButton__icon:"am",globalSearchButton__svg:"om"};var Ise=e=>re.createElement("svg",m({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M15.7814 14.3104C16.0627 14.6229 16.0627 15.0917 15.7502 15.3729L14.8752 16.2479C14.5939 16.5604 14.1252 16.5604 13.8127 16.2479L10.7189 13.1542C10.5627 12.9979 10.5002 12.8104 10.5002 12.6229V12.0917C9.37516 12.9667 8.00016 13.4667 6.50016 13.4667C2.90641 13.4667 0.000162125 10.5604 0.000162125 6.96667C0.000162125 3.40417 2.90641 0.466675 6.50016 0.466675C10.0627 0.466675 13.0002 3.40417 13.0002 6.96667C13.0002 8.49792 12.4689 9.87292 11.6252 10.9667H12.1252C12.3127 10.9667 12.5002 11.0604 12.6564 11.1854L15.7814 14.3104ZM6.50016 10.9667C8.68766 10.9667 10.5002 9.18542 10.5002 6.96667C10.5002 4.77917 8.68766 2.96667 6.50016 2.96667C4.28141 2.96667 2.50016 4.77917 2.50016 6.96667C2.50016 9.18542 4.28141 10.9667 6.50016 10.9667Z"}));function V7({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n}){let i="global_search_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return c?null:re.createElement(z,{style:u,"data-qa-anchor":a,className:Dd.globalSearchButton,onPress:n},re.createElement(ae,{defaultIcon:()=>re.createElement("div",{className:Dd.globalSearchButton__icon},re.createElement(Ise,{className:Kn(Dd.globalSearchButton__svg,o)})),imgIcon:()=>re.createElement("img",{style:u,src:s.icon,alt:p,className:Kn(Dd.globalSearchButton__icon,r),"data-qa-anchor":a}),defaultIconName:l.icon,configIconName:s.icon}))}var ck={headerLabel:"tm"};function U7({pageId:e="*",componentId:t="*"}){let o="header_label",{accessibilityId:r,config:n,defaultConfig:i,isExcluded:a,uiReference:s,themeStyles:l}=F({pageId:e,componentId:t,elementId:o});return a?null:re.createElement(_.Heading,{className:ck.headerLabel,style:l,"data-qa-anchor":r},n.text)}var K3={topNavigation:"im",topNavigationLeftPane:"sm",topNavigationRightPane:"cm"};var g1={socialHomePage:"nm",socialHomePage__topBar:"lm",socialHomePage__topNavigation:"dm",socialHomePage__tabs:"Be",socialHomePage__contents:"He",socialHomePage__createPostMenu:"mm"};var J3={tabButton:"Le",tabButton__text:"gm"};function y1(a){var s=a,{pageId:e="*",componentId:t="*",elementId:o="*",children:r,isActive:n=!1}=s,i=M(s,["pageId","componentId","elementId","children","isActive"]);let{accessibilityId:l,config:c,defaultConfig:p,isExcluded:u,uiReference:f,themeStyles:g}=F({pageId:e,componentId:t,elementId:o});return re.createElement(z,m({style:g,className:J3.tabButton,"data-active":n,"data-qa-anchor":l},i),n?re.createElement(_.Title,{"data-active":n,className:J3.tabButton__text},r):re.createElement(_.Caption,{"data-active":n,className:J3.tabButton__text},r))}function H7({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="newsfeed_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:c,themeStyles:p}=F({pageId:e,componentId:t,elementId:n});return l?null:re.createElement(y1,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}function j7({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="explore_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:c,themeStyles:p}=F({pageId:e,componentId:t,elementId:n});return l?null:re.createElement(y1,{pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r(),"data-qa-anchor":i},a.text)}function G7({pageId:e="*",componentId:t="*",isActive:o,onClick:r}){let n="my_communities_button",{accessibilityId:i,config:a,defaultConfig:s,isExcluded:l,uiReference:c,themeStyles:p}=F({pageId:e,componentId:t,elementId:n});return l?null:re.createElement(y1,{"data-qa-anchor":i,pageId:e,componentId:t,elementId:n,isActive:o,onPress:()=>r==null?void 0:r()},a.text)}var X3=(r=>(r.Newsfeed="Newsfeed",r.Explore="Explore",r.MyCommunities="My communities",r))(X3||{});function $7(){let e="social_home_page",{themeStyles:t}=tt({pageId:e}),{scrollPosition:o,onScroll:r}=za(),[n,i]=useState("Newsfeed"),[a,s]=useState(!1),l=useRef(null),c=useRef(!0);useEffect(()=>{l.current&&(l.current.scrollTop=o,setTimeout(()=>{c.current=!1;},100));},[l.current]);let p=()=>{s(f=>!f);},u=f=>{c.current||r(f);};return useEffect(()=>{let f=()=>{a&&s(!1);};a?document.addEventListener("mousedown",f):document.removeEventListener("mousedown",f);},[a]),re.createElement("div",{className:g1.socialHomePage,style:t},re.createElement("div",{className:g1.socialHomePage__topBar},re.createElement("div",{className:g1.socialHomePage__topNavigation},re.createElement(R3,{pageId:e,selectedTab:n,onClickPostCreationButton:p})),re.createElement("div",{className:g1.socialHomePage__tabs},re.createElement(H7,{pageId:e,isActive:n==="Newsfeed",onClick:()=>i("Newsfeed")}),re.createElement(j7,{pageId:e,isActive:n==="Explore",onClick:()=>i("Explore")}),re.createElement(G7,{pageId:e,isActive:n==="My communities",onClick:()=>i("My communities")}))),re.createElement("div",{className:g1.socialHomePage__contents,ref:l,onScroll:u},n==="Newsfeed"&&re.createElement(Y3,{pageId:e}),n==="Explore"&&re.createElement(O2,{isOpen:!1,toggleOpen:()=>{},hideSideMenu:!0}),n==="My communities"&&re.createElement(Z3,{pageId:e})),a&&re.createElement("div",{className:g1.socialHomePage__createPostMenu},re.createElement(S3,{pageId:e})))}function R3({pageId:e="*",selectedTab:t,onClickPostCreationButton:o}){let r="top_navigation",{goToSocialGlobalSearchPage:n,goToMyCommunitiesSearchPage:i}=ot(),{isExcluded:a,themeStyles:s}=te({pageId:e,componentId:r}),l=()=>{switch(t){case"Newsfeed":n();break;case"Explore":break;case"My communities":i();break}};return a?null:re.createElement("div",{className:K3.topNavigation,style:s},re.createElement("div",{className:K3.topNavigationLeftPane},re.createElement(U7,{pageId:e,componentId:r})),re.createElement("div",{className:K3.topNavigationRightPane},re.createElement(V7,{pageId:e,componentId:r,onPress:l}),t!=="Explore"&&re.createElement(O7,{pageId:e,componentId:r,onClick:o})))}var Ese=w1`
|
|
3788
3788
|
from {
|
|
3789
3789
|
transform: rotate(0deg);
|
|
3790
3790
|
}
|
|
@@ -3793,7 +3793,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[pc]+=1);var bc=`url("data:ima
|
|
|
3793
3793
|
}
|
|
3794
3794
|
`,Ase=d.svg`
|
|
3795
3795
|
animation: ${Ese} 2s linear infinite;
|
|
3796
|
-
`,Lse=e=>re.createElement(Ase,m({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"})),e5=Lse;var q7={storyCommentButton:"hm",storyCommentIcon:"pm"};var Dse=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),re.createElement("path",{fill:"#A5A9B5",d:"M10 2.188c4.682 0 8.5 3.12 8.5 6.906C18.5 12.912 14.682 16 10 16c-1.295 0-2.49-.232-3.586-.63-.797.663-2.457 1.693-4.648 1.693-.133 0-.2-.034-.266-.133-.033-.1 0-.233.066-.3 0-.032 1.395-1.493 1.827-3.187-1.196-1.195-1.893-2.69-1.893-4.35 0-3.784 3.785-6.905 8.5-6.905z"})),gk=({pageId:e="*",componentId:t="*",onPress:o,commentsCount:r,imgClassName:n})=>{let i="story_comment_button",{isExcluded:a,accessibilityId:s,defaultConfig:l,config:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return a?null:re.createElement(z,{"data-qa-anchor":s,onPress:o,style:u,className:Kn(q7.storyCommentButton)},re.createElement(ae,{defaultIconName:l.icon,configIconName:c.icon,imgIcon:()=>re.createElement("img",{src:c.icon,alt:p,className:Kn(n),style:u}),defaultIcon:()=>re.createElement("div",{className:Kn(q7.storyCommentIcon)},re.createElement(Dse,null),re.createElement(_.BodyBold,null,ov(r)))}))};var Y7={storyReactionButton:"fm",storyReactionIcon:"um"};var Use=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),re.createElement("path",{fill:"#A5A9B5",d:"M17.793 11.025c.148.854.037 1.67-.334 2.338a3.437 3.437 0 01-.668 2.487c-.037 2.078-1.299 3.525-4.156 3.525h-.854c-3.785 0-4.935-1.41-6.605-1.447-.112.482-.594.853-1.114.853H1.688c-.667 0-1.187-.52-1.187-1.187V8.687c0-.63.52-1.187 1.188-1.187h3.636c.705-.594 1.707-2.227 2.56-3.08.52-.52.372-4.045 2.673-4.045 2.115 0 3.525 1.188 3.525 3.896 0 .706-.148 1.262-.334 1.745h1.373c1.781 0 3.191 1.521 3.191 3.154 0 .705-.185 1.299-.519 1.855zm-2.3 2.004c.816-.742.704-1.892.185-2.449.37 0 .853-.705.853-1.373-.037-.705-.63-1.41-1.41-1.41h-3.86c0-1.41 1.04-2.078 1.04-3.526 0-.89 0-2.115-1.744-2.115-.705.705-.372 2.487-1.41 3.526-1.002 1.002-2.45 3.6-3.526 3.6H5.25v6.939c1.967 0 3.71 1.373 6.346 1.373h1.41c1.299 0 2.264-.631 1.967-2.412.556-.334 1.002-1.373.52-2.153zM3.765 16.406a.903.903 0 00-.891-.89.88.88 0 00-.89.89c0 .52.37.89.89.89a.88.88 0 00.89-.89z"})),zse=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),re.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"url(#paint0_linear_7702_34939)"}),re.createElement("path",{fill:"#fff",d:"M7.486 10.575H5.42a.611.611 0 00-.62.619v6.187c0 .361.258.619.62.619h2.066c.336 0 .62-.258.62-.619v-6.187a.628.628 0 00-.62-.62zm-1.033 6.394a.596.596 0 01-.62-.62c0-.334.258-.618.62-.618.336 0 .62.284.62.619 0 .36-.284.619-.62.619zm8.264-10.055c0-1.908-1.24-2.114-1.859-2.114-.542 0-.775 1.031-.878 1.495-.155.567-.284 1.134-.672 1.521-.826.851-1.265 1.908-2.298 2.913a.415.415 0 00-.078.232v5.518c0 .154.13.283.284.31.414 0 .956.231 1.37.412.826.36 1.833.799 3.073.799h.077c1.11 0 2.428 0 2.944-.748.233-.31.285-.696.155-1.16.44-.438.646-1.263.44-1.934.439-.593.49-1.443.232-2.036.31-.31.516-.8.49-1.264 0-.799-.67-1.52-1.523-1.52h-2.635c.207-.723.878-1.341.878-2.424z"}),re.createElement("defs",null,re.createElement("linearGradient",{id:"paint0_linear_7702_34939",x1:"9",x2:"19.8",y1:"2.4",y2:"29.4",gradientUnits:"userSpaceOnUse"},re.createElement("stop",{stopColor:"#5B9DFF"}),re.createElement("stop",{offset:"1",stopColor:"#0041BE"})))),yk=({myReactions:e=[],reactionsCount:t,pageId:o="*",componentId:r="*",defaultIconClassName:n,imgIconClassName:i,onPress:a})=>{let s="story_reaction_button",{isExcluded:l,accessibilityId:c,config:p,uiReference:u,themeStyles:f}=F({pageId:o,componentId:r,elementId:s}),g=e.length>0;return l?null:re.createElement(z,{"data-qa-anchor":c,className:Kn(Y7.storyReactionButton),onPress:a,style:f},re.createElement(ae,{defaultIcon:()=>re.createElement("div",{className:Kn(Y7.storyReactionIcon,n)},g?re.createElement(zse,null):re.createElement(Use,null),re.createElement(_.BodyBold,null,ov(t))),imgIcon:()=>re.createElement("img",{src:p.icon,alt:u,className:Kn(i)})}))};var $a={viewStoryCompostBarContainer:"bm",viewStoryFailedCompostBarContainer:"vm",viewStoryFailedCompostBarWrapper:"xm",viewStoryUploadingWrapper:"wm",viewStoryCompostBarViewIconContainer:"ym",viewStoryCompostBarEngagementContainer:"km",viewStoryCommentButton:"jm",viewStoryCommentIcon:"zm"};var jse=({pageId:e="*",syncState:t,reach:o,commentsCount:r,reactionsCount:n,isLiked:i,storyId:a,onClickComment:s,showImpression:l,isMember:c,myReactions:p})=>{let u=Co(),f=()=>S(void 0,null,function*(){try{if(!c){u.info({content:"Join community to interact with all stories"});return}i?yield ReactionRepository.removeReaction("story",a,Qo):yield ReactionRepository.addReaction("story",a,Qo);}catch(g){console.error("Can't toggle like",g);}});return t==="syncing"?re.createElement("div",{className:$a.viewStoryCompostBarContainer},re.createElement("div",{className:$a.viewStoryUploadingWrapper},re.createElement(e5,{width:20,height:20}),"Uploading...")):t==="error"?re.createElement("div",{className:$a.viewStoryFailedCompostBarContainer},re.createElement("div",{className:$a.viewStoryFailedCompostBarWrapper},re.createElement(hu,null),re.createElement("span",null,"Failed to upload")),re.createElement(ji,null)):re.createElement("div",{className:$a.viewStoryCompostBarContainer},re.createElement("div",null,l&&re.createElement("div",{className:$a.viewStoryCompostBarViewIconContainer},re.createElement(Jp,{reach:o}))),re.createElement("div",{className:$a.viewStoryCompostBarEngagementContainer},re.createElement(gk,{pageId:e,commentsCount:r,onPress:s}),re.createElement(yk,{pageId:e,myReactions:p,reactionsCount:n,onPress:f})))},t5=jse;var Tr={iconButton:"Xm",rendererContainer:"Ym",storyVideo:"Am",muteCircleIcon:"Cm",unmuteCircleIcon:"Mm",loadingOverlay:"Sm",storyImage:"Em",playStoryButton:"Fm",pauseStoryButton:"Im",closeButton:"Rm",verifiedBadge:"Um",dotsButton:"Bm",viewStoryInfoContainer:"Hm",viewStoryCompostBarContainer:"Lm",viewStoryCompostBarViewIconContainer:"Tm",viewStoryCompostBarEngagementContainer:"Vm",viewStoryCompostBarEngagementIconContainer:"qm",storyContent:"Dm",header:"Gm",viewStoryContainer:"Jm",viewStoryHeaderContainer:"Km",avatarContainer:"Nm",addStoryButton:"Te",viewStoryHeaderListActionsContainer:"Om",viewStoryHeadingInfoContainer:"Pm",viewStoryHeading:"Qm",viewStoryHeadingTitle:"Wm",viewStorySubHeading:"Zm"};var qse=({community:e,heading:t,subheading:o,isHaveActions:r,isOfficial:n,isPaused:i,onPlay:a,onPause:s,onAction:l,onClose:c,onClickCommunity:p,haveStoryPermission:u,addStoryButton:f})=>re.createElement("div",{className:Tr.viewStoryHeaderContainer},re.createElement("div",{className:Tr.viewStoryHeadingInfoContainer},re.createElement("div",{className:Tr.avatarContainer},re.createElement(br,{pageId:"story_page",community:e}),u&&f),re.createElement("div",{className:Tr.viewStoryInfoContainer},re.createElement("div",{className:Tr.viewStoryHeading},re.createElement(ZC,{lines:1},re.createElement("div",{className:Tr.viewStoryHeadingTitle,"data-qa-anchor":"community_display_name",onClick:p},t)),n&&re.createElement(Zs,{className:Tr.verifiedBadge})),re.createElement("span",{className:Tr.viewStorySubHeading},o))),re.createElement("div",{className:Tr.viewStoryHeaderListActionsContainer},i?re.createElement(yo,{className:Tr.playStoryButton,"data-qa-anchor":"play_button",onClick:a}):re.createElement(ns,{className:Tr.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:s}),r&&re.createElement(Xp,{pageId:"story_page",onPress:l}),re.createElement(sr,{defaultClassName:Kn(Tr.closeButton),pageId:"story_page",onPress:c}))),o5=qse;function Od({queryParams:e,shouldCall:t=!0}){let n=oo({fetcher:CommunityRepository.Membership.getMembers,params:e,shouldCall:!!(e!=null&&e.communityId)&&t}),{items:o}=n,r=M(n,["items"]);return m({members:o},r)}var so={iconButton:"_m",hyperLinkContainer:"Ve",rendererContainer:"eg",storyVideo:"rg",muteCircleIcon:"ag",unmuteCircleIcon:"og",loadingOverlay:"tg",storyImageContainer:"ig",storyImage:"sg",playStoryButton:"cg",pauseStoryButton:"ng",closeButton:"lg",verifiedBadge:"dg",dotsButton:"mg",viewStoryInfoContainer:"gg",viewStoryCompostBarContainer:"hg",viewStoryCompostBarViewIconContainer:"pg",viewStoryCompostBarEngagementContainer:"fg",viewStoryCompostBarEngagementIconContainer:"ug",header:"bg",viewStoryContainer:"vg",viewStoryHeaderContainer:"xg",avatarContainer:"wg",addStoryButton:"qe",viewStoryHeaderListActionsContainer:"yg",viewStoryHeadingInfoContainer:"kg",viewStoryHeading:"jg",viewStoryHeadingTitle:"zg",viewStorySubHeading:"Xg",story:"Yg",storyContent:"Ag",actionButton:"De",navigationOverlay:"Cg",leftOverlay:"Mg",rightOverlay:"Sg",imageFit:"Eg",imageFill:"Fg"};var r5={progressBarContainer:"Ig",progressSegment:"Rg",progressBar:"Ug"};var vm=re.memo(({pageId:e="*",componentId:t="*",duration:o,currentIndex:r,storiesCount:n,isPaused:i,onComplete:a})=>{let s="progress_bar",{config:l,isExcluded:c}=F({pageId:e,componentId:t,elementId:s}),[p,u]=useState(new Array(n).fill(0)),[f,g]=useState(r),y=l==null?void 0:l.backgroundColor,h=l==null?void 0:l.progressColor;return useEffect(()=>{r<f&&u(C=>{let v=[...C];return v[r]=0,v}),g(r);},[r,f]),useEffect(()=>{let C;return i||(C=setInterval(()=>{u(v=>{let w=[...v];return w[r]<100&&(w[r]+=100/o*100,w[r]>=100&&(w[r]=100,a())),w});},100)),()=>{C&&clearInterval(C);}},[o,r,i,a]),c?null:re.createElement("div",{className:Kn(r5.progressBarContainer),style:{backgroundColor:y}},p.map((C,v)=>re.createElement("div",{key:v,className:Kn(r5.progressSegment),style:{width:`calc(${100/n}% - 4px)`}},re.createElement("div",{className:Kn(r5.progressBar),style:{width:`${v<r?100:v===r?C:0}%`,backgroundColor:h}}))))});var e1e=({story:{actions:e,fileInputRef:t,addStoryButton:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l,url:c},action:p,config:u,onClose:f,onClickCommunity:g})=>{var Re,eo,Ae,fo;let{formatMessage:y}=useIntl(),[h,C]=useState(!1),[v,w]=useState(!1),[x,P]=useState(!1),[b,I]=useState(!1),{loader:T}=u,{client:N}=Ee(),[B,D]=useState(""),A=useRef(null),q=!!(l&&l.myReactions&&l.myReactions.includes(hn)),$=(l==null?void 0:l.reactionsCount)||0,{storyId:U,syncState:Q,reach:G,commentsCount:L,createdAt:O,creator:j,community:Z,myReactions:K,data:E,items:V}=l,{members:Y}=Od({queryParams:{communityId:Z==null?void 0:Z.communityId},shouldCall:!!(Z!=null&&Z.communityId)}),pe=(Y==null?void 0:Y.find(et=>et.userId===(N==null?void 0:N.userId)))!=null,{user:ce}=Mo(N==null?void 0:N.userId),je=(Z==null?void 0:Z.isOfficial)||!1,Lt=(j==null?void 0:j.userId)===(ce==null?void 0:ce.userId),Te=hp(ce==null?void 0:ce.roles),$o=yp(ce==null?void 0:ce.roles),po=Te||$o||Ia(N,Z==null?void 0:Z.communityId),Ja=useMemo(()=>re.createElement("div",{"data-qa-anchor":"community_display_name"},Z==null?void 0:Z.displayName),[Z==null?void 0:Z.displayName]),Xa=useMemo(()=>O&&(j!=null&&j.displayName)?re.createElement("span",null,re.createElement("span",{"data-qa-anchor":"created_at"},Cp(O))," \u2022 By"," ",re.createElement("span",{"data-qa-anchor":"creator_display_name"},j==null?void 0:j.displayName)):"",[O,j==null?void 0:j.displayName]),en="asc-uikit-stories-viewer",Sn=useCallback(()=>{if(A.current&&A.current.complete){let Eo=new Rse().getPalette(A.current,2);if(Eo){let sc=`linear-gradient(to top, rgb(${Eo[0].join(",")}), rgb(${Eo[1].join(",")})`;D(sc);}}},[]),ri=useCallback(()=>{C(!0),b&&I(!1),p("play",!0),Sn();},[p,b,Sn]),ye=()=>{p("play",!0),I(!1);},ft=()=>{p("pause",!0),I(!0);},_n=()=>{p("pause",!0),w(!0);},ko=()=>{p("play",!0),w(!1);},uo=()=>{p("pause",!0),P(!0);},ni=()=>{p("play",!0),P(!1);},Ra=()=>{f();},We=()=>{i();};return useEffect(()=>{A.current&&A.current.complete&&Sn();},[]),useEffect(()=>{if(t.current){let et=()=>{p("pause",!0),I(!0);},Eo=()=>{p("play",!0),I(!1);};return t.current.addEventListener("click",et),t.current.addEventListener("cancel",Eo),()=>{t.current&&(t.current.removeEventListener("cancel",Eo),t.current.removeEventListener("click",et));}}},[t]),useEffect(()=>{var et,Eo;if(s){let sc=()=>{p("pause",!0),I(!0);},yg=()=>{p("play",!0),I(!1);};return (et=s.current)==null||et.addEventListener("dragstart",sc),(Eo=s.current)==null||Eo.addEventListener("dragend",yg),()=>{var hg,Cg;(hg=s.current)==null||hg.removeEventListener("dragstart",sc),(Cg=s.current)==null||Cg.removeEventListener("dragend",yg);}}},[s]),re.createElement("div",{className:so.rendererContainer,style:{background:B}},re.createElement(vm,{pageId:a,duration:5e3,currentIndex:r,storiesCount:n,isPaused:b||v||x,onComplete:We}),re.createElement(o5,{community:Z,heading:Ja,subheading:Xa,isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:po,isOfficial:je,isPaused:b,onPlay:ye,onPause:ft,onAction:_n,onClickCommunity:()=>g==null?void 0:g(),onClose:Ra,addStoryButton:o}),re.createElement("div",{className:Kn(so.storyImageContainer,{[so.imageFit]:E.imageDisplayMode==="fit",[so.imageFill]:E.imageDisplayMode==="fill"})},re.createElement("img",{ref:A,className:Kn(so.storyImage,{[so.imageFit]:E.imageDisplayMode==="fit",[so.imageFill]:E.imageDisplayMode==="fill"}),"data-qa-anchor":"image_view",src:c!=null?c:l==null?void 0:l.data.fileData,onLoad:ri,alt:"Story Image",crossOrigin:"anonymous"})),!h&&re.createElement("div",{className:so.loadingOverlay},T||re.createElement("div",null,"loading...")),re.createElement(nr,{rootId:en,isOpen:v,onClose:ko,mountPoint:document.getElementById(en),detent:"content-height"},e==null?void 0:e.map(et=>re.createElement(z,{key:et.name,className:so.actionButton,onPress:()=>et==null?void 0:et.action()},(et==null?void 0:et.icon)&&et.icon,re.createElement(_.BodyBold,null,et.name)))),re.createElement(nr,{rootId:en,isOpen:x,onClose:ni,mountPoint:document.getElementById(en),detent:"full-height",headerTitle:y({id:"storyViewer.commentSheet.title"})},re.createElement(Xl,{referenceId:U,referenceType:"story",community:Z,shouldAllowCreation:Z==null?void 0:Z.allowCommentInStory,shouldAllowInteraction:pe})),((eo=(Re=V==null?void 0:V[0])==null?void 0:Re.data)==null?void 0:eo.url)&&re.createElement("div",{className:so.hyperLinkContainer},re.createElement(Hn,{href:V[0].data.url.startsWith("http")?V[0].data.url:`https://${V[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},re.createElement(ZC,{lines:1},re.createElement("span",null,((fo=(Ae=V[0])==null?void 0:Ae.data)==null?void 0:fo.customText)||V[0].data.url.replace(/^https?:\/\//,""))))),re.createElement(t5,{pageId:a,storyId:U,syncState:Q,reach:G,commentsCount:L,reactionsCount:$,isLiked:q,myReactions:K,onClickComment:uo,showImpression:Lt||Ia(N,Z==null?void 0:Z.communityId),isMember:pe}))},t1e=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&(!e.type||e.type==="image"),priority:2}},Mk={renderer:e1e,tester:t1e};var n1e=()=>{let[e,t]=useState(!1),o=useCallback(()=>t(!0),[]),r=useCallback(()=>t(!1),[]);return {muted:e,mute:o,unmute:r}},i1e=e=>{let[t,o]=useState(!1),r=useCallback(()=>{e("play",!0),o(!1);},[e]),n=useCallback(()=>{e("pause",!0),o(!0);},[e]);return {isPaused:t,play:r,pause:n}},a1e=e=>{let[t,o]=useState(!1),[r,n]=useState(!1),i=useCallback(()=>{e("pause",!0),o(!0);},[e]),a=useCallback(()=>{e("play",!0),o(!1);},[e]),s=useCallback(()=>{e("pause",!0),n(!0);},[e]),l=useCallback(()=>{e("play",!0),n(!1);},[e]);return {isBottomSheetOpen:t,isOpenCommentSheet:r,openBottomSheet:i,closeBottomSheet:a,openCommentSheet:s,closeCommentSheet:l}},s1e=({story:{actions:e,addStoryButton:t,fileInputRef:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l},action:c,config:p,messageHandler:u,onClose:f,onClickCommunity:g})=>{var ye,ft,_n,ko,uo,ni,Ra,We,Re,eo;let[y,h]=useState(!1),{loader:C}=p,{client:v}=Ee(),{user:w}=Mo(v==null?void 0:v.userId),x=useRef(null),{muted:P,mute:b,unmute:I}=n1e(),{isPaused:T,play:N,pause:B}=i1e(c),{isBottomSheetOpen:D,isOpenCommentSheet:A,openBottomSheet:q,closeBottomSheet:$,openCommentSheet:U,closeCommentSheet:Q}=a1e(c),{storyId:G,syncState:L,reach:O,commentsCount:j,createdAt:Z,creator:K,community:E,myReactions:V,data:Y,items:ee}=l,pe=(ye=l==null?void 0:l.myReactions)==null?void 0:ye.includes(hn),ce=(l==null?void 0:l.reactions[hn])||0,{members:je}=Od({queryParams:{communityId:E==null?void 0:E.communityId},shouldCall:!!(E!=null&&E.communityId)}),Lt=je==null?void 0:je.some(Ae=>Ae.userId===(v==null?void 0:v.userId)),Te=(E==null?void 0:E.isOfficial)||!1,$o=(K==null?void 0:K.userId)===(w==null?void 0:w.userId),po=hp(w==null?void 0:w.roles),Ja=yp(w==null?void 0:w.roles),Xa=po||Ja||Ia(v,E==null?void 0:E.communityId),en=useCallback(()=>{var Ae;u("UPDATE_VIDEO_DURATION",{duration:(Ae=l==null?void 0:l.videoData)==null?void 0:Ae.attributes.metadata.video.duration}),h(!0),c("play",!0);},[u,(ft=l==null?void 0:l.videoData)==null?void 0:ft.attributes.metadata.video.duration,c]),Sn=useCallback(()=>{r+1<n?i():f();},[r,n,i,f]);useEffect(()=>{x.current&&(T||D||A?(x.current.pause(),c("pause",!0)):(x.current.play(),c("play",!0)));},[T,D,A,c]),useEffect(()=>{if(o.current){let Ae=()=>{c("pause",!0),B();},fo=()=>{c("play",!0),N();};return o.current.addEventListener("click",Ae),o.current.addEventListener("cancel",fo),()=>{var et,Eo;(et=o.current)==null||et.removeEventListener("click",Ae),(Eo=o.current)==null||Eo.removeEventListener("cancel",fo);}}},[c,B,N]),useEffect(()=>{if(s!=null&&s.current){let Ae=()=>{c("pause",!0),B();},fo=()=>{c("play",!0),N();};return s.current.addEventListener("dragstart",Ae),s.current.addEventListener("dragend",fo),()=>{var et,Eo;(et=s.current)==null||et.removeEventListener("dragstart",Ae),(Eo=s.current)==null||Eo.removeEventListener("dragend",fo);}}},[c,B,N,s]);let ri=Math.round(((_n=l==null?void 0:l.videoData)==null?void 0:_n.attributes.metadata.video.duration)*1e3);return re.createElement("div",{className:Kn(so.rendererContainer)},re.createElement(vm,{pageId:a,duration:ri,currentIndex:r,storiesCount:n,isPaused:T||D||A,onComplete:Sn}),re.createElement(r3,{pageId:"story_page",componentId:"*",isMuted:P,onPress:P?I:b}),re.createElement(o5,{community:E,heading:re.createElement("div",{"data-qa-anchor":"community_display_name"},E==null?void 0:E.displayName),subheading:Z&&(K!=null&&K.displayName)?re.createElement("span",null,re.createElement("span",{"data-qa-anchor":"created_at"},Cp(Z))," \u2022 By"," ",re.createElement("span",{"data-qa-anchor":"creator_display_name"},K==null?void 0:K.displayName)):"",isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:Xa,isOfficial:Te,isPaused:T,onPlay:N,onPause:B,onMute:b,onUnmute:I,onAction:q,onClickCommunity:()=>g==null?void 0:g(),onClose:f,addStoryButton:t}),re.createElement("video",{"data-qa-anchor":"video_view",ref:x,className:Kn(so.storyVideo),src:((ko=l==null?void 0:l.videoData)==null?void 0:ko.fileUrl)||((ni=(uo=l==null?void 0:l.videoData)==null?void 0:uo.videoUrl)==null?void 0:ni.original),controls:!1,onLoadedData:en,playsInline:!0,onWaiting:()=>c("pause",!0),onPlaying:()=>c("play",!0),muted:P,autoPlay:!0}),!y&&re.createElement("div",{className:Kn(so.loadingOverlay)},C||re.createElement("div",null,"loading...")),re.createElement(nr,{rootId:"asc-uikit-stories-viewer",isOpen:D,onClose:$,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"content-height"},e==null?void 0:e.map(Ae=>re.createElement(z,{key:Ae.name,className:Kn(so.actionButton),onPress:Ae==null?void 0:Ae.action},Ae==null?void 0:Ae.icon,re.createElement(_.BodyBold,null,Ae.name)))),re.createElement(nr,{rootId:"asc-uikit-stories-viewer",isOpen:A,onClose:Q,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"full-height"},re.createElement(Xl,{referenceId:G,referenceType:"story",community:E,shouldAllowCreation:E==null?void 0:E.allowCommentInStory,shouldAllowInteraction:Lt})),((We=(Ra=ee==null?void 0:ee[0])==null?void 0:Ra.data)==null?void 0:We.url)&&re.createElement("div",{className:Kn(so.hyperLinkContainer)},re.createElement(Hn,{href:ee[0].data.url.startsWith("http")?ee[0].data.url:`https://${ee[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},re.createElement(ZC,{lines:1},re.createElement("span",null,((eo=(Re=ee[0])==null?void 0:Re.data)==null?void 0:eo.customText)||ee[0].data.url.replace(/^https?:\/\//,""))))),re.createElement(t5,{pageId:a,storyId:G,syncState:L,reach:O,commentsCount:j,reactionsCount:ce,isLiked:pe,onClickComment:U,myReactions:V,showImpression:$o||Ia(v,E==null?void 0:E.communityId),isMember:Lt}))},l1e=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&e.type==="video",priority:2}},wk={renderer:s1e,tester:l1e};var d1e=({story:e,action:t})=>(useEffect(()=>{t("play");},[e]),re.createElement("div",{style:Sk.storyContent},re.createElement("p",{style:Sk.text},"This story could not be loaded."))),Sk={storyContent:{width:"100%",maxHeight:"100%",margin:"auto"},text:{textAlign:"center",color:"white",width:"90%",margin:"auto"}},c1e=()=>({condition:!0,priority:1}),_k={renderer:d1e,tester:c1e};var f1e=e=>{useEffect(()=>{e.action("play");},[e.story]);let t=e.story.originalContent;return re.createElement(t,m({},e))},g1e=e=>({condition:!!e.content,priority:2}),Tk={renderer:f1e,tester:g1e};var Ut={drawer__content:"Ge",drawer__innerContent:"Bg",drawer__placeholder:"Hg",drawer__overlay:"Lg",drawer__title:"Tg",drawer__content__data:"Vg",drawer__content__data__title:"qg",drawer__content__data__text:"Dg",drawer__content__data__caption:"Gg",drawer__content__data__infoIcon:"Jg",drawer__content__emptySpace:"Kg",drawer__container:"Ng",drawer__innerContainer:"Og"};var Nk=({isOpen:e,onOpenChange:t,ad:o,targetRef:r})=>{var n;return re.createElement(Drawer.Root,{open:e,onOpenChange:t,onDrag:i=>{i.preventDefault(),i.stopPropagation();}},re.createElement(Drawer.Portal,{container:r==null?void 0:r.current},re.createElement("div",{className:Ut.drawer__container},re.createElement("div",{className:Ut.drawer__innerContainer},re.createElement(Drawer.Overlay,{className:Ut.drawer__overlay}),re.createElement(Drawer.Content,{className:Ut.drawer__content},re.createElement("div",{className:Ut.drawer__innerContent},re.createElement("div",{className:Ut.drawer__placeholder}),re.createElement(Drawer.Title,{className:Ut.drawer__title},re.createElement(_.Title,null,"About this advertisement")),re.createElement("div",{className:Ut.drawer__content__data},re.createElement(_.BodyBold,{className:Ut.drawer__content__data__title},"Why this advertisement?"),re.createElement("div",{className:Ut.drawer__content__data__text},re.createElement(qr,{className:Ut.drawer__content__data__infoIcon}),re.createElement(_.Caption,{className:Ut.drawer__content__data__caption},"You're seeing this advertisement because it was displayed to all users in the system."))),re.createElement("div",{className:Ut.drawer__content__data},re.createElement(_.BodyBold,{className:Ut.drawer__content__data__title},"About this advertiser"),re.createElement("div",{className:Ut.drawer__content__data__text},re.createElement(qr,{className:Ut.drawer__content__data__infoIcon}),re.createElement(_.Caption,{className:Ut.drawer__content__data__caption},"Advertiser name: ",(n=o.advertiser)==null?void 0:n.companyName)))),re.createElement("div",{className:Ut.drawer__content__emptySpace}))))))};var zt={iconButton:"Pg",hyperLinkContainer:"Qg",hyperLink__text:"Wg",rendererContainer:"Zg",storyVideo:"_g",muteCircleIcon:"eh",unmuteCircleIcon:"rh",loadingOverlay:"ah",storyImageContainer:"oh",storyImage:"th",playStoryButton:"ih",pauseStoryButton:"sh",closeButton:"ch",verifiedBadge:"nh",dotsButton:"lh",viewStoryInfoContainer:"dh",viewStoryCompostBarContainer:"mh",viewStoryCompostBarViewIconContainer:"gh",viewStoryCompostBarEngagementContainer:"hh",viewStoryCompostBarEngagementIconContainer:"ph",header:"fh",viewStoryContainer:"uh",viewStoryHeaderContainer:"bh",avatarContainer:"vh",addStoryButton:"Je",viewStoryHeaderListActionsContainer:"xh",viewStoryHeadingInfoContainer:"wh",viewStoryHeading:"yh",viewStoryHeadingTitle:"kh",viewStorySubHeading:"jh",story:"zh",storyContent:"Xh",actionButton:"Ke",navigationOverlay:"Yh",leftOverlay:"Ah",rightOverlay:"Ch",imageFit:"Mh",imageFill:"Sh",infoIcon__button:"Eh",infoIcon:"Fh",storyAd__main:"Ih",storyAd__topBar:"Rh",storyAd__topBar__left:"Uh",storyAd__topBar__avatar:"Bh",storyAd__topBar__text:"Hh",storyAd__topBar__advertiserName:"Lh",storyAd__topBar__right:"Th",storyAd__closeButton:"Vh"};var Ak=({pageId:e="*",ad:t,avatarUrl:o,adImageUrl:r,currentIndex:n,isPaused:i,storiesCount:a,renderLoader:s=()=>re.createElement("div",null,"loading..."),onComplete:l=()=>{},onPauseClick:c,onPlayClick:p,onClose:u,onImageLoaded:f,onAdvertisementInfoOpen:g,onAdvertisementInfoClose:y})=>{var N;let[h,C]=useState(!1),[v,w]=useState(!1),x=()=>{w(!0),g==null||g();},P=()=>{w(!1),y==null||y();},b=useRef(null),I=useRef(null),T=()=>{C(!0),f==null||f();};return re.createElement("div",{className:zt.rendererContainer,ref:I},re.createElement("div",{className:zt.storyAd__main},re.createElement(vm,{pageId:e,duration:5e3,currentIndex:n,storiesCount:a,isPaused:i,onComplete:l}),re.createElement("div",{className:zt.storyAd__topBar},re.createElement("div",{className:zt.storyAd__topBar__left},re.createElement("div",{className:zt.storyAd__topBar__avatar},re.createElement(yt,{defaultImage:re.createElement(Jl,null),avatarUrl:o})),re.createElement("div",{className:zt.storyAd__topBar__text},re.createElement(_.BodyBold,{className:zt.storyAd__topBar__advertiserName},(N=t.advertiser)==null?void 0:N.name),re.createElement(Kl,null))),re.createElement("div",{className:zt.storyAd__topBar__right},i?re.createElement(yo,{className:zt.playStoryButton,"data-qa-anchor":"play_button",onClick:()=>p==null?void 0:p()}):re.createElement(ns,{className:zt.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:()=>c==null?void 0:c()}),re.createElement(sr,{defaultClassName:Kn(zt.storyAd__closeButton),pageId:e,onPress:u}))),re.createElement("div",{className:Kn(zt.storyImageContainer)},re.createElement("img",{ref:b,className:Kn(zt.storyImage),"data-qa-anchor":"image_view",src:r,onLoad:T,alt:"Story Image",crossOrigin:"anonymous"})),!h&&re.createElement("div",{className:zt.loadingOverlay},s()),t.callToActionUrl&&re.createElement("div",{className:zt.hyperLinkContainer},re.createElement("a",{className:zt.hyperLink__text,href:t.callToActionUrl,target:"_blank",rel:"noreferrer"},t.callToAction)),re.createElement(z,{className:zt.infoIcon__button,onPress:()=>{console.log("openAdvertisementInfo"),x();}},re.createElement(qr,{className:zt.infoIcon}))),re.createElement(Nk,{ad:t,isOpen:v,targetRef:I,onOpenChange:B=>!B&&P()}))};var I1e=({story:e,action:t,config:o,onClose:r})=>{var T,N,B,D,A,q;let[n,i]=useState(!1),{loader:a}=o,{ad:s,currentIndex:l,storiesCount:c,increaseIndex:p,pageId:u,dragEventTarget:f}=e,g=()=>{t("play",!0),i(!1);},y=()=>{t("pause",!0),i(!0);},C=Je({fileId:(N=(T=s==null?void 0:s.advertiser)==null?void 0:T.avatar)==null?void 0:N.fileId})||((D=(B=s==null?void 0:s.advertiser)==null?void 0:B.avatar)==null?void 0:D.fileUrl)||"",w=Je({fileId:(A=s==null?void 0:s.image9_16)==null?void 0:A.fileId})||((q=s==null?void 0:s.image9_16)==null?void 0:q.fileUrl)||"",x=useCallback(()=>{n&&i(!1),t("play",!0);},[t,n]),P=()=>{t("pause",!0);},b=()=>{t("play",!0);},I=()=>{p();};return useEffect(()=>{var $,U;if(f){let Q=()=>{t("pause",!0),i(!0);},G=()=>{t("play",!0),i(!1);};return ($=f.current)==null||$.addEventListener("dragstart",Q),(U=f.current)==null||U.addEventListener("dragend",G),()=>{var L,O;(L=f.current)==null||L.removeEventListener("dragstart",Q),(O=f.current)==null||O.removeEventListener("dragend",G);}}},[f]),s?re.createElement(Ak,{pageId:u,ad:s,adImageUrl:w,avatarUrl:C,currentIndex:l,isPaused:n,storiesCount:c,renderLoader:()=>a,onComplete:I,onPauseClick:y,onPlayClick:g,onClose:r,onImageLoaded:x,onAdvertisementInfoOpen:P,onAdvertisementInfoClose:b}):null},M1e=e=>({condition:!!e.ad,priority:2}),Lk={renderer:I1e,tester:M1e};var xm=[Mk,wk,Lk,Tk,_k];var ef={storyButton:"Ne",desktopOnly:"Oe"};var S1e=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),re.createElement("path",{d:"M12 23.91C5.578 23.91.375 18.709.375 12.287.375 5.864 5.578.66 12 .66s11.625 5.203 11.625 11.625S18.422 23.91 12 23.91zM6.656 13.084l6.328 6.375c.47.422 1.172.422 1.594 0l.797-.797c.422-.422.422-1.172 0-1.594l-4.781-4.781 4.781-4.735c.422-.468.422-1.171 0-1.593l-.797-.797c-.422-.422-1.172-.422-1.594 0l-6.328 6.328c-.468.469-.468 1.172 0 1.594z"})),jd=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_left_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=F({pageId:e,componentId:t,elementId:r});return i?null:re.createElement("button",{"data-qa-anchor":n,className:Kn(ef.storyButton,ef.desktopOnly),onClick:o,style:a},re.createElement(S1e,null))};var tf={storyButton:"Pe",desktopOnly:"Qe"};var N1e=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),re.createElement("path",{d:"M12 .66c6.422 0 11.625 5.204 11.625 11.626S18.422 23.91 12 23.91.375 18.708.375 12.286 5.578.66 12 .66zm5.297 10.829L10.969 5.16c-.422-.422-1.172-.422-1.594 0l-.797.797c-.422.422-.422 1.172 0 1.593l4.781 4.735-4.78 4.781c-.423.422-.423 1.172 0 1.594l.796.797c.422.422 1.172.422 1.594 0l6.328-6.375c.469-.422.469-1.125 0-1.594z"})),Gd=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_right_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=F({pageId:e,componentId:t,elementId:r});return i?null:re.createElement("button",{"data-qa-anchor":n,className:Kn(tf.storyButton,tf.desktopOnly),onClick:o,style:a},re.createElement(N1e,null))};var Ho={overlayLeft:"We",overlayRight:"Ze",viewStoryContent:"qh",viewStoryOverlay:"Dh",hiddenInput:"Gh",viewStoryContainer:"Jh",storyWrapper:"Kh",deleteIcon:"Nh",arrowButton:"Oh"};var O1e=7e3,Za=e=>!!(e!=null&&e.storyId),s5=({pageId:e="*",communityId:t,onBack:o,onClose:r,onSwipeDown:n,onClickCommunity:i,goToDraftStoryPage:a})=>{var K;let{accessibilityId:s}=tt({pageId:e}),{confirm:l}=$e(),c=Co(),p=useMotionValue(0),u=useRef(null),f=useRef(new EventTarget),[g,y]=useState(!1),{stories:h}=ba({targetId:t,targetType:"community",options:{orderBy:"asc",sortBy:"createdAt"}}),C=useMemo(()=>xm.map(({renderer:E,tester:V})=>({renderer:ee=>E(k(m({},ee),{onClose:()=>r(t),onClickCommunity:()=>i(t)})),tester:V})),[xm,r,i,t]),v=useRef(null),{client:w,currentUserId:x}=Ee(),[P,b]=useState(0),{file:I,setFile:T}=zr(),N=h[P],B=Za(N)?((K=N==null?void 0:N.creator)==null?void 0:K.userId)===x:!1,D=Za(N)?g0(w,N==null?void 0:N.targetId):!1,A=()=>{if(P===h.length-1){o();return}b(P+1);},q=()=>{P!==0&&b(P-1);},$=E=>{l({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You'll no longer to see and find this story.",okText:"Delete",onOk:()=>S(void 0,null,function*(){y(!1),yield StoryRepository.softDeleteStory(E),P===0?r(t):b(P-1),c.success({content:"Story deleted"});})});},U=E=>{$(E);},Q=useCallback((E,V,Y,ee)=>S(void 0,null,function*(){var pe;try{let ce=new FormData;ce.append("files",E),T(null),E!=null&&E.type.includes("image")&&x?yield StoryRepository.createImageStory("user",x,ce,Y,V,ee):x&&(yield StoryRepository.createVideoStory("user",x,ce,Y,ee)),c.success({content:"Successfully shared story"});}catch(ce){ce instanceof Error&&c.info({content:(pe=ce.message)!=null?pe:"Failed to share story"});}}),[x,c,T]),G=()=>{T(null);},L=re.createElement(FileTrigger,{ref:v,onSelect:E=>{let V=Array.from(E);T(V[0]);}},re.createElement(Ma,{pageId:e})),O=()=>{if(P===h.length-1){o();return}b(E=>E+1);},j=h==null?void 0:h.map(E=>{var V,Y,ee;if(Za(E)){let pe=(E==null?void 0:E.dataType)==="image",ce=pe?(V=E==null?void 0:E.imageData)==null?void 0:V.fileUrl:(ee=(Y=E==null?void 0:E.videoData)==null?void 0:Y.videoUrl)==null?void 0:ee["720p"];return {story:E,url:ce,type:pe?"image":"video",actions:[B||D?{name:"Delete",action:()=>U(E==null?void 0:E.storyId),icon:re.createElement(Cu,{fill:getComputedStyle(document.documentElement).getPropertyValue("--asc-color-base-default")})}:null].filter(Ur),onCreateStory:Q,discardStory:G,addStoryButton:L,fileInputRef:v,currentIndex:P,storiesCount:h==null?void 0:h.length,increaseIndex:O,pageId:e,dragEventTarget:f.current,setIsBottomSheetOpen:y,isBottomSheetOpen:g}}else return {ad:E,actions:[],pageId:e,currentIndex:P,storiesCount:h==null?void 0:h.length,increaseIndex:O}}),Z="asc-uikit-stories-viewer";return useEffect(()=>{let E=h[h.length-1];Za(E)&&(E==null?void 0:E.syncState)==="syncing"&&b(h.length-1),N&&Za(N)&&(N==null||N.analytics.markAsSeen());},[P,h]),useEffect(()=>{if(h.filter(Za).every(V=>V==null?void 0:V.isSeen))return;let E=h.findIndex(V=>Za(V)?!(V!=null&&V.isSeen):!1);E!==-1&&b(E);},[]),Rs({targetId:t,targetType:"community"}),I&&a(t,"community",I.type.includes("image")?{type:"image",url:URL.createObjectURL(I)}:{type:"video",url:URL.createObjectURL(I)},"communityFeed"),!h||h.length===0?null:re.createElement("div",{className:Kn(Ho.storyWrapper)},re.createElement(jd,{onClick:q}),re.createElement(motion.div,{id:Z,ref:u,"data-qa-anchor":s,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{f.current.dispatchEvent(new Event("dragstart"));},onDrag:(E,V)=>{V.point.y<V.point.y-V.offset.y&&p.set(0);},onDragEnd:(E,V)=>{f.current.dispatchEvent(new Event("dragend")),V.offset.y>100?n(t):p.set(0);},className:Kn(Ho.viewStoryContainer)},re.createElement("div",{className:Kn(Ho.viewStoryContent)},re.createElement("div",{className:Kn(Ho.overlayLeft),onClick:q}),re.createElement("div",{className:Kn(Ho.overlayRight),onClick:A}),re.createElement("div",{className:Kn(Ho.viewStoryOverlay)}),re.createElement(L1e,{key:h==null?void 0:h.length,progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:P,stories:j,renderers:C,defaultInterval:O1e,onStoryStart:()=>Za(N)&&(N==null?void 0:N.analytics.markAsSeen()),onStoryEnd:A,onNext:A,onPrevious:q,onAllStoriesEnd:A}))),re.createElement(Gd,{onClick:A}))};var $1e=7e3,qa=e=>!!(e!=null&&e.storyId),Dk=({pageId:e="*",targetId:t,targetIds:o,onChangePage:r,onClickStory:n,goToDraftStoryPage:i,onClose:a,onSwipeDown:s,onClickCommunity:l})=>{var K;let{accessibilityId:c}=tt({pageId:e}),{confirm:p}=$e(),u=Co(),{client:f,currentUserId:g}=Ee(),{file:y,setFile:h}=zr(),C=useMotionValue(0),v=useRef(null),w=useRef(new EventTarget),[x,P]=useState(0),b=useRef(null),{stories:I}=ba({targetType:"community",targetId:t,options:{orderBy:"asc",sortBy:"createdAt"}}),T=useMemo(()=>xm.map(({renderer:E,tester:V})=>({renderer:ee=>E(k(m({},ee),{onClose:()=>a(t),onClickCommunity:()=>l(t)})),tester:V})),[xm,a,s,l,t]),N=I[x],B=qa(N)?((K=N==null?void 0:N.creator)==null?void 0:K.userId)===g:!1,D=qa(N)?g0(f,N==null?void 0:N.targetId):!1,A=()=>{if(x===0){let V=o.indexOf(t)-1;if(V>=0){let Y=o[V];n(Y);}else r==null||r();P(0);return}P(E=>E-1);},q=E=>{let V=x===I.length-1;p({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",okText:"Delete",onOk:()=>S(void 0,null,function*(){yield StoryRepository.softDeleteStory(E),u.success({content:"Story deleted"}),I.length===1?r==null||r():V?A():P(Y=>Y);})});},$=E=>{q(E);},U=(E,V,Y,ee)=>S(void 0,null,function*(){var pe;try{let ce=new FormData;if(ce.append("files",E),h(null),E!=null&&E.type.includes("image")&&g){let{data:je}=yield StoryRepository.createImageStory("user",g,ce,Y,V,ee);je&&u.success({content:"Successfully shared story"});}else if(g){let{data:je}=yield StoryRepository.createVideoStory("user",g,ce,Y,ee);je&&u.success({content:"Successfully shared story"});}}catch(ce){ce instanceof Error&&u.info({content:(pe=ce.message)!=null?pe:"Failed to share story"});}}),Q=()=>{h(null);},G=re.createElement(FileTrigger,{ref:b,onSelect:E=>{let V=Array.from(E);h(V[0]);}},re.createElement(Ma,{pageId:e})),L=()=>{x!==I.length-1&&P(E=>E+1);},O=I==null?void 0:I.map(E=>{var V,Y,ee;if(qa(E)){let pe=(E==null?void 0:E.dataType)==="image",ce=pe?(V=E==null?void 0:E.imageData)==null?void 0:V.fileUrl:(ee=(Y=E==null?void 0:E.videoData)==null?void 0:Y.videoUrl)==null?void 0:ee["720p"];return {story:E,url:ce,type:pe?"image":"video",actions:[B||D?{name:"Delete",action:()=>$(E==null?void 0:E.storyId),icon:re.createElement(qs,{className:Ho.deleteIcon})}:null].filter(Ur),onCreateStory:U,discardStory:Q,addStoryButton:G,fileInputRef:b,currentIndex:x,storiesCount:I==null?void 0:I.length,increaseIndex:L,pageId:e}}else return {ad:E,actions:[],pageId:e,currentIndex:x,storiesCount:I==null?void 0:I.length,increaseIndex:L}}),j=()=>{if(x===(O==null?void 0:O.length)-1){let V=o.indexOf(t)+1;if(V<o.length){let Y=o[V];n(Y);}else r==null||r();P(0);return}P(E=>E+1);},Z="asc-uikit-stories-viewer";return useEffect(()=>{let E=I[I.length-1];qa(E)&&(E==null?void 0:E.syncState)==="syncing"&&P(I.length-1),N&&qa(N)&&(N==null||N.analytics.markAsSeen());},[N,I]),useEffect(()=>{if(I.filter(qa).every(V=>V==null?void 0:V.isSeen))return;let E=I.findIndex(V=>qa(V)?!(V!=null&&V.isSeen):!1);E!==-1&&P(E);},[]),useEffect(()=>{y&&i(t,"community",y.type.includes("image")?{type:"image",url:URL.createObjectURL(y)}:{type:"video",url:URL.createObjectURL(y)},"globalFeed");},[y,i,t]),Rs({targetId:t,targetType:"community"}),!I||I.length===0?null:re.createElement("div",{className:Kn(Ho.storyWrapper),"data-qa-anchor":c},re.createElement(jd,{onClick:A}),re.createElement(motion.div,{id:Z,ref:v,"data-qa-anchor":c,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{w.current.dispatchEvent(new Event("dragstart"));},onDrag:(E,V)=>{V.point.y<V.point.y-V.offset.y&&C.set(0);},onDragEnd:(E,V)=>{w.current.dispatchEvent(new Event("dragend")),V.offset.y>100?s(t):C.set(0);},className:Kn(Ho.viewStoryContainer)},re.createElement("div",{className:Kn(Ho.viewStoryContent)},re.createElement("div",{className:Kn(Ho.overlayLeft),onClick:A}),re.createElement("div",{className:Kn(Ho.overlayRight),onClick:j}),re.createElement("div",{className:Kn(Ho.viewStoryOverlay)}),re.createElement(L1e,{progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:x,stories:O,renderers:T,defaultInterval:$1e,onStoryStart:()=>qa(N)&&(N==null?void 0:N.analytics.markAsSeen()),onStoryEnd:L,onNext:j,onPrevious:A,onAllStoriesEnd:j}))),re.createElement(Gd,{onClick:j}))};var l5=({pageId:e="*",targetId:t,onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})=>{let{stories:l}=Mp({seenState:"smart",limit:10});return re.createElement(Dk,{pageId:e,targetId:t,targetIds:l.map(c=>c.targetId),onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})};var q1e=({type:e,targetId:t})=>{let o="view_story_page",{onBack:r,goToDraftStoryPage:n,onClickCommunity:i,onChangePage:a,onClickStory:s}=X(),l=()=>{a("newsfeed");},c=p=>{i(p);};return e==="communityFeed"?re.createElement(s5,{pageId:o,communityId:t,onBack:r,onClose:c,onSwipeDown:c,onClickCommunity:c,goToDraftStoryPage:({targetId:p,targetType:u,mediaType:f,storyType:g})=>n(p,u,f,g)}):e==="globalFeed"?re.createElement(l5,{pageId:o,targetId:t,onChangePage:l,onClose:l,onSwipeDown:l,onClickStory:p=>s(p,"globalFeed"),goToDraftStoryPage:({targetId:p,targetType:u,mediaType:f,storyType:g})=>n(p,u,f,g),onClickCommunity:p=>i(p)}):null},Vk=q1e;var Uk={roundedBackButton:"Ph"};var Y1e=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 32 32"},e),re.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"#000",fillOpacity:"0.5"}),re.createElement("path",{fill:"currentColor",d:"M16.176 23.914c-.14.176-.422.176-.598 0L8.23 16.566a.405.405 0 010-.597l7.348-7.348c.176-.176.457-.176.598 0l.703.668c.176.176.176.457 0 .598l-5.45 5.449h12.024c.211 0 .422.21.422.422v.984c0 .246-.21.422-.422.422H11.43l5.449 5.484c.176.141.176.422 0 .598l-.703.668z"})),lf=({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n})=>{let i="back_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return c?null:re.createElement(z,{style:u,className:Uk.roundedBackButton,onPress:n},re.createElement(ae,{"data-qa-anchor":a,defaultIcon:()=>re.createElement(Y1e,{className:o}),imgIcon:()=>re.createElement("img",{src:s.icon,alt:p,className:r}),defaultIconName:l.icon,configIconName:s.icon}))};var In={draftPageContainer:"_e",headerContainer:"Qh",storyWrapper:"Wh",header:"Zh",topRightButtons:"_h",mainContainer:"ep",previewImage:"rp",footer:"ap",videoPreview:"op",hyperLinkContainer:"tp",playPauseButton:"ip",progressBar:"sp",progressFill:"cp",userInfo:"np",name:"lp",description:"dp",storyPreview:"mp"};var mf=({targetId:e,targetType:t,mediaType:o,goToCommunityPage:r,goToGlobalFeedPage:n,onDiscardCreateStory:i})=>{var Q,G,L,O,j,Z;let{page:a}=ot(),s="create_story_page",{accessibilityId:l,themeStyles:c}=tt({pageId:s}),{file:p,setFile:u}=zr(),{community:f}=zp(e),[g,y]=useState(!1),{confirm:h}=$e(),C=Co(),[v,w]=useState([{data:{url:"",customText:""},type:"hyperlink"}]),x=()=>{y(!1);},[P,b]=useState("fit"),[I,T]=useState([]),N=()=>{b(P==="fit"?"fill":"fit"),P==="fill"&&T([]);},B=(K,E,V,Y)=>S(void 0,null,function*(){var ee;if(K)try{let pe=new FormData;pe.append("files",K),u(null),a.type==="DraftPage"&&a.context.storyType==="globalFeed"?n():r(e),(o==null?void 0:o.type)==="image"&&e?yield StoryRepository.createImageStory(t,e,pe,V,E,Y):(o==null?void 0:o.type)==="video"&&e&&(yield StoryRepository.createVideoStory(t,e,pe,V,Y)),C.success({content:"Successfully shared story"});}catch(pe){pe instanceof Error&&C.info({content:(ee=pe.message)!=null?ee:"Failed to share story"});}}),D=()=>{h({pageId:s,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",cancelText:"Cancel",okText:"Delete",onOk:()=>{u(null),i();}});},A=({url:K,customText:E})=>{w([{data:{url:K,customText:E||""},type:"hyperlink"}]),y(!1);},q=()=>{w([{data:{url:"",customText:""},type:"hyperlink"}]);},$=()=>{var K,E;if((E=(K=v[0])==null?void 0:K.data)!=null&&E.url){C.info({content:"Can\u2019t add more than one link to your story."});return}y(!0);},U=useCallback(K=>S(void 0,null,function*(){let E=new Image;E.crossOrigin="Anonymous",E.src=K,E.onload=()=>{let Y=new Rse().getPalette(E,2);Y&&T(Y.map(ee=>`rgb(${ee.join(",")})`));};}),[]);return useEffect(()=>{S(void 0,null,function*(){if((o==null?void 0:o.type)==="image")if(p){let E=URL.createObjectURL(p);yield U(E);}else o.url&&(yield U(o.url));});},[p,o,U]),re.createElement("div",{"data-qa-anchor":l,style:c,className:In.storyWrapper},re.createElement("div",{id:"asc-uikit-create-story",className:In.draftPageContainer},re.createElement("div",{className:In.headerContainer},re.createElement("div",{className:In.header},re.createElement(lf,{pageId:s,onPress:D}),re.createElement("div",{className:In.topRightButtons},(o==null?void 0:o.type)==="image"&&re.createElement(Zp,{pageId:s,onPress:N}),re.createElement(Kp,{pageId:s,onPress:$})))),(o==null?void 0:o.type)==="image"?re.createElement("div",{className:In.mainContainer,style:{background:`linear-gradient(
|
|
3796
|
+
`,Lse=e=>re.createElement(Ase,m({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none"},e),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"white",strokeWidth:"2"}),re.createElement("circle",{cx:"10.5",cy:"10.5",r:"9",fill:"none",stroke:"#1054DE",strokeWidth:"2",strokeDasharray:"46.75",strokeDashoffset:"21",strokeLinecap:"round",strokeLinejoin:"round"})),e5=Lse;var q7={storyCommentButton:"hm",storyCommentIcon:"pm"};var Dse=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),re.createElement("path",{fill:"#A5A9B5",d:"M10 2.188c4.682 0 8.5 3.12 8.5 6.906C18.5 12.912 14.682 16 10 16c-1.295 0-2.49-.232-3.586-.63-.797.663-2.457 1.693-4.648 1.693-.133 0-.2-.034-.266-.133-.033-.1 0-.233.066-.3 0-.032 1.395-1.493 1.827-3.187-1.196-1.195-1.893-2.69-1.893-4.35 0-3.784 3.785-6.905 8.5-6.905z"})),gk=({pageId:e="*",componentId:t="*",onPress:o,commentsCount:r,imgClassName:n})=>{let i="story_comment_button",{isExcluded:a,accessibilityId:s,defaultConfig:l,config:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return a?null:re.createElement(z,{"data-qa-anchor":s,onPress:o,style:u,className:Kn(q7.storyCommentButton)},re.createElement(ae,{defaultIconName:l.icon,configIconName:c.icon,imgIcon:()=>re.createElement("img",{src:c.icon,alt:p,className:Kn(n),style:u}),defaultIcon:()=>re.createElement("div",{className:Kn(q7.storyCommentIcon)},re.createElement(Dse,null),re.createElement(_.BodyBold,null,ov(r)))}))};var Y7={storyReactionButton:"fm",storyReactionIcon:"um"};var Use=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),re.createElement("path",{fill:"#A5A9B5",d:"M17.793 11.025c.148.854.037 1.67-.334 2.338a3.437 3.437 0 01-.668 2.487c-.037 2.078-1.299 3.525-4.156 3.525h-.854c-3.785 0-4.935-1.41-6.605-1.447-.112.482-.594.853-1.114.853H1.688c-.667 0-1.187-.52-1.187-1.187V8.687c0-.63.52-1.187 1.188-1.187h3.636c.705-.594 1.707-2.227 2.56-3.08.52-.52.372-4.045 2.673-4.045 2.115 0 3.525 1.188 3.525 3.896 0 .706-.148 1.262-.334 1.745h1.373c1.781 0 3.191 1.521 3.191 3.154 0 .705-.185 1.299-.519 1.855zm-2.3 2.004c.816-.742.704-1.892.185-2.449.37 0 .853-.705.853-1.373-.037-.705-.63-1.41-1.41-1.41h-3.86c0-1.41 1.04-2.078 1.04-3.526 0-.89 0-2.115-1.744-2.115-.705.705-.372 2.487-1.41 3.526-1.002 1.002-2.45 3.6-3.526 3.6H5.25v6.939c1.967 0 3.71 1.373 6.346 1.373h1.41c1.299 0 2.264-.631 1.967-2.412.556-.334 1.002-1.373.52-2.153zM3.765 16.406a.903.903 0 00-.891-.89.88.88 0 00-.89.89c0 .52.37.89.89.89a.88.88 0 00.89-.89z"})),zse=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),re.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"url(#paint0_linear_7702_34939)"}),re.createElement("path",{fill:"#fff",d:"M7.486 10.575H5.42a.611.611 0 00-.62.619v6.187c0 .361.258.619.62.619h2.066c.336 0 .62-.258.62-.619v-6.187a.628.628 0 00-.62-.62zm-1.033 6.394a.596.596 0 01-.62-.62c0-.334.258-.618.62-.618.336 0 .62.284.62.619 0 .36-.284.619-.62.619zm8.264-10.055c0-1.908-1.24-2.114-1.859-2.114-.542 0-.775 1.031-.878 1.495-.155.567-.284 1.134-.672 1.521-.826.851-1.265 1.908-2.298 2.913a.415.415 0 00-.078.232v5.518c0 .154.13.283.284.31.414 0 .956.231 1.37.412.826.36 1.833.799 3.073.799h.077c1.11 0 2.428 0 2.944-.748.233-.31.285-.696.155-1.16.44-.438.646-1.263.44-1.934.439-.593.49-1.443.232-2.036.31-.31.516-.8.49-1.264 0-.799-.67-1.52-1.523-1.52h-2.635c.207-.723.878-1.341.878-2.424z"}),re.createElement("defs",null,re.createElement("linearGradient",{id:"paint0_linear_7702_34939",x1:"9",x2:"19.8",y1:"2.4",y2:"29.4",gradientUnits:"userSpaceOnUse"},re.createElement("stop",{stopColor:"#5B9DFF"}),re.createElement("stop",{offset:"1",stopColor:"#0041BE"})))),yk=({myReactions:e=[],reactionsCount:t,pageId:o="*",componentId:r="*",defaultIconClassName:n,imgIconClassName:i,onPress:a})=>{let s="story_reaction_button",{isExcluded:l,accessibilityId:c,config:p,uiReference:u,themeStyles:f}=F({pageId:o,componentId:r,elementId:s}),g=e.length>0;return l?null:re.createElement(z,{"data-qa-anchor":c,className:Kn(Y7.storyReactionButton),onPress:a,style:f},re.createElement(ae,{defaultIcon:()=>re.createElement("div",{className:Kn(Y7.storyReactionIcon,n)},g?re.createElement(zse,null):re.createElement(Use,null),re.createElement(_.BodyBold,null,ov(t))),imgIcon:()=>re.createElement("img",{src:p.icon,alt:u,className:Kn(i)})}))};var $a={viewStoryCompostBarContainer:"bm",viewStoryFailedCompostBarContainer:"vm",viewStoryFailedCompostBarWrapper:"xm",viewStoryUploadingWrapper:"wm",viewStoryCompostBarViewIconContainer:"ym",viewStoryCompostBarEngagementContainer:"km",viewStoryCommentButton:"jm",viewStoryCommentIcon:"zm"};var jse=({pageId:e="*",syncState:t,reach:o,commentsCount:r,reactionsCount:n,isLiked:i,storyId:a,onClickComment:s,showImpression:l,isMember:c,myReactions:p})=>{let u=Co(),f=()=>S(void 0,null,function*(){try{if(!c){u.info({content:"Join community to interact with all stories"});return}i?yield ReactionRepository.removeReaction("story",a,Qo):yield ReactionRepository.addReaction("story",a,Qo);}catch(g){console.error("Can't toggle like",g);}});return t==="syncing"?re.createElement("div",{className:$a.viewStoryCompostBarContainer},re.createElement("div",{className:$a.viewStoryUploadingWrapper},re.createElement(e5,{width:20,height:20}),"Uploading...")):t==="error"?re.createElement("div",{className:$a.viewStoryFailedCompostBarContainer},re.createElement("div",{className:$a.viewStoryFailedCompostBarWrapper},re.createElement(hu,null),re.createElement("span",null,"Failed to upload")),re.createElement(ji,null)):re.createElement("div",{className:$a.viewStoryCompostBarContainer},re.createElement("div",null,l&&re.createElement("div",{className:$a.viewStoryCompostBarViewIconContainer},re.createElement(Jp,{reach:o}))),re.createElement("div",{className:$a.viewStoryCompostBarEngagementContainer},re.createElement(gk,{pageId:e,commentsCount:r,onPress:s}),re.createElement(yk,{pageId:e,myReactions:p,reactionsCount:n,onPress:f})))},t5=jse;var Tr={iconButton:"Xm",rendererContainer:"Ym",storyVideo:"Am",muteCircleIcon:"Cm",unmuteCircleIcon:"Mm",loadingOverlay:"Sm",storyImage:"Em",playStoryButton:"Fm",pauseStoryButton:"Im",closeButton:"Rm",verifiedBadge:"Um",dotsButton:"Bm",viewStoryInfoContainer:"Hm",viewStoryCompostBarContainer:"Lm",viewStoryCompostBarViewIconContainer:"Tm",viewStoryCompostBarEngagementContainer:"Vm",viewStoryCompostBarEngagementIconContainer:"qm",storyContent:"Dm",header:"Gm",viewStoryContainer:"Jm",viewStoryHeaderContainer:"Km",avatarContainer:"Nm",addStoryButton:"Te",viewStoryHeaderListActionsContainer:"Om",viewStoryHeadingInfoContainer:"Pm",viewStoryHeading:"Qm",viewStoryHeadingTitle:"Wm",viewStorySubHeading:"Zm"};var qse=({community:e,heading:t,subheading:o,isHaveActions:r,isOfficial:n,isPaused:i,onPlay:a,onPause:s,onAction:l,onClose:c,onClickCommunity:p,haveStoryPermission:u,addStoryButton:f})=>re.createElement("div",{className:Tr.viewStoryHeaderContainer},re.createElement("div",{className:Tr.viewStoryHeadingInfoContainer},re.createElement("div",{className:Tr.avatarContainer},re.createElement(br,{pageId:"story_page",community:e}),u&&f),re.createElement("div",{className:Tr.viewStoryInfoContainer},re.createElement("div",{className:Tr.viewStoryHeading},re.createElement(ZC,{lines:1},re.createElement("div",{className:Tr.viewStoryHeadingTitle,"data-qa-anchor":"community_display_name",onClick:p},t)),n&&re.createElement(Zs,{className:Tr.verifiedBadge})),re.createElement("span",{className:Tr.viewStorySubHeading},o))),re.createElement("div",{className:Tr.viewStoryHeaderListActionsContainer},i?re.createElement(yo,{className:Tr.playStoryButton,"data-qa-anchor":"play_button",onClick:a}):re.createElement(ns,{className:Tr.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:s}),r&&re.createElement(Xp,{pageId:"story_page",onPress:l}),re.createElement(sr,{defaultClassName:Kn(Tr.closeButton),pageId:"story_page",onPress:c}))),o5=qse;function Od({queryParams:e,shouldCall:t=!0}){let n=oo({fetcher:CommunityRepository.Membership.getMembers,params:e,shouldCall:!!(e!=null&&e.communityId)&&t}),{items:o}=n,r=M(n,["items"]);return m({members:o},r)}var so={iconButton:"_m",hyperLinkContainer:"Ve",rendererContainer:"eg",storyVideo:"rg",muteCircleIcon:"ag",unmuteCircleIcon:"og",loadingOverlay:"tg",storyImageContainer:"ig",storyImage:"sg",playStoryButton:"cg",pauseStoryButton:"ng",closeButton:"lg",verifiedBadge:"dg",dotsButton:"mg",viewStoryInfoContainer:"gg",viewStoryCompostBarContainer:"hg",viewStoryCompostBarViewIconContainer:"pg",viewStoryCompostBarEngagementContainer:"fg",viewStoryCompostBarEngagementIconContainer:"ug",header:"bg",viewStoryContainer:"vg",viewStoryHeaderContainer:"xg",avatarContainer:"wg",addStoryButton:"qe",viewStoryHeaderListActionsContainer:"yg",viewStoryHeadingInfoContainer:"kg",viewStoryHeading:"jg",viewStoryHeadingTitle:"zg",viewStorySubHeading:"Xg",story:"Yg",storyContent:"Ag",actionButton:"De",navigationOverlay:"Cg",leftOverlay:"Mg",rightOverlay:"Sg",imageFit:"Eg",imageFill:"Fg"};var r5={progressBarContainer:"Ig",progressSegment:"Rg",progressBar:"Ug"};var vm=re.memo(({pageId:e="*",componentId:t="*",duration:o,currentIndex:r,storiesCount:n,isPaused:i,onComplete:a})=>{let s="progress_bar",{config:l,isExcluded:c}=F({pageId:e,componentId:t,elementId:s}),[p,u]=useState(new Array(n).fill(0)),[f,g]=useState(r),y=l==null?void 0:l.backgroundColor,h=l==null?void 0:l.progressColor;return useEffect(()=>{r<f&&u(C=>{let v=[...C];return v[r]=0,v}),g(r);},[r,f]),useEffect(()=>{let C;return i||(C=setInterval(()=>{u(v=>{let w=[...v];return w[r]<100&&(w[r]+=100/o*100,w[r]>=100&&(w[r]=100,a())),w});},100)),()=>{C&&clearInterval(C);}},[o,r,i,a]),c?null:re.createElement("div",{className:Kn(r5.progressBarContainer),style:{backgroundColor:y}},p.map((C,v)=>re.createElement("div",{key:v,className:Kn(r5.progressSegment),style:{width:`calc(${100/n}% - 4px)`}},re.createElement("div",{className:Kn(r5.progressBar),style:{width:`${v<r?100:v===r?C:0}%`,backgroundColor:h}}))))});var e1e=({story:{actions:e,fileInputRef:t,addStoryButton:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l,url:c},action:p,config:u,onClose:f,onClickCommunity:g})=>{var Re,eo,Ae,fo;let{formatMessage:y}=useIntl(),[h,C]=useState(!1),[v,w]=useState(!1),[x,P]=useState(!1),[b,I]=useState(!1),{loader:T}=u,{client:N}=Ee(),[B,D]=useState(""),A=useRef(null),q=!!(l&&l.myReactions&&l.myReactions.includes(hn)),$=(l==null?void 0:l.reactionsCount)||0,{storyId:U,syncState:Q,reach:G,commentsCount:L,createdAt:O,creator:j,community:Z,myReactions:K,data:E,items:V}=l,{members:Y}=Od({queryParams:{communityId:Z==null?void 0:Z.communityId},shouldCall:!!(Z!=null&&Z.communityId)}),pe=(Y==null?void 0:Y.find(et=>et.userId===(N==null?void 0:N.userId)))!=null,{user:ce}=Mo(N==null?void 0:N.userId),je=(Z==null?void 0:Z.isOfficial)||!1,Lt=(j==null?void 0:j.userId)===(ce==null?void 0:ce.userId),Ne=hp(ce==null?void 0:ce.roles),$o=yp(ce==null?void 0:ce.roles),po=Ne||$o||Ia(N,Z==null?void 0:Z.communityId),Ja=useMemo(()=>re.createElement("div",{"data-qa-anchor":"community_display_name"},Z==null?void 0:Z.displayName),[Z==null?void 0:Z.displayName]),Xa=useMemo(()=>O&&(j!=null&&j.displayName)?re.createElement("span",null,re.createElement("span",{"data-qa-anchor":"created_at"},Cp(O))," \u2022 By"," ",re.createElement("span",{"data-qa-anchor":"creator_display_name"},j==null?void 0:j.displayName)):"",[O,j==null?void 0:j.displayName]),en="asc-uikit-stories-viewer",Sn=useCallback(()=>{if(A.current&&A.current.complete){let Eo=new Rse().getPalette(A.current,2);if(Eo){let sc=`linear-gradient(to top, rgb(${Eo[0].join(",")}), rgb(${Eo[1].join(",")})`;D(sc);}}},[]),ri=useCallback(()=>{C(!0),b&&I(!1),p("play",!0),Sn();},[p,b,Sn]),ye=()=>{p("play",!0),I(!1);},ft=()=>{p("pause",!0),I(!0);},_n=()=>{p("pause",!0),w(!0);},ko=()=>{p("play",!0),w(!1);},uo=()=>{p("pause",!0),P(!0);},ni=()=>{p("play",!0),P(!1);},Ra=()=>{f();},We=()=>{i();};return useEffect(()=>{A.current&&A.current.complete&&Sn();},[]),useEffect(()=>{if(t.current){let et=()=>{p("pause",!0),I(!0);},Eo=()=>{p("play",!0),I(!1);};return t.current.addEventListener("click",et),t.current.addEventListener("cancel",Eo),()=>{t.current&&(t.current.removeEventListener("cancel",Eo),t.current.removeEventListener("click",et));}}},[t]),useEffect(()=>{var et,Eo;if(s){let sc=()=>{p("pause",!0),I(!0);},yg=()=>{p("play",!0),I(!1);};return (et=s.current)==null||et.addEventListener("dragstart",sc),(Eo=s.current)==null||Eo.addEventListener("dragend",yg),()=>{var hg,Cg;(hg=s.current)==null||hg.removeEventListener("dragstart",sc),(Cg=s.current)==null||Cg.removeEventListener("dragend",yg);}}},[s]),re.createElement("div",{className:so.rendererContainer,style:{background:B}},re.createElement(vm,{pageId:a,duration:5e3,currentIndex:r,storiesCount:n,isPaused:b||v||x,onComplete:We}),re.createElement(o5,{community:Z,heading:Ja,subheading:Xa,isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:po,isOfficial:je,isPaused:b,onPlay:ye,onPause:ft,onAction:_n,onClickCommunity:()=>g==null?void 0:g(),onClose:Ra,addStoryButton:o}),re.createElement("div",{className:Kn(so.storyImageContainer,{[so.imageFit]:E.imageDisplayMode==="fit",[so.imageFill]:E.imageDisplayMode==="fill"})},re.createElement("img",{ref:A,className:Kn(so.storyImage,{[so.imageFit]:E.imageDisplayMode==="fit",[so.imageFill]:E.imageDisplayMode==="fill"}),"data-qa-anchor":"image_view",src:c!=null?c:l==null?void 0:l.data.fileData,onLoad:ri,alt:"Story Image",crossOrigin:"anonymous"})),!h&&re.createElement("div",{className:so.loadingOverlay},T||re.createElement("div",null,"loading...")),re.createElement(nr,{rootId:en,isOpen:v,onClose:ko,mountPoint:document.getElementById(en),detent:"content-height"},e==null?void 0:e.map(et=>re.createElement(z,{key:et.name,className:so.actionButton,onPress:()=>et==null?void 0:et.action()},(et==null?void 0:et.icon)&&et.icon,re.createElement(_.BodyBold,null,et.name)))),re.createElement(nr,{rootId:en,isOpen:x,onClose:ni,mountPoint:document.getElementById(en),detent:"full-height",headerTitle:y({id:"storyViewer.commentSheet.title"})},re.createElement(Xl,{referenceId:U,referenceType:"story",community:Z,shouldAllowCreation:Z==null?void 0:Z.allowCommentInStory,shouldAllowInteraction:pe})),((eo=(Re=V==null?void 0:V[0])==null?void 0:Re.data)==null?void 0:eo.url)&&re.createElement("div",{className:so.hyperLinkContainer},re.createElement(Hn,{href:V[0].data.url.startsWith("http")?V[0].data.url:`https://${V[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},re.createElement(ZC,{lines:1},re.createElement("span",null,((fo=(Ae=V[0])==null?void 0:Ae.data)==null?void 0:fo.customText)||V[0].data.url.replace(/^https?:\/\//,""))))),re.createElement(t5,{pageId:a,storyId:U,syncState:Q,reach:G,commentsCount:L,reactionsCount:$,isLiked:q,myReactions:K,onClickComment:uo,showImpression:Lt||Ia(N,Z==null?void 0:Z.communityId),isMember:pe}))},t1e=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&(!e.type||e.type==="image"),priority:2}},Mk={renderer:e1e,tester:t1e};var n1e=()=>{let[e,t]=useState(!1),o=useCallback(()=>t(!0),[]),r=useCallback(()=>t(!1),[]);return {muted:e,mute:o,unmute:r}},i1e=e=>{let[t,o]=useState(!1),r=useCallback(()=>{e("play",!0),o(!1);},[e]),n=useCallback(()=>{e("pause",!0),o(!0);},[e]);return {isPaused:t,play:r,pause:n}},a1e=e=>{let[t,o]=useState(!1),[r,n]=useState(!1),i=useCallback(()=>{e("pause",!0),o(!0);},[e]),a=useCallback(()=>{e("play",!0),o(!1);},[e]),s=useCallback(()=>{e("pause",!0),n(!0);},[e]),l=useCallback(()=>{e("play",!0),n(!1);},[e]);return {isBottomSheetOpen:t,isOpenCommentSheet:r,openBottomSheet:i,closeBottomSheet:a,openCommentSheet:s,closeCommentSheet:l}},s1e=({story:{actions:e,addStoryButton:t,fileInputRef:o,currentIndex:r,storiesCount:n,increaseIndex:i,pageId:a,dragEventTarget:s,story:l},action:c,config:p,messageHandler:u,onClose:f,onClickCommunity:g})=>{var ye,ft,_n,ko,uo,ni,Ra,We,Re,eo;let[y,h]=useState(!1),{loader:C}=p,{client:v}=Ee(),{user:w}=Mo(v==null?void 0:v.userId),x=useRef(null),{muted:P,mute:b,unmute:I}=n1e(),{isPaused:T,play:N,pause:B}=i1e(c),{isBottomSheetOpen:D,isOpenCommentSheet:A,openBottomSheet:q,closeBottomSheet:$,openCommentSheet:U,closeCommentSheet:Q}=a1e(c),{storyId:G,syncState:L,reach:O,commentsCount:j,createdAt:Z,creator:K,community:E,myReactions:V,data:Y,items:ee}=l,pe=(ye=l==null?void 0:l.myReactions)==null?void 0:ye.includes(hn),ce=(l==null?void 0:l.reactions[hn])||0,{members:je}=Od({queryParams:{communityId:E==null?void 0:E.communityId},shouldCall:!!(E!=null&&E.communityId)}),Lt=je==null?void 0:je.some(Ae=>Ae.userId===(v==null?void 0:v.userId)),Ne=(E==null?void 0:E.isOfficial)||!1,$o=(K==null?void 0:K.userId)===(w==null?void 0:w.userId),po=hp(w==null?void 0:w.roles),Ja=yp(w==null?void 0:w.roles),Xa=po||Ja||Ia(v,E==null?void 0:E.communityId),en=useCallback(()=>{var Ae;u("UPDATE_VIDEO_DURATION",{duration:(Ae=l==null?void 0:l.videoData)==null?void 0:Ae.attributes.metadata.video.duration}),h(!0),c("play",!0);},[u,(ft=l==null?void 0:l.videoData)==null?void 0:ft.attributes.metadata.video.duration,c]),Sn=useCallback(()=>{r+1<n?i():f();},[r,n,i,f]);useEffect(()=>{x.current&&(T||D||A?(x.current.pause(),c("pause",!0)):(x.current.play(),c("play",!0)));},[T,D,A,c]),useEffect(()=>{if(o.current){let Ae=()=>{c("pause",!0),B();},fo=()=>{c("play",!0),N();};return o.current.addEventListener("click",Ae),o.current.addEventListener("cancel",fo),()=>{var et,Eo;(et=o.current)==null||et.removeEventListener("click",Ae),(Eo=o.current)==null||Eo.removeEventListener("cancel",fo);}}},[c,B,N]),useEffect(()=>{if(s!=null&&s.current){let Ae=()=>{c("pause",!0),B();},fo=()=>{c("play",!0),N();};return s.current.addEventListener("dragstart",Ae),s.current.addEventListener("dragend",fo),()=>{var et,Eo;(et=s.current)==null||et.removeEventListener("dragstart",Ae),(Eo=s.current)==null||Eo.removeEventListener("dragend",fo);}}},[c,B,N,s]);let ri=Math.round(((_n=l==null?void 0:l.videoData)==null?void 0:_n.attributes.metadata.video.duration)*1e3);return re.createElement("div",{className:Kn(so.rendererContainer)},re.createElement(vm,{pageId:a,duration:ri,currentIndex:r,storiesCount:n,isPaused:T||D||A,onComplete:Sn}),re.createElement(r3,{pageId:"story_page",componentId:"*",isMuted:P,onPress:P?I:b}),re.createElement(o5,{community:E,heading:re.createElement("div",{"data-qa-anchor":"community_display_name"},E==null?void 0:E.displayName),subheading:Z&&(K!=null&&K.displayName)?re.createElement("span",null,re.createElement("span",{"data-qa-anchor":"created_at"},Cp(Z))," \u2022 By"," ",re.createElement("span",{"data-qa-anchor":"creator_display_name"},K==null?void 0:K.displayName)):"",isHaveActions:(e==null?void 0:e.length)>0,haveStoryPermission:Xa,isOfficial:Ne,isPaused:T,onPlay:N,onPause:B,onMute:b,onUnmute:I,onAction:q,onClickCommunity:()=>g==null?void 0:g(),onClose:f,addStoryButton:t}),re.createElement("video",{"data-qa-anchor":"video_view",ref:x,className:Kn(so.storyVideo),src:((ko=l==null?void 0:l.videoData)==null?void 0:ko.fileUrl)||((ni=(uo=l==null?void 0:l.videoData)==null?void 0:uo.videoUrl)==null?void 0:ni.original),controls:!1,onLoadedData:en,playsInline:!0,onWaiting:()=>c("pause",!0),onPlaying:()=>c("play",!0),muted:P,autoPlay:!0}),!y&&re.createElement("div",{className:Kn(so.loadingOverlay)},C||re.createElement("div",null,"loading...")),re.createElement(nr,{rootId:"asc-uikit-stories-viewer",isOpen:D,onClose:$,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"content-height"},e==null?void 0:e.map(Ae=>re.createElement(z,{key:Ae.name,className:Kn(so.actionButton),onPress:Ae==null?void 0:Ae.action},Ae==null?void 0:Ae.icon,re.createElement(_.BodyBold,null,Ae.name)))),re.createElement(nr,{rootId:"asc-uikit-stories-viewer",isOpen:A,onClose:Q,mountPoint:document.getElementById("asc-uikit-stories-viewer"),detent:"full-height"},re.createElement(Xl,{referenceId:G,referenceType:"story",community:E,shouldAllowCreation:E==null?void 0:E.allowCommentInStory,shouldAllowInteraction:Lt})),((We=(Ra=ee==null?void 0:ee[0])==null?void 0:Ra.data)==null?void 0:We.url)&&re.createElement("div",{className:Kn(so.hyperLinkContainer)},re.createElement(Hn,{href:ee[0].data.url.startsWith("http")?ee[0].data.url:`https://${ee[0].data.url}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>l==null?void 0:l.analytics.markLinkAsClicked()},re.createElement(ZC,{lines:1},re.createElement("span",null,((eo=(Re=ee[0])==null?void 0:Re.data)==null?void 0:eo.customText)||ee[0].data.url.replace(/^https?:\/\//,""))))),re.createElement(t5,{pageId:a,storyId:G,syncState:L,reach:O,commentsCount:j,reactionsCount:ce,isLiked:pe,onClickComment:U,myReactions:V,showImpression:$o||Ia(v,E==null?void 0:E.communityId),isMember:Lt}))},l1e=e=>{var t;return {condition:!!((t=e.story)!=null&&t.storyId)&&e.type==="video",priority:2}},wk={renderer:s1e,tester:l1e};var d1e=({story:e,action:t})=>(useEffect(()=>{t("play");},[e]),re.createElement("div",{style:Sk.storyContent},re.createElement("p",{style:Sk.text},"This story could not be loaded."))),Sk={storyContent:{width:"100%",maxHeight:"100%",margin:"auto"},text:{textAlign:"center",color:"white",width:"90%",margin:"auto"}},c1e=()=>({condition:!0,priority:1}),_k={renderer:d1e,tester:c1e};var f1e=e=>{useEffect(()=>{e.action("play");},[e.story]);let t=e.story.originalContent;return re.createElement(t,m({},e))},g1e=e=>({condition:!!e.content,priority:2}),Tk={renderer:f1e,tester:g1e};var Ut={drawer__content:"Ge",drawer__innerContent:"Bg",drawer__placeholder:"Hg",drawer__overlay:"Lg",drawer__title:"Tg",drawer__content__data:"Vg",drawer__content__data__title:"qg",drawer__content__data__text:"Dg",drawer__content__data__caption:"Gg",drawer__content__data__infoIcon:"Jg",drawer__content__emptySpace:"Kg",drawer__container:"Ng",drawer__innerContainer:"Og"};var Nk=({isOpen:e,onOpenChange:t,ad:o,targetRef:r})=>{var n;return re.createElement(Drawer.Root,{open:e,onOpenChange:t,onDrag:i=>{i.preventDefault(),i.stopPropagation();}},re.createElement(Drawer.Portal,{container:r==null?void 0:r.current},re.createElement("div",{className:Ut.drawer__container},re.createElement("div",{className:Ut.drawer__innerContainer},re.createElement(Drawer.Overlay,{className:Ut.drawer__overlay}),re.createElement(Drawer.Content,{className:Ut.drawer__content},re.createElement("div",{className:Ut.drawer__innerContent},re.createElement("div",{className:Ut.drawer__placeholder}),re.createElement(Drawer.Title,{className:Ut.drawer__title},re.createElement(_.Title,null,"About this advertisement")),re.createElement("div",{className:Ut.drawer__content__data},re.createElement(_.BodyBold,{className:Ut.drawer__content__data__title},"Why this advertisement?"),re.createElement("div",{className:Ut.drawer__content__data__text},re.createElement(qr,{className:Ut.drawer__content__data__infoIcon}),re.createElement(_.Caption,{className:Ut.drawer__content__data__caption},"You're seeing this advertisement because it was displayed to all users in the system."))),re.createElement("div",{className:Ut.drawer__content__data},re.createElement(_.BodyBold,{className:Ut.drawer__content__data__title},"About this advertiser"),re.createElement("div",{className:Ut.drawer__content__data__text},re.createElement(qr,{className:Ut.drawer__content__data__infoIcon}),re.createElement(_.Caption,{className:Ut.drawer__content__data__caption},"Advertiser name: ",(n=o.advertiser)==null?void 0:n.companyName)))),re.createElement("div",{className:Ut.drawer__content__emptySpace}))))))};var zt={iconButton:"Pg",hyperLinkContainer:"Qg",hyperLink__text:"Wg",rendererContainer:"Zg",storyVideo:"_g",muteCircleIcon:"eh",unmuteCircleIcon:"rh",loadingOverlay:"ah",storyImageContainer:"oh",storyImage:"th",playStoryButton:"ih",pauseStoryButton:"sh",closeButton:"ch",verifiedBadge:"nh",dotsButton:"lh",viewStoryInfoContainer:"dh",viewStoryCompostBarContainer:"mh",viewStoryCompostBarViewIconContainer:"gh",viewStoryCompostBarEngagementContainer:"hh",viewStoryCompostBarEngagementIconContainer:"ph",header:"fh",viewStoryContainer:"uh",viewStoryHeaderContainer:"bh",avatarContainer:"vh",addStoryButton:"Je",viewStoryHeaderListActionsContainer:"xh",viewStoryHeadingInfoContainer:"wh",viewStoryHeading:"yh",viewStoryHeadingTitle:"kh",viewStorySubHeading:"jh",story:"zh",storyContent:"Xh",actionButton:"Ke",navigationOverlay:"Yh",leftOverlay:"Ah",rightOverlay:"Ch",imageFit:"Mh",imageFill:"Sh",infoIcon__button:"Eh",infoIcon:"Fh",storyAd__main:"Ih",storyAd__topBar:"Rh",storyAd__topBar__left:"Uh",storyAd__topBar__avatar:"Bh",storyAd__topBar__text:"Hh",storyAd__topBar__advertiserName:"Lh",storyAd__topBar__right:"Th",storyAd__closeButton:"Vh"};var Ak=({pageId:e="*",ad:t,avatarUrl:o,adImageUrl:r,currentIndex:n,isPaused:i,storiesCount:a,renderLoader:s=()=>re.createElement("div",null,"loading..."),onComplete:l=()=>{},onPauseClick:c,onPlayClick:p,onClose:u,onImageLoaded:f,onAdvertisementInfoOpen:g,onAdvertisementInfoClose:y})=>{var N;let[h,C]=useState(!1),[v,w]=useState(!1),x=()=>{w(!0),g==null||g();},P=()=>{w(!1),y==null||y();},b=useRef(null),I=useRef(null),T=()=>{C(!0),f==null||f();};return re.createElement("div",{className:zt.rendererContainer,ref:I},re.createElement("div",{className:zt.storyAd__main},re.createElement(vm,{pageId:e,duration:5e3,currentIndex:n,storiesCount:a,isPaused:i,onComplete:l}),re.createElement("div",{className:zt.storyAd__topBar},re.createElement("div",{className:zt.storyAd__topBar__left},re.createElement("div",{className:zt.storyAd__topBar__avatar},re.createElement(yt,{defaultImage:re.createElement(Jl,null),avatarUrl:o})),re.createElement("div",{className:zt.storyAd__topBar__text},re.createElement(_.BodyBold,{className:zt.storyAd__topBar__advertiserName},(N=t.advertiser)==null?void 0:N.name),re.createElement(Kl,null))),re.createElement("div",{className:zt.storyAd__topBar__right},i?re.createElement(yo,{className:zt.playStoryButton,"data-qa-anchor":"play_button",onClick:()=>p==null?void 0:p()}):re.createElement(ns,{className:zt.pauseStoryButton,"data-qa-anchor":"pause_button",onClick:()=>c==null?void 0:c()}),re.createElement(sr,{defaultClassName:Kn(zt.storyAd__closeButton),pageId:e,onPress:u}))),re.createElement("div",{className:Kn(zt.storyImageContainer)},re.createElement("img",{ref:b,className:Kn(zt.storyImage),"data-qa-anchor":"image_view",src:r,onLoad:T,alt:"Story Image",crossOrigin:"anonymous"})),!h&&re.createElement("div",{className:zt.loadingOverlay},s()),t.callToActionUrl&&re.createElement("div",{className:zt.hyperLinkContainer},re.createElement("a",{className:zt.hyperLink__text,href:t.callToActionUrl,target:"_blank",rel:"noreferrer"},t.callToAction)),re.createElement(z,{className:zt.infoIcon__button,onPress:()=>{console.log("openAdvertisementInfo"),x();}},re.createElement(qr,{className:zt.infoIcon}))),re.createElement(Nk,{ad:t,isOpen:v,targetRef:I,onOpenChange:B=>!B&&P()}))};var I1e=({story:e,action:t,config:o,onClose:r})=>{var T,N,B,D,A,q;let[n,i]=useState(!1),{loader:a}=o,{ad:s,currentIndex:l,storiesCount:c,increaseIndex:p,pageId:u,dragEventTarget:f}=e,g=()=>{t("play",!0),i(!1);},y=()=>{t("pause",!0),i(!0);},C=Je({fileId:(N=(T=s==null?void 0:s.advertiser)==null?void 0:T.avatar)==null?void 0:N.fileId})||((D=(B=s==null?void 0:s.advertiser)==null?void 0:B.avatar)==null?void 0:D.fileUrl)||"",w=Je({fileId:(A=s==null?void 0:s.image9_16)==null?void 0:A.fileId})||((q=s==null?void 0:s.image9_16)==null?void 0:q.fileUrl)||"",x=useCallback(()=>{n&&i(!1),t("play",!0);},[t,n]),P=()=>{t("pause",!0);},b=()=>{t("play",!0);},I=()=>{p();};return useEffect(()=>{var $,U;if(f){let Q=()=>{t("pause",!0),i(!0);},G=()=>{t("play",!0),i(!1);};return ($=f.current)==null||$.addEventListener("dragstart",Q),(U=f.current)==null||U.addEventListener("dragend",G),()=>{var L,O;(L=f.current)==null||L.removeEventListener("dragstart",Q),(O=f.current)==null||O.removeEventListener("dragend",G);}}},[f]),s?re.createElement(Ak,{pageId:u,ad:s,adImageUrl:w,avatarUrl:C,currentIndex:l,isPaused:n,storiesCount:c,renderLoader:()=>a,onComplete:I,onPauseClick:y,onPlayClick:g,onClose:r,onImageLoaded:x,onAdvertisementInfoOpen:P,onAdvertisementInfoClose:b}):null},M1e=e=>({condition:!!e.ad,priority:2}),Lk={renderer:I1e,tester:M1e};var xm=[Mk,wk,Lk,Tk,_k];var ef={storyButton:"Ne",desktopOnly:"Oe"};var S1e=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),re.createElement("path",{d:"M12 23.91C5.578 23.91.375 18.709.375 12.287.375 5.864 5.578.66 12 .66s11.625 5.203 11.625 11.625S18.422 23.91 12 23.91zM6.656 13.084l6.328 6.375c.47.422 1.172.422 1.594 0l.797-.797c.422-.422.422-1.172 0-1.594l-4.781-4.781 4.781-4.735c.422-.468.422-1.171 0-1.593l-.797-.797c-.422-.422-1.172-.422-1.594 0l-6.328 6.328c-.468.469-.468 1.172 0 1.594z"})),jd=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_left_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=F({pageId:e,componentId:t,elementId:r});return i?null:re.createElement("button",{"data-qa-anchor":n,className:Kn(ef.storyButton,ef.desktopOnly),onClick:o,style:a},re.createElement(S1e,null))};var tf={storyButton:"Pe",desktopOnly:"Qe"};var N1e=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},e),re.createElement("path",{d:"M12 .66c6.422 0 11.625 5.204 11.625 11.626S18.422 23.91 12 23.91.375 18.708.375 12.286 5.578.66 12 .66zm5.297 10.829L10.969 5.16c-.422-.422-1.172-.422-1.594 0l-.797.797c-.422.422-.422 1.172 0 1.593l4.781 4.735-4.78 4.781c-.423.422-.423 1.172 0 1.594l.796.797c.422.422 1.172.422 1.594 0l6.328-6.375c.469-.422.469-1.125 0-1.594z"})),Gd=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="arrow_right_button",{accessibilityId:n,isExcluded:i,themeStyles:a}=F({pageId:e,componentId:t,elementId:r});return i?null:re.createElement("button",{"data-qa-anchor":n,className:Kn(tf.storyButton,tf.desktopOnly),onClick:o,style:a},re.createElement(N1e,null))};var Ho={overlayLeft:"We",overlayRight:"Ze",viewStoryContent:"qh",viewStoryOverlay:"Dh",hiddenInput:"Gh",viewStoryContainer:"Jh",storyWrapper:"Kh",deleteIcon:"Nh",arrowButton:"Oh"};var O1e=7e3,Za=e=>!!(e!=null&&e.storyId),s5=({pageId:e="*",communityId:t,onBack:o,onClose:r,onSwipeDown:n,onClickCommunity:i,goToDraftStoryPage:a})=>{var K;let{accessibilityId:s}=tt({pageId:e}),{confirm:l}=$e(),c=Co(),p=useMotionValue(0),u=useRef(null),f=useRef(new EventTarget),[g,y]=useState(!1),{stories:h}=ba({targetId:t,targetType:"community",options:{orderBy:"asc",sortBy:"createdAt"}}),C=useMemo(()=>xm.map(({renderer:E,tester:V})=>({renderer:ee=>E(k(m({},ee),{onClose:()=>r(t),onClickCommunity:()=>i(t)})),tester:V})),[xm,r,i,t]),v=useRef(null),{client:w,currentUserId:x}=Ee(),[P,b]=useState(0),{file:I,setFile:T}=zr(),N=h[P],B=Za(N)?((K=N==null?void 0:N.creator)==null?void 0:K.userId)===x:!1,D=Za(N)?g0(w,N==null?void 0:N.targetId):!1,A=()=>{if(P===h.length-1){o();return}b(P+1);},q=()=>{P!==0&&b(P-1);},$=E=>{l({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You'll no longer to see and find this story.",okText:"Delete",onOk:()=>S(void 0,null,function*(){y(!1),yield StoryRepository.softDeleteStory(E),P===0?r(t):b(P-1),c.success({content:"Story deleted"});})});},U=E=>{$(E);},Q=useCallback((E,V,Y,ee)=>S(void 0,null,function*(){var pe;try{let ce=new FormData;ce.append("files",E),T(null),E!=null&&E.type.includes("image")&&x?yield StoryRepository.createImageStory("user",x,ce,Y,V,ee):x&&(yield StoryRepository.createVideoStory("user",x,ce,Y,ee)),c.success({content:"Successfully shared story"});}catch(ce){ce instanceof Error&&c.info({content:(pe=ce.message)!=null?pe:"Failed to share story"});}}),[x,c,T]),G=()=>{T(null);},L=re.createElement(FileTrigger,{ref:v,onSelect:E=>{let V=Array.from(E);T(V[0]);}},re.createElement(Ma,{pageId:e})),O=()=>{if(P===h.length-1){o();return}b(E=>E+1);},j=h==null?void 0:h.map(E=>{var V,Y,ee;if(Za(E)){let pe=(E==null?void 0:E.dataType)==="image",ce=pe?(V=E==null?void 0:E.imageData)==null?void 0:V.fileUrl:(ee=(Y=E==null?void 0:E.videoData)==null?void 0:Y.videoUrl)==null?void 0:ee["720p"];return {story:E,url:ce,type:pe?"image":"video",actions:[B||D?{name:"Delete",action:()=>U(E==null?void 0:E.storyId),icon:re.createElement(Cu,{fill:getComputedStyle(document.documentElement).getPropertyValue("--asc-color-base-default")})}:null].filter(Ur),onCreateStory:Q,discardStory:G,addStoryButton:L,fileInputRef:v,currentIndex:P,storiesCount:h==null?void 0:h.length,increaseIndex:O,pageId:e,dragEventTarget:f.current,setIsBottomSheetOpen:y,isBottomSheetOpen:g}}else return {ad:E,actions:[],pageId:e,currentIndex:P,storiesCount:h==null?void 0:h.length,increaseIndex:O}}),Z="asc-uikit-stories-viewer";return useEffect(()=>{let E=h[h.length-1];Za(E)&&(E==null?void 0:E.syncState)==="syncing"&&b(h.length-1),N&&Za(N)&&(N==null||N.analytics.markAsSeen());},[P,h]),useEffect(()=>{if(h.filter(Za).every(V=>V==null?void 0:V.isSeen))return;let E=h.findIndex(V=>Za(V)?!(V!=null&&V.isSeen):!1);E!==-1&&b(E);},[]),Rs({targetId:t,targetType:"community"}),I&&a(t,"community",I.type.includes("image")?{type:"image",url:URL.createObjectURL(I)}:{type:"video",url:URL.createObjectURL(I)},"communityFeed"),!h||h.length===0?null:re.createElement("div",{className:Kn(Ho.storyWrapper)},re.createElement(jd,{onClick:q}),re.createElement(motion.div,{id:Z,ref:u,"data-qa-anchor":s,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{f.current.dispatchEvent(new Event("dragstart"));},onDrag:(E,V)=>{V.point.y<V.point.y-V.offset.y&&p.set(0);},onDragEnd:(E,V)=>{f.current.dispatchEvent(new Event("dragend")),V.offset.y>100?n(t):p.set(0);},className:Kn(Ho.viewStoryContainer)},re.createElement("div",{className:Kn(Ho.viewStoryContent)},re.createElement("div",{className:Kn(Ho.overlayLeft),onClick:q}),re.createElement("div",{className:Kn(Ho.overlayRight),onClick:A}),re.createElement("div",{className:Kn(Ho.viewStoryOverlay)}),re.createElement(L1e,{key:h==null?void 0:h.length,progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:P,stories:j,renderers:C,defaultInterval:O1e,onStoryStart:()=>Za(N)&&(N==null?void 0:N.analytics.markAsSeen()),onStoryEnd:A,onNext:A,onPrevious:q,onAllStoriesEnd:A}))),re.createElement(Gd,{onClick:A}))};var $1e=7e3,qa=e=>!!(e!=null&&e.storyId),Dk=({pageId:e="*",targetId:t,targetIds:o,onChangePage:r,onClickStory:n,goToDraftStoryPage:i,onClose:a,onSwipeDown:s,onClickCommunity:l})=>{var K;let{accessibilityId:c}=tt({pageId:e}),{confirm:p}=$e(),u=Co(),{client:f,currentUserId:g}=Ee(),{file:y,setFile:h}=zr(),C=useMotionValue(0),v=useRef(null),w=useRef(new EventTarget),[x,P]=useState(0),b=useRef(null),{stories:I}=ba({targetType:"community",targetId:t,options:{orderBy:"asc",sortBy:"createdAt"}}),T=useMemo(()=>xm.map(({renderer:E,tester:V})=>({renderer:ee=>E(k(m({},ee),{onClose:()=>a(t),onClickCommunity:()=>l(t)})),tester:V})),[xm,a,s,l,t]),N=I[x],B=qa(N)?((K=N==null?void 0:N.creator)==null?void 0:K.userId)===g:!1,D=qa(N)?g0(f,N==null?void 0:N.targetId):!1,A=()=>{if(x===0){let V=o.indexOf(t)-1;if(V>=0){let Y=o[V];n(Y);}else r==null||r();P(0);return}P(E=>E-1);},q=E=>{let V=x===I.length-1;p({pageId:e,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",okText:"Delete",onOk:()=>S(void 0,null,function*(){yield StoryRepository.softDeleteStory(E),u.success({content:"Story deleted"}),I.length===1?r==null||r():V?A():P(Y=>Y);})});},$=E=>{q(E);},U=(E,V,Y,ee)=>S(void 0,null,function*(){var pe;try{let ce=new FormData;if(ce.append("files",E),h(null),E!=null&&E.type.includes("image")&&g){let{data:je}=yield StoryRepository.createImageStory("user",g,ce,Y,V,ee);je&&u.success({content:"Successfully shared story"});}else if(g){let{data:je}=yield StoryRepository.createVideoStory("user",g,ce,Y,ee);je&&u.success({content:"Successfully shared story"});}}catch(ce){ce instanceof Error&&u.info({content:(pe=ce.message)!=null?pe:"Failed to share story"});}}),Q=()=>{h(null);},G=re.createElement(FileTrigger,{ref:b,onSelect:E=>{let V=Array.from(E);h(V[0]);}},re.createElement(Ma,{pageId:e})),L=()=>{x!==I.length-1&&P(E=>E+1);},O=I==null?void 0:I.map(E=>{var V,Y,ee;if(qa(E)){let pe=(E==null?void 0:E.dataType)==="image",ce=pe?(V=E==null?void 0:E.imageData)==null?void 0:V.fileUrl:(ee=(Y=E==null?void 0:E.videoData)==null?void 0:Y.videoUrl)==null?void 0:ee["720p"];return {story:E,url:ce,type:pe?"image":"video",actions:[B||D?{name:"Delete",action:()=>$(E==null?void 0:E.storyId),icon:re.createElement(qs,{className:Ho.deleteIcon})}:null].filter(Ur),onCreateStory:U,discardStory:Q,addStoryButton:G,fileInputRef:b,currentIndex:x,storiesCount:I==null?void 0:I.length,increaseIndex:L,pageId:e}}else return {ad:E,actions:[],pageId:e,currentIndex:x,storiesCount:I==null?void 0:I.length,increaseIndex:L}}),j=()=>{if(x===(O==null?void 0:O.length)-1){let V=o.indexOf(t)+1;if(V<o.length){let Y=o[V];n(Y);}else r==null||r();P(0);return}P(E=>E+1);},Z="asc-uikit-stories-viewer";return useEffect(()=>{let E=I[I.length-1];qa(E)&&(E==null?void 0:E.syncState)==="syncing"&&P(I.length-1),N&&qa(N)&&(N==null||N.analytics.markAsSeen());},[N,I]),useEffect(()=>{if(I.filter(qa).every(V=>V==null?void 0:V.isSeen))return;let E=I.findIndex(V=>qa(V)?!(V!=null&&V.isSeen):!1);E!==-1&&P(E);},[]),useEffect(()=>{y&&i(t,"community",y.type.includes("image")?{type:"image",url:URL.createObjectURL(y)}:{type:"video",url:URL.createObjectURL(y)},"globalFeed");},[y,i,t]),Rs({targetId:t,targetType:"community"}),!I||I.length===0?null:re.createElement("div",{className:Kn(Ho.storyWrapper),"data-qa-anchor":c},re.createElement(jd,{onClick:A}),re.createElement(motion.div,{id:Z,ref:v,"data-qa-anchor":c,initial:{y:0},drag:"y",whileDrag:{scale:.95,borderRadius:"8px",cursor:"grabbing"},dragConstraints:{top:0,bottom:200},dragElastic:{top:0,bottom:.5},onDragStart:()=>{w.current.dispatchEvent(new Event("dragstart"));},onDrag:(E,V)=>{V.point.y<V.point.y-V.offset.y&&C.set(0);},onDragEnd:(E,V)=>{w.current.dispatchEvent(new Event("dragend")),V.offset.y>100?s(t):C.set(0);},className:Kn(Ho.viewStoryContainer)},re.createElement("div",{className:Kn(Ho.viewStoryContent)},re.createElement("div",{className:Kn(Ho.overlayLeft),onClick:A}),re.createElement("div",{className:Kn(Ho.overlayRight),onClick:j}),re.createElement("div",{className:Kn(Ho.viewStoryOverlay)}),re.createElement(L1e,{progressWrapperStyles:{display:"none"},preventDefault:!0,currentIndex:x,stories:O,renderers:T,defaultInterval:$1e,onStoryStart:()=>qa(N)&&(N==null?void 0:N.analytics.markAsSeen()),onStoryEnd:L,onNext:j,onPrevious:A,onAllStoriesEnd:j}))),re.createElement(Gd,{onClick:j}))};var l5=({pageId:e="*",targetId:t,onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})=>{let{stories:l}=Mp({seenState:"smart",limit:10});return re.createElement(Dk,{pageId:e,targetId:t,targetIds:l.map(c=>c.targetId),onChangePage:o,onClickStory:r,goToDraftStoryPage:n,onClose:i,onSwipeDown:a,onClickCommunity:s})};var q1e=({type:e,targetId:t})=>{let o="view_story_page",{onBack:r,goToDraftStoryPage:n,onClickCommunity:i,onChangePage:a,onClickStory:s}=X(),l=()=>{a("newsfeed");},c=p=>{i(p);};return e==="communityFeed"?re.createElement(s5,{pageId:o,communityId:t,onBack:r,onClose:c,onSwipeDown:c,onClickCommunity:c,goToDraftStoryPage:({targetId:p,targetType:u,mediaType:f,storyType:g})=>n(p,u,f,g)}):e==="globalFeed"?re.createElement(l5,{pageId:o,targetId:t,onChangePage:l,onClose:l,onSwipeDown:l,onClickStory:p=>s(p,"globalFeed"),goToDraftStoryPage:({targetId:p,targetType:u,mediaType:f,storyType:g})=>n(p,u,f,g),onClickCommunity:p=>i(p)}):null},Vk=q1e;var Uk={roundedBackButton:"Ph"};var Y1e=e=>re.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 32 32"},e),re.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"#000",fillOpacity:"0.5"}),re.createElement("path",{fill:"currentColor",d:"M16.176 23.914c-.14.176-.422.176-.598 0L8.23 16.566a.405.405 0 010-.597l7.348-7.348c.176-.176.457-.176.598 0l.703.668c.176.176.176.457 0 .598l-5.45 5.449h12.024c.211 0 .422.21.422.422v.984c0 .246-.21.422-.422.422H11.43l5.449 5.484c.176.141.176.422 0 .598l-.703.668z"})),lf=({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:n})=>{let i="back_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:c,uiReference:p,themeStyles:u}=F({pageId:e,componentId:t,elementId:i});return c?null:re.createElement(z,{style:u,className:Uk.roundedBackButton,onPress:n},re.createElement(ae,{"data-qa-anchor":a,defaultIcon:()=>re.createElement(Y1e,{className:o}),imgIcon:()=>re.createElement("img",{src:s.icon,alt:p,className:r}),defaultIconName:l.icon,configIconName:s.icon}))};var In={draftPageContainer:"_e",headerContainer:"Qh",storyWrapper:"Wh",header:"Zh",topRightButtons:"_h",mainContainer:"ep",previewImage:"rp",footer:"ap",videoPreview:"op",hyperLinkContainer:"tp",playPauseButton:"ip",progressBar:"sp",progressFill:"cp",userInfo:"np",name:"lp",description:"dp",storyPreview:"mp"};var mf=({targetId:e,targetType:t,mediaType:o,goToCommunityPage:r,goToGlobalFeedPage:n,onDiscardCreateStory:i})=>{var Q,G,L,O,j,Z;let{page:a}=ot(),s="create_story_page",{accessibilityId:l,themeStyles:c}=tt({pageId:s}),{file:p,setFile:u}=zr(),{community:f}=zp(e),[g,y]=useState(!1),{confirm:h}=$e(),C=Co(),[v,w]=useState([{data:{url:"",customText:""},type:"hyperlink"}]),x=()=>{y(!1);},[P,b]=useState("fit"),[I,T]=useState([]),N=()=>{b(P==="fit"?"fill":"fit"),P==="fill"&&T([]);},B=(K,E,V,Y)=>S(void 0,null,function*(){var ee;if(K)try{let pe=new FormData;pe.append("files",K),u(null),a.type==="DraftPage"&&a.context.storyType==="globalFeed"?n():r(e),(o==null?void 0:o.type)==="image"&&e?yield StoryRepository.createImageStory(t,e,pe,V,E,Y):(o==null?void 0:o.type)==="video"&&e&&(yield StoryRepository.createVideoStory(t,e,pe,V,Y)),C.success({content:"Successfully shared story"});}catch(pe){pe instanceof Error&&C.info({content:(ee=pe.message)!=null?ee:"Failed to share story"});}}),D=()=>{h({pageId:s,title:"Delete this story?",content:"This story will be permanently deleted. You\u2019ll no longer to see and find this story.",cancelText:"Cancel",okText:"Delete",onOk:()=>{u(null),i();}});},A=({url:K,customText:E})=>{w([{data:{url:K,customText:E||""},type:"hyperlink"}]),y(!1);},q=()=>{w([{data:{url:"",customText:""},type:"hyperlink"}]);},$=()=>{var K,E;if((E=(K=v[0])==null?void 0:K.data)!=null&&E.url){C.info({content:"Can\u2019t add more than one link to your story."});return}y(!0);},U=useCallback(K=>S(void 0,null,function*(){let E=new Image;E.crossOrigin="Anonymous",E.src=K,E.onload=()=>{let Y=new Rse().getPalette(E,2);Y&&T(Y.map(ee=>`rgb(${ee.join(",")})`));};}),[]);return useEffect(()=>{S(void 0,null,function*(){if((o==null?void 0:o.type)==="image")if(p){let E=URL.createObjectURL(p);yield U(E);}else o.url&&(yield U(o.url));});},[p,o,U]),re.createElement("div",{"data-qa-anchor":l,style:c,className:In.storyWrapper},re.createElement("div",{id:"asc-uikit-create-story",className:In.draftPageContainer},re.createElement("div",{className:In.headerContainer},re.createElement("div",{className:In.header},re.createElement(lf,{pageId:s,onPress:D}),re.createElement("div",{className:In.topRightButtons},(o==null?void 0:o.type)==="image"&&re.createElement(Zp,{pageId:s,onPress:N}),re.createElement(Kp,{pageId:s,onPress:$})))),(o==null?void 0:o.type)==="image"?re.createElement("div",{className:In.mainContainer,style:{background:`linear-gradient(
|
|
3797
3797
|
180deg,
|
|
3798
3798
|
${I[0]||"var(--asc-color-black)"} 0%,
|
|
3799
3799
|
${I[1]||"var(--asc-color-black)"} 100%
|