 Promise = require 'bluebird-q'
-{ invoke, pick } = require 'underscore'
+{ stringify } = require 'qs'
+{ invoke, pick, last } = require 'underscore'
 { View, Model } = require 'backbone'
 { isPhoneLike } = require '../../../../../components/util/device.coffee'
 analyticsHooks = require '../../../../../lib/analytics_hooks.coffee'


      .then =>
        @confirm() unless isPhoneLike()
        @redirectTo '/collect?source=professional-buyer'

      .catch (err) ->
        form.error err
        analyticsHooks.trigger 'pro_buyer:complete:error',
          error_messages: [form.errors.parse err]

  confirm: ->
    confirmation.register

      ignore:
        label: 'Maybe later, start browsing'

  redirectTo: (path, options = {}) ->
    location.assign "#{path}?#{stringify options}"

  postRender: ->
    city = @user.related().location.toString()
