var S=Object.create;var a=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},d=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!E.call(e,n)&&n!==o&&a(e,n,{get:()=>t[n],enumerable:!(r=M(t,n))||r.enumerable});return e};var b=(e,t,o)=>(o=e!=null?S(v(e)):{},d(t||!e||!e.__esModule?a(o,"default",{value:e,enumerable:!0}):o,e)),A=e=>d(a({},"__esModule",{value:!0}),e);var z={};L(z,{default:()=>N});module.exports=A(z);var c=require("@chakra-ui/react"),x=require("react-icons/fi"),l=require("react-redux");var u=require("@reduxjs/toolkit"),O={selectedCollectionId:null,showMint:!1,collectionViewOpen:!1,selectedSpaceId:!1},h=(0,u.createSlice)({name:"collection",initialState:O,reducers:{updateSelectedCollectionId(e,{payload:{id:t}}){e.selectedCollectionId=t},updateShowMint(e,{payload:{showMint:t}}){e.showMint=t},updateCollectionViewOpen(e,{payload:{collectionViewOpen:t}}){e.collectionViewOpen=t},updateSelectedSpaceId(e,{payload:{id:t}}){e.selectedSpaceId=t}}}),{updateSelectedCollectionId:m,updateShowMint:y,updateCollectionViewOpen:D,updateSelectedSpaceId:$}=h.actions,k=h.reducer;var w=(e,t,o,r,n,p,f)=>{if(f)r(t);else{let i=new URLSearchParams(e);i.set("collectionId",o);let I=`${t}?${i.toString()}${p?"#mint":""}`;r(I)}};var C=b(require("posthog-js"),1);function g(e,t){try{C.default.capture(e,t)}catch(o){}}var s=require("react/jsx-runtime"),_=({collectionId:e,isExternalMint:t,profile:o,isCollectionContest:r})=>{let n=(0,l.useDispatch)(),p=(0,l.useSelector)(i=>i.user.accessKey);return(0,s.jsxs)(c.Button,{variant:"outline",size:"sm",w:"20",onClick:()=>{t?window.open(o.socialmedia.website):(n(m({id:e})),n(y({showMint:!0})),w(window.location.search,window.location.pathname,e,i=>{window.history.pushState({},"",i)},!1,!0,!1)),g("Collection Mint Button Clicked",{collectionId:e})},children:[r?"Claim":"Mint",t&&(0,s.jsx)(c.Icon,{as:x.FiExternalLink,pos:"absolute",right:"2.5",h:"3",w:"3"})]})},N=_;
