YUI.add("flickr-prefs-setSafeSearch-updater",(function(e,r){"use strict";e.namespace("ModelUpdaters")["flickr-prefs-setSafeSearch"]={run:function(c,a){return a.callAPI("flickr.prefs.setSafeSearch",c).then(null,e.FetcherErrorLogger(r))}}}),"@VERSION@",{requires:["flickr-promise"]});YUI.add("person-preferences-models",(function(e){function t(e){t.superclass.constructor.call(this,e)}t.UNIFIED_SEARCH_VIEW_TYPES={justified:"jst",thumbs:"thm",tiles:"til"},t.UNIFIED_SEARCH_VIEW_TYPE_DEFAULT=t.UNIFIED_SEARCH_VIEW_TYPES.justified,t.PHOTOSTREAM_VIEW_ORDER_TYPES={dateposted:"dc",datetaken:"dt"},t.PHOTOSTREAM_VIEW_ORDER_DEFAULT=t.PHOTOSTREAM_VIEW_ORDER_TYPES.dateposted,t.PHOTOSTREAM_VIEW_AS_TYPES={me:"me",friend:"fr",family:"fa",ff:"ff",public:"pu"},t.PHOTOSTREAM_VIEW_PREF_MAP={me:"me",fr:"friend",fa:"family",ff:"ff",pu:"public",dc:"dateposted",dt:"datetaken"},t.ALBUM_VIEW_LAYOUT_TYPES={justified:"justified",story:"story"},t.GALLERY_VIEW_LAYOUT_TYPES={large:"lv",justified:"jv",thumbnail:"tv"},t.ALBUM_VIEW_LAYOUT_DEFAULT=t.ALBUM_VIEW_LAYOUT_TYPES.story,t.GALLERY_VIEW_LAYOUT_DEFAULT=t.GALLERY_VIEW_LAYOUT_TYPES.large,t.PHOTOSTREAM_VIEW_AS_DEFAULT=t.PHOTOSTREAM_VIEW_AS_TYPES.public,e.Models[this.name]=t,e.extend(t,e.FlickrModelRegistry,{name:this.name,remote:{read:function(t){return e.ModelFetchers["flickr-people-getInfo"].run(t,this.appContext)},update:function(t,r){var i=[],n={};return e.Lang.isObject(r,!0)&&("safeSearch"in r?(n.safe_search=e.AttributeHelpers.coerceInteger(r.safeSearch.newVal)+1,i.push(e.ModelUpdaters["flickr-prefs-setSafeSearch"].run(n,this.appContext))):"photostreamViewOrderPref"in r||"photostreamViewAsPref"in r?(r.photostreamViewOrderPref&&(n.photostream_view_order_pref=r.photostreamViewOrderPref.newVal),r.photostreamViewAsPref&&(n.photostream_view_as_pref=r.photostreamViewAsPref.newVal),i.push(this.appContext.callAPI("flickr.prefs.setPrefs",n))):"albumViewLayoutPref"in r?(r.albumViewLayoutPref&&(n.album_view_layout=r.albumViewLayoutPref.newVal),i.push(this.appContext.callAPI("flickr.prefs.setPrefs",n))):"galleryViewLayoutPref"in r?(r.galleryViewLayoutPref&&(n.galleries_view_layout_pref=r.galleryViewLayoutPref.newVal),i.push(this.appContext.callAPI("flickr.prefs.setPrefs",n))):Object.keys(r).forEach((function(e){"unifiedSearchViewPref"===e?n.unified_search_view_pref=r.unifiedSearchViewPref.newVal:n[e]=r[e],i.push(this.appContext.callAPI("flickr.prefs.setPrefs",n))}))),e.Promise.all(i)},readUserPrefs:function(e,t){return t.callAPI("flickr.feed.preferences.getUserPreferences",e,t).then((function(e){return e}),(function(e){}))}},remoteReadUserPrefs:function(e,t,r){return this.remote.readUserPrefs(t,r).then((function(e){return e}),(function(e){}))},attributes:{safeSearch:{validator:function(t){return e.AttributeHelpers.validateInteger(t)},setter:function(t){return e.AttributeHelpers.coerceInteger(t)}},unifiedSearchViewPref:{validator:function(r){return!!e.AttributeHelpers.validateString(r)&&Object.keys(t.UNIFIED_SEARCH_VIEW_TYPES).some((function(e){return t.UNIFIED_SEARCH_VIEW_TYPES[e]===r}))},setter:function(t){return e.AttributeHelpers.coerceString(t)},defaultValue:t.UNIFIED_SEARCH_VIEW_TYPE_DEFAULT},photostreamViewOrderPref:{validator:function(r){return!!e.AttributeHelpers.validateString(r)&&Object.keys(t.PHOTOSTREAM_VIEW_ORDER_TYPES).some((function(e){return t.PHOTOSTREAM_VIEW_ORDER_TYPES[e]===r}))},setter:function(t){return e.AttributeHelpers.coerceString(t)},defaultValue:t.PHOTOSTREAM_VIEW_ORDER_DEFAULT},photostreamViewAsPref:{validator:function(r){return!!e.AttributeHelpers.validateString(r)&&Object.keys(t.PHOTOSTREAM_VIEW_AS_TYPES).some((function(e){return t.PHOTOSTREAM_VIEW_AS_TYPES[e]===r}))},setter:function(t){return e.AttributeHelpers.coerceString(t)},defaultValue:t.PHOTOSTREAM_VIEW_AS_DEFAULT},albumViewLayoutPref:{validator:function(r){return!!e.AttributeHelpers.validateString(r)&&Object.keys(t.ALBUM_VIEW_LAYOUT_TYPES).some((function(e){return t.ALBUM_VIEW_LAYOUT_TYPES[e]===r}))},setter:function(t){return e.AttributeHelpers.coerceString(t)},defaultValue:t.ALBUM_VIEW_LAYOUT_DEFAULT},galleryViewLayoutPref:{validator:function(r){return!!e.AttributeHelpers.validateString(r)&&Object.keys(t.GALLERY_VIEW_LAYOUT_TYPES).some((function(e){return t.GALLERY_VIEW_LAYOUT_TYPES[e]===r}))},setter:function(t){return e.AttributeHelpers.coerceString(t)},defaultValue:t.GALLERY_VIEW_LAYOUT_DEFAULT}}},{getReadablePrefName:function(e){return t.PHOTOSTREAM_VIEW_PREF_MAP[e]},buildContextSuffix:function(t,r){var i=e.Models["person-preferences-models"].getReadablePrefName(t.getValue("photostreamViewOrderPref")),n=e.Models["person-preferences-models"].getReadablePrefName(t.getValue("photostreamViewAsPref"));return n===e.Models["person-preferences-models"].PHOTOSTREAM_VIEW_PREF_MAP.me||t.id!==r?i:i+"-"+n}})}),"@VERSION@",{requires:["flickr-model-registry","flickr-people-getInfo-fetcher","flickr-prefs-setSafeSearch-updater","attribute-helpers"]});YUI.add("person-profile-models",(function(e){function t(e){t.superclass.constructor.call(this,e)}e.Models[this.name]=t,e.extend(t,e.FlickrModelRegistry,{name:this.name,remote:{read:function(t){return e.ModelFetchers["flickr-people-getInfo"].run(t,this.appContext)}},attributes:{nsid:{readOnly:!0,defaultFn:function(e){return e}},photoCount:{},unreadMessages:{},storageUsed:{},storageTotal:{},coverPhotoUrls:{},location:{},arrPhotoCount:{}}})}),"@VERSION@",{requires:["flickr-model-registry","flickr-people-getInfo-fetcher"]});YUI.add("flickr-groups-join-creator",(function(r,o){"use strict";r.namespace("ModelCreators")["flickr-groups-join"]={run:function(e,i){var u={};return u.group_id=e.groupModel.id,u.accept_rules=e.acceptRules,r.Promise.all([i.callAPI("flickr.groups.join",u)]).then((function(r){if("ok"===r[0].stat)return e.groupModel.join(),e.groupModel}),r.FetcherErrorLogger(o))}}}),"@VERSION@",{requires:["flickr-promise"],optional:[]});YUI.add("flickr-groups-leave-deletor",(function(e,r){"use strict";e.namespace("ModelDeletors")["flickr-groups-leave"]={run:function(o,l){var t={};return t.group_id=o.groupModel.id,t.delete_photos=o.deletePhotos,e.Promise.all([l.callAPI("flickr.groups.leave",t)]).then((function(e){if("ok"===e[0].stat)return o.groupModel.leave(),o.groupModel}),e.FetcherErrorLogger(r))}}}),"@VERSION@",{requires:["flickr-promise"],optional:[]});YUI.add("flickr-favorites-add-updater",(function(r,e){"use strict";r.namespace("ModelUpdaters")["flickr-favorites-add"]={run:function(o,t){var a={};return a.photo_id=o.photoId,t.callAPI("flickr.favorites.add",a).then(null,r.FetcherErrorLogger(e))}}}),"@VERSION@",{requires:["flickr-promise"],optional:[]});YUI.add("flickr-favorites-remove-updater",(function(r,e){"use strict";r.namespace("ModelUpdaters")["flickr-favorites-remove"]={run:function(o,i){var t={};return t.photo_id=o.photoId,t.user_id=o.userId,i.callAPI("flickr.favorites.remove",t).then(null,r.FetcherErrorLogger(e))}}}),"@VERSION@",{requires:["flickr-promise"],optional:[]});