@elliemae/ssf-host 2.35.3 → 2.35.5

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.
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Popup Focus E2E Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.1a8728b1d4fe91140d17.js"></script></head><body class="bg-gray-50"><header class="bg-purple-600 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">Popup Focus E2E Test</h1><a href="./index.html" class="text-purple-200 hover:text-white text-sm">&larr; Back to main</a></header><main class="mx-auto max-w-5xl px-4 py-4"><div class="grid grid-cols-2 gap-4 mb-4"><div class="bg-purple-50 border border-purple-200 rounded-md p-3"><h2 class="text-sm font-bold text-purple-900 mb-2">Behavior Under Test</h2><ul class="text-xs text-purple-800 space-y-1 list-disc list-inside"><li><strong>Trusted domains</strong> (.ice.com, .elliemae.com, .ellielabs.com, localhost): <code>window.opener</code> is kept intact. Re-opening uses <code>window.open('', name)</code> to bring the popup to front.</li><li><strong>Untrusted domains</strong> (everything else): <code>window.opener = null</code> is set for security. Re-opening falls back to <code>guest.window.focus()</code>.</li><li>The host tracks popup windows and detects closure via a periodic monitor.</li></ul></div><div class="bg-green-50 border border-green-200 rounded-md p-3"><h2 class="text-sm font-bold text-green-900 mb-2">Test Steps</h2><ol class="text-xs text-green-800 space-y-1.5 list-decimal list-inside"><li>Wait for <code>"Popup Focus Host ready"</code> in the Event Log.</li><li><strong>Trusted popup test:</strong> Click "Open Title Service" → popup opens. Click "Re-open Title Service" → the <em>existing</em> popup should come to the foreground (no new window).</li><li><strong>Second trusted popup:</strong> Click "Open Credit Service" → second popup opens. Click "Re-open Credit" → same foreground behavior.</li><li><strong>Untrusted popup test:</strong> Click "Open Third-Party" → popup opens to <code>example.com</code>. Click "Re-open Third-Party" → focus may or may not work (opener was nulled). Observe the behavior.</li><li>Verify the Guest Status panel shows the open/closed state of each popup.</li><li>Manually close a popup window, then check Guest Status updates to "closed".</li></ol></div></div><div class="bg-amber-50 border border-amber-200 rounded-md p-3 mb-4"><h2 class="text-sm font-bold text-amber-900 mb-2">Expected Behavior</h2><div class="grid grid-cols-3 gap-3 text-xs"><div><h3 class="font-semibold text-amber-800 mb-1">Title / Credit Service (Trusted)</h3><ul class="text-amber-900 list-disc list-inside space-y-0.5"><li>"Open" → new popup window appears</li><li>"Re-open" → existing popup comes to front, <strong>no new window</strong></li><li>Guest Status shows <span class="text-green-600 font-semibold">open</span></li><li>Embedded Pricing Service renders normally</li></ul></div><div><h3 class="font-semibold text-amber-800 mb-1">Third-Party (Untrusted)</h3><ul class="text-amber-900 list-disc list-inside space-y-0.5"><li>"Open" → popup opens to <code>example.com</code></li><li>"Re-open" → <code>focus()</code> is called on stored reference (browser may or may not honor it)</li><li><code>opener</code> is <code>null</code> inside the popup</li></ul></div><div><h3 class="font-semibold text-amber-800 mb-1">Popup Closure</h3><ul class="text-amber-900 list-disc list-inside space-y-0.5"><li>Close a popup manually (X button)</li><li>Guest Status updates to <span class="text-red-500 font-semibold">closed</span> within 2 seconds</li><li>Re-opening a closed popup should open a new window</li></ul></div></div></div><div class="grid grid-cols-2 gap-4 mb-4"><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-3">Popup Actions</h2><div class="flex flex-col gap-2"><p class="text-xs text-gray-400 font-medium">Trusted (localhost — opener preserved)</p><button data-testid="btn-open-title-popup" id="btnOpenTitle" class="rounded bg-purple-600 px-4 py-2 text-sm text-white hover:bg-purple-700">Open Title Service (Popup)</button> <button data-testid="btn-reopen-title-popup" id="btnReopenTitle" class="rounded bg-purple-500 px-4 py-2 text-sm text-white hover:bg-purple-600">Re-open Title Service (should focus existing)</button> <button data-testid="btn-open-credit-popup" id="btnOpenCredit" class="rounded bg-indigo-600 px-4 py-2 text-sm text-white hover:bg-indigo-700">Open Credit Service (Popup)</button> <button data-testid="btn-reopen-credit-popup" id="btnReopenCredit" class="rounded bg-indigo-500 px-4 py-2 text-sm text-white hover:bg-indigo-600">Re-open Credit Service (should focus existing)</button><hr class="my-2 border-gray-300"/><p class="text-xs text-gray-400 font-medium">Untrusted (opener nulled)</p><button data-testid="btn-open-thirdparty-popup" id="btnOpenThirdParty" class="rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700">Open Third-Party (Popup) — untrusted</button> <button data-testid="btn-reopen-thirdparty-popup" id="btnReopenThirdParty" class="rounded bg-red-500 px-4 py-2 text-sm text-white hover:bg-red-600">Re-open Third-Party (focus test — opener nulled)</button></div></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-3">Guest Status</h2><div data-testid="popup-guest-list" id="guestList" class="text-xs space-y-1 min-h-[100px]"><p class="text-gray-400">No popup guests loaded yet</p></div></div></div><div class="bg-white rounded-lg shadow p-4 mb-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Event Log</h2><div data-testid="popup-event-log" id="eventLog" class="text-xs bg-gray-100 rounded p-2 min-h-[100px] max-h-[250px] overflow-y-auto"></div></div><div class="mb-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Embedded Guest (for comparison)</h2><div data-testid="embedded-container" id="embedded-container" class="border-2 border-dashed border-purple-300 rounded-lg min-h-[150px]"></div></div><div class="bg-gray-100 border border-gray-300 rounded-md p-3"><h2 class="text-sm font-bold text-gray-800 mb-2">Verification Checklist</h2><div class="grid grid-cols-2 gap-2 text-xs"><label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-01:</strong> Host initializes, embedded Pricing Service guest loads without error</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-02:</strong> "Open Title Service" opens a new popup window</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-03:</strong> "Re-open Title Service" brings the existing popup to front — <strong>no new window or about:blank tab</strong></span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-04:</strong> "Open Credit Service" opens a second popup (both coexist)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-05:</strong> "Re-open Credit Service" brings credit popup to front</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-06:</strong> Guest Status shows each popup as <span class="text-green-600 font-semibold">open</span></span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-07:</strong> Manually close a popup → Guest Status updates to <span class="text-red-500 font-semibold">closed</span> within ~2s</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-08:</strong> Re-opening a closed popup opens a new window (not just focus)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-09:</strong> "Open Third-Party" opens <code>example.com</code> popup</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-10:</strong> "Re-open Third-Party" attempts <code>focus()</code> (may open about:blank — expected for untrusted, opener was nulled)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-11:</strong> No console errors during trusted popup operations</span></label></div></div></main><script src="./popup-focus-host.js" type="module"></script></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Popup Focus E2E Test</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body class="bg-gray-50"><header class="bg-purple-600 text-white px-4 py-3 flex items-center justify-between"><h1 class="text-lg font-semibold">Popup Focus E2E Test</h1><a href="./index.html" class="text-purple-200 hover:text-white text-sm">&larr; Back to main</a></header><main class="mx-auto max-w-5xl px-4 py-4"><div class="grid grid-cols-2 gap-4 mb-4"><div class="bg-purple-50 border border-purple-200 rounded-md p-3"><h2 class="text-sm font-bold text-purple-900 mb-2">Behavior Under Test</h2><ul class="text-xs text-purple-800 space-y-1 list-disc list-inside"><li><strong>Trusted domains</strong> (.ice.com, .elliemae.com, .ellielabs.com, localhost): <code>window.opener</code> is kept intact. Re-opening uses <code>window.open('', name)</code> to bring the popup to front.</li><li><strong>Untrusted domains</strong> (everything else): <code>window.opener = null</code> is set for security. Re-opening falls back to <code>guest.window.focus()</code>.</li><li>The host tracks popup windows and detects closure via a periodic monitor.</li></ul></div><div class="bg-green-50 border border-green-200 rounded-md p-3"><h2 class="text-sm font-bold text-green-900 mb-2">Test Steps</h2><ol class="text-xs text-green-800 space-y-1.5 list-decimal list-inside"><li>Wait for <code>"Popup Focus Host ready"</code> in the Event Log.</li><li><strong>Trusted popup test:</strong> Click "Open Title Service" → popup opens. Click "Re-open Title Service" → the <em>existing</em> popup should come to the foreground (no new window).</li><li><strong>Second trusted popup:</strong> Click "Open Credit Service" → second popup opens. Click "Re-open Credit" → same foreground behavior.</li><li><strong>Untrusted popup test:</strong> Click "Open Third-Party" → popup opens to <code>example.com</code>. Click "Re-open Third-Party" → focus may or may not work (opener was nulled). Observe the behavior.</li><li>Verify the Guest Status panel shows the open/closed state of each popup.</li><li>Manually close a popup window, then check Guest Status updates to "closed".</li></ol></div></div><div class="bg-amber-50 border border-amber-200 rounded-md p-3 mb-4"><h2 class="text-sm font-bold text-amber-900 mb-2">Expected Behavior</h2><div class="grid grid-cols-3 gap-3 text-xs"><div><h3 class="font-semibold text-amber-800 mb-1">Title / Credit Service (Trusted)</h3><ul class="text-amber-900 list-disc list-inside space-y-0.5"><li>"Open" → new popup window appears</li><li>"Re-open" → existing popup comes to front, <strong>no new window</strong></li><li>Guest Status shows <span class="text-green-600 font-semibold">open</span></li><li>Embedded Pricing Service renders normally</li></ul></div><div><h3 class="font-semibold text-amber-800 mb-1">Third-Party (Untrusted)</h3><ul class="text-amber-900 list-disc list-inside space-y-0.5"><li>"Open" → popup opens to <code>example.com</code></li><li>"Re-open" → <code>focus()</code> is called on stored reference (browser may or may not honor it)</li><li><code>opener</code> is <code>null</code> inside the popup</li></ul></div><div><h3 class="font-semibold text-amber-800 mb-1">Popup Closure</h3><ul class="text-amber-900 list-disc list-inside space-y-0.5"><li>Close a popup manually (X button)</li><li>Guest Status updates to <span class="text-red-500 font-semibold">closed</span> within 2 seconds</li><li>Re-opening a closed popup should open a new window</li></ul></div></div></div><div class="grid grid-cols-2 gap-4 mb-4"><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-3">Popup Actions</h2><div class="flex flex-col gap-2"><p class="text-xs text-gray-400 font-medium">Trusted (localhost — opener preserved)</p><button data-testid="btn-open-title-popup" id="btnOpenTitle" class="rounded bg-purple-600 px-4 py-2 text-sm text-white hover:bg-purple-700">Open Title Service (Popup)</button> <button data-testid="btn-reopen-title-popup" id="btnReopenTitle" class="rounded bg-purple-500 px-4 py-2 text-sm text-white hover:bg-purple-600">Re-open Title Service (should focus existing)</button> <button data-testid="btn-open-credit-popup" id="btnOpenCredit" class="rounded bg-indigo-600 px-4 py-2 text-sm text-white hover:bg-indigo-700">Open Credit Service (Popup)</button> <button data-testid="btn-reopen-credit-popup" id="btnReopenCredit" class="rounded bg-indigo-500 px-4 py-2 text-sm text-white hover:bg-indigo-600">Re-open Credit Service (should focus existing)</button><hr class="my-2 border-gray-300"/><p class="text-xs text-gray-400 font-medium">Untrusted (opener nulled)</p><button data-testid="btn-open-thirdparty-popup" id="btnOpenThirdParty" class="rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700">Open Third-Party (Popup) — untrusted</button> <button data-testid="btn-reopen-thirdparty-popup" id="btnReopenThirdParty" class="rounded bg-red-500 px-4 py-2 text-sm text-white hover:bg-red-600">Re-open Third-Party (focus test — opener nulled)</button></div></div><div class="bg-white rounded-lg shadow p-4"><h2 class="text-sm font-semibold text-gray-700 mb-3">Guest Status</h2><div data-testid="popup-guest-list" id="guestList" class="text-xs space-y-1 min-h-[100px]"><p class="text-gray-400">No popup guests loaded yet</p></div></div></div><div class="bg-white rounded-lg shadow p-4 mb-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Event Log</h2><div data-testid="popup-event-log" id="eventLog" class="text-xs bg-gray-100 rounded p-2 min-h-[100px] max-h-[250px] overflow-y-auto"></div></div><div class="mb-4"><h2 class="text-sm font-semibold text-gray-700 mb-2">Embedded Guest (for comparison)</h2><div data-testid="embedded-container" id="embedded-container" class="border-2 border-dashed border-purple-300 rounded-lg min-h-[150px]"></div></div><div class="bg-gray-100 border border-gray-300 rounded-md p-3"><h2 class="text-sm font-bold text-gray-800 mb-2">Verification Checklist</h2><div class="grid grid-cols-2 gap-2 text-xs"><label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-01:</strong> Host initializes, embedded Pricing Service guest loads without error</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-02:</strong> "Open Title Service" opens a new popup window</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-03:</strong> "Re-open Title Service" brings the existing popup to front — <strong>no new window or about:blank tab</strong></span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-04:</strong> "Open Credit Service" opens a second popup (both coexist)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-05:</strong> "Re-open Credit Service" brings credit popup to front</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-06:</strong> Guest Status shows each popup as <span class="text-green-600 font-semibold">open</span></span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-07:</strong> Manually close a popup → Guest Status updates to <span class="text-red-500 font-semibold">closed</span> within ~2s</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-08:</strong> Re-opening a closed popup opens a new window (not just focus)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-09:</strong> "Open Third-Party" opens <code>example.com</code> popup</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-10:</strong> "Re-open Third-Party" attempts <code>focus()</code> (may open about:blank — expected for untrusted, opener was nulled)</span></label> <label class="flex items-start gap-2"><input type="checkbox" class="mt-0.5"/> <span><strong>TC-POP-11:</strong> No console errors during trusted popup operations</span></label></div></div></main><script src="./popup-focus-host.js" type="module"></script></body></html>
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Guest V1 -> V2 Host</title><style>body,html,main{height:100%;margin:2px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="https://cdn.elliemae.io/elliemae/core/ssf/1.0/elli.ssf.guest.js"></script><script defer="defer" src="js/emuiSsfHost.1a8728b1d4fe91140d17.js"></script></head><body><h2>Guest V1 nesting Host V2</h2><div id="result"><p id="loan-details"></p><p id="loan-pre-save-event-details"></p></div><div id="guest-container"></div><script type="module">import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loadV2Guest=async()=>{const t=await getGuestBaseUrl(),{id:e}=hostV2.loadGuest({id:"guestV2",url:new URL("./v2-guest.html",t).href,title:"Guest V2",targetElement:document.getElementById("guest-container")})};window.addEventListener("load",async()=>{await elli.script.connect();const t=await elli.script.getObject("Application"),e=await elli.script.getObject("Loan"),a=await e.getLoanDetails();document.getElementById("loan-details").innerText=`Loan Data: ${JSON.stringify(a)}`,elli.script.subscribe("loan","onPreSave",(t,e)=>(document.getElementById("loan-pre-save-event-details").innerText=`Presave event data: ${JSON.stringify(e)}`,!1)),hostV2.addScriptingObject(hostV2.cloneScriptingObject(t,{})),hostV2.addScriptingObject(hostV2.cloneScriptingObject(e,{})),await loadV2Guest()})</script></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Guest V1 -> V2 Host</title><style>body,html,main{height:100%;margin:2px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="https://cdn.elliemae.io/elliemae/core/ssf/1.0/elli.ssf.guest.js"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body><h2>Guest V1 nesting Host V2</h2><div id="result"><p id="loan-details"></p><p id="loan-pre-save-event-details"></p></div><div id="guest-container"></div><script type="module">import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loadV2Guest=async()=>{const t=await getGuestBaseUrl(),{id:e}=hostV2.loadGuest({id:"guestV2",url:new URL("./v2-guest.html",t).href,title:"Guest V2",targetElement:document.getElementById("guest-container")})};window.addEventListener("load",async()=>{await elli.script.connect();const t=await elli.script.getObject("Application"),e=await elli.script.getObject("Loan"),a=await e.getLoanDetails();document.getElementById("loan-details").innerText=`Loan Data: ${JSON.stringify(a)}`,elli.script.subscribe("loan","onPreSave",(t,e)=>(document.getElementById("loan-pre-save-event-details").innerText=`Presave event data: ${JSON.stringify(e)}`,!1)),hostV2.addScriptingObject(hostV2.cloneScriptingObject(t,{})),hostV2.addScriptingObject(hostV2.cloneScriptingObject(e,{})),await loadV2Guest()})</script></body></html>
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host V2 -> V1 Guest</title><style>body,html,main{height:100%;margin:4px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.1a8728b1d4fe91140d17.js"></script></head><body><main><h1>Host V2 nesting V1 Guest</h1><button id="save-btn" type="button" onclick="saveLoan()">Save Loan</button><div id="results"><p id="pre-save-feedback-result"></p></div><div id="guest-container"></div></main><script type="module">import{Loan}from"./loan-object.js";import{Application}from"./application-object-v2.js";import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loanObj=new Loan,appObj=new Application;hostV2.addScriptingObject(loanObj),hostV2.addScriptingObject(appObj);const params=new URLSearchParams(document.location.search),{id:id}=hostV2.loadGuest({id:"guestV1",url:new URL("true"!==params.get("nestV1GuestV2Host")?"./v1-guest.html":"./v1-guest-v2-host.html",window.location.href).href,searchParams:{nestHostV1:!0},title:"Guest V1",targetElement:document.getElementById("guest-container")});window.saveLoan=async()=>{const e=loanObj.getLoanDetails();(await hostV2.dispatchEvent({event:loanObj.onPreSave,eventParams:e,eventOptions:{timeout:1e3}})).some(e=>!1===e)?document.getElementById("pre-save-feedback-result").innerText="Pre save failed":document.getElementById("pre-save-feedback-result").innerText="Pre save succeeded"}</script></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host V2 -> V1 Guest</title><style>body,html,main{height:100%;margin:4px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.cd7880c12c9813b29111.js"></script></head><body><main><h1>Host V2 nesting V1 Guest</h1><button id="save-btn" type="button" onclick="saveLoan()">Save Loan</button><div id="results"><p id="pre-save-feedback-result"></p></div><div id="guest-container"></div></main><script type="module">import{Loan}from"./loan-object.js";import{Application}from"./application-object-v2.js";import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loanObj=new Loan,appObj=new Application;hostV2.addScriptingObject(loanObj),hostV2.addScriptingObject(appObj);const params=new URLSearchParams(document.location.search),{id:id}=hostV2.loadGuest({id:"guestV1",url:new URL("true"!==params.get("nestV1GuestV2Host")?"./v1-guest.html":"./v1-guest-v2-host.html",window.location.href).href,searchParams:{nestHostV1:!0},title:"Guest V1",targetElement:document.getElementById("guest-container")});window.saveLoan=async()=>{const e=loanObj.getLoanDetails();(await hostV2.dispatchEvent({event:loanObj.onPreSave,eventParams:e,eventOptions:{timeout:1e3}})).some(e=>!1===e)?document.getElementById("pre-save-feedback-result").innerText="Pre save failed":document.getElementById("pre-save-feedback-result").innerText="Pre save succeeded"}</script></body></html>
@@ -92,6 +92,28 @@ export type HostOption = {
92
92
  * @default 0.05
93
93
  */
94
94
  performanceSamplingRatio?: number;
95
+ /**
96
+ * Unload embed guests whose iframe is no longer connected to the document
97
+ * (or whose document has no window), even when the host never calls
98
+ * {@link ISSFHost.unloadGuest}. Covers an ancestor container being removed
99
+ * (for example a route unmount) and an iframe moved to another container
100
+ * before it is removed.
101
+ *
102
+ * The host checks embed guests on the same once-per-second lifecycle poll
103
+ * used for popup guests. A guest must be seen detached on two consecutive
104
+ * checks, so it is unloaded within about two seconds. This leaves the host
105
+ * at least one full interval to call `unloadGuest` itself (for example from
106
+ * a deferred effect cleanup), which stays silent. When the poll unloads the
107
+ * guest, its {@link ISSFHost.onGuestClose} callbacks fire once, as when the
108
+ * iframe is removed from its direct parent. An iframe removed and
109
+ * re-inserted before the next check is not unloaded. Guests already being
110
+ * unloaded through `unloadGuest` are skipped.
111
+ *
112
+ * Set to `false` to keep the previous behavior: only removal of the iframe
113
+ * from its direct parent unloads the guest.
114
+ * @default true
115
+ */
116
+ detectDetachedEmbedGuests?: boolean;
95
117
  };
96
118
  /**
97
119
  * parameters for rendering a guest