{"version":3,"file":"SocialFeed.js","sources":["SocialFeed.js"],"sourcesContent":["define(\"Modules/SocialFeed\", [`Module`, `module`], function (Super, Self) {\n\tvar SOURCE_NAME_MAP = {\n\t\t\tInstagram: `instagram`,\n\t\t},\n\t\tSOURCE_ICON_MAP = {\n\t\t\tInstagram: `instagram`,\n\t\t},\n\t\tSOURCE_LINK_THEME_MAP = {\n\t\t\tInstagram: `INSTAGRAM`,\n\t\t};\n\n\treturn Super.inherit({\n\t\tnamespace: Self.id,\n\t\trequires: [`XHR`],\n\t\tconstructor(setup) {\n\t\t\tthis.defaults(setup, {\n\t\t\t\tfeedId: `jpcutter`,\n\t\t\t});\n\n\t\t\tthis.data.minWidth = null; // used to avoid manipulating the DOM unnecessarily in this.tabulate()\n\n\t\t\treturn this.XHR.ajax({\n\t\t\t\turl: `//www.juicer.io/api/feeds/tixr_`,\n\t\t\t\tthen: function (feed) {\n\t\t\t\t\tvar posts = feed.posts.items.slice(0, 14);\n\n\t\t\t\t\tthis.find(posts, function (post, i) {\n\t\t\t\t\t\tvar source = post.source.source;\n\n\t\t\t\t\t\tpost.index = i;\n\t\t\t\t\t\tpost.sourceType = source;\n\t\t\t\t\t\tpost.icon = SOURCE_ICON_MAP[source];\n\t\t\t\t\t\tpost.linkTheme = SOURCE_LINK_THEME_MAP[source];\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.data.posts = posts;\n\n\t\t\t\t\tthis.render();\n\t\t\t\t\tthis.show({\n\t\t\t\t\t\tdone: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t\tlisteners: [\n\t\t\t{\n\t\t\t\tevent: `click`,\n\t\t\t\tfilter: `[action=\"load-image\"]`,\n\t\t\t\thandler(evt) {\n\t\t\t\t\tconst { data } = this;\n\t\t\t\t\tconst index = this.parseInt(evt.currentTarget.getAttribute(`index`));\n\n\t\t\t\t\tconst mappedMedia = data.posts.map((post) => {\n\t\t\t\t\t\tconst sourceLabel = post.source.source;\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: `IMAGE`,\n\t\t\t\t\t\t\turl: post.image,\n\t\t\t\t\t\t\tsourceLabel,\n\t\t\t\t\t\t\tsourceIcon: SOURCE_NAME_MAP[sourceLabel],\n\t\t\t\t\t\t\tcaption: post.message,\n\t\t\t\t\t\t\tlink: post.full_url,\n\t\t\t\t\t\t\tlinkTheme: post.linkTheme,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.App.loadOverlay({\n\t\t\t\t\t\ttype: `MediaScroller`,\n\t\t\t\t\t\tsetup: {\n\t\t\t\t\t\t\tstartIndex: index,\n\t\t\t\t\t\t\tmedia: mappedMedia,\n\t\t\t\t\t\t\tcenterMobileContentVertically: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdone: true,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t});\n});\n\ndefine(\"Modules/SocialFeed.templates\",[\"handlebars\"], function(Handlebars) {\n\nthis[\"Templates\"] = this[\"Templates\"] || {};\n\nthis[\"Templates\"][\"Modules/SocialFeed/main\"] = Handlebars.template({\"1\":function(container,depth0,helpers,partials,data) {\n var stack1, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n };\n\n return \"