@dcl/builder-site 7.2.3 → 7.3.0
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-3lqsvQ4K.js → Back-CmrASlX3.js} +1 -1
- package/assets/{CollectionProvider.container-D7Q3L_Zh.js → CollectionProvider.container-DOhRKeRu.js} +1 -1
- package/assets/{CollectionStatus.container-DMTnAYoK.js → CollectionStatus.container-NEqFbtYE.js} +1 -1
- package/assets/{ConfirmDelete-C_J3qEsY.js → ConfirmDelete-DN98x9nl.js} +1 -1
- package/assets/{FileSaver.min-Bt83hOdI.js → FileSaver.min-iJfSJV1w.js} +1 -1
- package/assets/{ItemProvider.container-Y7lkADhP.js → ItemProvider.container-BRpScX9b.js} +1 -1
- package/assets/{JumpIn.container-CsAlO0hD.js → JumpIn.container-BvDOoqTn.js} +1 -1
- package/assets/{LandAction-BXNGNhXP.js → LandAction-C6Ncoc71.js} +1 -1
- package/assets/{LandProviderPage-BEOIh0H2.js → LandProviderPage-BmBQ8e2k.js} +1 -1
- package/assets/{LoggedInDetailPage.container-CG29n1_U.js → LoggedInDetailPage.container-iODRZ5_l.js} +1 -1
- package/assets/{Navigation-D3yLJtY2.css → Navigation-De175sH6.css} +1 -1
- package/assets/{Navigation.container-COpaMzxC.js → Navigation.container-BZFqWR65.js} +1 -1
- package/assets/{NotFound-CBkI36Sj.js → NotFound-DAstcQ7G.js} +1 -1
- package/assets/{OptionsDropdown-DHePoh2i.js → OptionsDropdown-wWmxnpgA.js} +1 -1
- package/assets/{RentalPeriod-x-10gWSB.js → RentalPeriod-CdjbV9WM.js} +1 -1
- package/assets/{SDKTag--ttQ5W4k.js → SDKTag-GVA6nW7P.js} +1 -1
- package/assets/{SceneStats.container-Dbo5VyJY.js → SceneStats.container-CAMK4paj.js} +1 -1
- package/assets/{SignInRequired-C_iqcbEx.js → SignInRequired-B3HAtRFv.js} +1 -1
- package/assets/{ThirdPartyKindBadge-DI8Au6V1.js → ThirdPartyKindBadge-B8owNMMy.js} +1 -1
- package/assets/{dataReader-18dNwwWA.js → dataReader-DfKSTeuK.js} +1 -1
- package/assets/{date-BUZUk5-K.js → date-DHhUNLFy.js} +1 -1
- package/assets/{fortmatic-GEUvejTj.js → fortmatic-Bej0PemP.js} +1 -1
- package/assets/{index-iQkJ7ncO.js → index-8CHEe-ss.js} +1 -1
- package/assets/{index-Dsy1fxY7.js → index-B4ZW2Z_u.js} +1 -1
- package/assets/{index-pdYsHD6j.js → index-B4yi1NlK.js} +1 -1
- package/assets/{index-fxggSp4A.js → index-B5pd48tO.js} +1 -1
- package/assets/{index-BOoLOrMt.js → index-B6qX4-6j.js} +1 -1
- package/assets/{index-1JiLs6xt.js → index-BDePC9hB.js} +1 -1
- package/assets/{index-DCP5MuDo.css → index-BFuH4F1r.css} +1 -1
- package/assets/{index-DSIhJEO7.js → index-BXWgEra7.js} +1 -1
- package/assets/{index-iQS2NjJV.js → index-BhYCONdT.js} +1 -1
- package/assets/{index-C5kvo6ZE.js → index-BmwjHEx4.js} +1 -1
- package/assets/{index-CF0IKUON.css → index-BnwFajcc.css} +1 -1
- package/assets/{index-CYDa4E7Z.css → index-Bo-YlyS1.css} +1 -1
- package/assets/{index-BqLyNmoW.js → index-Bu91bpAP.js} +1 -1
- package/assets/{index-D2UrmU_b.js → index-BuNvkYN8.js} +1 -1
- package/assets/{index-Cc35HPe0.js → index-C2F43J8F.js} +1 -1
- package/assets/index-CEHfYCKG.js +1 -0
- package/assets/{index-D16q6yvC.js → index-CO2Jsdt3.js} +1 -1
- package/assets/{index-CWzBxJIY.js → index-CWDRzwFa.js} +1 -1
- package/assets/{index-CpQkOQzi.js → index-CZiCSiQu.js} +1 -1
- package/assets/{index-BCnT436C.js → index-Cbyzlv4X.js} +1 -1
- package/assets/{index-DUKUKcUm.css → index-Cj-lVnrZ.css} +7 -7
- package/assets/index-Cq21LvcY.js +1 -0
- package/assets/{index-Ca1FIoFE.js → index-Cr8Y-7z7.js} +1 -1
- package/assets/{index-3Won5U-l.js → index-CtlR5vLP.js} +24 -24
- package/assets/{index-BotAhiGp.js → index-CwJczhBw.js} +1 -1
- package/assets/{index-CsWzLDJS.css → index-CxRhC40I.css} +1 -1
- package/assets/{index-CybdoCXN.css → index-D3BmLld5.css} +1 -1
- package/assets/{index-BIyNJ3tV.js → index-D88Kj2Su.js} +1 -1
- package/assets/{index-UMT5Znqx.js → index-D8jdVU90.js} +1 -1
- package/assets/{index-DA_BTV6W.css → index-DDVswcxH.css} +1 -1
- package/assets/{index-ylsxIjgc.js → index-DGOXxMEX.js} +1 -1
- package/assets/{index-3iUqbXt4.js → index-DHr-nc9d.js} +1 -1
- package/assets/{index-5vMgQwwN.js → index-DL2T9rVI.js} +1 -1
- package/assets/{index-DWBkKfGl.js → index-DTDcruxk.js} +1 -1
- package/assets/{index-0l5G1bvn.js → index-DWa23QKq.js} +1 -1
- package/assets/{index-zFVHafJW.js → index-DhfxQISc.js} +1 -1
- package/assets/{index-DgbTUhJF.js → index-DkQLxn7s.js} +2 -2
- package/assets/{index-C9vL9TxX.js → index-DkxIf62a.js} +1 -1
- package/assets/{index-Bgad-9EV.js → index-DlmcFMIc.js} +1 -1
- package/assets/{index-DawR4I4O.js → index-Dp84zHnv.js} +1 -1
- package/assets/{index-TFXsE77L.js → index-DuWRVwpy.js} +1 -1
- package/assets/{index-BWoFMTKz.js → index-DyLoqE9D.js} +1 -1
- package/assets/{index-B-8LRnXx.js → index-GTriaZJc.js} +1 -1
- package/assets/{index-CqAbSyBR.js → index-OCzT0a-k.js} +1 -1
- package/assets/{index-Tsy7eeyl.js → index-P5tHAbfe.js} +1 -1
- package/assets/{index-il3yM9Di.js → index-QeHYGpFS.js} +1 -1
- package/assets/{index-BlYXeJC2.js → index-d09gJZXe.js} +1 -1
- package/assets/{index-zjq-Eyga.js → index-h5x8oMDN.js} +1 -1
- package/assets/{index-Ck_fZph-.js → index-kNjlVuOw.js} +1 -1
- package/assets/{index.es-CavG5WkY.js → index.es-oJ7IgpG8.js} +4 -4
- package/assets/{selectors-ClN-5Gd3.js → selectors-DB1jYqTE.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-BiPrJEWC.js +0 -1
- package/assets/index-Dn7fTV6c.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bk as _,Z as b,D as c,K as d,H as s,ah as h,M as l,G as n,hK as k,J as x,aj as g,N as v,hL as j,hM as C}from"./index-
|
|
1
|
+
import{bk as _,Z as b,D as c,K as d,H as s,ah as h,M as l,G as n,hK as k,J as x,aj as g,N as v,hL as j,hM as C}from"./index-CtlR5vLP.js";import{a as N,N as T}from"./Navigation.container-BZFqWR65.js";import"./selectors-DB1jYqTE.js";var r=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(r||{});const E="_titleContainer_5ka3v_1",S="_backButton_5ka3v_8",B="_title_5ka3v_1",f="_templates_5ka3v_26",I="_subtitle_5ka3v_32",a={titleContainer:E,backButton:S,title:B,templates:f,subtitle:I},y=({templates:e,onLoadTemplates:u})=>{const i=_(),o=b();c.useEffect(()=>{u()},[u]);const p=c.useCallback(()=>{o.push(d.scenes())},[o]),m=c.useCallback(t=>{i==null||i.track("Go to template detail",{id:t.id,name:t.title,description:t.description}),o.push(d.templateDetail(t.id))},[i,o]);return s.jsxs(s.Fragment,{children:[s.jsx(h,{}),s.jsxs(l.Page,{isFullscreen:!0,className:"ScenesPage",children:[s.jsx(N,{activeTab:T.SCENES}),s.jsxs("div",{className:a.titleContainer,children:[s.jsx(l.Button,{className:a.backButton,basic:!0,icon:s.jsx(l.Icon,{name:"arrow alternate circle left outline"}),onClick:p,"aria-label":n("templates_page.back_to_scenes")}),s.jsx("h2",{className:a.title,children:n("templates_page.title")})]}),s.jsx("div",{className:a.templates,children:Object.values(e).map(t=>s.jsx(k,{title:t.title,description:t.description,videoSrc:t.video,imgSrc:t.thumbnail,subtitle:s.jsxs("span",{className:a.subtitle,children:[s.jsx(x,{name:"scene-parcel"}),n("templates_page.parcels",{size:t.layout.rows*t.layout.cols})]}),tag:t.templateStatus!==r.ACTIVE?{label:n("templates_page.coming_soon"),color:"#716B7C"}:void 0,disabled:t.templateStatus!==r.ACTIVE,onClick:m.bind(null,t)},t.id))})]}),s.jsx(g,{})]})},A=e=>({templates:j(e)}),G=e=>({onLoadTemplates:()=>e(C())}),F=v(A,G)(y);export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var I=Object.defineProperty;var R=(l,o,s)=>o in l?I(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s;var x=(l,o,s)=>R(l,typeof o!="symbol"?o+"":o,s);import{D as g,K as m,H as e,aZ as B,M as t,N,a_ as O,bR as z,bS as H,aA as P,bC as _,bT as A,bU as F,bJ as j,bV as C,G as a,bN as $,bB as X,bD as E,bW as Y,bX as W,bY as U,bZ as J,b_ as V,b$ as Z,aW as G,c0 as K,X as q}from"./index-
|
|
1
|
+
var I=Object.defineProperty;var R=(l,o,s)=>o in l?I(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s;var x=(l,o,s)=>R(l,typeof o!="symbol"?o+"":o,s);import{D as g,K as m,H as e,aZ as B,M as t,N,a_ as O,bR as z,bS as H,aA as P,bC as _,bT as A,bU as F,bJ as j,bV as C,G as a,bN as $,bB as X,bD as E,bW as Y,bX as W,bY as U,bZ as J,b_ as V,b$ as Z,aW as G,c0 as K,X as q}from"./index-CtlR5vLP.js";import{L as Q}from"./LandProviderPage-BmBQ8e2k.js";import{B as ee}from"./Back-CmrASlX3.js";import{J as se}from"./JumpIn.container-BvDOoqTn.js";import{R as te}from"./RentalPeriod-CdjbV9WM.js";import{S as oe}from"./SceneStats.container-CAMK4paj.js";import"./NotFound-DAstcQ7G.js";import"./index-Dp84zHnv.js";import"./date-DHhUNLFy.js";let ie=class extends g.PureComponent{constructor(){super(...arguments);x(this,"handleOnClick",()=>{const{isLoading:s,history:i}=this.props;s&&i.push(m.activity())})}render(){const{ens:s,isLoading:i,onIconClick:n}=this.props;return e.jsx(B,{className:"ENSChip",text:i?e.jsxs(e.Fragment,{children:[s.subdomain,e.jsx(t.Loader,{active:!0,size:"tiny"})]}):s.subdomain,isActive:i,icon:i?"":"minus",onClick:this.handleOnClick,onIconClick:n})}};const ne=(l,o)=>{const{ens:s}=o;return{isLoading:z(l)[s.subdomain]||H(l)[s.subdomain]}},le=N(ne)(O(ie)),ae=l=>{const{deployment:o,onMouseEnter:s,onMouseLeave:i,onNavigate:n,onOpenModal:u,projects:c,disabled:r}=l,d=o.projectId&&o.projectId in c?c[o.projectId]:null,p=g.useCallback(()=>{r||s(o)},[s,r,o]),h=g.useCallback(()=>{r||i(o)},[i,r,o]),v=g.useCallback(()=>{d&&!r&&n(m.sceneDetail(d.id))},[n,d,r]),S=g.useCallback(()=>{u("DeployModal",{view:P.CLEAR_DEPLOYMENT,deploymentId:o.id})},[u,o]);return e.jsxs("div",{className:`Scene ${d&&!r?"clickable":""}`,onClick:v,onMouseEnter:p,onMouseLeave:h,children:[o.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${o.thumbnail})`}}):e.jsx("div",{className:"no-thumbnail"}),e.jsxs("div",{className:"stat",children:[e.jsx("div",{className:"title",title:o.name,children:o.name}),o.layout?e.jsxs("div",{className:"secondary-text",children:[o.layout.rows,"x",o.layout.cols]}):null]}),e.jsx(oe,{deployment:o}),e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,disabled:r,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:"Unpublish",onClick:S})})})]})},L=({children:l,land:o})=>{const s=g.Children.map(l,i=>g.isValidElement(i)?g.cloneElement(i,{disabled:o.roles.includes(j.LESSOR)}):i);return e.jsx(t.Popup,{content:a("land_detail_page.land_is_locked"),position:"top left",disabled:!o.roles.includes(j.LESSOR),trigger:e.jsx("span",{children:s})})};let re=class extends g.PureComponent{constructor(){super(...arguments);x(this,"state",{hovered:null,mouseX:0,mouseY:0,showTooltip:!1});x(this,"handleMouseEnter",s=>{this.setState({hovered:s,showTooltip:!1})});x(this,"handleMouseLeave",()=>{this.setState({hovered:null,showTooltip:!1})});x(this,"handleMouseMove",s=>{this.setState({mouseX:s.clientX,mouseY:s.clientY})});x(this,"handleHover",s=>(i,n)=>{const{deploymentsByCoord:u}=this.props,c=u[_(i,n)];c&&s.some(r=>r.id===c.id)?this.setState({hovered:c,showTooltip:!0}):this.setState({hovered:null,showTooltip:!1})});x(this,"handleClick",(s,i)=>{const{deploymentsByCoord:n,projects:u,onNavigate:c,onReplace:r,landTiles:d}=this.props,p=_(s,i),h=n[p];h&&h.projectId&&h.projectId in u?c(m.sceneDetail(h.projectId)):p in d&&r(m.landDetail(d[p].land.id))});x(this,"isHovered",(s,i)=>{const{deploymentsByCoord:n}=this.props,{hovered:u}=this.state,c=_(s,i),r=n[c];return!!r&&!!u&&u.id===r.id});x(this,"getHoverStrokeLayer",s=>(i,n)=>this.isHovered(i,n)?{color:A[s.role],scale:1.4}:null);x(this,"getHoverFillLayer",s=>(i,n)=>this.isHovered(i,n)?{color:F[s.role],scale:1.2}:null)}computeOccupiedLand(s,i){const{landTiles:n}=this.props;return i.reduce((c,r)=>c+r.parcels.filter(d=>{const p=n[d];return!!p&&p.land.id===s.id}).length,0)}renderDetail(s,i,n){const{ensList:u,parcelsAvailableToBuildEstates:c,projects:r,onNavigate:d,onOpenModal:p}=this.props,{hovered:h,mouseX:v,mouseY:S,showTooltip:y}=this.state,D=this.computeOccupiedLand(s,i),w=n&&(s.roles.includes(j.LESSOR)||s.roles.includes(j.TENANT))?n.lessor:s.owner,k=s.roles.includes(j.LESSOR),M=c[s.id],T=y&&h&&h.projectId&&h.projectId in r;return e.jsxs(e.Fragment,{children:[h&&y?e.jsxs("div",{className:"tooltip",style:{top:S,left:v},children:[h.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${h.thumbnail})`}}):null,e.jsx("div",{className:"name",children:h.name})]}):null,e.jsx(t.Section,{size:"large",children:e.jsxs(t.Row,{children:[e.jsx(ee,{absolute:!0,onClick:()=>d(m.land())}),e.jsx(t.Narrow,{children:e.jsxs(t.Row,{children:[e.jsx(t.Column,{children:e.jsxs(t.Row,{children:[e.jsx(t.Header,{size:"huge",children:s.name}),s.type===C.PARCEL?e.jsx(e.Fragment,{children:e.jsxs(t.Badge,{color:"#37333D",children:[e.jsx("i",{className:"pin"}),s.id]})}):e.jsxs(t.Badge,{color:"#37333D",children:[s.size," LAND"]}),e.jsx(se,{land:s})]})}),s.role===j.OWNER||s.role===j.LESSOR?e.jsx(t.Column,{className:"actions",align:"right",children:e.jsxs(t.Row,{children:[e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landTransfer(s.id)),children:a("land_detail_page.transfer")})}),e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landEdit(s.id)),children:a("global.edit")})}),e.jsx(L,{land:s,children:e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[M?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.build_estate"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.add_or_remove_parcels"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.dissolve_estate"),onClick:()=>p("DissolveModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.assign_name"),onClick:()=>d(m.landSelectENS(s.id))}),e.jsx(t.Dropdown.Divider,{})]}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})]})})})]})}):s.roles.includes(j.TENANT)&&n&&!$(n)?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})})}):null]})})]})}),e.jsxs(t.Narrow,{children:[e.jsx(t.Section,{size:"large",children:e.jsx("div",{className:`atlas-wrapper ${T?"clickable":""}`,onMouseLeave:this.handleMouseLeave,onMouseMove:this.handleMouseMove,children:e.jsx(X,{landId:s.id,layers:[this.getHoverStrokeLayer(s),this.getHoverFillLayer(s)],isDraggable:!0,zoom:s.size&&s.size>=1e3?.5:1,onHover:this.handleHover(i),onClick:this.handleClick})})}),e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.online_scenes")}),i.length===0?e.jsx(t.Empty,{height:100,children:a("global.none")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"deployments",children:i.map(b=>e.jsx(ae,{disabled:k,deployment:b,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onNavigate:d,onOpenModal:p,projects:r},b.id))}),e.jsx("div",{className:"notice",children:a("analytics.notice")})]})]}),u.length>0?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:e.jsx(t.Row,{children:e.jsx(t.Column,{children:a("land_detail_page.assigned_names")})})}),e.jsx("div",{className:"ens-list",children:u.map(b=>e.jsx(le,{ens:b,onIconClick:()=>p("UnsetENSContentModal",{ens:b,land:s})},b.subdomain))})]}):null,s.description?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.description")}),e.jsx("p",{children:s.description})]}):null,e.jsxs(t.Section,{className:"data",children:[e.jsxs(t.Stats,{title:a("global.role"),className:"role",children:[e.jsx(t.Header,{children:a(`roles.${s.role}`)}),n?e.jsx(te,{land:s,rental:n}):null]}),e.jsx(t.Stats,{title:a("land_detail_page.owner"),children:e.jsx(E,{address:w,size:"large"})}),n&&s.roles.includes(j.LESSOR)?e.jsx(t.Stats,{title:a("land_detail_page.tenant"),children:e.jsx(E,{address:n.tenant,size:"large"})}):null,s.operators.length>0?e.jsx(t.Stats,{title:a("land_detail_page.operated_by"),className:"operators",children:e.jsx(t.Row,{children:s.operators.map((b,f)=>e.jsx(E,{address:b,size:"large"},f))})}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Stats,{title:a("land_detail_page.total_land"),children:e.jsx(t.Header,{children:s.size})}),e.jsx(t.Stats,{title:a("land_detail_page.empty_land"),children:e.jsx(t.Header,{children:s.size-D})})]}):null]})]})]})}render(){return e.jsx(Q,{className:"LandDetailPage",children:(s,{deployments:i,rental:n})=>this.renderDetail(s,i,n)})}};const de=l=>{const o=Y(l)||"";return{ensList:W(l,o),parcelsAvailableToBuildEstates:U(l),deploymentsByCoord:J(l),landTiles:V(l),projects:Z(l)}},ce=l=>({onNavigate:o=>l(G(o)),onReplace:o=>l(K(o)),onOpenModal:(o,s)=>l(q(o,s))}),Ee=N(de,ce)(re);export{Ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var x=Object.defineProperty;var j=(i,n,t)=>n in i?x(i,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[n]=t;var d=(i,n,t)=>j(i,typeof n!="symbol"?n+"":n,t);import{D as C,bV as h,H as e,M as s,G as r,e8 as b,cB as v,cC as y,bm as u,bD as S,cd as A,N as _,e9 as T,ea as z,eb as N}from"./index-
|
|
1
|
+
var x=Object.defineProperty;var j=(i,n,t)=>n in i?x(i,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[n]=t;var d=(i,n,t)=>j(i,typeof n!="symbol"?n+"":n,t);import{D as C,bV as h,H as e,M as s,G as r,e8 as b,cB as v,cC as y,bm as u,bD as S,cd as A,N as _,e9 as T,ea as z,eb as N}from"./index-CtlR5vLP.js";import{L as P}from"./LoggedInDetailPage.container-iODRZ5_l.js";import{S as f}from"./SignInRequired-B3HAtRFv.js";import"./Navigation.container-BZFqWR65.js";import"./selectors-DB1jYqTE.js";let L=class extends C.PureComponent{constructor(){super(...arguments);d(this,"timeoutId",null);d(this,"state",{hasCopiedText:!1,type:h.PARCEL,managerAddress:""});d(this,"handleOnCopy",()=>{this.timeoutId&&clearTimeout(this.timeoutId),this.setState({hasCopiedText:!0}),this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.setState({hasCopiedText:!1})},1200)});d(this,"handleAddressChange",(t,a)=>{this.setState({managerAddress:a.value})});d(this,"handleTypeChange",(t,a)=>{this.setState({type:a.value})});d(this,"handleAddAuthorization",()=>{const{onSetUpdateManager:t}=this.props,{managerAddress:a,type:c}=this.state;t(a,c,!0)})}renderPage(){const{authorizations:t,wallet:a,onSetUpdateManager:c}=this.props,{hasCopiedText:g,managerAddress:o,type:m}=this.state,p=A(o);return e.jsx(s.Grid,{children:a===null?e.jsx(s.Loader,{size:"big",active:!0}):e.jsxs(e.Fragment,{children:[e.jsxs(s.Grid.Row,{children:[e.jsx(s.Grid.Column,{computer:4,mobile:16,children:e.jsx("div",{className:"left-column secondary-text",children:r("global.address")})}),e.jsxs(s.Grid.Column,{computer:12,mobile:16,children:[e.jsx("div",{className:"blockie-container",children:e.jsx(s.Blockie,{seed:a.address,scale:12})}),e.jsxs("div",{className:"address-container",children:[e.jsx("div",{className:"address",children:b()?v(a.address):a.address}),e.jsx(y,{role:"button",text:a.address,onCopy:this.handleOnCopy,children:g?e.jsx("span",{children:r("settings_page.copied")}):e.jsx("span",{className:"link",children:r("settings_page.copy_address")})})]})]})]}),e.jsxs(s.Grid.Row,{children:[e.jsx(s.Grid.Column,{computer:4,mobile:16,children:e.jsx("div",{className:"left-column secondary-text",children:r("settings_page.authorizations")})}),e.jsxs(s.Grid.Column,{computer:12,mobile:16,children:[e.jsx(s.Section,{className:"authoziations-disclaimer",children:r("settings_page.disclaimer",{emphasis:e.jsx("strong",{children:r("settings_page.emphasis")})})}),e.jsxs(s.Row,{className:"authorization-action",children:[e.jsx(u,{id:"settings_page.authorization_action",values:{address:e.jsx(s.Field,{value:o,onChange:this.handleAddressChange,placeholder:"0x...",error:o.length>0&&!p}),type:e.jsx(s.Dropdown,{options:[{text:"Parcels",value:h.PARCEL},{text:"Estates",value:h.ESTATE}],value:m,onChange:this.handleTypeChange})}}),e.jsx(s.Button,{size:"small",primary:!0,disabled:o.length===0||!p,onClick:this.handleAddAuthorization,children:r("global.submit")})]}),t.length>0?e.jsxs(s.Section,{children:[e.jsx(s.Header,{sub:!0,children:r("settings_page.authorizations_title")}),t.map(l=>e.jsxs(s.Row,{className:"authorization",children:[e.jsx(u,{id:"settings_page.authorization",values:{address:e.jsx(S,{address:l.address}),type:e.jsxs("span",{children:[" ",e.jsx("strong",{children:r(`global.${l.type}_plural`)})," "]})}}),e.jsx(s.Button,{basic:!0,onClick:()=>c(l.address,l.type,!1),children:r("global.revoke")})]}))]}):null]})]})]})})}renderLogin(){return e.jsx(f,{})}renderLoading(){return e.jsx("div",{className:"center",children:e.jsx(s.Loader,{active:!0,size:"huge"})})}render(){return e.jsx(P,{className:"SettingsPage",children:this.renderPage()})}};const R=i=>({wallet:T(i),authorizations:z(i)}),E=i=>({onSetUpdateManager:(n,t,a)=>i(N(n,t,a))}),U=_(R,E)(L);export{U as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{B as pe,_ as me}from"./index-3Won5U-l.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.2.3",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.2.3",VITE_REACT_APP_WEBSITE_VERSION:"7.2.3"},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=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),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(i),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(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(k[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),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 ae=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}=ae?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}=ae?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,ie=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(ie)for(var s of ie(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-C9vL9TxX.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};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DkxIf62a.js","assets/index-CtlR5vLP.js","assets/index-Cj-lVnrZ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{B as pe,_ as me}from"./index-CtlR5vLP.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.3.0",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.3.0",VITE_REACT_APP_WEBSITE_VERSION:"7.3.0"},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=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),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(i),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(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(k[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),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 ae=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}=ae?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}=ae?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,ie=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(ie)for(var s of ie(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-DkxIf62a.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-
|
|
1
|
+
import{T as xt,M as re,R as N,E as k,C as x,a as X,b as Wo,O as Z,c as ht}from"./index-DkQLxn7s.js";import"./index-CtlR5vLP.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var N=(a,l,e)=>l in a?f(a,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[l]=e;var c=(a,l,e)=>N(a,typeof l!="symbol"?l+"":l,e);import{D as j,aA as S,H as s,L as y,K as p,J as C,G as r,N as P,O as F,R as L,X as _,aM as d,ah as w,M as n,aj as A,aN as D,ac as E,aO as I,aP as M,aQ as O,aR as b,aS as B,aT as T,aU as R,aV as k,ae as G,ad as V,aW as m}from"./index-
|
|
1
|
+
var f=Object.defineProperty;var N=(a,l,e)=>l in a?f(a,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[l]=e;var c=(a,l,e)=>N(a,typeof l!="symbol"?l+"":l,e);import{D as j,aA as S,H as s,L as y,K as p,J as C,G as r,N as P,O as F,R as L,X as _,aM as d,ah as w,M as n,aj as A,aN as D,ac as E,aO as I,aP as M,aQ as O,aR as b,aS as B,aT as T,aU as R,aV as k,ae as G,ad as V,aW as m}from"./index-CtlR5vLP.js";import{B as $}from"./Back-CmrASlX3.js";const W=["page","sortBy","sortOrder","group","ethAddress"];var x;let z=(x=class extends j.PureComponent{constructor(){super(...arguments);c(this,"state",{isDeleting:!1});c(this,"handleOnClick",()=>{const{onClick:e,pool:t}=this.props;e&&e(t)});c(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});c(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});c(this,"handleClearDeployment",()=>{const{pool:e,onOpenModal:t}=this.props;t("DeployModal",{view:S.CLEAR_DEPLOYMENT,projectId:e.id})})}render(){const{pool:e}=this.props,t=e.statistics?e.statistics.parcels:e.layout.cols*e.layout.rows;return s.jsxs(y,{to:p.poolView(e.id,"pool"),className:"PoolCard",children:[s.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${e.thumbnail})`}}),s.jsxs("div",{className:"project-data",children:[s.jsx("div",{className:"title-wrapper",children:s.jsx("div",{className:"title",children:e.title})}),s.jsx("div",{className:"description",title:e.description,children:s.jsxs("div",{className:"component-list",children:[s.jsxs("div",{className:"component",children:[s.jsx(C,{name:"scene-parcel"})," ",r("public_page.parcel_count",{parcels:t})]}),e.statistics&&s.jsxs("div",{className:"component",children:[s.jsx(C,{name:"scene-object"})," ",r("public_page.item_count",{items:e.statistics.transforms})]})]})})]})]})}},c(x,"defaultProps",{items:0}),x);const U=(a,l)=>{const{pool:e}=l,t=F(a)[e.sceneId];return{items:t&&t.sdk6?t.sdk6.metrics.entities:0,deploymentStatus:L(a)[l.pool.id]}},H=a=>({onOpenModal:(l,e)=>a(_(l,e))}),K=P(U,H)(z);let q=class extends j.PureComponent{constructor(){super(...arguments);c(this,"handleChangeGroup",(e,t)=>{const{group:i,...o}=this.getFilters(),h=1;t.value==="all"?this.handleChangeFilters({...o,page:h}):this.handleChangeFilters({...o,page:h,group:t.value})});c(this,"handleChangeUser",(e,t)=>{const{ethAddress:i,...o}=this.getFilters(),h=1;t.value==="all"?this.handleChangeFilters({...o,page:h}):this.handleChangeFilters({...o,page:h,ethAddress:t.value})});c(this,"handleChangeSort",(e,t)=>{const i=this.getFilters(),o=1;if(t.value&&i.sortBy!==t.value)switch(t.value){case d.NAME:this.handleChangeFilters({...i,page:o,sortBy:t.value,sortOrder:"asc"});break;default:this.handleChangeFilters({...i,page:o,sortBy:t.value,sortOrder:"desc"})}});c(this,"handlePageChange",(e,t)=>{const i=this.getFilters(),o=Number(t.activePage);!Number.isNaN(o)&&o>0&&this.handleChangeFilters({...i,page:o})})}componentDidMount(){const{location:e}=this.props,t=this.getFilters();(e.search===""||e.search==="?")&&(t.sortBy=d.NEWEST,t.sortOrder="desc"),this.handleChangeFilters(t)}getFilters(e=this.props){return W.reduce((t,i)=>{const o=e[i];return o!==void 0&&(t[i]=o),t},{})}handleChangeFilters(e){const{onPageChange:t,onLoadPools:i}=this.props;t(e),i(e)}render(){const{pools:e,total:t,totalPages:i,isLoggedIn:o,onNavigateToScenes:h}=this.props,g=this.getFilters(),u={firstItem:null,lastItem:null};return g.page===1&&(u.prevItem=null),g.page===i&&(u.nextItem=null),s.jsxs(s.Fragment,{children:[s.jsx(w,{}),s.jsx(n.Page,{isFullscreen:!0,children:s.jsxs("div",{className:"SceneListPage",children:[s.jsxs(n.Container,{children:[s.jsx(n.Section,{className:"navigation",children:s.jsxs(n.Row,{children:[s.jsx($,{absolute:!0,onClick:h}),s.jsx(n.Narrow,{children:s.jsxs(n.Row,{children:[s.jsx(n.Column,{children:s.jsx(n.Row,{children:s.jsx(n.Header,{size:"large",children:r("scene_list_page.projects_title")})})}),s.jsx(n.Column,{align:"right",children:s.jsxs(n.Row,{children:[s.jsx(n.Responsive,{minWidth:1025,as:j.Fragment,children:o&&s.jsx(n.Dropdown,{direction:"left",value:g.ethAddress||"all",options:[{value:"all",text:r("scene_list_page.filters.all_users")},{value:"me",text:r("scene_list_page.filters.only_me")}],onChange:this.handleChangeUser})}),s.jsx(n.Dropdown,{direction:"left",value:g.sortBy,options:[{value:d.NEWEST,text:r("scene_list_page.filters.newest")},{value:d.NAME,text:r("scene_list_page.filters.name")},{value:d.LIKES,text:r("scene_list_page.filters.likes")},{value:d.ITEMS,text:r("scene_list_page.filters.items")},{value:d.SMART_ITEMS,text:r("scene_list_page.filters.smart_items")},{value:d.SIZE,text:r("scene_list_page.filters.size")}],onChange:this.handleChangeSort})]})})]})})]})}),s.jsx(n.Narrow,{children:s.jsxs("div",{className:"PoolCardList",children:[e===null&&s.jsx(n.Loader,{active:!0,size:"huge"}),Array.isArray(e)&&t===0&&s.jsx("div",{className:"empty-projects",children:r("scene_list_page.no_projects")}),Array.isArray(e)&&t!==0&&s.jsx(s.Fragment,{children:e.map(v=>s.jsx(K,{pool:v},v.id))})]})})]}),s.jsx(n.Container,{children:t!==null&&i!==null&&s.jsx(n.Pagination,{totalPages:i,activePage:g.page,onPageChange:this.handlePageChange,...u})})]})}),s.jsx(A,{})]})}};const J=a=>({location:D(a),pools:E(a),poolGroups:I(a),total:M(a),totalPages:O(a),page:b(a),sortBy:B(a),sortOrder:T(a),group:R(a),ethAddress:k(a),isLoggedIn:G(a)}),Q=a=>({onOpenModal:(l,e)=>a(_(l,e)),onLoadPools:l=>a(V(l)),onPageChange:l=>a(m(p.poolSearch(l))),onNavigateToScenes:()=>a(m(p.scenes())),onNavegateToViewPool:l=>a(m(p.poolView(l)))}),te=P(J,Q)(q);export{te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bP as h,bQ as s}from"./index-3Won5U-l.js";var N={};function O(){return N}function D(e){var a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),e.getTime()-a.getTime()}function M(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getTime()-n.getTime();return i<0?-1:i>0?1:i}function A(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getFullYear()-n.getFullYear(),o=t.getMonth()-n.getMonth();return i*12+o}function X(e,a){return h(2,arguments),s(e).getTime()-s(a).getTime()}var T={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(a){return a<0?Math.ceil(a):Math.floor(a)}},_="trunc";function I(e){return e?T[e]:T[_]}function R(e){h(1,arguments);var a=s(e);return a.setHours(23,59,59,999),a}function Y(e){h(1,arguments);var a=s(e),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}function E(e){h(1,arguments);var a=s(e);return R(a).getTime()===Y(a).getTime()}function j(e,a){h(2,arguments);var t=s(e),n=s(a),i=M(t,n),o=Math.abs(A(t,n)),r;if(o<1)r=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*o);var l=M(t,n)===-i;E(s(e))&&o===1&&M(e,n)===1&&(l=!1),r=i*(o-Number(l))}return r===0?0:r}function q(e,a,t){h(2,arguments);var n=X(e,a)/1e3;return I(void 0)(n)}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},z=function(a,t,n){var i,o=V[a];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function w(e){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=a.width?String(a.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var H={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},J={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},L={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q={date:w({formats:H,defaultWidth:"full"}),time:w({formats:J,defaultWidth:"full"}),dateTime:w({formats:L,defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$=function(a,t,n,i){return U[a]};function g(e){return function(a,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,r=t!=null&&t.width?String(t.width):o;i=e.formattingValues[r]||e.formattingValues[o]}else{var l=e.defaultWidth,u=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[u]||e.values[l]}var m=e.argumentCallback?e.argumentCallback(a):a;return i[m]}}var B={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},K={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},G={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Z={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},te={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ae=function(a,t){var n=Number(a),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ne={ordinalNumber:ae,era:g({values:B,defaultWidth:"wide"}),quarter:g({values:K,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:g({values:G,defaultWidth:"wide"}),day:g({values:Z,defaultWidth:"wide"}),dayPeriod:g({values:ee,defaultWidth:"wide",formattingValues:te,defaultFormattingWidth:"wide"})};function b(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=a.match(i);if(!o)return null;var r=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?ie(l,function(f){return f.test(r)}):re(l,function(f){return f.test(r)}),m;m=e.valueCallback?e.valueCallback(u):u,m=t.valueCallback?t.valueCallback(m):m;var c=a.slice(r.length);return{value:m,rest:c}}}function re(e,a){for(var t in e)if(e.hasOwnProperty(t)&&a(e[t]))return t}function ie(e,a){for(var t=0;t<e.length;t++)if(a(e[t]))return t}function oe(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.match(e.matchPattern);if(!n)return null;var i=n[0],o=a.match(e.parsePattern);if(!o)return null;var r=e.valueCallback?e.valueCallback(o[0]):o[0];r=t.valueCallback?t.valueCallback(r):r;var l=a.slice(i.length);return{value:r,rest:l}}}var ue=/^(\d+)(th|st|nd|rd)?/i,se=/\d+/i,le={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},de={any:[/^b/i,/^(a|c)/i]},me={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fe={any:[/1/i,/2/i,/3/i,/4/i]},he={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ce={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ve={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ge={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},be={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Me={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ye={ordinalNumber:oe({matchPattern:ue,parsePattern:se,valueCallback:function(a){return parseInt(a,10)}}),era:b({matchPatterns:le,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),quarter:b({matchPatterns:me,defaultMatchWidth:"wide",parsePatterns:fe,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:b({matchPatterns:he,defaultMatchWidth:"wide",parsePatterns:ce,defaultParseWidth:"any"}),day:b({matchPatterns:ve,defaultMatchWidth:"wide",parsePatterns:ge,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:be,defaultMatchWidth:"any",parsePatterns:Me,defaultParseWidth:"any"})},we={code:"en-US",formatDistance:z,formatLong:Q,formatRelative:$,localize:ne,match:ye,options:{weekStartsOn:0,firstWeekContainsDate:1}};function W(e,a){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);return e}function Pe(e){return W({},e)}var S=1440,pe=2520,P=43200,De=86400;function Se(e,a,t){var n,i;h(2,arguments);var o=O(),r=(n=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:o.locale)!==null&&n!==void 0?n:we;if(!r.formatDistance)throw new RangeError("locale must contain formatDistance property");var l=M(e,a);if(isNaN(l))throw new RangeError("Invalid time value");var u=W(Pe(t),{addSuffix:!!(t!=null&&t.addSuffix),comparison:l}),m,c;l>0?(m=s(a),c=s(e)):(m=s(e),c=s(a));var f=q(c,m),k=(D(c)-D(m))/1e3,d=Math.round((f-k)/60),v;if(d<2)return t!=null&&t.includeSeconds?f<5?r.formatDistance("lessThanXSeconds",5,u):f<10?r.formatDistance("lessThanXSeconds",10,u):f<20?r.formatDistance("lessThanXSeconds",20,u):f<40?r.formatDistance("halfAMinute",0,u):f<60?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",1,u):d===0?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",d,u);if(d<45)return r.formatDistance("xMinutes",d,u);if(d<90)return r.formatDistance("aboutXHours",1,u);if(d<S){var F=Math.round(d/60);return r.formatDistance("aboutXHours",F,u)}else{if(d<pe)return r.formatDistance("xDays",1,u);if(d<P){var x=Math.round(d/S);return r.formatDistance("xDays",x,u)}else if(d<De)return v=Math.round(d/P),r.formatDistance("aboutXMonths",v,u)}if(v=j(c,m),v<12){var C=Math.round(d/P);return r.formatDistance("xMonths",C,u)}else{var p=v%12,y=Math.floor(v/12);return p<3?r.formatDistance("aboutXYears",y,u):p<9?r.formatDistance("overXYears",y,u):r.formatDistance("almostXYears",y+1,u)}}export{g as a,w as b,oe as c,b as d,D as e,Se as f,O as g,we as l};
|
|
1
|
+
import{bP as h,bQ as s}from"./index-CtlR5vLP.js";var N={};function O(){return N}function D(e){var a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),e.getTime()-a.getTime()}function M(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getTime()-n.getTime();return i<0?-1:i>0?1:i}function A(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getFullYear()-n.getFullYear(),o=t.getMonth()-n.getMonth();return i*12+o}function X(e,a){return h(2,arguments),s(e).getTime()-s(a).getTime()}var T={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(a){return a<0?Math.ceil(a):Math.floor(a)}},_="trunc";function I(e){return e?T[e]:T[_]}function R(e){h(1,arguments);var a=s(e);return a.setHours(23,59,59,999),a}function Y(e){h(1,arguments);var a=s(e),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}function E(e){h(1,arguments);var a=s(e);return R(a).getTime()===Y(a).getTime()}function j(e,a){h(2,arguments);var t=s(e),n=s(a),i=M(t,n),o=Math.abs(A(t,n)),r;if(o<1)r=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*o);var l=M(t,n)===-i;E(s(e))&&o===1&&M(e,n)===1&&(l=!1),r=i*(o-Number(l))}return r===0?0:r}function q(e,a,t){h(2,arguments);var n=X(e,a)/1e3;return I(void 0)(n)}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},z=function(a,t,n){var i,o=V[a];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function w(e){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=a.width?String(a.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var H={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},J={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},L={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q={date:w({formats:H,defaultWidth:"full"}),time:w({formats:J,defaultWidth:"full"}),dateTime:w({formats:L,defaultWidth:"full"})},U={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$=function(a,t,n,i){return U[a]};function g(e){return function(a,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,r=t!=null&&t.width?String(t.width):o;i=e.formattingValues[r]||e.formattingValues[o]}else{var l=e.defaultWidth,u=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[u]||e.values[l]}var m=e.argumentCallback?e.argumentCallback(a):a;return i[m]}}var B={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},K={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},G={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Z={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},te={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ae=function(a,t){var n=Number(a),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ne={ordinalNumber:ae,era:g({values:B,defaultWidth:"wide"}),quarter:g({values:K,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:g({values:G,defaultWidth:"wide"}),day:g({values:Z,defaultWidth:"wide"}),dayPeriod:g({values:ee,defaultWidth:"wide",formattingValues:te,defaultFormattingWidth:"wide"})};function b(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=a.match(i);if(!o)return null;var r=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?ie(l,function(f){return f.test(r)}):re(l,function(f){return f.test(r)}),m;m=e.valueCallback?e.valueCallback(u):u,m=t.valueCallback?t.valueCallback(m):m;var c=a.slice(r.length);return{value:m,rest:c}}}function re(e,a){for(var t in e)if(e.hasOwnProperty(t)&&a(e[t]))return t}function ie(e,a){for(var t=0;t<e.length;t++)if(a(e[t]))return t}function oe(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.match(e.matchPattern);if(!n)return null;var i=n[0],o=a.match(e.parsePattern);if(!o)return null;var r=e.valueCallback?e.valueCallback(o[0]):o[0];r=t.valueCallback?t.valueCallback(r):r;var l=a.slice(i.length);return{value:r,rest:l}}}var ue=/^(\d+)(th|st|nd|rd)?/i,se=/\d+/i,le={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},de={any:[/^b/i,/^(a|c)/i]},me={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fe={any:[/1/i,/2/i,/3/i,/4/i]},he={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ce={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ve={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ge={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},be={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Me={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ye={ordinalNumber:oe({matchPattern:ue,parsePattern:se,valueCallback:function(a){return parseInt(a,10)}}),era:b({matchPatterns:le,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),quarter:b({matchPatterns:me,defaultMatchWidth:"wide",parsePatterns:fe,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:b({matchPatterns:he,defaultMatchWidth:"wide",parsePatterns:ce,defaultParseWidth:"any"}),day:b({matchPatterns:ve,defaultMatchWidth:"wide",parsePatterns:ge,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:be,defaultMatchWidth:"any",parsePatterns:Me,defaultParseWidth:"any"})},we={code:"en-US",formatDistance:z,formatLong:Q,formatRelative:$,localize:ne,match:ye,options:{weekStartsOn:0,firstWeekContainsDate:1}};function W(e,a){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);return e}function Pe(e){return W({},e)}var S=1440,pe=2520,P=43200,De=86400;function Se(e,a,t){var n,i;h(2,arguments);var o=O(),r=(n=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:o.locale)!==null&&n!==void 0?n:we;if(!r.formatDistance)throw new RangeError("locale must contain formatDistance property");var l=M(e,a);if(isNaN(l))throw new RangeError("Invalid time value");var u=W(Pe(t),{addSuffix:!!(t!=null&&t.addSuffix),comparison:l}),m,c;l>0?(m=s(a),c=s(e)):(m=s(e),c=s(a));var f=q(c,m),k=(D(c)-D(m))/1e3,d=Math.round((f-k)/60),v;if(d<2)return t!=null&&t.includeSeconds?f<5?r.formatDistance("lessThanXSeconds",5,u):f<10?r.formatDistance("lessThanXSeconds",10,u):f<20?r.formatDistance("lessThanXSeconds",20,u):f<40?r.formatDistance("halfAMinute",0,u):f<60?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",1,u):d===0?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",d,u);if(d<45)return r.formatDistance("xMinutes",d,u);if(d<90)return r.formatDistance("aboutXHours",1,u);if(d<S){var F=Math.round(d/60);return r.formatDistance("aboutXHours",F,u)}else{if(d<pe)return r.formatDistance("xDays",1,u);if(d<P){var x=Math.round(d/S);return r.formatDistance("xDays",x,u)}else if(d<De)return v=Math.round(d/P),r.formatDistance("aboutXMonths",v,u)}if(v=j(c,m),v<12){var C=Math.round(d/P);return r.formatDistance("xMonths",C,u)}else{var p=v%12,y=Math.floor(v/12);return p<3?r.formatDistance("aboutXYears",y,u):p<9?r.formatDistance("overXYears",y,u):r.formatDistance("almostXYears",y+1,u)}}export{g as a,w as b,oe as c,b as d,D as e,Se as f,O as g,we as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bv as be,Z as F,D as n,af as je,H as e,G as s,L as de,K as E,dD as me,M as a,N as U,ep as Ie,X as he,eq as Se,er as Z,a1 as fe,dC as Ce,es as Ne,et as ue,eu as ve,ev as ce,J as Re,ew as N,aZ as oe,ex as w,aH as we,ey as Le,ez as De,eA as Ee,eB as Ae,eC as Oe,bw as G,eD as ye,eE as ie,eF as Pe,eG as ke,eH as Me,eI as He,eJ as $e,eK as Be,eL as Fe,eM as Ue,eN as Ve,eO as ze}from"./index-3Won5U-l.js";import{B as qe,b as Ge,N as Ye}from"./Navigation.container-COpaMzxC.js";import{L as Ze}from"./LoggedInDetailPage.container-CG29n1_U.js";import{O as ge}from"./OptionsDropdown-DHePoh2i.js";import{a as B}from"./date-BUZUk5-K.js";import{C as _e}from"./CollectionStatus.container-DMTnAYoK.js";import"./selectors-ClN-5Gd3.js";import"./SignInRequired-C_iqcbEx.js";import"./index-DawR4I4O.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:t,pathname:c}=be(),d=F(),r=d.push.bind(d),o=n.useMemo(()=>{var i;return((i=l==null?void 0:l.pageSize)==null?void 0:i.toString())??re.toString()},[l==null?void 0:l.pageSize]),x=n.useMemo(()=>{const i=new URLSearchParams(t);return i.delete("page"),i.delete("first"),i.delete("offset"),i.delete("sortBy"),Object.fromEntries(i.entries())},[t]),u=n.useMemo(()=>new URLSearchParams(t).get("sortBy"),[t])??void 0,[g,b,A]=n.useMemo(()=>{const i=new URLSearchParams(t),_=parseInt(i.get("page")??"1"),p=parseInt(i.get("first")??o),I=(_-1)*p;return[_,p,I]},[o,t]),j=n.useCallback(()=>{const i=new URLSearchParams(t);i.set("page",(g+1).toString()),r(`${c}?${i.toString()}`)},[t,g,r,c]),S=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page",i.toString()),r(`${c}?${_.toString()}`)},[t,r,c]),O=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page","1"),_.set("sortBy",i),r(`${c}?${_.toString()}`)},[c,r,t]),V=n.useCallback((i,_,p={clearOldFilters:!1})=>{const I=new URLSearchParams(p.clearOldFilters?{}:t);I.set("page","1"),p.clearOldFilters&&u&&I.set("sortBy",u),I.set(i,_),r(`${c}?${I.toString()}`)},[c,r,t,u]),v=l!=null&&l.count?Math.ceil((l==null?void 0:l.count)/((l==null?void 0:l.pageSize)??re)):void 0,f=v?g<v:void 0;return{page:g,pages:v,hasMorePages:f,first:b,offset:A,sortBy:u,filters:x,goToNextPage:j,goToPage:S,changeSorting:O,changeFilter:V}}const Ke="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%2018H28V28H18V18Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%204H14V14H4V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M18%204H28V14H18V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%2018H14V28H4V18Z'%20fill='%23A09BA8'/%3e%3c/svg%3e",Xe=l=>{const{item:t,onDeleteItem:c,onOpenModal:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{o(!1),c()},[o,c]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ItemCard is-card",children:[e.jsx(ge,{className:"options-dropdown",options:[{text:s("item_card.move_to_collection"),handler:g},{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.itemDetail(t.id),children:[e.jsx(me,{item:t}),e.jsxs(a.Card.Content,{children:[e.jsx("div",{className:"text",title:t.name,children:t.name}),e.jsx("div",{className:"subtitle",children:s(`item.type.${t.type}`)})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("item_card.confirm_delete_header",{name:t.name}),content:s("item_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:b})]})},et=je.memo(Xe),tt=(l,t)=>({onDeleteItem:()=>l(Ie(t.item)),onOpenModal:c=>l(he(c,{item:t.item}))}),at=U(void 0,tt)(et),lt="_ItemRow_xmdia_1",st="_image_xmdia_7",nt="_name_xmdia_21",ct="_title_xmdia_29",ot="_imageColumn_xmdia_30",it="_published_xmdia_35",D={ItemRow:lt,image:st,name:nt,title:ct,imageColumn:ot,published:it};function rt(l){const{item:t}=l,c=F(),d=n.useCallback(()=>{c.push(E.itemDetail(t.id))},[c]);return e.jsxs(a.Table.Row,{className:D.ItemRow,onClick:d,children:[e.jsx(a.Table.Cell,{width:4,children:e.jsxs("div",{className:D.imageColumn,children:[e.jsx(me,{className:D.image,item:t}),e.jsxs("div",{className:D.title,children:[e.jsx(Se,{item:t}),e.jsx("div",{className:D.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})})]})}const dt=l=>{const{collection:t,onDeleteCollection:c,itemCount:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>{o(!1),c()},[o,c]),b=Z(t);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"CollectionCard is-card",children:[!t.isPublished&&e.jsx(ge,{className:fe({"empty-collection-options":d===0},"options-dropdown"),options:[{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.collectionDetail(t.id,b),children:[e.jsx(Ce,{collectionId:t.id}),e.jsxs(a.Card.Content,{children:[e.jsxs("div",{className:"text",title:t.name,children:[e.jsx(_e,{collection:t})," ",t.name]}),e.jsxs("div",{className:"subtitle",children:[s(`collection.type.${b}`)," · ",s("collection_card.item_count",{count:d})]}),!t.isMappingComplete&&Ne(t.urn)&&e.jsxs("div",{className:"pending-migration",children:[e.jsx(a.Icon,{name:"warning circle"})," ",s("item_status.pending_migration")]})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("collection_card.confirm_delete_header",{name:t.name}),content:s("collection_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:g,className:"delete-collection-confirm"})]})},mt=n.memo(dt),ht=(l,t)=>({itemCount:ue(l,t.collection.id)}),Ct=(l,t)=>({onDeleteCollection:()=>l(ve(t.collection))}),ut=U(ht,Ct)(mt),gt="_CollectionRow_k7d4q_1",_t="_image_k7d4q_7",xt="_name_k7d4q_16",pt="_title_k7d4q_24",Tt="_imageColumn_k7d4q_25",bt="_published_k7d4q_30",L={CollectionRow:gt,image:_t,name:xt,title:pt,imageColumn:Tt,published:bt};function jt(l){const{collection:t,itemCount:c}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(t.id,Z(t)))},[d]),o=Z(t);return e.jsxs(a.Table.Row,{className:L.CollectionRow,onClick:r,children:[e.jsx(a.Table.Cell,{width:3,children:e.jsxs("div",{className:L.imageColumn,children:[e.jsx(Ce,{className:L.image,collectionId:t.id}),e.jsxs("div",{className:L.title,children:[e.jsx(_e,{collection:t}),e.jsx("div",{className:L.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:s(`collection.type.${o}`)}),e.jsx(a.Table.Cell,{width:2,children:c}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:t.isPublished?e.jsxs("div",{className:L.published,children:[s("global.published")," ",e.jsx(a.Icon,{name:"check"})]}):null})]})}const It=(l,t)=>({itemCount:ue(l,t.collection.id)}),St=U(It)(jt);var m=(l=>(l.STANDARD_COLLECTIONS="standard_collections",l.THIRD_PARTY_COLLECTIONS="third_party_collections",l.ITEMS="orphan_items",l))(m||{});const Y=20;function ft(l){const{address:t,items:c,collections:d,view:r,collectionsPaginationData:o,itemsPaginationData:x,hasUserOrphanItems:u,isLoadingItems:g,isLoadingCollections:b,isLoadingOrphanItem:A,isLinkedWearablesPaymentsEnabled:j,isThirdPartyManager:S,onFetchCollections:O,onFetchOrphanItem:V,onFetchOrphanItems:v,onOpenModal:f,onSetView:i}=l,_=F(),{page:p,pages:I,goToPage:Q,filters:y,changeFilter:P,sortBy:k,changeSorting:W}=Je({pageSize:Y,count:o==null?void 0:o.total}),h=y.section??m.STANDARD_COLLECTIONS,M=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS,[J,xe]=n.useState(y.search??""),H=n.useRef(null);n.useEffect(()=>{u===void 0&&t&&V(t)},[t,u]),n.useEffect(()=>{t&&(h===m.ITEMS?v(t,{page:p,limit:Y}):O(t,{page:p,limit:Y,q:y.search??void 0,type:h===m.STANDARD_COLLECTIONS?ce.STANDARD:ce.THIRD_PARTY,sort:k}))},[t,p,h,y.search,k,v,O]);const pe=n.useCallback(()=>{f("CreateThirdPartyCollectionModal")},[f]),$=n.useCallback(()=>{f(j?"CreateCollectionSelectorModal":"CreateCollectionModal")},[f,j]),K=n.useCallback((C,T)=>{xe(T.value),H.current&&(clearTimeout(H.current),H.current=null),H.current=setTimeout(()=>{P("search",T.value)},500)},[P]),X=n.useCallback(()=>{_.push(E.itemEditor())},[_]),ee=n.useCallback((C,{value:T})=>{W(T)},[W]),z=n.useCallback(C=>{h!==C&&P("section",C)},[t,h,P]),te=n.useCallback(()=>e.jsx(a.Card.Group,{children:M?d.map((C,T)=>e.jsx(ut,{collection:C},T)):g?e.jsx(a.Loader,{size:"large",active:!0}):c.map((C,T)=>e.jsx(at,{item:C},T))}),[c,d,g,M,h]),ae=n.useCallback(()=>M?e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("collections_page.collection")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.type")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.items")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:d.map(C=>e.jsx(St,{collection:C},C.id))})]})}):e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("global.item")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")})]})}),e.jsx(a.Table.Body,{children:c.map(C=>e.jsx(rt,{item:C},C.id))})]})}),[c,d,M]),le=n.useCallback((C,T)=>{p!==T.activePage&&Q(Number(T.activePage))},[p,Q]),se=n.useCallback(()=>e.jsxs("div",{className:"collections-main-actions",children:[h!==m.ITEMS&&e.jsx(a.Field,{placeholder:s("itemdrawer.search_items"),className:"collections-search-field",input:{icon:"search"},onChange:K,icon:e.jsx(a.Icon,{name:"search",className:"searchIcon"}),iconPosition:"left",value:J,isClearable:!0}),e.jsxs(a.Row,{className:"actions",grow:!1,children:[S&&!j&&e.jsx(a.Button,{className:"action-button",size:"small",basic:!0,onClick:pe,children:s("collections_page.new_third_party_collection")}),e.jsxs(a.Button,{className:"action-button open-editor",size:"small",basic:!0,onClick:X,children:[e.jsx(Re,{name:"cube"}),s("item_editor.open")]}),e.jsxs(a.Button,{className:"action-button",size:"small",primary:!0,onClick:$,children:[e.jsx(a.Icon,{name:"plus square"})," ",s("collections_page.new_collection")]})]})]}),[J,S,j,K,X,$]),ne=n.useCallback(()=>e.jsx(a.Column,{align:"right",children:e.jsxs(a.Row,{className:"actions",children:[h===m.STANDARD_COLLECTIONS||m.THIRD_PARTY_COLLECTIONS&&e.jsx(a.Dropdown,{direction:"left",value:k,options:[{value:N.MOST_RELEVANT,text:s("curation_page.order.most_relevant")},{value:N.CREATED_AT_DESC,text:s("global.order.newest")},{value:N.CREATED_AT_ASC,text:s("global.order.oldest")},{value:N.UPDATED_AT_DESC,text:s("global.order.updated_at_desc")},{value:N.UPDATED_AT_ASC,text:s("global.order.updated_at_asc")},{value:N.NAME_DESC,text:s("global.order.name_desc")},{value:N.NAME_ASC,text:s("global.order.name_asc")}],onChange:ee}),e.jsx(oe,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(oe,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=o==null?void 0:o.total,T=x==null?void 0:x.total,R=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?C:T,q=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?I:x==null?void 0:x.totalPages;return A?e.jsx(a.Loader,{active:!0,size:"large"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"banner-container",children:e.jsx(qe,{id:Ge})}),e.jsx("div",{className:"filters",children:e.jsxs(a.Container,{children:[(u||S||j)&&e.jsxs("div",{className:"action-tabs-container",children:[e.jsx("img",{src:Ke,className:"collections-icon"}),e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsx(a.Tabs.Tab,{active:h===m.STANDARD_COLLECTIONS,onClick:()=>z(m.STANDARD_COLLECTIONS),children:s("collections_page.collections")}),(S||j)&&e.jsx(a.Tabs.Tab,{active:h===m.THIRD_PARTY_COLLECTIONS,onClick:()=>z(m.THIRD_PARTY_COLLECTIONS),children:s("collections_page.third_party_collections")}),u&&e.jsx(a.Tabs.Tab,{active:h===m.ITEMS,onClick:()=>z(m.ITEMS),children:s("collections_page.single_items")})]})]}),se(),e.jsxs(a.Row,{height:30,children:[e.jsx(a.Column,{children:e.jsx(a.Row,{children:!g&&!b&&!!R&&R>0&&e.jsx(a.Header,{sub:!0,children:s("collections_page.results",{count:R})})})}),ne()]})]})}),g||b||R===void 0?e.jsx(a.Loader,{active:!0,size:"large"}):R>0?e.jsxs(e.Fragment,{children:[r===w.GRID?te():r===w.LIST?ae():null,!!q&&q>1&&e.jsx(a.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:q,activePage:p,onPageChange:le})]}):e.jsxs("div",{className:"empty",children:[e.jsx(a.Header,{className:"title",size:"large",children:s("collections_page.no_items")}),e.jsx("div",{className:"empty-description",children:s("collections_page.empty_description")}),e.jsx("div",{className:"create-new-wrapper",children:e.jsx("div",{className:"create-new create-new-collection",onClick:$,children:e.jsx("div",{className:"text",children:s("collections_page.new_collection")})})})]})]})},[p,I,o,x,r,u,g,b,A,j,S,le,$,te,ae,ne,se]);return e.jsx(Ze,{className:"CollectionsPage",activeTab:Ye.COLLECTIONS,children:Te()})}const Nt=l=>{const t=we(l),c=Le(l),d=t?De(l,t):[],r=t?Ee(l,t):null,o=Ae(l);return{items:d,address:t,collections:c,collectionsPaginationData:o,itemsPaginationData:r,view:We(l),isThirdPartyManager:Oe(l),isLoadingCollections:G(ye(l),Ue),isLoadingItems:G(ie(l),Ve),isLoadingOrphanItem:G(ie(l),ze),isLinkedWearablesPaymentsEnabled:Pe(l),isCampaignEnabled:ke(l),hasUserOrphanItems:Me(l)}},vt=l=>({onSetView:t=>l(He(t)),onOpenModal:(t,c)=>l(he(t,c)),onFetchOrphanItems:(t,c)=>l($e(t,c)),onFetchCollections:(t,c)=>l(Be(t,c)),onFetchOrphanItem:t=>l(Fe(t))}),kt=U(Nt,vt)(ft);export{kt as default};
|
|
1
|
+
import{bv as be,Z as F,D as n,af as je,H as e,G as s,L as de,K as E,dD as me,M as a,N as U,ep as Ie,X as he,eq as Se,er as Z,a1 as fe,dC as Ce,es as Ne,et as ue,eu as ve,ev as ce,J as Re,ew as N,aZ as oe,ex as w,aH as we,ey as Le,ez as De,eA as Ee,eB as Ae,eC as Oe,bw as G,eD as ye,eE as ie,eF as Pe,eG as ke,eH as Me,eI as He,eJ as $e,eK as Be,eL as Fe,eM as Ue,eN as Ve,eO as ze}from"./index-CtlR5vLP.js";import{B as qe,b as Ge,N as Ye}from"./Navigation.container-BZFqWR65.js";import{L as Ze}from"./LoggedInDetailPage.container-iODRZ5_l.js";import{O as ge}from"./OptionsDropdown-wWmxnpgA.js";import{a as B}from"./date-DHhUNLFy.js";import{C as _e}from"./CollectionStatus.container-NEqFbtYE.js";import"./selectors-DB1jYqTE.js";import"./SignInRequired-B3HAtRFv.js";import"./index-Dp84zHnv.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:t,pathname:c}=be(),d=F(),r=d.push.bind(d),o=n.useMemo(()=>{var i;return((i=l==null?void 0:l.pageSize)==null?void 0:i.toString())??re.toString()},[l==null?void 0:l.pageSize]),x=n.useMemo(()=>{const i=new URLSearchParams(t);return i.delete("page"),i.delete("first"),i.delete("offset"),i.delete("sortBy"),Object.fromEntries(i.entries())},[t]),u=n.useMemo(()=>new URLSearchParams(t).get("sortBy"),[t])??void 0,[g,b,A]=n.useMemo(()=>{const i=new URLSearchParams(t),_=parseInt(i.get("page")??"1"),p=parseInt(i.get("first")??o),I=(_-1)*p;return[_,p,I]},[o,t]),j=n.useCallback(()=>{const i=new URLSearchParams(t);i.set("page",(g+1).toString()),r(`${c}?${i.toString()}`)},[t,g,r,c]),S=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page",i.toString()),r(`${c}?${_.toString()}`)},[t,r,c]),O=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page","1"),_.set("sortBy",i),r(`${c}?${_.toString()}`)},[c,r,t]),V=n.useCallback((i,_,p={clearOldFilters:!1})=>{const I=new URLSearchParams(p.clearOldFilters?{}:t);I.set("page","1"),p.clearOldFilters&&u&&I.set("sortBy",u),I.set(i,_),r(`${c}?${I.toString()}`)},[c,r,t,u]),v=l!=null&&l.count?Math.ceil((l==null?void 0:l.count)/((l==null?void 0:l.pageSize)??re)):void 0,f=v?g<v:void 0;return{page:g,pages:v,hasMorePages:f,first:b,offset:A,sortBy:u,filters:x,goToNextPage:j,goToPage:S,changeSorting:O,changeFilter:V}}const Ke="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%2018H28V28H18V18Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%204H14V14H4V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M18%204H28V14H18V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%2018H14V28H4V18Z'%20fill='%23A09BA8'/%3e%3c/svg%3e",Xe=l=>{const{item:t,onDeleteItem:c,onOpenModal:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{o(!1),c()},[o,c]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ItemCard is-card",children:[e.jsx(ge,{className:"options-dropdown",options:[{text:s("item_card.move_to_collection"),handler:g},{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.itemDetail(t.id),children:[e.jsx(me,{item:t}),e.jsxs(a.Card.Content,{children:[e.jsx("div",{className:"text",title:t.name,children:t.name}),e.jsx("div",{className:"subtitle",children:s(`item.type.${t.type}`)})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("item_card.confirm_delete_header",{name:t.name}),content:s("item_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:b})]})},et=je.memo(Xe),tt=(l,t)=>({onDeleteItem:()=>l(Ie(t.item)),onOpenModal:c=>l(he(c,{item:t.item}))}),at=U(void 0,tt)(et),lt="_ItemRow_xmdia_1",st="_image_xmdia_7",nt="_name_xmdia_21",ct="_title_xmdia_29",ot="_imageColumn_xmdia_30",it="_published_xmdia_35",D={ItemRow:lt,image:st,name:nt,title:ct,imageColumn:ot,published:it};function rt(l){const{item:t}=l,c=F(),d=n.useCallback(()=>{c.push(E.itemDetail(t.id))},[c]);return e.jsxs(a.Table.Row,{className:D.ItemRow,onClick:d,children:[e.jsx(a.Table.Cell,{width:4,children:e.jsxs("div",{className:D.imageColumn,children:[e.jsx(me,{className:D.image,item:t}),e.jsxs("div",{className:D.title,children:[e.jsx(Se,{item:t}),e.jsx("div",{className:D.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})})]})}const dt=l=>{const{collection:t,onDeleteCollection:c,itemCount:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>{o(!1),c()},[o,c]),b=Z(t);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"CollectionCard is-card",children:[!t.isPublished&&e.jsx(ge,{className:fe({"empty-collection-options":d===0},"options-dropdown"),options:[{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.collectionDetail(t.id,b),children:[e.jsx(Ce,{collectionId:t.id}),e.jsxs(a.Card.Content,{children:[e.jsxs("div",{className:"text",title:t.name,children:[e.jsx(_e,{collection:t})," ",t.name]}),e.jsxs("div",{className:"subtitle",children:[s(`collection.type.${b}`)," · ",s("collection_card.item_count",{count:d})]}),!t.isMappingComplete&&Ne(t.urn)&&e.jsxs("div",{className:"pending-migration",children:[e.jsx(a.Icon,{name:"warning circle"})," ",s("item_status.pending_migration")]})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("collection_card.confirm_delete_header",{name:t.name}),content:s("collection_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:g,className:"delete-collection-confirm"})]})},mt=n.memo(dt),ht=(l,t)=>({itemCount:ue(l,t.collection.id)}),Ct=(l,t)=>({onDeleteCollection:()=>l(ve(t.collection))}),ut=U(ht,Ct)(mt),gt="_CollectionRow_k7d4q_1",_t="_image_k7d4q_7",xt="_name_k7d4q_16",pt="_title_k7d4q_24",Tt="_imageColumn_k7d4q_25",bt="_published_k7d4q_30",L={CollectionRow:gt,image:_t,name:xt,title:pt,imageColumn:Tt,published:bt};function jt(l){const{collection:t,itemCount:c}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(t.id,Z(t)))},[d]),o=Z(t);return e.jsxs(a.Table.Row,{className:L.CollectionRow,onClick:r,children:[e.jsx(a.Table.Cell,{width:3,children:e.jsxs("div",{className:L.imageColumn,children:[e.jsx(Ce,{className:L.image,collectionId:t.id}),e.jsxs("div",{className:L.title,children:[e.jsx(_e,{collection:t}),e.jsx("div",{className:L.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:s(`collection.type.${o}`)}),e.jsx(a.Table.Cell,{width:2,children:c}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:t.isPublished?e.jsxs("div",{className:L.published,children:[s("global.published")," ",e.jsx(a.Icon,{name:"check"})]}):null})]})}const It=(l,t)=>({itemCount:ue(l,t.collection.id)}),St=U(It)(jt);var m=(l=>(l.STANDARD_COLLECTIONS="standard_collections",l.THIRD_PARTY_COLLECTIONS="third_party_collections",l.ITEMS="orphan_items",l))(m||{});const Y=20;function ft(l){const{address:t,items:c,collections:d,view:r,collectionsPaginationData:o,itemsPaginationData:x,hasUserOrphanItems:u,isLoadingItems:g,isLoadingCollections:b,isLoadingOrphanItem:A,isLinkedWearablesPaymentsEnabled:j,isThirdPartyManager:S,onFetchCollections:O,onFetchOrphanItem:V,onFetchOrphanItems:v,onOpenModal:f,onSetView:i}=l,_=F(),{page:p,pages:I,goToPage:Q,filters:y,changeFilter:P,sortBy:k,changeSorting:W}=Je({pageSize:Y,count:o==null?void 0:o.total}),h=y.section??m.STANDARD_COLLECTIONS,M=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS,[J,xe]=n.useState(y.search??""),H=n.useRef(null);n.useEffect(()=>{u===void 0&&t&&V(t)},[t,u]),n.useEffect(()=>{t&&(h===m.ITEMS?v(t,{page:p,limit:Y}):O(t,{page:p,limit:Y,q:y.search??void 0,type:h===m.STANDARD_COLLECTIONS?ce.STANDARD:ce.THIRD_PARTY,sort:k}))},[t,p,h,y.search,k,v,O]);const pe=n.useCallback(()=>{f("CreateThirdPartyCollectionModal")},[f]),$=n.useCallback(()=>{f(j?"CreateCollectionSelectorModal":"CreateCollectionModal")},[f,j]),K=n.useCallback((C,T)=>{xe(T.value),H.current&&(clearTimeout(H.current),H.current=null),H.current=setTimeout(()=>{P("search",T.value)},500)},[P]),X=n.useCallback(()=>{_.push(E.itemEditor())},[_]),ee=n.useCallback((C,{value:T})=>{W(T)},[W]),z=n.useCallback(C=>{h!==C&&P("section",C)},[t,h,P]),te=n.useCallback(()=>e.jsx(a.Card.Group,{children:M?d.map((C,T)=>e.jsx(ut,{collection:C},T)):g?e.jsx(a.Loader,{size:"large",active:!0}):c.map((C,T)=>e.jsx(at,{item:C},T))}),[c,d,g,M,h]),ae=n.useCallback(()=>M?e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("collections_page.collection")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.type")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.items")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:d.map(C=>e.jsx(St,{collection:C},C.id))})]})}):e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("global.item")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")})]})}),e.jsx(a.Table.Body,{children:c.map(C=>e.jsx(rt,{item:C},C.id))})]})}),[c,d,M]),le=n.useCallback((C,T)=>{p!==T.activePage&&Q(Number(T.activePage))},[p,Q]),se=n.useCallback(()=>e.jsxs("div",{className:"collections-main-actions",children:[h!==m.ITEMS&&e.jsx(a.Field,{placeholder:s("itemdrawer.search_items"),className:"collections-search-field",input:{icon:"search"},onChange:K,icon:e.jsx(a.Icon,{name:"search",className:"searchIcon"}),iconPosition:"left",value:J,isClearable:!0}),e.jsxs(a.Row,{className:"actions",grow:!1,children:[S&&!j&&e.jsx(a.Button,{className:"action-button",size:"small",basic:!0,onClick:pe,children:s("collections_page.new_third_party_collection")}),e.jsxs(a.Button,{className:"action-button open-editor",size:"small",basic:!0,onClick:X,children:[e.jsx(Re,{name:"cube"}),s("item_editor.open")]}),e.jsxs(a.Button,{className:"action-button",size:"small",primary:!0,onClick:$,children:[e.jsx(a.Icon,{name:"plus square"})," ",s("collections_page.new_collection")]})]})]}),[J,S,j,K,X,$]),ne=n.useCallback(()=>e.jsx(a.Column,{align:"right",children:e.jsxs(a.Row,{className:"actions",children:[h===m.STANDARD_COLLECTIONS||m.THIRD_PARTY_COLLECTIONS&&e.jsx(a.Dropdown,{direction:"left",value:k,options:[{value:N.MOST_RELEVANT,text:s("curation_page.order.most_relevant")},{value:N.CREATED_AT_DESC,text:s("global.order.newest")},{value:N.CREATED_AT_ASC,text:s("global.order.oldest")},{value:N.UPDATED_AT_DESC,text:s("global.order.updated_at_desc")},{value:N.UPDATED_AT_ASC,text:s("global.order.updated_at_asc")},{value:N.NAME_DESC,text:s("global.order.name_desc")},{value:N.NAME_ASC,text:s("global.order.name_asc")}],onChange:ee}),e.jsx(oe,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(oe,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=o==null?void 0:o.total,T=x==null?void 0:x.total,R=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?C:T,q=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?I:x==null?void 0:x.totalPages;return A?e.jsx(a.Loader,{active:!0,size:"large"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"banner-container",children:e.jsx(qe,{id:Ge})}),e.jsx("div",{className:"filters",children:e.jsxs(a.Container,{children:[(u||S||j)&&e.jsxs("div",{className:"action-tabs-container",children:[e.jsx("img",{src:Ke,className:"collections-icon"}),e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsx(a.Tabs.Tab,{active:h===m.STANDARD_COLLECTIONS,onClick:()=>z(m.STANDARD_COLLECTIONS),children:s("collections_page.collections")}),(S||j)&&e.jsx(a.Tabs.Tab,{active:h===m.THIRD_PARTY_COLLECTIONS,onClick:()=>z(m.THIRD_PARTY_COLLECTIONS),children:s("collections_page.third_party_collections")}),u&&e.jsx(a.Tabs.Tab,{active:h===m.ITEMS,onClick:()=>z(m.ITEMS),children:s("collections_page.single_items")})]})]}),se(),e.jsxs(a.Row,{height:30,children:[e.jsx(a.Column,{children:e.jsx(a.Row,{children:!g&&!b&&!!R&&R>0&&e.jsx(a.Header,{sub:!0,children:s("collections_page.results",{count:R})})})}),ne()]})]})}),g||b||R===void 0?e.jsx(a.Loader,{active:!0,size:"large"}):R>0?e.jsxs(e.Fragment,{children:[r===w.GRID?te():r===w.LIST?ae():null,!!q&&q>1&&e.jsx(a.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:q,activePage:p,onPageChange:le})]}):e.jsxs("div",{className:"empty",children:[e.jsx(a.Header,{className:"title",size:"large",children:s("collections_page.no_items")}),e.jsx("div",{className:"empty-description",children:s("collections_page.empty_description")}),e.jsx("div",{className:"create-new-wrapper",children:e.jsx("div",{className:"create-new create-new-collection",onClick:$,children:e.jsx("div",{className:"text",children:s("collections_page.new_collection")})})})]})]})},[p,I,o,x,r,u,g,b,A,j,S,le,$,te,ae,ne,se]);return e.jsx(Ze,{className:"CollectionsPage",activeTab:Ye.COLLECTIONS,children:Te()})}const Nt=l=>{const t=we(l),c=Le(l),d=t?De(l,t):[],r=t?Ee(l,t):null,o=Ae(l);return{items:d,address:t,collections:c,collectionsPaginationData:o,itemsPaginationData:r,view:We(l),isThirdPartyManager:Oe(l),isLoadingCollections:G(ye(l),Ue),isLoadingItems:G(ie(l),Ve),isLoadingOrphanItem:G(ie(l),ze),isLinkedWearablesPaymentsEnabled:Pe(l),isCampaignEnabled:ke(l),hasUserOrphanItems:Me(l)}},vt=l=>({onSetView:t=>l(He(t)),onOpenModal:(t,c)=>l(he(t,c)),onFetchOrphanItems:(t,c)=>l($e(t,c)),onFetchCollections:(t,c)=>l(Be(t,c)),onFetchOrphanItem:t=>l(Fe(t))}),kt=U(Nt,vt)(ft);export{kt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as e,g1 as Ae,g2 as Ge,a1 as V,dC as Re,M as n,N as B,fc as je,Z,e_ as We,G as i,fL as Ue,eS as ee,g3 as He,cD as Oe,X as D,eu as Fe,g4 as ze,fX as qe,bw as Ie,fZ as Ve,eF as Ne,g5 as Ze,f$ as Ye,D as r,K as M,g6 as Qe,g7 as Ke,eP as T,dD as fe,eq as Xe,g8 as Je,bu as ke,L as ye,fd as be,ep as ve,es as _e,g9 as es,ga as ue,gb as ss,gc as ts,gd as ns,ge as as,gf as is,fg as os,gg as ls,gh as we,ev as rs,gi as cs,gj as ds,gk as ge,J as ms,cB as _s,cC as us,fP as gs,eQ as he,eA as pe,fr as hs,aN as ps,e9 as Cs,gl as xs,gm as js,gn as Is,eD as Ns,go as fs,gp as ks,gq as ys,gr as bs,gs as vs,fT as ws}from"./index-3Won5U-l.js";import{g as Ss}from"./selector-CtnQnmhq.js";import{L as Ps}from"./LoggedInDetailPage.container-CG29n1_U.js";import{C as Ds}from"./CollectionProvider.container-D7Q3L_Zh.js";import{N as Es}from"./NotFound-CBkI36Sj.js";import{B as Ts}from"./Back-3lqsvQ4K.js";import{C as Ms,T as $s}from"./ThirdPartyKindBadge-DI8Au6V1.js";import{C as se}from"./ConfirmDelete-C_J3qEsY.js";import"./Navigation.container-COpaMzxC.js";import"./selectors-ClN-5Gd3.js";import"./SignInRequired-C_iqcbEx.js";const Ls=s=>e.jsx("img",{"data-testid":Ae,src:Ge[s.network],alt:s.network,className:s.className}),Bs="_image_142g7_1",As="_main_142g7_2",Gs="_network_142g7_13",F={image:Bs,main:As,network:Gs},Rs=s=>{const{collection:t,collectionId:o,className:l,shape:c}=s;return e.jsxs("div",{className:V(F.main,l),children:[t!=null&&t.itemCount?e.jsx(Re,{collectionId:o,className:F.image}):e.jsx(n.Blockie,{className:F.image,seed:o,size:8,scale:8,shape:c??"circle"}),t!=null&&t.linkedContractNetwork?e.jsx(Ls,{network:t==null?void 0:t.linkedContractNetwork,className:F.network}):null]})},Ws=(s,t)=>({collection:je(s,t.collectionId)}),Us=B(Ws)(Rs),Hs="_ellipsis_4huv2_1",Ce={ellipsis:Hs},Os=s=>{const{collection:t}=s,o=Z(),l=()=>{t.isPublished&&t.forumLink&&v(t.forumLink,"_blank")},c=()=>{const{items:m,onOpenModal:d}=s;d("SeeInWorldModal",{itemIds:m.map(k=>k.id)})},a=()=>{const{collection:m,items:d}=s;o.push(Ue(m,d),{fromParam:ee.TP_COLLECTIONS})},x=()=>{const{collection:m,onDelete:d}=s;d(m)},p=()=>{const{collection:m,onOpenModal:d}=s;m.isPublished||d("EditCollectionURNModal",{collection:m})},N=()=>{const{collection:m,onOpenModal:d}=s;d("CreateAndEditMultipleItemsModal",{collectionId:m.id,type:He.EDIT})},v=(m,d="")=>{const k=window.open(m,d);k&&k.focus()},f=!We(t)&&!t.isPublished;return e.jsx(n.Dropdown,{className:Ce.dropdown,trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{className:Ce.ellipsis,size:"large",name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:c}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:a}),e.jsx(n.Popup,{content:i("collection_context_menu.delete_published_collection"),position:"right center",disabled:f,trigger:f?e.jsx(se,{name:t.name,onDelete:x,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})}):e.jsx(n.Dropdown.Item,{text:i("global.delete"),disabled:!0}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Popup,{content:i("collection_context_menu.change_published_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_urn"),onClick:p,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_in_bulk"),onClick:N}),e.jsx(n.Popup,{content:i("collection_context_menu.unpublished"),position:"right center",disabled:t.isPublished||!!t.forumLink,trigger:e.jsx(n.Dropdown.Item,{disabled:!t.isPublished||!t.forumLink,text:i("collection_context_menu.forum_post"),onClick:l}),hideOnScroll:!0,on:"hover",inverted:!0})]})})},Fs=Os,zs=s=>({name:Oe(s)||""}),qs=s=>({onOpenModal:(t,o)=>s(D(t,o)),onDelete:t=>s(Fe(t))}),Vs=B(zs,qs)(Fs),Zs=(s,t)=>{const{collection:o,items:l}=t;return{itemCurations:qe(s,o.id),isLoadingItemCurations:Ie(Ve(s),Ye),isLinkedWearablesPaymentsEnabled:Ne(s),itemsStatus:Ze(s,l.map(c=>c.id))}},Ys=s=>({onNewClick:(t,o,l)=>s(D("PublishWizardCollectionModal",{collectionId:t,itemsWithChanges:o,itemsToPublish:l})),onPushChangesClick:(t,o)=>s(D("PushChangesModal",{collectionId:t,itemsWithChanges:o})),onClick:(t,o,l)=>s(D("PublishThirdPartyCollectionModal",{collectionId:t,itemIds:o,action:l}))}),Qs=B(Zs,Ys)(ze),Ks="_itemImage_1y9df_1",Xs="_itemStatus_1y9df_10",Js="_grid_1y9df_14",et="_row_1y9df_25",st="_column_1y9df_30",tt="_statusColumn_1y9df_34",nt="_synced_1y9df_39",at="_unsynced_1y9df_43",it="_avatarColumn_1y9df_47",ot="_nameWrapper_1y9df_52",lt="_name_1y9df_52",rt="_itemActions_1y9df_65",ct="_action_1y9df_72",C={itemImage:Ks,itemStatus:Xs,grid:Js,row:et,column:st,statusColumn:tt,synced:nt,unsynced:at,avatarColumn:it,nameWrapper:ot,name:lt,itemActions:rt,action:ct};function dt({item:s,status:t,selected:o,onSelect:l,onOpenModal:c,onDelete:a}){const x=Z(),p=r.useCallback((h,P)=>{l(s,P.checked)},[s,l]),N=r.useCallback(()=>{c("SeeInWorldModal",{itemIds:[s.id]})},[s,c]),v=r.useCallback(()=>{s.isPublished||c("EditItemURNModal",{item:s})},[s,c]),f=r.useCallback(()=>{x.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,x]),m=r.useCallback(()=>{a(s)},[a,s]),d=r.useMemo(()=>{if(!s.urn)return"";try{const h=Qe(s.urn);return Ke(h)?h.thirdPartyTokenId??"":""}catch{return""}},[s]),k=r.useMemo(()=>{switch(t){case T.UNDER_REVIEW:return e.jsx(n.Icon,{name:"clock outline"});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle outline"});case T.UNSYNCED:return e.jsx(n.Icon,{name:"exclamation circle"});default:return null}},[t]),y=s.data;return e.jsx(n.Grid,{className:`CollectionItem ${C.grid}`,columns:"equal",children:e.jsxs(n.Grid.Row,{className:C.row,children:[e.jsxs(n.Grid.Column,{className:`${C.column} ${C.avatarColumn}`,width:5,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished,onClick:p}),e.jsx(fe,{className:C.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:C.nameWrapper,children:e.jsxs("div",{className:C.name,title:s.name,children:[e.jsx(Xe,{className:C.itemStatus,item:s}),s.name]})})]}),e.jsx(n.Grid.Column,{className:C.column,children:y.category?e.jsx("div",{children:i(`wearable.category.${y.category}`)}):null}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:i(`body_shapes.${Je(s)}`)})}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:d})}),e.jsxs(n.Grid.Column,{width:3,className:`${C.column} ${C.statusColumn} ${C[t]}`,children:[k,e.jsx("div",{children:i(`third_party_collection_detail_page.synced_statuses.${t}`)})]}),e.jsx(n.Grid.Column,{width:1,className:C.column,children:e.jsx("div",{className:C.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:C.action,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:N}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:f}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:v,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:m,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})})}const mt=(s,t)=>({status:be(s)[t.item.id]}),_t=s=>({onDelete:t=>s(ve(t)),onOpenModal:(t,o)=>s(D(t,o))}),ut=B(mt,_t)(dt),gt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8524_427)'%3e%3cpath%20d='M20.5%203L20.34%203.03L15%205.1L9%203L3.36%204.9C3.15%204.97%203%205.15%203%205.38V20.5C3%2020.78%203.22%2021%203.5%2021L3.66%2020.97L9%2018.9L15%2021L20.64%2019.1C20.85%2019.03%2021%2018.85%2021%2018.62V3.5C21%203.22%2020.78%203%2020.5%203ZM15%2019L9%2016.89V5L15%207.11V19Z'%20fill='%23A09BA8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8524_427'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.669%200H1.33362C0.593463%200%200%200.600131%200%201.33362V10.669C0%2011.4025%200.593463%2012.0026%201.33362%2012.0026H10.669C11.4025%2012.0026%2012.0026%2011.4025%2012.0026%2010.669V1.33362C12.0026%200.600131%2011.4092%200%2010.669%200ZM10.669%2010.669H1.33362V2.66725H10.669V10.669ZM7.00152%206.66812C7.00152%207.22157%206.55476%207.66834%206.00131%207.66834C5.44785%207.66834%205.00109%207.22157%205.00109%206.66812C5.00109%206.11466%205.44785%205.6679%206.00131%205.6679C6.55476%205.6679%207.00152%206.11466%207.00152%206.66812ZM6.00131%204.00087C4.18091%204.00087%202.62724%205.10778%202.00044%206.66812C2.62724%208.22846%204.18091%209.33537%206.00131%209.33537C7.8217%209.33537%209.37537%208.22846%2010.0022%206.66812C9.37537%205.10778%207.8217%204.00087%206.00131%204.00087ZM6.00131%208.33515C5.08111%208.33515%204.33428%207.58832%204.33428%206.66812C4.33428%205.74792%205.08111%205.00109%206.00131%205.00109C6.92151%205.00109%207.66834%205.74792%207.66834%206.66812C7.66834%207.58832%206.92151%208.33515%206.00131%208.33515Z'%20fill='%23ECEBED'/%3e%3c/svg%3e",pt="_status_rgxu1_1",Ct="_pending_migration_rgxu1_14",xt="_synced_rgxu1_19",jt="_unpublished_rgxu1_24",It="_unsynced_rgxu1_25",Nt="_pending_mapping_rgxu1_30",ft="_under_review_rgxu1_31",kt="_icon_rgxu1_10",z={status:pt,pending_migration:Ct,synced:xt,unpublished:jt,unsynced:It,pending_mapping:Nt,under_review:ft,icon:kt},yt=s=>{const{status:t,item:o}=s,l=!o.mappings&&_e(o.urn),c=!o.isMappingComplete&&_e(o.urn),a=r.useMemo(()=>{if(l)return e.jsx("img",{src:gt,className:z.icon});if(c)return e.jsx(n.Icon,{name:"warning circle"});switch(t){case T.UNDER_REVIEW:return e.jsx("img",{src:ht,className:z.icon});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle"});case T.UNSYNCED:case T.UNPUBLISHED:return e.jsx(n.Icon,{name:"cloud upload"})}},[t,l,c]),x=r.useMemo(()=>l?i("item_status.pending_mapping"):c?i("item_status.pending_migration"):i(`item_status.${t}`),[t,l,c]),p=r.useMemo(()=>l?"pending_mapping":c?"pending_migration":t,[t,l,c]);return e.jsxs("div",{className:V(z[p],z.status),children:[a," ",x]})},bt="_itemImage_1rili_1",vt="_itemStatus_1rili_10",wt="_grid_1rili_14",St="_loading_1rili_21",Pt="_row_1rili_26",Dt="_column_1rili_31",Et="_avatarColumn_1rili_35",Tt="_nameWrapper_1rili_40",Mt="_name_1rili_40",$t="_itemActions_1rili_53",Lt="_action_1rili_60",Bt="_overlay_1rili_65",I={itemImage:bt,itemStatus:vt,grid:wt,loading:St,row:Pt,column:Dt,avatarColumn:Et,nameWrapper:Tt,name:Mt,itemActions:$t,action:Lt,overlay:Bt};function At({item:s,status:t,selected:o,loading:l,collection:c,onSaveItem:a,onSelect:x,onOpenModal:p,onDelete:N}){const v=Z(),f=r.useMemo(()=>es(s),[s]),m=r.useMemo(()=>c.linkedContractAddress&&c.linkedContractNetwork?{address:c.linkedContractAddress,network:c.linkedContractNetwork}:null,[c]),[d,k]=r.useState(f),y=r.useMemo(()=>{if(d&&m){const S=ue(d,m);return ss(S)?void 0:"Invalid mapping"}},[d,m]);r.useEffect(()=>{!m||y||(!f&&d||f&&d&&!ts(f,d))&&h(d,m)},[f,y,d,m]);const h=r.useCallback(ns((S,E)=>{const $=ue(S,E);a({...s,mappings:$})},1e3),[a]),P=r.useCallback((S,E)=>{l||x(s,E.checked)},[s,l,x]),w=r.useCallback(()=>{p("SeeInWorldModal",{itemIds:[s.id]})},[s,p]),H=r.useCallback(()=>{s.isPublished||p("EditItemURNModal",{item:s})},[s,p]),Y=r.useCallback(()=>{v.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,v]),A=r.useCallback(()=>{N(s)},[N,s]);return e.jsxs(n.Grid,{className:V(I.grid,l&&I.loading),columns:"equal",children:[l&&e.jsx("div",{className:I.overlay,children:e.jsx(n.Loader,{size:"large",active:!0})}),e.jsxs(n.Grid.Row,{className:I.row,children:[e.jsxs(n.Grid.Column,{className:`${I.column} ${I.avatarColumn}`,width:4,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished||l,onClick:P}),e.jsx(fe,{className:I.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:I.nameWrapper,children:e.jsx("div",{className:I.name,title:s.name,children:s.name})})]}),e.jsx(n.Grid.Column,{children:m&&e.jsx(as,{disabled:l,mapping:d,error:y,onChange:k,isCompact:!0})}),e.jsx(n.Grid.Column,{width:3,className:V(I.column,I.statusColumn),children:e.jsx(yt,{status:t,item:s})}),e.jsx(n.Grid.Column,{width:1,className:I.column,children:e.jsx("div",{className:I.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:I.action,disabled:l,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:w}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:Y}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:H,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:A,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})]})}const Gt=(s,t)=>{const o=be(s);return{loading:!!is(s)[t.item.id],status:o[t.item.id]}},Rt=s=>({onDelete:t=>s(ve(t)),onSaveItem:t=>s(os(t,{},{onlySaveItem:!0})),onOpenModal:(t,o)=>s(D(t,o))}),Wt=B(Gt,Rt)(At),L=50,Ut="_itemCheckbox_2k9qa_1",Ht="_gridHeader_2k9qa_5",Ot="_itemColumn_2k9qa_15",J={itemCheckbox:Ut,gridHeader:Ht,itemColumn:Ot},Ft=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:J.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:5,className:J.itemColumn,children:[e.jsx(n.Checkbox,{className:J.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsx(n.Grid.Column,{children:i("global.category")}),e.jsx(n.Grid.Column,{children:i("global.body_shape")}),e.jsx(n.Grid.Column,{children:"URN ID"}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),zt="_gridHeader_4acv6_1",qt="_itemColumn_4acv6_11",Vt="_itemCheckbox_4acv6_16",Zt="_linkedToColumn_4acv6_20",q={gridHeader:zt,itemColumn:qt,itemCheckbox:Vt,linkedToColumn:Zt},Yt=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:q.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:4,className:q.itemColumn,children:[e.jsx(n.Checkbox,{className:q.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsxs(n.Grid.Column,{className:q.linkedToColumn,children:[e.jsx("span",{children:i("third_party_collection_detail_page.linked_to")}),e.jsx(ls,{})]}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),Qt="_main_16i8r_3",Kt="_slots_16i8r_11",Xt="_empty_16i8r_28",Jt="_searchContainer_16i8r_32",en="_searchInfo_16i8r_42",sn="_syncedStatusList_16i8r_46",tn="_selectionInfo_16i8r_53",nn="_header_16i8r_63",an="_content_16i8r_74",on="_title_16i8r_83",ln="_editCollectionName_16i8r_96",rn="_name_16i8r_101",cn="_nameAndType_16i8r_105",dn="_nameWrapper_16i8r_115",mn="_size_16i8r_139",_n="_actions_16i8r_143",un="_body_16i8r_151",gn="_info_16i8r_162",hn="_infoHeader_16i8r_170",pn="_infoContent_16i8r_178",Cn="_slotsIcon_16i8r_195",xn="_copyButton_16i8r_207",jn="_sparkles_16i8r_232",In="_start_16i8r_241",Nn="_migrationBanner_16i8r_254",fn="_type_16i8r_277",kn="_linkedWearableBadge_16i8r_283",yn="_typeBadge_16i8r_288",bn="_programmaticBadge_16i8r_292",vn="_standardBadge_16i8r_296",wn="_loader_16i8r_302",_={main:Qt,slots:Kt,empty:Xt,searchContainer:Jt,searchInfo:en,syncedStatusList:sn,selectionInfo:tn,header:nn,content:an,title:on,editCollectionName:ln,name:rn,nameAndType:cn,nameWrapper:dn,size:mn,actions:_n,body:un,info:gn,infoHeader:hn,infoContent:pn,slotsIcon:Cn,copyButton:xn,sparkles:jn,start:In,migrationBanner:Nn,type:fn,linkedWearableBadge:kn,typeBadge:yn,programmaticBadge:bn,standardBadge:vn,loader:wn},xe=({children:s,title:t,info:o})=>e.jsxs("div",{className:_.info,children:[e.jsxs("div",{className:_.infoHeader,children:[t," ",o&&e.jsx(n.InfoTooltip,{content:o})]}),e.jsx("div",{className:_.infoContent,children:s})]});function Sn({currentPage:s,lastLocation:t,wallet:o,thirdParty:l,items:c,collection:a,totalItems:x,isLoading:p,isThirdPartyV2Enabled:N,isLinkedWearablesPaymentsEnabled:v,onFetchAvailableSlots:f,onFetchThirdParty:m,onNewItem:d,onEditName:k,isLoadingAvailableSlots:y}){const[h,P]=r.useState({}),[w,H]=r.useState(s),[Y,A]=r.useState(!1),[S,E]=r.useState(!1),[$,te]=r.useState("ALL"),G=Z(),ne=t===M.collections();r.useEffect(()=>{l&&l.availableSlots===void 0&&!y&&f(l.id)},[l,y,f]),r.useEffect(()=>{!p&&!l&&(a!=null&&a.urn)&&m(we(a.urn))},[a==null?void 0:a.urn,p,l]),r.useEffect(()=>{if(s!==w&&H(s),S){const u=c.reduce((g,j)=>(g[j.id]=!0,g),{});P(u),A(!1)}},[w,S,c,l,s]);const Se=r.useCallback(()=>{a!=null&&a.id&&d(a.id)},[a==null?void 0:a.id,d]),Pe=r.useCallback(()=>{a&&k(a)},[a,k]),De=r.useCallback(()=>{ne?G.goBack():G.push(M.collections(rs.THIRD_PARTY))},[G,ne]),Ee=r.useCallback((u,g)=>{H(+g.activePage),G.push(M.thirdPartyCollectionDetail(a.id,{page:+g.activePage}))},[a,G]),Q=r.useCallback((u,g)=>{P({...h,[u.id]:g}),E(!1),A(!1)},[h]),R=r.useCallback(u=>u.every(g=>h[g.id]),[h]),ae=r.useCallback((u,g)=>{const j={...h},W=!R(u);for(const U of u)j[U.id]=W;P(j),A(!0),E(S&&!!g.checked)},[h,S,R]),ie=r.useCallback(()=>{P({})},[]),oe=r.useMemo(()=>a&&l&&o&&cs(o.address,l),[a,l,o]),Te=r.useCallback(u=>{if(E(!0),a){const g=Math.ceil(x/L);u(a.id,{page:ds(g),limit:L,overridePaginationData:!1})}},[x]),le=r.useCallback((u,{value:g})=>{te(g)},[te]),Me=[{value:"ALL",text:i("third_party_collection_detail_page.synced_filter.all")},{value:"SYNCED",text:i("item_status.synced")},{value:"UNSYNCED",text:i("item_status.unsynced")},...a!=null&&a.isMappingComplete?[]:[{value:"MIGRATION_REQUIRED",text:i("item_status.pending_migration")},{value:"MAPPING_PENDING",text:i("item_status.pending_mapping")}]],$e=r.useMemo(()=>{switch($){case"SYNCED":return{synced:!0};case"UNSYNCED":return{synced:!1};case"MIGRATION_REQUIRED":return{mappingStatus:ge.UNPUBLISHED_MAPPING};case"MAPPING_PENDING":return{mappingStatus:ge.MISSING_MAPPING};default:return{}}},[$]),Le=r.useCallback((u,g,j,W,U)=>{const re=g.filter(b=>h[b.id]),ce=re.length,de=!!(a!=null&&a.linkedContractAddress&&(a!=null&&a.linkedContractNetwork)),O=x,K=Math.ceil(O/L),me=(a==null?void 0:a.itemCount)===0;return a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:_.header,children:[e.jsx(Ts,{absolute:!0,onClick:De}),e.jsxs("div",{className:_.content,children:[e.jsxs("div",{className:_.title,children:[e.jsx(Us,{collectionId:a.id}),e.jsxs("div",{className:_.nameAndType,children:[e.jsxs("div",{className:_.nameWrapper,children:[e.jsx(n.Header,{size:"large",className:_.name,onClick:Pe,children:a.name}),!a.isPublished&&e.jsx(ms,{name:"edit",className:_.editCollectionName})]}),e.jsxs("div",{className:_.type,children:[e.jsx(Ms,{isThirdParty:!0}),e.jsx($s,{isProgrammatic:u.isProgrammatic})]})]})]}),e.jsxs("div",{className:_.actions,children:[a.linkedContractAddress&&a.linkedContractNetwork&&e.jsxs(xe,{title:i("third_party_collection_detail_page.smart_contract_address_short"),info:i("third_party_collection_detail_page.smart_contract_address_long"),children:[_s(a.linkedContractAddress)," ",e.jsx(us,{className:_.copyButton,showPopup:!0,text:a.linkedContractAddress,role:"button",children:e.jsx(n.Icon,{name:"copy outline"})})]}),!v&&e.jsxs(xe,{title:i("third_party_collection_detail_page.slots_short"),info:i("third_party_collection_detail_page.slots_long"),children:[e.jsx("div",{className:_.slotsIcon}),y?e.jsx(n.Loader,{active:!0,inline:!0,size:"tiny"}):e.jsxs("span",{children:[u.availableSlots??0," / ",u.maxItems]})]}),e.jsxs(n.Button,{inverted:!0,onClick:Se,children:[e.jsx(n.Icon,{name:"plus"}),i("third_party_collection_detail_page.new_items")]}),u.availableSlots!==void 0?e.jsx(Qs,{collection:a,items:re,slots:u.availableSlots}):null,e.jsx(Vs,{collection:a,items:j})]})]})]}),!a.isMappingComplete&&e.jsxs("div",{className:_.migrationBanner,children:[e.jsx(n.Icon,{name:"sync"})," ",i("third_party_collection_detail_page.migration_banner")]}),e.jsx("div",{className:_.body,children:W?e.jsx("div",{className:_.loader,children:e.jsx(n.Loader,{size:"massive",inline:!0,active:!0})}):e.jsxs(e.Fragment,{children:[(a.itemCount??0)>0&&e.jsxs("div",{className:_.searchContainer,children:[j.length>0&&e.jsx("div",{className:_.searchInfo,children:i("third_party_collection_detail_page.search_info",{page:(w-1)*L+1,pageTotal:Math.min(O,w*L),total:O})}),e.jsx(n.Dropdown,{className:_.syncedStatusList,direction:"left",value:$,options:Me,onChange:le})]}),j.length?e.jsxs(e.Fragment,{children:[ce>0?e.jsxs("div",{className:_.selectionInfo,children:[i("third_party_collection_detail_page.selection",{count:ce})," ",e.jsx("span",{className:"link",onClick:ie,children:i("third_party_collection_detail_page.clear_selection")}),". ",Y&&K>1?e.jsx("span",{className:"link",onClick:()=>Te(U),children:i("third_party_collection_detail_page.select_all",{total:O})}):null," "]}):null,e.jsxs("div",{children:[N&&de?e.jsx(Yt,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}):e.jsx(Ft,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}),j.map(b=>N&&de?e.jsx(Wt,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id):e.jsx(ut,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id)),K>1?e.jsx(n.Pagination,{firstItem:null,lastItem:null,totalPages:K,activePage:w,onPageChange:Ee}):null]})]}):e.jsxs("div",{className:_.empty,children:[e.jsx("div",{className:me?_.start:_.sparkles}),me?e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.start_adding_items")}),e.jsx("p",{children:i("third_party_collection_detail_page.cant_remove")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.not_found")}),e.jsx("p",{children:i("third_party_collection_detail_page.try_again")})]})]})]})})]}):(console.error("No collection defined"),null)},[a,h,y,v,N,x,w,Q,R,le,ie,$]),Be=oe&&a;return e.jsx(Ds,{id:a==null?void 0:a.id,itemsPage:w,itemsPageSize:L,fetchCollectionItemsOptions:$e,children:({isLoadingCollection:u,isLoadingCollectionItems:g,items:j,paginatedItems:W,onFetchCollectionItemsPages:U})=>e.jsx(Ps,{className:_.main,hasNavigation:!oe&&!p&&!u,isLoading:p||u,children:Be&&l?Le(l,j,W,g,U):e.jsx(Es,{})})})}const Pn=s=>{var N;const t=gs(s)||"",o=je(s,t),l=o?he(o):!1,c=((N=pe(s,t))==null?void 0:N.total)||null,a=o?hs(s,o.id):[],x=o&&pe(s,o.id)||null,p=Number(ps(s).query.page??1);return{items:a,totalItems:c,currentPage:p,paginatedData:x,wallet:Cs(s),collection:o,isThirdPartyV2Enabled:xs(s),isLinkedWearablesPaymentsEnabled:Ne(s),thirdParty:o&&he(o)?js(s,o):null,authorizations:Is(s),isLoading:Ie(Ns(s),ws)||fs(s)||!!(l&&o&&ks(s,we(o.urn))),isLoadingAvailableSlots:ys(s),lastLocation:Ss(s)}},Dn=s=>({onNewItem:t=>s(D("CreateItemsModal",{collectionId:t})),onEditName:t=>s(D("EditCollectionNameModal",{collection:t})),onFetchAvailableSlots:t=>s(bs(t)),onFetchThirdParty:t=>s(vs(t))}),Hn=B(Pn,Dn)(Sn);export{Hn as default};
|
|
1
|
+
import{H as e,g1 as Ae,g2 as Ge,a1 as V,dC as Re,M as n,N as B,fc as je,Z,e_ as We,G as i,fL as Ue,eS as ee,g3 as He,cD as Oe,X as D,eu as Fe,g4 as ze,fX as qe,bw as Ie,fZ as Ve,eF as Ne,g5 as Ze,f$ as Ye,D as r,K as M,g6 as Qe,g7 as Ke,eP as T,dD as fe,eq as Xe,g8 as Je,bu as ke,L as ye,fd as be,ep as ve,es as _e,g9 as es,ga as ue,gb as ss,gc as ts,gd as ns,ge as as,gf as is,fg as os,gg as ls,gh as we,ev as rs,gi as cs,gj as ds,gk as ge,J as ms,cB as _s,cC as us,fP as gs,eQ as he,eA as pe,fr as hs,aN as ps,e9 as Cs,gl as xs,gm as js,gn as Is,eD as Ns,go as fs,gp as ks,gq as ys,gr as bs,gs as vs,fT as ws}from"./index-CtlR5vLP.js";import{g as Ss}from"./selector-CtnQnmhq.js";import{L as Ps}from"./LoggedInDetailPage.container-iODRZ5_l.js";import{C as Ds}from"./CollectionProvider.container-DOhRKeRu.js";import{N as Es}from"./NotFound-DAstcQ7G.js";import{B as Ts}from"./Back-CmrASlX3.js";import{C as Ms,T as $s}from"./ThirdPartyKindBadge-B8owNMMy.js";import{C as se}from"./ConfirmDelete-DN98x9nl.js";import"./Navigation.container-BZFqWR65.js";import"./selectors-DB1jYqTE.js";import"./SignInRequired-B3HAtRFv.js";const Ls=s=>e.jsx("img",{"data-testid":Ae,src:Ge[s.network],alt:s.network,className:s.className}),Bs="_image_142g7_1",As="_main_142g7_2",Gs="_network_142g7_13",F={image:Bs,main:As,network:Gs},Rs=s=>{const{collection:t,collectionId:o,className:l,shape:c}=s;return e.jsxs("div",{className:V(F.main,l),children:[t!=null&&t.itemCount?e.jsx(Re,{collectionId:o,className:F.image}):e.jsx(n.Blockie,{className:F.image,seed:o,size:8,scale:8,shape:c??"circle"}),t!=null&&t.linkedContractNetwork?e.jsx(Ls,{network:t==null?void 0:t.linkedContractNetwork,className:F.network}):null]})},Ws=(s,t)=>({collection:je(s,t.collectionId)}),Us=B(Ws)(Rs),Hs="_ellipsis_4huv2_1",Ce={ellipsis:Hs},Os=s=>{const{collection:t}=s,o=Z(),l=()=>{t.isPublished&&t.forumLink&&v(t.forumLink,"_blank")},c=()=>{const{items:m,onOpenModal:d}=s;d("SeeInWorldModal",{itemIds:m.map(k=>k.id)})},a=()=>{const{collection:m,items:d}=s;o.push(Ue(m,d),{fromParam:ee.TP_COLLECTIONS})},x=()=>{const{collection:m,onDelete:d}=s;d(m)},p=()=>{const{collection:m,onOpenModal:d}=s;m.isPublished||d("EditCollectionURNModal",{collection:m})},N=()=>{const{collection:m,onOpenModal:d}=s;d("CreateAndEditMultipleItemsModal",{collectionId:m.id,type:He.EDIT})},v=(m,d="")=>{const k=window.open(m,d);k&&k.focus()},f=!We(t)&&!t.isPublished;return e.jsx(n.Dropdown,{className:Ce.dropdown,trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{className:Ce.ellipsis,size:"large",name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:c}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:a}),e.jsx(n.Popup,{content:i("collection_context_menu.delete_published_collection"),position:"right center",disabled:f,trigger:f?e.jsx(se,{name:t.name,onDelete:x,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})}):e.jsx(n.Dropdown.Item,{text:i("global.delete"),disabled:!0}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Popup,{content:i("collection_context_menu.change_published_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_urn"),onClick:p,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_in_bulk"),onClick:N}),e.jsx(n.Popup,{content:i("collection_context_menu.unpublished"),position:"right center",disabled:t.isPublished||!!t.forumLink,trigger:e.jsx(n.Dropdown.Item,{disabled:!t.isPublished||!t.forumLink,text:i("collection_context_menu.forum_post"),onClick:l}),hideOnScroll:!0,on:"hover",inverted:!0})]})})},Fs=Os,zs=s=>({name:Oe(s)||""}),qs=s=>({onOpenModal:(t,o)=>s(D(t,o)),onDelete:t=>s(Fe(t))}),Vs=B(zs,qs)(Fs),Zs=(s,t)=>{const{collection:o,items:l}=t;return{itemCurations:qe(s,o.id),isLoadingItemCurations:Ie(Ve(s),Ye),isLinkedWearablesPaymentsEnabled:Ne(s),itemsStatus:Ze(s,l.map(c=>c.id))}},Ys=s=>({onNewClick:(t,o,l)=>s(D("PublishWizardCollectionModal",{collectionId:t,itemsWithChanges:o,itemsToPublish:l})),onPushChangesClick:(t,o)=>s(D("PushChangesModal",{collectionId:t,itemsWithChanges:o})),onClick:(t,o,l)=>s(D("PublishThirdPartyCollectionModal",{collectionId:t,itemIds:o,action:l}))}),Qs=B(Zs,Ys)(ze),Ks="_itemImage_1y9df_1",Xs="_itemStatus_1y9df_10",Js="_grid_1y9df_14",et="_row_1y9df_25",st="_column_1y9df_30",tt="_statusColumn_1y9df_34",nt="_synced_1y9df_39",at="_unsynced_1y9df_43",it="_avatarColumn_1y9df_47",ot="_nameWrapper_1y9df_52",lt="_name_1y9df_52",rt="_itemActions_1y9df_65",ct="_action_1y9df_72",C={itemImage:Ks,itemStatus:Xs,grid:Js,row:et,column:st,statusColumn:tt,synced:nt,unsynced:at,avatarColumn:it,nameWrapper:ot,name:lt,itemActions:rt,action:ct};function dt({item:s,status:t,selected:o,onSelect:l,onOpenModal:c,onDelete:a}){const x=Z(),p=r.useCallback((h,P)=>{l(s,P.checked)},[s,l]),N=r.useCallback(()=>{c("SeeInWorldModal",{itemIds:[s.id]})},[s,c]),v=r.useCallback(()=>{s.isPublished||c("EditItemURNModal",{item:s})},[s,c]),f=r.useCallback(()=>{x.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,x]),m=r.useCallback(()=>{a(s)},[a,s]),d=r.useMemo(()=>{if(!s.urn)return"";try{const h=Qe(s.urn);return Ke(h)?h.thirdPartyTokenId??"":""}catch{return""}},[s]),k=r.useMemo(()=>{switch(t){case T.UNDER_REVIEW:return e.jsx(n.Icon,{name:"clock outline"});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle outline"});case T.UNSYNCED:return e.jsx(n.Icon,{name:"exclamation circle"});default:return null}},[t]),y=s.data;return e.jsx(n.Grid,{className:`CollectionItem ${C.grid}`,columns:"equal",children:e.jsxs(n.Grid.Row,{className:C.row,children:[e.jsxs(n.Grid.Column,{className:`${C.column} ${C.avatarColumn}`,width:5,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished,onClick:p}),e.jsx(fe,{className:C.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:C.nameWrapper,children:e.jsxs("div",{className:C.name,title:s.name,children:[e.jsx(Xe,{className:C.itemStatus,item:s}),s.name]})})]}),e.jsx(n.Grid.Column,{className:C.column,children:y.category?e.jsx("div",{children:i(`wearable.category.${y.category}`)}):null}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:i(`body_shapes.${Je(s)}`)})}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:d})}),e.jsxs(n.Grid.Column,{width:3,className:`${C.column} ${C.statusColumn} ${C[t]}`,children:[k,e.jsx("div",{children:i(`third_party_collection_detail_page.synced_statuses.${t}`)})]}),e.jsx(n.Grid.Column,{width:1,className:C.column,children:e.jsx("div",{className:C.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:C.action,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:N}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:f}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:v,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:m,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})})}const mt=(s,t)=>({status:be(s)[t.item.id]}),_t=s=>({onDelete:t=>s(ve(t)),onOpenModal:(t,o)=>s(D(t,o))}),ut=B(mt,_t)(dt),gt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8524_427)'%3e%3cpath%20d='M20.5%203L20.34%203.03L15%205.1L9%203L3.36%204.9C3.15%204.97%203%205.15%203%205.38V20.5C3%2020.78%203.22%2021%203.5%2021L3.66%2020.97L9%2018.9L15%2021L20.64%2019.1C20.85%2019.03%2021%2018.85%2021%2018.62V3.5C21%203.22%2020.78%203%2020.5%203ZM15%2019L9%2016.89V5L15%207.11V19Z'%20fill='%23A09BA8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8524_427'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.669%200H1.33362C0.593463%200%200%200.600131%200%201.33362V10.669C0%2011.4025%200.593463%2012.0026%201.33362%2012.0026H10.669C11.4025%2012.0026%2012.0026%2011.4025%2012.0026%2010.669V1.33362C12.0026%200.600131%2011.4092%200%2010.669%200ZM10.669%2010.669H1.33362V2.66725H10.669V10.669ZM7.00152%206.66812C7.00152%207.22157%206.55476%207.66834%206.00131%207.66834C5.44785%207.66834%205.00109%207.22157%205.00109%206.66812C5.00109%206.11466%205.44785%205.6679%206.00131%205.6679C6.55476%205.6679%207.00152%206.11466%207.00152%206.66812ZM6.00131%204.00087C4.18091%204.00087%202.62724%205.10778%202.00044%206.66812C2.62724%208.22846%204.18091%209.33537%206.00131%209.33537C7.8217%209.33537%209.37537%208.22846%2010.0022%206.66812C9.37537%205.10778%207.8217%204.00087%206.00131%204.00087ZM6.00131%208.33515C5.08111%208.33515%204.33428%207.58832%204.33428%206.66812C4.33428%205.74792%205.08111%205.00109%206.00131%205.00109C6.92151%205.00109%207.66834%205.74792%207.66834%206.66812C7.66834%207.58832%206.92151%208.33515%206.00131%208.33515Z'%20fill='%23ECEBED'/%3e%3c/svg%3e",pt="_status_rgxu1_1",Ct="_pending_migration_rgxu1_14",xt="_synced_rgxu1_19",jt="_unpublished_rgxu1_24",It="_unsynced_rgxu1_25",Nt="_pending_mapping_rgxu1_30",ft="_under_review_rgxu1_31",kt="_icon_rgxu1_10",z={status:pt,pending_migration:Ct,synced:xt,unpublished:jt,unsynced:It,pending_mapping:Nt,under_review:ft,icon:kt},yt=s=>{const{status:t,item:o}=s,l=!o.mappings&&_e(o.urn),c=!o.isMappingComplete&&_e(o.urn),a=r.useMemo(()=>{if(l)return e.jsx("img",{src:gt,className:z.icon});if(c)return e.jsx(n.Icon,{name:"warning circle"});switch(t){case T.UNDER_REVIEW:return e.jsx("img",{src:ht,className:z.icon});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle"});case T.UNSYNCED:case T.UNPUBLISHED:return e.jsx(n.Icon,{name:"cloud upload"})}},[t,l,c]),x=r.useMemo(()=>l?i("item_status.pending_mapping"):c?i("item_status.pending_migration"):i(`item_status.${t}`),[t,l,c]),p=r.useMemo(()=>l?"pending_mapping":c?"pending_migration":t,[t,l,c]);return e.jsxs("div",{className:V(z[p],z.status),children:[a," ",x]})},bt="_itemImage_1rili_1",vt="_itemStatus_1rili_10",wt="_grid_1rili_14",St="_loading_1rili_21",Pt="_row_1rili_26",Dt="_column_1rili_31",Et="_avatarColumn_1rili_35",Tt="_nameWrapper_1rili_40",Mt="_name_1rili_40",$t="_itemActions_1rili_53",Lt="_action_1rili_60",Bt="_overlay_1rili_65",I={itemImage:bt,itemStatus:vt,grid:wt,loading:St,row:Pt,column:Dt,avatarColumn:Et,nameWrapper:Tt,name:Mt,itemActions:$t,action:Lt,overlay:Bt};function At({item:s,status:t,selected:o,loading:l,collection:c,onSaveItem:a,onSelect:x,onOpenModal:p,onDelete:N}){const v=Z(),f=r.useMemo(()=>es(s),[s]),m=r.useMemo(()=>c.linkedContractAddress&&c.linkedContractNetwork?{address:c.linkedContractAddress,network:c.linkedContractNetwork}:null,[c]),[d,k]=r.useState(f),y=r.useMemo(()=>{if(d&&m){const S=ue(d,m);return ss(S)?void 0:"Invalid mapping"}},[d,m]);r.useEffect(()=>{!m||y||(!f&&d||f&&d&&!ts(f,d))&&h(d,m)},[f,y,d,m]);const h=r.useCallback(ns((S,E)=>{const $=ue(S,E);a({...s,mappings:$})},1e3),[a]),P=r.useCallback((S,E)=>{l||x(s,E.checked)},[s,l,x]),w=r.useCallback(()=>{p("SeeInWorldModal",{itemIds:[s.id]})},[s,p]),H=r.useCallback(()=>{s.isPublished||p("EditItemURNModal",{item:s})},[s,p]),Y=r.useCallback(()=>{v.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,v]),A=r.useCallback(()=>{N(s)},[N,s]);return e.jsxs(n.Grid,{className:V(I.grid,l&&I.loading),columns:"equal",children:[l&&e.jsx("div",{className:I.overlay,children:e.jsx(n.Loader,{size:"large",active:!0})}),e.jsxs(n.Grid.Row,{className:I.row,children:[e.jsxs(n.Grid.Column,{className:`${I.column} ${I.avatarColumn}`,width:4,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished||l,onClick:P}),e.jsx(fe,{className:I.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:I.nameWrapper,children:e.jsx("div",{className:I.name,title:s.name,children:s.name})})]}),e.jsx(n.Grid.Column,{children:m&&e.jsx(as,{disabled:l,mapping:d,error:y,onChange:k,isCompact:!0})}),e.jsx(n.Grid.Column,{width:3,className:V(I.column,I.statusColumn),children:e.jsx(yt,{status:t,item:s})}),e.jsx(n.Grid.Column,{width:1,className:I.column,children:e.jsx("div",{className:I.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:I.action,disabled:l,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:w}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:Y}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:H,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:A,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})]})}const Gt=(s,t)=>{const o=be(s);return{loading:!!is(s)[t.item.id],status:o[t.item.id]}},Rt=s=>({onDelete:t=>s(ve(t)),onSaveItem:t=>s(os(t,{},{onlySaveItem:!0})),onOpenModal:(t,o)=>s(D(t,o))}),Wt=B(Gt,Rt)(At),L=50,Ut="_itemCheckbox_2k9qa_1",Ht="_gridHeader_2k9qa_5",Ot="_itemColumn_2k9qa_15",J={itemCheckbox:Ut,gridHeader:Ht,itemColumn:Ot},Ft=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:J.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:5,className:J.itemColumn,children:[e.jsx(n.Checkbox,{className:J.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsx(n.Grid.Column,{children:i("global.category")}),e.jsx(n.Grid.Column,{children:i("global.body_shape")}),e.jsx(n.Grid.Column,{children:"URN ID"}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),zt="_gridHeader_4acv6_1",qt="_itemColumn_4acv6_11",Vt="_itemCheckbox_4acv6_16",Zt="_linkedToColumn_4acv6_20",q={gridHeader:zt,itemColumn:qt,itemCheckbox:Vt,linkedToColumn:Zt},Yt=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:q.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:4,className:q.itemColumn,children:[e.jsx(n.Checkbox,{className:q.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsxs(n.Grid.Column,{className:q.linkedToColumn,children:[e.jsx("span",{children:i("third_party_collection_detail_page.linked_to")}),e.jsx(ls,{})]}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),Qt="_main_16i8r_3",Kt="_slots_16i8r_11",Xt="_empty_16i8r_28",Jt="_searchContainer_16i8r_32",en="_searchInfo_16i8r_42",sn="_syncedStatusList_16i8r_46",tn="_selectionInfo_16i8r_53",nn="_header_16i8r_63",an="_content_16i8r_74",on="_title_16i8r_83",ln="_editCollectionName_16i8r_96",rn="_name_16i8r_101",cn="_nameAndType_16i8r_105",dn="_nameWrapper_16i8r_115",mn="_size_16i8r_139",_n="_actions_16i8r_143",un="_body_16i8r_151",gn="_info_16i8r_162",hn="_infoHeader_16i8r_170",pn="_infoContent_16i8r_178",Cn="_slotsIcon_16i8r_195",xn="_copyButton_16i8r_207",jn="_sparkles_16i8r_232",In="_start_16i8r_241",Nn="_migrationBanner_16i8r_254",fn="_type_16i8r_277",kn="_linkedWearableBadge_16i8r_283",yn="_typeBadge_16i8r_288",bn="_programmaticBadge_16i8r_292",vn="_standardBadge_16i8r_296",wn="_loader_16i8r_302",_={main:Qt,slots:Kt,empty:Xt,searchContainer:Jt,searchInfo:en,syncedStatusList:sn,selectionInfo:tn,header:nn,content:an,title:on,editCollectionName:ln,name:rn,nameAndType:cn,nameWrapper:dn,size:mn,actions:_n,body:un,info:gn,infoHeader:hn,infoContent:pn,slotsIcon:Cn,copyButton:xn,sparkles:jn,start:In,migrationBanner:Nn,type:fn,linkedWearableBadge:kn,typeBadge:yn,programmaticBadge:bn,standardBadge:vn,loader:wn},xe=({children:s,title:t,info:o})=>e.jsxs("div",{className:_.info,children:[e.jsxs("div",{className:_.infoHeader,children:[t," ",o&&e.jsx(n.InfoTooltip,{content:o})]}),e.jsx("div",{className:_.infoContent,children:s})]});function Sn({currentPage:s,lastLocation:t,wallet:o,thirdParty:l,items:c,collection:a,totalItems:x,isLoading:p,isThirdPartyV2Enabled:N,isLinkedWearablesPaymentsEnabled:v,onFetchAvailableSlots:f,onFetchThirdParty:m,onNewItem:d,onEditName:k,isLoadingAvailableSlots:y}){const[h,P]=r.useState({}),[w,H]=r.useState(s),[Y,A]=r.useState(!1),[S,E]=r.useState(!1),[$,te]=r.useState("ALL"),G=Z(),ne=t===M.collections();r.useEffect(()=>{l&&l.availableSlots===void 0&&!y&&f(l.id)},[l,y,f]),r.useEffect(()=>{!p&&!l&&(a!=null&&a.urn)&&m(we(a.urn))},[a==null?void 0:a.urn,p,l]),r.useEffect(()=>{if(s!==w&&H(s),S){const u=c.reduce((g,j)=>(g[j.id]=!0,g),{});P(u),A(!1)}},[w,S,c,l,s]);const Se=r.useCallback(()=>{a!=null&&a.id&&d(a.id)},[a==null?void 0:a.id,d]),Pe=r.useCallback(()=>{a&&k(a)},[a,k]),De=r.useCallback(()=>{ne?G.goBack():G.push(M.collections(rs.THIRD_PARTY))},[G,ne]),Ee=r.useCallback((u,g)=>{H(+g.activePage),G.push(M.thirdPartyCollectionDetail(a.id,{page:+g.activePage}))},[a,G]),Q=r.useCallback((u,g)=>{P({...h,[u.id]:g}),E(!1),A(!1)},[h]),R=r.useCallback(u=>u.every(g=>h[g.id]),[h]),ae=r.useCallback((u,g)=>{const j={...h},W=!R(u);for(const U of u)j[U.id]=W;P(j),A(!0),E(S&&!!g.checked)},[h,S,R]),ie=r.useCallback(()=>{P({})},[]),oe=r.useMemo(()=>a&&l&&o&&cs(o.address,l),[a,l,o]),Te=r.useCallback(u=>{if(E(!0),a){const g=Math.ceil(x/L);u(a.id,{page:ds(g),limit:L,overridePaginationData:!1})}},[x]),le=r.useCallback((u,{value:g})=>{te(g)},[te]),Me=[{value:"ALL",text:i("third_party_collection_detail_page.synced_filter.all")},{value:"SYNCED",text:i("item_status.synced")},{value:"UNSYNCED",text:i("item_status.unsynced")},...a!=null&&a.isMappingComplete?[]:[{value:"MIGRATION_REQUIRED",text:i("item_status.pending_migration")},{value:"MAPPING_PENDING",text:i("item_status.pending_mapping")}]],$e=r.useMemo(()=>{switch($){case"SYNCED":return{synced:!0};case"UNSYNCED":return{synced:!1};case"MIGRATION_REQUIRED":return{mappingStatus:ge.UNPUBLISHED_MAPPING};case"MAPPING_PENDING":return{mappingStatus:ge.MISSING_MAPPING};default:return{}}},[$]),Le=r.useCallback((u,g,j,W,U)=>{const re=g.filter(b=>h[b.id]),ce=re.length,de=!!(a!=null&&a.linkedContractAddress&&(a!=null&&a.linkedContractNetwork)),O=x,K=Math.ceil(O/L),me=(a==null?void 0:a.itemCount)===0;return a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:_.header,children:[e.jsx(Ts,{absolute:!0,onClick:De}),e.jsxs("div",{className:_.content,children:[e.jsxs("div",{className:_.title,children:[e.jsx(Us,{collectionId:a.id}),e.jsxs("div",{className:_.nameAndType,children:[e.jsxs("div",{className:_.nameWrapper,children:[e.jsx(n.Header,{size:"large",className:_.name,onClick:Pe,children:a.name}),!a.isPublished&&e.jsx(ms,{name:"edit",className:_.editCollectionName})]}),e.jsxs("div",{className:_.type,children:[e.jsx(Ms,{isThirdParty:!0}),e.jsx($s,{isProgrammatic:u.isProgrammatic})]})]})]}),e.jsxs("div",{className:_.actions,children:[a.linkedContractAddress&&a.linkedContractNetwork&&e.jsxs(xe,{title:i("third_party_collection_detail_page.smart_contract_address_short"),info:i("third_party_collection_detail_page.smart_contract_address_long"),children:[_s(a.linkedContractAddress)," ",e.jsx(us,{className:_.copyButton,showPopup:!0,text:a.linkedContractAddress,role:"button",children:e.jsx(n.Icon,{name:"copy outline"})})]}),!v&&e.jsxs(xe,{title:i("third_party_collection_detail_page.slots_short"),info:i("third_party_collection_detail_page.slots_long"),children:[e.jsx("div",{className:_.slotsIcon}),y?e.jsx(n.Loader,{active:!0,inline:!0,size:"tiny"}):e.jsxs("span",{children:[u.availableSlots??0," / ",u.maxItems]})]}),e.jsxs(n.Button,{inverted:!0,onClick:Se,children:[e.jsx(n.Icon,{name:"plus"}),i("third_party_collection_detail_page.new_items")]}),u.availableSlots!==void 0?e.jsx(Qs,{collection:a,items:re,slots:u.availableSlots}):null,e.jsx(Vs,{collection:a,items:j})]})]})]}),!a.isMappingComplete&&e.jsxs("div",{className:_.migrationBanner,children:[e.jsx(n.Icon,{name:"sync"})," ",i("third_party_collection_detail_page.migration_banner")]}),e.jsx("div",{className:_.body,children:W?e.jsx("div",{className:_.loader,children:e.jsx(n.Loader,{size:"massive",inline:!0,active:!0})}):e.jsxs(e.Fragment,{children:[(a.itemCount??0)>0&&e.jsxs("div",{className:_.searchContainer,children:[j.length>0&&e.jsx("div",{className:_.searchInfo,children:i("third_party_collection_detail_page.search_info",{page:(w-1)*L+1,pageTotal:Math.min(O,w*L),total:O})}),e.jsx(n.Dropdown,{className:_.syncedStatusList,direction:"left",value:$,options:Me,onChange:le})]}),j.length?e.jsxs(e.Fragment,{children:[ce>0?e.jsxs("div",{className:_.selectionInfo,children:[i("third_party_collection_detail_page.selection",{count:ce})," ",e.jsx("span",{className:"link",onClick:ie,children:i("third_party_collection_detail_page.clear_selection")}),". ",Y&&K>1?e.jsx("span",{className:"link",onClick:()=>Te(U),children:i("third_party_collection_detail_page.select_all",{total:O})}):null," "]}):null,e.jsxs("div",{children:[N&&de?e.jsx(Yt,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}):e.jsx(Ft,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}),j.map(b=>N&&de?e.jsx(Wt,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id):e.jsx(ut,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id)),K>1?e.jsx(n.Pagination,{firstItem:null,lastItem:null,totalPages:K,activePage:w,onPageChange:Ee}):null]})]}):e.jsxs("div",{className:_.empty,children:[e.jsx("div",{className:me?_.start:_.sparkles}),me?e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.start_adding_items")}),e.jsx("p",{children:i("third_party_collection_detail_page.cant_remove")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.not_found")}),e.jsx("p",{children:i("third_party_collection_detail_page.try_again")})]})]})]})})]}):(console.error("No collection defined"),null)},[a,h,y,v,N,x,w,Q,R,le,ie,$]),Be=oe&&a;return e.jsx(Ds,{id:a==null?void 0:a.id,itemsPage:w,itemsPageSize:L,fetchCollectionItemsOptions:$e,children:({isLoadingCollection:u,isLoadingCollectionItems:g,items:j,paginatedItems:W,onFetchCollectionItemsPages:U})=>e.jsx(Ps,{className:_.main,hasNavigation:!oe&&!p&&!u,isLoading:p||u,children:Be&&l?Le(l,j,W,g,U):e.jsx(Es,{})})})}const Pn=s=>{var N;const t=gs(s)||"",o=je(s,t),l=o?he(o):!1,c=((N=pe(s,t))==null?void 0:N.total)||null,a=o?hs(s,o.id):[],x=o&&pe(s,o.id)||null,p=Number(ps(s).query.page??1);return{items:a,totalItems:c,currentPage:p,paginatedData:x,wallet:Cs(s),collection:o,isThirdPartyV2Enabled:xs(s),isLinkedWearablesPaymentsEnabled:Ne(s),thirdParty:o&&he(o)?js(s,o):null,authorizations:Is(s),isLoading:Ie(Ns(s),ws)||fs(s)||!!(l&&o&&ks(s,we(o.urn))),isLoadingAvailableSlots:ys(s),lastLocation:Ss(s)}},Dn=s=>({onNewItem:t=>s(D("CreateItemsModal",{collectionId:t})),onEditName:t=>s(D("EditCollectionNameModal",{collection:t})),onFetchAvailableSlots:t=>s(bs(t)),onFetchThirdParty:t=>s(vs(t))}),Hn=B(Pn,Dn)(Sn);export{Hn as default};
|