|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/owens.enteract/inc/libs/photocropper/js/ |
Upload File : |
window.IG||(window.IG={_client_id:null,_session:null,_userStatus:"unknown",_logging:!1,_domain:{https_com:"https://instagram.com/",api:"http://api.instagram.com/"},getDomain:function(a){switch(a){case"https_com":return IG._domain.https_com;case"api":return IG._domain.api}},provide:function(a,b){return IG.copy(IG.create(a),b)},copy:function(a,b){var c;for(c in b)b.hasOwnProperty(c)&&typeof a[c]=="undefined"&&(a[c]=b[c]);return a},create:function(a,b){var c=window.IG,d=a?a.split("."):[],e=d.length,f;for(f=0;f<e;f++){var g=d[f],h=c[g];h||(h=b&&f+1===e?b:{},c[g]=h),c=h}return c},guid:function(){return"f"+(Math.random()*(1<<30)).toString(16).replace(".","")},log:function(a){IG._logging&&(window.Debug&&window.Debug.writeln?window.Debug.writeln(a):window.console&&window.console.log(a))},$:function(a){return document.getElementById(a)}},IG.provide("Array",{forEach:function(a,b){var c,d;if(!a)return;if(Object.prototype.toString.apply(a)!=="[object Array]"&&(a instanceof Function||typeof a.length!="number"))for(d in a)a.hasOwnProperty(d)&&b(a[d],d,a);else if(a.forEach)a.forEach(b);else for(c=0,length=a.length;c<length;c++)b(a[c],c,a)},join:function(a,b){var c="";return IG.Array.forEach(a,function(a,d){c+=a+b}),c=c.substr(0,c.lastIndexOf(b)),c}}),IG.provide("QS",{encode:function(a,b,c){b=b===undefined?"&":b,encoder=c===!1?function(a){return a}:encodeURIComponent;var d=[];return IG.Array.forEach(a,function(a,b){a!==null&&typeof a!="undefined"&&d.push(encoder(b)+"="+encoder(a))}),d.sort(),d.join(b)},decode:function(a){var b=a.split("&"),c={},d;for(d=0;d<b.length;d++)pair=b[d].split("=",2),pair&&pair[0]&&(c[decodeURIComponent(pair[0])]=decodeURIComponent(pair[1]||""));return c}}),IG.provide("Content",{_root:null,_hiddenRoot:null,_callbacks:{},append:function(a,b){if(!b)if(!IG.Content._root){IG.Content._root=b=IG.$("ig-root");if(!b){IG.log('The "ig-root" div has not been created.');return}}else c=IG.Content._root;if(typeof a=="string"){var d=document.createElement("div");return b.appendChild(d).innerHTML=a,d}return b.appendChild(a)},appendHidden:function(a){if(!IG.Content._hiddenRoot){var b=document.createElement("div");b.style.position="absolute",b.style.top="-10000px",b.style.width=b.style.height=0,IG.Content._hiddenRoot=IG.Content.append(b)}return IG.Content.append(a,IG.Content._hiddenRoot)},insertIframe:function(a){a.id=a.id||IG.guid(),a.name=a.name||IG.guid();var b=IG.guid(),c=!1,d=!1;IG.Content._callbacks[b]=function(){c&&!d&&(d=!0,a.onload&&a.onload(a.root.firstChild))};if(document.attachEvent){var e='<iframe id="'+a.id+'"'+' name="'+a.name+'"'+(a.title?' title="'+a.title+'"':"")+(a.className?' class="'+a.className+'"':"")+' style="border:none;'+(a.width?"width:"+a.width+"px;":"")+(a.height?"height:"+a.height+"px;":"")+'"'+' src="'+a.url+'"'+' frameborder="0"'+' scrolling="no"'+' allowtransparency="true"'+' onload="IG.Content._callbacks.'+b+'()"'+"></iframe>";a.root.innerHTML='<iframe src="javascript:false" frameborder="0" scrolling="no" style="height:1px"></iframe>',c=!0,window.setTimeout(function(){a.root.innerHTML=e},0)}else{var f=document.createElement("iframe");f.id=a.id,f.name=a.name,f.onload=IG.Content._callbacks[b],f.scrolling="no",f.style.border="none",f.style.overflow="hidden",a.title&&(f.title=a.title),a.className&&(f.className=a.className),a.height&&(f.height=a.height),a.width&&(f.width=a.width),a.root.appendChild(f),c=!0,f.src=a.url}}}),IG.provide("JSON",{stringify:function(a){return window.Prototype&&Object.toJSON?Object.toJSON(a):JSON.stringify(a)},parse:function(a){return JSON.parse(a)},flatten:function(a){var b={},c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];typeof d=="string"&&c!==null?b[c]=d:d!==null&&d!==undefined&&(b[c]=IG.JSON.stringify(d))}return b}}),IG.provide("EventProvider",{subscribers:function(){return this._subscribersMap||(this._subscribersMap={}),this._subscribersMap},subscribe:function(a,b){IG.log("Subscription to: "+a);var c=this.subscribers();c[a]?c[a].push(b):c[a]=[b]},unsubscribe:function(a,b){var c=this.subscribers()[a];IG.Array.forEach(c,function(a,d){a===b&&(c[d]=null)})},monitor:function(a,b){if(!b()){var c=this,d=function(){b.apply(b,arguments)&&c.unsubscribe(a,d)};this.subscribe(a,d)}},clear:function(a){delete this.subscribers()[a]},fire:function(){var a=Array.prototype.slice.call(arguments),b=a.shift();IG.log("Fire for: "+b),IG.Array.forEach(this.subscribers()[b],function(b){b&&b.apply(this,a)})}}),IG.provide("Event",IG.EventProvider),IG.provide("XD",{_origin:null,_transport:null,_callbacks:{},init:function(a){if(IG.XD._origin){IG.log('XD.init called with "XD._origin" already set. Returning.');return}window.addEventListener&&!window.attachEvent&&window.postMessage?(IG.log('Using "postmessage" as XD transport.'),IG.XD._origin=window.location.protocol+"//"+window.location.host+"/"+IG.guid(),IG.XD.PostMessage.init(),IG.XD._transport="postmessage"):(IG.log('Using "fragment" as XD transport.'),IG.XD._transport="fragment",IG.XD.Fragment._channelUrl=a||window.location.toString())},resolveRelation:function(a){var b=a.split("."),c=window,d,e;for(e=0,num_relations=b.length;e<num_relations;e++){child=b[e];if(child==="opener"||child==="parent"||child==="top")c=c[child];else{d=/^frames\[['"]?([a-zA-Z0-9-_]+)['"]?\]$/.exec(child);if(d)c=c.frames[d[1]];else throw new SyntaxError("Malformed relation to resolve: "+a+", pt: "+child)}}return c},handler:function(a,b){if(window.location.toString().indexOf(IG.XD.Fragment._magic)>0)return"javascript:false;//";var c=IG.getDomain("https_com")+"oauth/xd_proxy/#",d=IG.guid();if(IG.XD._transport==="fragment"){c=IG.XD.Fragment._channelUrl;var e=c.indexOf("#");e>0&&(c=c.substr(0,e)),c+=(c.indexOf("?")<0?"?":"&")+IG.XD.Fragment._magic+"#?=&"}return IG.XD._callbacks[d]=a,c+IG.QS.encode({cb:d,origin:IG.XD._origin,relation:b||"opener",transport:IG.XD._transport})},recv:function(a){typeof a=="string"&&(a=IG.QS.decode(a));var b=IG.XD._callbacks[a.cb];delete IG.XD._callbacks[a.cb],b&&b(a)},PostMessage:{init:function(){var a=IG.XD.PostMessage.onMessage;window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)},onMessage:function(a){IG.XD.recv(a.data)}},Fragment:{_magic:"ig_xd_fragment",checkAndDispatch:function(){var a=window.location.toString(),b=a.substr(a.indexOf("#")+1),c=a.indexOf(IG.XD.Fragment._magic);c>0&&(IG.init=function(){},document.documentElement.style.display="none",IG.XD.resolveRelation(IG.QS.decode(b).relation).IG.XD.recv(b))}}}),IG.XD.Fragment.checkAndDispatch(),IG.provide("",{ui:function(a,b){var c=IG.UIServer.prepareCall(a,b);if(!c){IG.log('"prepareCall" failed to return options');return}var d=c.params.display,e=IG.UIServer[d];if(!e){IG.log('"display" must be "popup"');return}e(c)}}),IG.provide("UIServer",{Methods:{},_active:{},_defaultCb:{},prepareCall:function(a,b){var c=a.method.toLowerCase(),d=IG.UIServer.Methods[c],e=IG.guid();IG.copy(a,{client_id:IG._client_id,access_token:IG._session&&IG._session.access_token||undefined}),a.display=IG.UIServer.getDisplayMode(d,a);var f={callback:b,id:e,size:d.size||{},url:d.url,params:a};if(d.transform){f=d.transform(f);if(!f){IG.log('Call to "transform" in "prepareCall" failed to return options');return}}var g=IG.UIServer.getXdRelation(f.params.display);f.params.redirect_uri=IG.UIServer._xdResult(f.callback,f.id,g,!0),f.params=IG.JSON.flatten(f.params);var h=IG.QS.encode(f.params);return h&&(f.url+="?"+h),f},getDisplayMode:function(a,b){return b.display==="hidden"?"hidden":"popup"},getXdRelation:function(a){if(a==="popup")return"opener"},popup:function(a){var b=typeof window.screenX!="undefined"?window.screenX:window.screenLeft,c=typeof window.screenY!="undefined"?window.screenY:window.screenTop,d=typeof window.outerWidth!="undefined"?window.outerWidth:document.documentElement.clientWidth,e=typeof window.outerHeight!="undefined"?window.outerHeight:document.documentElement.clientHeight-22,f=a.size.width,g=a.size.height,h=b<0?window.screen.width+b:b,i=parseInt(h+(d-f)/2,10),j=parseInt(c+(e-g)/2.5,10),k="width="+f+",height="+g+",left="+i+",top="+j+",scrollbars=1,location=1,toolbar=0";IG.log("opening popup: "+a.id),IG.UIServer._active[a.id]=window.open(a.url,a.id,k)},hidden:function(a){a.className="IG_UI_Hidden",a.root=IG.Content.appendHidden(""),IG.UIServer._insertIframe(a)},_insertIframe:function(a){IG.UIServer._active[a.id]=!1;var b=function(b){IG.UIServer._active.hasOwnProperty(a.id)&&(IG.UIServer._active[a.id]=b)};IG.Content.insertIframe({url:a.url,root:a.root,className:a.className,width:a.size.width,height:a.size.height,onload:b})},_xdRedirectUriHandler:function(a,b,c,d){return d&&(IG.UIServer._defaultCb[b]=a),IG.XD.handler(function(b){IG.UIServer._xdRecv(b,a)},c)+"&frame="+b},_xdRecv:function(a,b){var c=IG.UIServer._active[a.frame];try{c.close&&c.close()}catch(d){}delete IG.UIServer._active[a.frame],delete IG.UIServer._defaultCb[a.frame],b(a)},_xdResult:function(a,b,c,d){return IG.UIServer._xdRedirectUriHandler(function(b){a&&b.result&&a(IG.JSON.parse(b.result))},b,c,d)}}),IG.provide("",{getLoginStatus:function(a,b){if(!IG._client_id){IG.log("IG.getLoginStatus() called before calling IG.init().");return}if(a){if(!b&&IG.Auth._loadState==="loaded"){a({status:IG._userStatus,session:IG._session});return}IG.Event.subscribe("IG.loginStatus",a)}if(!b&&IG.Auth._loadState==="loading")return;IG.Auth._loadState="loading";var c=function(a){IG.Auth._loadState="loaded",IG.Event.fire("IG.loginStatus",a),IG.Event.clear("IG.loginStatus")};IG.ui({method:"auth.status",display:"hidden"},c)},login:function(a,b){IG.ui(IG.copy({display:"popup",method:"authorize"},b||{}),a)},logout:function(a){IG.Auth.setSession()}}),IG.provide("Auth",{setSession:function(a,b){var c=!IG._session&&a,d=IG._session&&!a,e=c||d||IG._session&&a&&IG._session.access_token!==a.access_token,f=b!==IG._userStatus,g={session:a,status:b};return IG._session=a,IG._userStatus=b,e&&IG.Cookie.getEnabled()&&IG.Cookie.set(a),f&&IG.Event.fire("auth.statusChange",g),c&&IG.Event.fire("auth.login",g),d&&IG.Event.fire("auth.logout",g),e&&IG.Event.fire("auth.sessionChange",g),g},xdHandler:function(a,b,c,d,e,f){return IG.UIServer._xdRedirectUriHandler(IG.Auth.xdResponseWrapper(a,e,f),b,c,d)},xdResponseWrapper:function(a,b,c){return function(d){try{c=IG.JSON.parse(d.session||null),c.scope=IG.JSON.parse(d.scope||null)}catch(e){}c&&(b="connected");var f=IG.Auth.setSession(c||null,b),g=["code","error","error_reason","error_description"];d&&IG.Array.forEach(g,function(a){f[a]=d[a]||null}),a&&a(f)}}}),IG.provide("UIServer.Methods",{authorize:{size:{width:627,height:326},url:IG.getDomain("https_com")+"oauth/authorize/",transform:function(a){if(!IG._client_id){IG.log("IG.login() called before claling IG.init().");return}if(IG._session){var b=!1;IG.Array.forEach(a.params.scope,function(a){IG._session.scope.indexOf(a)===-1&&(b=!0)});if(!b){IG.log("IG.login() called when user is already connected.");if(a.callback){a.callback({status:IG._userStatus,session:IG._session});return}}}return a.callback=IG.Auth.xdResponseWrapper(a.callback),a.params.scope&&(a.params.scope=a.params.scope.join(" ")),IG.copy(a.params,{response_type:"token"}),a}},"auth.status":{url:IG.getDomain("https_com")+"oauth/login_status/",transform:function(a){var b=a.callback,c=a.id;return delete a.callback,IG.copy(a.params,{no_session:IG.Auth.xdHandler(b,a.id,"parent",!1,"notConnected"),no_user:IG.Auth.xdHandler(b,a.id,"parent",!1,"unknown"),ok_session:IG.Auth.xdHandler(b,a.id,"parent",!1,"connected")}),a}}}),IG.provide("Cookie",{_domain:null,_enabled:!1,setEnabled:function(a){IG.Cookie._enabled=a},getEnabled:function(){return IG.Cookie._enabled},load:function(){var a=document.cookie.match("\\bigs_"+IG._client_id+'="([^;]*)\\b'),b;return a&&(b=IG.QS.decode(a[1]),b.expires&&(b.expires=parseInt(b.expires,10)),IG.Cookie._domain=b.base_domain),b},setRaw:function(a,b,c){document.cookie="igs_"+IG._client_id+'="'+a+'"'+(a&&b===0?"":"; expires="+(new Date(b*1e3)).toGMTString())+"; path=/"+(c?"; domain=."+c:""),IG.Cookie._domain=c},set:function(a){a?IG.Cookie.setRaw(IG.QS.encode(a),a.expires,a.base_domain):IG.Cookie.clear()},clear:function(){IG.Cookie.setRaw("",0,IG.Cookie._domain)}}),IG.provide("",{init:function(a){a=IG.copy(a||{},{logging:!1,check_status:!0}),IG._client_id=a.client_id,IG._logging=a.logging||typeof a.logging=="undefined"&&window.location.toString().indexOf("ig_debug=1")>0,IG.XD.init(a.channelUrl),IG._client_id&&(IG.Cookie.setEnabled(a.cookie),a.session=a.session||a.cookie&&IG.Cookie.load(),IG.Auth.setSession(a.session),a.check_status&&IG.getLoginStatus())}}),window.setTimeout(function(){window.igAsyncInit&&!window.igAsyncInit.hasRun&&(window.igAsyncInit.hasRun=!0,igAsyncInit())},0));