jQuery((function(s){const e=Joomla.getOptions("igConfig");let o=s(".sppb-ig-token #app_id"),n=s(".sppb-ig-token #app_secret"),t=s(".sppb-ig-token #access_token"),a=s(".sppb-ig-token #ig_id"),p=s(".sppb-ig-token #ig_next"),d=s(".sppb-ig-token #app_token");const i={app_id:"appId",app_secret:"appSecret",access_token:"accessToken",ig_id:"igId"},c={appId:o.val(),appSecret:n.val(),accessToken:t.val(),igId:a.val()},l=JSON.parse(JSON.stringify(c)),r=function(o){let n=o.target.id,r=o.target.value;if(c[i[n]]=r,l.appId!==c.appId||l.appSecret!==c.appSecret){const s=t.closest(".control-group");s.hasClass("hidden")||s.addClass("hidden");const e=a.closest(".control-group");e.hasClass("hidden")||e.addClass("hidden");const o=p.closest(".control-group");o.hasClass("hidden")&&o.removeClass("hidden");const n=d.closest(".control-group");n.hasClass("hidden")||n.addClass("hidden")}else{const s=t.closest(".control-group");s.hasClass("hidden")&&s.removeClass("hidden");const e=a.closest(".control-group");e.hasClass("hidden")&&e.removeClass("hidden");const o=p.closest(".control-group");o.hasClass("hidden")||o.addClass("hidden");const n=d.closest(".control-group");n.hasClass("hidden")&&n.removeClass("hidden")}s(".sppb-ig-token input#"+e.inputId).val(JSON.stringify(c))};o.on("keyup",r),n.on("keyup",r),t.on("change",r),a.on("change",r),d.on("click",(function(s){s.preventDefault();const t=o.val(),a=n.val();if(!t||!a)return void alert("You have to insert your facebook APP_ID and APP_SECRET for getting the access token!");const p=e.base+"/index.php?option=com_sppagebuilder&task=instagram.accessToken";window.open(p,"window name","location=yes,height=750,left=350,top=0,width=750,modal=yes,alwaysRaised=yes")}))}));