@dcl/builder-site 7.14.3 → 7.14.4-19333247245.commit-881855f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Back-Du-3PX5t.js → Back-Bq3Xcoly.js} +1 -1
- package/assets/{CollectionProvider.container-Lqsy-tws.js → CollectionProvider.container-78TB9kiH.js} +1 -1
- package/assets/{CollectionStatus.container-BEIqfJjn.js → CollectionStatus.container-DBfnW5vX.js} +1 -1
- package/assets/{ConfirmDelete-BnSJSqBZ.js → ConfirmDelete-71BcCucu.js} +1 -1
- package/assets/{FileSaver.min-Dwax41FS.js → FileSaver.min-BZiMcTZh.js} +1 -1
- package/assets/{ItemProvider.container-DdEAL_Ri.js → ItemProvider.container-B_BAvEtH.js} +1 -1
- package/assets/{JumpIn.container-DBOPalEu.js → JumpIn.container-CeSOEwOc.js} +1 -1
- package/assets/{LandAction-DweppjnN.js → LandAction-Be_9Vd4x.js} +1 -1
- package/assets/{LandProviderPage-BKfn97qy.js → LandProviderPage-C-6H7vWP.js} +1 -1
- package/assets/{LoggedInDetailPage.container-D8H5VCWI.js → LoggedInDetailPage.container-BwMfJFSQ.js} +1 -1
- package/assets/{Navigation-C-ZlQ9p1.css → Navigation-jXq70jgH.css} +1 -1
- package/assets/{Navigation.container-Czf_aMXt.js → Navigation.container-gTCRHjj6.js} +1 -1
- package/assets/{NotFound-B5Bl_gw1.js → NotFound-BnVf99__.js} +1 -1
- package/assets/{OptionsDropdown-DePMzHXt.js → OptionsDropdown-Ct56jDIF.js} +1 -1
- package/assets/{RentalPeriod-Bsw3l3b-.js → RentalPeriod-Dur2tZPB.js} +1 -1
- package/assets/{SDKTag-CBAhu_lg.js → SDKTag-B-Q47VXc.js} +1 -1
- package/assets/{SceneStats.container-Ca4F8ZRq.js → SceneStats.container-DWiDhtTP.js} +1 -1
- package/assets/{SignInRequired-BWM3m5Bh.js → SignInRequired-hq09yAsv.js} +1 -1
- package/assets/{ThirdPartyKindBadge-ET9ggHTR.js → ThirdPartyKindBadge-BMfvIxcg.js} +1 -1
- package/assets/{dataReader-DbDcjw59.js → dataReader-BKwQpqk0.js} +1 -1
- package/assets/{date-B6b7CVrN.js → date-fu0Q5SmK.js} +1 -1
- package/assets/{fortmatic-9H4P56_9.js → fortmatic-DFjOPMpn.js} +1 -1
- package/assets/{hooks-CZx9E4HM.js → hooks-C8UcKsSN.js} +1 -1
- package/assets/{index-DbMEblf5.js → index-1kC9v6hM.js} +1 -1
- package/assets/{index-DBg5WiYR.js → index-AIRgE-AH.js} +1 -1
- package/assets/{index-BOF2b_tG.js → index-B70jPWUC.js} +1 -1
- package/assets/{index-D29Huvez.js → index-B7l7sJg2.js} +1 -1
- package/assets/{index-BLEwdEin.js → index-BHBiKgzq.js} +1 -1
- package/assets/{index-CbSrvQ3n.js → index-BO-dI8RM.js} +1 -1
- package/assets/{index-BXMsz2Lh.js → index-BSV0ASyT.js} +1 -1
- package/assets/{index-liv2k8mp.js → index-BTDa9rgp.js} +1 -1
- package/assets/{index-DBMOLm39.js → index-BdDRr38Q.js} +1 -1
- package/assets/{index-BmS9iM1I.js → index-BdqF7tuc.js} +1 -1
- package/assets/{index-76S3Bul4.js → index-BlcMW_g6.js} +204 -198
- package/assets/{index-DVF64vJ1.js → index-BllbtnmR.js} +1 -1
- package/assets/{index-Cf7CBDBP.js → index-BnzPu6kN.js} +1 -1
- package/assets/{index-YFxMXAOn.js → index-BpbrfPnW.js} +1 -1
- package/assets/{index-jccc0hDE.css → index-BwtkRqt7.css} +1 -1
- package/assets/index-C1dGl8XT.css +1 -0
- package/assets/{index-peDfbbNt.js → index-C5rcmfcn.js} +1 -1
- package/assets/{index-CFo4HO7Z.js → index-CA5U2eoi.js} +1 -1
- package/assets/{index-BTfmHeNN.js → index-CBJhwCuq.js} +1 -1
- package/assets/{index-BAOisAir.js → index-CEJEtJkL.js} +1 -1
- package/assets/index-CHxHn296.js +1 -0
- package/assets/{index-C5uvfXcz.js → index-COGtA8En.js} +1 -1
- package/assets/{index-CYF1jnKQ.js → index-CVnoGzvQ.js} +1 -1
- package/assets/{index-CVBrzwuh.js → index-CY1Kg1DY.js} +1 -1
- package/assets/index-C_uyOxRe.js +1 -0
- package/assets/{index-CFjpjxhQ.js → index-CcVM_MVj.js} +1 -1
- package/assets/{index-B8MpIaEn.js → index-CczDtxja.js} +1 -1
- package/assets/{index-DODo_AA2.css → index-Co-_AGGw.css} +7 -7
- package/assets/{index-xVCHzlfE.js → index-CqH-gavs.js} +1 -1
- package/assets/{index-BfpOuMxx.js → index-D2E7HW9r.js} +1 -1
- package/assets/{index-D-DTCEtL.js → index-DBkNL0Th.js} +1 -1
- package/assets/{index-BrUJYumw.js → index-DFRQoFbj.js} +1 -1
- package/assets/{index-D75j3LJB.js → index-DGtPjzZG.js} +1 -1
- package/assets/index-DJ8x8wA3.css +1 -0
- package/assets/index-DJzhTL6b.css +1 -0
- package/assets/{index-DU5kC8Wa.js → index-DM0r5dUd.js} +1 -1
- package/assets/{index-CBcwD23d.js → index-DYUIlIfe.js} +1 -1
- package/assets/{index-BUPxmR5g.js → index-D_RXKLMK.js} +1 -1
- package/assets/index-Dg630mlC.js +2 -0
- package/assets/{index-CV6TLvQx.js → index-Dub0PLTM.js} +1 -1
- package/assets/{index-CZDGtJQc.js → index-DyL3RKfL.js} +1 -1
- package/assets/{index-7VHsQJBX.js → index-Ijwig6A9.js} +1 -1
- package/assets/{index-DPO6HDpi.js → index-Pg38vW63.js} +1 -1
- package/assets/index-e8nO5duU.js +1 -0
- package/assets/{index-jxJOvrFv.js → index-l01ZXTQD.js} +1 -1
- package/assets/{index-B3trRFJD.js → index-oifEF-AL.js} +1 -1
- package/assets/{index-WGbYHmSa.js → index-p2SgPRC2.js} +1 -1
- package/assets/index-rcrcGNw2.css +1 -0
- package/assets/{index-DTQ3d5tX.css → index-wzlt3Ngs.css} +1 -1
- package/assets/{index.es-z67bobBT.js → index.es-B8BKm5UV.js} +4 -4
- package/assets/{selectors-xoM-YAcs.js → selectors-C5Krcz9D.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-BiQ1dBjY.js +0 -2
- package/assets/index-BnlS84my.css +0 -1
- package/assets/index-CqplWHDN.js +0 -1
- package/assets/index-D8EUOW_O.js +0 -1
- package/assets/index-DSqpzpNh.js +0 -1
- package/assets/index-DbEtkDpc.css +0 -1
- package/assets/index-DfMVurEC.css +0 -1
- package/assets/index-kJ09AvL0.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var ht=Object.defineProperty;var mt=(i,m,e)=>m in i?ht(i,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[m]=e;var c=(i,m,e)=>mt(i,typeof m!="symbol"?m+"":m,e);import{ae as q,H as t,M as d,G as r,bk as $,bJ as gt,D as b,gt as X,L as te,K as F,cj as Fe,b4 as P,N as He,bD as G,gu as pt,eF as ut,gv as Ct,gw as It,gx as bt,gy as _t,gz as xt,gA as Et,gB as vt,gC as jt,gD as H,et as St,gE as K,gF as Pe,a4 as se,Z as _e,a5 as C,aG as ae,gG as ft,de as xe,br as Ve,fe as Ee,ft as Tt,fW as wt,fX as yt,eC as ge,gm as Pt,gH as At,gI as Nt,fZ as Rt,eG as Ue,gJ as Mt,gK as Dt,gL as Lt,gM as Ot,fo as kt,fY as Bt,f_ as Wt,aM as ve,gN as Ft,gO as Ht,eU as Ae,bK as Vt,ad as Ut,eJ as je,gP as $e,X as Ge,ew as $t,er as Ye,fG as ee,dG as pe,es as Gt,eX as ue,gQ as Je,bi as Se,fV as ze,e_ as L,eu as z,fC as qe,fD as Ce,J as V,f9 as Ie,dF as Yt,eS as Jt,fl as zt,gR as qt,gS as Ze,gT as Ke,gU as Qe,fd as fe,eD as Zt,gV as Kt,gW as Qt,fK as Xe,eM as Xt,eL as et,eN as es,eP as ts,eQ as ss,gX as as,gY as ns,gZ as is,g_ as Ne,g$ as de,h0 as ls,eg as os,h1 as rs,h2 as ds,h3 as cs,h4 as hs,h5 as ms,h6 as gs,h7 as ps,h8 as us,h9 as Cs,ha as Is,hb as bs,fm as _s,hc as xs,hd as Es,he as vs,hf as js,hg as Ss,hh as fs,hi as Ts,hj as ws,f$ as ys,bU as ie,hk as Ps,hl as Re,hm as As,hn as Ns,eW as Me,fH as ce,ho as he,eV as Rs,eR as De,eY as Ms,eZ as Le,e$ as Oe,f0 as ke,hp as Ds,hq as Ls,f1 as Os,f2 as Be,f3 as We,hr as ks,fc as Bs,hs as Ws,ht as Fs,hu as Hs,hv as tt,hw as Vs,hx as Us,hy as $s,hz as Gs,hA as Ys,eI as Js,hB as zs,fg as qs,ff as Zs,fi as Ks,hC as Qs}from"./index-76S3Bul4.js";import{g as oe,h as Te,i as we}from"./hooks-CZx9E4HM.js";import{J as Xs}from"./JumpIn.container-DBOPalEu.js";import{C as ea}from"./CollectionProvider.container-Lqsy-tws.js";import{C as st}from"./ConfirmDelete-BnSJSqBZ.js";import{C as at}from"./CollectionStatus.container-BEIqfJjn.js";import{d as ta,e as sa,c as aa}from"./selectors-xoM-YAcs.js";import{I as na}from"./ItemProvider.container-DdEAL_Ri.js";const ia=({open:i,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(d.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:i,children:[t.jsx(d.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(gt,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:s,children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),la=q.memo(ia);var D=(i=>(i.REJECT_COLLECTION="REJECT_COLLECTION",i.REJECT_CURATION="REJECT_CURATION",i.DISABLE_COLLECTION="DISABLE_COLLECTION",i.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",i))(D||{});const U="item_editor.top_panel.rejection_modal",oa=({open:i,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:l,curation:o,onReject:h,onRejectCuration:g,onClose:p})=>{const E=b.useMemo(()=>{switch(m){case D.DISABLE_COLLECTION:return U+".disable_collection";case D.REJECT_CURATION:return U+".reject_curation";case D.DISABLE_THIRD_PARTY:return U+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case D.DISABLE_COLLECTION:h(l);break;case D.REJECT_CURATION:g(o.collectionId);break;case D.DISABLE_THIRD_PARTY:s&&n(s.id);break}},S=m===D.DISABLE_COLLECTION&&!l.isApproved||m===D.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===D.REJECT_COLLECTION&&!l.isApproved||m===D.REJECT_CURATION&&(o==null?void 0:o.status)===X.REJECTED;return t.jsx(d.Modal,{size:"tiny",className:"RejectionModal",open:i,children:a?t.jsx(ra,{i18nKey:E}):S?t.jsx(da,{link:l.forumLink,onClose:p}):t.jsx(ca,{i18nKey:E,isLoading:e,onClose:p,onConfirm:w})})},ra=({i18nKey:i})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${i}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx($,{id:U+".visit_activity",values:{activity_link:t.jsx(te,{to:F.activity(),children:r("global.activity")})}})}),t.jsx(d.Loader,{active:!0,size:"large"})]})]}),da=({link:i,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(U+".veredict_explanation")}),t.jsx(d.Modal.Content,{children:r(U+".go_to_forum")}),t.jsxs(d.Modal.Actions,{children:[t.jsx("a",{href:i,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(d.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(U+".forum_link")}),t.jsx("div",{className:"discussion",children:r(U+".discussion")}),t.jsx(d.Icon,{name:"chevron right"})]})}),t.jsx(d.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),ca=({i18nKey:i,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsx(d.Modal.Content,{children:r(`${i}.subtitle`)}),t.jsxs(d.Modal.Actions,{children:[t.jsx(Fe,{primary:!0,onClick:e,disabled:m,loading:m,network:P.Network.MATIC,children:r(`${i}.action`)}),t.jsx(d.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),ha=q.memo(oa),ma=(i,m)=>({isLoading:G(ut(i),pt)||G(It(i),Ct)||bt(i),hasPendingTransaction:_t(i)||!!(m.thirdParty&&xt(i,m.thirdParty.id))}),ga=i=>({onReject:m=>i(Et(m)),onRejectCuration:m=>i(vt(m)),onDisableThirdParty:m=>i(jt(m))}),pa=He(ma,ga)(ha);var y=(i=>(i[i.APPROVE=0]="APPROVE",i[i.REJECT=1]="REJECT",i[i.ENABLE=2]="ENABLE",i[i.DISABLE=3]="DISABLE",i[i.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",i))(y||{});let ua=class extends q.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push(F.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:l,onSetAssignee:o}=this.props;this.setState({showApproveConfirmModal:!1}),a&&o(e.id,a,s),H(e)?l(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:l,thirdParty:o}=this.props,{showRejectionModal:h,showApproveConfirmModal:g}=this.state,{chainId:p}=this.props,E=St(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(Xs,{size:"small",active:!0,collection:e,chainId:p,items:H(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:H(e)&&l!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),h&&t.jsx(pa,{type:h,open:!0,collection:e,curation:n,thirdParty:o,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&g&&t.jsx(la,{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:l,onInitiateApprovalFlow:o,onInitiateTPApprovalFlow:h,onDeployMissingEntities:g,reviewedItems:p,totalItems:E}=this.props,w={[y.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):H(s)?h(s):o(s),[y.ENABLE]:()=>o(s),[y.DISABLE]:()=>this.setShowRejectionModal(l?D.DISABLE_THIRD_PARTY:D.DISABLE_COLLECTION),[y.REJECT]:()=>{(a==null?void 0:a.status)===X.PENDING?this.setShowRejectionModal(D.REJECT_CURATION):this.setShowRejectionModal(D.REJECT_COLLECTION)},[y.DEPLOY_MISSING_ENTITIES]:()=>g(s)},S={[y.APPROVE]:"approve",[y.ENABLE]:"enable",[y.DISABLE]:"disable",[y.REJECT]:"reject",[y.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===y.APPROVE||e===y.ENABLE||e===y.DEPLOY_MISSING_ENTITIES,x=!H(s)||!!E&&p.length>=K(E);return t.jsx(d.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:x,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(d.Button,{primary:j,onClick:()=>w[e](),disabled:H(s)&&e===y.APPROVE&&!!E&&p.length<K(E),children:r(`item_editor.top_panel.${S[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:l,thirdParty:o}=this.props,h=a==null?void 0:a.some(g=>g.status===X.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(d.Header,{sub:!0,children:[h?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:K(l)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=K(l)?t.jsx(d.Icon,{name:"check circle"}):null]}),h&&this.renderButton(y.APPROVE,e,s),h&&this.renderButton(y.REJECT,e,s),!h&&(o==null?void 0:o.isApproved)&&this.renderButton(y.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)?this.renderButton(y.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:l,isLoading:o}=this.props,h=!e||o&&!s.length;return a&&n&&l?t.jsx("div",{className:"TopPanel",children:h?t.jsx(d.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const Ca=({reviewedItems:i})=>{const m=se(),e=_e(),s=oe(),a=Te(),n=C(ae),l=C(ft),o=C(xe),h=C(Ve),g=C(u=>s?Ee(u,s):null),p=C(u=>g?Tt(u,g.id):[]),E=C(u=>g?wt(u,g.id):[]),w=C(u=>s?yt(u,s):null),S=C(u=>s?ge(u,s):void 0),j=C(u=>g&&H(g)?Pt(u,g):null),x=C(u=>s?At(u,s):!1),f=C(u=>G(Nt(u),kt)||G(Rt(u),Bt)||G(Ue(u),Wt)),T=b.useCallback((u,N,k)=>{m(Mt(u,N,k))},[m]),R=b.useCallback(u=>{m(Dt(u))},[m]),M=b.useCallback(u=>{m(Lt(u))},[m]),I=b.useCallback(u=>{m(Ot(u))},[m]);return t.jsx(ua,{address:n,items:p,totalItems:(S==null?void 0:S.total)||null,collection:g,itemCurations:E,thirdParty:j,curation:w,chainId:l,isConnected:o,isReviewing:a,isCommitteeMember:h,selectedCollectionId:s,hasCollectionMissingEntities:x,isLoading:f,reviewedItems:i,onSetAssignee:T,onInitiateTPApprovalFlow:R,onInitiateApprovalFlow:M,onDeployMissingEntities:I,history:e})},Ia=Ca,nt=()=>{const{search:i}=ve();return C(e=>Ft(e,i))},ba="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",_a=i=>{const{collectionId:m}=i,[e,s]=b.useState(!1),[a,n]=b.useState(null),l=_e(),o=ve(),h=b.useMemo(()=>Ht(o.search),[o.search]);b.useEffect(()=>{h&&(s(!0),n(h))},[h]);function g(){s(!1);const p=new URLSearchParams(o.search);p.delete("newItem"),l.replace({search:p.toString()})}return e&&a&&m?t.jsx(d.Toast,{type:d.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:ba,alt:r("sagas.item.item_added_toast.title")})}),onClose:g,body:t.jsx($,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:p=>t.jsx("strong",{children:p}),"collection-link":p=>t.jsx(te,{to:F.collectionDetail(m),children:t.jsx(d.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:p})})}})}):null},xa=q.memo(_a),Ea=({collection:i,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:l})=>{var I,u;const o=ve(),h=_e(),g=((I=o.state)==null?void 0:I.fromParam)===Ae.COLLECTIONS,p=((u=o.state)==null?void 0:u.fromParam)===Ae.TP_COLLECTIONS,E=b.useCallback(()=>{h.push(F.collections())},[h]),w=b.useCallback(()=>{if(i&&(g||p)){const N=g?F.collectionDetail:F.thirdPartyCollectionDetail;h.push(N(i.id))}else h.push(F.itemEditor())},[g,p,h,i]),S=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{i&&n("CreateSingleItemModal",{collectionId:i.id})},[i,n]),x=b.useCallback(()=>{i&&n("AddExistingItemModal",{collectionId:i.id})},[i,n]),f=b.useCallback(()=>{i&&n("EditCollectionNameModal",{collection:i})},[i,n]),T=b.useCallback(()=>{i&&l(i)},[i,l]),R=b.useCallback(()=>{const N=i&&Vt(i.owner,m||"");return i?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${g||p?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(te,{to:F.collectionDetail(i.id),children:i.name}),t.jsx(at,{collection:i})]}),N&&!i.isPublished?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[t.jsx(d.Dropdown.Item,{onClick:f,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(d.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(d.Dropdown.Item,{onClick:x,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(st,{name:i.name,onDelete:T,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[i,m,e,g,p]),M=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:E}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(d.Dropdown.Menu,{children:t.jsx(d.Dropdown.Item,{onClick:S,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(d.Row,{grow:!1,shrink:!1,className:"Header",children:i?R():M()})},va=()=>{const i=oe();return C(m=>i?Ee(m,i):null)},ja=()=>{const i=se(),m=C(ae),e=C(Ut),s=Te(),a=C(je),n=va(),l=C(p=>!!(n&&m&&$e(p,m,n))),o=b.useCallback((p,E)=>i(Ge(p,E)),[i]),h=b.useCallback(p=>i($t(p)),[i]),g=b.useCallback(p=>i(Ye(p)),[i]);return t.jsx(Ea,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:o,onDeleteCollection:h,onDeleteItem:g,hasEditRights:l,hasUserOrphanItems:a})},B=10;class W extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:n?s:null})]})}}class Sa 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 ee(e)?t.jsx(d.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(te,{to:F.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(pe,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Gt,{item:e}),e.name]}),t.jsx(d.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${ue(e)}`).toLowerCase()})}),disabled:Je(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var A=(i=>(i.TO_REVIEW="to-review",i.REVIEWED="reviewed",i.ALL_ITEMS="all-items",i))(A||{});const fa={[A.TO_REVIEW]:1,[A.REVIEWED]:1,[A.ALL_ITEMS]:1};class Ta extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:A.TO_REVIEW,currentPages:fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Se());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===A.TO_REVIEW&&!ze(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var g;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:l,onSetItems:o}=this.props;if(!Je(e,s))return;let h=a.filter(p=>p.id!==e.id);if(ee(e))if(this.isVisible(e)){l?n==null||n.emote.pause():n==null||n.emote.play();return}else h=h.filter(p=>p.type!==L.EMOTE);this.isVisible(e)||(h.push(e),(g=this.analytics)==null||g.track("Preview Item",{ITEM_ID:e!=null&&e.urn?z(e.urn)?qe(e.urn):Ce(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:z(e.urn)})),o(h)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:l}=this.state;e===A.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(l[A.ALL_ITEMS])}):e===A.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(l=>({currentPages:{...l.currentPages,[a]:+s.activePage}})),a!==A.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(A.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?z(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:l}=this.props;return t.jsx(Sa,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:l,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(Ie),a=e.filter(ee);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(W,{label:this.renderCollapsableLabel(L.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(W,{label:this.renderCollapsableLabel(L.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],l=Math.ceil(e/B);return l>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:l,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],l=(n-1)*B,o=n*B;return t.jsx(d.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:l,pageEnd:o>e?e:o,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:l,currentPages:o}=this.state,h=this.getIsReviewingTPItems(),g=o[l];if(s)return t.jsx(d.Loader,{size:"large",active:!0});switch(l){case A.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!h&&a?this.renderTabPagination(a):null]});case A.REVIEWED:{const p=n.slice((g-1)*B,g*B);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(p),n.length?this.renderTabPagination(n.length):null]})}case A.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let l;const o=!s||s<B||a.length===s;switch(n){case A.TO_REVIEW:l=t.jsx(d.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!o,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(d.Button,{disabled:e||o,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(d.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case A.REVIEWED:l=t.jsx($,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:K(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",l," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(d.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx($,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:A.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(d.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(d.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(d.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:()=>this.handleTabChange(A.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:e===A.TO_REVIEW,onClick:()=>this.handleTabChange(A.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(d.Tabs.Tab,{active:e===A.REVIEWED,onClick:()=>this.handleTabChange(A.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(d.Tabs.Tab,{active:e===A.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(V,{name:e}),t.jsx($,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(d.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class wa extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(te,{to:F.itemEditor({collectionId:m.id}),children:[t.jsx(Yt,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(at,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class ya 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:l}=this.props,{currentPage:o}=this.state;if(e.length===0)return null;const h=Math.ceil(l/B);return s?t.jsx(d.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(d.Section,{className:"Collections",children:[e.map(g=>t.jsx(wa,{collection:g,items:a,isSelected:g.id===n},g.id)),h>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:h,activePage:o,onPageChange:this.handlePageChange}):null]})})}}var J=(i=>(i.COLLECTIONS="collections",i.ORPHAN_ITEMS="orphanItems",i))(J||{});const Y=1;let Pa=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:l}=this.props,{pages:o}=this.state;if(e&&!n&&!l){const h=o[o.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:B,page:h})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:l}=this.props,o=this.isCollectionTabActive()?n:a,h=Math.ceil(o/B);if(h>s.length){const g=[...Array(h).keys()].map(p=>p+1).filter(p=>!s.includes(p));if(g.length>0){const p=g[Math.floor(Math.random()*g.length)];this.setState(E=>({pages:[...E.pages,p]}),this.fetchResource)}}l(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[Y]},this.fetchResource)});c(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===J.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=J.COLLECTIONS;return!e&&s&&(a=J.ORPHAN_ITEMS),{pages:[Y],currentTab:a,initialPage:Y,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:l}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&l([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:l,selectedItemId:o,selectedItem:h,orphanItems:g,totalItems:p,visibleItems:E,hasUserOrphanItems:w,onSetItems:S,onFetchOrphanItem:j}=this.props,{initialPage:x,pages:f}=this.state;if(!l&&n&&o&&p&&(x===Y||s.initialPage<x)){if(!g.find(T=>T.id===o)){const T=Math.ceil(p/B),R=f[f.length-1],M=Math.min(T,R+1);f.includes(M)||this.setState({pages:[M],initialPage:M},this.fetchResource)}}else if(e.selectedItemId&&o&&e.selectedItemId!==o){const T=E.filter(R=>R.type!==L.EMOTE);S(T)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!l)&&this.setState({pages:[Y]},this.fetchResource),e.selectedCollectionId!==l&&this.setState({pages:[Y]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&h&&h.type!==L.EMOTE&&S([h]),e.selectedCollectionId!==l&&S([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:l,isReviewing:o}=this.props;return n&&e?Jt(e)&&o?s.filter(h=>!!(a!=null&&a.find(g=>g.itemId===h.id&&g.status===X.PENDING))):s:l}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:l,selectedCollectionId:o,visibleItems:h,bodyShape:g,reviewedItems:p,isReviewing:E,isPlayingEmote:w,isConnected:S,wearableController:j,isLoading:x,hasUserOrphanItems:f,onSetItems:T,onSetReviewedItems:R,onResetReviewedItems:M}=this.props,{pages:I,showSamplesModalAgain:u}=this.state,N=!o&&f,k=this.isCollectionTabActive()&&!o,_=!this.isCollectionTabActive()||o;return t.jsx("div",{className:"LeftPanel",children:S?t.jsx(ea,{id:o,itemSelected:l,itemsPage:I,itemsPageSize:B,fetchCollectionItemsOptions:{status:E?X.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:O,paginatedItems:re,initialPage:lt,isLoadingCollection:ot,isLoadingCollectionItems:rt,itemCurations:dt})=>{const Z=this.getItems(O,re,dt),ye=this.isCollectionTabActive(),ct=o&&O?lt:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(ja,{}),N?t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:ye,onClick:()=>this.handleTabChange(J.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(d.Tabs.Tab,{active:!ye,onClick:()=>this.handleTabChange(J.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,k?t.jsx(ya,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Z.length>0,selectedCollectionId:o,onLoadPage:this.loadPage,isLoading:ot}):null,_?t.jsxs(t.Fragment,{children:[t.jsx(Ta,{items:Z,totalItems:s||Z.length,hasHeader:!o&&n.length>0,selectedItemId:l,collection:O,isReviewing:E,isPlayingEmote:w,visibleItems:h,bodyShape:g,onResetReviewedItems:M,reviewedItems:p,onSetItems:T,wearableController:j,initialPage:ct,isLoading:rt||x,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:u,onReviewItems:()=>R(Z),onLoadRandomPage:()=>this.loadRandomPage(Z),onLoadPage:this.loadPage}),t.jsx(xa,{collectionId:o})]}):null]})}}):null})}};const Aa=i=>{const m=se(),e=oe(),s=we(),a=Te(),n=nt(),l=C(_=>ae(_)),o=C(_=>xe(_)),h=C(_=>zt(_)),g=C(_=>qt(_)),p=C(_=>Ze(_)),E=C(_=>Ke(_)),w=C(_=>Qe(_)),S=C(_=>je(_)),j=C(_=>Ue(_)),x=C(_=>s?fe(_,s):null),f=C(_=>{if(e)return ge(_,e);if(l)return ge(_,l)}),T=C(_=>e?void 0:Zt(_)),R=C(_=>l&&!e?Kt(_,l,f==null?void 0:f.limit):Qt(_)),M=b.useMemo(()=>G(j,ts)||G(j,ss),[j]),I=b.useCallback(_=>m(Xe(_)),[m]),u=b.useCallback((_,v)=>m(Xt(_,v)),[m]),N=b.useCallback((_,v)=>m(et(_,v)),[m]),k=b.useCallback(_=>m(es(_)),[m]);return t.jsx(Pa,{...i,address:l,isConnected:o,items:h,totalItems:(f==null?void 0:f.total)||null,totalCollections:(T==null?void 0:T.total)||null,orphanItems:R,collections:g,selectedItemId:s,selectedItem:x,selectedCollectionId:e,visibleItems:n,bodyShape:p,wearableController:E,isReviewing:a,isLoading:M,isPlayingEmote:w,hasUserOrphanItems:S,onSetItems:I,onFetchCollections:u,onFetchOrphanItems:N,onFetchOrphanItem:k})},Na=Aa;var Q=(i=>(i[i.ZOOM_IN=0]="ZOOM_IN",i[i.ZOOM_OUT=1]="ZOOM_OUT",i[i.PAN_CAMERA_Y=2]="PAN_CAMERA_Y",i[i.CHANGE_CAMERA_ALPHA=3]="CHANGE_CAMERA_ALPHA",i))(Q||{});class me extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:l}=this.props;if(a.toHexString()!==s.value){const o=n.find(h=>h.toHexString()===s.value);l(o)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(d.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,n=e.toHexString();return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(d.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ra=class extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:l,onChange:o,baseWearables:h}=this.props,g=s.value?h.find(p=>p.id===s.value):null;a!==g&&o(n,l,g??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:l,baseWearables:o}=this.props,h=as(o,a,s).map(p=>({value:p.id,text:ns(p)}));l&&h.push({value:"",text:r("global.none")});const g=e?h.find(p=>p.value===e.id):null;return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:h,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:g?g.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const Ma=i=>({baseWearables:is(i)}),ne=He(Ma)(Ra);let Da=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1});c(this,"analytics",Se());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:l,onSetItems:o}=this.props,h=a.find(p=>p.id===s),g=n.filter(p=>p.type!==L.EMOTE);g.forEach(p=>{var E;(E=this.analytics)==null||E.track("Play Emote",{EMOTE_PLAYED_BASE:!h,EMOTE_PLAYED_ITEM_ID:h!=null&&h.urn?Ce(h.urn):null,EMOTE_PLAYED_NAME:h?h.name:s,PREVIEWED_WEARABLE_ITEM_ID:p!=null&&p.urn?z(p.urn)?qe(p.urn):Ce(p.urn):null,PREVIEWED_WEARABLE_NAME:p.name})}),h?g.push(h):l(s),o(g)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(Ne.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handleControlActionChange",async e=>{const{wearableController:s}=this.props,a=.1;if(s)switch(await(s==null?void 0:s.emote.pause()),e){case Q.ZOOM_IN:{await(s==null?void 0:s.scene.changeZoom(a));break}case Q.ZOOM_OUT:{await(s==null?void 0:s.scene.changeZoom(-a));break}}});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:l}=this.props,o=a.filter(h=>h.type!==L.EMOTE);s?(n(P.PreviewEmote.IDLE),l(o)):e==null||e.emote.play()});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(d.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(d.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,l=s.length>0;return a?null:t.jsx(d.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(d.Dropdown.Menu,{children:[l&&t.jsxs(t.Fragment,{children:[t.jsx(d.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(d.Dropdown.Divider,{}),s.map(o=>t.jsx(d.Dropdown.Item,{value:o.id,text:o.name,onClick:this.handleAnimationChange},o.id)),t.jsx(d.Dropdown.Divider,{}),t.jsx(d.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(d.Dropdown.Divider,{})]}),P.PreviewEmote.schema.enum.map(o=>t.jsx(d.Dropdown.Item,{value:o,text:r(`emotes.${o}`),onClick:this.handleAnimationChange},o))]})})});c(this,"renderEmoteSelector",()=>t.jsx(d.Popup,{content:r("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(d.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:l,onFetchBaseWearables:o,onFetchOrphanItems:h,onFetchCollectionItems:g}=this.props,p=a.length>0;n||o(),p||(s&&!H(s)?g(s.id):e&&l&&h(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const n=s.find(l=>l.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:l,selectedBaseWearables:o,selectedItem:h,visibleItems:g,isImportFilesModalOpen:p,wearableController:E}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:S,isLoading:j}=this.state,x=g.some(ee)&&(h==null?void 0:h.type)===L.EMOTE,f=l===P.PreviewEmote.JUMP?1:void 0;return t.jsxs("div",{className:`CenterPanel ${p?"import-files-modal-is-open":""}`,children:[t.jsx(Ne,{id:"wearable-editor",profile:"default",bodyShape:e,emote:l,zoom:f,skin:de(s),eyes:de(a),hair:de(n),urns:o?Object.values(o).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:g.map(ls),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:os,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:x,showSceneBoundaries:S}),x?t.jsxs("div",{className:"zoom-controls",children:[t.jsx(d.Button,{className:"zoom-control zoom-in-control",onClick:()=>this.handleControlActionChange(Q.ZOOM_IN),children:t.jsx(d.Icon,{name:"plus"})}),t.jsx(d.Button,{className:"zoom-control zoom-out-control",onClick:()=>this.handleControlActionChange(Q.ZOOM_OUT),children:t.jsx(d.Icon,{name:"minus"})})]}):null,j&&t.jsx(d.Center,{children:t.jsx(d.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[x&&!j&&E?t.jsx("div",{className:"emote-controls-container",children:t.jsx(rs,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(d.Icon,{name:"user"})}),x?null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${S?"active":""}`,children:t.jsx(V,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:P.BodyShape.MALE,text:r("body_shapes.male")},{value:P.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:s,colors:ds(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:a,colors:cs(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:n,colors:hs(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.HAIR],category:P.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.FACIAL_HAIR],category:P.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.UPPER_BODY],category:P.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.LOWER_BODY],category:P.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const La=()=>{const i=se(),m=C(ae),e=C(Ze),s=C(ms),a=C(gs),n=C(ps),l=C(us),o=C(Cs),h=nt(),g=C(Ke),p=C(Is),E=C(Qe),w=C(bs),S=C(je),j=C(_s),x=oe(),f=we(),T=C(v=>f?fe(v,f):null),R=b.useMemo(()=>x?j.find(v=>v.id===x):void 0,[j,x]),M=b.useMemo(()=>x?p.filter(v=>v.collectionId===x):p.filter(v=>!v.collectionId),[p,x]),I=o?o[e]:null,N=b.useMemo(()=>!h.some(ee)&&l===P.PreviewEmote.IDLE,[h,l])?!1:E,k="CreateSingleItemModal"in w,_=b.useMemo(()=>({onSetBodyShape:v=>{i(xs(v))},onSetAvatarAnimation:v=>{i(Es(v))},onSetSkinColor:v=>{i(vs(v))},onSetEyeColor:v=>{i(js(v))},onSetHairColor:v=>{i(Ss(v))},onSetBaseWearable:(v,O,re)=>{i(fs(v,O,re))},onFetchBaseWearables:()=>{i(Ts())},onSetWearablePreviewController:v=>{i(ws(v))},onSetItems:v=>{i(Xe(v))},onFetchOrphanItems:(v,O)=>{i(et(v,O))},onFetchCollectionItems:(v,O)=>{i(ys(v,O))}}),[i]);return t.jsx(Da,{address:m,bodyShape:e,collection:R,selectedItem:T,selectedBaseWearables:I,skinColor:s,eyeColor:a,hairColor:n,emote:l,visibleItems:h,wearableController:g,emotes:M,isPlayingEmote:N,isImportFilesModalOpen:k,hasUserOrphanItems:S,..._})},Oa=La;class ka extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,l=e.target.value;s!==l&&n(a?l.slice(0,a):l)})}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 le 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,l=s.value;l!==a&&(this.setState({value:l}),n(l))})}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(l=>l.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:n?n.text:r("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(d.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}c(le,"defaultProps",{disabled:!1});class be extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,l=s.value,o=[...n];for(const h of l)n.includes(h)||o.push(h);o.length!==n.length&&(this.setState({value:o}),a(o))});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,l=a.reduce((o,h)=>(o[h.value]=h.text,o),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(ie,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(o=>t.jsxs("div",{className:"value",children:[l[o],t.jsx("div",{className:"remove",onClick:h=>{this.handleRemove(o),h.stopPropagation()}})]},o)):t.jsx("div",{className:"placeholder",children:r("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(d.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(be,"defaultProps",{disabled:!1});class it 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 l=[...a,n];this.setState({value:l,draft:""}),e(l)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===Ps||e.keyCode===Re||e.keyCode===As)this.handleAdd();else if(e.keyCode===Ns||e.keyCode===Re){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:l=>{this.handleRemove(n),l.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(it,"defaultProps",{isDisabled:!1});let Ba=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Se());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[Me]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;ce(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===P.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===he.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(o=>!P.WearableCategory.schema.enum.includes(o)),...e]:n=[...a.filter(o=>!P.BodyPartCategory.schema.enum.includes(o)),...e];const l=this.setHides(this.state.data,n);this.setState({data:l,isDirty:this.isDirty({data:l})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,S;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:l,utility:o,rarity:h,contents:g,data:p,isDirty:E}=this.state;if(E&&e){let j=p;j&&!ce(j)&&(j={...j,removesDefaultHiding:j.category===P.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(P.WearableCategory.UPPER_BODY)?[P.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const x={...e.contents,...await Rs(g)},f={...e,name:n,description:l,rarity:h,data:j,contents:x,utility:o??void 0};s&&[De.UNPUBLISHED,De.UNDER_REVIEW].includes(s)&&(f.video=x[Me]),a(f,g),z(f.urn)&&((S=this.analytics)==null||S.track("Edit Item",{contents:g})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===L.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=Ms(e);this.setState({thumbnail:e,contents:{[Le]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Oe(a),l=await Oe(a,1024,1024),o=URL.createObjectURL(n);this.setState({thumbnail:o,contents:{[Le]:l},isDirty:!0})}});c(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;Ie(e)&&((a=s.replaces)!=null&&a.length)&&(s.hides=s.hides.concat(s.replaces),s.replaces=[]),this.setState({thumbnail:"",video:"",name:e.name,description:e.description,utility:e.utility||"",rarity:e.rarity,data:e.data,hasItem:!0,isDirty:!1})}getInitialState(){return{name:"",description:"",utility:"",thumbnail:"",video:"",rarity:void 0,contents:{},data:void 0,hasItem:!1,isDirty:!1}}setReplaces(e,s){return{...e,replaces:s,representations:e.representations.map(a=>({...a,overrideReplaces:s}))}}setHides(e,s){return{...e,hides:s,representations:e.representations.map(a=>({...a,overrideHides:s}))}}canEditItemMetadata(e){const{collection:s,canEditSelectedItem:a}=this.props;return!e||s&&ke(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===P.WearableCategory.SKIN}isDirty(e={}){const{selectedItem:s}=this.props,{hasItem:a}=this.state;return a?this.hasStateItemChanged({...this.state,...e},s):!1}hasSavedItem(){const{selectedItem:e}=this.props,{isDirty:s}=this.state;return e&&!s&&this.hasStateItemChanged(this.state,e)}hasStateItemChanged(e,s){return e.name!==s.name||e.description!==s.description||e.utility!==s.utility||e.rarity!==s.rarity||!ze(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||ce(a))return null;const n=Ds(e.contents,a.category),l=Ls(e.contents),o=a.hides.filter(g=>n.includes(g)),h=a.hides.filter(g=>l.includes(g));return t.jsxs(t.Fragment,{children:[t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:h,options:this.asCategorySelect(e.type,l),disabled:!s,onChange:g=>this.handleChangeHides(g,"bodypart")}),t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:o,options:this.asCategorySelect(e.type,o.some(g=>g===P.WearableCategory.BODY_SHAPE)?n:n.filter(g=>g!==P.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:g=>this.handleChangeHides(g,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),l=s?t.jsx(d.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(V,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(V,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),l,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(pe,{item:e,src:a,hasBadge:!0,badgeSize:"small"}),t.jsxs("div",{className:"thumbnail-edit-container",children:[t.jsx("input",{type:"file",ref:this.thumbnailInput,onChange:this.handleThumbnailChange,accept:"image/png"}),t.jsx("div",{className:"thumbnail-edit-background"}),t.jsx(V,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[l,t.jsx(pe,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(Os,{item:e})]})}renderVideoDetails(e){if(!Be(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(V,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(V,{name:"play",className:"play-video-button",onClick:a}),t.jsx(We,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[ks(e)&&t.jsx(V,{name:"play",className:"play-video-button",onClick:a}),t.jsx(We,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Bs,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:l,isCampaignEnabled:o,isVrmOptOutEnabled:h,campaignName:g,campaignTag:p}=this.props,{name:E,description:w,utility:S,rarity:j,data:x,isDirty:f,hasItem:T}=this.state,R=P.Rarity.getRarities(),M=Ws();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(na,{id:e,children:(I,u,N)=>{var O;const k=u&&ke(u),_=this.canEditItemMetadata(I),v=I?Ie(I)?Fs(I.contents):Hs():[];return N?t.jsx(d.Loader,{size:"massive",active:!0}):T||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),I&&tt(I,s)&&!I.isPublished&&!k?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[ue(I)!==null?t.jsx(d.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${ue(I)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(st,{name:E,onDelete:this.handleDeleteItem,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(W,{label:r("item_editor.right_panel.details"),children:I?t.jsxs(t.Fragment,{children:[this.renderModelDetails(I),this.renderVideoDetails(I)]}):null}),t.jsx(W,{label:r("item_editor.right_panel.basics"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(ka,{label:r("global.name"),value:E,disabled:!_,maxLength:Vs,onChange:this.handleChangeName}),t.jsx(d.TextAreaField,{maxLength:Us,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!_,value:w,rows:"2",cols:"12"}),a?t.jsx(d.TextAreaField,{maxLength:$s,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!_,value:S,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(le,{itemId:I.id,label:r("global.category"),value:x.category,options:this.asCategorySelect(I.type,v),disabled:!_,onChange:this.handleChangeCategory}),!(I.urn&&z(I.urn))&&t.jsx(le,{itemId:I.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(R),disabled:I.isPublished||!_,onChange:this.handleChangeRarity})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(ie,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(I)}),(I==null?void 0:I.type)===L.EMOTE&&t.jsx(W,{label:r("item_editor.right_panel.animation"),children:I?t.jsx(le,{itemId:I.id,label:r("create_single_item_modal.play_mode_label"),value:x.loop?he.LOOP:he.SIMPLE,options:this.asPlayModeSelect(M),disabled:!_,onChange:this.handlePlayModeChange}):null}),I&&Be(I)&&((O=I.data.requiredPermissions)!=null&&O.length)?t.jsx(W,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(I)}):null,t.jsx(W,{label:r("item_editor.right_panel.tags"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(it,{itemId:I.id,value:x.tags,onChange:this.handleChangeTags,isDisabled:!_}),o&&g&&p&&_&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:p}),event_name:t.jsx("span",{children:g})})})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&h&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(ie,{content:r("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(d.Checkbox,{toggle:!0,label:x!=null&&x.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(x!=null&&x.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(ie,{content:r("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(d.Checkbox,{toggle:!0,label:(x==null?void 0:x.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(x==null?void 0:x.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),f?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(d.Button,{secondary:!0,onClick:this.handleOnResetItem,children:r("global.cancel")}),t.jsx(Fe,{primary:!0,onClick:this.handleOnSaveItem,network:P.Network.MATIC,children:r("global.save")})]}):l&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",l]}):null]})]}):null}}):null})}};const Wa=()=>{const i=se(),m=we(),e=C(u=>ae(u)),s=C(u=>xe(u)),a=C(u=>Gs(u)),n=C(u=>Ys(u)),l=C(u=>Ve(u)),o=C(u=>Js(u)),h=C(u=>ta(u)),g=C(u=>zs(u)),p=C(u=>qs(u)),E=C(u=>m?fe(u,m):null),w=C(u=>m&&E&&E.collectionId?Ee(u,E.collectionId):null),S=C(u=>{const N=sa(u),k=aa(u);return N==null?void 0:N[k]}),j=C(u=>Zs(u)),x=C(u=>!E||!e?!1:w?$e(u,e,w):tt(E,e)),f=b.useMemo(()=>m?j[m]:null,[m,j]),T=b.useCallback((u,N)=>i(Ks(u,N)),[i]),R=b.useCallback(u=>i(Ye(u)),[i]),M=b.useCallback((u,N)=>i(Ge(u,N)),[i]),I=b.useCallback(u=>i(Qs(u)),[i]);return t.jsx(Ba,{address:e,collection:w,selectedItem:E,selectedItemId:m,canEditSelectedItem:x,itemStatus:f,error:a,isConnected:s,isDownloading:n,isCommitteeMember:l,isCampaignEnabled:o,campaignTag:h,campaignName:S,isVrmOptOutEnabled:g,isWearableUtilityEnabled:p,onSaveItem:T,onDeleteItem:R,onOpenModal:M,onDownload:I})},Fa=Wa;class tn 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(Ia,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Na,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Oa,{}),t.jsx(Fa,{})]})]})})}}export{tn as default};
|
|
1
|
+
var ht=Object.defineProperty;var mt=(i,m,e)=>m in i?ht(i,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[m]=e;var c=(i,m,e)=>mt(i,typeof m!="symbol"?m+"":m,e);import{ae as q,H as t,M as d,G as r,bk as $,bJ as gt,D as b,gt as X,L as te,K as F,cj as Fe,b4 as P,N as He,bD as G,gu as pt,eF as ut,gv as Ct,gw as It,gx as bt,gy as _t,gz as xt,gA as Et,gB as vt,gC as jt,gD as H,et as St,gE as K,gF as Pe,a4 as se,Z as _e,a5 as C,aG as ae,gG as ft,de as xe,br as Ve,fe as Ee,ft as Tt,fW as wt,fX as yt,eC as ge,gm as Pt,gH as At,gI as Nt,fZ as Rt,eG as Ue,gJ as Mt,gK as Dt,gL as Lt,gM as Ot,fo as kt,fY as Bt,f_ as Wt,aM as ve,gN as Ft,gO as Ht,eU as Ae,bK as Vt,ad as Ut,eJ as je,gP as $e,X as Ge,ew as $t,er as Ye,fG as ee,dG as pe,es as Gt,eX as ue,gQ as Je,bi as Se,fV as ze,e_ as L,eu as z,fC as qe,fD as Ce,J as V,f9 as Ie,dF as Yt,eS as Jt,fl as zt,gR as qt,gS as Ze,gT as Ke,gU as Qe,fd as fe,eD as Zt,gV as Kt,gW as Qt,fK as Xe,eM as Xt,eL as et,eN as es,eP as ts,eQ as ss,gX as as,gY as ns,gZ as is,g_ as Ne,g$ as de,h0 as ls,eg as os,h1 as rs,h2 as ds,h3 as cs,h4 as hs,h5 as ms,h6 as gs,h7 as ps,h8 as us,h9 as Cs,ha as Is,hb as bs,fm as _s,hc as xs,hd as Es,he as vs,hf as js,hg as Ss,hh as fs,hi as Ts,hj as ws,f$ as ys,bU as ie,hk as Ps,hl as Re,hm as As,hn as Ns,eW as Me,fH as ce,ho as he,eV as Rs,eR as De,eY as Ms,eZ as Le,e$ as Oe,f0 as ke,hp as Ds,hq as Ls,f1 as Os,f2 as Be,f3 as We,hr as ks,fc as Bs,hs as Ws,ht as Fs,hu as Hs,hv as tt,hw as Vs,hx as Us,hy as $s,hz as Gs,hA as Ys,eI as Js,hB as zs,fg as qs,ff as Zs,fi as Ks,hC as Qs}from"./index-BlcMW_g6.js";import{g as oe,h as Te,i as we}from"./hooks-C8UcKsSN.js";import{J as Xs}from"./JumpIn.container-CeSOEwOc.js";import{C as ea}from"./CollectionProvider.container-78TB9kiH.js";import{C as st}from"./ConfirmDelete-71BcCucu.js";import{C as at}from"./CollectionStatus.container-DBfnW5vX.js";import{d as ta,e as sa,c as aa}from"./selectors-C5Krcz9D.js";import{I as na}from"./ItemProvider.container-B_BAvEtH.js";const ia=({open:i,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(d.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:i,children:[t.jsx(d.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(gt,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx($,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:s,children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),la=q.memo(ia);var D=(i=>(i.REJECT_COLLECTION="REJECT_COLLECTION",i.REJECT_CURATION="REJECT_CURATION",i.DISABLE_COLLECTION="DISABLE_COLLECTION",i.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",i))(D||{});const U="item_editor.top_panel.rejection_modal",oa=({open:i,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:l,curation:o,onReject:h,onRejectCuration:g,onClose:p})=>{const E=b.useMemo(()=>{switch(m){case D.DISABLE_COLLECTION:return U+".disable_collection";case D.REJECT_CURATION:return U+".reject_curation";case D.DISABLE_THIRD_PARTY:return U+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case D.DISABLE_COLLECTION:h(l);break;case D.REJECT_CURATION:g(o.collectionId);break;case D.DISABLE_THIRD_PARTY:s&&n(s.id);break}},S=m===D.DISABLE_COLLECTION&&!l.isApproved||m===D.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===D.REJECT_COLLECTION&&!l.isApproved||m===D.REJECT_CURATION&&(o==null?void 0:o.status)===X.REJECTED;return t.jsx(d.Modal,{size:"tiny",className:"RejectionModal",open:i,children:a?t.jsx(ra,{i18nKey:E}):S?t.jsx(da,{link:l.forumLink,onClose:p}):t.jsx(ca,{i18nKey:E,isLoading:e,onClose:p,onConfirm:w})})},ra=({i18nKey:i})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${i}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx($,{id:U+".visit_activity",values:{activity_link:t.jsx(te,{to:F.activity(),children:r("global.activity")})}})}),t.jsx(d.Loader,{active:!0,size:"large"})]})]}),da=({link:i,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(U+".veredict_explanation")}),t.jsx(d.Modal.Content,{children:r(U+".go_to_forum")}),t.jsxs(d.Modal.Actions,{children:[t.jsx("a",{href:i,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(d.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(U+".forum_link")}),t.jsx("div",{className:"discussion",children:r(U+".discussion")}),t.jsx(d.Icon,{name:"chevron right"})]})}),t.jsx(d.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),ca=({i18nKey:i,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(d.Modal.Header,{children:r(`${i}.title`)}),t.jsx(d.Modal.Content,{children:r(`${i}.subtitle`)}),t.jsxs(d.Modal.Actions,{children:[t.jsx(Fe,{primary:!0,onClick:e,disabled:m,loading:m,network:P.Network.MATIC,children:r(`${i}.action`)}),t.jsx(d.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),ha=q.memo(oa),ma=(i,m)=>({isLoading:G(ut(i),pt)||G(It(i),Ct)||bt(i),hasPendingTransaction:_t(i)||!!(m.thirdParty&&xt(i,m.thirdParty.id))}),ga=i=>({onReject:m=>i(Et(m)),onRejectCuration:m=>i(vt(m)),onDisableThirdParty:m=>i(jt(m))}),pa=He(ma,ga)(ha);var y=(i=>(i[i.APPROVE=0]="APPROVE",i[i.REJECT=1]="REJECT",i[i.ENABLE=2]="ENABLE",i[i.DISABLE=3]="DISABLE",i[i.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",i))(y||{});let ua=class extends q.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push(F.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:l,onSetAssignee:o}=this.props;this.setState({showApproveConfirmModal:!1}),a&&o(e.id,a,s),H(e)?l(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:l,thirdParty:o}=this.props,{showRejectionModal:h,showApproveConfirmModal:g}=this.state,{chainId:p}=this.props,E=St(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(Xs,{size:"small",active:!0,collection:e,chainId:p,items:H(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:H(e)&&l!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),h&&t.jsx(pa,{type:h,open:!0,collection:e,curation:n,thirdParty:o,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&g&&t.jsx(la,{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:l,onInitiateApprovalFlow:o,onInitiateTPApprovalFlow:h,onDeployMissingEntities:g,reviewedItems:p,totalItems:E}=this.props,w={[y.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):H(s)?h(s):o(s),[y.ENABLE]:()=>o(s),[y.DISABLE]:()=>this.setShowRejectionModal(l?D.DISABLE_THIRD_PARTY:D.DISABLE_COLLECTION),[y.REJECT]:()=>{(a==null?void 0:a.status)===X.PENDING?this.setShowRejectionModal(D.REJECT_CURATION):this.setShowRejectionModal(D.REJECT_COLLECTION)},[y.DEPLOY_MISSING_ENTITIES]:()=>g(s)},S={[y.APPROVE]:"approve",[y.ENABLE]:"enable",[y.DISABLE]:"disable",[y.REJECT]:"reject",[y.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===y.APPROVE||e===y.ENABLE||e===y.DEPLOY_MISSING_ENTITIES,x=!H(s)||!!E&&p.length>=K(E);return t.jsx(d.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:x,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(d.Button,{primary:j,onClick:()=>w[e](),disabled:H(s)&&e===y.APPROVE&&!!E&&p.length<K(E),children:r(`item_editor.top_panel.${S[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:l,thirdParty:o}=this.props,h=a==null?void 0:a.some(g=>g.status===X.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(d.Header,{sub:!0,children:[h?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:K(l)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=K(l)?t.jsx(d.Icon,{name:"check circle"}):null]}),h&&this.renderButton(y.APPROVE,e,s),h&&this.renderButton(y.REJECT,e,s),!h&&(o==null?void 0:o.isApproved)&&this.renderButton(y.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(y.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(y.DEPLOY_MISSING_ENTITIES,e,s)]}):Pe(e)?this.renderButton(y.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(y.APPROVE,e,s),this.renderButton(y.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:l,isLoading:o}=this.props,h=!e||o&&!s.length;return a&&n&&l?t.jsx("div",{className:"TopPanel",children:h?t.jsx(d.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const Ca=({reviewedItems:i})=>{const m=se(),e=_e(),s=oe(),a=Te(),n=C(ae),l=C(ft),o=C(xe),h=C(Ve),g=C(u=>s?Ee(u,s):null),p=C(u=>g?Tt(u,g.id):[]),E=C(u=>g?wt(u,g.id):[]),w=C(u=>s?yt(u,s):null),S=C(u=>s?ge(u,s):void 0),j=C(u=>g&&H(g)?Pt(u,g):null),x=C(u=>s?At(u,s):!1),f=C(u=>G(Nt(u),kt)||G(Rt(u),Bt)||G(Ue(u),Wt)),T=b.useCallback((u,N,k)=>{m(Mt(u,N,k))},[m]),R=b.useCallback(u=>{m(Dt(u))},[m]),M=b.useCallback(u=>{m(Lt(u))},[m]),I=b.useCallback(u=>{m(Ot(u))},[m]);return t.jsx(ua,{address:n,items:p,totalItems:(S==null?void 0:S.total)||null,collection:g,itemCurations:E,thirdParty:j,curation:w,chainId:l,isConnected:o,isReviewing:a,isCommitteeMember:h,selectedCollectionId:s,hasCollectionMissingEntities:x,isLoading:f,reviewedItems:i,onSetAssignee:T,onInitiateTPApprovalFlow:R,onInitiateApprovalFlow:M,onDeployMissingEntities:I,history:e})},Ia=Ca,nt=()=>{const{search:i}=ve();return C(e=>Ft(e,i))},ba="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",_a=i=>{const{collectionId:m}=i,[e,s]=b.useState(!1),[a,n]=b.useState(null),l=_e(),o=ve(),h=b.useMemo(()=>Ht(o.search),[o.search]);b.useEffect(()=>{h&&(s(!0),n(h))},[h]);function g(){s(!1);const p=new URLSearchParams(o.search);p.delete("newItem"),l.replace({search:p.toString()})}return e&&a&&m?t.jsx(d.Toast,{type:d.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:ba,alt:r("sagas.item.item_added_toast.title")})}),onClose:g,body:t.jsx($,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:p=>t.jsx("strong",{children:p}),"collection-link":p=>t.jsx(te,{to:F.collectionDetail(m),children:t.jsx(d.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:p})})}})}):null},xa=q.memo(_a),Ea=({collection:i,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:l})=>{var I,u;const o=ve(),h=_e(),g=((I=o.state)==null?void 0:I.fromParam)===Ae.COLLECTIONS,p=((u=o.state)==null?void 0:u.fromParam)===Ae.TP_COLLECTIONS,E=b.useCallback(()=>{h.push(F.collections())},[h]),w=b.useCallback(()=>{if(i&&(g||p)){const N=g?F.collectionDetail:F.thirdPartyCollectionDetail;h.push(N(i.id))}else h.push(F.itemEditor())},[g,p,h,i]),S=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{i&&n("CreateSingleItemModal",{collectionId:i.id})},[i,n]),x=b.useCallback(()=>{i&&n("AddExistingItemModal",{collectionId:i.id})},[i,n]),f=b.useCallback(()=>{i&&n("EditCollectionNameModal",{collection:i})},[i,n]),T=b.useCallback(()=>{i&&l(i)},[i,l]),R=b.useCallback(()=>{const N=i&&Vt(i.owner,m||"");return i?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${g||p?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(te,{to:F.collectionDetail(i.id),children:i.name}),t.jsx(at,{collection:i})]}),N&&!i.isPublished?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[t.jsx(d.Dropdown.Item,{onClick:f,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(d.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(d.Dropdown.Item,{onClick:x,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(st,{name:i.name,onDelete:T,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[i,m,e,g,p]),M=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:E}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(d.Dropdown.Menu,{children:t.jsx(d.Dropdown.Item,{onClick:S,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(d.Row,{grow:!1,shrink:!1,className:"Header",children:i?R():M()})},va=()=>{const i=oe();return C(m=>i?Ee(m,i):null)},ja=()=>{const i=se(),m=C(ae),e=C(Ut),s=Te(),a=C(je),n=va(),l=C(p=>!!(n&&m&&$e(p,m,n))),o=b.useCallback((p,E)=>i(Ge(p,E)),[i]),h=b.useCallback(p=>i($t(p)),[i]),g=b.useCallback(p=>i(Ye(p)),[i]);return t.jsx(Ea,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:o,onDeleteCollection:h,onDeleteItem:g,hasEditRights:l,hasUserOrphanItems:a})},B=10;class W extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:n?s:null})]})}}class Sa 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 ee(e)?t.jsx(d.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(te,{to:F.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(pe,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Gt,{item:e}),e.name]}),t.jsx(d.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${ue(e)}`).toLowerCase()})}),disabled:Je(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var A=(i=>(i.TO_REVIEW="to-review",i.REVIEWED="reviewed",i.ALL_ITEMS="all-items",i))(A||{});const fa={[A.TO_REVIEW]:1,[A.REVIEWED]:1,[A.ALL_ITEMS]:1};class Ta extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:A.TO_REVIEW,currentPages:fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Se());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===A.TO_REVIEW&&!ze(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var g;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:l,onSetItems:o}=this.props;if(!Je(e,s))return;let h=a.filter(p=>p.id!==e.id);if(ee(e))if(this.isVisible(e)){l?n==null||n.emote.pause():n==null||n.emote.play();return}else h=h.filter(p=>p.type!==L.EMOTE);this.isVisible(e)||(h.push(e),(g=this.analytics)==null||g.track("Preview Item",{ITEM_ID:e!=null&&e.urn?z(e.urn)?qe(e.urn):Ce(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:z(e.urn)})),o(h)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:l}=this.state;e===A.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(l[A.ALL_ITEMS])}):e===A.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(l=>({currentPages:{...l.currentPages,[a]:+s.activePage}})),a!==A.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(A.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?z(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:l}=this.props;return t.jsx(Sa,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:l,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(Ie),a=e.filter(ee);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(W,{label:this.renderCollapsableLabel(L.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(W,{label:this.renderCollapsableLabel(L.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],l=Math.ceil(e/B);return l>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:l,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],l=(n-1)*B,o=n*B;return t.jsx(d.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:l,pageEnd:o>e?e:o,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:l,currentPages:o}=this.state,h=this.getIsReviewingTPItems(),g=o[l];if(s)return t.jsx(d.Loader,{size:"large",active:!0});switch(l){case A.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!h&&a?this.renderTabPagination(a):null]});case A.REVIEWED:{const p=n.slice((g-1)*B,g*B);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(p),n.length?this.renderTabPagination(n.length):null]})}case A.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let l;const o=!s||s<B||a.length===s;switch(n){case A.TO_REVIEW:l=t.jsx(d.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!o,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(d.Button,{disabled:e||o,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(d.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case A.REVIEWED:l=t.jsx($,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:K(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",l," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(d.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(d.Modal.Content,{children:[t.jsx($,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:A.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(d.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(d.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(d.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(d.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(d.Modal.Actions,{children:[t.jsx(d.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(d.Button,{primary:!0,onClick:()=>this.handleTabChange(A.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:e===A.TO_REVIEW,onClick:()=>this.handleTabChange(A.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(d.Tabs.Tab,{active:e===A.REVIEWED,onClick:()=>this.handleTabChange(A.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(d.Tabs.Tab,{active:e===A.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(V,{name:e}),t.jsx($,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(d.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class wa extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(te,{to:F.itemEditor({collectionId:m.id}),children:[t.jsx(Yt,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(at,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class ya 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:l}=this.props,{currentPage:o}=this.state;if(e.length===0)return null;const h=Math.ceil(l/B);return s?t.jsx(d.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(d.Section,{className:"Collections",children:[e.map(g=>t.jsx(wa,{collection:g,items:a,isSelected:g.id===n},g.id)),h>1?t.jsx(d.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:h,activePage:o,onPageChange:this.handlePageChange}):null]})})}}var J=(i=>(i.COLLECTIONS="collections",i.ORPHAN_ITEMS="orphanItems",i))(J||{});const Y=1;let Pa=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:l}=this.props,{pages:o}=this.state;if(e&&!n&&!l){const h=o[o.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:B,page:h})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:l}=this.props,o=this.isCollectionTabActive()?n:a,h=Math.ceil(o/B);if(h>s.length){const g=[...Array(h).keys()].map(p=>p+1).filter(p=>!s.includes(p));if(g.length>0){const p=g[Math.floor(Math.random()*g.length)];this.setState(E=>({pages:[...E.pages,p]}),this.fetchResource)}}l(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[Y]},this.fetchResource)});c(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===J.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=J.COLLECTIONS;return!e&&s&&(a=J.ORPHAN_ITEMS),{pages:[Y],currentTab:a,initialPage:Y,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:l}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&l([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:l,selectedItemId:o,selectedItem:h,orphanItems:g,totalItems:p,visibleItems:E,hasUserOrphanItems:w,onSetItems:S,onFetchOrphanItem:j}=this.props,{initialPage:x,pages:f}=this.state;if(!l&&n&&o&&p&&(x===Y||s.initialPage<x)){if(!g.find(T=>T.id===o)){const T=Math.ceil(p/B),R=f[f.length-1],M=Math.min(T,R+1);f.includes(M)||this.setState({pages:[M],initialPage:M},this.fetchResource)}}else if(e.selectedItemId&&o&&e.selectedItemId!==o){const T=E.filter(R=>R.type!==L.EMOTE);S(T)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!l)&&this.setState({pages:[Y]},this.fetchResource),e.selectedCollectionId!==l&&this.setState({pages:[Y]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&h&&h.type!==L.EMOTE&&S([h]),e.selectedCollectionId!==l&&S([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:l,isReviewing:o}=this.props;return n&&e?Jt(e)&&o?s.filter(h=>!!(a!=null&&a.find(g=>g.itemId===h.id&&g.status===X.PENDING))):s:l}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:l,selectedCollectionId:o,visibleItems:h,bodyShape:g,reviewedItems:p,isReviewing:E,isPlayingEmote:w,isConnected:S,wearableController:j,isLoading:x,hasUserOrphanItems:f,onSetItems:T,onSetReviewedItems:R,onResetReviewedItems:M}=this.props,{pages:I,showSamplesModalAgain:u}=this.state,N=!o&&f,k=this.isCollectionTabActive()&&!o,_=!this.isCollectionTabActive()||o;return t.jsx("div",{className:"LeftPanel",children:S?t.jsx(ea,{id:o,itemSelected:l,itemsPage:I,itemsPageSize:B,fetchCollectionItemsOptions:{status:E?X.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:O,paginatedItems:re,initialPage:lt,isLoadingCollection:ot,isLoadingCollectionItems:rt,itemCurations:dt})=>{const Z=this.getItems(O,re,dt),ye=this.isCollectionTabActive(),ct=o&&O?lt:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(ja,{}),N?t.jsxs(d.Tabs,{isFullscreen:!0,children:[t.jsx(d.Tabs.Tab,{active:ye,onClick:()=>this.handleTabChange(J.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(d.Tabs.Tab,{active:!ye,onClick:()=>this.handleTabChange(J.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,k?t.jsx(ya,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Z.length>0,selectedCollectionId:o,onLoadPage:this.loadPage,isLoading:ot}):null,_?t.jsxs(t.Fragment,{children:[t.jsx(Ta,{items:Z,totalItems:s||Z.length,hasHeader:!o&&n.length>0,selectedItemId:l,collection:O,isReviewing:E,isPlayingEmote:w,visibleItems:h,bodyShape:g,onResetReviewedItems:M,reviewedItems:p,onSetItems:T,wearableController:j,initialPage:ct,isLoading:rt||x,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:u,onReviewItems:()=>R(Z),onLoadRandomPage:()=>this.loadRandomPage(Z),onLoadPage:this.loadPage}),t.jsx(xa,{collectionId:o})]}):null]})}}):null})}};const Aa=i=>{const m=se(),e=oe(),s=we(),a=Te(),n=nt(),l=C(_=>ae(_)),o=C(_=>xe(_)),h=C(_=>zt(_)),g=C(_=>qt(_)),p=C(_=>Ze(_)),E=C(_=>Ke(_)),w=C(_=>Qe(_)),S=C(_=>je(_)),j=C(_=>Ue(_)),x=C(_=>s?fe(_,s):null),f=C(_=>{if(e)return ge(_,e);if(l)return ge(_,l)}),T=C(_=>e?void 0:Zt(_)),R=C(_=>l&&!e?Kt(_,l,f==null?void 0:f.limit):Qt(_)),M=b.useMemo(()=>G(j,ts)||G(j,ss),[j]),I=b.useCallback(_=>m(Xe(_)),[m]),u=b.useCallback((_,v)=>m(Xt(_,v)),[m]),N=b.useCallback((_,v)=>m(et(_,v)),[m]),k=b.useCallback(_=>m(es(_)),[m]);return t.jsx(Pa,{...i,address:l,isConnected:o,items:h,totalItems:(f==null?void 0:f.total)||null,totalCollections:(T==null?void 0:T.total)||null,orphanItems:R,collections:g,selectedItemId:s,selectedItem:x,selectedCollectionId:e,visibleItems:n,bodyShape:p,wearableController:E,isReviewing:a,isLoading:M,isPlayingEmote:w,hasUserOrphanItems:S,onSetItems:I,onFetchCollections:u,onFetchOrphanItems:N,onFetchOrphanItem:k})},Na=Aa;var Q=(i=>(i[i.ZOOM_IN=0]="ZOOM_IN",i[i.ZOOM_OUT=1]="ZOOM_OUT",i[i.PAN_CAMERA_Y=2]="PAN_CAMERA_Y",i[i.CHANGE_CAMERA_ALPHA=3]="CHANGE_CAMERA_ALPHA",i))(Q||{});class me extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:l}=this.props;if(a.toHexString()!==s.value){const o=n.find(h=>h.toHexString()===s.value);l(o)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(d.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,n=e.toHexString();return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(d.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ra=class extends q.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:l,onChange:o,baseWearables:h}=this.props,g=s.value?h.find(p=>p.id===s.value):null;a!==g&&o(n,l,g??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:l,baseWearables:o}=this.props,h=as(o,a,s).map(p=>({value:p.id,text:ns(p)}));l&&h.push({value:"",text:r("global.none")});const g=e?h.find(p=>p.value===e.id):null;return t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:h,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:g?g.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const Ma=i=>({baseWearables:is(i)}),ne=He(Ma)(Ra);let Da=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1});c(this,"analytics",Se());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:l,onSetItems:o}=this.props,h=a.find(p=>p.id===s),g=n.filter(p=>p.type!==L.EMOTE);g.forEach(p=>{var E;(E=this.analytics)==null||E.track("Play Emote",{EMOTE_PLAYED_BASE:!h,EMOTE_PLAYED_ITEM_ID:h!=null&&h.urn?Ce(h.urn):null,EMOTE_PLAYED_NAME:h?h.name:s,PREVIEWED_WEARABLE_ITEM_ID:p!=null&&p.urn?z(p.urn)?qe(p.urn):Ce(p.urn):null,PREVIEWED_WEARABLE_NAME:p.name})}),h?g.push(h):l(s),o(g)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(Ne.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handleControlActionChange",async e=>{const{wearableController:s}=this.props,a=.1;if(s)switch(await(s==null?void 0:s.emote.pause()),e){case Q.ZOOM_IN:{await(s==null?void 0:s.scene.changeZoom(a));break}case Q.ZOOM_OUT:{await(s==null?void 0:s.scene.changeZoom(-a));break}}});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:l}=this.props,o=a.filter(h=>h.type!==L.EMOTE);s?(n(P.PreviewEmote.IDLE),l(o)):e==null||e.emote.play()});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(d.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(d.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,l=s.length>0;return a?null:t.jsx(d.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(d.Dropdown.Menu,{children:[l&&t.jsxs(t.Fragment,{children:[t.jsx(d.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(d.Dropdown.Divider,{}),s.map(o=>t.jsx(d.Dropdown.Item,{value:o.id,text:o.name,onClick:this.handleAnimationChange},o.id)),t.jsx(d.Dropdown.Divider,{}),t.jsx(d.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(d.Dropdown.Divider,{})]}),P.PreviewEmote.schema.enum.map(o=>t.jsx(d.Dropdown.Item,{value:o,text:r(`emotes.${o}`),onClick:this.handleAnimationChange},o))]})})});c(this,"renderEmoteSelector",()=>t.jsx(d.Popup,{content:r("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(d.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:l,onFetchBaseWearables:o,onFetchOrphanItems:h,onFetchCollectionItems:g}=this.props,p=a.length>0;n||o(),p||(s&&!H(s)?g(s.id):e&&l&&h(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const n=s.find(l=>l.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:l,selectedBaseWearables:o,selectedItem:h,visibleItems:g,isImportFilesModalOpen:p,wearableController:E}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:S,isLoading:j}=this.state,x=g.some(ee)&&(h==null?void 0:h.type)===L.EMOTE,f=l===P.PreviewEmote.JUMP?1:void 0;return t.jsxs("div",{className:`CenterPanel ${p?"import-files-modal-is-open":""}`,children:[t.jsx(Ne,{id:"wearable-editor",profile:"default",bodyShape:e,emote:l,zoom:f,skin:de(s),eyes:de(a),hair:de(n),urns:o?Object.values(o).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:g.map(ls),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:os,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:x,showSceneBoundaries:S}),x?t.jsxs("div",{className:"zoom-controls",children:[t.jsx(d.Button,{className:"zoom-control zoom-in-control",onClick:()=>this.handleControlActionChange(Q.ZOOM_IN),children:t.jsx(d.Icon,{name:"plus"})}),t.jsx(d.Button,{className:"zoom-control zoom-out-control",onClick:()=>this.handleControlActionChange(Q.ZOOM_OUT),children:t.jsx(d.Icon,{name:"minus"})})]}):null,j&&t.jsx(d.Center,{children:t.jsx(d.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[x&&!j&&E?t.jsx("div",{className:"emote-controls-container",children:t.jsx(rs,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(d.Icon,{name:"user"})}),x?null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${S?"active":""}`,children:t.jsx(V,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(d.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:P.BodyShape.MALE,text:r("body_shapes.male")},{value:P.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:s,colors:ds(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:a,colors:cs(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(me,{currentColor:n,colors:hs(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.HAIR],category:P.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.FACIAL_HAIR],category:P.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.UPPER_BODY],category:P.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:o&&t.jsx(ne,{wearable:o[P.WearableCategory.LOWER_BODY],category:P.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const La=()=>{const i=se(),m=C(ae),e=C(Ze),s=C(ms),a=C(gs),n=C(ps),l=C(us),o=C(Cs),h=nt(),g=C(Ke),p=C(Is),E=C(Qe),w=C(bs),S=C(je),j=C(_s),x=oe(),f=we(),T=C(v=>f?fe(v,f):null),R=b.useMemo(()=>x?j.find(v=>v.id===x):void 0,[j,x]),M=b.useMemo(()=>x?p.filter(v=>v.collectionId===x):p.filter(v=>!v.collectionId),[p,x]),I=o?o[e]:null,N=b.useMemo(()=>!h.some(ee)&&l===P.PreviewEmote.IDLE,[h,l])?!1:E,k="CreateSingleItemModal"in w,_=b.useMemo(()=>({onSetBodyShape:v=>{i(xs(v))},onSetAvatarAnimation:v=>{i(Es(v))},onSetSkinColor:v=>{i(vs(v))},onSetEyeColor:v=>{i(js(v))},onSetHairColor:v=>{i(Ss(v))},onSetBaseWearable:(v,O,re)=>{i(fs(v,O,re))},onFetchBaseWearables:()=>{i(Ts())},onSetWearablePreviewController:v=>{i(ws(v))},onSetItems:v=>{i(Xe(v))},onFetchOrphanItems:(v,O)=>{i(et(v,O))},onFetchCollectionItems:(v,O)=>{i(ys(v,O))}}),[i]);return t.jsx(Da,{address:m,bodyShape:e,collection:R,selectedItem:T,selectedBaseWearables:I,skinColor:s,eyeColor:a,hairColor:n,emote:l,visibleItems:h,wearableController:g,emotes:M,isPlayingEmote:N,isImportFilesModalOpen:k,hasUserOrphanItems:S,..._})},Oa=La;class ka extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,l=e.target.value;s!==l&&n(a?l.slice(0,a):l)})}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 le 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,l=s.value;l!==a&&(this.setState({value:l}),n(l))})}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(l=>l.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:n?n.text:r("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(d.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}c(le,"defaultProps",{disabled:!1});class be extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,l=s.value,o=[...n];for(const h of l)n.includes(h)||o.push(h);o.length!==n.length&&(this.setState({value:o}),a(o))});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,l=a.reduce((o,h)=>(o[h.value]=h.text,o),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(ie,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(o=>t.jsxs("div",{className:"value",children:[l[o],t.jsx("div",{className:"remove",onClick:h=>{this.handleRemove(o),h.stopPropagation()}})]},o)):t.jsx("div",{className:"placeholder",children:r("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(d.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(be,"defaultProps",{disabled:!1});class it 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 l=[...a,n];this.setState({value:l,draft:""}),e(l)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===Ps||e.keyCode===Re||e.keyCode===As)this.handleAdd();else if(e.keyCode===Ns||e.keyCode===Re){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:l=>{this.handleRemove(n),l.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(it,"defaultProps",{isDisabled:!1});let Ba=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Se());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[Me]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;ce(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===P.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===he.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(o=>!P.WearableCategory.schema.enum.includes(o)),...e]:n=[...a.filter(o=>!P.BodyPartCategory.schema.enum.includes(o)),...e];const l=this.setHides(this.state.data,n);this.setState({data:l,isDirty:this.isDirty({data:l})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,S;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:l,utility:o,rarity:h,contents:g,data:p,isDirty:E}=this.state;if(E&&e){let j=p;j&&!ce(j)&&(j={...j,removesDefaultHiding:j.category===P.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(P.WearableCategory.UPPER_BODY)?[P.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const x={...e.contents,...await Rs(g)},f={...e,name:n,description:l,rarity:h,data:j,contents:x,utility:o??void 0};s&&[De.UNPUBLISHED,De.UNDER_REVIEW].includes(s)&&(f.video=x[Me]),a(f,g),z(f.urn)&&((S=this.analytics)==null||S.track("Edit Item",{contents:g})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===L.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=Ms(e);this.setState({thumbnail:e,contents:{[Le]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Oe(a),l=await Oe(a,1024,1024),o=URL.createObjectURL(n);this.setState({thumbnail:o,contents:{[Le]:l},isDirty:!0})}});c(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;Ie(e)&&((a=s.replaces)!=null&&a.length)&&(s.hides=s.hides.concat(s.replaces),s.replaces=[]),this.setState({thumbnail:"",video:"",name:e.name,description:e.description,utility:e.utility||"",rarity:e.rarity,data:e.data,hasItem:!0,isDirty:!1})}getInitialState(){return{name:"",description:"",utility:"",thumbnail:"",video:"",rarity:void 0,contents:{},data:void 0,hasItem:!1,isDirty:!1}}setReplaces(e,s){return{...e,replaces:s,representations:e.representations.map(a=>({...a,overrideReplaces:s}))}}setHides(e,s){return{...e,hides:s,representations:e.representations.map(a=>({...a,overrideHides:s}))}}canEditItemMetadata(e){const{collection:s,canEditSelectedItem:a}=this.props;return!e||s&&ke(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===P.WearableCategory.SKIN}isDirty(e={}){const{selectedItem:s}=this.props,{hasItem:a}=this.state;return a?this.hasStateItemChanged({...this.state,...e},s):!1}hasSavedItem(){const{selectedItem:e}=this.props,{isDirty:s}=this.state;return e&&!s&&this.hasStateItemChanged(this.state,e)}hasStateItemChanged(e,s){return e.name!==s.name||e.description!==s.description||e.utility!==s.utility||e.rarity!==s.rarity||!ze(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||ce(a))return null;const n=Ds(e.contents,a.category),l=Ls(e.contents),o=a.hides.filter(g=>n.includes(g)),h=a.hides.filter(g=>l.includes(g));return t.jsxs(t.Fragment,{children:[t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:h,options:this.asCategorySelect(e.type,l),disabled:!s,onChange:g=>this.handleChangeHides(g,"bodypart")}),t.jsx(be,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:o,options:this.asCategorySelect(e.type,o.some(g=>g===P.WearableCategory.BODY_SHAPE)?n:n.filter(g=>g!==P.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:g=>this.handleChangeHides(g,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),l=s?t.jsx(d.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(V,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(V,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),l,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(pe,{item:e,src:a,hasBadge:!0,badgeSize:"small"}),t.jsxs("div",{className:"thumbnail-edit-container",children:[t.jsx("input",{type:"file",ref:this.thumbnailInput,onChange:this.handleThumbnailChange,accept:"image/png"}),t.jsx("div",{className:"thumbnail-edit-background"}),t.jsx(V,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[l,t.jsx(pe,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(Os,{item:e})]})}renderVideoDetails(e){if(!Be(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(V,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(V,{name:"play",className:"play-video-button",onClick:a}),t.jsx(We,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[ks(e)&&t.jsx(V,{name:"play",className:"play-video-button",onClick:a}),t.jsx(We,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Bs,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:l,isCampaignEnabled:o,isVrmOptOutEnabled:h,campaignName:g,campaignTag:p}=this.props,{name:E,description:w,utility:S,rarity:j,data:x,isDirty:f,hasItem:T}=this.state,R=P.Rarity.getRarities(),M=Ws();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(na,{id:e,children:(I,u,N)=>{var O;const k=u&&ke(u),_=this.canEditItemMetadata(I),v=I?Ie(I)?Fs(I.contents):Hs():[];return N?t.jsx(d.Loader,{size:"massive",active:!0}):T||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),I&&tt(I,s)&&!I.isPublished&&!k?t.jsx(d.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(d.Dropdown.Menu,{children:[ue(I)!==null?t.jsx(d.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${ue(I)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(st,{name:E,onDelete:this.handleDeleteItem,trigger:t.jsx(d.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(W,{label:r("item_editor.right_panel.details"),children:I?t.jsxs(t.Fragment,{children:[this.renderModelDetails(I),this.renderVideoDetails(I)]}):null}),t.jsx(W,{label:r("item_editor.right_panel.basics"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(ka,{label:r("global.name"),value:E,disabled:!_,maxLength:Vs,onChange:this.handleChangeName}),t.jsx(d.TextAreaField,{maxLength:Us,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!_,value:w,rows:"2",cols:"12"}),a?t.jsx(d.TextAreaField,{maxLength:$s,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!_,value:S,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(le,{itemId:I.id,label:r("global.category"),value:x.category,options:this.asCategorySelect(I.type,v),disabled:!_,onChange:this.handleChangeCategory}),!(I.urn&&z(I.urn))&&t.jsx(le,{itemId:I.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(R),disabled:I.isPublished||!_,onChange:this.handleChangeRarity})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(ie,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(I)}),(I==null?void 0:I.type)===L.EMOTE&&t.jsx(W,{label:r("item_editor.right_panel.animation"),children:I?t.jsx(le,{itemId:I.id,label:r("create_single_item_modal.play_mode_label"),value:x.loop?he.LOOP:he.SIMPLE,options:this.asPlayModeSelect(M),disabled:!_,onChange:this.handlePlayModeChange}):null}),I&&Be(I)&&((O=I.data.requiredPermissions)!=null&&O.length)?t.jsx(W,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(I)}):null,t.jsx(W,{label:r("item_editor.right_panel.tags"),children:I?t.jsxs(t.Fragment,{children:[t.jsx(it,{itemId:I.id,value:x.tags,onChange:this.handleChangeTags,isDisabled:!_}),o&&g&&p&&_&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:p}),event_name:t.jsx("span",{children:g})})})]}):null}),(I==null?void 0:I.type)===L.WEARABLE&&h&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(ie,{content:r("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(d.Checkbox,{toggle:!0,label:x!=null&&x.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(x!=null&&x.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(I==null?void 0:I.type)===L.WEARABLE&&t.jsx(W,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(ie,{content:r("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(d.Checkbox,{toggle:!0,label:(x==null?void 0:x.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(x==null?void 0:x.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),f?t.jsxs("div",{className:"edit-buttons",children:[t.jsx(d.Button,{secondary:!0,onClick:this.handleOnResetItem,children:r("global.cancel")}),t.jsx(Fe,{primary:!0,onClick:this.handleOnSaveItem,network:P.Network.MATIC,children:r("global.save")})]}):l&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",l]}):null]})]}):null}}):null})}};const Wa=()=>{const i=se(),m=we(),e=C(u=>ae(u)),s=C(u=>xe(u)),a=C(u=>Gs(u)),n=C(u=>Ys(u)),l=C(u=>Ve(u)),o=C(u=>Js(u)),h=C(u=>ta(u)),g=C(u=>zs(u)),p=C(u=>qs(u)),E=C(u=>m?fe(u,m):null),w=C(u=>m&&E&&E.collectionId?Ee(u,E.collectionId):null),S=C(u=>{const N=sa(u),k=aa(u);return N==null?void 0:N[k]}),j=C(u=>Zs(u)),x=C(u=>!E||!e?!1:w?$e(u,e,w):tt(E,e)),f=b.useMemo(()=>m?j[m]:null,[m,j]),T=b.useCallback((u,N)=>i(Ks(u,N)),[i]),R=b.useCallback(u=>i(Ye(u)),[i]),M=b.useCallback((u,N)=>i(Ge(u,N)),[i]),I=b.useCallback(u=>i(Qs(u)),[i]);return t.jsx(Ba,{address:e,collection:w,selectedItem:E,selectedItemId:m,canEditSelectedItem:x,itemStatus:f,error:a,isConnected:s,isDownloading:n,isCommitteeMember:l,isCampaignEnabled:o,campaignTag:h,campaignName:S,isVrmOptOutEnabled:g,isWearableUtilityEnabled:p,onSaveItem:T,onDeleteItem:R,onOpenModal:M,onDownload:I})},Fa=Wa;class tn 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(Ia,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Na,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Oa,{}),t.jsx(Fa,{})]})]})})}}export{tn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._dropdown_1a07a_1{border:1px solid var(--gray);border-radius:0 5px 5px 0;border-left:0}._ellipsis_1a07a_9{margin:auto!important}._dropdown_1a07a_1 ._menu_1a07a_13>._disabled_1a07a_13._item_1a07a_13{pointer-events:all}._dropdown_1a07a_1 ._menu_1a07a_13>._disabled_1a07a_13._item_1a07a_13 a{cursor:default}._itemImage_10lcv_1{min-width:48px;max-width:48px;height:48px;padding:5px;margin-right:24px}._itemStatus_10lcv_9{margin-right:4px}._mana_10lcv_13{font-size:15px!important;font-weight:400;line-height:0}._grid_10lcv_19{padding:10px 0!important;color:var(--text);border-bottom:1px solid var(--divider)}._grid_10lcv_19:hover{background-color:#24212966;color:var(--text)}._row_10lcv_30{align-items:center;font-size:15px}._avatarColumn_10lcv_35{align-items:center;flex-direction:inherit!important}._avatarContainer_10lcv_40{display:flex}._info_10lcv_44{width:calc(100% - 80px);display:flex}._nameWrapper_10lcv_49{display:flex;align-items:center}._badgeContainer_10lcv_54{margin-left:8px}._badge_10lcv_54{background-color:#37333d}._badge_10lcv_54:before{filter:none}._name_10lcv_49{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;text-decoration:underline}._linkAction_10lcv_76{text-transform:uppercase}._subtitle_10lcv_80{margin-top:2px;color:var(--secondary-text);text-transform:uppercase}._itemActions_10lcv_86{display:flex;align-items:center;justify-content:flex-end;width:100%}._removeSaleButton_10lcv_93.ui.button.secondary{background:#fff;color:#000}._status_10lcv_98{padding:4px 10px 4px 8px;border-radius:32px;align-items:center;width:fit-content;text-transform:uppercase;font-weight:700;font-size:12px}._status_10lcv_98 i{margin-right:5px}._ready_10lcv_112{color:#63b4f6;background:#2196f333}._notReady_10lcv_117{background:#fb3b3b33;color:#e97177}._incomplete_10lcv_122{color:var(--primary)}._published_10lcv_126{color:#65d890;background:#34ce7733}._underReview_10lcv_131,._unsynced_10lcv_132{color:#fe9c2a;background:#fe9c2a33}._alertIcon_10lcv_137{display:inline-block;margin-right:.25rem;height:15px;width:15px;vertical-align:text-bottom;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M-1-1h16v16H-1z'/%3e%3cpath%20fill='%23FFF'%20d='M7%2013.667A6.667%206.667%200%201%201%207%20.333a6.667%206.667%200%200%201%200%2013.334zM7%2012.5a5.5%205.5%200%201%200%200-11%205.5%205.5%200%200%200%200%2011zm0-8.833c.368%200%20.667.298.667.666V7a.667.667%200%200%201-1.334%200V4.333c0-.368.299-.666.667-.666zM7%209a.667.667%200%201%201%200%201.333A.667.667%200%200%201%207%209z'/%3e%3c/g%3e%3c/svg%3e") no-repeat;background-size:contain;filter:invert(64%) sepia(34%) saturate(797%) hue-rotate(331deg) brightness(140%) contrast(98%)}._check_10lcv_148{margin-left:2px}._contextMenuButton_10lcv_152{width:18px!important;background-color:transparent!important;box-shadow:none!important}._contextMenu_10lcv_152{background-color:var(--smart-grey)!important}.CollectionDetailPage>.ui.container>.dcl.section{margin-bottom:48px}.CollectionDetailPage .header-column{flex:none;width:calc(100% - 300px)}.CollectionDetailPage .header-row{width:100%}.CollectionDetailPage .header-row .ui.header.name{line-height:29px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CollectionDetailPage .edit-collection-name{display:none;margin-left:16px;margin-bottom:2px}.CollectionDetailPage .section:not(.is-published) .header-row:hover .edit-collection-name{display:inline-block}.CollectionDetailPage .ui.circular.label.badge-on-sale{margin-left:1em;padding:.5em .667em!important;color:var(--text);background-color:var(--primary);text-transform:uppercase}.CollectionDetailPage .section:not(.is-published) .header-row:hover{cursor:pointer}.CollectionDetailPage .ui.toggle.on-sale{text-transform:uppercase;margin-right:16px}.CollectionDetailPage .ui.toggle.on-sale>label{white-space:nowrap}.CollectionDetailPage .ui.toggle.checkbox input.hidden:focus+label,.CollectionDetailPage .ui.toggle.on-sale input.hidden+label{padding-left:40px;color:var(--secondary-text)!important}.CollectionDetailPage .dcl.row.actions>.ui.button.action-button{border:1px solid rgba(115,110,125,.4);border-radius:5px;padding:9px 20px;white-space:nowrap}.CollectionDetailPage .left.actions .ui.dropdown{margin-left:8px;border:1px solid rgba(115,110,125,.4);border-radius:5px}.CollectionDetailPage .actions .ui.button.basic.action-button>.text{color:var(--primary)}.CollectionDetailPage .actions .ui.button.compact{padding:10px}.CollectionDetailPage .actions .popup-button{margin-left:16px}.CollectionDetailPage .dcl.row.left.actions.grow.shrink{margin-left:12px}.CollectionDetailPage .actions-container{margin-left:auto}.CollectionDetailPage .Notice{margin-bottom:32px}.CollectionDetailPage .ui.grid.equal.width>.row>.column{padding-left:0}.CollectionDetailPage .dcl.narrow>.empty{padding:200px 0;width:100%;border-radius:8px;border:1px solid var(--divider);justify-content:center;color:var(--secondary-text);text-align:center;line-height:22px;font-size:15px}.CollectionDetailPage .sparkles{width:54px;height:56px;background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.14.4-19333247245.commit-881855f/assets/sparkles-C-WJN0Gh.svg);background-repeat:no-repeat;margin:auto auto 20px}.CollectionDetailPage .CollectionItem:first-child .grid{border-top:1px solid var(--divider)}.CollectionDetailPage .narrow.dcl{width:100%;max-width:1200px}.CollectionDetailPage .CollectionStatus{width:16px;height:16px;margin-bottom:6px;margin-right:12px}.CollectionDetailPage .empty-collection-title{font-weight:500;font-size:17px;line-height:26px;color:#fff;padding-bottom:8px;display:inline-block}.CollectionDetailPage .ui.basic.button.empty-action-button{border:1px solid rgba(115,110,125,.4);border-radius:5px;padding:8px 58px;margin-top:32px;color:var(--primary)}.CollectionDetailPage .ui.basic.button.empty-action-button span{color:var(--primary);font-weight:600}.CollectionDetailPage .ui.container .dcl.back{position:absolute}.CollectionDetailPage .dcl.column.left.shrink.name-container{min-width:0}.CollectionDetailPage .Icon.wearable,.CollectionDetailPage .Icon.emote{margin-right:12px;filter:brightness(100)}.CollectionDetailPage .dcl.tab{display:inline-flex;align-items:center}.CollectionDetailPage .dcl.tab i.circle.icon{margin-left:5px;color:#ff3d61}.CollectionDetailPage .dcl.tabs.fullscreen .ui.container{border-bottom:1px solid rgba(115,110,125,.32)}.CollectionDetailPage.toast.move-item-to-another-collection{padding:0;margin-bottom:96px}.CollectionDetailPage.toast.move-item-to-another-collection>div{margin:16px}.CollectionDetailPage.toast.move-item-to-another-collection .title{color:var(--text);font-size:17px;font-weight:600;line-height:26px;margin-bottom:0}.CollectionDetailPage.toast.move-item-to-another-collection .body{display:flex;flex-direction:column;max-width:348px}.CollectionDetailPage.toast.move-item-to-another-collection .body .description{color:var(--text);font-size:15px;line-height:24px;letter-spacing:0px;margin-bottom:8px}.CollectionDetailPage.toast.move-item-to-another-collection .body .cta{font-size:13px;font-weight:600;line-height:18px;text-transform:uppercase}.CollectionDetailPage.toast.move-item-to-another-collection .toast-icon{margin-right:16px}.CollectionDetailPage.toast.move-item-to-another-collection .toast-icon .two-way-arrow-icon{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%3crect%20width='48'%20height='48'%20rx='24'%20fill='%23242129'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20.9395%2024.375C20.8612%2024.481%2020.7309%2024.5417%2020.5989%2024.5417C20.5023%2024.5417%2020.4041%2024.5086%2020.3145%2024.4459L14.2202%2020.1759C14.0799%2020.0776%2014%2019.9299%2014%2019.7707C14%2019.6115%2014.0817%2019.4638%2014.222%2019.3655L20.3188%2015.0959C20.4084%2015.0332%2020.5118%2015%2020.6084%2015C20.8181%2015%2021.0402%2015.1593%2021.0402%2015.4637V18.0513H32.7371C33.0518%2018.0513%2033.2776%2018.3291%2033.2776%2018.6437V20.8986C33.2776%2021.2132%2033.0518%2021.4752%2032.7371%2021.4752H21.0402V24.078C21.0402%2024.1917%2020.999%2024.2944%2020.9395%2024.375ZM27.6837%2024.0846L33.7783%2028.3545C33.9186%2028.4527%2034%2028.5996%2034%2028.7588C34%2028.918%2033.9201%2029.0647%2033.7798%2029.163L27.687%2033.4306C27.5983%2033.4928%2027.5037%2033.5221%2027.4081%2033.5226C27.1994%2033.5213%2027.0003%2033.3698%2027.0003%2033.0668V30.4791H15.2609C14.9462%2030.4791%2014.6995%2030.2013%2014.6995%2029.8867V27.6318C14.6995%2027.3172%2014.9462%2027.0552%2015.2609%2027.0552H27.0003V24.4523C27.0003%2024.1479%2027.2009%2023.9886%2027.4106%2023.9886C27.5073%2023.9886%2027.5941%2024.0218%2027.6837%2024.0846ZM27.4081%2033.5226C27.4071%2033.5226%2027.4061%2033.5226%2027.4052%2033.5226H27.4108C27.4099%2033.5226%2027.409%2033.5226%2027.4081%2033.5226Z'%20fill='white'/%3e%3c/svg%3e");height:48px;width:48px}.CollectionDetailPage .dcl.tabs .secondary-actions.tab{display:inline-flex;position:absolute;right:0;padding:19px 0}.CollectionDetailPage .dcl.narrow .secondary-actions{display:flex;justify-content:flex-end}.CollectionDetailPage .secondary-actions.tab .button.action-button,.CollectionDetailPage .dcl.narrow .secondary-actions .button.action-button{display:flex;align-items:center}.CollectionDetailPage .dcl.tabs .secondary-actions.tab .button.action-button:not(:last-child),.CollectionDetailPage .dcl.narrow .secondary-actions .button.action-button:not(:last-child){margin-right:24px}.CollectionDetailPage .dcl.tabs .secondary-actions.tab .button.basic.inverted{border:1px solid rgba(115,110,125,.4);border-radius:5px;box-shadow:none!important;padding:7px 20px}.CollectionDetailPage .dcl.tabs .secondary-actions.tab .button.action-button>.Icon,.CollectionDetailPage .dcl.narrow .secondary-actions .button.action-button>.Icon{margin-right:5px}.CollectionDetailPage .dcl.tabs .secondary-actions.tab .button.action-button.add-items,.CollectionDetailPage .dcl.narrow .secondary-actions .button.action-button.add-items{border:1px solid rgba(115,110,125,.4);padding:7px 20px}.CollectionDetailPage .dcl.tabs .secondary-actions.tab .button span,.CollectionDetailPage .dcl.narrow .secondary-actions .button span{color:var(--primary)}.CollectionDetailPage .badge-forum-unread-posts{margin-left:8px;color:var(--text);background-color:var(--primary)}.CollectionDetailPage .unsynced-collection.container{display:flex;padding:24px 30px;margin:24px 0;border-radius:8px;background-color:var(--dark-two);align-items:center;text-align:justify}.CollectionDetailPage .unsynced-collection.message{flex:1}.CollectionDetailPage .unsynced-collection.title{margin:0;font-size:15px;font-weight:600;line-height:24px}.CollectionDetailPage .unsynced-collection.text{font-size:15px;font-weight:400;line-height:24px}.CollectionDetailPage .unsynced-collection.alert-icon{margin-right:30px;height:36px;width:36px;background:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M-1-1h16v16H-1z'/%3e%3cpath%20fill='%23FFF'%20d='M7%2013.667A6.667%206.667%200%201%201%207%20.333a6.667%206.667%200%200%201%200%2013.334zM7%2012.5a5.5%205.5%200%201%200%200-11%205.5%205.5%200%200%200%200%2011zm0-8.833c.368%200%20.667.298.667.666V7a.667.667%200%200%201-1.334%200V4.333c0-.368.299-.666.667-.666zM7%209a.667.667%200%201%201%200%201.333A.667.667%200%200%201%207%209z'/%3e%3c/g%3e%3c/svg%3e") no-repeat;background-size:contain;filter:invert(64%) sepia(34%) saturate(797%) hue-rotate(331deg) brightness(160%) contrast(98%)}.CollectionDetailPage .unsynced-collection.action-button{padding:7px 12px}.CollectionDetailPage .unsynced-collection.action-button .badge-forum-unread-posts{background-color:var(--text-on-primary);color:var(--primary)}.CollectionDetailPage.toast.deleted-item{padding:0;width:480px}.CollectionDetailPage.toast.deleted-item .toast-info{align-items:center;margin:16px}.CollectionDetailPage.toast.deleted-item .title{font-size:17px;font-weight:600;line-height:26px;margin-bottom:0}.CollectionDetailPage.toast.deleted-item .body .description{font-size:15px;font-weight:400;line-height:24px}.CollectionDetailPage.toast.deleted-item .toast-icon .delete-icon{background: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%3crect%20width='48'%20height='48'%20rx='24'%20fill='%23242129'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.5693%2015.0303H17.2345C16.8856%2015.0303%2016.6029%2015.3131%2016.6029%2015.662V17.6462H31.5093V15.6619C31.5093%2015.3131%2031.2265%2015.0303%2030.8777%2015.0303H26.5428V14.2108C26.5428%2014.0944%2026.4485%2014%2026.3321%2014H21.7801C21.6636%2014%2021.5693%2014.0944%2021.5693%2014.2108V15.0303ZM28.7541%2034C29.2936%2034%2029.7372%2033.5746%2029.7598%2033.0355L30.4308%2018.8701H17.6812L18.3522%2033.0355C18.3748%2033.5746%2018.8184%2034%2019.3579%2034H28.7541ZM21.5216%2021.9797C21.7474%2021.9797%2021.9305%2022.1628%2021.9305%2022.3885V30.4815C21.9305%2030.7074%2021.7473%2030.8903%2021.5216%2030.8903H20.8677C20.6419%2030.8903%2020.4589%2030.7073%2020.4589%2030.4815V22.3885C20.4589%2022.1628%2020.6421%2021.9797%2020.8677%2021.9797H21.5216ZM24.3829%2021.9797C24.6087%2021.9797%2024.7917%2022.1628%2024.7917%2022.3885V30.4815C24.7917%2030.7074%2024.6087%2030.8903%2024.3829%2030.8903H23.7291C23.5033%2030.8903%2023.3203%2030.7073%2023.3203%2030.4815V22.3885C23.3203%2022.1628%2023.5034%2021.9797%2023.7291%2021.9797H24.3829ZM27.2443%2021.9797C27.4701%2021.9797%2027.6531%2022.1628%2027.6531%2022.3885V30.4815C27.6531%2030.7074%2027.47%2030.8903%2027.2443%2030.8903H26.5904C26.3646%2030.8903%2026.1816%2030.7073%2026.1816%2030.4815V22.3885C26.1816%2022.1628%2026.3647%2021.9797%2026.5904%2021.9797H27.2443Z'%20fill='white'/%3e%3c/svg%3e") no-repeat;background-size:contain;height:48px;width:48px}.CollectionDetailPage.popup-mint,.CollectionDetailPage.popup-mint:before{background-color:var(--smart-grey)!important}.toast-info .body{max-width:450px;overflow:hidden}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_12bci_1{background-color:var(--dark-two);border-radius:10px;padding:22px}._container_12bci_1 ._used_12bci_7{font-weight:600;font-size:16px;margin-bottom:8px}._container_12bci_1 ._description_12bci_13{color:#cfcdd4;font-size:14px;font-weight:400;margin-bottom:12px}._container_12bci_1 ._description_12bci_13 ._link_12bci_20{color:#fff;cursor:pointer;text-decoration:underline;font-weight:700}._container_12bci_1 ._space_12bci_27{display:flex;align-items:center;gap:1rem}._container_12bci_1 ._space_12bci_27 ._current_12bci_33{flex:1;font-size:1.5rem}._container_12bci_1 ._space_12bci_27 ._bar_12bci_38{flex:1;margin-bottom:0!important;background-color:#a09ba8!important}._container_12bci_1 ._space_12bci_27 ._bar_12bci_38.ui.progress .bar{background-color:#ff2d55}._worldUrl_1sb6i_1{display:flex;width:100%;justify-content:space-between}._rightContainer_1sb6i_7{display:flex;align-items:center;margin-right:20px}._rightContainer_1sb6i_7 ._copyUrn_1sb6i_13{color:var(--text)}.WorldListPage .filters{margin-bottom:16px}.WorldListPage .filters .ui.header.items-count,.WorldListPage .ui.table>thead>tr th{color:var(--text)}.WorldListPage .TableRow{cursor:default}.WorldListPage .empty-names-container{display:flex;flex-direction:column;text-align:center}.WorldListPage .empty-names-container .empty-icon{margin-bottom:30px;height:87px;width:87px}.WorldListPage .empty-names-container .empty-icon.dcl-icon{background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.14.4-19333247245.commit-881855f/assets/dcl-empty-state-icon-BDDqmD-V.svg)}.WorldListPage .empty-names-container .empty-icon.ens-icon{background-image:url("data:image/svg+xml,%3csvg%20width='87'%20height='87'%20viewBox='0%200%2087%2087'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='43.5'%20cy='43.5'%20r='43.5'%20fill='white'/%3e%3cg%20clip-path='url(%23clip0_119_22392)'%3e%3cpath%20d='M22.9004%2037.517C23.5096%2038.8466%2025.0327%2041.5058%2025.0327%2041.5058L42.4718%2011.8638L25.4896%2024.0647C24.4996%2024.7686%2023.6619%2025.7071%2023.0527%2026.8021C21.4534%2030.1652%2021.4534%2034.0757%2022.9004%2037.517Z'%20fill='url(%23paint0_linear_119_22392)'/%3e%3cpath%20d='M16.0466%2047.215C16.4274%2052.9244%2019.2451%2058.2427%2023.662%2061.684L42.4719%2075.1363C42.4719%2075.1363%2030.6681%2057.6952%2020.7681%2040.3324C19.7781%2038.5335%2019.0928%2036.5%2018.7881%2034.3884C18.6358%2033.4498%2018.6358%2032.5113%2018.7881%2031.5728C18.5597%2032.042%2018.0266%2033.0588%2018.0266%2033.0588C17.0366%2035.1705%2016.3512%2037.4386%2015.9705%2039.7849C15.742%2042.2877%2015.742%2044.7904%2016.0466%2047.215Z'%20fill='%23A0A8D4'/%3e%3cpath%20d='M64.0234%2049.5615C63.4141%2048.2319%2061.8911%2045.5728%2061.8911%2045.5728L44.4519%2075.1365L61.5103%2063.0138C62.5003%2062.3099%2063.338%2061.3714%2063.9472%2060.2764C65.4703%2056.9134%2065.5464%2053.0028%2064.0234%2049.5615Z'%20fill='url(%23paint1_linear_119_22392)'/%3e%3cpath%20d='M70.9534%2039.7851C70.5726%2034.0757%2067.7549%2028.7574%2063.338%2025.3161L44.5281%2011.8638C44.5281%2011.8638%2056.3319%2029.3048%2066.2318%2046.6677C67.2218%2048.4665%2067.9072%2050.5%2068.2118%2052.6117C68.3641%2053.5503%2068.3641%2054.4888%2068.2118%2055.4273C68.4403%2054.9581%2068.9734%2053.9413%2068.9734%2053.9413C69.9634%2051.8296%2070.6487%2049.5615%2071.0295%2047.2934C71.1818%2044.7124%2071.1818%2042.2879%2070.9534%2039.7851Z'%20fill='%23A0A8D4'/%3e%3cpath%20d='M23.0535%2026.8021C23.6627%2025.7071%2024.4242%2024.7686%2025.4904%2024.0647L42.4726%2011.8638L25.0335%2041.4275C25.0335%2041.4275%2023.5104%2038.7684%2022.9012%2037.4388C21.4543%2034.0757%2021.4543%2030.1652%2023.0535%2026.8021ZM16.0474%2047.2152C16.4281%2052.9246%2019.2458%2058.2429%2023.6627%2061.6842L42.4726%2075.1365C42.4726%2075.1365%2030.6688%2057.6954%2020.7689%2040.3326C19.7789%2038.5337%2019.0935%2036.5002%2018.7889%2034.3885C18.6366%2033.45%2018.6366%2032.5115%2018.7889%2031.573C18.5604%2032.0422%2018.0273%2033.059%2018.0273%2033.059C17.0373%2035.1707%2016.352%2037.4388%2015.9712%2039.7851C15.7427%2042.2879%2015.7427%2044.7906%2016.0474%2047.2152ZM64.0241%2049.5615C63.4149%2048.2319%2061.8918%2045.5727%2061.8918%2045.5727L44.4526%2075.1365L61.511%2063.0138C62.501%2062.3099%2063.3387%2061.3714%2063.9479%2060.2764C65.471%2056.9133%2065.5472%2053.0028%2064.0241%2049.5615ZM70.8779%2039.8633C70.4972%2034.1539%2067.6795%2028.8356%2063.2626%2025.3943L44.5288%2011.8638C44.5288%2011.8638%2056.3326%2029.3048%2066.2325%2046.6677C67.2225%2048.4665%2067.9079%2050.5%2068.2125%2052.6117C68.3649%2053.5503%2068.3649%2054.4888%2068.2125%2055.4273C68.441%2054.958%2068.9741%2053.9413%2068.9741%2053.9413C69.9641%2051.8296%2070.6495%2049.5615%2071.0302%2047.2934C71.1825%2044.7124%2071.1825%2042.2879%2070.8779%2039.8633Z'%20fill='url(%23paint2_linear_119_22392)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_119_22392'%20x1='43.265'%20y1='12.6053'%20x2='20.2441'%20y2='36.9051'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.58'%20stop-color='%23A0A8D4'/%3e%3cstop%20offset='0.73'%20stop-color='%238791C7'/%3e%3cstop%20offset='0.91'%20stop-color='%236470B4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_119_22392'%20x1='43.735'%20y1='74.4471'%20x2='66.7471'%20y2='50.1648'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.58'%20stop-color='%23A0A8D4'/%3e%3cstop%20offset='0.73'%20stop-color='%238791C7'/%3e%3cstop%20offset='0.91'%20stop-color='%236470B4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_119_22392'%20x1='43.4798'%20y1='11.551'%20x2='43.4798'%20y2='75.3711'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23513EFF'/%3e%3cstop%20offset='0.18'%20stop-color='%235157FF'/%3e%3cstop%20offset='0.57'%20stop-color='%235298FF'/%3e%3cstop%20offset='1'%20stop-color='%2352E5FF'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_119_22392'%3e%3crect%20width='55.3636'%20height='63.2727'%20fill='white'%20transform='translate(15.8181%2011.8638)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")}.WorldListPage .empty-names-container .empty-title{font-size:24px;font-weight:600;line-height:29px;color:var(--text)}.WorldListPage .empty-names-container .empty-description{font-size:14px;font-weight:500;line-height:24px;color:var(--text);max-width:612px}.WorldListPage .empty-names-container .empty-action{margin-top:40px;width:372px}.WorldListPage .Icon.right-round-arrow{margin-bottom:-2px}.WorldListPage .TableRow .dcl.column.subdomain-wrapper{display:flex;flex:none;flex-direction:row}.WorldListPage .TableRow .empty-url{color:#fffc;font-style:italic}.WorldListPage .TableRow .publish-scene{display:flex;width:100%;justify-content:space-between;align-items:center}.WorldListPage .TableRow .publish-scene span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100px}.WorldListPage .TableRow .publish-scene button{margin-right:20px;width:168px}.WorldListPage .TableRow .world-status.active{color:#34ce76}.WorldListPage .TableRow .world-status.inactive{color:#cfcdd4}.WorldListPage .TableRow .world-status.warning{color:var(--danger)}.WorldListPage .TableRow .world-status.blocked{color:var(--error)}.WorldListPage .ui.pagination{width:100%;display:flex;justify-content:center}.WorldListPage .ui.pagination .item[type=nextItem],.WorldListPage .ui.pagination .item[type=prevItem]{position:absolute;background-color:var(--secondary)}.WorldListPage .ui.pagination .item[type=prevItem]{left:0}.WorldListPage .ui.pagination .item[type=nextItem]{right:0}.WorldListPage .pagination-section{width:100%}.WorldListPage .ui.sub.header.items-count{flex:1 0 auto;text-transform:uppercase;font-size:13px;line-height:18px;font-weight:500}.WorldListPage .actions{display:flex;flex:1 0 auto;align-items:center;justify-content:flex-end;font-size:13px;line-height:18px;text-transform:uppercase}.WorldListPage .actions .ui.button.basic{width:16px;height:16px;box-sizing:content-box;padding:5px 10px;border-radius:4px;border:solid 1px var(--gray)}.WorldListPage .claim-name .Icon{display:block}.WorldListPage .ui.dropdown{margin-right:20px}.WorldListPage .worlds-storage{margin-bottom:24px}.WorldListPage .insufficient-storage-message{display:flex;align-items:center;gap:1rem;background-color:var(--dark-two);border-radius:10px;padding:22px;margin-bottom:24px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var L=(n,a,s)=>a in n?E(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s;var r=(n,a,s)=>L(n,typeof a!="symbol"?a+"":a,s);import{aA as b,D as x,dh as g,H as e,M as c,G as o,L as m,K as p,bk as j,cj as C,b4 as R,N as k,aX as w,di as P,cS as f}from"./index-
|
|
1
|
+
var E=Object.defineProperty;var L=(n,a,s)=>a in n?E(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s;var r=(n,a,s)=>L(n,typeof a!="symbol"?a+"":a,s);import{aA as b,D as x,dh as g,H as e,M as c,G as o,L as m,K as p,bk as j,cj as C,b4 as R,N as k,aX as w,di as P,cS as f}from"./index-BlcMW_g6.js";import{L as v}from"./LandAction-Be_9Vd4x.js";import{L as F}from"./LandProviderPage-C-6H7vWP.js";import"./Back-Bq3Xcoly.js";import"./NotFound-BnVf99__.js";import"./hooks-C8UcKsSN.js";const u=b.get("MARKETPLACE_WEB_URL","");class A extends x.PureComponent{constructor(){super(...arguments);r(this,"state",{selectedName:""});r(this,"handleChange",(s,i)=>{const{onFetchENS:l,land:t}=this.props,d=i.value;l(d,t),this.setState({selectedName:d})});r(this,"handleContinue",()=>{const{selectedName:s}=this.state,{onUpdateSubdomain:i,ensList:l}=this.props,t=l.find(d=>d.name===s);i(t.subdomain)})}render(){const{land:s,ensList:i,isLoading:l}=this.props,{selectedName:t}=this.state,d=i.map(({name:_,subdomain:S})=>({value:_,text:S})),h=i.find(_=>_.name===t),N=!h||g(h,s);return e.jsx(c.Form,{className:"LandSelectENSForm",children:!l&&d.length===0?e.jsxs(e.Fragment,{children:[e.jsx(c.Section,{size:"large",children:o("land_select_ens_page.empty_options_message")}),e.jsxs(c.Row,{children:[e.jsx(m,{className:"cancel",to:p.landDetail(s.id),children:e.jsx(c.Button,{children:o("global.cancel")})}),e.jsx(m,{to:`${u}/names/claim`,children:e.jsx(c.Button,{primary:!0,children:o("land_select_ens_page.claim_new_name")})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs(c.Section,{size:"large",children:[e.jsxs("div",{className:"select-names",children:[e.jsx(c.Header,{sub:!0,className:"name",children:o("land_select_ens_page.select_name_title")}),e.jsx(c.Dropdown,{value:t,options:d,placeholder:o("land_select_ens_page.select_name_placeholder"),onChange:this.handleChange})]}),e.jsx("div",{className:"select-message",children:h&&g(h,s)?e.jsx("span",{className:"danger-text",children:o("land_select_ens_page.name_assigned")}):e.jsx(j,{id:"land_select_ens_page.click_to_claim_new_name",values:{click_here:e.jsx(m,{to:`${u}/names/claim`,children:o("global.click_here")})}})})]}),e.jsxs(c.Row,{children:[e.jsx(m,{className:"cancel",to:p.landDetail(s.id),children:e.jsx(c.Button,{children:o("global.cancel")})}),e.jsx(C,{type:"submit",disabled:N||l,primary:!0,onClick:this.handleContinue,loading:l,network:R.Network.ETHEREUM,children:o("global.continue")})]})]})})}}let B=class extends x.PureComponent{constructor(){super(...arguments);r(this,"handleUpdateSubdomain",(s,i)=>{const{history:l}=this.props;l.push(p.landAssignENS(s.id,i))})}render(){const{ensList:s,isLoading:i,onFetchENS:l}=this.props;return e.jsx(F,{children:t=>e.jsx(v,{land:t,title:o("land_select_ens_page.title"),subtitle:e.jsx(j,{id:"land_select_ens_page.subtitle",values:{land:e.jsx(m,{to:p.landDetail(t.id),children:t.name})}}),children:e.jsx(A,{land:t,ensList:s,isLoading:i,onUpdateSubdomain:d=>this.handleUpdateSubdomain(t,d),onFetchENS:l})})})}};const D=n=>({ensList:P(n)}),U=n=>({onFetchENS:(a,s)=>n(f(a,s))}),W=k(D,U)(w(B));export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var $=Object.defineProperty;var W=(n,t,s)=>t in n?$(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var h=(n,t,s)=>W(n,typeof t!="symbol"?t+"":t,s);import{D as p,E as A,F as G,G as a,H as e,I as H,J as E,L as w,K as D,M as o,N as q,O as z,P as J,Q as I,R as K,S as V,T as Z,U as Q,V as X,W as Y,X as B,Y as ee,Z as se,$ as te,a0 as ne,a1 as oe,a2 as _,a3 as ae,a4 as ce,a5 as S,a6 as re,a7 as le,a8 as ie,a9 as de,aa as pe,ab as je,ac as he}from"./index-
|
|
1
|
+
var $=Object.defineProperty;var W=(n,t,s)=>t in n?$(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var h=(n,t,s)=>W(n,typeof t!="symbol"?t+"":t,s);import{D as p,E as A,F as G,G as a,H as e,I as H,J as E,L as w,K as D,M as o,N as q,O as z,P as J,Q as I,R as K,S as V,T as Z,U as Q,V as X,W as Y,X as B,Y as ee,Z as se,$ as te,a0 as ne,a1 as oe,a2 as _,a3 as ae,a4 as ce,a5 as S,a6 as re,a7 as le,a8 as ie,a9 as de,aa as pe,ab as je,ac as he}from"./index-BlcMW_g6.js";import{N as ue,S as me,u as ge,a as xe}from"./Navigation.container-gTCRHjj6.js";import{O as Pe}from"./OptionsDropdown-Ct56jDIF.js";import{S as Ce}from"./SDKTag-B-Q47VXc.js";import{L as Se}from"./LoggedInDetailPage.container-BwMfJFSQ.js";import{u as _e}from"./hooks-C8UcKsSN.js";import"./selectors-C5Krcz9D.js";import"./SignInRequired-hq09yAsv.js";var k;let fe=(k=class extends p.PureComponent{constructor(){super(...arguments);h(this,"state",{isDeleting:!1});h(this,"handleOnClick",()=>{const{onClick:s,project:c}=this.props;s&&s(c)});h(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});h(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});h(this,"handleDeleteProject",()=>{const{project:s,onDeleteProject:c}=this.props;c(s),this.setState({isDeleting:!1})});h(this,"handleDuplicateProject",()=>{const{project:s,onDuplicateProject:c}=this.props;c(s)});h(this,"handleExportScene",()=>{this.props.onOpenModal("ExportModal",{project:this.props.project})})}componentDidMount(){this.props.onLoadProjectScene(this.props.project,this.props.type)}render(){const{project:s,parcels:c,items:r,onClick:j,isUploading:u,hasError:C,scene:m}=this.props,{isDeleting:l}=this.state,g="likes"in s;let i={},x="ProjectCard",P=A(s,m);P&&(P&&G(P)&&(P+=`?updated_at=${+new Date(s.updatedAt)}`),i={backgroundImage:`url(${P})`},x+=" has-thumbnail");const v=[{text:a("scenes_page.project_actions.duplicate_project"),handler:this.handleDuplicateProject},{text:a("scenes_page.project_actions.export_project"),handler:this.handleExportScene},{text:a("scenes_page.project_actions.delete_project"),handler:this.handleConfirmDeleteProject}],f=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"project-thumbnail",style:i}),g?null:e.jsxs(e.Fragment,{children:[e.jsx(H,{projectId:s.id,className:"deployment-status"}),e.jsxs("div",{className:"options-container",children:[e.jsx(Ce,{scene:m}),e.jsx(Pe,{className:"options-dropdown",options:v})]})]}),e.jsxs("div",{className:"project-data",children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx("div",{className:"title",children:s.title}),u?e.jsx(E,{name:"cloud-upload",className:"is-uploading"}):null,!u&&C?e.jsx("div",{className:"error-indicator"}):null]}),e.jsxs("div",{className:"description",title:s.description,children:[e.jsx(E,{name:"scene-parcel"})," ",a("public_page.parcel_count",{parcels:c}),e.jsx(E,{name:"scene-object"})," ",a("project_card.item_count",{items:r})]})]})]});return e.jsxs(e.Fragment,{children:[j?e.jsx("div",{className:x,onClick:this.handleOnClick,children:f}):e.jsx(w,{to:g?D.poolView(s.id,"pool"):D.sceneDetail(s.id),className:x,children:f}),e.jsx(o.Confirm,{size:"tiny",open:l,header:a("project_card.confirm_delete_header",{title:s.title}),content:a("project_card.confirm_delete_content",{title:s.title}),confirmButton:e.jsx(o.Button,{primary:!0,children:a("global.confirm")}),cancelButton:e.jsx(o.Button,{secondary:!0,children:a("global.cancel")}),onCancel:this.handleCancelDeleteProject,onConfirm:this.handleDeleteProject})]})}},h(k,"defaultProps",{items:0,parcels:0}),k);const Ne=(n,t)=>{const{project:s}=t,c=s.layout.cols*s.layout.rows,r=z(n)[s.sceneId],j=r&&r.sdk6?Object.keys(r.sdk6.entities).length-c:0,u=J(n)[s.id]?I.POOL:I.PROJECT;return{parcels:c,items:j,scene:r,deploymentStatus:K(n)[t.project.id],deployments:V(n)[t.project.id],isUploading:Z(n).has(s.id),hasError:Q(n).has(s.id),type:u}},De=n=>({onDeleteProject:t=>n(X(t)),onDuplicateProject:t=>n(Y(t)),onOpenModal:(t,s)=>n(B(t,s)),onLoadProjectScene:(t,s)=>n(ee(t,s))}),L=q(Ne,De)(fe),F=n=>{const{page:t,poolList:s,projects:c,sortBy:r,totalPages:j,isFetching:u,isLoggingIn:C,onLoadFromScenePool:m,onOpenModal:l}=n,g=se();p.useEffect(()=>{m({sortBy:"updated_at",sortOrder:"desc"})},[m,l]),p.useEffect(()=>{te()&&l("WorldsForENSOwnersAnnouncementModal")},[l]);const i=p.useCallback(()=>{l("ImportModal")},[l]),x=p.useCallback(()=>{l("SceneCreationModal")},[l]),P=()=>e.jsx(o.Button,{inverted:!0,className:"import-scene",onClick:i,children:a("scenes_page.upload_scene")}),v=()=>e.jsx(o.Button,{primary:!0,className:"create-scene",onClick:x,children:a("scenes_page.create_scene")}),f=()=>e.jsx(o.Dropdown,{direction:"left",value:r,options:[{value:_.NEWEST,text:a("scenes_page.sort.newest")},{value:_.NAME,text:a("scenes_page.sort.name")},{value:_.SIZE,text:a("scenes_page.sort.size")}],onChange:R}),M=()=>c.length>0?e.jsx("div",{className:"CardList",children:c.map(d=>e.jsx(L,{project:d},d.id))}):e.jsxs("div",{className:"no-scenes-container",children:[e.jsx("h3",{className:"no-scenes-title",children:a("scenes_page.no_scenes.title")}),e.jsx("span",{className:"no-scenes-description",children:a("scenes_page.no_scenes.description",{a:d=>e.jsx("a",{rel:"noreferrer",target:"_blank",href:"https://docs.decentraland.org/creator/development-guide/sdk-101/",children:d})})}),e.jsx(ae,{})]}),N=p.useCallback((d={})=>{g.push(D.scenes({page:t,sortBy:r,...d}))},[t,r,g]),R=p.useCallback((d,{value:b})=>N({sortBy:b}),[N]),T=p.useCallback((d,{activePage:b})=>N({page:b}),[N]);if(C||u)return e.jsx(ne,{});const O=j>1,y={firstItem:null,lastItem:null};t===1&&(y.prevItem=null),t===j&&(y.nextItem=null);const U=()=>e.jsxs(e.Fragment,{children:[e.jsx(me,{}),e.jsxs(o.Container,{children:[e.jsxs(o.Section,{className:"projects-menu",children:[e.jsxs(o.Row,{children:[e.jsx(o.Column,{children:e.jsx(o.Header,{children:a("scenes_page.my_scenes")})}),e.jsx(o.Column,{align:"right",children:e.jsxs("div",{className:"actions",children:[P(),v()]})})]}),e.jsxs(o.Row,{className:"actions",children:[e.jsx(o.Column,{children:e.jsx("div",{className:"items-count",children:a("scenes_page.results",{count:c.length})})}),e.jsx(o.Column,{align:"right",children:c.length>1?f():null})]})]}),e.jsxs(o.Section,{className:oe("project-cards",{"has-pagination":O}),children:[M(),O?e.jsx(o.Pagination,{...y,activePage:t,totalPages:j,onPageChange:T}):null]}),s?e.jsxs(e.Fragment,{children:[e.jsxs(o.Row,{children:[e.jsx(o.Row,{className:"scene-pool-menu",children:e.jsx(o.Header,{sub:!0,children:a("scenes_page.from_scene_pool")})}),e.jsx(o.Row,{align:"right",children:e.jsx(w,{to:D.poolSearch(),children:e.jsxs(o.Button,{basic:!0,children:[a("global.view_more")," ",e.jsx(o.Icon,{name:"chevron right"})]})})})]}),e.jsx("div",{className:"scene-pool-projects",children:s.map(d=>e.jsx(L,{project:d},d.id))})]}):null]})]});return e.jsx(Se,{className:"ScenesPage",activeTab:ue.SCENES,children:U()})};F.defaultProps={projects:[]};const ve=()=>{const n=ce(),t=ge(),s=xe(),c=_e(Object.values(_),_.NEWEST),r=S(i=>re(i)||le(i)),j=S(ie),u=S(de),C=S(pe),m=S(je),l=p.useCallback((i,x)=>n(B(i,x)),[n]),g=p.useCallback(i=>n(he(i)),[n]);return e.jsx(F,{projects:s,isLoggingIn:r,isFetching:j,page:t,sortBy:c,totalPages:u,didCreate:C,poolList:m,onOpenModal:l,onLoadFromScenePool:g})},Me=ve;export{Me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var x=(t,s,a)=>s in t?u(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a;var c=(t,s,a)=>x(t,typeof s!="symbol"?s+"":s,a);import{D as f,ch as g,H as e,bK as p,G as i,bk as h,M as l,ci as j,L as b,K as L,cj as v,bP as T,b4 as w,N as E,ck as N}from"./index-
|
|
1
|
+
var u=Object.defineProperty;var x=(t,s,a)=>s in t?u(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a;var c=(t,s,a)=>x(t,typeof s!="symbol"?s+"":s,a);import{D as f,ch as g,H as e,bK as p,G as i,bk as h,M as l,ci as j,L as b,K as L,cj as v,bP as T,b4 as w,N as E,ck as N}from"./index-BlcMW_g6.js";import{L as P}from"./LandAction-Be_9Vd4x.js";import{L as _}from"./LandProviderPage-C-6H7vWP.js";import"./Back-Bq3Xcoly.js";import"./NotFound-BnVf99__.js";import"./hooks-C8UcKsSN.js";let k=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(P,{land:n,title:i("transfer_page.title"),subtitle:e.jsx(h,{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(h,{id:"transfer_page.disclaimer",values:{br:e.jsx("br",{})}})})}),e.jsxs(l.Row,{children:[e.jsx(b,{className:"cancel",to:L.landDetail(n.id),children:e.jsx(l.Button,{children:i("global.cancel")})}),e.jsx(v,{type:"submit",primary:!0,disabled:!r||!o||n.role!==T.OWNER||p(n.owner,r),network:w.Network.ETHEREUM,children:i("global.submit")})]})]})})}})}};const R=t=>({onTransfer:(s,a)=>t(N(s,a))}),F=E(void 0,R)(k);export{F as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CA5U2eoi.js","assets/index-BlcMW_g6.js","assets/index-Co-_AGGw.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{B as pe,_ as me}from"./index-BlcMW_g6.js";const he=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,ge=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ye=e=>ge(e)&&e[he]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.14.4-19333247245.commit-881855f",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.14.4-19333247245.commit-881855f",VITE_REACT_APP_WEBSITE_VERSION:"7.14.4-19333247245.commit-881855f"},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(a,i=++f[0])=>{I!==i&&(I=i,v.forEach(r=>r(a,i)))};let j=f[1];const O=(a=++f[1])=>(j!==a&&!v.size&&(j=a,y.forEach(([i])=>{const r=i[1](a);r>I&&(I=r)})),I),A=a=>(i,r)=>{const h=[...i];h[1]=[a,...h[1]],b(h,r)},y=new Map,H=(a,i)=>{if((z?"production":void 0)!=="production"&&y.has(a))throw new Error("prop listener already exists");if(v.size){const r=i[3](A(a));y.set(a,[i,r])}else y.set(a,[i])},Z=a=>{var i;const r=y.get(a);r&&(y.delete(a),(i=r[1])==null||i.call(r))},ue=a=>(v.add(a),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(a),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),k=t(q,{deleteProperty(a,i){const r=Reflect.get(a,i);Z(i);const h=Reflect.deleteProperty(a,i);return h&&b(["delete",[i],r]),h},set(a,i,r,h){const U=Reflect.has(a,i),N=Reflect.get(a,i,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(i),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[i],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[i],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(i,L)}return Reflect.set(a,i,V,h),b(["set",[i],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(a=>{const i=Object.getOwnPropertyDescriptor(o,a);"value"in i&&(k[a]=o[a],delete i.value,delete i.writable),Object.defineProperty(q,a,i)}),k})=>[W,C,x,e,t,s,n,l,c,d,f],[be]=ve();function P(e={}){return be(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=pe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),_e={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;_e.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))We.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const S={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Ae.call(t,s)&&re(e,s,t[s]);return e};const ie=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await S.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ie?await S.getMobileListings(d):await S.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ie?await S.getMobileListings(t):await S.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))je.call(t,s)&&le(e,s,t[s]);return e};function Te(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=P({themeMode:Te()?"dark":"light"}),ce={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=Ue({},s))}},M=P({open:!1,message:"",variant:"success"}),Ve={state:M,subscribe(e){return D(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class $e{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await me(()=>import("./index-CA5U2eoi.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const xe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:$e},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,J as M,w as O,de as R,ce as T,Ve as a,_e as b,$ as c,xe as i};
|