diff --git a/app/assets/javascripts/lib/embedly.js b/app/assets/javascripts/lib/embedly.js index c1600cab..f8fbd758 100644 --- a/app/assets/javascripts/lib/embedly.js +++ b/app/assets/javascripts/lib/embedly.js @@ -1,2 +1,3 @@ -!function(){var a=function b(c,d,e){function f(h,i){if(!d[h]){if(!c[h]){var j="function"==typeof a&&a;if(!i&&j)return j(h,!0);if(g)return g(h,!0);throw new Error("Cannot find module '"+h+"'")}var k=d[h]={exports:{}};c[h][0].call(k.exports,function(a){var b=c[h][1][a];return f(b?b:a)},k,k.exports,b,c,d,e)}return d[h].exports}for(var g="function"==typeof a&&a,h=0;ha};0>k&&(l=function(b){return a>b});var m=function(){clearInterval(c),g.console.log("duration",(new Date).getTime()-i),d.detachEvent("scroll",e)};c=setInterval(function(){return f+=k,l(f)?(m(),!1):(window.scrollTo(0,f),void(j=!0))},10),e=function(){j&&f!==g.window.scrollY()&&m()},d.addEvent("scroll",e)},b.exports=g},{"./dom.js":5,"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],3:[function(a,b){var c=!1,d=/xyz/.test(function(){})?/\b_super\b/:/.*/,e=function(){};e.extend=function(a){function b(){!c&&this.init&&this.init.apply(this,arguments)}var e=this.prototype;c=!0;var f=new this;c=!1;for(var g in a)f[g]="function"==typeof a[g]&&"function"==typeof e[g]&&d.test(a[g])?function(a,b){return function(){var c=this._super;this._super=e[a];var d=b.apply(this,arguments);return this._super=c,d}}(g,a[g]):a[g];return b.prototype=f,b.prototype.constructor=b,b.extend=arguments.callee,b},b.exports=e},{}],4:[function(a,b){var c=a("./iframe.js"),d=a("./utils.js"),e={started:!1,instance:null};e.EVENTS=["xcomm.stats.access","xcomm.stats.card.realtime","xcomm.stats.card.week","xcomm.stats.media.realtime","xcomm.stats.media.week","xcomm.stats.media.recommend","xcomm.stats.card.recommend","xcomm.user.set","xcomm.user.get","xcomm.user.remove","xcomm.page.progress"],e.clear=function(){e.instance&&(e.instance.remove(),e.instance=null),e.started=!1},e.connect=function(a){if(!a||e.started)return!1;e.started=!0;var b=c.createComm(a);return d.each(e.EVENTS,function(c){b.on(c,function(b){a.notify(c+".response",b)}),a.on(c,function(a){b.send(c,a)})}),b.on("xcomm.ready",function(b){a.notify("xcomm.ready",b)}),e.instance=b,b},b.exports=e},{"./iframe.js":6,"./utils.js":15}],5:[function(a,b){var c=a("./utils.js"),d={};d.toArray=function(a){return c.map(a,function(a){return a})},d.all=function(a){var b=[];return document.querySelectorAll?d.toArray(document.querySelectorAll(a)):b},d.one=function(a,b){var c=d.all(a,b);return 0===c.length?null:c[0]},d.create=function(a,b,e,f){if(!a||!c.isString(a))return null;c.isString(b)&&c.isNone(e)&&(e=b,b={});var g;return g=f?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a),c.each(b,function(a,b){g.setAttribute(b,a)}),e&&d.text(g,e),g},d.set=function(a,b,e){if(!a||!c.isString(a))return null;c.isString(b)&&c.isNone(e)&&(e=b,b={});var f=d.one(a);return f?(c.each(b,function(a,b){f.setAttribute(b,a)}),c.isNone(e)||d.text(f,e),f):null},d.replace=function(a,b){c.assert(c.isElement(a),"replace requires an element to be replaced"),c.assert(c.isElement(b),"replace requires an element to replace with."),a.parentNode.replaceChild(b,a)},d.remove=function(a){return c.isElement(a)&&c.isElement(a.parentNode)?void a.parentNode.removeChild(a):!1},d.hide=function(a){return c.isString(a)&&(a=d.one(a)),c.isElement(a)&&(a.style.display="none"),a},d.show=function(a,b){return c.isString(a)&&(a=d.one(a)),c.isElement(a)&&(a.style.display=b?"inline-block":"block"),a},d.svg=function(a,b,c){return d.create(a,b,c,"http://www.w3.org/2000/svg")},d.children=function(a,b){return c.isElement(a)?c.reduce(a.childNodes,function(a,d){if(c.isElement(d)){if(!c.isNone(b))if(d.namespaceURI&&"http://www.w3.org/2000/svg"===d.namespaceURI){if(d.nodeName!==b)return a}else if(b.toUpperCase()!==d.nodeName)return a;a.push(d)}return a},[]):[]},d.child=function(a,b){var c=d.children(a,b);return 0!==c.length?c[0]:null},d.text=function(a,b){if(!a||!c.isElement(a))return null;if(c.isNone(b))return a.innerText||a.textContent;var d=void 0===a.textContent?"innerText":"textContent";a[d]=b},d.hasClass=function(a,b){if(c.isString(a)&&(a=d.one(a)),!c.isElement(a)||!c.isString(b)||!b)return!1;var e=a.getAttribute("class");return c.isNone(e)?!1:(" "+e+" ").indexOf(" "+b+" ")>-1?!0:!1},d.addClass=function(a,b){if(c.isString(a)&&(a=d.one(a)),!c.isElement(a)||!c.isString(b)||!b)return!1;if(d.hasClass(a,b))return!1;var e=a.getAttribute("class");if(c.isNone(e))return a.setAttribute("class",b),!0;var f=e.split(" "),g=[];return c.map(f,function(a){var b=c.trim(a);""!==b&&g.push(b)}),g.push(b),a.setAttribute("class",g.join(" ")),!0},d.removeClass=function(a,b){if(c.isString(a)&&(a=d.one(a)),!c.isElement(a)||!c.isString(b)||!b)return!1;var e=a.getAttribute("class");if(c.isNone(e))return!1;var f=!1,g=c.reduce(e.split(" "),function(a,d){var e=c.trim(d);return e?e===b?(f=!0,a):(a.push(e),a):a},[]);return a.setAttribute("class",g.join(" ")),f},d.data=function(a,b,d){c.assert(a&&c.isElement(a),"dom.data needs an element."),c.assert(b&&c.isString(b),"dom.data needs an attr.");var e=c.camelCase(b);return c.isNone(d)?c.isNone(a.dataset)?a.getAttribute("data-"+b):c.isNone(a.dataset[e])?null:a.dataset[e]:void(c.isNone(a.dataset)?a.setAttribute("data-"+b,d):a.dataset[e]=d)},d.attrize=function(a){return a&&c.isObject(a)?c.map(a,function(a,b){return b+'="'+a+'"'}).sort().join(" "):""},d.event=function(a){var b=c.extend({},a||window.event);return b.target||(b.target=b.srcElement||document),3===b.target.nodeType&&(b.target=b.target.parentNode),!a.metaKey&&a.ctrlKey&&(b.metaKey=b.ctrlKey),b.stop=function(){a.preventDefault?a.preventDefault():a.returnValue=!1},b.pageX||b.pageY||!b.clientX&&!b.clientY||(b.pageX=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,b.pageY=b.clientY+document.body.scrollTop+document.documentElement.scrollTop),b},d.addEvent=function(a,b,d){c.isNone(a)||(a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent?a.attachEvent("on"+b,d):a["on"+b]=d)},d.detachEvent=function(a,b,d){c.isNone(a)||(a.removeEventListener?a.removeEventListener(b,d,!1):a.detachEvent?a.detachEvent("on"+b,d):a["on"+b]=null)},d.trigger=function(a,b){c.assert(c.contains(["click"],b),"Not a valid event");var d;a.dispatchEvent?(d=document.createEvent("MouseEvents"),d.initEvent(b,!0,!0),a.dispatchEvent(d,!0)):(d=document.createEventObject(),a.fireEvent("on"+b,d))},d.rect=function(a){try{return a.getBoundingClientRect()}catch(b){}return!1},b.exports=d},{"./utils.js":15}],6:[function(a,b){var c=a("./utils.js"),d=a("./dom.js"),e=a("./urlparse.js"),f=a("./browser.js"),g=a("./class.js"),h=a("./json.js"),i=a("./a.js"),j=a("conf"),k={};k.connect=function(a,b){if(!a||!c.isElement(a.elem))return!1;var d=new i,g=[],j=a.elem.src,k=!1,l=e.getOrigin(j);a.on=function(a,b,c){d.on(a,b,c)},a.one=function(a,b,c){d.one(a,b,c)},a.off=function(a,b){d.off(a,b)},a.send=function(b,d){if(c.isNone(d)&&(d={}),c.isString(d)&&(d={msg:d}),d.method=b,k===!1)return f.console.log("Iframe.queue",d),g.push(d),!1;a.sid&&(d.sid=a.sid),f.console.log("iframe.send",d);var e=h.stringify(d);a.elem.contentWindow&&a.elem.contentWindow.postMessage&&a.elem.contentWindow.postMessage(e,l)},a.ready=function(){k||(f.console.log("iframe.ready",a.name),k=!0,c.each(g,function(b){a.send(b.method,b)}))};var m=function(b,c){if(b.origin===l){if(f.console.log("iframe.message",c),!c.src&&!c.sid&&!c.listener)return!1;if(a.sid&&c.sid!==a.sid)return!1;if(c.src&&c.src!==j)return!1;if(c.listener&&c.listener!==j)return!1;"resize"===c.method&&a.resize&&a.resize(c),!c.method&&c.event&&c.listener?d.notify(c.event,c):c.method&&d.notify(c.method,c)}};return b.on("window.message",m),a._remove=function(){b.off("window.message",m)},a},k.rendering=function(a){return"1"===d.data(a,"rendering")?!0:(d.data(a,"rendering","1"),!1)};var l=g.extend({secure:null,rendered:!1,hashed:!1,init:function(a,b){this.sid=c.getUUID(),this.query=a,this.create(b)},getSrc:function(){var a="";a=this.secure===!0||j.EMB_HTTPS?j.EMB_SECURE_FRAME_SRC:/https?:\/\/sulia\.com\/embed/.test(this.query.url)?"http://embed.sulia.com/widgets/":j.EMB_FRAME_SRC,a+=this.name+".html";var b=c.extend({},this.query);return this.hashed?(b.sid=this.sid,a+="#"+e.createQuery(b)):a+="?"+e.createQuery(b)+"#sid="+this.sid,a},create:function(a){var b=c.extend({},this.attrs);return this.src=this.getSrc(),b.src=this.src,b.id="emb_"+(this.query&&this.query.url?c.hash(this.query.url):this.sid),b["class"]="embedly-"+this.name,this.elem=d.create("iframe",b),c.each(this.style,function(a,b){this.elem.style[b]=a},this),k.connect(this,a),this.after(),this.elem},after:function(){},replace:function(a){d.replace(a,this.elem)},append:function(a){a.appendChild(this.elem)},resize:function(a){a.width&&this.elem.setAttribute("width",a.width),a.height&&this.elem.setAttribute("height",a.height)},remove:function(){d.remove(this.elem),this._remove&&this._remove()}}),m=l.extend({name:"card",hashed:!0,attrs:{frameborder:"0",scrolling:"no",allowtransparency:"true",allowfullscreen:"true"},style:{width:"1px",height:"0px",border:"none",position:"absolute",visibility:"hidden"}});k.createCard=function(a,b,f){if(!j.EMB_POST_MESSAGE)return null;if(!c.isElement(a)||!c.isElement(a.parentNode))return null;if(k.rendering(a))return null;var g={};if(b&&c.isFunction(b.off)&&(f=b,b=null),!c.isNone(b)&&b.url)g=b;else if(c.each(["type","via","chrome","theme","image","description","embed","controls","analytics","lang"],function(b){var e=d.data(a,"card-"+b);c.isNone(e)||(g[b]=e)}),"BLOCKQUOTE"===a.nodeName){var h,i=d.child(a,"h4"),l=d.child(a,"p");if(c.isNone(i)){if(!l)return!1;var n=a.getElementsByTagName("a");if(0===n.length)return!1;h=n[n.length-1],g.url=h.getAttribute("href")}else h=d.child(i,"a"),g.url=h.getAttribute("href"),g.title=d.text(h),g.description=c.isNone(l)?"0":d.text(l)}else"A"===a.nodeName&&(g.url=a.getAttribute("href"));var o,p,q;if(c.each(document.getElementsByTagName("meta"),function(a){q=[a.getAttribute("name"),a.getAttribute("property")],c.contains(q,"twitter:site")?p=a.getAttribute("content"):c.contains(q,"twitter:creator")&&(o=a.getAttribute("content"))}),o?g.twitter_via=o:p&&(g.twitter_via=p),!g.url)return null;var r=e.parse(g.url);if(!r.valid())return null;g.url=r.url;var s={url:g.url};c.isNone(g.type)||(s.type=g.type),c.isNone(g.lang)||(s.lang=g.lang);var t=new m(s,f);t.send("card.content",g);var u=a.parentNode;return u&&u.offsetWidth&&(t.elem.style.width=u.offsetWidth>600?"600px":u.offsetWidth+"px"),u.insertBefore(t.elem,a),t.on("card.repeat",function(a){var b={url:a.url,via:document.location.toString()};c.each(["image","embed","title","description","lang"],function(c){a.hasOwnProperty(c)&&(b[c]=a[c])}),k.createCardModal(b,f)}),t.on("modal.stats",function(a){k.createStatsModal(a,f)}),t.on("card.ready",function(){t.ready()}),t.on("card.rendered",function(e){return"error"===e.name?(t.remove(),!1):b&&c.isArray(b.types)&&b.types.length>0&&!c.contains(b.types,e.type)?(t.remove(),!1):(t.rendered=!0,t.elem.style.display="block",t.elem.style.margin="10px auto",t.elem.style.visibility="visible",t.elem.style.position="relative",t.elem.width="600",t.elem.height=e.height?e.height:"300",t.elem.style.width=null,t.elem.style.height=null,t.elem.style.maxWidth="99%",t.elem.style.minWidth="200px",void d.remove(a))}),t};var n=l.extend({name:"button",attrs:{frameborder:"0",scrolling:"no",allowtransparency:"true",height:"20",width:"80"},style:{border:"none"}});k.createButton=function(a,b){if(!c.isElement(a))return null;if(k.rendering(a))return null;var e=d.data(a,"url");c.isNone(e)&&(e=document.location.toString());var g,h={url:e};c.each(["theme","target","lang"],function(b){g=d.data(a,b),c.isNone(g)||(h[b]=g)});var i=f.window.center(635,500);h.left=i.left,h.top=i.top;var j=new n({url:e},b);return j.replace(a),j.on("button.click",c.bind(function(){f.window.innerWidth()<=768||f.mobile()?window.location="http://embed.ly/code?url="+encodeURIComponent(h.url):k.createCardModal(this,b)},h)),j.send("button.data",h),j.on("button.ready",function(){j.ready()}),j};var o=l.extend({name:"modal",attrs:{frameborder:"0",allowtransparency:"true"},style:{border:"none",position:"fixed",top:"0",left:"0",zIndex:"2147483647"},after:function(){this.elem.style.width=f.window.innerWidth()+"px",this.elem.style.height=f.window.innerHeight()+"px"}});k.createCardModal=function(a,b){if(c.isNone(a)&&(a={url:document.location.toString()}),c.isNone(a.url)&&(a.url=document.location.toString()),"window"===a.target)return f.open("http://cdn.embedly.com/widgets/embed?url="+encodeURIComponent(a.url),"Embed Code",635,500),!1;a.t="card";var e=new o(a,b);return e.append(document.body),d.addEvent(window,"resize",function(){e.elem.style.width=f.window.innerWidth()+"px",e.elem.style.height=f.window.innerHeight()+"px"}),e.on("modal.close",function(){document.body.removeChild(e.elem)}),e.on("modal.ready",function(){e.ready()}),e},k.createStatsModal=function(a,b){a.t="stats";var c=new o(a,b);c.append(document.body),c.on("modal.close",function(){document.body.removeChild(c.elem)}),c.on("modal.ready",function(){c.ready()}),d.addEvent(window,"resize",function(){c.elem.style.width=f.window.innerWidth()+"px",c.elem.style.height=f.window.innerHeight()+"px"})};var p=l.extend({name:"xcomm",attrs:{frameborder:"0",allowtransparency:"true"},style:{border:"none",position:"absolute",top:"-9999em",width:"10px",height:"10px"},secure:!0});k.createComm=function(a){var b=new p({},a);return b.append(document.body),b.on("xcomm.ready",function(){b.ready()}),b},b.exports=k},{"./a.js":1,"./browser.js":2,"./class.js":3,"./dom.js":5,"./json.js":7,"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],7:[function(a,b){var c=a("./browser.js");b.exports=function(a){function b(a){return 10>a?"0"+a:a}function c(a){return h.lastIndex=0,h.test(a)?'"'+a.replace(h,function(a){var b=i[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function d(a,e){var h,i,j,k,l,m=f,n=e[a];switch(n&&"[object Date]"===Object.prototype.toString.call(n)&&(n=isFinite(this.valueOf())?this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"Z":null),typeof n){case"string":return c(n);case"number":return isFinite(n)?String(n):"null";case"boolean":case"null":return String(n);case"object":if(!n)return"null";if(f+=g,l=[],"[object Array]"===Object.prototype.toString.apply(n)){for(k=n.length,h=0;k>h;h+=1)l[h]=d(h,n)||"null";return j=0===l.length?"[]":f?"[\n"+f+l.join(",\n"+f)+"\n"+m+"]":"["+l.join(",")+"]",f=m,j}for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(j=d(i,n),j&&l.push(c(i)+(f?": ":":")+j));return j=0===l.length?"{}":f?"{\n"+f+l.join(",\n"+f)+"\n"+m+"}":"{"+l.join(",")+"}",f=m,j}}var e={};if(window.JSON&&JSON.parse&&JSON.stringify)return window.JSON;var f,g,h=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return e.stringify=function(a,b){var c;if(f="",g="","number"==typeof b)for(c=0;b>c;c+=1)g+=" ";else"string"==typeof b&&(g=b);return d("",{"":a})},e.parse=function(){var b,c,d,e,f={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},g=function(c){a.console.error({name:"SyntaxError",message:c,at:b,text:d})},h=function(a){return a&&a!==c&&g("Expected '"+a+"' instead of '"+c+"'"),c=d.charAt(b),b+=1,c},i=function(){var a,b="";for("-"===c&&(b="-",h("-"));c>="0"&&"9">=c;)b+=c,h();if("."===c)for(b+=".";h()&&c>="0"&&"9">=c;)b+=c;if("e"===c||"E"===c)for(b+=c,h(),("-"===c||"+"===c)&&(b+=c,h());c>="0"&&"9">=c;)b+=c,h();return a=+b,isFinite(a)?a:void g("Bad number")},j=function(){var a,b,d,e="";if('"'===c)for(;h();){if('"'===c)return h(),e;if("\\"===c)if(h(),"u"===c){for(d=0,b=0;4>b&&(a=parseInt(h(),16),isFinite(a));b+=1)d=16*d+a;e+=String.fromCharCode(d)}else{if("string"!=typeof f[c])break;e+=f[c]}else e+=c}g("Bad string")},k=function(){for(;c&&" ">=c;)h()},l=function(){switch(c){case"t":return h("t"),h("r"),h("u"),h("e"),!0;case"f":return h("f"),h("a"),h("l"),h("s"),h("e"),!1;case"n":return h("n"),h("u"),h("l"),h("l"),null}g("Unexpected '"+c+"'")},m=function(){var a=[];if("["===c){if(h("["),k(),"]"===c)return h("]"),a;for(;c;){if(a.push(e()),k(),"]"===c)return h("]"),a;h(","),k()}}g("Bad array")},n=function(){var a,b={};if("{"===c){if(h("{"),k(),"}"===c)return h("}"),b;for(;c;){if(a=j(),k(),h(":"),Object.hasOwnProperty.call(b,a)&&g('Duplicate key "'+a+'"'),b[a]=e(),k(),"}"===c)return h("}"),b;h(","),k()}}g("Bad object")};return e=function(){switch(k(),c){case"{":return n();case"[":return m();case'"':return j();case"-":return i();default:return c>="0"&&"9">=c?i():l()}},function(a){var f;return d=a,b=0,c=" ",f=e(),k(),c&&g("Syntax error"),f}}(),e}(c)},{"./browser.js":2}],8:[function(a,b){var c=a("./browser.js"),d=a("./utils.js"),e=a("./dom.js"),f={_data:null};f.COOKIE_NAME="em_p_uid",f.format=function(a){return a&&d.isObject(a)?d.map(a,function(a,b){return b+":"+a}).sort().join("|"):null},f.parse=function(a){if(!a)return null;var b;return d.reduce(a.split("|"),function(a,c){return null===a?null:(b=c.split(":"),2!==b.length?null:(a[b[0]]=b[1],a))},{})},f.timestamp=function(a){var b;try{b=parseInt(a,10)}catch(c){return!1}return b},f.get=function(){var a=c.cookie.get(f.COOKIE_NAME);if(d.isNone(a))return f.set();var b=f.parse(a),e=f.timestamp(b.t);return e===!1?f.set():d.getTimestamp()-e>15552e6?f.set({u:b.u,l:b.l}):b},f.set=function(a){var b={u:d.getUUID(),t:d.getTimestamp(),l:0};a&&(b=d.extend(b,a));var e=f.format(b);return c.cookie.set(f.COOKIE_NAME,e,365,"https:"===window.location.protocol),e=c.cookie.get(f.COOKIE_NAME),d.isNone(e)?null:f.parse(e)},f.update=function(a){var b=f.get();return b?(b=d.extend(b,a),f.set(b)):!1},f.data=function(){if(f._data)return f._data;var a={mt:d.getTimestamp(),mr:document.referrer,msw:c.window.innerWidth(),msh:c.window.innerHeight()},b=f.get();return b?(a.muu=b.u,a.mut=b.t,a.mul=b.l):a.muu=0,f._data=a,f.update({l:d.getTimestamp()}),f._data},f.send=function(a,b){if(!b||!d.isElement(b.elem))return!1;var c=d.extend(f.data(),{}),g=e.rect(b.elem);g&&(c.mft=g.top,c.mfl=g.left,c.mfw=g.width,c.mfh=g.height),b.send(a,c)},b.exports=f},{"./browser.js":2,"./dom.js":5,"./utils.js":15}],9:[function(a,b){var c=a("./dom.js"),d=a("./utils"),e={_event:null,_observer:null};e.nodeNames=["iframe","a","blockquote"],e.html=function(){var a=document.getElementsByTagName("html");return 0===a.length?null:a[0]},e.recurse=function(a){var b=[];return d.isElement(a)&&b.push(a),d.reduce(a.childNodes,function(a,b){return d.isElement(b)?a.concat(e.recurse(b)):a},b)},e.observer=function(a){var b=e.html();if(null===b)return!1;if(!window.MutationObserver)return!1;e._observer=new window.MutationObserver(function(b){d.each(b,function(b){if("childList"===b.type&&b.addedNodes){var c=Array.prototype.slice.call(b.addedNodes);d.each(c,function(b){d.each(e.recurse(b),function(b){b.nodeName&&d.contains(e.nodeNames,b.nodeName.toLowerCase())&&a.notify("mutation.insert."+b.nodeName.toLowerCase(),b)})})}})});var c={childList:!0,subtree:!0};return e._observer.observe(b,c),!0},e.events=function(a){var b=e.html();return null===b?!1:(e._event=function(b){d.each(e.recurse(b.target),function(b){b.nodeName&&d.contains(e.nodeNames,b.nodeName.toLowerCase())&&a.notify("mutation.insert."+b.nodeName.toLowerCase(),b)})},c.addEvent(b,"DOMNodeInserted",e._event),!0)},e.stop=function(){var a=e.html();return null===a?!1:(e._event&&(c.detachEvent(a,"DOMNodeInserted",e._event),e._event=null),void(e._observer&&(e._observer.disconnect(),e._observer=null)))},e.connect=function(a){return e._event||e._observer?!1:void(e.observer(a)||e.events(a))},b.exports=e},{"./dom.js":5,"./utils":15}],10:[function(a,b){var c=a("./utils.js"),d=a("./urlparse.js"),e=a("./comms.js"),f=a("conf"),g={started:!1};g.connect=function(a,b){var h=d.getDomain(document.location.toString());if(!b&&f.PAGE_PROGRESS_DOMAINS&&!c.contains(f.PAGE_PROGRESS_DOMAINS,h))return!1;if(g.started)return!1;g.started=!0;var i=function(){a.notify("xcomm.page.progress")};e.started?i():(e.connect(a),a.one("xcomm.ready",i))},b.exports=g},{"./comms.js":4,"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],11:[function(a,b){var c=a("./utils.js"),d=a("./dom.js"),e=function(){this.init()};e.prototype.init=function(){var a=this;document.addEventListener?document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,!1),a.ready()},!1):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",arguments.callee),a.ready())}),document.documentElement.doScroll&&window===window.top&&!function(){if(!a.isReady){try{document.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a.ready()}}()),d.addEvent(window,"load",a.ready)},e.prototype.ready=function(){return this.isReady?!1:(this.isReady=!1,void(this.callback&&this.callback()))},e.prototype.bind=function(a){this.isReady&&a(),this.callback=a},e.prototype.elem=function(a,b,c){var e=!1,f=function(){e===!1&&(e=!0,b.call(c))};a.onload=f,d.addEvent(a,"load",f),a.onreadystatechange=function(){var b=a.readyState;("loaded"===b||"complete"===b)&&(a.onreadystatechange=null,f())}},e.prototype.firstNode=function(){var a=document.getElementsByTagName("head")[0],b=d.child(a,"link");if(b)return b;var c=d.child(a,"style");if(c)return c;var e=d.child(a,"script");return e?e:null},e.prototype.script=function(a,b,d,e){var f=this.firstNode(),g=document.createElement("script");g.type="text/javascript",g.src=a,c.isNone(e)||(g.async=1),this.elem(g,b,d),f.parentNode.insertBefore(g,f)},e.prototype.css=function(a,b,c){var d=this.firstNode(),e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=a,this.elem(e,b,c),d.parentNode.insertBefore(e,d)},b.exports=new e},{"./dom.js":5,"./utils.js":15}],12:[function(a,b){var c=a("./urlparse.js"),d={data:{},results:{},enabled:!1};d.show=function(a){var b=d.data[a],c=d.results[a];d.hub.notify("recommend.show",b,c)},d.add=function(a){var b=c.getQuery(a.elem.src);d.data[b.url]=a,d.enabled&&(a.on("media.stats.recommend",function(c){d.results[c.url]=c.results,a.on("pause",function(){d.show(b.url)}),a.send("addEventListener",{context:"player.js",version:"0.0.8",method:"addEventListener",value:"pause",listener:a.elem.src})}),a.send("media.stats.recommend",{key:b.key,url:b.url}))},d.connect=function(a){a.on("recommend",function(){d.enabled=!0}),a.on("recommend.add",function(a){d.add(a)}),d.hub=a},b.exports=d},{"./urlparse.js":14}],13:[function(a,b){var c=a("./utils.js"),d=a("./urlparse.js"),e=a("conf"),f={};f.youtube={schema:"youtube",re:/youtube\.com\/embed\/([^\/?#]+)/i,url:function(a){var b=f.youtube.re.exec(a);return 2!==b.length?a:"http://www.youtube.com/watch?v="+b[1]}},f.vimeo={schema:"vimeo",re:/player\.vimeo\.com\/video\/([^\/?#]+)/i,url:function(a){var b=f.vimeo.re.exec(a);return 2!==b.length?a:"http://vimeo.com/"+b[1]}},f.soundcloud={schema:"soundcloud",re:/w\.soundcloud\.com\/player\/\?/,url:function(a){var b=d.getQuery(a);if(b.url){var c=/api\.soundcloud\.com\/tracks\/([^\/?#]+)/.exec(b.url);if(2===c.length)return"https://soundcloud.com/track/"+c[1]}return a}},f.providers=[f.youtube,f.vimeo,f.soundcloud],f.provider=function(a){return c.reduce(f.providers,function(b,c){return c.re.test(a)?c:b},null)},f.replace=function(a,b){if(c.isNone(a)||!c.isElement(a))return null;if("IFRAME"!==a.nodeName)return null;if(!a.src||!c.isString(a.src))return null;if(!b.key)return!1;var g=a.src;g=g.replace(/&/g,"&");var h=f.provider(g);if(null===h)return null;var i="https:"===window.location.protocol?"https:":"http:";"file://"===g.substr(0,7)&&(g=g.substr(5)),"//"===g.substr(0,2)&&(g=i+g);var j=c.extend({},b,{url:h.url(g),src:g,schema:h.schema,type:"text/html"}),k=i+"//cdn.embedly.com/widgets/";e.EMB_DEBUG&&(k=e.EMB_FRAME_SRC);var l=k+"media.html?"+d.createQuery(j);return a.src=l,a},b.exports=f},{"./urlparse.js":14,"./utils.js":15,conf:"AqyHQT"}],14:[function(a,b){var c=a("./utils.js"),d={};d.createQuery=function(a){var b=[],d="";return a&&c.isObject(a)&&!c.isEmptyObject(a)?(c.each(a,function(a,c){b.push(encodeURIComponent(c)+"="+encodeURIComponent(a))}),b.sort(),b.join("&")):d},d.parseQuery=function(a){var b={};if(!a||!c.isString(a))return b;("#"===a.substr(0,1)||"?"===a.substr(0,1))&&(a=a.substr(1));var d=a.split("&");return c.each(d,function(a){if(!a)return!0;var c=a.split("="),d=decodeURIComponent(c[0]);b[d]=1===c.length?"":decodeURIComponent(2===c.length?c[1]:c.slice(1).join("="))}),b},d.getQuery=function(a){if(!a||!c.isString(a))return{};var b=a.split("?");return 2===b.length?d.parseQuery(b[1]):b.length>2?d.parseQuery(b.slice(1).join("?")):{}},d.appendQuery=function(a,b){if(!a||!c.isString(a))return null;var e=a.split("?"),f=e[0];if(!b||!c.isObject(b)||c.isEmptyObject(b))return a;var g=d.getQuery(a);return g=c.extend(g,b),c.isEmptyObject(g)?a:[f,d.createQuery(g)].join("?")},d.removeQuery=function(a,b){if(!a||!c.isString(a))return null;var e=a.split("?"),f=e[0],g=d.getQuery(a);return g.hasOwnProperty(b)&&delete g[b],c.isEmptyObject(g)?f:[f,d.createQuery(g)].join("?")},d.getOrigin=function(a){if(!a||!c.isString(a))return null;if(!/^https?:\/\//.test(a))return null;var b=a.split("/").slice(0,3).join("/");return-1===b.indexOf(".")?null:b},d.getDomain=function(a){var b=d.getOrigin(a);return b?b.replace(/^https?:\/\//,""):null},d.Parsed=function(a,b){this.init(a,b)},d.Parsed.prototype.init=function(a,b){this.original=a,this.url=b,this._valid=!1,this.url=b},d.Parsed.prototype.valid=function(a){return(a===!0||a===!1)&&(this._valid=a),this._valid},d.parse=function(a){var b=a,e="https:"===window.location.protocol?"https:":"http:";a=a?c.trim(a):a;var f=new d.Parsed(b,a);return a?/^https?:\/\/[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f):/^\w+:/i.test(a)?f:"#"===a[0]?f:/^\/\/[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f.url=e+a,f):/^\/([^\/]+|$)/i.test(a)?(f.valid(!0),f.url=d.getOrigin(window.location.toString())+a,f):/^[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f.url="http://"+a,f):f:f},d.addHash=function(a,b){return-1===a.indexOf("#")?a+"#"+b:a+"&"+b},b.exports=d},{"./utils.js":15}],15:[function(a,b){var c=a("conf"),d={},e={},f=Array.prototype,g=Object.prototype,h=Function.prototype,i=(f.push,f.slice),j=(f.concat,g.toString),k=f.forEach,l=(f.map,f.reduce),m=(f.reduceRight,f.filter,f.every),n=(f.some,f.indexOf),o=(f.lastIndexOf,Array.isArray,Object.keys,h.bind);d.identity=function(a){return a},d.each=function(a,b,c){if(null!=a)if(k&&a.forEach===k)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,f=a.length;f>d;d++)if(d in a&&b.call(c,a[d],d,a)===e)return}else for(var h in a)if(g.hasOwnProperty.call(a,h)&&b.call(c,a[h],h,a)===e)return},d.map=function(a,b,c){var e=[]; -return null==a?e:Array.prototype.map&&a.map===Array.prototype.map?a.map(b,c):(d.each(a,function(a,d,f){e[e.length]=b.call(c,a,d,f)}),e)},d.reduce=function(a,b,c,e){var f=arguments.length>2;if(null==a&&(a=[]),l&&a.reduce===l)return e&&(b=d.bind(b,e)),f?a.reduce(b,c):a.reduce(b);if(d.each(a,function(a,d,g){f?c=b.call(e,c,a,d,g):(c=a,f=!0)}),!f)throw new TypeError("Reduce of empty array with no initial value");return c},d.zip=function(a){return d.map(a[0],function(b,c){return b.map(a,function(a){return a[c]})})},d.extend=function(a){return d.each(Array.prototype.slice.call(arguments,1),function(b){for(var c in b)void 0!==b[c]&&(a[c]=b[c])}),a},d.contains=function(a,b){if(!n){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1}return a.indexOf(b)>-1},d.every=function(a,b,c){b||(b=d.identity);var f=!0;return null==a?f:m&&a.every===m?a.every(b,c):(d.each(a,function(a,d,g){return(f=f&&b.call(c,a,d,g))?void 0:e}),!!f)},d.indexOf=function(a,b){if(null==a)return-1;var c=0,d=a.length;if(n&&a.indexOf===n)return a.indexOf(b);for(;d>c;c++)if(a[c]===b)return c;return-1};var p=function(){};d.bind=function(a,b){var c,e;if(o&&a.bind===o)return o.apply(a,i.call(arguments,1));if(!d.isFunction(a))throw new TypeError;return c=i.call(arguments,2),e=function(){if(!(this instanceof e))return a.apply(b,c.concat(i.call(arguments)));p.prototype=a.prototype;var d=new p;p.prototype=null;var f=a.apply(d,c.concat(i.call(arguments)));return Object(f)===f?f:d}},d.get=function(a,b,c){if(c=d.isNone(c)?null:c,d.isNone(b)||!d.isString(b)||!a)return c;if(""===b)return a;var e=b.split("."),f=e.splice(0,1)[0];return a.hasOwnProperty(f)?d.get(a[f],e.join("."),c):c},d.isFunction=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return!1}},d.isNone=function(a){return null===a||void 0===a},d.isString=function(a){return"[object String]"===j.call(a)},d.isNumber=function(a){return"[object Number]"===j.call(a)},d.isDate=function(a){return"[object Date]"===j.call(a)},d.isObject=function(a){return"[object Object]"===j.call(a)},d.isArray=function(a){return"[object Array]"===j.call(a)},d.isElement=function(a){return!d.isNone(a)&&!d.isNone(a.nodeType)&&1===a.nodeType},d.isEmptyObject=function(a){if(d.isObject(a)){for(var b in a)if(g.hasOwnProperty.call(a,b))return!1;return!0}return!1},d.bool=function(a){return d.isNone(a)?null:"true"===a||"1"===a||1===a||a===!0?!0:"false"===a||"0"===a||0===a||a===!1?!1:null},d.assert=function(a,b){if(!a)throw b||"Assertion Failed"},d.getUUID=function(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)})},d.getTimestamp=function(){var a=new Date;return a.getTime()},d.trim=function(a){return a.replace(/^\s+|\s+$/g,"")},d.capitalize=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},d.camelCase=function(a){var b=a.split("-");return b.length>1&&(a=b[0],a+=d.map(b.slice(1),function(a){return a[0].toUpperCase()+a.substr(1)}).join("")),a},d.truncate=function(a,b){return a?(b=b?b:50,a.lengthc;c++)b=31*b+a.charCodeAt(c)<<0;return(Math.pow(2,31)+b).toString()},d.rgbToHex=function(a,b,c){return"#"+((1<<24)+(a<<16)+(b<<8)+c).toString(16).slice(1)},c.EMB_DEBUG===!0&&(window._=d),b.exports=d},{conf:"AqyHQT"}],16:[function(a,b){var c=a("./utils.js"),d=a("./dom.js"),e=a("./browser.js"),f=function(){this.init()};f.prototype.init=function(){this._elements=[],this._listening=!1},f.prototype.viewable=function(a){if(!a.getBoundingClientRect)return!0;var b;try{b=a.getBoundingClientRect()}catch(c){return!1}return b.bottom>=0&&b.right>=0&&b.top<=(window.innerHeight||document.documentElement.clientHeight)&&b.left<=(window.innerWidth||document.documentElement.clientWidth)},f.prototype.check=function(){this.freeze=!0;var a=[];c.each(this._elements,c.bind(function(b,c){if(this.viewable(b.elem)){try{b.func.call(this)}catch(d){e.console.log(d)}a.push(c)}},this)),c.each(a,function(a){this._elements.splice(a,1)},this),0===this._elements.length&&this.stop(),this.freeze=!1},f.prototype.stop=function(){try{d.detachEvent(window,"DOMContentLoaded",this.handler),d.detachEvent(window,"load",this.handler),d.detachEvent(window,"resize",this.handler),d.detachEvent(window,"scroll",this.handler)}catch(a){}this.handler=null,this._listening=!1},f.prototype.listen=function(){return this._listening?!1:(this._listening=!0,this.handler=c.bind(function(){!this.freeze&&this._elements.length&&this.check()},this),d.addEvent(window,"DOMContentLoaded",this.handler),d.addEvent(window,"load",this.handler),d.addEvent(window,"resize",this.handler),void d.addEvent(window,"scroll",this.handler))},f.prototype.on=function(a,b,c){"viewable"===a&&(this._elements.push({elem:b,func:c}),this.listen(),this.check())},b.exports=f},{"./browser.js":2,"./dom.js":5,"./utils.js":15}],conf:[function(a,b){b.exports=a("AqyHQT")},{}],AqyHQT:[function(a,b){!function(a){a.EMB_DEBUG=!1,a.EMB_HTTPS="https:"===window.location.protocol?!0:!1,a.EMB_ORIGIN=(a.EMB_HTTPS?"https":"http")+"://cdn.embedly.com",a.EMB_FRAME_SRC=a.EMB_ORIGIN+"/widgets/",a.EMB_SECURE_FRAME_SRC="https://cdn.embedly.com/widgets/",a.EMB_POST_MESSAGE=!!window.postMessage,a.EMB_PROGRESS=!0,a.EMB_APP_API="https://app.embed.ly",a.EMB_API_KEY="fd92ebbc52fc43fb98f69e50e7893c13";var b=window.location.pathname.split(".")[0].split("/");a.EMB_GROUP=b[b.length-1].toLowerCase(),a.PAGE_PROGRESS_DOMAINS=[]}("undefined"==typeof b?this.conf={}:b.exports)},{}],19:[function(a){if(window.embedly&&window.embedly.look)return window.embedly.look(),!1;var b=a("./common/iframe.js"),c=a("./common/browser.js"),d=a("./common/utils.js"),e=a("./common/a.js"),f=a("./common/dom.js"),g=a("./common/ready.js"),h=a("./common/mutations.js"),i=a("./common/swap.js"),j=a("./common/meta.js"),k=a("./common/json.js"),l=a("./common/viewport.js"),m=a("./common/page.js"),n=a("./common/recommend.js"),o=new e,p=new l;n.connect(o);var q=function(){var a=/emb_(\d+)/.exec(c.location.hash());return a?a[1]:null},r={cardSelectors:[{selector:".embedly-card"}],buttonSelectors:[".embedly-button"],analytics:null,recommend:!1,shared:q()},s=function(a){var b;try{b=k.parse(a.data)}catch(d){return c.console.error(d),!1}o.notify("window.message",a,b)};f.addEvent(window,"message",s);var t=function(a,c,e){var f;if(d.isFunction(c)&&(e=c,c={}),d.isString(a))return".embedly-card"===a?!1:(r.cardSelectors.push({selector:a}),B(),!0);if(!d.isElement(a)&&d.isObject(a)){if(!a.selector&&!a.types)return!1;var g={};if(d.isArray(a.types)&&a.types.length>0&&(g.types=a.types),a.selector)g.selector=a.selector,r.cardSelectors.push(g);else{var h=r.cardSelectors.reduce(function(a,b){return".embedly-card"===b.selector?b:a},{});if(!h)return!1;h.types=g.types}}return!d.isElement(a)||"a"!==a.nodeName.toLowerCase()&&"blockquote"!==a.nodeName.toLowerCase()||(f=b.createCard(a,c,o)),f&&(f.one("card.rendered",function(){o.notify("card.rendered",f.elem,f),p.on("viewable",f.elem,function(){f.send("card.view")})}),f.on("resize",function(){o.notify("card.resize",f.elem,f)})),d.isFunction(e)&&e.call(f,f),o.notify("card.created",f),f},u=function(a){var c;return d.isString(a)?(r.buttonSelectors.push(a),B(),!0):(d.isElement(a)&&"a"===a.nodeName.toLowerCase()&&(c=b.createButton(a,o)),o.notify("button.created",c),c)},v=function(a,c){var e;e=d.isString(a)?{url:a}:a;var f=b.createCardModal(e,o);return d.isFunction(c)&&c.call(f,f),f},w=function(a){if("1"===f.data(a,"connected"))return!1;f.data(a,"connected","1");var c=b.connect({elem:a},o);c.one("media.ready",function(){c.ready(),p.on("viewable",c.elem,function(){c.send("media.view")}),o.notify("recommend.add",c),o.notify("media.ready",c)}),c.send("media.ready")},x=function(a){return a&&a.key?(r.analytics=a,void B()):!1},y=function(){o.notify("recommend"),B()},z=function(a,b){return"."===a.substr(0,1)?f.hasClass(b,a.substr(1))?!0:!1:d.contains(f.all(a),b)?!0:!1},A=function(a){if(("A"===a.nodeName||"BLOCKQUOTE"===a.nodeName)&&d.each(r.cardSelectors,function(b){z(b.selector,a)&&t(a,b)}),"A"===a.nodeName&&d.each(r.buttonSelectors,function(b){z(b,a)&&u(a)}),"IFRAME"===a.nodeName)if("embedly-embed"===a.className)w(a);else if(a.src&&/\/\/cdn\.embedly\.com\/widgets\/media\.html/.test(a.src))w(a);else if(null!==r.analytics&&r.analytics.replace){var b=i.replace(a,r.analytics);null!==b&&w(b)}},B=function(){d.each(r.cardSelectors,function(a){d.each(f.all(a.selector),function(a){A(a)})}),d.each(r.buttonSelectors,function(a){d.each(f.all(a),function(a){A(a)})}),d.each(f.all("iframe"),function(a){A(a)}),o.notify("look.done")};o.on("mutation.insert.a",A),o.on("mutation.insert.blockquote",A),o.on("mutation.insert.iframe",A),o.on("media.ready",function(a){j.send("media.meta",a)}),o.on("card.rendered",function(a,b){j.send("card.meta",b)}),o.on("card.rendered",function(a,b){if(!r.shared)return!1;if(!b.query||!b.query.url)return!1;var e=d.hash(b.query.url);return e!==r.shared?!1:(r.shared=null,void setTimeout(function(){var a=f.rect(b.elem);return a&&a.top?void c.animateScroll(a.top-5,500):!1},500))});var C=function(a,b){o.on(a,b)},D=function(a,b){o.off(a,b)},E=function(){f.detachEvent(window,"message",s),h.stop(),o.data={},window.embedly=null},F=function(){var a=Array.prototype.slice.call(arguments,0);if(0===a.length)return null;var b=a.splice(0,1)[0];switch(b){case"card":return t.apply(window,a);case"button":return u.apply(window,a);case"modal":return v.apply(window,a);case"look":return B.apply(window,a);case"on":return C.apply(window,a);case"off":return D.apply(window,a);case"kill":return E.apply(window,a);case"analytics":return x.apply(window,a);case"recommend":return y.apply(window,a)}return null},G=[];window.embedly&&d.isFunction(window.embedly)&&d.isArray(window.embedly.q)&&(G=window.embedly.q),window.embedly=function(){return F.apply(window,arguments)},window.embedly.card=function(a){return t(a)},window.embedly.button=function(a){return u(a)},window.embedly.modal=function(a){return v(a)},window.embedly.look=function(a){return B(a)},d.each(G,function(a){window.embedly.apply(window,a)}),h.connect(o),m.connect(o),g.bind(B),B(),d.isFunction(window.onEmbedlyReady)&&window.onEmbedlyReady.apply(this,[window.embedly])},{"./common/a.js":1,"./common/browser.js":2,"./common/dom.js":5,"./common/iframe.js":6,"./common/json.js":7,"./common/meta.js":8,"./common/mutations.js":9,"./common/page.js":10,"./common/ready.js":11,"./common/recommend.js":12,"./common/swap.js":13,"./common/utils.js":15,"./common/viewport.js":16}]},{},[19])}(); \ No newline at end of file +!function(){var a=function b(c,d,e){function f(h,i){if(!d[h]){if(!c[h]){var j="function"==typeof a&&a;if(!i&&j)return j(h,!0);if(g)return g(h,!0);throw new Error("Cannot find module '"+h+"'")}var k=d[h]={exports:{}};c[h][0].call(k.exports,function(a){var b=c[h][1][a];return f(b?b:a)},k,k.exports,b,c,d,e)}return d[h].exports}for(var g="function"==typeof a&&a,h=0;ha};0>k&&(l=function(b){return a>b});var m=function(){clearInterval(c),h.console.log("duration",(new Date).getTime()-i),e.detachEvent("scroll",d)};c=setInterval(function(){return f+=k,l(f)?(m(),!1):(window.scrollTo(0,f),void(j=!0))},10),d=function(){j&&f!==h.window.scrollY()&&m()},e.addEvent("scroll",d)},b.exports=h},{"./dom.js":7,"./urlparse.js":26,"./utils.js":27,conf:"d0R7L1"}],6:[function(a,b,c){var d=a("./iframes/comms.js").one,e=a("./utils.js"),f={started:!1,instance:null};f.EVENTS=["xcomm.options.access","xcomm.media.recommend","xcomm.card.recommend","xcomm.user.set","xcomm.user.get","xcomm.user.remove","xcomm.log.event","xcomm.page.progress"],f.clear=function(){f.instance&&(f.instance.remove(),f.instance=null),f.started=!1},f.connect=function(a,b){if(!a||f.started)return!1;f.started=!0;var c=d(a,b);return f.instance=c,e.each(f.EVENTS,function(b){c.on(b,function(c){a.notify(b+".response",c)}),a.on(b,function(a){c.send(b,a)})}),c.on("xcomm.ready",function(b){a.notify("xcomm.ready",b)}),c},b.exports=f},{"./iframes/comms.js":13,"./utils.js":27}],7:[function(a,b,c){var d=a("./utils.js"),e=a("conf"),f={};f.toArray=function(a){return d.map(a,function(a){return a})},f.all=function(a){var b=[];return document.querySelectorAll?f.toArray(document.querySelectorAll(a)):b},f.one=function(a,b){var c=f.all(a,b);return 0===c.length?null:c[0]},f.create=function(a,b,c,e){if(!a||!d.isString(a))return null;d.isString(b)&&d.isNone(c)&&(c=b,b={});var g;return g=e?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a),d.each(b,function(a,b){g.setAttribute(b,a)}),c&&f.text(g,c),g},f.set=function(a,b,c){if(!a||!d.isString(a))return null;d.isString(b)&&d.isNone(c)&&(c=b,b={});var e=f.one(a);return e?(d.each(b,function(a,b){e.setAttribute(b,a)}),d.isNone(c)||f.text(e,c),e):null},f.replace=function(a,b){d.assert(d.isElement(a),"replace requires an element to be replaced"),d.assert(d.isElement(b),"replace requires an element to replace with."),a.parentNode.replaceChild(b,a)},f.remove=function(a){return d.isElement(a)&&d.isElement(a.parentNode)?void a.parentNode.removeChild(a):!1},f.hide=function(a){return d.isString(a)&&(a=f.one(a)),d.isElement(a)&&(a.style.display="none"),a},f.show=function(a,b){return d.isString(a)&&(a=f.one(a)),d.isElement(a)&&(a.style.display=b?"inline-block":"block"),a},f.svg=function(a,b,c){return f.create(a,b,c,"http://www.w3.org/2000/svg")},f.children=function(a,b){return d.isElement(a)?d.reduce(a.childNodes,function(a,c){if(d.isElement(c)){if(!d.isNone(b))if(c.namespaceURI&&"http://www.w3.org/2000/svg"===c.namespaceURI){if(c.nodeName!==b)return a}else if(b.toUpperCase()!==c.nodeName)return a;a.push(c)}return a},[]):[]},f.child=function(a,b){var c=f.children(a,b);return 0!==c.length?c[0]:null},f.text=function(a,b){if(d.isString(a)&&(a=f.one(a)),!a||!d.isElement(a))return null;if(d.isNone(b))return a.innerText||a.textContent;var c=void 0===a.textContent?"innerText":"textContent";a[c]=b},f.hasClass=function(a,b){if(d.isString(a)&&(a=f.one(a)),!d.isElement(a)||!d.isString(b)||!b)return!1;var c=a.getAttribute("class");return d.isNone(c)?!1:(" "+c+" ").indexOf(" "+b+" ")>-1?!0:!1},f.addClass=function(a,b){if(d.isString(a)&&(a=f.one(a)),!d.isElement(a)||!d.isString(b)||!b)return!1;if(f.hasClass(a,b))return!1;var c=a.getAttribute("class");if(d.isNone(c))return a.setAttribute("class",b),!0;var e=c.split(" "),g=[];return d.map(e,function(a){var b=d.trim(a);""!==b&&g.push(b)}),g.push(b),a.setAttribute("class",g.join(" ")),!0},f.removeClass=function(a,b){if(d.isString(a)&&(a=f.one(a)),!d.isElement(a)||!d.isString(b)||!b)return!1;var c=a.getAttribute("class");if(d.isNone(c))return!1;var e=!1,g=d.reduce(c.split(" "),function(a,c){var f=d.trim(c);return f?f===b?(e=!0,a):(a.push(f),a):a},[]);return a.setAttribute("class",g.join(" ")),e},f.data=function(a,b,c){d.assert(a&&d.isElement(a),"dom.data needs an element."),d.assert(b&&d.isString(b),"dom.data needs an attr.");var e=d.camelCase(b);return d.isNone(c)?d.isNone(a.dataset)?a.getAttribute("data-"+b):d.isNone(a.dataset[e])?null:a.dataset[e]:void(d.isNone(a.dataset)?a.setAttribute("data-"+b,c):a.dataset[e]=c)},f.attrize=function(a){return a&&d.isObject(a)?d.map(a,function(a,b){return b+'="'+a+'"'}).sort().join(" "):""},f.event=function(a){var b=d.extend({},a||window.event);return b.target||(b.target=b.srcElement||document),3===b.target.nodeType&&(b.target=b.target.parentNode),!a.metaKey&&a.ctrlKey&&(b.metaKey=b.ctrlKey),b.stop=function(){a.preventDefault?a.preventDefault():a.returnValue=!1},b.pageX||b.pageY||!b.clientX&&!b.clientY||(b.pageX=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,b.pageY=b.clientY+document.body.scrollTop+document.documentElement.scrollTop),b},f.addEvent=function(a,b,c){d.isNone(a)||(a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c)},f.detachEvent=function(a,b,c){d.isNone(a)||(a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent?a.detachEvent("on"+b,c):a["on"+b]=null)},f.trigger=function(a,b){d.assert(d.contains(["click"],b),"Not a valid event");var c;a.dispatchEvent?(c=document.createEvent("MouseEvents"),c.initEvent(b,!0,!0),a.dispatchEvent(c,!0)):(c=document.createEventObject(),a.fireEvent("on"+b,c))},f.rect=function(a){try{return a.getBoundingClientRect()}catch(b){}return!1},e.EMB_DEBUG===!0&&(window.dom=f),b.exports=f},{"./utils.js":27,conf:"d0R7L1"}],8:[function(a,b,c){var d=a("./utils.js"),e=a("./swap.js"),f=a("./dom.js"),g=a("./mutations.js"),h={timeout:null,hub:null,selectors:{cards:[{selector:".embedly-card"}],button:[".embedly-button"],slideshow:[".embedly-slideshow"]},analytics:null,_queue:[]};h.add={},h.add.cards=function(a){if(d.isString(a)){if(".embedly-card"===a)return!1;h.selectors.cards.push({selector:a})}else if(!d.isElement(a)&&d.isObject(a)){if(!a.selector&&!a.types)return!1;var b={};if(d.isArray(a.types)&&a.types.length>0&&(b.types=a.types),a.selector)b.selector=a.selector,h.selectors.cards.push(b);else{var c=h.selectors.cards.reduce(function(a,b){return".embedly-card"===b.selector?b:a},{});if(!c)return!1;c.types=b.types}}h.look()},h.add.button=function(a){d.isString(a)&&(h.selectors.button.push(a),h.look())},h.select=function(a,b){return"."===a.substr(0,1)?f.hasClass(b,a.substr(1))?!0:!1:d.contains(f.all(a),b)?!0:!1},h.each=function(a){var b,c;if("A"===a.nodeName||"BLOCKQUOTE"===a.nodeName)for(b=0;b600?this.frame.elem.style.width="600px":this.frame.elem.style.width=i.offsetWidth+"px");var j=f.create("div",{"class":"embedly-card"});j.appendChild(this.frame.elem),i.insertBefore(j,b),e.wait(this.done,this)},n.prototype.done=function(a){var b=a[0].iframe,c=a[0].doc,d=a[1],e={};if(3===a.length&&(e=a[2].media),this.options.sandbox===!1)this.frame.ready(),this.frame.send("card.create",{options:this.options,extract:d,media:e});else{var f=function(a,b,d,f){return function(a){f.__tunnel=new l.Tunnel(f.__hub),a.create(c.body,{options:b,extract:d,media:e,tunnel:f.__tunnel})}},g=f(b,this.options,d,this.frame);b.contentWindow.cards?g(b.contentWindow.cards):b.contentWindow.onCardsReady=g}this.frame.options=this.options,this.frame.extract=d,this._done(this.frame)},m.fetch=function(a,b,c,f){c=e.map(b,function(a){return e.extend({},m.options(a),c)});var g=new h,i=[];c=e.reduce(c,function(c,d,e){var f=new n(a,b[e],d,g.callback());return m.extractless.test(d.url)?f.extract({}):f.error||c.push(d),i.push(f),c},[]);var j=e.reduce(c,function(a,b){return a.push(b.url),b.embed&&a.push(b.embed),a},[]);if(!j.length)return e.isFunction(f)&&f(e.map(i,function(a){return a.frame})),e.map(i,function(a){return a.frame});var k={card:1,v:1,youtube_showinfo:0},l=window.location.protocol;return c.protocol&&(l=c.protocol),l=l.split(":")[0],e.contains(["http","https"],l)||(l="https"),k.scheme=l,d.api().extract(j,k,function(a){e.each(a,function(a){e.each(i,function(b){b.options.url===a.original_url?b.extract(a):b.options.embed===a.original_url&&b.media(a)})})}),g.wait(function(a){f(a)}),e.map(i,function(a){return a.frame})},m.build=function(a,b,c){var d=i.create("card",c,b,m.attrs,m.styles);return d.on("card.repeat",function(a){var b={url:a.url,via:document.location.toString()};e.each(["image","embed","title","description","lang"],function(c){a.hasOwnProperty(c)&&(b[c]=a[c])}),c.notify("modal.create",b)}),d.on("card.ready",function(){d.ready()}),d.on("card.rendered",function(b){if(d.type=b.type,"error"===b.name)return d.__hub.notify("card.error",a),d.remove(),!1;if(a._em_opts){var g=e.extend({},a._em_opts);if(delete a._em_opts,e.isArray(g.types)&&g.types.length>0&&!e.contains(g.types,b.type))return d.__hub.notify("card.error",a),d.remove(),!1}d.rendered=!0,!d.options.twitter_via&&b.defaultTwitterVia&&(d.options.twitter_via=b.defaultTwitterVia);var h=d.elem.parentNode;d.elem.style.display="block",d.elem.style.margin="0",d.elem.style.padding="0",d.elem.style.visibility="visible",d.elem.style.position="relative",b.height?d.elem.height=b.height:d.elem.height="300",b.width?d.elem.width=b.width:d.elem.width="600",h.style.width=d.elem.width+"px",h.style.margin="5px auto",h.style.padding="0",h.style.position="relative",h.style.maxWidth="100%",d.elem.style.width=null,d.elem.style.height=null,d.elem.style.maxWidth="100%",d.elem.style.minWidth="200px",f.remove(a),"error"!==b.type&&(c.notify("card.rendered",d.elem,d),b.controls&&j.card(d))}),d.one("card.error",function(a){c.notify("card.error",a)}),d.on("resize",function(){c.notify("card.resize",d.elem,d)}),d.on("log.event",function(a){k.event(a)}),d.on("pinterest.log",function(){c.notify("pinterest.log")}),d},m.multi=function(a,b,c){a=e.reduce(a,function(a,b){return i.rendering(b)?a:(a.push(b),a)},[]);var d={protocol:window.location.protocol};return m.fetch(b,a,d,function(a){e.isFunction(c)&&c(a)})},m.one=function(a,b,c,d){if(i.rendering(a))return null;b=e.extend({},b?b:{}),b.protocol=window.location.protocol;var f=m.fetch(c,[a],b,function(a){e.isFunction(d)&&d(a[0])});return f[0]},b.exports=m},{"../api.js":4,"../dom.js":7,"../keeper.js":16,"../log/front.js":17,"../share.js":23,"../tunnels.js":25,"../urlparse.js":26,"../utils.js":27,"./base.js":10}],13:[function(a,b,c){var d=a("../utils.js"),e=a("../dom.js"),f=a("../urlparse.js"),g=a("./base.js"),h=a("conf"),i={attrs:{frameborder:"0",allowtransparency:"true"},styles:{border:"none",position:"absolute",top:"-9999em",width:"10px",height:"10px"}};i.one=function(a,b){var c=d.getUUID();d.assert(b.name),b=d.extend({sid:c},b?b:{});var j=d.extend({},i.attrs);j.id="emb_xcomm",j["class"]="embedly-xcomm",j.src=h.EMB_SECURE_FRAME_SRC+"xcomm.html#"+f.createQuery(b);var k=e.create("iframe",j);d.each(i.styles,function(a,b){k.style[b]=a});var l=g.connect(c,k,a);return l.on("xcomm.ready",function(){l.ready()}),document.body.appendChild(k),l},b.exports=i},{"../dom.js":7,"../urlparse.js":26,"../utils.js":27,"./base.js":10,conf:"d0R7L1"}],14:[function(a,b,c){var d=a("../utils.js"),e=a("../dom.js"),f=a("../browser.js"),g=a("./base.js"),h=a("../tunnels.js"),i={name:"modal",attrs:{frameborder:"0",allowtransparency:"true"},styles:{border:"none",position:"fixed",top:"0",left:"0",zIndex:"2147483647"}};i.one=function(a,b){if(d.isNone(a)&&(a={url:document.location.toString()}),d.isNone(a.url)&&(a.url=document.location.toString()),a.protocol=window.location.protocol,"window"===a.target)return f.open("http://cdn.embedly.com/widgets/embed?url="+encodeURIComponent(a.url),"Embed Code",635,500),!1;a.t="card";var c=g.create("modal",b,a,i.attrs,i.styles);return c.on("modal.load",function(b){var d=function(a,b){return function(c){a.__tunnel=new h.Tunnel(a.__hub),c.create(b,a.__tunnel)}},e=d(c,a);b.contentWindow.modals?e(b.contentWindow.modals):b.contentWindow.onModalsReady=e}),c.elem.style.width=f.window.innerWidth()+"px",c.elem.style.height=f.window.innerHeight()+"px",e.addEvent(window,"resize",function(){c.elem.style.width=f.window.innerWidth()+"px",c.elem.style.height=f.window.innerHeight()+"px"}),c.on("modal.close",function(){document.body.removeChild(c.elem)}),c.on("modal.ready",function(){c.ready()}),document.body.appendChild(c.elem),c},b.exports=i},{"../browser.js":5,"../dom.js":7,"../tunnels.js":25,"../utils.js":27,"./base.js":10}],15:[function(a,b,c){var d=a("../utils.js"),e=a("../api.js"),f=a("../dom.js"),g=a("../keeper.js"),h=a("./base.js"),i=a("../tunnels.js"),j={name:"slideshow",attrs:{frameborder:"0",scrolling:"no",allowtransparency:"true",allowfullscreen:"true"},styles:{width:"1px",height:"0px",border:"none",position:"absolute",visibility:"hidden"},opts:["schema","lang","width","align"]};j.options=function(a,b){if(!d.isElement(a)||!d.isElement(a.parentNode))return null;var c=d.reduce(j.opts,function(a,c){return b.hasOwnProperty(c)&&(a[c]=b[c]),a},b.options?b.options:{});return d.reduce(j.opts,function(b,c){var e=f.data(a,"slideshow-"+c);return d.isNone(e)||(b[c]=e),b},c)},j.urls=function(a,b){return d.isArray(b.urls)&&b.urls.length>0?b.urls:d.reduce(f.children(a,"blockquote"),function(a,b){if("BLOCKQUOTE"===b.nodeName){var c=f.child(b,"h4");if(!d.isNone(c)){var e=f.child(c,"a");d.isNone(e)||a.push(e.href)}}return a},[])},j.fetch=function(a,b){var c={card:1,v:1};e.api().extract(a,c,function(a){b(a)})},j.build=function(a,b,c){var d=b[0].iframe,e=b[0].doc,f=b[1],g=function(a,b,c){return function(d){a.__tunnel=new i.Tunnel(a.__hub),d.create(e.body,{options:b,extract:c,tunnel:a.__tunnel})}},h=g(c,a,f);d.contentWindow.slideshows?h(d.contentWindow.slideshows):d.contentWindow.onSlideshowsReady=h},j.one=function(a,b,c){if(!d.isElement(a))return null;if(b=b?b:{},h.rendering(a))return null;var e=j.options(a,b),i=j.urls(a,b);if(null===e||0===i.length)return null;var k=h.create("slideshow",c,e,j.attrs,j.styles),l=new g,m=l.callback(),n=l.callback();return l.wait(function(a){j.build(e,a,k)}),k.on("slideshow.load",function(a,b){m({iframe:a,doc:b})}),j.fetch(i,n),a.parentNode.insertBefore(k.elem,a),k.on("slideshow.ready",function(){k.ready()}),k.on("slideshow.rendered",function(b){return k.ready(),"error"===b.name?(k.remove(),k.__hub.notify("slideshow.error",a),!1):(k.rendered=!0,k.elem.style.display="block",k.elem.style.margin="10px auto",k.elem.style.visibility="visible",k.elem.style.position="relative",k.elem.width="700",b.height?k.elem.height=b.height:k.elem.height="500",b.width?k.elem.width=b.width:k.elem.width="700",k.elem.style.width=null,k.elem.style.height=null,k.elem.style.maxWidth="99%",k.elem.style.minWidth="300px",void f.remove(a)); + +}),k},b.exports=j},{"../api.js":4,"../dom.js":7,"../keeper.js":16,"../tunnels.js":25,"../utils.js":27,"./base.js":10}],16:[function(a,b,c){var d=a("./utils.js"),e=function(){this.init()};e.prototype.init=function(){this.len=0,this.count=0,this.results={},this.finished=!1,this.started=!1},e.prototype.callback=function(){var a=this.len;return this.len++,d.bind(function(b){this.each(a,b)},this)},e.prototype.done=function(){if(!this.started)return!1;if(this.finished)return!0;if(this.count===this.len){this.finished=!0;for(var a=[],b=0;b15552e6?h.setUID(b.u):b.u},h.setUID=function(a){var b={u:d.isNone(a)?d.getUUID():a,t:d.getTimestamp()},c=encodeURIComponent(e.createQuery(b));return f.cookie.set(h.COOKIE_NAME,c,365),c=f.cookie.get(h.COOKIE_NAME),d.isNone(c)?0:(b=e.parseQuery(decodeURIComponent(c)),b.u)},h.uid=h.getUID(),h.release=function(){var a=h._queue;h._queue=[],f.console.log("log.release",a),h.hub.notify("xcomm.log.event",{events:a})},h.queue=function(a){clearTimeout(h.timeout),h._queue.push(a),h.comms()&&(h.timeout=setTimeout(function(){h.release()},50))},h.event=function(a){var b={uid:h.uid,sid:h.sid,t:d.getTimestamp()};window.self===window.top?(b.r=document.location.toString(),b.rr=document.referrer):b.r=document.referrer,d.assert(a.g),d.assert(a.c),d.assert(a.a),b=d.extend({},b,a),h.queue(b)},h.comms=function(){return h.connected?!0:h.connecting?!1:(h.connecting=!0,h.hub.one("xcomm.ready",function(){h.connected=!0,h.release()}),void g.connect(h.hub,{name:h.name}))},h.connect=function(a,b){h.name=b,a.on("log.event",function(a){h.event(a)}),h.hub=a},b.exports=h},{"../browser.js":5,"../comms.js":6,"../urlparse.js":26,"../utils.js":27}],18:[function(a,b,c){var d=a("./browser.js"),e=a("./utils.js"),f=a("./dom.js"),g={_data:null};g.COOKIE_NAME="em_p_uid",g.format=function(a){return a&&e.isObject(a)?e.map(a,function(a,b){return b+":"+a}).sort().join("|"):null},g.parse=function(a){if(!a)return null;var b;return e.reduce(a.split("|"),function(a,c){return null===a?null:(b=c.split(":"),2!==b.length?null:(a[b[0]]=b[1],a))},{})},g.timestamp=function(a){var b;try{b=parseInt(a,10)}catch(c){return!1}return b},g.get=function(){var a=d.cookie.get(g.COOKIE_NAME);if(e.isNone(a))return g.set();var b=g.parse(a),c=g.timestamp(b.t);return c===!1?g.set():e.getTimestamp()-c>15552e6?g.set({u:b.u,l:b.l}):b},g.set=function(a){var b={u:e.getUUID(),t:e.getTimestamp(),l:0};a&&(b=e.extend(b,a));var c=g.format(b);return d.cookie.set(g.COOKIE_NAME,c,365,"https:"===window.location.protocol),c=d.cookie.get(g.COOKIE_NAME),e.isNone(c)?null:g.parse(c)},g.update=function(a){var b=g.get();return b?(b=e.extend(b,a),g.set(b)):!1},g.data=function(){if(g._data)return g._data;var a={mt:e.getTimestamp(),mr:document.referrer,msw:d.window.innerWidth(),msh:d.window.innerHeight()},b=g.get();return b?(a.muu=b.u,a.mut=b.t,a.mul=b.l):a.muu=0,g._data=a,g.update({l:e.getTimestamp()}),g._data},g.send=function(a,b){if(!b||!e.isElement(b.elem))return!1;var c=e.extend(g.data(),{}),d=f.rect(b.elem);d&&(c.mft=d.top,c.mfl=d.left,c.mfw=d.width,c.mfh=d.height),b.send(a,c)},b.exports=g},{"./browser.js":5,"./dom.js":7,"./utils.js":27}],19:[function(a,b,c){var d=a("./dom.js"),e=a("./utils"),f={_event:null,_observer:null};f.nodeNames=["iframe","a","blockquote"],f.html=function(){var a=document.getElementsByTagName("html");return 0===a.length?null:a[0]},f.recurse=function(a){var b=[];return e.isElement(a)&&b.push(a),e.reduce(a.childNodes,function(a,b){return e.isElement(b)?a.concat(f.recurse(b)):a},b)},f.observer=function(a){var b=f.html();if(null===b)return!1;if(!window.MutationObserver)return!1;f._observer=new window.MutationObserver(function(b){e.each(b,function(b){if("childList"===b.type&&b.addedNodes){var c=Array.prototype.slice.call(b.addedNodes);e.each(c,function(b){e.each(f.recurse(b),function(b){b.nodeName&&e.contains(f.nodeNames,b.nodeName.toLowerCase())&&a.notify("mutation.insert."+b.nodeName.toLowerCase(),b)})})}})});var c={childList:!0,subtree:!0};return f._observer.observe(b,c),!0},f.events=function(a){var b=f.html();return null===b?!1:(f._event=function(b){e.each(f.recurse(b.target),function(b){b.nodeName&&e.contains(f.nodeNames,b.nodeName.toLowerCase())&&a.notify("mutation.insert."+b.nodeName.toLowerCase(),b)})},d.addEvent(b,"DOMNodeInserted",f._event),!0)},f.stop=function(){var a=f.html();return null===a?!1:(f._event&&(d.detachEvent(a,"DOMNodeInserted",f._event),f._event=null),void(f._observer&&(f._observer.disconnect(),f._observer=null)))},f.connect=function(a){return f._event||f._observer?!1:void(f.observer(a)||f.events(a))},b.exports=f},{"./dom.js":7,"./utils":27}],20:[function(a,b,c){var d=a("./utils.js"),e=a("./urlparse.js"),f=a("./comms.js"),g=a("conf"),h={started:!1};h.connect=function(a,b){var c=e.getDomain(document.location.toString());if(!b&&g.PAGE_PROGRESS_DOMAINS&&!d.contains(g.PAGE_PROGRESS_DOMAINS,c))return!1;if(h.started)return!1;h.started=!0;var i=function(){a.notify("xcomm.page.progress")};f.started?i():(f.connect(a,{name:"platform"}),a.one("xcomm.ready",i))},b.exports=h},{"./comms.js":6,"./urlparse.js":26,"./utils.js":27,conf:"d0R7L1"}],21:[function(a,b,c){var d=a("./utils.js"),e=a("./dom.js"),f=function(){this.init()};f.prototype.init=function(){var a=this;document.addEventListener?document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,!1),a.ready()},!1):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",arguments.callee),a.ready())}),document.documentElement.doScroll&&window===window.top&&!function(){if(!a.isReady){try{document.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a.ready()}}()),e.addEvent(window,"load",a.ready)},f.prototype.ready=function(){return this.isReady?!1:(this.isReady=!1,void(this.callback&&this.callback()))},f.prototype.bind=function(a){this.isReady&&a(),this.callback=a},f.prototype.elem=function(a,b,c){var d=!1,f=function(){d===!1&&(d=!0,b.call(c))};a.onload=f,e.addEvent(a,"load",f),a.onreadystatechange=function(){var b=a.readyState;("loaded"===b||"complete"===b)&&(a.onreadystatechange=null,f())}},f.prototype.firstNode=function(){var a=document.getElementsByTagName("head")[0],b=e.child(a,"link");if(b)return b;var c=e.child(a,"style");if(c)return c;var d=e.child(a,"script");return d?d:null},f.prototype.script=function(a,b,c,e){var f=this.firstNode(),g=document.createElement("script");return g.type="text/javascript",g.src=a,d.isNone(e)||d.each(e,function(a,b){g.setAttribute(b,a)}),this.elem(g,b,c),f.parentNode.insertBefore(g,f),g},f.prototype.css=function(a,b,c){var d=this.firstNode(),e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=a,this.elem(e,b,c),d.parentNode.insertBefore(e,d)},b.exports=new f},{"./dom.js":7,"./utils.js":27}],22:[function(a,b,c){var d=a("./urlparse.js"),e={data:{},results:{},enabled:!1};e.show=function(a){var b=e.data[a],c=e.results[a];e.hub.notify("recommend.show",b,c)},e.add=function(a){var b=d.getQuery(a.elem.src);e.data[b.url]=a,e.enabled&&(a.on("media.recommend",function(c){e.results[c.url]=c.results,a.on("pause",function(){e.show(b.url)}),a.send("addEventListener",{context:"player.js",version:"0.0.8",method:"addEventListener",value:"pause",listener:a.elem.src})}),a.send("media.recommend",{key:b.key,url:b.url}))},e.connect=function(a){a.on("recommend",function(){e.enabled=!0}),a.on("recommend.add",function(a){e.add(a)}),e.hub=a},b.exports=e},{"./urlparse.js":26}],23:[function(a,b,c){var d=a("./utils.js"),e=a("./dom.js"),f=a("./ready.js"),g=a("./urlparse.js"),h=a("./log/front.js"),i=a("conf"),j={_css:!1,hub:null};j.connect=function(a){j.hub=a},j.log=function(a,b){j.hub.notify("log.event",{u:a,g:"card",a:"click",c:b,l:d.hash(h.sid)})},j.url=function(a){var b=["embd",d.hash(a),d.hash(h.sid)].join(":");return g.addHash(document.URL,b)},j.buttons=function(a){var b,c=e.create("div",{"class":"embdscl0"});return d.each(["facebook","twitter","pinterest","card","embedly"],function(d){b=e.create("a",{"class":"embd-"+d}),b.innerHTML="",j.buttons[d].call(window,b,a)===!0&&c.appendChild(b)}),c},j.buttons.twitter=function(a,b){var c=b.options.url,f=b.extract.title,h=b.options.twitter_via,i={url:j.url(c)};return f&&(i.text=d.truncate(f,100)),h?i.via="@"===h.substr(0,1)?h.substr(1):h:i.via="embedly",a.href="https://twitter.com/intent/tweet?"+g.createQuery(i),e.addEvent(a,"click",function(c){var d=e.event(c);d.stop(),window.open(a.href,"_blank","width=550,height=410,top=150,left=150"),j.log(b.options.url,"twitter")}),!0},j.buttons.facebook=function(a,b){var c={u:j.url(b.options.url)};return a.href="https://www.facebook.com/sharer/sharer.php?"+g.createQuery(c),e.addEvent(a,"click",function(c){var d=e.event(c);d.stop(),window.open(a.href,"_blank","width=700,height=425,top=150,left=150"),j.log(b.options.url,"facebook")}),!0},j.buttons.pinterest=function(a,b){var c,d="https://www.pinterest.com/pin/create/button/";if(b.options.image)c=b.options.image;else if(b.extract.media&&"photo"===b.extract.media.type)c=b.extract.media.url;else{if(!(b.extract.images&&b.extract.images.length>0))return!1;c=b.extract.images[0].url}return a.href=g.appendQuery(d,{url:j.url(b.options.url),media:c,description:b.extract.title}),e.addEvent(a,"click",function(c){var d=e.event(c);d.stop(),window.open(a.href,"_blank","width=700,height=425,top=150,left=150"),j.log(b.options.url,"pinterest")}),!0},j.buttons.card=function(a,b){return e.addEvent(a,"click",function(a){var c=e.event(a);c.stop();var f={url:b.options.url};d.each(["image","embed","title","description","lang"],function(a){b.options.hasOwnProperty(a)&&(f[a]=b.options[a])}),b.__hub.notify("card.repeat",f),j.log(b.options.url,"repeat")}),!0},j.buttons.embedly=function(a,b){return a.href="http://embed.ly/cards",a.target="_blank",e.addEvent(a,"click",function(){j.log(b.options.url,"whats-this")}),!0},j.css=function(a){if(!j._css){j._css=!0;var b=i.EMB_ORIGIN_BASE+"css/social."+i.EMB_ASSET_VERSION+".css";return f.css(b,a),!1}a()},j.card=function(a){var b=a.elem.parentNode;return!d.isElement(b)||"DIV"!==b.nodeName&&!e.hasClass(b,"embedly-card")?!1:void j.css(function(){var c=j.buttons(a);e.addEvent(b,"mouseenter",function(){e.addClass(c,"embd-active")}),e.addEvent(b,"mouseleave",function(){e.removeClass(c,"embd-active")}),b.appendChild(c),a.__hub.notify("card.share.init")})},b.exports=j},{"./dom.js":7,"./log/front.js":17,"./ready.js":21,"./urlparse.js":26,"./utils.js":27,conf:"d0R7L1"}],24:[function(a,b,c){var d=a("./utils.js"),e=a("./urlparse.js"),f=a("conf"),g={};g.youtube={schema:"youtube",re:/youtube\.com\/embed\/([^\/?#]+)/i,url:function(a){var b=g.youtube.re.exec(a);return 2!==b.length?a:"http://www.youtube.com/watch?v="+b[1]}},g.vimeo={schema:"vimeo",re:/player\.vimeo\.com\/video\/([^\/?#]+)/i,url:function(a){var b=g.vimeo.re.exec(a);return 2!==b.length?a:"http://vimeo.com/"+b[1]}},g.soundcloud={schema:"soundcloud",re:/w\.soundcloud\.com\/player\/\?/,url:function(a){var b=e.getQuery(a);if(b.url){var c=/api\.soundcloud\.com\/tracks\/([^\/?#]+)/.exec(b.url);if(2===c.length)return"https://soundcloud.com/track/"+c[1]}return a}},g.providers=[g.youtube,g.vimeo,g.soundcloud],g.provider=function(a){return d.reduce(g.providers,function(b,c){return c.re.test(a)?c:b},null)},g.replace=function(a,b){if(d.isNone(a)||!d.isElement(a))return null;if("IFRAME"!==a.nodeName)return null;if(!a.src||!d.isString(a.src))return null;if(!b.key)return!1;var c=a.src;c=c.replace(/&/g,"&");var h=g.provider(c);if(null===h)return null;var i="https:"===window.location.protocol?"https:":"http:";"file://"===c.substr(0,7)&&(c=c.substr(5)),"//"===c.substr(0,2)&&(c=i+c);var j=d.extend({},b,{url:h.url(c),src:c,schema:h.schema,type:"text/html"}),k=i+"//cdn.embedly.com/widgets/";f.EMB_DEBUG&&(k=f.EMB_FRAME_SRC);var l=k+"media.html?"+e.createQuery(j);return a.src=l,a},b.exports=g},{"./urlparse.js":26,"./utils.js":27,conf:"d0R7L1"}],25:[function(a,b,c){var d=a("./utils.js"),e={};e.Tunnel=function(a){this.init(a)},e.Tunnel.prototype.init=function(a){this.parent=a,this.child=null,this.ready=!1,this.queue=[]},e.Tunnel.prototype.connect=function(a){this.child=a,this.child.on("receiver.send",d.bind(function(a,b){d.isNone(b)&&(b={}),b.method=a,setTimeout(d.bind(function(){this.parent.notify("message",b)},this),1)},this)),this.ready=!0,this.release()},e.Tunnel.prototype.release=function(){for(var a=0;a2?e.parseQuery(b.slice(1).join("?")):{}},e.appendQuery=function(a,b){if(!a||!d.isString(a))return null;var c=a.split("?"),f=c[0];if(!b||!d.isObject(b)||d.isEmptyObject(b))return a;var g=e.getQuery(a);return g=d.extend(g,b),d.isEmptyObject(g)?a:[f,e.createQuery(g)].join("?")},e.removeQuery=function(a,b){if(!a||!d.isString(a))return null;var c=a.split("?"),f=c[0],g=e.getQuery(a);return g.hasOwnProperty(b)&&delete g[b],d.isEmptyObject(g)?f:[f,e.createQuery(g)].join("?")},e.getOrigin=function(a){if(!a||!d.isString(a))return null;if(!/^https?:\/\//.test(a))return null;var b=a.split("/").slice(0,3).join("/");return-1===b.indexOf(".")?null:b},e.getDomain=function(a){var b=e.getOrigin(a);return b?b.replace(/^https?:\/\//,""):null},e.param=function(a){return d.map(a,function(a,b){return encodeURIComponent(b)+"="+encodeURIComponent(a)}).join("&")},e.Parsed=function(a,b){this.init(a,b)},e.Parsed.prototype.init=function(a,b){this.original=a,this.url=b,this._valid=!1,this.url=b},e.Parsed.prototype.valid=function(a){return(a===!0||a===!1)&&(this._valid=a),this._valid},e.parse=function(a){var b=a,c="https:"===window.location.protocol?"https:":"http:";a=a?d.trim(a):a;var f=new e.Parsed(b,a);return a?/^https?:\/\/[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f):/^\w+:/i.test(a)?f:"#"===a[0]?f:/^\/\/[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f.url=c+a,f):/^\/([^\/]+|$)/i.test(a)?(f.valid(!0),f.url=e.getOrigin(window.location.toString())+a,f):/^[^\/]+\.[^\/]/i.test(a)?(f.valid(!0),f.url="http://"+a,f):f:f},e.addHash=function(a,b){return-1===a.indexOf("#")?a+"#"+b:a+"&"+b},b.exports=e},{"./utils.js":27}],27:[function(a,b,c){var d=a("conf"),e={},f={},g=Array.prototype,h=Object.prototype,i=Function.prototype,j=g.slice,k=h.toString,l=g.forEach,m=g.reduce,n=g.every,o=g.indexOf,p=i.bind;e.identity=function(a){return a},e.each=function(a,b,c){if(null!=a)if(l&&a.forEach===l)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,e=a.length;e>d;d++)if(d in a&&b.call(c,a[d],d,a)===f)return}else for(var g in a)if(h.hasOwnProperty.call(a,g)&&b.call(c,a[g],g,a)===f)return},e.map=function(a,b,c){var d=[];return null==a?d:Array.prototype.map&&a.map===Array.prototype.map?a.map(b,c):(e.each(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)},e.reduce=function(a,b,c,d){var f=arguments.length>2;if(null==a&&(a=[]),m&&a.reduce===m)return d&&(b=e.bind(b,d)),f?a.reduce(b,c):a.reduce(b);if(e.each(a,function(a,e,g){f?c=b.call(d,c,a,e,g):(c=a,f=!0)}),!f)throw new TypeError("Reduce of empty array with no initial value");return c},e.zip=function(a){return e.map(a[0],function(b,c){return b.map(a,function(a){return a[c]})})},e.extend=function(a){return e.each(Array.prototype.slice.call(arguments,1),function(b){for(var c in b)void 0!==b[c]&&(a[c]=b[c])}),a},e.contains=function(a,b){if(!o){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1}return a.indexOf(b)>-1},e.every=function(a,b,c){b||(b=e.identity);var d=!0;return null==a?d:n&&a.every===n?a.every(b,c):(e.each(a,function(a,e,g){return(d=d&&b.call(c,a,e,g))?void 0:f}),!!d)},e.indexOf=function(a,b){if(null==a)return-1;var c=0,d=a.length;if(o&&a.indexOf===o)return a.indexOf(b);for(;d>c;c++)if(a[c]===b)return c;return-1},e.batch=function(a,b){var c=[],d=[];return e.each(a,function(a){d.push(a),d.length===b&&(c.push(d),d=[])}),0!==d.length&&c.push(d),c};var q=function(){};e.bind=function(a,b){var c,d;if(p&&a.bind===p)return p.apply(a,j.call(arguments,1));if(!e.isFunction(a))throw new TypeError;return c=j.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(j.call(arguments)));q.prototype=a.prototype;var e=new q;q.prototype=null;var f=a.apply(e,c.concat(j.call(arguments)));return Object(f)===f?f:e}},e.get=function(a,b,c){if(c=e.isNone(c)?null:c,e.isNone(b)||!e.isString(b)||!a)return c;if(""===b)return a;var d=b.split("."),f=d.splice(0,1)[0];return a.hasOwnProperty(f)?e.get(a[f],d.join("."),c):c},e.isFunction=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return!1}},e.isNone=function(a){return null===a||"undefined"==typeof a},e.isString=function(a){return"[object String]"===k.call(a)},e.isNumber=function(a){return"[object Number]"===k.call(a)},e.isDate=function(a){return"[object Date]"===k.call(a)},e.isObject=function(a){return"[object Object]"===k.call(a)},e.isArray=function(a){return"[object Array]"===k.call(a)},e.isElement=function(a){return!e.isNone(a)&&!e.isNone(a.nodeType)&&1===a.nodeType},e.isEmptyObject=function(a){if(e.isObject(a)){for(var b in a)if(h.hasOwnProperty.call(a,b))return!1;return!0}return!1},e.bool=function(a){return e.isNone(a)?null:"true"===a||"1"===a||1===a||a===!0?!0:"false"===a||"0"===a||0===a||a===!1?!1:null},e.assert=function(a,b){if(!a)throw b||"Assertion Failed"},e.getUUID=function(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)})},e.getTimestamp=function(){var a=new Date;return a.getTime()},e.trim=function(a){return a.replace(/^\s+|\s+$/g,"")},e.capitalize=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},e.camelCase=function(a){var b=a.split("-");return b.length>1&&(a=b[0],a+=e.map(b.slice(1),function(a){return a[0].toUpperCase()+a.substr(1)}).join("")),a},e.truncate=function(a,b){return a?(b=b?b:50,a.lengthc;c++)b=31*b+a.charCodeAt(c)<<0;for(var e,f,g=(Math.pow(2,31)+b).toString(),h="",i=0;ie?(f=parseInt(g.substr(i,2),10),h+=r[f],i+=2):(h+=g[i],i++);return h},e.rgbToHex=function(a,b,c){return"#"+((1<<24)+(a<<16)+(b<<8)+c).toString(16).slice(1)},d.EMB_DEBUG===!0&&(window._=e),b.exports=e},{conf:"d0R7L1"}],28:[function(a,b,c){var d=a("./utils.js"),e=a("./dom.js"),f=a("./browser.js"),g=function(){this.init()};g.prototype.init=function(){this._elements=[],this._listening=!1},g.prototype.viewable=function(a){if(!a.getBoundingClientRect)return!0;var b;try{b=a.getBoundingClientRect()}catch(c){return!1}return b.bottom>=0&&b.right>=0&&b.top<=(window.innerHeight||document.documentElement.clientHeight)&&b.left<=(window.innerWidth||document.documentElement.clientWidth)},g.prototype.check=function(){this.freeze=!0;var a=[];d.each(this._elements,d.bind(function(b,c){if(this.viewable(b.elem)){try{b.func.call(this)}catch(d){f.console.log(d)}a.push(c)}},this)),d.each(a,function(a){this._elements.splice(a,1)},this),0===this._elements.length&&this.stop(),this.freeze=!1},g.prototype.stop=function(){try{e.detachEvent(window,"DOMContentLoaded",this.handler),e.detachEvent(window,"load",this.handler),e.detachEvent(window,"resize",this.handler),e.detachEvent(window,"scroll",this.handler)}catch(a){}this.handler=null,this._listening=!1},g.prototype.listen=function(){return this._listening?!1:(this._listening=!0,this.handler=d.bind(function(){!this.freeze&&this._elements.length&&this.check()},this),e.addEvent(window,"DOMContentLoaded",this.handler),e.addEvent(window,"load",this.handler),e.addEvent(window,"resize",this.handler),void e.addEvent(window,"scroll",this.handler))},g.prototype.on=function(a,b,c){"viewable"===a&&(this._elements.push({elem:b,func:c}),this.listen(),this.check())},b.exports=g},{"./browser.js":5,"./dom.js":7,"./utils.js":27}],29:[function(a,b,c){if(window.embedly&&window.embedly.look)return window.embedly.look(),!1;var d=a("./common/iframes/all.js"),e=a("./common/browser.js"),f=a("./common/utils.js"),g=a("./common/a.js"),h=a("./common/dom.js"),i=a("./common/ready.js"),j=a("./common/meta.js"),k=a("./common/viewport.js"),l=a("./common/page.js"),m=a("./common/urlparse.js"),n=a("./common/found.js"),o=a("./common/share.js"),p=a("./common/log/front.js"),q=a("./common/recommend.js"),r=new g,s=new k;q.connect(r),o.connect(r),p.connect(r,"platform");var t=function(){var a=/emb_(\d+)/.exec(e.location.hash());return a?a[1]:null},u={cardSelectors:[{selector:".embedly-card"}],buttonSelectors:[".embedly-button"],analytics:null,recommend:!1,shared:t()},v=function(a){var b;try{b=JSON.parse(a.data)}catch(c){return e.console.error(c),!1}r.notify("window.message",a,b)};h.addEvent(window,"message",v);var w=function(a,b,c){var e;return f.isFunction(b)&&(c=b,b={}),f.isString(a)||!f.isElement(a)&&f.isObject(a)?(n.add.cards(a),!0):(!f.isElement(a)||"a"!==a.nodeName.toLowerCase()&&"blockquote"!==a.nodeName.toLowerCase()||(e=d.cards.one(a,b,r,function(a){f.isFunction(c)&&c.call(a,a)})),e)},x=function(a){var b;return f.isString(a)?(n.add.button(a),!0):(f.isElement(a)&&"a"===a.nodeName.toLowerCase()&&(b=d.button.one(a,r)),b&&b.on("button.rendered",function(){r.notify("button.rendered",b.elem,b)}),b)},y=function(a,b){var c;c=f.isString(a)?{url:a}:a;var e=d.modal.one(c,r);return f.isFunction(b)&&b.call(e,e),e},z=function(a,b,c){var e=d.slideshow.one(a,b,r);return f.isFunction(c)&&c.call(e,e),e},A=function(a){if("1"===h.data(a,"connected"))return!1;h.data(a,"connected","1");var b=d.connect(null,a,r);b.one("media.ready",function(){b.ready(),s.on("viewable",b.elem,function(){b.send("media.view")}),r.notify("recommend.add",b),r.notify("media.ready",b)}),b.send("media.ready")},B=function(a){return a&&a.key?(n.analytics=a,void n.look()):!1},C=function(){r.notify("recommend"),n.look()};r.on("found",function(a){a.cards&&a.cards.length&&d.cards.multi(a.cards,r),a.buttons&&a.buttons.length&&f.each(a.buttons,function(a){x(a)}),a.slideshows&&a.slideshows.length&&f.each(a.slideshows,function(a){z(a)}),a.iframes&&a.iframes.length&&f.each(a.iframes,function(a){A(a)})}),r.on("modal.create",function(a){y(a)}),r.on("media.ready",function(a){j.send("media.meta",a)}),r.on("card.rendered",function(a,b){j.send("card.meta",b),s.on("viewable",a,f.bind(function(){this.send("card.view")},b))}),r.on("card.rendered",function(a,b){if(!u.shared)return!1;if(!b.query||!b.query.url)return!1;var c=f.hash(b.query.url);return c!==u.shared?!1:(u.shared=null,void setTimeout(function(){var a=h.rect(b.elem);return a&&a.top?void e.animateScroll(a.top-5,500):!1},500))});var D=!1;r.on("pinterest.log",function(){if(D)return!1;D=!0;var a={type:"pidget",partner:"embedly",via:document.URL,callback:f.getUUID()};i.script("https://log.pinterest.com/?"+m.createQuery(a),function(){h.remove(h.one("#pinLog"))},this,{id:"pinLog"})});var E=function(a,b){r.on(a,b)},F=function(a,b){r.off(a,b)},G=function(){h.detachEvent(window,"message",v),n.stop(),r.clear(),h.remove(h.one("#emb_xcomm")),window.embedly=null},H=function(){var a=Array.prototype.slice.call(arguments,0);if(0===a.length)return null;var b=a.splice(0,1)[0];switch(b){case"card":return w.apply(window,a);case"button":return x.apply(window,a);case"modal":return y.apply(window,a);case"slideshow":return z.apply(window,a);case"look":return n.look.apply(window,a);case"on":return E.apply(window,a);case"off":return F.apply(window,a);case"kill":return G.apply(window,a);case"analytics":return B.apply(window,a);case"recommend":return C.apply(window,a)}return null},I=[];window.embedly&&f.isFunction(window.embedly)&&f.isArray(window.embedly.q)&&(I=window.embedly.q),window.embedly=function(){return H.apply(window,arguments)},window.embedly.card=function(){return w.apply(window,arguments)},window.embedly.button=function(){return x.apply(window,arguments)},window.embedly.modal=function(){return y.apply(window,arguments)},window.embedly.slideshow=function(){return z.apply(window,arguments)},window.embedly.look=function(){return n.look()},f.each(I,function(a){window.embedly.apply(window,a)}),l.connect(r),n.connect(r),i.bind(n.look),f.isFunction(window.onEmbedlyReady)&&window.onEmbedlyReady.apply(this,[window.embedly])},{"./common/a.js":3,"./common/browser.js":5,"./common/dom.js":7,"./common/found.js":8,"./common/iframes/all.js":9,"./common/log/front.js":17,"./common/meta.js":18,"./common/page.js":20,"./common/ready.js":21,"./common/recommend.js":22,"./common/share.js":23,"./common/urlparse.js":26,"./common/utils.js":27,"./common/viewport.js":28}]},{},[29])}(); \ No newline at end of file