@dcl/builder-site 7.1.1-13269289529.commit-1d74a6c → 7.1.1-13294447493.commit-2360873
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/assets/{Back-BPa2M8SK.js → Back-BbaCjdmj.js} +1 -1
- package/assets/{CollectionProvider.container-DLttDjYi.js → CollectionProvider.container-y-5H8jwt.js} +1 -1
- package/assets/{CollectionStatus.container-KkB73dPK.js → CollectionStatus.container-C_F9jS5x.js} +1 -1
- package/assets/{ConfirmDelete-CL242pjc.js → ConfirmDelete-BoP9iGlg.js} +1 -1
- package/assets/{FileSaver.min-DeCAttmg.js → FileSaver.min-DQOvbsbS.js} +1 -1
- package/assets/{ItemProvider.container-CUJZfUhf.js → ItemProvider.container-BFuvxqdM.js} +1 -1
- package/assets/{JumpIn.container-9o11sV9i.js → JumpIn.container-DaZ9uhq6.js} +1 -1
- package/assets/{LandAction-CZMTtMKA.js → LandAction-DDToJbdT.js} +1 -1
- package/assets/{LandProviderPage-Z0daXGvA.js → LandProviderPage-BIzOoDr2.js} +1 -1
- package/assets/{LoggedInDetailPage.container-pu6zqzsR.js → LoggedInDetailPage.container-B0LUeqEX.js} +1 -1
- package/assets/{Navigation-DsLrgxpA.css → Navigation-mol432rZ.css} +1 -1
- package/assets/Navigation.container-5XL4DURe.js +1 -0
- package/assets/{NotFound-CniT7gKH.js → NotFound-CztUzMk9.js} +1 -1
- package/assets/{OptionsDropdown-Dmu_w3nF.js → OptionsDropdown-BYNesKiT.js} +1 -1
- package/assets/{RentalPeriod-wm2JsBQY.js → RentalPeriod-DLq8_E46.js} +1 -1
- package/assets/{SDKTag-ldNCPc3y.js → SDKTag-t7uWWZ8W.js} +1 -1
- package/assets/{SceneStats.container-Pqf5I2F4.js → SceneStats.container-CA1kGsWD.js} +1 -1
- package/assets/{SignInRequired-CwTJZg2z.js → SignInRequired-oPwjml9L.js} +1 -1
- package/assets/{ThirdPartyKindBadge-Ce4k43Iz.js → ThirdPartyKindBadge-CVdMZEjj.js} +1 -1
- package/assets/{dataReader-wHkimmPj.js → dataReader-DRE-N3yk.js} +1 -1
- package/assets/{date-B4EwqWPO.js → date-C1XiQbBs.js} +1 -1
- package/assets/{fortmatic-DY7tMJj0.js → fortmatic-DZTLL64C.js} +1 -1
- package/assets/{index-Beq1Rv-Z.css → index-4CcUz_7W.css} +1 -1
- package/assets/{index-COlK5rpg.js → index-B-YW_oxb.js} +1 -1
- package/assets/index-B2mb0cq5.js +1 -0
- package/assets/index-B40bGwUl.js +1 -0
- package/assets/{index-Dsyjwgy9.js → index-BFG9nOAy.js} +1 -1
- package/assets/{index-DvWMJE6Y.js → index-BGm00p1v.js} +1 -1
- package/assets/{index-CnuVZMvH.js → index-BHx9xSrv.js} +1 -1
- package/assets/{index-CqqatYmc.js → index-BLUQZAWv.js} +1 -1
- package/assets/{index-CN2TWhlR.css → index-BTyTm5Z9.css} +1 -1
- package/assets/index-BWGsLulQ.js +1 -0
- package/assets/{index-BDaF7HCf.css → index-BWR9O1aa.css} +1 -1
- package/assets/{index-DDj7JkRA.js → index-BYopUzYe.js} +1 -1
- package/assets/{index-DdToDGtK.js → index-BkfOkDkr.js} +1 -1
- package/assets/{index-DExrqn8M.js → index-BmoKAeGN.js} +1 -1
- package/assets/index-BtPfomCY.js +1 -0
- package/assets/{index-CS_N8A1H.js → index-BvouVN8g.js} +1 -1
- package/assets/{index-B41VSewB.js → index-BzGMf3ev.js} +1 -1
- package/assets/{index-ZpnXkoie.js → index-C3ehu23a.js} +1 -1
- package/assets/{index-DyuS8MDX.js → index-C4F89tUw.js} +1 -1
- package/assets/{index-0mFwMpW5.css → index-C4Zul3Hv.css} +7 -7
- package/assets/{index-64xAKlNk.js → index-C9d-16UU.js} +1 -1
- package/assets/{index-B-RmA26Y.js → index-CAVb37q9.js} +1 -1
- package/assets/{index-BACSMWJK.js → index-CLvg5Hy1.js} +1 -1
- package/assets/{index-DfUdM3NE.js → index-CM1sEZkI.js} +2 -2
- package/assets/{index-B0GyiKoI.js → index-CRXKByac.js} +1 -1
- package/assets/{index-DNdkvol-.js → index-CRcIc54x.js} +1 -1
- package/assets/{index-OElQkvac.js → index-CSKXO2UZ.js} +1 -1
- package/assets/{index-ByAm85pM.js → index-CX7FDia5.js} +1 -1
- package/assets/{index-BWJdTrkw.css → index-CcLl_H-i.css} +1 -1
- package/assets/{index-CTj08Za4.css → index-CemIkqzh.css} +1 -1
- package/assets/index-CgC9RPsG.js +1 -0
- package/assets/{index-B3rcGd62.js → index-CjDEWbyR.js} +820 -285
- package/assets/{index-CvMPqYym.js → index-Cw15jBaj.js} +1 -1
- package/assets/{index-D9u7dTkh.js → index-D5XDKpc0.js} +1 -1
- package/assets/{index-DQLNSntZ.js → index-DEZCEPzh.js} +1 -1
- package/assets/{index-CaLB7UFc.js → index-DGNg6ECv.js} +1 -1
- package/assets/{index-Bzbh54jP.js → index-DGsoLoPg.js} +1 -1
- package/assets/{index-BmKvQ4BC.js → index-DJMz7rSJ.js} +1 -1
- package/assets/{index-BpRttPtI.js → index-DMpj4aIn.js} +1 -1
- package/assets/{index-cy3QCMX5.js → index-DahR_SKG.js} +1 -1
- package/assets/index-DaifjOHt.js +1 -0
- package/assets/{index-C2Ea1fcJ.js → index-DpjLX_59.js} +1 -1
- package/assets/{index-CnqB_rLC.js → index-Dro1blzn.js} +1 -1
- package/assets/{index-BqGiZx7e.js → index-Dwk1Wybi.js} +1 -1
- package/assets/{index-Cfj9JLHa.css → index-FWn4LEPg.css} +1 -1
- package/assets/{index-CAc-k5v3.js → index-PBb8_h1O.js} +1 -1
- package/assets/{index-YOZwcEwn.js → index-XH5HWz83.js} +1 -1
- package/assets/{index-DcdvvT3d.js → index-ZvBERBoI.js} +1 -1
- package/assets/{index-MkHKhH0K.js → index-cnoITORS.js} +1 -1
- package/assets/{index.es-qAt7-yz8.js → index.es-BS9LuxCM.js} +4 -4
- package/assets/{selectors-Cuqfofix.js → selectors-TOR8HVIv.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/Navigation.container-rGgC0rDy.js +0 -1
- package/assets/index-B5dIZKGN.js +0 -1
- package/assets/index-BKIpBAR1.js +0 -1
- package/assets/index-C2ga5-3d.js +0 -1
- package/assets/index-D43GeKXB.js +0 -1
- package/assets/index-DSchuKch.js +0 -1
- package/assets/index-hLX2OJxJ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bw as d,bx as u,by as o,bz as L}from"./index-
|
|
1
|
+
import{bw as d,bx as u,by as o,bz as L}from"./index-CjDEWbyR.js";const f=n=>typeof n=="object"&&n!==null&&"en-US"in n,i=n=>n.campaign,s=n=>i(n).data,b=n=>i(n).loading,C=n=>i(n).error,z=n=>d(b(n),u),T=n=>{var e;return(e=s(n))==null?void 0:e.mainTag},U=n=>{var e;return((e=s(n))==null?void 0:e.name)||null},m=n=>{var e;return((e=s(n))==null?void 0:e.assets)||null},S=(n,e)=>{var t;return((t=s(n))==null?void 0:t.banners[e])??null},A=(n,e)=>{const t=m(n),r=S(n,e);return r?Object.entries(r).reduce((c,[p,g])=>{if(f(g)){const a=g["en-US"];if(o.isSysLink(a)){const l=t==null?void 0:t[a.sys.id];l&&(c[a.sys.id]=l)}}return c},{}):{}},E=n=>{const e=L(n);return["en","zh","es"].includes(e)?e==="en"?o.ContentfulLocale.enUS:e:o.ContentfulLocale.enUS};export{A as a,C as b,E as c,T as d,U as e,S as g,z as i};
|
package/index.html
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<meta itemprop="image" content="https://decentraland.org/images/logo.png" />
|
|
33
33
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
34
34
|
<meta name="theme-color" content="#000000" />
|
|
35
|
-
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/builder-site/7.1.1-
|
|
35
|
+
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/builder-site/7.1.1-13294447493.commit-2360873/manifest.json" />
|
|
36
36
|
|
|
37
37
|
<style>
|
|
38
38
|
.loading-overlay {
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
</style>
|
|
72
72
|
|
|
73
73
|
<title>Builder | Decentraland</title>
|
|
74
|
-
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/builder-site/7.1.1-
|
|
75
|
-
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/builder-site/7.1.1-
|
|
74
|
+
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/builder-site/7.1.1-13294447493.commit-2360873/assets/index-CjDEWbyR.js"></script>
|
|
75
|
+
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/builder-site/7.1.1-13294447493.commit-2360873/assets/index-C4Zul3Hv.css">
|
|
76
76
|
</head>
|
|
77
77
|
<body class="dcl-loading">
|
|
78
78
|
<div id="load-messages-wrapper"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/builder-site",
|
|
3
|
-
"version": "7.1.1-
|
|
3
|
+
"version": "7.1.1-13294447493.commit-2360873",
|
|
4
4
|
"description": "Builder website",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/decentraland/builder.git"
|
|
15
15
|
},
|
|
16
|
-
"homepage": "https://cdn.decentraland.org/@dcl/builder-site/7.1.1-
|
|
17
|
-
"commit": "
|
|
16
|
+
"homepage": "https://cdn.decentraland.org/@dcl/builder-site/7.1.1-13294447493.commit-2360873",
|
|
17
|
+
"commit": "2360873211cd37f2f8c702e4a56f9d0613e02cff"
|
|
18
18
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var D=Object.defineProperty;var _=(e,t,a)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var h=(e,t,a)=>_(e,typeof t!="symbol"?t+"":t,a);import{b8 as u,b9 as U,H as n,ba as R,bb as M,bc as $,bd as V,be as P,bf as W,bg as H,bh as z,bi as F,bj as G,D as S,bk as K,af as Y,bl as A,N as T,G as c,M as i,bm as q,T as Q,U as X,a4 as Z,ae as J,bn as ee,bo as ne,bp as se,X as te,bq as oe,br as ae,bs as O,Z as w,K as g,a0 as ie,ah as re,a1 as le,aj as ce,bt as de}from"./index-B3rcGd62.js";import{g as ue,a as ge,i as me,b as Ce,c as he}from"./selectors-Cuqfofix.js";const k=(e,t,a)=>{var d;if(!a)return"";const s=e[a.sys.id];return(d=s==null?void 0:s.fields.file[t])!=null&&d.url?`https:${s.fields.file[t].url}`:""},Se=e=>{switch(e){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end";default:return"flex-start"}},xe=e=>{var p,N,y,E,v;const{isLoading:t,onClick:a,fields:s,assets:d,locale:l=u.ContentfulLocale.enUS,error:m}=e,o=U();if(t)return n.jsx(R,{children:n.jsx(M,{})});if(!s||m)return null;const C=k(d,u.ContentfulLocale.enUS,o?s.mobileBackground[u.ContentfulLocale.enUS]:s.fullSizeBackground[u.ContentfulLocale.enUS]),b=o?s.mobileTitle[l]:s.desktopTitle[l],L=(p=o?s.mobileTitleAlignment[u.ContentfulLocale.enUS]:s.desktopTitleAlignment[u.ContentfulLocale.enUS])==null?void 0:p.toLowerCase(),x=o?s.mobileText[l]:s.desktopText[l],j=(N=o?s.mobileTextAlignment[u.ContentfulLocale.enUS]:s.desktopTextAlignment[u.ContentfulLocale.enUS])==null?void 0:N.toLowerCase(),B=Se((y=o?s.mobileButtonAlignment[u.ContentfulLocale.enUS]:s.desktopButtonAlignment[u.ContentfulLocale.enUS])==null?void 0:y.toLowerCase());return n.jsxs($,{background:C,children:[n.jsxs(V,{children:[n.jsx(P,{variant:"h1",textAlign:L,children:b}),n.jsx(W,{textAlign:j,children:x?H(x):null}),s.showButton[u.ContentfulLocale.enUS]&&((E=s.buttonLink)!=null&&E[u.ContentfulLocale.enUS])&&((v=s.buttonsText)!=null&&v[l])?n.jsx(z,{justifyContent:B,children:n.jsx(F,{onClick:a,href:s.buttonLink[u.ContentfulLocale.enUS],variant:"contained",disableElevation:!0,children:s.buttonsText[l]})}):null]}),s.logo&&s.logo[u.ContentfulLocale.enUS]&&n.jsx(G,{src:k(d,u.ContentfulLocale.enUS,s.logo[u.ContentfulLocale.enUS]),alt:"Banner logo"})]})},be=e=>{const{fields:t,id:a,...s}=e,d=S.useCallback(l=>{const m=l;m.preventDefault();const o=A();o&&o.track("CLICK_BANNER",{id:t==null?void 0:t.id,location:a}),K(300).then(()=>{window.location.href=m.target.href})},[t==null?void 0:t.id,a]);return Y.createElement(xe,{onClick:d,fields:t,...s})},Le=(e,t)=>({fields:ue(e,t.id)??null,assets:ge(e,t.id),isLoading:me(e),error:Ce(e),locale:he(e)}),je=T(Le)(be),fe="Sign in from sync toast";let Te=class extends S.PureComponent{constructor(){super(...arguments);h(this,"state",{isSynced:!1});h(this,"analytics",A());h(this,"handleRetry",()=>{const{onRetry:a}=this.props;a()});h(this,"handleLogin",()=>{this.analytics.track(fe),this.props.onOpenModal("WalletLoginModal")})}componentWillReceiveProps(a){a.syncCount>0&&this.props.syncCount===0?this.setState({isSynced:!1}):a.syncCount===0&&this.props.syncCount>0&&this.setState({isSynced:!0})}render(){const{syncCount:a,errorCount:s,projectCount:d,didDismissSignInToast:l,didDismissSyncedToast:m,isLoggedIn:o,onDismissSignInToast:C,onDismissSyncedToast:b}=this.props,{isSynced:L}=this.state,x=L&&!m,j=!o&&!l&&d>0;return a>0?n.jsx("div",{className:"SyncToast",children:n.jsx("div",{className:"message",children:c("sync.loading")})}):s>0?n.jsx("div",{className:"SyncToast",children:n.jsxs("div",{className:"message",children:[n.jsx("div",{className:"error-indicator"}),c("sync.error",{errorCount:s}),n.jsx(i.Button,{basic:!0,onClick:this.handleRetry,children:c("sync.retry")})]})}):x?n.jsx("div",{className:"SyncToast",children:n.jsxs("div",{className:"message",children:[c("sync.success"),n.jsx(i.Close,{small:!0,onClick:b})]})}):j?n.jsx("div",{className:"SyncToast",children:n.jsxs("div",{className:"message",children:[n.jsx(q,{id:"toasts.localstorage",values:{sign_in:n.jsxs("span",{className:"sign-in",onClick:this.handleLogin,children:[" ",c("global.sign_in")," "]})}}),n.jsx(i.Close,{small:!0,onClick:C})]})}):null}};const pe=e=>({syncCount:Q(e).size,errorCount:X(e).size,projectCount:Z(e).length,isLoggedIn:J(e),didDismissSignInToast:ee(e),didDismissSyncedToast:ne(e)}),Ne=e=>({onRetry:()=>e(se()),onOpenModal:(t,a)=>e(te(t,a)),onDismissSignInToast:()=>e(oe()),onDismissSyncedToast:()=>e(ae())}),ye=T(pe,Ne)(Te);var r=(e=>(e.OVERVIEW="overview",e.SCENES="scenes",e.LAND="land",e.COLLECTIONS="collections",e.NAMES="names",e.WORLDS="worlds",e.CURATION="curation",e))(r||{});const Ee="builderCampaignBanner",f="builder-last-visited-section",I=O(),ve=[r.COLLECTIONS,r.SCENES,r.LAND,r.NAMES],ke=e=>{const{isLoggingIn:t,isLoggedIn:a}=e,s=w();S.useEffect(()=>{const o=I.getItem(f)??"";a&&!s.length&&o!==g.root()&&s.push(o)},[a,s]);const d=S.useCallback(o=>{I.setItem(f,o),s.push(o)},[s]),l=o=>{switch(o){case r.COLLECTIONS:return d(g.collections());case r.SCENES:return d(g.scenes());case r.LAND:return d(g.land());case r.NAMES:return d(g.ens());default:throw new Error("Invalid NavigationTab")}},m=o=>{switch(o){case r.COLLECTIONS:return"https://docs.decentraland.org/creator/wearables/wearables-overview/#collections";case r.SCENES:return"https://docs.decentraland.org/creator/editor/about-scene-editor/";case r.LAND:return"https://docs.decentraland.org/player/market/land-manager/";case r.NAMES:return"https://decentraland.org/blog/project-updates/manage-names-in-the-builder/";default:throw new Error("Invalid Navigation Tab")}};return t?n.jsx(ie,{}):n.jsxs(n.Fragment,{children:[n.jsx(re,{}),n.jsxs(i.Page,{isFullscreen:!0,className:"HomePage",children:[n.jsx(we,{activeTab:r.OVERVIEW,children:n.jsx(ye,{})}),n.jsx(je,{id:Ee}),n.jsxs(i.Container,{children:[n.jsx("h1",{className:"title",children:c("home_page.title")}),n.jsx(i.Card.Group,{itemsPerRow:4,centered:!0,children:ve.map((o,C)=>n.jsxs(i.Card,{children:[n.jsxs(i.Card.Content,{textAlign:"center",children:[n.jsx(i.Card.Header,{children:c(`home_page.${o}.card_title`)}),n.jsxs(i.Card.Description,{children:[n.jsx("p",{className:"card-description",children:c(`home_page.${o}.card_description`)}),n.jsx("div",{className:le("card-image",o)})]})]}),n.jsxs(i.Card.Content,{extra:!0,children:[n.jsx(i.Button,{primary:!0,content:c(`home_page.${o}.cta_label`),onClick:()=>l(o)}),n.jsx(i.Button,{as:"a",basic:!0,content:c("global.learn_more"),href:m(o),rel:"noopener noreferrer",target:"_blank"})]})]},C))})]})]}),n.jsx(ce,{})]})},Re=ke,Ie=O();function Ae({activeTab:e,isFullscreen:t,isCommitteeMember:a,children:s}){const d=w(),l=S.useCallback(m=>{Ie.setItem(f,m),d.push(m)},[]);return n.jsx("div",{className:"Navigation",children:n.jsxs(i.Tabs,{isFullscreen:t,children:[s,n.jsx(i.Tabs.Tab,{active:e===r.OVERVIEW,onClick:()=>l(g.root()),children:c("navigation.overview")}),n.jsx(i.Tabs.Tab,{active:e===r.COLLECTIONS,onClick:()=>l(g.collections()),children:c("navigation.collections")}),n.jsx(i.Tabs.Tab,{active:e===r.SCENES,onClick:()=>l(g.scenes()),children:c("navigation.scenes")}),n.jsx(i.Tabs.Tab,{active:e===r.LAND,onClick:()=>l(g.land()),children:c("navigation.land")}),n.jsx(i.Tabs.Tab,{active:e===r.NAMES,onClick:()=>l(g.ens()),children:c("navigation.names")}),n.jsx(i.Tabs.Tab,{active:e===r.WORLDS,onClick:()=>l(g.worlds()),children:c("navigation.worlds")}),a?n.jsx(i.Tabs.Tab,{active:e===r.CURATION,onClick:()=>l(g.curation()),children:c("navigation.curation")}):null]})})}const Oe=e=>({isCommitteeMember:de(e)}),we=T(Oe)(Ae);export{je as B,Re as H,r as N,ye as S,we as a,Ee as b};
|
package/assets/index-B5dIZKGN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var rt=Object.defineProperty;var dt=(n,l,e)=>l in n?rt(n,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[l]=e;var h=(n,l,e)=>dt(n,typeof l!="symbol"?l+"":l,e);import{af as z,H as t,M as c,G as d,bm as H,bD as ct,D as b,gt as K,L as ee,K as R,cf as Me,b8 as x,N as B,bw as V,eD as ht,gu as mt,gv as gt,gw as pt,gx as ut,gy as Ct,gz as It,gA as bt,gB as xt,gC as _t,gD as L,er as vt,gE as Z,gF as Et,gG as Q,fc as Le,fr as jt,fX as St,fY as ft,eA as he,gm as wt,aH as te,gH as Tt,db as be,gI as xe,bt as Oe,gJ as yt,fZ as Pt,eE as me,aW as At,gK as Nt,gL as Rt,gM as Dt,fo as Mt,f$ as Lt,g0 as Ot,Z as ke,bv as Be,gN as kt,eS as fe,bE as Bt,fk as We,ae as Wt,gO as Fe,eH as _e,X as He,eu as Ft,ep as Ve,fF as X,dD as ge,eq as Ht,eV as pe,gP as $e,bl as ve,fV as Ue,eY as T,es as Y,fA as Je,fB as ue,J as O,f6 as Ce,dC as Vt,eQ as $t,eB as Ut,gQ as Ee,fb as je,fj as Jt,gR as Yt,gS as zt,gT as qt,gU as Ye,gV as ze,gW as qe,gX as Ge,fJ as Ze,eK as Gt,eJ as Ke,eL as Zt,eN as Kt,eO as Qt,gY as Xt,gZ as es,g_ as ts,g$ as se,h0 as oe,h1 as ss,ed as as,h2 as ns,h3 as is,h4 as ls,h5 as os,h6 as rs,h7 as ds,h8 as cs,h9 as hs,ha as ms,hb as gs,hc as ps,hd as us,he as Cs,hf as Is,hg as bs,hh as xs,hi as _s,hj as vs,f_ as Es,bO as ne,hk as js,hl as we,hm as Ss,hn as fs,eU as Te,fG as re,ho as de,eT as ws,eP as ye,eW as Ts,eX as Pe,eZ as Ae,e_ as Ne,hp as ys,hq as Ps,e$ as As,f0 as Re,f1 as De,hr as Ns,f9 as Rs,hs as Ds,ht as Ms,hu as Ls,hv as Qe,hw as Os,hx as ks,hy as Bs,fd as Ws,hz as Fs,hA as Hs,eG as Vs,hB as $s,fe as Us,fg as Js,hC as Ys}from"./index-B3rcGd62.js";import{J as zs}from"./JumpIn.container-9o11sV9i.js";import{C as qs}from"./CollectionProvider.container-DLttDjYi.js";import{C as Xe}from"./ConfirmDelete-CL242pjc.js";import{C as et}from"./CollectionStatus.container-KkB73dPK.js";import{d as Gs,e as Zs,c as Ks}from"./selectors-Cuqfofix.js";import{I as Qs}from"./ItemProvider.container-CUJZfUhf.js";const Xs=({open:n,assignee:l,onConfirm:e,onClose:s})=>t.jsxs(c.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:n,children:[t.jsx(c.Modal.Header,{children:d("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(c.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx(H,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(ct,{textOnly:!0,address:l})})}})}),t.jsx("span",{children:t.jsx(H,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:s,children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:e,children:d("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),ea=z.memo(Xs);var w=(n=>(n.REJECT_COLLECTION="REJECT_COLLECTION",n.REJECT_CURATION="REJECT_CURATION",n.DISABLE_COLLECTION="DISABLE_COLLECTION",n.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",n))(w||{});const k="item_editor.top_panel.rejection_modal",ta=({open:n,type:l,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:i,collection:o,curation:r,onReject:m,onRejectCuration:g,onClose:p})=>{const _=b.useMemo(()=>{switch(l){case w.DISABLE_COLLECTION:return k+".disable_collection";case w.REJECT_CURATION:return k+".reject_curation";case w.DISABLE_THIRD_PARTY:return k+".disable_third_party";default:return""}},[l]),j=()=>{switch(l){case w.DISABLE_COLLECTION:m(o);break;case w.REJECT_CURATION:g(r.collectionId);break;case w.DISABLE_THIRD_PARTY:s&&i(s.id);break}},C=l===w.DISABLE_COLLECTION&&!o.isApproved||l===w.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||l===w.REJECT_COLLECTION&&!o.isApproved||l===w.REJECT_CURATION&&(r==null?void 0:r.status)===K.REJECTED;return t.jsx(c.Modal,{size:"tiny",className:"RejectionModal",open:n,children:a?t.jsx(sa,{i18nKey:_}):C?t.jsx(aa,{link:o.forumLink,onClose:p}):t.jsx(na,{i18nKey:_,isLoading:e,onClose:p,onConfirm:j})})},sa=({i18nKey:n})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(`${n}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:d(`${n}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx(H,{id:k+".visit_activity",values:{activity_link:t.jsx(ee,{to:R.activity(),children:d("global.activity")})}})}),t.jsx(c.Loader,{active:!0,size:"large"})]})]}),aa=({link:n,onClose:l})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(k+".veredict_explanation")}),t.jsx(c.Modal.Content,{children:d(k+".go_to_forum")}),t.jsxs(c.Modal.Actions,{children:[t.jsx("a",{href:n,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(c.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:d(k+".forum_link")}),t.jsx("div",{className:"discussion",children:d(k+".discussion")}),t.jsx(c.Icon,{name:"chevron right"})]})}),t.jsx(c.Button,{basic:!0,onClick:l,children:d("global.done")})]})]}),na=({i18nKey:n,isLoading:l,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(`${n}.title`)}),t.jsx(c.Modal.Content,{children:d(`${n}.subtitle`)}),t.jsxs(c.Modal.Actions,{children:[t.jsx(Me,{primary:!0,onClick:e,disabled:l,loading:l,network:x.Network.MATIC,children:d(`${n}.action`)}),t.jsx(c.Button,{disabled:l,onClick:s,children:d("global.cancel")})]})]}),ia=z.memo(ta),la=(n,l)=>({isLoading:V(ht(n),xt)||V(mt(n),_t)||gt(n),hasPendingTransaction:pt(n)||!!(l.thirdParty&&ut(n,l.thirdParty.id))}),oa=n=>({onReject:l=>n(Ct(l)),onRejectCuration:l=>n(It(l)),onDisableThirdParty:l=>n(bt(l))}),ra=B(la,oa)(ia);var E=(n=>(n[n.APPROVE=0]="APPROVE",n[n.REJECT=1]="REJECT",n[n.ENABLE=2]="ENABLE",n[n.DISABLE=3]="DISABLE",n))(E||{});let da=class extends z.PureComponent{constructor(){super(...arguments);h(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});h(this,"handleBack",()=>{this.props.onNavigate(R.curation())});h(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:i,onInitiateTPApprovalFlow:o,onSetAssignee:r}=this.props;this.setState({showApproveConfirmModal:!1}),a&&r(e.id,a,s),L(e)?o(e):i(e)});h(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));h(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:i,totalItems:o,thirdParty:r}=this.props,{showRejectionModal:m,showApproveConfirmModal:g}=this.state,{chainId:p}=this.props,_=vt(e);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"actions",children:t.jsx("div",{className:"back",onClick:this.handleBack})}),t.jsxs("div",{className:"title",children:[e.name," · ",d(`collection.type.${_}`),t.jsx(zs,{size:"small",active:!0,collection:e,chainId:p,items:L(e)?s:void 0,text:d("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:L(e)&&o!==void 0?this.renderTPButtons(e,i,a):this.renderButtons(e,i)})}),m&&t.jsx(ra,{type:m,open:!0,collection:e,curation:i,thirdParty:r,onClose:()=>this.setShowRejectionModal(null)}),(i==null?void 0:i.assignee)&&g&&t.jsx(ea,{open:!0,assignee:i.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,i),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});h(this,"renderButton",(e,s,a)=>{const{address:i,thirdParty:o,onInitiateApprovalFlow:r,onInitiateTPApprovalFlow:m,reviewedItems:g,totalItems:p}=this.props,_={[E.APPROVE]:()=>a!=null&&a.assignee&&i!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):L(s)?m(s):r(s),[E.ENABLE]:()=>r(s),[E.DISABLE]:()=>this.setShowRejectionModal(o?w.DISABLE_THIRD_PARTY:w.DISABLE_COLLECTION),[E.REJECT]:()=>{(a==null?void 0:a.status)===K.PENDING?this.setShowRejectionModal(w.REJECT_CURATION):this.setShowRejectionModal(w.REJECT_COLLECTION)}},j={[E.APPROVE]:"approve",[E.ENABLE]:"enable",[E.DISABLE]:"disable",[E.REJECT]:"reject"},C=e===E.APPROVE||e===E.ENABLE,S=!L(s)||!!p&&g.length>=Z(p);return t.jsx(c.Popup,{content:d("item_editor.top_panel.items_pending_to_review"),disabled:S,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(c.Button,{primary:C,onClick:()=>_[e](),disabled:L(s)&&e===E.APPROVE&&!!p&&g.length<Z(p),children:d(`item_editor.top_panel.${j[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});h(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:i,totalItems:o,thirdParty:r}=this.props,m=a==null?void 0:a.some(g=>g.status===K.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(c.Header,{sub:!0,children:[m?d("item_editor.top_panel.reviewed_counter",{count:i.length,threshold:Z(o)}):d("item_editor.top_panel.not_enough_items_to_curate_more"),i.length>=Z(o)?t.jsx(c.Icon,{name:"check circle"}):null]}),m&&this.renderButton(E.APPROVE,e,s),m&&this.renderButton(E.REJECT,e,s),!m&&(r==null?void 0:r.isApproved)&&this.renderButton(E.DISABLE,e,null)]})});h(this,"renderButtons",(e,s)=>{if(s&&e.isApproved)switch(s.status){case"pending":return t.jsxs(t.Fragment,{children:[this.renderButton(E.APPROVE,e,s),this.renderButton(E.REJECT,e,s)]});case"approved":case"rejected":return this.renderButton(E.DISABLE,e,s)}return Et(e)?e.isApproved?this.renderButton(E.DISABLE,e,s):this.renderButton(E.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(E.APPROVE,e,s),this.renderButton(E.REJECT,e,s)]})})}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:i,isConnected:o,isLoading:r}=this.props,m=!e||r&&!s.length;return a&&i&&o?t.jsx("div",{className:"TopPanel",children:m?t.jsx(c.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const ca=n=>{const l=Q(n),e=l?Le(n,l):null,s=e?jt(n,e.id):[],a=e?St(n,e.id):[],i=l?ft(n,l):null,o=l?he(n,l):void 0,r=e&&L(e)?wt(n,e):null;return{address:te(n),items:s,totalItems:(o==null?void 0:o.total)||null,collection:e,itemCurations:a,thirdParty:r,curation:i,chainId:Tt(n),isConnected:be(n),isReviewing:xe(n),isCommitteeMember:Oe(n),selectedCollectionId:Q(n),isLoading:V(yt(n),Mt)||V(Pt(n),Lt)||V(me(n),Ot)}},ha=n=>({onNavigate:l=>n(At(l)),onSetAssignee:(l,e,s)=>n(Nt(l,e,s)),onInitiateTPApprovalFlow:l=>n(Rt(l)),onInitiateApprovalFlow:l=>n(Dt(l))}),ma=B(ca,ha)(da),ga="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.22722%2012.7164C4.07574%2012.5731%204%2012.3582%204%2012.2149C4%2012.0716%204.07574%2011.8567%204.22722%2011.7134L5.28757%2010.7104C5.59053%2010.4239%206.04497%2010.4239%206.34793%2010.7104L9.35858%2013.8448C9.51006%2013.9881%209.73728%2013.9881%209.88876%2013.8448L17.6521%206.21493C17.955%205.92836%2018.4095%205.92836%2018.7124%206.21493L19.7728%207.21791C20.0757%207.50448%2020.0757%207.93433%2019.7728%208.2209L10.116%2017.7851C9.9645%2017.9284%209.81302%2018%209.5858%2018C9.35858%2018%209.2071%2017.9284%209.05562%2017.7851L4.22722%2012.7164Z'%20fill='white'/%3e%3c/svg%3e",pa=n=>{const{collectionId:l,itemName:e}=n,[s,a]=b.useState(!1),[i,o]=b.useState(null),r=ke(),m=Be();b.useEffect(()=>{e&&(a(!0),o(e))},[e]);function g(){a(!1);const p=new URLSearchParams(m.search);p.delete("newItem"),r.replace({search:p.toString()})}return s&&i&&l?t.jsx(c.Toast,{type:c.ToastType.INFO,title:d("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:ga,alt:d("sagas.item.item_added_toast.title")})}),onClose:g,body:t.jsx(H,{id:"sagas.item.item_added_toast.body",values:{name:i,br:()=>t.jsx("br",{}),b:p=>t.jsx("strong",{children:p}),"collection-link":p=>t.jsx(ee,{to:R.collectionDetail(l),children:t.jsx(c.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:p})})}})}):null},ua=z.memo(pa),Ca=n=>({itemName:kt(n)}),Ia=B(Ca)(ua),ba=({collection:n,address:l,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:i,onDeleteCollection:o})=>{var u,W;const r=Be(),m=ke(),g=((u=r.state)==null?void 0:u.fromParam)===fe.COLLECTIONS,p=((W=r.state)==null?void 0:W.fromParam)===fe.TP_COLLECTIONS,_=b.useCallback(()=>{m.push(R.collections())},[m]),j=b.useCallback(()=>{if(n&&(g||p)){const F=g?R.collectionDetail:R.thirdPartyCollectionDetail;m.push(F(n.id))}else m.push(R.itemEditor())},[g,p,m,n]),C=b.useCallback(()=>{i("CreateCollectionModal")},[i]),S=b.useCallback(()=>{n&&i("CreateSingleItemModal",{collectionId:n.id})},[n,i]),I=b.useCallback(()=>{n&&i("AddExistingItemModal",{collectionId:n.id})},[n,i]),y=b.useCallback(()=>{n&&i("EditCollectionNameModal",{collection:n})},[n,i]),f=b.useCallback(()=>{n&&o(n)},[n,o]),D=b.useCallback(()=>{const F=n&&Bt(n.owner,l||"");return n?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${g||p?"close":"back"}`,onClick:j}),t.jsxs("div",{className:"title",children:[t.jsx(ee,{to:R.collectionDetail(n.id),children:n.name}),t.jsx(et,{collection:n})]}),F&&!n.isPublished?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(c.Dropdown.Menu,{children:[t.jsx(c.Dropdown.Item,{onClick:y,children:d("item_editor.left_panel.actions.edit_name")}),t.jsx(c.Dropdown.Item,{onClick:S,children:d("item_editor.left_panel.actions.new_item")}),e&&t.jsx(c.Dropdown.Item,{onClick:I,children:d("item_editor.left_panel.actions.add_existing_item")}),t.jsx(Xe,{name:n.name,onDelete:f,trigger:t.jsx(c.Dropdown.Item,{text:d("global.delete")})})]})}):null]}):null},[n,l,e,g,p]),M=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:_}),t.jsx("div",{className:"title",children:e?d("item_editor.left_panel.title"):d("item_editor.left_panel.title_alternative")}),s?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(c.Dropdown.Menu,{children:t.jsx(c.Dropdown.Item,{onClick:C,children:d("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(c.Row,{grow:!1,shrink:!1,className:"Header",children:n?D():M()})},xa=ba,_a=n=>{let l;const e=Q(n);e&&(l=We(n).find(i=>i.id===e));const s=te(n);return{address:s,isLoggedIn:Wt(n),isReviewing:xe(n),collection:l,hasEditRights:l!==void 0&&s!==void 0&&Fe(n,s,l),hasUserOrphanItems:_e(n)}},va=n=>({onOpenModal:(l,e)=>n(He(l,e)),onDeleteCollection:l=>n(Ft(l)),onDeleteItem:l=>n(Ve(l))}),Ea=B(_a,va)(xa),P=10;class N extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{isCollapsed:!1});h(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,i=!a;return t.jsxs("div",{className:`Collapsable ${i?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:i?s:null})]})}}class ja extends b.PureComponent{constructor(){super(...arguments);h(this,"handleClick",()=>{const{item:e,onClick:s}=this.props;s(e)})}renderToggleItem(){const{item:e,isVisible:s,isPlayingEmote:a}=this.props;return X(e)?t.jsx(c.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:i}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(ee,{to:R.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(ge,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Ht,{item:e}),e.name]}),t.jsx(c.Popup,{content:d("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:d(`body_shapes.${pe(e)}`).toLowerCase()})}),disabled:$e(e,i),position:"top center",trigger:this.renderToggleItem()})]})})}}const Sa=ja;var v=(n=>(n.TO_REVIEW="to-review",n.REVIEWED="reviewed",n.ALL_ITEMS="all-items",n))(v||{});const fa={[v.TO_REVIEW]:1,[v.REVIEWED]:1,[v.ALL_ITEMS]:1};class wa extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{currentTab:v.TO_REVIEW,currentPages:fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});h(this,"analytics",ve());h(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:i}=this.state;this.getIsReviewingTPItems()&&i===v.TO_REVIEW&&!Ue(s,e==null?void 0:e.items)&&a()});h(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});h(this,"handleClick",e=>{const{bodyShape:s,visibleItems:a,wearableController:i,isPlayingEmote:o,onSetItems:r}=this.props;if(!$e(e,s))return;let m=a.filter(g=>g.id!==e.id);if(X(e))if(this.isVisible(e)){o?i==null||i.emote.pause():i==null||i.emote.play();return}else m=m.filter(g=>g.type!==T.EMOTE);this.isVisible(e)||(m.push(e),this.analytics.track("Preview Item",{ITEM_ID:e!=null&&e.urn?Y(e.urn)?Je(e.urn):ue(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:Y(e.urn)})),r(m)});h(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:i}=this.props,{currentPages:o}=this.state;e===v.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{i(),s(o[v.ALL_ITEMS])}):e===v.TO_REVIEW&&a(),this.setState({currentTab:e})});h(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});h(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});h(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:i}=this.props;this.setState(o=>({currentPages:{...o.currentPages,[a]:+s.activePage}})),a!==v.REVIEWED&&i(+s.activePage)});h(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(v.ALL_ITEMS)});h(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?Y(e.urn)&&s:!1});h(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:i,isPlayingEmote:o}=this.props;return t.jsx(Sa,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:o,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:i,onClick:this.handleClick},e.id)});h(this,"renderSidebarCategory",e=>{const s=e.filter(Ce),a=e.filter(X);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:d("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(N,{label:this.renderCollapsableLabel(T.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(N,{label:this.renderCollapsableLabel(T.EMOTE),children:a.map(this.renderSidebarItem)})]})});h(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,i=a[s],o=Math.ceil(e/P);return o>1?t.jsx(c.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:o,activePage:i,onPageChange:this.handlePageChange}):null});h(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,i=s[a],o=(i-1)*P,r=i*P;return t.jsx(c.Header,{sub:!0,children:d("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:o,pageEnd:r>e?e:r,total:e})})});h(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:i}=this.props,{currentTab:o,currentPages:r}=this.state,m=this.getIsReviewingTPItems(),g=r[o];if(s)return t.jsx(c.Loader,{size:"large",active:!0});switch(o){case v.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!m&&a?this.renderTabPagination(a):null]});case v.REVIEWED:{const p=i.slice((g-1)*P,g*P);return t.jsxs(t.Fragment,{children:[i.length?this.renderPaginationStats(i.length):null,this.renderSidebarCategory(p),i.length?this.renderTabPagination(i.length):null]})}case v.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});h(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:i}=this.state;let o;const r=!s||s<P||a.length===s;switch(i){case v.TO_REVIEW:o=t.jsx(c.Popup,{content:d("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!r,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(c.Button,{disabled:e||r,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(c.Icon,{name:"random"}),d("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case v.REVIEWED:o=t.jsx(H,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:d("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:Z(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",o," "]})});h(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(c.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(c.Modal.Header,{children:d("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(c.Modal.Content,{children:[t.jsx(H,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:v.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(c.Checkbox,{checked:!s}),d("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:this.handleModalProceed,children:d("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});h(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(c.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(c.Modal.Header,{children:d("item_editor.left_panel.all_items_check.title")}),t.jsx(c.Modal.Content,{children:d("item_editor.left_panel.all_items_check.content")}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:()=>this.handleTabChange(v.ALL_ITEMS),children:d("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});h(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(c.Tabs,{isFullscreen:!0,children:[t.jsx(c.Tabs.Tab,{active:e===v.TO_REVIEW,onClick:()=>this.handleTabChange(v.TO_REVIEW),children:d("item_editor.left_panel.to_review")}),t.jsx(c.Tabs.Tab,{active:e===v.REVIEWED,onClick:()=>this.handleTabChange(v.REVIEWED),children:d("item_editor.left_panel.reviewed")}),t.jsx(c.Tabs.Tab,{active:e===v.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:d("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(O,{name:e}),t.jsx(H,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(c.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class Ta extends b.PureComponent{render(){const{collection:l,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(ee,{to:R.itemEditor({collectionId:l.id}),children:[t.jsx(Vt,{collectionId:l.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(et,{collection:l}),l.name]}),t.jsx("div",{className:"count",children:d("item_editor.left_panel.items_count",{count:l.itemCount})})]})]})})}}const ya=Ta;class Pa extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{currentPage:1});h(this,"handlePageChange",(e,s)=>{const{onLoadPage:a}=this.props;this.setState({currentPage:+s.activePage}),a(+s.activePage)})}render(){const{collections:e,isLoading:s,items:a,selectedCollectionId:i,totalCollections:o}=this.props,{currentPage:r}=this.state;if(e.length===0)return null;const m=Math.ceil(o/P);return s?t.jsx(c.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:d("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(c.Section,{className:"Collections",children:[e.map(g=>t.jsx(ya,{collection:g,items:a,isSelected:g.id===i},g.id)),m>1?t.jsx(c.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:m,activePage:r,onPageChange:this.handlePageChange}):null]})})}}var J=(n=>(n.COLLECTIONS="collections",n.ORPHAN_ITEMS="orphanItems",n))(J||{});const U=1;let Aa=class extends b.PureComponent{constructor(){super(...arguments);h(this,"state",this.getInitialState());h(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});h(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:i,selectedCollectionId:o}=this.props,{pages:r}=this.state;if(e&&!i&&!o){const m=r[r.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:P,page:m})}});h(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});h(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));h(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:i,onSetReviewedItems:o}=this.props,r=this.isCollectionTabActive()?i:a,m=Math.ceil(r/P);if(m>s.length){const g=[...Array(m).keys()].map(p=>p+1).filter(p=>!s.includes(p));if(g.length>0){const p=g[Math.floor(Math.random()*g.length)];this.setState(_=>({pages:[..._.pages,p]}),this.fetchResource)}}o(e)});h(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[U]},this.fetchResource)});h(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===J.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=J.COLLECTIONS;return!e&&s&&(a=J.ORPHAN_ITEMS),{pages:[U],currentTab:a,initialPage:U,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:i,onSetItems:o}=this.props;this.fetchResource(),e&&s===void 0&&i(e),a&&o([a])}componentDidUpdate(e,s){const{isConnected:a,address:i,selectedCollectionId:o,selectedItemId:r,selectedItem:m,orphanItems:g,totalItems:p,visibleItems:_,hasUserOrphanItems:j,onSetItems:C,onFetchOrphanItem:S}=this.props,{initialPage:I,pages:y}=this.state;if(!o&&i&&r&&p&&(I===U||s.initialPage<I)){if(!g.find(f=>f.id===r)){const f=Math.ceil(p/P),D=y[y.length-1],M=Math.min(f,D+1);y.includes(M)||this.setState({pages:[M],initialPage:M},this.fetchResource)}}else if(e.selectedItemId&&r&&e.selectedItemId!==r){const f=_.filter(D=>D.type!==T.EMOTE);C(f)}else i&&a&&(a!==e.isConnected||e.selectedCollectionId&&!o)&&this.setState({pages:[U]},this.fetchResource),e.selectedCollectionId!==o&&this.setState({pages:[U]}),i&&i!==e.address&&j===void 0&&S(i);!e.selectedItem&&m&&m.type!==T.EMOTE&&C([m]),e.selectedCollectionId!==o&&C([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:i,orphanItems:o,isReviewing:r}=this.props;return i&&e?$t(e)&&r?s.filter(m=>!!(a!=null&&a.find(g=>g.itemId===m.id&&g.status===K.PENDING))):s:o}render(){const{items:e,totalItems:s,totalCollections:a,collections:i,selectedItemId:o,selectedCollectionId:r,visibleItems:m,bodyShape:g,reviewedItems:p,isReviewing:_,isPlayingEmote:j,isConnected:C,wearableController:S,isLoading:I,hasUserOrphanItems:y,onSetItems:f,onSetReviewedItems:D,onResetReviewedItems:M}=this.props,{pages:u,showSamplesModalAgain:W}=this.state,F=!r&&y,le=this.isCollectionTabActive()&&!r,A=!this.isCollectionTabActive()||r;return t.jsx("div",{className:"LeftPanel",children:C?t.jsx(qs,{id:r,itemSelected:o,itemsPage:u,itemsPageSize:P,fetchCollectionItemsOptions:{status:_?K.PENDING:void 0},onChangePage:q=>this.setState({pages:[q]}),children:({paginatedCollections:q,collection:$,paginatedItems:st,initialPage:at,isLoadingCollection:nt,isLoadingCollectionItems:it,itemCurations:lt})=>{const G=this.getItems($,st,lt),Se=this.isCollectionTabActive(),ot=r&&$?at:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(Ea,{}),F?t.jsxs(c.Tabs,{isFullscreen:!0,children:[t.jsx(c.Tabs.Tab,{active:Se,onClick:()=>this.handleTabChange(J.COLLECTIONS),children:d("collections_page.collections")}),t.jsx(c.Tabs.Tab,{active:!Se,onClick:()=>this.handleTabChange(J.ORPHAN_ITEMS),children:d("item_editor.left_panel.items")})]}):null,le?t.jsx(Pa,{collections:q,totalCollections:a||i.length,items:e,hasHeader:G.length>0,selectedCollectionId:r,onLoadPage:this.loadPage,isLoading:nt}):null,A?t.jsxs(t.Fragment,{children:[t.jsx(wa,{items:G,totalItems:s||G.length,hasHeader:!r&&i.length>0,selectedItemId:o,collection:$,isReviewing:_,isPlayingEmote:j,visibleItems:m,bodyShape:g,onResetReviewedItems:M,reviewedItems:p,onSetItems:f,wearableController:S,initialPage:ot,isLoading:it||I,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:W,onReviewItems:()=>D(G),onLoadRandomPage:()=>this.loadRandomPage(G),onLoadPage:this.loadPage}),t.jsx(Ia,{collectionId:r})]}):null]})}}):null})}};const Na=n=>{const l=Q(n),e=te(n),s=l?he(n,l):e?he(n,e):void 0,a=l?void 0:Ut(n),i=Ee(n)||"",o=je(n,i);return{address:e,isConnected:be(n),items:Jt(n),totalItems:(s==null?void 0:s.total)||null,totalCollections:(a==null?void 0:a.total)||null,orphanItems:e&&!l?Yt(n,e,s==null?void 0:s.limit):zt(n),collections:qt(n),selectedItemId:i,selectedItem:o,selectedCollectionId:l,visibleItems:Ye(n),bodyShape:ze(n),wearableController:qe(n),isReviewing:xe(n),isLoading:V(me(n),Kt)||V(me(n),Qt),isPlayingEmote:Ge(n),hasUserOrphanItems:_e(n)}},Ra=n=>({onSetItems:l=>n(Ze(l)),onFetchCollections:(l,e)=>n(Gt(l,e)),onFetchOrphanItems:(l,e)=>n(Ke(l,e)),onFetchOrphanItem:l=>n(Zt(l))}),Da=B(Na,Ra)(Aa);class ce extends z.PureComponent{constructor(){super(...arguments);h(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:i,onChange:o}=this.props;if(a.toHexString()!==s.value){const r=i.find(m=>m.toHexString()===s.value);o(r)}});h(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(c.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,i=e.toHexString();return t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:i,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:i}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(c.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ma=class extends z.PureComponent{constructor(){super(...arguments);h(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:i,bodyShape:o,onChange:r,baseWearables:m}=this.props,g=s.value?m.find(p=>p.id===s.value):null;a!==g&&r(i,o,g??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:i,isNullable:o,baseWearables:r}=this.props,m=Xt(r,a,s).map(p=>({value:p.id,text:es(p)}));o&&m.push({value:"",text:d("global.none")});const g=e?m.find(p=>p.value===e.id):null;return t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:m,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:i}),t.jsx("div",{className:"value",children:g?g.text:d("global.none")}),t.jsx("div",{className:"handle"})]})})}};const La=n=>({baseWearables:ts(n)}),ae=B(La)(Ma);let Oa=class extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1});h(this,"analytics",ve());h(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});h(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});h(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:i,onSetAvatarAnimation:o,onSetItems:r}=this.props,m=a.find(p=>p.id===s),g=i.filter(p=>p.type!==T.EMOTE);g.forEach(p=>{this.analytics.track("Play Emote",{EMOTE_PLAYED_BASE:!m,EMOTE_PLAYED_ITEM_ID:m!=null&&m.urn?ue(m.urn):null,EMOTE_PLAYED_NAME:m?m.name:s,PREVIEWED_WEARABLE_ITEM_ID:p!=null&&p.urn?Y(p.urn)?Je(p.urn):ue(p.urn):null,PREVIEWED_WEARABLE_NAME:p.name})}),m?g.push(m):o(s),r(g)});h(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});h(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});h(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});h(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:i}=this.props;i(e,s,a)});h(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(c.WearablePreview.createController("wearable-editor")),this.setState({isLoading:!1})});h(this,"handleControlActionChange",async e=>{const{wearableController:s}=this.props,a=.1;if(s)switch(await(s==null?void 0:s.emote.pause()),e){case se.ZOOM_IN:{await(s==null?void 0:s.scene.changeZoom(a));break}case se.ZOOM_OUT:{await(s==null?void 0:s.scene.changeZoom(-a));break}}});h(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:i,onSetItems:o}=this.props,r=a.filter(m=>m.type!==T.EMOTE);s?(i(x.PreviewEmote.IDLE),o(r)):e==null||e.emote.play()});h(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?d("item_editor.center_panel.stop"):d("item_editor.center_panel.play_emote");return t.jsxs(c.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(c.Icon,{name:s}),t.jsx("span",{children:a})]})});h(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,i=!!e,o=s.length>0;return a?null:t.jsx(c.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(c.Dropdown.Menu,{children:[o&&t.jsxs(t.Fragment,{children:[t.jsx(c.Dropdown.Header,{content:i?d("item_editor.center_panel.from_collection"):d("item_editor.center_panel.from_items")}),t.jsx(c.Dropdown.Divider,{}),s.map(r=>t.jsx(c.Dropdown.Item,{value:r.id,text:r.name,onClick:this.handleAnimationChange},r.id)),t.jsx(c.Dropdown.Divider,{}),t.jsx(c.Dropdown.Header,{content:d("item_editor.center_panel.default")}),t.jsx(c.Dropdown.Divider,{})]}),x.PreviewEmote.schema.enum.map(r=>t.jsx(c.Dropdown.Item,{value:r,text:d(`emotes.${r}`),onClick:this.handleAnimationChange},r))]})})});h(this,"renderEmoteSelector",()=>t.jsx(c.Popup,{content:d("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(c.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:i,hasUserOrphanItems:o,onFetchBaseWearables:r,onFetchOrphanItems:m,onFetchCollectionItems:g}=this.props,p=a.length>0;i||r(),p||(s&&!L(s)?g(s.id):e&&o&&m(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const i=s.find(o=>o.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,i?i.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:i,emote:o,selectedBaseWearables:r,selectedItem:m,visibleItems:g,isImportFilesModalOpen:p,wearableController:_}=this.props,{isShowingAvatarAttributes:j,showSceneBoundaries:C,isLoading:S}=this.state,I=g.some(X)&&(m==null?void 0:m.type)===T.EMOTE,y=o===x.PreviewEmote.JUMP?1:void 0;return t.jsxs("div",{className:`CenterPanel ${p?"import-files-modal-is-open":""}`,children:[t.jsx(c.WearablePreview,{id:"wearable-editor",profile:"default",bodyShape:e,emote:o,zoom:y,skin:oe(s),eyes:oe(a),hair:oe(i),urns:r?Object.values(r).map(f=>f?f.id:null).filter(f=>f!==null):[],base64s:g.map(ss),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:as,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:I,showSceneBoundaries:C}),I?t.jsxs("div",{className:"zoom-controls",children:[t.jsx(c.Button,{className:"zoom-control zoom-in-control",onClick:()=>this.handleControlActionChange(se.ZOOM_IN),children:t.jsx(c.Icon,{name:"plus"})}),t.jsx(c.Button,{className:"zoom-control zoom-out-control",onClick:()=>this.handleControlActionChange(se.ZOOM_OUT),children:t.jsx(c.Icon,{name:"minus"})})]}):null,S&&t.jsx(c.Center,{children:t.jsx(c.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[I&&!S&&_?t.jsx("div",{className:"emote-controls-container",children:t.jsx(c.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:_})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${j?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(c.Icon,{name:"user"})}),I?null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${C?"active":""}`,children:t.jsx(O,{name:"cylinder",onClick:()=>this.setState(f=>({showSceneBoundaries:!f.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${j?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:x.BodyShape.MALE,text:d("body_shapes.male")},{value:x.BodyShape.FEMALE,text:d("body_shapes.female")}],d("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:s,colors:ns(),label:d("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:a,colors:is(),label:d("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:i,colors:ls(),label:d("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[x.WearableCategory.HAIR],category:x.WearableCategory.HAIR,bodyShape:e,label:d("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[x.WearableCategory.FACIAL_HAIR],category:x.WearableCategory.FACIAL_HAIR,bodyShape:e,label:d("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[x.WearableCategory.UPPER_BODY],category:x.WearableCategory.UPPER_BODY,bodyShape:e,label:d("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[x.WearableCategory.LOWER_BODY],category:x.WearableCategory.LOWER_BODY,bodyShape:e,label:d("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const ka=n=>{const l=te(n);let e;const s=Q(n);let a=os(n);s?(e=We(n).find(S=>S.id===s),a=a.filter(S=>S.collectionId===s)):a=a.filter(C=>!C.collectionId);const i=Ee(n)||"",o=je(n,i),r=ze(n),m=rs(n),g=Ye(n),p=ds(n),_=!g.some(X)&&p===x.PreviewEmote.IDLE,j="CreateSingleItemModal"in cs(n);return{address:l,bodyShape:r,collection:e,selectedItem:o,selectedBaseWearables:m?m[r]:null,skinColor:hs(n),eyeColor:ms(n),hairColor:gs(n),emote:p,visibleItems:g,wearableController:qe(n),emotes:a,isPlayingEmote:_?!1:Ge(n),isImportFilesModalOpen:j,hasUserOrphanItems:_e(n)}},Ba=n=>({onSetBodyShape:l=>n(ps(l)),onSetAvatarAnimation:l=>n(us(l)),onSetSkinColor:l=>n(Cs(l)),onSetEyeColor:l=>n(Is(l)),onSetHairColor:l=>n(bs(l)),onSetBaseWearable:(l,e,s)=>n(xs(l,e,s)),onFetchBaseWearables:()=>n(_s()),onSetWearablePreviewController:l=>n(vs(l)),onSetItems:l=>n(Ze(l)),onFetchOrphanItems:(l,e)=>n(Ke(l,e)),onFetchCollectionItems:(l,e)=>n(Es(l,e))}),Wa=B(ka,Ba)(Oa);class Fa extends b.PureComponent{constructor(){super(...arguments);h(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:i}=this.props,o=e.target.value;s!==o&&i(a?o.slice(0,a):o)})}render(){const{label:e,disabled:s,value:a}=this.props;return t.jsxs("div",{className:`Input ${s?"is-disabled":""}`.trim(),children:[t.jsx("div",{className:"label",children:e}),t.jsx("input",{value:a||"",onChange:this.handleChange,disabled:s})]})}}class ie extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{value:this.props.value});h(this,"handleChange",(e,s)=>{const{value:a,onChange:i}=this.props,o=s.value;o!==a&&(this.setState({value:o}),i(o))})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,options:s}=this.props,{value:a}=this.state,i=s.find(o=>o.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:i?i.text:d("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(c.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}h(ie,"defaultProps",{disabled:!1});class Ie extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{value:this.props.value});h(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:i}=this.state,o=s.value,r=[...i];for(const m of o)i.includes(m)||r.push(m);r.length!==i.length&&(this.setState({value:r}),a(r))});h(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(i=>i!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,info:s,options:a}=this.props,{value:i}=this.state,o=a.reduce((r,m)=>(r[m.value]=m.text,r),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(ne,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:i.length>0?i.map(r=>t.jsxs("div",{className:"value",children:[o[r],t.jsx("div",{className:"remove",onClick:m=>{this.handleRemove(r),m.stopPropagation()}})]},r)):t.jsx("div",{className:"placeholder",children:d("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(c.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(i=>!a.includes(i.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}h(Ie,"defaultProps",{disabled:!1});class tt extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{draft:"",value:this.props.value});h(this,"handleChange",e=>{this.setState({draft:e.target.value})});h(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,i=s.trim();if(i!=="")if(a.includes(i))this.setState({draft:""});else{const o=[...a,i];this.setState({value:o,draft:""}),e(o)}});h(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===js||e.keyCode===we||e.keyCode===Ss)this.handleAdd();else if(e.keyCode===fs||e.keyCode===we){const{draft:s,value:a}=this.state,i=a[a.length-1];i&&s===""&&this.handleRemove(i)}});h(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(i=>i!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}render(){const{isDisabled:e}=this.props,{draft:s,value:a}=this.state;return t.jsx("div",{className:`Tags ${a.length>0?"":"blank"} ${e?"is-disabled":""}`.trim(),children:t.jsxs("div",{className:"values",children:[a.map(i=>t.jsxs("div",{className:"value",children:[i,t.jsx("div",{className:"remove",onClick:o=>{this.handleRemove(i),o.stopPropagation()}})]},i)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}h(tt,"defaultProps",{isDisabled:!1});let Ha=class extends b.PureComponent{constructor(){super(...arguments);h(this,"analytics",ve());h(this,"state",this.getInitialState());h(this,"thumbnailInput",b.createRef());h(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});h(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});h(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});h(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});h(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[Te]:e},isDirty:!0})});h(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});h(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});h(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});h(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});h(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});h(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});h(this,"handleChangeCategory",e=>{let s;re(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===x.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===de.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let i=[];s==="wearable"?i=[...a.filter(r=>!x.WearableCategory.schema.enum.includes(r)),...e]:i=[...a.filter(r=>!x.BodyPartCategory.schema.enum.includes(r)),...e];const o=this.setHides(this.state.data,i);this.setState({data:o,isDirty:this.isDirty({data:o})})});h(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleOnSaveItem",async()=>{var j;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:i,description:o,utility:r,rarity:m,contents:g,data:p,isDirty:_}=this.state;if(_&&e){let C=p;C&&!re(C)&&(C={...C,removesDefaultHiding:C.category===x.WearableCategory.UPPER_BODY||(j=C.hides)!=null&&j.includes(x.WearableCategory.UPPER_BODY)?[x.BodyPartCategory.HANDS]:[],..."blockVrmExport"in C?{blockVrmExport:C.blockVrmExport}:{},..."outlineCompatible"in C?{outlineCompatible:C.outlineCompatible}:{}});const S={...e.contents,...await ws(g)},I={...e,name:i,description:o,rarity:m,data:C,contents:S,utility:r??void 0};s&&[ye.UNPUBLISHED,ye.UNDER_REVIEW].includes(s)&&(I.video=S[Te]),a(I,g),Y(I.urn)&&this.analytics.track("Edit Item",{contents:g}),this.setState({isDirty:!1}),this.handleOnResetItem()}});h(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});h(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===T.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});h(this,"handleEmoteThumbnailChange",e=>{const s=Ts(e);this.setState({thumbnail:e,contents:{[Pe]:s},isDirty:!0})});h(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],i=await Ae(a),o=await Ae(a,1024,1024),r=URL.createObjectURL(i);this.setState({thumbnail:r,contents:{[Pe]:o},isDirty:!0})}});h(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;Ce(e)&&((a=s.replaces)!=null&&a.length)&&(s.hides=s.hides.concat(s.replaces),s.replaces=[]),this.setState({thumbnail:"",video:"",name:e.name,description:e.description,utility:e.utility||"",rarity:e.rarity,data:e.data,hasItem:!0,isDirty:!1})}getInitialState(){return{name:"",description:"",utility:"",thumbnail:"",video:"",rarity:void 0,contents:{},data:void 0,hasItem:!1,isDirty:!1}}setReplaces(e,s){return{...e,replaces:s,representations:e.representations.map(a=>({...a,overrideReplaces:s}))}}setHides(e,s){return{...e,hides:s,representations:e.representations.map(a=>({...a,overrideHides:s}))}}canEditItemMetadata(e){const{collection:s,canEditSelectedItem:a}=this.props;return!e||s&&Ne(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===x.WearableCategory.SKIN}isDirty(e={}){const{selectedItem:s}=this.props,{hasItem:a}=this.state;return a?this.hasStateItemChanged({...this.state,...e},s):!1}hasSavedItem(){const{selectedItem:e}=this.props,{isDirty:s}=this.state;return e&&!s&&this.hasStateItemChanged(this.state,e)}hasStateItemChanged(e,s){return e.name!==s.name||e.description!==s.description||e.utility!==s.utility||e.rarity!==s.rarity||!Ue(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:d(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:d(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:d(`emote.play_mode.${s}.text`),description:d(`emote.play_mode.${s}.description`)}))}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||re(a))return null;const i=ys(e.contents,a.category),o=Ps(e.contents),r=a.hides.filter(g=>i.includes(g)),m=a.hides.filter(g=>o.includes(g));return t.jsxs(t.Fragment,{children:[t.jsx(Ie,{itemId:e.id,label:d("item_editor.right_panel.base_body"),info:d("item_editor.right_panel.base_body_info"),value:m,options:this.asCategorySelect(e.type,o),disabled:!s,onChange:g=>this.handleChangeHides(g,"bodypart")}),t.jsx(Ie,{itemId:e.id,label:d("item_editor.right_panel.wearables"),info:d("item_editor.right_panel.wearables_info"),value:r,options:this.asCategorySelect(e.type,r.some(g=>g===x.WearableCategory.BODY_SHAPE)?i:i.filter(g=>g!==x.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:g=>this.handleChangeHides(g,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,i=this.canEditItemMetadata(e),o=s?t.jsx(c.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(O,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[i?t.jsxs(t.Fragment,{children:[t.jsx(O,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),o,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(ge,{item:e,src:a,hasBadge:!0,badgeSize:"small"}),t.jsxs("div",{className:"thumbnail-edit-container",children:[t.jsx("input",{type:"file",ref:this.thumbnailInput,onChange:this.handleThumbnailChange,accept:"image/png"}),t.jsx("div",{className:"thumbnail-edit-background"}),t.jsx(O,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[o,t.jsx(ge,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(As,{item:e})]})}renderVideoDetails(e){if(!Re(e))return null;const s=this.canEditItemMetadata(e),a=s?()=>this.handleOpenVideoDialog():()=>this.handleOpenVideoDialog({viewOnly:!0});return t.jsx("div",{className:"details",children:s?t.jsxs(t.Fragment,{children:[t.jsx(O,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(O,{name:"play",className:"play-video-button",onClick:a}),t.jsx(De,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Ns(e)&&t.jsx(O,{name:"play",className:"play-video-button",onClick:a}),t.jsx(De,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Rs,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:i,error:o,isCampaignEnabled:r,isVrmOptOutEnabled:m,campaignName:g,campaignTag:p}=this.props,{name:_,description:j,utility:C,rarity:S,data:I,isDirty:y,hasItem:f}=this.state,D=x.Rarity.getRarities(),M=Ds();return t.jsx("div",{className:"RightPanel",children:i?t.jsx(Qs,{id:e,children:(u,W,F)=>{var $;const le=W&&Ne(W),A=this.canEditItemMetadata(u),q=u?Ce(u)?Ms(u.contents):Ls():[];return F?t.jsx(c.Loader,{size:"massive",active:!0}):f||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:d("item_editor.right_panel.properties")}),u&&Qe(u,s)&&!u.isPublished&&!le?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(c.Dropdown.Menu,{children:[pe(u)!==null?t.jsx(c.Dropdown.Item,{text:d("item_detail_page.add_representation",{bodyShape:d(`body_shapes.${pe(u)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(Xe,{name:_,onDelete:this.handleDeleteItem,trigger:t.jsx(c.Dropdown.Item,{text:d("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(N,{label:d("item_editor.right_panel.details"),children:u?t.jsxs(t.Fragment,{children:[this.renderModelDetails(u),this.renderVideoDetails(u)]}):null}),t.jsx(N,{label:d("item_editor.right_panel.basics"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(Fa,{label:d("global.name"),value:_,disabled:!A,maxLength:Os,onChange:this.handleChangeName}),t.jsx(c.TextAreaField,{maxLength:ks,onChange:this.handleChangeDescription,label:d("global.description"),placeholder:d("item_editor.right_panel.description_placeholder"),disabled:!A,value:j,rows:"2",cols:"12"}),a?t.jsx(c.TextAreaField,{maxLength:Bs,onChange:this.handleChangeUtility,label:d("global.utility"),placeholder:d("item_editor.right_panel.utility_placeholder"),disabled:!A,value:C,tooltip:{content:d("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(ie,{itemId:u.id,label:d("global.category"),value:I.category,options:this.asCategorySelect(u.type,q),disabled:!A,onChange:this.handleChangeCategory}),!(u.urn&&Y(u.urn))&&t.jsx(ie,{itemId:u.id,label:d("global.rarity"),value:S,options:this.asRaritySelect(D),disabled:u.isPublished||!A,onChange:this.handleChangeRarity})]}):null}),(u==null?void 0:u.type)===T.WEARABLE&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.overrides")}),t.jsx(ne,{content:d("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(u)}),(u==null?void 0:u.type)===T.EMOTE&&t.jsx(N,{label:d("item_editor.right_panel.animation"),children:u?t.jsx(ie,{itemId:u.id,label:d("create_single_item_modal.play_mode_label"),value:I.loop?de.LOOP:de.SIMPLE,options:this.asPlayModeSelect(M),disabled:!A,onChange:this.handlePlayModeChange}):null}),u&&Re(u)&&(($=u.data.requiredPermissions)!=null&&$.length)?t.jsx(N,{label:d("item_editor.right_panel.required_permissions"),children:this.renderPermissions(u)}):null,t.jsx(N,{label:d("item_editor.right_panel.tags"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(tt,{itemId:u.id,value:I.tags,onChange:this.handleChangeTags,isDisabled:!A}),r&&g&&p&&A&&t.jsx("p",{className:"event-tag",children:d("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:p}),event_name:t.jsx("span",{children:g})})})]}):null}),(u==null?void 0:u.type)===T.WEARABLE&&m&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.copyright.title")}),t.jsx(ne,{content:d("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:d("item_editor.right_panel.copyright.vrm_export")}),t.jsx(c.Checkbox,{toggle:!0,label:I!=null&&I.blockVrmExport?d("item_editor.right_panel.copyright.disabled"):d("item_editor.right_panel.copyright.enabled"),checked:!(I!=null&&I.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":d("item_editor.right_panel.copyright.vrm_export")})]})})}),(u==null?void 0:u.type)===T.WEARABLE&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.outline_compatible.title")}),t.jsx(ne,{content:d("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:d("item_editor.right_panel.outline_compatible.title")}),t.jsx(c.Checkbox,{toggle:!0,label:(I==null?void 0:I.outlineCompatible)!==!1?d("item_editor.right_panel.copyright.enabled"):d("item_editor.right_panel.copyright.disabled"),checked:(I==null?void 0:I.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":d("item_editor.right_panel.outline_compatible.title")})]})})}),y?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(c.Button,{secondary:!0,onClick:this.handleOnResetItem,children:d("global.cancel")}),t.jsx(Me,{primary:!0,onClick:this.handleOnSaveItem,network:x.Network.MATIC,children:d("global.save")})]}):o&&e?t.jsxs("p",{className:"danger-text",children:[d("global.error_ocurred"),": ",o]}):null]})]}):null}}):null})}};const Va=n=>{var r;const l=Ee(n)||"",e=je(n,l),s=te(n)||"",a=l&&e&&e.collectionId?Le(n,e.collectionId):null,i=Ws(n),o=l?i[l]:null;return{address:s,collection:a,selectedItem:e,selectedItemId:l,canEditSelectedItem:e?a?Fe(n,s,a):Qe(e,s):!1,itemStatus:o,error:Fs(n),isConnected:be(n),isDownloading:Hs(n),isCommitteeMember:Oe(n),isCampaignEnabled:Vs(n),campaignTag:Gs(n),campaignName:(r=Zs(n))==null?void 0:r[Ks(n)],isVrmOptOutEnabled:$s(n),isWearableUtilityEnabled:Us(n)}},$a=n=>({onSaveItem:(l,e)=>n(Js(l,e)),onDeleteItem:l=>n(Ve(l)),onOpenModal:(l,e)=>n(He(l,e)),onDownload:l=>n(Ys(l))}),Ua=B(Va,$a)(Ha);class nn extends b.PureComponent{constructor(){super(...arguments);h(this,"state",{reviewedItems:[]});h(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(i=>i.id===a.id))]}))});h(this,"handleResetReviewedItems",()=>{this.setState({reviewedItems:[]})})}render(){const{reviewedItems:e}=this.state;return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"ItemEditorPage",children:[t.jsx(ma,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Da,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Wa,{}),t.jsx(Ua,{})]})]})})}}export{nn as default};
|
package/assets/index-BKIpBAR1.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as g,ae as n,a5 as a,a6 as i}from"./index-B3rcGd62.js";import{H as s}from"./Navigation.container-rGgC0rDy.js";import"./selectors-Cuqfofix.js";const e=o=>({isLoggedIn:n(o),isLoggingIn:a(o)||i(o)}),c=g(e)(s);export{c as default};
|
package/assets/index-C2ga5-3d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{af as b,Z as T,D as o,K as k,H as e,ah as C,M as s,aj as f,bl as w,G as l,N as D,hN as S,hL as L,O as y,bw as E,b3 as P,X as R,Y as M,Q as v,en as F}from"./index-B3rcGd62.js";import{N as H}from"./NotFound-CniT7gKH.js";const I=n=>{const{template:a,isLoading:t,scene:c,onOpenModal:i,onLoadTemplateScene:m}=n,u=T(),r=w(),d=o.useMemo(()=>({id:a==null?void 0:a.id,name:a==null?void 0:a.title,description:a==null?void 0:a.description}),[a]);o.useEffect(()=>{a&&!c&&m(a)},[a,c,m]);const x=()=>e.jsx(s.Center,{children:e.jsx(s.Loader,{active:!0,size:"large"})}),j=()=>e.jsx(H,{}),h=o.useCallback(()=>{r.track("Download Template",d),i("ExportModal",{project:a})},[r,a,d,i]),g=o.useCallback(()=>{u.push(k.templates())},[u]),_=o.useCallback(()=>{a&&(r.track("Select Template",d),i("CloneTemplateModal",{template:a}))},[r,a,d,i]),N=p=>e.jsxs(e.Fragment,{children:[e.jsx(s.Section,{size:"large",children:e.jsx(s.Row,{children:e.jsx(s.Column,{children:e.jsx(s.Row,{children:e.jsxs("div",{className:"title-container",children:[e.jsx(s.Button,{className:"back-button",basic:!0,icon:e.jsx(s.Icon,{name:"arrow alternate circle left outline"}),onClick:g,"aria-label":l("templates_page.back_to_scenes")}),e.jsx(s.Header,{className:"name",children:p.title})]})})})})}),e.jsx(s.Section,{children:e.jsx("div",{className:"header-image",style:{backgroundImage:`url(${p.thumbnail})`}})}),e.jsxs(s.Section,{children:[e.jsxs(s.Row,{className:"content info-container",children:[e.jsxs(s.Column,{className:"creator-container",children:[e.jsx(s.Header,{children:l("template_detail_page.creator")}),e.jsxs("p",{className:"description-content",children:[e.jsx(s.Logo,{})," Decentraland",e.jsx("br",{}),"Foundation"]})]}),e.jsxs(s.Column,{className:"description-container",children:[e.jsx(s.Header,{children:l("template_detail_page.description")}),e.jsx("p",{className:"description-content",children:p.description})]}),e.jsxs(s.Column,{className:"action-buttons-container",children:[e.jsx(s.Button,{primary:!0,className:"select-button",onClick:_,children:l("template_detail_page.select_template")}),e.jsx(s.Button,{inverted:!0,className:"download-button",onClick:h,children:l("template_detail_page.download_scene")})]})]}),e.jsx(s.Row,{className:"content",children:e.jsxs(s.Column,{className:"scene-details-container",children:[e.jsx(s.Header,{children:l("template_detail_page.scene_details")}),e.jsx("p",{className:"description-content world",children:l("template_detail_page.built_for_world")}),e.jsx("p",{className:"description-content size-scene",children:l("template_detail_page.parcels",{...p.layout})}),e.jsx("p",{className:"description-content personalize-content",children:l("template_detail_page.personalize_it_yourself")}),c&&e.jsx("p",{className:"description-content sdk",children:c!=null&&c.sdk6?"SDK 6":"SDK 7"})]})})]})]});return e.jsxs(e.Fragment,{children:[e.jsx(C,{}),e.jsxs(s.Page,{className:"TemplateDetailPage",isFullscreen:!0,children:[t&&!a?x():null,!t&&!a?j():null,a?N(a):null]}),e.jsx(f,{})]})},z=b.memo(I),O=n=>{const a=S(n),t=a&&L(n)[a],c=t?y(n)[t.sceneId]:null;return{template:t||null,scene:c,isLoading:E(P(n),F)}},B=n=>({onOpenModal:(a,t)=>n(R(a,t)),onLoadTemplateScene:a=>n(M(a,v.TEMPLATE))}),$=D(O,B)(z);export{$ as default};
|
package/assets/index-D43GeKXB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as _,D as c,K as d,H as s,ah as b,M as l,G as n,hK as h,J as x,aj as g,bl as k,N as v,hL as j,hM as C}from"./index-B3rcGd62.js";import{a as N,N as T}from"./Navigation.container-rGgC0rDy.js";import"./selectors-Cuqfofix.js";var o=(a=>(a.ACTIVE="active",a.COMING_SOON="coming_soon",a))(o||{});const E="_titleContainer_5ka3v_1",S="_backButton_5ka3v_8",y="_title_5ka3v_1",B="_templates_5ka3v_26",f="_subtitle_5ka3v_32",e={titleContainer:E,backButton:S,title:y,templates:B,subtitle:f},I=({templates:a,onLoadTemplates:r})=>{const u=k(),i=_();c.useEffect(()=>{r()},[r]);const p=c.useCallback(()=>{i.push(d.scenes())},[i]),m=c.useCallback(t=>{u.track("Go to template detail",{id:t.id,name:t.title,description:t.description}),i.push(d.templateDetail(t.id))},[u,i]);return s.jsxs(s.Fragment,{children:[s.jsx(b,{}),s.jsxs(l.Page,{isFullscreen:!0,className:"ScenesPage",children:[s.jsx(N,{activeTab:T.SCENES}),s.jsxs("div",{className:e.titleContainer,children:[s.jsx(l.Button,{className:e.backButton,basic:!0,icon:s.jsx(l.Icon,{name:"arrow alternate circle left outline"}),onClick:p,"aria-label":n("templates_page.back_to_scenes")}),s.jsx("h2",{className:e.title,children:n("templates_page.title")})]}),s.jsx("div",{className:e.templates,children:Object.values(a).map(t=>s.jsx(h,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:e.subtitle,children:[s.jsx(x,{name:"scene-parcel"}),n("templates_page.parcels",{size:t.layout.rows*t.layout.cols})]}),tag:t.templateStatus!==o.ACTIVE?{label:n("templates_page.coming_soon"),color:"#716B7C"}:void 0,disabled:t.templateStatus!==o.ACTIVE,onClick:m.bind(null,t)},t.id))})]}),s.jsx(g,{})]})},A=a=>({templates:j(a)}),G=a=>({onLoadTemplates:()=>a(C())}),F=v(A,G)(I);export{F as default};
|
package/assets/index-DSchuKch.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{af as ne,H as e,M as a,G as n,D as r,fp as X,fq as fe,eP as N,cf as Fe,b8 as Q,N as $,eR as Ne,fr as le,fs as Ue,X as R,ft as He,fu as ve,e_ as V,cC as ue,fv as me,e9 as ye,cD as We,bw as L,eD as Y,fw as Oe,eu as ze,fx as Ye,fd as Ee,bl as Ge,Z as ke,fy as G,fz as te,K as S,eS as Te,es as _e,fA as qe,fB as Qe,bu as ee,fC as Ve,f4 as Je,f5 as Ze,f0 as Pe,eU as Se,L as pe,fD as Ke,dD as Xe,eq as es,f8 as ss,fE as as,fF as q,fG as ts,f3 as ns,eE as he,fH as xe,aH as ls,cO as os,fI as Re,ep as is,fJ as rs,fK as cs,bv as ds,eY as f,fL as us,ev as ms,J as B,fM as be,a1 as se,fN as _s,f6 as ae,fO as ge,fP as ps,fc as hs,fQ as xs,fR as bs,fS as gs,fT as Cs,fU as js}from"./index-B3rcGd62.js";import{g as Is}from"./selector-CtnQnmhq.js";import{C as fs}from"./CollectionProvider.container-DLttDjYi.js";import{L as Ns}from"./LoggedInDetailPage.container-pu6zqzsR.js";import{N as vs}from"./NotFound-CniT7gKH.js";import{B as ys}from"./Back-BPa2M8SK.js";import{C as Es}from"./CollectionStatus.container-KkB73dPK.js";import{J as ks}from"./JumpIn.container-9o11sV9i.js";import{C as Ts}from"./ConfirmDelete-CL242pjc.js";import"./Navigation.container-rGgC0rDy.js";import"./selectors-Cuqfofix.js";import"./SignInRequired-CwTJZg2z.js";const Ps=({type:s})=>e.jsx(a.Popup,{content:n(s==="publish"?"collection_detail_page.cant_mint":"collection_detail_page.cant_push"),position:"top center",trigger:e.jsx("div",{className:"popup-button",children:e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("collection_detail_page.under_review")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:s==="publish"}),Ce=ne.memo(Ps),Ss=s=>{const{collection:l,items:o,status:t,hasPendingCuration:u,onPublish:d,onPush:_,onInit:j}=s;r.useEffect(()=>{l.isPublished&&j()},[l,j]);const b=o.length>X,v=r.useMemo(()=>o.length===0||!o.every(fe)||b,[o,b]);let g;if(l.isPublished)l.isApproved?u?g=e.jsx(Ce,{type:"push"}):t===N.UNSYNCED?g=e.jsx(a.Button,{primary:!0,compact:!0,onClick:_,children:n("collection_detail_page.push_changes")}):g=e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("global.published")}):g=e.jsx(Ce,{type:"publish"});else{const y=e.jsx(Fe,{disabled:v,primary:!0,compact:!0,onClick:d,network:Q.Network.MATIC,children:n("collection_detail_page.publish")});if(v){let p;o.length>X?p=n("collection_detail_page.publish_reason_max_items",{maxItems:X}):o.length===0?p=n("collection_detail_page.publish_reason_no_items"):p=n("collection_detail_page.publish_reason_items_not_complete"),g=e.jsx(a.Popup,{content:p,position:"top center",trigger:e.jsx("div",{className:"popup-button",children:y}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})}else g=y}return g},Rs=ne.memo(Ss),ws=(s,l)=>{const{id:o}=l.collection,t=Ne(s);return{items:le(s,o),status:t[o],hasPendingCuration:Ue(s,o)}},Ds=(s,l)=>{const{id:o}=l.collection;return{onPublish:()=>s(R("PublishWizardCollectionModal",{collectionId:o})),onPush:()=>s(R("PushCollectionChangesModal",{collectionId:o})),onInit:()=>s(He(o))}},je=$(ws,Ds)(Rs),Ms="_dropdown_1a07a_1",As="_ellipsis_1a07a_9",Bs="_menu_1a07a_13",Ls="_disabled_1a07a_13",$s="_item_1a07a_13",Ie={dropdown:Ms,ellipsis:As,menu:Bs,disabled:Ls,item:$s},Fs=({collection:s,wallet:l,onOpenModal:o,onDelete:t})=>{const u=()=>{o("ManageCollectionRoleModal",{type:me.MANAGER,collectionId:s.id,roles:s.managers})},d=()=>{o("ManageCollectionRoleModal",{type:me.MINTER,collectionId:s.id,roles:s.minters})},_=()=>{o("AddExistingItemModal",{collectionId:s.id})},j=()=>{t(s)},b=ve(s,l.address);return e.jsx(a.Dropdown,{className:Ie.dropdown,trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{className:Ie.ellipsis,name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(a.Dropdown.Menu,{children:[s.isPublished?b?e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.managers"),onClick:u}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.minters"),onClick:d})]}):null:V(s)?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.add_existing_item"),onClick:_}),e.jsx(Ts,{name:s.name,onDelete:j,trigger:e.jsx(a.Dropdown.Item,{text:n("global.delete")})})]}),e.jsx(ue,{role:"option",className:"item",text:s.urn,children:e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.copy_urn")})}),e.jsx(a.Popup,{content:n("collection_context_menu.unpublished"),position:"right center",disabled:s.isPublished,trigger:e.jsx(ue,{role:"option",className:"item",text:s.contractAddress,children:e.jsx(a.Dropdown.Item,{disabled:!s.isPublished,text:n("collection_context_menu.copy_address")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})]})})},Us=Fs,Hs=(s,l)=>({wallet:ye(s),items:le(s,l.collection.id),name:We(s)||"",isForumPostLoading:L(Y(s),Ye)}),Ws=s=>({onOpenModal:(l,o)=>s(R(l,o)),onPostToForum:(l,o)=>s(Oe(l,o)),onDelete:l=>s(ze(l))}),Os=$(Hs,Ws)(Us),zs=({isEnabled:s,onClick:l})=>s?e.jsx(a.Dropdown.Item,{text:n("collection_item.reset_item"),onClick:l}):null,Ys=ne.memo(zs),Gs=(s,l)=>{const{itemId:o}=l;return{isEnabled:Ee(s)[o]===N.UNSYNCED}},qs=(s,l)=>{const{itemId:o}=l;return{onClick:()=>s(R("ResetItemModal",{itemId:o}))}},Qs=$(Gs,qs)(Ys),Vs="_itemImage_10lcv_1",Js="_itemStatus_10lcv_9",Zs="_mana_10lcv_13",Ks="_grid_10lcv_19",Xs="_row_10lcv_30",ea="_avatarColumn_10lcv_35",sa="_avatarContainer_10lcv_40",aa="_info_10lcv_44",ta="_nameWrapper_10lcv_49",na="_badgeContainer_10lcv_54",la="_badge_10lcv_54",oa="_name_10lcv_49",ia="_linkAction_10lcv_76",ra="_subtitle_10lcv_80",ca="_itemActions_10lcv_86",da="_removeSaleButton_10lcv_93",ua="_status_10lcv_98",ma="_ready_10lcv_112",_a="_notReady_10lcv_117",pa="_incomplete_10lcv_122",ha="_published_10lcv_126",xa="_underReview_10lcv_131",ba="_unsynced_10lcv_132",ga="_alertIcon_10lcv_137",Ca="_check_10lcv_148",ja="_contextMenuButton_10lcv_152",Ia="_contextMenu_10lcv_152",i={itemImage:Vs,itemStatus:Js,mana:Zs,grid:Ks,row:Xs,avatarColumn:ea,avatarContainer:sa,info:aa,nameWrapper:ta,badgeContainer:na,badge:la,name:oa,linkAction:ia,subtitle:ra,itemActions:ca,removeSaleButton:da,status:ua,ready:ma,notReady:_a,incomplete:pa,published:ha,underReview:xa,unsynced:ba,alertIcon:ga,check:Ca,contextMenuButton:ja,contextMenu:Ia},fa=25;function Na({onOpenModal:s,onSetItems:l,onRemoveFromSale:o,item:t,isOffchainPublicItemOrdersEnabled:u,collection:d,status:_,ethAddress:j,wallet:b,loadingTradeIds:v,isCancellingItemOrder:g}){analytics=Ge();const y=ke(),p=b&&G(d,b),w=b&&u&&te(d,b),I=!u||w&&t.tradeId||p,E=r.useCallback(()=>{if(u&&w){s("PutForSaleOffchainModal",{itemId:t.id});return}s("EditPriceAndBeneficiaryModal",{itemId:t.id})},[t,s]),F=r.useCallback(()=>{s("SeeInWorldModal",{itemIds:[t.id]})},[s,t]),k=r.useCallback(()=>{l([t]),y.push(S.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:Te.COLLECTIONS}),analytics.track("Preview Item",{ITEM_ID:t!=null&&t.urn?_e(t.urn)?qe(t.urn):Qe(t.urn):null,ITEM_TYPE:t.type,ITEM_NAME:t.name,ITEM_IS_THIRD_PARTY:_e(t.urn)})},[t,l,y]),T=r.useCallback(()=>{s("DeleteItemModal",{item:t})},[t,s]),D=r.useCallback(()=>{s("MoveItemToAnotherCollectionModal",{item:t,fromCollection:d})},[t,s,d]),M=r.useCallback(()=>{s("PutForSaleOffchainModal",{itemId:t.id})},[]),U=r.useCallback(()=>{t.tradeId&&o(t.tradeId)},[t]),H=r.useCallback(()=>t.price?t.price===Ve.toString()||u&&!p&&!t.tradeId?e.jsx("span",{children:"-"}):Je(t)?e.jsx("span",{children:n("global.free")}):e.jsx(a.Mana,{className:i.mana,network:Q.Network.MATIC,showTooltip:!0,children:Ze(t.price)}):e.jsx("div",{className:`link ${i.linkAction}`,onClick:ee(E),children:n("collection_item.set_price")}),[t,p,u,E]),J=r.useCallback(()=>_===N.UNSYNCED?e.jsxs("div",{className:`${i.unsynced} ${i.status}`,children:[e.jsx("div",{className:i.alertIcon}),n("collection_item.unsynced")]}):_===N.UNDER_REVIEW||t.isPublished&&!t.isApproved?e.jsxs("div",{className:`${i.underReview} ${i.status}`,children:[e.jsx(a.Icon,{name:"clock outline"}),n("collection_item.under_review")]}):t.isPublished&&t.isApproved?e.jsxs("div",{className:`${i.published} ${i.status}`,children:[e.jsx(a.Icon,{name:"check circle outline"}),n("collection_item.published")]}):fe(t)?e.jsxs("div",{className:`${i.ready} ${i.status}`,children:[e.jsx(a.Icon,{className:i.check,name:"cloud upload"}),n("collection_item.ready")]}):!t.price||Pe(t)&&!(Se in t.contents)?e.jsxs("div",{className:`${i.notReady} ${i.status}`,children:[e.jsx(a.Icon,{name:"exclamation circle"}),n("collection_item.not_ready")]}):e.jsx("span",{onClick:ee(k),className:`link ${i.linkAction}`,children:n("collection_item.edit_item")}),[k,t,_]),P=r.useCallback(()=>e.jsx("div",{className:i.itemActions,children:e.jsx(a.Dropdown,{trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:i.action,onClick:ee(),children:e.jsxs(a.Dropdown.Menu,{className:i.contextMenu,children:[e.jsx(a.Dropdown.Item,{text:n("collection_item.see_details"),as:pe,to:S.itemDetail(t.id)}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.see_in_decentraland"),onClick:F}),e.jsx(a.Dropdown.Item,{text:n("collection_item.preview"),onClick:k}),!d.isPublished&&e.jsx(a.Dropdown.Item,{text:n("collection_item.move_to_another_collection"),onClick:D}),Ke(d,t,j)&&!V(d)?e.jsxs(e.Fragment,{children:[t.price&&I?e.jsx(a.Dropdown.Item,{text:n("collection_item.edit_price"),onClick:E}):null,e.jsx(Qs,{itemId:t.id}),t.isPublished?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Divider,{}),e.jsx(a.Dropdown.Item,{text:n("collection_item.delete_item"),onClick:T})]})]}):null]})})}),[d,t,j,F,k,D,E,T]),C=t.data;return e.jsxs(a.Table.Row,{className:`CollectionItem ${i.row}`,children:[e.jsx(a.Table.Cell,{className:`${i.avatarColumn}`,width:t.name.length>fa?6:5,children:e.jsx(pe,{to:S.itemDetail(t.id),className:"CollectionItem",children:e.jsxs("div",{className:i.avatarContainer,children:[e.jsx(Xe,{className:i.itemImage,item:t}),e.jsx("div",{className:i.info,children:e.jsx("div",{className:i.nameWrapper,children:e.jsxs("div",{className:i.name,title:t.name,children:[e.jsx(es,{className:i.itemStatus,item:t}),t.name,e.jsx("div",{className:i.badgeContainer,children:e.jsx(ss,{className:i.badge,item:t,size:"small"})})]})})})]})})}),e.jsx(a.Table.Cell,{className:i.column,children:t.rarity&&C.category?e.jsx(as,{size:"medium",rarity:t.rarity,withTooltip:!0}):null}),e.jsx(a.Table.Cell,{className:i.column,children:C.category?e.jsx("div",{children:n(`${t.type}.category.${C.category}`)}):null}),q(t)&&ts(C)?e.jsx(a.Table.Cell,{className:i.column,children:C.category?e.jsx("div",{children:n(`emote.play_mode.${C.loop?"loop":"simple"}.text`)}):null}):null,u&&!d.isPublished?null:e.jsx(a.Table.Cell,{className:i.column,children:H()}),t.isPublished&&t.isApproved?e.jsx(a.Table.Cell,{className:i.column,children:e.jsxs("div",{children:[t.totalSupply,"/",ns(t)]})}):null,e.jsx(a.Table.Cell,{children:J()}),u&&!p&&!t.tradeId&&t.isPublished&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{primary:!0,size:"tiny",disabled:!w,onClick:M,children:n("collection_item.put_for_sale")})}),u&&t.tradeId&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{secondary:!0,size:"tiny",className:i.removeSaleButton,onClick:U,loading:g&&v.includes(t.tradeId),children:n("collection_item.remove_from_sale")})}),e.jsx(a.Table.Cell,{className:i.contextMenuButton,children:P()})]})}const va=(s,l)=>{const o=Ee(s),t=he(s).filter(u=>u.type===xe).map(u=>u.payload.tradeId);return{ethAddress:ls(s),status:o[l.item.id],wallet:os(s),isOffchainPublicItemOrdersEnabled:Re(s),isCancellingItemOrder:L(he(s),xe),loadingTradeIds:t}},ya=s=>({onOpenModal:(l,o)=>s(R(l,o)),onDeleteItem:l=>s(is(l)),onSetItems:l=>s(rs(l)),onRemoveFromSale:l=>s(cs(l,!0))}),Ea=$(va,ya)(Na);function ka({collection:s,wallet:l,items:o,isOnSaleLoading:t,lastLocation:u,status:d,onOpenModal:_,isLoading:j,isOffchainPublicItemOrdersEnabled:b,onFetchCollectionForumPostReply:v}){const g=ds(),y=r.useMemo(()=>new URLSearchParams(g.search).get("tab"),[g]),[p,w]=r.useState(y||f.WEARABLE),I=ke(),E=u===S.collections(),F=r.useCallback(()=>{s&&s.isPublished&&!s.isApproved&&s.forumLink&&v(s.id)},[s,v]);r.useEffect(()=>{s&&F()},[s]);const k=r.useCallback(()=>{_("MintItemsModal",{collectionId:s.id})},[s,_]),T=r.useCallback(()=>{_("CreateSingleItemModal",{collectionId:s.id})},[s,_]),D=r.useCallback(()=>{s&&!s.isPublished&&_("EditCollectionNameModal",{collection:s})},[s,_]),M=r.useCallback(()=>{s&&_("SellCollectionModal",{collectionId:s.id,isOnSale:te(s,l)||G(s,l)})},[s,l,_]),U=r.useCallback(()=>{E?I.goBack():I.push(S.collections())},[I,E]),H=r.useCallback(()=>{s&&I.push(us(s,o),{fromParam:Te.COLLECTIONS})},[I,s,o]),J=r.useCallback((c,h="")=>{const m=window.open(c,h);m&&m.focus()},[]),P=r.useCallback(()=>{s&&s.isPublished&&s.forumLink&&J(s.forumLink,"_blank")},[s]),C=r.useCallback(c=>{w(c),I.push(S.collectionDetail(s.id,ms.STANDARD,{tab:p}))},[s,I]),Z=r.useCallback(c=>{const h=c===f.WEARABLE?n("collection_detail_page.wearables"):n("collection_detail_page.emotes");return e.jsx(a.Popup,{className:"modal-tooltip",content:n("collection_detail_page.missing_item_price",{item_type:h.toLowerCase()}),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})})},[]),oe=r.useCallback(()=>e.jsx(a.Popup,{className:"modal-tooltip",content:n("collection_detail_page.missing_smart_wearable_video"),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})}),[]),K=r.useCallback(c=>{if(!s)return null;const h=V(s),m=c.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(ks,{size:"small",active:!0,collection:s,text:n("global.see_in_decentraland"),disabled:h||!m}),e.jsxs(a.Button,{basic:!0,className:"action-button",disabled:h||!m,onClick:H,children:[e.jsx(B,{name:"cube"}),e.jsx("span",{className:"text",children:n("collection_detail_page.preview")})]}),m&&!s.isPublished?e.jsxs(a.Button,{basic:!0,className:"action-button add-items",disabled:h,onClick:T,children:[e.jsx(B,{name:"add-active"}),e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})]}):null]})},[s,H,T]),ie=r.useCallback(()=>{if(!s)return null;const c=G(s,l),h=te(s,l);return b&&!c?h?null:e.jsx(be,{network:Q.Network.MATIC,children:m=>e.jsxs(a.Button,{className:se("action-button",h?"secondary":"primary"),disabled:t||!m,onClick:M,children:[e.jsx(a.Icon,{name:"lock"}),e.jsx("span",{className:"text",children:n("collection_detail_page.enable_sales")})]})}):e.jsx(be,{network:Q.Network.MATIC,children:m=>e.jsx(a.Button,{className:se("action-button",c?"basic":"primary"),disabled:t||!m,onClick:M,children:e.jsx("span",{className:"text",children:c?n("collection_detail_page.remove_from_marketplace"):n("collection_detail_page.put_for_sale")})})})},[s,b,M]),W=r.useCallback((c="tiny")=>{if(s!=null&&s.forumPostReply){const{highest_post_number:h,last_read_post_number:m}=s.forumPostReply,O=h-(m??0);return e.jsx(a.Label,{className:"badge-forum-unread-posts",circular:!0,size:c,children:O})}return null},[s]),re=r.useCallback(()=>!(s!=null&&s.isApproved)||![N.UNSYNCED,N.UNDER_REVIEW].includes(d)?null:e.jsxs("div",{className:"unsynced-collection container",children:[e.jsx("i",{className:"unsynced-collection alert-icon"}),e.jsxs("div",{className:"unsynced-collection message",children:[e.jsx("h4",{className:"unsynced-collection title",children:n("collection_detail_page.unsynced_collection_title")}),e.jsx("p",{className:"unsynced-collection text",children:n(`collection_detail_page.${d}_collection_message`,{br:e.jsx("br",{})})})]}),d===N.UNDER_REVIEW?e.jsxs(a.Button,{primary:!0,onClick:P,className:"unsynced-collection action-button",children:[e.jsx("span",{children:n("collection_context_menu.forum_post")}),W("medium")]}):null,d===N.UNSYNCED?e.jsx(je,{collection:s}):null]}),[s,d,W,P]),we=r.useCallback(c=>{if(!s)return null;const h=_s(s,l.address),m=V(s),O=G(s,l),z=c.some(q),A=c.some(ae),De=z?c.some(x=>q(x)&&!x.price):!1,Me=A?c.some(x=>ae(x)&&!x.price):!1,Ae=A&&c.some(x=>Pe(x)&&!(Se in x.contents)),de=z&&!A,Be=A&&!z,Le=c.filter(x=>Be?ae(x):de?q(x):x.type===p),$e=z&&A;return e.jsxs(e.Fragment,{children:[e.jsx(a.Section,{className:se({"is-published":s.isPublished}),children:e.jsxs(a.Row,{children:[e.jsx(ys,{absolute:!0,onClick:U}),e.jsx(a.Narrow,{children:e.jsxs(a.Row,{children:[e.jsx(a.Column,{grow:!1,className:"name-container",children:m?e.jsxs(a.Header,{size:"huge",className:"name",children:[s.isPublished&&e.jsx(Es,{collection:s}),s.name]}):e.jsxs(a.Row,{className:"header-row",onClick:D,children:[e.jsx(a.Header,{size:"huge",className:"name",children:s.name}),e.jsx(B,{name:"edit",className:"edit-collection-name"}),O?e.jsx(a.Label,{className:"badge-on-sale",size:"small",circular:!0,children:n("collection_detail_page.on_sale")}):null]})}),e.jsx(a.Column,{align:"right",className:"actions-container",shrink:!1,grow:!1,children:e.jsxs(a.Row,{className:"actions",children:[s.isPublished&&s.isApproved?e.jsx(a.Popup,{content:n("collection_detail_page.can_mint"),className:"CollectionDetailPage popup-mint",position:"top center",trigger:e.jsx(a.Button,{basic:!0,className:"action-button",disabled:!h,onClick:k,children:e.jsx("span",{className:"text",children:n("collection_detail_page.mint_items")})}),on:"hover",inverted:!0,flowing:!0}):null,s.isPublished&&s.forumLink&&!s.isApproved?e.jsxs(e.Fragment,{children:[e.jsx(a.Button,{basic:!0,onClick:P,children:e.jsx("span",{children:n("collection_context_menu.forum_post")})}),s!=null&&s.forumPostReply?W():null]}):null,!(s.isPublished&&s.isApproved)&&d!==N.UNSYNCED?e.jsx(je,{collection:s}):null,ve(s,l.address)&&s.isPublished&&s.isApproved?ie():null,ge(s,l.address)?e.jsx(Os,{collection:s}):null]})})]})})]})}),e.jsxs(a.Narrow,{children:[re(),$e?e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsxs(a.Tabs.Tab,{active:p===f.WEARABLE,onClick:()=>C(f.WEARABLE),children:[e.jsx(B,{name:"wearable"}),n("collection_detail_page.wearables"),Me?Z(f.WEARABLE):Ae?oe():null]}),e.jsxs(a.Tabs.Tab,{active:p===f.EMOTE,onClick:()=>C(f.EMOTE),children:[e.jsx(B,{name:"emote"}),n("collection_detail_page.emotes"),De?Z(f.EMOTE):null]}),e.jsx("div",{className:"secondary-actions tab",children:K(c)})]}):e.jsx("div",{className:"secondary-actions",children:K(c)}),c.length>0?e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.item")}),e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.rarity")}),e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.category")}),p===f.EMOTE||de?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.play_mode")}):null,b&&!s.isPublished?null:e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.price")}),s.isPublished&&s.isApproved?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.supply")}):null,e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.status")}),b&&!O&&e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.actions")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:Le.map(x=>e.jsx(Ea,{collection:s,item:x},x.id))})]}):e.jsxs("div",{className:"empty",children:[e.jsx("div",{className:"sparkles"}),e.jsxs("div",{children:[e.jsx("span",{className:"empty-collection-title",children:n("collection_detail_page.add_items_title")}),e.jsx("br",{}),n("collection_detail_page.add_items_subtitle"),e.jsx("br",{}),n("collection_detail_page.cant_remove"),e.jsx("br",{}),e.jsx(a.Button,{basic:!0,className:"empty-action-button",disabled:m,onClick:T,children:e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})})]})]})]})]})},[p,d,l,s,T,K,D,Z,C,re,ie,C,P,oe,W,k,U]),ce=l!==null&&s!==null&&ge(s,l.address);return e.jsx(fs,{id:s==null?void 0:s.id,itemsPage:1,itemsPageSize:5e3,children:({isLoadingCollection:c,isLoadingCollectionItems:h,items:m})=>e.jsx(Ns,{className:"CollectionDetailPage",hasNavigation:!ce&&!j&&!c,isLoading:j||c||h,children:ce?we(m):e.jsx(vs,{})})})}const Ta=s=>{const l=ps(s)||"",o=hs(s,l),t=Ne(s);return{wallet:ye(s),collection:o,isOnSaleLoading:xs(s)||L(Y(s),gs),items:le(s,l),status:t[l],isLoading:L(Y(s),Cs)||L(Y(s),js),lastLocation:Is(s),isOffchainPublicItemOrdersEnabled:Re(s)}},Pa=s=>({onOpenModal:(l,o)=>s(R(l,o)),onFetchCollectionForumPostReply:l=>s(bs(l))}),Oa=$(Ta,Pa)(ka);export{Oa as default};
|
package/assets/index-hLX2OJxJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{al as o}from"./index-B3rcGd62.js";export{o as default};
|