@dcl/builder-site 7.16.0 → 7.16.1-19644308472.commit-c4256dc

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 (86) hide show
  1. package/assets/{Back-D94RsYQI.js → Back-CDOxIrnn.js} +1 -1
  2. package/assets/{CollectionProvider.container-B6B7jeBx.js → CollectionProvider.container-3333NUxE.js} +1 -1
  3. package/assets/{CollectionStatus.container-CmB5tcfq.js → CollectionStatus.container-DzhTjeP9.js} +1 -1
  4. package/assets/{ConfirmDelete-DmmVVAp0.js → ConfirmDelete-Bi0mUMu0.js} +1 -1
  5. package/assets/{FileSaver.min-C38aG5Wv.js → FileSaver.min-CZvv48fT.js} +1 -1
  6. package/assets/{ItemProvider.container-C3ASCRbL.js → ItemProvider.container-7qkDLYej.js} +2 -2
  7. package/assets/{JumpIn.container-DNWn05IB.js → JumpIn.container-Db9sy8sq.js} +1 -1
  8. package/assets/{LandAction-DhmPYdL8.js → LandAction-CiY0RweX.js} +1 -1
  9. package/assets/{LandProviderPage-D2JQ3F7v.js → LandProviderPage-DMoeh5ZK.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-D3YwBYzF.js → LoggedInDetailPage.container-C9GSQhch.js} +1 -1
  11. package/assets/{Navigation-C34bp3Mt.css → Navigation-CV4Ecri2.css} +1 -1
  12. package/assets/{Navigation.container-Bvr99qLy.js → Navigation.container-DdDz8aQR.js} +1 -1
  13. package/assets/{NotFound-mNWy5xM3.js → NotFound-BxsG7cuR.js} +1 -1
  14. package/assets/{OptionsDropdown-DEuKM56F.js → OptionsDropdown-DdF7xSCX.js} +1 -1
  15. package/assets/{RentalPeriod-D_beCQN0.js → RentalPeriod-DgXK5WFQ.js} +1 -1
  16. package/assets/{SDKTag-26bb1MRo.js → SDKTag-ChEtvoIS.js} +1 -1
  17. package/assets/{SceneStats.container-BzjcXk6l.js → SceneStats.container-ZJOdavL5.js} +1 -1
  18. package/assets/{SignInRequired-NQYfoxmv.js → SignInRequired-DmF9Qp0Q.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-Be0Ad4fF.js → ThirdPartyKindBadge-BA3-jy7a.js} +1 -1
  20. package/assets/{dataReader-BNRTZZiJ.js → dataReader-DAefHot9.js} +1 -1
  21. package/assets/{date-C9ArxA_e.js → date-XnshaYAj.js} +1 -1
  22. package/assets/{fortmatic-DGqcSaN2.js → fortmatic-Bxn9btu4.js} +1 -1
  23. package/assets/{hooks-BBT2z0gO.js → hooks-BR9ATp8C.js} +1 -1
  24. package/assets/{index-jRpvNFmH.js → index-1qhlYVJo.js} +1 -1
  25. package/assets/index-8nDAcs6q.js +1 -0
  26. package/assets/{index-Zh552Wzc.js → index-B6z24HhG.js} +1 -1
  27. package/assets/{index-Dnz1DwyM.js → index-B7JMFszx.js} +1 -1
  28. package/assets/{index-UYYEhvXh.js → index-BBxq5T5O.js} +1 -1
  29. package/assets/{index-WzZM31bL.js → index-BCXSooAS.js} +1 -1
  30. package/assets/{index-DmeQdYL_.js → index-BDqGuP6d.js} +1 -1
  31. package/assets/{index-DN6zeLPW.js → index-BNWfs07B.js} +1 -1
  32. package/assets/{index-YAqkouTP.js → index-BQKKZYid.js} +1 -1
  33. package/assets/{index-BJF4F6E2.js → index-BZVd6DXW.js} +1 -1
  34. package/assets/{index-CHW3a1d8.css → index-BdXvBSq9.css} +7 -7
  35. package/assets/{index-DDKLiU5I.js → index-Bg3kbxT6.js} +1 -1
  36. package/assets/{index-iqc2hUgY.js → index-BgAj-Cjh.js} +1 -1
  37. package/assets/{index-wJpnjryc.js → index-BhcZNLcf.js} +1 -1
  38. package/assets/index-Biexqjwx.css +1 -0
  39. package/assets/index-C71GMpBg.css +1 -0
  40. package/assets/{index-DV-S_Vo4.js → index-CAEFSp6T.js} +1 -1
  41. package/assets/{index-Dal8DaD9.js → index-CDypNyWX.js} +1 -1
  42. package/assets/index-CIJ-Apwv.js +1 -0
  43. package/assets/{index--dRbXcCy.js → index-CJe-sWhe.js} +1 -1
  44. package/assets/{index-BWehEcif.js → index-CLws8iD9.js} +1 -1
  45. package/assets/index-CTHhGxUn.js +1 -0
  46. package/assets/{index-DdbnxO3S.css → index-CUpuV6SS.css} +1 -1
  47. package/assets/{index-hi-6PNHv.js → index-CYwns7My.js} +1 -1
  48. package/assets/{index-BspQeoNu.js → index-CmdFvF1a.js} +1 -1
  49. package/assets/{index-dORSrkG_.js → index-D3CkOUIz.js} +1 -1
  50. package/assets/{index-C3s6sasx.js → index-D7MNQUVi.js} +1 -1
  51. package/assets/index-DDJJ4aT_.css +1 -0
  52. package/assets/{index-BpSWUH3N.js → index-DDLQh72H.js} +22 -22
  53. package/assets/{index-ZYJx20me.js → index-DTyOeuDD.js} +1 -1
  54. package/assets/{index-Dj7mQiFF.js → index-D_KoEYmR.js} +1 -1
  55. package/assets/{index-wJdvWbwQ.js → index-DfkdTSnc.js} +1 -1
  56. package/assets/{index-C4HHYdhM.js → index-DhbZhfsJ.js} +1 -1
  57. package/assets/{index-BYp2WENw.js → index-DhhNoSjU.js} +1 -1
  58. package/assets/{index-DybHUI1B.css → index-Dje7cGpR.css} +1 -1
  59. package/assets/{index-kotSpI1A.js → index-Dlnzy_Ws.js} +1 -1
  60. package/assets/{index-BqzYHGMh.js → index-Dmtoehcg.js} +1 -1
  61. package/assets/{index-By6X_sWo.js → index-Dr1aQrkO.js} +1 -1
  62. package/assets/{index-B1GtOexf.css → index-DtoAxbrz.css} +1 -1
  63. package/assets/{index-CvYXhhW4.js → index-DxDsw9f1.js} +1 -1
  64. package/assets/index-Fo4geG3i.css +1 -0
  65. package/assets/{index-BTGNYpgk.js → index-HyBfIc0E.js} +1 -1
  66. package/assets/{index--jj2eEdN.js → index-KdMkTi9U.js} +1 -1
  67. package/assets/{index-hHyn87hK.js → index-TCqfus0x.js} +1 -1
  68. package/assets/{index-D-omXGcm.js → index-Tn0fe1c8.js} +1 -1
  69. package/assets/index-VqI7gByO.js +2 -0
  70. package/assets/{index-CgalNfsG.js → index-Y7uEsaMN.js} +1 -1
  71. package/assets/{index-lVsZiQbZ.js → index-bgQz0P48.js} +1 -1
  72. package/assets/index-dkUDE4T4.js +1 -0
  73. package/assets/{index-BIQTKV6z.js → index-s-JRPuW3.js} +1 -1
  74. package/assets/{index.es-CZG9hSjz.js → index.es-DjPcoY42.js} +4 -4
  75. package/assets/{selectors-Hr22Peqo.js → selectors-BFWzed6x.js} +1 -1
  76. package/index.html +3 -3
  77. package/package.json +3 -3
  78. package/assets/index-BiiQf61S.css +0 -1
  79. package/assets/index-Blc255Kh.js +0 -1
  80. package/assets/index-BpxsDhC6.css +0 -1
  81. package/assets/index-BwKOgET4.js +0 -2
  82. package/assets/index-CWBtF0Bm.css +0 -1
  83. package/assets/index-DDGKUpl1.js +0 -1
  84. package/assets/index-D_n7A5EP.css +0 -1
  85. package/assets/index-DgjHmPjs.js +0 -1
  86. package/assets/index-wgtjB6lV.js +0 -1
@@ -1 +1 @@
1
- var _t=Object.defineProperty;var xt=(o,m,e)=>m in o?_t(o,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[m]=e;var c=(o,m,e)=>xt(o,typeof m!="symbol"?m+"":m,e);import{ak as ae,N as t,S as h,M as r,b6 as Q,bQ as Et,J as b,gB as oe,Q as re,R as $,cq as Xe,aR as f,T as Ze,bq as X,gC as vt,eM as jt,gD as St,gE as ft,gF as yt,gG as At,gH as wt,gI as Tt,gJ as Pt,gK as Nt,gL as q,eA as Rt,gM as ie,gN as Fe,aa as de,a4 as Ae,ab as _,aM as ce,gO as Mt,dl as we,bd as et,fl as Te,fB as Dt,g2 as Ot,g3 as Lt,eJ as Ee,gu as kt,gP as Bt,gQ as Ft,g5 as Wt,eN as tt,gR as Ht,gS as Vt,gT as $t,gU as Ut,fw as Gt,g4 as Yt,g6 as zt,b1 as Pe,gV as qt,gW as Jt,e$ as We,bR as Kt,aj as Qt,eQ as Ne,gX as st,a2 as at,eD as Xt,ey as nt,fO as le,dN as ve,ez as Zt,f2 as je,gY as it,b4 as Re,g1 as ot,f5 as B,eB as se,fK as lt,fL as Se,P as G,fg as fe,dM as es,eZ as ts,ft as ss,gZ as as,g_ as rt,g$ as dt,h0 as ct,fk as Me,eK as ns,h1 as is,h2 as os,fS as ht,eT as ls,eS as mt,eU as rs,eW as ds,eX as cs,h3 as hs,h4 as ms,h5 as ps,h6 as He,h7 as be,h8 as gs,en as us,h9 as Cs,ha as Is,hb as bs,hc as _s,hd as xs,he as Es,hf as vs,hg as js,hh as Ss,hi as fs,hj as ys,hk as As,fu as ws,hl as Ts,hm as Ps,hn as Ns,ho as Rs,hp as Ms,hq as Ds,hr as Os,hs as Ls,g7 as ks,a7 as Bs,b$ as Ce,ht as Fs,hu as Ve,hv as Ws,hw as Hs,f1 as $e,fP as _e,hx as U,f0 as Vs,eY as Ue,f3 as $s,f4 as Ge,f6 as Ye,f7 as ze,hy as qe,hz as Us,hA as Gs,hB as Ys,hC as zs,f8 as qs,f9 as Je,fa as Ke,hD as Js,fj as Ks,hE as Qs,hF as Xs,hG as Zs,hH as pt,hI as ea,hJ as ta,hK as sa,hL as aa,hM as Qe,hN as na,hO as ia,hP as oa,eP as la,hQ as ra,fn as da,fm as ca,fp as ha,hR as ma}from"./index-BpSWUH3N.js";import{g as Ie,h as De,i as Oe}from"./hooks-BBT2z0gO.js";import{J as pa}from"./JumpIn.container-DNWn05IB.js";import{C as ga}from"./CollectionProvider.container-B6B7jeBx.js";import{C as gt}from"./ConfirmDelete-DmmVVAp0.js";import{C as ut}from"./CollectionStatus.container-CmB5tcfq.js";import{d as ua,e as Ca,c as Ia}from"./selectors-Hr22Peqo.js";import{I as ba}from"./ItemProvider.container-C3ASCRbL.js";const _a=({open:o,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(h.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:o,children:[t.jsx(h.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(Et,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:s,children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),xa=ae.memo(_a);var L=(o=>(o.REJECT_COLLECTION="REJECT_COLLECTION",o.REJECT_CURATION="REJECT_CURATION",o.DISABLE_COLLECTION="DISABLE_COLLECTION",o.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",o))(L||{});const J="item_editor.top_panel.rejection_modal",Ea=({open:o,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:i,curation:l,onReject:d,onRejectCuration:p,onClose:g})=>{const x=b.useMemo(()=>{switch(m){case L.DISABLE_COLLECTION:return J+".disable_collection";case L.REJECT_CURATION:return J+".reject_curation";case L.DISABLE_THIRD_PARTY:return J+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case L.DISABLE_COLLECTION:d(i);break;case L.REJECT_CURATION:p(l.collectionId);break;case L.DISABLE_THIRD_PARTY:s&&n(s.id);break}},A=m===L.DISABLE_COLLECTION&&!i.isApproved||m===L.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===L.REJECT_COLLECTION&&!i.isApproved||m===L.REJECT_CURATION&&(l==null?void 0:l.status)===oe.REJECTED;return t.jsx(h.Modal,{size:"tiny",className:"RejectionModal",open:o,children:a?t.jsx(va,{i18nKey:x}):A?t.jsx(ja,{link:i.forumLink,onClose:g}):t.jsx(Sa,{i18nKey:x,isLoading:e,onClose:g,onConfirm:w})})},va=({i18nKey:o})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${o}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx(Q,{id:J+".visit_activity",values:{activity_link:t.jsx(re,{to:$.activity(),children:r("global.activity")})}})}),t.jsx(h.Loader,{active:!0,size:"large"})]})]}),ja=({link:o,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(J+".veredict_explanation")}),t.jsx(h.Modal.Content,{children:r(J+".go_to_forum")}),t.jsxs(h.Modal.Actions,{children:[t.jsx("a",{href:o,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(h.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(J+".forum_link")}),t.jsx("div",{className:"discussion",children:r(J+".discussion")}),t.jsx(h.Icon,{name:"chevron right"})]})}),t.jsx(h.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),Sa=({i18nKey:o,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsx(h.Modal.Content,{children:r(`${o}.subtitle`)}),t.jsxs(h.Modal.Actions,{children:[t.jsx(Xe,{primary:!0,onClick:e,disabled:m,loading:m,network:f.Network.MATIC,children:r(`${o}.action`)}),t.jsx(h.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),fa=ae.memo(Ea),ya=(o,m)=>({isLoading:X(jt(o),vt)||X(ft(o),St)||yt(o),hasPendingTransaction:At(o)||!!(m.thirdParty&&wt(o,m.thirdParty.id))}),Aa=o=>({onReject:m=>o(Tt(m)),onRejectCuration:m=>o(Pt(m)),onDisableThirdParty:m=>o(Nt(m))}),wa=Ze(ya,Aa)(fa);var P=(o=>(o[o.APPROVE=0]="APPROVE",o[o.REJECT=1]="REJECT",o[o.ENABLE=2]="ENABLE",o[o.DISABLE=3]="DISABLE",o[o.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",o))(P||{});let Ta=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push($.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:i,onSetAssignee:l}=this.props;this.setState({showApproveConfirmModal:!1}),a&&l(e.id,a,s),q(e)?i(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:i,thirdParty:l}=this.props,{showRejectionModal:d,showApproveConfirmModal:p}=this.state,{chainId:g}=this.props,x=Rt(e);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"actions",children:t.jsx("div",{className:"back",onClick:this.handleBack})}),t.jsxs("div",{className:"title",children:[e.name," · ",r(`collection.type.${x}`),t.jsx(pa,{size:"small",active:!0,collection:e,chainId:g,items:q(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:q(e)&&i!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),d&&t.jsx(wa,{type:d,open:!0,collection:e,curation:n,thirdParty:l,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&p&&t.jsx(xa,{open:!0,assignee:n.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,n),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});c(this,"renderButton",(e,s,a)=>{const{address:n,thirdParty:i,onInitiateApprovalFlow:l,onInitiateTPApprovalFlow:d,onDeployMissingEntities:p,reviewedItems:g,totalItems:x}=this.props,w={[P.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):q(s)?d(s):l(s),[P.ENABLE]:()=>l(s),[P.DISABLE]:()=>this.setShowRejectionModal(i?L.DISABLE_THIRD_PARTY:L.DISABLE_COLLECTION),[P.REJECT]:()=>{(a==null?void 0:a.status)===oe.PENDING?this.setShowRejectionModal(L.REJECT_CURATION):this.setShowRejectionModal(L.REJECT_COLLECTION)},[P.DEPLOY_MISSING_ENTITIES]:()=>p(s)},A={[P.APPROVE]:"approve",[P.ENABLE]:"enable",[P.DISABLE]:"disable",[P.REJECT]:"reject",[P.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===P.APPROVE||e===P.ENABLE||e===P.DEPLOY_MISSING_ENTITIES,I=!q(s)||!!x&&g.length>=ie(x);return t.jsx(h.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:I,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(h.Button,{primary:j,onClick:()=>w[e](),disabled:q(s)&&e===P.APPROVE&&!!x&&g.length<ie(x),children:r(`item_editor.top_panel.${A[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:i,thirdParty:l}=this.props,d=a==null?void 0:a.some(p=>p.status===oe.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(h.Header,{sub:!0,children:[d?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:ie(i)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=ie(i)?t.jsx(h.Icon,{name:"check circle"}):null]}),d&&this.renderButton(P.APPROVE,e,s),d&&this.renderButton(P.REJECT,e,s),!d&&(l==null?void 0:l.isApproved)&&this.renderButton(P.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)?this.renderButton(P.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:i,isLoading:l}=this.props,d=!e||l&&!s.length;return a&&n&&i?t.jsx("div",{className:"TopPanel",children:d?t.jsx(h.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const Pa=({reviewedItems:o})=>{const m=de(),e=Ae(),s=Ie(),a=De(),n=_(ce),i=_(Mt),l=_(we),d=_(et),p=_(C=>s?Te(C,s):null),g=_(C=>p?Dt(C,p.id):[]),x=_(C=>p?Ot(C,p.id):[]),w=_(C=>s?Lt(C,s):null),A=_(C=>s?Ee(C,s):void 0),j=_(C=>p&&q(p)?kt(C,p):null),I=_(C=>s?Bt(C,s):!1),y=_(C=>X(Ft(C),Gt)||X(Wt(C),Yt)||X(tt(C),zt)),N=b.useCallback((C,E,R)=>{m(Ht(C,E,R))},[m]),D=b.useCallback(C=>{m(Vt(C))},[m]),T=b.useCallback(C=>{m($t(C))},[m]),u=b.useCallback(C=>{m(Ut(C))},[m]);return t.jsx(Ta,{address:n,items:g,totalItems:(A==null?void 0:A.total)||null,collection:p,itemCurations:x,thirdParty:j,curation:w,chainId:i,isConnected:l,isReviewing:a,isCommitteeMember:d,selectedCollectionId:s,hasCollectionMissingEntities:I,isLoading:y,reviewedItems:o,onSetAssignee:N,onInitiateTPApprovalFlow:D,onInitiateApprovalFlow:T,onDeployMissingEntities:u,history:e})},Na=Pa,Ct=()=>{const{search:o}=Pe();return _(e=>qt(e,o))},Ra="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",Ma=o=>{const{collectionId:m}=o,[e,s]=b.useState(!1),[a,n]=b.useState(null),i=Ae(),l=Pe(),d=b.useMemo(()=>Jt(l.search),[l.search]);b.useEffect(()=>{d&&(s(!0),n(d))},[d]);function p(){s(!1);const g=new URLSearchParams(l.search);g.delete("newItem"),i.replace({search:g.toString()})}return e&&a&&m?t.jsx(h.Toast,{type:h.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:Ra,alt:r("sagas.item.item_added_toast.title")})}),onClose:p,body:t.jsx(Q,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:g=>t.jsx("strong",{children:g}),"collection-link":g=>t.jsx(re,{to:$.collectionDetail(m),children:t.jsx(h.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:g})})}})}):null},Da=ae.memo(Ma),Oa=({collection:o,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:i})=>{var u,C;const l=Pe(),d=Ae(),p=((u=l.state)==null?void 0:u.fromParam)===We.COLLECTIONS,g=((C=l.state)==null?void 0:C.fromParam)===We.TP_COLLECTIONS,x=b.useCallback(()=>{d.push($.collections())},[d]),w=b.useCallback(()=>{if(o&&(p||g)){const E=p?$.collectionDetail:$.thirdPartyCollectionDetail;d.push(E(o.id))}else d.push($.itemEditor())},[p,g,d,o]),A=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{o&&n("CreateSingleItemModal",{collectionId:o.id})},[o,n]),I=b.useCallback(()=>{o&&n("AddExistingItemModal",{collectionId:o.id})},[o,n]),y=b.useCallback(()=>{o&&n("EditCollectionNameModal",{collection:o})},[o,n]),N=b.useCallback(()=>{o&&i(o)},[o,i]),D=b.useCallback(()=>{const E=o&&Kt(o.owner,m||"");return o?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${p||g?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(re,{to:$.collectionDetail(o.id),children:o.name}),t.jsx(ut,{collection:o})]}),E&&!o.isPublished?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[t.jsx(h.Dropdown.Item,{onClick:y,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(h.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(h.Dropdown.Item,{onClick:I,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(gt,{name:o.name,onDelete:N,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[o,m,e,p,g]),T=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:x}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(h.Dropdown.Menu,{children:t.jsx(h.Dropdown.Item,{onClick:A,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(h.Row,{grow:!1,shrink:!1,className:"Header",children:o?D():T()})},La=()=>{const o=Ie();return _(m=>o?Te(m,o):null)},ka=()=>{const o=de(),m=_(ce),e=_(Qt),s=De(),a=_(Ne),n=La(),i=_(g=>!!(n&&m&&st(g,m,n))),l=b.useCallback((g,x)=>o(at(g,x)),[o]),d=b.useCallback(g=>o(Xt(g)),[o]),p=b.useCallback(g=>o(nt(g)),[o]);return t.jsx(Oa,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:l,onDeleteCollection:d,onDeleteItem:p,hasEditRights:i,hasUserOrphanItems:a})},V=10;class H extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:n?s:null})]})}}class Ba extends b.PureComponent{constructor(){super(...arguments);c(this,"handleClick",()=>{const{item:e,onClick:s}=this.props;s(e)})}renderToggleItem(){const{item:e,isVisible:s,isPlayingEmote:a}=this.props;return le(e)?t.jsx(h.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(ve,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Zt,{item:e}),e.name]}),t.jsx(h.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${je(e)}`).toLowerCase()})}),disabled:it(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var M=(o=>(o.TO_REVIEW="to-review",o.REVIEWED="reviewed",o.ALL_ITEMS="all-items",o))(M||{});const Fa={[M.TO_REVIEW]:1,[M.REVIEWED]:1,[M.ALL_ITEMS]:1};class Wa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:M.TO_REVIEW,currentPages:Fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Re());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===M.TO_REVIEW&&!ot(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var p;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:i,onSetItems:l}=this.props;if(!it(e,s))return;let d=a.filter(g=>g.id!==e.id);if(le(e))if(this.isVisible(e)){i?n==null||n.emote.pause():n==null||n.emote.play();return}else d=d.filter(g=>g.type!==B.EMOTE);this.isVisible(e)||(d.push(e),(p=this.analytics)==null||p.track("Preview Item",{ITEM_ID:e!=null&&e.urn?se(e.urn)?lt(e.urn):Se(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:se(e.urn)})),l(d)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:i}=this.state;e===M.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(i[M.ALL_ITEMS])}):e===M.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(i=>({currentPages:{...i.currentPages,[a]:+s.activePage}})),a!==M.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(M.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?se(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:i}=this.props;return t.jsx(Ba,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:i,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(fe),a=e.filter(le);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(H,{label:this.renderCollapsableLabel(B.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(H,{label:this.renderCollapsableLabel(B.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],i=Math.ceil(e/V);return i>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:i,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],i=(n-1)*V,l=n*V;return t.jsx(h.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:i,pageEnd:l>e?e:l,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:i,currentPages:l}=this.state,d=this.getIsReviewingTPItems(),p=l[i];if(s)return t.jsx(h.Loader,{size:"large",active:!0});switch(i){case M.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!d&&a?this.renderTabPagination(a):null]});case M.REVIEWED:{const g=n.slice((p-1)*V,p*V);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(g),n.length?this.renderTabPagination(n.length):null]})}case M.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let i;const l=!s||s<V||a.length===s;switch(n){case M.TO_REVIEW:i=t.jsx(h.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!l,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(h.Button,{disabled:e||l,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(h.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case M.REVIEWED:i=t.jsx(Q,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:ie(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",i," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(h.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx(Q,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:M.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(h.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(h.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(h.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:()=>this.handleTabChange(M.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:e===M.TO_REVIEW,onClick:()=>this.handleTabChange(M.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(h.Tabs.Tab,{active:e===M.REVIEWED,onClick:()=>this.handleTabChange(M.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(h.Tabs.Tab,{active:e===M.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(G,{name:e}),t.jsx(Q,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(h.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class Ha extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({collectionId:m.id}),children:[t.jsx(es,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(ut,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class Va extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentPage:1});c(this,"handlePageChange",(e,s)=>{const{onLoadPage:a}=this.props;this.setState({currentPage:+s.activePage}),a(+s.activePage)})}render(){const{collections:e,isLoading:s,items:a,selectedCollectionId:n,totalCollections:i}=this.props,{currentPage:l}=this.state;if(e.length===0)return null;const d=Math.ceil(i/V);return s?t.jsx(h.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(h.Section,{className:"Collections",children:[e.map(p=>t.jsx(Ha,{collection:p,items:a,isSelected:p.id===n},p.id)),d>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:d,activePage:l,onPageChange:this.handlePageChange}):null]})})}}var te=(o=>(o.COLLECTIONS="collections",o.ORPHAN_ITEMS="orphanItems",o))(te||{});const ee=1;let $a=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",this.getInitialState());c(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});c(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:n,selectedCollectionId:i}=this.props,{pages:l}=this.state;if(e&&!n&&!i){const d=l[l.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:V,page:d})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:i}=this.props,l=this.isCollectionTabActive()?n:a,d=Math.ceil(l/V);if(d>s.length){const p=[...Array(d).keys()].map(g=>g+1).filter(g=>!s.includes(g));if(p.length>0){const g=p[Math.floor(Math.random()*p.length)];this.setState(x=>({pages:[...x.pages,g]}),this.fetchResource)}}i(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[ee]},this.fetchResource)});c(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===te.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=te.COLLECTIONS;return!e&&s&&(a=te.ORPHAN_ITEMS),{pages:[ee],currentTab:a,initialPage:ee,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:i}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&i([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:i,selectedItemId:l,selectedItem:d,orphanItems:p,totalItems:g,visibleItems:x,hasUserOrphanItems:w,onSetItems:A,onFetchOrphanItem:j}=this.props,{initialPage:I,pages:y}=this.state;if(!i&&n&&l&&g&&(I===ee||s.initialPage<I)){if(!p.find(N=>N.id===l)){const N=Math.ceil(g/V),D=y[y.length-1],T=Math.min(N,D+1);y.includes(T)||this.setState({pages:[T],initialPage:T},this.fetchResource)}}else if(e.selectedItemId&&l&&e.selectedItemId!==l){const N=x.filter(D=>D.type!==B.EMOTE);A(N)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!i)&&this.setState({pages:[ee]},this.fetchResource),e.selectedCollectionId!==i&&this.setState({pages:[ee]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&d&&d.type!==B.EMOTE&&A([d]),e.selectedCollectionId!==i&&A([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:i,isReviewing:l}=this.props;return n&&e?ts(e)&&l?s.filter(d=>!!(a!=null&&a.find(p=>p.itemId===d.id&&p.status===oe.PENDING))):s:i}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:i,selectedCollectionId:l,visibleItems:d,bodyShape:p,reviewedItems:g,isReviewing:x,isPlayingEmote:w,isConnected:A,wearableController:j,isLoading:I,hasUserOrphanItems:y,onSetItems:N,onSetReviewedItems:D,onResetReviewedItems:T}=this.props,{pages:u,showSamplesModalAgain:C}=this.state,E=!l&&y,R=this.isCollectionTabActive()&&!l,S=!this.isCollectionTabActive()||l;return t.jsx("div",{className:"LeftPanel",children:A?t.jsx(ga,{id:l,itemSelected:i,itemsPage:u,itemsPageSize:V,fetchCollectionItemsOptions:{status:x?oe.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:F,paginatedItems:Z,initialPage:he,isLoadingCollection:me,isLoadingCollectionItems:pe,itemCurations:ge})=>{const Y=this.getItems(F,Z,ge),ne=this.isCollectionTabActive(),O=l&&F?he:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(ka,{}),E?t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:ne,onClick:()=>this.handleTabChange(te.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(h.Tabs.Tab,{active:!ne,onClick:()=>this.handleTabChange(te.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,R?t.jsx(Va,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Y.length>0,selectedCollectionId:l,onLoadPage:this.loadPage,isLoading:me}):null,S?t.jsxs(t.Fragment,{children:[t.jsx(Wa,{items:Y,totalItems:s||Y.length,hasHeader:!l&&n.length>0,selectedItemId:i,collection:F,isReviewing:x,isPlayingEmote:w,visibleItems:d,bodyShape:p,onResetReviewedItems:T,reviewedItems:g,onSetItems:N,wearableController:j,initialPage:O,isLoading:pe||I,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:C,onReviewItems:()=>D(Y),onLoadRandomPage:()=>this.loadRandomPage(Y),onLoadPage:this.loadPage}),t.jsx(Da,{collectionId:l})]}):null]})}}):null})}};const Ua=o=>{const m=de(),e=Ie(),s=Oe(),a=De(),n=Ct(),i=_(S=>ce(S)),l=_(S=>we(S)),d=_(S=>ss(S)),p=_(S=>as(S)),g=_(S=>rt(S)),x=_(S=>dt(S)),w=_(S=>ct(S)),A=_(S=>Ne(S)),j=_(S=>tt(S)),I=_(S=>s?Me(S,s):null),y=_(S=>{if(e)return Ee(S,e);if(i)return Ee(S,i)}),N=_(S=>e?void 0:ns(S)),D=_(S=>i&&!e?is(S,i,y==null?void 0:y.limit):os(S)),T=b.useMemo(()=>X(j,ds)||X(j,cs),[j]),u=b.useCallback(S=>m(ht(S)),[m]),C=b.useCallback((S,v)=>m(ls(S,v)),[m]),E=b.useCallback((S,v)=>m(mt(S,v)),[m]),R=b.useCallback(S=>m(rs(S)),[m]);return t.jsx($a,{...o,address:i,isConnected:l,items:d,totalItems:(y==null?void 0:y.total)||null,totalCollections:(N==null?void 0:N.total)||null,orphanItems:D,collections:p,selectedItemId:s,selectedItem:I,selectedCollectionId:e,visibleItems:n,bodyShape:g,wearableController:x,isReviewing:a,isLoading:T,isPlayingEmote:w,hasUserOrphanItems:A,onSetItems:u,onFetchCollections:C,onFetchOrphanItems:E,onFetchOrphanItem:R})},Ga=Ua;class xe extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:i}=this.props;if(a.toHexString()!==s.value){const l=n.find(d=>d.toHexString()===s.value);i(l)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(h.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,n=e.toHexString();return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(h.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ya=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:i,onChange:l,baseWearables:d}=this.props,p=s.value?d.find(g=>g.id===s.value):null;a!==p&&l(n,i,p??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:i,baseWearables:l}=this.props,d=hs(l,a,s).map(g=>({value:g.id,text:ms(g)}));i&&d.push({value:"",text:r("global.none")});const p=e?d.find(g=>g.value===e.id):null;return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:d,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:p?p.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const za=o=>({baseWearables:ps(o)}),ue=Ze(za)(Ya);let qa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1,socialEmote:void 0});c(this,"analytics",Re());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:i,onSetItems:l}=this.props,d=a.find(g=>g.id===s),p=n.filter(g=>g.type!==B.EMOTE);p.forEach(g=>{var x;(x=this.analytics)==null||x.track("Play Emote",{EMOTE_PLAYED_BASE:!d,EMOTE_PLAYED_ITEM_ID:d!=null&&d.urn?Se(d.urn):null,EMOTE_PLAYED_NAME:d?d.name:s,PREVIEWED_WEARABLE_ITEM_ID:g!=null&&g.urn?se(g.urn)?lt(g.urn):Se(g.urn):null,PREVIEWED_WEARABLE_NAME:g.name})}),d?p.push(d):i(s),l(p)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(He.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:i}=this.props,l=a.filter(d=>d.type!==B.EMOTE);s?(n(f.PreviewEmote.IDLE),i(l)):e==null||e.emote.play()});c(this,"handleSocialEmoteSelect",e=>{this.setState({socialEmote:e})});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(h.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(h.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,i=s.length>0;return a?null:t.jsx(h.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(h.Dropdown.Menu,{children:[i&&t.jsxs(t.Fragment,{children:[t.jsx(h.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(h.Dropdown.Divider,{}),s.map(l=>t.jsx(h.Dropdown.Item,{value:l.id,text:l.name,onClick:this.handleAnimationChange},l.id)),t.jsx(h.Dropdown.Divider,{}),t.jsx(h.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(h.Dropdown.Divider,{})]}),f.PreviewEmote.schema.enum.map(l=>t.jsx(h.Dropdown.Item,{value:l,text:r(`emotes.${l}`),onClick:this.handleAnimationChange},l))]})})});c(this,"renderEmoteSelector",()=>t.jsx(h.Popup,{content:r("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(h.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:i,onFetchBaseWearables:l,onFetchOrphanItems:d,onFetchCollectionItems:p}=this.props,g=a.length>0;n||l(),g||(s&&!q(s)?p(s.id):e&&i&&d(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const n=s.find(i=>i.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,n?n.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:n,emote:i,selectedBaseWearables:l,selectedItem:d,visibleItems:p,isImportFilesModalOpen:g,wearableController:x}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:A,isLoading:j,socialEmote:I}=this.state,y=p.some(le)&&(d==null?void 0:d.type)===B.EMOTE,N=i===f.PreviewEmote.JUMP?1:void 0;let D;return!I&&(d==null?void 0:d.type)===B.EMOTE&&d.data.startAnimation&&(D={title:"Start Animation",...d.data.startAnimation,loop:!0}),t.jsxs("div",{className:`CenterPanel ${g?"import-files-modal-is-open":""}`,children:[t.jsx(He,{id:"wearable-editor",profile:"default",bodyShape:e,emote:i,zoom:N,skin:be(s),eyes:be(a),hair:be(n),urns:l?Object.values(l).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:p.map(gs),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:us,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:y,showSceneBoundaries:A,socialEmote:I||D}),y&&!j&&x?t.jsx(Cs,{className:"zoom-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:x}):null,j&&t.jsx(h.Center,{children:t.jsx(h.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[y&&!j&&x?t.jsx("div",{className:"emote-controls-container",children:t.jsx(h.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:x})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(h.Icon,{name:"user"})}),y?!j&&x?t.jsx(Is,{className:"animation-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:x,selectedAnimation:I,onSelectAnimation:this.handleSocialEmoteSelect}):null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${A?"active":""}`,children:t.jsx(G,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:f.BodyShape.MALE,text:r("body_shapes.male")},{value:f.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:s,colors:bs(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:a,colors:_s(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:n,colors:xs(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ue,{wearable:l[f.WearableCategory.HAIR],category:f.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ue,{wearable:l[f.WearableCategory.FACIAL_HAIR],category:f.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ue,{wearable:l[f.WearableCategory.UPPER_BODY],category:f.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ue,{wearable:l[f.WearableCategory.LOWER_BODY],category:f.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const Ja=()=>{const o=de(),m=_(ce),e=_(rt),s=_(Es),a=_(vs),n=_(js),i=_(Ss),l=_(fs),d=Ct(),p=_(dt),g=_(ys),x=_(ct),w=_(As),A=_(Ne),j=_(ws),I=Ie(),y=Oe(),N=_(v=>y?Me(v,y):null),D=b.useMemo(()=>I?j.find(v=>v.id===I):void 0,[j,I]),T=b.useMemo(()=>I?g.filter(v=>v.collectionId===I):g.filter(v=>!v.collectionId),[g,I]),u=l?l[e]:null,E=b.useMemo(()=>!d.some(le)&&i===f.PreviewEmote.IDLE,[d,i])?!1:x,R="CreateSingleItemModal"in w,S=b.useMemo(()=>({onSetBodyShape:v=>{o(Ts(v))},onSetAvatarAnimation:v=>{o(Ps(v))},onSetSkinColor:v=>{o(Ns(v))},onSetEyeColor:v=>{o(Rs(v))},onSetHairColor:v=>{o(Ms(v))},onSetBaseWearable:(v,F,Z)=>{o(Ds(v,F,Z))},onFetchBaseWearables:()=>{o(Os())},onSetWearablePreviewController:v=>{o(Ls(v))},onSetItems:v=>{o(ht(v))},onFetchOrphanItems:(v,F)=>{o(mt(v,F))},onFetchCollectionItems:(v,F)=>{o(ks(v,F))}}),[o]);return t.jsx(qa,{address:m,bodyShape:e,collection:D,selectedItem:N,selectedBaseWearables:u,skinColor:s,eyeColor:a,hairColor:n,emote:i,visibleItems:d,wearableController:p,emotes:T,isPlayingEmote:E,isImportFilesModalOpen:R,hasUserOrphanItems:A,...S})},Ka=Ja,Qa="_dynamicInput_ljtxw_1",Xa="_dynamicInputField_ljtxw_8",Za="_noTransition_ljtxw_26",en="_isEditing_ljtxw_41",tn="_dynamicInputEditButton_ljtxw_48",sn="_mirrorSpan_ljtxw_60",K={dynamicInput:Qa,dynamicInputField:Xa,noTransition:Za,isEditing:en,dynamicInputEditButton:tn,mirrorSpan:sn},an=6,It="a-zA-Z0-9\\s_-",nn=new RegExp(`^[${It}]*$`),on=new RegExp(`[^${It}]`,"g"),ln=({value:o,disabled:m=!1,placeholder:e="",editable:s=!1,className:a="",maxLength:n,onChange:i})=>{const[l,d]=b.useState(!1),p=b.useRef(null),g=b.useRef(null),x=b.useRef(null),w=b.useRef(!1),A=b.useCallback(()=>{const E=p.current;E&&(E.classList.add(K.noTransition),x.current&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>{E.classList.remove(K.noTransition),x.current=null},120))},[]),j=b.useCallback(()=>{const E=g.current,R=p.current;if(!E||!R||w.current)return;E.textContent=o&&o.length>0?o:e||"​";const v=E.getBoundingClientRect().width+an;R.style.width=`${v}px`},[o,e]);b.useLayoutEffect(()=>{j()},[j]);const I=b.useCallback(E=>{let R=E.target.value;R=R.replace(on,""),o!==R&&i&&i(n?R.slice(0,n):R),A(),requestAnimationFrame(j)},[o,n,i,A,j]),y=b.useCallback(E=>{w.current=!0},[]),N=b.useCallback(E=>{w.current=!1,requestAnimationFrame(j)},[j]),D=b.useCallback(E=>{if(E.key==="Enter"){d(!1);return}E.key.length>1||E.ctrlKey||E.metaKey||E.altKey||nn.test(E.key)||E.preventDefault()},[]),T=b.useCallback(()=>d(!1),[]),u=b.useCallback(()=>{d(!0),setTimeout(()=>{var E;return(E=p.current)==null?void 0:E.focus()},0)},[]),C=s&&!m;return t.jsxs("div",{className:Bs(K.dynamicInput,{[K.isEditing]:l},a),children:[t.jsx("input",{ref:p,value:o,onChange:I,onKeyDown:D,onBlur:T,onCompositionStart:y,onCompositionEnd:N,disabled:m||!l,placeholder:e,maxLength:n,className:K.dynamicInputField}),t.jsx("span",{ref:g,className:K.mirrorSpan,"aria-hidden":"true"}),C&&t.jsx(h.Button,{className:K.dynamicInputEditButton,icon:"pencil alternate",size:"tiny",basic:!0,onClick:u,disabled:m})]})},rn=b.memo(ln);class dn extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,i=e.target.value;s!==i&&n(a?i.slice(0,a):i)})}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 k extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{value:a,onChange:n}=this.props,i=s.value;i!==a&&(this.setState({value:i}),n(i))})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,options:s}=this.props,{value:a}=this.state,n=s.find(i=>i.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:n?n.text:r("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}c(k,"defaultProps",{disabled:!1});class ye extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,i=s.value,l=[...n];for(const d of i)n.includes(d)||l.push(d);l.length!==n.length&&(this.setState({value:l}),a(l))});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,info:s,options:a}=this.props,{value:n}=this.state,i=a.reduce((l,d)=>(l[d.value]=d.text,l),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(Ce,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(l=>t.jsxs("div",{className:"value",children:[i[l],t.jsx("div",{className:"remove",onClick:d=>{this.handleRemove(l),d.stopPropagation()}})]},l)):t.jsx("div",{className:"placeholder",children:r("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(ye,"defaultProps",{disabled:!1});class bt extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{draft:"",value:this.props.value});c(this,"handleChange",e=>{this.setState({draft:e.target.value})});c(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,n=s.trim();if(n!=="")if(a.includes(n))this.setState({draft:""});else{const i=[...a,n];this.setState({value:i,draft:""}),e(i)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===Fs||e.keyCode===Ve||e.keyCode===Ws)this.handleAdd();else if(e.keyCode===Hs||e.keyCode===Ve){const{draft:s,value:a}=this.state,n=a[a.length-1];n&&s===""&&this.handleRemove(n)}});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}render(){const{isDisabled:e}=this.props,{draft:s,value:a}=this.state;return t.jsx("div",{className:`Tags ${a.length>0?"":"blank"} ${e?"is-disabled":""}`.trim(),children:t.jsxs("div",{className:"values",children:[a.map(n=>t.jsxs("div",{className:"value",children:[n,t.jsx("div",{className:"remove",onClick:i=>{this.handleRemove(n),i.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(bt,"defaultProps",{isDisabled:!1});const cn=3;let hn=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Re());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[$e]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;_e(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===f.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===U.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleStartAnimationArmatureAnimationChange",(e,s)=>{const a=this.state.data,n={...a.startAnimation||{}};s===""&&e===f.ArmatureId.Armature_Prop?delete n[e]:n[e]={animation:s},this.setState({data:{...a,startAnimation:n},isDirty:this.isDirty({data:{...a,startAnimation:n}})})});c(this,"handleStartAnimationAudioClipChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.audio=e||void 0,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleStartAnimationPlayModeChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.loop=e,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleRandomizeOutcomesChange",e=>{const s={...this.state.data,randomizeOutcomes:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOutcomeChange",(e,s,a)=>{const n=this.state.data,i=[...n.outcomes];i[e]={...i[e],[s]:a},this.setState({data:{...n,outcomes:i},isDirty:this.isDirty({data:{...n,outcomes:i}})})});c(this,"handleOutcomeClipChange",(e,s,a,n)=>{const i=this.state.data,l=[...i.outcomes||[]],d={...l[e].clips};n===""?delete d[s]:(d[s]||(d[s]={animation:""}),d[s]={...d[s],[a]:n}),l[e]={...l[e],clips:d},this.setState({data:{...i,outcomes:l},isDirty:this.isDirty({data:{...i,outcomes:l}})})});c(this,"handleOutcomeAudioClipChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].audio=s||void 0,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleOutcomePlayModeChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].loop=s,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleAddOutcome",()=>{const e=this.state.data;(!e||!e.outcomes)&&(e.outcomes=[]);const s={title:`Outcome ${e.outcomes.length+1}`,clips:{},loop:!1},a=[...e.outcomes,s];this.setState({data:{...e,outcomes:a},isDirty:this.isDirty({data:{...e,outcomes:a}})})});c(this,"handleRemoveOutcome",e=>{const s=this.state.data,a=s.outcomes.filter((n,i)=>i!==e);this.setState({data:{...s,outcomes:a},isDirty:this.isDirty({data:{...s,outcomes:a}})})});c(this,"handleEditOutcomeTitle",(e,s)=>{this.handleOutcomeChange(e,"title",s)});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(l=>!f.WearableCategory.schema.enum.includes(l)),...e]:n=[...a.filter(l=>!f.BodyPartCategory.schema.enum.includes(l)),...e];const i=this.setHides(this.state.data,n);this.setState({data:i,isDirty:this.isDirty({data:i})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,A;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:i,utility:l,rarity:d,contents:p,data:g,isDirty:x}=this.state;if(x&&e){let j=g;j&&!_e(j)&&(j={...j,removesDefaultHiding:j.category===f.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(f.WearableCategory.UPPER_BODY)?[f.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const I={...e.contents,...await Vs(p)},y={...e,name:n,description:i,rarity:d,data:j,contents:I,utility:l??void 0};s&&[Ue.UNPUBLISHED,Ue.UNDER_REVIEW].includes(s)&&(y.video=I[$e]),a(y,p),se(y.urn)&&((A=this.analytics)==null||A.track("Edit Item",{contents:p})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===B.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=$s(e);this.setState({thumbnail:e,contents:{[Ge]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Ye(a),i=await Ye(a,1024,1024),l=URL.createObjectURL(n);this.setState({thumbnail:l,contents:{[Ge]:i},isDirty:!0})}});c(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;fe(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&&ze(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===f.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||!ot(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}getAnimationOptions(e,s=!1,a){if(!e.isLoaded)return[];if(e.error)return console.warn("Animation data error:",e.error),[];let n=e.animations;if(a){const l=qe(`dummy${a}`);n=e.animations.filter(d=>{const p=qe(d.name),x=Us(d.name)===d.name;return p===l||x})}const i=n.map(l=>({value:l.name,text:l.name}));return s?[{value:"",text:"--"},...i]:i}getAudioOptions(e){const s=new Set,a=Object.keys(e).map(n=>{if(Gs(n)){const i=n.replace(/^(male|female)\//,"");if(!s.has(i))return s.add(i),{value:i,text:i}}return null}).filter(Boolean);return[{value:"",text:"--"},...a]}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||_e(a))return null;const n=Ys(e.contents,a.category),i=zs(e.contents),l=a.hides.filter(p=>n.includes(p)),d=a.hides.filter(p=>i.includes(p));return t.jsxs(t.Fragment,{children:[t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:d,options:this.asCategorySelect(e.type,i),disabled:!s,onChange:p=>this.handleChangeHides(p,"bodypart")}),t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:l,options:this.asCategorySelect(e.type,l.some(p=>p===f.WearableCategory.BODY_SHAPE)?n:n.filter(p=>p!==f.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:p=>this.handleChangeHides(p,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),i=s?t.jsx(h.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(G,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(G,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),i,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(ve,{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(G,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[i,t.jsx(ve,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(qs,{item:e})]})}renderVideoDetails(e){if(!Je(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(G,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Js(e)&&t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Ks,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:i,isCampaignEnabled:l,isVrmOptOutEnabled:d,campaignName:p,campaignTag:g}=this.props,{name:x,description:w,utility:A,rarity:j,data:I,isDirty:y,hasItem:N}=this.state,D=f.Rarity.getRarities(),T=Qs();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(ba,{id:e,children:(u,C,E,R)=>{var Z,he,me,pe,ge,Y,ne;const S=C&&ze(C),v=this.canEditItemMetadata(u),F=u?fe(u)?Xs(u.contents):Zs():[];return E?t.jsx(h.Loader,{size:"massive",active:!0}):N||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),u&&pt(u,s)&&!u.isPublished&&!S?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[je(u)!==null?t.jsx(h.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${je(u)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(gt,{name:x,onDelete:this.handleDeleteItem,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(H,{label:r("item_editor.right_panel.details"),children:u?t.jsxs(t.Fragment,{children:[this.renderModelDetails(u),this.renderVideoDetails(u)]}):null}),t.jsx(H,{label:r("item_editor.right_panel.basics"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(dn,{label:r("global.name"),value:x,disabled:!v,maxLength:ea,onChange:this.handleChangeName}),t.jsx(h.TextAreaField,{maxLength:ta,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!v,value:w,rows:"2",cols:"12"}),a?t.jsx(h.TextAreaField,{maxLength:sa,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!v,value:A,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(k,{itemId:u.id,label:r("global.category"),value:I.category,options:this.asCategorySelect(u.type,F),disabled:!v,onChange:this.handleChangeCategory}),!(u.urn&&se(u.urn))&&t.jsx(k,{itemId:u.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(D),disabled:u.isPublished||!v,onChange:this.handleChangeRarity})]}):null}),(u==null?void 0:u.type)===B.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(Ce,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(u)}),(u==null?void 0:u.type)===B.EMOTE&&(u!=null&&u.metrics)&&aa(u.metrics)&&u.metrics.additionalArmatures?t.jsx(H,{label:r("item_editor.right_panel.animations"),children:t.jsxs("div",{className:"animations-section",children:[t.jsxs(h.Box,{className:"emote-request-state-box",header:t.jsx(h.Header,{className:"emote-start-header",children:"Emote Start"}),children:[t.jsx(k,{itemId:u.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(he=(Z=I==null?void 0:I.startAnimation)==null?void 0:Z[f.ArmatureId.Armature])==null?void 0:he.animation,options:this.getAnimationOptions(R,!1),disabled:E,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature,O)}),t.jsx(k,{itemId:u.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(pe=(me=I==null?void 0:I.startAnimation)==null?void 0:me[f.ArmatureId.Armature_Prop])==null?void 0:pe.animation,options:this.getAnimationOptions(R,!0),disabled:E,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature_Prop,O)}),Object.values(u.contents).length>0&&Qe(u)?t.jsx(k,{itemId:u.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(ge=I==null?void 0:I.startAnimation)==null?void 0:ge.audio,options:this.getAudioOptions(u.contents),onChange:O=>this.handleStartAnimationAudioClipChange(O)}):null,t.jsx(k,{itemId:u.id,label:r("create_single_item_modal.play_mode_label"),value:(Y=I==null?void 0:I.startAnimation)!=null&&Y.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),onChange:O=>this.handleStartAnimationPlayModeChange(O===U.LOOP),disabled:!0})]}),I!=null&&I.outcomes&&I.outcomes.length>1?t.jsx(k,{itemId:u.id,label:r("item_editor.right_panel.social_emote.randomize_outcomes"),value:I!=null&&I.randomizeOutcomes?"true":"false",options:[{value:"true",text:"True"},{value:"false",text:"False"}],disabled:E,onChange:O=>this.handleRandomizeOutcomesChange(O==="true")}):null,(I==null?void 0:I.outcomes)&&I.outcomes.length>0&&I.outcomes.map((O,z)=>{var Le,ke,Be;return t.jsxs(h.Box,{className:"outcome-box",header:t.jsxs("div",{className:"outcome-header",children:[t.jsx(rn,{className:"outcome-title-input",value:O.title,editable:!0,maxLength:na,onChange:W=>this.handleEditOutcomeTitle(z,W)}),I.outcomes.length>1?t.jsx(h.Button,{className:"outcome-remove-button",icon:"trash",size:"tiny",basic:!0,onClick:()=>this.handleRemoveOutcome(z),disabled:E,style:{float:"right",marginTop:"-2px"}}):null]}),children:[t.jsx(k,{itemId:u.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(Le=O.clips[f.ArmatureId.Armature])==null?void 0:Le.animation,options:this.getAnimationOptions(R,!1),disabled:E,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature,"animation",W)}),t.jsx(k,{itemId:u.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 2 (${r("item_editor.right_panel.social_emote.optional")})`,value:(ke=O.clips[f.ArmatureId.Armature_Other])==null?void 0:ke.animation,options:this.getAnimationOptions(R,!0),disabled:E,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Other,"animation",W)}),t.jsx(k,{itemId:u.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(Be=O.clips[f.ArmatureId.Armature_Prop])==null?void 0:Be.animation,options:this.getAnimationOptions(R,!0),disabled:E,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Prop,"animation",W)}),Object.values(u.contents).length>0&&Qe(u)?t.jsx(k,{itemId:u.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:O.audio,options:this.getAudioOptions(u.contents),onChange:W=>this.handleOutcomeAudioClipChange(z,W)}):null,t.jsx(k,{itemId:u.id,label:r("create_single_item_modal.play_mode_label"),value:O!=null&&O.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:E,onChange:W=>this.handleOutcomePlayModeChange(z,W===U.LOOP)})]},z)}),((I==null?void 0:I.outcomes)??[]).length<cn?t.jsx(h.Row,{className:"add-outcome-button",align:"left",children:t.jsxs(h.Button,{secondary:!0,size:"small",disabled:E,onClick:this.handleAddOutcome,children:[t.jsx(G,{name:"add"})," ",r("item_editor.right_panel.social_emote.add_outcome")]})}):null]})}):t.jsx(H,{label:r("item_editor.right_panel.animation"),children:u?t.jsx(k,{itemId:u.id,label:r("create_single_item_modal.play_mode_label"),value:I.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:!v,onChange:this.handlePlayModeChange}):null}),u&&Je(u)&&((ne=u.data.requiredPermissions)!=null&&ne.length)?t.jsx(H,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(u)}):null,t.jsx(H,{label:r("item_editor.right_panel.tags"),children:u?t.jsxs(t.Fragment,{children:[t.jsx(bt,{itemId:u.id,value:I.tags,onChange:this.handleChangeTags,isDisabled:!v}),l&&p&&g&&v&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:g}),event_name:t.jsx("span",{children:p})})})]}):null}),(u==null?void 0:u.type)===B.WEARABLE&&d&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(h.Checkbox,{toggle:!0,label:I!=null&&I.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(I!=null&&I.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(u==null?void 0:u.type)===B.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(h.Checkbox,{toggle:!0,label:(I==null?void 0:I.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(I==null?void 0:I.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),y?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(h.Button,{secondary:!0,onClick:this.handleOnResetItem,children:r("global.cancel")}),t.jsx(Xe,{primary:!0,onClick:this.handleOnSaveItem,network:f.Network.MATIC,children:r("global.save")})]}):i&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",i]}):null]})]}):null}}):null})}};const mn=()=>{const o=de(),m=Oe(),e=_(C=>ce(C)),s=_(C=>we(C)),a=_(C=>ia(C)),n=_(C=>oa(C)),i=_(C=>et(C)),l=_(C=>la(C)),d=_(C=>ua(C)),p=_(C=>ra(C)),g=_(C=>da(C)),x=_(C=>m?Me(C,m):null),w=_(C=>m&&x&&x.collectionId?Te(C,x.collectionId):null),A=_(C=>{const E=Ca(C),R=Ia(C);return E==null?void 0:E[R]}),j=_(C=>ca(C)),I=_(C=>!x||!e?!1:w?st(C,e,w):pt(x,e)),y=b.useMemo(()=>m?j[m]:null,[m,j]),N=b.useCallback((C,E)=>o(ha(C,E)),[o]),D=b.useCallback(C=>o(nt(C)),[o]),T=b.useCallback((C,E)=>o(at(C,E)),[o]),u=b.useCallback(C=>o(ma(C)),[o]);return t.jsx(hn,{address:e,collection:w,selectedItem:x,selectedItemId:m,canEditSelectedItem:I,itemStatus:y,error:a,isConnected:s,isDownloading:n,isCommitteeMember:i,isCampaignEnabled:l,campaignTag:d,campaignName:A,isVrmOptOutEnabled:p,isWearableUtilityEnabled:g,onSaveItem:N,onDeleteItem:D,onOpenModal:T,onDownload:u})},pn=mn;class wn extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{reviewedItems:[]});c(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(n=>n.id===a.id))]}))});c(this,"handleResetReviewedItems",()=>{this.setState({reviewedItems:[]})})}render(){const{reviewedItems:e}=this.state;return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"ItemEditorPage",children:[t.jsx(Na,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Ga,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Ka,{}),t.jsx(pn,{})]})]})})}}export{wn as default};
1
+ var _t=Object.defineProperty;var xt=(o,m,e)=>m in o?_t(o,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[m]=e;var c=(o,m,e)=>xt(o,typeof m!="symbol"?m+"":m,e);import{ak as ae,N as t,S as h,M as r,b6 as Q,bQ as Et,J as b,gB as oe,Q as re,R as $,cq as Xe,aR as f,T as Ze,bq as X,gC as vt,eM as jt,gD as St,gE as ft,gF as yt,gG as At,gH as wt,gI as Tt,gJ as Pt,gK as Nt,gL as q,eA as Rt,gM as ie,gN as Fe,aa as de,a4 as Ae,ab as _,aM as ce,gO as Mt,dl as we,bd as et,fl as Te,fB as Dt,g2 as Ot,g3 as Lt,eJ as Ee,gu as kt,gP as Bt,gQ as Ft,g5 as Wt,eN as tt,gR as Ht,gS as Vt,gT as $t,gU as Ut,fw as Gt,g4 as Yt,g6 as zt,b1 as Pe,gV as qt,gW as Jt,e$ as We,bR as Kt,aj as Qt,eQ as Ne,gX as st,a2 as at,eD as Xt,ey as nt,fO as le,dN as ve,ez as Zt,f2 as je,gY as it,b4 as Re,g1 as ot,f5 as k,eB as se,fK as lt,fL as Se,P as G,fg as fe,dM as es,eZ as ts,ft as ss,gZ as as,g_ as rt,g$ as dt,h0 as ct,fk as Me,eK as ns,h1 as is,h2 as os,fS as ht,eT as ls,eS as mt,eU as rs,eW as ds,eX as cs,h3 as hs,h4 as ms,h5 as ps,h6 as He,h7 as be,h8 as us,en as gs,h9 as Cs,ha as Is,hb as bs,hc as _s,hd as xs,he as Es,hf as vs,hg as js,hh as Ss,hi as fs,hj as ys,hk as As,fu as ws,hl as Ts,hm as Ps,hn as Ns,ho as Rs,hp as Ms,hq as Ds,hr as Os,hs as Ls,g7 as ks,a7 as Bs,b$ as Ce,ht as Fs,hu as Ve,hv as Ws,hw as Hs,f1 as $e,fP as _e,hx as U,f0 as Vs,eY as Ue,f3 as $s,f4 as Ge,f6 as Ye,f7 as ze,hy as qe,hz as Us,hA as Gs,hB as Ys,hC as zs,f8 as qs,f9 as Je,fa as Ke,hD as Js,fj as Ks,hE as Qs,hF as Xs,hG as Zs,hH as pt,hI as ea,hJ as ta,hK as sa,hL as aa,hM as Qe,hN as na,hO as ia,hP as oa,eP as la,hQ as ra,fn as da,fm as ca,fp as ha,hR as ma}from"./index-DDLQh72H.js";import{g as Ie,h as De,i as Oe}from"./hooks-BR9ATp8C.js";import{J as pa}from"./JumpIn.container-Db9sy8sq.js";import{C as ua}from"./CollectionProvider.container-3333NUxE.js";import{C as ut}from"./ConfirmDelete-Bi0mUMu0.js";import{C as gt}from"./CollectionStatus.container-DzhTjeP9.js";import{d as ga,e as Ca,c as Ia}from"./selectors-BFWzed6x.js";import{I as ba}from"./ItemProvider.container-7qkDLYej.js";const _a=({open:o,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(h.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:o,children:[t.jsx(h.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(Et,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:s,children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),xa=ae.memo(_a);var L=(o=>(o.REJECT_COLLECTION="REJECT_COLLECTION",o.REJECT_CURATION="REJECT_CURATION",o.DISABLE_COLLECTION="DISABLE_COLLECTION",o.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",o))(L||{});const J="item_editor.top_panel.rejection_modal",Ea=({open:o,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:i,curation:l,onReject:d,onRejectCuration:p,onClose:u})=>{const E=b.useMemo(()=>{switch(m){case L.DISABLE_COLLECTION:return J+".disable_collection";case L.REJECT_CURATION:return J+".reject_curation";case L.DISABLE_THIRD_PARTY:return J+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case L.DISABLE_COLLECTION:d(i);break;case L.REJECT_CURATION:p(l.collectionId);break;case L.DISABLE_THIRD_PARTY:s&&n(s.id);break}},A=m===L.DISABLE_COLLECTION&&!i.isApproved||m===L.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===L.REJECT_COLLECTION&&!i.isApproved||m===L.REJECT_CURATION&&(l==null?void 0:l.status)===oe.REJECTED;return t.jsx(h.Modal,{size:"tiny",className:"RejectionModal",open:o,children:a?t.jsx(va,{i18nKey:E}):A?t.jsx(ja,{link:i.forumLink,onClose:u}):t.jsx(Sa,{i18nKey:E,isLoading:e,onClose:u,onConfirm:w})})},va=({i18nKey:o})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${o}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx(Q,{id:J+".visit_activity",values:{activity_link:t.jsx(re,{to:$.activity(),children:r("global.activity")})}})}),t.jsx(h.Loader,{active:!0,size:"large"})]})]}),ja=({link:o,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(J+".veredict_explanation")}),t.jsx(h.Modal.Content,{children:r(J+".go_to_forum")}),t.jsxs(h.Modal.Actions,{children:[t.jsx("a",{href:o,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(h.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(J+".forum_link")}),t.jsx("div",{className:"discussion",children:r(J+".discussion")}),t.jsx(h.Icon,{name:"chevron right"})]})}),t.jsx(h.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),Sa=({i18nKey:o,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsx(h.Modal.Content,{children:r(`${o}.subtitle`)}),t.jsxs(h.Modal.Actions,{children:[t.jsx(Xe,{primary:!0,onClick:e,disabled:m,loading:m,network:f.Network.MATIC,children:r(`${o}.action`)}),t.jsx(h.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),fa=ae.memo(Ea),ya=(o,m)=>({isLoading:X(jt(o),vt)||X(ft(o),St)||yt(o),hasPendingTransaction:At(o)||!!(m.thirdParty&&wt(o,m.thirdParty.id))}),Aa=o=>({onReject:m=>o(Tt(m)),onRejectCuration:m=>o(Pt(m)),onDisableThirdParty:m=>o(Nt(m))}),wa=Ze(ya,Aa)(fa);var P=(o=>(o[o.APPROVE=0]="APPROVE",o[o.REJECT=1]="REJECT",o[o.ENABLE=2]="ENABLE",o[o.DISABLE=3]="DISABLE",o[o.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",o))(P||{});let Ta=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push($.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:i,onSetAssignee:l}=this.props;this.setState({showApproveConfirmModal:!1}),a&&l(e.id,a,s),q(e)?i(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:i,thirdParty:l}=this.props,{showRejectionModal:d,showApproveConfirmModal:p}=this.state,{chainId:u}=this.props,E=Rt(e);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"actions",children:t.jsx("div",{className:"back",onClick:this.handleBack})}),t.jsxs("div",{className:"title",children:[e.name," · ",r(`collection.type.${E}`),t.jsx(pa,{size:"small",active:!0,collection:e,chainId:u,items:q(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:q(e)&&i!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),d&&t.jsx(wa,{type:d,open:!0,collection:e,curation:n,thirdParty:l,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&p&&t.jsx(xa,{open:!0,assignee:n.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,n),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});c(this,"renderButton",(e,s,a)=>{const{address:n,thirdParty:i,onInitiateApprovalFlow:l,onInitiateTPApprovalFlow:d,onDeployMissingEntities:p,reviewedItems:u,totalItems:E}=this.props,w={[P.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):q(s)?d(s):l(s),[P.ENABLE]:()=>l(s),[P.DISABLE]:()=>this.setShowRejectionModal(i?L.DISABLE_THIRD_PARTY:L.DISABLE_COLLECTION),[P.REJECT]:()=>{(a==null?void 0:a.status)===oe.PENDING?this.setShowRejectionModal(L.REJECT_CURATION):this.setShowRejectionModal(L.REJECT_COLLECTION)},[P.DEPLOY_MISSING_ENTITIES]:()=>p(s)},A={[P.APPROVE]:"approve",[P.ENABLE]:"enable",[P.DISABLE]:"disable",[P.REJECT]:"reject",[P.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===P.APPROVE||e===P.ENABLE||e===P.DEPLOY_MISSING_ENTITIES,I=!q(s)||!!E&&u.length>=ie(E);return t.jsx(h.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:I,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(h.Button,{primary:j,onClick:()=>w[e](),disabled:q(s)&&e===P.APPROVE&&!!E&&u.length<ie(E),children:r(`item_editor.top_panel.${A[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:i,thirdParty:l}=this.props,d=a==null?void 0:a.some(p=>p.status===oe.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(h.Header,{sub:!0,children:[d?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:ie(i)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=ie(i)?t.jsx(h.Icon,{name:"check circle"}):null]}),d&&this.renderButton(P.APPROVE,e,s),d&&this.renderButton(P.REJECT,e,s),!d&&(l==null?void 0:l.isApproved)&&this.renderButton(P.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)?this.renderButton(P.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:i,isLoading:l}=this.props,d=!e||l&&!s.length;return a&&n&&i?t.jsx("div",{className:"TopPanel",children:d?t.jsx(h.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const Pa=({reviewedItems:o})=>{const m=de(),e=Ae(),s=Ie(),a=De(),n=_(ce),i=_(Mt),l=_(we),d=_(et),p=_(C=>s?Te(C,s):null),u=_(C=>p?Dt(C,p.id):[]),E=_(C=>p?Ot(C,p.id):[]),w=_(C=>s?Lt(C,s):null),A=_(C=>s?Ee(C,s):void 0),j=_(C=>p&&q(p)?kt(C,p):null),I=_(C=>s?Bt(C,s):!1),y=_(C=>X(Ft(C),Gt)||X(Wt(C),Yt)||X(tt(C),zt)),N=b.useCallback((C,x,R)=>{m(Ht(C,x,R))},[m]),D=b.useCallback(C=>{m(Vt(C))},[m]),T=b.useCallback(C=>{m($t(C))},[m]),g=b.useCallback(C=>{m(Ut(C))},[m]);return t.jsx(Ta,{address:n,items:u,totalItems:(A==null?void 0:A.total)||null,collection:p,itemCurations:E,thirdParty:j,curation:w,chainId:i,isConnected:l,isReviewing:a,isCommitteeMember:d,selectedCollectionId:s,hasCollectionMissingEntities:I,isLoading:y,reviewedItems:o,onSetAssignee:N,onInitiateTPApprovalFlow:D,onInitiateApprovalFlow:T,onDeployMissingEntities:g,history:e})},Na=Pa,Ct=()=>{const{search:o}=Pe();return _(e=>qt(e,o))},Ra="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",Ma=o=>{const{collectionId:m}=o,[e,s]=b.useState(!1),[a,n]=b.useState(null),i=Ae(),l=Pe(),d=b.useMemo(()=>Jt(l.search),[l.search]);b.useEffect(()=>{d&&(s(!0),n(d))},[d]);function p(){s(!1);const u=new URLSearchParams(l.search);u.delete("newItem"),i.replace({search:u.toString()})}return e&&a&&m?t.jsx(h.Toast,{type:h.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:Ra,alt:r("sagas.item.item_added_toast.title")})}),onClose:p,body:t.jsx(Q,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:u=>t.jsx("strong",{children:u}),"collection-link":u=>t.jsx(re,{to:$.collectionDetail(m),children:t.jsx(h.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:u})})}})}):null},Da=ae.memo(Ma),Oa=({collection:o,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:i})=>{var g,C;const l=Pe(),d=Ae(),p=((g=l.state)==null?void 0:g.fromParam)===We.COLLECTIONS,u=((C=l.state)==null?void 0:C.fromParam)===We.TP_COLLECTIONS,E=b.useCallback(()=>{d.push($.collections())},[d]),w=b.useCallback(()=>{if(o&&(p||u)){const x=p?$.collectionDetail:$.thirdPartyCollectionDetail;d.push(x(o.id))}else d.push($.itemEditor())},[p,u,d,o]),A=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{o&&n("CreateSingleItemModal",{collectionId:o.id})},[o,n]),I=b.useCallback(()=>{o&&n("AddExistingItemModal",{collectionId:o.id})},[o,n]),y=b.useCallback(()=>{o&&n("EditCollectionNameModal",{collection:o})},[o,n]),N=b.useCallback(()=>{o&&i(o)},[o,i]),D=b.useCallback(()=>{const x=o&&Kt(o.owner,m||"");return o?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${p||u?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(re,{to:$.collectionDetail(o.id),children:o.name}),t.jsx(gt,{collection:o})]}),x&&!o.isPublished?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[t.jsx(h.Dropdown.Item,{onClick:y,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(h.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(h.Dropdown.Item,{onClick:I,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(ut,{name:o.name,onDelete:N,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[o,m,e,p,u]),T=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:E}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(h.Dropdown.Menu,{children:t.jsx(h.Dropdown.Item,{onClick:A,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(h.Row,{grow:!1,shrink:!1,className:"Header",children:o?D():T()})},La=()=>{const o=Ie();return _(m=>o?Te(m,o):null)},ka=()=>{const o=de(),m=_(ce),e=_(Qt),s=De(),a=_(Ne),n=La(),i=_(u=>!!(n&&m&&st(u,m,n))),l=b.useCallback((u,E)=>o(at(u,E)),[o]),d=b.useCallback(u=>o(Xt(u)),[o]),p=b.useCallback(u=>o(nt(u)),[o]);return t.jsx(Oa,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:l,onDeleteCollection:d,onDeleteItem:p,hasEditRights:i,hasUserOrphanItems:a})},V=10;class H extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:n?s:null})]})}}class Ba extends b.PureComponent{constructor(){super(...arguments);c(this,"handleClick",()=>{const{item:e,onClick:s}=this.props;s(e)})}renderToggleItem(){const{item:e,isVisible:s,isPlayingEmote:a}=this.props;return le(e)?t.jsx(h.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(ve,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Zt,{item:e}),e.name]}),t.jsx(h.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${je(e)}`).toLowerCase()})}),disabled:it(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var M=(o=>(o.TO_REVIEW="to-review",o.REVIEWED="reviewed",o.ALL_ITEMS="all-items",o))(M||{});const Fa={[M.TO_REVIEW]:1,[M.REVIEWED]:1,[M.ALL_ITEMS]:1};class Wa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:M.TO_REVIEW,currentPages:Fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Re());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===M.TO_REVIEW&&!ot(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var p;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:i,onSetItems:l}=this.props;if(!it(e,s))return;let d=a.filter(u=>u.id!==e.id);if(le(e))if(this.isVisible(e)){i?n==null||n.emote.pause():n==null||n.emote.play();return}else d=d.filter(u=>u.type!==k.EMOTE);this.isVisible(e)||(d.push(e),(p=this.analytics)==null||p.track("Preview Item",{ITEM_ID:e!=null&&e.urn?se(e.urn)?lt(e.urn):Se(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:se(e.urn)})),l(d)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:i}=this.state;e===M.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(i[M.ALL_ITEMS])}):e===M.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(i=>({currentPages:{...i.currentPages,[a]:+s.activePage}})),a!==M.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(M.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?se(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:i}=this.props;return t.jsx(Ba,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:i,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(fe),a=e.filter(le);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(H,{label:this.renderCollapsableLabel(k.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(H,{label:this.renderCollapsableLabel(k.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],i=Math.ceil(e/V);return i>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:i,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],i=(n-1)*V,l=n*V;return t.jsx(h.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:i,pageEnd:l>e?e:l,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:i,currentPages:l}=this.state,d=this.getIsReviewingTPItems(),p=l[i];if(s)return t.jsx(h.Loader,{size:"large",active:!0});switch(i){case M.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!d&&a?this.renderTabPagination(a):null]});case M.REVIEWED:{const u=n.slice((p-1)*V,p*V);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(u),n.length?this.renderTabPagination(n.length):null]})}case M.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let i;const l=!s||s<V||a.length===s;switch(n){case M.TO_REVIEW:i=t.jsx(h.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!l,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(h.Button,{disabled:e||l,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(h.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case M.REVIEWED:i=t.jsx(Q,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:ie(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",i," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(h.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx(Q,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:M.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(h.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(h.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(h.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:()=>this.handleTabChange(M.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:e===M.TO_REVIEW,onClick:()=>this.handleTabChange(M.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(h.Tabs.Tab,{active:e===M.REVIEWED,onClick:()=>this.handleTabChange(M.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(h.Tabs.Tab,{active:e===M.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(G,{name:e}),t.jsx(Q,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(h.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class Ha extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({collectionId:m.id}),children:[t.jsx(es,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(gt,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class Va extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentPage:1});c(this,"handlePageChange",(e,s)=>{const{onLoadPage:a}=this.props;this.setState({currentPage:+s.activePage}),a(+s.activePage)})}render(){const{collections:e,isLoading:s,items:a,selectedCollectionId:n,totalCollections:i}=this.props,{currentPage:l}=this.state;if(e.length===0)return null;const d=Math.ceil(i/V);return s?t.jsx(h.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(h.Section,{className:"Collections",children:[e.map(p=>t.jsx(Ha,{collection:p,items:a,isSelected:p.id===n},p.id)),d>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:d,activePage:l,onPageChange:this.handlePageChange}):null]})})}}var te=(o=>(o.COLLECTIONS="collections",o.ORPHAN_ITEMS="orphanItems",o))(te||{});const ee=1;let $a=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",this.getInitialState());c(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});c(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:n,selectedCollectionId:i}=this.props,{pages:l}=this.state;if(e&&!n&&!i){const d=l[l.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:V,page:d})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:i}=this.props,l=this.isCollectionTabActive()?n:a,d=Math.ceil(l/V);if(d>s.length){const p=[...Array(d).keys()].map(u=>u+1).filter(u=>!s.includes(u));if(p.length>0){const u=p[Math.floor(Math.random()*p.length)];this.setState(E=>({pages:[...E.pages,u]}),this.fetchResource)}}i(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[ee]},this.fetchResource)});c(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===te.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=te.COLLECTIONS;return!e&&s&&(a=te.ORPHAN_ITEMS),{pages:[ee],currentTab:a,initialPage:ee,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:i}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&i([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:i,selectedItemId:l,selectedItem:d,orphanItems:p,totalItems:u,visibleItems:E,hasUserOrphanItems:w,onSetItems:A,onFetchOrphanItem:j}=this.props,{initialPage:I,pages:y}=this.state;if(!i&&n&&l&&u&&(I===ee||s.initialPage<I)){if(!p.find(N=>N.id===l)){const N=Math.ceil(u/V),D=y[y.length-1],T=Math.min(N,D+1);y.includes(T)||this.setState({pages:[T],initialPage:T},this.fetchResource)}}else if(e.selectedItemId&&l&&e.selectedItemId!==l){const N=E.filter(D=>D.type!==k.EMOTE);A(N)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!i)&&this.setState({pages:[ee]},this.fetchResource),e.selectedCollectionId!==i&&this.setState({pages:[ee]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&d&&d.type!==k.EMOTE&&A([d]),e.selectedCollectionId!==i&&A([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:i,isReviewing:l}=this.props;return n&&e?ts(e)&&l?s.filter(d=>!!(a!=null&&a.find(p=>p.itemId===d.id&&p.status===oe.PENDING))):s:i}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:i,selectedCollectionId:l,visibleItems:d,bodyShape:p,reviewedItems:u,isReviewing:E,isPlayingEmote:w,isConnected:A,wearableController:j,isLoading:I,hasUserOrphanItems:y,onSetItems:N,onSetReviewedItems:D,onResetReviewedItems:T}=this.props,{pages:g,showSamplesModalAgain:C}=this.state,x=!l&&y,R=this.isCollectionTabActive()&&!l,S=!this.isCollectionTabActive()||l;return t.jsx("div",{className:"LeftPanel",children:A?t.jsx(ua,{id:l,itemSelected:i,itemsPage:g,itemsPageSize:V,fetchCollectionItemsOptions:{status:E?oe.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:F,paginatedItems:Z,initialPage:he,isLoadingCollection:me,isLoadingCollectionItems:pe,itemCurations:ue})=>{const Y=this.getItems(F,Z,ue),ne=this.isCollectionTabActive(),O=l&&F?he:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(ka,{}),x?t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:ne,onClick:()=>this.handleTabChange(te.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(h.Tabs.Tab,{active:!ne,onClick:()=>this.handleTabChange(te.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,R?t.jsx(Va,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Y.length>0,selectedCollectionId:l,onLoadPage:this.loadPage,isLoading:me}):null,S?t.jsxs(t.Fragment,{children:[t.jsx(Wa,{items:Y,totalItems:s||Y.length,hasHeader:!l&&n.length>0,selectedItemId:i,collection:F,isReviewing:E,isPlayingEmote:w,visibleItems:d,bodyShape:p,onResetReviewedItems:T,reviewedItems:u,onSetItems:N,wearableController:j,initialPage:O,isLoading:pe||I,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:C,onReviewItems:()=>D(Y),onLoadRandomPage:()=>this.loadRandomPage(Y),onLoadPage:this.loadPage}),t.jsx(Da,{collectionId:l})]}):null]})}}):null})}};const Ua=o=>{const m=de(),e=Ie(),s=Oe(),a=De(),n=Ct(),i=_(S=>ce(S)),l=_(S=>we(S)),d=_(S=>ss(S)),p=_(S=>as(S)),u=_(S=>rt(S)),E=_(S=>dt(S)),w=_(S=>ct(S)),A=_(S=>Ne(S)),j=_(S=>tt(S)),I=_(S=>s?Me(S,s):null),y=_(S=>{if(e)return Ee(S,e);if(i)return Ee(S,i)}),N=_(S=>e?void 0:ns(S)),D=_(S=>i&&!e?is(S,i,y==null?void 0:y.limit):os(S)),T=b.useMemo(()=>X(j,ds)||X(j,cs),[j]),g=b.useCallback(S=>m(ht(S)),[m]),C=b.useCallback((S,v)=>m(ls(S,v)),[m]),x=b.useCallback((S,v)=>m(mt(S,v)),[m]),R=b.useCallback(S=>m(rs(S)),[m]);return t.jsx($a,{...o,address:i,isConnected:l,items:d,totalItems:(y==null?void 0:y.total)||null,totalCollections:(N==null?void 0:N.total)||null,orphanItems:D,collections:p,selectedItemId:s,selectedItem:I,selectedCollectionId:e,visibleItems:n,bodyShape:u,wearableController:E,isReviewing:a,isLoading:T,isPlayingEmote:w,hasUserOrphanItems:A,onSetItems:g,onFetchCollections:C,onFetchOrphanItems:x,onFetchOrphanItem:R})},Ga=Ua;class xe extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:i}=this.props;if(a.toHexString()!==s.value){const l=n.find(d=>d.toHexString()===s.value);i(l)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(h.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,n=e.toHexString();return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(h.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ya=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:i,onChange:l,baseWearables:d}=this.props,p=s.value?d.find(u=>u.id===s.value):null;a!==p&&l(n,i,p??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:i,baseWearables:l}=this.props,d=hs(l,a,s).map(u=>({value:u.id,text:ms(u)}));i&&d.push({value:"",text:r("global.none")});const p=e?d.find(u=>u.value===e.id):null;return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:d,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:p?p.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const za=o=>({baseWearables:ps(o)}),ge=Ze(za)(Ya);let qa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1,socialEmote:void 0});c(this,"analytics",Re());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:i,onSetItems:l}=this.props,d=a.find(u=>u.id===s),p=n.filter(u=>u.type!==k.EMOTE);p.forEach(u=>{var E;(E=this.analytics)==null||E.track("Play Emote",{EMOTE_PLAYED_BASE:!d,EMOTE_PLAYED_ITEM_ID:d!=null&&d.urn?Se(d.urn):null,EMOTE_PLAYED_NAME:d?d.name:s,PREVIEWED_WEARABLE_ITEM_ID:u!=null&&u.urn?se(u.urn)?lt(u.urn):Se(u.urn):null,PREVIEWED_WEARABLE_NAME:u.name})}),d?p.push(d):i(s),l(p)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(He.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:i}=this.props,l=a.filter(d=>d.type!==k.EMOTE);s?(n(f.PreviewEmote.IDLE),i(l)):e==null||e.emote.play()});c(this,"handleSocialEmoteSelect",e=>{this.setState({socialEmote:e})});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(h.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(h.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,i=s.length>0;return a?null:t.jsx(h.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(h.Dropdown.Menu,{children:[i&&t.jsxs(t.Fragment,{children:[t.jsx(h.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(h.Dropdown.Divider,{}),s.map(l=>t.jsx(h.Dropdown.Item,{value:l.id,text:l.name,onClick:this.handleAnimationChange},l.id)),t.jsx(h.Dropdown.Divider,{}),t.jsx(h.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(h.Dropdown.Divider,{})]}),f.PreviewEmote.schema.enum.map(l=>t.jsx(h.Dropdown.Item,{value:l,text:r(`emotes.${l}`),onClick:this.handleAnimationChange},l))]})})});c(this,"renderEmoteSelector",()=>t.jsx(h.Popup,{content:r("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(h.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:i,onFetchBaseWearables:l,onFetchOrphanItems:d,onFetchCollectionItems:p}=this.props,u=a.length>0;n||l(),u||(s&&!q(s)?p(s.id):e&&i&&d(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const n=s.find(i=>i.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,n?n.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:n,emote:i,selectedBaseWearables:l,selectedItem:d,visibleItems:p,isImportFilesModalOpen:u,wearableController:E}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:A,isLoading:j,socialEmote:I}=this.state,y=p.some(le)&&(d==null?void 0:d.type)===k.EMOTE,N=i===f.PreviewEmote.JUMP?1:void 0;let D;return!I&&(d==null?void 0:d.type)===k.EMOTE&&d.data.startAnimation&&(D={title:"Start Animation",...d.data.startAnimation,loop:!0}),t.jsxs("div",{className:`CenterPanel ${u?"import-files-modal-is-open":""}`,children:[t.jsx(He,{id:"wearable-editor",profile:"default",bodyShape:e,emote:i,zoom:N,skin:be(s),eyes:be(a),hair:be(n),urns:l?Object.values(l).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:p.map(us),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:gs,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:y,showSceneBoundaries:A,socialEmote:I||D}),y&&!j&&E?t.jsx(Cs,{className:"zoom-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E}):null,j&&t.jsx(h.Center,{children:t.jsx(h.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[y&&!j&&E?t.jsx("div",{className:"emote-controls-container",children:t.jsx(h.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(h.Icon,{name:"user"})}),y?!j&&E?t.jsx(Is,{className:"animation-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E,selectedAnimation:I,onSelectAnimation:this.handleSocialEmoteSelect}):null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${A?"active":""}`,children:t.jsx(G,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:f.BodyShape.MALE,text:r("body_shapes.male")},{value:f.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:s,colors:bs(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:a,colors:_s(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:n,colors:xs(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.HAIR],category:f.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.FACIAL_HAIR],category:f.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.UPPER_BODY],category:f.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.LOWER_BODY],category:f.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const Ja=()=>{const o=de(),m=_(ce),e=_(rt),s=_(Es),a=_(vs),n=_(js),i=_(Ss),l=_(fs),d=Ct(),p=_(dt),u=_(ys),E=_(ct),w=_(As),A=_(Ne),j=_(ws),I=Ie(),y=Oe(),N=_(v=>y?Me(v,y):null),D=b.useMemo(()=>I?j.find(v=>v.id===I):void 0,[j,I]),T=b.useMemo(()=>I?u.filter(v=>v.collectionId===I):u.filter(v=>!v.collectionId),[u,I]),g=l?l[e]:null,x=b.useMemo(()=>!d.some(le)&&i===f.PreviewEmote.IDLE,[d,i])?!1:E,R="CreateSingleItemModal"in w,S=b.useMemo(()=>({onSetBodyShape:v=>{o(Ts(v))},onSetAvatarAnimation:v=>{o(Ps(v))},onSetSkinColor:v=>{o(Ns(v))},onSetEyeColor:v=>{o(Rs(v))},onSetHairColor:v=>{o(Ms(v))},onSetBaseWearable:(v,F,Z)=>{o(Ds(v,F,Z))},onFetchBaseWearables:()=>{o(Os())},onSetWearablePreviewController:v=>{o(Ls(v))},onSetItems:v=>{o(ht(v))},onFetchOrphanItems:(v,F)=>{o(mt(v,F))},onFetchCollectionItems:(v,F)=>{o(ks(v,F))}}),[o]);return t.jsx(qa,{address:m,bodyShape:e,collection:D,selectedItem:N,selectedBaseWearables:g,skinColor:s,eyeColor:a,hairColor:n,emote:i,visibleItems:d,wearableController:p,emotes:T,isPlayingEmote:x,isImportFilesModalOpen:R,hasUserOrphanItems:A,...S})},Ka=Ja,Qa="_dynamicInput_ljtxw_1",Xa="_dynamicInputField_ljtxw_8",Za="_noTransition_ljtxw_26",en="_isEditing_ljtxw_41",tn="_dynamicInputEditButton_ljtxw_48",sn="_mirrorSpan_ljtxw_60",K={dynamicInput:Qa,dynamicInputField:Xa,noTransition:Za,isEditing:en,dynamicInputEditButton:tn,mirrorSpan:sn},an=6,It="a-zA-Z0-9\\s_-",nn=new RegExp(`^[${It}]*$`),on=new RegExp(`[^${It}]`,"g"),ln=({value:o,disabled:m=!1,placeholder:e="",editable:s=!1,className:a="",maxLength:n,onChange:i})=>{const[l,d]=b.useState(!1),p=b.useRef(null),u=b.useRef(null),E=b.useRef(null),w=b.useRef(!1),A=b.useCallback(()=>{const x=p.current;x&&(x.classList.add(K.noTransition),E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{x.classList.remove(K.noTransition),E.current=null},120))},[]),j=b.useCallback(()=>{const x=u.current,R=p.current;if(!x||!R||w.current)return;x.textContent=o&&o.length>0?o:e||"​";const v=x.getBoundingClientRect().width+an;R.style.width=`${v}px`},[o,e]);b.useLayoutEffect(()=>{j()},[j]);const I=b.useCallback(x=>{let R=x.target.value;R=R.replace(on,""),o!==R&&i&&i(n?R.slice(0,n):R),A(),requestAnimationFrame(j)},[o,n,i,A,j]),y=b.useCallback(x=>{w.current=!0},[]),N=b.useCallback(x=>{w.current=!1,requestAnimationFrame(j)},[j]),D=b.useCallback(x=>{if(x.key==="Enter"){d(!1);return}x.key.length>1||x.ctrlKey||x.metaKey||x.altKey||nn.test(x.key)||x.preventDefault()},[]),T=b.useCallback(()=>d(!1),[]),g=b.useCallback(()=>{d(!0),setTimeout(()=>{var x;return(x=p.current)==null?void 0:x.focus()},0)},[]),C=s&&!m;return t.jsxs("div",{className:Bs(K.dynamicInput,{[K.isEditing]:l},a),children:[t.jsx("input",{ref:p,value:o,onChange:I,onKeyDown:D,onBlur:T,onCompositionStart:y,onCompositionEnd:N,disabled:m||!l,placeholder:e,maxLength:n,className:K.dynamicInputField}),t.jsx("span",{ref:u,className:K.mirrorSpan,"aria-hidden":"true"}),C&&t.jsx(h.Button,{className:K.dynamicInputEditButton,icon:"pencil alternate",size:"tiny",basic:!0,onClick:g,disabled:m})]})},rn=b.memo(ln);class dn extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,i=e.target.value;s!==i&&n(a?i.slice(0,a):i)})}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 B extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{value:a,onChange:n}=this.props,i=s.value;i!==a&&(this.setState({value:i}),n(i))})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,options:s}=this.props,{value:a}=this.state,n=s.find(i=>i.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:n?n.text:r("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}c(B,"defaultProps",{disabled:!1});class ye extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,i=s.value,l=[...n];for(const d of i)n.includes(d)||l.push(d);l.length!==n.length&&(this.setState({value:l}),a(l))});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,info:s,options:a}=this.props,{value:n}=this.state,i=a.reduce((l,d)=>(l[d.value]=d.text,l),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(Ce,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(l=>t.jsxs("div",{className:"value",children:[i[l],t.jsx("div",{className:"remove",onClick:d=>{this.handleRemove(l),d.stopPropagation()}})]},l)):t.jsx("div",{className:"placeholder",children:r("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(ye,"defaultProps",{disabled:!1});class bt extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{draft:"",value:this.props.value});c(this,"handleChange",e=>{this.setState({draft:e.target.value})});c(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,n=s.trim();if(n!=="")if(a.includes(n))this.setState({draft:""});else{const i=[...a,n];this.setState({value:i,draft:""}),e(i)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===Fs||e.keyCode===Ve||e.keyCode===Ws)this.handleAdd();else if(e.keyCode===Hs||e.keyCode===Ve){const{draft:s,value:a}=this.state,n=a[a.length-1];n&&s===""&&this.handleRemove(n)}});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}render(){const{isDisabled:e}=this.props,{draft:s,value:a}=this.state;return t.jsx("div",{className:`Tags ${a.length>0?"":"blank"} ${e?"is-disabled":""}`.trim(),children:t.jsxs("div",{className:"values",children:[a.map(n=>t.jsxs("div",{className:"value",children:[n,t.jsx("div",{className:"remove",onClick:i=>{this.handleRemove(n),i.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(bt,"defaultProps",{isDisabled:!1});const cn=3;let hn=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Re());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[$e]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;_e(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===f.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===U.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleStartAnimationArmatureAnimationChange",(e,s)=>{const a=this.state.data,n={...a.startAnimation||{}};s===""&&e===f.ArmatureId.Armature_Prop?delete n[e]:n[e]={animation:s},this.setState({data:{...a,startAnimation:n},isDirty:this.isDirty({data:{...a,startAnimation:n}})})});c(this,"handleStartAnimationAudioClipChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.audio=e||void 0,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleStartAnimationPlayModeChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.loop=e,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleRandomizeOutcomesChange",e=>{const s={...this.state.data,randomizeOutcomes:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOutcomeChange",(e,s,a)=>{const n=this.state.data,i=[...n.outcomes];i[e]={...i[e],[s]:a},this.setState({data:{...n,outcomes:i},isDirty:this.isDirty({data:{...n,outcomes:i}})})});c(this,"handleOutcomeClipChange",(e,s,a,n)=>{const i=this.state.data,l=[...i.outcomes||[]],d={...l[e].clips};n===""?delete d[s]:(d[s]||(d[s]={animation:""}),d[s]={...d[s],[a]:n}),l[e]={...l[e],clips:d},this.setState({data:{...i,outcomes:l},isDirty:this.isDirty({data:{...i,outcomes:l}})})});c(this,"handleOutcomeAudioClipChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].audio=s||void 0,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleOutcomePlayModeChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].loop=s,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleAddOutcome",()=>{const e=this.state.data;(!e||!e.outcomes)&&(e.outcomes=[]);const s={title:`Outcome ${e.outcomes.length+1}`,clips:{},loop:!1},a=[...e.outcomes,s];this.setState({data:{...e,outcomes:a},isDirty:this.isDirty({data:{...e,outcomes:a}})})});c(this,"handleRemoveOutcome",e=>{const s=this.state.data,a=s.outcomes.filter((n,i)=>i!==e);this.setState({data:{...s,outcomes:a},isDirty:this.isDirty({data:{...s,outcomes:a}})})});c(this,"handleEditOutcomeTitle",(e,s)=>{this.handleOutcomeChange(e,"title",s)});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(l=>!f.WearableCategory.schema.enum.includes(l)),...e]:n=[...a.filter(l=>!f.BodyPartCategory.schema.enum.includes(l)),...e];const i=this.setHides(this.state.data,n);this.setState({data:i,isDirty:this.isDirty({data:i})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,A;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:i,utility:l,rarity:d,contents:p,data:u,isDirty:E}=this.state;if(E&&e){let j=u;j&&!_e(j)&&(j={...j,removesDefaultHiding:j.category===f.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(f.WearableCategory.UPPER_BODY)?[f.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const I={...e.contents,...await Vs(p)},y={...e,name:n,description:i,rarity:d,data:j,contents:I,utility:l??void 0};s&&[Ue.UNPUBLISHED,Ue.UNDER_REVIEW].includes(s)&&(y.video=I[$e]),a(y,p),se(y.urn)&&((A=this.analytics)==null||A.track("Edit Item",{contents:p})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===k.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=$s(e);this.setState({thumbnail:e,contents:{[Ge]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Ye(a),i=await Ye(a,1024,1024),l=URL.createObjectURL(n);this.setState({thumbnail:l,contents:{[Ge]:i},isDirty:!0})}});c(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;fe(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&&ze(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===f.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||!ot(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}getAnimationOptions(e,s=!1,a){if(!e.isLoaded)return[];if(e.error)return console.warn("Animation data error:",e.error),[];let n=e.animations;if(a){const l=qe(`dummy${a}`);n=e.animations.filter(d=>{const p=qe(d.name),E=Us(d.name)===d.name;return p===l||E})}const i=n.map(l=>({value:l.name,text:l.name}));return s?[{value:"",text:"--"},...i]:i}getAudioOptions(e){const s=new Set,a=Object.keys(e).map(n=>{if(Gs(n)){const i=n.replace(/^(male|female)\//,"");if(!s.has(i))return s.add(i),{value:i,text:i}}return null}).filter(Boolean);return[{value:"",text:"--"},...a]}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||_e(a))return null;const n=Ys(e.contents,a.category),i=zs(e.contents),l=a.hides.filter(p=>n.includes(p)),d=a.hides.filter(p=>i.includes(p));return t.jsxs(t.Fragment,{children:[t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:d,options:this.asCategorySelect(e.type,i),disabled:!s,onChange:p=>this.handleChangeHides(p,"bodypart")}),t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:l,options:this.asCategorySelect(e.type,l.some(p=>p===f.WearableCategory.BODY_SHAPE)?n:n.filter(p=>p!==f.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:p=>this.handleChangeHides(p,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),i=s?t.jsx(h.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(G,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(G,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),i,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(ve,{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(G,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[i,t.jsx(ve,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(qs,{item:e})]})}renderVideoDetails(e){if(!Je(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(G,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Js(e)&&t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Ks,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:i,isCampaignEnabled:l,isVrmOptOutEnabled:d,campaignName:p,campaignTag:u}=this.props,{name:E,description:w,utility:A,rarity:j,data:I,isDirty:y,hasItem:N}=this.state,D=f.Rarity.getRarities(),T=Qs();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(ba,{id:e,children:(g,C,x,R)=>{var Z,he,me,pe,ue,Y,ne;const S=C&&ze(C),v=this.canEditItemMetadata(g),F=g?fe(g)?Xs(g.contents):Zs():[];return x?t.jsx(h.Loader,{size:"massive",active:!0}):N||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),g&&pt(g,s)&&!g.isPublished&&!S?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[je(g)!==null?t.jsx(h.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${je(g)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(ut,{name:E,onDelete:this.handleDeleteItem,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(H,{label:r("item_editor.right_panel.details"),children:g?t.jsxs(t.Fragment,{children:[this.renderModelDetails(g),this.renderVideoDetails(g)]}):null}),t.jsx(H,{label:r("item_editor.right_panel.basics"),children:g?t.jsxs(t.Fragment,{children:[t.jsx(dn,{label:r("global.name"),value:E,disabled:!v,maxLength:ea,onChange:this.handleChangeName}),t.jsx(h.TextAreaField,{maxLength:ta,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!v,value:w,rows:"2",cols:"12"}),a?t.jsx(h.TextAreaField,{maxLength:sa,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!v,value:A,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(B,{itemId:g.id,label:r("global.category"),value:I.category,options:this.asCategorySelect(g.type,F),disabled:!v,onChange:this.handleChangeCategory}),!(g.urn&&se(g.urn))&&t.jsx(B,{itemId:g.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(D),disabled:g.isPublished||!v,onChange:this.handleChangeRarity})]}):null}),(g==null?void 0:g.type)===k.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(Ce,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(g)}),(g==null?void 0:g.type)===k.EMOTE&&(g!=null&&g.metrics)&&aa(g.metrics)&&g.metrics.additionalArmatures?t.jsx(H,{label:r("item_editor.right_panel.animations"),children:t.jsxs("div",{className:"animations-section",children:[t.jsxs(h.Box,{className:"emote-request-state-box",header:t.jsx(h.Header,{className:"emote-start-header",children:"Emote Start"}),children:[t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(he=(Z=I==null?void 0:I.startAnimation)==null?void 0:Z[f.ArmatureId.Armature])==null?void 0:he.animation,options:this.getAnimationOptions(R,!1),disabled:x,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature,O)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(pe=(me=I==null?void 0:I.startAnimation)==null?void 0:me[f.ArmatureId.Armature_Prop])==null?void 0:pe.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature_Prop,O)}),Object.values(g.contents).length>0&&Qe(g)?t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(ue=I==null?void 0:I.startAnimation)==null?void 0:ue.audio,options:this.getAudioOptions(g.contents),onChange:O=>this.handleStartAnimationAudioClipChange(O)}):null,t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:(Y=I==null?void 0:I.startAnimation)!=null&&Y.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),onChange:O=>this.handleStartAnimationPlayModeChange(O===U.LOOP),disabled:!0})]}),I!=null&&I.outcomes&&I.outcomes.length>1?t.jsx(B,{itemId:g.id,label:r("item_editor.right_panel.social_emote.randomize_outcomes"),value:I!=null&&I.randomizeOutcomes?"true":"false",options:[{value:"true",text:"True"},{value:"false",text:"False"}],disabled:x,onChange:O=>this.handleRandomizeOutcomesChange(O==="true")}):null,(I==null?void 0:I.outcomes)&&I.outcomes.length>0&&I.outcomes.map((O,z)=>{var Le,ke,Be;return t.jsxs(h.Box,{className:"outcome-box",header:t.jsxs("div",{className:"outcome-header",children:[t.jsx(rn,{className:"outcome-title-input",value:O.title,editable:!0,maxLength:na,onChange:W=>this.handleEditOutcomeTitle(z,W)}),I.outcomes.length>1?t.jsx(h.Button,{className:"outcome-remove-button",icon:"trash",size:"tiny",basic:!0,onClick:()=>this.handleRemoveOutcome(z),disabled:x,style:{float:"right",marginTop:"-2px"}}):null]}),children:[t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(Le=O.clips[f.ArmatureId.Armature])==null?void 0:Le.animation,options:this.getAnimationOptions(R,!1),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature,"animation",W)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 2 (${r("item_editor.right_panel.social_emote.optional")})`,value:(ke=O.clips[f.ArmatureId.Armature_Other])==null?void 0:ke.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Other,"animation",W)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(Be=O.clips[f.ArmatureId.Armature_Prop])==null?void 0:Be.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Prop,"animation",W)}),Object.values(g.contents).length>0&&Qe(g)?t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:O.audio,options:this.getAudioOptions(g.contents),onChange:W=>this.handleOutcomeAudioClipChange(z,W)}):null,t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:O!=null&&O.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:x,onChange:W=>this.handleOutcomePlayModeChange(z,W===U.LOOP)})]},z)}),((I==null?void 0:I.outcomes)??[]).length<cn?t.jsx(h.Row,{className:"add-outcome-button",align:"left",children:t.jsxs(h.Button,{secondary:!0,size:"small",disabled:x,onClick:this.handleAddOutcome,children:[t.jsx(G,{name:"add"})," ",r("item_editor.right_panel.social_emote.add_outcome")]})}):null]})}):(g==null?void 0:g.type)===k.EMOTE?t.jsx(H,{label:r("item_editor.right_panel.animation"),children:g?t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:I.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:!v,onChange:this.handlePlayModeChange}):null}):null,g&&Je(g)&&((ne=g.data.requiredPermissions)!=null&&ne.length)?t.jsx(H,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(g)}):null,t.jsx(H,{label:r("item_editor.right_panel.tags"),children:g?t.jsxs(t.Fragment,{children:[t.jsx(bt,{itemId:g.id,value:I.tags,onChange:this.handleChangeTags,isDisabled:!v}),l&&p&&u&&v&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:u}),event_name:t.jsx("span",{children:p})})})]}):null}),(g==null?void 0:g.type)===k.WEARABLE&&d&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(h.Checkbox,{toggle:!0,label:I!=null&&I.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(I!=null&&I.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(g==null?void 0:g.type)===k.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(h.Checkbox,{toggle:!0,label:(I==null?void 0:I.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(I==null?void 0:I.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),t.jsx("div",{className:"edit-buttons-container",children:t.jsxs("div",{className:"edit-buttons",children:[t.jsx(h.Button,{secondary:!0,onClick:this.handleOnResetItem,disabled:!y||x,loading:x,children:r("global.revert")}),t.jsx(Xe,{primary:!0,onClick:this.handleOnSaveItem,network:f.Network.MATIC,disabled:!y||x,loading:x,children:r("global.save")})]})}),i&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",i]}):null]})]}):null}}):null})}};const mn=()=>{const o=de(),m=Oe(),e=_(C=>ce(C)),s=_(C=>we(C)),a=_(C=>ia(C)),n=_(C=>oa(C)),i=_(C=>et(C)),l=_(C=>la(C)),d=_(C=>ga(C)),p=_(C=>ra(C)),u=_(C=>da(C)),E=_(C=>m?Me(C,m):null),w=_(C=>m&&E&&E.collectionId?Te(C,E.collectionId):null),A=_(C=>{const x=Ca(C),R=Ia(C);return x==null?void 0:x[R]}),j=_(C=>ca(C)),I=_(C=>!E||!e?!1:w?st(C,e,w):pt(E,e)),y=b.useMemo(()=>m?j[m]:null,[m,j]),N=b.useCallback((C,x)=>o(ha(C,x)),[o]),D=b.useCallback(C=>o(nt(C)),[o]),T=b.useCallback((C,x)=>o(at(C,x)),[o]),g=b.useCallback(C=>o(ma(C)),[o]);return t.jsx(hn,{address:e,collection:w,selectedItem:E,selectedItemId:m,canEditSelectedItem:I,itemStatus:y,error:a,isConnected:s,isDownloading:n,isCommitteeMember:i,isCampaignEnabled:l,campaignTag:d,campaignName:A,isVrmOptOutEnabled:p,isWearableUtilityEnabled:u,onSaveItem:N,onDeleteItem:D,onOpenModal:T,onDownload:g})},pn=mn;class wn extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{reviewedItems:[]});c(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(n=>n.id===a.id))]}))});c(this,"handleResetReviewedItems",()=>{this.setState({reviewedItems:[]})})}render(){const{reviewedItems:e}=this.state;return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"ItemEditorPage",children:[t.jsx(Na,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Ga,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Ka,{}),t.jsx(pn,{})]})]})})}}export{wn as default};
@@ -0,0 +1 @@
1
+ var J=Object.defineProperty;var V=(s,t,a)=>t in s?J(s,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[t]=a;var I=(s,t,a)=>V(s,typeof t!="symbol"?t+"":t,a);import{aG as H,J as l,em as X,N as e,bO as Z,c4 as ee,c5 as se,en as te,eo as ne,M as i,ep as ae,a7 as A,R as f,cN as oe,S as n,aF as le,bP as ie,T as K,bE as ce,ca as re,a2 as Q,eq as de,er as ue,bq as E,es as me,et as ge,Z as pe,eu as he,bJ as W,ev as _e,ak as xe,a4 as be,am as je,ao as Se,O as Ce,aa as Ee,ab as N,cb as ye,Y as De,U as Ne,cT as ke,da as B,cc as Te,a0 as Ie,a1 as fe,a3 as Re,ew as Me,cW as we,ex as Le,d9 as ve,cd as Oe}from"./index-DDLQh72H.js";import{c as Pe}from"./hooks-BR9ATp8C.js";import{B as $e}from"./Back-CDOxIrnn.js";import{N as Fe}from"./NotFound-BxsG7cuR.js";import{S as Ae}from"./SDKTag-ChEtvoIS.js";import{a as U,S as Be}from"./SceneStats.container-ZJOdavL5.js";import"./date-XnshaYAj.js";import"./index-BBxq5T5O.js";const z=H.get("EXPLORER_URL",""),Ue=H.get("WORLDS_CONTENT_SERVER","");let ze=class extends l.PureComponent{constructor(){super(...arguments);I(this,"getHighlightLayer",(a,o)=>(u,_)=>{const{deployment:m,landTiles:g}=this.props,c=ie(u,_),x=g[c];return x&&m.parcels.some(d=>d===c)?{color:a[x.land.role],scale:o}:null});I(this,"renderThumbnail",()=>{const{deployment:a,landTiles:o,project:u}=this.props,[_,m]=X(a.base);return(a.base in o?o[a.base].land.id:null)?e.jsx("div",{className:"atlas-wrapper",children:e.jsx(Z,{x:_,y:m,isDraggable:!1,zoom:.75,layers:[this.getHighlightLayer(ee,1.4),this.getHighlightLayer(se,1.2)]})}):e.jsx("div",{className:"thumbnail-wrapper",children:e.jsx("img",{className:"thumbnail",src:u.thumbnail,alt:u.description})})});I(this,"getExplorerUrl",a=>te?`${z}/?realm=${Ue}/world/${a}&NETWORK=sepolia`:`${z}/world/${a}`)}render(){const{project:a,deployment:o,landTiles:u,history:_,onOpenModal:m}=this.props,g=o.base in u?u[o.base].land.id:null,c=o.world?o.world:o.base,x=ne(a,o);let d=i("scene_detail_page.published");return x===ae.NEEDS_SYNC&&(d=i("scene_detail_page.unsynced")),e.jsxs("div",{className:A("DeploymentDetail",{clickable:g}),onClick:()=>g&&_.push(f.landDetail(g)),children:[this.renderThumbnail(),e.jsx(U,{label:i("scene_detail_page.status"),children:d}),e.jsx(U,{label:i("scene_detail_page.location"),children:e.jsxs("div",{className:A({"world-url":o.world}),children:[c,o.world?e.jsxs(e.Fragment,{children:[e.jsx(oe,{role:"button",text:this.getExplorerUrl(o.world),showPopup:!0,children:e.jsx(n.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:"link copy",name:"copy outline"})}),e.jsx("a",{href:this.getExplorerUrl(o.world),target:"_blank",rel:"noopener noreferrer",children:e.jsx(n.Icon,{name:"external alternate"})})]}):null]})}),e.jsx(Be,{deployment:o}),e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsx(n.Dropdown.Menu,{children:e.jsx(n.Dropdown.Item,{text:i("scene_detail_page.actions.unpublish"),onClick:()=>m("DeployModal",{view:le.CLEAR_DEPLOYMENT,deploymentId:o.id})})})})]})}};const Ge=s=>({landTiles:re(s)}),He=s=>({onOpenModal:(t,a)=>s(Q(t,a))}),Ke=K(Ge,He)(ce(ze)),Qe="https://cdn.decentraland.org/@dcl/builder-site/7.16.1-19644308472.commit-c4256dc/assets/automatic_migrate-DQYv7lI_.webp",We="https://cdn.decentraland.org/@dcl/builder-site/7.16.1-19644308472.commit-c4256dc/assets/migrate_smart_items-D2zNoKEa.webp";var h=(s=>(s.INFO="info",s.MIGRATE="migrate",s))(h||{});function G(s){return s&&s.sdk6?Object.values(s.sdk6.components).filter(a=>a.type===de.Script).length:0}const Ye="_modalContainer_5geih_1",qe="_subtitle_5geih_20",Je="_content_5geih_27",Ve="_actions_5geih_35",Xe="_loadingMessage_5geih_53",Ze="_loader_5geih_57",C={modalContainer:Ye,subtitle:qe,content:Je,actions:Ve,loadingMessage:Xe,loader:Ze};function es({project:s,scene:t,isLoading:a,isSavingSDK6Copy:o,isSavingScene:u,onNavigate:_,onClose:m,onMigrateScene:g}){const[c,x]=l.useState(h.INFO),[d,y]=l.useState(!1),b=l.useMemo(()=>G(t)>0,[t]),j=l.useCallback(()=>{x(h.INFO)},[]),r=l.useCallback(()=>{a||m()},[a,m]),S=l.useCallback(()=>{switch(c){case h.INFO:return ue;case h.MIGRATE:return s!=null&&s.thumbnail?s.thumbnail:b?We:Qe}},[c,b,s]),R=l.useCallback(()=>{switch(c){case h.INFO:x(h.MIGRATE);break;case h.MIGRATE:s&&g(s,d);break}},[c,d,s,g]),M=()=>c===h.MIGRATE&&b?{smartItemsCount:G(t)}:{},w=()=>!a||c!==h.MIGRATE?e.jsx(n.Button,{disabled:a,primary:!0,onClick:R,children:i(`migrate_to_sdk7_modal.${D}.action`)}):o?e.jsxs("span",{className:C.loadingMessage,children:[e.jsx(n.Loader,{size:"tiny",inline:!0,className:C.loader}),i("migrate_to_sdk7_modal.saving_copy")]}):u?e.jsxs("span",{className:C.loadingMessage,children:[e.jsx(n.Loader,{size:"tiny"}),i("migrate_to_sdk7_modal.migrating_scene")]}):null,D=b?`${c}_smart_items`:c,L=!a&&(c!==h.MIGRATE||b);return e.jsxs(n.Modal,{open:!0,className:C.modalContainer,onClose:r,children:[e.jsx(n.ModalNavigation,{title:i(`migrate_to_sdk7_modal.${D}.title`),onBack:c!==h.INFO?j:void 0,onClose:r}),e.jsxs(n.ModalContent,{className:C.content,children:[e.jsx("p",{className:C.subtitle,children:i(`migrate_to_sdk7_modal.${D}.subtitle`,{b:k=>e.jsx("b",{children:k}),br:()=>e.jsx("br",{}),...M()})}),e.jsx("div",{style:{width:"648px",height:"324px",backgroundPosition:"center",backgroundSize:"cover",backgroundImage:`url(${S()}`}}),c===h.MIGRATE&&e.jsx(n.Checkbox,{disabled:a,checked:d,label:i("migrate_to_sdk7_modal.save_a_copy"),onChange:(k,{checked:v})=>{y(!!v)}})]}),e.jsxs(n.ModalActions,{className:C.actions,children:[w(),L&&e.jsx(n.Button,{disabled:a,secondary:!0,onClick:()=>_(f.sceneEditor(s==null?void 0:s.id)),children:i("migrate_to_sdk7_modal.use_legacy_builder")})]})]})}const ss=(s,t)=>{var a,o;return{isLoading:E(ge(s),me),isSavingScene:!!((a=t.project)!=null&&a.id)&&pe(s).has((o=t.project)==null?void 0:o.id),isSavingSDK6Copy:E(W(s),he)}},ts=s=>({onMigrateScene:(t,a)=>s(_e(t,a))}),ns=K(ss,ts)(es),as=s=>{const{project:t,scene:a,isLoading:o,deployments:u,onOpenModal:_,onDelete:m,onDuplicate:g,onLoadProjectScene:c}=s,[x,d]=l.useState(!1),[y,b]=l.useState(!1),j=be();l.useEffect(()=>{t&&!a&&c(t)},[t,a,c]);const r=()=>e.jsx(n.Center,{children:e.jsx(n.Loader,{active:!0,size:"large"})}),S=()=>e.jsx(Fe,{}),R=l.useCallback(()=>{_("EditProjectModal")},[_]),M=l.useCallback(()=>{d(!0)},[d]),w=l.useCallback(()=>{g(t)},[t,g]),D=l.useCallback(()=>{m(t),d(!1)},[t,m,d]),L=l.useCallback(()=>{d(!1)},[d]),k=l.useCallback(()=>{a!=null&&a.sdk6?b(!0):j.push(f.inspector(t==null?void 0:t.id))},[t,a,j]),v=()=>{const{project:p,isLoading:T,isLoadingDeployments:O}=s;return T||O||!p?null:e.jsx(Ce,{projectId:p.id,className:"deployment-status"})},$=l.useCallback(p=>{j.push(p)},[j]),Y=(p,T)=>{const{isLoadingDeployments:O,onOpenModal:q,scene:P}=s;return e.jsxs(e.Fragment,{children:[e.jsxs(n.Section,{size:"large",children:[e.jsxs(n.Row,{children:[e.jsx(n.Column,{children:e.jsxs(n.Row,{children:[e.jsx($e,{absolute:!0,onClick:()=>$(f.scenes())}),e.jsxs(n.Header,{className:"name",children:[p.title,e.jsx(n.Icon,{name:"edit outline",onClick:R})]})]})}),e.jsx(n.Column,{className:"actions",align:"right",children:e.jsxs(n.Row,{children:[e.jsxs(n.Button,{inverted:!0,className:"download-button",onClick:()=>q("ExportModal",{project:p}),children:[e.jsx(n.Icon,{name:"download"}),i("scene_detail_page.download_scene")]}),e.jsxs(n.Button,{primary:!0,className:"edit-button",disabled:!P,loading:!P,onClick:k,children:[e.jsx(n.Icon,{name:"edit outline"}),i("scene_detail_page.edit_scene")]}),e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("scene_detail_page.actions.duplicate"),onClick:w}),e.jsx(n.Dropdown.Item,{text:i("scene_detail_page.actions.delete"),onClick:M})]})})]})})]}),e.jsxs(n.Row,{className:"status-container",children:[v(),e.jsx(Ae,{scene:P})]})]}),e.jsx(n.Section,{children:e.jsx("div",{className:"header-image",style:{backgroundImage:p.thumbnail?`url(${p.thumbnail})`:""}})}),e.jsxs(n.Section,{className:p.description?"":"no-margin-bottom",children:[e.jsx(n.Header,{sub:!0,children:i("scene_detail_page.published_in")}),O?e.jsx(n.Loader,{active:!0,size:"small"}):T.length===0?e.jsxs(n.Empty,{className:"empty-deployments-container",children:[e.jsx("div",{className:"empty-deployments-thumbnail"}),i("scene_detail_page.no_deployments")]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"deployments",children:T.map(F=>e.jsx(Ke,{project:p,deployment:F},F.id))}),e.jsx("div",{className:"notice",children:i("analytics.notice")})]})]}),p.description?e.jsxs(n.Section,{className:"description no-margin-bottom",children:[e.jsx(n.Header,{sub:!0,children:i("scene_detail_page.description")}),e.jsx("p",{className:"description-content",children:p.description})]}):null]})};return e.jsxs(e.Fragment,{children:[e.jsx(je,{}),e.jsxs(n.Page,{className:"SceneDetailPage",isFullscreen:!0,children:[o&&!t?r():null,!o&&!t?S():null,t?e.jsxs(e.Fragment,{children:[Y(t,u),e.jsx(n.Confirm,{size:"tiny",open:x,header:i("project_card.confirm_delete_header",{title:t.title}),content:i("project_card.confirm_delete_content",{title:t.title}),confirmButton:e.jsx(n.Button,{primary:!0,children:i("global.confirm")}),cancelButton:e.jsx(n.Button,{secondary:!0,children:i("global.cancel")}),onCancel:L,onConfirm:D})]}):null,y&&e.jsx(ns,{project:t,scene:a,onNavigate:$,onClose:()=>b(!1)})]}),e.jsx(Se,{})]})},os=xe.memo(as),ls=()=>{const s=Ee(),t=Pe(),a=N(ye),o=l.useMemo(()=>t&&t in a?a[t]:null,[t,a]),u=N(De),_=l.useMemo(()=>t&&t in u?u[t]:[],[t,u]),m=N(Ne),g=l.useMemo(()=>o&&m[o.sceneId],[o,m]),c=N(r=>E(W(r),Me)),x=N(r=>E(ke(r),we)||E(B(r),Le)||E(B(r),ve)||E(Te(r),Oe)),d=l.useCallback((r,S)=>s(Q(r,S)),[s]),y=l.useCallback(r=>s(Ie(r)),[s]),b=l.useCallback(r=>s(fe(r)),[s]),j=l.useCallback((r,S)=>s(Re(r,S)),[s]);return e.jsx(os,{project:o,deployments:_,scene:g,isLoading:c,isLoadingDeployments:x,onOpenModal:d,onDelete:y,onDuplicate:b,onLoadProjectScene:j})},xs=ls;export{xs as default};
@@ -1 +1 @@
1
- var y=Object.defineProperty;var b=(o,r,e)=>r in o?y(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e;var d=(o,r,e)=>b(o,typeof r!="symbol"?r+"":r,e);import{J as g,aF as E,N as s,Q as F,R as v,P as C,M as h,T as I,U as L,X as M,a2 as P,bu as i,am as A,S as l,ao as w,aa as D,a4 as T,b1 as B,ab as m,ah as R,bv as k,bw as O,bx as U,aj as W,by as _,bz as z,bn as G,bA as V,ai as $}from"./index-BpSWUH3N.js";import{B as H}from"./Back-D94RsYQI.js";const K=["page","sortBy","sortOrder","group","ethAddress"];var j;let Z=(j=class extends g.PureComponent{constructor(){super(...arguments);d(this,"state",{isDeleting:!1});d(this,"handleOnClick",()=>{const{onClick:e,pool:t}=this.props;e&&e(t)});d(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});d(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});d(this,"handleClearDeployment",()=>{const{pool:e,onOpenModal:t}=this.props;t("DeployModal",{view:E.CLEAR_DEPLOYMENT,projectId:e.id})})}render(){const{pool:e}=this.props,t=e.statistics?e.statistics.parcels:e.layout.cols*e.layout.rows;return s.jsxs(F,{to:v.poolView(e.id,"pool"),className:"PoolCard",children:[s.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${e.thumbnail})`}}),s.jsxs("div",{className:"project-data",children:[s.jsx("div",{className:"title-wrapper",children:s.jsx("div",{className:"title",children:e.title})}),s.jsx("div",{className:"description",title:e.description,children:s.jsxs("div",{className:"component-list",children:[s.jsxs("div",{className:"component",children:[s.jsx(C,{name:"scene-parcel"})," ",h("public_page.parcel_count",{parcels:t})]}),e.statistics&&s.jsxs("div",{className:"component",children:[s.jsx(C,{name:"scene-object"})," ",h("public_page.item_count",{items:e.statistics.transforms})]})]})})]})]})}},d(j,"defaultProps",{items:0}),j);const q=(o,r)=>{const{pool:e}=r,t=L(o)[e.sceneId];return{items:t&&t.sdk6?t.sdk6.metrics.entities:0,deploymentStatus:M(o)[r.pool.id]}},J=o=>({onOpenModal:(r,e)=>o(P(r,e))}),Q=I(q,J)(Z);let X=class extends g.PureComponent{constructor(){super(...arguments);d(this,"handleChangeGroup",(e,t)=>{const{group:n,...a}=this.getFilters(),c=1;t.value==="all"?this.handleChangeFilters({...a,page:c}):this.handleChangeFilters({...a,page:c,group:t.value})});d(this,"handleChangeUser",(e,t)=>{const{ethAddress:n,...a}=this.getFilters(),c=1;t.value==="all"?this.handleChangeFilters({...a,page:c}):this.handleChangeFilters({...a,page:c,ethAddress:t.value})});d(this,"handleChangeSort",(e,t)=>{const n=this.getFilters(),a=1;if(t.value&&n.sortBy!==t.value)switch(t.value){case i.NAME:this.handleChangeFilters({...n,page:a,sortBy:t.value,sortOrder:"asc"});break;default:this.handleChangeFilters({...n,page:a,sortBy:t.value,sortOrder:"desc"})}});d(this,"handlePageChange",(e,t)=>{const n=this.getFilters(),a=Number(t.activePage);!Number.isNaN(a)&&a>0&&this.handleChangeFilters({...n,page:a})});d(this,"handleNavigateToScenes",()=>{const{history:e}=this.props;e.push(v.scenes())})}componentDidMount(){const{location:e}=this.props,t=this.getFilters();(e.search===""||e.search==="?")&&(t.sortBy=i.NEWEST,t.sortOrder="desc"),this.handleChangeFilters(t)}getFilters(e=this.props){return K.reduce((t,n)=>{const a=e[n];return a!==void 0&&(t[n]=a),t},{})}handleChangeFilters(e){const{history:t,onLoadPools:n}=this.props;t.push(v.poolSearch(e)),n(e)}render(){const{pools:e,total:t,totalPages:n,isLoggedIn:a}=this.props,c=this.getFilters(),u={firstItem:null,lastItem:null};return c.page===1&&(u.prevItem=null),c.page===n&&(u.nextItem=null),s.jsxs(s.Fragment,{children:[s.jsx(A,{}),s.jsx(l.Page,{isFullscreen:!0,children:s.jsxs("div",{className:"SceneListPage",children:[s.jsxs(l.Container,{children:[s.jsx(l.Section,{className:"navigation",children:s.jsxs(l.Row,{children:[s.jsx(H,{absolute:!0,onClick:this.handleNavigateToScenes}),s.jsx(l.Narrow,{children:s.jsxs(l.Row,{children:[s.jsx(l.Column,{children:s.jsx(l.Row,{children:s.jsx(l.Header,{size:"large",children:h("scene_list_page.projects_title")})})}),s.jsx(l.Column,{align:"right",children:s.jsxs(l.Row,{children:[s.jsx(l.Responsive,{minWidth:1025,as:g.Fragment,children:a&&s.jsx(l.Dropdown,{direction:"left",value:c.ethAddress||"all",options:[{value:"all",text:h("scene_list_page.filters.all_users")},{value:"me",text:h("scene_list_page.filters.only_me")}],onChange:this.handleChangeUser})}),s.jsx(l.Dropdown,{direction:"left",value:c.sortBy,options:[{value:i.NEWEST,text:h("scene_list_page.filters.newest")},{value:i.NAME,text:h("scene_list_page.filters.name")},{value:i.LIKES,text:h("scene_list_page.filters.likes")},{value:i.ITEMS,text:h("scene_list_page.filters.items")},{value:i.SMART_ITEMS,text:h("scene_list_page.filters.smart_items")},{value:i.SIZE,text:h("scene_list_page.filters.size")}],onChange:this.handleChangeSort})]})})]})})]})}),s.jsx(l.Narrow,{children:s.jsxs("div",{className:"PoolCardList",children:[e===null&&s.jsx(l.Loader,{active:!0,size:"huge"}),Array.isArray(e)&&t===0&&s.jsx("div",{className:"empty-projects",children:h("scene_list_page.no_projects")}),Array.isArray(e)&&t!==0&&s.jsx(s.Fragment,{children:e.map(x=>s.jsx(Q,{pool:x},x.id))})]})})]}),s.jsx(l.Container,{children:t!==null&&n!==null&&s.jsx(l.Pagination,{totalPages:n,activePage:c.page,onPageChange:this.handlePageChange,...u})})]})}),s.jsx(w,{})]})}};const Y=()=>{const o=D(),r=T(),e=B(),t=m(R),n=m(k),a=m(O),c=m(U),u=m(W),x=g.useMemo(()=>{const p=new URLSearchParams(e.search);return{group:_(p.get("group")),ethAddress:_(p.get("eth_address")),page:z(p.get("page"),1),sortBy:G(p.get("sort_by")??"",[i.NEWEST,i.LIKES,i.NAME,i.SIZE,i.ITEMS,i.SMART_ITEMS],i.NEWEST),sortOrder:V(p.get("sort_order"),"desc")}},[e.search]),S=g.useCallback((p,N)=>o(P(p,N)),[o]),f=g.useCallback(p=>o($(p)),[o]);return s.jsx(X,{pools:t,poolGroups:n,total:a,totalPages:c,isLoggedIn:u,onOpenModal:S,onLoadPools:f,history:r,location:e,...x})},le=Y;export{le as default};
1
+ var y=Object.defineProperty;var b=(o,r,e)=>r in o?y(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e;var d=(o,r,e)=>b(o,typeof r!="symbol"?r+"":r,e);import{J as g,aF as E,N as s,Q as F,R as v,P as C,M as h,T as I,U as L,X as M,a2 as P,bu as i,am as A,S as l,ao as w,aa as D,a4 as T,b1 as B,ab as m,ah as R,bv as k,bw as O,bx as U,aj as W,by as _,bz as z,bn as G,bA as V,ai as $}from"./index-DDLQh72H.js";import{B as H}from"./Back-CDOxIrnn.js";const K=["page","sortBy","sortOrder","group","ethAddress"];var j;let Z=(j=class extends g.PureComponent{constructor(){super(...arguments);d(this,"state",{isDeleting:!1});d(this,"handleOnClick",()=>{const{onClick:e,pool:t}=this.props;e&&e(t)});d(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});d(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});d(this,"handleClearDeployment",()=>{const{pool:e,onOpenModal:t}=this.props;t("DeployModal",{view:E.CLEAR_DEPLOYMENT,projectId:e.id})})}render(){const{pool:e}=this.props,t=e.statistics?e.statistics.parcels:e.layout.cols*e.layout.rows;return s.jsxs(F,{to:v.poolView(e.id,"pool"),className:"PoolCard",children:[s.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${e.thumbnail})`}}),s.jsxs("div",{className:"project-data",children:[s.jsx("div",{className:"title-wrapper",children:s.jsx("div",{className:"title",children:e.title})}),s.jsx("div",{className:"description",title:e.description,children:s.jsxs("div",{className:"component-list",children:[s.jsxs("div",{className:"component",children:[s.jsx(C,{name:"scene-parcel"})," ",h("public_page.parcel_count",{parcels:t})]}),e.statistics&&s.jsxs("div",{className:"component",children:[s.jsx(C,{name:"scene-object"})," ",h("public_page.item_count",{items:e.statistics.transforms})]})]})})]})]})}},d(j,"defaultProps",{items:0}),j);const q=(o,r)=>{const{pool:e}=r,t=L(o)[e.sceneId];return{items:t&&t.sdk6?t.sdk6.metrics.entities:0,deploymentStatus:M(o)[r.pool.id]}},J=o=>({onOpenModal:(r,e)=>o(P(r,e))}),Q=I(q,J)(Z);let X=class extends g.PureComponent{constructor(){super(...arguments);d(this,"handleChangeGroup",(e,t)=>{const{group:n,...a}=this.getFilters(),c=1;t.value==="all"?this.handleChangeFilters({...a,page:c}):this.handleChangeFilters({...a,page:c,group:t.value})});d(this,"handleChangeUser",(e,t)=>{const{ethAddress:n,...a}=this.getFilters(),c=1;t.value==="all"?this.handleChangeFilters({...a,page:c}):this.handleChangeFilters({...a,page:c,ethAddress:t.value})});d(this,"handleChangeSort",(e,t)=>{const n=this.getFilters(),a=1;if(t.value&&n.sortBy!==t.value)switch(t.value){case i.NAME:this.handleChangeFilters({...n,page:a,sortBy:t.value,sortOrder:"asc"});break;default:this.handleChangeFilters({...n,page:a,sortBy:t.value,sortOrder:"desc"})}});d(this,"handlePageChange",(e,t)=>{const n=this.getFilters(),a=Number(t.activePage);!Number.isNaN(a)&&a>0&&this.handleChangeFilters({...n,page:a})});d(this,"handleNavigateToScenes",()=>{const{history:e}=this.props;e.push(v.scenes())})}componentDidMount(){const{location:e}=this.props,t=this.getFilters();(e.search===""||e.search==="?")&&(t.sortBy=i.NEWEST,t.sortOrder="desc"),this.handleChangeFilters(t)}getFilters(e=this.props){return K.reduce((t,n)=>{const a=e[n];return a!==void 0&&(t[n]=a),t},{})}handleChangeFilters(e){const{history:t,onLoadPools:n}=this.props;t.push(v.poolSearch(e)),n(e)}render(){const{pools:e,total:t,totalPages:n,isLoggedIn:a}=this.props,c=this.getFilters(),u={firstItem:null,lastItem:null};return c.page===1&&(u.prevItem=null),c.page===n&&(u.nextItem=null),s.jsxs(s.Fragment,{children:[s.jsx(A,{}),s.jsx(l.Page,{isFullscreen:!0,children:s.jsxs("div",{className:"SceneListPage",children:[s.jsxs(l.Container,{children:[s.jsx(l.Section,{className:"navigation",children:s.jsxs(l.Row,{children:[s.jsx(H,{absolute:!0,onClick:this.handleNavigateToScenes}),s.jsx(l.Narrow,{children:s.jsxs(l.Row,{children:[s.jsx(l.Column,{children:s.jsx(l.Row,{children:s.jsx(l.Header,{size:"large",children:h("scene_list_page.projects_title")})})}),s.jsx(l.Column,{align:"right",children:s.jsxs(l.Row,{children:[s.jsx(l.Responsive,{minWidth:1025,as:g.Fragment,children:a&&s.jsx(l.Dropdown,{direction:"left",value:c.ethAddress||"all",options:[{value:"all",text:h("scene_list_page.filters.all_users")},{value:"me",text:h("scene_list_page.filters.only_me")}],onChange:this.handleChangeUser})}),s.jsx(l.Dropdown,{direction:"left",value:c.sortBy,options:[{value:i.NEWEST,text:h("scene_list_page.filters.newest")},{value:i.NAME,text:h("scene_list_page.filters.name")},{value:i.LIKES,text:h("scene_list_page.filters.likes")},{value:i.ITEMS,text:h("scene_list_page.filters.items")},{value:i.SMART_ITEMS,text:h("scene_list_page.filters.smart_items")},{value:i.SIZE,text:h("scene_list_page.filters.size")}],onChange:this.handleChangeSort})]})})]})})]})}),s.jsx(l.Narrow,{children:s.jsxs("div",{className:"PoolCardList",children:[e===null&&s.jsx(l.Loader,{active:!0,size:"huge"}),Array.isArray(e)&&t===0&&s.jsx("div",{className:"empty-projects",children:h("scene_list_page.no_projects")}),Array.isArray(e)&&t!==0&&s.jsx(s.Fragment,{children:e.map(x=>s.jsx(Q,{pool:x},x.id))})]})})]}),s.jsx(l.Container,{children:t!==null&&n!==null&&s.jsx(l.Pagination,{totalPages:n,activePage:c.page,onPageChange:this.handlePageChange,...u})})]})}),s.jsx(w,{})]})}};const Y=()=>{const o=D(),r=T(),e=B(),t=m(R),n=m(k),a=m(O),c=m(U),u=m(W),x=g.useMemo(()=>{const p=new URLSearchParams(e.search);return{group:_(p.get("group")),ethAddress:_(p.get("eth_address")),page:z(p.get("page"),1),sortBy:G(p.get("sort_by")??"",[i.NEWEST,i.LIKES,i.NAME,i.SIZE,i.ITEMS,i.SMART_ITEMS],i.NEWEST),sortOrder:V(p.get("sort_order"),"desc")}},[e.search]),S=g.useCallback((p,N)=>o(P(p,N)),[o]),f=g.useCallback(p=>o($(p)),[o]);return s.jsx(X,{pools:t,poolGroups:n,total:a,totalPages:c,isLoggedIn:u,onOpenModal:S,onLoadPools:f,history:r,location:e,...x})},le=Y;export{le as default};
@@ -1 +1 @@
1
- import{b4 as _,a4 as b,J as c,R as d,N as s,am as x,S as l,M as n,hZ as g,P as h,ao as k,T as v,h_ as C,h$ as j}from"./index-BpSWUH3N.js";import{b as N,N as T}from"./Navigation.container-Bvr99qLy.js";import"./selectors-Hr22Peqo.js";var r=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(r||{});const S="_titleContainer_5ka3v_1",E="_backButton_5ka3v_8",B="_title_5ka3v_1",f="_templates_5ka3v_26",I="_subtitle_5ka3v_32",a={titleContainer:S,backButton:E,title:B,templates:f,subtitle:I},y=({templates:e,onLoadTemplates:u})=>{const i=_(),o=b();c.useEffect(()=>{u()},[u]);const m=c.useCallback(()=>{o.push(d.scenes())},[o]),p=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(x,{}),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:m,"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(g,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:a.subtitle,children:[s.jsx(h,{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:p.bind(null,t)},t.id))})]}),s.jsx(k,{})]})},P=e=>({templates:C(e)}),A=e=>({onLoadTemplates:()=>e(j())}),R=v(P,A)(y);export{R as default};
1
+ import{b4 as _,a4 as b,J as c,R as d,N as s,am as x,S as l,M as n,hZ as g,P as h,ao as k,T as v,h_ as C,h$ as j}from"./index-DDLQh72H.js";import{b as N,N as T}from"./Navigation.container-DdDz8aQR.js";import"./selectors-BFWzed6x.js";var r=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(r||{});const S="_titleContainer_5ka3v_1",E="_backButton_5ka3v_8",B="_title_5ka3v_1",f="_templates_5ka3v_26",I="_subtitle_5ka3v_32",a={titleContainer:S,backButton:E,title:B,templates:f,subtitle:I},y=({templates:e,onLoadTemplates:u})=>{const i=_(),o=b();c.useEffect(()=>{u()},[u]);const m=c.useCallback(()=>{o.push(d.scenes())},[o]),p=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(x,{}),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:m,"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(g,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:a.subtitle,children:[s.jsx(h,{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:p.bind(null,t)},t.id))})]}),s.jsx(k,{})]})},P=e=>({templates:C(e)}),A=e=>({onLoadTemplates:()=>e(j())}),R=v(P,A)(y);export{R as default};
@@ -0,0 +1 @@
1
+ import{T as g,aj as n,ac as a,ad as i}from"./index-DDLQh72H.js";import{H as s}from"./Navigation.container-DdDz8aQR.js";import"./selectors-BFWzed6x.js";const e=o=>({isLoggedIn:n(o),isLoggingIn:a(o)||i(o)}),r=g(e)(s);export{r as default};
@@ -1 +1 @@
1
- ._image_142g7_1,._main_142g7_2{position:relative;width:64px;height:64px;border-radius:50%!important}._image_142g7_1{overflow:hidden}._network_142g7_13{position:absolute;bottom:0;right:0;width:32px;height:32px;z-index:1}._ellipsis_4huv2_1{margin:auto!important;color:var(--primary-text)}._itemImage_1y9df_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1y9df_10{margin-right:4px}._grid_1y9df_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider)}._grid_1y9df_14:hover{background-color:#24212966;color:var(--text)}._row_1y9df_25{align-items:center!important;font-size:15px}._column_1y9df_30{display:flex!important}._statusColumn_1y9df_34{font-size:13px;text-transform:uppercase}._statusColumn_1y9df_34._synced_1y9df_39{color:#34ce76}._statusColumn_1y9df_34._unsynced_1y9df_43{color:#fc9965}._avatarColumn_1y9df_47{align-items:center;padding-left:10px!important}._nameWrapper_1y9df_52{display:flex;align-items:center;overflow:hidden}._name_1y9df_52{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1y9df_65{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1y9df_72{margin-left:5px}._status_rgxu1_1{text-transform:uppercase;padding:4px 8px;border-radius:32px;display:inline-flex;align-items:center;gap:4px}._status_rgxu1_1 .icon{height:18px}._pending_migration_rgxu1_14{color:#ffbc5b;background-color:#ffbc5b33}._synced_rgxu1_19{color:#65d890;background-color:#65d89033}._unpublished_rgxu1_24,._unsynced_rgxu1_25{color:#63b4f6;background-color:#63b4f633}._pending_mapping_rgxu1_30,._under_review_rgxu1_31{color:#ecebed;background-color:#ecebed33}._icon_rgxu1_10{width:17px;height:17px}._itemImage_1rili_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1rili_10{margin-right:4px}._grid_1rili_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider);position:relative}._grid_1rili_14:not(._loading_1rili_21):hover{background-color:#24212966;color:var(--text)}._row_1rili_26{align-items:center!important;font-size:15px}._column_1rili_31{display:flex!important}._avatarColumn_1rili_35{align-items:center;padding-left:10px!important}._nameWrapper_1rili_40{display:flex;align-items:center;overflow:hidden}._name_1rili_40{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1rili_53{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1rili_60{margin-left:5px}._overlay_1rili_65{position:absolute;pointer-events:none;z-index:100000000;top:0;left:0;width:100%;height:100%;background-color:#00000046;z-index:1000;display:flex;justify-content:center;align-items:center}._itemCheckbox_2k9qa_1{margin-right:10px}._gridHeader_2k9qa_5.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_2k9qa_5.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_2k9qa_5.ui.grid>.row>.column._itemColumn_2k9qa_15{display:flex;align-items:center}._gridHeader_4acv6_1.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_4acv6_1.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_4acv6_1.ui.grid>.row>.column._itemColumn_4acv6_11{display:flex;align-items:center}._itemCheckbox_4acv6_16{margin-right:10px}._linkedToColumn_4acv6_20>span{margin-right:6px}._main_16i8r_3,._main_16i8r_3>.ui.container{display:flex;flex-direction:column;min-height:0;flex:1}._slots_16i8r_11{font-weight:700;text-transform:uppercase;position:relative}._slots_16i8r_11:before{content:"";display:inline-block;background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23FF2D55'/%3e%3c/svg%3e");width:16px;height:16px;top:3px;position:relative;margin-right:8px}.button._slots_16i8r_11._empty_16i8r_28:before{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23736E7D'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23736E7D'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23736E7D'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23736E7D'/%3e%3c/svg%3e")}._searchContainer_16i8r_32{display:flex;align-items:center;justify-content:end}._searchContainer_16i8r_32 .dcl.text-filter{flex:1}._searchContainer_16i8r_32 ._searchInfo_16i8r_42{color:var(--secondary-text)}._syncedStatusList_16i8r_46.ui.dropdown{margin-left:25px;padding-left:7px;margin-right:10px;color:var(--primary)}._selectionInfo_16i8r_53{display:flex;justify-content:center;align-items:center;margin-bottom:20px;padding:10px 0;border:1px solid var(--secondary-text);border-radius:4px}._header_16i8r_63{display:flex;flex-direction:row;align-items:center;gap:16px;padding-right:142px;padding-left:90px;min-width:1400px;width:100%}._header_16i8r_63 ._content_16i8r_74{display:flex;flex-direction:row;background-color:#242129;padding:24px;width:calc(100% - 50px);border-radius:8px}._header_16i8r_63 ._title_16i8r_83{display:flex;flex-direction:row;align-items:center;gap:12px;overflow:hidden;margin-right:20px;flex:1 1 auto;min-width:0}._editCollectionName_16i8r_96{visibility:hidden;padding-left:16px}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101:hover+._editCollectionName_16i8r_96{visibility:visible}._nameAndType_16i8r_105{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}._nameWrapper_16i8r_115{display:flex;flex-direction:row;align-items:center;gap:15px;min-width:0;flex:1}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101{margin-top:0;margin-bottom:0;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;min-width:0;width:fit-content}._header_16i8r_63 ._title_16i8r_83 ._size_16i8r_139{font-size:16px}._header_16i8r_63 ._actions_16i8r_143{display:flex;flex-direction:row;align-items:center;gap:16px;flex:0 0 auto}._body_16i8r_151{display:flex;flex-direction:column;padding-right:142px;padding-left:142px;margin-top:16px;gap:16px;min-width:1400px;flex:1}._info_16i8r_162{display:flex;flex-direction:row;gap:10px;align-items:center;font-weight:600}._infoHeader_16i8r_170{display:flex;flex-direction:row;text-transform:uppercase;color:#a09ba8;gap:10px}._infoContent_16i8r_178{display:flex;flex-direction:row;align-items:center;gap:5px;border-radius:6px;padding:8px;background-color:#43404a}._info_16i8r_162 .dui-info-tooltip__trigger{background-repeat:no-repeat;background-size:cover;height:20px;width:20px}._slotsIcon_16i8r_195{background-color:#5e5b67;border-radius:32px;padding:2px;height:24px;width:24px;background-image:url("data:image/svg+xml,%3csvg%20width='19'%20height='14'%20viewBox='0%200%2019%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%204H4V0H2C0.9%200%200%200.9%200%202V4ZM0%209H4V5H0V9ZM5%209H9V5H5V9ZM10%209H14V5H10V9ZM5%204H9V0H5V4ZM10%200V4H14V0H10ZM15%209H19V5H15V9ZM2%2014H4V10H0V12C0%2013.1%200.9%2014%202%2014ZM5%2014H9V10H5V14ZM10%2014H14V10H10V14ZM15%2014H17C18.1%2014%2019%2013.1%2019%2012V10H15V14ZM15%200V4H19V2C19%200.9%2018.1%200%2017%200H15Z'%20fill='white'/%3e%3c/svg%3e");background-size:70%;background-position:center;background-repeat:no-repeat}._copyButton_16i8r_207{cursor:pointer}._empty_16i8r_28{padding:200px 0;width:100%;border-radius:8px;justify-content:center;color:var(--secondary-text);text-align:center;line-height:22px;font-size:15px;background-color:#242129}._empty_16i8r_28 h3{color:#cfcdd4;margin-bottom:5px}._empty_16i8r_28 p{color:#a09ba8}._sparkles_16i8r_232{width:54px;height:56px;background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.16.0/assets/sparkles-C-WJN0Gh.svg);background-repeat:no-repeat;margin:auto auto 20px}._start_16i8r_241{width:80px;height:80px;background-image:url("data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_6709_15241)'%3e%3cpath%20d='M20%2032.0004H28C29.1%2032.0004%2030%2031.1004%2030%2030.0004V20.0004H33.18C34.96%2020.0004%2035.86%2017.8404%2034.6%2016.5804L25.42%207.40043C24.64%206.62043%2023.38%206.62043%2022.6%207.40043L13.42%2016.5804C12.16%2017.8404%2013.04%2020.0004%2014.82%2020.0004H18V30.0004C18%2031.1004%2018.9%2032.0004%2020%2032.0004ZM12%2036.0004H36C37.1%2036.0004%2038%2036.9004%2038%2038.0004C38%2039.1004%2037.1%2040.0004%2036%2040.0004H12C10.9%2040.0004%2010%2039.1004%2010%2038.0004C10%2036.9004%2010.9%2036.0004%2012%2036.0004Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_6709_15241'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");background-size:48px;background-position:center;background-repeat:no-repeat;border-radius:50%;background-color:#43404a;margin:auto auto 20px}._migrationBanner_16i8r_254{min-width:1116px;color:#000;display:flex;align-items:center;background-color:#ffbc5b;padding:9px 16px;min-height:42px;font-weight:700;text-transform:uppercase;border-radius:8px;margin-right:142px;margin-left:142px;margin-top:15px}._migrationBanner_16i8r_254 .icon{height:18px;margin-right:10px}._type_16i8r_277{display:flex;flex-direction:row;gap:8px}._linkedWearableBadge_16i8r_283{padding:4px 8px;border-radius:32px}._typeBadge_16i8r_288{background-color:#00a146}._programmaticBadge_16i8r_292{background-color:#691fa9}._standardBadge_16i8r_296{background-color:#43404a}._loader_16i8r_302{display:flex;justify-content:center;align-items:center;min-height:0;flex:1}
1
+ ._image_142g7_1,._main_142g7_2{position:relative;width:64px;height:64px;border-radius:50%!important}._image_142g7_1{overflow:hidden}._network_142g7_13{position:absolute;bottom:0;right:0;width:32px;height:32px;z-index:1}._ellipsis_4huv2_1{margin:auto!important;color:var(--primary-text)}._itemImage_1y9df_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1y9df_10{margin-right:4px}._grid_1y9df_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider)}._grid_1y9df_14:hover{background-color:#24212966;color:var(--text)}._row_1y9df_25{align-items:center!important;font-size:15px}._column_1y9df_30{display:flex!important}._statusColumn_1y9df_34{font-size:13px;text-transform:uppercase}._statusColumn_1y9df_34._synced_1y9df_39{color:#34ce76}._statusColumn_1y9df_34._unsynced_1y9df_43{color:#fc9965}._avatarColumn_1y9df_47{align-items:center;padding-left:10px!important}._nameWrapper_1y9df_52{display:flex;align-items:center;overflow:hidden}._name_1y9df_52{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1y9df_65{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1y9df_72{margin-left:5px}._status_rgxu1_1{text-transform:uppercase;padding:4px 8px;border-radius:32px;display:inline-flex;align-items:center;gap:4px}._status_rgxu1_1 .icon{height:18px}._pending_migration_rgxu1_14{color:#ffbc5b;background-color:#ffbc5b33}._synced_rgxu1_19{color:#65d890;background-color:#65d89033}._unpublished_rgxu1_24,._unsynced_rgxu1_25{color:#63b4f6;background-color:#63b4f633}._pending_mapping_rgxu1_30,._under_review_rgxu1_31{color:#ecebed;background-color:#ecebed33}._icon_rgxu1_10{width:17px;height:17px}._itemImage_1rili_1{min-width:64px;max-width:64px;height:64px;padding:5px;margin-left:18px;margin-right:24px}._itemStatus_1rili_10{margin-right:4px}._grid_1rili_14{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider);position:relative}._grid_1rili_14:not(._loading_1rili_21):hover{background-color:#24212966;color:var(--text)}._row_1rili_26{align-items:center!important;font-size:15px}._column_1rili_31{display:flex!important}._avatarColumn_1rili_35{align-items:center;padding-left:10px!important}._nameWrapper_1rili_40{display:flex;align-items:center;overflow:hidden}._name_1rili_40{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._itemActions_1rili_53{display:flex;align-items:center;justify-content:flex-end;width:100%}._action_1rili_60{margin-left:5px}._overlay_1rili_65{position:absolute;pointer-events:none;z-index:100000000;top:0;left:0;width:100%;height:100%;background-color:#00000046;z-index:1000;display:flex;justify-content:center;align-items:center}._itemCheckbox_2k9qa_1{margin-right:10px}._gridHeader_2k9qa_5.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_2k9qa_5.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_2k9qa_5.ui.grid>.row>.column._itemColumn_2k9qa_15{display:flex;align-items:center}._gridHeader_4acv6_1.ui.grid{border-bottom:1px solid var(--divider);padding-bottom:10px;color:var(--secondary-text)}._gridHeader_4acv6_1.ui.grid>.row>.column:first-child{padding-left:10px}._gridHeader_4acv6_1.ui.grid>.row>.column._itemColumn_4acv6_11{display:flex;align-items:center}._itemCheckbox_4acv6_16{margin-right:10px}._linkedToColumn_4acv6_20>span{margin-right:6px}._main_16i8r_3,._main_16i8r_3>.ui.container{display:flex;flex-direction:column;min-height:0;flex:1}._slots_16i8r_11{font-weight:700;text-transform:uppercase;position:relative}._slots_16i8r_11:before{content:"";display:inline-block;background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23FF2D55'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23FF2D55'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23FF2D55'/%3e%3c/svg%3e");width:16px;height:16px;top:3px;position:relative;margin-right:8px}.button._slots_16i8r_11._empty_16i8r_28:before{background-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202C4%203.10457%203.10457%204%202%204C0.89543%204%200%203.10457%200%202C0%200.89543%200.89543%200%202%200C3.10457%200%204%200.89543%204%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%208C4%209.10457%203.10457%2010%202%2010C0.89543%2010%200%209.10457%200%208C0%206.89543%200.89543%206%202%206C3.10457%206%204%206.89543%204%208Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%2014C4%2015.1046%203.10457%2016%202%2016C0.89543%2016%200%2015.1046%200%2014C0%2012.8954%200.89543%2012%202%2012C3.10457%2012%204%2012.8954%204%2014Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%202C10%203.10457%209.10457%204%208%204C6.89543%204%206%203.10457%206%202C6%200.89543%206.89543%200%208%200C9.10457%200%2010%200.89543%2010%202Z'%20fill='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%208C10%209.10457%209.10457%2010%208%2010C6.89543%2010%206%209.10457%206%208C6%206.89543%206.89543%206%208%206C9.10457%206%2010%206.89543%2010%208Z'%20fill='%23736E7D'/%3e%3cpath%20d='M8%2015.5C8.82843%2015.5%209.5%2014.8284%209.5%2014C9.5%2013.1716%208.82843%2012.5%208%2012.5C7.17157%2012.5%206.5%2013.1716%206.5%2014C6.5%2014.8284%207.17157%2015.5%208%2015.5Z'%20stroke='%23736E7D'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%202C16%203.10457%2015.1046%204%2014%204C12.8954%204%2012%203.10457%2012%202C12%200.89543%2012.8954%200%2014%200C15.1046%200%2016%200.89543%2016%202Z'%20fill='%23736E7D'/%3e%3cpath%20d='M14%209.5C14.8284%209.5%2015.5%208.82843%2015.5%208C15.5%207.17157%2014.8284%206.5%2014%206.5C13.1716%206.5%2012.5%207.17157%2012.5%208C12.5%208.82843%2013.1716%209.5%2014%209.5Z'%20stroke='%23736E7D'/%3e%3cpath%20d='M14%2015.5C14.8284%2015.5%2015.5%2014.8284%2015.5%2014C15.5%2013.1716%2014.8284%2012.5%2014%2012.5C13.1716%2012.5%2012.5%2013.1716%2012.5%2014C12.5%2014.8284%2013.1716%2015.5%2014%2015.5Z'%20stroke='%23736E7D'/%3e%3c/svg%3e")}._searchContainer_16i8r_32{display:flex;align-items:center;justify-content:end}._searchContainer_16i8r_32 .dcl.text-filter{flex:1}._searchContainer_16i8r_32 ._searchInfo_16i8r_42{color:var(--secondary-text)}._syncedStatusList_16i8r_46.ui.dropdown{margin-left:25px;padding-left:7px;margin-right:10px;color:var(--primary)}._selectionInfo_16i8r_53{display:flex;justify-content:center;align-items:center;margin-bottom:20px;padding:10px 0;border:1px solid var(--secondary-text);border-radius:4px}._header_16i8r_63{display:flex;flex-direction:row;align-items:center;gap:16px;padding-right:142px;padding-left:90px;min-width:1400px;width:100%}._header_16i8r_63 ._content_16i8r_74{display:flex;flex-direction:row;background-color:#242129;padding:24px;width:calc(100% - 50px);border-radius:8px}._header_16i8r_63 ._title_16i8r_83{display:flex;flex-direction:row;align-items:center;gap:12px;overflow:hidden;margin-right:20px;flex:1 1 auto;min-width:0}._editCollectionName_16i8r_96{visibility:hidden;padding-left:16px}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101:hover+._editCollectionName_16i8r_96{visibility:visible}._nameAndType_16i8r_105{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}._nameWrapper_16i8r_115{display:flex;flex-direction:row;align-items:center;gap:15px;min-width:0;flex:1}._header_16i8r_63 ._title_16i8r_83 ._name_16i8r_101{margin-top:0;margin-bottom:0;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;min-width:0;width:fit-content}._header_16i8r_63 ._title_16i8r_83 ._size_16i8r_139{font-size:16px}._header_16i8r_63 ._actions_16i8r_143{display:flex;flex-direction:row;align-items:center;gap:16px;flex:0 0 auto}._body_16i8r_151{display:flex;flex-direction:column;padding-right:142px;padding-left:142px;margin-top:16px;gap:16px;min-width:1400px;flex:1}._info_16i8r_162{display:flex;flex-direction:row;gap:10px;align-items:center;font-weight:600}._infoHeader_16i8r_170{display:flex;flex-direction:row;text-transform:uppercase;color:#a09ba8;gap:10px}._infoContent_16i8r_178{display:flex;flex-direction:row;align-items:center;gap:5px;border-radius:6px;padding:8px;background-color:#43404a}._info_16i8r_162 .dui-info-tooltip__trigger{background-repeat:no-repeat;background-size:cover;height:20px;width:20px}._slotsIcon_16i8r_195{background-color:#5e5b67;border-radius:32px;padding:2px;height:24px;width:24px;background-image:url("data:image/svg+xml,%3csvg%20width='19'%20height='14'%20viewBox='0%200%2019%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%204H4V0H2C0.9%200%200%200.9%200%202V4ZM0%209H4V5H0V9ZM5%209H9V5H5V9ZM10%209H14V5H10V9ZM5%204H9V0H5V4ZM10%200V4H14V0H10ZM15%209H19V5H15V9ZM2%2014H4V10H0V12C0%2013.1%200.9%2014%202%2014ZM5%2014H9V10H5V14ZM10%2014H14V10H10V14ZM15%2014H17C18.1%2014%2019%2013.1%2019%2012V10H15V14ZM15%200V4H19V2C19%200.9%2018.1%200%2017%200H15Z'%20fill='white'/%3e%3c/svg%3e");background-size:70%;background-position:center;background-repeat:no-repeat}._copyButton_16i8r_207{cursor:pointer}._empty_16i8r_28{padding:200px 0;width:100%;border-radius:8px;justify-content:center;color:var(--secondary-text);text-align:center;line-height:22px;font-size:15px;background-color:#242129}._empty_16i8r_28 h3{color:#cfcdd4;margin-bottom:5px}._empty_16i8r_28 p{color:#a09ba8}._sparkles_16i8r_232{width:54px;height:56px;background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.16.1-19644308472.commit-c4256dc/assets/sparkles-C-WJN0Gh.svg);background-repeat:no-repeat;margin:auto auto 20px}._start_16i8r_241{width:80px;height:80px;background-image:url("data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_6709_15241)'%3e%3cpath%20d='M20%2032.0004H28C29.1%2032.0004%2030%2031.1004%2030%2030.0004V20.0004H33.18C34.96%2020.0004%2035.86%2017.8404%2034.6%2016.5804L25.42%207.40043C24.64%206.62043%2023.38%206.62043%2022.6%207.40043L13.42%2016.5804C12.16%2017.8404%2013.04%2020.0004%2014.82%2020.0004H18V30.0004C18%2031.1004%2018.9%2032.0004%2020%2032.0004ZM12%2036.0004H36C37.1%2036.0004%2038%2036.9004%2038%2038.0004C38%2039.1004%2037.1%2040.0004%2036%2040.0004H12C10.9%2040.0004%2010%2039.1004%2010%2038.0004C10%2036.9004%2010.9%2036.0004%2012%2036.0004Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_6709_15241'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e");background-size:48px;background-position:center;background-repeat:no-repeat;border-radius:50%;background-color:#43404a;margin:auto auto 20px}._migrationBanner_16i8r_254{min-width:1116px;color:#000;display:flex;align-items:center;background-color:#ffbc5b;padding:9px 16px;min-height:42px;font-weight:700;text-transform:uppercase;border-radius:8px;margin-right:142px;margin-left:142px;margin-top:15px}._migrationBanner_16i8r_254 .icon{height:18px;margin-right:10px}._type_16i8r_277{display:flex;flex-direction:row;gap:8px}._linkedWearableBadge_16i8r_283{padding:4px 8px;border-radius:32px}._typeBadge_16i8r_288{background-color:#00a146}._programmaticBadge_16i8r_292{background-color:#691fa9}._standardBadge_16i8r_296{background-color:#43404a}._loader_16i8r_302{display:flex;justify-content:center;align-items:center;min-height:0;flex:1}
@@ -1 +1 @@
1
- import{a as g}from"./index-BTGNYpgk.js";import"./index-BpSWUH3N.js";var m=Object.defineProperty,v=Object.defineProperties,y=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h=(e,r)=>{for(var t in r||(r={}))w.call(r,t)&&d(e,t,r[t]);if(c)for(var t of c(r))f.call(r,t)&&d(e,t,r[t]);return e},_=(e,r)=>v(e,y(r)),u=(e,r,t)=>new Promise((n,s)=>{var l=i=>{try{o(t.next(i))}catch(p){s(p)}},a=i=>{try{o(t.throw(i))}catch(p){s(p)}},o=i=>i.done?n(i.value):Promise.resolve(i.value).then(l,a);o((t=t.apply(e,r)).next())}),b=(e=>(e.Start="magic_oauth_login_with_redirect_start",e.Verify="magic_oauth_login_with_redirect_verify",e.Popup="magic_oauth_login_with_popup",e.VerifyTelegramData="magic_oauth_verify_telegram_data",e))(b||{}),R=(e=>(e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidScope="invalid_scope",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedGrantType="unsupported_grant_type",e.UnsupportedTokenType="unsupported_token_type",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e))(R||{}),I=class extends g.Internal{constructor(){super(),this.name="oauth2",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1},this.seamlessTelegramLogin()}loginWithRedirect(e){return this.utils.createPromiEvent((r,t)=>u(this,null,function*(){var n;let s=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_start",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]),l=yield this.request(s),a=l,o=l;if(o.error&&t(this.createError(o.error,(n=o.error_description)!=null?n:"An error occurred.",{errorURI:o.error_uri,provider:o.provider})),a!=null&&a.oauthAuthoriationURI){let i=a.useMagicServerCallback?new URL(a.oauthAuthoriationURI,this.sdk.endpoint).href:a.oauthAuthoriationURI;a!=null&&a.shouldReturnURI?r(i):window.location.href=i}r(null)}))}getRedirectResult(e,r){let t=r||window.location.search,n=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",n),P.call(this,t,e)}loginWithPopup(e){let r=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_popup",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]);return this.request(r)}seamlessTelegramLogin(){try{if(!window.location.hash.toString().includes("#tgWebAppData"))return;let e=document.createElement("script");e.src="https://telegram.org/js/telegram-web-app.js",document.head.prepend(e),e.onload=()=>u(this,null,function*(){var r;try{let t=(r=window.Telegram)==null?void 0:r.WebApp.initData,n=this.utils.createJsonRpcRequestPayload("magic_oauth_verify_telegram_data",[{userData:t,isMiniApp:!0}]);yield this.request(n)}catch(t){console.log("Error while verifying telegram data",t)}})}catch(e){console.log("Error while loading telegram-web-app script",e)}}};function P(e,r){return this.utils.createPromiEvent((t,n)=>u(this,null,function*(){var s;let l=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_verify",[{authorizationResponseParams:e,magicApiKey:this.sdk.apiKey,platform:"web",lifespan:r}]),a=yield this.request(l),o=a,i=a;i.error&&n(this.createError(i.error,(s=i.error_description)!=null?s:"An error occurred.",{errorURI:i.error_uri,provider:i.provider})),t(o)}))}export{R as OAuthErrorCode,I as OAuthExtension,b as OAuthPayloadMethods};
1
+ import{a as g}from"./index-HyBfIc0E.js";import"./index-DDLQh72H.js";var m=Object.defineProperty,v=Object.defineProperties,y=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h=(e,r)=>{for(var t in r||(r={}))w.call(r,t)&&d(e,t,r[t]);if(c)for(var t of c(r))f.call(r,t)&&d(e,t,r[t]);return e},_=(e,r)=>v(e,y(r)),u=(e,r,t)=>new Promise((n,s)=>{var l=i=>{try{o(t.next(i))}catch(p){s(p)}},a=i=>{try{o(t.throw(i))}catch(p){s(p)}},o=i=>i.done?n(i.value):Promise.resolve(i.value).then(l,a);o((t=t.apply(e,r)).next())}),b=(e=>(e.Start="magic_oauth_login_with_redirect_start",e.Verify="magic_oauth_login_with_redirect_verify",e.Popup="magic_oauth_login_with_popup",e.VerifyTelegramData="magic_oauth_verify_telegram_data",e))(b||{}),R=(e=>(e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidScope="invalid_scope",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedGrantType="unsupported_grant_type",e.UnsupportedTokenType="unsupported_token_type",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e))(R||{}),I=class extends g.Internal{constructor(){super(),this.name="oauth2",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1},this.seamlessTelegramLogin()}loginWithRedirect(e){return this.utils.createPromiEvent((r,t)=>u(this,null,function*(){var n;let s=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_start",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]),l=yield this.request(s),a=l,o=l;if(o.error&&t(this.createError(o.error,(n=o.error_description)!=null?n:"An error occurred.",{errorURI:o.error_uri,provider:o.provider})),a!=null&&a.oauthAuthoriationURI){let i=a.useMagicServerCallback?new URL(a.oauthAuthoriationURI,this.sdk.endpoint).href:a.oauthAuthoriationURI;a!=null&&a.shouldReturnURI?r(i):window.location.href=i}r(null)}))}getRedirectResult(e,r){let t=r||window.location.search,n=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",n),P.call(this,t,e)}loginWithPopup(e){let r=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_popup",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]);return this.request(r)}seamlessTelegramLogin(){try{if(!window.location.hash.toString().includes("#tgWebAppData"))return;let e=document.createElement("script");e.src="https://telegram.org/js/telegram-web-app.js",document.head.prepend(e),e.onload=()=>u(this,null,function*(){var r;try{let t=(r=window.Telegram)==null?void 0:r.WebApp.initData,n=this.utils.createJsonRpcRequestPayload("magic_oauth_verify_telegram_data",[{userData:t,isMiniApp:!0}]);yield this.request(n)}catch(t){console.log("Error while verifying telegram data",t)}})}catch(e){console.log("Error while loading telegram-web-app script",e)}}};function P(e,r){return this.utils.createPromiEvent((t,n)=>u(this,null,function*(){var s;let l=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_verify",[{authorizationResponseParams:e,magicApiKey:this.sdk.apiKey,platform:"web",lifespan:r}]),a=yield this.request(l),o=a,i=a;i.error&&n(this.createError(i.error,(s=i.error_description)!=null?s:"An error occurred.",{errorURI:i.error_uri,provider:i.provider})),t(o)}))}export{R as OAuthErrorCode,I as OAuthExtension,b as OAuthPayloadMethods};
@@ -1 +1 @@
1
- var C=Object.defineProperty;var b=(s,r,e)=>r in s?C(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var l=(s,r,e)=>b(s,typeof r!="symbol"?r+"":r,e);import{aG as v,J as u,W as P,N as t,aq as L,am as p,S as a,ao as g,M as d,bB as f,R as y,bC as k,bD as m,P as h,T as w,bE as N,as as S,av as F,au as j,bF as I,aj as R,ay as A,bG as E,U as T,bH as _,bI as M,bJ as O,bK as B,bL as D,aA as U,bM as V,a2 as $,a3 as q}from"./index-BpSWUH3N.js";import{B as W}from"./Back-D94RsYQI.js";import{S as G}from"./SDKTag-26bb1MRo.js";function J(s){return s?{id:s.id,title:s.title,description:s.description,thumbnail:s.thumbnail,isPublic:!1,sceneId:s.sceneId,ethAddress:s.ethAddress,createdAt:s.createdAt,updatedAt:s.updatedAt,layout:s.layout,isTemplate:!1,video:s.video,templateStatus:null}:null}const K=v.get("PROFILE_URL","");let z=class extends u.PureComponent{constructor(){super(...arguments);l(this,"handlePreview",()=>{this.props.onPreview()});l(this,"handleLike",()=>{const{currentPool:e,isLoggedIn:n,onOpenModal:o}=this.props;e&&(n?this.props.onLikePool(e.id,!e.like):o("LikeModal",{}))});l(this,"handleBack",()=>{const{history:e}=this.props;e.push(y.poolSearch())})}componentDidMount(){const{match:e,onLoadProject:n}=this.props;e.params.projectId&&n(e.params.projectId,this.getType())}componentDidUpdate(){const e=this.getCurrentProject(),n=this.getCurrentScene(),{isLoading:o,onLoadProjectScene:i}=this.props;e&&!n&&!o&&i(e,this.getType())}componentWillUnmount(){this.props.onCloseEditor()}getType(){return this.props.match&&this.props.match.params&&this.props.match.params.type||P.PUBLIC}getCurrentProject(){const{currentProject:e,currentPool:n}=this.props;switch(this.getType()){case"pool":return n;default:return e}}getCurrentScene(){const{scenes:e}=this.props,n=this.getCurrentProject();return n&&e[n.sceneId]||null}getCurrentPool(){const{currentPool:e}=this.props;switch(this.getType()){case"pool":return e;default:return null}}getParcelCount(){const e=this.getCurrentProject();return e?e.layout.cols*e.layout.rows:0}getObjectCount(){const e=this.getCurrentScene();if(!e||!e.sdk6)return 0;const n=this.getParcelCount();if(n===0)return 0;const o=Object.keys(e.sdk6.entities).length;return o<n?0:o-n}renderNotFount(){return t.jsx(L,{})}renderLoading(){return t.jsxs(t.Fragment,{children:[t.jsx(p,{}),t.jsx(a.Page,{isFullscreen:!0,children:t.jsx(a.Loader,{active:!0,size:"huge"})}),t.jsx(g,{isFullscreen:!0})]})}handleExportProject(){const{onOpenModal:e}=this.props;e("ExportModal",{project:J(this.getCurrentProject())})}renderAuthor(){const{currentAuthor:e}=this.props;if(!e)return null;const n=e.avatars[0].ethAddress;return t.jsxs("div",{className:"author",children:[d("public_page.made_by"),t.jsx(f,{address:n,as:"a",href:`${K}/accounts/${n}`})]})}render(){const{isFetching:e,isPreviewing:n,isReady:o}=this.props;if(e)return this.renderLoading();const i=this.getCurrentProject();if(!i)return this.renderNotFount();const c=this.getCurrentPool(),x=this.getCurrentScene();return t.jsxs(t.Fragment,{children:[!n&&t.jsxs(t.Fragment,{children:[t.jsx(p,{}),t.jsxs(a.Container,{className:"back-container",children:[t.jsx(W,{absolute:!0,onClick:this.handleBack}),t.jsxs(a.Button,{secondary:!0,onClick:this.handleExportProject.bind(this),loading:!i,disabled:!i,children:[t.jsx(a.Icon,{name:"download"}),d("scene_detail_page.download_scene")]})]})]}),t.jsxs("div",{className:"SceneViewPage"+(n?" preview":" mini"),children:[t.jsx("div",{className:"thumbnail",style:{backgroundImage:`url("${i.thumbnail}")`},children:t.jsx(a.Responsive,{minWidth:1025,as:u.Fragment,children:t.jsx(k,{isReadOnly:!0,type:this.getType()},i.id)})}),t.jsxs("div",{className:"scene-action-list",children:[c&&t.jsx("div",{className:"scene-action",children:t.jsx(m,{text:t.jsxs(t.Fragment,{children:[t.jsx(h,{name:c.like?"heart-full":"heart"}),c.likes>0&&t.jsx("span",{className:"LikeCount",children:c.likes})]}),type:"circle",onClick:this.handleLike})}),t.jsx("div",{style:{flex:1}}),t.jsx(a.Responsive,{minWidth:1025,as:u.Fragment,children:t.jsx("div",{className:"scene-action",children:t.jsx(m,{icon:"view",type:"circle",isActive:n,isDisabled:!o,onClick:this.handlePreview})})})]}),t.jsxs("div",{className:"detail",children:[t.jsxs("div",{className:"title",children:[t.jsx("h1",{children:i.title}),t.jsx(G,{scene:x})]}),this.renderAuthor(),i.description&&t.jsx("div",{className:"description",children:t.jsx("p",{children:i.description})}),t.jsxs("div",{className:"component-list",children:[t.jsxs("div",{className:"component",children:[t.jsx(h,{name:"scene-parcel"})," ",d("public_page.parcel_count",{parcels:this.getParcelCount()})]}),t.jsxs("div",{className:"component",children:[t.jsx(h,{name:"scene-object"})," ",d("public_page.item_count",{items:this.getObjectCount()})]})]})]})]}),!n&&t.jsx(g,{})]})}};const H=s=>({isPreviewing:S(s),isReady:!F(s)&&j(s),isFetching:I(s)&&!j(s),isLoggedIn:R(s),currentProject:A(s),currentPool:E(s),scenes:T(s),currentAuthor:_(s),isLoading:M(s)||!!O(s).length}),Q=s=>({onLikePool:(r,e=!0)=>s(B(r,e)),onPreview:()=>s(D(!0)),onCloseEditor:()=>s(U()),onLoadProject:(r,e=P.PUBLIC)=>s(V(r,e)),onOpenModal:(r,e)=>s($(r,e)),onLoadProjectScene:(r,e)=>s(q(r,e))}),se=w(H,Q)(N(z));export{se as default};
1
+ var C=Object.defineProperty;var b=(s,r,e)=>r in s?C(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e;var l=(s,r,e)=>b(s,typeof r!="symbol"?r+"":r,e);import{aG as v,J as u,W as P,N as t,aq as L,am as p,S as a,ao as g,M as d,bB as f,R as y,bC as k,bD as m,P as h,T as w,bE as N,as as S,av as F,au as j,bF as I,aj as R,ay as A,bG as E,U as T,bH as _,bI as M,bJ as O,bK as B,bL as D,aA as U,bM as V,a2 as $,a3 as q}from"./index-DDLQh72H.js";import{B as W}from"./Back-CDOxIrnn.js";import{S as G}from"./SDKTag-ChEtvoIS.js";function J(s){return s?{id:s.id,title:s.title,description:s.description,thumbnail:s.thumbnail,isPublic:!1,sceneId:s.sceneId,ethAddress:s.ethAddress,createdAt:s.createdAt,updatedAt:s.updatedAt,layout:s.layout,isTemplate:!1,video:s.video,templateStatus:null}:null}const K=v.get("PROFILE_URL","");let z=class extends u.PureComponent{constructor(){super(...arguments);l(this,"handlePreview",()=>{this.props.onPreview()});l(this,"handleLike",()=>{const{currentPool:e,isLoggedIn:n,onOpenModal:o}=this.props;e&&(n?this.props.onLikePool(e.id,!e.like):o("LikeModal",{}))});l(this,"handleBack",()=>{const{history:e}=this.props;e.push(y.poolSearch())})}componentDidMount(){const{match:e,onLoadProject:n}=this.props;e.params.projectId&&n(e.params.projectId,this.getType())}componentDidUpdate(){const e=this.getCurrentProject(),n=this.getCurrentScene(),{isLoading:o,onLoadProjectScene:i}=this.props;e&&!n&&!o&&i(e,this.getType())}componentWillUnmount(){this.props.onCloseEditor()}getType(){return this.props.match&&this.props.match.params&&this.props.match.params.type||P.PUBLIC}getCurrentProject(){const{currentProject:e,currentPool:n}=this.props;switch(this.getType()){case"pool":return n;default:return e}}getCurrentScene(){const{scenes:e}=this.props,n=this.getCurrentProject();return n&&e[n.sceneId]||null}getCurrentPool(){const{currentPool:e}=this.props;switch(this.getType()){case"pool":return e;default:return null}}getParcelCount(){const e=this.getCurrentProject();return e?e.layout.cols*e.layout.rows:0}getObjectCount(){const e=this.getCurrentScene();if(!e||!e.sdk6)return 0;const n=this.getParcelCount();if(n===0)return 0;const o=Object.keys(e.sdk6.entities).length;return o<n?0:o-n}renderNotFount(){return t.jsx(L,{})}renderLoading(){return t.jsxs(t.Fragment,{children:[t.jsx(p,{}),t.jsx(a.Page,{isFullscreen:!0,children:t.jsx(a.Loader,{active:!0,size:"huge"})}),t.jsx(g,{isFullscreen:!0})]})}handleExportProject(){const{onOpenModal:e}=this.props;e("ExportModal",{project:J(this.getCurrentProject())})}renderAuthor(){const{currentAuthor:e}=this.props;if(!e)return null;const n=e.avatars[0].ethAddress;return t.jsxs("div",{className:"author",children:[d("public_page.made_by"),t.jsx(f,{address:n,as:"a",href:`${K}/accounts/${n}`})]})}render(){const{isFetching:e,isPreviewing:n,isReady:o}=this.props;if(e)return this.renderLoading();const i=this.getCurrentProject();if(!i)return this.renderNotFount();const c=this.getCurrentPool(),x=this.getCurrentScene();return t.jsxs(t.Fragment,{children:[!n&&t.jsxs(t.Fragment,{children:[t.jsx(p,{}),t.jsxs(a.Container,{className:"back-container",children:[t.jsx(W,{absolute:!0,onClick:this.handleBack}),t.jsxs(a.Button,{secondary:!0,onClick:this.handleExportProject.bind(this),loading:!i,disabled:!i,children:[t.jsx(a.Icon,{name:"download"}),d("scene_detail_page.download_scene")]})]})]}),t.jsxs("div",{className:"SceneViewPage"+(n?" preview":" mini"),children:[t.jsx("div",{className:"thumbnail",style:{backgroundImage:`url("${i.thumbnail}")`},children:t.jsx(a.Responsive,{minWidth:1025,as:u.Fragment,children:t.jsx(k,{isReadOnly:!0,type:this.getType()},i.id)})}),t.jsxs("div",{className:"scene-action-list",children:[c&&t.jsx("div",{className:"scene-action",children:t.jsx(m,{text:t.jsxs(t.Fragment,{children:[t.jsx(h,{name:c.like?"heart-full":"heart"}),c.likes>0&&t.jsx("span",{className:"LikeCount",children:c.likes})]}),type:"circle",onClick:this.handleLike})}),t.jsx("div",{style:{flex:1}}),t.jsx(a.Responsive,{minWidth:1025,as:u.Fragment,children:t.jsx("div",{className:"scene-action",children:t.jsx(m,{icon:"view",type:"circle",isActive:n,isDisabled:!o,onClick:this.handlePreview})})})]}),t.jsxs("div",{className:"detail",children:[t.jsxs("div",{className:"title",children:[t.jsx("h1",{children:i.title}),t.jsx(G,{scene:x})]}),this.renderAuthor(),i.description&&t.jsx("div",{className:"description",children:t.jsx("p",{children:i.description})}),t.jsxs("div",{className:"component-list",children:[t.jsxs("div",{className:"component",children:[t.jsx(h,{name:"scene-parcel"})," ",d("public_page.parcel_count",{parcels:this.getParcelCount()})]}),t.jsxs("div",{className:"component",children:[t.jsx(h,{name:"scene-object"})," ",d("public_page.item_count",{items:this.getObjectCount()})]})]})]})]}),!n&&t.jsx(g,{})]})}};const H=s=>({isPreviewing:S(s),isReady:!F(s)&&j(s),isFetching:I(s)&&!j(s),isLoggedIn:R(s),currentProject:A(s),currentPool:E(s),scenes:T(s),currentAuthor:_(s),isLoading:M(s)||!!O(s).length}),Q=s=>({onLikePool:(r,e=!0)=>s(B(r,e)),onPreview:()=>s(D(!0)),onCloseEditor:()=>s(U()),onLoadProject:(r,e=P.PUBLIC)=>s(V(r,e)),onOpenModal:(r,e)=>s($(r,e)),onLoadProjectScene:(r,e)=>s(q(r,e))}),se=w(H,Q)(N(z));export{se as default};
@@ -1 +1 @@
1
- var x=Object.defineProperty;var h=(t,s,a)=>s in t?x(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a;var c=(t,s,a)=>h(t,typeof s!="symbol"?s+"":s,a);import{J as f,co as g,N as e,bR as p,M as i,b6 as u,S as l,cp as j,Q as b,R as v,cq as L,bW as T,aR as R,T as w,cr as E}from"./index-BpSWUH3N.js";import{L as N}from"./LandAction-DhmPYdL8.js";import{L as _}from"./LandProviderPage-D2JQ3F7v.js";import"./Back-D94RsYQI.js";import"./NotFound-mNWy5xM3.js";import"./hooks-BBT2z0gO.js";let P=class extends f.PureComponent{constructor(){super(...arguments);c(this,"state",{address:"",isValid:!0});c(this,"handleChange",(a,r)=>{this.setState({isValid:!r.value||g(r.value),address:r.value})})}render(){const{onTransfer:a}=this.props,{address:r,isValid:o}=this.state;return e.jsx(_,{className:"LandTransferPage",children:n=>{let d;const m=p(n.owner,r);return m?d=i("transfer_page.same_owner"):o||(d=i("transfer_page.invalid_address")),e.jsx(N,{land:n,title:i("transfer_page.title"),subtitle:e.jsx(u,{id:"transfer_page.subtitle",values:{name:e.jsx("strong",{children:n.name})}}),children:e.jsxs(l.Form,{onSubmit:()=>a(n,r),children:[e.jsx(j,{label:"Address",value:r,onChange:this.handleChange,placeholder:"0x...",error:!o||m,message:d}),e.jsx(l.Section,{className:"disclaimer",children:e.jsx("p",{className:"danger-text",children:e.jsx(u,{id:"transfer_page.disclaimer",values:{br:e.jsx("br",{})}})})}),e.jsxs(l.Row,{children:[e.jsx(b,{className:"cancel",to:v.landDetail(n.id),children:e.jsx(l.Button,{children:i("global.cancel")})}),e.jsx(L,{type:"submit",primary:!0,disabled:!r||!o||n.role!==T.OWNER||p(n.owner,r),network:R.Network.ETHEREUM,children:i("global.submit")})]})]})})}})}};const V=t=>({onTransfer:(s,a)=>t(E(s,a))}),F=w(void 0,V)(P);export{F as default};
1
+ var x=Object.defineProperty;var h=(t,s,a)=>s in t?x(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a;var c=(t,s,a)=>h(t,typeof s!="symbol"?s+"":s,a);import{J as f,co as g,N as e,bR as p,M as i,b6 as u,S as l,cp as j,Q as b,R as v,cq as L,bW as T,aR as R,T as w,cr as E}from"./index-DDLQh72H.js";import{L as N}from"./LandAction-CiY0RweX.js";import{L as _}from"./LandProviderPage-DMoeh5ZK.js";import"./Back-CDOxIrnn.js";import"./NotFound-BxsG7cuR.js";import"./hooks-BR9ATp8C.js";let P=class extends f.PureComponent{constructor(){super(...arguments);c(this,"state",{address:"",isValid:!0});c(this,"handleChange",(a,r)=>{this.setState({isValid:!r.value||g(r.value),address:r.value})})}render(){const{onTransfer:a}=this.props,{address:r,isValid:o}=this.state;return e.jsx(_,{className:"LandTransferPage",children:n=>{let d;const m=p(n.owner,r);return m?d=i("transfer_page.same_owner"):o||(d=i("transfer_page.invalid_address")),e.jsx(N,{land:n,title:i("transfer_page.title"),subtitle:e.jsx(u,{id:"transfer_page.subtitle",values:{name:e.jsx("strong",{children:n.name})}}),children:e.jsxs(l.Form,{onSubmit:()=>a(n,r),children:[e.jsx(j,{label:"Address",value:r,onChange:this.handleChange,placeholder:"0x...",error:!o||m,message:d}),e.jsx(l.Section,{className:"disclaimer",children:e.jsx("p",{className:"danger-text",children:e.jsx(u,{id:"transfer_page.disclaimer",values:{br:e.jsx("br",{})}})})}),e.jsxs(l.Row,{children:[e.jsx(b,{className:"cancel",to:v.landDetail(n.id),children:e.jsx(l.Button,{children:i("global.cancel")})}),e.jsx(L,{type:"submit",primary:!0,disabled:!r||!o||n.role!==T.OWNER||p(n.owner,r),network:R.Network.ETHEREUM,children:i("global.submit")})]})]})})}})}};const V=t=>({onTransfer:(s,a)=>t(E(s,a))}),F=w(void 0,V)(P);export{F as default};