package assets

import (
	"bytes"
	"compress/gzip"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"time"
)

func bindataRead(data []byte, name string) ([]byte, error) {
	gz, err := gzip.NewReader(bytes.NewBuffer(data))
	if err != nil {
		return nil, fmt.Errorf("Read %q: %v", name, err)
	}

	var buf bytes.Buffer
	_, err = io.Copy(&buf, gz)
	clErr := gz.Close()

	if err != nil {
		return nil, fmt.Errorf("Read %q: %v", name, err)
	}
	if clErr != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

type asset struct {
	bytes []byte
	info  os.FileInfo
}

type bindataFileInfo struct {
	name    string
	size    int64
	mode    os.FileMode
	modTime time.Time
}

func (fi bindataFileInfo) Name() string {
	return fi.name
}
func (fi bindataFileInfo) Size() int64 {
	return fi.size
}
func (fi bindataFileInfo) Mode() os.FileMode {
	return fi.mode
}
func (fi bindataFileInfo) ModTime() time.Time {
	return fi.modTime
}
func (fi bindataFileInfo) IsDir() bool {
	return false
}
func (fi bindataFileInfo) Sys() interface{} {
	return nil
}

var _publicAssetsApplicationCss = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x4a\xca\x4f\xa9\x54\xa8\xe6\x52\x50\x48\xcb\xcf\x2b\xd1\x4d\x4b\xcc\xcd\xcc\xa9\xb4\x52\x70\x2c\xca\x4c\xcc\xd1\x51\xf0\x48\xcd\x29\x4b\x2d\xc9\x4c\x4e\xd4\x51\x28\x4e\xcc\x2b\xd6\x2d\x4e\x2d\xca\x4c\xb3\x56\xa8\xe5\x02\x04\x00\x00\xff\xff\x9d\x07\x15\x35\x36\x00\x00\x00")

func publicAssetsApplicationCssBytes() ([]byte, error) {
	return bindataRead(
		_publicAssetsApplicationCss,
		"public/assets/application.css",
	)
}

func publicAssetsApplicationCss() (*asset, error) {
	bytes, err := publicAssetsApplicationCssBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "public/assets/application.css", size: 54, mode: os.FileMode(420), modTime: time.Unix(1540427164, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _publicAssetsApplicationJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x56\x41\x6f\xb3\x46\x10\x3d\xc3\xaf\x98\xcf\x87\x18\x22\xdb\x24\x57\x23\xab\x52\xdb\x54\xad\xd4\x2a\x55\x55\xa9\x87\x28\x42\x6b\x18\xcc\x36\xcb\x2e\x5d\x86\x38\x96\xe5\xff\x5e\x61\x16\xbc\x18\x88\x23\x7d\xbe\x58\xda\xd9\x79\xf3\x66\xe6\xcd\xb0\xc1\xfd\xf9\x17\x80\x97\x56\x32\x26\xae\xa4\x97\xab\xa4\x12\x58\xfa\x70\x84\x20\x80\x3d\x6e\x0b\x16\xbf\xfd\xa8\x14\x95\xa4\x59\xe1\x76\x1e\x4e\x10\xc0\xdf\x19\x42\x73\x1f\x62\x16\x67\x68\x59\xdf\x99\x06\x2e\x4b\x62\x42\x60\xf2\x47\x83\x09\x1b\x38\x9e\xc2\xee\xd2\x10\x4b\xe3\x7f\x15\xd7\x08\x2d\x19\xeb\x46\x7b\x04\x51\x64\x38\x45\xe6\x76\x14\x19\xce\xbf\x25\x3e\x1c\xc7\xd0\x6b\xf8\x9f\x32\x8c\xdf\x80\xa7\x2d\x5f\x5e\x02\x97\x03\xd6\x0e\x4f\xbd\x6b\xd6\x2f\x2d\xfa\xab\x0d\x0f\x8e\xe3\x68\xa4\x4a\xcb\x41\x9a\x17\x87\x15\x7e\x14\x4a\x53\x19\xda\x6e\xa7\x6b\x66\x1a\x19\x21\x30\x90\xb8\x6f\xd9\x79\x4c\x26\x50\x54\x04\x9c\x80\x4b\x52\x40\x99\x29\xb1\x6f\x7b\xd7\x45\x36\x1e\x9b\x4f\x68\xd4\x75\xef\x11\xe7\x6b\x68\x8d\x8b\x9e\x41\xac\x21\x65\xa2\xc4\xfe\xa9\xc9\x62\x0d\xc7\x1e\xf7\xf1\x56\xd6\x29\x3d\x7d\x60\x5c\x11\x9e\x59\x1b\x7e\x23\x2d\x75\xf2\x41\xbd\x62\x26\x84\xe9\x66\x5b\xbb\x85\x41\x68\xff\x2f\xe7\x23\x4a\xf0\x27\x29\xfd\x22\xd8\xce\xe6\xc3\x4a\x10\x8a\x25\x98\x0c\x09\xad\x04\x6c\x80\x74\x85\x93\x60\x7f\x35\x8d\xaf\xe1\x0c\x1b\x50\xa9\x85\x6e\x5f\x37\x22\xe9\x93\xb7\x05\x71\x1a\x46\xe9\x4f\x46\xed\x53\xda\xc5\x2c\x41\x6d\xff\xc5\x98\xc0\xbb\x94\xc0\x58\xa2\xc8\x16\xc8\x48\x85\x56\x39\x6c\x5a\x98\xa9\x51\x1c\x04\x1c\xcc\xc9\x18\x70\x3c\xa2\xc1\xa9\x08\x09\xa6\x5c\x22\xec\x90\x08\x75\xa7\x0d\x48\x95\x86\x8c\xe9\x5c\xc9\x43\x5b\xd8\x1b\x41\x13\xd8\x74\xee\x5e\xa7\x0c\xc9\x72\x5c\x18\xf4\xab\xa1\xe5\xa9\xf7\x6d\x0c\x48\xf5\xbd\xfd\xeb\x59\x7f\x3e\x57\x7c\xd5\x10\xff\x53\xab\x02\x35\x1d\xae\x23\xf6\x5d\x9c\x58\xc9\x94\xef\x2a\xcd\xb6\x02\x47\x07\xcb\x41\x59\xe5\x68\xec\xb5\xe2\xae\xcc\x3b\xa4\xb5\x49\xa3\x67\x38\xf9\x93\x1b\x65\x72\xbf\xee\x90\x7e\xc6\x94\x55\x82\x9e\xce\xa4\xfb\x55\x8f\x55\x5e\x30\xe2\x5b\x2e\x38\x1d\x60\xcf\x29\x03\xa9\xe4\xb2\x6d\x86\x11\xcc\x8d\x66\x48\xbb\x19\x8d\xcb\x55\x19\xeb\x85\x65\x9a\xde\xaa\x10\xee\xee\xda\xe1\x88\x22\x2c\x1b\xe1\xc0\x0f\xbd\x7c\x3b\xaa\x97\x24\xbc\xfa\x03\xd5\x9b\xad\x97\x79\xd2\x98\xe6\xaf\x21\x9c\x60\x3d\x89\xd0\x84\x68\xaa\x50\x0e\x71\x42\x38\xf5\xaa\x3b\x2a\x3b\xaf\xc9\x62\x01\x73\x36\xef\x94\x16\x8e\xcc\x7d\x63\x0a\xbf\xd2\x21\x23\xb1\x42\x2b\x52\x74\x28\x70\x95\xb1\xf2\x79\x2f\x5b\xb1\x9d\x97\xe3\x8d\x0e\x28\xbb\x03\xcd\x92\x58\x40\x61\x00\xac\x4c\xbf\x12\x6a\xe8\xdf\xab\x4c\x9f\xfb\x85\x4c\x51\x6d\x05\x8f\xa3\x82\x51\x16\x45\x37\xe8\x16\xb0\x81\xd9\x6c\x0a\xf3\x77\xc5\x12\x40\x49\xfa\xd0\x2d\x6d\x99\xb4\x19\x0c\xd7\x83\x31\x8c\xbd\x0f\xc6\x62\xd7\xaf\x91\x07\xbb\x65\xa7\x6e\x73\x7e\xff\xcf\xca\xc4\x7b\x71\x83\x7b\x78\x00\x73\x36\x7c\x6a\x2d\xe0\xd3\x2f\x1a\x1c\x5d\x77\x56\x95\x08\x25\x69\x1e\xd3\x2c\x74\x5d\x77\x2c\xc7\x47\x3f\x74\xdd\x58\xc9\x52\xd5\x5f\x30\xb5\xf3\x66\xbf\xa2\x10\x6a\x01\xff\x28\x2d\x92\x6f\xb3\xda\x1c\x98\x44\xeb\x35\x03\x8f\x5f\xa0\x74\x8e\x1e\x04\xa0\x31\x57\xef\x98\xc0\xb6\xde\xcb\xa4\x59\x4c\x4b\xc2\x0f\x5a\x1a\x1a\xcb\x42\x54\x3b\x2e\x2f\x01\x2e\xe9\xbf\xfa\xe1\xff\x01\x00\x00\xff\xff\x0f\x93\x12\x07\x65\x0a\x00\x00")

func publicAssetsApplicationJsBytes() ([]byte, error) {
	return bindataRead(
		_publicAssetsApplicationJs,
		"public/assets/application.js",
	)
}

func publicAssetsApplicationJs() (*asset, error) {
	bytes, err := publicAssetsApplicationJsBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "public/assets/application.js", size: 2661, mode: os.FileMode(420), modTime: time.Unix(1540427164, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

func Asset(name string) ([]byte, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
		}
		return a.bytes, nil
	}
	return nil, fmt.Errorf("Asset %s not found", name)
}

func MustAsset(name string) []byte {
	a, err := Asset(name)
	if err != nil {
		panic("asset: Asset(" + name + "): " + err.Error())
	}

	return a
}

func AssetInfo(name string) (os.FileInfo, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
		}
		return a.info, nil
	}
	return nil, fmt.Errorf("AssetInfo %s not found", name)
}

func AssetNames() []string {
	names := make([]string, 0, len(_bindata))
	for name := range _bindata {
		names = append(names, name)
	}
	return names
}

var _bindata = map[string]func() (*asset, error){
	"public/assets/application.css": publicAssetsApplicationCss,
	"public/assets/application.js": publicAssetsApplicationJs,
}

func AssetDir(name string) ([]string, error) {
	node := _bintree
	if len(name) != 0 {
		cannonicalName := strings.Replace(name, "\\", "/", -1)
		pathList := strings.Split(cannonicalName, "/")
		for _, p := range pathList {
			node = node.Children[p]
			if node == nil {
				return nil, fmt.Errorf("Asset %s not found", name)
			}
		}
	}
	if node.Func != nil {
		return nil, fmt.Errorf("Asset %s not found", name)
	}
	rv := make([]string, 0, len(node.Children))
	for childName := range node.Children {
		rv = append(rv, childName)
	}
	return rv, nil
}

type bintree struct {
	Func     func() (*asset, error)
	Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
	"public": &bintree{nil, map[string]*bintree{
		"assets": &bintree{nil, map[string]*bintree{
			"application.css": &bintree{publicAssetsApplicationCss, map[string]*bintree{}},
			"application.js": &bintree{publicAssetsApplicationJs, map[string]*bintree{}},
		}},
	}},
}}

func RestoreAsset(dir, name string) error {
	data, err := Asset(name)
	if err != nil {
		return err
	}
	info, err := AssetInfo(name)
	if err != nil {
		return err
	}
	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
	if err != nil {
		return err
	}
	err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
	if err != nil {
		return err
	}
	err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
	if err != nil {
		return err
	}
	return nil
}

func RestoreAssets(dir, name string) error {
	children, err := AssetDir(name)

	if err != nil {
		return RestoreAsset(dir, name)
	}

	for _, child := range children {
		err = RestoreAssets(dir, filepath.Join(name, child))
		if err != nil {
			return err
		}
	}
	return nil
}

func _filePath(dir, name string) string {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}
// Code generated by go-bindata. DO NOT EDIT. @generated
// sources:
// public/assets/application.css
// public/assets/application.js
package assets

import (
	"bytes"
	"compress/gzip"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"time"
)

func bindataRead(data []byte, name string) ([]byte, error) {
	gz, err := gzip.NewReader(bytes.NewBuffer(data))
	if err != nil {
		return nil, fmt.Errorf("Read %q: %v", name, err)
	}

	var buf bytes.Buffer
	_, err = io.Copy(&buf, gz)
	clErr := gz.Close()

	if err != nil {
		return nil, fmt.Errorf("Read %q: %v", name, err)
	}
	if clErr != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

type asset struct {
	bytes []byte
	info  os.FileInfo
}

type bindataFileInfo struct {
	name    string
	size    int64
	mode    os.FileMode
	modTime time.Time
}

func (fi bindataFileInfo) Name() string {
	return fi.name
}
func (fi bindataFileInfo) Size() int64 {
	return fi.size
}
func (fi bindataFileInfo) Mode() os.FileMode {
	return fi.mode
}
func (fi bindataFileInfo) ModTime() time.Time {
	return fi.modTime
}
func (fi bindataFileInfo) IsDir() bool {
	return false
}
func (fi bindataFileInfo) Sys() interface{} {
	return nil
}

var _publicAssetsApplicationCss = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x4a\xca\x4f\xa9\x54\xa8\xe6\x52\x50\x48\xcb\xcf\x2b\xd1\x4d\x4b\xcc\xcd\xcc\xa9\xb4\x52\x70\x2c\xca\x4c\xcc\xd1\x51\xf0\x48\xcd\x29\x4b\x2d\xc9\x4c\x4e\xd4\x51\x28\x4e\xcc\x2b\xd6\x2d\x4e\x2d\xca\x4c\xb3\x56\xa8\xe5\x02\x04\x00\x00\xff\xff\x9d\x07\x15\x35\x36\x00\x00\x00")

func publicAssetsApplicationCssBytes() ([]byte, error) {
	return bindataRead(
		_publicAssetsApplicationCss,
		"public/assets/application.css",
	)
}

func publicAssetsApplicationCss() (*asset, error) {
	bytes, err := publicAssetsApplicationCssBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "public/assets/application.css", size: 54, mode: os.FileMode(420), modTime: time.Unix(1540427164, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

var _publicAssetsApplicationJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x56\x41\x6f\xb3\x46\x10\x3d\xc3\xaf\x98\xcf\x87\x18\x22\xdb\x24\x57\x23\xab\x52\xdb\x54\xad\xd4\x2a\x55\x55\xa9\x87\x28\x42\x6b\x18\xcc\x36\xcb\x2e\x5d\x86\x38\x96\xe5\xff\x5e\x61\x16\xbc\x18\x88\x23\x7d\xbe\x58\xda\xd9\x79\xf3\x66\xe6\xcd\xb0\xc1\xfd\xf9\x17\x80\x97\x56\x32\x26\xae\xa4\x97\xab\xa4\x12\x58\xfa\x70\x84\x20\x80\x3d\x6e\x0b\x16\xbf\xfd\xa8\x14\x95\xa4\x59\xe1\x76\x1e\x4e\x10\xc0\xdf\x19\x42\x73\x1f\x62\x16\x67\x68\x59\xdf\x99\x06\x2e\x4b\x62\x42\x60\xf2\x47\x83\x09\x1b\x38\x9e\xc2\xee\xd2\x10\x4b\xe3\x7f\x15\xd7\x08\x2d\x19\xeb\x46\x7b\x04\x51\x64\x38\x45\xe6\x76\x14\x19\xce\xbf\x25\x3e\x1c\xc7\xd0\x6b\xf8\x9f\x32\x8c\xdf\x80\xa7\x2d\x5f\x5e\x02\x97\x03\xd6\x0e\x4f\xbd\x6b\xd6\x2f\x2d\xfa\xab\x0d\x0f\x8e\xe3\x68\xa4\x4a\xcb\x41\x9a\x17\x87\x15\x7e\x14\x4a\x53\x19\xda\x6e\xa7\x6b\x66\x1a\x19\x21\x30\x90\xb8\x6f\xd9\x79\x4c\x26\x50\x54\x04\x9c\x80\x4b\x52\x40\x99\x29\xb1\x6f\x7b\xd7\x45\x36\x1e\x9b\x4f\x68\xd4\x75\xef\x11\xe7\x6b\x68\x8d\x8b\x9e\x41\xac\x21\x65\xa2\xc4\xfe\xa9\xc9\x62\x0d\xc7\x1e\xf7\xf1\x56\xd6\x29\x3d\x7d\x60\x5c\x11\x9e\x59\x1b\x7e\x23\x2d\x75\xf2\x41\xbd\x62\x26\x84\xe9\x66\x5b\xbb\x85\x41\x68\xff\x2f\xe7\x23\x4a\xf0\x27\x29\xfd\x22\xd8\xce\xe6\xc3\x4a\x10\x8a\x25\x98\x0c\x09\xad\x04\x6c\x80\x74\x85\x93\x60\x7f\x35\x8d\xaf\xe1\x0c\x1b\x50\xa9\x85\x6e\x5f\x37\x22\xe9\x93\xb7\x05\x71\x1a\x46\xe9\x4f\x46\xed\x53\xda\xc5\x2c\x41\x6d\xff\xc5\x98\xc0\xbb\x94\xc0\x58\xa2\xc8\x16\xc8\x48\x85\x56\x39\x6c\x5a\x98\xa9\x51\x1c\x04\x1c\xcc\xc9\x18\x70\x3c\xa2\xc1\xa9\x08\x09\xa6\x5c\x22\xec\x90\x08\x75\xa7\x0d\x48\x95\x86\x8c\xe9\x5c\xc9\x43\x5b\xd8\x1b\x41\x13\xd8\x74\xee\x5e\xa7\x0c\xc9\x72\x5c\x18\xf4\xab\xa1\xe5\xa9\xf7\x6d\x0c\x48\xf5\xbd\xfd\xeb\x59\x7f\x3e\x57\x7c\xd5\x10\xff\x53\xab\x02\x35\x1d\xae\x23\xf6\x5d\x9c\x58\xc9\x94\xef\x2a\xcd\xb6\x02\x47\x07\xcb\x41\x59\xe5\x68\xec\xb5\xe2\xae\xcc\x3b\xa4\xb5\x49\xa3\x67\x38\xf9\x93\x1b\x65\x72\xbf\xee\x90\x7e\xc6\x94\x55\x82\x9e\xce\xa4\xfb\x55\x8f\x55\x5e\x30\xe2\x5b\x2e\x38\x1d\x60\xcf\x29\x03\xa9\xe4\xb2\x6d\x86\x11\xcc\x8d\x66\x48\xbb\x19\x8d\xcb\x55\x19\xeb\x85\x65\x9a\xde\xaa\x10\xee\xee\xda\xe1\x88\x22\x2c\x1b\xe1\xc0\x0f\xbd\x7c\x3b\xaa\x97\x24\xbc\xfa\x03\xd5\x9b\xad\x97\x79\xd2\x98\xe6\xaf\x21\x9c\x60\x3d\x89\xd0\x84\x68\xaa\x50\x0e\x71\x42\x38\xf5\xaa\x3b\x2a\x3b\xaf\xc9\x62\x01\x73\x36\xef\x94\x16\x8e\xcc\x7d\x63\x0a\xbf\xd2\x21\x23\xb1\x42\x2b\x52\x74\x28\x70\x95\xb1\xf2\x79\x2f\x5b\xb1\x9d\x97\xe3\x8d\x0e\x28\xbb\x03\xcd\x92\x58\x40\x61\x00\xac\x4c\xbf\x12\x6a\xe8\xdf\xab\x4c\x9f\xfb\x85\x4c\x51\x6d\x05\x8f\xa3\x82\x51\x16\x45\x37\xe8\x16\xb0\x81\xd9\x6c\x0a\xf3\x77\xc5\x12\x40\x49\xfa\xd0\x2d\x6d\x99\xb4\x19\x0c\xd7\x83\x31\x8c\xbd\x0f\xc6\x62\xd7\xaf\x91\x07\xbb\x65\xa7\x6e\x73\x7e\xff\xcf\xca\xc4\x7b\x71\x83\x7b\x78\x00\x73\x36\x7c\x6a\x2d\xe0\xd3\x2f\x1a\x1c\x5d\x77\x56\x95\x08\x25\x69\x1e\xd3\x2c\x74\x5d\x77\x2c\xc7\x47\x3f\x74\xdd\x58\xc9\x52\xd5\x5f\x30\xb5\xf3\x66\xbf\xa2\x10\x6a\x01\xff\x28\x2d\x92\x6f\xb3\xda\x1c\x98\x44\xeb\x35\x03\x8f\x5f\xa0\x74\x8e\x1e\x04\xa0\x31\x57\xef\x98\xc0\xb6\xde\xcb\xa4\x59\x4c\x4b\xc2\x0f\x5a\x1a\x1a\xcb\x42\x54\x3b\x2e\x2f\x01\x2e\xe9\xbf\xfa\xe1\xff\x01\x00\x00\xff\xff\x0f\x93\x12\x07\x65\x0a\x00\x00")

func publicAssetsApplicationJsBytes() ([]byte, error) {
	return bindataRead(
		_publicAssetsApplicationJs,
		"public/assets/application.js",
	)
}

func publicAssetsApplicationJs() (*asset, error) {
	bytes, err := publicAssetsApplicationJsBytes()
	if err != nil {
		return nil, err
	}

	info := bindataFileInfo{name: "public/assets/application.js", size: 2661, mode: os.FileMode(420), modTime: time.Unix(1540427164, 0)}
	a := &asset{bytes: bytes, info: info}
	return a, nil
}

// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
		}
		return a.bytes, nil
	}
	return nil, fmt.Errorf("Asset %s not found", name)
}

// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
	a, err := Asset(name)
	if err != nil {
		panic("asset: Asset(" + name + "): " + err.Error())
	}

	return a
}

// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	if f, ok := _bindata[cannonicalName]; ok {
		a, err := f()
		if err != nil {
			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
		}
		return a.info, nil
	}
	return nil, fmt.Errorf("AssetInfo %s not found", name)
}

// AssetNames returns the names of the assets.
func AssetNames() []string {
	names := make([]string, 0, len(_bindata))
	for name := range _bindata {
		names = append(names, name)
	}
	return names
}

// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
	"public/assets/application.css": publicAssetsApplicationCss,
	"public/assets/application.js": publicAssetsApplicationJs,
}

// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
//     data/
//       foo.txt
//       img/
//         a.png
//         b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
	node := _bintree
	if len(name) != 0 {
		cannonicalName := strings.Replace(name, "\\", "/", -1)
		pathList := strings.Split(cannonicalName, "/")
		for _, p := range pathList {
			node = node.Children[p]
			if node == nil {
				return nil, fmt.Errorf("Asset %s not found", name)
			}
		}
	}
	if node.Func != nil {
		return nil, fmt.Errorf("Asset %s not found", name)
	}
	rv := make([]string, 0, len(node.Children))
	for childName := range node.Children {
		rv = append(rv, childName)
	}
	return rv, nil
}

type bintree struct {
	Func     func() (*asset, error)
	Children map[string]*bintree
}
var _bintree = &bintree{nil, map[string]*bintree{
	"public": &bintree{nil, map[string]*bintree{
		"assets": &bintree{nil, map[string]*bintree{
			"application.css": &bintree{publicAssetsApplicationCss, map[string]*bintree{}},
			"application.js": &bintree{publicAssetsApplicationJs, map[string]*bintree{}},
		}},
	}},
}}

// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
	data, err := Asset(name)
	if err != nil {
		return err
	}
	info, err := AssetInfo(name)
	if err != nil {
		return err
	}
	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
	if err != nil {
		return err
	}
	err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
	if err != nil {
		return err
	}
	err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
	if err != nil {
		return err
	}
	return nil
}

// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
	children, err := AssetDir(name)
	// File
	if err != nil {
		return RestoreAsset(dir, name)
	}
	// Dir
	for _, child := range children {
		err = RestoreAssets(dir, filepath.Join(name, child))
		if err != nil {
			return err
		}
	}
	return nil
}

func _filePath(dir, name string) string {
	cannonicalName := strings.Replace(name, "\\", "/", -1)
	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}

