text: /*global angular:true */
  
  angular.module('uxTools.prototyping', [])
  
  .controller('prototypingCtrl', function($scope, $state, prototypingFactory) {
  
    $scope.prototypingTools = prototypingFactory.tools();
    $scope.filters = prototypingFactory.filters();
    // Copy filters so ngModel doesn't reflect while changing
    $scope.tempFilters = angular.copy($scope.filters);
  
    $scope.modalShowing = false;
    //$scope.showMonthly = true; for pricing
  
    $scope.showFiltersModal = function(command) {
      if (command === 'show') {
        $scope.modalShowing = true;
      } else if (command === 'hide') {
        $scope.modalShowing = false;
      }
    };
  
    $scope.isFilterVisible = function(string) {
      for ( var i = 0; i < $scope.filters.length; i++ ) {
        if ( $scope.filters[i].title === string ) {
          return $scope.filters[i].show;
        }
      }
    };
  
    $scope.setFilters = function() {
      prototypingFactory.setFilters($scope.tempFilters);
      $state.reload();
      $scope.showFiltersModal = false;
    };
  
  })
  
  .factory('prototypingFactory', function() {
  
      var tools = [{
          "name": "Framer",
          "url": "http://framerjs.com/",
          "image": {
              "background-position": "-200 -400",
          },
          "taylorChoice": true,
          "platforms": {
              "mac": true
          },
          "import": {
              "photoshop": true,
              "sketch": true,
              "figma": true,
          },
          "micro": true,
          "navigation": true,
          "transition": true,
          "data": true,
          "code": true,
          "sharing": {
              "web": true,
              "iOS": true
          },
          "pricing": {
              "free": false,
              "subscription": "",
              "purchase": "$129"
          }
      }, {
          "name": "Principle",
          "url": "http://principleformac.com/",
          "image": {
              "background-position": "0 -400",
          },
          "platforms": {
              "mac": true
          },
          "import": {
              "sketch": true
          },
          "micro": true,
          "navigation": false,
          "transition": false,
          "sharing": {
              "iOS": true,
              "mac": true
          },
          "pricing": {
              "free": false,
              "subscription": "",
              "purchase": "$99"
          }
      }, {
          "name": "UX Pin",
          "url": "https://uxpin.com/",
          "image": {
              "background-position": "0 -100",
          },
          "platforms": {
              "web": true
          },
          "design": true,
          "import": {
              "sketch": true,
              "photoshop": true
          },
          "micro": true,
          "navigation": true,
          "sharing": {
              "web": true,
          },
          "handoff": true,
          "pricing": {
              "free": false,
              "subscription": "$19+",
              "purchase": ""
          }
      }, {
          "name": "InVision",
          "url": "https://www.invisionapp.com/",
          "image": {
              "background-position": "-300 -400",
          },
          "platforms": {
              "web": true
          },
          "import": {
              "sketch": true,
              "photoshop": true,
              "dropbox": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true,
              "pdf": true,
              "html": true
          },
          "fixedHeader": true,
          "handoff": true,
          "pricing": {
              "free": true,
              "subscription": "$15+",
              "purchase": ""
          }
      }, {
          "name": "Marvel",
          "url": "https://marvelapp.com/",
          "image": {
              "background-position": "-200 -300",
          },
          "platforms": {
              "web": true,
              "iOS": true,
              "android": true
          },
          "design": true,
          "import": {
              "sketch": true,
              "dropbox": true,
              "camera": true,
              "googleDrive": true,
              "box": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true,
              "iOS": true,
              "android": true,
              "appleWatch": true,
              "appleTv": true,
              "html": true,
              "pdf": true
          },
          "pricing": {
              "free": true,
              "subscription": "$12+",
              "purchase": ""
          }
      }, {
          "name": "Flinto",
          "url": "https://www.flinto.com/mac",
          "image": {
              "background-position": "-100 -300",
          },
          "platforms": {
              "web": true,
              "mac": true
          },
          "micro": true,
          "design": true,
          "import": {
              "sketch": true,
              "dropbox": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "iOS": true
          },
          "fixedHeader": true,
          "pricing": {
              "free": false,
              "subscription": "",
              "purchase": "$99"
          }
      }, {
          "name": "Flinto Lite",
          "url": "https://www.flinto.com/lite",
          "image": {
              "background-position": "-400 -400",
          },
          "platforms": {
              "web": true,
          },
          "import": {
              "dropbox": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "iOS": true,
              "android": true
          },
          "fixedHeader": true,
          "pricing": {
              "free": false,
              "subscription": "$20+",
              "purchase": ""
          }
      }, {
          "name": "Axure",
          "url": "http://www.axure.com/",
          "image": {
              "background-position": "-300 0",
          },
          "platforms": {
              "mac": true,
              "windows": true
          },
          "design": true,
          "micro": true,
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true
          },
          "pricing": {
              "free": false,
              "subscription": "$29+",
              "purchase": "$495"
          }
      }, {
          "name": "Balsamiq",
          "url": "https://balsamiq.com/",
          "image": {
              "background-position": "-500 -400",
          },
          "design": true,
          "platforms": {
              "web": true
          },
          "navigation": true,
          "sharing": {
              "web": true,
              "pdf": true
          },
          "pricing": {
              "free": false,
              "subscription": "$12+",
              "purchase": "$89"
          }
      }, {
          "name": "Lucidchart",
          "url": "https://lucidchart.com/",
          "image": {
              "background-position": "0 -500",
          },
          "design": true,
          "platforms": {
              "web": true
          },
          "navigation": true,
          "sharing": {
              "web": true
          },
          "pricing": {
              "free": true,
              "subscription": "$5+",
              "purchase": ""
          }
      }, {
          "name": "Adobe XD",
          "url": "http://www.adobe.com/products/experience-design",
          "image": {
              "background-position": "0 0",
          },
          "design": true,
          "platforms": {
              "mac": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true
          },
          "pricing": {
              "free": false,
              "subscription": "$19+",
              "purchase": ""
          }
      }, {
          "name": "Craft",
          "url": "https://www.invisionapp.com/craft",
          "image": {
              "background-position": "-500 -300",
          },
          "platforms": {
              "mac": true
          },
          "import": {
              "sketch": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "iOS": true
          },
          "pricing": {
              "free": true,
              "subscription": "",
              "purchase": ""
          }
      }, {
          "name": "Origami Studio",
          "url": "https://facebook.github.io/origami/",
          "image": {
              "background-position": "-300 -300",
          },
          "platforms": {
              "mac": true,
          },
          "import": {
              "sketch": true,
          },
          "micro": true,
          "data": true,
          "sharing": {
              "iOS": true
          },
          "pricing": {
              "free": true,
              "subscription": "",
              "purchase": ""
          }
      }, {
          "name": "Proto.io",
          "url": "https://proto.io/",
          "image": {
              "background-position": "-100 -500",
          },
          "platforms": {
              "web": true,
          },
          "import": {
              "photoshop": true,
              "dropbox": true,
              "sketch": true,
          },
          "sketch": true,
          "design": true,
          "micro": true,
          "navigation": true,
          "transition": true, // technically allows for both screen and state transition
          "sharing": {
              "iOS": true,
              "android": true,
              "web": true,
              "html": true
          },
          "pricing": {
              "free": true,
              "subscription": "$24+",
              "purchase": ""
          }
      }, {
          "name": "Moqups",
          "url": "https://moqups.com/",
          "image": {
              "background-position": "-400 -300",
          },
          "platforms": {
              "web": true,
          },
          "design": true,
          "navigation": true,
          "sharing": {
              "web": true,
              "pdf": true,
          },
          "pricing": {
              "free": true,
              "subscription": "$19+",
              "purchase": ""
          }
      }, {
          "name": "Atomic.io",
          "url": "https://atomic.io/",
          "image": {
              "background-position": "-500 -700",
          },
          "platforms": {
              "web": true,
          },
          "import": {
              "sketch": true
          },
          "taylorChoice": true,
          "design": true,
          "micro": true,
          "navigation": true,
          "transitions": false,
          "sharing": {
              "web": true,
          },
          "pricing": {
              "free": false,
              "subscription": "$15+",
              "purchase": ""
          }
      }, {
          "name": "CanvasFlip",
          "url": "http://canvasflip.com/",
          "image": {
              "background-position": "-500 -200",
          },
          "platforms": {
              "web": true,
          },
          "import": {
              "sketch": true,
              "balsamiq": true,
              "dropbox": true,
              "camera": true
          },
          // "micro": only with GIF,
          "navigation": true,
          "transition": true,
          "sharing": {
              "iOS": true,
              "android": true,
              "web": true
          },
          "analytics": true,
          "heatmap": true,
          "pricing": {
              "free": true,
              "subscription": "$19+",
              "purchase": ""
          }
          // fixed header
          // screen overlays
          // timers,
      }, {
          "name": "iRise",
          "url": "https://www.irise.com/",
          "image": {
              "background-position": "-100 -700",
          },
          "design": true,
          "platforms": {
              "web": true,
              "windows": true,
              "mac": true
          },
          "micro": true,
          "data": true,
          "navigation": true,
          "transition": true,
          "sharing": {
              "iOS": true,
              "web": true,
              "windows": true,
              "mac": true
          },
          "pricing": {
              "free": false,
              "subscription": "$29+",
              "purchase": ""
          }
      }, {
          "name": "Koncept App",
          "url": "https://konceptapp.com/",
          "image": {
              "background-position": "-200 -500",
          },
          "platforms": {
              "web": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true,
          },
          "tasks": true,
          "heatmap": true,
          "analytics": true,
          "pricing": {
              "free": false,
              "subscription": "$15+",
              "purchase": ""
          }
      }, {
          "name": "Fuse",
          "url": "https://www.fusetools.com/",
          "image": {
              "background-position": "-500 -100",
          },
          "platforms": {
              "mac": true,
              "windows": true,
          },
          "import": {
              "sketch": true,
          },
          "navigation": true,
          "micro": true,
          "transition": true,
          "data": true,
          "code": true,
          "sharing": {
              "iOS": true,
              "android": true
          },
          "pricing": {
              "free": true,
              "subscription": "",
              "purchase": ""
          }
      }, {
          "name": "HotGloo",
          "url": "https://www.hotgloo.com/",
          "image": {
              "background-position": "-200 -600",
          },
          "design": true,
          "platforms": {
              "web": true,
          },
          "navigation": true,
          "micro": true,
          "sharing": {
              "web": true,
              "pdf": true,
              "html":true
          },
          "pricing": {
              "free": false,
              "subscription": "$15+",
              "purchase": ""
          }
      }, {
          "name": "Webflow",
          "url": "https://webflow.com/",
          "image": {
              "background-position": "-200 -700",
          },
          "design": true,
          "platforms": {
              "web": true,
          },
          "navigation": true,
          "micro": true,
          "transition": false,
          "data": true,
          "sharing": {
              "web": true,
              "html":true
          },
          "pricing": {
              "free": true,
              "subscription": "$16+",
              "purchase": null
          }
      }, {
          "name": "Demonstrate",
          "url": "http://nfnlabs.in/demonstrate/",
          "image": {
              "background-position": "-300 -500",
          },
          "platforms": {
              "iOS": true,
          },
          "import": {
              "dropbox": true,
              "camera": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "iOS": true
          },
          "pricing": {
              "free": true,
              "subscription": "",
              "purchase": ""
          }
      }, {
          "name": "Prott",
          "url": "https://prottapp.com/",
          "image": {
              "background-position": "-500 0",
          },
          "platforms": {
              "web": true,
              "mac": true,
              "iOS": true,
              "android": true
          },
          "design": true,
          "import": {
              "sketch": true,
              "photoshop": true,
              "camera": true,
              "dropbox": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true,
              "iOS": true,
              "android": true
          },
          "pricing": {
              "free": true,
              "subscription": "$19+",
              "purchase": null
          }
      }, {
          "name": "Justinmind",
          "url": "http://www.justinmind.com/",
          "image": {
              "background-position": "-400 -700",
          },
          "platforms": {
              "mac": true,
              "windows": true
          },
          "design": true,
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true,
              "iOS": true,
              "android": true
          },
          "mobileOnly": false,
          "responsive": true,
          "pricing": {
              "free": false,
              "subscription": "$29+",
              "purchase": "$495"
          }
      }, {
          "name": "Notable",
          "url": "http://notable.zurb.com/",
          "image": {
              "background-position": "-0 -700",
          },
          "platforms": {
              "web": true
          },
          "navigation": true,
          "transition": true,
          "sharing": {
              "web": true,
          },
          "pricing": {
              "free": false,
              "subscription": "$20+",
              "purchase": ""
          }
      }, {
          "name": "ProtoPie",
          "url": "https://www.protopie.io",
          "image": {
              "background-position": "-0 -800",
          },
          "platforms": {
              "mac": true
          },
          "pricing": {
              "free": true,
              "subscription": "",
              "purchase": ""
          },
          "design": false,
          "import": {
              "sketch": true,
          },
          "micro": true,
          "navigation": true,
          "transition": true,
          "data": false,
          "code": false,
          "sharing": {
              "android": true,
              "iOS": true
          },
          "tasks": false,
          "analytics": false,
          "heatmaps": false,
          "sensors": true
          // "mobileOnly": true,
      }, {
          "name": "Mockplus",
          "url": "https://goo.gl/uBdBne",
          "image": {
              "background-position": "-100 -800",
          },
          "platforms": {
              "mac": true,
              "windows": true,
          },
          "pricing": {
              "free": true,
              "subscription": "$29+",
              "purchase": ""
          },
          "design": true,
          "import": {},
          "micro": true,
          "navigation": true,
          "transition": true,
          "data": false,
          "code": false,
          "sharing": {
              "html": true,
              "web": true,
              "android": true,
              "iOS": true
          },
          "tasks": false,
          "analytics": false,
          "heatmaps": false,
          "sensors": false
          // "mobileOnly": null,
      }, {
          "name": "Pidoco",
          "url": "https://pidoco.com/",
          "image": {
              "background-position": "-200 -800",
          },
          "platforms": {
              "web": true
          },
          "pricing": {
              "free": false,
              "subscription": "$12+",
              "purchase": ""
          },
          "design": true,
          "import": {},
          "micro": true,
          "navigation": true,
          "transition": true,
          "data": false,
          "code": false,
          "sharing": {
              "html": true,
              "web": true,
              "iOS": true,
              "android": true,
              "pdf": true
          },
          "tasks": false,
          "analytics": false,
          "heatmaps": false,
          "sensors": false
          // "mobileOnly": null,
      }, {
          "name": "AppCooker",
          "url": "http://www.appcooker.com/",
          "image": {
              "background-position": "-300 -800",
          },
          "platforms": {
              "iOS": true
          },
          "pricing": {
              "free": false,
              "subscription": "",
              "purchase": "$29"
          },
          "design": true,
          "import": {
              "dropbox": true,
              "drive": true,
              "icloud": true
          },
          "micro": false,
          "navigation": true,
          "transition": true,
          "data": false,
          "code": false,
          "sharing": {
              "iOS": true,
              "pdf": true
          },
          "handoff": false,
          "tasks": false,
          "analytics": false,
          "heatmaps": false,
          "sensors": false
          // "mobileOnly": null,
      }, {
          "name": "TestLab",
          "url": "http://testlab.io",
          "image": {
              "background-position": "-500 -800",
          },
          "platforms": {
              "web": true
          },
          "pricing": {
              "free": true,
              "subscription": "$42+",
              "purchase": ""
          },
          "design": false,
          "import": {
          },
          "micro": false,
          "navigation": true,
          "transition": true,
          "data": false,
          "code": false,
          "sharing": {
              "iOS": true,
              "Android": true
          },
          "handoff": false,
          "tasks": true,
          "analytics": true,
          "heatmaps": true,
          "sensors": false
          // "mobileOnly": null,
      }];
  
      var filters = [{
              "title": "",
              "show": true,
              "canChange": false
          }, {
              "title": "Name",
              "show": true,
              "canChange": true,
              "tipText": "Name of app"
          }, {
              "title": "Platform",
              "show": true,
              "canChange": true,
              "tipText": "Platforms used for <br>building prototypes"
          }, {
              "title": "Free",
              "show": true,
              "canChange": true,
              "tipText": "Has a free version"
          }, {
              "title": "Subscription",
              "show": true,
              "canChange": true,
              "tipText": "Cheapest monthly<br>payment"
          }, {
              "title": "Purchase",
              "show": true,
              "canChange": true,
              "tipText": "One time cost"
          }, {
              "title": "Design",
              "show": true,
              "canChange": true,
              "tipText": "App can design<br>from scratch"
          }, {
              "title": "Import",
              "show": true,
              "canChange": true,
              "tipText": "Integrations with<br>other apps"
          }, {
              "title": "Animations",
              "show": true,
              "canChange": true,
              "tipText": "Individual animations<br>& micro-interactions"
          }, {
              "title": "Transitions",
              "show": true,
              "canChange": true,
              "tipText": "Animates between screens"
          }, {
              "title": "Data",
              "show": true,
              "canChange": true,
              "tipText": "Uses data to<br>render UI"
          }, {
              "title": "Code",
              "show": true,
              "canChange": true,
              "tipText": "Requires knowledge<br>of code"
          }, {
              "title": "Sharing",
              "show": true,
              "canChange": true,
              "tipText": "How others can<br>use the prototype"
          }, {
              "title": "Handoff",
              "show": true,
              "canChange": true,
              "tipText": "Automatic specs<br>for developers"
          }, {
              "title": "Tasks",
              "show": true,
              "canChange": true,
              "tipText": ""
          }, {
              "title": "Analytics",
              "show": true,
              "canChange": true,
              "tipText": "Can track events<br>when testing"
          }, {
              "title": "Heatmap",
              "show": true,
              "canChange": true,
              "tipText": "Generates heatmaps<br>from user testing"
          }, {
              "title": "Sensors",
              "show": true,
              "canChange": true,
              "tipText": "Utilizes device sensors"
          }
      ];
  
      return {
          tools: function() {
              return tools;
          },
          filters: function() {
              return filters;
          },
          setFilters: function(data) {
              filters = data;
          }
      };
  
  });