"use strict";(function(){function n(n){return["$rootScope","$window","$log",function(t,i,r){for(var e=i[n]||(r.warn("This browser does not support Web Storage!"),{}),u={$default:function(n){for(var t in n)angular.isDefined(u[t])||(u[t]=n[t]);return u},$reset:function(n){for(var t in u)"$"===t[0]||delete u[t];return u.$default(n)}},f,h,s,o=0;o<e.length;o++)(s=e.key(o))&&"ngStorage-"===s.slice(0,10)&&(u[s.slice(10)]=angular.fromJson(e.getItem(s)));return f=angular.copy(u),t.$watch(function(){h||(h=setTimeout(function(){if(h=null,!angular.equals(u,f)){angular.forEach(u,function(n,t){angular.isDefined(n)&&"$"!==t[0]&&e.setItem("ngStorage-"+t,angular.toJson(n)),delete f[t]});for(var n in f)e.removeItem("ngStorage-"+n);f=angular.copy(u)}},100))}),"localStorage"===n&&i.addEventListener&&i.addEventListener("storage",function(n){"ngStorage-"===n.key.slice(0,10)&&(n.newValue?u[n.key.slice(10)]=angular.fromJson(n.newValue):delete u[n.key.slice(10)],f=angular.copy(u),t.$apply())}),u}]}angular.module("ngStorage",[]).factory("$localStorage",n("localStorage")).factory("$sessionStorage",n("sessionStorage"))})()