/* jshint node: true */
'use strict';

module.exports = {
  name: 'ember-hammertime',

  included: function (app) {
    this._super.included.apply(this, arguments);

    // see: https://github.com/ember-cli/ember-cli/issues/3718
    if (typeof app.import !== 'function' && app.app) {
      app = app.app;
    }

    if (!process.env.EMBER_CLI_FASTBOOT) {
      app.import(app.bowerDirectory + '/hammer-time/hammer-time.js');
    }
  },

  isDevelopingAddon: function() {
    return false;
  },

  setupPreprocessorRegistry: function(type, registry) {
    var TouchAction = require('./htmlbars-plugins/touch-action');

    registry.add('htmlbars-ast-plugin', {
      name: "touch-action",
      plugin: TouchAction
    });

  }

};

@@ -226,18 +226,21 @@
 718%0A    
-if
+while
  (typeof
@@ -308,16 +308,236 @@
 %0A    %7D%0A%0A
+    if (typeof app.import !== 'function') %7B%0A      throw new Error('Ember-Hammertime is being used within another addon or engine ' +%0A        'and is having trouble registering itself to the parent application.');%0A    %7D%0A%0A
     if (

fix nested addon / engine support