contract Genesis is ERC721Enumerable, ReentrancyGuard, Ownable {
    
    string[] private vision = [
        "Live on chain. The majority will join.",
        "Prepare accordingly and contribute ",
        "to immutable history in the making.",
        "Here, we are primary source.",
        "Interact and push engagement on chain, ",
        "building composable culture and community ",
        "at the forefront.",
        "If the message is deserving,",
        "the bytes will never be too costly."
    ];
    
    function getVision(uint256 visionNum) public view returns (string memory) {
        string memory output = vision[visionNum];
        return output;
    }

    function tokenURI(uint256 tokenId) override public view returns (string memory) {
        string[19] memory parts;
        parts[0] = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 350 350"><style>.base { fill: white; font-family: serif; font-size: 14px; }</style><rect width="100%" height="100%" fill="black" /><text x="10" y="20" class="base">';

        parts[1] = getVision(0);

        parts[2] = '</text><text x="10" y="40" class="base">';

        parts[3] = getVision(1);

        parts[4] = '</text><text x="10" y="60" class="base">';

        parts[5] = getVision(2);

        parts[6] = '</text><text x="10" y="80" class="base">';

        parts[7] = getVision(3);

        parts[8] = '</text><text x="10" y="120" class="base">';

        parts[9] = getVision(4);

        parts[10] = '</text><text x="10" y="140" class="base">';

        parts[11] = getVision(5);

        parts[12] = '</text><text x="10" y="160" class="base">';

        parts[13] = getVision(6);

        parts[14] = '</text><text x="10" y="200" class="base">';

        parts[15] = getVision(7);
        
        parts[16] = '</text><text x="10" y="220" class="base">';

        parts[17] = getVision(8);

        parts[18] = '</text></svg>';

        string memory output = string(abi.encodePacked(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6], parts[7], parts[8]));
        output = string(abi.encodePacked(output, parts[9], parts[10], parts[11], parts[12], parts[13], parts[14], parts[15], parts[16]));
        output = string(abi.encodePacked(output, parts[17], parts[18]));
        
        string memory json = Base64.encode(bytes(string(abi.encodePacked('{"name": "Paradigm Genesis #', toString(tokenId), '", "description": "Paradigm Genesis represents the first form", "image": "data:image/svg+xml;base64,', Base64.encode(bytes(output)), '"}'))));
        output = string(abi.encodePacked('data:application/json;base64,', json));

        return output;
    }
    
    // Let's see who's out there, and if the real players come to the table ;)
    // Community: If any single meatspace consciousness mints more than one of these,
    // hold them accountable. Capitalism is encouraged. Gluttonous greed at the asymmetric expense 
    // of our cuture and community is unacceptable
    function paradigmGenesisClaim(uint256 tokenId) public nonReentrant {
        require(tokenId > 0 && tokenId < 11, "Token ID invalid");
        _safeMint(_msgSender(), tokenId);
    }
    
    function toString(uint256 value) internal pure returns (string memory) {
    // Inspired by OraclizeAPI's implementation - MIT license
    // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }
    
    constructor() ERC721("Genesis", "GEN") Ownable() {}
}
function paradigmGenesisClaim(uint256 tokenId) public nonReentrant {
    require(tokenId > 0 && tokenId < 11, "Token ID invalid");
    _safeMint(_msgSender(), tokenId);
}

// Let's see who's out there, and if the real players come to the table ;)
// Community: If any single meatspace consciousness mints more than one of these,
// hold them accountable. Capitalism is encouraged. Gluttonous greed at the asymmetric expense 
// of our cuture and community is unacceptable