@dcl/builder-site 7.6.0 → 7.6.1-15066342098.commit-7c747bd

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 (83) hide show
  1. package/assets/{Back-DVDrV4XS.js → Back-DgKAoQIH.js} +1 -1
  2. package/assets/{CollectionProvider.container-Cen6wteT.js → CollectionProvider.container-CLgOQNf-.js} +1 -1
  3. package/assets/{CollectionStatus.container-IfxJ2FXJ.js → CollectionStatus.container-BD9iAeVF.js} +1 -1
  4. package/assets/{ConfirmDelete-DRi0COjr.js → ConfirmDelete-CmQp_7hn.js} +1 -1
  5. package/assets/{FileSaver.min-BVvZzDC7.js → FileSaver.min-CZ9hXjqv.js} +1 -1
  6. package/assets/{ItemProvider.container-D5psKqp5.js → ItemProvider.container-fLUe_5rO.js} +1 -1
  7. package/assets/{JumpIn.container-CHK-Z_Zl.js → JumpIn.container-CKS-_CwV.js} +1 -1
  8. package/assets/{LandAction-BpzpS-68.js → LandAction-Boy2pTRu.js} +1 -1
  9. package/assets/{LandProviderPage-CnKtwxuP.js → LandProviderPage-D1wx3XFJ.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-CDSy4rw9.js → LoggedInDetailPage.container-DmotxT86.js} +1 -1
  11. package/assets/{Navigation-CZobJzn5.css → Navigation-BUK-xyGC.css} +1 -1
  12. package/assets/{Navigation.container-D4bOX-AY.js → Navigation.container-BbObl0Ib.js} +1 -1
  13. package/assets/{NotFound-BFf6zsjs.js → NotFound-B3qud5sl.js} +1 -1
  14. package/assets/{OptionsDropdown-CBs9QAWV.js → OptionsDropdown-BMVplrrd.js} +1 -1
  15. package/assets/{RentalPeriod-B1VH40kP.js → RentalPeriod-D9qOXo3H.js} +1 -1
  16. package/assets/{SDKTag-xtuqGgmi.js → SDKTag-BISIXYdY.js} +1 -1
  17. package/assets/{SceneStats.container-CWVBefWA.js → SceneStats.container-B8wBXy4f.js} +1 -1
  18. package/assets/{SignInRequired-DaqmN1AU.js → SignInRequired-D6OazGjK.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-P-G-49ta.js → ThirdPartyKindBadge-CAn4Arwr.js} +1 -1
  20. package/assets/{dataReader-DfqMoFvb.js → dataReader-DboIsKXs.js} +1 -1
  21. package/assets/{date-Bn2WlT-o.js → date-e3l4KRXn.js} +1 -1
  22. package/assets/{fortmatic-Cn2VTUyU.js → fortmatic-CdoeslBJ.js} +1 -1
  23. package/assets/{index-BzEAPTQZ.css → index-2ohaO6d5.css} +1 -1
  24. package/assets/{index-CiOLXphq.js → index-B-pUo8dO.js} +1 -1
  25. package/assets/{index-BqR14NG8.js → index-B4oAv4Nv.js} +1 -1
  26. package/assets/{index-BDp1J98i.js → index-BBbGj54f.js} +1 -1
  27. package/assets/{index-PQI7Lnlg.js → index-BG8Y6aqJ.js} +1 -1
  28. package/assets/{index-B6zCeUAv.js → index-BMumoo5a.js} +1 -1
  29. package/assets/{index-BRXAPjGd.js → index-BNHCgoVX.js} +1 -1
  30. package/assets/{index-B5JODbxO.js → index-BQznUFVq.js} +1 -1
  31. package/assets/index-BkINttIT.js +2 -0
  32. package/assets/{index-7W2dmX5K.js → index-BmMLkQ6h.js} +1 -1
  33. package/assets/{index-8hssZWsO.js → index-BnSyLDSm.js} +1 -1
  34. package/assets/{index-CXaPtJgk.js → index-Bwo3QFSj.js} +1 -1
  35. package/assets/index-C2UseE3f.css +1 -0
  36. package/assets/{index-CTRzUgxC.js → index-C4k-BKFe.js} +1 -1
  37. package/assets/{index-C97e_oh9.js → index-C5WJ431i.js} +1 -1
  38. package/assets/index-CGU_dno6.js +1 -0
  39. package/assets/index-CI-tkeKp.css +1 -0
  40. package/assets/index-CKQ3FgLY.js +1 -0
  41. package/assets/{index-D426xjd7.js → index-CM-I_Hvl.js} +1 -1
  42. package/assets/{index-77GGAofq.js → index-CMUFtuyz.js} +1 -1
  43. package/assets/{index-CwIUi20L.js → index-CbT_oqBz.js} +1 -1
  44. package/assets/{index-DBkzP8CH.js → index-Cbs9lSbS.js} +1 -1
  45. package/assets/{index-CkFGdPyY.js → index-Cd4tf47K.js} +1 -1
  46. package/assets/{index-BL_Hkw_R.js → index-CeiGYvHe.js} +1 -1
  47. package/assets/{index-B7uYpu-V.js → index-Ci4TayiL.js} +1 -1
  48. package/assets/index-Civkmg3A.js +1 -0
  49. package/assets/{index-Di5fQIKj.js → index-Cs_CHg49.js} +1 -1
  50. package/assets/{index-CW1OdcU6.js → index-CvYc8vI9.js} +1 -1
  51. package/assets/{index-De3YKuL2.js → index-CyqCdXFi.js} +1 -1
  52. package/assets/{index-X-h2qlu8.js → index-CzXblosQ.js} +1 -1
  53. package/assets/{index-DoC8BigK.js → index-D1pl7rhD.js} +1 -1
  54. package/assets/{index-DVVND4Lw.js → index-D4FRE2ZB.js} +2 -2
  55. package/assets/{index-D3gQlTQW.css → index-D4ys05oa.css} +7 -7
  56. package/assets/{index-RCOBszic.js → index-DCuN6A7a.js} +1 -1
  57. package/assets/{index-Ch-IVCGq.js → index-DRLjoHwb.js} +1 -1
  58. package/assets/index-DcgjW479.css +1 -0
  59. package/assets/{index-obRQePTE.js → index-Defj8AMh.js} +1 -1
  60. package/assets/{index-HmaWOM5z.js → index-Doqk6rtG.js} +1 -1
  61. package/assets/{index-CF3Lslie.js → index-Dp5BQYeu.js} +1 -1
  62. package/assets/index-DsuR8KIm.css +1 -0
  63. package/assets/{index-BV0Wmuj9.js → index-DyexnaXg.js} +1 -1
  64. package/assets/{index-DCzfVOZ6.js → index-JobLBM74.js} +1 -1
  65. package/assets/{index-rpOZlV0B.js → index-TkdRn63V.js} +1 -1
  66. package/assets/{index-D-2Wi5Z3.js → index-W4pl5C6z.js} +1 -1
  67. package/assets/{index-nSeb2kLU.js → index-fMUqgf16.js} +52 -52
  68. package/assets/{index-CNAT8a6X.js → index-fQ9MA-mz.js} +1 -1
  69. package/assets/{index-BV-yrbFj.js → index-gTkepFU_.js} +1 -1
  70. package/assets/{index-BPHr7acD.css → index-j5cRq6aH.css} +1 -1
  71. package/assets/{index-jU2hzkZA.js → index-vlMHinOh.js} +1 -1
  72. package/assets/{index.es-y7JmZs9C.js → index.es-IRAFxTkz.js} +4 -4
  73. package/assets/{selectors-CRfPBNkn.js → selectors-BhNw_vWj.js} +1 -1
  74. package/index.html +3 -3
  75. package/package.json +3 -3
  76. package/assets/index-BXnLNx0C.css +0 -1
  77. package/assets/index-BfJxH1qW.css +0 -1
  78. package/assets/index-CPs0EnPc.js +0 -1
  79. package/assets/index-D4pC8HQ_.css +0 -1
  80. package/assets/index-DAVEXbZi.js +0 -1
  81. package/assets/index-DMaklfqw.css +0 -1
  82. package/assets/index-DO565How.js +0 -1
  83. package/assets/index-RN1U8tL7.js +0 -2
@@ -1 +1 @@
1
- var G=Object.defineProperty;var X=(n,s,l)=>s in n?G(n,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[s]=l;var E=(n,s,l)=>X(n,typeof s!="symbol"?s+"":s,l);import{D as d,H as e,J as Y,Z,K as k,er as q,eR as F,eS as S,eT as j,eO as H,eU as z,eV as J,eW as _,eX as ee,eY as se,eZ as ae,M as t,G as i,dC as ie,e_ as le,e$ as C,f0 as te,f1 as ne,f2 as ce,L as de,eq as oe,cB as re,f3 as ue,b8 as me,f4 as he,cA as xe,f5 as pe,f6 as je,f7 as ge,f8 as ve,N as be,f9 as Ne,fa as Ie,e8 as fe,fb as _e,fc as Ce,fd as ye,bw as T,eD as P,fe as Ee,ff as ke,eo as Se,X as Te,eM as Pe,fg as De,fh as we}from"./index-nSeb2kLU.js";import{I as Me}from"./ItemProvider.container-D5psKqp5.js";import{C as Le}from"./ConfirmDelete-DRi0COjr.js";import{L as Re}from"./LoggedInDetailPage.container-CDSy4rw9.js";import{N as Be}from"./NotFound-BFf6zsjs.js";import{B as Ue}from"./Back-DVDrV4XS.js";import"./Navigation.container-D4bOX-AY.js";import"./selectors-CRfPBNkn.js";import"./SignInRequired-DaqmN1AU.js";class Oe extends d.PureComponent{constructor(l){super(l);E(this,"state",{isNoticeClosed:!1});E(this,"handleCloseNotice",()=>{const{storageKey:l}=this.props;this.setState({isNoticeClosed:!0}),localStorage.setItem(l,"1")});const{storageKey:r}=l;this.state={isNoticeClosed:localStorage.getItem(r)!==null}}render(){const{children:l}=this.props,{isNoticeClosed:r}=this.state;return r?null:e.jsxs("div",{className:"Notice",children:[e.jsx("div",{className:"text",children:l}),e.jsx(Y,{name:"close",onClick:this.handleCloseNotice})]})}}const Ae="dcl-item-notice";function Ve(n){const{item:s,itemId:l,isLoading:r,status:h,collection:g,hasAccess:v,isWearableUtilityEnabled:D,onDelete:w,onSaveItem:x,onOpenModal:o}=n,p=d.useRef(null),b=Z(),y=d.useCallback(()=>{s&&b.push(k.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:q(s.urn)?F.TP_COLLECTIONS:F.COLLECTIONS})},[b,s]),M=d.useCallback(async a=>{const c=await S({[j]:a}),u={...s,contents:{...s==null?void 0:s.contents,[j]:c[j]}};h&&[H.UNPUBLISHED,H.UNDER_REVIEW].includes(h)&&(u.video=c[j]),x(u,{[j]:a})},[x,s,h]),N=d.useCallback(()=>{o("EditVideoModal",{item:s,onSaveVideo:M})},[s,o,M]),L=d.useCallback(()=>{w(s)},[s,w]),I=d.useCallback(()=>{s&&z(s)?o("CreateSingleItemModal",{item:s,addRepresentation:!0}):o("CreateSingleItemModal",{item:s,changeItemFile:!0})},[o,s]),R=d.useCallback(()=>{o("EditItemURNModal",{item:s})},[s,o]),B=d.useCallback(async a=>{const c=J(a);x({...s,contents:{...s==null?void 0:s.contents,...await S({[_]:c})}},{[_]:c})},[x,s]),U=d.useCallback(()=>{(s==null?void 0:s.type)===ee.EMOTE?o("EditThumbnailModal",{onSaveThumbnail:B,item:s,collection:g}):p.current&&p.current.click()},[p.current,g,s,o,B]),O=d.useCallback(async a=>{const{files:c}=a.target;if(c&&c.length>0){const u=c[0],f=await se(u,1024,1024);f&&s&&(s.contents={...s.contents,...await S({[_]:f})},x(s,{[_]:f}))}},[x,s]),A=d.useCallback(()=>{o("MoveItemToCollectionModal",{item:s})},[s,o]),W=d.useCallback((a,c)=>{var V;const u=a.data,$=!(c&&ae(c));return e.jsxs(e.Fragment,{children:[e.jsx(t.Section,{children:e.jsx(t.Row,{children:e.jsx(Ue,{onClick:()=>b.push(k.collectionDetail(a.collectionId))})})}),e.jsxs(t.Narrow,{children:[!c&&!a.collectionId?e.jsx(Oe,{storageKey:Ae,children:i("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:a,hasBadge:!0,hasRarityBadge:!0,hasUtilityBadge:!0}),e.jsx("div",{children:e.jsxs(t.Button,{primary:!0,onClick:U,children:[e.jsx("input",{type:"file",ref:p,onChange:O,accept:"image/png"}),e.jsx(t.Icon,{name:"camera"}),i("item_detail_page.edit_thumbnail")]})}),e.jsxs("div",{className:"metrics",children:[e.jsx("span",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(le,{item:a})]}),C(a)?e.jsx(te,{item:a,onClick:N,children:(m,K,Q,He)=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overlay",children:e.jsx(t.Icon,{name:"play",className:"play-video-button",onClick:N})}),e.jsxs(t.Button,{primary:!0,onClick:N,children:[e.jsx(t.Icon,{name:"video"}),i("item_detail_page.edit_video")]}),e.jsxs("div",{className:"metrics",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(ne,{duration:K,size:Q,showIcons:!1})]})]})}):null,e.jsxs("div",{className:"details",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details")}),a.isPublished&&e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details_info.id")}),e.jsxs("div",{className:"value",children:["#",a.tokenId]})]}),u.category?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.category")}),e.jsx("div",{className:"value",children:i(`${a.type}.category.${u.category}`)})]}):null,a.isPublished&&a.rarity?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.supply")}),e.jsxs("div",{className:"value",children:[a.totalSupply,"/",ce(a)]})]}):null,c?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.collection")}),e.jsx(de,{className:"collection-link",to:k.collectionDetail(c.id,oe(c)),children:c.name})]}):null,a.urn?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("global.urn")}),e.jsxs("div",{className:"value urn",children:[e.jsxs("span",{children:[a.urn,e.jsx(re,{role:"button",text:a.urn,children:e.jsx(t.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:"link copy",name:"copy outline"})})]}),e.jsx("div",{className:"urn-actions",children:q(a.urn)?e.jsx(t.Popup,{content:i("collection_item.cannot_edit_urn"),disabled:!a.isPublished,position:"top center",trigger:e.jsx("div",{children:e.jsx("button",{disabled:a.isPublished,className:"link",onClick:R,children:i("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:a.name}),e.jsxs("div",{className:"actions",children:[C(a)&&e.jsx(t.Button,{className:"edit",inverted:!0,size:"small",onClick:I,children:i("global.edit")}),e.jsx(t.Button,{inverted:!0,size:"small",onClick:y,children:i("collection_detail_page.preview")}),$?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,className:"more-actions-button",children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[e.jsx(Le,{name:a.name,onDelete:L,trigger:a.isPublished?e.jsx(t.Popup,{content:i("item_detail_page.delete_published_item"),position:"right center",trigger:e.jsx(t.Dropdown.Item,{disabled:!0,text:i("global.delete")}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):e.jsx(t.Dropdown.Item,{text:i("global.delete")})}),!a.collectionId&&e.jsx(t.Dropdown.Item,{text:i("collection_item.move_to_another_collection"),onClick:A})]})}):null]})]}),e.jsxs("div",{className:"attribute-row",children:[a.description&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.description")}),e.jsx("div",{className:"data",children:a.description})]}),a.utility&&D&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.utility")}),e.jsx("div",{className:"data",children:a.utility})]})]}),a.data.tags.length?e.jsx("div",{className:"attribute-row",children:e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.tags.title")}),e.jsx("div",{className:"data tags-container",children:a.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:i("item_detail_page.selling.title")}),e.jsxs("div",{className:"data",children:[ue(a)?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),e.jsx("div",{className:"value",children:i("global.free")})]}):a.price?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),a.price?e.jsx(t.Mana,{showTooltip:!0,network:me.Network.MATIC,children:he(a.price)}):"-"]}):null,e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.beneficiary")}),a.beneficiary?e.jsx("div",{className:"value",children:xe(a.beneficiary)}):"-"]})]})]}),pe(a)&&!C(a)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.representations.title")}),e.jsx(t.Button,{className:"edit-button",inverted:!0,size:"small",onClick:I,children:z(a)?i("global.add"):i("global.edit")})]}),e.jsx("div",{className:"data",children:e.jsx("div",{className:"representations-container",children:a.data.representations.map(m=>e.jsxs("div",{className:"representation",children:[e.jsx("img",{className:"item-image",src:je(a),alt:a.name}),m.mainFile,e.jsx(ge,{item:a,bodyShape:m.bodyShapes[0]})]},m.mainFile))})})]}):null,C(a)&&((V=a.data.requiredPermissions)!=null&&V.length)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.required_permissions")}),e.jsx(t.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:i("global.learn_more")})]}),e.jsx("div",{className:"data",children:e.jsx(ve,{requiredPermissions:a.data.requiredPermissions,basic:!0})})]}):null]})]})]})]})},[D,b,p,U,O,N,R,I,I,A,y,L,y]);return e.jsx(Me,{id:l,children:(a,c,u)=>e.jsx(Re,{className:"ItemDetailPage",hasNavigation:!v&&!r,isLoading:r||u,children:v&&a?W(a,c):e.jsx(Be,{})})})}const qe=n=>{const s=Ne(n),l=s?Ie(n,s):null,r=fe(n),h=l&&l.collectionId?_e(n,l.collectionId):null,g=Ce(n),v=l?g[l.id]:null;return{itemId:s,wallet:r,item:l,collection:h,status:v,isWearableUtilityEnabled:ye(n),isLoading:T(P(n),Pe)||T(P(n),De)||T(P(n),we),hasAccess:l!==null&&Ee(n,r.address,h,l)}},Fe=n=>({onSaveItem:(s,l)=>n(ke(s,l)),onDelete:s=>n(Se(s)),onOpenModal:(s,l)=>n(Te(s,l))}),es=be(qe,Fe)(Ve);export{es as default};
1
+ var G=Object.defineProperty;var X=(n,s,l)=>s in n?G(n,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[s]=l;var E=(n,s,l)=>X(n,typeof s!="symbol"?s+"":s,l);import{D as d,H as e,J as Y,Z,K as k,er as q,eR as F,eS as S,eT as j,eO as H,eU as z,eV as J,eW as _,eX as ee,eY as se,eZ as ae,M as t,G as i,dC as ie,e_ as le,e$ as C,f0 as te,f1 as ne,f2 as ce,L as de,eq as oe,cB as re,f3 as ue,b8 as me,f4 as he,cA as xe,f5 as pe,f6 as je,f7 as ge,f8 as ve,N as be,f9 as Ne,fa as Ie,e8 as fe,fb as _e,fc as Ce,fd as ye,bw as T,eD as P,fe as Ee,ff as ke,eo as Se,X as Te,eM as Pe,fg as De,fh as we}from"./index-fMUqgf16.js";import{I as Me}from"./ItemProvider.container-fLUe_5rO.js";import{C as Le}from"./ConfirmDelete-CmQp_7hn.js";import{L as Re}from"./LoggedInDetailPage.container-DmotxT86.js";import{N as Be}from"./NotFound-B3qud5sl.js";import{B as Ue}from"./Back-DgKAoQIH.js";import"./Navigation.container-BbObl0Ib.js";import"./selectors-BhNw_vWj.js";import"./SignInRequired-D6OazGjK.js";class Oe extends d.PureComponent{constructor(l){super(l);E(this,"state",{isNoticeClosed:!1});E(this,"handleCloseNotice",()=>{const{storageKey:l}=this.props;this.setState({isNoticeClosed:!0}),localStorage.setItem(l,"1")});const{storageKey:r}=l;this.state={isNoticeClosed:localStorage.getItem(r)!==null}}render(){const{children:l}=this.props,{isNoticeClosed:r}=this.state;return r?null:e.jsxs("div",{className:"Notice",children:[e.jsx("div",{className:"text",children:l}),e.jsx(Y,{name:"close",onClick:this.handleCloseNotice})]})}}const Ae="dcl-item-notice";function Ve(n){const{item:s,itemId:l,isLoading:r,status:h,collection:g,hasAccess:v,isWearableUtilityEnabled:D,onDelete:w,onSaveItem:x,onOpenModal:o}=n,p=d.useRef(null),b=Z(),y=d.useCallback(()=>{s&&b.push(k.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:q(s.urn)?F.TP_COLLECTIONS:F.COLLECTIONS})},[b,s]),M=d.useCallback(async a=>{const c=await S({[j]:a}),u={...s,contents:{...s==null?void 0:s.contents,[j]:c[j]}};h&&[H.UNPUBLISHED,H.UNDER_REVIEW].includes(h)&&(u.video=c[j]),x(u,{[j]:a})},[x,s,h]),N=d.useCallback(()=>{o("EditVideoModal",{item:s,onSaveVideo:M})},[s,o,M]),L=d.useCallback(()=>{w(s)},[s,w]),I=d.useCallback(()=>{s&&z(s)?o("CreateSingleItemModal",{item:s,addRepresentation:!0}):o("CreateSingleItemModal",{item:s,changeItemFile:!0})},[o,s]),R=d.useCallback(()=>{o("EditItemURNModal",{item:s})},[s,o]),B=d.useCallback(async a=>{const c=J(a);x({...s,contents:{...s==null?void 0:s.contents,...await S({[_]:c})}},{[_]:c})},[x,s]),U=d.useCallback(()=>{(s==null?void 0:s.type)===ee.EMOTE?o("EditThumbnailModal",{onSaveThumbnail:B,item:s,collection:g}):p.current&&p.current.click()},[p.current,g,s,o,B]),O=d.useCallback(async a=>{const{files:c}=a.target;if(c&&c.length>0){const u=c[0],f=await se(u,1024,1024);f&&s&&(s.contents={...s.contents,...await S({[_]:f})},x(s,{[_]:f}))}},[x,s]),A=d.useCallback(()=>{o("MoveItemToCollectionModal",{item:s})},[s,o]),W=d.useCallback((a,c)=>{var V;const u=a.data,$=!(c&&ae(c));return e.jsxs(e.Fragment,{children:[e.jsx(t.Section,{children:e.jsx(t.Row,{children:e.jsx(Ue,{onClick:()=>b.push(k.collectionDetail(a.collectionId))})})}),e.jsxs(t.Narrow,{children:[!c&&!a.collectionId?e.jsx(Oe,{storageKey:Ae,children:i("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:a,hasBadge:!0,hasRarityBadge:!0,hasUtilityBadge:!0}),e.jsx("div",{children:e.jsxs(t.Button,{primary:!0,onClick:U,children:[e.jsx("input",{type:"file",ref:p,onChange:O,accept:"image/png"}),e.jsx(t.Icon,{name:"camera"}),i("item_detail_page.edit_thumbnail")]})}),e.jsxs("div",{className:"metrics",children:[e.jsx("span",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(le,{item:a})]}),C(a)?e.jsx(te,{item:a,onClick:N,children:(m,K,Q,He)=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overlay",children:e.jsx(t.Icon,{name:"play",className:"play-video-button",onClick:N})}),e.jsxs(t.Button,{primary:!0,onClick:N,children:[e.jsx(t.Icon,{name:"video"}),i("item_detail_page.edit_video")]}),e.jsxs("div",{className:"metrics",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(ne,{duration:K,size:Q,showIcons:!1})]})]})}):null,e.jsxs("div",{className:"details",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details")}),a.isPublished&&e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details_info.id")}),e.jsxs("div",{className:"value",children:["#",a.tokenId]})]}),u.category?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.category")}),e.jsx("div",{className:"value",children:i(`${a.type}.category.${u.category}`)})]}):null,a.isPublished&&a.rarity?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.supply")}),e.jsxs("div",{className:"value",children:[a.totalSupply,"/",ce(a)]})]}):null,c?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.collection")}),e.jsx(de,{className:"collection-link",to:k.collectionDetail(c.id,oe(c)),children:c.name})]}):null,a.urn?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("global.urn")}),e.jsxs("div",{className:"value urn",children:[e.jsxs("span",{children:[a.urn,e.jsx(re,{role:"button",text:a.urn,children:e.jsx(t.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:"link copy",name:"copy outline"})})]}),e.jsx("div",{className:"urn-actions",children:q(a.urn)?e.jsx(t.Popup,{content:i("collection_item.cannot_edit_urn"),disabled:!a.isPublished,position:"top center",trigger:e.jsx("div",{children:e.jsx("button",{disabled:a.isPublished,className:"link",onClick:R,children:i("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:a.name}),e.jsxs("div",{className:"actions",children:[C(a)&&e.jsx(t.Button,{className:"edit",inverted:!0,size:"small",onClick:I,children:i("global.edit")}),e.jsx(t.Button,{inverted:!0,size:"small",onClick:y,children:i("collection_detail_page.preview")}),$?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,className:"more-actions-button",children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[e.jsx(Le,{name:a.name,onDelete:L,trigger:a.isPublished?e.jsx(t.Popup,{content:i("item_detail_page.delete_published_item"),position:"right center",trigger:e.jsx(t.Dropdown.Item,{disabled:!0,text:i("global.delete")}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):e.jsx(t.Dropdown.Item,{text:i("global.delete")})}),!a.collectionId&&e.jsx(t.Dropdown.Item,{text:i("collection_item.move_to_another_collection"),onClick:A})]})}):null]})]}),e.jsxs("div",{className:"attribute-row",children:[a.description&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.description")}),e.jsx("div",{className:"data",children:a.description})]}),a.utility&&D&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.utility")}),e.jsx("div",{className:"data",children:a.utility})]})]}),a.data.tags.length?e.jsx("div",{className:"attribute-row",children:e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.tags.title")}),e.jsx("div",{className:"data tags-container",children:a.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:i("item_detail_page.selling.title")}),e.jsxs("div",{className:"data",children:[ue(a)?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),e.jsx("div",{className:"value",children:i("global.free")})]}):a.price?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),a.price?e.jsx(t.Mana,{showTooltip:!0,network:me.Network.MATIC,children:he(a.price)}):"-"]}):null,e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.beneficiary")}),a.beneficiary?e.jsx("div",{className:"value",children:xe(a.beneficiary)}):"-"]})]})]}),pe(a)&&!C(a)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.representations.title")}),e.jsx(t.Button,{className:"edit-button",inverted:!0,size:"small",onClick:I,children:z(a)?i("global.add"):i("global.edit")})]}),e.jsx("div",{className:"data",children:e.jsx("div",{className:"representations-container",children:a.data.representations.map(m=>e.jsxs("div",{className:"representation",children:[e.jsx("img",{className:"item-image",src:je(a),alt:a.name}),m.mainFile,e.jsx(ge,{item:a,bodyShape:m.bodyShapes[0]})]},m.mainFile))})})]}):null,C(a)&&((V=a.data.requiredPermissions)!=null&&V.length)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.required_permissions")}),e.jsx(t.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:i("global.learn_more")})]}),e.jsx("div",{className:"data",children:e.jsx(ve,{requiredPermissions:a.data.requiredPermissions,basic:!0})})]}):null]})]})]})]})},[D,b,p,U,O,N,R,I,I,A,y,L,y]);return e.jsx(Me,{id:l,children:(a,c,u)=>e.jsx(Re,{className:"ItemDetailPage",hasNavigation:!v&&!r,isLoading:r||u,children:v&&a?W(a,c):e.jsx(Be,{})})})}const qe=n=>{const s=Ne(n),l=s?Ie(n,s):null,r=fe(n),h=l&&l.collectionId?_e(n,l.collectionId):null,g=Ce(n),v=l?g[l.id]:null;return{itemId:s,wallet:r,item:l,collection:h,status:v,isWearableUtilityEnabled:ye(n),isLoading:T(P(n),Pe)||T(P(n),De)||T(P(n),we),hasAccess:l!==null&&Ee(n,r.address,h,l)}},Fe=n=>({onSaveItem:(s,l)=>n(ke(s,l)),onDelete:s=>n(Se(s)),onOpenModal:(s,l)=>n(Te(s,l))}),es=be(qe,Fe)(Ve);export{es as default};
@@ -1 +1 @@
1
- import{bk as _,Z as b,D as c,K as d,H as s,ah as h,M as l,G as n,hJ as k,J as x,aj as g,N as v,hK as j,hL as C}from"./index-nSeb2kLU.js";import{a as N,N as T}from"./Navigation.container-D4bOX-AY.js";import"./selectors-CRfPBNkn.js";var r=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(r||{});const E="_titleContainer_5ka3v_1",S="_backButton_5ka3v_8",B="_title_5ka3v_1",f="_templates_5ka3v_26",I="_subtitle_5ka3v_32",a={titleContainer:E,backButton:S,title:B,templates:f,subtitle:I},y=({templates:e,onLoadTemplates:u})=>{const i=_(),o=b();c.useEffect(()=>{u()},[u]);const p=c.useCallback(()=>{o.push(d.scenes())},[o]),m=c.useCallback(t=>{i==null||i.track("Go to template detail",{id:t.id,name:t.title,description:t.description}),o.push(d.templateDetail(t.id))},[i,o]);return s.jsxs(s.Fragment,{children:[s.jsx(h,{}),s.jsxs(l.Page,{isFullscreen:!0,className:"ScenesPage",children:[s.jsx(N,{activeTab:T.SCENES}),s.jsxs("div",{className:a.titleContainer,children:[s.jsx(l.Button,{className:a.backButton,basic:!0,icon:s.jsx(l.Icon,{name:"arrow alternate circle left outline"}),onClick:p,"aria-label":n("templates_page.back_to_scenes")}),s.jsx("h2",{className:a.title,children:n("templates_page.title")})]}),s.jsx("div",{className:a.templates,children:Object.values(e).map(t=>s.jsx(k,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:a.subtitle,children:[s.jsx(x,{name:"scene-parcel"}),n("templates_page.parcels",{size:t.layout.rows*t.layout.cols})]}),tag:t.templateStatus!==r.ACTIVE?{label:n("templates_page.coming_soon"),color:"#716B7C"}:void 0,disabled:t.templateStatus!==r.ACTIVE,onClick:m.bind(null,t)},t.id))})]}),s.jsx(g,{})]})},A=e=>({templates:j(e)}),G=e=>({onLoadTemplates:()=>e(C())}),F=v(A,G)(y);export{F as default};
1
+ import{bk as _,Z as b,D as c,K as d,H as s,ah as h,M as l,G as n,hJ as k,J as x,aj as g,N as v,hK as j,hL as C}from"./index-fMUqgf16.js";import{a as N,N as T}from"./Navigation.container-BbObl0Ib.js";import"./selectors-BhNw_vWj.js";var r=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(r||{});const E="_titleContainer_5ka3v_1",S="_backButton_5ka3v_8",B="_title_5ka3v_1",f="_templates_5ka3v_26",I="_subtitle_5ka3v_32",a={titleContainer:E,backButton:S,title:B,templates:f,subtitle:I},y=({templates:e,onLoadTemplates:u})=>{const i=_(),o=b();c.useEffect(()=>{u()},[u]);const p=c.useCallback(()=>{o.push(d.scenes())},[o]),m=c.useCallback(t=>{i==null||i.track("Go to template detail",{id:t.id,name:t.title,description:t.description}),o.push(d.templateDetail(t.id))},[i,o]);return s.jsxs(s.Fragment,{children:[s.jsx(h,{}),s.jsxs(l.Page,{isFullscreen:!0,className:"ScenesPage",children:[s.jsx(N,{activeTab:T.SCENES}),s.jsxs("div",{className:a.titleContainer,children:[s.jsx(l.Button,{className:a.backButton,basic:!0,icon:s.jsx(l.Icon,{name:"arrow alternate circle left outline"}),onClick:p,"aria-label":n("templates_page.back_to_scenes")}),s.jsx("h2",{className:a.title,children:n("templates_page.title")})]}),s.jsx("div",{className:a.templates,children:Object.values(e).map(t=>s.jsx(k,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:a.subtitle,children:[s.jsx(x,{name:"scene-parcel"}),n("templates_page.parcels",{size:t.layout.rows*t.layout.cols})]}),tag:t.templateStatus!==r.ACTIVE?{label:n("templates_page.coming_soon"),color:"#716B7C"}:void 0,disabled:t.templateStatus!==r.ACTIVE,onClick:m.bind(null,t)},t.id))})]}),s.jsx(g,{})]})},A=e=>({templates:j(e)}),G=e=>({onLoadTemplates:()=>e(C())}),F=v(A,G)(y);export{F as default};
@@ -0,0 +1 @@
1
+ ._container_12bci_1{background-color:var(--dark-two);border-radius:10px;padding:22px}._container_12bci_1 ._used_12bci_7{font-weight:600;font-size:16px;margin-bottom:8px}._container_12bci_1 ._description_12bci_13{color:#cfcdd4;font-size:14px;font-weight:400;margin-bottom:12px}._container_12bci_1 ._description_12bci_13 ._link_12bci_20{color:#fff;cursor:pointer;text-decoration:underline;font-weight:700}._container_12bci_1 ._space_12bci_27{display:flex;align-items:center;gap:1rem}._container_12bci_1 ._space_12bci_27 ._current_12bci_33{flex:1;font-size:1.5rem}._container_12bci_1 ._space_12bci_27 ._bar_12bci_38{flex:1;margin-bottom:0!important;background-color:#a09ba8!important}._container_12bci_1 ._space_12bci_27 ._bar_12bci_38.ui.progress .bar{background-color:#ff2d55}._worldUrl_1sb6i_1{display:flex;width:100%;justify-content:space-between}._rightContainer_1sb6i_7{display:flex;align-items:center;margin-right:20px}._rightContainer_1sb6i_7 ._copyUrn_1sb6i_13{color:var(--text)}.WorldListPage .filters{margin-bottom:16px}.WorldListPage .filters .ui.header.items-count,.WorldListPage .ui.table>thead>tr th{color:var(--text)}.WorldListPage .TableRow{cursor:default}.WorldListPage .empty-names-container{display:flex;flex-direction:column;text-align:center}.WorldListPage .empty-names-container .empty-icon{margin-bottom:30px;height:87px;width:87px}.WorldListPage .empty-names-container .empty-icon.dcl-icon{background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.6.1-15066342098.commit-7c747bd/assets/dcl-empty-state-icon-BDDqmD-V.svg)}.WorldListPage .empty-names-container .empty-icon.ens-icon{background-image:url("data:image/svg+xml,%3csvg%20width='87'%20height='87'%20viewBox='0%200%2087%2087'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='43.5'%20cy='43.5'%20r='43.5'%20fill='white'/%3e%3cg%20clip-path='url(%23clip0_119_22392)'%3e%3cpath%20d='M22.9004%2037.517C23.5096%2038.8466%2025.0327%2041.5058%2025.0327%2041.5058L42.4718%2011.8638L25.4896%2024.0647C24.4996%2024.7686%2023.6619%2025.7071%2023.0527%2026.8021C21.4534%2030.1652%2021.4534%2034.0757%2022.9004%2037.517Z'%20fill='url(%23paint0_linear_119_22392)'/%3e%3cpath%20d='M16.0466%2047.215C16.4274%2052.9244%2019.2451%2058.2427%2023.662%2061.684L42.4719%2075.1363C42.4719%2075.1363%2030.6681%2057.6952%2020.7681%2040.3324C19.7781%2038.5335%2019.0928%2036.5%2018.7881%2034.3884C18.6358%2033.4498%2018.6358%2032.5113%2018.7881%2031.5728C18.5597%2032.042%2018.0266%2033.0588%2018.0266%2033.0588C17.0366%2035.1705%2016.3512%2037.4386%2015.9705%2039.7849C15.742%2042.2877%2015.742%2044.7904%2016.0466%2047.215Z'%20fill='%23A0A8D4'/%3e%3cpath%20d='M64.0234%2049.5615C63.4141%2048.2319%2061.8911%2045.5728%2061.8911%2045.5728L44.4519%2075.1365L61.5103%2063.0138C62.5003%2062.3099%2063.338%2061.3714%2063.9472%2060.2764C65.4703%2056.9134%2065.5464%2053.0028%2064.0234%2049.5615Z'%20fill='url(%23paint1_linear_119_22392)'/%3e%3cpath%20d='M70.9534%2039.7851C70.5726%2034.0757%2067.7549%2028.7574%2063.338%2025.3161L44.5281%2011.8638C44.5281%2011.8638%2056.3319%2029.3048%2066.2318%2046.6677C67.2218%2048.4665%2067.9072%2050.5%2068.2118%2052.6117C68.3641%2053.5503%2068.3641%2054.4888%2068.2118%2055.4273C68.4403%2054.9581%2068.9734%2053.9413%2068.9734%2053.9413C69.9634%2051.8296%2070.6487%2049.5615%2071.0295%2047.2934C71.1818%2044.7124%2071.1818%2042.2879%2070.9534%2039.7851Z'%20fill='%23A0A8D4'/%3e%3cpath%20d='M23.0535%2026.8021C23.6627%2025.7071%2024.4242%2024.7686%2025.4904%2024.0647L42.4726%2011.8638L25.0335%2041.4275C25.0335%2041.4275%2023.5104%2038.7684%2022.9012%2037.4388C21.4543%2034.0757%2021.4543%2030.1652%2023.0535%2026.8021ZM16.0474%2047.2152C16.4281%2052.9246%2019.2458%2058.2429%2023.6627%2061.6842L42.4726%2075.1365C42.4726%2075.1365%2030.6688%2057.6954%2020.7689%2040.3326C19.7789%2038.5337%2019.0935%2036.5002%2018.7889%2034.3885C18.6366%2033.45%2018.6366%2032.5115%2018.7889%2031.573C18.5604%2032.0422%2018.0273%2033.059%2018.0273%2033.059C17.0373%2035.1707%2016.352%2037.4388%2015.9712%2039.7851C15.7427%2042.2879%2015.7427%2044.7906%2016.0474%2047.2152ZM64.0241%2049.5615C63.4149%2048.2319%2061.8918%2045.5727%2061.8918%2045.5727L44.4526%2075.1365L61.511%2063.0138C62.501%2062.3099%2063.3387%2061.3714%2063.9479%2060.2764C65.471%2056.9133%2065.5472%2053.0028%2064.0241%2049.5615ZM70.8779%2039.8633C70.4972%2034.1539%2067.6795%2028.8356%2063.2626%2025.3943L44.5288%2011.8638C44.5288%2011.8638%2056.3326%2029.3048%2066.2325%2046.6677C67.2225%2048.4665%2067.9079%2050.5%2068.2125%2052.6117C68.3649%2053.5503%2068.3649%2054.4888%2068.2125%2055.4273C68.441%2054.958%2068.9741%2053.9413%2068.9741%2053.9413C69.9641%2051.8296%2070.6495%2049.5615%2071.0302%2047.2934C71.1825%2044.7124%2071.1825%2042.2879%2070.8779%2039.8633Z'%20fill='url(%23paint2_linear_119_22392)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_119_22392'%20x1='43.265'%20y1='12.6053'%20x2='20.2441'%20y2='36.9051'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.58'%20stop-color='%23A0A8D4'/%3e%3cstop%20offset='0.73'%20stop-color='%238791C7'/%3e%3cstop%20offset='0.91'%20stop-color='%236470B4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_119_22392'%20x1='43.735'%20y1='74.4471'%20x2='66.7471'%20y2='50.1648'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.58'%20stop-color='%23A0A8D4'/%3e%3cstop%20offset='0.73'%20stop-color='%238791C7'/%3e%3cstop%20offset='0.91'%20stop-color='%236470B4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_119_22392'%20x1='43.4798'%20y1='11.551'%20x2='43.4798'%20y2='75.3711'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23513EFF'/%3e%3cstop%20offset='0.18'%20stop-color='%235157FF'/%3e%3cstop%20offset='0.57'%20stop-color='%235298FF'/%3e%3cstop%20offset='1'%20stop-color='%2352E5FF'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_119_22392'%3e%3crect%20width='55.3636'%20height='63.2727'%20fill='white'%20transform='translate(15.8181%2011.8638)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")}.WorldListPage .empty-names-container .empty-title{font-size:24px;font-weight:600;line-height:29px;color:var(--text)}.WorldListPage .empty-names-container .empty-description{font-size:14px;font-weight:500;line-height:24px;color:var(--text);max-width:612px}.WorldListPage .empty-names-container .empty-action{margin-top:40px;width:372px}.WorldListPage .Icon.right-round-arrow{margin-bottom:-2px}.WorldListPage .TableRow .dcl.column.subdomain-wrapper{display:flex;flex:none;flex-direction:row}.WorldListPage .TableRow .empty-url{color:#fffc;font-style:italic}.WorldListPage .TableRow .publish-scene{display:flex;width:100%;justify-content:space-between;align-items:center}.WorldListPage .TableRow .publish-scene span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100px}.WorldListPage .TableRow .publish-scene button{margin-right:20px;width:168px}.WorldListPage .TableRow .world-status.active{color:#34ce76}.WorldListPage .TableRow .world-status.inactive{color:#cfcdd4}.WorldListPage .TableRow .world-status.warning{color:var(--danger)}.WorldListPage .TableRow .world-status.blocked{color:var(--error)}.WorldListPage .ui.pagination{width:100%;display:flex;justify-content:center}.WorldListPage .ui.pagination .item[type=nextItem],.WorldListPage .ui.pagination .item[type=prevItem]{position:absolute;background-color:var(--secondary)}.WorldListPage .ui.pagination .item[type=prevItem]{left:0}.WorldListPage .ui.pagination .item[type=nextItem]{right:0}.WorldListPage .pagination-section{width:100%}.WorldListPage .ui.sub.header.items-count{flex:1 0 auto;text-transform:uppercase;font-size:13px;line-height:18px;font-weight:500}.WorldListPage .actions{display:flex;flex:1 0 auto;align-items:center;justify-content:flex-end;font-size:13px;line-height:18px;text-transform:uppercase}.WorldListPage .actions .ui.button.basic{width:16px;height:16px;box-sizing:content-box;padding:5px 10px;border-radius:4px;border:solid 1px var(--gray)}.WorldListPage .claim-name .Icon{display:block}.WorldListPage .ui.dropdown{margin-right:20px}.WorldListPage .worlds-storage{margin-bottom:24px}.WorldListPage .insufficient-storage-message{display:flex;align-items:center;gap:1rem;background-color:var(--dark-two);border-radius:10px;padding:22px;margin-bottom:24px}
@@ -1 +1 @@
1
- var rt=Object.defineProperty;var dt=(n,l,e)=>l in n?rt(n,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[l]=e;var h=(n,l,e)=>dt(n,typeof l!="symbol"?l+"":l,e);import{af as J,H as t,M as c,G as d,bm as H,bC as ct,D as x,gs as K,L as ee,K as R,ce as Me,b8 as _,N as B,bw as V,eC as ht,gt as mt,gu as gt,gv as pt,gw as ut,gx as Ct,gy as It,gz as bt,gA as xt,gB as _t,gC as L,eq as vt,gD as Z,gE as Et,gF as Q,fb as Le,fq as jt,fW as St,fX as ft,ez as he,gl as wt,aH as te,gG as Tt,da as be,gH as xe,bt as Oe,gI as yt,fY as Pt,eD as me,aW as At,gJ as Nt,gK as Rt,gL as Dt,fn as Mt,f_ as Lt,f$ as Ot,Z as ke,bv as Be,gM as kt,eR as fe,bD as Bt,fj as We,ae as Wt,gN as Fe,eG as _e,X as He,et as Ft,eo as Ve,fE as X,dC as ge,ep as Ht,eU as pe,gO as $e,bk as ve,fU as Ue,eX as y,er as Y,fz as ze,fA as ue,J as O,f5 as Ce,dB as Vt,eP as $t,eA as Ut,gP as Ee,fa as je,fi as zt,gQ as Yt,gR as Jt,gS as qt,gT as Ye,gU as Je,gV as qe,gW as Ge,fI as Ze,eJ as Gt,eI as Ke,eK as Zt,eM as Kt,eN as Qt,gX as Xt,gY as es,gZ as ts,g_ as se,g$ as oe,h0 as ss,ec as as,h1 as ns,h2 as is,h3 as ls,h4 as os,h5 as rs,h6 as ds,h7 as cs,h8 as hs,h9 as ms,ha as gs,hb as ps,hc as us,hd as Cs,he as Is,hf as bs,hg as xs,hh as _s,hi as vs,fZ as Es,bN as ne,hj as js,hk as we,hl as Ss,hm as fs,eT as Te,fF as re,hn as de,eS as ws,eO as ye,eV as Ts,eW as Pe,eY as Ae,eZ as Ne,ho as ys,hp as Ps,e_ as As,e$ as Re,f0 as De,hq as Ns,f8 as Rs,hr as Ds,hs as Ms,ht as Ls,hu as Qe,hv as Os,hw as ks,hx as Bs,fc as Ws,hy as Fs,hz as Hs,eF as Vs,hA as $s,fd as Us,ff as zs,hB as Ys}from"./index-nSeb2kLU.js";import{J as Js}from"./JumpIn.container-CHK-Z_Zl.js";import{C as qs}from"./CollectionProvider.container-Cen6wteT.js";import{C as Xe}from"./ConfirmDelete-DRi0COjr.js";import{C as et}from"./CollectionStatus.container-IfxJ2FXJ.js";import{d as Gs,e as Zs,c as Ks}from"./selectors-CRfPBNkn.js";import{I as Qs}from"./ItemProvider.container-D5psKqp5.js";const Xs=({open:n,assignee:l,onConfirm:e,onClose:s})=>t.jsxs(c.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:n,children:[t.jsx(c.Modal.Header,{children:d("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(c.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx(H,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(ct,{textOnly:!0,address:l})})}})}),t.jsx("span",{children:t.jsx(H,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:s,children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:e,children:d("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),ea=J.memo(Xs);var T=(n=>(n.REJECT_COLLECTION="REJECT_COLLECTION",n.REJECT_CURATION="REJECT_CURATION",n.DISABLE_COLLECTION="DISABLE_COLLECTION",n.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",n))(T||{});const k="item_editor.top_panel.rejection_modal",ta=({open:n,type:l,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:i,collection:o,curation:r,onReject:m,onRejectCuration:g,onClose:p})=>{const I=x.useMemo(()=>{switch(l){case T.DISABLE_COLLECTION:return k+".disable_collection";case T.REJECT_CURATION:return k+".reject_curation";case T.DISABLE_THIRD_PARTY:return k+".disable_third_party";default:return""}},[l]),S=()=>{switch(l){case T.DISABLE_COLLECTION:m(o);break;case T.REJECT_CURATION:g(r.collectionId);break;case T.DISABLE_THIRD_PARTY:s&&i(s.id);break}},E=l===T.DISABLE_COLLECTION&&!o.isApproved||l===T.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||l===T.REJECT_COLLECTION&&!o.isApproved||l===T.REJECT_CURATION&&(r==null?void 0:r.status)===K.REJECTED;return t.jsx(c.Modal,{size:"tiny",className:"RejectionModal",open:n,children:a?t.jsx(sa,{i18nKey:I}):E?t.jsx(aa,{link:o.forumLink,onClose:p}):t.jsx(na,{i18nKey:I,isLoading:e,onClose:p,onConfirm:S})})},sa=({i18nKey:n})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(`${n}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:d(`${n}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx(H,{id:k+".visit_activity",values:{activity_link:t.jsx(ee,{to:R.activity(),children:d("global.activity")})}})}),t.jsx(c.Loader,{active:!0,size:"large"})]})]}),aa=({link:n,onClose:l})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(k+".veredict_explanation")}),t.jsx(c.Modal.Content,{children:d(k+".go_to_forum")}),t.jsxs(c.Modal.Actions,{children:[t.jsx("a",{href:n,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(c.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:d(k+".forum_link")}),t.jsx("div",{className:"discussion",children:d(k+".discussion")}),t.jsx(c.Icon,{name:"chevron right"})]})}),t.jsx(c.Button,{basic:!0,onClick:l,children:d("global.done")})]})]}),na=({i18nKey:n,isLoading:l,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(`${n}.title`)}),t.jsx(c.Modal.Content,{children:d(`${n}.subtitle`)}),t.jsxs(c.Modal.Actions,{children:[t.jsx(Me,{primary:!0,onClick:e,disabled:l,loading:l,network:_.Network.MATIC,children:d(`${n}.action`)}),t.jsx(c.Button,{disabled:l,onClick:s,children:d("global.cancel")})]})]}),ia=J.memo(ta),la=(n,l)=>({isLoading:V(ht(n),xt)||V(mt(n),_t)||gt(n),hasPendingTransaction:pt(n)||!!(l.thirdParty&&ut(n,l.thirdParty.id))}),oa=n=>({onReject:l=>n(Ct(l)),onRejectCuration:l=>n(It(l)),onDisableThirdParty:l=>n(bt(l))}),ra=B(la,oa)(ia);var j=(n=>(n[n.APPROVE=0]="APPROVE",n[n.REJECT=1]="REJECT",n[n.ENABLE=2]="ENABLE",n[n.DISABLE=3]="DISABLE",n))(j||{});let da=class extends J.PureComponent{constructor(){super(...arguments);h(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});h(this,"handleBack",()=>{this.props.onNavigate(R.curation())});h(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:i,onInitiateTPApprovalFlow:o,onSetAssignee:r}=this.props;this.setState({showApproveConfirmModal:!1}),a&&r(e.id,a,s),L(e)?o(e):i(e)});h(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));h(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:i,totalItems:o,thirdParty:r}=this.props,{showRejectionModal:m,showApproveConfirmModal:g}=this.state,{chainId:p}=this.props,I=vt(e);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"actions",children:t.jsx("div",{className:"back",onClick:this.handleBack})}),t.jsxs("div",{className:"title",children:[e.name," · ",d(`collection.type.${I}`),t.jsx(Js,{size:"small",active:!0,collection:e,chainId:p,items:L(e)?s:void 0,text:d("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:L(e)&&o!==void 0?this.renderTPButtons(e,i,a):this.renderButtons(e,i)})}),m&&t.jsx(ra,{type:m,open:!0,collection:e,curation:i,thirdParty:r,onClose:()=>this.setShowRejectionModal(null)}),(i==null?void 0:i.assignee)&&g&&t.jsx(ea,{open:!0,assignee:i.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,i),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});h(this,"renderButton",(e,s,a)=>{const{address:i,thirdParty:o,onInitiateApprovalFlow:r,onInitiateTPApprovalFlow:m,reviewedItems:g,totalItems:p}=this.props,I={[j.APPROVE]:()=>a!=null&&a.assignee&&i!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):L(s)?m(s):r(s),[j.ENABLE]:()=>r(s),[j.DISABLE]:()=>this.setShowRejectionModal(o?T.DISABLE_THIRD_PARTY:T.DISABLE_COLLECTION),[j.REJECT]:()=>{(a==null?void 0:a.status)===K.PENDING?this.setShowRejectionModal(T.REJECT_CURATION):this.setShowRejectionModal(T.REJECT_COLLECTION)}},S={[j.APPROVE]:"approve",[j.ENABLE]:"enable",[j.DISABLE]:"disable",[j.REJECT]:"reject"},E=e===j.APPROVE||e===j.ENABLE,b=!L(s)||!!p&&g.length>=Z(p);return t.jsx(c.Popup,{content:d("item_editor.top_panel.items_pending_to_review"),disabled:b,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(c.Button,{primary:E,onClick:()=>I[e](),disabled:L(s)&&e===j.APPROVE&&!!p&&g.length<Z(p),children:d(`item_editor.top_panel.${S[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});h(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:i,totalItems:o,thirdParty:r}=this.props,m=a==null?void 0:a.some(g=>g.status===K.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(c.Header,{sub:!0,children:[m?d("item_editor.top_panel.reviewed_counter",{count:i.length,threshold:Z(o)}):d("item_editor.top_panel.not_enough_items_to_curate_more"),i.length>=Z(o)?t.jsx(c.Icon,{name:"check circle"}):null]}),m&&this.renderButton(j.APPROVE,e,s),m&&this.renderButton(j.REJECT,e,s),!m&&(r==null?void 0:r.isApproved)&&this.renderButton(j.DISABLE,e,null)]})});h(this,"renderButtons",(e,s)=>{if(s&&e.isApproved)switch(s.status){case"pending":return t.jsxs(t.Fragment,{children:[this.renderButton(j.APPROVE,e,s),this.renderButton(j.REJECT,e,s)]});case"approved":case"rejected":return this.renderButton(j.DISABLE,e,s)}return Et(e)?e.isApproved?this.renderButton(j.DISABLE,e,s):this.renderButton(j.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(j.APPROVE,e,s),this.renderButton(j.REJECT,e,s)]})})}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:i,isConnected:o,isLoading:r}=this.props,m=!e||r&&!s.length;return a&&i&&o?t.jsx("div",{className:"TopPanel",children:m?t.jsx(c.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const ca=n=>{const l=Q(n),e=l?Le(n,l):null,s=e?jt(n,e.id):[],a=e?St(n,e.id):[],i=l?ft(n,l):null,o=l?he(n,l):void 0,r=e&&L(e)?wt(n,e):null;return{address:te(n),items:s,totalItems:(o==null?void 0:o.total)||null,collection:e,itemCurations:a,thirdParty:r,curation:i,chainId:Tt(n),isConnected:be(n),isReviewing:xe(n),isCommitteeMember:Oe(n),selectedCollectionId:Q(n),isLoading:V(yt(n),Mt)||V(Pt(n),Lt)||V(me(n),Ot)}},ha=n=>({onNavigate:l=>n(At(l)),onSetAssignee:(l,e,s)=>n(Nt(l,e,s)),onInitiateTPApprovalFlow:l=>n(Rt(l)),onInitiateApprovalFlow:l=>n(Dt(l))}),ma=B(ca,ha)(da),ga="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.22722%2012.7164C4.07574%2012.5731%204%2012.3582%204%2012.2149C4%2012.0716%204.07574%2011.8567%204.22722%2011.7134L5.28757%2010.7104C5.59053%2010.4239%206.04497%2010.4239%206.34793%2010.7104L9.35858%2013.8448C9.51006%2013.9881%209.73728%2013.9881%209.88876%2013.8448L17.6521%206.21493C17.955%205.92836%2018.4095%205.92836%2018.7124%206.21493L19.7728%207.21791C20.0757%207.50448%2020.0757%207.93433%2019.7728%208.2209L10.116%2017.7851C9.9645%2017.9284%209.81302%2018%209.5858%2018C9.35858%2018%209.2071%2017.9284%209.05562%2017.7851L4.22722%2012.7164Z'%20fill='white'/%3e%3c/svg%3e",pa=n=>{const{collectionId:l,itemName:e}=n,[s,a]=x.useState(!1),[i,o]=x.useState(null),r=ke(),m=Be();x.useEffect(()=>{e&&(a(!0),o(e))},[e]);function g(){a(!1);const p=new URLSearchParams(m.search);p.delete("newItem"),r.replace({search:p.toString()})}return s&&i&&l?t.jsx(c.Toast,{type:c.ToastType.INFO,title:d("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:ga,alt:d("sagas.item.item_added_toast.title")})}),onClose:g,body:t.jsx(H,{id:"sagas.item.item_added_toast.body",values:{name:i,br:()=>t.jsx("br",{}),b:p=>t.jsx("strong",{children:p}),"collection-link":p=>t.jsx(ee,{to:R.collectionDetail(l),children:t.jsx(c.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:p})})}})}):null},ua=J.memo(pa),Ca=n=>({itemName:kt(n)}),Ia=B(Ca)(ua),ba=({collection:n,address:l,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:i,onDeleteCollection:o})=>{var u,W;const r=Be(),m=ke(),g=((u=r.state)==null?void 0:u.fromParam)===fe.COLLECTIONS,p=((W=r.state)==null?void 0:W.fromParam)===fe.TP_COLLECTIONS,I=x.useCallback(()=>{m.push(R.collections())},[m]),S=x.useCallback(()=>{if(n&&(g||p)){const F=g?R.collectionDetail:R.thirdPartyCollectionDetail;m.push(F(n.id))}else m.push(R.itemEditor())},[g,p,m,n]),E=x.useCallback(()=>{i("CreateCollectionModal")},[i]),b=x.useCallback(()=>{n&&i("CreateSingleItemModal",{collectionId:n.id})},[n,i]),C=x.useCallback(()=>{n&&i("AddExistingItemModal",{collectionId:n.id})},[n,i]),w=x.useCallback(()=>{n&&i("EditCollectionNameModal",{collection:n})},[n,i]),f=x.useCallback(()=>{n&&o(n)},[n,o]),D=x.useCallback(()=>{const F=n&&Bt(n.owner,l||"");return n?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${g||p?"close":"back"}`,onClick:S}),t.jsxs("div",{className:"title",children:[t.jsx(ee,{to:R.collectionDetail(n.id),children:n.name}),t.jsx(et,{collection:n})]}),F&&!n.isPublished?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(c.Dropdown.Menu,{children:[t.jsx(c.Dropdown.Item,{onClick:w,children:d("item_editor.left_panel.actions.edit_name")}),t.jsx(c.Dropdown.Item,{onClick:b,children:d("item_editor.left_panel.actions.new_item")}),e&&t.jsx(c.Dropdown.Item,{onClick:C,children:d("item_editor.left_panel.actions.add_existing_item")}),t.jsx(Xe,{name:n.name,onDelete:f,trigger:t.jsx(c.Dropdown.Item,{text:d("global.delete")})})]})}):null]}):null},[n,l,e,g,p]),M=x.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:I}),t.jsx("div",{className:"title",children:e?d("item_editor.left_panel.title"):d("item_editor.left_panel.title_alternative")}),s?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(c.Dropdown.Menu,{children:t.jsx(c.Dropdown.Item,{onClick:E,children:d("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(c.Row,{grow:!1,shrink:!1,className:"Header",children:n?D():M()})},xa=ba,_a=n=>{let l;const e=Q(n);e&&(l=We(n).find(i=>i.id===e));const s=te(n);return{address:s,isLoggedIn:Wt(n),isReviewing:xe(n),collection:l,hasEditRights:l!==void 0&&s!==void 0&&Fe(n,s,l),hasUserOrphanItems:_e(n)}},va=n=>({onOpenModal:(l,e)=>n(He(l,e)),onDeleteCollection:l=>n(Ft(l)),onDeleteItem:l=>n(Ve(l))}),Ea=B(_a,va)(xa),P=10;class N extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{isCollapsed:!1});h(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,i=!a;return t.jsxs("div",{className:`Collapsable ${i?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:i?s:null})]})}}class ja extends x.PureComponent{constructor(){super(...arguments);h(this,"handleClick",()=>{const{item:e,onClick:s}=this.props;s(e)})}renderToggleItem(){const{item:e,isVisible:s,isPlayingEmote:a}=this.props;return X(e)?t.jsx(c.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:i}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(ee,{to:R.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(ge,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Ht,{item:e}),e.name]}),t.jsx(c.Popup,{content:d("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:d(`body_shapes.${pe(e)}`).toLowerCase()})}),disabled:$e(e,i),position:"top center",trigger:this.renderToggleItem()})]})})}}const Sa=ja;var v=(n=>(n.TO_REVIEW="to-review",n.REVIEWED="reviewed",n.ALL_ITEMS="all-items",n))(v||{});const fa={[v.TO_REVIEW]:1,[v.REVIEWED]:1,[v.ALL_ITEMS]:1};class wa extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{currentTab:v.TO_REVIEW,currentPages:fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});h(this,"analytics",ve());h(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:i}=this.state;this.getIsReviewingTPItems()&&i===v.TO_REVIEW&&!Ue(s,e==null?void 0:e.items)&&a()});h(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});h(this,"handleClick",e=>{var g;const{bodyShape:s,visibleItems:a,wearableController:i,isPlayingEmote:o,onSetItems:r}=this.props;if(!$e(e,s))return;let m=a.filter(p=>p.id!==e.id);if(X(e))if(this.isVisible(e)){o?i==null||i.emote.pause():i==null||i.emote.play();return}else m=m.filter(p=>p.type!==y.EMOTE);this.isVisible(e)||(m.push(e),(g=this.analytics)==null||g.track("Preview Item",{ITEM_ID:e!=null&&e.urn?Y(e.urn)?ze(e.urn):ue(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:Y(e.urn)})),r(m)});h(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:i}=this.props,{currentPages:o}=this.state;e===v.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{i(),s(o[v.ALL_ITEMS])}):e===v.TO_REVIEW&&a(),this.setState({currentTab:e})});h(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});h(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});h(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:i}=this.props;this.setState(o=>({currentPages:{...o.currentPages,[a]:+s.activePage}})),a!==v.REVIEWED&&i(+s.activePage)});h(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(v.ALL_ITEMS)});h(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?Y(e.urn)&&s:!1});h(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:i,isPlayingEmote:o}=this.props;return t.jsx(Sa,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:o,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:i,onClick:this.handleClick},e.id)});h(this,"renderSidebarCategory",e=>{const s=e.filter(Ce),a=e.filter(X);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:d("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(N,{label:this.renderCollapsableLabel(y.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(N,{label:this.renderCollapsableLabel(y.EMOTE),children:a.map(this.renderSidebarItem)})]})});h(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,i=a[s],o=Math.ceil(e/P);return o>1?t.jsx(c.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:o,activePage:i,onPageChange:this.handlePageChange}):null});h(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,i=s[a],o=(i-1)*P,r=i*P;return t.jsx(c.Header,{sub:!0,children:d("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:o,pageEnd:r>e?e:r,total:e})})});h(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:i}=this.props,{currentTab:o,currentPages:r}=this.state,m=this.getIsReviewingTPItems(),g=r[o];if(s)return t.jsx(c.Loader,{size:"large",active:!0});switch(o){case v.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!m&&a?this.renderTabPagination(a):null]});case v.REVIEWED:{const p=i.slice((g-1)*P,g*P);return t.jsxs(t.Fragment,{children:[i.length?this.renderPaginationStats(i.length):null,this.renderSidebarCategory(p),i.length?this.renderTabPagination(i.length):null]})}case v.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});h(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:i}=this.state;let o;const r=!s||s<P||a.length===s;switch(i){case v.TO_REVIEW:o=t.jsx(c.Popup,{content:d("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!r,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(c.Button,{disabled:e||r,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(c.Icon,{name:"random"}),d("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case v.REVIEWED:o=t.jsx(H,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:d("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:Z(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",o," "]})});h(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(c.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(c.Modal.Header,{children:d("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(c.Modal.Content,{children:[t.jsx(H,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:v.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(c.Checkbox,{checked:!s}),d("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:this.handleModalProceed,children:d("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});h(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(c.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(c.Modal.Header,{children:d("item_editor.left_panel.all_items_check.title")}),t.jsx(c.Modal.Content,{children:d("item_editor.left_panel.all_items_check.content")}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:()=>this.handleTabChange(v.ALL_ITEMS),children:d("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});h(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(c.Tabs,{isFullscreen:!0,children:[t.jsx(c.Tabs.Tab,{active:e===v.TO_REVIEW,onClick:()=>this.handleTabChange(v.TO_REVIEW),children:d("item_editor.left_panel.to_review")}),t.jsx(c.Tabs.Tab,{active:e===v.REVIEWED,onClick:()=>this.handleTabChange(v.REVIEWED),children:d("item_editor.left_panel.reviewed")}),t.jsx(c.Tabs.Tab,{active:e===v.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:d("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(O,{name:e}),t.jsx(H,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(c.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class Ta extends x.PureComponent{render(){const{collection:l,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(ee,{to:R.itemEditor({collectionId:l.id}),children:[t.jsx(Vt,{collectionId:l.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(et,{collection:l}),l.name]}),t.jsx("div",{className:"count",children:d("item_editor.left_panel.items_count",{count:l.itemCount})})]})]})})}}const ya=Ta;class Pa extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{currentPage:1});h(this,"handlePageChange",(e,s)=>{const{onLoadPage:a}=this.props;this.setState({currentPage:+s.activePage}),a(+s.activePage)})}render(){const{collections:e,isLoading:s,items:a,selectedCollectionId:i,totalCollections:o}=this.props,{currentPage:r}=this.state;if(e.length===0)return null;const m=Math.ceil(o/P);return s?t.jsx(c.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:d("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(c.Section,{className:"Collections",children:[e.map(g=>t.jsx(ya,{collection:g,items:a,isSelected:g.id===i},g.id)),m>1?t.jsx(c.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:m,activePage:r,onPageChange:this.handlePageChange}):null]})})}}var z=(n=>(n.COLLECTIONS="collections",n.ORPHAN_ITEMS="orphanItems",n))(z||{});const U=1;let Aa=class extends x.PureComponent{constructor(){super(...arguments);h(this,"state",this.getInitialState());h(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});h(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:i,selectedCollectionId:o}=this.props,{pages:r}=this.state;if(e&&!i&&!o){const m=r[r.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:P,page:m})}});h(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});h(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));h(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:i,onSetReviewedItems:o}=this.props,r=this.isCollectionTabActive()?i:a,m=Math.ceil(r/P);if(m>s.length){const g=[...Array(m).keys()].map(p=>p+1).filter(p=>!s.includes(p));if(g.length>0){const p=g[Math.floor(Math.random()*g.length)];this.setState(I=>({pages:[...I.pages,p]}),this.fetchResource)}}o(e)});h(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[U]},this.fetchResource)});h(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===z.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=z.COLLECTIONS;return!e&&s&&(a=z.ORPHAN_ITEMS),{pages:[U],currentTab:a,initialPage:U,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:i,onSetItems:o}=this.props;this.fetchResource(),e&&s===void 0&&i(e),a&&o([a])}componentDidUpdate(e,s){const{isConnected:a,address:i,selectedCollectionId:o,selectedItemId:r,selectedItem:m,orphanItems:g,totalItems:p,visibleItems:I,hasUserOrphanItems:S,onSetItems:E,onFetchOrphanItem:b}=this.props,{initialPage:C,pages:w}=this.state;if(!o&&i&&r&&p&&(C===U||s.initialPage<C)){if(!g.find(f=>f.id===r)){const f=Math.ceil(p/P),D=w[w.length-1],M=Math.min(f,D+1);w.includes(M)||this.setState({pages:[M],initialPage:M},this.fetchResource)}}else if(e.selectedItemId&&r&&e.selectedItemId!==r){const f=I.filter(D=>D.type!==y.EMOTE);E(f)}else i&&a&&(a!==e.isConnected||e.selectedCollectionId&&!o)&&this.setState({pages:[U]},this.fetchResource),e.selectedCollectionId!==o&&this.setState({pages:[U]}),i&&i!==e.address&&S===void 0&&b(i);!e.selectedItem&&m&&m.type!==y.EMOTE&&E([m]),e.selectedCollectionId!==o&&E([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:i,orphanItems:o,isReviewing:r}=this.props;return i&&e?$t(e)&&r?s.filter(m=>!!(a!=null&&a.find(g=>g.itemId===m.id&&g.status===K.PENDING))):s:o}render(){const{items:e,totalItems:s,totalCollections:a,collections:i,selectedItemId:o,selectedCollectionId:r,visibleItems:m,bodyShape:g,reviewedItems:p,isReviewing:I,isPlayingEmote:S,isConnected:E,wearableController:b,isLoading:C,hasUserOrphanItems:w,onSetItems:f,onSetReviewedItems:D,onResetReviewedItems:M}=this.props,{pages:u,showSamplesModalAgain:W}=this.state,F=!r&&w,le=this.isCollectionTabActive()&&!r,A=!this.isCollectionTabActive()||r;return t.jsx("div",{className:"LeftPanel",children:E?t.jsx(qs,{id:r,itemSelected:o,itemsPage:u,itemsPageSize:P,fetchCollectionItemsOptions:{status:I?K.PENDING:void 0},onChangePage:q=>this.setState({pages:[q]}),children:({paginatedCollections:q,collection:$,paginatedItems:st,initialPage:at,isLoadingCollection:nt,isLoadingCollectionItems:it,itemCurations:lt})=>{const G=this.getItems($,st,lt),Se=this.isCollectionTabActive(),ot=r&&$?at:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(Ea,{}),F?t.jsxs(c.Tabs,{isFullscreen:!0,children:[t.jsx(c.Tabs.Tab,{active:Se,onClick:()=>this.handleTabChange(z.COLLECTIONS),children:d("collections_page.collections")}),t.jsx(c.Tabs.Tab,{active:!Se,onClick:()=>this.handleTabChange(z.ORPHAN_ITEMS),children:d("item_editor.left_panel.items")})]}):null,le?t.jsx(Pa,{collections:q,totalCollections:a||i.length,items:e,hasHeader:G.length>0,selectedCollectionId:r,onLoadPage:this.loadPage,isLoading:nt}):null,A?t.jsxs(t.Fragment,{children:[t.jsx(wa,{items:G,totalItems:s||G.length,hasHeader:!r&&i.length>0,selectedItemId:o,collection:$,isReviewing:I,isPlayingEmote:S,visibleItems:m,bodyShape:g,onResetReviewedItems:M,reviewedItems:p,onSetItems:f,wearableController:b,initialPage:ot,isLoading:it||C,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:W,onReviewItems:()=>D(G),onLoadRandomPage:()=>this.loadRandomPage(G),onLoadPage:this.loadPage}),t.jsx(Ia,{collectionId:r})]}):null]})}}):null})}};const Na=n=>{const l=Q(n),e=te(n),s=l?he(n,l):e?he(n,e):void 0,a=l?void 0:Ut(n),i=Ee(n)||"",o=je(n,i);return{address:e,isConnected:be(n),items:zt(n),totalItems:(s==null?void 0:s.total)||null,totalCollections:(a==null?void 0:a.total)||null,orphanItems:e&&!l?Yt(n,e,s==null?void 0:s.limit):Jt(n),collections:qt(n),selectedItemId:i,selectedItem:o,selectedCollectionId:l,visibleItems:Ye(n),bodyShape:Je(n),wearableController:qe(n),isReviewing:xe(n),isLoading:V(me(n),Kt)||V(me(n),Qt),isPlayingEmote:Ge(n),hasUserOrphanItems:_e(n)}},Ra=n=>({onSetItems:l=>n(Ze(l)),onFetchCollections:(l,e)=>n(Gt(l,e)),onFetchOrphanItems:(l,e)=>n(Ke(l,e)),onFetchOrphanItem:l=>n(Zt(l))}),Da=B(Na,Ra)(Aa);class ce extends J.PureComponent{constructor(){super(...arguments);h(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:i,onChange:o}=this.props;if(a.toHexString()!==s.value){const r=i.find(m=>m.toHexString()===s.value);o(r)}});h(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(c.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,i=e.toHexString();return t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:i,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:i}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(c.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ma=class extends J.PureComponent{constructor(){super(...arguments);h(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:i,bodyShape:o,onChange:r,baseWearables:m}=this.props,g=s.value?m.find(p=>p.id===s.value):null;a!==g&&r(i,o,g??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:i,isNullable:o,baseWearables:r}=this.props,m=Xt(r,a,s).map(p=>({value:p.id,text:es(p)}));o&&m.push({value:"",text:d("global.none")});const g=e?m.find(p=>p.value===e.id):null;return t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:m,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:i}),t.jsx("div",{className:"value",children:g?g.text:d("global.none")}),t.jsx("div",{className:"handle"})]})})}};const La=n=>({baseWearables:ts(n)}),ae=B(La)(Ma);let Oa=class extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1});h(this,"analytics",ve());h(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});h(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});h(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:i,onSetAvatarAnimation:o,onSetItems:r}=this.props,m=a.find(p=>p.id===s),g=i.filter(p=>p.type!==y.EMOTE);g.forEach(p=>{var I;(I=this.analytics)==null||I.track("Play Emote",{EMOTE_PLAYED_BASE:!m,EMOTE_PLAYED_ITEM_ID:m!=null&&m.urn?ue(m.urn):null,EMOTE_PLAYED_NAME:m?m.name:s,PREVIEWED_WEARABLE_ITEM_ID:p!=null&&p.urn?Y(p.urn)?ze(p.urn):ue(p.urn):null,PREVIEWED_WEARABLE_NAME:p.name})}),m?g.push(m):o(s),r(g)});h(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});h(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});h(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});h(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:i}=this.props;i(e,s,a)});h(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(c.WearablePreview.createController("wearable-editor")),this.setState({isLoading:!1})});h(this,"handleControlActionChange",async e=>{const{wearableController:s}=this.props,a=.1;if(s)switch(await(s==null?void 0:s.emote.pause()),e){case se.ZOOM_IN:{await(s==null?void 0:s.scene.changeZoom(a));break}case se.ZOOM_OUT:{await(s==null?void 0:s.scene.changeZoom(-a));break}}});h(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:i,onSetItems:o}=this.props,r=a.filter(m=>m.type!==y.EMOTE);s?(i(_.PreviewEmote.IDLE),o(r)):e==null||e.emote.play()});h(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?d("item_editor.center_panel.stop"):d("item_editor.center_panel.play_emote");return t.jsxs(c.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(c.Icon,{name:s}),t.jsx("span",{children:a})]})});h(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,i=!!e,o=s.length>0;return a?null:t.jsx(c.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(c.Dropdown.Menu,{children:[o&&t.jsxs(t.Fragment,{children:[t.jsx(c.Dropdown.Header,{content:i?d("item_editor.center_panel.from_collection"):d("item_editor.center_panel.from_items")}),t.jsx(c.Dropdown.Divider,{}),s.map(r=>t.jsx(c.Dropdown.Item,{value:r.id,text:r.name,onClick:this.handleAnimationChange},r.id)),t.jsx(c.Dropdown.Divider,{}),t.jsx(c.Dropdown.Header,{content:d("item_editor.center_panel.default")}),t.jsx(c.Dropdown.Divider,{})]}),_.PreviewEmote.schema.enum.map(r=>t.jsx(c.Dropdown.Item,{value:r,text:d(`emotes.${r}`),onClick:this.handleAnimationChange},r))]})})});h(this,"renderEmoteSelector",()=>t.jsx(c.Popup,{content:d("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(c.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:i,hasUserOrphanItems:o,onFetchBaseWearables:r,onFetchOrphanItems:m,onFetchCollectionItems:g}=this.props,p=a.length>0;i||r(),p||(s&&!L(s)?g(s.id):e&&o&&m(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const i=s.find(o=>o.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,i?i.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:i,emote:o,selectedBaseWearables:r,selectedItem:m,visibleItems:g,isImportFilesModalOpen:p,wearableController:I}=this.props,{isShowingAvatarAttributes:S,showSceneBoundaries:E,isLoading:b}=this.state,C=g.some(X)&&(m==null?void 0:m.type)===y.EMOTE,w=o===_.PreviewEmote.JUMP?1:void 0;return t.jsxs("div",{className:`CenterPanel ${p?"import-files-modal-is-open":""}`,children:[t.jsx(c.WearablePreview,{id:"wearable-editor",profile:"default",bodyShape:e,emote:o,zoom:w,skin:oe(s),eyes:oe(a),hair:oe(i),urns:r?Object.values(r).map(f=>f?f.id:null).filter(f=>f!==null):[],base64s:g.map(ss),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:as,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:C,showSceneBoundaries:E}),C?t.jsxs("div",{className:"zoom-controls",children:[t.jsx(c.Button,{className:"zoom-control zoom-in-control",onClick:()=>this.handleControlActionChange(se.ZOOM_IN),children:t.jsx(c.Icon,{name:"plus"})}),t.jsx(c.Button,{className:"zoom-control zoom-out-control",onClick:()=>this.handleControlActionChange(se.ZOOM_OUT),children:t.jsx(c.Icon,{name:"minus"})})]}):null,b&&t.jsx(c.Center,{children:t.jsx(c.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[C&&!b&&I?t.jsx("div",{className:"emote-controls-container",children:t.jsx(c.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:I})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${S?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(c.Icon,{name:"user"})}),C?null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${E?"active":""}`,children:t.jsx(O,{name:"cylinder",onClick:()=>this.setState(f=>({showSceneBoundaries:!f.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${S?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:_.BodyShape.MALE,text:d("body_shapes.male")},{value:_.BodyShape.FEMALE,text:d("body_shapes.female")}],d("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:s,colors:ns(),label:d("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:a,colors:is(),label:d("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:i,colors:ls(),label:d("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.HAIR],category:_.WearableCategory.HAIR,bodyShape:e,label:d("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.FACIAL_HAIR],category:_.WearableCategory.FACIAL_HAIR,bodyShape:e,label:d("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.UPPER_BODY],category:_.WearableCategory.UPPER_BODY,bodyShape:e,label:d("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.LOWER_BODY],category:_.WearableCategory.LOWER_BODY,bodyShape:e,label:d("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const ka=n=>{const l=te(n);let e;const s=Q(n);let a=os(n);s?(e=We(n).find(b=>b.id===s),a=a.filter(b=>b.collectionId===s)):a=a.filter(E=>!E.collectionId);const i=Ee(n)||"",o=je(n,i),r=Je(n),m=rs(n),g=Ye(n),p=ds(n),I=!g.some(X)&&p===_.PreviewEmote.IDLE,S="CreateSingleItemModal"in cs(n);return{address:l,bodyShape:r,collection:e,selectedItem:o,selectedBaseWearables:m?m[r]:null,skinColor:hs(n),eyeColor:ms(n),hairColor:gs(n),emote:p,visibleItems:g,wearableController:qe(n),emotes:a,isPlayingEmote:I?!1:Ge(n),isImportFilesModalOpen:S,hasUserOrphanItems:_e(n)}},Ba=n=>({onSetBodyShape:l=>n(ps(l)),onSetAvatarAnimation:l=>n(us(l)),onSetSkinColor:l=>n(Cs(l)),onSetEyeColor:l=>n(Is(l)),onSetHairColor:l=>n(bs(l)),onSetBaseWearable:(l,e,s)=>n(xs(l,e,s)),onFetchBaseWearables:()=>n(_s()),onSetWearablePreviewController:l=>n(vs(l)),onSetItems:l=>n(Ze(l)),onFetchOrphanItems:(l,e)=>n(Ke(l,e)),onFetchCollectionItems:(l,e)=>n(Es(l,e))}),Wa=B(ka,Ba)(Oa);class Fa extends x.PureComponent{constructor(){super(...arguments);h(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:i}=this.props,o=e.target.value;s!==o&&i(a?o.slice(0,a):o)})}render(){const{label:e,disabled:s,value:a}=this.props;return t.jsxs("div",{className:`Input ${s?"is-disabled":""}`.trim(),children:[t.jsx("div",{className:"label",children:e}),t.jsx("input",{value:a||"",onChange:this.handleChange,disabled:s})]})}}class ie extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{value:this.props.value});h(this,"handleChange",(e,s)=>{const{value:a,onChange:i}=this.props,o=s.value;o!==a&&(this.setState({value:o}),i(o))})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,options:s}=this.props,{value:a}=this.state,i=s.find(o=>o.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:i?i.text:d("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(c.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}h(ie,"defaultProps",{disabled:!1});class Ie extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{value:this.props.value});h(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:i}=this.state,o=s.value,r=[...i];for(const m of o)i.includes(m)||r.push(m);r.length!==i.length&&(this.setState({value:r}),a(r))});h(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(i=>i!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,info:s,options:a}=this.props,{value:i}=this.state,o=a.reduce((r,m)=>(r[m.value]=m.text,r),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(ne,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:i.length>0?i.map(r=>t.jsxs("div",{className:"value",children:[o[r],t.jsx("div",{className:"remove",onClick:m=>{this.handleRemove(r),m.stopPropagation()}})]},r)):t.jsx("div",{className:"placeholder",children:d("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(c.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(i=>!a.includes(i.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}h(Ie,"defaultProps",{disabled:!1});class tt extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{draft:"",value:this.props.value});h(this,"handleChange",e=>{this.setState({draft:e.target.value})});h(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,i=s.trim();if(i!=="")if(a.includes(i))this.setState({draft:""});else{const o=[...a,i];this.setState({value:o,draft:""}),e(o)}});h(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===js||e.keyCode===we||e.keyCode===Ss)this.handleAdd();else if(e.keyCode===fs||e.keyCode===we){const{draft:s,value:a}=this.state,i=a[a.length-1];i&&s===""&&this.handleRemove(i)}});h(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(i=>i!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}render(){const{isDisabled:e}=this.props,{draft:s,value:a}=this.state;return t.jsx("div",{className:`Tags ${a.length>0?"":"blank"} ${e?"is-disabled":""}`.trim(),children:t.jsxs("div",{className:"values",children:[a.map(i=>t.jsxs("div",{className:"value",children:[i,t.jsx("div",{className:"remove",onClick:o=>{this.handleRemove(i),o.stopPropagation()}})]},i)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}h(tt,"defaultProps",{isDisabled:!1});let Ha=class extends x.PureComponent{constructor(){super(...arguments);h(this,"analytics",ve());h(this,"state",this.getInitialState());h(this,"thumbnailInput",x.createRef());h(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});h(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});h(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});h(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});h(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[Te]:e},isDirty:!0})});h(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});h(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});h(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});h(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});h(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});h(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});h(this,"handleChangeCategory",e=>{let s;re(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===_.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===de.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let i=[];s==="wearable"?i=[...a.filter(r=>!_.WearableCategory.schema.enum.includes(r)),...e]:i=[...a.filter(r=>!_.BodyPartCategory.schema.enum.includes(r)),...e];const o=this.setHides(this.state.data,i);this.setState({data:o,isDirty:this.isDirty({data:o})})});h(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleOnSaveItem",async()=>{var S,E;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:i,description:o,utility:r,rarity:m,contents:g,data:p,isDirty:I}=this.state;if(I&&e){let b=p;b&&!re(b)&&(b={...b,removesDefaultHiding:b.category===_.WearableCategory.UPPER_BODY||(S=b.hides)!=null&&S.includes(_.WearableCategory.UPPER_BODY)?[_.BodyPartCategory.HANDS]:[],..."blockVrmExport"in b?{blockVrmExport:b.blockVrmExport}:{},..."outlineCompatible"in b?{outlineCompatible:b.outlineCompatible}:{}});const C={...e.contents,...await ws(g)},w={...e,name:i,description:o,rarity:m,data:b,contents:C,utility:r??void 0};s&&[ye.UNPUBLISHED,ye.UNDER_REVIEW].includes(s)&&(w.video=C[Te]),a(w,g),Y(w.urn)&&((E=this.analytics)==null||E.track("Edit Item",{contents:g})),this.setState({isDirty:!1}),this.handleOnResetItem()}});h(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});h(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===y.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});h(this,"handleEmoteThumbnailChange",e=>{const s=Ts(e);this.setState({thumbnail:e,contents:{[Pe]:s},isDirty:!0})});h(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],i=await Ae(a),o=await Ae(a,1024,1024),r=URL.createObjectURL(i);this.setState({thumbnail:r,contents:{[Pe]:o},isDirty:!0})}});h(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;Ce(e)&&((a=s.replaces)!=null&&a.length)&&(s.hides=s.hides.concat(s.replaces),s.replaces=[]),this.setState({thumbnail:"",video:"",name:e.name,description:e.description,utility:e.utility||"",rarity:e.rarity,data:e.data,hasItem:!0,isDirty:!1})}getInitialState(){return{name:"",description:"",utility:"",thumbnail:"",video:"",rarity:void 0,contents:{},data:void 0,hasItem:!1,isDirty:!1}}setReplaces(e,s){return{...e,replaces:s,representations:e.representations.map(a=>({...a,overrideReplaces:s}))}}setHides(e,s){return{...e,hides:s,representations:e.representations.map(a=>({...a,overrideHides:s}))}}canEditItemMetadata(e){const{collection:s,canEditSelectedItem:a}=this.props;return!e||s&&Ne(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===_.WearableCategory.SKIN}isDirty(e={}){const{selectedItem:s}=this.props,{hasItem:a}=this.state;return a?this.hasStateItemChanged({...this.state,...e},s):!1}hasSavedItem(){const{selectedItem:e}=this.props,{isDirty:s}=this.state;return e&&!s&&this.hasStateItemChanged(this.state,e)}hasStateItemChanged(e,s){return e.name!==s.name||e.description!==s.description||e.utility!==s.utility||e.rarity!==s.rarity||!Ue(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:d(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:d(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:d(`emote.play_mode.${s}.text`),description:d(`emote.play_mode.${s}.description`)}))}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||re(a))return null;const i=ys(e.contents,a.category),o=Ps(e.contents),r=a.hides.filter(g=>i.includes(g)),m=a.hides.filter(g=>o.includes(g));return t.jsxs(t.Fragment,{children:[t.jsx(Ie,{itemId:e.id,label:d("item_editor.right_panel.base_body"),info:d("item_editor.right_panel.base_body_info"),value:m,options:this.asCategorySelect(e.type,o),disabled:!s,onChange:g=>this.handleChangeHides(g,"bodypart")}),t.jsx(Ie,{itemId:e.id,label:d("item_editor.right_panel.wearables"),info:d("item_editor.right_panel.wearables_info"),value:r,options:this.asCategorySelect(e.type,r.some(g=>g===_.WearableCategory.BODY_SHAPE)?i:i.filter(g=>g!==_.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:g=>this.handleChangeHides(g,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,i=this.canEditItemMetadata(e),o=s?t.jsx(c.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(O,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[i?t.jsxs(t.Fragment,{children:[t.jsx(O,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),o,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(ge,{item:e,src:a,hasBadge:!0,badgeSize:"small"}),t.jsxs("div",{className:"thumbnail-edit-container",children:[t.jsx("input",{type:"file",ref:this.thumbnailInput,onChange:this.handleThumbnailChange,accept:"image/png"}),t.jsx("div",{className:"thumbnail-edit-background"}),t.jsx(O,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[o,t.jsx(ge,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(As,{item:e})]})}renderVideoDetails(e){if(!Re(e))return null;const s=this.canEditItemMetadata(e),a=s?()=>this.handleOpenVideoDialog():()=>this.handleOpenVideoDialog({viewOnly:!0});return t.jsx("div",{className:"details",children:s?t.jsxs(t.Fragment,{children:[t.jsx(O,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(O,{name:"play",className:"play-video-button",onClick:a}),t.jsx(De,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Ns(e)&&t.jsx(O,{name:"play",className:"play-video-button",onClick:a}),t.jsx(De,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Rs,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:i,error:o,isCampaignEnabled:r,isVrmOptOutEnabled:m,campaignName:g,campaignTag:p}=this.props,{name:I,description:S,utility:E,rarity:b,data:C,isDirty:w,hasItem:f}=this.state,D=_.Rarity.getRarities(),M=Ds();return t.jsx("div",{className:"RightPanel",children:i?t.jsx(Qs,{id:e,children:(u,W,F)=>{var $;const le=W&&Ne(W),A=this.canEditItemMetadata(u),q=u?Ce(u)?Ms(u.contents):Ls():[];return F?t.jsx(c.Loader,{size:"massive",active:!0}):f||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:d("item_editor.right_panel.properties")}),u&&Qe(u,s)&&!u.isPublished&&!le?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(c.Dropdown.Menu,{children:[pe(u)!==null?t.jsx(c.Dropdown.Item,{text:d("item_detail_page.add_representation",{bodyShape:d(`body_shapes.${pe(u)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(Xe,{name:I,onDelete:this.handleDeleteItem,trigger:t.jsx(c.Dropdown.Item,{text:d("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(N,{label:d("item_editor.right_panel.details"),children:u?t.jsxs(t.Fragment,{children:[this.renderModelDetails(u),this.renderVideoDetails(u)]}):null}),t.jsx(N,{label:d("item_editor.right_panel.basics"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(Fa,{label:d("global.name"),value:I,disabled:!A,maxLength:Os,onChange:this.handleChangeName}),t.jsx(c.TextAreaField,{maxLength:ks,onChange:this.handleChangeDescription,label:d("global.description"),placeholder:d("item_editor.right_panel.description_placeholder"),disabled:!A,value:S,rows:"2",cols:"12"}),a?t.jsx(c.TextAreaField,{maxLength:Bs,onChange:this.handleChangeUtility,label:d("global.utility"),placeholder:d("item_editor.right_panel.utility_placeholder"),disabled:!A,value:E,tooltip:{content:d("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(ie,{itemId:u.id,label:d("global.category"),value:C.category,options:this.asCategorySelect(u.type,q),disabled:!A,onChange:this.handleChangeCategory}),!(u.urn&&Y(u.urn))&&t.jsx(ie,{itemId:u.id,label:d("global.rarity"),value:b,options:this.asRaritySelect(D),disabled:u.isPublished||!A,onChange:this.handleChangeRarity})]}):null}),(u==null?void 0:u.type)===y.WEARABLE&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.overrides")}),t.jsx(ne,{content:d("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(u)}),(u==null?void 0:u.type)===y.EMOTE&&t.jsx(N,{label:d("item_editor.right_panel.animation"),children:u?t.jsx(ie,{itemId:u.id,label:d("create_single_item_modal.play_mode_label"),value:C.loop?de.LOOP:de.SIMPLE,options:this.asPlayModeSelect(M),disabled:!A,onChange:this.handlePlayModeChange}):null}),u&&Re(u)&&(($=u.data.requiredPermissions)!=null&&$.length)?t.jsx(N,{label:d("item_editor.right_panel.required_permissions"),children:this.renderPermissions(u)}):null,t.jsx(N,{label:d("item_editor.right_panel.tags"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(tt,{itemId:u.id,value:C.tags,onChange:this.handleChangeTags,isDisabled:!A}),r&&g&&p&&A&&t.jsx("p",{className:"event-tag",children:d("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:p}),event_name:t.jsx("span",{children:g})})})]}):null}),(u==null?void 0:u.type)===y.WEARABLE&&m&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.copyright.title")}),t.jsx(ne,{content:d("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:d("item_editor.right_panel.copyright.vrm_export")}),t.jsx(c.Checkbox,{toggle:!0,label:C!=null&&C.blockVrmExport?d("item_editor.right_panel.copyright.disabled"):d("item_editor.right_panel.copyright.enabled"),checked:!(C!=null&&C.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":d("item_editor.right_panel.copyright.vrm_export")})]})})}),(u==null?void 0:u.type)===y.WEARABLE&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.outline_compatible.title")}),t.jsx(ne,{content:d("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:d("item_editor.right_panel.outline_compatible.title")}),t.jsx(c.Checkbox,{toggle:!0,label:(C==null?void 0:C.outlineCompatible)!==!1?d("item_editor.right_panel.copyright.enabled"):d("item_editor.right_panel.copyright.disabled"),checked:(C==null?void 0:C.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":d("item_editor.right_panel.outline_compatible.title")})]})})}),w?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(c.Button,{secondary:!0,onClick:this.handleOnResetItem,children:d("global.cancel")}),t.jsx(Me,{primary:!0,onClick:this.handleOnSaveItem,network:_.Network.MATIC,children:d("global.save")})]}):o&&e?t.jsxs("p",{className:"danger-text",children:[d("global.error_ocurred"),": ",o]}):null]})]}):null}}):null})}};const Va=n=>{var r;const l=Ee(n)||"",e=je(n,l),s=te(n)||"",a=l&&e&&e.collectionId?Le(n,e.collectionId):null,i=Ws(n),o=l?i[l]:null;return{address:s,collection:a,selectedItem:e,selectedItemId:l,canEditSelectedItem:e?a?Fe(n,s,a):Qe(e,s):!1,itemStatus:o,error:Fs(n),isConnected:be(n),isDownloading:Hs(n),isCommitteeMember:Oe(n),isCampaignEnabled:Vs(n),campaignTag:Gs(n),campaignName:(r=Zs(n))==null?void 0:r[Ks(n)],isVrmOptOutEnabled:$s(n),isWearableUtilityEnabled:Us(n)}},$a=n=>({onSaveItem:(l,e)=>n(zs(l,e)),onDeleteItem:l=>n(Ve(l)),onOpenModal:(l,e)=>n(He(l,e)),onDownload:l=>n(Ys(l))}),Ua=B(Va,$a)(Ha);class nn extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{reviewedItems:[]});h(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(i=>i.id===a.id))]}))});h(this,"handleResetReviewedItems",()=>{this.setState({reviewedItems:[]})})}render(){const{reviewedItems:e}=this.state;return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"ItemEditorPage",children:[t.jsx(ma,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Da,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Wa,{}),t.jsx(Ua,{})]})]})})}}export{nn as default};
1
+ var rt=Object.defineProperty;var dt=(n,l,e)=>l in n?rt(n,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[l]=e;var h=(n,l,e)=>dt(n,typeof l!="symbol"?l+"":l,e);import{af as J,H as t,M as c,G as d,bm as H,bC as ct,D as x,gs as K,L as ee,K as R,ce as Me,b8 as _,N as B,bw as V,eC as ht,gt as mt,gu as gt,gv as pt,gw as ut,gx as Ct,gy as It,gz as bt,gA as xt,gB as _t,gC as L,eq as vt,gD as Z,gE as Et,gF as Q,fb as Le,fq as jt,fW as St,fX as ft,ez as he,gl as wt,aH as te,gG as Tt,da as be,gH as xe,bt as Oe,gI as yt,fY as Pt,eD as me,aW as At,gJ as Nt,gK as Rt,gL as Dt,fn as Mt,f_ as Lt,f$ as Ot,Z as ke,bv as Be,gM as kt,eR as fe,bD as Bt,fj as We,ae as Wt,gN as Fe,eG as _e,X as He,et as Ft,eo as Ve,fE as X,dC as ge,ep as Ht,eU as pe,gO as $e,bk as ve,fU as Ue,eX as y,er as Y,fz as ze,fA as ue,J as O,f5 as Ce,dB as Vt,eP as $t,eA as Ut,gP as Ee,fa as je,fi as zt,gQ as Yt,gR as Jt,gS as qt,gT as Ye,gU as Je,gV as qe,gW as Ge,fI as Ze,eJ as Gt,eI as Ke,eK as Zt,eM as Kt,eN as Qt,gX as Xt,gY as es,gZ as ts,g_ as se,g$ as oe,h0 as ss,ec as as,h1 as ns,h2 as is,h3 as ls,h4 as os,h5 as rs,h6 as ds,h7 as cs,h8 as hs,h9 as ms,ha as gs,hb as ps,hc as us,hd as Cs,he as Is,hf as bs,hg as xs,hh as _s,hi as vs,fZ as Es,bN as ne,hj as js,hk as we,hl as Ss,hm as fs,eT as Te,fF as re,hn as de,eS as ws,eO as ye,eV as Ts,eW as Pe,eY as Ae,eZ as Ne,ho as ys,hp as Ps,e_ as As,e$ as Re,f0 as De,hq as Ns,f8 as Rs,hr as Ds,hs as Ms,ht as Ls,hu as Qe,hv as Os,hw as ks,hx as Bs,fc as Ws,hy as Fs,hz as Hs,eF as Vs,hA as $s,fd as Us,ff as zs,hB as Ys}from"./index-fMUqgf16.js";import{J as Js}from"./JumpIn.container-CKS-_CwV.js";import{C as qs}from"./CollectionProvider.container-CLgOQNf-.js";import{C as Xe}from"./ConfirmDelete-CmQp_7hn.js";import{C as et}from"./CollectionStatus.container-BD9iAeVF.js";import{d as Gs,e as Zs,c as Ks}from"./selectors-BhNw_vWj.js";import{I as Qs}from"./ItemProvider.container-fLUe_5rO.js";const Xs=({open:n,assignee:l,onConfirm:e,onClose:s})=>t.jsxs(c.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:n,children:[t.jsx(c.Modal.Header,{children:d("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(c.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx(H,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(ct,{textOnly:!0,address:l})})}})}),t.jsx("span",{children:t.jsx(H,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:s,children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:e,children:d("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),ea=J.memo(Xs);var T=(n=>(n.REJECT_COLLECTION="REJECT_COLLECTION",n.REJECT_CURATION="REJECT_CURATION",n.DISABLE_COLLECTION="DISABLE_COLLECTION",n.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",n))(T||{});const k="item_editor.top_panel.rejection_modal",ta=({open:n,type:l,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:i,collection:o,curation:r,onReject:m,onRejectCuration:g,onClose:p})=>{const I=x.useMemo(()=>{switch(l){case T.DISABLE_COLLECTION:return k+".disable_collection";case T.REJECT_CURATION:return k+".reject_curation";case T.DISABLE_THIRD_PARTY:return k+".disable_third_party";default:return""}},[l]),S=()=>{switch(l){case T.DISABLE_COLLECTION:m(o);break;case T.REJECT_CURATION:g(r.collectionId);break;case T.DISABLE_THIRD_PARTY:s&&i(s.id);break}},E=l===T.DISABLE_COLLECTION&&!o.isApproved||l===T.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||l===T.REJECT_COLLECTION&&!o.isApproved||l===T.REJECT_CURATION&&(r==null?void 0:r.status)===K.REJECTED;return t.jsx(c.Modal,{size:"tiny",className:"RejectionModal",open:n,children:a?t.jsx(sa,{i18nKey:I}):E?t.jsx(aa,{link:o.forumLink,onClose:p}):t.jsx(na,{i18nKey:I,isLoading:e,onClose:p,onConfirm:S})})},sa=({i18nKey:n})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(`${n}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:d(`${n}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx(H,{id:k+".visit_activity",values:{activity_link:t.jsx(ee,{to:R.activity(),children:d("global.activity")})}})}),t.jsx(c.Loader,{active:!0,size:"large"})]})]}),aa=({link:n,onClose:l})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(k+".veredict_explanation")}),t.jsx(c.Modal.Content,{children:d(k+".go_to_forum")}),t.jsxs(c.Modal.Actions,{children:[t.jsx("a",{href:n,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(c.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:d(k+".forum_link")}),t.jsx("div",{className:"discussion",children:d(k+".discussion")}),t.jsx(c.Icon,{name:"chevron right"})]})}),t.jsx(c.Button,{basic:!0,onClick:l,children:d("global.done")})]})]}),na=({i18nKey:n,isLoading:l,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(c.Modal.Header,{children:d(`${n}.title`)}),t.jsx(c.Modal.Content,{children:d(`${n}.subtitle`)}),t.jsxs(c.Modal.Actions,{children:[t.jsx(Me,{primary:!0,onClick:e,disabled:l,loading:l,network:_.Network.MATIC,children:d(`${n}.action`)}),t.jsx(c.Button,{disabled:l,onClick:s,children:d("global.cancel")})]})]}),ia=J.memo(ta),la=(n,l)=>({isLoading:V(ht(n),xt)||V(mt(n),_t)||gt(n),hasPendingTransaction:pt(n)||!!(l.thirdParty&&ut(n,l.thirdParty.id))}),oa=n=>({onReject:l=>n(Ct(l)),onRejectCuration:l=>n(It(l)),onDisableThirdParty:l=>n(bt(l))}),ra=B(la,oa)(ia);var j=(n=>(n[n.APPROVE=0]="APPROVE",n[n.REJECT=1]="REJECT",n[n.ENABLE=2]="ENABLE",n[n.DISABLE=3]="DISABLE",n))(j||{});let da=class extends J.PureComponent{constructor(){super(...arguments);h(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});h(this,"handleBack",()=>{this.props.onNavigate(R.curation())});h(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:i,onInitiateTPApprovalFlow:o,onSetAssignee:r}=this.props;this.setState({showApproveConfirmModal:!1}),a&&r(e.id,a,s),L(e)?o(e):i(e)});h(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));h(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:i,totalItems:o,thirdParty:r}=this.props,{showRejectionModal:m,showApproveConfirmModal:g}=this.state,{chainId:p}=this.props,I=vt(e);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"actions",children:t.jsx("div",{className:"back",onClick:this.handleBack})}),t.jsxs("div",{className:"title",children:[e.name," · ",d(`collection.type.${I}`),t.jsx(Js,{size:"small",active:!0,collection:e,chainId:p,items:L(e)?s:void 0,text:d("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:L(e)&&o!==void 0?this.renderTPButtons(e,i,a):this.renderButtons(e,i)})}),m&&t.jsx(ra,{type:m,open:!0,collection:e,curation:i,thirdParty:r,onClose:()=>this.setShowRejectionModal(null)}),(i==null?void 0:i.assignee)&&g&&t.jsx(ea,{open:!0,assignee:i.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,i),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});h(this,"renderButton",(e,s,a)=>{const{address:i,thirdParty:o,onInitiateApprovalFlow:r,onInitiateTPApprovalFlow:m,reviewedItems:g,totalItems:p}=this.props,I={[j.APPROVE]:()=>a!=null&&a.assignee&&i!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):L(s)?m(s):r(s),[j.ENABLE]:()=>r(s),[j.DISABLE]:()=>this.setShowRejectionModal(o?T.DISABLE_THIRD_PARTY:T.DISABLE_COLLECTION),[j.REJECT]:()=>{(a==null?void 0:a.status)===K.PENDING?this.setShowRejectionModal(T.REJECT_CURATION):this.setShowRejectionModal(T.REJECT_COLLECTION)}},S={[j.APPROVE]:"approve",[j.ENABLE]:"enable",[j.DISABLE]:"disable",[j.REJECT]:"reject"},E=e===j.APPROVE||e===j.ENABLE,b=!L(s)||!!p&&g.length>=Z(p);return t.jsx(c.Popup,{content:d("item_editor.top_panel.items_pending_to_review"),disabled:b,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(c.Button,{primary:E,onClick:()=>I[e](),disabled:L(s)&&e===j.APPROVE&&!!p&&g.length<Z(p),children:d(`item_editor.top_panel.${S[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});h(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:i,totalItems:o,thirdParty:r}=this.props,m=a==null?void 0:a.some(g=>g.status===K.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(c.Header,{sub:!0,children:[m?d("item_editor.top_panel.reviewed_counter",{count:i.length,threshold:Z(o)}):d("item_editor.top_panel.not_enough_items_to_curate_more"),i.length>=Z(o)?t.jsx(c.Icon,{name:"check circle"}):null]}),m&&this.renderButton(j.APPROVE,e,s),m&&this.renderButton(j.REJECT,e,s),!m&&(r==null?void 0:r.isApproved)&&this.renderButton(j.DISABLE,e,null)]})});h(this,"renderButtons",(e,s)=>{if(s&&e.isApproved)switch(s.status){case"pending":return t.jsxs(t.Fragment,{children:[this.renderButton(j.APPROVE,e,s),this.renderButton(j.REJECT,e,s)]});case"approved":case"rejected":return this.renderButton(j.DISABLE,e,s)}return Et(e)?e.isApproved?this.renderButton(j.DISABLE,e,s):this.renderButton(j.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(j.APPROVE,e,s),this.renderButton(j.REJECT,e,s)]})})}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:i,isConnected:o,isLoading:r}=this.props,m=!e||r&&!s.length;return a&&i&&o?t.jsx("div",{className:"TopPanel",children:m?t.jsx(c.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const ca=n=>{const l=Q(n),e=l?Le(n,l):null,s=e?jt(n,e.id):[],a=e?St(n,e.id):[],i=l?ft(n,l):null,o=l?he(n,l):void 0,r=e&&L(e)?wt(n,e):null;return{address:te(n),items:s,totalItems:(o==null?void 0:o.total)||null,collection:e,itemCurations:a,thirdParty:r,curation:i,chainId:Tt(n),isConnected:be(n),isReviewing:xe(n),isCommitteeMember:Oe(n),selectedCollectionId:Q(n),isLoading:V(yt(n),Mt)||V(Pt(n),Lt)||V(me(n),Ot)}},ha=n=>({onNavigate:l=>n(At(l)),onSetAssignee:(l,e,s)=>n(Nt(l,e,s)),onInitiateTPApprovalFlow:l=>n(Rt(l)),onInitiateApprovalFlow:l=>n(Dt(l))}),ma=B(ca,ha)(da),ga="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.22722%2012.7164C4.07574%2012.5731%204%2012.3582%204%2012.2149C4%2012.0716%204.07574%2011.8567%204.22722%2011.7134L5.28757%2010.7104C5.59053%2010.4239%206.04497%2010.4239%206.34793%2010.7104L9.35858%2013.8448C9.51006%2013.9881%209.73728%2013.9881%209.88876%2013.8448L17.6521%206.21493C17.955%205.92836%2018.4095%205.92836%2018.7124%206.21493L19.7728%207.21791C20.0757%207.50448%2020.0757%207.93433%2019.7728%208.2209L10.116%2017.7851C9.9645%2017.9284%209.81302%2018%209.5858%2018C9.35858%2018%209.2071%2017.9284%209.05562%2017.7851L4.22722%2012.7164Z'%20fill='white'/%3e%3c/svg%3e",pa=n=>{const{collectionId:l,itemName:e}=n,[s,a]=x.useState(!1),[i,o]=x.useState(null),r=ke(),m=Be();x.useEffect(()=>{e&&(a(!0),o(e))},[e]);function g(){a(!1);const p=new URLSearchParams(m.search);p.delete("newItem"),r.replace({search:p.toString()})}return s&&i&&l?t.jsx(c.Toast,{type:c.ToastType.INFO,title:d("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:ga,alt:d("sagas.item.item_added_toast.title")})}),onClose:g,body:t.jsx(H,{id:"sagas.item.item_added_toast.body",values:{name:i,br:()=>t.jsx("br",{}),b:p=>t.jsx("strong",{children:p}),"collection-link":p=>t.jsx(ee,{to:R.collectionDetail(l),children:t.jsx(c.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:p})})}})}):null},ua=J.memo(pa),Ca=n=>({itemName:kt(n)}),Ia=B(Ca)(ua),ba=({collection:n,address:l,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:i,onDeleteCollection:o})=>{var u,W;const r=Be(),m=ke(),g=((u=r.state)==null?void 0:u.fromParam)===fe.COLLECTIONS,p=((W=r.state)==null?void 0:W.fromParam)===fe.TP_COLLECTIONS,I=x.useCallback(()=>{m.push(R.collections())},[m]),S=x.useCallback(()=>{if(n&&(g||p)){const F=g?R.collectionDetail:R.thirdPartyCollectionDetail;m.push(F(n.id))}else m.push(R.itemEditor())},[g,p,m,n]),E=x.useCallback(()=>{i("CreateCollectionModal")},[i]),b=x.useCallback(()=>{n&&i("CreateSingleItemModal",{collectionId:n.id})},[n,i]),C=x.useCallback(()=>{n&&i("AddExistingItemModal",{collectionId:n.id})},[n,i]),w=x.useCallback(()=>{n&&i("EditCollectionNameModal",{collection:n})},[n,i]),f=x.useCallback(()=>{n&&o(n)},[n,o]),D=x.useCallback(()=>{const F=n&&Bt(n.owner,l||"");return n?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${g||p?"close":"back"}`,onClick:S}),t.jsxs("div",{className:"title",children:[t.jsx(ee,{to:R.collectionDetail(n.id),children:n.name}),t.jsx(et,{collection:n})]}),F&&!n.isPublished?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(c.Dropdown.Menu,{children:[t.jsx(c.Dropdown.Item,{onClick:w,children:d("item_editor.left_panel.actions.edit_name")}),t.jsx(c.Dropdown.Item,{onClick:b,children:d("item_editor.left_panel.actions.new_item")}),e&&t.jsx(c.Dropdown.Item,{onClick:C,children:d("item_editor.left_panel.actions.add_existing_item")}),t.jsx(Xe,{name:n.name,onDelete:f,trigger:t.jsx(c.Dropdown.Item,{text:d("global.delete")})})]})}):null]}):null},[n,l,e,g,p]),M=x.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:I}),t.jsx("div",{className:"title",children:e?d("item_editor.left_panel.title"):d("item_editor.left_panel.title_alternative")}),s?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(c.Dropdown.Menu,{children:t.jsx(c.Dropdown.Item,{onClick:E,children:d("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(c.Row,{grow:!1,shrink:!1,className:"Header",children:n?D():M()})},xa=ba,_a=n=>{let l;const e=Q(n);e&&(l=We(n).find(i=>i.id===e));const s=te(n);return{address:s,isLoggedIn:Wt(n),isReviewing:xe(n),collection:l,hasEditRights:l!==void 0&&s!==void 0&&Fe(n,s,l),hasUserOrphanItems:_e(n)}},va=n=>({onOpenModal:(l,e)=>n(He(l,e)),onDeleteCollection:l=>n(Ft(l)),onDeleteItem:l=>n(Ve(l))}),Ea=B(_a,va)(xa),P=10;class N extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{isCollapsed:!1});h(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,i=!a;return t.jsxs("div",{className:`Collapsable ${i?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:i?s:null})]})}}class ja extends x.PureComponent{constructor(){super(...arguments);h(this,"handleClick",()=>{const{item:e,onClick:s}=this.props;s(e)})}renderToggleItem(){const{item:e,isVisible:s,isPlayingEmote:a}=this.props;return X(e)?t.jsx(c.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:i}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(ee,{to:R.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(ge,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Ht,{item:e}),e.name]}),t.jsx(c.Popup,{content:d("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:d(`body_shapes.${pe(e)}`).toLowerCase()})}),disabled:$e(e,i),position:"top center",trigger:this.renderToggleItem()})]})})}}const Sa=ja;var v=(n=>(n.TO_REVIEW="to-review",n.REVIEWED="reviewed",n.ALL_ITEMS="all-items",n))(v||{});const fa={[v.TO_REVIEW]:1,[v.REVIEWED]:1,[v.ALL_ITEMS]:1};class wa extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{currentTab:v.TO_REVIEW,currentPages:fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});h(this,"analytics",ve());h(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:i}=this.state;this.getIsReviewingTPItems()&&i===v.TO_REVIEW&&!Ue(s,e==null?void 0:e.items)&&a()});h(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});h(this,"handleClick",e=>{var g;const{bodyShape:s,visibleItems:a,wearableController:i,isPlayingEmote:o,onSetItems:r}=this.props;if(!$e(e,s))return;let m=a.filter(p=>p.id!==e.id);if(X(e))if(this.isVisible(e)){o?i==null||i.emote.pause():i==null||i.emote.play();return}else m=m.filter(p=>p.type!==y.EMOTE);this.isVisible(e)||(m.push(e),(g=this.analytics)==null||g.track("Preview Item",{ITEM_ID:e!=null&&e.urn?Y(e.urn)?ze(e.urn):ue(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:Y(e.urn)})),r(m)});h(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:i}=this.props,{currentPages:o}=this.state;e===v.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{i(),s(o[v.ALL_ITEMS])}):e===v.TO_REVIEW&&a(),this.setState({currentTab:e})});h(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});h(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});h(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:i}=this.props;this.setState(o=>({currentPages:{...o.currentPages,[a]:+s.activePage}})),a!==v.REVIEWED&&i(+s.activePage)});h(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(v.ALL_ITEMS)});h(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?Y(e.urn)&&s:!1});h(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:i,isPlayingEmote:o}=this.props;return t.jsx(Sa,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:o,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:i,onClick:this.handleClick},e.id)});h(this,"renderSidebarCategory",e=>{const s=e.filter(Ce),a=e.filter(X);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:d("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(N,{label:this.renderCollapsableLabel(y.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(N,{label:this.renderCollapsableLabel(y.EMOTE),children:a.map(this.renderSidebarItem)})]})});h(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,i=a[s],o=Math.ceil(e/P);return o>1?t.jsx(c.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:o,activePage:i,onPageChange:this.handlePageChange}):null});h(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,i=s[a],o=(i-1)*P,r=i*P;return t.jsx(c.Header,{sub:!0,children:d("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:o,pageEnd:r>e?e:r,total:e})})});h(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:i}=this.props,{currentTab:o,currentPages:r}=this.state,m=this.getIsReviewingTPItems(),g=r[o];if(s)return t.jsx(c.Loader,{size:"large",active:!0});switch(o){case v.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!m&&a?this.renderTabPagination(a):null]});case v.REVIEWED:{const p=i.slice((g-1)*P,g*P);return t.jsxs(t.Fragment,{children:[i.length?this.renderPaginationStats(i.length):null,this.renderSidebarCategory(p),i.length?this.renderTabPagination(i.length):null]})}case v.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});h(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:i}=this.state;let o;const r=!s||s<P||a.length===s;switch(i){case v.TO_REVIEW:o=t.jsx(c.Popup,{content:d("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!r,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(c.Button,{disabled:e||r,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(c.Icon,{name:"random"}),d("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case v.REVIEWED:o=t.jsx(H,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:d("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:Z(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",o," "]})});h(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(c.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(c.Modal.Header,{children:d("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(c.Modal.Content,{children:[t.jsx(H,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:v.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(c.Checkbox,{checked:!s}),d("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:this.handleModalProceed,children:d("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});h(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(c.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(c.Modal.Header,{children:d("item_editor.left_panel.all_items_check.title")}),t.jsx(c.Modal.Content,{children:d("item_editor.left_panel.all_items_check.content")}),t.jsxs(c.Modal.Actions,{children:[t.jsx(c.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:d("global.cancel")}),t.jsx(c.Button,{primary:!0,onClick:()=>this.handleTabChange(v.ALL_ITEMS),children:d("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});h(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(c.Tabs,{isFullscreen:!0,children:[t.jsx(c.Tabs.Tab,{active:e===v.TO_REVIEW,onClick:()=>this.handleTabChange(v.TO_REVIEW),children:d("item_editor.left_panel.to_review")}),t.jsx(c.Tabs.Tab,{active:e===v.REVIEWED,onClick:()=>this.handleTabChange(v.REVIEWED),children:d("item_editor.left_panel.reviewed")}),t.jsx(c.Tabs.Tab,{active:e===v.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:d("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(O,{name:e}),t.jsx(H,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(c.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class Ta extends x.PureComponent{render(){const{collection:l,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(ee,{to:R.itemEditor({collectionId:l.id}),children:[t.jsx(Vt,{collectionId:l.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(et,{collection:l}),l.name]}),t.jsx("div",{className:"count",children:d("item_editor.left_panel.items_count",{count:l.itemCount})})]})]})})}}const ya=Ta;class Pa extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{currentPage:1});h(this,"handlePageChange",(e,s)=>{const{onLoadPage:a}=this.props;this.setState({currentPage:+s.activePage}),a(+s.activePage)})}render(){const{collections:e,isLoading:s,items:a,selectedCollectionId:i,totalCollections:o}=this.props,{currentPage:r}=this.state;if(e.length===0)return null;const m=Math.ceil(o/P);return s?t.jsx(c.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:d("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(c.Section,{className:"Collections",children:[e.map(g=>t.jsx(ya,{collection:g,items:a,isSelected:g.id===i},g.id)),m>1?t.jsx(c.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:m,activePage:r,onPageChange:this.handlePageChange}):null]})})}}var z=(n=>(n.COLLECTIONS="collections",n.ORPHAN_ITEMS="orphanItems",n))(z||{});const U=1;let Aa=class extends x.PureComponent{constructor(){super(...arguments);h(this,"state",this.getInitialState());h(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});h(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:i,selectedCollectionId:o}=this.props,{pages:r}=this.state;if(e&&!i&&!o){const m=r[r.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:P,page:m})}});h(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});h(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));h(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:i,onSetReviewedItems:o}=this.props,r=this.isCollectionTabActive()?i:a,m=Math.ceil(r/P);if(m>s.length){const g=[...Array(m).keys()].map(p=>p+1).filter(p=>!s.includes(p));if(g.length>0){const p=g[Math.floor(Math.random()*g.length)];this.setState(I=>({pages:[...I.pages,p]}),this.fetchResource)}}o(e)});h(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[U]},this.fetchResource)});h(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===z.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=z.COLLECTIONS;return!e&&s&&(a=z.ORPHAN_ITEMS),{pages:[U],currentTab:a,initialPage:U,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:i,onSetItems:o}=this.props;this.fetchResource(),e&&s===void 0&&i(e),a&&o([a])}componentDidUpdate(e,s){const{isConnected:a,address:i,selectedCollectionId:o,selectedItemId:r,selectedItem:m,orphanItems:g,totalItems:p,visibleItems:I,hasUserOrphanItems:S,onSetItems:E,onFetchOrphanItem:b}=this.props,{initialPage:C,pages:w}=this.state;if(!o&&i&&r&&p&&(C===U||s.initialPage<C)){if(!g.find(f=>f.id===r)){const f=Math.ceil(p/P),D=w[w.length-1],M=Math.min(f,D+1);w.includes(M)||this.setState({pages:[M],initialPage:M},this.fetchResource)}}else if(e.selectedItemId&&r&&e.selectedItemId!==r){const f=I.filter(D=>D.type!==y.EMOTE);E(f)}else i&&a&&(a!==e.isConnected||e.selectedCollectionId&&!o)&&this.setState({pages:[U]},this.fetchResource),e.selectedCollectionId!==o&&this.setState({pages:[U]}),i&&i!==e.address&&S===void 0&&b(i);!e.selectedItem&&m&&m.type!==y.EMOTE&&E([m]),e.selectedCollectionId!==o&&E([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:i,orphanItems:o,isReviewing:r}=this.props;return i&&e?$t(e)&&r?s.filter(m=>!!(a!=null&&a.find(g=>g.itemId===m.id&&g.status===K.PENDING))):s:o}render(){const{items:e,totalItems:s,totalCollections:a,collections:i,selectedItemId:o,selectedCollectionId:r,visibleItems:m,bodyShape:g,reviewedItems:p,isReviewing:I,isPlayingEmote:S,isConnected:E,wearableController:b,isLoading:C,hasUserOrphanItems:w,onSetItems:f,onSetReviewedItems:D,onResetReviewedItems:M}=this.props,{pages:u,showSamplesModalAgain:W}=this.state,F=!r&&w,le=this.isCollectionTabActive()&&!r,A=!this.isCollectionTabActive()||r;return t.jsx("div",{className:"LeftPanel",children:E?t.jsx(qs,{id:r,itemSelected:o,itemsPage:u,itemsPageSize:P,fetchCollectionItemsOptions:{status:I?K.PENDING:void 0},onChangePage:q=>this.setState({pages:[q]}),children:({paginatedCollections:q,collection:$,paginatedItems:st,initialPage:at,isLoadingCollection:nt,isLoadingCollectionItems:it,itemCurations:lt})=>{const G=this.getItems($,st,lt),Se=this.isCollectionTabActive(),ot=r&&$?at:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(Ea,{}),F?t.jsxs(c.Tabs,{isFullscreen:!0,children:[t.jsx(c.Tabs.Tab,{active:Se,onClick:()=>this.handleTabChange(z.COLLECTIONS),children:d("collections_page.collections")}),t.jsx(c.Tabs.Tab,{active:!Se,onClick:()=>this.handleTabChange(z.ORPHAN_ITEMS),children:d("item_editor.left_panel.items")})]}):null,le?t.jsx(Pa,{collections:q,totalCollections:a||i.length,items:e,hasHeader:G.length>0,selectedCollectionId:r,onLoadPage:this.loadPage,isLoading:nt}):null,A?t.jsxs(t.Fragment,{children:[t.jsx(wa,{items:G,totalItems:s||G.length,hasHeader:!r&&i.length>0,selectedItemId:o,collection:$,isReviewing:I,isPlayingEmote:S,visibleItems:m,bodyShape:g,onResetReviewedItems:M,reviewedItems:p,onSetItems:f,wearableController:b,initialPage:ot,isLoading:it||C,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:W,onReviewItems:()=>D(G),onLoadRandomPage:()=>this.loadRandomPage(G),onLoadPage:this.loadPage}),t.jsx(Ia,{collectionId:r})]}):null]})}}):null})}};const Na=n=>{const l=Q(n),e=te(n),s=l?he(n,l):e?he(n,e):void 0,a=l?void 0:Ut(n),i=Ee(n)||"",o=je(n,i);return{address:e,isConnected:be(n),items:zt(n),totalItems:(s==null?void 0:s.total)||null,totalCollections:(a==null?void 0:a.total)||null,orphanItems:e&&!l?Yt(n,e,s==null?void 0:s.limit):Jt(n),collections:qt(n),selectedItemId:i,selectedItem:o,selectedCollectionId:l,visibleItems:Ye(n),bodyShape:Je(n),wearableController:qe(n),isReviewing:xe(n),isLoading:V(me(n),Kt)||V(me(n),Qt),isPlayingEmote:Ge(n),hasUserOrphanItems:_e(n)}},Ra=n=>({onSetItems:l=>n(Ze(l)),onFetchCollections:(l,e)=>n(Gt(l,e)),onFetchOrphanItems:(l,e)=>n(Ke(l,e)),onFetchOrphanItem:l=>n(Zt(l))}),Da=B(Na,Ra)(Aa);class ce extends J.PureComponent{constructor(){super(...arguments);h(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:i,onChange:o}=this.props;if(a.toHexString()!==s.value){const r=i.find(m=>m.toHexString()===s.value);o(r)}});h(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(c.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,i=e.toHexString();return t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:i,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:i}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(c.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ma=class extends J.PureComponent{constructor(){super(...arguments);h(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:i,bodyShape:o,onChange:r,baseWearables:m}=this.props,g=s.value?m.find(p=>p.id===s.value):null;a!==g&&r(i,o,g??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:i,isNullable:o,baseWearables:r}=this.props,m=Xt(r,a,s).map(p=>({value:p.id,text:es(p)}));o&&m.push({value:"",text:d("global.none")});const g=e?m.find(p=>p.value===e.id):null;return t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:m,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:i}),t.jsx("div",{className:"value",children:g?g.text:d("global.none")}),t.jsx("div",{className:"handle"})]})})}};const La=n=>({baseWearables:ts(n)}),ae=B(La)(Ma);let Oa=class extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1});h(this,"analytics",ve());h(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});h(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});h(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:i,onSetAvatarAnimation:o,onSetItems:r}=this.props,m=a.find(p=>p.id===s),g=i.filter(p=>p.type!==y.EMOTE);g.forEach(p=>{var I;(I=this.analytics)==null||I.track("Play Emote",{EMOTE_PLAYED_BASE:!m,EMOTE_PLAYED_ITEM_ID:m!=null&&m.urn?ue(m.urn):null,EMOTE_PLAYED_NAME:m?m.name:s,PREVIEWED_WEARABLE_ITEM_ID:p!=null&&p.urn?Y(p.urn)?ze(p.urn):ue(p.urn):null,PREVIEWED_WEARABLE_NAME:p.name})}),m?g.push(m):o(s),r(g)});h(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});h(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});h(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});h(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:i}=this.props;i(e,s,a)});h(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(c.WearablePreview.createController("wearable-editor")),this.setState({isLoading:!1})});h(this,"handleControlActionChange",async e=>{const{wearableController:s}=this.props,a=.1;if(s)switch(await(s==null?void 0:s.emote.pause()),e){case se.ZOOM_IN:{await(s==null?void 0:s.scene.changeZoom(a));break}case se.ZOOM_OUT:{await(s==null?void 0:s.scene.changeZoom(-a));break}}});h(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:i,onSetItems:o}=this.props,r=a.filter(m=>m.type!==y.EMOTE);s?(i(_.PreviewEmote.IDLE),o(r)):e==null||e.emote.play()});h(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?d("item_editor.center_panel.stop"):d("item_editor.center_panel.play_emote");return t.jsxs(c.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(c.Icon,{name:s}),t.jsx("span",{children:a})]})});h(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,i=!!e,o=s.length>0;return a?null:t.jsx(c.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(c.Dropdown.Menu,{children:[o&&t.jsxs(t.Fragment,{children:[t.jsx(c.Dropdown.Header,{content:i?d("item_editor.center_panel.from_collection"):d("item_editor.center_panel.from_items")}),t.jsx(c.Dropdown.Divider,{}),s.map(r=>t.jsx(c.Dropdown.Item,{value:r.id,text:r.name,onClick:this.handleAnimationChange},r.id)),t.jsx(c.Dropdown.Divider,{}),t.jsx(c.Dropdown.Header,{content:d("item_editor.center_panel.default")}),t.jsx(c.Dropdown.Divider,{})]}),_.PreviewEmote.schema.enum.map(r=>t.jsx(c.Dropdown.Item,{value:r,text:d(`emotes.${r}`),onClick:this.handleAnimationChange},r))]})})});h(this,"renderEmoteSelector",()=>t.jsx(c.Popup,{content:d("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(c.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:i,hasUserOrphanItems:o,onFetchBaseWearables:r,onFetchOrphanItems:m,onFetchCollectionItems:g}=this.props,p=a.length>0;i||r(),p||(s&&!L(s)?g(s.id):e&&o&&m(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const i=s.find(o=>o.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,i?i.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:i,emote:o,selectedBaseWearables:r,selectedItem:m,visibleItems:g,isImportFilesModalOpen:p,wearableController:I}=this.props,{isShowingAvatarAttributes:S,showSceneBoundaries:E,isLoading:b}=this.state,C=g.some(X)&&(m==null?void 0:m.type)===y.EMOTE,w=o===_.PreviewEmote.JUMP?1:void 0;return t.jsxs("div",{className:`CenterPanel ${p?"import-files-modal-is-open":""}`,children:[t.jsx(c.WearablePreview,{id:"wearable-editor",profile:"default",bodyShape:e,emote:o,zoom:w,skin:oe(s),eyes:oe(a),hair:oe(i),urns:r?Object.values(r).map(f=>f?f.id:null).filter(f=>f!==null):[],base64s:g.map(ss),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:as,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:C,showSceneBoundaries:E}),C?t.jsxs("div",{className:"zoom-controls",children:[t.jsx(c.Button,{className:"zoom-control zoom-in-control",onClick:()=>this.handleControlActionChange(se.ZOOM_IN),children:t.jsx(c.Icon,{name:"plus"})}),t.jsx(c.Button,{className:"zoom-control zoom-out-control",onClick:()=>this.handleControlActionChange(se.ZOOM_OUT),children:t.jsx(c.Icon,{name:"minus"})})]}):null,b&&t.jsx(c.Center,{children:t.jsx(c.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[C&&!b&&I?t.jsx("div",{className:"emote-controls-container",children:t.jsx(c.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:I})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${S?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(c.Icon,{name:"user"})}),C?null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${E?"active":""}`,children:t.jsx(O,{name:"cylinder",onClick:()=>this.setState(f=>({showSceneBoundaries:!f.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${S?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(c.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:_.BodyShape.MALE,text:d("body_shapes.male")},{value:_.BodyShape.FEMALE,text:d("body_shapes.female")}],d("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:s,colors:ns(),label:d("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:a,colors:is(),label:d("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(ce,{currentColor:i,colors:ls(),label:d("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.HAIR],category:_.WearableCategory.HAIR,bodyShape:e,label:d("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.FACIAL_HAIR],category:_.WearableCategory.FACIAL_HAIR,bodyShape:e,label:d("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.UPPER_BODY],category:_.WearableCategory.UPPER_BODY,bodyShape:e,label:d("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:r&&t.jsx(ae,{wearable:r[_.WearableCategory.LOWER_BODY],category:_.WearableCategory.LOWER_BODY,bodyShape:e,label:d("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const ka=n=>{const l=te(n);let e;const s=Q(n);let a=os(n);s?(e=We(n).find(b=>b.id===s),a=a.filter(b=>b.collectionId===s)):a=a.filter(E=>!E.collectionId);const i=Ee(n)||"",o=je(n,i),r=Je(n),m=rs(n),g=Ye(n),p=ds(n),I=!g.some(X)&&p===_.PreviewEmote.IDLE,S="CreateSingleItemModal"in cs(n);return{address:l,bodyShape:r,collection:e,selectedItem:o,selectedBaseWearables:m?m[r]:null,skinColor:hs(n),eyeColor:ms(n),hairColor:gs(n),emote:p,visibleItems:g,wearableController:qe(n),emotes:a,isPlayingEmote:I?!1:Ge(n),isImportFilesModalOpen:S,hasUserOrphanItems:_e(n)}},Ba=n=>({onSetBodyShape:l=>n(ps(l)),onSetAvatarAnimation:l=>n(us(l)),onSetSkinColor:l=>n(Cs(l)),onSetEyeColor:l=>n(Is(l)),onSetHairColor:l=>n(bs(l)),onSetBaseWearable:(l,e,s)=>n(xs(l,e,s)),onFetchBaseWearables:()=>n(_s()),onSetWearablePreviewController:l=>n(vs(l)),onSetItems:l=>n(Ze(l)),onFetchOrphanItems:(l,e)=>n(Ke(l,e)),onFetchCollectionItems:(l,e)=>n(Es(l,e))}),Wa=B(ka,Ba)(Oa);class Fa extends x.PureComponent{constructor(){super(...arguments);h(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:i}=this.props,o=e.target.value;s!==o&&i(a?o.slice(0,a):o)})}render(){const{label:e,disabled:s,value:a}=this.props;return t.jsxs("div",{className:`Input ${s?"is-disabled":""}`.trim(),children:[t.jsx("div",{className:"label",children:e}),t.jsx("input",{value:a||"",onChange:this.handleChange,disabled:s})]})}}class ie extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{value:this.props.value});h(this,"handleChange",(e,s)=>{const{value:a,onChange:i}=this.props,o=s.value;o!==a&&(this.setState({value:o}),i(o))})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,options:s}=this.props,{value:a}=this.state,i=s.find(o=>o.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:i?i.text:d("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(c.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}h(ie,"defaultProps",{disabled:!1});class Ie extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{value:this.props.value});h(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:i}=this.state,o=s.value,r=[...i];for(const m of o)i.includes(m)||r.push(m);r.length!==i.length&&(this.setState({value:r}),a(r))});h(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(i=>i!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,info:s,options:a}=this.props,{value:i}=this.state,o=a.reduce((r,m)=>(r[m.value]=m.text,r),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(ne,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:i.length>0?i.map(r=>t.jsxs("div",{className:"value",children:[o[r],t.jsx("div",{className:"remove",onClick:m=>{this.handleRemove(r),m.stopPropagation()}})]},r)):t.jsx("div",{className:"placeholder",children:d("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(c.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(i=>!a.includes(i.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}h(Ie,"defaultProps",{disabled:!1});class tt extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{draft:"",value:this.props.value});h(this,"handleChange",e=>{this.setState({draft:e.target.value})});h(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,i=s.trim();if(i!=="")if(a.includes(i))this.setState({draft:""});else{const o=[...a,i];this.setState({value:o,draft:""}),e(o)}});h(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===js||e.keyCode===we||e.keyCode===Ss)this.handleAdd();else if(e.keyCode===fs||e.keyCode===we){const{draft:s,value:a}=this.state,i=a[a.length-1];i&&s===""&&this.handleRemove(i)}});h(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(i=>i!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}render(){const{isDisabled:e}=this.props,{draft:s,value:a}=this.state;return t.jsx("div",{className:`Tags ${a.length>0?"":"blank"} ${e?"is-disabled":""}`.trim(),children:t.jsxs("div",{className:"values",children:[a.map(i=>t.jsxs("div",{className:"value",children:[i,t.jsx("div",{className:"remove",onClick:o=>{this.handleRemove(i),o.stopPropagation()}})]},i)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}h(tt,"defaultProps",{isDisabled:!1});let Ha=class extends x.PureComponent{constructor(){super(...arguments);h(this,"analytics",ve());h(this,"state",this.getInitialState());h(this,"thumbnailInput",x.createRef());h(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});h(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});h(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});h(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});h(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[Te]:e},isDirty:!0})});h(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});h(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});h(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});h(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});h(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});h(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});h(this,"handleChangeCategory",e=>{let s;re(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===_.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===de.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let i=[];s==="wearable"?i=[...a.filter(r=>!_.WearableCategory.schema.enum.includes(r)),...e]:i=[...a.filter(r=>!_.BodyPartCategory.schema.enum.includes(r)),...e];const o=this.setHides(this.state.data,i);this.setState({data:o,isDirty:this.isDirty({data:o})})});h(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});h(this,"handleOnSaveItem",async()=>{var S,E;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:i,description:o,utility:r,rarity:m,contents:g,data:p,isDirty:I}=this.state;if(I&&e){let b=p;b&&!re(b)&&(b={...b,removesDefaultHiding:b.category===_.WearableCategory.UPPER_BODY||(S=b.hides)!=null&&S.includes(_.WearableCategory.UPPER_BODY)?[_.BodyPartCategory.HANDS]:[],..."blockVrmExport"in b?{blockVrmExport:b.blockVrmExport}:{},..."outlineCompatible"in b?{outlineCompatible:b.outlineCompatible}:{}});const C={...e.contents,...await ws(g)},w={...e,name:i,description:o,rarity:m,data:b,contents:C,utility:r??void 0};s&&[ye.UNPUBLISHED,ye.UNDER_REVIEW].includes(s)&&(w.video=C[Te]),a(w,g),Y(w.urn)&&((E=this.analytics)==null||E.track("Edit Item",{contents:g})),this.setState({isDirty:!1}),this.handleOnResetItem()}});h(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});h(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===y.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});h(this,"handleEmoteThumbnailChange",e=>{const s=Ts(e);this.setState({thumbnail:e,contents:{[Pe]:s},isDirty:!0})});h(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],i=await Ae(a),o=await Ae(a,1024,1024),r=URL.createObjectURL(i);this.setState({thumbnail:r,contents:{[Pe]:o},isDirty:!0})}});h(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;Ce(e)&&((a=s.replaces)!=null&&a.length)&&(s.hides=s.hides.concat(s.replaces),s.replaces=[]),this.setState({thumbnail:"",video:"",name:e.name,description:e.description,utility:e.utility||"",rarity:e.rarity,data:e.data,hasItem:!0,isDirty:!1})}getInitialState(){return{name:"",description:"",utility:"",thumbnail:"",video:"",rarity:void 0,contents:{},data:void 0,hasItem:!1,isDirty:!1}}setReplaces(e,s){return{...e,replaces:s,representations:e.representations.map(a=>({...a,overrideReplaces:s}))}}setHides(e,s){return{...e,hides:s,representations:e.representations.map(a=>({...a,overrideHides:s}))}}canEditItemMetadata(e){const{collection:s,canEditSelectedItem:a}=this.props;return!e||s&&Ne(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===_.WearableCategory.SKIN}isDirty(e={}){const{selectedItem:s}=this.props,{hasItem:a}=this.state;return a?this.hasStateItemChanged({...this.state,...e},s):!1}hasSavedItem(){const{selectedItem:e}=this.props,{isDirty:s}=this.state;return e&&!s&&this.hasStateItemChanged(this.state,e)}hasStateItemChanged(e,s){return e.name!==s.name||e.description!==s.description||e.utility!==s.utility||e.rarity!==s.rarity||!Ue(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:d(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:d(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:d(`emote.play_mode.${s}.text`),description:d(`emote.play_mode.${s}.description`)}))}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||re(a))return null;const i=ys(e.contents,a.category),o=Ps(e.contents),r=a.hides.filter(g=>i.includes(g)),m=a.hides.filter(g=>o.includes(g));return t.jsxs(t.Fragment,{children:[t.jsx(Ie,{itemId:e.id,label:d("item_editor.right_panel.base_body"),info:d("item_editor.right_panel.base_body_info"),value:m,options:this.asCategorySelect(e.type,o),disabled:!s,onChange:g=>this.handleChangeHides(g,"bodypart")}),t.jsx(Ie,{itemId:e.id,label:d("item_editor.right_panel.wearables"),info:d("item_editor.right_panel.wearables_info"),value:r,options:this.asCategorySelect(e.type,r.some(g=>g===_.WearableCategory.BODY_SHAPE)?i:i.filter(g=>g!==_.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:g=>this.handleChangeHides(g,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,i=this.canEditItemMetadata(e),o=s?t.jsx(c.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(O,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[i?t.jsxs(t.Fragment,{children:[t.jsx(O,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),o,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(ge,{item:e,src:a,hasBadge:!0,badgeSize:"small"}),t.jsxs("div",{className:"thumbnail-edit-container",children:[t.jsx("input",{type:"file",ref:this.thumbnailInput,onChange:this.handleThumbnailChange,accept:"image/png"}),t.jsx("div",{className:"thumbnail-edit-background"}),t.jsx(O,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[o,t.jsx(ge,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(As,{item:e})]})}renderVideoDetails(e){if(!Re(e))return null;const s=this.canEditItemMetadata(e),a=s?()=>this.handleOpenVideoDialog():()=>this.handleOpenVideoDialog({viewOnly:!0});return t.jsx("div",{className:"details",children:s?t.jsxs(t.Fragment,{children:[t.jsx(O,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(O,{name:"play",className:"play-video-button",onClick:a}),t.jsx(De,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Ns(e)&&t.jsx(O,{name:"play",className:"play-video-button",onClick:a}),t.jsx(De,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Rs,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:i,error:o,isCampaignEnabled:r,isVrmOptOutEnabled:m,campaignName:g,campaignTag:p}=this.props,{name:I,description:S,utility:E,rarity:b,data:C,isDirty:w,hasItem:f}=this.state,D=_.Rarity.getRarities(),M=Ds();return t.jsx("div",{className:"RightPanel",children:i?t.jsx(Qs,{id:e,children:(u,W,F)=>{var $;const le=W&&Ne(W),A=this.canEditItemMetadata(u),q=u?Ce(u)?Ms(u.contents):Ls():[];return F?t.jsx(c.Loader,{size:"massive",active:!0}):f||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:d("item_editor.right_panel.properties")}),u&&Qe(u,s)&&!u.isPublished&&!le?t.jsx(c.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(c.Dropdown.Menu,{children:[pe(u)!==null?t.jsx(c.Dropdown.Item,{text:d("item_detail_page.add_representation",{bodyShape:d(`body_shapes.${pe(u)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(Xe,{name:I,onDelete:this.handleDeleteItem,trigger:t.jsx(c.Dropdown.Item,{text:d("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(N,{label:d("item_editor.right_panel.details"),children:u?t.jsxs(t.Fragment,{children:[this.renderModelDetails(u),this.renderVideoDetails(u)]}):null}),t.jsx(N,{label:d("item_editor.right_panel.basics"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(Fa,{label:d("global.name"),value:I,disabled:!A,maxLength:Os,onChange:this.handleChangeName}),t.jsx(c.TextAreaField,{maxLength:ks,onChange:this.handleChangeDescription,label:d("global.description"),placeholder:d("item_editor.right_panel.description_placeholder"),disabled:!A,value:S,rows:"2",cols:"12"}),a?t.jsx(c.TextAreaField,{maxLength:Bs,onChange:this.handleChangeUtility,label:d("global.utility"),placeholder:d("item_editor.right_panel.utility_placeholder"),disabled:!A,value:E,tooltip:{content:d("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(ie,{itemId:u.id,label:d("global.category"),value:C.category,options:this.asCategorySelect(u.type,q),disabled:!A,onChange:this.handleChangeCategory}),!(u.urn&&Y(u.urn))&&t.jsx(ie,{itemId:u.id,label:d("global.rarity"),value:b,options:this.asRaritySelect(D),disabled:u.isPublished||!A,onChange:this.handleChangeRarity})]}):null}),(u==null?void 0:u.type)===y.WEARABLE&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.overrides")}),t.jsx(ne,{content:d("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(u)}),(u==null?void 0:u.type)===y.EMOTE&&t.jsx(N,{label:d("item_editor.right_panel.animation"),children:u?t.jsx(ie,{itemId:u.id,label:d("create_single_item_modal.play_mode_label"),value:C.loop?de.LOOP:de.SIMPLE,options:this.asPlayModeSelect(M),disabled:!A,onChange:this.handlePlayModeChange}):null}),u&&Re(u)&&(($=u.data.requiredPermissions)!=null&&$.length)?t.jsx(N,{label:d("item_editor.right_panel.required_permissions"),children:this.renderPermissions(u)}):null,t.jsx(N,{label:d("item_editor.right_panel.tags"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(tt,{itemId:u.id,value:C.tags,onChange:this.handleChangeTags,isDisabled:!A}),r&&g&&p&&A&&t.jsx("p",{className:"event-tag",children:d("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:p}),event_name:t.jsx("span",{children:g})})})]}):null}),(u==null?void 0:u.type)===y.WEARABLE&&m&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.copyright.title")}),t.jsx(ne,{content:d("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:d("item_editor.right_panel.copyright.vrm_export")}),t.jsx(c.Checkbox,{toggle:!0,label:C!=null&&C.blockVrmExport?d("item_editor.right_panel.copyright.disabled"):d("item_editor.right_panel.copyright.enabled"),checked:!(C!=null&&C.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":d("item_editor.right_panel.copyright.vrm_export")})]})})}),(u==null?void 0:u.type)===y.WEARABLE&&t.jsx(N,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:d("item_editor.right_panel.outline_compatible.title")}),t.jsx(ne,{content:d("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:d("item_editor.right_panel.outline_compatible.title")}),t.jsx(c.Checkbox,{toggle:!0,label:(C==null?void 0:C.outlineCompatible)!==!1?d("item_editor.right_panel.copyright.enabled"):d("item_editor.right_panel.copyright.disabled"),checked:(C==null?void 0:C.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":d("item_editor.right_panel.outline_compatible.title")})]})})}),w?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(c.Button,{secondary:!0,onClick:this.handleOnResetItem,children:d("global.cancel")}),t.jsx(Me,{primary:!0,onClick:this.handleOnSaveItem,network:_.Network.MATIC,children:d("global.save")})]}):o&&e?t.jsxs("p",{className:"danger-text",children:[d("global.error_ocurred"),": ",o]}):null]})]}):null}}):null})}};const Va=n=>{var r;const l=Ee(n)||"",e=je(n,l),s=te(n)||"",a=l&&e&&e.collectionId?Le(n,e.collectionId):null,i=Ws(n),o=l?i[l]:null;return{address:s,collection:a,selectedItem:e,selectedItemId:l,canEditSelectedItem:e?a?Fe(n,s,a):Qe(e,s):!1,itemStatus:o,error:Fs(n),isConnected:be(n),isDownloading:Hs(n),isCommitteeMember:Oe(n),isCampaignEnabled:Vs(n),campaignTag:Gs(n),campaignName:(r=Zs(n))==null?void 0:r[Ks(n)],isVrmOptOutEnabled:$s(n),isWearableUtilityEnabled:Us(n)}},$a=n=>({onSaveItem:(l,e)=>n(zs(l,e)),onDeleteItem:l=>n(Ve(l)),onOpenModal:(l,e)=>n(He(l,e)),onDownload:l=>n(Ys(l))}),Ua=B(Va,$a)(Ha);class nn extends x.PureComponent{constructor(){super(...arguments);h(this,"state",{reviewedItems:[]});h(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(i=>i.id===a.id))]}))});h(this,"handleResetReviewedItems",()=>{this.setState({reviewedItems:[]})})}render(){const{reviewedItems:e}=this.state;return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"ItemEditorPage",children:[t.jsx(ma,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Da,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Wa,{}),t.jsx(Ua,{})]})]})})}}export{nn as default};
@@ -1 +1 @@
1
- var S=Object.defineProperty;var L=(n,a,s)=>a in n?S(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s;var r=(n,a,s)=>L(n,typeof a!="symbol"?a+"":a,s);import{aB as b,D as x,dd as g,H as e,M as c,G as o,L as m,K as p,bm as j,ce as C,b8 as R,N as w,a_ as P,de as f,cO as k}from"./index-nSeb2kLU.js";import{L as v}from"./LandAction-BpzpS-68.js";import{L as B}from"./LandProviderPage-CnKtwxuP.js";import"./Back-DVDrV4XS.js";import"./NotFound-BFf6zsjs.js";const u=b.get("MARKETPLACE_WEB_URL","");class F extends x.PureComponent{constructor(){super(...arguments);r(this,"state",{selectedName:""});r(this,"handleChange",(s,i)=>{const{onFetchENS:l,land:t}=this.props,d=i.value;l(d,t),this.setState({selectedName:d})});r(this,"handleContinue",()=>{const{selectedName:s}=this.state,{onUpdateSubdomain:i,ensList:l}=this.props,t=l.find(d=>d.name===s);i(t.subdomain)})}render(){const{land:s,ensList:i,isLoading:l}=this.props,{selectedName:t}=this.state,d=i.map(({name:_,subdomain:E})=>({value:_,text:E})),h=i.find(_=>_.name===t),N=!h||g(h,s);return e.jsx(c.Form,{className:"LandSelectENSForm",children:!l&&d.length===0?e.jsxs(e.Fragment,{children:[e.jsx(c.Section,{size:"large",children:o("land_select_ens_page.empty_options_message")}),e.jsxs(c.Row,{children:[e.jsx(m,{className:"cancel",to:p.landDetail(s.id),children:e.jsx(c.Button,{children:o("global.cancel")})}),e.jsx(m,{to:`${u}/names/claim`,children:e.jsx(c.Button,{primary:!0,children:o("land_select_ens_page.claim_new_name")})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(c.Section,{size:"large",children:[e.jsxs("div",{className:"select-names",children:[e.jsx(c.Header,{sub:!0,className:"name",children:o("land_select_ens_page.select_name_title")}),e.jsx(c.Dropdown,{value:t,options:d,placeholder:o("land_select_ens_page.select_name_placeholder"),onChange:this.handleChange})]}),e.jsx("div",{className:"select-message",children:h&&g(h,s)?e.jsx("span",{className:"danger-text",children:o("land_select_ens_page.name_assigned")}):e.jsx(j,{id:"land_select_ens_page.click_to_claim_new_name",values:{click_here:e.jsx(m,{to:`${u}/names/claim`,children:o("global.click_here")})}})})]}),e.jsxs(c.Row,{children:[e.jsx(m,{className:"cancel",to:p.landDetail(s.id),children:e.jsx(c.Button,{children:o("global.cancel")})}),e.jsx(C,{type:"submit",disabled:N||l,primary:!0,onClick:this.handleContinue,loading:l,network:R.Network.ETHEREUM,children:o("global.continue")})]})]})})}}let D=class extends x.PureComponent{constructor(){super(...arguments);r(this,"handleUpdateSubdomain",(s,i)=>{const{history:l}=this.props;l.push(p.landAssignENS(s.id,i))})}render(){const{ensList:s,isLoading:i,onFetchENS:l}=this.props;return e.jsx(B,{children:t=>e.jsx(v,{land:t,title:o("land_select_ens_page.title"),subtitle:e.jsx(j,{id:"land_select_ens_page.subtitle",values:{land:e.jsx(m,{to:p.landDetail(t.id),children:t.name})}}),children:e.jsx(F,{land:t,ensList:s,isLoading:i,onUpdateSubdomain:d=>this.handleUpdateSubdomain(t,d),onFetchENS:l})})})}};const U=n=>({ensList:f(n)}),A=n=>({onFetchENS:(a,s)=>n(k(a,s))}),z=w(U,A)(P(D));export{z as default};
1
+ var S=Object.defineProperty;var L=(n,a,s)=>a in n?S(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s;var r=(n,a,s)=>L(n,typeof a!="symbol"?a+"":a,s);import{aB as b,D as x,dd as g,H as e,M as c,G as o,L as m,K as p,bm as j,ce as C,b8 as R,N as w,a_ as P,de as f,cO as k}from"./index-fMUqgf16.js";import{L as v}from"./LandAction-Boy2pTRu.js";import{L as B}from"./LandProviderPage-D1wx3XFJ.js";import"./Back-DgKAoQIH.js";import"./NotFound-B3qud5sl.js";const u=b.get("MARKETPLACE_WEB_URL","");class F extends x.PureComponent{constructor(){super(...arguments);r(this,"state",{selectedName:""});r(this,"handleChange",(s,i)=>{const{onFetchENS:l,land:t}=this.props,d=i.value;l(d,t),this.setState({selectedName:d})});r(this,"handleContinue",()=>{const{selectedName:s}=this.state,{onUpdateSubdomain:i,ensList:l}=this.props,t=l.find(d=>d.name===s);i(t.subdomain)})}render(){const{land:s,ensList:i,isLoading:l}=this.props,{selectedName:t}=this.state,d=i.map(({name:_,subdomain:E})=>({value:_,text:E})),h=i.find(_=>_.name===t),N=!h||g(h,s);return e.jsx(c.Form,{className:"LandSelectENSForm",children:!l&&d.length===0?e.jsxs(e.Fragment,{children:[e.jsx(c.Section,{size:"large",children:o("land_select_ens_page.empty_options_message")}),e.jsxs(c.Row,{children:[e.jsx(m,{className:"cancel",to:p.landDetail(s.id),children:e.jsx(c.Button,{children:o("global.cancel")})}),e.jsx(m,{to:`${u}/names/claim`,children:e.jsx(c.Button,{primary:!0,children:o("land_select_ens_page.claim_new_name")})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(c.Section,{size:"large",children:[e.jsxs("div",{className:"select-names",children:[e.jsx(c.Header,{sub:!0,className:"name",children:o("land_select_ens_page.select_name_title")}),e.jsx(c.Dropdown,{value:t,options:d,placeholder:o("land_select_ens_page.select_name_placeholder"),onChange:this.handleChange})]}),e.jsx("div",{className:"select-message",children:h&&g(h,s)?e.jsx("span",{className:"danger-text",children:o("land_select_ens_page.name_assigned")}):e.jsx(j,{id:"land_select_ens_page.click_to_claim_new_name",values:{click_here:e.jsx(m,{to:`${u}/names/claim`,children:o("global.click_here")})}})})]}),e.jsxs(c.Row,{children:[e.jsx(m,{className:"cancel",to:p.landDetail(s.id),children:e.jsx(c.Button,{children:o("global.cancel")})}),e.jsx(C,{type:"submit",disabled:N||l,primary:!0,onClick:this.handleContinue,loading:l,network:R.Network.ETHEREUM,children:o("global.continue")})]})]})})}}let D=class extends x.PureComponent{constructor(){super(...arguments);r(this,"handleUpdateSubdomain",(s,i)=>{const{history:l}=this.props;l.push(p.landAssignENS(s.id,i))})}render(){const{ensList:s,isLoading:i,onFetchENS:l}=this.props;return e.jsx(B,{children:t=>e.jsx(v,{land:t,title:o("land_select_ens_page.title"),subtitle:e.jsx(j,{id:"land_select_ens_page.subtitle",values:{land:e.jsx(m,{to:p.landDetail(t.id),children:t.name})}}),children:e.jsx(F,{land:t,ensList:s,isLoading:i,onUpdateSubdomain:d=>this.handleUpdateSubdomain(t,d),onFetchENS:l})})})}};const U=n=>({ensList:f(n)}),A=n=>({onFetchENS:(a,s)=>n(k(a,s))}),z=w(U,A)(P(D));export{z as default};
@@ -1 +1 @@
1
- var U=Object.defineProperty;var A=(t,n,s)=>n in t?U(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var d=(t,n,s)=>A(t,typeof n!="symbol"?n+"":n,s);import{D as p,E as H,F as W,G as a,H as e,I as q,J as v,L,K as _,M as o,N as w,O as z,P as J,Q as I,R as K,S as V,T as Z,U as G,V as Q,W as X,X as B,Y,Z as ee,$ as se,a0 as te,a1 as ne,a2 as b,a3 as oe,a4 as ae,a5 as ce,a6 as re,a7 as le,a8 as ie,a9 as de,aa as pe,ab as je,ac as he,ad as me}from"./index-nSeb2kLU.js";import{O as ge}from"./OptionsDropdown-CBs9QAWV.js";import{S as ue}from"./SDKTag-xtuqGgmi.js";import{L as xe}from"./LoggedInDetailPage.container-CDSy4rw9.js";import{N as Pe,S as Ce}from"./Navigation.container-D4bOX-AY.js";import"./SignInRequired-DaqmN1AU.js";import"./selectors-CRfPBNkn.js";var E;let Se=(E=class extends p.PureComponent{constructor(){super(...arguments);d(this,"state",{isDeleting:!1});d(this,"handleOnClick",()=>{const{onClick:s,project:c}=this.props;s&&s(c)});d(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});d(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});d(this,"handleDeleteProject",()=>{const{project:s,onDeleteProject:c}=this.props;c(s),this.setState({isDeleting:!1})});d(this,"handleDuplicateProject",()=>{const{project:s,onDuplicateProject:c}=this.props;c(s)});d(this,"handleExportScene",()=>{this.props.onOpenModal("ExportModal",{project:this.props.project})})}componentDidMount(){this.props.onLoadProjectScene(this.props.project,this.props.type)}render(){const{project:s,parcels:c,items:l,onClick:j,isUploading:m,hasError:f,scene:g}=this.props,{isDeleting:i}=this.state,u="likes"in s;let P={},x="ProjectCard",h=H(s,g);h&&(h&&W(h)&&(h+=`?updated_at=${+new Date(s.updatedAt)}`),P={backgroundImage:`url(${h})`},x+=" has-thumbnail");const N=[{text:a("scenes_page.project_actions.duplicate_project"),handler:this.handleDuplicateProject},{text:a("scenes_page.project_actions.export_project"),handler:this.handleExportScene},{text:a("scenes_page.project_actions.delete_project"),handler:this.handleConfirmDeleteProject}],C=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"project-thumbnail",style:P}),u?null:e.jsxs(e.Fragment,{children:[e.jsx(q,{projectId:s.id,className:"deployment-status"}),e.jsxs("div",{className:"options-container",children:[e.jsx(ue,{scene:g}),e.jsx(ge,{className:"options-dropdown",options:N})]})]}),e.jsxs("div",{className:"project-data",children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx("div",{className:"title",children:s.title}),m?e.jsx(v,{name:"cloud-upload",className:"is-uploading"}):null,!m&&f?e.jsx("div",{className:"error-indicator"}):null]}),e.jsxs("div",{className:"description",title:s.description,children:[e.jsx(v,{name:"scene-parcel"})," ",a("public_page.parcel_count",{parcels:c}),e.jsx(v,{name:"scene-object"})," ",a("project_card.item_count",{items:l})]})]})]});return e.jsxs(e.Fragment,{children:[j?e.jsx("div",{className:x,onClick:this.handleOnClick,children:C}):e.jsx(L,{to:u?_.poolView(s.id,"pool"):_.sceneDetail(s.id),className:x,children:C}),e.jsx(o.Confirm,{size:"tiny",open:i,header:a("project_card.confirm_delete_header",{title:s.title}),content:a("project_card.confirm_delete_content",{title:s.title}),confirmButton:e.jsx(o.Button,{primary:!0,children:a("global.confirm")}),cancelButton:e.jsx(o.Button,{secondary:!0,children:a("global.cancel")}),onCancel:this.handleCancelDeleteProject,onConfirm:this.handleDeleteProject})]})}},d(E,"defaultProps",{items:0,parcels:0}),E);const _e=(t,n)=>{const{project:s}=n,c=s.layout.cols*s.layout.rows,l=z(t)[s.sceneId],j=l&&l.sdk6?Object.keys(l.sdk6.entities).length-c:0,m=J(t)[s.id]?I.POOL:I.PROJECT;return{parcels:c,items:j,scene:l,deploymentStatus:K(t)[n.project.id],deployments:V(t)[n.project.id],isUploading:Z(t).has(s.id),hasError:G(t).has(s.id),type:m}},fe=t=>({onDeleteProject:n=>t(Q(n)),onDuplicateProject:n=>t(X(n)),onOpenModal:(n,s)=>t(B(n,s)),onLoadProjectScene:(n,s)=>t(Y(n,s))}),O=w(_e,fe)(Se),M=t=>{const{page:n,poolList:s,projects:c,sortBy:l,totalPages:j,isFetching:m,isLoggingIn:f,onLoadFromScenePool:g,onOpenModal:i}=t,u=ee();p.useEffect(()=>{g({sortBy:"updated_at",sortOrder:"desc"})},[g,i]),p.useEffect(()=>{se()&&i("WorldsForENSOwnersAnnouncementModal")},[i]);const P=p.useCallback(()=>{i("ImportModal")},[i]),x=p.useCallback(()=>{i("SceneCreationModal")},[i]),h=()=>e.jsx(o.Button,{inverted:!0,className:"import-scene",onClick:P,children:a("scenes_page.upload_scene")}),N=()=>e.jsx(o.Button,{primary:!0,className:"create-scene",onClick:x,children:a("scenes_page.create_scene")}),C=()=>e.jsx(o.Dropdown,{direction:"left",value:l,options:[{value:b.NEWEST,text:a("scenes_page.sort.newest")},{value:b.NAME,text:a("scenes_page.sort.name")},{value:b.SIZE,text:a("scenes_page.sort.size")}],onChange:R}),F=()=>c.length>0?e.jsx("div",{className:"CardList",children:c.map(r=>e.jsx(O,{project:r},r.id))}):e.jsxs("div",{className:"no-scenes-container",children:[e.jsx("h3",{className:"no-scenes-title",children:a("scenes_page.no_scenes.title")}),e.jsx("span",{className:"no-scenes-description",children:a("scenes_page.no_scenes.description",{a:r=>e.jsx("a",{rel:"noreferrer",target:"_blank",href:"https://docs.decentraland.org/creator/development-guide/sdk-101/",children:r})})}),e.jsx(oe,{})]}),S=p.useCallback((r={})=>{u.push(_.scenes({page:n,sortBy:l,...r}))},[n,l,u]),R=p.useCallback((r,{value:y})=>S({sortBy:y}),[S]),T=p.useCallback((r,{activePage:y})=>S({page:y}),[S]);if(f||m)return e.jsx(te,{});const k=j>1,D={firstItem:null,lastItem:null};n===1&&(D.prevItem=null),n===j&&(D.nextItem=null);const $=()=>e.jsxs(e.Fragment,{children:[e.jsx(Ce,{}),e.jsxs(o.Container,{children:[e.jsxs(o.Section,{className:"projects-menu",children:[e.jsxs(o.Row,{children:[e.jsx(o.Column,{children:e.jsx(o.Header,{children:a("scenes_page.my_scenes")})}),e.jsx(o.Column,{align:"right",children:e.jsxs("div",{className:"actions",children:[h(),N()]})})]}),e.jsxs(o.Row,{className:"actions",children:[e.jsx(o.Column,{children:e.jsx("div",{className:"items-count",children:a("scenes_page.results",{count:c.length})})}),e.jsx(o.Column,{align:"right",children:c.length>1?C():null})]})]}),e.jsxs(o.Section,{className:ne("project-cards",{"has-pagination":k}),children:[F(),k?e.jsx(o.Pagination,{...D,activePage:n,totalPages:j,onPageChange:T}):null]}),s?e.jsxs(e.Fragment,{children:[e.jsxs(o.Row,{children:[e.jsx(o.Row,{className:"scene-pool-menu",children:e.jsx(o.Header,{sub:!0,children:a("scenes_page.from_scene_pool")})}),e.jsx(o.Row,{align:"right",children:e.jsx(L,{to:_.poolSearch(),children:e.jsxs(o.Button,{basic:!0,children:[a("global.view_more")," ",e.jsx(o.Icon,{name:"chevron right"})]})})})]}),e.jsx("div",{className:"scene-pool-projects",children:s.map(r=>e.jsx(O,{project:r},r.id))})]}):null]})]});return e.jsx(xe,{className:"ScenesPage",activeTab:Pe.SCENES,children:$()})};M.defaultProps={projects:[]};const Ne=M,De=t=>({projects:ae(t),isLoggingIn:ce(t)||re(t),isFetching:le(t),page:ie(t),sortBy:de(t),totalPages:pe(t),didCreate:je(t),poolList:he(t)}),ye=t=>({onOpenModal:(n,s)=>t(B(n,s)),onLoadFromScenePool:n=>t(me(n))}),Me=w(De,ye)(Ne);export{Me as default};
1
+ var U=Object.defineProperty;var A=(t,n,s)=>n in t?U(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var d=(t,n,s)=>A(t,typeof n!="symbol"?n+"":n,s);import{D as p,E as H,F as W,G as a,H as e,I as q,J as v,L,K as _,M as o,N as w,O as z,P as J,Q as I,R as K,S as V,T as Z,U as G,V as Q,W as X,X as B,Y,Z as ee,$ as se,a0 as te,a1 as ne,a2 as b,a3 as oe,a4 as ae,a5 as ce,a6 as re,a7 as le,a8 as ie,a9 as de,aa as pe,ab as je,ac as he,ad as me}from"./index-fMUqgf16.js";import{O as ge}from"./OptionsDropdown-BMVplrrd.js";import{S as ue}from"./SDKTag-BISIXYdY.js";import{L as xe}from"./LoggedInDetailPage.container-DmotxT86.js";import{N as Pe,S as Ce}from"./Navigation.container-BbObl0Ib.js";import"./SignInRequired-D6OazGjK.js";import"./selectors-BhNw_vWj.js";var E;let Se=(E=class extends p.PureComponent{constructor(){super(...arguments);d(this,"state",{isDeleting:!1});d(this,"handleOnClick",()=>{const{onClick:s,project:c}=this.props;s&&s(c)});d(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});d(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});d(this,"handleDeleteProject",()=>{const{project:s,onDeleteProject:c}=this.props;c(s),this.setState({isDeleting:!1})});d(this,"handleDuplicateProject",()=>{const{project:s,onDuplicateProject:c}=this.props;c(s)});d(this,"handleExportScene",()=>{this.props.onOpenModal("ExportModal",{project:this.props.project})})}componentDidMount(){this.props.onLoadProjectScene(this.props.project,this.props.type)}render(){const{project:s,parcels:c,items:l,onClick:j,isUploading:m,hasError:f,scene:g}=this.props,{isDeleting:i}=this.state,u="likes"in s;let P={},x="ProjectCard",h=H(s,g);h&&(h&&W(h)&&(h+=`?updated_at=${+new Date(s.updatedAt)}`),P={backgroundImage:`url(${h})`},x+=" has-thumbnail");const N=[{text:a("scenes_page.project_actions.duplicate_project"),handler:this.handleDuplicateProject},{text:a("scenes_page.project_actions.export_project"),handler:this.handleExportScene},{text:a("scenes_page.project_actions.delete_project"),handler:this.handleConfirmDeleteProject}],C=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"project-thumbnail",style:P}),u?null:e.jsxs(e.Fragment,{children:[e.jsx(q,{projectId:s.id,className:"deployment-status"}),e.jsxs("div",{className:"options-container",children:[e.jsx(ue,{scene:g}),e.jsx(ge,{className:"options-dropdown",options:N})]})]}),e.jsxs("div",{className:"project-data",children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx("div",{className:"title",children:s.title}),m?e.jsx(v,{name:"cloud-upload",className:"is-uploading"}):null,!m&&f?e.jsx("div",{className:"error-indicator"}):null]}),e.jsxs("div",{className:"description",title:s.description,children:[e.jsx(v,{name:"scene-parcel"})," ",a("public_page.parcel_count",{parcels:c}),e.jsx(v,{name:"scene-object"})," ",a("project_card.item_count",{items:l})]})]})]});return e.jsxs(e.Fragment,{children:[j?e.jsx("div",{className:x,onClick:this.handleOnClick,children:C}):e.jsx(L,{to:u?_.poolView(s.id,"pool"):_.sceneDetail(s.id),className:x,children:C}),e.jsx(o.Confirm,{size:"tiny",open:i,header:a("project_card.confirm_delete_header",{title:s.title}),content:a("project_card.confirm_delete_content",{title:s.title}),confirmButton:e.jsx(o.Button,{primary:!0,children:a("global.confirm")}),cancelButton:e.jsx(o.Button,{secondary:!0,children:a("global.cancel")}),onCancel:this.handleCancelDeleteProject,onConfirm:this.handleDeleteProject})]})}},d(E,"defaultProps",{items:0,parcels:0}),E);const _e=(t,n)=>{const{project:s}=n,c=s.layout.cols*s.layout.rows,l=z(t)[s.sceneId],j=l&&l.sdk6?Object.keys(l.sdk6.entities).length-c:0,m=J(t)[s.id]?I.POOL:I.PROJECT;return{parcels:c,items:j,scene:l,deploymentStatus:K(t)[n.project.id],deployments:V(t)[n.project.id],isUploading:Z(t).has(s.id),hasError:G(t).has(s.id),type:m}},fe=t=>({onDeleteProject:n=>t(Q(n)),onDuplicateProject:n=>t(X(n)),onOpenModal:(n,s)=>t(B(n,s)),onLoadProjectScene:(n,s)=>t(Y(n,s))}),O=w(_e,fe)(Se),M=t=>{const{page:n,poolList:s,projects:c,sortBy:l,totalPages:j,isFetching:m,isLoggingIn:f,onLoadFromScenePool:g,onOpenModal:i}=t,u=ee();p.useEffect(()=>{g({sortBy:"updated_at",sortOrder:"desc"})},[g,i]),p.useEffect(()=>{se()&&i("WorldsForENSOwnersAnnouncementModal")},[i]);const P=p.useCallback(()=>{i("ImportModal")},[i]),x=p.useCallback(()=>{i("SceneCreationModal")},[i]),h=()=>e.jsx(o.Button,{inverted:!0,className:"import-scene",onClick:P,children:a("scenes_page.upload_scene")}),N=()=>e.jsx(o.Button,{primary:!0,className:"create-scene",onClick:x,children:a("scenes_page.create_scene")}),C=()=>e.jsx(o.Dropdown,{direction:"left",value:l,options:[{value:b.NEWEST,text:a("scenes_page.sort.newest")},{value:b.NAME,text:a("scenes_page.sort.name")},{value:b.SIZE,text:a("scenes_page.sort.size")}],onChange:R}),F=()=>c.length>0?e.jsx("div",{className:"CardList",children:c.map(r=>e.jsx(O,{project:r},r.id))}):e.jsxs("div",{className:"no-scenes-container",children:[e.jsx("h3",{className:"no-scenes-title",children:a("scenes_page.no_scenes.title")}),e.jsx("span",{className:"no-scenes-description",children:a("scenes_page.no_scenes.description",{a:r=>e.jsx("a",{rel:"noreferrer",target:"_blank",href:"https://docs.decentraland.org/creator/development-guide/sdk-101/",children:r})})}),e.jsx(oe,{})]}),S=p.useCallback((r={})=>{u.push(_.scenes({page:n,sortBy:l,...r}))},[n,l,u]),R=p.useCallback((r,{value:y})=>S({sortBy:y}),[S]),T=p.useCallback((r,{activePage:y})=>S({page:y}),[S]);if(f||m)return e.jsx(te,{});const k=j>1,D={firstItem:null,lastItem:null};n===1&&(D.prevItem=null),n===j&&(D.nextItem=null);const $=()=>e.jsxs(e.Fragment,{children:[e.jsx(Ce,{}),e.jsxs(o.Container,{children:[e.jsxs(o.Section,{className:"projects-menu",children:[e.jsxs(o.Row,{children:[e.jsx(o.Column,{children:e.jsx(o.Header,{children:a("scenes_page.my_scenes")})}),e.jsx(o.Column,{align:"right",children:e.jsxs("div",{className:"actions",children:[h(),N()]})})]}),e.jsxs(o.Row,{className:"actions",children:[e.jsx(o.Column,{children:e.jsx("div",{className:"items-count",children:a("scenes_page.results",{count:c.length})})}),e.jsx(o.Column,{align:"right",children:c.length>1?C():null})]})]}),e.jsxs(o.Section,{className:ne("project-cards",{"has-pagination":k}),children:[F(),k?e.jsx(o.Pagination,{...D,activePage:n,totalPages:j,onPageChange:T}):null]}),s?e.jsxs(e.Fragment,{children:[e.jsxs(o.Row,{children:[e.jsx(o.Row,{className:"scene-pool-menu",children:e.jsx(o.Header,{sub:!0,children:a("scenes_page.from_scene_pool")})}),e.jsx(o.Row,{align:"right",children:e.jsx(L,{to:_.poolSearch(),children:e.jsxs(o.Button,{basic:!0,children:[a("global.view_more")," ",e.jsx(o.Icon,{name:"chevron right"})]})})})]}),e.jsx("div",{className:"scene-pool-projects",children:s.map(r=>e.jsx(O,{project:r},r.id))})]}):null]})]});return e.jsx(xe,{className:"ScenesPage",activeTab:Pe.SCENES,children:$()})};M.defaultProps={projects:[]};const Ne=M,De=t=>({projects:ae(t),isLoggingIn:ce(t)||re(t),isFetching:le(t),page:ie(t),sortBy:de(t),totalPages:pe(t),didCreate:je(t),poolList:he(t)}),ye=t=>({onOpenModal:(n,s)=>t(B(n,s)),onLoadFromScenePool:n=>t(me(n))}),Me=w(De,ye)(Ne);export{Me as default};
@@ -0,0 +1 @@
1
+ .ItemCard .image-wrapper{display:flex;align-items:center;text-align:center}.ItemCard .content{background:none;margin-top:16px;text-align:center}.ItemCard .content .text{font-size:17px;max-width:248px;overflow:hidden;text-overflow:ellipsis}.ItemCard .subtitle{margin-top:5px;color:var(--secondary-text)}.ui.cards>.ui.card.link.ItemCard.is-dragging{transform:translateY(0);border:1px solid var(--primary)!important}.ItemCard.is-dragging .ItemImage{border:1px solid var(--primary)}.ItemCard:hover .options-dropdown.ui.dropdown>.dropdown.icon{visibility:visible}.ItemCard .options-dropdown.ui.dropdown>.dropdown.icon{visibility:hidden}@media (max-width: 1200px){.ItemCard .content .text{max-width:215px}}._ItemRow_xmdia_1:hover{background-color:#24212966;color:var(--text);cursor:pointer}._image_xmdia_7{width:64px;height:64px;margin-right:10px;border-radius:8px;overflow:hidden;flex:none}._image_xmdia_7 img{width:100%;height:100%}._name_xmdia_21{display:inline-block;margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._title_xmdia_29,._imageColumn_xmdia_30{display:flex;align-items:center}._published_xmdia_35{color:var(--light-blue-raw)}.CollectionCard .content{margin-top:16px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}.CollectionCard .content .text{font-size:17px;max-width:248px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CollectionCard .subtitle{margin-top:5px;max-width:248px;color:var(--secondary-text)}.CollectionCard .CollectionBadge{margin-left:5px}.CollectionCard .sparkles{width:54px;height:56px;margin-bottom:5px;background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.6.1-15066342098.commit-7c747bd/assets/sparkles-C-WJN0Gh.svg);background-repeat:no-repeat}.CollectionCard.is-over .CollectionImage{border:1px solid var(--primary)!important}.CollectionCard .empty-collection-options .icon:before{color:var(--text)!important}.CollectionCard:hover .options-dropdown.ui.dropdown>.dropdown.icon{visibility:visible}.CollectionCard .options-dropdown.ui.dropdown>.dropdown.icon{visibility:hidden}.CollectionCard .pending-migration{text-transform:uppercase;padding:4px 8px;border-radius:32px;display:inline-flex;align-items:center;gap:4px;color:#ffbc5b;background-color:#ffbc5b33;margin-top:16px}.CollectionCard .pending-migration .icon{height:18px}@media (max-width: 1200px){.CollectionCard .content .text{max-width:215px}}.delete-collection-confirm .header{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._CollectionRow_k7d4q_1:hover{background-color:#24212966;color:var(--text);cursor:pointer}._image_k7d4q_7{width:64px;height:64px;margin-right:10px;border-radius:8px;overflow:hidden;flex:none}._name_k7d4q_16{display:inline-block;margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._title_k7d4q_24,._imageColumn_k7d4q_25{display:flex;align-items:center}._published_k7d4q_30{color:var(--light-blue-raw)}.CollectionsPage .ui.cards{margin:0}.CollectionsPage .empty{margin-top:28px;padding:112px 0;width:100%;border-radius:8px;border:1px solid var(--divider);justify-content:center;color:var(--secondary-text);text-align:center;line-height:28px;font-size:17px}.CollectionsPage .empty .header.title{margin:0}.CollectionsPage .empty .empty-description{margin:8px auto 34px;width:500px}.CollectionsPage .empty .create-new-wrapper{display:flex;justify-content:center}.CollectionsPage .empty .create-new{width:240px;height:204px;position:relative;background-color:rgba(var(--bluish-steel-raw),.16);border-radius:8px;background-position:50% 35%;cursor:pointer}.CollectionsPage .empty .create-new:first-child{margin-right:24px}.CollectionsPage .empty .create-new>.text{position:absolute;flex:1 1;color:#fff;bottom:31px;width:100%}.CollectionsPage .empty .create-new-item{background-image:url("data:image/svg+xml,%3csvg%20width='96'%20height='70'%20viewBox='0%200%2096%2070'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M94.7941%2054.5156H74.6855L79.6698%205.31259C79.6698%203.69125%2077.9661%202.41876%2069.6516%201.4775C64.084%200.847025%2056.4659%200.5%2048.201%200.5C39.9361%200.5%2032.318%200.847025%2026.7498%201.4775C18.4353%202.41876%2016.7316%203.69125%2016.7316%205.31259L21.7303%2054.5156H1.20588C0.53989%2054.5156%200%2055.0595%200%2055.7304C0%2057.5657%201.48584%2059.3693%204.41633%2061.0912C6.95671%2062.5838%2010.6085%2064.027%2014.9768%2065.2659C24.4687%2067.9566%2036.5783%2069.5%2048.201%2069.5C59.8068%2069.5%2071.8444%2067.9562%2081.2276%2065.2648C85.5422%2064.0272%2089.1474%2062.5826%2091.6534%2061.087C94.5377%2059.366%2096%2057.5641%2096%2055.7304C96%2055.0595%2095.4601%2054.5156%2094.7941%2054.5156ZM28.2371%203.76191C33.5781%203.22518%2040.6681%202.92958%2048.201%202.92958C55.7339%202.92958%2062.8239%203.22518%2068.1649%203.76191C73.4374%204.29176%2075.7292%204.92365%2076.6979%205.31239C75.7296%205.70071%2073.4378%206.3324%2068.1637%206.86185C62.8231%207.39818%2055.7335%207.69357%2048.201%207.69357C40.6685%207.69357%2033.5799%207.39798%2028.2375%206.86124C22.9668%206.3318%2020.6744%205.70051%2019.7047%205.31218C20.6738%204.92325%2022.9656%204.29176%2028.2371%203.76191ZM20.2817%208.04769C19.9589%207.96103%2019.6639%207.87195%2019.3895%207.78023L22.8556%2041.7797C25.5439%2042.0648%2028.2326%2042.3092%2030.8623%2042.5027C31.5103%2042.549%2032.0054%2043.104%2031.9822%2043.758C31.9589%2044.4121%2031.4255%2044.9299%2030.7758%2044.9293C30.7469%2044.9293%2030.7165%2044.9281%2030.6866%2044.9258C28.1961%2044.7424%2025.6531%2044.5138%2023.1074%2044.2492L24.1662%2054.633C40.9818%2056.5169%2055.4425%2056.5169%2072.2488%2054.633L73.3112%2044.2097C64.9039%2045.1073%2056.4558%2045.5605%2048.0014%2045.5676C44.0282%2045.5676%2040.0619%2045.4656%2036.0803%2045.2619C35.4151%2045.2279%2034.9033%2044.6572%2034.937%2043.9871C34.9708%2043.317%2035.5373%2042.8014%2036.2025%2042.8354C48.6658%2043.465%2061.159%2043.0979%2073.5646%2041.7374L77.0249%207.77658C76.75%207.86891%2076.4539%207.9588%2076.1301%208.04586C74.5092%208.48157%2072.236%208.8624%2069.3734%209.17744C63.8348%209.78726%2056.3155%2010.1232%2048.201%2010.1232C40.0939%2010.1232%2032.5784%209.78747%2027.0392%209.17805C24.1777%208.86321%2021.9042%208.48278%2020.2817%208.04769ZM80.5678%2062.928C71.3902%2065.56%2059.5933%2067.0704%2048.2016%2067.0704C36.7904%2067.0704%2024.9189%2065.5602%2015.6308%2062.9272C7.79601%2060.7059%204.28067%2058.4424%203.01068%2056.9452H22.9981L23.2493%2056.9737C40.7442%2058.9781%2055.669%2058.9781%2073.1554%2056.9757L73.4183%2056.9452H93.0339C91.6488%2058.6329%2087.6232%2060.9042%2080.5672%2062.928H80.5678ZM42.7852%2028.6841L41.9678%2033.4888C41.8902%2033.9446%2042.0762%2034.4052%2042.4475%2034.677C42.8189%2034.9488%2043.3112%2034.9846%2043.7175%2034.7694L48%2032.5014L52.2825%2034.769C52.6888%2034.9842%2053.1811%2034.9484%2053.5525%2034.6766C53.9238%2034.4048%2054.1098%2033.9442%2054.0322%2033.4884L53.2148%2028.6837L56.6799%2025.2817C57.0087%2024.9589%2057.1271%2024.4761%2056.9852%2024.0362C56.8433%2023.5964%2056.4658%2023.2759%2056.0115%2023.2095L51.2225%2022.5095L49.0815%2018.1383C48.8784%2017.7235%2048.4591%2017.4609%2048%2017.4609C47.5409%2017.4609%2047.1216%2017.7235%2046.9185%2018.1383L44.7775%2022.5095L39.9885%2023.2095C39.5342%2023.2759%2039.1567%2023.5964%2039.0148%2024.0362C38.8729%2024.4761%2038.9913%2024.9589%2039.3201%2025.2817L42.7852%2028.6841ZM45.7514%2024.8217C46.1443%2024.7642%2046.484%2024.5157%2046.6597%2024.157L48%2021.4205L49.3403%2024.157C49.516%2024.5157%2049.8557%2024.7642%2050.2486%2024.8217L53.2466%2025.2598L51.0774%2027.3902C50.7932%2027.6692%2050.6635%2028.0712%2050.7305%2028.4652L51.2424%2031.4737L48.5611%2030.0536C48.2098%2029.8675%2047.7902%2029.8675%2047.4389%2030.0536L44.7576%2031.4737L45.2695%2028.4652C45.3365%2028.0712%2045.2068%2027.6692%2044.9226%2027.3902L42.7544%2025.2598L45.7514%2024.8217Z'%20fill='white'/%3e%3c/svg%3e");background-repeat:no-repeat}.CollectionsPage .empty .create-new-collection{background-image:url("data:image/svg+xml,%3csvg%20width='80'%20height='68'%20viewBox='0%200%2080%2068'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M41.0076%2012.269L41.0075%2012.2691L41.0168%2012.2788C41.9992%2013.2997%2043.3962%2013.8831%2044.8227%2013.8831H70.143C74.7432%2013.8831%2078.4998%2017.6467%2078.4998%2022.2832L78.4998%2058.0694L78.4998%2058.0761C78.5204%2062.6953%2074.7818%2066.4778%2070.1849%2066.5H70.1792H9.85685C5.25666%2066.5%201.5%2062.7363%201.5%2058.0997V9.90034C1.5%205.26392%205.25664%201.50022%209.85681%201.50036H9.85685L27.0684%201.50038L27.077%201.50033C29.3256%201.48732%2031.5245%202.33413%2033.1219%203.92557L41.0076%2012.269Z'%20stroke='white'%20stroke-width='3'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M58.5227%2046.9194H50.563L52.536%2026.9529C52.536%2026.295%2051.8616%2025.7786%2048.5704%2025.3967C46.3666%2025.1408%2043.3511%2025%2040.0796%2025C36.808%2025%2033.7925%2025.1408%2031.5885%2025.3967C28.2973%2025.7786%2027.6229%2026.295%2027.6229%2026.9529L29.6016%2046.9194H21.4773C21.2137%2046.9194%2021%2047.1401%2021%2047.4123C21%2048.1571%2021.5881%2048.889%2022.7481%2049.5877C23.7537%2050.1934%2025.1992%2050.7791%2026.9283%2051.2818C30.6855%2052.3737%2035.4789%2053%2040.0796%2053C44.6735%2053%2049.4384%2052.3735%2053.1526%2051.2814C54.8605%2050.7791%2056.2875%2050.1929%2057.2795%2049.586C58.4212%2048.8877%2059%2048.1564%2059%2047.4123C59%2047.1401%2058.7863%2046.9194%2058.5227%2046.9194ZM32.1772%2026.3237C34.2913%2026.1059%2037.0978%2025.9859%2040.0796%2025.9859C43.0613%2025.9859%2045.8678%2026.1059%2047.9819%2026.3237C50.069%2026.5387%2050.9761%2026.7951%2051.3596%2026.9529C50.9763%2027.1104%2050.0691%2027.3668%2047.9815%2027.5816C45.8675%2027.7993%2043.0612%2027.9191%2040.0796%2027.9191C37.0979%2027.9191%2034.292%2027.7992%2032.1773%2027.5814C30.091%2027.3665%2029.1836%2027.1104%2028.7998%2026.9528C29.1834%2026.7949%2030.0905%2026.5387%2032.1772%2026.3237ZM29.0282%2028.0628C28.9004%2028.0277%2028.7836%2027.9915%2028.675%2027.9543L30.047%2041.7512C31.1111%2041.8669%2032.1754%2041.966%2033.2163%2042.0446C33.4728%2042.0634%2033.6688%2042.2886%2033.6596%2042.554C33.6504%2042.8194%2033.4392%2043.0295%2033.1821%2043.0293C33.1706%2043.0293%2033.1586%2043.0288%2033.1468%2043.0279C32.1609%2042.9534%2031.1543%2042.8607%2030.1467%2042.7533L30.5658%2046.967C37.222%2047.7315%2042.946%2047.7315%2049.5985%2046.967L50.019%2042.7373C46.6911%2043.1015%2043.3471%2043.2854%2040.0006%2043.2883C38.4278%2043.2883%2036.8578%2043.2469%2035.2818%2043.1643C35.0185%2043.1505%2034.8159%2042.9189%2034.8292%2042.6469C34.8426%2042.375%2035.0669%2042.1658%2035.3302%2042.1796C40.2635%2042.4351%2045.2088%2042.2861%2050.1193%2041.734L51.489%2027.9528C51.3802%2027.9903%2051.263%2028.0268%2051.1348%2028.0621C50.4932%2028.2389%2049.5934%2028.3934%2048.4603%2028.5213C46.2679%2028.7687%2043.2916%2028.905%2040.0796%2028.905C36.8705%2028.905%2033.8956%2028.7688%2031.703%2028.5215C30.5703%2028.3938%2029.6704%2028.2394%2029.0282%2028.0628ZM52.8914%2050.3331C49.2586%2051.4012%2044.589%2052.0141%2040.0798%2052.0141C35.5628%2052.0141%2030.8637%2051.4013%2027.1872%2050.3328C24.0859%2049.4314%2022.6944%2048.5129%2022.1917%2047.9053H30.1034L30.2029%2047.9169C37.1279%2048.7302%2043.0356%2048.7302%2049.9574%2047.9177L50.0614%2047.9053H57.8259C57.2776%2048.5902%2055.6842%2049.5118%2052.8912%2050.3331H52.8914ZM37.9358%2036.437L37.6123%2038.3868C37.5815%2038.5717%2037.6552%2038.7586%2037.8021%2038.8689C37.9491%2038.9792%2038.144%2038.9938%2038.3049%2038.9064L40%2037.9861L41.6951%2038.9063C41.856%2038.9936%2042.0508%2038.979%2042.1978%2038.8688C42.3448%2038.7585%2042.4185%2038.5715%2042.3877%2038.3866L42.0642%2036.4369L43.4358%2035.0563C43.5659%2034.9254%2043.6128%2034.7294%2043.5566%2034.5509C43.5005%2034.3724%2043.351%2034.2424%2043.1712%2034.2154L41.2756%2033.9314L40.4281%2032.1576C40.3477%2031.9893%2040.1817%2031.8827%2040%2031.8827C39.8183%2031.8827%2039.6523%2031.9893%2039.5719%2032.1576L38.7244%2033.9314L36.8288%2034.2154C36.649%2034.2424%2036.4995%2034.3724%2036.4434%2034.5509C36.3872%2034.7294%2036.4341%2034.9254%2036.5642%2035.0563L37.9358%2036.437ZM39.1099%2034.8697C39.2655%2034.8464%2039.3999%2034.7455%2039.4694%2034.5999L40%2033.4895L40.5305%2034.5999C40.6001%2034.7455%2040.7345%2034.8464%2040.8901%2034.8697L42.0768%2035.0475L41.2181%2035.9119C41.1056%2036.0252%2041.0543%2036.1883%2041.0808%2036.3482L41.2835%2037.569L40.2221%2036.9928C40.0831%2036.9173%2039.9169%2036.9173%2039.7779%2036.9928L38.7165%2037.569L38.9192%2036.3482C38.9457%2036.1883%2038.8944%2036.0252%2038.7819%2035.9119L37.9236%2035.0475L39.1099%2034.8697Z'%20fill='white'/%3e%3c/svg%3e");background-repeat:no-repeat}.CollectionsPage .ui.cards .ui.card{width:248px;background-color:transparent;box-shadow:none}.CollectionsPage .card .image-wrapper{height:248px;padding:15px}.CollectionsPage .filters{margin-bottom:20px}.dcl.page.LoggedInDetailPage.CollectionsPage{padding:0 24px}.CollectionsPage .filters .dcl.row.actions .ui.dropdown .ui.button{width:16px;height:16px;box-sizing:content-box;padding:5px 10px;border-radius:4px;border:solid 1px var(--gray)}.CollectionsPage .filters .dcl.row.actions .ui.button.open-editor{display:flex;align-items:center}.CollectionsPage .filters .dcl.row.actions .ui.button.open-editor .Icon{margin-right:6px}.CollectionsPage .filters .dcl.row.actions .ui.button.open-editor:hover{transform:translateY(0)}.CollectionsPage .Chip{padding:4px;height:28px;width:32px}.CollectionsPage .Chip.grid{border-radius:4px 0 0 4px;margin-left:16px}.CollectionsPage .Chip.list{border-radius:0 4px 4px 0}.CollectionsPage .is-card{transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;box-shadow:none;transform:translateY(0)}.CollectionsPage .is-card:nth-child(4n){margin-right:0}.CollectionsPage .is-card:hover{transform:translateY(-4px)}.CollectionsPage .is-card .is-image{aspect-ratio:1 / 1;transition:box-shadow .2s ease-in-out;width:100%;overflow:hidden;border-radius:8px!important}.CollectionsPage .is-card:hover .is-image{box-shadow:var(--shadow-2)}.CollectionsPage .is-card .is-image .is-image{border-radius:0!important;box-shadow:none}.dcl.page.CollectionsPage .ui.container{width:100%;max-width:100%!important}.CollectionsPage .ui.container .ui.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:20px}.CollectionsPage .dcl.tabs.fullscreen .dcl.column.right{float:right;padding:19px 0}.CollectionsPage .pagination{width:100%;display:flex;justify-content:center;margin-top:16px}.CollectionsPage .ui.pagination.menu{margin-top:16px}.CollectionsPage .dcl.tabs .ui.container{margin-bottom:20px}.CollectionsPage .collections-main-actions{display:flex;justify-content:end;gap:20px;min-height:74px}.CollectionsPage .collections-main-actions>:first-child{flex:1}.CollectionsPage .dcl.field .collections-search-field.ui.input input{padding:8px;background:var(--shadows);border-radius:10px;border:none;font-size:16px}.CollectionsPage .collections-main-actions>.actions{align-self:baseline;justify-self:end;flex:none}.CollectionsPage .collections-icon{width:32px;height:32px;margin-bottom:20px}.CollectionsPage .action-tabs-container{display:flex;align-items:center;flex-direction:row;gap:8px}.CollectionsPage .banner-container{margin-bottom:24px}
@@ -1 +1 @@
1
- var f=Object.defineProperty;var R=(l,o,s)=>o in l?f(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s;var x=(l,o,s)=>R(l,typeof o!="symbol"?o+"":o,s);import{D as g,K as m,H as e,aZ as B,M as t,N,a_ as O,bQ as z,bR as H,aA as P,bB as _,bS as A,bT as F,bI as j,bU as C,G as a,bM as $,bA as X,bC as E,bV as Y,bW as W,bX as U,bY as V,bZ as J,b_ as Z,aW as G,b$ as K,X as Q}from"./index-nSeb2kLU.js";import{L as q}from"./LandProviderPage-CnKtwxuP.js";import{B as ee}from"./Back-DVDrV4XS.js";import{J as se}from"./JumpIn.container-CHK-Z_Zl.js";import{R as te}from"./RentalPeriod-B1VH40kP.js";import{S as oe}from"./SceneStats.container-CWVBefWA.js";import"./NotFound-BFf6zsjs.js";import"./index-C97e_oh9.js";import"./date-Bn2WlT-o.js";let ie=class extends g.PureComponent{constructor(){super(...arguments);x(this,"handleOnClick",()=>{const{isLoading:s,history:i}=this.props;s&&i.push(m.activity())})}render(){const{ens:s,isLoading:i,onIconClick:n}=this.props;return e.jsx(B,{className:"ENSChip",text:i?e.jsxs(e.Fragment,{children:[s.subdomain,e.jsx(t.Loader,{active:!0,size:"tiny"})]}):s.subdomain,isActive:i,icon:i?"":"minus",onClick:this.handleOnClick,onIconClick:n})}};const ne=(l,o)=>{const{ens:s}=o;return{isLoading:z(l)[s.subdomain]||H(l)[s.subdomain]}},le=N(ne)(O(ie)),ae=l=>{const{deployment:o,onMouseEnter:s,onMouseLeave:i,onNavigate:n,onOpenModal:u,projects:c,disabled:r}=l,d=o.projectId&&o.projectId in c?c[o.projectId]:null,p=g.useCallback(()=>{r||s(o)},[s,r,o]),h=g.useCallback(()=>{r||i(o)},[i,r,o]),v=g.useCallback(()=>{d&&!r&&n(m.sceneDetail(d.id))},[n,d,r]),S=g.useCallback(()=>{u("DeployModal",{view:P.CLEAR_DEPLOYMENT,deploymentId:o.id})},[u,o]);return e.jsxs("div",{className:`Scene ${d&&!r?"clickable":""}`,onClick:v,onMouseEnter:p,onMouseLeave:h,children:[o.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${o.thumbnail})`}}):e.jsx("div",{className:"no-thumbnail"}),e.jsxs("div",{className:"stat",children:[e.jsx("div",{className:"title",title:o.name,children:o.name}),o.layout?e.jsxs("div",{className:"secondary-text",children:[o.layout.rows,"x",o.layout.cols]}):null]}),e.jsx(oe,{deployment:o}),e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,disabled:r,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:"Unpublish",onClick:S})})})]})},L=({children:l,land:o})=>{const s=g.Children.map(l,i=>g.isValidElement(i)?g.cloneElement(i,{disabled:o.roles.includes(j.LESSOR)}):i);return e.jsx(t.Popup,{content:a("land_detail_page.land_is_locked"),position:"top left",disabled:!o.roles.includes(j.LESSOR),trigger:e.jsx("span",{children:s})})};let re=class extends g.PureComponent{constructor(){super(...arguments);x(this,"state",{hovered:null,mouseX:0,mouseY:0,showTooltip:!1});x(this,"handleMouseEnter",s=>{this.setState({hovered:s,showTooltip:!1})});x(this,"handleMouseLeave",()=>{this.setState({hovered:null,showTooltip:!1})});x(this,"handleMouseMove",s=>{this.setState({mouseX:s.clientX,mouseY:s.clientY})});x(this,"handleHover",s=>(i,n)=>{const{deploymentsByCoord:u}=this.props,c=u[_(i,n)];c&&s.some(r=>r.id===c.id)?this.setState({hovered:c,showTooltip:!0}):this.setState({hovered:null,showTooltip:!1})});x(this,"handleClick",(s,i)=>{const{deploymentsByCoord:n,projects:u,onNavigate:c,onReplace:r,landTiles:d}=this.props,p=_(s,i),h=n[p];h&&h.projectId&&h.projectId in u?c(m.sceneDetail(h.projectId)):p in d&&r(m.landDetail(d[p].land.id))});x(this,"isHovered",(s,i)=>{const{deploymentsByCoord:n}=this.props,{hovered:u}=this.state,c=_(s,i),r=n[c];return!!r&&!!u&&u.id===r.id});x(this,"getHoverStrokeLayer",s=>(i,n)=>this.isHovered(i,n)?{color:A[s.role],scale:1.4}:null);x(this,"getHoverFillLayer",s=>(i,n)=>this.isHovered(i,n)?{color:F[s.role],scale:1.2}:null)}computeOccupiedLand(s,i){const{landTiles:n}=this.props;return i.reduce((c,r)=>c+r.parcels.filter(d=>{const p=n[d];return!!p&&p.land.id===s.id}).length,0)}renderDetail(s,i,n){const{ensList:u,parcelsAvailableToBuildEstates:c,projects:r,onNavigate:d,onOpenModal:p}=this.props,{hovered:h,mouseX:v,mouseY:S,showTooltip:y}=this.state,D=this.computeOccupiedLand(s,i),w=n&&(s.roles.includes(j.LESSOR)||s.roles.includes(j.TENANT))?n.lessor:s.owner,M=s.roles.includes(j.LESSOR),k=c[s.id],T=y&&h&&h.projectId&&h.projectId in r;return e.jsxs(e.Fragment,{children:[h&&y?e.jsxs("div",{className:"tooltip",style:{top:S,left:v},children:[h.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${h.thumbnail})`}}):null,e.jsx("div",{className:"name",children:h.name})]}):null,e.jsx(t.Section,{size:"large",children:e.jsxs(t.Row,{children:[e.jsx(ee,{absolute:!0,onClick:()=>d(m.land())}),e.jsx(t.Narrow,{children:e.jsxs(t.Row,{children:[e.jsx(t.Column,{children:e.jsxs(t.Row,{children:[e.jsx(t.Header,{size:"huge",children:s.name}),s.type===C.PARCEL?e.jsx(e.Fragment,{children:e.jsxs(t.Badge,{color:"#37333D",children:[e.jsx("i",{className:"pin"}),s.id]})}):e.jsxs(t.Badge,{color:"#37333D",children:[s.size," LAND"]}),e.jsx(se,{land:s})]})}),s.role===j.OWNER||s.role===j.LESSOR?e.jsx(t.Column,{className:"actions",align:"right",children:e.jsxs(t.Row,{children:[e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landTransfer(s.id)),children:a("land_detail_page.transfer")})}),e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landEdit(s.id)),children:a("global.edit")})}),e.jsx(L,{land:s,children:e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[k?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.build_estate"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.add_or_remove_parcels"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.dissolve_estate"),onClick:()=>p("DissolveModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.assign_name"),onClick:()=>d(m.landSelectENS(s.id))}),e.jsx(t.Dropdown.Divider,{})]}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})]})})})]})}):s.roles.includes(j.TENANT)&&n&&!$(n)?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})})}):null]})})]})}),e.jsxs(t.Narrow,{children:[e.jsx(t.Section,{size:"large",children:e.jsx("div",{className:`atlas-wrapper ${T?"clickable":""}`,onMouseLeave:this.handleMouseLeave,onMouseMove:this.handleMouseMove,children:e.jsx(X,{landId:s.id,layers:[this.getHoverStrokeLayer(s),this.getHoverFillLayer(s)],isDraggable:!0,zoom:s.size&&s.size>=1e3?.5:1,onHover:this.handleHover(i),onClick:this.handleClick})})}),e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.online_scenes")}),i.length===0?e.jsx(t.Empty,{height:100,children:a("global.none")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"deployments",children:i.map(b=>e.jsx(ae,{disabled:M,deployment:b,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onNavigate:d,onOpenModal:p,projects:r},b.id))}),e.jsx("div",{className:"notice",children:a("analytics.notice")})]})]}),u.length>0?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:e.jsx(t.Row,{children:e.jsx(t.Column,{children:a("land_detail_page.assigned_names")})})}),e.jsx("div",{className:"ens-list",children:u.map(b=>e.jsx(le,{ens:b,onIconClick:()=>p("UnsetENSContentModal",{ens:b,land:s})},b.subdomain))})]}):null,s.description?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.description")}),e.jsx("p",{children:s.description})]}):null,e.jsxs(t.Section,{className:"data",children:[e.jsxs(t.Stats,{title:a("global.role"),className:"role",children:[e.jsx(t.Header,{children:a(`roles.${s.role}`)}),n?e.jsx(te,{land:s,rental:n}):null]}),e.jsx(t.Stats,{title:a("land_detail_page.owner"),children:e.jsx(E,{address:w,size:"large"})}),n&&s.roles.includes(j.LESSOR)?e.jsx(t.Stats,{title:a("land_detail_page.tenant"),children:e.jsx(E,{address:n.tenant,size:"large"})}):null,s.operators.length>0?e.jsx(t.Stats,{title:a("land_detail_page.operated_by"),className:"operators",children:e.jsx(t.Row,{children:s.operators.map((b,I)=>e.jsx(E,{address:b,size:"large"},I))})}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Stats,{title:a("land_detail_page.total_land"),children:e.jsx(t.Header,{children:s.size})}),e.jsx(t.Stats,{title:a("land_detail_page.empty_land"),children:e.jsx(t.Header,{children:s.size-D})})]}):null]})]})]})}render(){return e.jsx(q,{className:"LandDetailPage",children:(s,{deployments:i,rental:n})=>this.renderDetail(s,i,n)})}};const de=l=>{const o=Y(l)||"";return{ensList:W(l,o),parcelsAvailableToBuildEstates:U(l),deploymentsByCoord:V(l),landTiles:J(l),projects:Z(l)}},ce=l=>({onNavigate:o=>l(G(o)),onReplace:o=>l(K(o)),onOpenModal:(o,s)=>l(Q(o,s))}),Ee=N(de,ce)(re);export{Ee as default};
1
+ var f=Object.defineProperty;var R=(l,o,s)=>o in l?f(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s;var x=(l,o,s)=>R(l,typeof o!="symbol"?o+"":o,s);import{D as g,K as m,H as e,aZ as B,M as t,N,a_ as O,bQ as z,bR as H,aA as P,bB as _,bS as A,bT as F,bI as j,bU as C,G as a,bM as $,bA as X,bC as E,bV as Y,bW as W,bX as U,bY as V,bZ as J,b_ as Z,aW as G,b$ as K,X as Q}from"./index-fMUqgf16.js";import{L as q}from"./LandProviderPage-D1wx3XFJ.js";import{B as ee}from"./Back-DgKAoQIH.js";import{J as se}from"./JumpIn.container-CKS-_CwV.js";import{R as te}from"./RentalPeriod-D9qOXo3H.js";import{S as oe}from"./SceneStats.container-B8wBXy4f.js";import"./NotFound-B3qud5sl.js";import"./index-C5WJ431i.js";import"./date-e3l4KRXn.js";let ie=class extends g.PureComponent{constructor(){super(...arguments);x(this,"handleOnClick",()=>{const{isLoading:s,history:i}=this.props;s&&i.push(m.activity())})}render(){const{ens:s,isLoading:i,onIconClick:n}=this.props;return e.jsx(B,{className:"ENSChip",text:i?e.jsxs(e.Fragment,{children:[s.subdomain,e.jsx(t.Loader,{active:!0,size:"tiny"})]}):s.subdomain,isActive:i,icon:i?"":"minus",onClick:this.handleOnClick,onIconClick:n})}};const ne=(l,o)=>{const{ens:s}=o;return{isLoading:z(l)[s.subdomain]||H(l)[s.subdomain]}},le=N(ne)(O(ie)),ae=l=>{const{deployment:o,onMouseEnter:s,onMouseLeave:i,onNavigate:n,onOpenModal:u,projects:c,disabled:r}=l,d=o.projectId&&o.projectId in c?c[o.projectId]:null,p=g.useCallback(()=>{r||s(o)},[s,r,o]),h=g.useCallback(()=>{r||i(o)},[i,r,o]),v=g.useCallback(()=>{d&&!r&&n(m.sceneDetail(d.id))},[n,d,r]),S=g.useCallback(()=>{u("DeployModal",{view:P.CLEAR_DEPLOYMENT,deploymentId:o.id})},[u,o]);return e.jsxs("div",{className:`Scene ${d&&!r?"clickable":""}`,onClick:v,onMouseEnter:p,onMouseLeave:h,children:[o.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${o.thumbnail})`}}):e.jsx("div",{className:"no-thumbnail"}),e.jsxs("div",{className:"stat",children:[e.jsx("div",{className:"title",title:o.name,children:o.name}),o.layout?e.jsxs("div",{className:"secondary-text",children:[o.layout.rows,"x",o.layout.cols]}):null]}),e.jsx(oe,{deployment:o}),e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,disabled:r,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:"Unpublish",onClick:S})})})]})},L=({children:l,land:o})=>{const s=g.Children.map(l,i=>g.isValidElement(i)?g.cloneElement(i,{disabled:o.roles.includes(j.LESSOR)}):i);return e.jsx(t.Popup,{content:a("land_detail_page.land_is_locked"),position:"top left",disabled:!o.roles.includes(j.LESSOR),trigger:e.jsx("span",{children:s})})};let re=class extends g.PureComponent{constructor(){super(...arguments);x(this,"state",{hovered:null,mouseX:0,mouseY:0,showTooltip:!1});x(this,"handleMouseEnter",s=>{this.setState({hovered:s,showTooltip:!1})});x(this,"handleMouseLeave",()=>{this.setState({hovered:null,showTooltip:!1})});x(this,"handleMouseMove",s=>{this.setState({mouseX:s.clientX,mouseY:s.clientY})});x(this,"handleHover",s=>(i,n)=>{const{deploymentsByCoord:u}=this.props,c=u[_(i,n)];c&&s.some(r=>r.id===c.id)?this.setState({hovered:c,showTooltip:!0}):this.setState({hovered:null,showTooltip:!1})});x(this,"handleClick",(s,i)=>{const{deploymentsByCoord:n,projects:u,onNavigate:c,onReplace:r,landTiles:d}=this.props,p=_(s,i),h=n[p];h&&h.projectId&&h.projectId in u?c(m.sceneDetail(h.projectId)):p in d&&r(m.landDetail(d[p].land.id))});x(this,"isHovered",(s,i)=>{const{deploymentsByCoord:n}=this.props,{hovered:u}=this.state,c=_(s,i),r=n[c];return!!r&&!!u&&u.id===r.id});x(this,"getHoverStrokeLayer",s=>(i,n)=>this.isHovered(i,n)?{color:A[s.role],scale:1.4}:null);x(this,"getHoverFillLayer",s=>(i,n)=>this.isHovered(i,n)?{color:F[s.role],scale:1.2}:null)}computeOccupiedLand(s,i){const{landTiles:n}=this.props;return i.reduce((c,r)=>c+r.parcels.filter(d=>{const p=n[d];return!!p&&p.land.id===s.id}).length,0)}renderDetail(s,i,n){const{ensList:u,parcelsAvailableToBuildEstates:c,projects:r,onNavigate:d,onOpenModal:p}=this.props,{hovered:h,mouseX:v,mouseY:S,showTooltip:y}=this.state,D=this.computeOccupiedLand(s,i),w=n&&(s.roles.includes(j.LESSOR)||s.roles.includes(j.TENANT))?n.lessor:s.owner,M=s.roles.includes(j.LESSOR),k=c[s.id],T=y&&h&&h.projectId&&h.projectId in r;return e.jsxs(e.Fragment,{children:[h&&y?e.jsxs("div",{className:"tooltip",style:{top:S,left:v},children:[h.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${h.thumbnail})`}}):null,e.jsx("div",{className:"name",children:h.name})]}):null,e.jsx(t.Section,{size:"large",children:e.jsxs(t.Row,{children:[e.jsx(ee,{absolute:!0,onClick:()=>d(m.land())}),e.jsx(t.Narrow,{children:e.jsxs(t.Row,{children:[e.jsx(t.Column,{children:e.jsxs(t.Row,{children:[e.jsx(t.Header,{size:"huge",children:s.name}),s.type===C.PARCEL?e.jsx(e.Fragment,{children:e.jsxs(t.Badge,{color:"#37333D",children:[e.jsx("i",{className:"pin"}),s.id]})}):e.jsxs(t.Badge,{color:"#37333D",children:[s.size," LAND"]}),e.jsx(se,{land:s})]})}),s.role===j.OWNER||s.role===j.LESSOR?e.jsx(t.Column,{className:"actions",align:"right",children:e.jsxs(t.Row,{children:[e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landTransfer(s.id)),children:a("land_detail_page.transfer")})}),e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landEdit(s.id)),children:a("global.edit")})}),e.jsx(L,{land:s,children:e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[k?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.build_estate"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.add_or_remove_parcels"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.dissolve_estate"),onClick:()=>p("DissolveModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.assign_name"),onClick:()=>d(m.landSelectENS(s.id))}),e.jsx(t.Dropdown.Divider,{})]}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})]})})})]})}):s.roles.includes(j.TENANT)&&n&&!$(n)?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})})}):null]})})]})}),e.jsxs(t.Narrow,{children:[e.jsx(t.Section,{size:"large",children:e.jsx("div",{className:`atlas-wrapper ${T?"clickable":""}`,onMouseLeave:this.handleMouseLeave,onMouseMove:this.handleMouseMove,children:e.jsx(X,{landId:s.id,layers:[this.getHoverStrokeLayer(s),this.getHoverFillLayer(s)],isDraggable:!0,zoom:s.size&&s.size>=1e3?.5:1,onHover:this.handleHover(i),onClick:this.handleClick})})}),e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.online_scenes")}),i.length===0?e.jsx(t.Empty,{height:100,children:a("global.none")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"deployments",children:i.map(b=>e.jsx(ae,{disabled:M,deployment:b,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onNavigate:d,onOpenModal:p,projects:r},b.id))}),e.jsx("div",{className:"notice",children:a("analytics.notice")})]})]}),u.length>0?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:e.jsx(t.Row,{children:e.jsx(t.Column,{children:a("land_detail_page.assigned_names")})})}),e.jsx("div",{className:"ens-list",children:u.map(b=>e.jsx(le,{ens:b,onIconClick:()=>p("UnsetENSContentModal",{ens:b,land:s})},b.subdomain))})]}):null,s.description?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.description")}),e.jsx("p",{children:s.description})]}):null,e.jsxs(t.Section,{className:"data",children:[e.jsxs(t.Stats,{title:a("global.role"),className:"role",children:[e.jsx(t.Header,{children:a(`roles.${s.role}`)}),n?e.jsx(te,{land:s,rental:n}):null]}),e.jsx(t.Stats,{title:a("land_detail_page.owner"),children:e.jsx(E,{address:w,size:"large"})}),n&&s.roles.includes(j.LESSOR)?e.jsx(t.Stats,{title:a("land_detail_page.tenant"),children:e.jsx(E,{address:n.tenant,size:"large"})}):null,s.operators.length>0?e.jsx(t.Stats,{title:a("land_detail_page.operated_by"),className:"operators",children:e.jsx(t.Row,{children:s.operators.map((b,I)=>e.jsx(E,{address:b,size:"large"},I))})}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Stats,{title:a("land_detail_page.total_land"),children:e.jsx(t.Header,{children:s.size})}),e.jsx(t.Stats,{title:a("land_detail_page.empty_land"),children:e.jsx(t.Header,{children:s.size-D})})]}):null]})]})]})}render(){return e.jsx(q,{className:"LandDetailPage",children:(s,{deployments:i,rental:n})=>this.renderDetail(s,i,n)})}};const de=l=>{const o=Y(l)||"";return{ensList:W(l,o),parcelsAvailableToBuildEstates:U(l),deploymentsByCoord:V(l),landTiles:J(l),projects:Z(l)}},ce=l=>({onNavigate:o=>l(G(o)),onReplace:o=>l(K(o)),onOpenModal:(o,s)=>l(Q(o,s))}),Ee=N(de,ce)(re);export{Ee as default};