//>>built define("dojo/_base/declare dojo/Deferred dojo/when dojo/store/util/QueryResults dojo/_base/lang dojo/promise/all".split(" "),function(t,u,l,v,p,m){function q(a){return a&&p.mixin(a,JSON.parse(a.__extra))}var w=/(.*)\*$/;return t([],{constructor:function(a){var c=a.dbConfig;this.database=openDatabase(a.dbName||"dojo-db","1.0","dojo-db",4194304);var g=this.indexPrefix=a.indexPrefix||"idx_",d=a.table||a.storeName;this.table=(a.table||a.storeName).replace(/[^\w]/g,"_");a=[];this.indices=c.stores[d];this.repeatingIndices= {};for(var b in this.indices)this.indices[b].multiEntry&&(this.repeatingIndices[b]=!0);if(!c.available){for(d in c.stores){var h=c.stores[d],k=d.replace(/[^\w]/g,"_"),f=h[this.idProperty],e=["__extra",this.idProperty+" "+(f&&f.autoIncrement?"INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY")],f=[this.idProperty];for(b in h)b!=this.idProperty&&e.push(b);a.push(this.executeSql("CREATE TABLE IF NOT EXISTS "+k+" ("+e.join(",")+")"));for(b in h)b!=this.idProperty&&(h[b].multiEntry?(f.push(b),e=k+"_repeating_"+ b,a.push(this.executeSql("CREATE TABLE IF NOT EXISTS "+e+" (id,value)")),a.push(this.executeSql("CREATE INDEX IF NOT EXISTS idx_"+e+"_id ON "+e+"(id)")),a.push(this.executeSql("CREATE INDEX IF NOT EXISTS idx_"+e+"_value ON "+e+"(value)"))):(a.push(this.executeSql("ALTER TABLE "+k+" ADD "+b).then(null,function(){})),!1!==h[b].indexed&&a.push(this.executeSql("CREATE INDEX IF NOT EXISTS "+g+k+"_"+b+" ON "+k+"("+b+")"))))}c.available=m(a)}this.available=c.available},idProperty:"id",selectColumns:["*"], get:function(a){return l(this.executeSql("SELECT "+this.selectColumns.join(",")+" FROM "+this.table+" WHERE "+this.idProperty+"\x3d?",[a]),function(a){return 0