 #   }
 # ]
 #
-#Format of opts.referralProgram
+# Format of opts.referralProgram
 # Referral Program Object
 
 Shop.riot = riot
-
 Shop.analytics = analytics
 
 Shop.isEmpty = ->
   items = @data.get 'order.items'
-  return items.length == 0
+  items.length == 0
 
 getQueries = ()->
   search = /([^&=]+)=?([^&]*)/g

    @data.set 'order.shippingAddress', checkoutShippingAddress
    store.remove 'checkout-shippingAddress'

  @client = new window.Crowdstart.Api
    key:      opts.key
    endpoint: opts.endpoint


import './utils/patches'

import Promise from 'broken'
import extend  from 'extend'
import refer   from 'referential'
import riot    from 'riot'
import {Api}   from 'hanzo.js'
import {Cart}  from 'commerce.js'

import Events    from './events'
import analytics from './utils/analytics'
import m         from './mediator'
import store     from './utils/store'

import Shop      from './shop'
import Forms     from './forms'
import Widgets        from './widgets'
import Controls       from './controls'

# Monkey Patch common utils onto every View/Instance
import crowdcontrol from 'crowdcontrol'
import {renderUICurrencyFromJSON} from './utils/currency'
import {renderDate} from './utils/dates'
crowdcontrol.Views.View::renderCurrency = renderUICurrencyFromJSON
crowdcontrol.Views.View::renderDate = require('./utils/dates')
crowdcontrol.Views.View::isEmpty = ->
  Shop.isEmpty()

Shop.use = (templates) ->
  Shop.Controls.Control::errorHtml = templates.Controls.Error if templates?.Controls?.Error
