onairos 3.1.19 → 3.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/241.js +1 -1
- package/dist/241.js.map +1 -1
- package/dist/991.js +1 -1
- package/dist/991.js.map +1 -1
- package/dist/data_request_iframe.html +11 -11
- package/dist/iframe.bundle.js +1 -1
- package/dist/iframe.bundle.js.map +1 -1
- package/dist/onairos.bundle.js +1 -1
- package/dist/onairos.bundle.js.map +1 -1
- package/dist/onairos.esm.js +1 -1
- package/dist/onairos.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Onairos Terminal</title><style>body {
|
|
2
|
-
margin: 0;
|
|
3
|
-
padding: 0;
|
|
4
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
5
|
-
background-color: transparent;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
#root {
|
|
10
|
-
width: 100%;
|
|
11
|
-
height:
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Onairos Terminal</title><style>body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
#root {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 90vh;
|
|
12
12
|
}</style><script defer="defer" src="iframe.bundle.js"></script></head><body><div id="root"></div><script src="data_request_page.js"></script></body></html>
|
package/dist/iframe.bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("Onairos",["React","ReactDOM"],t):"object"==typeof exports?exports.Onairos=t(require("react"),require("react-dom")):e.Onairos=t(e.React,e.ReactDOM)}(this,(e,t)=>(()=>{"use strict";var o={156:t=>{t.exports=e},318:e=>{e.exports=t},338:(e,t,o)=>{var n=o(318);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})();var r=a(156),c=a.n(r),s=a(338);function l(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function i(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?l(Object(o),!0).forEach(function(t){m(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function m(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const u={1:"https://anushkasirv.sirv.com/persona1.png",2:"https://anushkasirv.sirv.com/persona2.png",3:"https://anushkasirv.sirv.com/persona3.png",4:"https://anushkasirv.sirv.com/persona4.png",5:"https://anushkasirv.sirv.com/persona5.png"},d=[{name:"Google",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24"},c().createElement("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),c().createElement("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),c().createElement("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),c().createElement("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})),color:"bg-white",connector:"gmail",description:"We use your search, YouTube, and location signals to better understand your interests and routines."},{name:"Reddit",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"#FF4500"},c().createElement("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})),color:"bg-white",connector:"reddit",description:"We use your search history to better understand your interests and routines."},{name:"Instagram",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24"},c().createElement("defs",null,c().createElement("radialGradient",{id:"instagram-gradient",cx:"0.5",cy:"1",r:"1"},c().createElement("stop",{offset:"0%",stopColor:"#FD5949"}),c().createElement("stop",{offset:"50%",stopColor:"#D6249F"}),c().createElement("stop",{offset:"100%",stopColor:"#285AEB"}))),c().createElement("path",{fill:"url(#instagram-gradient)",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-.073-1.689-.073-4.849 0-3.204.013-3.583.072-4.948.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"})),color:"bg-white",connector:"instagram",description:"We use your search history to better understand your interests and routines."},{name:"LinkedIn",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"#0077B5"},c().createElement("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})),color:"bg-white",connector:"linkedin",description:"We use your search history to better understand your interests and routines."}],p={apiKey:process.env.REACT_APP_ONAIROS_API_KEY||"onairos_web_sdk_live_key_2024",baseUrl:process.env.REACT_APP_ONAIROS_BASE_URL||"https://api2.onairos.uk",sdkType:"web",enableHealthMonitoring:!0,enableAutoRefresh:!0,enableConnectionValidation:!0};function f(e){let{onComplete:t,onBack:o,appIcon:n,appName:a="App",personaImages:s}=e;const l=null!=s?s:u,[m,f]=(0,r.useState)({}),[g,h]=(0,r.useState)(!1),[b,v]=(0,r.useState)(null),[w,y]=(0,r.useState)({}),[x,E]=(0,r.useState)({}),[N,k]=(0,r.useState)(0);(0,r.useEffect)(()=>{(()=>{const e=localStorage.getItem("onairos_oauth_platform");e&&(console.log("📱 OAuth return detected for: ".concat(e)),localStorage.removeItem("onairos_oauth_platform"),localStorage.removeItem("onairos_oauth_return"),f(t=>i(i({},t),{},{[e]:!0})),y(t=>i(i({},t),{},{[e]:null})),console.log("✅ ".concat(e," marked as connected from OAuth return")))})()},[]);const S=async e=>{console.log("🚀 connectToPlatform called for: ".concat(e));const t=d.find(t=>t.name===e);if(null==t||!t.connector)return console.error("❌ No connector found for platform: ".concat(e)),!1;try{var o;h(!0),v(e),y(t=>i(i({},t),{},{[e]:null})),console.log("🔗 Starting OAuth connection for ".concat(e,"..."));const n=localStorage.getItem("username")||(null===(o=localStorage.getItem("onairosUser"))||void 0===o?void 0:o.email)||"user@example.com",a="".concat(p.baseUrl,"/").concat(t.connector,"/authorize"),r=await fetch(a,{method:"POST",headers:{"x-api-key":p.apiKey,"Content-Type":"application/json"},body:JSON.stringify({session:{username:n}})});if(!r.ok)throw new Error("HTTP ".concat(r.status,": ").concat(r.statusText));const c=await r.json();console.log("📋 ".concat(e," OAuth response:"),c);const s={youtube:["youtubeURL","youtubeUrl","youtube_url"],linkedin:["linkedinURL","linkedinUrl","linkedin_url"],reddit:["redditURL","redditUrl","reddit_url"],pinterest:["pinterestURL","pinterestUrl","pinterest_url"],instagram:["instagramURL","instagramUrl","instagram_url"],github:["githubURL","githubUrl","github_url"],facebook:["facebookURL","facebookUrl","facebook_url"],gmail:["gmailURL","gmailUrl","gmail_url"]}[t.connector]||["".concat(t.connector,"URL"),"".concat(t.connector,"Url"),"".concat(t.connector,"_url"),"platformURL","authUrl","url"];let l=null,m=null;for(const e of s)if(c[e]){l=c[e],m=e;break}if(!l)throw console.error("❌ No OAuth URL found for ".concat(e,":")),console.error("Expected one of:",s),console.error("Response keys:",Object.keys(c)),console.error("Full response:",c),new Error("No OAuth URL found. Backend should return one of: ".concat(s.join(", ")));if(console.log("✅ Found OAuth URL for ".concat(e," using key: ").concat(m)),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768)return localStorage.setItem("onairos_oauth_platform",e),localStorage.setItem("onairos_oauth_return",window.location.href),window.location.href=l,!0;{const o=window.open(l,"".concat(t.connector,"_oauth"),"width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no");if(!o)throw new Error("Popup blocked. Please allow popups and try again.");let n=!1;const a=setInterval(()=>{try{if(o.location&&"onairos.uk"===o.location.hostname)return n=!0,console.log("🔄 ".concat(e," popup navigated to onairos.uk - treating as success")),void o.close()}catch(t){n||(n=!0,console.log("🔄 ".concat(e," popup navigated (cross-origin) - likely to onairos.uk")))}try{if(o.closed){clearInterval(a);const t=localStorage.getItem("onairos_".concat(e,"_success")),o=localStorage.getItem("onairos_".concat(e,"_error")),r=localStorage.getItem("onairos_".concat(e,"_timestamp")),c=r&&Date.now()-parseInt(r)<3e4;t&&c?(console.log("✅ ".concat(e," OAuth completed successfully (callback page)")),localStorage.removeItem("onairos_".concat(e,"_success")),localStorage.removeItem("onairos_".concat(e,"_timestamp")),f(t=>i(i({},t),{},{[e]:!0})),y(t=>i(i({},t),{},{[e]:null}))):o&&c?(console.log("❌ ".concat(e," OAuth failed:"),o),localStorage.removeItem("onairos_".concat(e,"_error")),localStorage.removeItem("onairos_".concat(e,"_timestamp")),y(t=>i(i({},t),{},{[e]:o}))):n?(console.log("✅ ".concat(e," OAuth likely successful (navigated to onairos.uk)")),f(t=>i(i({},t),{},{[e]:!0})),y(t=>i(i({},t),{},{[e]:null}))):(console.log("⚠️ ".concat(e," OAuth cancelled or no response")),y(t=>i(i({},t),{},{[e]:"Connection was cancelled"}))),h(!1),v(null)}}catch(e){}},1e3);return setTimeout(()=>{try{!o.closed&&o.location&&"onairos.uk"===o.location.hostname&&(console.log("🚪 Auto-closing ".concat(e," popup showing onairos.uk (not found)")),o.close())}catch(t){!o.closed&&n&&(console.log("🚪 Auto-closing ".concat(e," popup (cross-origin, likely onairos.uk)")),o.close())}},1e4),setTimeout(()=>{o.closed||(o.close(),clearInterval(a),y(t=>i(i({},t),{},{[e]:"Connection timeout"})),h(!1),v(null))},3e5),!0}}catch(t){return console.error("❌ Error connecting to ".concat(e,":"),t),y(o=>i(i({},o),{},{[e]:t.message})),h(!1),v(null),!1}},C=async e=>{if(console.log("🔥 TOGGLE CLICKED: ".concat(e)),g&&b!==e)return void console.log("⚠️ Already connecting to ".concat(b,", ignoring click on ").concat(e));m[e]?(console.log("🔌 Disconnecting from ".concat(e,"...")),f(t=>i(i({},t),{},{[e]:!1})),y(t=>i(i({},t),{},{[e]:null}))):await S(e)},O=Object.values(m).filter(Boolean).length,R=Math.min(O+1,5);return c().createElement("div",{className:"w-full h-full flex flex-col",style:{height:"100%",minHeight:0}},c().createElement("div",{className:"px-6 pt-16 flex-1 flex flex-col",style:{minHeight:0,overflow:"hidden"}},c().createElement("div",{className:"mb-6 flex-shrink-0"},c().createElement("h1",{className:"text-2xl font-bold text-gray-900 mb-2 text-balance leading-tight"},"Connect app data"),c().createElement("p",{className:"text-gray-600 text-base"},"More connections, better personalization.")),c().createElement("div",{className:"mb-2 flex justify-center flex-shrink-0"},c().createElement("div",{className:"w-56 h-56 overflow-hidden"},c().createElement("img",{src:l[R],alt:"Persona ".concat(R),width:"224",height:"224",className:"w-full h-full object-cover",onLoad:()=>console.log("✅ Persona image loaded successfully!"),onError:e=>{console.log("❌ Persona image failed to load:",l[R]),console.log("Connected count:",O),console.log("Persona number:",R),console.log("All persona URLs:",l),console.log("Current location:",window.location.href),console.log("Trying to load from:",l[R]),e.target.style.display="none",e.target.parentElement.style.background="linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%)"}}))),c().createElement("div",{className:"flex-1 overflow-y-auto mt-4",style:{minHeight:0}},c().createElement("div",{className:"space-y-4 pb-4"},d.map(e=>{const t=m[e.name]||!1,o=b===e.name,n=w[e.name],a=g&&!o;return c().createElement("div",{key:e.name,className:"flex items-start gap-4 p-4 rounded-xl hover:bg-gray-50 transition-colors",style:{backgroundColor:"#ffffff",border:"none",outline:"none"},onClick:()=>!a&&C(e.name)},c().createElement("div",{className:"w-10 h-10 bg-white rounded-full flex items-center justify-center flex-shrink-0 border border-gray-100"},o?c().createElement("div",{className:"animate-spin h-5 w-5 border-2 border-gray-400 rounded-full border-t-transparent"}):e.icon),c().createElement("div",{className:"flex-1 min-w-0 pr-4"},c().createElement("h3",{className:"font-medium mb-1",style:{backgroundColor:"#ffffff !important",color:"#111827 !important",border:"none",outline:"none"}},e.name),c().createElement("p",{className:"text-sm leading-relaxed",style:{backgroundColor:"#ffffff !important",color:"#4B5563 !important",border:"none",outline:"none"}},e.description),n&&c().createElement("p",{className:"text-xs text-red-600 mt-1"},n)),c().createElement("div",{className:"flex-shrink-0"},c().createElement("div",{onClick:t=>{t.stopPropagation(),a||C(e.name)},className:"relative inline-flex h-7 w-12 items-center rounded-full transition-all duration-200 ease-in-out cursor-pointer ".concat(t?"bg-green-500":"bg-gray-300"," ").concat(a?"opacity-50 cursor-not-allowed":"cursor-pointer")},c().createElement("span",{className:"inline-block h-5 w-5 transform rounded-full bg-white transition-all duration-200 ease-in-out shadow-md ".concat(t?"translate-x-6":"translate-x-0.5")}))))})))),c().createElement("div",{className:"px-6 pb-6 pt-4 flex-shrink-0 space-y-3",style:{minHeight:"auto"}},c().createElement("div",{className:"w-full bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 cursor-pointer transition-colors",onClick:()=>{const e=Object.entries(m).filter(e=>{let[t,o]=e;return o}).map(e=>{let[t]=e;return t});t({connectedAccounts:e,totalConnections:e.length,healthScore:N,connectionHealth:x,sdkVersion:"2.1.7",enhancedFeatures:{healthMonitoring:p.enableHealthMonitoring,autoRefresh:p.enableAutoRefresh,connectionValidation:p.enableConnectionValidation}})}},"Update",c().createElement("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}))),c().createElement("div",{onClick:()=>t({connectedAccounts:[],totalConnections:0}),className:"w-full text-gray-600 text-base font-medium py-3 text-center cursor-pointer hover:text-gray-800 transition-colors"},"Skip")))}const g=e=>c().createElement("div",{className:"relative inline-flex items-center"},c().createElement("input",{type:"checkbox",id:"request-".concat(e.number),disabled:!e.active,onChange:t=>{const o=t.target.checked;console.log("Checkbox ".concat(e.title," is now: ").concat(o?"checked":"unchecked")),o?(e.setSelected(!0),e.changeGranted(1)):(e.setSelected(!1),e.changeGranted(-1)),e.onSelectionChange(o)},className:"\n appearance-none w-5 h-5 border rounded\n ".concat(e.active?"border-blue-500 cursor-pointer":"border-gray-300 bg-gray-100 cursor-not-allowed","\n checked:bg-blue-600 checked:border-blue-600\n focus:outline-none focus:ring-2 focus:ring-blue-500/30\n transition-colors\n ")}),c().createElement("svg",{className:"absolute left-0.5 top-0.5 w-4 h-4 text-white pointer-events-none opacity-0 peer-checked:opacity-100",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},c().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M5 13l4 4L19 7"})),!e.active&&c().createElement("span",{className:"ml-2 text-xs text-red-500 font-medium"},"Not available"));const h=function(e){const[t,o]=(0,r.useState)(!1);return c().createElement("div",{className:"bg-white rounded-xl shadow-sm hover:shadow-md transition-all overflow-hidden"},c().createElement("div",{className:"p-5"},c().createElement("div",{className:"flex items-start space-x-4"},(()=>{switch(e.title){case"Profile":return c().createElement("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-blue-600",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})));case"User Memories":return c().createElement("div",{className:"w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-purple-600",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{d:"M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"})));default:return c().createElement("div",{className:"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-600",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})))}})(),c().createElement("div",{className:"flex-1"},c().createElement("div",{className:"flex items-center justify-between"},c().createElement("h3",{className:"font-medium text-gray-800"},e.title),c().createElement(g,{active:e.active,onSelectionChange:t=>{o(t),e.onSelectionChange(t)},changeGranted:e.changeGranted,setSelected:o,number:e.number+1,type:"Test",title:e.title})),e.descriptions&&c().createElement("div",{className:"mt-2"},c().createElement("p",{className:"text-sm text-gray-600"},e.descriptions)))),e.rewards&&c().createElement("div",{className:"mt-3 pt-3 border-t border-gray-100"},c().createElement("div",{className:"flex items-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-yellow-500 mr-2",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"})),c().createElement("span",{className:"text-xs text-gray-500"},"Benefit: ",c().createElement("span",{className:"text-gray-700"},e.rewards))))))},b=a.p+"static/ca60d8c79124e56d8c1c.png",v=e=>{let{requestData:t={},dataRequester:o="App",proofMode:n=!1,domain:a="",appIcon:s=""}=e;const[l,i]=(0,r.useState)(!0),[m,u]=(0,r.useState)([]),[d,p]=(0,r.useState)(0),[g,v]=(0,r.useState)(!1),[w,y]=(0,r.useState)(["instagram","youtube","email"]),[x,E]=(0,r.useState)({}),N=(0,r.useRef)([]),k=(0,r.useRef)(null),S=(0,r.useRef)(null);function C(e){p(d+e)}return(0,r.useEffect)(()=>{v(d>0)},[d]),(0,r.useEffect)(()=>{(async()=>{try{await new Promise(e=>setTimeout(e,1e3)),u(["Profile","User Memories"]),i(!1)}catch(e){console.error("Error loading data:",e),i(!1)}})();const e=e=>{e.data&&"dataRequest"===e.data.type&&(e.data.requestData,e.data.activeModels&&u(e.data.activeModels),e.data.userSub&&(k.current=e.data.userSub),e.data.encryptedUserPin&&(S.current=e.data.encryptedUserPin))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[]),c().createElement("div",{className:"min-h-screen bg-gray-100"},l?c().createElement("div",{className:"flex items-center justify-center min-h-screen"},c().createElement("div",{className:"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent"})):0===m.length?c().createElement(f,{appIcon:"https://onairos.sirv.com/Images/OnairosBlack.png",appName:o,username:localStorage.getItem("username")}):c().createElement("div",{className:"max-w-md mx-auto p-6 space-y-4"},c().createElement("header",{className:"bg-white p-6 rounded-xl shadow-md"},c().createElement("div",{className:"flex items-center justify-between mb-6"},c().createElement("div",{className:"flex items-center space-x-2"},c().createElement("img",{src:b,alt:"Onairos Logo",className:"w-8 h-8"}),c().createElement("div",{className:"text-gray-400 mx-2"},"→"),s?c().createElement("img",{src:s,alt:"".concat(o," Logo"),className:"w-8 h-8 rounded-full"}):c().createElement("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center"},c().createElement("span",{className:"text-gray-600 text-xs font-bold"},o.charAt(0)))),c().createElement("h2",{className:"text-lg font-bold text-gray-800"},o)),c().createElement("h1",{className:"text-xl font-bold text-gray-800 mb-4"},"Data Access Request"),c().createElement("p",{className:"text-gray-600 mb-6"},"Select the data you want to share with ",o),c().createElement("div",{className:"flex items-center justify-between gap-4"},c().createElement("button",{onClick:async function(){window.top.postMessage({type:"closeIframe"},"*"),window.postMessage({type:"closeIframe"},"*")},className:"border w-full border border-gray-300 hover:bg-gray-50 text-gray-700 font-medium py-3 px-4 rounded-lg transition-colors"},"Decline"),c().createElement("button",{disabled:!g,onClick:async function(){if(0!==d){const e={message:"Confirm "+o+" Data Access",confirmations:N.current};try{window.top.postMessage({type:"dataRequestComplete",approved:N.current,message:e},"*"),window.postMessage({type:"dataRequestComplete",approved:N.current,message:e},"*")}catch(e){console.error("Error sending data request:",e),window.close()}}else window.close()},className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},"Approve ",d>0&&"(".concat(d,")")))),c().createElement("div",{className:"space-y-3"},["Profile","User Memories"].map((e,t)=>{const n=e.toLowerCase().replace(" ","_"),a={type:e,descriptions:"Profile"===e?"Basic profile information and preferences":"Your personal context and memory data",reward:"Profile"===e?"Personalized experience":"Contextual understanding of your preferences"};return c().createElement(h,{key:n,active:!0,title:a.type,id:a,number:t,descriptions:a.descriptions,rewards:a.reward,size:n,changeGranted:C,onSelectionChange:e=>function(e,t,o,n,a,r){const c=new Date,s={requester:e,date:c.toISOString(),name:n,reward:a,data:t};r?(console.log("Adding connection: ".concat(JSON.stringify(s))),N.current.find(o=>o.requester===e&&o.data===t)||N.current.push(s)):(console.log("Removing connection for: ".concat(t)),N.current=N.current.filter(o=>!(o.requester===e&&o.data===t))),console.log("Current selected connections:",N.current)}(o,n,0,a.type,a.reward,e)})}),c().createElement("div",{className:"bg-white p-4 rounded-xl shadow-sm mt-4"},c().createElement("h3",{className:"text-sm font-semibold text-gray-700 mb-3"},"Your Connected Services"),c().createElement("div",{className:"flex items-center space-x-3"},w.map((e,t)=>c().createElement("div",{key:t,className:"flex flex-col items-center"},(e=>{switch(e){case"instagram":return c().createElement("div",{className:"w-10 h-10 rounded-full bg-linear-to-tr from-purple-500 via-pink-500 to-yellow-500 flex items-center justify-center"},c().createElement("span",{className:"text-white text-xs"},"IG"));case"youtube":return c().createElement("div",{className:"w-10 h-10 rounded-full bg-red-600 flex items-center justify-center"},c().createElement("span",{className:"text-white text-xs"},"YT"));case"email":return c().createElement("div",{className:"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center"},c().createElement("span",{className:"text-white text-xs"},"@"));default:return c().createElement("div",{className:"w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center"},c().createElement("span",{className:"text-gray-600 text-xs"},e.charAt(0).toUpperCase()))}})(e),c().createElement("span",{className:"text-xs text-gray-600 mt-1"},e))))))))};let w=!1,y="",x=null,E=null;function N(){s.createRoot(document.getElementById("root")).render(c().createElement(v,{proofMode:w,domain:y,userSub:x,encryptedUserPin:E}))}return window.addEventListener("message",e=>{e.data&&"onairosButton"===e.data.source&&(w=e.data.proofMode||!1,y=e.data.domain||"",x=e.data.userSub||null,E=e.data.encryptedUserPin||null,N())}),window.parent.postMessage({source:"onairosIframe",action:"iframeReady"},"*"),N(),{}})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("Onairos",["React","ReactDOM"],t):"object"==typeof exports?exports.Onairos=t(require("react"),require("react-dom")):e.Onairos=t(e.React,e.ReactDOM)}(this,(e,t)=>(()=>{"use strict";var a={156:t=>{t.exports=e},318:e=>{e.exports=t},338:(e,t,a)=>{var o=a(318);t.createRoot=o.createRoot,t.hydrateRoot=o.hydrateRoot}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return a[e](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var a=t.getElementsByTagName("script");if(a.length)for(var o=a.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=a[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r=n(156),c=n.n(r),l=n(338);function s(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,o)}return a}function i(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?s(Object(a),!0).forEach(function(t){m(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function m(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var o=a.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const d={1:"https://anushkasirv.sirv.com/persona1.png",2:"https://anushkasirv.sirv.com/persona2.png",3:"https://anushkasirv.sirv.com/persona3.png",4:"https://anushkasirv.sirv.com/persona4.png",5:"https://anushkasirv.sirv.com/persona5.png"},u=[{name:"Gmail",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24"},c().createElement("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),c().createElement("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),c().createElement("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),c().createElement("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})),color:"bg-white",connector:"gmail",description:"We use your emails and search patterns to better understand your interests and communication style."},{name:"Google",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24"},c().createElement("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),c().createElement("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),c().createElement("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),c().createElement("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})),color:"bg-white",connector:"google",description:"We use your search, YouTube, and location signals to better understand your interests and routines."},{name:"Reddit",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"#FF4500"},c().createElement("path",{d:"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"})),color:"bg-white",connector:"reddit",description:"We use your posts and interactions to better understand your interests and preferences."},{name:"Instagram",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24"},c().createElement("defs",null,c().createElement("radialGradient",{id:"instagram-gradient",cx:"0.5",cy:"1",r:"1"},c().createElement("stop",{offset:"0%",stopColor:"#FD5949"}),c().createElement("stop",{offset:"50%",stopColor:"#D6249F"}),c().createElement("stop",{offset:"100%",stopColor:"#285AEB"}))),c().createElement("path",{fill:"url(#instagram-gradient)",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-.073-1.689-.073-4.849 0-3.204.013-3.583.072-4.948.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"})),color:"bg-white",connector:"instagram",description:"We use your photos and interactions to better understand your visual preferences and lifestyle."},{name:"LinkedIn",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"#0077B5"},c().createElement("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})),color:"bg-white",connector:"linkedin",description:"We use your professional network and content to better understand your career interests."},{name:"Pinterest",icon:c().createElement("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"#E60023"},c().createElement("path",{d:"M12 0C5.373 0 0 5.372 0 12s5.373 12 12 12c6.628 0 12-5.372 12-12S18.628 0 12 0zm0 19c-.721 0-1.418-.109-2.073-.312.286-.465.713-1.227.87-1.835l.437-1.664c.229.436.895.8 1.604.8 2.111 0 3.633-1.941 3.633-4.354 0-2.312-1.895-4.049-4.218-4.049-2.972 0-4.684 1.946-4.684 4.338 0 1.083.424 2.42 1.218 2.847.131.07.201.04.232-.107.023-.106.151-.602.2-.784.067-.25.041-.336-.145-.553-.408-.474-.615-1.088-.615-1.72 0-1.658 1.222-3.259 3.297-3.259 1.798 0 3.064 1.244 3.064 3.018 0 2.019-.864 3.423-2.024 3.423-.633 0-1.106-.537-.954-1.196.181-.788.532-1.637.532-2.204 0-.508-.267-.932-.822-.932-.652 0-1.176.685-1.176 1.602 0 .584.197.98.197.98l-.790 3.396C6.595 16.85 6.017 14.47 6.017 12c0-3.313 2.687-6 6-6s6 2.687 6 6-2.687 6-6 6z"})),color:"bg-white",connector:"pinterest",description:"We use your pins and boards to better understand your creative interests and style preferences."}],p={apiKey:process.env.REACT_APP_ONAIROS_API_KEY||"onairos_web_sdk_live_key_2024",baseUrl:process.env.REACT_APP_ONAIROS_BASE_URL||"https://api2.onairos.uk",sdkType:"web",enableHealthMonitoring:!0,enableAutoRefresh:!0,enableConnectionValidation:!0};function g(e){let{onComplete:t,onBack:a,appIcon:o,appName:n="App",personaImages:l,priorityPlatform:s=null,testMode:m=!1}=e;const g=null!=l?l:d,[f,h]=(0,r.useState)({}),[w,v]=(0,r.useState)(!1),[x,b]=(0,r.useState)(null),[y,E]=(0,r.useState)({}),[N,k]=(0,r.useState)({}),[C,S]=(0,r.useState)(0);(0,r.useEffect)(()=>{(()=>{const e=localStorage.getItem("onairos_oauth_platform");e&&(console.log("📱 OAuth return detected for: ".concat(e)),localStorage.removeItem("onairos_oauth_platform"),localStorage.removeItem("onairos_oauth_return"),h(t=>i(i({},t),{},{[e]:!0})),E(t=>i(i({},t),{},{[e]:null})),console.log("✅ ".concat(e," marked as connected from OAuth return")))})()},[]);const O=async e=>{console.log("🚀 connectToPlatform called for: ".concat(e));const t=u.find(t=>t.name===e);if(null==t||!t.connector)return console.error("❌ No connector found for platform: ".concat(e)),!1;try{var a;v(!0),b(e),E(t=>i(i({},t),{},{[e]:null})),console.log("🔗 Starting OAuth connection for ".concat(e,"..."));const o=localStorage.getItem("username")||(null===(a=localStorage.getItem("onairosUser"))||void 0===a?void 0:a.email)||"user@example.com",n="".concat(p.baseUrl,"/").concat(t.connector,"/authorize"),r=await fetch(n,{method:"POST",headers:{"x-api-key":p.apiKey,"Content-Type":"application/json"},body:JSON.stringify({session:{username:o}})});if(!r.ok)throw new Error("HTTP ".concat(r.status,": ").concat(r.statusText));const c=await r.json();console.log("📋 ".concat(e," OAuth response:"),c);const l={youtube:["youtubeURL","youtubeUrl","youtube_url"],linkedin:["linkedinURL","linkedinUrl","linkedin_url"],reddit:["redditURL","redditUrl","reddit_url"],pinterest:["pinterestURL","pinterestUrl","pinterest_url"],instagram:["instagramURL","instagramUrl","instagram_url"],github:["githubURL","githubUrl","github_url"],facebook:["facebookURL","facebookUrl","facebook_url"],gmail:["gmailURL","gmailUrl","gmail_url"]}[t.connector]||["".concat(t.connector,"URL"),"".concat(t.connector,"Url"),"".concat(t.connector,"_url"),"platformURL","authUrl","url"];let s=null,m=null;for(const e of l)if(c[e]){s=c[e],m=e;break}if(!s)throw console.error("❌ No OAuth URL found for ".concat(e,":")),console.error("Expected one of:",l),console.error("Response keys:",Object.keys(c)),console.error("Full response:",c),new Error("No OAuth URL found. Backend should return one of: ".concat(l.join(", ")));if(console.log("✅ Found OAuth URL for ".concat(e," using key: ").concat(m)),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768)return localStorage.setItem("onairos_oauth_platform",e),localStorage.setItem("onairos_oauth_return",window.location.href),window.location.href=s,!0;{const a=window.open(s,"".concat(t.connector,"_oauth"),"width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no");if(!a)throw new Error("Popup blocked. Please allow popups and try again.");let o=!1;const n=setInterval(()=>{try{if(a.location&&"onairos.uk"===a.location.hostname)return o=!0,console.log("🔄 ".concat(e," popup navigated to onairos.uk - treating as success")),void a.close()}catch(t){o||(o=!0,console.log("🔄 ".concat(e," popup navigated (cross-origin) - likely to onairos.uk")))}try{if(a.closed){clearInterval(n);const t=localStorage.getItem("onairos_".concat(e,"_success")),a=localStorage.getItem("onairos_".concat(e,"_error")),r=localStorage.getItem("onairos_".concat(e,"_timestamp")),c=r&&Date.now()-parseInt(r)<3e4;t&&c?(console.log("✅ ".concat(e," OAuth completed successfully (callback page)")),localStorage.removeItem("onairos_".concat(e,"_success")),localStorage.removeItem("onairos_".concat(e,"_timestamp")),h(t=>i(i({},t),{},{[e]:!0})),E(t=>i(i({},t),{},{[e]:null}))):a&&c?(console.log("❌ ".concat(e," OAuth failed:"),a),localStorage.removeItem("onairos_".concat(e,"_error")),localStorage.removeItem("onairos_".concat(e,"_timestamp")),E(t=>i(i({},t),{},{[e]:a}))):o?(console.log("✅ ".concat(e," OAuth likely successful (navigated to onairos.uk)")),h(t=>i(i({},t),{},{[e]:!0})),E(t=>i(i({},t),{},{[e]:null}))):(console.log("⚠️ ".concat(e," OAuth cancelled or no response")),E(t=>i(i({},t),{},{[e]:"Connection was cancelled"}))),v(!1),b(null)}}catch(e){}},1e3);return setTimeout(()=>{try{!a.closed&&a.location&&"onairos.uk"===a.location.hostname&&(console.log("🚪 Auto-closing ".concat(e," popup showing onairos.uk (not found)")),a.close())}catch(t){!a.closed&&o&&(console.log("🚪 Auto-closing ".concat(e," popup (cross-origin, likely onairos.uk)")),a.close())}},1e4),setTimeout(()=>{a.closed||(a.close(),clearInterval(n),E(t=>i(i({},t),{},{[e]:"Connection timeout"})),v(!1),b(null))},3e5),!0}}catch(t){return console.error("❌ Error connecting to ".concat(e,":"),t),E(a=>i(i({},a),{},{[e]:t.message})),v(!1),b(null),!1}},R=async e=>{if(console.log("🔥 TOGGLE CLICKED: ".concat(e)),w&&x!==e)return void console.log("⚠️ Already connecting to ".concat(x,", ignoring click on ").concat(e));f[e]?(console.log("🔌 Disconnecting from ".concat(e,"...")),h(t=>i(i({},t),{},{[e]:!1})),E(t=>i(i({},t),{},{[e]:null}))):await O(e)},_=Object.values(f).filter(Boolean).length,A=Math.min(_+1,5);(()=>{if(!s)return u;const e=u.find(e=>e.name.toLowerCase()===s.toLowerCase()||e.connector.toLowerCase()===s.toLowerCase());if(!e)return u;const t=u.filter(t=>t!==e)})();return c().createElement("div",{className:"w-full h-full flex flex-col",style:{height:"90vh",minHeight:0}},c().createElement("div",{className:"px-6 pt-16 flex-1 flex flex-col",style:{minHeight:0,overflow:"hidden"}},c().createElement("div",{className:"mb-6 flex-shrink-0"},c().createElement("h1",{className:"text-2xl font-bold text-gray-900 mb-2 text-balance leading-tight"},"Connect app data"),c().createElement("p",{className:"text-gray-600 text-base"},"More connections, better personalization.")),c().createElement("div",{className:"mb-2 flex justify-center flex-shrink-0"},c().createElement("div",{className:"w-56 h-56 overflow-hidden"},c().createElement("img",{src:g[A],alt:"Persona ".concat(A),width:"256",height:"256",className:"w-full h-full object-cover",onLoad:()=>console.log("✅ Persona image loaded successfully!"),onError:e=>{console.log("❌ Persona image failed to load:",g[A]),console.log("Connected count:",_),console.log("Persona number:",A),console.log("All persona URLs:",g),console.log("Current location:",window.location.href),console.log("Trying to load from:",g[A]),e.target.style.display="none",e.target.parentElement.style.background="linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%)"}}))),c().createElement("div",{className:"flex-1 overflow-y-auto mt-4",style:{minHeight:0}},c().createElement("div",{className:"space-y-4 pb-4"},u.map(e=>{const t=f[e.name]||!1,a=x===e.name,o=y[e.name],n=w&&!a;(e=>{!!s&&(e.name.toLowerCase()===s.toLowerCase()||(e.connector.toLowerCase(),s.toLowerCase()))})(e);return c().createElement("div",{key:e.name,className:"flex items-start gap-4 p-4 rounded-xl hover:bg-gray-50 transition-colors",style:{backgroundColor:"#ffffff",border:"none",outline:"none",gap:"clamp(6px, 1.5vw, 10px)",padding:"clamp(6px, 1.5vw, 10px)",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)",marginBottom:"clamp(3px, 0.8vw, 6px)"},onClick:()=>!n&&R(e.name)},c().createElement("div",{className:"bg-gray-50 rounded-full flex items-center justify-center flex-shrink-0 border-2 border-gray-200",style:{width:"clamp(28px, 6vw, 36px)",height:"clamp(28px, 6vw, 36px)"}},a?c().createElement("div",{className:"animate-spin h-5 w-5 border-2 border-gray-400 rounded-full border-t-transparent"}):e.icon),c().createElement("div",{className:"flex-1 min-w-0 pr-4"},c().createElement("h3",{className:"font-semibold",style:{color:"#111827",fontSize:"clamp(12px, 2.8vw, 15px)",marginBottom:"clamp(1px, 0.3vw, 3px)",lineHeight:"1.2"}},e.name),c().createElement("p",{className:"leading-tight",style:{color:"#6B7280",fontSize:"clamp(10px, 2.2vw, 12px)",lineHeight:"1.3"}},e.description),o&&c().createElement("p",{className:"text-xs text-red-600 mt-1"},o)),c().createElement("div",{className:"flex-shrink-0"},c().createElement("div",{onClick:t=>{t.stopPropagation(),n||R(e.name)},className:"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out cursor-pointer ".concat(t?"bg-blue-500":"bg-gray-300"," ").concat(n?"opacity-50 cursor-not-allowed":"cursor-pointer"),style:{height:"clamp(20px, 4vw, 26px)",width:"clamp(40px, 8vw, 52px)",boxShadow:t?"0 2px 4px rgba(59, 130, 246, 0.3)":"0 1px 2px rgba(0, 0, 0, 0.1)"}},c().createElement("span",{className:"inline-block rounded-full bg-white transition-all duration-300 ease-in-out shadow-lg ".concat(t?"translate-x-6":"translate-x-0.5"),style:{height:"clamp(16px, 3.5vw, 20px)",width:"clamp(16px, 3.5vw, 20px)"}}))))})))),c().createElement("div",{className:"flex-shrink-0",style:{padding:"clamp(8px, 2vw, 16px) clamp(16px, 4vw, 24px)",minHeight:"auto",display:"flex",flexDirection:"column",gap:"clamp(6px, 1.5vw, 10px)"}},c().createElement("div",{className:"w-full bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-semibold flex items-center justify-center gap-2 cursor-pointer transition-all duration-200 shadow-lg hover:shadow-xl",style:{padding:"clamp(10px, 2.5vw, 14px)",fontSize:"clamp(13px, 3.2vw, 16px)",minHeight:"clamp(36px, 7vw, 44px)"},onClick:()=>{const e=Object.entries(f).filter(e=>{let[t,a]=e;return a}).map(e=>{let[t]=e;return t});t({connectedAccounts:e,totalConnections:e.length,healthScore:C,connectionHealth:N,sdkVersion:"2.1.7",enhancedFeatures:{healthMonitoring:p.enableHealthMonitoring,autoRefresh:p.enableAutoRefresh,connectionValidation:p.enableConnectionValidation}})}},"Update",c().createElement("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"}))),_>0&&c().createElement("div",{onClick:()=>t({connectedAccounts:[],totalConnections:0}),className:"w-full text-gray-500 font-medium text-center cursor-pointer hover:text-gray-700 transition-colors",style:{padding:"clamp(6px, 1.5vw, 10px)",fontSize:"clamp(12px, 3vw, 15px)",minHeight:"clamp(28px, 5vw, 36px)"}},"Skip")))}const f=e=>c().createElement("div",{className:"relative inline-flex items-center"},c().createElement("input",{type:"checkbox",id:"request-".concat(e.number),disabled:!e.active,onChange:t=>{const a=t.target.checked;console.log("Checkbox ".concat(e.title," is now: ").concat(a?"checked":"unchecked")),a?(e.setSelected(!0),e.changeGranted(1)):(e.setSelected(!1),e.changeGranted(-1)),e.onSelectionChange(a)},className:"\n appearance-none w-5 h-5 border rounded\n ".concat(e.active?"border-blue-500 cursor-pointer":"border-gray-300 bg-gray-100 cursor-not-allowed","\n checked:bg-blue-600 checked:border-blue-600\n focus:outline-none focus:ring-2 focus:ring-blue-500/30\n transition-colors\n ")}),c().createElement("svg",{className:"absolute left-0.5 top-0.5 w-4 h-4 text-white pointer-events-none opacity-0 peer-checked:opacity-100",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},c().createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M5 13l4 4L19 7"})),!e.active&&c().createElement("span",{className:"ml-2 text-xs text-red-500 font-medium"},"Not available"));const h=function(e){const[t,a]=(0,r.useState)(!1);return c().createElement("div",{className:"bg-white rounded-xl shadow-sm hover:shadow-md transition-all overflow-hidden"},c().createElement("div",{className:"p-5"},c().createElement("div",{className:"flex items-start space-x-4"},(()=>{switch(e.title){case"Profile":return c().createElement("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-blue-600",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})));case"User Memories":return c().createElement("div",{className:"w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-purple-600",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{d:"M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"})));default:return c().createElement("div",{className:"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-600",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})))}})(),c().createElement("div",{className:"flex-1"},c().createElement("div",{className:"flex items-center justify-between"},c().createElement("h3",{className:"font-medium text-gray-800"},e.title),c().createElement(f,{active:e.active,onSelectionChange:t=>{a(t),e.onSelectionChange(t)},changeGranted:e.changeGranted,setSelected:a,number:e.number+1,type:"Test",title:e.title})),e.descriptions&&c().createElement("div",{className:"mt-2"},c().createElement("p",{className:"text-sm text-gray-600"},e.descriptions)))),e.rewards&&c().createElement("div",{className:"mt-3 pt-3 border-t border-gray-100"},c().createElement("div",{className:"flex items-center"},c().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-yellow-500 mr-2",viewBox:"0 0 20 20",fill:"currentColor"},c().createElement("path",{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"})),c().createElement("span",{className:"text-xs text-gray-500"},"Benefit: ",c().createElement("span",{className:"text-gray-700"},e.rewards))))))},w=n.p+"static/ca60d8c79124e56d8c1c.png",v=e=>{let{requestData:t={},dataRequester:a="App",proofMode:o=!1,domain:n="",appIcon:l=""}=e;const[s,i]=(0,r.useState)(!0),[m,d]=(0,r.useState)([]),[u,p]=(0,r.useState)(0),[f,v]=(0,r.useState)(!1),[x,b]=(0,r.useState)(["instagram","youtube","email"]),[y,E]=(0,r.useState)({}),N=(0,r.useRef)([]),k=(0,r.useRef)(null),C=(0,r.useRef)(null);function S(e){p(u+e)}return(0,r.useEffect)(()=>{v(u>0)},[u]),(0,r.useEffect)(()=>{(async()=>{try{await new Promise(e=>setTimeout(e,1e3)),d(["Profile","User Memories"]),i(!1)}catch(e){console.error("Error loading data:",e),i(!1)}})();const e=e=>{e.data&&"dataRequest"===e.data.type&&(e.data.requestData,e.data.activeModels&&d(e.data.activeModels),e.data.userSub&&(k.current=e.data.userSub),e.data.encryptedUserPin&&(C.current=e.data.encryptedUserPin))};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[]),c().createElement("div",{className:"min-h-screen bg-gray-100"},s?c().createElement("div",{className:"flex items-center justify-center min-h-screen"},c().createElement("div",{className:"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent"})):0===m.length?c().createElement(g,{appIcon:"https://onairos.sirv.com/Images/OnairosBlack.png",appName:a,username:localStorage.getItem("username")}):c().createElement("div",{className:"max-w-md mx-auto p-6 space-y-4"},c().createElement("header",{className:"bg-white p-6 rounded-xl shadow-md"},c().createElement("div",{className:"flex items-center justify-between mb-6"},c().createElement("div",{className:"flex items-center space-x-2"},c().createElement("img",{src:w,alt:"Onairos Logo",className:"w-8 h-8"}),c().createElement("div",{className:"text-gray-400 mx-2"},"→"),l?c().createElement("img",{src:l,alt:"".concat(a," Logo"),className:"w-8 h-8 rounded-full"}):c().createElement("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center"},c().createElement("span",{className:"text-gray-600 text-xs font-bold"},a.charAt(0)))),c().createElement("h2",{className:"text-lg font-bold text-gray-800"},a)),c().createElement("h1",{className:"text-xl font-bold text-gray-800 mb-4"},"Data Access Request"),c().createElement("p",{className:"text-gray-600 mb-6"},"Select the data you want to share with ",a),c().createElement("div",{className:"flex items-center justify-between gap-4"},c().createElement("button",{onClick:async function(){window.top.postMessage({type:"closeIframe"},"*"),window.postMessage({type:"closeIframe"},"*")},className:"border w-full border border-gray-300 hover:bg-gray-50 text-gray-700 font-medium py-3 px-4 rounded-lg transition-colors"},"Decline"),c().createElement("button",{disabled:!f,onClick:async function(){if(0!==u){const e={message:"Confirm "+a+" Data Access",confirmations:N.current};try{window.top.postMessage({type:"dataRequestComplete",approved:N.current,message:e},"*"),window.postMessage({type:"dataRequestComplete",approved:N.current,message:e},"*")}catch(e){console.error("Error sending data request:",e),window.close()}}else window.close()},className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},"Approve ",u>0&&"(".concat(u,")")))),c().createElement("div",{className:"space-y-3"},["Profile","User Memories"].map((e,t)=>{const o=e.toLowerCase().replace(" ","_"),n={type:e,descriptions:"Profile"===e?"Basic profile information and preferences":"Your personal context and memory data",reward:"Profile"===e?"Personalized experience":"Contextual understanding of your preferences"};return c().createElement(h,{key:o,active:!0,title:n.type,id:n,number:t,descriptions:n.descriptions,rewards:n.reward,size:o,changeGranted:S,onSelectionChange:e=>function(e,t,a,o,n,r){const c=new Date,l={requester:e,date:c.toISOString(),name:o,reward:n,data:t};r?(console.log("Adding connection: ".concat(JSON.stringify(l))),N.current.find(a=>a.requester===e&&a.data===t)||N.current.push(l)):(console.log("Removing connection for: ".concat(t)),N.current=N.current.filter(a=>!(a.requester===e&&a.data===t))),console.log("Current selected connections:",N.current)}(a,o,0,n.type,n.reward,e)})}),c().createElement("div",{className:"bg-white p-4 rounded-xl shadow-sm mt-4"},c().createElement("h3",{className:"text-sm font-semibold text-gray-700 mb-3"},"Your Connected Services"),c().createElement("div",{className:"flex items-center space-x-3"},x.map((e,t)=>c().createElement("div",{key:t,className:"flex flex-col items-center"},(e=>{switch(e){case"instagram":return c().createElement("div",{className:"w-10 h-10 rounded-full bg-linear-to-tr from-purple-500 via-pink-500 to-yellow-500 flex items-center justify-center"},c().createElement("span",{className:"text-white text-xs"},"IG"));case"youtube":return c().createElement("div",{className:"w-10 h-10 rounded-full bg-red-600 flex items-center justify-center"},c().createElement("span",{className:"text-white text-xs"},"YT"));case"email":return c().createElement("div",{className:"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center"},c().createElement("span",{className:"text-white text-xs"},"@"));default:return c().createElement("div",{className:"w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center"},c().createElement("span",{className:"text-gray-600 text-xs"},e.charAt(0).toUpperCase()))}})(e),c().createElement("span",{className:"text-xs text-gray-600 mt-1"},e))))))))};let x=!1,b="",y=null,E=null;function N(){l.createRoot(document.getElementById("root")).render(c().createElement(v,{proofMode:x,domain:b,userSub:y,encryptedUserPin:E}))}return window.addEventListener("message",e=>{e.data&&"onairosButton"===e.data.source&&(x=e.data.proofMode||!1,b=e.data.domain||"",y=e.data.userSub||null,E=e.data.encryptedUserPin||null,N())}),window.parent.postMessage({source:"onairosIframe",action:"iframeReady"},"*"),N(),{}})());
|
|
2
2
|
//# sourceMappingURL=iframe.bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe.bundle.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAU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":["webpack://Onairos/webpack/universalModuleDefinition","webpack://Onairos/external umd {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"React\",\"root\":\"React\"}","webpack://Onairos/external umd {\"commonjs\":\"react-dom\",\"commonjs2\":\"react-dom\",\"amd\":\"ReactDOM\",\"root\":\"ReactDOM\"}","webpack://Onairos/./node_modules/react-dom/client.js","webpack://Onairos/webpack/bootstrap","webpack://Onairos/webpack/runtime/compat get default export","webpack://Onairos/webpack/runtime/define property getters","webpack://Onairos/webpack/runtime/global","webpack://Onairos/webpack/runtime/hasOwnProperty shorthand","webpack://Onairos/webpack/runtime/publicPath","webpack://Onairos/./src/components/UniversalOnboarding.jsx","webpack://Onairos/./src/iframe/components/Box.jsx","webpack://Onairos/./src/iframe/components/IndividualConnection.jsx","webpack://Onairos/./src/iframe/DataRequestPage.jsx","webpack://Onairos/./src/iframe/data_request_page.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Onairos\", [\"React\", \"ReactDOM\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Onairos\"] = factory(require(\"react\"), require(\"react-dom\"));\n\telse\n\t\troot[\"Onairos\"] = factory(root[\"React\"], root[\"ReactDOM\"]);\n})(this, (__WEBPACK_EXTERNAL_MODULE__156__, __WEBPACK_EXTERNAL_MODULE__318__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__156__;","module.exports = __WEBPACK_EXTERNAL_MODULE__318__;","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","import React, { useState, useEffect } from 'react';\n\n// Default persona images - using public folder paths for consumer compatibility\nconst defaultPersonaImages = {\n 1: 'https://anushkasirv.sirv.com/persona1.png',\n 2: 'https://anushkasirv.sirv.com/persona2.png', \n 3: 'https://anushkasirv.sirv.com/persona3.png',\n 4: 'https://anushkasirv.sirv.com/persona4.png',\n 5: 'https://anushkasirv.sirv.com/persona5.png',\n};\n\nconst platforms = [\n { \n name: 'Google', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\">\n <path fill=\"#4285F4\" d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"/>\n <path fill=\"#34A853\" d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"/>\n <path fill=\"#FBBC05\" d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"/>\n <path fill=\"#EA4335\" d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"/>\n </svg>\n ), \n color: 'bg-white', \n connector: 'gmail',\n description: \"We use your search, YouTube, and location signals to better understand your interests and routines.\"\n },\n { \n name: 'Reddit', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\" fill=\"#FF4500\">\n <path d=\"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z\" />\n </svg>\n ), \n color: 'bg-white', \n connector: 'reddit',\n description: \"We use your search history to better understand your interests and routines.\"\n },\n { \n name: 'Instagram', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\">\n <defs>\n <radialGradient id=\"instagram-gradient\" cx=\"0.5\" cy=\"1\" r=\"1\">\n <stop offset=\"0%\" stopColor=\"#FD5949\" />\n <stop offset=\"50%\" stopColor=\"#D6249F\" />\n <stop offset=\"100%\" stopColor=\"#285AEB\" />\n </radialGradient>\n </defs>\n <path fill=\"url(#instagram-gradient)\" 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-.073-1.689-.073-4.849 0-3.204.013-3.583.072-4.948.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\"/>\n </svg>\n ), \n color: 'bg-white', \n connector: 'instagram',\n description: \"We use your search history to better understand your interests and routines.\"\n },\n { \n name: 'LinkedIn', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\" fill=\"#0077B5\">\n <path d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\" />\n </svg>\n ), \n color: 'bg-white', \n connector: 'linkedin',\n description: \"We use your search history to better understand your interests and routines.\"\n }\n];\n\n// Enhanced SDK configuration\nconst sdkConfig = {\n apiKey: process.env.REACT_APP_ONAIROS_API_KEY || 'onairos_web_sdk_live_key_2024',\n baseUrl: process.env.REACT_APP_ONAIROS_BASE_URL || 'https://api2.onairos.uk',\n sdkType: 'web', // web, mobile, desktop\n enableHealthMonitoring: true,\n enableAutoRefresh: true,\n enableConnectionValidation: true\n};\n\n/**\n * UniversalOnboarding Component - Compact & Enhanced\n * Displays a streamlined onboarding screen for data connections\n */\nexport default function UniversalOnboarding({ onComplete, onBack, appIcon, appName = 'App', personaImages: personaImagesProp }) {\n // Use provided persona images or fallback to defaults\n const personaImages = personaImagesProp ?? defaultPersonaImages;\n \n const [connectedAccounts, setConnectedAccounts] = useState({});\n const [isConnecting, setIsConnecting] = useState(false);\n const [connectingPlatform, setConnectingPlatform] = useState(null);\n const [connectionErrors, setConnectionErrors] = useState({});\n const [connectionHealth, setConnectionHealth] = useState({});\n const [healthScore, setHealthScore] = useState(0);\n\n // Mobile device detection\n const isMobileDevice = () => {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||\n (window.innerWidth <= 768);\n };\n\n // Handle mobile OAuth return\n useEffect(() => {\n const handleOAuthReturn = () => {\n const platform = localStorage.getItem('onairos_oauth_platform');\n if (platform) {\n console.log(`📱 OAuth return detected for: ${platform}`);\n \n // Clear OAuth state\n localStorage.removeItem('onairos_oauth_platform');\n localStorage.removeItem('onairos_oauth_return');\n \n // Mark as connected\n setConnectedAccounts(prev => ({\n ...prev,\n [platform]: true\n }));\n \n // Clear any errors\n setConnectionErrors(prev => ({\n ...prev,\n [platform]: null\n }));\n \n console.log(`✅ ${platform} marked as connected from OAuth return`);\n }\n };\n\n handleOAuthReturn();\n }, []);\n\n const connectToPlatform = async (platformName) => {\n console.log(`🚀 connectToPlatform called for: ${platformName}`);\n \n const platform = platforms.find(p => p.name === platformName);\n if (!platform?.connector) {\n console.error(`❌ No connector found for platform: ${platformName}`);\n return false;\n }\n\n try {\n setIsConnecting(true);\n setConnectingPlatform(platformName);\n \n // Clear any previous errors\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n \n console.log(`🔗 Starting OAuth connection for ${platformName}...`);\n \n const username = localStorage.getItem('username') || localStorage.getItem('onairosUser')?.email || 'user@example.com';\n \n // Enhanced authorize endpoint with SDK type\n const authorizeUrl = `${sdkConfig.baseUrl}/${platform.connector}/authorize`;\n \n const response = await fetch(authorizeUrl, {\n method: 'POST',\n headers: {\n 'x-api-key': sdkConfig.apiKey,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n session: {\n username: username\n }\n })\n });\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n\n const responseData = await response.json();\n console.log(`📋 ${platformName} OAuth response:`, responseData);\n \n // Check for platform-specific URL keys with multiple fallbacks\n const platformUrlKeys = {\n 'youtube': ['youtubeURL', 'youtubeUrl', 'youtube_url'],\n 'linkedin': ['linkedinURL', 'linkedinUrl', 'linkedin_url'], \n 'reddit': ['redditURL', 'redditUrl', 'reddit_url'],\n 'pinterest': ['pinterestURL', 'pinterestUrl', 'pinterest_url'],\n 'instagram': ['instagramURL', 'instagramUrl', 'instagram_url'],\n 'github': ['githubURL', 'githubUrl', 'github_url'],\n 'facebook': ['facebookURL', 'facebookUrl', 'facebook_url'],\n 'gmail': ['gmailURL', 'gmailUrl', 'gmail_url']\n };\n \n const possibleKeys = platformUrlKeys[platform.connector] || [\n `${platform.connector}URL`,\n `${platform.connector}Url`, \n `${platform.connector}_url`,\n 'platformURL',\n 'authUrl', \n 'url'\n ];\n \n let oauthUrl = null;\n let usedKey = null;\n \n // Try each possible key\n for (const key of possibleKeys) {\n if (responseData[key]) {\n oauthUrl = responseData[key];\n usedKey = key;\n break;\n }\n }\n \n if (!oauthUrl) {\n console.error(`❌ No OAuth URL found for ${platformName}:`);\n console.error(`Expected one of:`, possibleKeys);\n console.error(`Response keys:`, Object.keys(responseData));\n console.error(`Full response:`, responseData);\n throw new Error(`No OAuth URL found. Backend should return one of: ${possibleKeys.join(', ')}`);\n }\n \n console.log(`✅ Found OAuth URL for ${platformName} using key: ${usedKey}`);\n \n if (isMobileDevice()) {\n // Mobile: Use redirect flow\n localStorage.setItem('onairos_oauth_platform', platformName);\n localStorage.setItem('onairos_oauth_return', window.location.href);\n window.location.href = oauthUrl;\n return true;\n } else {\n // Desktop: Use popup flow with enhanced monitoring\n const popup = window.open(\n oauthUrl,\n `${platform.connector}_oauth`,\n 'width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no'\n );\n \n if (!popup) {\n throw new Error('Popup blocked. Please allow popups and try again.');\n }\n\n // Enhanced popup monitoring with onairos.uk detection\n let hasNavigatedToOnairos = false;\n const checkInterval = setInterval(() => {\n try {\n // Try to detect if popup has navigated to onairos.uk (indicates success)\n if (popup.location && popup.location.hostname === 'onairos.uk') {\n hasNavigatedToOnairos = true;\n console.log(`🔄 ${platformName} popup navigated to onairos.uk - treating as success`);\n \n // Close the popup since it shows \"not found\"\n popup.close();\n return; // Let the popup.closed check handle the rest\n }\n } catch (e) {\n // Cross-origin error is expected when popup navigates to onairos.uk\n // This actually indicates the OAuth likely succeeded\n if (!hasNavigatedToOnairos) {\n hasNavigatedToOnairos = true;\n console.log(`🔄 ${platformName} popup navigated (cross-origin) - likely to onairos.uk`);\n }\n }\n \n try {\n // Check if popup is closed\n if (popup.closed) {\n clearInterval(checkInterval);\n \n // Check for success or error signals from callback page\n const successFlag = localStorage.getItem(`onairos_${platformName}_success`);\n const errorFlag = localStorage.getItem(`onairos_${platformName}_error`);\n const timestamp = localStorage.getItem(`onairos_${platformName}_timestamp`);\n \n // Only process recent signals (within 30 seconds)\n const isRecentSignal = timestamp && (Date.now() - parseInt(timestamp) < 30000);\n \n if (successFlag && isRecentSignal) {\n // Success flow from callback page\n console.log(`✅ ${platformName} OAuth completed successfully (callback page)`);\n localStorage.removeItem(`onairos_${platformName}_success`);\n localStorage.removeItem(`onairos_${platformName}_timestamp`);\n \n setConnectedAccounts(prev => ({\n ...prev,\n [platformName]: true\n }));\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n \n } else if (errorFlag && isRecentSignal) {\n // Error flow from callback page\n console.log(`❌ ${platformName} OAuth failed:`, errorFlag);\n localStorage.removeItem(`onairos_${platformName}_error`);\n localStorage.removeItem(`onairos_${platformName}_timestamp`);\n \n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: errorFlag\n }));\n \n } else if (hasNavigatedToOnairos) {\n // Popup navigated to onairos.uk - assume success\n console.log(`✅ ${platformName} OAuth likely successful (navigated to onairos.uk)`);\n setConnectedAccounts(prev => ({\n ...prev,\n [platformName]: true\n }));\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n \n } else {\n // No signal and no onairos navigation - assume user cancelled\n console.log(`⚠️ ${platformName} OAuth cancelled or no response`);\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: 'Connection was cancelled'\n }));\n }\n \n setIsConnecting(false);\n setConnectingPlatform(null);\n }\n } catch (error) {\n // Cross-origin error when popup navigates away - this is normal\n // console.log(`🔄 Popup navigated away for ${platformName}`);\n }\n }, 1000);\n\n // Auto-close popup if it shows onairos.uk \"not found\" page after 10 seconds\n setTimeout(() => {\n try {\n if (!popup.closed && popup.location && popup.location.hostname === 'onairos.uk') {\n console.log(`🚪 Auto-closing ${platformName} popup showing onairos.uk (not found)`);\n popup.close();\n }\n } catch (e) {\n // Cross-origin error is expected - try to close anyway if it's been 10 seconds\n if (!popup.closed && hasNavigatedToOnairos) {\n console.log(`🚪 Auto-closing ${platformName} popup (cross-origin, likely onairos.uk)`);\n popup.close();\n }\n }\n }, 10000);\n\n // Final timeout after 5 minutes\n setTimeout(() => {\n if (!popup.closed) {\n popup.close();\n clearInterval(checkInterval);\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: 'Connection timeout'\n }));\n setIsConnecting(false);\n setConnectingPlatform(null);\n }\n }, 300000);\n\n return true;\n }\n } catch (error) {\n console.error(`❌ Error connecting to ${platformName}:`, error);\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: error.message\n }));\n setIsConnecting(false);\n setConnectingPlatform(null);\n return false;\n }\n };\n\n const handleToggle = async (platformName) => {\n console.log(`🔥 TOGGLE CLICKED: ${platformName}`);\n \n if (isConnecting && connectingPlatform !== platformName) {\n console.log(`⚠️ Already connecting to ${connectingPlatform}, ignoring click on ${platformName}`);\n return;\n }\n \n const isConnected = connectedAccounts[platformName];\n \n if (isConnected) {\n // Disconnect\n console.log(`🔌 Disconnecting from ${platformName}...`);\n setConnectedAccounts(prev => ({\n ...prev,\n [platformName]: false\n }));\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n } else {\n // Connect\n await connectToPlatform(platformName);\n }\n };\n\n const handleContinue = () => {\n const connected = Object.entries(connectedAccounts)\n .filter(([platform, isConnected]) => isConnected)\n .map(([platform]) => platform);\n \n onComplete({\n connectedAccounts: connected,\n totalConnections: connected.length,\n healthScore: healthScore,\n connectionHealth: connectionHealth,\n sdkVersion: '2.1.7',\n enhancedFeatures: {\n healthMonitoring: sdkConfig.enableHealthMonitoring,\n autoRefresh: sdkConfig.enableAutoRefresh,\n connectionValidation: sdkConfig.enableConnectionValidation\n }\n });\n };\n\n const connectedCount = Object.values(connectedAccounts).filter(Boolean).length;\n const personaNumber = Math.min(connectedCount + 1, 5); // 0 connections = persona 1, 1 connection = persona 2, etc.\n\n return (\n <div className=\"w-full h-full flex flex-col\" style={{ height: '100%', minHeight: 0 }}>\n {/* Content - Flexible center area */}\n <div className=\"px-6 pt-16 flex-1 flex flex-col\" style={{ minHeight: 0, overflow: 'hidden' }}>\n <div className=\"mb-6 flex-shrink-0\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2 text-balance leading-tight\">Connect app data</h1>\n <p className=\"text-gray-600 text-base\">More connections, better personalization.</p>\n </div>\n\n <div className=\"mb-2 flex justify-center flex-shrink-0\">\n <div className=\"w-56 h-56 overflow-hidden\">\n <img\n src={personaImages[personaNumber]}\n alt={`Persona ${personaNumber}`}\n width=\"224\"\n height=\"224\"\n className=\"w-full h-full object-cover\"\n onLoad={() => console.log('✅ Persona image loaded successfully!')}\n onError={(e) => {\n console.log('❌ Persona image failed to load:', personaImages[personaNumber]);\n console.log('Connected count:', connectedCount);\n console.log('Persona number:', personaNumber);\n console.log('All persona URLs:', personaImages);\n console.log('Current location:', window.location.href);\n console.log('Trying to load from:', personaImages[personaNumber]);\n \n // Fallback to gradient if image fails to load\n e.target.style.display = 'none';\n e.target.parentElement.style.background = 'linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%)';\n }}\n />\n </div>\n </div>\n\n {/* Scrollable platform list */}\n <div className=\"flex-1 overflow-y-auto mt-4\" style={{ minHeight: 0 }}>\n <div className=\"space-y-4 pb-4\">\n {platforms.map((platform) => {\n const isConnected = connectedAccounts[platform.name] || false;\n const isCurrentlyConnecting = connectingPlatform === platform.name;\n const hasError = connectionErrors[platform.name];\n const isDisabled = isConnecting && !isCurrentlyConnecting;\n \n return (\n <div \n key={platform.name}\n className=\"flex items-start gap-4 p-4 rounded-xl hover:bg-gray-50 transition-colors\"\n style={{\n backgroundColor: \"#ffffff\",\n border: \"none\",\n outline: \"none\",\n }}\n onClick={() => !isDisabled && handleToggle(platform.name)}\n >\n <div className=\"w-10 h-10 bg-white rounded-full flex items-center justify-center flex-shrink-0 border border-gray-100\">\n {isCurrentlyConnecting ? (\n <div className=\"animate-spin h-5 w-5 border-2 border-gray-400 rounded-full border-t-transparent\"></div>\n ) : (\n platform.icon\n )}\n </div>\n <div className=\"flex-1 min-w-0 pr-4\">\n <h3\n className=\"font-medium mb-1\"\n style={{\n backgroundColor: \"#ffffff !important\",\n color: \"#111827 !important\",\n border: \"none\",\n outline: \"none\",\n }}\n >\n {platform.name}\n </h3>\n <p\n className=\"text-sm leading-relaxed\"\n style={{\n backgroundColor: \"#ffffff !important\",\n color: \"#4B5563 !important\",\n border: \"none\",\n outline: \"none\",\n }}\n >\n {platform.description}\n </p>\n \n {/* Error Message */}\n {hasError && (\n <p className=\"text-xs text-red-600 mt-1\">\n {hasError}\n </p>\n )}\n </div>\n <div className=\"flex-shrink-0\">\n <div\n onClick={(e) => {\n e.stopPropagation();\n if (!isDisabled) handleToggle(platform.name);\n }}\n className={`relative inline-flex h-7 w-12 items-center rounded-full transition-all duration-200 ease-in-out cursor-pointer ${\n isConnected ? \"bg-green-500\" : \"bg-gray-300\"\n } ${isDisabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}\n >\n <span\n className={`inline-block h-5 w-5 transform rounded-full bg-white transition-all duration-200 ease-in-out shadow-md ${\n isConnected ? \"translate-x-6\" : \"translate-x-0.5\"\n }`}\n />\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n\n {/* Buttons - Fixed at bottom */}\n <div className=\"px-6 pb-6 pt-4 flex-shrink-0 space-y-3\" style={{ minHeight: 'auto' }}>\n <div\n className=\"w-full bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 cursor-pointer transition-colors\"\n onClick={handleContinue}\n >\n Update\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </div>\n <div\n onClick={() => onComplete({ connectedAccounts: [], totalConnections: 0 })}\n className=\"w-full text-gray-600 text-base font-medium py-3 text-center cursor-pointer hover:text-gray-800 transition-colors\"\n >\n Skip\n </div>\n </div>\n </div>\n );\n}\n","import React from 'react';\n\n/**\n * Box Component\n * Displays a checkbox item for data access requests\n */\nconst Box = (props) => {\n const handleChange = (e) => {\n const checked = e.target.checked;\n console.log(`Checkbox ${props.title} is now: ${checked ? 'checked' : 'unchecked'}`);\n if (checked) {\n props.setSelected(true);\n props.changeGranted(1);\n } else {\n props.setSelected(false);\n props.changeGranted(-1);\n }\n \n props.onSelectionChange(checked);\n };\n\n return (\n <div className=\"relative inline-flex items-center\">\n <input\n type=\"checkbox\"\n id={`request-${props.number}`}\n disabled={!props.active}\n onChange={handleChange}\n className={`\n appearance-none w-5 h-5 border rounded\n ${!props.active ? 'border-gray-300 bg-gray-100 cursor-not-allowed' : 'border-blue-500 cursor-pointer'}\n checked:bg-blue-600 checked:border-blue-600\n focus:outline-none focus:ring-2 focus:ring-blue-500/30\n transition-colors\n `}\n />\n <svg \n className=\"absolute left-0.5 top-0.5 w-4 h-4 text-white pointer-events-none opacity-0 peer-checked:opacity-100\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"3\" d=\"M5 13l4 4L19 7\"></path>\n </svg>\n \n {!props.active && (\n <span className=\"ml-2 text-xs text-red-500 font-medium\">\n Not available\n </span>\n )}\n </div>\n );\n};\n\nexport default Box;\n","import React, { useState } from 'react';\nimport Box from './Box';\n\n/**\n * IndividualConnection Component\n * Displays a card for each data connection request\n */\nfunction IndividualConnection(props) {\n const [selected, setSelected] = useState(false);\n\n const handleSelectionChange = (isSelected) => {\n setSelected(isSelected);\n props.onSelectionChange(isSelected);\n };\n\n // Get icon based on data type\n const getDataTypeIcon = () => {\n switch(props.title) {\n case \"Profile\":\n return (\n <div className=\"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-blue-600\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z\" clipRule=\"evenodd\" />\n </svg>\n </div>\n );\n case \"User Memories\":\n return (\n <div className=\"w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-purple-600\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path d=\"M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z\" />\n </svg>\n </div>\n );\n default:\n return (\n <div className=\"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-gray-600\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z\" clipRule=\"evenodd\" />\n </svg>\n </div>\n );\n }\n };\n\n return (\n <div className=\"bg-white rounded-xl shadow-sm hover:shadow-md transition-all overflow-hidden\">\n <div className=\"p-5\">\n <div className=\"flex items-start space-x-4\">\n {getDataTypeIcon()}\n <div className=\"flex-1\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-medium text-gray-800\">{props.title}</h3>\n <Box\n active={props.active}\n onSelectionChange={handleSelectionChange}\n changeGranted={props.changeGranted}\n setSelected={setSelected}\n number={props.number + 1}\n type={\"Test\"}\n title={props.title}\n />\n </div>\n \n {props.descriptions && (\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-600\">{props.descriptions}</p>\n </div>\n )}\n </div>\n </div>\n \n {props.rewards && (\n <div className=\"mt-3 pt-3 border-t border-gray-100\">\n <div className=\"flex items-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-yellow-500 mr-2\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z\" clipRule=\"evenodd\" />\n </svg>\n <span className=\"text-xs text-gray-500\">Benefit: <span className=\"text-gray-700\">{props.rewards}</span></span>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport default IndividualConnection;\n","import React, { useState, useEffect, useRef } from 'react';\nimport UniversalOnboarding from '../components/UniversalOnboarding.jsx';\nimport IndividualConnection from './components/IndividualConnection';\nimport onairosLogo from './icons/onairos_logo.png';\n\n/**\n * DataRequestPage Component\n * Displays different data requests and handles user interactions\n */\nconst DataRequestPage = ({ requestData = {}, dataRequester = 'App', proofMode = false, domain = '', appIcon = '' }) => {\n const [loading, setLoading] = useState(true);\n const [activeModels, setActiveModels] = useState([]);\n const [granted, setGranted] = useState(0);\n const [allowSubmit, setAllowSubmit] = useState(false);\n const [userConnections, setUserConnections] = useState(['instagram', 'youtube', 'email']);\n const [selectedRequests, setSelectedRequests] = useState({});\n const selectedConnections = useRef([]);\n const userSub = useRef(null);\n const encryptedUserPin = useRef(null);\n\n // Update allowSubmit when granted changes\n useEffect(() => {\n if (granted > 0) {\n setAllowSubmit(true);\n } else {\n setAllowSubmit(false);\n }\n }, [granted]);\n\n // Simulate loading data\n useEffect(() => {\n // In a real implementation, this would fetch active models from a service\n const loadData = async () => {\n try {\n // Simulate API call\n await new Promise(resolve => setTimeout(resolve, 1000));\n \n // Sample active models - this would come from your backend\n setActiveModels(['Profile', 'User Memories']);\n setLoading(false);\n } catch (error) {\n console.error('Error loading data:', error);\n setLoading(false);\n }\n };\n \n loadData();\n\n // Message handler to receive data from parent window\n const handleMessage = (event) => {\n if (event.data && event.data.type === 'dataRequest') {\n // Process received data\n if (event.data.requestData) {\n // Update request data state\n }\n if (event.data.activeModels) {\n setActiveModels(event.data.activeModels);\n }\n if (event.data.userSub) {\n userSub.current = event.data.userSub;\n }\n if (event.data.encryptedUserPin) {\n encryptedUserPin.current = event.data.encryptedUserPin;\n }\n }\n };\n\n // Add message listener\n window.addEventListener('message', handleMessage);\n \n // Clean up listener\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, []);\n\n /**\n * Reject all data requests\n */\n async function rejectDataRequest() {\n window.top.postMessage({type: 'closeIframe'}, '*');\n window.postMessage({type: 'closeIframe'}, '*');\n }\n\n /**\n * Send the selected data requests to the parent window\n */\n async function sendDataRequest() {\n if (granted === 0) {\n window.close();\n return;\n } else {\n const SignMessage = {\n message: 'Confirm ' + dataRequester + ' Data Access',\n confirmations: selectedConnections.current\n };\n \n // Send simplified response\n try {\n window.top.postMessage({\n type: 'dataRequestComplete',\n approved: selectedConnections.current,\n message: SignMessage\n }, '*');\n \n window.postMessage({\n type: 'dataRequestComplete',\n approved: selectedConnections.current,\n message: SignMessage\n }, '*');\n } catch (error) {\n console.error(\"Error sending data request:\", error);\n window.close();\n }\n }\n }\n\n /**\n * Update the granted count\n */\n function changeGranted(plusMinus) {\n setGranted(granted + plusMinus);\n }\n\n /**\n * Handle selection of a connection/data request\n */\n function handleConnectionSelection(dataRequester, modelType, index, title, reward, isSelected) {\n const newDate = new Date();\n const newConnection = {\n requester: dataRequester,\n date: newDate.toISOString(),\n name: title,\n reward: reward,\n data: modelType\n };\n\n if (isSelected) {\n console.log(`Adding connection: ${JSON.stringify(newConnection)}`);\n if (!selectedConnections.current.find(connection => connection.requester === dataRequester && connection.data === modelType)) {\n selectedConnections.current.push(newConnection);\n }\n } else {\n console.log(`Removing connection for: ${modelType}`);\n selectedConnections.current = selectedConnections.current.filter(\n connection => !(connection.requester === dataRequester && connection.data === modelType)\n );\n }\n\n console.log('Current selected connections:', selectedConnections.current);\n }\n\n return (\n <div className=\"min-h-screen bg-gray-100\">\n {loading ? (\n <div className=\"flex items-center justify-center min-h-screen\">\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\n </div>\n ) : activeModels.length === 0 ? (\n <UniversalOnboarding \n appIcon=\"https://onairos.sirv.com/Images/OnairosBlack.png\" \n appName={dataRequester}\n username={localStorage.getItem(\"username\")}\n />\n ) : (\n <div className=\"max-w-md mx-auto p-6 space-y-4\">\n <header className=\"bg-white p-6 rounded-xl shadow-md\">\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center space-x-2\">\n <img src={onairosLogo} alt=\"Onairos Logo\" className=\"w-8 h-8\" />\n <div className=\"text-gray-400 mx-2\">→</div>\n {appIcon ? (\n <img src={appIcon} alt={`${dataRequester} Logo`} className=\"w-8 h-8 rounded-full\" />\n ) : (\n <div className=\"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center\">\n <span className=\"text-gray-600 text-xs font-bold\">{dataRequester.charAt(0)}</span>\n </div>\n )}\n </div>\n <h2 className=\"text-lg font-bold text-gray-800\">{dataRequester}</h2>\n </div>\n \n <h1 className=\"text-xl font-bold text-gray-800 mb-4\">Data Access Request</h1>\n <p className=\"text-gray-600 mb-6\">Select the data you want to share with {dataRequester}</p>\n \n <div className=\"flex items-center justify-between gap-4\">\n <button\n onClick={rejectDataRequest}\n className=\"border w-full border border-gray-300 hover:bg-gray-50 text-gray-700 font-medium py-3 px-4 rounded-lg transition-colors\"\n >\n Decline\n </button>\n <button\n disabled={!allowSubmit}\n onClick={sendDataRequest}\n className=\"w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Approve {granted > 0 && `(${granted})`}\n </button>\n </div>\n </header>\n\n <div className=\"space-y-3\">\n {/* Only show Profile and User Memories */}\n {['Profile', 'User Memories'].map((dataType, index) => {\n const key = dataType.toLowerCase().replace(' ', '_');\n const product = {\n type: dataType,\n descriptions: dataType === 'Profile' ? \n 'Basic profile information and preferences' : \n 'Your personal context and memory data',\n reward: dataType === 'Profile' ? \n 'Personalized experience' : \n 'Contextual understanding of your preferences'\n };\n \n return (\n <IndividualConnection\n key={key}\n active={true}\n title={product.type}\n id={product}\n number={index}\n descriptions={product.descriptions}\n rewards={product.reward}\n size={key}\n changeGranted={changeGranted}\n onSelectionChange={(isSelected) =>\n handleConnectionSelection(dataRequester, key, index, product.type, product.reward, isSelected)\n }\n />\n );\n })}\n \n {/* User Connections Section */}\n <div className=\"bg-white p-4 rounded-xl shadow-sm mt-4\">\n <h3 className=\"text-sm font-semibold text-gray-700 mb-3\">Your Connected Services</h3>\n <div className=\"flex items-center space-x-3\">\n {userConnections.map((connection, index) => {\n const getConnectionIcon = (type) => {\n switch(type) {\n case 'instagram':\n return (\n <div className=\"w-10 h-10 rounded-full bg-linear-to-tr from-purple-500 via-pink-500 to-yellow-500 flex items-center justify-center\">\n <span className=\"text-white text-xs\">IG</span>\n </div>\n );\n case 'youtube':\n return (\n <div className=\"w-10 h-10 rounded-full bg-red-600 flex items-center justify-center\">\n <span className=\"text-white text-xs\">YT</span>\n </div>\n );\n case 'email':\n return (\n <div className=\"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center\">\n <span className=\"text-white text-xs\">@</span>\n </div>\n );\n default:\n return (\n <div className=\"w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center\">\n <span className=\"text-gray-600 text-xs\">{type.charAt(0).toUpperCase()}</span>\n </div>\n );\n }\n };\n \n return (\n <div key={index} className=\"flex flex-col items-center\">\n {getConnectionIcon(connection)}\n <span className=\"text-xs text-gray-600 mt-1\">{connection}</span>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default DataRequestPage;\n","import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport DataRequestPage from './DataRequestPage.jsx';\n\n// Global variables to store data from parent window\nlet proofMode = false;\nlet domain = '';\nlet userSub = null;\nlet encryptedUserPin = null;\n\n// Handle messages from the parent window\nwindow.addEventListener('message', (event) => {\n // Verify the sender origin if needed\n // if (event.origin !== 'expected-origin') return;\n \n if (event.data && event.data.source === 'onairosButton') {\n proofMode = event.data.proofMode || false;\n domain = event.data.domain || '';\n userSub = event.data.userSub || null;\n encryptedUserPin = event.data.encryptedUserPin || null;\n \n // Re-render with the new data\n renderApp();\n }\n});\n\n// Notify the parent window that the iframe is ready\nwindow.parent.postMessage({\n source: 'onairosIframe',\n action: 'iframeReady'\n}, '*');\n\n// Function to render the React app\nfunction renderApp() {\n const root = ReactDOM.createRoot(document.getElementById('root'));\n root.render(\n <DataRequestPage \n proofMode={proofMode}\n domain={domain}\n userSub={userSub}\n encryptedUserPin={encryptedUserPin}\n />\n );\n}\n\n// Initial render\nrenderApp();\n"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__156__","__WEBPACK_EXTERNAL_MODULE__318__","m","createRoot","hydrateRoot","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","tagName","toUpperCase","src","scripts","getElementsByTagName","length","i","test","Error","replace","p","defaultPersonaImages","platforms","name","icon","React","className","viewBox","fill","color","connector","description","id","cx","cy","r","offset","stopColor","sdkConfig","apiKey","process","env","REACT_APP_ONAIROS_API_KEY","baseUrl","REACT_APP_ONAIROS_BASE_URL","sdkType","enableHealthMonitoring","enableAutoRefresh","enableConnectionValidation","UniversalOnboarding","_ref","onComplete","onBack","appIcon","appName","personaImages","personaImagesProp","connectedAccounts","setConnectedAccounts","useState","isConnecting","setIsConnecting","connectingPlatform","setConnectingPlatform","connectionErrors","setConnectionErrors","connectionHealth","setConnectionHealth","healthScore","setHealthScore","useEffect","handleOAuthReturn","platform","localStorage","getItem","console","log","concat","removeItem","prev","_objectSpread","connectToPlatform","async","platformName","find","error","_localStorage$getItem","username","email","authorizeUrl","response","fetch","method","headers","body","JSON","stringify","session","ok","status","statusText","responseData","json","possibleKeys","oauthUrl","usedKey","keys","join","navigator","userAgent","innerWidth","setItem","href","popup","open","hasNavigatedToOnairos","checkInterval","setInterval","hostname","close","closed","clearInterval","successFlag","errorFlag","timestamp","isRecentSignal","Date","now","parseInt","setTimeout","message","handleToggle","connectedCount","values","filter","Boolean","personaNumber","Math","min","style","height","minHeight","overflow","alt","width","onLoad","onError","target","display","parentElement","background","map","isConnected","isCurrentlyConnecting","hasError","isDisabled","backgroundColor","border","outline","onClick","stopPropagation","handleContinue","connected","entries","_ref2","_ref3","totalConnections","sdkVersion","enhancedFeatures","healthMonitoring","autoRefresh","connectionValidation","stroke","strokeLinecap","strokeLinejoin","strokeWidth","props","type","number","disabled","active","onChange","checked","title","setSelected","changeGranted","onSelectionChange","xmlns","selected","getDataTypeIcon","fillRule","clipRule","Box","isSelected","descriptions","rewards","requestData","dataRequester","proofMode","domain","loading","setLoading","activeModels","setActiveModels","granted","setGranted","allowSubmit","setAllowSubmit","userConnections","setUserConnections","selectedRequests","setSelectedRequests","selectedConnections","useRef","userSub","encryptedUserPin","plusMinus","Promise","resolve","loadData","handleMessage","event","data","current","addEventListener","removeEventListener","onairosLogo","charAt","top","postMessage","SignMessage","confirmations","approved","dataType","index","toLowerCase","product","reward","IndividualConnection","size","modelType","newDate","newConnection","requester","date","toISOString","connection","push","handleConnectionSelection","getConnectionIcon","renderApp","ReactDOM","getElementById","render","DataRequestPage","source","parent","action"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"iframe.bundle.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,SAAUA,QAAQ,cAC1B,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,UAAW,CAAC,QAAS,YAAaJ,GACf,iBAAZC,QACdA,QAAiB,QAAID,EAAQG,QAAQ,SAAUA,QAAQ,cAEvDJ,EAAc,QAAIC,EAAQD,EAAY,MAAGA,EAAe,SACzD,CATD,CASGO,KAAM,CAACC,EAAkCC,I,kCCT5CN,EAAOD,QAAUM,C,UCAjBL,EAAOD,QAAUO,C,gBCEjB,IAAIC,EAAI,EAAQ,KAEdR,EAAQS,WAAaD,EAAEC,WACvBT,EAAQU,YAAcF,EAAEE,W,GCJtBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAad,QAGrB,IAAIC,EAASU,EAAyBE,GAAY,CAGjDb,QAAS,CAAC,GAOX,OAHAgB,EAAoBH,GAAUZ,EAAQA,EAAOD,QAASY,GAG/CX,EAAOD,OACf,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qK,EAAKkD,OAAO,GAAGtO,kBAQ7D2P,CAAkBH,GACnB1O,IAAAA,cAAA,QAAMC,UAAU,8BAA8ByO,WC1QpE,IAAI/C,GAAY,EACZC,EAAS,GACTe,EAAU,KACVC,EAAmB,KAyBvB,SAASkC,IACMC,EAAAA,WAAoBhQ,SAASiQ,eAAe,SACpDC,OACHjP,IAAAA,cAACkP,EAAe,CACdvD,UAAWA,EACXC,OAAQA,EACRe,QAASA,EACTC,iBAAkBA,IAGxB,C,OAhCAtO,OAAO+O,iBAAiB,UAAYH,IAI9BA,EAAMC,MAA8B,kBAAtBD,EAAMC,KAAKgC,SAC3BxD,EAAYuB,EAAMC,KAAKxB,YAAa,EACpCC,EAASsB,EAAMC,KAAKvB,QAAU,GAC9Be,EAAUO,EAAMC,KAAKR,SAAW,KAChCC,EAAmBM,EAAMC,KAAKP,kBAAoB,KAGlDkC,OAKJxQ,OAAO8Q,OAAO1B,YAAY,CACxByB,OAAQ,gBACRE,OAAQ,eACP,KAgBHP,I","sources":["webpack://Onairos/webpack/universalModuleDefinition","webpack://Onairos/external umd {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"React\",\"root\":\"React\"}","webpack://Onairos/external umd {\"commonjs\":\"react-dom\",\"commonjs2\":\"react-dom\",\"amd\":\"ReactDOM\",\"root\":\"ReactDOM\"}","webpack://Onairos/./node_modules/react-dom/client.js","webpack://Onairos/webpack/bootstrap","webpack://Onairos/webpack/runtime/compat get default export","webpack://Onairos/webpack/runtime/define property getters","webpack://Onairos/webpack/runtime/global","webpack://Onairos/webpack/runtime/hasOwnProperty shorthand","webpack://Onairos/webpack/runtime/publicPath","webpack://Onairos/./src/components/UniversalOnboarding.jsx","webpack://Onairos/./src/iframe/components/Box.jsx","webpack://Onairos/./src/iframe/components/IndividualConnection.jsx","webpack://Onairos/./src/iframe/DataRequestPage.jsx","webpack://Onairos/./src/iframe/data_request_page.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Onairos\", [\"React\", \"ReactDOM\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Onairos\"] = factory(require(\"react\"), require(\"react-dom\"));\n\telse\n\t\troot[\"Onairos\"] = factory(root[\"React\"], root[\"ReactDOM\"]);\n})(this, (__WEBPACK_EXTERNAL_MODULE__156__, __WEBPACK_EXTERNAL_MODULE__318__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__156__;","module.exports = __WEBPACK_EXTERNAL_MODULE__318__;","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","import React, { useState, useEffect } from 'react';\n\n// Default persona images - using public folder paths for consumer compatibility\nconst defaultPersonaImages = {\n 1: 'https://anushkasirv.sirv.com/persona1.png',\n 2: 'https://anushkasirv.sirv.com/persona2.png', \n 3: 'https://anushkasirv.sirv.com/persona3.png',\n 4: 'https://anushkasirv.sirv.com/persona4.png',\n 5: 'https://anushkasirv.sirv.com/persona5.png',\n};\n\nconst platforms = [\n { \n name: 'Gmail', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\">\n <path fill=\"#4285F4\" d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"/>\n <path fill=\"#34A853\" d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"/>\n <path fill=\"#FBBC05\" d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"/>\n <path fill=\"#EA4335\" d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"/>\n </svg>\n ), \n color: 'bg-white', \n connector: 'gmail',\n description: \"We use your emails and search patterns to better understand your interests and communication style.\"\n },\n { \n name: 'Google', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\">\n <path fill=\"#4285F4\" d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"/>\n <path fill=\"#34A853\" d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"/>\n <path fill=\"#FBBC05\" d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"/>\n <path fill=\"#EA4335\" d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"/>\n </svg>\n ), \n color: 'bg-white', \n connector: 'google',\n description: \"We use your search, YouTube, and location signals to better understand your interests and routines.\"\n },\n { \n name: 'Reddit', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\" fill=\"#FF4500\">\n <path d=\"M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z\" />\n </svg>\n ), \n color: 'bg-white', \n connector: 'reddit',\n description: \"We use your posts and interactions to better understand your interests and preferences.\"\n },\n { \n name: 'Instagram', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\">\n <defs>\n <radialGradient id=\"instagram-gradient\" cx=\"0.5\" cy=\"1\" r=\"1\">\n <stop offset=\"0%\" stopColor=\"#FD5949\" />\n <stop offset=\"50%\" stopColor=\"#D6249F\" />\n <stop offset=\"100%\" stopColor=\"#285AEB\" />\n </radialGradient>\n </defs>\n <path fill=\"url(#instagram-gradient)\" 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-.073-1.689-.073-4.849 0-3.204.013-3.583.072-4.948.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\"/>\n </svg>\n ), \n color: 'bg-white', \n connector: 'instagram',\n description: \"We use your photos and interactions to better understand your visual preferences and lifestyle.\"\n },\n { \n name: 'LinkedIn', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\" fill=\"#0077B5\">\n <path d=\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z\" />\n </svg>\n ), \n color: 'bg-white', \n connector: 'linkedin',\n description: \"We use your professional network and content to better understand your career interests.\"\n },\n { \n name: 'Pinterest', \n icon: (\n <svg className=\"w-6 h-6\" viewBox=\"0 0 24 24\" fill=\"#E60023\">\n <path d=\"M12 0C5.373 0 0 5.372 0 12s5.373 12 12 12c6.628 0 12-5.372 12-12S18.628 0 12 0zm0 19c-.721 0-1.418-.109-2.073-.312.286-.465.713-1.227.87-1.835l.437-1.664c.229.436.895.8 1.604.8 2.111 0 3.633-1.941 3.633-4.354 0-2.312-1.895-4.049-4.218-4.049-2.972 0-4.684 1.946-4.684 4.338 0 1.083.424 2.42 1.218 2.847.131.07.201.04.232-.107.023-.106.151-.602.2-.784.067-.25.041-.336-.145-.553-.408-.474-.615-1.088-.615-1.72 0-1.658 1.222-3.259 3.297-3.259 1.798 0 3.064 1.244 3.064 3.018 0 2.019-.864 3.423-2.024 3.423-.633 0-1.106-.537-.954-1.196.181-.788.532-1.637.532-2.204 0-.508-.267-.932-.822-.932-.652 0-1.176.685-1.176 1.602 0 .584.197.98.197.98l-.790 3.396C6.595 16.85 6.017 14.47 6.017 12c0-3.313 2.687-6 6-6s6 2.687 6 6-2.687 6-6 6z\"/>\n </svg>\n ), \n color: 'bg-white', \n connector: 'pinterest',\n description: \"We use your pins and boards to better understand your creative interests and style preferences.\"\n }\n];\n\n// Enhanced SDK configuration\nconst sdkConfig = {\n apiKey: process.env.REACT_APP_ONAIROS_API_KEY || 'onairos_web_sdk_live_key_2024',\n baseUrl: process.env.REACT_APP_ONAIROS_BASE_URL || 'https://api2.onairos.uk',\n sdkType: 'web', // web, mobile, desktop\n enableHealthMonitoring: true,\n enableAutoRefresh: true,\n enableConnectionValidation: true\n};\n\n/**\n * UniversalOnboarding Component - Compact & Enhanced\n * Displays a streamlined onboarding screen for data connections\n */\nexport default function UniversalOnboarding({ onComplete, onBack, appIcon, appName = 'App', personaImages: personaImagesProp, priorityPlatform = null, testMode = false }) {\n // Use provided persona images or fallback to defaults\n const personaImages = personaImagesProp ?? defaultPersonaImages;\n \n const [connectedAccounts, setConnectedAccounts] = useState({});\n const [isConnecting, setIsConnecting] = useState(false);\n const [connectingPlatform, setConnectingPlatform] = useState(null);\n const [connectionErrors, setConnectionErrors] = useState({});\n const [connectionHealth, setConnectionHealth] = useState({});\n const [healthScore, setHealthScore] = useState(0);\n\n // Mobile device detection\n const isMobileDevice = () => {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||\n (window.innerWidth <= 768);\n };\n\n // Handle mobile OAuth return\n useEffect(() => {\n const handleOAuthReturn = () => {\n const platform = localStorage.getItem('onairos_oauth_platform');\n if (platform) {\n console.log(`📱 OAuth return detected for: ${platform}`);\n \n // Clear OAuth state\n localStorage.removeItem('onairos_oauth_platform');\n localStorage.removeItem('onairos_oauth_return');\n \n // Mark as connected\n setConnectedAccounts(prev => ({\n ...prev,\n [platform]: true\n }));\n \n // Clear any errors\n setConnectionErrors(prev => ({\n ...prev,\n [platform]: null\n }));\n \n console.log(`✅ ${platform} marked as connected from OAuth return`);\n }\n };\n\n handleOAuthReturn();\n }, []);\n\n const connectToPlatform = async (platformName) => {\n console.log(`🚀 connectToPlatform called for: ${platformName}`);\n \n const platform = platforms.find(p => p.name === platformName);\n if (!platform?.connector) {\n console.error(`❌ No connector found for platform: ${platformName}`);\n return false;\n }\n\n try {\n setIsConnecting(true);\n setConnectingPlatform(platformName);\n \n // Clear any previous errors\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n \n console.log(`🔗 Starting OAuth connection for ${platformName}...`);\n \n const username = localStorage.getItem('username') || localStorage.getItem('onairosUser')?.email || 'user@example.com';\n \n // Enhanced authorize endpoint with SDK type\n const authorizeUrl = `${sdkConfig.baseUrl}/${platform.connector}/authorize`;\n \n const response = await fetch(authorizeUrl, {\n method: 'POST',\n headers: {\n 'x-api-key': sdkConfig.apiKey,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n session: {\n username: username\n }\n })\n });\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n\n const responseData = await response.json();\n console.log(`📋 ${platformName} OAuth response:`, responseData);\n \n // Check for platform-specific URL keys with multiple fallbacks\n const platformUrlKeys = {\n 'youtube': ['youtubeURL', 'youtubeUrl', 'youtube_url'],\n 'linkedin': ['linkedinURL', 'linkedinUrl', 'linkedin_url'], \n 'reddit': ['redditURL', 'redditUrl', 'reddit_url'],\n 'pinterest': ['pinterestURL', 'pinterestUrl', 'pinterest_url'],\n 'instagram': ['instagramURL', 'instagramUrl', 'instagram_url'],\n 'github': ['githubURL', 'githubUrl', 'github_url'],\n 'facebook': ['facebookURL', 'facebookUrl', 'facebook_url'],\n 'gmail': ['gmailURL', 'gmailUrl', 'gmail_url']\n };\n \n const possibleKeys = platformUrlKeys[platform.connector] || [\n `${platform.connector}URL`,\n `${platform.connector}Url`, \n `${platform.connector}_url`,\n 'platformURL',\n 'authUrl', \n 'url'\n ];\n \n let oauthUrl = null;\n let usedKey = null;\n \n // Try each possible key\n for (const key of possibleKeys) {\n if (responseData[key]) {\n oauthUrl = responseData[key];\n usedKey = key;\n break;\n }\n }\n \n if (!oauthUrl) {\n console.error(`❌ No OAuth URL found for ${platformName}:`);\n console.error(`Expected one of:`, possibleKeys);\n console.error(`Response keys:`, Object.keys(responseData));\n console.error(`Full response:`, responseData);\n throw new Error(`No OAuth URL found. Backend should return one of: ${possibleKeys.join(', ')}`);\n }\n \n console.log(`✅ Found OAuth URL for ${platformName} using key: ${usedKey}`);\n \n if (isMobileDevice()) {\n // Mobile: Use redirect flow\n localStorage.setItem('onairos_oauth_platform', platformName);\n localStorage.setItem('onairos_oauth_return', window.location.href);\n window.location.href = oauthUrl;\n return true;\n } else {\n // Desktop: Use popup flow with enhanced monitoring\n const popup = window.open(\n oauthUrl,\n `${platform.connector}_oauth`,\n 'width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no'\n );\n \n if (!popup) {\n throw new Error('Popup blocked. Please allow popups and try again.');\n }\n\n // Enhanced popup monitoring with onairos.uk detection\n let hasNavigatedToOnairos = false;\n const checkInterval = setInterval(() => {\n try {\n // Try to detect if popup has navigated to onairos.uk (indicates success)\n if (popup.location && popup.location.hostname === 'onairos.uk') {\n hasNavigatedToOnairos = true;\n console.log(`🔄 ${platformName} popup navigated to onairos.uk - treating as success`);\n \n // Close the popup since it shows \"not found\"\n popup.close();\n return; // Let the popup.closed check handle the rest\n }\n } catch (e) {\n // Cross-origin error is expected when popup navigates to onairos.uk\n // This actually indicates the OAuth likely succeeded\n if (!hasNavigatedToOnairos) {\n hasNavigatedToOnairos = true;\n console.log(`🔄 ${platformName} popup navigated (cross-origin) - likely to onairos.uk`);\n }\n }\n \n try {\n // Check if popup is closed\n if (popup.closed) {\n clearInterval(checkInterval);\n \n // Check for success or error signals from callback page\n const successFlag = localStorage.getItem(`onairos_${platformName}_success`);\n const errorFlag = localStorage.getItem(`onairos_${platformName}_error`);\n const timestamp = localStorage.getItem(`onairos_${platformName}_timestamp`);\n \n // Only process recent signals (within 30 seconds)\n const isRecentSignal = timestamp && (Date.now() - parseInt(timestamp) < 30000);\n \n if (successFlag && isRecentSignal) {\n // Success flow from callback page\n console.log(`✅ ${platformName} OAuth completed successfully (callback page)`);\n localStorage.removeItem(`onairos_${platformName}_success`);\n localStorage.removeItem(`onairos_${platformName}_timestamp`);\n \n setConnectedAccounts(prev => ({\n ...prev,\n [platformName]: true\n }));\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n \n } else if (errorFlag && isRecentSignal) {\n // Error flow from callback page\n console.log(`❌ ${platformName} OAuth failed:`, errorFlag);\n localStorage.removeItem(`onairos_${platformName}_error`);\n localStorage.removeItem(`onairos_${platformName}_timestamp`);\n \n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: errorFlag\n }));\n \n } else if (hasNavigatedToOnairos) {\n // Popup navigated to onairos.uk - assume success\n console.log(`✅ ${platformName} OAuth likely successful (navigated to onairos.uk)`);\n setConnectedAccounts(prev => ({\n ...prev,\n [platformName]: true\n }));\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n \n } else {\n // No signal and no onairos navigation - assume user cancelled\n console.log(`⚠️ ${platformName} OAuth cancelled or no response`);\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: 'Connection was cancelled'\n }));\n }\n \n setIsConnecting(false);\n setConnectingPlatform(null);\n }\n } catch (error) {\n // Cross-origin error when popup navigates away - this is normal\n // console.log(`🔄 Popup navigated away for ${platformName}`);\n }\n }, 1000);\n\n // Auto-close popup if it shows onairos.uk \"not found\" page after 10 seconds\n setTimeout(() => {\n try {\n if (!popup.closed && popup.location && popup.location.hostname === 'onairos.uk') {\n console.log(`🚪 Auto-closing ${platformName} popup showing onairos.uk (not found)`);\n popup.close();\n }\n } catch (e) {\n // Cross-origin error is expected - try to close anyway if it's been 10 seconds\n if (!popup.closed && hasNavigatedToOnairos) {\n console.log(`🚪 Auto-closing ${platformName} popup (cross-origin, likely onairos.uk)`);\n popup.close();\n }\n }\n }, 10000);\n\n // Final timeout after 5 minutes\n setTimeout(() => {\n if (!popup.closed) {\n popup.close();\n clearInterval(checkInterval);\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: 'Connection timeout'\n }));\n setIsConnecting(false);\n setConnectingPlatform(null);\n }\n }, 300000);\n\n return true;\n }\n } catch (error) {\n console.error(`❌ Error connecting to ${platformName}:`, error);\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: error.message\n }));\n setIsConnecting(false);\n setConnectingPlatform(null);\n return false;\n }\n };\n\n const handleToggle = async (platformName) => {\n console.log(`🔥 TOGGLE CLICKED: ${platformName}`);\n \n if (isConnecting && connectingPlatform !== platformName) {\n console.log(`⚠️ Already connecting to ${connectingPlatform}, ignoring click on ${platformName}`);\n return;\n }\n \n const isConnected = connectedAccounts[platformName];\n \n if (isConnected) {\n // Disconnect\n console.log(`🔌 Disconnecting from ${platformName}...`);\n setConnectedAccounts(prev => ({\n ...prev,\n [platformName]: false\n }));\n setConnectionErrors(prev => ({\n ...prev,\n [platformName]: null\n }));\n } else {\n // Connect\n await connectToPlatform(platformName);\n }\n };\n\n const handleContinue = () => {\n const connected = Object.entries(connectedAccounts)\n .filter(([platform, isConnected]) => isConnected)\n .map(([platform]) => platform);\n \n onComplete({\n connectedAccounts: connected,\n totalConnections: connected.length,\n healthScore: healthScore,\n connectionHealth: connectionHealth,\n sdkVersion: '2.1.7',\n enhancedFeatures: {\n healthMonitoring: sdkConfig.enableHealthMonitoring,\n autoRefresh: sdkConfig.enableAutoRefresh,\n connectionValidation: sdkConfig.enableConnectionValidation\n }\n });\n };\n\n const connectedCount = Object.values(connectedAccounts).filter(Boolean).length;\n const personaNumber = Math.min(connectedCount + 1, 5); // 0 connections = persona 1, 1 connection = persona 2, etc.\n\n // Sort platforms to prioritize the specified platform\n const getSortedPlatforms = () => {\n if (!priorityPlatform) return platforms;\n \n const priorityPlat = platforms.find(p => \n p.name.toLowerCase() === priorityPlatform.toLowerCase() || \n p.connector.toLowerCase() === priorityPlatform.toLowerCase()\n );\n \n if (!priorityPlat) return platforms;\n \n const otherPlatforms = platforms.filter(p => p !== priorityPlat);\n return [priorityPlat, ...otherPlatforms];\n };\n\n const sortedPlatforms = getSortedPlatforms();\n const isPriorityPlatform = (platform) => {\n if (!priorityPlatform) return false;\n return platform.name.toLowerCase() === priorityPlatform.toLowerCase() || \n platform.connector.toLowerCase() === priorityPlatform.toLowerCase();\n };\n\n return (\n <div className=\"w-full h-full flex flex-col\" style={{ height: '90vh', minHeight: 0 }}>\n {/* Content - Flexible center area */}\n <div className=\"px-6 pt-16 flex-1 flex flex-col\" style={{ minHeight: 0, overflow: 'hidden' }}>\n <div className=\"mb-6 flex-shrink-0\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2 text-balance leading-tight\">Connect app data</h1>\n <p className=\"text-gray-600 text-base\">More connections, better personalization.</p>\n </div>\n\n <div className=\"mb-2 flex justify-center flex-shrink-0\">\n <div className=\"w-56 h-56 overflow-hidden\">\n <img\n src={personaImages[personaNumber]}\n alt={`Persona ${personaNumber}`}\n width=\"256\"\n height=\"256\"\n className=\"w-full h-full object-cover\"\n onLoad={() => console.log('✅ Persona image loaded successfully!')}\n onError={(e) => {\n console.log('❌ Persona image failed to load:', personaImages[personaNumber]);\n console.log('Connected count:', connectedCount);\n console.log('Persona number:', personaNumber);\n console.log('All persona URLs:', personaImages);\n console.log('Current location:', window.location.href);\n console.log('Trying to load from:', personaImages[personaNumber]);\n \n // Fallback to gradient if image fails to load\n e.target.style.display = 'none';\n e.target.parentElement.style.background = 'linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%)';\n }}\n />\n </div>\n </div>\n\n {/* Scrollable platform list */}\n <div className=\"flex-1 overflow-y-auto mt-4\" style={{ minHeight: 0 }}>\n <div className=\"space-y-4 pb-4\">\n {platforms.map((platform) => {\n const isConnected = connectedAccounts[platform.name] || false;\n const isCurrentlyConnecting = connectingPlatform === platform.name;\n const hasError = connectionErrors[platform.name];\n const isDisabled = isConnecting && !isCurrentlyConnecting;\n const isPriority = isPriorityPlatform(platform);\n \n return (\n <div \n key={platform.name}\n className=\"flex items-start gap-4 p-4 rounded-xl hover:bg-gray-50 transition-colors\"\n style={{\n backgroundColor: \"#ffffff\",\n border: \"none\",\n outline: \"none\",\n gap: 'clamp(6px, 1.5vw, 10px)',\n padding: 'clamp(6px, 1.5vw, 10px)',\n boxShadow: '0 1px 3px rgba(0, 0, 0, 0.1)',\n marginBottom: 'clamp(3px, 0.8vw, 6px)'\n }}\n onClick={() => !isDisabled && handleToggle(platform.name)}\n >\n <div className=\"bg-gray-50 rounded-full flex items-center justify-center flex-shrink-0 border-2 border-gray-200\" style={{ width: 'clamp(28px, 6vw, 36px)', height: 'clamp(28px, 6vw, 36px)' }}>\n {isCurrentlyConnecting ? (\n <div className=\"animate-spin h-5 w-5 border-2 border-gray-400 rounded-full border-t-transparent\"></div>\n ) : (\n platform.icon\n )}\n </div>\n <div className=\"flex-1 min-w-0 pr-4\">\n <h3\n className=\"font-semibold\"\n style={{\n color: \"#111827\",\n fontSize: 'clamp(12px, 2.8vw, 15px)',\n marginBottom: 'clamp(1px, 0.3vw, 3px)',\n lineHeight: '1.2'\n }}\n >\n {platform.name}\n </h3>\n <p\n className=\"leading-tight\"\n style={{\n color: \"#6B7280\",\n fontSize: 'clamp(10px, 2.2vw, 12px)',\n lineHeight: '1.3'\n }}\n >\n {platform.description}\n </p>\n \n {/* Error Message */}\n {hasError && (\n <p className=\"text-xs text-red-600 mt-1\">\n {hasError}\n </p>\n )}\n </div>\n <div className=\"flex-shrink-0\">\n <div\n onClick={(e) => {\n e.stopPropagation();\n if (!isDisabled) handleToggle(platform.name);\n }}\n className={`relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out cursor-pointer ${\n isConnected ? \"bg-blue-500\" : \"bg-gray-300\"\n } ${isDisabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}\n style={{ \n height: 'clamp(20px, 4vw, 26px)', \n width: 'clamp(40px, 8vw, 52px)',\n boxShadow: isConnected ? '0 2px 4px rgba(59, 130, 246, 0.3)' : '0 1px 2px rgba(0, 0, 0, 0.1)'\n }}\n >\n <span\n className={`inline-block rounded-full bg-white transition-all duration-300 ease-in-out shadow-lg ${\n isConnected ? \"translate-x-6\" : \"translate-x-0.5\"\n }`}\n style={{ \n height: 'clamp(16px, 3.5vw, 20px)', \n width: 'clamp(16px, 3.5vw, 20px)'\n }}\n />\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n\n {/* Buttons - Fixed at bottom */}\n <div className=\"flex-shrink-0\" style={{ padding: 'clamp(8px, 2vw, 16px) clamp(16px, 4vw, 24px)', minHeight: 'auto', display: 'flex', flexDirection: 'column', gap: 'clamp(6px, 1.5vw, 10px)' }}>\n <div\n className=\"w-full bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-semibold flex items-center justify-center gap-2 cursor-pointer transition-all duration-200 shadow-lg hover:shadow-xl\"\n style={{ \n padding: 'clamp(10px, 2.5vw, 14px)', \n fontSize: 'clamp(13px, 3.2vw, 16px)',\n minHeight: 'clamp(36px, 7vw, 44px)'\n }}\n onClick={handleContinue}\n >\n Update\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </div>\n {connectedCount > 0 && (\n <div\n onClick={() => onComplete({ connectedAccounts: [], totalConnections: 0 })}\n className=\"w-full text-gray-500 font-medium text-center cursor-pointer hover:text-gray-700 transition-colors\"\n style={{ \n padding: 'clamp(6px, 1.5vw, 10px)', \n fontSize: 'clamp(12px, 3vw, 15px)',\n minHeight: 'clamp(28px, 5vw, 36px)'\n }}\n >\n Skip\n </div>\n )}\n </div>\n </div>\n );\n}\n","import React from 'react';\n\n/**\n * Box Component\n * Displays a checkbox item for data access requests\n */\nconst Box = (props) => {\n const handleChange = (e) => {\n const checked = e.target.checked;\n console.log(`Checkbox ${props.title} is now: ${checked ? 'checked' : 'unchecked'}`);\n if (checked) {\n props.setSelected(true);\n props.changeGranted(1);\n } else {\n props.setSelected(false);\n props.changeGranted(-1);\n }\n \n props.onSelectionChange(checked);\n };\n\n return (\n <div className=\"relative inline-flex items-center\">\n <input\n type=\"checkbox\"\n id={`request-${props.number}`}\n disabled={!props.active}\n onChange={handleChange}\n className={`\n appearance-none w-5 h-5 border rounded\n ${!props.active ? 'border-gray-300 bg-gray-100 cursor-not-allowed' : 'border-blue-500 cursor-pointer'}\n checked:bg-blue-600 checked:border-blue-600\n focus:outline-none focus:ring-2 focus:ring-blue-500/30\n transition-colors\n `}\n />\n <svg \n className=\"absolute left-0.5 top-0.5 w-4 h-4 text-white pointer-events-none opacity-0 peer-checked:opacity-100\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"3\" d=\"M5 13l4 4L19 7\"></path>\n </svg>\n \n {!props.active && (\n <span className=\"ml-2 text-xs text-red-500 font-medium\">\n Not available\n </span>\n )}\n </div>\n );\n};\n\nexport default Box;\n","import React, { useState } from 'react';\nimport Box from './Box';\n\n/**\n * IndividualConnection Component\n * Displays a card for each data connection request\n */\nfunction IndividualConnection(props) {\n const [selected, setSelected] = useState(false);\n\n const handleSelectionChange = (isSelected) => {\n setSelected(isSelected);\n props.onSelectionChange(isSelected);\n };\n\n // Get icon based on data type\n const getDataTypeIcon = () => {\n switch(props.title) {\n case \"Profile\":\n return (\n <div className=\"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-blue-600\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z\" clipRule=\"evenodd\" />\n </svg>\n </div>\n );\n case \"User Memories\":\n return (\n <div className=\"w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-purple-600\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path d=\"M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z\" />\n </svg>\n </div>\n );\n default:\n return (\n <div className=\"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-gray-600\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z\" clipRule=\"evenodd\" />\n </svg>\n </div>\n );\n }\n };\n\n return (\n <div className=\"bg-white rounded-xl shadow-sm hover:shadow-md transition-all overflow-hidden\">\n <div className=\"p-5\">\n <div className=\"flex items-start space-x-4\">\n {getDataTypeIcon()}\n <div className=\"flex-1\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-medium text-gray-800\">{props.title}</h3>\n <Box\n active={props.active}\n onSelectionChange={handleSelectionChange}\n changeGranted={props.changeGranted}\n setSelected={setSelected}\n number={props.number + 1}\n type={\"Test\"}\n title={props.title}\n />\n </div>\n \n {props.descriptions && (\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-600\">{props.descriptions}</p>\n </div>\n )}\n </div>\n </div>\n \n {props.rewards && (\n <div className=\"mt-3 pt-3 border-t border-gray-100\">\n <div className=\"flex items-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-4 w-4 text-yellow-500 mr-2\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z\" clipRule=\"evenodd\" />\n </svg>\n <span className=\"text-xs text-gray-500\">Benefit: <span className=\"text-gray-700\">{props.rewards}</span></span>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport default IndividualConnection;\n","import React, { useState, useEffect, useRef } from 'react';\nimport UniversalOnboarding from '../components/UniversalOnboarding.jsx';\nimport IndividualConnection from './components/IndividualConnection';\nimport onairosLogo from './icons/onairos_logo.png';\n\n/**\n * DataRequestPage Component\n * Displays different data requests and handles user interactions\n */\nconst DataRequestPage = ({ requestData = {}, dataRequester = 'App', proofMode = false, domain = '', appIcon = '' }) => {\n const [loading, setLoading] = useState(true);\n const [activeModels, setActiveModels] = useState([]);\n const [granted, setGranted] = useState(0);\n const [allowSubmit, setAllowSubmit] = useState(false);\n const [userConnections, setUserConnections] = useState(['instagram', 'youtube', 'email']);\n const [selectedRequests, setSelectedRequests] = useState({});\n const selectedConnections = useRef([]);\n const userSub = useRef(null);\n const encryptedUserPin = useRef(null);\n\n // Update allowSubmit when granted changes\n useEffect(() => {\n if (granted > 0) {\n setAllowSubmit(true);\n } else {\n setAllowSubmit(false);\n }\n }, [granted]);\n\n // Simulate loading data\n useEffect(() => {\n // In a real implementation, this would fetch active models from a service\n const loadData = async () => {\n try {\n // Simulate API call\n await new Promise(resolve => setTimeout(resolve, 1000));\n \n // Sample active models - this would come from your backend\n setActiveModels(['Profile', 'User Memories']);\n setLoading(false);\n } catch (error) {\n console.error('Error loading data:', error);\n setLoading(false);\n }\n };\n \n loadData();\n\n // Message handler to receive data from parent window\n const handleMessage = (event) => {\n if (event.data && event.data.type === 'dataRequest') {\n // Process received data\n if (event.data.requestData) {\n // Update request data state\n }\n if (event.data.activeModels) {\n setActiveModels(event.data.activeModels);\n }\n if (event.data.userSub) {\n userSub.current = event.data.userSub;\n }\n if (event.data.encryptedUserPin) {\n encryptedUserPin.current = event.data.encryptedUserPin;\n }\n }\n };\n\n // Add message listener\n window.addEventListener('message', handleMessage);\n \n // Clean up listener\n return () => {\n window.removeEventListener('message', handleMessage);\n };\n }, []);\n\n /**\n * Reject all data requests\n */\n async function rejectDataRequest() {\n window.top.postMessage({type: 'closeIframe'}, '*');\n window.postMessage({type: 'closeIframe'}, '*');\n }\n\n /**\n * Send the selected data requests to the parent window\n */\n async function sendDataRequest() {\n if (granted === 0) {\n window.close();\n return;\n } else {\n const SignMessage = {\n message: 'Confirm ' + dataRequester + ' Data Access',\n confirmations: selectedConnections.current\n };\n \n // Send simplified response\n try {\n window.top.postMessage({\n type: 'dataRequestComplete',\n approved: selectedConnections.current,\n message: SignMessage\n }, '*');\n \n window.postMessage({\n type: 'dataRequestComplete',\n approved: selectedConnections.current,\n message: SignMessage\n }, '*');\n } catch (error) {\n console.error(\"Error sending data request:\", error);\n window.close();\n }\n }\n }\n\n /**\n * Update the granted count\n */\n function changeGranted(plusMinus) {\n setGranted(granted + plusMinus);\n }\n\n /**\n * Handle selection of a connection/data request\n */\n function handleConnectionSelection(dataRequester, modelType, index, title, reward, isSelected) {\n const newDate = new Date();\n const newConnection = {\n requester: dataRequester,\n date: newDate.toISOString(),\n name: title,\n reward: reward,\n data: modelType\n };\n\n if (isSelected) {\n console.log(`Adding connection: ${JSON.stringify(newConnection)}`);\n if (!selectedConnections.current.find(connection => connection.requester === dataRequester && connection.data === modelType)) {\n selectedConnections.current.push(newConnection);\n }\n } else {\n console.log(`Removing connection for: ${modelType}`);\n selectedConnections.current = selectedConnections.current.filter(\n connection => !(connection.requester === dataRequester && connection.data === modelType)\n );\n }\n\n console.log('Current selected connections:', selectedConnections.current);\n }\n\n return (\n <div className=\"min-h-screen bg-gray-100\">\n {loading ? (\n <div className=\"flex items-center justify-center min-h-screen\">\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\n </div>\n ) : activeModels.length === 0 ? (\n <UniversalOnboarding \n appIcon=\"https://onairos.sirv.com/Images/OnairosBlack.png\" \n appName={dataRequester}\n username={localStorage.getItem(\"username\")}\n />\n ) : (\n <div className=\"max-w-md mx-auto p-6 space-y-4\">\n <header className=\"bg-white p-6 rounded-xl shadow-md\">\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center space-x-2\">\n <img src={onairosLogo} alt=\"Onairos Logo\" className=\"w-8 h-8\" />\n <div className=\"text-gray-400 mx-2\">→</div>\n {appIcon ? (\n <img src={appIcon} alt={`${dataRequester} Logo`} className=\"w-8 h-8 rounded-full\" />\n ) : (\n <div className=\"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center\">\n <span className=\"text-gray-600 text-xs font-bold\">{dataRequester.charAt(0)}</span>\n </div>\n )}\n </div>\n <h2 className=\"text-lg font-bold text-gray-800\">{dataRequester}</h2>\n </div>\n \n <h1 className=\"text-xl font-bold text-gray-800 mb-4\">Data Access Request</h1>\n <p className=\"text-gray-600 mb-6\">Select the data you want to share with {dataRequester}</p>\n \n <div className=\"flex items-center justify-between gap-4\">\n <button\n onClick={rejectDataRequest}\n className=\"border w-full border border-gray-300 hover:bg-gray-50 text-gray-700 font-medium py-3 px-4 rounded-lg transition-colors\"\n >\n Decline\n </button>\n <button\n disabled={!allowSubmit}\n onClick={sendDataRequest}\n className=\"w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Approve {granted > 0 && `(${granted})`}\n </button>\n </div>\n </header>\n\n <div className=\"space-y-3\">\n {/* Only show Profile and User Memories */}\n {['Profile', 'User Memories'].map((dataType, index) => {\n const key = dataType.toLowerCase().replace(' ', '_');\n const product = {\n type: dataType,\n descriptions: dataType === 'Profile' ? \n 'Basic profile information and preferences' : \n 'Your personal context and memory data',\n reward: dataType === 'Profile' ? \n 'Personalized experience' : \n 'Contextual understanding of your preferences'\n };\n \n return (\n <IndividualConnection\n key={key}\n active={true}\n title={product.type}\n id={product}\n number={index}\n descriptions={product.descriptions}\n rewards={product.reward}\n size={key}\n changeGranted={changeGranted}\n onSelectionChange={(isSelected) =>\n handleConnectionSelection(dataRequester, key, index, product.type, product.reward, isSelected)\n }\n />\n );\n })}\n \n {/* User Connections Section */}\n <div className=\"bg-white p-4 rounded-xl shadow-sm mt-4\">\n <h3 className=\"text-sm font-semibold text-gray-700 mb-3\">Your Connected Services</h3>\n <div className=\"flex items-center space-x-3\">\n {userConnections.map((connection, index) => {\n const getConnectionIcon = (type) => {\n switch(type) {\n case 'instagram':\n return (\n <div className=\"w-10 h-10 rounded-full bg-linear-to-tr from-purple-500 via-pink-500 to-yellow-500 flex items-center justify-center\">\n <span className=\"text-white text-xs\">IG</span>\n </div>\n );\n case 'youtube':\n return (\n <div className=\"w-10 h-10 rounded-full bg-red-600 flex items-center justify-center\">\n <span className=\"text-white text-xs\">YT</span>\n </div>\n );\n case 'email':\n return (\n <div className=\"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center\">\n <span className=\"text-white text-xs\">@</span>\n </div>\n );\n default:\n return (\n <div className=\"w-10 h-10 rounded-full bg-gray-200 flex items-center justify-center\">\n <span className=\"text-gray-600 text-xs\">{type.charAt(0).toUpperCase()}</span>\n </div>\n );\n }\n };\n \n return (\n <div key={index} className=\"flex flex-col items-center\">\n {getConnectionIcon(connection)}\n <span className=\"text-xs text-gray-600 mt-1\">{connection}</span>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default DataRequestPage;\n","import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport DataRequestPage from './DataRequestPage.jsx';\n\n// Global variables to store data from parent window\nlet proofMode = false;\nlet domain = '';\nlet userSub = null;\nlet encryptedUserPin = null;\n\n// Handle messages from the parent window\nwindow.addEventListener('message', (event) => {\n // Verify the sender origin if needed\n // if (event.origin !== 'expected-origin') return;\n \n if (event.data && event.data.source === 'onairosButton') {\n proofMode = event.data.proofMode || false;\n domain = event.data.domain || '';\n userSub = event.data.userSub || null;\n encryptedUserPin = event.data.encryptedUserPin || null;\n \n // Re-render with the new data\n renderApp();\n }\n});\n\n// Notify the parent window that the iframe is ready\nwindow.parent.postMessage({\n source: 'onairosIframe',\n action: 'iframeReady'\n}, '*');\n\n// Function to render the React app\nfunction renderApp() {\n const root = ReactDOM.createRoot(document.getElementById('root'));\n root.render(\n <DataRequestPage \n proofMode={proofMode}\n domain={domain}\n userSub={userSub}\n encryptedUserPin={encryptedUserPin}\n />\n );\n}\n\n// Initial render\nrenderApp();\n"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE__156__","__WEBPACK_EXTERNAL_MODULE__318__","m","createRoot","hydrateRoot","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","tagName","toUpperCase","src","scripts","getElementsByTagName","length","i","test","Error","replace","p","defaultPersonaImages","platforms","name","icon","React","className","viewBox","fill","color","connector","description","id","cx","cy","r","offset","stopColor","sdkConfig","apiKey","process","env","REACT_APP_ONAIROS_API_KEY","baseUrl","REACT_APP_ONAIROS_BASE_URL","sdkType","enableHealthMonitoring","enableAutoRefresh","enableConnectionValidation","UniversalOnboarding","_ref","onComplete","onBack","appIcon","appName","personaImages","personaImagesProp","priorityPlatform","testMode","connectedAccounts","setConnectedAccounts","useState","isConnecting","setIsConnecting","connectingPlatform","setConnectingPlatform","connectionErrors","setConnectionErrors","connectionHealth","setConnectionHealth","healthScore","setHealthScore","useEffect","handleOAuthReturn","platform","localStorage","getItem","console","log","concat","removeItem","prev","_objectSpread","connectToPlatform","async","platformName","find","error","_localStorage$getItem","username","email","authorizeUrl","response","fetch","method","headers","body","JSON","stringify","session","ok","status","statusText","responseData","json","possibleKeys","oauthUrl","usedKey","keys","join","navigator","userAgent","innerWidth","setItem","href","popup","open","hasNavigatedToOnairos","checkInterval","setInterval","hostname","close","closed","clearInterval","successFlag","errorFlag","timestamp","isRecentSignal","Date","now","parseInt","setTimeout","message","handleToggle","connectedCount","values","filter","Boolean","personaNumber","Math","min","getSortedPlatforms","priorityPlat","toLowerCase","otherPlatforms","style","height","minHeight","overflow","alt","width","onLoad","onError","target","display","parentElement","background","map","isConnected","isCurrentlyConnecting","hasError","isDisabled","isPriorityPlatform","backgroundColor","border","outline","gap","padding","boxShadow","marginBottom","onClick","fontSize","lineHeight","stopPropagation","flexDirection","handleContinue","connected","entries","_ref2","_ref3","totalConnections","sdkVersion","enhancedFeatures","healthMonitoring","autoRefresh","connectionValidation","stroke","strokeLinecap","strokeLinejoin","strokeWidth","props","type","number","disabled","active","onChange","checked","title","setSelected","changeGranted","onSelectionChange","xmlns","selected","getDataTypeIcon","fillRule","clipRule","Box","isSelected","descriptions","rewards","requestData","dataRequester","proofMode","domain","loading","setLoading","activeModels","setActiveModels","granted","setGranted","allowSubmit","setAllowSubmit","userConnections","setUserConnections","selectedRequests","setSelectedRequests","selectedConnections","useRef","userSub","encryptedUserPin","plusMinus","Promise","resolve","loadData","handleMessage","event","data","current","addEventListener","removeEventListener","onairosLogo","charAt","top","postMessage","SignMessage","confirmations","approved","dataType","index","product","reward","IndividualConnection","size","modelType","newDate","newConnection","requester","date","toISOString","connection","push","handleConnectionSelection","getConnectionIcon","renderApp","ReactDOM","getElementById","render","DataRequestPage","source","parent","action"],"sourceRoot":""}
|