PageSourceSearch

https://www.instagem.ai/assets/InstagramOAuthRedirectPage-BybYKJCZ.js

js instagem.ai collected 2026-10-05 12:04:59 UTC 5,851 bytes, 1 lines download raw bytes

1import{b as I,d as A,a as T,r as i,cr as z,m as C,cp as U,t as j,j as e,c as h,o as O}from"./main-DX7XzkoU.js";import{r as R,d as N,o as E,e as B,a as L}from"./instagram-connection-error-C5t4-2DQ.js";import{S as D}from"./shield-alert-DFanFBiH.js";const P=new Set(["www.instagram.com","api.instagram.com"]);function F(t){try{const n=new URL(decodeURIComponent(t));return n.protocol!=="https:"||!P.has(n.hostname)?null:n.toString()}catch{return null}}function $(){const{t}=I(),[n]=A(),s=T(),[k,u]=i.useState(!1),[d,y]=i.useState(null),[g,S]=i.useState(!1),c=i.useMemo(()=>({isIOS:z(navigator.userAgent)==="ios"}),[]);i.useEffect(()=>{var _;const r=n.get("state"),f=n.get("url");if(!r||!f){s("/dashboard/posts",{replace:!0});return}C()&&((_=window.setInAppDomains)==null||_.call(window,["instagram\\.com","facebook\\.com",...Object.values(U).map(o=>o.domain.replace(/\./g,"\\."))]));const w=F(f);if(!w){s("/dashboard/posts",{replace:!0});return}try{const o=w+"#weblink";y(o);const b=(a=!1)=>R({...N(r,Date.now()),fromBfcache:a}),l=E(r),v=a=>{if(a==="already-connected")return s("/dashboard/posts",{replace:!0}),!0;if(a==="offer-help"){const m=N(r,Date.now()).sentAt!==null;return j("instagram_connect_back",{...l.fields,has_sent:m},void 0,`${l.key}_${m?"sent":"nosent"}`),S(!0),!0}return!1};if(v(b()))return;B(r,Date.now()),j("instagram_connect_sent",l.fields,void 0,l.key);const p=a=>{a.persisted&&(v(b(!0))||u(!0))};if(window.addEventListener("pageshow",p),c.isIOS){u(!0);const a=setTimeout(()=>{window.location.replace(o)},1e3);return()=>{clearTimeout(a),window.removeEventListener("pageshow",p)}}else{const a=setTimeout(()=>{window.location.href=o},100),m=setTimeout(()=>{u(!0)},3e3);return()=>{clearTimeout(a),clearTimeout(m),window.removeEventListener("pageshow",p)}}}catch{s("/dashboard/posts",{replace:!0})}},[n,s,c.isIOS]);const x=()=>{d&&(c.isIOS&&!g?window.location.replace(d):window.location.href=d)};return g?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-purple-600 to-pink-500 p-4",children:e.jsxs("div",{className:"bg-white rounded-2xl p-8 text-center max-w-md w-full shadow-2xl",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-50 rounded-2xl flex items-center justify-center mx-auto mb-4",children:e.jsx(D,{className:"w-8 h-8 text-amber-700"})}),e.jsx("h1",{className:"text-xl font-semibold text-gray-800 mb-2",children:t("instagram_connection_help.not_connected_title")}),e.jsx("p",{className:"text-gray-500 text-sm mb-6",children:t("instagram_connection_help.not_connected_description")}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(h,{onClick:()=>s(L(n.get("state"))),className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-700 hover:to-pink-600 text-white font-semibold py-3",size:"lg",children:t("instagram_connection_help.see_how_to_fix")}),e.jsx(h,{variant:"ghost",onClick:x,className:"w-full text-gray-600",children:t("instagram_connection_help.try_again")})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-purple-600 to-pink-500 p-4",children:e.jsx("div",{className:"bg-white rounded-2xl p-8 text-center max-w-md w-full shadow-2xl",children:k?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-16 h-16 bg-gradient-to-tr from-yellow-400 via-pink-500 to-purple-600 rounded-2xl flex items-center justify-center mx-auto mb-4",children:e.jsx("svg",{className:"w-10 h-10 text-white",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})})}
1),e.jsx("h1",{className:"text-xl font-semibold text-gray-800 mb-2",children:t("instagram_setup.oauth.authorize_instagram","Autorizar Instagram")}),e.jsx("p",{className:"text-gray-500 text-sm mb-6",children:t("instagram_setup.oauth.click_to_continue","Clique no botão abaixo para continuar a conexão")}),e.jsx(h,{onClick:x,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-700 hover:to-pink-600 text-white font-semibold py-3",size:"lg",children:t("instagram_setup.oauth.continue_to_instagram","Continuar para Instagram")}),e.jsx("p",{className:"text-xs text-gray-400 mt-4",children:c.isIOS?t("instagram_setup.oauth.ios_hint","Toque no botão para abrir no navegador e completar a autorização"):t("instagram_setup.oauth.default_hint","Você será redirecionado para a página de login do Instagram")})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"w-12 h-12 animate-spin text-pink-500 mx-auto mb-4"}),e.jsx("h1",{className:"text-xl font-semibold text-gray-800 mb-2",children:t("instagram_setup.oauth.connecting_instagram","Conectando ao Instagram...")}),e.jsx("p",{className:"text-gray-500 text-sm",children:t("instagram_setup.oauth.redirecting_auth","Redirecionando para autorização")})]})})})}export{$ as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.