abstract contract PostDeliveryCrowdsale is TimedCrowdsale {
    using SafeMath for uint256;

    IERC20 private _tokenSale;
    mapping(address => bool) public withdrawableTokens;

    constructor(IERC20 _token) public {
        _tokenSale = _token;
    }

    /**
     * @dev Withdraw tokens only after crowdsale ends.
     */
    function withdrawTokens() public withdrawable {
        require(!withdrawableTokens[_msgSender()]);
        uint256 amount = _balances[_msgSender()];
        require(
            amount > 0,
            "PostDeliveryCrowdsale: beneficiary is not due any tokens"
        );

        _deliverTokens(_msgSender(), amount);
        withdrawableTokens[_msgSender()] = true;
    }

    function depositTokenSale() public onlyOwner {
        _tokenSale.transferFrom(_msgSender(), address(this), _capTokenSale);
        isDepositedTokenSale = true;
    }

    /**
     * @return the balance of an account.
     */
    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }
}
/**
 * @title PostDeliveryCrowdsale
 * @dev Crowdsale that locks tokens from withdrawal until it ends.
 */
function balanceOf(address account) public view returns (uint256) {
    return _balances[account];
}

/**
 * @return the balance of an account.
 */