contract MetaJesus is ERC721, ERC721Enumerable, Pausable, Ownable {
    using Counters for Counters.Counter;

    Counters.Counter private _tokenIdCounter;
    uint256 public mintRate = 0.05 ether;
    uint256 public MAX_SUPPLY = 183;

    constructor() ERC721("Meta Jesus", "JESUS") {}

    function _baseURI() internal pure override returns (string memory) {
        return "https://inwiththeold.art/api/tmj/tokens/";
    }

    function pause() public onlyOwner {
        _pause();
    }

    function unpause() public onlyOwner {
        _unpause();
    }

    function safeMint(address to) public payable {
        require(totalSupply() < MAX_SUPPLY, "Tokens sold out! Buy on Opensea");
        require(msg.value >= mintRate, "Not enough Ether sent");
        _tokenIdCounter.increment();
        _safeMint(to, _tokenIdCounter.current());
        
    }

    function _beforeTokenTransfer(address from, address to, uint256 tokenId)
        internal
        whenNotPaused
        override(ERC721, ERC721Enumerable)
    {
        super._beforeTokenTransfer(from, to, tokenId);
    }
    
    function withdraw() public onlyOwner {
        require(address(this).balance > 0, "Address: insufficient balance");
        payable(owner()).transfer(address(this).balance);
        
    }
    // The following functions are overrides required by Solidity.

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721, ERC721Enumerable)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
    

}
function supportsInterface(bytes4 interfaceId)
    public
    view
    override(ERC721, ERC721Enumerable)
    returns (bool)
{
    return super.supportsInterface(interfaceId);
}

// The following functions are overrides required by Solidity.