//>>built
define("dojox/data/PicasaStore","dojo/_base/lang dojo/_base/declare dojo/_base/connect dojo/io/script dojo/data/util/simpleFetch dojo/date/stamp".split(" "),function(h,e,k,l,m,g){e=e("dojox.data.PicasaStore",null,{constructor:function(a){a&&a.label&&(this.label=a.label);a&&"urlPreventCache"in a&&(this.urlPreventCache=a.urlPreventCache?!0:!1);a&&"maxResults"in a&&(this.maxResults=parseInt(a.maxResults),this.maxResults||(this.maxResults=20))},_picasaUrl:"http://picasaweb.google.com/data/feed/api/all",
_storeRef:"_S",label:"title",urlPreventCache:!1,maxResults:20,_assertIsItem:function(a){if(!this.isItem(a))throw Error("dojox.data.PicasaStore: a function was passed an item argument that was not an item");},_assertIsAttribute:function(a){if("string"!==typeof a)throw Error("dojox.data.PicasaStore: a function was passed an attribute argument that was not an attribute name string");},getFeatures:function(){return{"dojo.data.api.Read":!0}},getValue:function(a,b,d){return(a=this.getValues(a,b))&&0<a.length?
a[0]:d},getAttributes:function(a){return"id published updated category title$type title summary$type summary rights$type rights link author gphoto$id gphoto$name location imageUrlSmall imageUrlMedium imageUrl datePublished dateTaken description".split(" ")},hasAttribute:function(a,b){return this.getValue(a,b)?!0:!1},isItemLoaded:function(a){return this.isItem(a)},loadItem:function(a){},getLabel:function(a){return this.getValue(a,this.label)},getLabelAttributes:function(a){return[this.label]},containsValue:function(a,
b,d){a=this.getValues(a,b);for(b=0;b<a.length;b++)if(a[b]===d)return!0;return!1},getValues:function(a,b){this._assertIsItem(a);this._assertIsAttribute(b);return"title"===b?[this._unescapeHtml(a.title)]:"author"===b?[this._unescapeHtml(a.author[0].name)]:"datePublished"===b?[dateAtamp.fromISOString(a.published)]:"dateTaken"===b?[g.fromISOString(a.published)]:"updated"===b?[g.fromISOString(a.updated)]:"imageUrlSmall"===b?[a.media.thumbnail[1].url]:"imageUrl"===b?[a.content$src]:"imageUrlMedium"===b?
[a.media.thumbnail[2].url]:"link"===b?[a.link[1]]:"tags"===b?a.tags.split(" "):"description"===b?[this._unescapeHtml(a.summary)]:[]},isItem:function(a){return a&&a[this._storeRef]===this?!0:!1},close:function(a){},_fetchItems:function(a,b,d){a.query||(a.query={});var c={alt:"jsonm",pp:"1",psc:"G","start-index":"1"};a.query.start&&(c["start-index"]=a.query.start);a.query.tags&&(c.q=a.query.tags);a.query.userid&&(c.uname=a.query.userid);a.query.userids&&(c.ids=a.query.userids);a.query.lang&&(c.hl=a.query.lang);
c["max-results"]=this.maxResults;var n=this;l.get({url:this._picasaUrl,preventCache:this.urlPreventCache,content:c,callbackParamName:"callback",handle:function(f){b(n._processPicasaData(f),a)}}).addErrback(function(f){k.disconnect(null);d(f,a)})},_processPicasaData:function(a){var b=[];if(a.feed)for(b=a.feed.entry,a=0;a<b.length;a++)b[a][this._storeRef]=this;return b},_unescapeHtml:function(a){a&&(a=a.replace(/&amp;/gm,"\x26").replace(/&lt;/gm,"\x3c").replace(/&gt;/gm,"\x3e").replace(/&quot;/gm,'"'),
a=a.replace(/&#39;/gm,"'"));return a}});h.extend(e,m);return e});