@dcl/builder-site 7.14.0 → 7.14.1

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.
Files changed (81) hide show
  1. package/assets/{Back-DdrQYZHm.js → Back-DAlD0UQy.js} +1 -1
  2. package/assets/{CollectionProvider.container-B3EqRy6H.js → CollectionProvider.container-B-xYoRRV.js} +1 -1
  3. package/assets/{CollectionStatus.container-CkFaF83s.js → CollectionStatus.container-dnoQ-PBl.js} +1 -1
  4. package/assets/{ConfirmDelete-CIPVWRhm.js → ConfirmDelete-pyR29k-n.js} +1 -1
  5. package/assets/{FileSaver.min-BUXQLdA8.js → FileSaver.min-BPydVSEp.js} +1 -1
  6. package/assets/{ItemProvider.container-DUp3V4pS.js → ItemProvider.container-D6oTclNC.js} +1 -1
  7. package/assets/{JumpIn.container-CQcApBEz.js → JumpIn.container-Dg6l-_Dx.js} +1 -1
  8. package/assets/{LandAction-BOHyksXY.js → LandAction-DUGZsV7N.js} +1 -1
  9. package/assets/{LandProviderPage-DrDHCi9R.js → LandProviderPage-CmCxrqKX.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-LEYRvHbQ.js → LoggedInDetailPage.container-CwXT8qId.js} +1 -1
  11. package/assets/{Navigation-BJjThZP2.css → Navigation-D4aL3PdE.css} +1 -1
  12. package/assets/{Navigation.container-CIMAkapp.js → Navigation.container-D4sN5Upx.js} +1 -1
  13. package/assets/{NotFound-DrpmeGv3.js → NotFound-Bk5qRB9N.js} +1 -1
  14. package/assets/{OptionsDropdown-C4O0yHi5.js → OptionsDropdown-CtGKnXfQ.js} +1 -1
  15. package/assets/{RentalPeriod-Bz1zIDPl.js → RentalPeriod-BFyaHbFw.js} +1 -1
  16. package/assets/{SDKTag-5uWYnT_n.js → SDKTag-DW_kGcaB.js} +1 -1
  17. package/assets/{SceneStats.container-NYmtW2Rj.js → SceneStats.container-D2jYTSCd.js} +1 -1
  18. package/assets/{SignInRequired-DQqcQoDx.js → SignInRequired-w49yYUTd.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-Dyc5j-Tc.js → ThirdPartyKindBadge-DFbThHc_.js} +1 -1
  20. package/assets/{dataReader-Cg2dXqmR.js → dataReader-BD2kzIzc.js} +1 -1
  21. package/assets/{date-Aqvlz9Fv.js → date-BcLXAVqg.js} +1 -1
  22. package/assets/{fortmatic-BcJM8F3v.js → fortmatic-BNX-4QKp.js} +1 -1
  23. package/assets/{hooks-Bu702gkG.js → hooks-Dztqgq6I.js} +1 -1
  24. package/assets/{index-DVK3wxXt.js → index-0pOqfwNU.js} +1 -1
  25. package/assets/{index-DjpECOwh.js → index-272VX2Aj.js} +1 -1
  26. package/assets/{index-0fvjVqzt.js → index-4ph2iI1o.js} +1 -1
  27. package/assets/{index-BEQiD9aM.js → index-9qkWRZbK.js} +1 -1
  28. package/assets/{index-Bc1VIWb2.js → index-B7eGGiUI.js} +1 -1
  29. package/assets/{index-DhvbfEOn.js → index-BD1wfKSp.js} +1 -1
  30. package/assets/{index-BGmdA2YB.js → index-BFVINM5F.js} +1 -1
  31. package/assets/{index-BHm38DIU.js → index-BKD_VB1P.js} +1 -1
  32. package/assets/{index-BYCJbFwm.js → index-BM6MmnEC.js} +1 -1
  33. package/assets/index-BUUPb0PO.js +1 -0
  34. package/assets/index-BWc2090G.js +1 -0
  35. package/assets/{index-Cng0BNEt.js → index-BY_dzxp6.js} +1 -1
  36. package/assets/{index-BtS_uooz.js → index-Be_u2Lli.js} +1 -1
  37. package/assets/{index-CgCShAAn.js → index-Bg8w7n_O.js} +1 -1
  38. package/assets/index-C-6x5U77.js +1 -0
  39. package/assets/{index-D1fsogft.js → index-CDJ3JC07.js} +1 -1
  40. package/assets/{index-BYC9OOfH.js → index-CDuku4oM.js} +1 -1
  41. package/assets/index-CGvQf7ut.js +1 -0
  42. package/assets/{index-DC5SJfKU.js → index-CNniOl7U.js} +1 -1
  43. package/assets/index-CTIVE-8D.js +1 -0
  44. package/assets/{index-1p5f88Bz.css → index-CTcnGnfn.css} +1 -1
  45. package/assets/{index-BM1b2sar.js → index-CWz7M-by.js} +1 -1
  46. package/assets/{index-DuaVR46A.css → index-Cb-GXhI7.css} +1 -1
  47. package/assets/{index-7YdhTpCB.css → index-Cd8nMwWs.css} +7 -7
  48. package/assets/{index-DrIMnKGo.css → index-CdthpnyC.css} +1 -1
  49. package/assets/{index-DAUouqh3.js → index-CiLweXel.js} +1 -1
  50. package/assets/{index-CkSryNnZ.js → index-Cn0gYWun.js} +1 -1
  51. package/assets/{index-BCO0yRvv.js → index-CzYOH32k.js} +1 -1
  52. package/assets/{index-VAY3iC6l.js → index-D-dwogAG.js} +1 -1
  53. package/assets/{index-CeuDfIgt.js → index-D4PxKtja.js} +1 -1
  54. package/assets/{index-BvYxzapl.js → index-D734GgwD.js} +1 -1
  55. package/assets/{index-DA49NSx7.css → index-DAoqnW-g.css} +1 -1
  56. package/assets/{index-CWIKnSU0.js → index-DG80-2we.js} +1 -1
  57. package/assets/{index-BqpUqlRm.js → index-DJbJem6H.js} +1 -1
  58. package/assets/{index-BvI8z-v6.js → index-DLTPqqPa.js} +2 -2
  59. package/assets/{index-DQDxW6Dn.js → index-DMXjITBg.js} +1 -1
  60. package/assets/{index-DyG3aqtf.css → index-DUo_ody6.css} +1 -1
  61. package/assets/{index-Cx5fFlON.js → index-DY2D8C6Z.js} +1 -1
  62. package/assets/{index-Cm1r59BA.js → index-Dft7gbj1.js} +1 -1
  63. package/assets/{index-CsfTlEQd.js → index-DgGOn8N1.js} +1 -1
  64. package/assets/{index-fCe6hggC.js → index-DlrNy4Vp.js} +1 -1
  65. package/assets/{index-BNFu-i2F.css → index-Dt4gftk-.css} +1 -1
  66. package/assets/{index-C9n59z3d.js → index-Hs9eFEfI.js} +1 -1
  67. package/assets/{index-xPVHmRXJ.js → index-QCbL_5mL.js} +1 -1
  68. package/assets/{index-B0M-djtI.js → index-R2Wjg1N9.js} +209 -242
  69. package/assets/{index-B4JcgCQz.js → index-WAhdFRkW.js} +1 -1
  70. package/assets/{index-C2nuT1Xc.js → index-Z205OA6y.js} +1 -1
  71. package/assets/{index-vMUrLvJs.js → index-_gTdU4l5.js} +1 -1
  72. package/assets/{index-CQcjrCIK.js → index-xFOM4EW9.js} +1 -1
  73. package/assets/{index.es-DqYAlq3I.js → index.es-oNC4elgz.js} +4 -4
  74. package/assets/{selectors-CJiu0Ou1.js → selectors-BKk0tQag.js} +1 -1
  75. package/index.html +3 -3
  76. package/package.json +3 -3
  77. package/assets/index-BiKnF0Cg.js +0 -1
  78. package/assets/index-BjT_yxd3.js +0 -1
  79. package/assets/index-BrMG0_BD.js +0 -1
  80. package/assets/index-C0MWGw3i.js +0 -1
  81. package/assets/index-CHJhfxEx.js +0 -1
@@ -0,0 +1 @@
1
+ var X=Object.defineProperty;var Y=(r,a,n)=>a in r?X(r,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[a]=n;var P=(r,a,n)=>Y(r,typeof a!="symbol"?a+"":a,n);import{D as c,H as e,J as Z,Z as J,K as D,ev as V,eV as A,eW as w,eX as f,eS as q,eY as $,eZ as ee,e_ as S,e$ as se,f0 as ae,f1 as te,M as i,G as t,dH as ie,f2 as le,f3 as T,f4 as ne,f5 as ce,f6 as re,L as oe,eu as de,cH as ue,f7 as me,f8 as z,bF as he,f9 as xe,cG as pe,fa as je,fb as ge,fc as ve,fd as Ne,a4 as be,a5 as g,ed as Ie,fe,ff as _e,fg as Ce,eH as ye,fh as Ee,bD as M,fi as ke,fj as Se,es as Te,X as Pe,eQ as De,fk as we,fl as Me}from"./index-R2Wjg1N9.js";import{d as Le}from"./hooks-Dztqgq6I.js";import{I as Re}from"./ItemProvider.container-D6oTclNC.js";import{C as Be}from"./ConfirmDelete-pyR29k-n.js";import{L as Ue}from"./LoggedInDetailPage.container-CwXT8qId.js";import{N as Oe}from"./NotFound-Bk5qRB9N.js";import{B as He}from"./Back-DAlD0UQy.js";import"./Navigation.container-D4sN5Upx.js";import"./selectors-BKk0tQag.js";import"./SignInRequired-w49yYUTd.js";class Fe extends c.PureComponent{constructor(n){super(n);P(this,"state",{isNoticeClosed:!1});P(this,"handleCloseNotice",()=>{const{storageKey:n}=this.props;this.setState({isNoticeClosed:!0}),localStorage.setItem(n,"1")});const{storageKey:o}=n;this.state={isNoticeClosed:localStorage.getItem(o)!==null}}render(){const{children:n}=this.props,{isNoticeClosed:o}=this.state;return o?null:e.jsxs("div",{className:"Notice",children:[e.jsx("div",{className:"text",children:n}),e.jsx(Z,{name:"close",onClick:this.handleCloseNotice})]})}}const Ve="dcl-item-notice";function Ae(r){const{item:a,itemId:n,isLoading:o,status:v,collection:_,hasAccess:N,isWearableUtilityEnabled:C,onDelete:y,onSaveItem:x,onOpenModal:u}=r,j=c.useRef(null),b=J(),I=c.useCallback(()=>{a&&b.push(D.itemEditor({itemId:a.id,collectionId:a.collectionId}),{fromParam:V(a.urn)?A.TP_COLLECTIONS:A.COLLECTIONS})},[b,a]),d=c.useCallback(async s=>{const l=await w({[f]:s}),h={...a,contents:{...a==null?void 0:a.contents,[f]:l[f]}};v&&[q.UNPUBLISHED,q.UNDER_REVIEW].includes(v)&&(h.video=l[f]),x(h,{[f]:s})},[x,a,v]),p=c.useCallback(()=>{u("EditVideoModal",{item:a,onSaveVideo:d})},[a,u,d]),L=c.useCallback(()=>{y(a)},[a,y]),E=c.useCallback(()=>{a&&$(a)?u("CreateSingleItemModal",{item:a,addRepresentation:!0}):u("CreateSingleItemModal",{item:a,changeItemFile:!0})},[u,a]),R=c.useCallback(()=>{u("EditItemURNModal",{item:a})},[a,u]),B=c.useCallback(async s=>{const l=ee(s);x({...a,contents:{...a==null?void 0:a.contents,...await w({[S]:l})}},{[S]:l})},[x,a]),U=c.useCallback(()=>{(a==null?void 0:a.type)===se.EMOTE?u("EditThumbnailModal",{onSaveThumbnail:B,item:a,collection:_}):j.current&&j.current.click()},[j.current,_,a,u,B]),O=c.useCallback(async s=>{const{files:l}=s.target;if(l&&l.length>0){const h=l[0],k=await ae(h,1024,1024);k&&a&&(a.contents={...a.contents,...await w({[S]:k})},x(a,{[S]:k}))}},[x,a]),H=c.useCallback(()=>{u("MoveItemToCollectionModal",{item:a})},[a,u]),W=c.useCallback((s,l)=>{var F;const h=s.data,K=!(l&&te(l));return e.jsxs(e.Fragment,{children:[e.jsx(i.Section,{children:e.jsx(i.Row,{children:e.jsx(He,{onClick:()=>b.push(D.collectionDetail(s.collectionId))})})}),e.jsxs(i.Narrow,{children:[!l&&!s.collectionId?e.jsx(Fe,{storageKey:Ve,children:t("item_detail_page.notice")}):null,e.jsxs("div",{className:"item-data",children:[e.jsxs("div",{className:"item-data-left-panel",children:[e.jsx(ie,{item:s,hasBadge:!0,hasRarityBadge:!0,hasUtilityBadge:!0}),e.jsx("div",{children:e.jsxs(i.Button,{primary:!0,onClick:U,children:[e.jsx("input",{type:"file",ref:j,onChange:O,accept:"image/png"}),e.jsx(i.Icon,{name:"camera"}),t("item_detail_page.edit_thumbnail")]})}),e.jsxs("div",{className:"metrics",children:[e.jsx("span",{className:"subtitle",children:t("item_detail_page.properties")}),e.jsx(le,{item:s})]}),T(s)?e.jsx(ne,{item:s,onClick:p,children:(m,G,Q,$e)=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overlay",children:e.jsx(i.Icon,{name:"play",className:"play-video-button",onClick:p})}),e.jsxs(i.Button,{primary:!0,onClick:p,children:[e.jsx(i.Icon,{name:"video"}),t("item_detail_page.edit_video")]}),e.jsxs("div",{className:"metrics",children:[e.jsx("div",{className:"subtitle",children:t("item_detail_page.properties")}),e.jsx(ce,{duration:G,size:Q,showIcons:!1})]})]})}):null,e.jsxs("div",{className:"details",children:[e.jsx("div",{className:"subtitle",children:t("item_detail_page.details")}),s.isPublished&&e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:t("item_detail_page.details_info.id")}),e.jsxs("div",{className:"value",children:["#",s.tokenId]})]}),h.category?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:t("item.category")}),e.jsx("div",{className:"value",children:t(`${s.type}.category.${h.category}`)})]}):null,s.isPublished&&s.rarity?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:t("item.supply")}),e.jsxs("div",{className:"value",children:[s.totalSupply,"/",re(s)]})]}):null,l?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:t("item.collection")}),e.jsx(oe,{className:"collection-link",to:D.collectionDetail(l.id,de(l)),children:l.name})]}):null,s.urn?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:t("global.urn")}),e.jsxs("div",{className:"value urn",children:[e.jsxs("span",{children:[s.urn,e.jsx(ue,{role:"button",text:s.urn,children:e.jsx(i.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:"link copy",name:"copy outline"})})]}),e.jsx("div",{className:"urn-actions",children:V(s.urn)?e.jsx(i.Popup,{content:t("collection_item.cannot_edit_urn"),disabled:!s.isPublished,position:"top center",trigger:e.jsx("div",{children:e.jsx("button",{disabled:s.isPublished,className:"link",onClick:R,children:t("item.edit_urn")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):null})]})]}):null]})]}),e.jsxs("div",{className:"cards-container",children:[e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:s.name}),e.jsxs("div",{className:"actions",children:[T(s)&&e.jsx(i.Button,{className:"edit",inverted:!0,size:"small",onClick:E,children:t("global.edit")}),e.jsx(i.Button,{inverted:!0,size:"small",onClick:I,children:t("collection_detail_page.preview")}),K?e.jsx(i.Dropdown,{trigger:e.jsx(i.Button,{basic:!0,className:"more-actions-button",children:e.jsx(i.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(i.Dropdown.Menu,{children:[e.jsx(Be,{name:s.name,onDelete:L,trigger:s.isPublished?e.jsx(i.Popup,{content:t("item_detail_page.delete_published_item"),position:"right center",trigger:e.jsx(i.Dropdown.Item,{disabled:!0,text:t("global.delete")}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):e.jsx(i.Dropdown.Item,{text:t("global.delete")})}),!s.collectionId&&e.jsx(i.Dropdown.Item,{text:t("collection_item.move_to_another_collection"),onClick:H})]})}):null]})]}),e.jsxs("div",{className:"attribute-row",children:[s.description&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:t("global.description")}),e.jsx("div",{className:"data",children:s.description})]}),s.utility&&C&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:t("global.utility")}),e.jsx("div",{className:"data",children:s.utility})]})]}),s.data.tags.length?e.jsx("div",{className:"attribute-row",children:e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:t("item_detail_page.tags.title")}),e.jsx("div",{className:"data tags-container",children:s.data.tags.map(m=>e.jsx("span",{className:"tag",children:m},m))})]})}):null]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"title",children:t("item_detail_page.selling.title")}),e.jsxs("div",{className:"data",children:[me(s)?e.jsxs(i.Section,{className:"price-container",children:[e.jsx("div",{className:"subtitle",children:t("item.price")}),e.jsx("div",{className:"value",children:t("global.free")})]}):s.price?e.jsxs(i.Section,{className:"price-container",children:[e.jsx("div",{className:"subtitle",children:t("item.price")}),s.price&&s.price!==z.toString()?e.jsx(i.Mana,{showTooltip:!0,network:he.Network.MATIC,className:"mana-price-container",children:(()=>{const m=xe(s.price);return m.length>10?e.jsx(i.Popup,{content:m,position:"top center",trigger:e.jsx("span",{children:`${m.slice(0,3)}...${m.slice(-4)}`}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):e.jsx("div",{className:"value",children:m})})()}):s.price===z.toString()?e.jsx("div",{className:"value",children:t("item.not_for_sale")}):"-"]}):null,e.jsxs(i.Section,{className:"beneficiary-container",children:[e.jsx("div",{className:"subtitle",children:t("item.beneficiary")}),s.beneficiary?e.jsx("div",{className:"value",children:pe(s.beneficiary)}):"-"]})]})]}),je(s)&&!T(s)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:t("item_detail_page.representations.title")}),e.jsx(i.Button,{className:"edit-button",inverted:!0,size:"small",onClick:E,children:$(s)?t("global.add"):t("global.edit")})]}),e.jsx("div",{className:"data",children:e.jsx("div",{className:"representations-container",children:s.data.representations.map(m=>e.jsxs("div",{className:"representation",children:[e.jsx("img",{className:"item-image",src:ge(s),alt:s.name}),m.mainFile,e.jsx(ve,{item:s,bodyShape:m.bodyShapes[0]})]},m.mainFile))})})]}):null,T(s)&&((F=s.data.requiredPermissions)!=null&&F.length)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:t("item_detail_page.required_permissions")}),e.jsx(i.Button,{inverted:!0,className:"learn-more-permissions",size:"small",href:"https://docs.decentraland.org/creator/development-guide/sdk7/scene-metadata/#required-permissions",rel:"noopener noreferrer",target:"_blank",content:t("global.learn_more")})]}),e.jsx("div",{className:"data",children:e.jsx(Ne,{requiredPermissions:s.data.requiredPermissions,basic:!0})})]}):null]})]})]})]})},[C,b,j,U,O,p,R,E,E,H,I,L,I]);return e.jsx(Re,{id:n,children:(s,l,h)=>e.jsx(Ue,{className:"ItemDetailPage",hasNavigation:!N&&!o,isLoading:o||h,children:N&&s?W(s,l):e.jsx(Oe,{})})})}const qe=()=>{const r=be(),a=Le(),n=g(Ie),o=g(d=>a?fe(d,a):null),v=g(d=>o&&o.collectionId?_e(d,o.collectionId):null),_=g(Ce),N=g(ye),C=g(Ee),y=o?_[o.id]:null,x=M(N,De)||M(N,we)||M(N,Me),u=g(d=>o!==null&&ke(d,n.address,v,o)),j=c.useCallback((d,p)=>r(Se(d,p)),[r]),b=c.useCallback(d=>r(Te(d)),[r]),I=c.useCallback((d,p)=>r(Pe(d,p)),[r]);return e.jsx(Ae,{itemId:a,wallet:n,item:o,collection:v,status:y,isLoading:x,isWearableUtilityEnabled:C,hasAccess:u,onSaveItem:j,onDelete:b,onOpenModal:I})},as=qe;export{as as default};
@@ -1 +1 @@
1
- import{ae as ne,H as e,M as a,G as n,D as r,fr as X,fs as Ie,eR as k,cj as $e,b4 as Q,N as J,eT as fe,ft as le,fu as Fe,X as A,fv as Ue,fw as Ne,f0 as V,cG as de,fx as ue,ec as ve,cH as We,bD as W,fy as He,eF as ye,fz as Oe,ew as Ge,ff as ke,bi as ze,Z as Ee,fA as Y,fB as te,K as D,eU as Te,eu as me,fC as Ye,fD as qe,bC as ee,f7 as Qe,f6 as Ve,f8 as Je,f2 as Pe,eW as Se,L as _e,fE as Ze,dG as Ke,es as Xe,fb as es,fF as ss,fG as q,fH as as,f5 as ts,eG as pe,fI as he,aG as ns,cR as ls,fJ as os,er as is,fK as rs,fL as cs,aM as ds,e_ as y,fM as us,ex as ms,J as U,fN as xe,a1 as se,fO as _s,f9 as ae,fP as be,a4 as ps,a5 as S,fe as hs,fQ as xs,fR as bs,fS as gs,fT as Cs,fU as js}from"./index-B0M-djtI.js";import{e as Is}from"./hooks-Bu702gkG.js";import{g as fs}from"./selector-CtnQnmhq.js";import{C as Ns}from"./CollectionProvider.container-B3EqRy6H.js";import{L as vs}from"./LoggedInDetailPage.container-LEYRvHbQ.js";import{N as ys}from"./NotFound-DrpmeGv3.js";import{B as ks}from"./Back-DdrQYZHm.js";import{C as Es}from"./CollectionStatus.container-CkFaF83s.js";import{J as Ts}from"./JumpIn.container-CQcApBEz.js";import{C as Ps}from"./ConfirmDelete-CIPVWRhm.js";import"./Navigation.container-CIMAkapp.js";import"./selectors-CJiu0Ou1.js";import"./SignInRequired-DQqcQoDx.js";const Ss=({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"}),ge=ne.memo(Ss),Rs=s=>{const{collection:l,items:o,status:t,hasPendingCuration:m,onPublish:d,onPush:u,onInit:I}=s;r.useEffect(()=>{l.isPublished&&I()},[l,I]);const b=o.length>X,N=r.useMemo(()=>o.length===0||!o.every(Ie)||b,[o,b]);let j;if(l.isPublished)l.isApproved?m?j=e.jsx(ge,{type:"push"}):t===k.UNSYNCED?j=e.jsx(a.Button,{primary:!0,compact:!0,onClick:u,children:n("collection_detail_page.push_changes")}):j=e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("global.published")}):j=e.jsx(ge,{type:"publish"});else{const h=e.jsx($e,{disabled:N,primary:!0,compact:!0,onClick:d,network:Q.Network.MATIC,children:n("collection_detail_page.publish")});if(N){let f;o.length>X?f=n("collection_detail_page.publish_reason_max_items",{maxItems:X}):o.length===0?f=n("collection_detail_page.publish_reason_no_items"):f=n("collection_detail_page.publish_reason_items_not_complete"),j=e.jsx(a.Popup,{content:f,position:"top center",trigger:e.jsx("div",{className:"popup-button",children:h}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})}else j=h}return j},ws=ne.memo(Rs),Ms=(s,l)=>{const{id:o}=l.collection,t=fe(s);return{items:le(s,o),status:t[o],hasPendingCuration:Fe(s,o)}},Ds=(s,l)=>{const{id:o}=l.collection;return{onPublish:()=>s(A("PublishWizardCollectionModal",{collectionId:o})),onPush:()=>s(A("PushCollectionChangesModal",{collectionId:o})),onInit:()=>s(Ue(o))}},Ce=J(Ms,Ds)(ws),As="_dropdown_1a07a_1",Bs="_ellipsis_1a07a_9",Ls="_menu_1a07a_13",$s="_disabled_1a07a_13",Fs="_item_1a07a_13",je={dropdown:As,ellipsis:Bs,menu:Ls,disabled:$s,item:Fs},Us=({collection:s,wallet:l,onOpenModal:o,onDelete:t})=>{const m=()=>{o("ManageCollectionRoleModal",{type:ue.MANAGER,collectionId:s.id,roles:s.managers})},d=()=>{o("ManageCollectionRoleModal",{type:ue.MINTER,collectionId:s.id,roles:s.minters})},u=()=>{o("AddExistingItemModal",{collectionId:s.id})},I=()=>{t(s)},b=Ne(s,l.address);return e.jsx(a.Dropdown,{className:je.dropdown,trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{className:je.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:m}),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:u}),e.jsx(Ps,{name:s.name,onDelete:I,trigger:e.jsx(a.Dropdown.Item,{text:n("global.delete")})})]}),e.jsx(de,{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(de,{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})]})})},Ws=(s,l)=>({wallet:ve(s),items:le(s,l.collection.id),name:We(s)||"",isForumPostLoading:W(ye(s),He)}),Hs=s=>({onOpenModal:(l,o)=>s(A(l,o)),onPostToForum:(l,o)=>s(Oe(l,o)),onDelete:l=>s(Ge(l))}),Os=J(Ws,Hs)(Us),Gs=({isEnabled:s,onClick:l})=>s?e.jsx(a.Dropdown.Item,{text:n("collection_item.reset_item"),onClick:l}):null,zs=ne.memo(Gs),Ys=(s,l)=>{const{itemId:o}=l;return{isEnabled:ke(s)[o]===k.UNSYNCED}},qs=(s,l)=>{const{itemId:o}=l;return{onClick:()=>s(A("ResetItemModal",{itemId:o}))}},Qs=J(Ys,qs)(zs),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:m,collection:d,status:u,ethAddress:I,wallet:b,loadingTradeIds:N,isCancellingItemOrder:j}){const h=ze(),f=Ee(),g=b&&Y(d,b),C=b&&m&&te(d,b),B=!m||C&&t.tradeId||g,E=r.useCallback(()=>{if(m&&C){s("PutForSaleOffchainModal",{itemId:t.id});return}s("EditPriceAndBeneficiaryModal",{itemId:t.id})},[t,s]),T=r.useCallback(()=>{s("SeeInWorldModal",{itemIds:[t.id]})},[s,t]),P=r.useCallback(()=>{l([t]),f.push(D.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:Te.COLLECTIONS}),h==null||h.track("Preview Item",{ITEM_ID:t!=null&&t.urn?me(t.urn)?Ye(t.urn):qe(t.urn):null,ITEM_TYPE:t.type,ITEM_NAME:t.name,ITEM_IS_THIRD_PARTY:me(t.urn)})},[t,l,f]),R=r.useCallback(()=>{s("DeleteItemModal",{item:t})},[t,s]),L=r.useCallback(()=>{s("MoveItemToAnotherCollectionModal",{item:t,fromCollection:d})},[t,s,d]),H=r.useCallback(()=>{s("PutForSaleOffchainModal",{itemId:t.id})},[]),Z=r.useCallback(()=>{t.tradeId&&o(t.tradeId)},[t]),w=r.useCallback(()=>t.price?t.price===Qe.toString()||m&&!g&&!t.tradeId?e.jsx("span",{children:"-"}):Ve(t)?e.jsx("span",{children:n("global.free")}):e.jsx(a.Mana,{className:i.mana,network:Q.Network.MATIC,showTooltip:!0,children:Je(t.price)}):e.jsx("div",{className:`link ${i.linkAction}`,onClick:ee(E),children:n("collection_item.set_price")}),[t,g,m,E]),M=r.useCallback(()=>u===k.UNSYNCED?e.jsxs("div",{className:`${i.unsynced} ${i.status}`,children:[e.jsx("div",{className:i.alertIcon}),n("collection_item.unsynced")]}):u===k.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")]}):Ie(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(P),className:`link ${i.linkAction}`,children:n("collection_item.edit_item")}),[P,t,u]),$=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:_e,to:D.itemDetail(t.id)}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.see_in_decentraland"),onClick:T}),e.jsx(a.Dropdown.Item,{text:n("collection_item.preview"),onClick:P}),!d.isPublished&&e.jsx(a.Dropdown.Item,{text:n("collection_item.move_to_another_collection"),onClick:L}),Ze(d,t,I)&&!V(d)?e.jsxs(e.Fragment,{children:[t.price&&B?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:R})]})]}):null]})})}),[d,t,I,T,P,L,E,R]),v=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(_e,{to:D.itemDetail(t.id),className:"CollectionItem",children:e.jsxs("div",{className:i.avatarContainer,children:[e.jsx(Ke,{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(Xe,{className:i.itemStatus,item:t}),t.name,e.jsx("div",{className:i.badgeContainer,children:e.jsx(es,{className:i.badge,item:t,size:"small"})})]})})})]})})}),e.jsx(a.Table.Cell,{className:i.column,children:t.rarity&&v.category?e.jsx(ss,{size:"medium",rarity:t.rarity,withTooltip:!0}):null}),e.jsx(a.Table.Cell,{className:i.column,children:v.category?e.jsx("div",{children:n(`${t.type}.category.${v.category}`)}):null}),q(t)&&as(v)?e.jsx(a.Table.Cell,{className:i.column,children:v.category?e.jsx("div",{children:n(`emote.play_mode.${v.loop?"loop":"simple"}.text`)}):null}):null,m&&!d.isPublished?null:e.jsx(a.Table.Cell,{className:i.column,children:w()}),t.isPublished&&t.isApproved?e.jsx(a.Table.Cell,{className:i.column,children:e.jsxs("div",{children:[t.totalSupply,"/",ts(t)]})}):null,e.jsx(a.Table.Cell,{children:M()}),m&&!g&&!t.tradeId&&t.isPublished&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{primary:!0,size:"tiny",disabled:!C,onClick:H,children:n("collection_item.put_for_sale")})}),m&&t.tradeId&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{secondary:!0,size:"tiny",className:i.removeSaleButton,onClick:Z,loading:j&&N.includes(t.tradeId),children:n("collection_item.remove_from_sale")})}),e.jsx(a.Table.Cell,{className:i.contextMenuButton,children:$()})]})}const va=(s,l)=>{const o=ke(s),t=pe(s).filter(m=>m.type===he).map(m=>m.payload.tradeId);return{ethAddress:ns(s),status:o[l.item.id],wallet:ls(s),isOffchainPublicItemOrdersEnabled:os(s),isCancellingItemOrder:W(pe(s),he),loadingTradeIds:t}},ya=s=>({onOpenModal:(l,o)=>s(A(l,o)),onDeleteItem:l=>s(is(l)),onSetItems:l=>s(rs(l)),onRemoveFromSale:l=>s(cs(l,!0))}),ka=J(va,ya)(Na);function Ea({collection:s,wallet:l,items:o,isOnSaleLoading:t,lastLocation:m,status:d,onOpenModal:u,isLoading:I,onFetchCollectionForumPostReply:b}){const N=ds(),j=r.useMemo(()=>new URLSearchParams(N.search).get("tab"),[N]),[h,f]=r.useState(j||y.WEARABLE),g=Ee(),C=m===D.collections(),B=r.useCallback(()=>{s&&s.isPublished&&!s.isApproved&&s.forumLink&&b(s.id)},[s,b]);r.useEffect(()=>{s&&B()},[s]);const E=r.useCallback(()=>{u("MintItemsModal",{collectionId:s.id})},[s,u]),T=r.useCallback(()=>{u("CreateSingleItemModal",{collectionId:s.id})},[s,u]),P=r.useCallback(()=>{s&&!s.isPublished&&u("EditCollectionNameModal",{collection:s})},[s,u]),R=r.useCallback(()=>{s&&u("SellCollectionModal",{collectionId:s.id,isOnSale:te(s,l)||Y(s,l)})},[s,l,u]),L=r.useCallback(()=>{C?g.goBack():g.push(D.collections())},[g,C]),H=r.useCallback(()=>{s&&g.push(us(s,o),{fromParam:Te.COLLECTIONS})},[g,s,o]),Z=r.useCallback((c,p="")=>{const _=window.open(c,p);_&&_.focus()},[]),w=r.useCallback(()=>{s&&s.isPublished&&s.forumLink&&Z(s.forumLink,"_blank")},[s]),M=r.useCallback(c=>{f(c),g.push(D.collectionDetail(s.id,ms.STANDARD,{tab:h}))},[s,g]),$=r.useCallback(c=>{const p=c===y.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:p.toLowerCase()}),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})})},[]),v=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 p=V(s),_=c.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(Ts,{size:"small",active:!0,collection:s,text:n("global.see_in_decentraland"),disabled:p||!_}),e.jsxs(a.Button,{basic:!0,className:"action-button",disabled:p||!_,onClick:H,children:[e.jsx(U,{name:"cube"}),e.jsx("span",{className:"text",children:n("collection_detail_page.preview")})]}),_&&!s.isPublished?e.jsxs(a.Button,{basic:!0,className:"action-button add-items",disabled:p,onClick:T,children:[e.jsx(U,{name:"add-active"}),e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})]}):null]})},[s,H,T]),oe=r.useCallback(()=>{if(!s)return null;const c=Y(s,l),p=te(s,l);return c?e.jsx(xe,{network:Q.Network.MATIC,children:_=>e.jsx(a.Button,{className:se("action-button",c?"basic":"primary"),disabled:t||!_,onClick:R,children:e.jsx("span",{className:"text",children:c?n("collection_detail_page.remove_from_marketplace"):n("collection_detail_page.put_for_sale")})})}):p?null:e.jsx(xe,{network:Q.Network.MATIC,children:_=>e.jsxs(a.Button,{className:se("action-button",p?"secondary":"primary"),disabled:t||!_,onClick:R,children:[e.jsx(a.Icon,{name:"lock"}),e.jsx("span",{className:"text",children:n("collection_detail_page.enable_sales")})]})})},[s,R]),O=r.useCallback((c="tiny")=>{if(s!=null&&s.forumPostReply){const{highest_post_number:p,last_read_post_number:_}=s.forumPostReply,G=p-(_??0);return e.jsx(a.Label,{className:"badge-forum-unread-posts",circular:!0,size:c,children:G})}return null},[s]),ie=r.useCallback(()=>!(s!=null&&s.isApproved)||![k.UNSYNCED,k.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===k.UNDER_REVIEW?e.jsxs(a.Button,{primary:!0,onClick:w,className:"unsynced-collection action-button",children:[e.jsx("span",{children:n("collection_context_menu.forum_post")}),O("medium")]}):null,d===k.UNSYNCED?e.jsx(Ce,{collection:s}):null]}),[s,d,O,w]),Re=r.useCallback(c=>{if(!s)return null;const p=_s(s,l.address),_=V(s),G=Y(s,l),z=c.some(q),F=c.some(ae),we=z?c.some(x=>q(x)&&!x.price):!1,Me=F?c.some(x=>ae(x)&&!x.price):!1,De=F&&c.some(x=>Pe(x)&&!(Se in x.contents)),ce=z&&!F,Ae=F&&!z,Be=c.filter(x=>Ae?ae(x):ce?q(x):x.type===h),Le=z&&F;return e.jsxs(e.Fragment,{children:[e.jsx(a.Section,{className:se({"is-published":s.isPublished}),children:e.jsxs(a.Row,{children:[e.jsx(ks,{absolute:!0,onClick:L}),e.jsx(a.Narrow,{children:e.jsxs(a.Row,{children:[e.jsx(a.Column,{grow:!1,className:"name-container",children:_?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:P,children:[e.jsx(a.Header,{size:"huge",className:"name",children:s.name}),e.jsx(U,{name:"edit",className:"edit-collection-name"}),G?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:!p,onClick:E,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:w,children:e.jsx("span",{children:n("collection_context_menu.forum_post")})}),s!=null&&s.forumPostReply?O():null]}):null,!(s.isPublished&&s.isApproved)&&d!==k.UNSYNCED?e.jsx(Ce,{collection:s}):null,Ne(s,l.address)&&s.isPublished&&s.isApproved?oe():null,be(s,l.address)?e.jsx(Os,{collection:s}):null]})})]})})]})}),e.jsxs(a.Narrow,{children:[ie(),Le?e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsxs(a.Tabs.Tab,{active:h===y.WEARABLE,onClick:()=>M(y.WEARABLE),children:[e.jsx(U,{name:"wearable"}),n("collection_detail_page.wearables"),Me?$(y.WEARABLE):De?v():null]}),e.jsxs(a.Tabs.Tab,{active:h===y.EMOTE,onClick:()=>M(y.EMOTE),children:[e.jsx(U,{name:"emote"}),n("collection_detail_page.emotes"),we?$(y.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")}),h===y.EMOTE||ce?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.play_mode")}):null,s.isPublished?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.price")}):null,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")}),!G&&e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.actions")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:Be.map(x=>e.jsx(ka,{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:_,onClick:T,children:e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})})]})]})]})]})},[h,d,l,s,T,K,P,$,M,ie,oe,M,w,v,O,E,L]),re=l!==null&&s!==null&&be(s,l.address);return e.jsx(Ns,{id:s==null?void 0:s.id,itemsPage:1,itemsPageSize:5e3,children:({isLoadingCollection:c,isLoadingCollectionItems:p,items:_})=>e.jsx(vs,{className:"CollectionDetailPage",hasNavigation:!re&&!I&&!c,isLoading:I||c||p,children:re?Re(_):e.jsx(ys,{})})})}const Ta=()=>{const s=ps(),l=Is()||"",o=S(ve),t=S(C=>hs(C,l)),m=S(fe),d=S(xs),u=S(ye),I=S(C=>le(C,l)),b=S(fs),N=r.useMemo(()=>d||W(u,gs),[d,u]),j=m[l],h=W(u,Cs)||W(u,js),f=r.useCallback((C,B)=>s(A(C,B)),[s]),g=r.useCallback(C=>s(bs(C)),[s]);return e.jsx(Ea,{wallet:o,collection:t,isOnSaleLoading:N,isLoading:h,items:I,status:j,lastLocation:b,onOpenModal:f,onFetchCollectionForumPostReply:g})},Oa=Ta;export{Oa as default};
1
+ import{ae as ne,H as e,M as a,G as n,D as r,fs as K,ft as Ie,eS as k,ck as $e,bF as q,N as J,eU as fe,fu as le,fv as Fe,X as A,fw as Ue,fx as Ne,f1 as Q,cH as de,fy as ue,ed as ve,cI as He,bD as H,fz as We,eG as ye,fA as Oe,ex as ze,fg as ke,bi as Ge,Z as Ee,fB as Y,fC as te,K as D,eV as Te,ev as me,fD as Ye,fE as Ve,bC as ee,f8 as qe,f7 as Qe,f9 as Je,f3 as Pe,eX as Se,L as _e,fF as Xe,dH as Ze,et as Ke,fc as es,fG as ss,fH as V,fI as as,f6 as ts,eH as pe,fJ as he,aG as ns,cS as ls,fK as os,es as is,fL as rs,fM as cs,aM as ds,e$ as y,fN as us,ey as ms,J as U,fO as xe,a1 as se,fP as _s,fa as ae,fQ as be,a4 as ps,a5 as S,ff as hs,fR as xs,fS as bs,fT as gs,fU as Cs,fV as js}from"./index-R2Wjg1N9.js";import{e as Is}from"./hooks-Dztqgq6I.js";import{g as fs}from"./selector-CtnQnmhq.js";import{C as Ns}from"./CollectionProvider.container-B-xYoRRV.js";import{L as vs}from"./LoggedInDetailPage.container-CwXT8qId.js";import{N as ys}from"./NotFound-Bk5qRB9N.js";import{B as ks}from"./Back-DAlD0UQy.js";import{C as Es}from"./CollectionStatus.container-dnoQ-PBl.js";import{J as Ts}from"./JumpIn.container-Dg6l-_Dx.js";import{C as Ps}from"./ConfirmDelete-pyR29k-n.js";import"./Navigation.container-D4sN5Upx.js";import"./selectors-BKk0tQag.js";import"./SignInRequired-w49yYUTd.js";const Ss=({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"}),ge=ne.memo(Ss),Rs=s=>{const{collection:l,items:o,status:t,hasPendingCuration:m,onPublish:d,onPush:u,onInit:I}=s;r.useEffect(()=>{l.isPublished&&I()},[l,I]);const b=o.length>K,N=r.useMemo(()=>o.length===0||!o.every(Ie)||b,[o,b]);let j;if(l.isPublished)l.isApproved?m?j=e.jsx(ge,{type:"push"}):t===k.UNSYNCED?j=e.jsx(a.Button,{primary:!0,compact:!0,onClick:u,children:n("collection_detail_page.push_changes")}):j=e.jsx(a.Button,{secondary:!0,compact:!0,disabled:!0,children:n("global.published")}):j=e.jsx(ge,{type:"publish"});else{const h=e.jsx($e,{disabled:N,primary:!0,compact:!0,onClick:d,network:q.Network.MATIC,children:n("collection_detail_page.publish")});if(N){let f;o.length>K?f=n("collection_detail_page.publish_reason_max_items",{maxItems:K}):o.length===0?f=n("collection_detail_page.publish_reason_no_items"):f=n("collection_detail_page.publish_reason_items_not_complete"),j=e.jsx(a.Popup,{content:f,position:"top center",trigger:e.jsx("div",{className:"popup-button",children:h}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})}else j=h}return j},ws=ne.memo(Rs),Ms=(s,l)=>{const{id:o}=l.collection,t=fe(s);return{items:le(s,o),status:t[o],hasPendingCuration:Fe(s,o)}},Ds=(s,l)=>{const{id:o}=l.collection;return{onPublish:()=>s(A("PublishWizardCollectionModal",{collectionId:o})),onPush:()=>s(A("PushCollectionChangesModal",{collectionId:o})),onInit:()=>s(Ue(o))}},Ce=J(Ms,Ds)(ws),As="_dropdown_1a07a_1",Bs="_ellipsis_1a07a_9",Ls="_menu_1a07a_13",$s="_disabled_1a07a_13",Fs="_item_1a07a_13",je={dropdown:As,ellipsis:Bs,menu:Ls,disabled:$s,item:Fs},Us=({collection:s,wallet:l,onOpenModal:o,onDelete:t})=>{const m=()=>{o("ManageCollectionRoleModal",{type:ue.MANAGER,collectionId:s.id,roles:s.managers})},d=()=>{o("ManageCollectionRoleModal",{type:ue.MINTER,collectionId:s.id,roles:s.minters})},u=()=>{o("AddExistingItemModal",{collectionId:s.id})},I=()=>{t(s)},b=Ne(s,l.address);return e.jsx(a.Dropdown,{className:je.dropdown,trigger:e.jsx(a.Button,{basic:!0,children:e.jsx(a.Icon,{className:je.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:m}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.minters"),onClick:d})]}):null:Q(s)?null:e.jsxs(e.Fragment,{children:[e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.add_existing_item"),onClick:u}),e.jsx(Ps,{name:s.name,onDelete:I,trigger:e.jsx(a.Dropdown.Item,{text:n("global.delete")})})]}),e.jsx(de,{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(de,{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})]})})},Hs=(s,l)=>({wallet:ve(s),items:le(s,l.collection.id),name:He(s)||"",isForumPostLoading:H(ye(s),We)}),Ws=s=>({onOpenModal:(l,o)=>s(A(l,o)),onPostToForum:(l,o)=>s(Oe(l,o)),onDelete:l=>s(ze(l))}),Os=J(Hs,Ws)(Us),zs=({isEnabled:s,onClick:l})=>s?e.jsx(a.Dropdown.Item,{text:n("collection_item.reset_item"),onClick:l}):null,Gs=ne.memo(zs),Ys=(s,l)=>{const{itemId:o}=l;return{isEnabled:ke(s)[o]===k.UNSYNCED}},Vs=(s,l)=>{const{itemId:o}=l;return{onClick:()=>s(A("ResetItemModal",{itemId:o}))}},qs=J(Ys,Vs)(Gs),Qs="_itemImage_10lcv_1",Js="_itemStatus_10lcv_9",Xs="_mana_10lcv_13",Zs="_grid_10lcv_19",Ks="_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:Qs,itemStatus:Js,mana:Xs,grid:Zs,row:Ks,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:m,collection:d,status:u,ethAddress:I,wallet:b,loadingTradeIds:N,isCancellingItemOrder:j}){const h=Ge(),f=Ee(),g=b&&Y(d,b),C=b&&m&&te(d,b),B=!m||C&&t.tradeId||g,E=r.useCallback(()=>{if(m&&C){s("PutForSaleOffchainModal",{itemId:t.id});return}s("EditPriceAndBeneficiaryModal",{itemId:t.id})},[t,s]),T=r.useCallback(()=>{s("SeeInWorldModal",{itemIds:[t.id]})},[s,t]),P=r.useCallback(()=>{l([t]),f.push(D.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:Te.COLLECTIONS}),h==null||h.track("Preview Item",{ITEM_ID:t!=null&&t.urn?me(t.urn)?Ye(t.urn):Ve(t.urn):null,ITEM_TYPE:t.type,ITEM_NAME:t.name,ITEM_IS_THIRD_PARTY:me(t.urn)})},[t,l,f]),R=r.useCallback(()=>{s("DeleteItemModal",{item:t})},[t,s]),L=r.useCallback(()=>{s("MoveItemToAnotherCollectionModal",{item:t,fromCollection:d})},[t,s,d]),W=r.useCallback(()=>{s("PutForSaleOffchainModal",{itemId:t.id})},[]),X=r.useCallback(()=>{t.tradeId&&o(t.tradeId)},[t]),w=r.useCallback(()=>t.price?t.price===qe.toString()||m&&!g&&!t.tradeId?e.jsx("span",{children:"-"}):Qe(t)?e.jsx("span",{children:n("global.free")}):e.jsx(a.Mana,{className:i.mana,network:q.Network.MATIC,showTooltip:!0,children:Je(t.price)}):e.jsx("div",{className:`link ${i.linkAction}`,onClick:ee(E),children:n("collection_item.set_price")}),[t,g,m,E]),M=r.useCallback(()=>u===k.UNSYNCED?e.jsxs("div",{className:`${i.unsynced} ${i.status}`,children:[e.jsx("div",{className:i.alertIcon}),n("collection_item.unsynced")]}):u===k.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")]}):Ie(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(P),className:`link ${i.linkAction}`,children:n("collection_item.edit_item")}),[P,t,u]),$=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:_e,to:D.itemDetail(t.id)}),e.jsx(a.Dropdown.Item,{text:n("collection_context_menu.see_in_decentraland"),onClick:T}),e.jsx(a.Dropdown.Item,{text:n("collection_item.preview"),onClick:P}),!d.isPublished&&e.jsx(a.Dropdown.Item,{text:n("collection_item.move_to_another_collection"),onClick:L}),Xe(d,t,I)&&!Q(d)?e.jsxs(e.Fragment,{children:[t.price&&B?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:R})]})]}):null]})})}),[d,t,I,T,P,L,E,R]),v=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(_e,{to:D.itemDetail(t.id),className:"CollectionItem",children:e.jsxs("div",{className:i.avatarContainer,children:[e.jsx(Ze,{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(Ke,{className:i.itemStatus,item:t}),t.name,e.jsx("div",{className:i.badgeContainer,children:e.jsx(es,{className:i.badge,item:t,size:"small"})})]})})})]})})}),e.jsx(a.Table.Cell,{className:i.column,children:t.rarity&&v.category?e.jsx(ss,{size:"medium",rarity:t.rarity,withTooltip:!0}):null}),e.jsx(a.Table.Cell,{className:i.column,children:v.category?e.jsx("div",{children:n(`${t.type}.category.${v.category}`)}):null}),V(t)&&as(v)?e.jsx(a.Table.Cell,{className:i.column,children:v.category?e.jsx("div",{children:n(`emote.play_mode.${v.loop?"loop":"simple"}.text`)}):null}):null,m&&!d.isPublished?null:e.jsx(a.Table.Cell,{className:i.column,children:w()}),t.isPublished&&t.isApproved?e.jsx(a.Table.Cell,{className:i.column,children:e.jsxs("div",{children:[t.totalSupply,"/",ts(t)]})}):null,e.jsx(a.Table.Cell,{children:M()}),m&&!g&&!t.tradeId&&t.isPublished&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{primary:!0,size:"tiny",disabled:!C,onClick:W,children:n("collection_item.put_for_sale")})}),m&&t.tradeId&&e.jsx(a.Table.Cell,{children:e.jsx(a.Button,{secondary:!0,size:"tiny",className:i.removeSaleButton,onClick:X,loading:j&&N.includes(t.tradeId),children:n("collection_item.remove_from_sale")})}),e.jsx(a.Table.Cell,{className:i.contextMenuButton,children:$()})]})}const va=(s,l)=>{const o=ke(s),t=pe(s).filter(m=>m.type===he).map(m=>m.payload.tradeId);return{ethAddress:ns(s),status:o[l.item.id],wallet:ls(s),isOffchainPublicItemOrdersEnabled:os(s),isCancellingItemOrder:H(pe(s),he),loadingTradeIds:t}},ya=s=>({onOpenModal:(l,o)=>s(A(l,o)),onDeleteItem:l=>s(is(l)),onSetItems:l=>s(rs(l)),onRemoveFromSale:l=>s(cs(l,!0))}),ka=J(va,ya)(Na);function Ea({collection:s,wallet:l,items:o,isOnSaleLoading:t,lastLocation:m,status:d,onOpenModal:u,isLoading:I,onFetchCollectionForumPostReply:b}){const N=ds(),j=r.useMemo(()=>new URLSearchParams(N.search).get("tab"),[N]),[h,f]=r.useState(j||y.WEARABLE),g=Ee(),C=m===D.collections(),B=r.useCallback(()=>{s&&s.isPublished&&!s.isApproved&&s.forumLink&&b(s.id)},[s,b]);r.useEffect(()=>{s&&B()},[s]);const E=r.useCallback(()=>{u("MintItemsModal",{collectionId:s.id})},[s,u]),T=r.useCallback(()=>{u("CreateSingleItemModal",{collectionId:s.id})},[s,u]),P=r.useCallback(()=>{s&&!s.isPublished&&u("EditCollectionNameModal",{collection:s})},[s,u]),R=r.useCallback(()=>{s&&u("SellCollectionModal",{collectionId:s.id,isOnSale:te(s,l)||Y(s,l)})},[s,l,u]),L=r.useCallback(()=>{C?g.goBack():g.push(D.collections())},[g,C]),W=r.useCallback(()=>{s&&g.push(us(s,o),{fromParam:Te.COLLECTIONS})},[g,s,o]),X=r.useCallback((c,p="")=>{const _=window.open(c,p);_&&_.focus()},[]),w=r.useCallback(()=>{s&&s.isPublished&&s.forumLink&&X(s.forumLink,"_blank")},[s]),M=r.useCallback(c=>{f(c),g.push(D.collectionDetail(s.id,ms.STANDARD,{tab:h}))},[s,g]),$=r.useCallback(c=>{const p=c===y.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:p.toLowerCase()}),position:"top center",trigger:e.jsx("i",{"aria-hidden":"true",className:"circle icon tiny"})})},[]),v=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"})}),[]),Z=r.useCallback(c=>{if(!s)return null;const p=Q(s),_=c.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(Ts,{size:"small",active:!0,collection:s,text:n("global.see_in_decentraland"),disabled:p||!_}),e.jsxs(a.Button,{basic:!0,className:"action-button",disabled:p||!_,onClick:W,children:[e.jsx(U,{name:"cube"}),e.jsx("span",{className:"text",children:n("collection_detail_page.preview")})]}),_&&!s.isPublished?e.jsxs(a.Button,{basic:!0,className:"action-button add-items",disabled:p,onClick:T,children:[e.jsx(U,{name:"add-active"}),e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})]}):null]})},[s,W,T]),oe=r.useCallback(()=>{if(!s)return null;const c=Y(s,l),p=te(s,l);return c?e.jsx(xe,{network:q.Network.MATIC,children:_=>e.jsx(a.Button,{className:se("action-button",c?"basic":"primary"),disabled:t||!_,onClick:R,children:e.jsx("span",{className:"text",children:c?n("collection_detail_page.remove_from_marketplace"):n("collection_detail_page.put_for_sale")})})}):p?null:e.jsx(xe,{network:q.Network.MATIC,children:_=>e.jsxs(a.Button,{className:se("action-button",p?"secondary":"primary"),disabled:t||!_,onClick:R,children:[e.jsx(a.Icon,{name:"lock"}),e.jsx("span",{className:"text",children:n("collection_detail_page.enable_sales")})]})})},[s,R]),O=r.useCallback((c="tiny")=>{if(s!=null&&s.forumPostReply){const{highest_post_number:p,last_read_post_number:_}=s.forumPostReply,z=p-(_??0);return e.jsx(a.Label,{className:"badge-forum-unread-posts",circular:!0,size:c,children:z})}return null},[s]),ie=r.useCallback(()=>!(s!=null&&s.isApproved)||![k.UNSYNCED,k.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===k.UNDER_REVIEW?e.jsxs(a.Button,{primary:!0,onClick:w,className:"unsynced-collection action-button",children:[e.jsx("span",{children:n("collection_context_menu.forum_post")}),O("medium")]}):null,d===k.UNSYNCED?e.jsx(Ce,{collection:s}):null]}),[s,d,O,w]),Re=r.useCallback(c=>{if(!s)return null;const p=_s(s,l.address),_=Q(s),z=Y(s,l),G=c.some(V),F=c.some(ae),we=G?c.some(x=>V(x)&&!x.price):!1,Me=F?c.some(x=>ae(x)&&!x.price):!1,De=F&&c.some(x=>Pe(x)&&!(Se in x.contents)),ce=G&&!F,Ae=F&&!G,Be=c.filter(x=>Ae?ae(x):ce?V(x):x.type===h),Le=G&&F;return e.jsxs(e.Fragment,{children:[e.jsx(a.Section,{className:se({"is-published":s.isPublished}),children:e.jsxs(a.Row,{children:[e.jsx(ks,{absolute:!0,onClick:L}),e.jsx(a.Narrow,{children:e.jsxs(a.Row,{children:[e.jsx(a.Column,{grow:!1,className:"name-container",children:_?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:P,children:[e.jsx(a.Header,{size:"huge",className:"name",children:s.name}),e.jsx(U,{name:"edit",className:"edit-collection-name"}),z?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:!p,onClick:E,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:w,children:e.jsx("span",{children:n("collection_context_menu.forum_post")})}),s!=null&&s.forumPostReply?O():null]}):null,!(s.isPublished&&s.isApproved)&&d!==k.UNSYNCED?e.jsx(Ce,{collection:s}):null,Ne(s,l.address)&&s.isPublished&&s.isApproved?oe():null,be(s,l.address)?e.jsx(Os,{collection:s}):null]})})]})})]})}),e.jsxs(a.Narrow,{children:[ie(),Le?e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsxs(a.Tabs.Tab,{active:h===y.WEARABLE,onClick:()=>M(y.WEARABLE),children:[e.jsx(U,{name:"wearable"}),n("collection_detail_page.wearables"),Me?$(y.WEARABLE):De?v():null]}),e.jsxs(a.Tabs.Tab,{active:h===y.EMOTE,onClick:()=>M(y.EMOTE),children:[e.jsx(U,{name:"emote"}),n("collection_detail_page.emotes"),we?$(y.EMOTE):null]}),e.jsx("div",{className:"secondary-actions tab",children:Z(c)})]}):e.jsx("div",{className:"secondary-actions",children:Z(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")}),h===y.EMOTE||ce?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.play_mode")}):null,s.isPublished?e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.price")}):null,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")}),!z&&e.jsx(a.Table.HeaderCell,{children:n("collection_detail_page.table.actions")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:Be.map(x=>e.jsx(ka,{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:_,onClick:T,children:e.jsx("span",{className:"text",children:n("collection_detail_page.add_item")})})]})]})]})]})},[h,d,l,s,T,Z,P,$,M,ie,oe,M,w,v,O,E,L]),re=l!==null&&s!==null&&be(s,l.address);return e.jsx(Ns,{id:s==null?void 0:s.id,itemsPage:1,itemsPageSize:5e3,children:({isLoadingCollection:c,isLoadingCollectionItems:p,items:_})=>e.jsx(vs,{className:"CollectionDetailPage",hasNavigation:!re&&!I&&!c,isLoading:I||c||p,children:re?Re(_):e.jsx(ys,{})})})}const Ta=()=>{const s=ps(),l=Is()||"",o=S(ve),t=S(C=>hs(C,l)),m=S(fe),d=S(xs),u=S(ye),I=S(C=>le(C,l)),b=S(fs),N=r.useMemo(()=>d||H(u,gs),[d,u]),j=m[l],h=H(u,Cs)||H(u,js),f=r.useCallback((C,B)=>s(A(C,B)),[s]),g=r.useCallback(C=>s(bs(C)),[s]);return e.jsx(Ea,{wallet:o,collection:t,isOnSaleLoading:N,isLoading:h,items:I,status:j,lastLocation:b,onOpenModal:f,onFetchCollectionForumPostReply:g})},Oa=Ta;export{Oa as default};
@@ -1 +1 @@
1
- var ct=Object.defineProperty;var ht=(i,m,e)=>m in i?ct(i,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[m]=e;var c=(i,m,e)=>ht(i,typeof m!="symbol"?m+"":m,e);import{ae as q,H as t,M as d,G as r,bk as $,bJ as mt,D as b,gt as Q,L as ee,K as F,cj as We,b4 as P,N as Fe,bD as G,gu as gt,eF as pt,gv as ut,gw as Ct,gx as It,gy as bt,gz as xt,gA as _t,gB as Et,gC as vt,gD as V,et as jt,gE as K,gF as Pe,a4 as te,Z as xe,a5 as C,aG as se,gG as St,de as _e,br as Ve,fe as Ee,ft,fW as Tt,fX as wt,eC as ge,gm as yt,gH as Pt,gI as At,fZ as Nt,eG as He,gJ as Rt,gK as Mt,gL as Dt,gM as Lt,fo as Ot,fY as kt,f_ as Bt,aM as ve,gN as Wt,gO as Ft,eU as Ae,bK as Vt,ad as Ht,eJ as je,gP as Ue,X as $e,ew as Ut,er as Ge,fG as X,dG as pe,es as $t,eX as ue,gQ as Ye,bi as Se,fV as Je,e_ as L,eu as z,fC as ze,fD as Ce,J as H,f9 as Ie,dF as Gt,eS as Yt,fl as Jt,gR as zt,gS as qe,gT as Ze,gU as Ke,fd as fe,eD as qt,gV as Zt,gW as Kt,fK as Qe,eM as Qt,eL as Xe,eN as Xt,eP as es,eQ as ts,gX as ss,gY as as,gZ as ns,g_ as ae,g$ as de,h0 as is,eg as os,h1 as ls,h2 as rs,h3 as ds,h4 as cs,h5 as hs,h6 as ms,h7 as gs,h8 as ps,h9 as us,ha as Cs,fm as Is,hb as bs,hc as xs,hd as _s,he as Es,hf as vs,hg as js,hh as Ss,hi as fs,f$ as Ts,bU as ie,hj as ws,hk as Ne,hl as ys,hm as Ps,eW as Re,fH as ce,hn as he,eV as As,eR as Me,eY as Ns,eZ as De,e$ as Le,f0 as Oe,ho as Rs,hp as Ms,f1 as Ds,f2 as ke,f3 as Be,hq as Ls,fc as Os,hr as ks,hs as Bs,ht as Ws,hu as et,hv as Fs,hw as Vs,hx as Hs,hy as Us,hz as $s,eI as Gs,hA as Ys,fg as Js,ff as zs,fi as qs,hB as Zs}from"./index-B0M-djtI.js";import{g as le,h as Te,i as we}from"./hooks-Bu702gkG.js";import{J as Ks}from"./JumpIn.container-CQcApBEz.js";import{C as Qs}from"./CollectionProvider.container-B3EqRy6H.js";import{C as tt}from"./ConfirmDelete-CIPVWRhm.js";import{C as st}from"./CollectionStatus.container-CkFaF83s.js";import{d as Xs,e as ea,c as ta}from"./selectors-CJiu0Ou1.js";import{I as sa}from"./ItemProvider.container-DUp3V4pS.js";const aa=({open:i,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(d.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:i,children:[t.jsx(d.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(mt,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:s,children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),na=q.memo(aa);var D=(i=>(i.REJECT_COLLECTION="REJECT_COLLECTION",i.REJECT_CURATION="REJECT_CURATION",i.DISABLE_COLLECTION="DISABLE_COLLECTION",i.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",i))(D||{});const U="item_editor.top_panel.rejection_modal",ia=({open:i,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:o,curation:l,onReject:h,onRejectCuration:g,onClose:p})=>{const E=b.useMemo(()=>{switch(m){case D.DISABLE_COLLECTION:return U+".disable_collection";case D.REJECT_CURATION:return U+".reject_curation";case D.DISABLE_THIRD_PARTY:return U+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case D.DISABLE_COLLECTION:h(o);break;case D.REJECT_CURATION:g(l.collectionId);break;case D.DISABLE_THIRD_PARTY:s&&n(s.id);break}},S=m===D.DISABLE_COLLECTION&&!o.isApproved||m===D.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===D.REJECT_COLLECTION&&!o.isApproved||m===D.REJECT_CURATION&&(l==null?void 0:l.status)===Q.REJECTED;return t.jsx(d.Modal,{size:"tiny",className:"RejectionModal",open:i,children:a?t.jsx(oa,{i18nKey:E}):S?t.jsx(la,{link:o.forumLink,onClose:p}):t.jsx(ra,{i18nKey:E,isLoading:e,onClose:p,onConfirm:w})})},oa=({i18nKey:i})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${i}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx($,{id:U+".visit_activity",values:{activity_link:t.jsx(ee,{to:F.activity(),children:r("global.activity")})}})}),t.jsx(d.Loader,{active:!0,size:"large"})]})]}),la=({link:i,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(U+".veredict_explanation")}),t.jsx(d.Modal.Content,{children:r(U+".go_to_forum")}),t.jsxs(d.Modal.Actions,{children:[t.jsx("a",{href:i,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(d.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(U+".forum_link")}),t.jsx("div",{className:"discussion",children:r(U+".discussion")}),t.jsx(d.Icon,{name:"chevron right"})]})}),t.jsx(d.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),ra=({i18nKey:i,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsx(d.Modal.Content,{children:r(`${i}.subtitle`)}),t.jsxs(d.Modal.Actions,{children:[t.jsx(We,{primary:!0,onClick:e,disabled:m,loading:m,network:P.Network.MATIC,children:r(`${i}.action`)}),t.jsx(d.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),da=q.memo(ia),ca=(i,m)=>({isLoading:G(pt(i),gt)||G(Ct(i),ut)||It(i),hasPendingTransaction:bt(i)||!!(m.thirdParty&&xt(i,m.thirdParty.id))}),ha=i=>({onReject:m=>i(_t(m)),onRejectCuration:m=>i(Et(m)),onDisableThirdParty:m=>i(vt(m))}),ma=Fe(ca,ha)(da);var y=(i=>(i[i.APPROVE=0]="APPROVE",i[i.REJECT=1]="REJECT",i[i.ENABLE=2]="ENABLE",i[i.DISABLE=3]="DISABLE",i[i.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",i))(y||{});let ga=class extends q.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push(F.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:o,onSetAssignee:l}=this.props;this.setState({showApproveConfirmModal:!1}),a&&l(e.id,a,s),V(e)?o(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:o,thirdParty:l}=this.props,{showRejectionModal:h,showApproveConfirmModal:g}=this.state,{chainId:p}=this.props,E=jt(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," · ",r(`collection.type.${E}`),t.jsx(Ks,{size:"small",active:!0,collection:e,chainId:p,items:V(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:V(e)&&o!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),h&&t.jsx(ma,{type:h,open:!0,collection:e,curation:n,thirdParty:l,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&g&&t.jsx(na,{open:!0,assignee:n.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,n),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});c(this,"renderButton",(e,s,a)=>{const{address:n,thirdParty:o,onInitiateApprovalFlow:l,onInitiateTPApprovalFlow:h,onDeployMissingEntities:g,reviewedItems:p,totalItems:E}=this.props,w={[y.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):V(s)?h(s):l(s),[y.ENABLE]:()=>l(s),[y.DISABLE]:()=>this.setShowRejectionModal(o?D.DISABLE_THIRD_PARTY:D.DISABLE_COLLECTION),[y.REJECT]:()=>{(a==null?void 0:a.status)===Q.PENDING?this.setShowRejectionModal(D.REJECT_CURATION):this.setShowRejectionModal(D.REJECT_COLLECTION)},[y.DEPLOY_MISSING_ENTITIES]:()=>g(s)},S={[y.APPROVE]:"approve",[y.ENABLE]:"enable",[y.DISABLE]:"disable",[y.REJECT]:"reject",[y.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===y.APPROVE||e===y.ENABLE||e===y.DEPLOY_MISSING_ENTITIES,_=!V(s)||!!E&&p.length>=K(E);return t.jsx(d.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:_,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(d.Button,{primary:j,onClick:()=>w[e](),disabled:V(s)&&e===y.APPROVE&&!!E&&p.length<K(E),children:r(`item_editor.top_panel.${S[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:o,thirdParty:l}=this.props,h=a==null?void 0:a.some(g=>g.status===Q.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(d.Header,{sub:!0,children:[h?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:K(o)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=K(o)?t.jsx(d.Icon,{name:"check circle"}):null]}),h&&this.renderButton(y.APPROVE,e,s),h&&this.renderButton(y.REJECT,e,s),!h&&(l==null?void 0:l.isApproved)&&this.renderButton(y.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)?this.renderButton(y.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:o,isLoading:l}=this.props,h=!e||l&&!s.length;return a&&n&&o?t.jsx("div",{className:"TopPanel",children:h?t.jsx(d.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const pa=({reviewedItems:i})=>{const m=te(),e=xe(),s=le(),a=Te(),n=C(se),o=C(St),l=C(_e),h=C(Ve),g=C(u=>s?Ee(u,s):null),p=C(u=>g?ft(u,g.id):[]),E=C(u=>g?Tt(u,g.id):[]),w=C(u=>s?wt(u,s):null),S=C(u=>s?ge(u,s):void 0),j=C(u=>g&&V(g)?yt(u,g):null),_=C(u=>s?Pt(u,s):!1),f=C(u=>G(At(u),Ot)||G(Nt(u),kt)||G(He(u),Bt)),T=b.useCallback((u,N,k)=>{m(Rt(u,N,k))},[m]),R=b.useCallback(u=>{m(Mt(u))},[m]),M=b.useCallback(u=>{m(Dt(u))},[m]),I=b.useCallback(u=>{m(Lt(u))},[m]);return t.jsx(ga,{address:n,items:p,totalItems:(S==null?void 0:S.total)||null,collection:g,itemCurations:E,thirdParty:j,curation:w,chainId:o,isConnected:l,isReviewing:a,isCommitteeMember:h,selectedCollectionId:s,hasCollectionMissingEntities:_,isLoading:f,reviewedItems:i,onSetAssignee:T,onInitiateTPApprovalFlow:R,onInitiateApprovalFlow:M,onDeployMissingEntities:I,history:e})},ua=pa,at=()=>{const{search:i}=ve();return C(e=>Wt(e,i))},Ca="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",Ia=i=>{const{collectionId:m}=i,[e,s]=b.useState(!1),[a,n]=b.useState(null),o=xe(),l=ve(),h=b.useMemo(()=>Ft(l.search),[l.search]);b.useEffect(()=>{h&&(s(!0),n(h))},[h]);function g(){s(!1);const p=new URLSearchParams(l.search);p.delete("newItem"),o.replace({search:p.toString()})}return e&&a&&m?t.jsx(d.Toast,{type:d.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:Ca,alt:r("sagas.item.item_added_toast.title")})}),onClose:g,body:t.jsx($,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:p=>t.jsx("strong",{children:p}),"collection-link":p=>t.jsx(ee,{to:F.collectionDetail(m),children:t.jsx(d.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:p})})}})}):null},ba=q.memo(Ia),xa=({collection:i,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:o})=>{var I,u;const l=ve(),h=xe(),g=((I=l.state)==null?void 0:I.fromParam)===Ae.COLLECTIONS,p=((u=l.state)==null?void 0:u.fromParam)===Ae.TP_COLLECTIONS,E=b.useCallback(()=>{h.push(F.collections())},[h]),w=b.useCallback(()=>{if(i&&(g||p)){const N=g?F.collectionDetail:F.thirdPartyCollectionDetail;h.push(N(i.id))}else h.push(F.itemEditor())},[g,p,h,i]),S=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{i&&n("CreateSingleItemModal",{collectionId:i.id})},[i,n]),_=b.useCallback(()=>{i&&n("AddExistingItemModal",{collectionId:i.id})},[i,n]),f=b.useCallback(()=>{i&&n("EditCollectionNameModal",{collection:i})},[i,n]),T=b.useCallback(()=>{i&&o(i)},[i,o]),R=b.useCallback(()=>{const N=i&&Vt(i.owner,m||"");return i?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${g||p?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(ee,{to:F.collectionDetail(i.id),children:i.name}),t.jsx(st,{collection:i})]}),N&&!i.isPublished?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[t.jsx(d.Dropdown.Item,{onClick:f,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(d.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(d.Dropdown.Item,{onClick:_,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(tt,{name:i.name,onDelete:T,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[i,m,e,g,p]),M=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:E}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(d.Dropdown.Menu,{children:t.jsx(d.Dropdown.Item,{onClick:S,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(d.Row,{grow:!1,shrink:!1,className:"Header",children:i?R():M()})},_a=()=>{const i=le();return C(m=>i?Ee(m,i):null)},Ea=()=>{const i=te(),m=C(se),e=C(Ht),s=Te(),a=C(je),n=_a(),o=C(p=>!!(n&&m&&Ue(p,m,n))),l=b.useCallback((p,E)=>i($e(p,E)),[i]),h=b.useCallback(p=>i(Ut(p)),[i]),g=b.useCallback(p=>i(Ge(p)),[i]);return t.jsx(xa,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:l,onDeleteCollection:h,onDeleteItem:g,hasEditRights:o,hasUserOrphanItems:a})},B=10;class W extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"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:n?s:null})]})}}class va extends b.PureComponent{constructor(){super(...arguments);c(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(d.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:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(ee,{to:F.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(pe,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx($t,{item:e}),e.name]}),t.jsx(d.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${ue(e)}`).toLowerCase()})}),disabled:Ye(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var A=(i=>(i.TO_REVIEW="to-review",i.REVIEWED="reviewed",i.ALL_ITEMS="all-items",i))(A||{});const ja={[A.TO_REVIEW]:1,[A.REVIEWED]:1,[A.ALL_ITEMS]:1};class Sa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:A.TO_REVIEW,currentPages:ja,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Se());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===A.TO_REVIEW&&!Je(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var g;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:o,onSetItems:l}=this.props;if(!Ye(e,s))return;let h=a.filter(p=>p.id!==e.id);if(X(e))if(this.isVisible(e)){o?n==null||n.emote.pause():n==null||n.emote.play();return}else h=h.filter(p=>p.type!==L.EMOTE);this.isVisible(e)||(h.push(e),(g=this.analytics)==null||g.track("Preview Item",{ITEM_ID:e!=null&&e.urn?z(e.urn)?ze(e.urn):Ce(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:z(e.urn)})),l(h)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:o}=this.state;e===A.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(o[A.ALL_ITEMS])}):e===A.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(o=>({currentPages:{...o.currentPages,[a]:+s.activePage}})),a!==A.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(A.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?z(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:o}=this.props;return t.jsx(va,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:o,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(Ie),a=e.filter(X);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(W,{label:this.renderCollapsableLabel(L.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(W,{label:this.renderCollapsableLabel(L.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],o=Math.ceil(e/B);return o>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:o,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],o=(n-1)*B,l=n*B;return t.jsx(d.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:o,pageEnd:l>e?e:l,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:o,currentPages:l}=this.state,h=this.getIsReviewingTPItems(),g=l[o];if(s)return t.jsx(d.Loader,{size:"large",active:!0});switch(o){case A.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!h&&a?this.renderTabPagination(a):null]});case A.REVIEWED:{const p=n.slice((g-1)*B,g*B);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(p),n.length?this.renderTabPagination(n.length):null]})}case A.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}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let o;const l=!s||s<B||a.length===s;switch(n){case A.TO_REVIEW:o=t.jsx(d.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!l,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(d.Button,{disabled:e||l,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(d.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case A.REVIEWED:o=t.jsx($,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:K(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",o," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(d.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx($,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:A.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(d.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(d.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(d.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:()=>this.handleTabChange(A.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:e===A.TO_REVIEW,onClick:()=>this.handleTabChange(A.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(d.Tabs.Tab,{active:e===A.REVIEWED,onClick:()=>this.handleTabChange(A.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(d.Tabs.Tab,{active:e===A.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(H,{name:e}),t.jsx($,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(d.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class fa extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(ee,{to:F.itemEditor({collectionId:m.id}),children:[t.jsx(Gt,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(st,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class Ta extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentPage:1});c(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:n,totalCollections:o}=this.props,{currentPage:l}=this.state;if(e.length===0)return null;const h=Math.ceil(o/B);return s?t.jsx(d.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(d.Section,{className:"Collections",children:[e.map(g=>t.jsx(fa,{collection:g,items:a,isSelected:g.id===n},g.id)),h>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:h,activePage:l,onPageChange:this.handlePageChange}):null]})})}}var J=(i=>(i.COLLECTIONS="collections",i.ORPHAN_ITEMS="orphanItems",i))(J||{});const Y=1;let wa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",this.getInitialState());c(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});c(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:n,selectedCollectionId:o}=this.props,{pages:l}=this.state;if(e&&!n&&!o){const h=l[l.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:B,page:h})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:o}=this.props,l=this.isCollectionTabActive()?n:a,h=Math.ceil(l/B);if(h>s.length){const g=[...Array(h).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(E=>({pages:[...E.pages,p]}),this.fetchResource)}}o(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[Y]},this.fetchResource)});c(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:[Y],currentTab:a,initialPage:Y,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:o}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&o([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:o,selectedItemId:l,selectedItem:h,orphanItems:g,totalItems:p,visibleItems:E,hasUserOrphanItems:w,onSetItems:S,onFetchOrphanItem:j}=this.props,{initialPage:_,pages:f}=this.state;if(!o&&n&&l&&p&&(_===Y||s.initialPage<_)){if(!g.find(T=>T.id===l)){const T=Math.ceil(p/B),R=f[f.length-1],M=Math.min(T,R+1);f.includes(M)||this.setState({pages:[M],initialPage:M},this.fetchResource)}}else if(e.selectedItemId&&l&&e.selectedItemId!==l){const T=E.filter(R=>R.type!==L.EMOTE);S(T)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!o)&&this.setState({pages:[Y]},this.fetchResource),e.selectedCollectionId!==o&&this.setState({pages:[Y]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&h&&h.type!==L.EMOTE&&S([h]),e.selectedCollectionId!==o&&S([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:o,isReviewing:l}=this.props;return n&&e?Yt(e)&&l?s.filter(h=>!!(a!=null&&a.find(g=>g.itemId===h.id&&g.status===Q.PENDING))):s:o}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:o,selectedCollectionId:l,visibleItems:h,bodyShape:g,reviewedItems:p,isReviewing:E,isPlayingEmote:w,isConnected:S,wearableController:j,isLoading:_,hasUserOrphanItems:f,onSetItems:T,onSetReviewedItems:R,onResetReviewedItems:M}=this.props,{pages:I,showSamplesModalAgain:u}=this.state,N=!l&&f,k=this.isCollectionTabActive()&&!l,x=!this.isCollectionTabActive()||l;return t.jsx("div",{className:"LeftPanel",children:S?t.jsx(Qs,{id:l,itemSelected:o,itemsPage:I,itemsPageSize:B,fetchCollectionItemsOptions:{status:E?Q.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:O,paginatedItems:re,initialPage:it,isLoadingCollection:ot,isLoadingCollectionItems:lt,itemCurations:rt})=>{const Z=this.getItems(O,re,rt),ye=this.isCollectionTabActive(),dt=l&&O?it:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(Ea,{}),N?t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:ye,onClick:()=>this.handleTabChange(J.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(d.Tabs.Tab,{active:!ye,onClick:()=>this.handleTabChange(J.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,k?t.jsx(Ta,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Z.length>0,selectedCollectionId:l,onLoadPage:this.loadPage,isLoading:ot}):null,x?t.jsxs(t.Fragment,{children:[t.jsx(Sa,{items:Z,totalItems:s||Z.length,hasHeader:!l&&n.length>0,selectedItemId:o,collection:O,isReviewing:E,isPlayingEmote:w,visibleItems:h,bodyShape:g,onResetReviewedItems:M,reviewedItems:p,onSetItems:T,wearableController:j,initialPage:dt,isLoading:lt||_,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:u,onReviewItems:()=>R(Z),onLoadRandomPage:()=>this.loadRandomPage(Z),onLoadPage:this.loadPage}),t.jsx(ba,{collectionId:l})]}):null]})}}):null})}};const ya=i=>{const m=te(),e=le(),s=we(),a=Te(),n=at(),o=C(x=>se(x)),l=C(x=>_e(x)),h=C(x=>Jt(x)),g=C(x=>zt(x)),p=C(x=>qe(x)),E=C(x=>Ze(x)),w=C(x=>Ke(x)),S=C(x=>je(x)),j=C(x=>He(x)),_=C(x=>s?fe(x,s):null),f=C(x=>{if(e)return ge(x,e);if(o)return ge(x,o)}),T=C(x=>e?void 0:qt(x)),R=C(x=>o&&!e?Zt(x,o,f==null?void 0:f.limit):Kt(x)),M=b.useMemo(()=>G(j,es)||G(j,ts),[j]),I=b.useCallback(x=>m(Qe(x)),[m]),u=b.useCallback((x,v)=>m(Qt(x,v)),[m]),N=b.useCallback((x,v)=>m(Xe(x,v)),[m]),k=b.useCallback(x=>m(Xt(x)),[m]);return t.jsx(wa,{...i,address:o,isConnected:l,items:h,totalItems:(f==null?void 0:f.total)||null,totalCollections:(T==null?void 0:T.total)||null,orphanItems:R,collections:g,selectedItemId:s,selectedItem:_,selectedCollectionId:e,visibleItems:n,bodyShape:p,wearableController:E,isReviewing:a,isLoading:M,isPlayingEmote:w,hasUserOrphanItems:S,onSetItems:I,onFetchCollections:u,onFetchOrphanItems:N,onFetchOrphanItem:k})},Pa=ya;class me extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:o}=this.props;if(a.toHexString()!==s.value){const l=n.find(h=>h.toHexString()===s.value);o(l)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(d.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,n=e.toHexString();return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,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:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(d.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Aa=class extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:o,onChange:l,baseWearables:h}=this.props,g=s.value?h.find(p=>p.id===s.value):null;a!==g&&l(n,o,g??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:o,baseWearables:l}=this.props,h=ss(l,a,s).map(p=>({value:p.id,text:as(p)}));o&&h.push({value:"",text:r("global.none")});const g=e?h.find(p=>p.value===e.id):null;return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:h,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:g?g.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const Na=i=>({baseWearables:ns(i)}),ne=Fe(Na)(Aa);let Ra=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1});c(this,"analytics",Se());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:o,onSetItems:l}=this.props,h=a.find(p=>p.id===s),g=n.filter(p=>p.type!==L.EMOTE);g.forEach(p=>{var E;(E=this.analytics)==null||E.track("Play Emote",{EMOTE_PLAYED_BASE:!h,EMOTE_PLAYED_ITEM_ID:h!=null&&h.urn?Ce(h.urn):null,EMOTE_PLAYED_NAME:h?h.name:s,PREVIEWED_WEARABLE_ITEM_ID:p!=null&&p.urn?z(p.urn)?ze(p.urn):Ce(p.urn):null,PREVIEWED_WEARABLE_NAME:p.name})}),h?g.push(h):o(s),l(g)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(d.WearablePreview.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handleControlActionChange",async e=>{const{wearableController:s}=this.props,a=.1;if(s)switch(await(s==null?void 0:s.emote.pause()),e){case ae.ZOOM_IN:{await(s==null?void 0:s.scene.changeZoom(a));break}case ae.ZOOM_OUT:{await(s==null?void 0:s.scene.changeZoom(-a));break}}});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:o}=this.props,l=a.filter(h=>h.type!==L.EMOTE);s?(n(P.PreviewEmote.IDLE),o(l)):e==null||e.emote.play()});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(d.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(d.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,o=s.length>0;return a?null:t.jsx(d.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(d.Dropdown.Menu,{children:[o&&t.jsxs(t.Fragment,{children:[t.jsx(d.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(d.Dropdown.Divider,{}),s.map(l=>t.jsx(d.Dropdown.Item,{value:l.id,text:l.name,onClick:this.handleAnimationChange},l.id)),t.jsx(d.Dropdown.Divider,{}),t.jsx(d.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(d.Dropdown.Divider,{})]}),P.PreviewEmote.schema.enum.map(l=>t.jsx(d.Dropdown.Item,{value:l,text:r(`emotes.${l}`),onClick:this.handleAnimationChange},l))]})})});c(this,"renderEmoteSelector",()=>t.jsx(d.Popup,{content:r("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(d.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:o,onFetchBaseWearables:l,onFetchOrphanItems:h,onFetchCollectionItems:g}=this.props,p=a.length>0;n||l(),p||(s&&!V(s)?g(s.id):e&&o&&h(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 n=s.find(o=>o.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,n?n.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:n,emote:o,selectedBaseWearables:l,selectedItem:h,visibleItems:g,isImportFilesModalOpen:p,wearableController:E}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:S,isLoading:j}=this.state,_=g.some(X)&&(h==null?void 0:h.type)===L.EMOTE,f=o===P.PreviewEmote.JUMP?1:void 0;return t.jsxs("div",{className:`CenterPanel ${p?"import-files-modal-is-open":""}`,children:[t.jsx(d.WearablePreview,{id:"wearable-editor",profile:"default",bodyShape:e,emote:o,zoom:f,skin:de(s),eyes:de(a),hair:de(n),urns:l?Object.values(l).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:g.map(is),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:os,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:_,showSceneBoundaries:S}),_?t.jsxs("div",{className:"zoom-controls",children:[t.jsx(d.Button,{className:"zoom-control zoom-in-control",onClick:()=>this.handleControlActionChange(ae.ZOOM_IN),children:t.jsx(d.Icon,{name:"plus"})}),t.jsx(d.Button,{className:"zoom-control zoom-out-control",onClick:()=>this.handleControlActionChange(ae.ZOOM_OUT),children:t.jsx(d.Icon,{name:"minus"})})]}):null,j&&t.jsx(d.Center,{children:t.jsx(d.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[_&&!j&&E?t.jsx("div",{className:"emote-controls-container",children:t.jsx(d.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(d.Icon,{name:"user"})}),_?null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${S?"active":""}`,children:t.jsx(H,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:P.BodyShape.MALE,text:r("body_shapes.male")},{value:P.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:s,colors:ls(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:a,colors:rs(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:n,colors:ds(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.HAIR],category:P.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.FACIAL_HAIR],category:P.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.UPPER_BODY],category:P.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.LOWER_BODY],category:P.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const Ma=()=>{const i=te(),m=C(se),e=C(qe),s=C(cs),a=C(hs),n=C(ms),o=C(gs),l=C(ps),h=at(),g=C(Ze),p=C(us),E=C(Ke),w=C(Cs),S=C(je),j=C(Is),_=le(),f=we(),T=C(v=>f?fe(v,f):null),R=b.useMemo(()=>_?j.find(v=>v.id===_):void 0,[j,_]),M=b.useMemo(()=>_?p.filter(v=>v.collectionId===_):p.filter(v=>!v.collectionId),[p,_]),I=l?l[e]:null,N=b.useMemo(()=>!h.some(X)&&o===P.PreviewEmote.IDLE,[h,o])?!1:E,k="CreateSingleItemModal"in w,x=b.useMemo(()=>({onSetBodyShape:v=>{i(bs(v))},onSetAvatarAnimation:v=>{i(xs(v))},onSetSkinColor:v=>{i(_s(v))},onSetEyeColor:v=>{i(Es(v))},onSetHairColor:v=>{i(vs(v))},onSetBaseWearable:(v,O,re)=>{i(js(v,O,re))},onFetchBaseWearables:()=>{i(Ss())},onSetWearablePreviewController:v=>{i(fs(v))},onSetItems:v=>{i(Qe(v))},onFetchOrphanItems:(v,O)=>{i(Xe(v,O))},onFetchCollectionItems:(v,O)=>{i(Ts(v,O))}}),[i]);return t.jsx(Ra,{address:m,bodyShape:e,collection:R,selectedItem:T,selectedBaseWearables:I,skinColor:s,eyeColor:a,hairColor:n,emote:o,visibleItems:h,wearableController:g,emotes:M,isPlayingEmote:N,isImportFilesModalOpen:k,hasUserOrphanItems:S,...x})},Da=Ma;class La extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,o=e.target.value;s!==o&&n(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 oe extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{value:a,onChange:n}=this.props,o=s.value;o!==a&&(this.setState({value:o}),n(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,n=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:n?n.text:r("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(d.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})}}c(oe,"defaultProps",{disabled:!1});class be extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,o=s.value,l=[...n];for(const h of o)n.includes(h)||l.push(h);l.length!==n.length&&(this.setState({value:l}),a(l))});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==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:n}=this.state,o=a.reduce((l,h)=>(l[h.value]=h.text,l),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(ie,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(l=>t.jsxs("div",{className:"value",children:[o[l],t.jsx("div",{className:"remove",onClick:h=>{this.handleRemove(l),h.stopPropagation()}})]},l)):t.jsx("div",{className:"placeholder",children:r("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(d.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(be,"defaultProps",{disabled:!1});class nt extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{draft:"",value:this.props.value});c(this,"handleChange",e=>{this.setState({draft:e.target.value})});c(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,n=s.trim();if(n!=="")if(a.includes(n))this.setState({draft:""});else{const o=[...a,n];this.setState({value:o,draft:""}),e(o)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===ws||e.keyCode===Ne||e.keyCode===ys)this.handleAdd();else if(e.keyCode===Ps||e.keyCode===Ne){const{draft:s,value:a}=this.state,n=a[a.length-1];n&&s===""&&this.handleRemove(n)}});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==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(n=>t.jsxs("div",{className:"value",children:[n,t.jsx("div",{className:"remove",onClick:o=>{this.handleRemove(n),o.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(nt,"defaultProps",{isDisabled:!1});let Oa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Se());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[Re]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;ce(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===P.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===he.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(l=>!P.WearableCategory.schema.enum.includes(l)),...e]:n=[...a.filter(l=>!P.BodyPartCategory.schema.enum.includes(l)),...e];const o=this.setHides(this.state.data,n);this.setState({data:o,isDirty:this.isDirty({data:o})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,S;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:o,utility:l,rarity:h,contents:g,data:p,isDirty:E}=this.state;if(E&&e){let j=p;j&&!ce(j)&&(j={...j,removesDefaultHiding:j.category===P.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(P.WearableCategory.UPPER_BODY)?[P.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const _={...e.contents,...await As(g)},f={...e,name:n,description:o,rarity:h,data:j,contents:_,utility:l??void 0};s&&[Me.UNPUBLISHED,Me.UNDER_REVIEW].includes(s)&&(f.video=_[Re]),a(f,g),z(f.urn)&&((S=this.analytics)==null||S.track("Edit Item",{contents:g})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===L.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=Ns(e);this.setState({thumbnail:e,contents:{[De]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Le(a),o=await Le(a,1024,1024),l=URL.createObjectURL(n);this.setState({thumbnail:l,contents:{[De]:o},isDirty:!0})}});c(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;Ie(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&&Oe(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===P.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||!Je(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||ce(a))return null;const n=Rs(e.contents,a.category),o=Ms(e.contents),l=a.hides.filter(g=>n.includes(g)),h=a.hides.filter(g=>o.includes(g));return t.jsxs(t.Fragment,{children:[t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:h,options:this.asCategorySelect(e.type,o),disabled:!s,onChange:g=>this.handleChangeHides(g,"bodypart")}),t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:l,options:this.asCategorySelect(e.type,l.some(g=>g===P.WearableCategory.BODY_SHAPE)?n:n.filter(g=>g!==P.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:g=>this.handleChangeHides(g,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),o=s?t.jsx(d.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(H,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(H,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),o,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(pe,{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(H,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[o,t.jsx(pe,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(Ds,{item:e})]})}renderVideoDetails(e){if(!ke(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(H,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(H,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Be,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Ls(e)&&t.jsx(H,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Be,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Os,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:o,isCampaignEnabled:l,isVrmOptOutEnabled:h,campaignName:g,campaignTag:p}=this.props,{name:E,description:w,utility:S,rarity:j,data:_,isDirty:f,hasItem:T}=this.state,R=P.Rarity.getRarities(),M=ks();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(sa,{id:e,children:(I,u,N)=>{var O;const k=u&&Oe(u),x=this.canEditItemMetadata(I),v=I?Ie(I)?Bs(I.contents):Ws():[];return N?t.jsx(d.Loader,{size:"massive",active:!0}):T||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),I&&et(I,s)&&!I.isPublished&&!k?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[ue(I)!==null?t.jsx(d.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${ue(I)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(tt,{name:E,onDelete:this.handleDeleteItem,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(W,{label:r("item_editor.right_panel.details"),children:I?t.jsxs(t.Fragment,{children:[this.renderModelDetails(I),this.renderVideoDetails(I)]}):null}),t.jsx(W,{label:r("item_editor.right_panel.basics"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(La,{label:r("global.name"),value:E,disabled:!x,maxLength:Fs,onChange:this.handleChangeName}),t.jsx(d.TextAreaField,{maxLength:Vs,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!x,value:w,rows:"2",cols:"12"}),a?t.jsx(d.TextAreaField,{maxLength:Hs,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!x,value:S,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(oe,{itemId:I.id,label:r("global.category"),value:_.category,options:this.asCategorySelect(I.type,v),disabled:!x,onChange:this.handleChangeCategory}),!(I.urn&&z(I.urn))&&t.jsx(oe,{itemId:I.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(R),disabled:I.isPublished||!x,onChange:this.handleChangeRarity})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(ie,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(I)}),(I==null?void 0:I.type)===L.EMOTE&&t.jsx(W,{label:r("item_editor.right_panel.animation"),children:I?t.jsx(oe,{itemId:I.id,label:r("create_single_item_modal.play_mode_label"),value:_.loop?he.LOOP:he.SIMPLE,options:this.asPlayModeSelect(M),disabled:!x,onChange:this.handlePlayModeChange}):null}),I&&ke(I)&&((O=I.data.requiredPermissions)!=null&&O.length)?t.jsx(W,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(I)}):null,t.jsx(W,{label:r("item_editor.right_panel.tags"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(nt,{itemId:I.id,value:_.tags,onChange:this.handleChangeTags,isDisabled:!x}),l&&g&&p&&x&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:p}),event_name:t.jsx("span",{children:g})})})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&h&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(ie,{content:r("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:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(d.Checkbox,{toggle:!0,label:_!=null&&_.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(_!=null&&_.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(ie,{content:r("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:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(d.Checkbox,{toggle:!0,label:(_==null?void 0:_.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(_==null?void 0:_.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),f?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(d.Button,{secondary:!0,onClick:this.handleOnResetItem,children:r("global.cancel")}),t.jsx(We,{primary:!0,onClick:this.handleOnSaveItem,network:P.Network.MATIC,children:r("global.save")})]}):o&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",o]}):null]})]}):null}}):null})}};const ka=()=>{const i=te(),m=we(),e=C(u=>se(u)),s=C(u=>_e(u)),a=C(u=>Us(u)),n=C(u=>$s(u)),o=C(u=>Ve(u)),l=C(u=>Gs(u)),h=C(u=>Xs(u)),g=C(u=>Ys(u)),p=C(u=>Js(u)),E=C(u=>m?fe(u,m):null),w=C(u=>m&&E&&E.collectionId?Ee(u,E.collectionId):null),S=C(u=>{const N=ea(u),k=ta(u);return N==null?void 0:N[k]}),j=C(u=>zs(u)),_=C(u=>!E||!e?!1:w?Ue(u,e,w):et(E,e)),f=b.useMemo(()=>m?j[m]:null,[m,j]),T=b.useCallback((u,N)=>i(qs(u,N)),[i]),R=b.useCallback(u=>i(Ge(u)),[i]),M=b.useCallback((u,N)=>i($e(u,N)),[i]),I=b.useCallback(u=>i(Zs(u)),[i]);return t.jsx(Oa,{address:e,collection:w,selectedItem:E,selectedItemId:m,canEditSelectedItem:_,itemStatus:f,error:a,isConnected:s,isDownloading:n,isCommitteeMember:o,isCampaignEnabled:l,campaignTag:h,campaignName:S,isVrmOptOutEnabled:g,isWearableUtilityEnabled:p,onSaveItem:T,onDeleteItem:R,onOpenModal:M,onDownload:I})},Ba=ka;class Xa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{reviewedItems:[]});c(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(n=>n.id===a.id))]}))});c(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(ua,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Pa,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Da,{}),t.jsx(Ba,{})]})]})})}}export{Xa as default};
1
+ var ct=Object.defineProperty;var ht=(i,m,e)=>m in i?ct(i,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[m]=e;var c=(i,m,e)=>ht(i,typeof m!="symbol"?m+"":m,e);import{ae as q,H as t,M as d,G as r,bk as $,bK as mt,D as b,gu as Q,L as ee,K as F,ck as We,bF as P,N as Fe,bD as G,gv as gt,eG as pt,gw as ut,gx as Ct,gy as It,gz as bt,gA as xt,gB as _t,gC as Et,gD as vt,gE as V,eu as jt,gF as K,gG as Pe,a4 as te,Z as xe,a5 as C,aG as se,gH as St,df as _e,br as Ve,ff as Ee,fu as ft,fX as Tt,fY as wt,eD as ge,gn as yt,gI as Pt,gJ as At,f_ as Nt,eH as He,gK as Rt,gL as Mt,gM as Dt,gN as Lt,fp as Ot,fZ as kt,f$ as Bt,aM as ve,gO as Wt,gP as Ft,eV as Ae,bL as Vt,ad as Ht,eK as je,gQ as Ue,X as $e,ex as Ut,es as Ge,fH as X,dH as pe,et as $t,eY as ue,gR as Ye,bi as Se,fW as Je,e$ as L,ev as z,fD as ze,fE as Ce,J as H,fa as Ie,dG as Gt,eT as Yt,fm as Jt,gS as zt,gT as qe,gU as Ze,gV as Ke,fe,eE as qt,gW as Zt,gX as Kt,fL as Qe,eN as Qt,eM as Xe,eO as Xt,eQ as es,eR as ts,gY as ss,gZ as as,g_ as ns,g$ as ae,h0 as de,h1 as is,eh as os,h2 as ls,h3 as rs,h4 as ds,h5 as cs,h6 as hs,h7 as ms,h8 as gs,h9 as ps,ha as us,hb as Cs,fn as Is,hc as bs,hd as xs,he as _s,hf as Es,hg as vs,hh as js,hi as Ss,hj as fs,g0 as Ts,bV as ie,hk as ws,hl as Ne,hm as ys,hn as Ps,eX as Re,fI as ce,ho as he,eW as As,eS as Me,eZ as Ns,e_ as De,f0 as Le,f1 as Oe,hp as Rs,hq as Ms,f2 as Ds,f3 as ke,f4 as Be,hr as Ls,fd as Os,hs as ks,ht as Bs,hu as Ws,hv as et,hw as Fs,hx as Vs,hy as Hs,hz as Us,hA as $s,eJ as Gs,hB as Ys,fh as Js,fg as zs,fj as qs,hC as Zs}from"./index-R2Wjg1N9.js";import{g as le,h as Te,i as we}from"./hooks-Dztqgq6I.js";import{J as Ks}from"./JumpIn.container-Dg6l-_Dx.js";import{C as Qs}from"./CollectionProvider.container-B-xYoRRV.js";import{C as tt}from"./ConfirmDelete-pyR29k-n.js";import{C as st}from"./CollectionStatus.container-dnoQ-PBl.js";import{d as Xs,e as ea,c as ta}from"./selectors-BKk0tQag.js";import{I as sa}from"./ItemProvider.container-D6oTclNC.js";const aa=({open:i,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(d.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:i,children:[t.jsx(d.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(mt,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:s,children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),na=q.memo(aa);var D=(i=>(i.REJECT_COLLECTION="REJECT_COLLECTION",i.REJECT_CURATION="REJECT_CURATION",i.DISABLE_COLLECTION="DISABLE_COLLECTION",i.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",i))(D||{});const U="item_editor.top_panel.rejection_modal",ia=({open:i,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:o,curation:l,onReject:h,onRejectCuration:g,onClose:p})=>{const E=b.useMemo(()=>{switch(m){case D.DISABLE_COLLECTION:return U+".disable_collection";case D.REJECT_CURATION:return U+".reject_curation";case D.DISABLE_THIRD_PARTY:return U+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case D.DISABLE_COLLECTION:h(o);break;case D.REJECT_CURATION:g(l.collectionId);break;case D.DISABLE_THIRD_PARTY:s&&n(s.id);break}},S=m===D.DISABLE_COLLECTION&&!o.isApproved||m===D.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===D.REJECT_COLLECTION&&!o.isApproved||m===D.REJECT_CURATION&&(l==null?void 0:l.status)===Q.REJECTED;return t.jsx(d.Modal,{size:"tiny",className:"RejectionModal",open:i,children:a?t.jsx(oa,{i18nKey:E}):S?t.jsx(la,{link:o.forumLink,onClose:p}):t.jsx(ra,{i18nKey:E,isLoading:e,onClose:p,onConfirm:w})})},oa=({i18nKey:i})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${i}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx($,{id:U+".visit_activity",values:{activity_link:t.jsx(ee,{to:F.activity(),children:r("global.activity")})}})}),t.jsx(d.Loader,{active:!0,size:"large"})]})]}),la=({link:i,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(U+".veredict_explanation")}),t.jsx(d.Modal.Content,{children:r(U+".go_to_forum")}),t.jsxs(d.Modal.Actions,{children:[t.jsx("a",{href:i,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(d.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(U+".forum_link")}),t.jsx("div",{className:"discussion",children:r(U+".discussion")}),t.jsx(d.Icon,{name:"chevron right"})]})}),t.jsx(d.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),ra=({i18nKey:i,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsx(d.Modal.Content,{children:r(`${i}.subtitle`)}),t.jsxs(d.Modal.Actions,{children:[t.jsx(We,{primary:!0,onClick:e,disabled:m,loading:m,network:P.Network.MATIC,children:r(`${i}.action`)}),t.jsx(d.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),da=q.memo(ia),ca=(i,m)=>({isLoading:G(pt(i),gt)||G(Ct(i),ut)||It(i),hasPendingTransaction:bt(i)||!!(m.thirdParty&&xt(i,m.thirdParty.id))}),ha=i=>({onReject:m=>i(_t(m)),onRejectCuration:m=>i(Et(m)),onDisableThirdParty:m=>i(vt(m))}),ma=Fe(ca,ha)(da);var y=(i=>(i[i.APPROVE=0]="APPROVE",i[i.REJECT=1]="REJECT",i[i.ENABLE=2]="ENABLE",i[i.DISABLE=3]="DISABLE",i[i.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",i))(y||{});let ga=class extends q.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push(F.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:o,onSetAssignee:l}=this.props;this.setState({showApproveConfirmModal:!1}),a&&l(e.id,a,s),V(e)?o(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:o,thirdParty:l}=this.props,{showRejectionModal:h,showApproveConfirmModal:g}=this.state,{chainId:p}=this.props,E=jt(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," · ",r(`collection.type.${E}`),t.jsx(Ks,{size:"small",active:!0,collection:e,chainId:p,items:V(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:V(e)&&o!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),h&&t.jsx(ma,{type:h,open:!0,collection:e,curation:n,thirdParty:l,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&g&&t.jsx(na,{open:!0,assignee:n.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,n),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});c(this,"renderButton",(e,s,a)=>{const{address:n,thirdParty:o,onInitiateApprovalFlow:l,onInitiateTPApprovalFlow:h,onDeployMissingEntities:g,reviewedItems:p,totalItems:E}=this.props,w={[y.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):V(s)?h(s):l(s),[y.ENABLE]:()=>l(s),[y.DISABLE]:()=>this.setShowRejectionModal(o?D.DISABLE_THIRD_PARTY:D.DISABLE_COLLECTION),[y.REJECT]:()=>{(a==null?void 0:a.status)===Q.PENDING?this.setShowRejectionModal(D.REJECT_CURATION):this.setShowRejectionModal(D.REJECT_COLLECTION)},[y.DEPLOY_MISSING_ENTITIES]:()=>g(s)},S={[y.APPROVE]:"approve",[y.ENABLE]:"enable",[y.DISABLE]:"disable",[y.REJECT]:"reject",[y.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===y.APPROVE||e===y.ENABLE||e===y.DEPLOY_MISSING_ENTITIES,_=!V(s)||!!E&&p.length>=K(E);return t.jsx(d.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:_,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(d.Button,{primary:j,onClick:()=>w[e](),disabled:V(s)&&e===y.APPROVE&&!!E&&p.length<K(E),children:r(`item_editor.top_panel.${S[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:o,thirdParty:l}=this.props,h=a==null?void 0:a.some(g=>g.status===Q.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(d.Header,{sub:!0,children:[h?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:K(o)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=K(o)?t.jsx(d.Icon,{name:"check circle"}):null]}),h&&this.renderButton(y.APPROVE,e,s),h&&this.renderButton(y.REJECT,e,s),!h&&(l==null?void 0:l.isApproved)&&this.renderButton(y.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)?this.renderButton(y.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:o,isLoading:l}=this.props,h=!e||l&&!s.length;return a&&n&&o?t.jsx("div",{className:"TopPanel",children:h?t.jsx(d.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const pa=({reviewedItems:i})=>{const m=te(),e=xe(),s=le(),a=Te(),n=C(se),o=C(St),l=C(_e),h=C(Ve),g=C(u=>s?Ee(u,s):null),p=C(u=>g?ft(u,g.id):[]),E=C(u=>g?Tt(u,g.id):[]),w=C(u=>s?wt(u,s):null),S=C(u=>s?ge(u,s):void 0),j=C(u=>g&&V(g)?yt(u,g):null),_=C(u=>s?Pt(u,s):!1),f=C(u=>G(At(u),Ot)||G(Nt(u),kt)||G(He(u),Bt)),T=b.useCallback((u,N,k)=>{m(Rt(u,N,k))},[m]),R=b.useCallback(u=>{m(Mt(u))},[m]),M=b.useCallback(u=>{m(Dt(u))},[m]),I=b.useCallback(u=>{m(Lt(u))},[m]);return t.jsx(ga,{address:n,items:p,totalItems:(S==null?void 0:S.total)||null,collection:g,itemCurations:E,thirdParty:j,curation:w,chainId:o,isConnected:l,isReviewing:a,isCommitteeMember:h,selectedCollectionId:s,hasCollectionMissingEntities:_,isLoading:f,reviewedItems:i,onSetAssignee:T,onInitiateTPApprovalFlow:R,onInitiateApprovalFlow:M,onDeployMissingEntities:I,history:e})},ua=pa,at=()=>{const{search:i}=ve();return C(e=>Wt(e,i))},Ca="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",Ia=i=>{const{collectionId:m}=i,[e,s]=b.useState(!1),[a,n]=b.useState(null),o=xe(),l=ve(),h=b.useMemo(()=>Ft(l.search),[l.search]);b.useEffect(()=>{h&&(s(!0),n(h))},[h]);function g(){s(!1);const p=new URLSearchParams(l.search);p.delete("newItem"),o.replace({search:p.toString()})}return e&&a&&m?t.jsx(d.Toast,{type:d.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:Ca,alt:r("sagas.item.item_added_toast.title")})}),onClose:g,body:t.jsx($,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:p=>t.jsx("strong",{children:p}),"collection-link":p=>t.jsx(ee,{to:F.collectionDetail(m),children:t.jsx(d.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:p})})}})}):null},ba=q.memo(Ia),xa=({collection:i,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:o})=>{var I,u;const l=ve(),h=xe(),g=((I=l.state)==null?void 0:I.fromParam)===Ae.COLLECTIONS,p=((u=l.state)==null?void 0:u.fromParam)===Ae.TP_COLLECTIONS,E=b.useCallback(()=>{h.push(F.collections())},[h]),w=b.useCallback(()=>{if(i&&(g||p)){const N=g?F.collectionDetail:F.thirdPartyCollectionDetail;h.push(N(i.id))}else h.push(F.itemEditor())},[g,p,h,i]),S=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{i&&n("CreateSingleItemModal",{collectionId:i.id})},[i,n]),_=b.useCallback(()=>{i&&n("AddExistingItemModal",{collectionId:i.id})},[i,n]),f=b.useCallback(()=>{i&&n("EditCollectionNameModal",{collection:i})},[i,n]),T=b.useCallback(()=>{i&&o(i)},[i,o]),R=b.useCallback(()=>{const N=i&&Vt(i.owner,m||"");return i?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${g||p?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(ee,{to:F.collectionDetail(i.id),children:i.name}),t.jsx(st,{collection:i})]}),N&&!i.isPublished?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[t.jsx(d.Dropdown.Item,{onClick:f,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(d.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(d.Dropdown.Item,{onClick:_,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(tt,{name:i.name,onDelete:T,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[i,m,e,g,p]),M=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:E}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(d.Dropdown.Menu,{children:t.jsx(d.Dropdown.Item,{onClick:S,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(d.Row,{grow:!1,shrink:!1,className:"Header",children:i?R():M()})},_a=()=>{const i=le();return C(m=>i?Ee(m,i):null)},Ea=()=>{const i=te(),m=C(se),e=C(Ht),s=Te(),a=C(je),n=_a(),o=C(p=>!!(n&&m&&Ue(p,m,n))),l=b.useCallback((p,E)=>i($e(p,E)),[i]),h=b.useCallback(p=>i(Ut(p)),[i]),g=b.useCallback(p=>i(Ge(p)),[i]);return t.jsx(xa,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:l,onDeleteCollection:h,onDeleteItem:g,hasEditRights:o,hasUserOrphanItems:a})},B=10;class W extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"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:n?s:null})]})}}class va extends b.PureComponent{constructor(){super(...arguments);c(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(d.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:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(ee,{to:F.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(pe,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx($t,{item:e}),e.name]}),t.jsx(d.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${ue(e)}`).toLowerCase()})}),disabled:Ye(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var A=(i=>(i.TO_REVIEW="to-review",i.REVIEWED="reviewed",i.ALL_ITEMS="all-items",i))(A||{});const ja={[A.TO_REVIEW]:1,[A.REVIEWED]:1,[A.ALL_ITEMS]:1};class Sa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:A.TO_REVIEW,currentPages:ja,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Se());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===A.TO_REVIEW&&!Je(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var g;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:o,onSetItems:l}=this.props;if(!Ye(e,s))return;let h=a.filter(p=>p.id!==e.id);if(X(e))if(this.isVisible(e)){o?n==null||n.emote.pause():n==null||n.emote.play();return}else h=h.filter(p=>p.type!==L.EMOTE);this.isVisible(e)||(h.push(e),(g=this.analytics)==null||g.track("Preview Item",{ITEM_ID:e!=null&&e.urn?z(e.urn)?ze(e.urn):Ce(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:z(e.urn)})),l(h)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:o}=this.state;e===A.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(o[A.ALL_ITEMS])}):e===A.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(o=>({currentPages:{...o.currentPages,[a]:+s.activePage}})),a!==A.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(A.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?z(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:o}=this.props;return t.jsx(va,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:o,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(Ie),a=e.filter(X);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(W,{label:this.renderCollapsableLabel(L.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(W,{label:this.renderCollapsableLabel(L.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],o=Math.ceil(e/B);return o>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:o,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],o=(n-1)*B,l=n*B;return t.jsx(d.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:o,pageEnd:l>e?e:l,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:o,currentPages:l}=this.state,h=this.getIsReviewingTPItems(),g=l[o];if(s)return t.jsx(d.Loader,{size:"large",active:!0});switch(o){case A.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!h&&a?this.renderTabPagination(a):null]});case A.REVIEWED:{const p=n.slice((g-1)*B,g*B);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(p),n.length?this.renderTabPagination(n.length):null]})}case A.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}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let o;const l=!s||s<B||a.length===s;switch(n){case A.TO_REVIEW:o=t.jsx(d.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!l,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(d.Button,{disabled:e||l,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(d.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case A.REVIEWED:o=t.jsx($,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:K(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",o," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(d.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx($,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:A.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(d.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(d.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(d.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:()=>this.handleTabChange(A.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:e===A.TO_REVIEW,onClick:()=>this.handleTabChange(A.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(d.Tabs.Tab,{active:e===A.REVIEWED,onClick:()=>this.handleTabChange(A.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(d.Tabs.Tab,{active:e===A.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(H,{name:e}),t.jsx($,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(d.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class fa extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(ee,{to:F.itemEditor({collectionId:m.id}),children:[t.jsx(Gt,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(st,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class Ta extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentPage:1});c(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:n,totalCollections:o}=this.props,{currentPage:l}=this.state;if(e.length===0)return null;const h=Math.ceil(o/B);return s?t.jsx(d.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(d.Section,{className:"Collections",children:[e.map(g=>t.jsx(fa,{collection:g,items:a,isSelected:g.id===n},g.id)),h>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:h,activePage:l,onPageChange:this.handlePageChange}):null]})})}}var J=(i=>(i.COLLECTIONS="collections",i.ORPHAN_ITEMS="orphanItems",i))(J||{});const Y=1;let wa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",this.getInitialState());c(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});c(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:n,selectedCollectionId:o}=this.props,{pages:l}=this.state;if(e&&!n&&!o){const h=l[l.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:B,page:h})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:o}=this.props,l=this.isCollectionTabActive()?n:a,h=Math.ceil(l/B);if(h>s.length){const g=[...Array(h).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(E=>({pages:[...E.pages,p]}),this.fetchResource)}}o(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[Y]},this.fetchResource)});c(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:[Y],currentTab:a,initialPage:Y,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:o}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&o([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:o,selectedItemId:l,selectedItem:h,orphanItems:g,totalItems:p,visibleItems:E,hasUserOrphanItems:w,onSetItems:S,onFetchOrphanItem:j}=this.props,{initialPage:_,pages:f}=this.state;if(!o&&n&&l&&p&&(_===Y||s.initialPage<_)){if(!g.find(T=>T.id===l)){const T=Math.ceil(p/B),R=f[f.length-1],M=Math.min(T,R+1);f.includes(M)||this.setState({pages:[M],initialPage:M},this.fetchResource)}}else if(e.selectedItemId&&l&&e.selectedItemId!==l){const T=E.filter(R=>R.type!==L.EMOTE);S(T)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!o)&&this.setState({pages:[Y]},this.fetchResource),e.selectedCollectionId!==o&&this.setState({pages:[Y]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&h&&h.type!==L.EMOTE&&S([h]),e.selectedCollectionId!==o&&S([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:o,isReviewing:l}=this.props;return n&&e?Yt(e)&&l?s.filter(h=>!!(a!=null&&a.find(g=>g.itemId===h.id&&g.status===Q.PENDING))):s:o}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:o,selectedCollectionId:l,visibleItems:h,bodyShape:g,reviewedItems:p,isReviewing:E,isPlayingEmote:w,isConnected:S,wearableController:j,isLoading:_,hasUserOrphanItems:f,onSetItems:T,onSetReviewedItems:R,onResetReviewedItems:M}=this.props,{pages:I,showSamplesModalAgain:u}=this.state,N=!l&&f,k=this.isCollectionTabActive()&&!l,x=!this.isCollectionTabActive()||l;return t.jsx("div",{className:"LeftPanel",children:S?t.jsx(Qs,{id:l,itemSelected:o,itemsPage:I,itemsPageSize:B,fetchCollectionItemsOptions:{status:E?Q.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:O,paginatedItems:re,initialPage:it,isLoadingCollection:ot,isLoadingCollectionItems:lt,itemCurations:rt})=>{const Z=this.getItems(O,re,rt),ye=this.isCollectionTabActive(),dt=l&&O?it:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(Ea,{}),N?t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:ye,onClick:()=>this.handleTabChange(J.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(d.Tabs.Tab,{active:!ye,onClick:()=>this.handleTabChange(J.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,k?t.jsx(Ta,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Z.length>0,selectedCollectionId:l,onLoadPage:this.loadPage,isLoading:ot}):null,x?t.jsxs(t.Fragment,{children:[t.jsx(Sa,{items:Z,totalItems:s||Z.length,hasHeader:!l&&n.length>0,selectedItemId:o,collection:O,isReviewing:E,isPlayingEmote:w,visibleItems:h,bodyShape:g,onResetReviewedItems:M,reviewedItems:p,onSetItems:T,wearableController:j,initialPage:dt,isLoading:lt||_,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:u,onReviewItems:()=>R(Z),onLoadRandomPage:()=>this.loadRandomPage(Z),onLoadPage:this.loadPage}),t.jsx(ba,{collectionId:l})]}):null]})}}):null})}};const ya=i=>{const m=te(),e=le(),s=we(),a=Te(),n=at(),o=C(x=>se(x)),l=C(x=>_e(x)),h=C(x=>Jt(x)),g=C(x=>zt(x)),p=C(x=>qe(x)),E=C(x=>Ze(x)),w=C(x=>Ke(x)),S=C(x=>je(x)),j=C(x=>He(x)),_=C(x=>s?fe(x,s):null),f=C(x=>{if(e)return ge(x,e);if(o)return ge(x,o)}),T=C(x=>e?void 0:qt(x)),R=C(x=>o&&!e?Zt(x,o,f==null?void 0:f.limit):Kt(x)),M=b.useMemo(()=>G(j,es)||G(j,ts),[j]),I=b.useCallback(x=>m(Qe(x)),[m]),u=b.useCallback((x,v)=>m(Qt(x,v)),[m]),N=b.useCallback((x,v)=>m(Xe(x,v)),[m]),k=b.useCallback(x=>m(Xt(x)),[m]);return t.jsx(wa,{...i,address:o,isConnected:l,items:h,totalItems:(f==null?void 0:f.total)||null,totalCollections:(T==null?void 0:T.total)||null,orphanItems:R,collections:g,selectedItemId:s,selectedItem:_,selectedCollectionId:e,visibleItems:n,bodyShape:p,wearableController:E,isReviewing:a,isLoading:M,isPlayingEmote:w,hasUserOrphanItems:S,onSetItems:I,onFetchCollections:u,onFetchOrphanItems:N,onFetchOrphanItem:k})},Pa=ya;class me extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:o}=this.props;if(a.toHexString()!==s.value){const l=n.find(h=>h.toHexString()===s.value);o(l)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(d.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,n=e.toHexString();return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,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:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(d.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Aa=class extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:o,onChange:l,baseWearables:h}=this.props,g=s.value?h.find(p=>p.id===s.value):null;a!==g&&l(n,o,g??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:o,baseWearables:l}=this.props,h=ss(l,a,s).map(p=>({value:p.id,text:as(p)}));o&&h.push({value:"",text:r("global.none")});const g=e?h.find(p=>p.value===e.id):null;return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:h,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:g?g.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const Na=i=>({baseWearables:ns(i)}),ne=Fe(Na)(Aa);let Ra=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1});c(this,"analytics",Se());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:o,onSetItems:l}=this.props,h=a.find(p=>p.id===s),g=n.filter(p=>p.type!==L.EMOTE);g.forEach(p=>{var E;(E=this.analytics)==null||E.track("Play Emote",{EMOTE_PLAYED_BASE:!h,EMOTE_PLAYED_ITEM_ID:h!=null&&h.urn?Ce(h.urn):null,EMOTE_PLAYED_NAME:h?h.name:s,PREVIEWED_WEARABLE_ITEM_ID:p!=null&&p.urn?z(p.urn)?ze(p.urn):Ce(p.urn):null,PREVIEWED_WEARABLE_NAME:p.name})}),h?g.push(h):o(s),l(g)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(d.WearablePreview.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handleControlActionChange",async e=>{const{wearableController:s}=this.props,a=.1;if(s)switch(await(s==null?void 0:s.emote.pause()),e){case ae.ZOOM_IN:{await(s==null?void 0:s.scene.changeZoom(a));break}case ae.ZOOM_OUT:{await(s==null?void 0:s.scene.changeZoom(-a));break}}});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:o}=this.props,l=a.filter(h=>h.type!==L.EMOTE);s?(n(P.PreviewEmote.IDLE),o(l)):e==null||e.emote.play()});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(d.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(d.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,o=s.length>0;return a?null:t.jsx(d.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(d.Dropdown.Menu,{children:[o&&t.jsxs(t.Fragment,{children:[t.jsx(d.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(d.Dropdown.Divider,{}),s.map(l=>t.jsx(d.Dropdown.Item,{value:l.id,text:l.name,onClick:this.handleAnimationChange},l.id)),t.jsx(d.Dropdown.Divider,{}),t.jsx(d.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(d.Dropdown.Divider,{})]}),P.PreviewEmote.schema.enum.map(l=>t.jsx(d.Dropdown.Item,{value:l,text:r(`emotes.${l}`),onClick:this.handleAnimationChange},l))]})})});c(this,"renderEmoteSelector",()=>t.jsx(d.Popup,{content:r("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(d.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:o,onFetchBaseWearables:l,onFetchOrphanItems:h,onFetchCollectionItems:g}=this.props,p=a.length>0;n||l(),p||(s&&!V(s)?g(s.id):e&&o&&h(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 n=s.find(o=>o.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,n?n.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:n,emote:o,selectedBaseWearables:l,selectedItem:h,visibleItems:g,isImportFilesModalOpen:p,wearableController:E}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:S,isLoading:j}=this.state,_=g.some(X)&&(h==null?void 0:h.type)===L.EMOTE,f=o===P.PreviewEmote.JUMP?1:void 0;return t.jsxs("div",{className:`CenterPanel ${p?"import-files-modal-is-open":""}`,children:[t.jsx(d.WearablePreview,{id:"wearable-editor",profile:"default",bodyShape:e,emote:o,zoom:f,skin:de(s),eyes:de(a),hair:de(n),urns:l?Object.values(l).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:g.map(is),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:os,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:_,showSceneBoundaries:S}),_?t.jsxs("div",{className:"zoom-controls",children:[t.jsx(d.Button,{className:"zoom-control zoom-in-control",onClick:()=>this.handleControlActionChange(ae.ZOOM_IN),children:t.jsx(d.Icon,{name:"plus"})}),t.jsx(d.Button,{className:"zoom-control zoom-out-control",onClick:()=>this.handleControlActionChange(ae.ZOOM_OUT),children:t.jsx(d.Icon,{name:"minus"})})]}):null,j&&t.jsx(d.Center,{children:t.jsx(d.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[_&&!j&&E?t.jsx("div",{className:"emote-controls-container",children:t.jsx(d.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(d.Icon,{name:"user"})}),_?null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${S?"active":""}`,children:t.jsx(H,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:P.BodyShape.MALE,text:r("body_shapes.male")},{value:P.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:s,colors:ls(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:a,colors:rs(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:n,colors:ds(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.HAIR],category:P.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.FACIAL_HAIR],category:P.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.UPPER_BODY],category:P.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ne,{wearable:l[P.WearableCategory.LOWER_BODY],category:P.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const Ma=()=>{const i=te(),m=C(se),e=C(qe),s=C(cs),a=C(hs),n=C(ms),o=C(gs),l=C(ps),h=at(),g=C(Ze),p=C(us),E=C(Ke),w=C(Cs),S=C(je),j=C(Is),_=le(),f=we(),T=C(v=>f?fe(v,f):null),R=b.useMemo(()=>_?j.find(v=>v.id===_):void 0,[j,_]),M=b.useMemo(()=>_?p.filter(v=>v.collectionId===_):p.filter(v=>!v.collectionId),[p,_]),I=l?l[e]:null,N=b.useMemo(()=>!h.some(X)&&o===P.PreviewEmote.IDLE,[h,o])?!1:E,k="CreateSingleItemModal"in w,x=b.useMemo(()=>({onSetBodyShape:v=>{i(bs(v))},onSetAvatarAnimation:v=>{i(xs(v))},onSetSkinColor:v=>{i(_s(v))},onSetEyeColor:v=>{i(Es(v))},onSetHairColor:v=>{i(vs(v))},onSetBaseWearable:(v,O,re)=>{i(js(v,O,re))},onFetchBaseWearables:()=>{i(Ss())},onSetWearablePreviewController:v=>{i(fs(v))},onSetItems:v=>{i(Qe(v))},onFetchOrphanItems:(v,O)=>{i(Xe(v,O))},onFetchCollectionItems:(v,O)=>{i(Ts(v,O))}}),[i]);return t.jsx(Ra,{address:m,bodyShape:e,collection:R,selectedItem:T,selectedBaseWearables:I,skinColor:s,eyeColor:a,hairColor:n,emote:o,visibleItems:h,wearableController:g,emotes:M,isPlayingEmote:N,isImportFilesModalOpen:k,hasUserOrphanItems:S,...x})},Da=Ma;class La extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,o=e.target.value;s!==o&&n(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 oe extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{value:a,onChange:n}=this.props,o=s.value;o!==a&&(this.setState({value:o}),n(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,n=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:n?n.text:r("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(d.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})}}c(oe,"defaultProps",{disabled:!1});class be extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,o=s.value,l=[...n];for(const h of o)n.includes(h)||l.push(h);l.length!==n.length&&(this.setState({value:l}),a(l))});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==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:n}=this.state,o=a.reduce((l,h)=>(l[h.value]=h.text,l),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(ie,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(l=>t.jsxs("div",{className:"value",children:[o[l],t.jsx("div",{className:"remove",onClick:h=>{this.handleRemove(l),h.stopPropagation()}})]},l)):t.jsx("div",{className:"placeholder",children:r("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(d.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(be,"defaultProps",{disabled:!1});class nt extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{draft:"",value:this.props.value});c(this,"handleChange",e=>{this.setState({draft:e.target.value})});c(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,n=s.trim();if(n!=="")if(a.includes(n))this.setState({draft:""});else{const o=[...a,n];this.setState({value:o,draft:""}),e(o)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===ws||e.keyCode===Ne||e.keyCode===ys)this.handleAdd();else if(e.keyCode===Ps||e.keyCode===Ne){const{draft:s,value:a}=this.state,n=a[a.length-1];n&&s===""&&this.handleRemove(n)}});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==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(n=>t.jsxs("div",{className:"value",children:[n,t.jsx("div",{className:"remove",onClick:o=>{this.handleRemove(n),o.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(nt,"defaultProps",{isDisabled:!1});let Oa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Se());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[Re]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;ce(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===P.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===he.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(l=>!P.WearableCategory.schema.enum.includes(l)),...e]:n=[...a.filter(l=>!P.BodyPartCategory.schema.enum.includes(l)),...e];const o=this.setHides(this.state.data,n);this.setState({data:o,isDirty:this.isDirty({data:o})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,S;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:o,utility:l,rarity:h,contents:g,data:p,isDirty:E}=this.state;if(E&&e){let j=p;j&&!ce(j)&&(j={...j,removesDefaultHiding:j.category===P.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(P.WearableCategory.UPPER_BODY)?[P.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const _={...e.contents,...await As(g)},f={...e,name:n,description:o,rarity:h,data:j,contents:_,utility:l??void 0};s&&[Me.UNPUBLISHED,Me.UNDER_REVIEW].includes(s)&&(f.video=_[Re]),a(f,g),z(f.urn)&&((S=this.analytics)==null||S.track("Edit Item",{contents:g})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===L.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=Ns(e);this.setState({thumbnail:e,contents:{[De]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Le(a),o=await Le(a,1024,1024),l=URL.createObjectURL(n);this.setState({thumbnail:l,contents:{[De]:o},isDirty:!0})}});c(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;Ie(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&&Oe(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===P.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||!Je(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||ce(a))return null;const n=Rs(e.contents,a.category),o=Ms(e.contents),l=a.hides.filter(g=>n.includes(g)),h=a.hides.filter(g=>o.includes(g));return t.jsxs(t.Fragment,{children:[t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:h,options:this.asCategorySelect(e.type,o),disabled:!s,onChange:g=>this.handleChangeHides(g,"bodypart")}),t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:l,options:this.asCategorySelect(e.type,l.some(g=>g===P.WearableCategory.BODY_SHAPE)?n:n.filter(g=>g!==P.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:g=>this.handleChangeHides(g,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),o=s?t.jsx(d.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(H,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(H,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),o,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(pe,{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(H,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[o,t.jsx(pe,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(Ds,{item:e})]})}renderVideoDetails(e){if(!ke(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(H,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(H,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Be,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Ls(e)&&t.jsx(H,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Be,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Os,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:o,isCampaignEnabled:l,isVrmOptOutEnabled:h,campaignName:g,campaignTag:p}=this.props,{name:E,description:w,utility:S,rarity:j,data:_,isDirty:f,hasItem:T}=this.state,R=P.Rarity.getRarities(),M=ks();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(sa,{id:e,children:(I,u,N)=>{var O;const k=u&&Oe(u),x=this.canEditItemMetadata(I),v=I?Ie(I)?Bs(I.contents):Ws():[];return N?t.jsx(d.Loader,{size:"massive",active:!0}):T||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),I&&et(I,s)&&!I.isPublished&&!k?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[ue(I)!==null?t.jsx(d.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${ue(I)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(tt,{name:E,onDelete:this.handleDeleteItem,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(W,{label:r("item_editor.right_panel.details"),children:I?t.jsxs(t.Fragment,{children:[this.renderModelDetails(I),this.renderVideoDetails(I)]}):null}),t.jsx(W,{label:r("item_editor.right_panel.basics"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(La,{label:r("global.name"),value:E,disabled:!x,maxLength:Fs,onChange:this.handleChangeName}),t.jsx(d.TextAreaField,{maxLength:Vs,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!x,value:w,rows:"2",cols:"12"}),a?t.jsx(d.TextAreaField,{maxLength:Hs,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!x,value:S,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(oe,{itemId:I.id,label:r("global.category"),value:_.category,options:this.asCategorySelect(I.type,v),disabled:!x,onChange:this.handleChangeCategory}),!(I.urn&&z(I.urn))&&t.jsx(oe,{itemId:I.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(R),disabled:I.isPublished||!x,onChange:this.handleChangeRarity})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(ie,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(I)}),(I==null?void 0:I.type)===L.EMOTE&&t.jsx(W,{label:r("item_editor.right_panel.animation"),children:I?t.jsx(oe,{itemId:I.id,label:r("create_single_item_modal.play_mode_label"),value:_.loop?he.LOOP:he.SIMPLE,options:this.asPlayModeSelect(M),disabled:!x,onChange:this.handlePlayModeChange}):null}),I&&ke(I)&&((O=I.data.requiredPermissions)!=null&&O.length)?t.jsx(W,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(I)}):null,t.jsx(W,{label:r("item_editor.right_panel.tags"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(nt,{itemId:I.id,value:_.tags,onChange:this.handleChangeTags,isDisabled:!x}),l&&g&&p&&x&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:p}),event_name:t.jsx("span",{children:g})})})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&h&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(ie,{content:r("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:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(d.Checkbox,{toggle:!0,label:_!=null&&_.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(_!=null&&_.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(ie,{content:r("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:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(d.Checkbox,{toggle:!0,label:(_==null?void 0:_.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(_==null?void 0:_.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),f?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(d.Button,{secondary:!0,onClick:this.handleOnResetItem,children:r("global.cancel")}),t.jsx(We,{primary:!0,onClick:this.handleOnSaveItem,network:P.Network.MATIC,children:r("global.save")})]}):o&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",o]}):null]})]}):null}}):null})}};const ka=()=>{const i=te(),m=we(),e=C(u=>se(u)),s=C(u=>_e(u)),a=C(u=>Us(u)),n=C(u=>$s(u)),o=C(u=>Ve(u)),l=C(u=>Gs(u)),h=C(u=>Xs(u)),g=C(u=>Ys(u)),p=C(u=>Js(u)),E=C(u=>m?fe(u,m):null),w=C(u=>m&&E&&E.collectionId?Ee(u,E.collectionId):null),S=C(u=>{const N=ea(u),k=ta(u);return N==null?void 0:N[k]}),j=C(u=>zs(u)),_=C(u=>!E||!e?!1:w?Ue(u,e,w):et(E,e)),f=b.useMemo(()=>m?j[m]:null,[m,j]),T=b.useCallback((u,N)=>i(qs(u,N)),[i]),R=b.useCallback(u=>i(Ge(u)),[i]),M=b.useCallback((u,N)=>i($e(u,N)),[i]),I=b.useCallback(u=>i(Zs(u)),[i]);return t.jsx(Oa,{address:e,collection:w,selectedItem:E,selectedItemId:m,canEditSelectedItem:_,itemStatus:f,error:a,isConnected:s,isDownloading:n,isCommitteeMember:o,isCampaignEnabled:l,campaignTag:h,campaignName:S,isVrmOptOutEnabled:g,isWearableUtilityEnabled:p,onSaveItem:T,onDeleteItem:R,onOpenModal:M,onDownload:I})},Ba=ka;class Xa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{reviewedItems:[]});c(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(n=>n.id===a.id))]}))});c(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(ua,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Pa,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Da,{}),t.jsx(Ba,{})]})]})})}}export{Xa as default};
@@ -0,0 +1 @@
1
+ import{ak as o}from"./index-R2Wjg1N9.js";export{o as default};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var j=(r,a,e)=>a in r?f(r,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[a]=e;var i=(r,a,e)=>j(r,typeof a!="symbol"?a+"":a,e);import{D as b,dz as O,bK as v,dA as L,bP as x,H as s,M as u,ci as S,G as o,L as y,K as E,cj as R,b4 as N,ch as P,bk as _,N as A,dB as C}from"./index-B0M-djtI.js";import{L as w}from"./LandAction-BOHyksXY.js";import{L as T}from"./LandProviderPage-DrDHCi9R.js";import"./Back-DdrQYZHm.js";import"./NotFound-DrpmeGv3.js";import"./hooks-Bu702gkG.js";class D extends b.PureComponent{constructor(){super(...arguments);i(this,"state",{address:"",initial:"",loading:!1,editing:!1,dirty:!1,revoked:!1});i(this,"handleSetOperator",()=>{const{land:e,onSetOperator:t}=this.props,{address:n,revoked:p}=this.state;t(e,p?null:n)});i(this,"handleChange",(e,t)=>{this.setState({address:t.value,dirty:!0,revoked:!1})});i(this,"handleRevoke",()=>{this.setState({revoked:!0,dirty:!0})});i(this,"handleUndo",()=>{this.setState({revoked:!1,dirty:!1})})}async componentWillMount(){this.setState({loading:!0});const{land:e}=this.props,t=await O(e);t!==null?this.setState({address:t,initial:t,loading:!1,editing:!0}):this.setState({loading:!1})}render(){const{land:e}=this.props,{address:t,loading:n,dirty:p,revoked:d,editing:g,initial:m}=this.state,c=g&&v(t,m),h=!n&&!!t&&!P(t),k=n||!p||(v(t,m)||h)&&!d||!L(e,[x.OWNER,x.TENANT]),l=[];return d&&l.push("revoked"),g&&l.push("editing"),c&&l.push("is-revokable"),s.jsxs(u.Form,{className:"LandOperatorForm",children:[s.jsx(S,{placeholder:"0x...",label:o("operator_page.address"),className:l.join(" "),value:t,onChange:this.handleChange,loading:n,action:c?d?o("operator_page.undo"):o("operator_page.revoke"):void 0,onAction:c?d?this.handleUndo:this.handleRevoke:void 0,error:h,message:h?o("operator_page.invalid_address"):void 0}),s.jsxs(u.Row,{children:[s.jsx(y,{className:"cancel",to:E.landDetail(e.id),children:s.jsx(u.Button,{children:o("global.cancel")})}),s.jsx(R,{type:"submit",primary:!0,disabled:k,onClick:this.handleSetOperator,network:N.Network.ETHEREUM,children:o("global.submit")})]})]})}}let F=class extends b.PureComponent{render(){const{onSetOperator:a}=this.props;return s.jsx(T,{children:e=>s.jsx(w,{land:e,title:o("operator_page.title"),subtitle:s.jsx(_,{id:"operator_page.subtitle",values:{name:s.jsx("strong",{children:e.name}),b:t=>s.jsx("strong",{children:t}),br:()=>s.jsx("br",{})}}),children:s.jsx(D,{land:e,onSetOperator:a})})})}};const U=r=>({onSetOperator:(a,e)=>r(C(a,e))}),V=A(void 0,U)(F);export{V as default};
1
+ var f=Object.defineProperty;var j=(r,a,e)=>a in r?f(r,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[a]=e;var i=(r,a,e)=>j(r,typeof a!="symbol"?a+"":a,e);import{D as k,dA as O,bL as v,dB as L,bQ as x,H as s,M as u,cj as S,G as o,L as y,K as E,ck as R,bF as N,ci as _,bk as C,N as P,dC as A}from"./index-R2Wjg1N9.js";import{L as w}from"./LandAction-DUGZsV7N.js";import{L as F}from"./LandProviderPage-CmCxrqKX.js";import"./Back-DAlD0UQy.js";import"./NotFound-Bk5qRB9N.js";import"./hooks-Dztqgq6I.js";class T extends k.PureComponent{constructor(){super(...arguments);i(this,"state",{address:"",initial:"",loading:!1,editing:!1,dirty:!1,revoked:!1});i(this,"handleSetOperator",()=>{const{land:e,onSetOperator:t}=this.props,{address:n,revoked:p}=this.state;t(e,p?null:n)});i(this,"handleChange",(e,t)=>{this.setState({address:t.value,dirty:!0,revoked:!1})});i(this,"handleRevoke",()=>{this.setState({revoked:!0,dirty:!0})});i(this,"handleUndo",()=>{this.setState({revoked:!1,dirty:!1})})}async componentWillMount(){this.setState({loading:!0});const{land:e}=this.props,t=await O(e);t!==null?this.setState({address:t,initial:t,loading:!1,editing:!0}):this.setState({loading:!1})}render(){const{land:e}=this.props,{address:t,loading:n,dirty:p,revoked:d,editing:g,initial:m}=this.state,c=g&&v(t,m),h=!n&&!!t&&!_(t),b=n||!p||(v(t,m)||h)&&!d||!L(e,[x.OWNER,x.TENANT]),l=[];return d&&l.push("revoked"),g&&l.push("editing"),c&&l.push("is-revokable"),s.jsxs(u.Form,{className:"LandOperatorForm",children:[s.jsx(S,{placeholder:"0x...",label:o("operator_page.address"),className:l.join(" "),value:t,onChange:this.handleChange,loading:n,action:c?d?o("operator_page.undo"):o("operator_page.revoke"):void 0,onAction:c?d?this.handleUndo:this.handleRevoke:void 0,error:h,message:h?o("operator_page.invalid_address"):void 0}),s.jsxs(u.Row,{children:[s.jsx(y,{className:"cancel",to:E.landDetail(e.id),children:s.jsx(u.Button,{children:o("global.cancel")})}),s.jsx(R,{type:"submit",primary:!0,disabled:b,onClick:this.handleSetOperator,network:N.Network.ETHEREUM,children:o("global.submit")})]})]})}}let D=class extends k.PureComponent{render(){const{onSetOperator:a}=this.props;return s.jsx(F,{children:e=>s.jsx(w,{land:e,title:o("operator_page.title"),subtitle:s.jsx(C,{id:"operator_page.subtitle",values:{name:s.jsx("strong",{children:e.name}),b:t=>s.jsx("strong",{children:t}),br:()=>s.jsx("br",{})}}),children:s.jsx(T,{land:e,onSetOperator:a})})})}};const U=r=>({onSetOperator:(a,e)=>r(A(a,e))}),V=P(void 0,U)(D);export{V as default};
@@ -0,0 +1 @@
1
+ var h=Object.defineProperty;var m=(a,s,e)=>s in a?h(a,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[s]=e;var r=(a,s,e)=>m(a,typeof s!="symbol"?s+"":s,e);import{D as p,H as t,G as d,bk as g,M as o,L as u,K as x,ck as b,bQ as E,bF as N,N as j,cm as L}from"./index-R2Wjg1N9.js";import{L as D}from"./LandAction-DUGZsV7N.js";import{L as f}from"./LandProviderPage-CmCxrqKX.js";import"./Back-DAlD0UQy.js";import"./NotFound-Bk5qRB9N.js";import"./hooks-Dztqgq6I.js";let v=class extends p.PureComponent{constructor(){super(...arguments);r(this,"state",{});r(this,"handleNameChange",(e,n)=>{this.setState({name:n.value})});r(this,"handleDescriptionChange",(e,n)=>{this.setState({description:n.value})})}getName(e){return typeof this.state.name>"u"?e.name:this.state.name}getDescription(e){return typeof this.state.description>"u"?e.description||"":this.state.description}render(){const{onEdit:e}=this.props,{name:n,description:c}=this.state,l=!n&&!c;return t.jsx(f,{className:"LandEditPage",children:i=>t.jsx(D,{land:i,title:d("edit_page.title"),subtitle:t.jsx(g,{id:"edit_page.subtitle",values:{name:t.jsx("strong",{children:i.name})}}),children:t.jsxs(o.Form,{onSubmit:()=>e(i,this.getName(i),this.getDescription(i)),children:[t.jsx(o.Field,{label:"Name",value:this.getName(i),onChange:this.handleNameChange}),t.jsx(o.Field,{label:"Description",value:this.getDescription(i),onChange:this.handleDescriptionChange}),t.jsxs(o.Row,{children:[t.jsx(u,{className:"cancel",to:x.landDetail(i.id),children:t.jsx(o.Button,{children:d("global.cancel")})}),t.jsx(b,{type:"submit",primary:!0,disabled:l||!this.getName(i)||i.role!==E.OWNER,network:N.Network.ETHEREUM,children:d("global.submit")})]})]})})})}};const P=a=>({onEdit:(s,e,n)=>a(L(s,e,n))}),T=j(null,P)(v);export{T as default};
@@ -1 +1 @@
1
- ._image_142g7_1,._main_142g7_2{position:relative;width:64px;height:64px;border-radius:50%!important}._image_142g7_1{overflow:hidden}._network_142g7_13{position:absolute;bottom:0;right:0;width:32px;height:32px;z-index:1}._ellipsis_4huv2_1{margin:auto!important;color:var(--primary-text)}._itemImage_1y9df_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1y9df_10{margin-right:4px}._grid_1y9df_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider)}._grid_1y9df_14:hover{background-color:#24212966;color:var(--text)}._row_1y9df_25{align-items:center!important;font-size:15px}._column_1y9df_30{display:flex!important}._statusColumn_1y9df_34{font-size:13px;text-transform:uppercase}._statusColumn_1y9df_34._synced_1y9df_39{color:#34ce76}._statusColumn_1y9df_34._unsynced_1y9df_43{color:#fc9965}._avatarColumn_1y9df_47{align-items:center;padding-left:10px!important}._nameWrapper_1y9df_52{display:flex;align-items:center;overflow:hidden}._name_1y9df_52{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1y9df_65{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1y9df_72{margin-left:5px}._status_rgxu1_1{text-transform:uppercase;padding:4px 8px;border-radius:32px;display:inline-flex;align-items:center;gap:4px}._status_rgxu1_1 .icon{height:18px}._pending_migration_rgxu1_14{color:#ffbc5b;background-color:#ffbc5b33}._synced_rgxu1_19{color:#65d890;background-color:#65d89033}._unpublished_rgxu1_24,._unsynced_rgxu1_25{color:#63b4f6;background-color:#63b4f633}._pending_mapping_rgxu1_30,._under_review_rgxu1_31{color:#ecebed;background-color:#ecebed33}._icon_rgxu1_10{width:17px;height:17px}._itemImage_1rili_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1rili_10{margin-right:4px}._grid_1rili_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider);position:relative}._grid_1rili_14:not(._loading_1rili_21):hover{background-color:#24212966;color:var(--text)}._row_1rili_26{align-items:center!important;font-size:15px}._column_1rili_31{display:flex!important}._avatarColumn_1rili_35{align-items:center;padding-left:10px!important}._nameWrapper_1rili_40{display:flex;align-items:center;overflow:hidden}._name_1rili_40{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1rili_53{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1rili_60{margin-left:5px}._overlay_1rili_65{position:absolute;pointer-events:none;z-index:100000000;top:0;left:0;width:100%;height:100%;background-color:#00000046;z-index:1000;display:flex;justify-content:center;align-items:center}._itemCheckbox_2k9qa_1{margin-right:10px}._gridHeader_2k9qa_5.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_2k9qa_5.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_2k9qa_5.ui.grid>.row>.column._itemColumn_2k9qa_15{display:flex;align-items:center}._gridHeader_4acv6_1.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_4acv6_1.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_4acv6_1.ui.grid>.row>.column._itemColumn_4acv6_11{display:flex;align-items:center}._itemCheckbox_4acv6_16{margin-right:10px}._linkedToColumn_4acv6_20>span{margin-right:6px}._main_16i8r_3,._main_16i8r_3>.ui.container{display:flex;flex-direction:column;min-height:0;flex:1}._slots_16i8r_11{font-weight:700;text-transform:uppercase;position:relative}._slots_16i8r_11:before{content:"";display:inline-block;background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23FF2D55'/%3e%3c/svg%3e");width:16px;height:16px;top:3px;position:relative;margin-right:8px}.button._slots_16i8r_11._empty_16i8r_28:before{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23736E7D'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23736E7D'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23736E7D'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23736E7D'/%3e%3c/svg%3e")}._searchContainer_16i8r_32{display:flex;align-items:center;justify-content:end}._searchContainer_16i8r_32 .dcl.text-filter{flex:1}._searchContainer_16i8r_32 ._searchInfo_16i8r_42{color:var(--secondary-text)}._syncedStatusList_16i8r_46.ui.dropdown{margin-left:25px;padding-left:7px;margin-right:10px;color:var(--primary)}._selectionInfo_16i8r_53{display:flex;justify-content:center;align-items:center;margin-bottom:20px;padding:10px 0;border:1px solid var(--secondary-text);border-radius:4px}._header_16i8r_63{display:flex;flex-direction:row;align-items:center;gap:16px;padding-right:142px;padding-left:90px;min-width:1400px;width:100%}._header_16i8r_63 ._content_16i8r_74{display:flex;flex-direction:row;background-color:#242129;padding:24px;width:calc(100% - 50px);border-radius:8px}._header_16i8r_63 ._title_16i8r_83{display:flex;flex-direction:row;align-items:center;gap:12px;overflow:hidden;margin-right:20px;flex:1 1 auto;min-width:0}._editCollectionName_16i8r_96{visibility:hidden;padding-left:16px}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101:hover+._editCollectionName_16i8r_96{visibility:visible}._nameAndType_16i8r_105{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}._nameWrapper_16i8r_115{display:flex;flex-direction:row;align-items:center;gap:15px;min-width:0;flex:1}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101{margin-top:0;margin-bottom:0;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;min-width:0;width:fit-content}._header_16i8r_63 ._title_16i8r_83 ._size_16i8r_139{font-size:16px}._header_16i8r_63 ._actions_16i8r_143{display:flex;flex-direction:row;align-items:center;gap:16px;flex:0 0 auto}._body_16i8r_151{display:flex;flex-direction:column;padding-right:142px;padding-left:142px;margin-top:16px;gap:16px;min-width:1400px;flex:1}._info_16i8r_162{display:flex;flex-direction:row;gap:10px;align-items:center;font-weight:600}._infoHeader_16i8r_170{display:flex;flex-direction:row;text-transform:uppercase;color:#a09ba8;gap:10px}._infoContent_16i8r_178{display:flex;flex-direction:row;align-items:center;gap:5px;border-radius:6px;padding:8px;background-color:#43404a}._info_16i8r_162 .dui-info-tooltip__trigger{background-repeat:no-repeat;background-size:cover;height:20px;width:20px}._slotsIcon_16i8r_195{background-color:#5e5b67;border-radius:32px;padding:2px;height:24px;width:24px;background-image:url("data:image/svg+xml,%3csvg%20width='19'%20height='14'%20viewBox='0%200%2019%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%204H4V0H2C0.9%200%200%200.9%200%202V4ZM0%209H4V5H0V9ZM5%209H9V5H5V9ZM10%209H14V5H10V9ZM5%204H9V0H5V4ZM10%200V4H14V0H10ZM15%209H19V5H15V9ZM2%2014H4V10H0V12C0%2013.1%200.9%2014%202%2014ZM5%2014H9V10H5V14ZM10%2014H14V10H10V14ZM15%2014H17C18.1%2014%2019%2013.1%2019%2012V10H15V14ZM15%200V4H19V2C19%200.9%2018.1%200%2017%200H15Z'%20fill='white'/%3e%3c/svg%3e");background-size:70%;background-position:center;background-repeat:no-repeat}._copyButton_16i8r_207{cursor:pointer}._empty_16i8r_28{padding:200px 0;width:100%;border-radius:8px;justify-content:center;color:var(--secondary-text);text-align:center;line-height:22px;font-size:15px;background-color:#242129}._empty_16i8r_28 h3{color:#cfcdd4;margin-bottom:5px}._empty_16i8r_28 p{color:#a09ba8}._sparkles_16i8r_232{width:54px;height:56px;background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.14.0/assets/sparkles-C-WJN0Gh.svg);background-repeat:no-repeat;margin:auto auto 20px}._start_16i8r_241{width:80px;height:80px;background-image:url("data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_6709_15241)'%3e%3cpath%20d='M20%2032.0004H28C29.1%2032.0004%2030%2031.1004%2030%2030.0004V20.0004H33.18C34.96%2020.0004%2035.86%2017.8404%2034.6%2016.5804L25.42%207.40043C24.64%206.62043%2023.38%206.62043%2022.6%207.40043L13.42%2016.5804C12.16%2017.8404%2013.04%2020.0004%2014.82%2020.0004H18V30.0004C18%2031.1004%2018.9%2032.0004%2020%2032.0004ZM12%2036.0004H36C37.1%2036.0004%2038%2036.9004%2038%2038.0004C38%2039.1004%2037.1%2040.0004%2036%2040.0004H12C10.9%2040.0004%2010%2039.1004%2010%2038.0004C10%2036.9004%2010.9%2036.0004%2012%2036.0004Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_6709_15241'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");background-size:48px;background-position:center;background-repeat:no-repeat;border-radius:50%;background-color:#43404a;margin:auto auto 20px}._migrationBanner_16i8r_254{min-width:1116px;color:#000;display:flex;align-items:center;background-color:#ffbc5b;padding:9px 16px;min-height:42px;font-weight:700;text-transform:uppercase;border-radius:8px;margin-right:142px;margin-left:142px;margin-top:15px}._migrationBanner_16i8r_254 .icon{height:18px;margin-right:10px}._type_16i8r_277{display:flex;flex-direction:row;gap:8px}._linkedWearableBadge_16i8r_283{padding:4px 8px;border-radius:32px}._typeBadge_16i8r_288{background-color:#00a146}._programmaticBadge_16i8r_292{background-color:#691fa9}._standardBadge_16i8r_296{background-color:#43404a}._loader_16i8r_302{display:flex;justify-content:center;align-items:center;min-height:0;flex:1}
1
+ ._image_142g7_1,._main_142g7_2{position:relative;width:64px;height:64px;border-radius:50%!important}._image_142g7_1{overflow:hidden}._network_142g7_13{position:absolute;bottom:0;right:0;width:32px;height:32px;z-index:1}._ellipsis_4huv2_1{margin:auto!important;color:var(--primary-text)}._itemImage_1y9df_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1y9df_10{margin-right:4px}._grid_1y9df_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider)}._grid_1y9df_14:hover{background-color:#24212966;color:var(--text)}._row_1y9df_25{align-items:center!important;font-size:15px}._column_1y9df_30{display:flex!important}._statusColumn_1y9df_34{font-size:13px;text-transform:uppercase}._statusColumn_1y9df_34._synced_1y9df_39{color:#34ce76}._statusColumn_1y9df_34._unsynced_1y9df_43{color:#fc9965}._avatarColumn_1y9df_47{align-items:center;padding-left:10px!important}._nameWrapper_1y9df_52{display:flex;align-items:center;overflow:hidden}._name_1y9df_52{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1y9df_65{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1y9df_72{margin-left:5px}._status_rgxu1_1{text-transform:uppercase;padding:4px 8px;border-radius:32px;display:inline-flex;align-items:center;gap:4px}._status_rgxu1_1 .icon{height:18px}._pending_migration_rgxu1_14{color:#ffbc5b;background-color:#ffbc5b33}._synced_rgxu1_19{color:#65d890;background-color:#65d89033}._unpublished_rgxu1_24,._unsynced_rgxu1_25{color:#63b4f6;background-color:#63b4f633}._pending_mapping_rgxu1_30,._under_review_rgxu1_31{color:#ecebed;background-color:#ecebed33}._icon_rgxu1_10{width:17px;height:17px}._itemImage_1rili_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1rili_10{margin-right:4px}._grid_1rili_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider);position:relative}._grid_1rili_14:not(._loading_1rili_21):hover{background-color:#24212966;color:var(--text)}._row_1rili_26{align-items:center!important;font-size:15px}._column_1rili_31{display:flex!important}._avatarColumn_1rili_35{align-items:center;padding-left:10px!important}._nameWrapper_1rili_40{display:flex;align-items:center;overflow:hidden}._name_1rili_40{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1rili_53{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1rili_60{margin-left:5px}._overlay_1rili_65{position:absolute;pointer-events:none;z-index:100000000;top:0;left:0;width:100%;height:100%;background-color:#00000046;z-index:1000;display:flex;justify-content:center;align-items:center}._itemCheckbox_2k9qa_1{margin-right:10px}._gridHeader_2k9qa_5.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_2k9qa_5.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_2k9qa_5.ui.grid>.row>.column._itemColumn_2k9qa_15{display:flex;align-items:center}._gridHeader_4acv6_1.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_4acv6_1.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_4acv6_1.ui.grid>.row>.column._itemColumn_4acv6_11{display:flex;align-items:center}._itemCheckbox_4acv6_16{margin-right:10px}._linkedToColumn_4acv6_20>span{margin-right:6px}._main_16i8r_3,._main_16i8r_3>.ui.container{display:flex;flex-direction:column;min-height:0;flex:1}._slots_16i8r_11{font-weight:700;text-transform:uppercase;position:relative}._slots_16i8r_11:before{content:"";display:inline-block;background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23FF2D55'/%3e%3c/svg%3e");width:16px;height:16px;top:3px;position:relative;margin-right:8px}.button._slots_16i8r_11._empty_16i8r_28:before{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23736E7D'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23736E7D'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23736E7D'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23736E7D'/%3e%3c/svg%3e")}._searchContainer_16i8r_32{display:flex;align-items:center;justify-content:end}._searchContainer_16i8r_32 .dcl.text-filter{flex:1}._searchContainer_16i8r_32 ._searchInfo_16i8r_42{color:var(--secondary-text)}._syncedStatusList_16i8r_46.ui.dropdown{margin-left:25px;padding-left:7px;margin-right:10px;color:var(--primary)}._selectionInfo_16i8r_53{display:flex;justify-content:center;align-items:center;margin-bottom:20px;padding:10px 0;border:1px solid var(--secondary-text);border-radius:4px}._header_16i8r_63{display:flex;flex-direction:row;align-items:center;gap:16px;padding-right:142px;padding-left:90px;min-width:1400px;width:100%}._header_16i8r_63 ._content_16i8r_74{display:flex;flex-direction:row;background-color:#242129;padding:24px;width:calc(100% - 50px);border-radius:8px}._header_16i8r_63 ._title_16i8r_83{display:flex;flex-direction:row;align-items:center;gap:12px;overflow:hidden;margin-right:20px;flex:1 1 auto;min-width:0}._editCollectionName_16i8r_96{visibility:hidden;padding-left:16px}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101:hover+._editCollectionName_16i8r_96{visibility:visible}._nameAndType_16i8r_105{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}._nameWrapper_16i8r_115{display:flex;flex-direction:row;align-items:center;gap:15px;min-width:0;flex:1}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101{margin-top:0;margin-bottom:0;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;min-width:0;width:fit-content}._header_16i8r_63 ._title_16i8r_83 ._size_16i8r_139{font-size:16px}._header_16i8r_63 ._actions_16i8r_143{display:flex;flex-direction:row;align-items:center;gap:16px;flex:0 0 auto}._body_16i8r_151{display:flex;flex-direction:column;padding-right:142px;padding-left:142px;margin-top:16px;gap:16px;min-width:1400px;flex:1}._info_16i8r_162{display:flex;flex-direction:row;gap:10px;align-items:center;font-weight:600}._infoHeader_16i8r_170{display:flex;flex-direction:row;text-transform:uppercase;color:#a09ba8;gap:10px}._infoContent_16i8r_178{display:flex;flex-direction:row;align-items:center;gap:5px;border-radius:6px;padding:8px;background-color:#43404a}._info_16i8r_162 .dui-info-tooltip__trigger{background-repeat:no-repeat;background-size:cover;height:20px;width:20px}._slotsIcon_16i8r_195{background-color:#5e5b67;border-radius:32px;padding:2px;height:24px;width:24px;background-image:url("data:image/svg+xml,%3csvg%20width='19'%20height='14'%20viewBox='0%200%2019%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%204H4V0H2C0.9%200%200%200.9%200%202V4ZM0%209H4V5H0V9ZM5%209H9V5H5V9ZM10%209H14V5H10V9ZM5%204H9V0H5V4ZM10%200V4H14V0H10ZM15%209H19V5H15V9ZM2%2014H4V10H0V12C0%2013.1%200.9%2014%202%2014ZM5%2014H9V10H5V14ZM10%2014H14V10H10V14ZM15%2014H17C18.1%2014%2019%2013.1%2019%2012V10H15V14ZM15%200V4H19V2C19%200.9%2018.1%200%2017%200H15Z'%20fill='white'/%3e%3c/svg%3e");background-size:70%;background-position:center;background-repeat:no-repeat}._copyButton_16i8r_207{cursor:pointer}._empty_16i8r_28{padding:200px 0;width:100%;border-radius:8px;justify-content:center;color:var(--secondary-text);text-align:center;line-height:22px;font-size:15px;background-color:#242129}._empty_16i8r_28 h3{color:#cfcdd4;margin-bottom:5px}._empty_16i8r_28 p{color:#a09ba8}._sparkles_16i8r_232{width:54px;height:56px;background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.14.1/assets/sparkles-C-WJN0Gh.svg);background-repeat:no-repeat;margin:auto auto 20px}._start_16i8r_241{width:80px;height:80px;background-image:url("data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_6709_15241)'%3e%3cpath%20d='M20%2032.0004H28C29.1%2032.0004%2030%2031.1004%2030%2030.0004V20.0004H33.18C34.96%2020.0004%2035.86%2017.8404%2034.6%2016.5804L25.42%207.40043C24.64%206.62043%2023.38%206.62043%2022.6%207.40043L13.42%2016.5804C12.16%2017.8404%2013.04%2020.0004%2014.82%2020.0004H18V30.0004C18%2031.1004%2018.9%2032.0004%2020%2032.0004ZM12%2036.0004H36C37.1%2036.0004%2038%2036.9004%2038%2038.0004C38%2039.1004%2037.1%2040.0004%2036%2040.0004H12C10.9%2040.0004%2010%2039.1004%2010%2038.0004C10%2036.9004%2010.9%2036.0004%2012%2036.0004Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_6709_15241'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");background-size:48px;background-position:center;background-repeat:no-repeat;border-radius:50%;background-color:#43404a;margin:auto auto 20px}._migrationBanner_16i8r_254{min-width:1116px;color:#000;display:flex;align-items:center;background-color:#ffbc5b;padding:9px 16px;min-height:42px;font-weight:700;text-transform:uppercase;border-radius:8px;margin-right:142px;margin-left:142px;margin-top:15px}._migrationBanner_16i8r_254 .icon{height:18px;margin-right:10px}._type_16i8r_277{display:flex;flex-direction:row;gap:8px}._linkedWearableBadge_16i8r_283{padding:4px 8px;border-radius:32px}._typeBadge_16i8r_288{background-color:#00a146}._programmaticBadge_16i8r_292{background-color:#691fa9}._standardBadge_16i8r_296{background-color:#43404a}._loader_16i8r_302{display:flex;justify-content:center;align-items:center;min-height:0;flex:1}