define(["Ti/_/Evented","Ti/_/lang"],function(n,r){function t(n){if(!u){var r=localStorage.getItem(f);u=require.is(r,"String")&&JSON.parse(r)||{}}return n?u[n]:u}function e(n,e,i){var o=t(n);return void 0===o?r.val(i,null):c[e]?c[e](o):o}function i(n,r,e){n&&(t(),void 0===e||null===e?delete u[n]:u[n]=c[r]?c[r](e):e,localStorage.setItem(f,JSON.stringify(u)))}var o,u,f="ti:properties",c={Bool:function(n){return!!n},Double:function(n){return parseFloat(n)},Int:function(n){return parseInt(n)},List:function(n){return require.is(n,"Array")?n:[n]},Object:function(n){return n},String:function(n){return""+n}},a=r.setObject("Ti.App.Properties",n,{hasProperty:function(n){return!!t(n)},listProperties:function(){var n,r=t(),e=[];for(n in r)e.push(n);return e},removeProperty:function(n){i(n)}});for(o in c)!function(n){a["get"+n]=function(r,t){return e(r,n,t)},a["set"+n]=function(r,t){i(r,n,t)}}(o);return a});