'use strict';
var React = require('react');

var Util = require('./util');
var Layout = require('./layout');
var Depot = require('./depot');

var Carousel = React.createClass({displayName: "Carousel",
    getInitialState: function () {
        return {
            cards: this.props.cards,
            figures: Layout[this.props.layout].figures(this.props.width, this.props.cards, 0),
            rotationY: 0
        };
    },
    componentWillMount: function () {
        this.depot = Depot(this.getInitialState(), this.props, this.setState.bind(this));
        this.onRotate = this.depot.onRotate.bind(this);
    },
    componentWillReceiveProps: function (nextProps) {
        this.depot.onNextProps(nextProps);
    },
    render: function () {
        var angle = (2 * Math.PI) / this.state.figures.length;
        var translateZ = -Layout[this.props.layout].distance(this.props.width,
            this.state.figures.length);
        var figures = this.state.figures.map(function (d, i) {
            return (React.createElement("figure", {key: i, style: Util.figureStyle(d)}, 
               React.createElement("div", {className: "ui card"}, 
                 React.createElement("div", {className: "image"}, 
                   React.createElement("img", {src: d.card.hash.image_url})
                 ), 
                 React.createElement("div", {className: "content"}, 
                   React.createElement("a", {className: "header", href: d.card.hash.url, target: "_new"}, d.card.hash.name)
                 ), 
                 React.createElement("div", {className: "extra content"}, 
                   React.createElement("span", null, 
                    React.createElement("i", {className: "red star icon"}), d.card.hash.rating
                   ), 
                   React.createElement("span", {className: "card-category"}, d.card.hash.categories[0][0]), 
                   React.createElement("span", {className: "right floated"}, 
                     React.createElement("a", {href: "https://maps.google.com/maps?q="+d.card.hash.location.display_address[0] + " " + d.card.hash.location.display_address[1], target: "_blank"}, React.createElement("i", {className: "red map icon"}), d.card.hash.location.display_address[0])
                   )
                 )
               )
               ));
        });
        return (
          React.createElement("div", null, 
            React.createElement("section", {className: "react-3d-carousel"}, 
            React.createElement("div", {className: "carousel", 
            style: {transform: "translateZ("+translateZ+"px)"}}, 
            figures
            ), 
            React.createElement("div", {className: "prev", onClick: Util.partial(this.onRotate,+angle)}), 
            React.createElement("div", {className: "next", onClick: Util.partial(this.onRotate,-angle)})
            ), 
            React.createElement("div", {className: "spin-button"}, 
              React.createElement("button", {className: "massive ui red button", onClick: Util.partial(this.onRotate,-((Math.floor(Math.random() * (39 - 19 + 1)) + 19)*angle))}, 
                React.createElement("i", {className: "refresh icon spinning-button"})
              )
            )
          )
        );
    }
});
module.exports = Carousel;

@@ -2100,32 +2100,24 @@
 sh.location.
-display_
 address%5B0%5D +
@@ -2148,26 +2148,12 @@
 ion.
-display_address%5B1%5D
+city
 , ta

change google maps address to be more specific