var e,t;"function"==typeof(e=globalThis.define)&&(t=e,e=null),function(t,o,n,r,i){var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof s[r]&&s[r],a=l.cache||{},p="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function d(e,o){if(!a[e]){if(!t[e]){var n="function"==typeof s[r]&&s[r];if(!o&&n)return n(e,!0);if(l)return l(e,!0);if(p&&"string"==typeof e)return p(e);var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}u.resolve=function(o){var n=t[e][1][o];return null!=n?n:o},u.cache={};var f=a[e]=new d.Module(e);t[e][0].call(f.exports,u,f,f.exports,this)}return a[e].exports;function u(e){var t=u.resolve(e);return!1===t?{}:d(t)}}d.isParcelRequire=!0,d.Module=function(e){this.id=e,this.bundle=d,this.exports={}},d.modules=t,d.cache=a,d.parent=l,d.register=function(e,o){t[e]=[function(e,t){t.exports=o},{}]},Object.defineProperty(d,"root",{get:function(){return s[r]}}),s[r]=d;for(var f=0;f<o.length;f++)d(o[f]);if(n){var u=d(n);"object"==typeof exports&&"undefined"!=typeof module?module.exports=u:"function"==typeof e&&e.amd?e(function(){return u}):i&&(this[i]=u)}}({dFyQR:[function(e,t,o){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(o),n.export(o,"config",()=>r);let r={matches:["<all_urls>"]},i='input[type="email"],input[type="text"][name*="email"],input[type="text"][name*="user"],input[type="text"][name*="login"],input[autocomplete="username"],input[autocomplete="email"]';function s(e,t){e.focus();let o=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set;o?.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),e.blur()}let l=null;async function a(e,t){let o=document.createElement("div");o.style.cssText=`
    position: fixed;
    top: 16px; right: 16px;
    z-index: 2147483647;
    background: #ffffff;
    border: 1.5px solid #e4e2ff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(97,82,232,0.18);
    font-family: -apple-system, system-ui, sans-serif;
    padding: 16px 18px;
    width: 260px;
    animation: oryn-in 0.2s ease;
  `,o.innerHTML=`
    <style>@keyframes oryn-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }</style>
    <div style="display:flex;align-items:center;gap:10px;margin-bottom:10px;">
      <img src="${chrome.runtime.getURL("assets/logo.png")}" style="width:30px;height:30px;border-radius:8px;object-fit:cover;flex-shrink:0;" />
      <span style="font-size:13px;font-weight:800;color:#1a1535;">Confirm on Ledger</span>
    </div>
    <div style="font-size:12px;color:#8b84b0;line-height:1.6;margin-bottom:12px;">
      Check your Ledger screen and <strong style="color:#6152e8;">approve</strong> the signature request to save your password.
    </div>
    <div id="__oryn_save_status" style="display:flex;align-items:center;gap:8px;">
      <div style="width:14px;height:14px;border:2px solid #e4e2ff;border-top-color:#6152e8;border-radius:50%;animation:oryn-spin 0.7s linear infinite;flex-shrink:0;"></div>
      <span style="font-size:11px;color:#8b84b0;font-weight:600;">Waiting for approval\u2026</span>
    </div>
    <style>@keyframes oryn-spin { to { transform: rotate(360deg) } }</style>
  `,document.body.appendChild(o);try{let n=await chrome.runtime.sendMessage({type:"SAVE_PASSWORD_REQUEST",domain:window.location.hostname,username:e,password:t}),r=o.querySelector("#__oryn_save_status");r&&(n?.ok?r.innerHTML=`<span style="font-size:11px;color:#22c55e;font-weight:700;">\u2713 Saved successfully</span>`:r.innerHTML=`<span style="font-size:11px;color:#ef4444;font-weight:700;">\u2717 ${n?.error??"Save failed"}</span>`),setTimeout(()=>o.remove(),2e3)}catch{o.remove()}}async function p(e){let t=document.createElement("div");t.id="__oryn_ledger_prompt",t.style.cssText=`
    position: fixed;
    top: 16px; right: 16px;
    z-index: 2147483647;
    background: #ffffff;
    border: 1.5px solid #e4e2ff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(97,82,232,0.18);
    font-family: -apple-system, system-ui, sans-serif;
    padding: 16px 18px;
    width: 260px;
    animation: oryn-in 0.2s ease;
  `,t.innerHTML=`
    <style>@keyframes oryn-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }</style>
    <div style="display:flex;align-items:center;gap:10px;margin-bottom:10px;">
      <img src="${chrome.runtime.getURL("assets/logo.png")}" style="width:30px;height:30px;border-radius:8px;object-fit:cover;flex-shrink:0;" />
      <span style="font-size:13px;font-weight:800;color:#1a1535;">Confirm on Ledger</span>
    </div>
    <div style="font-size:12px;color:#8b84b0;line-height:1.6;margin-bottom:12px;">
      Check your Ledger screen and <strong style="color:#6152e8;">approve</strong> the signature request to decrypt your password.
    </div>
    <div id="__oryn_ledger_spinner" style="display:flex;align-items:center;gap:8px;">
      <div style="width:14px;height:14px;border:2px solid #e4e2ff;border-top-color:#6152e8;border-radius:50%;animation:oryn-spin 0.7s linear infinite;flex-shrink:0;"></div>
      <span style="font-size:11px;color:#8b84b0;font-weight:600;">Waiting for approval\u2026</span>
    </div>
    <style>@keyframes oryn-spin { to { transform: rotate(360deg) } }</style>
  `,document.body.appendChild(t);try{let o=await chrome.runtime.sendMessage({type:"AUTOFILL_REQUEST",domain:window.location.hostname});t.remove(),o?.password&&function(e,t,o){let n="password"===e.type,r=n?e:function(e){let t=e.closest("form");if(t){let e=t.querySelector("input[type=password]");if(e)return e}let o=e.parentElement;for(let e=0;e<5&&o;e++,o=o.parentElement){let e=o.querySelector("input[type=password]");if(e)return e}return null}(e),l=n?function(e){let t=e.closest("form");if(t){let o=t.querySelector(i);if(o)return o;let n=Array.from(t.querySelectorAll("input")),r=n.indexOf(e);for(let e=r-1;e>=0;e--)if("text"===n[e].type||"email"===n[e].type)return n[e]}let o=e.parentElement;for(let t=0;t<5&&o;t++,o=o.parentElement){let t=o.querySelector(i);if(t&&t!==e)return t}return null}(e):e;r&&s(r,o),l&&s(l,t)}(e,o.username??"",o.password)}catch{t.remove()}}function d(){l?.remove(),l=null}let f=null;async function u(e){let t=await chrome.runtime.sendMessage({type:"AUTOFILL_CHECK",domain:window.location.hostname});t?.domain&&function(e,t){f&&clearTimeout(f),d();let o=e.getBoundingClientRect(),n=document.createElement("div");n.id="__oryn_dropdown",n.style.cssText=`
    position: fixed;
    top: ${o.bottom+4}px;
    left: ${o.left}px;
    width: ${o.width}px;
    z-index: 2147483647;
    background: #ffffff;
    border: 1.5px solid #e4e2ff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(97,82,232,0.15);
    font-family: -apple-system, system-ui, sans-serif;
    overflow: hidden;
    animation: oryn-in 0.15s ease;
  `,n.innerHTML=`
    <style>@keyframes oryn-in { from { opacity:0; transform:translateY(-4px) } to { opacity:1; transform:translateY(0) } }</style>
    <div id="__oryn_item" style="display:flex;align-items:center;gap:10px;padding:10px 14px;cursor:pointer;">
      <img src="${chrome.runtime.getURL("assets/logo.png")}" style="width:28px;height:28px;border-radius:8px;object-fit:cover;flex-shrink:0;" />
      <div style="flex:1;min-width:0;">
        <div style="font-size:10px;color:#8b84b0;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;">Oryn</div>
        <div style="font-size:13px;font-weight:600;color:#1a1535;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">${t}</div>
      </div>
      <div style="font-size:11px;color:#6152e8;font-weight:700;flex-shrink:0;">Fill \u21b5</div>
    </div>
  `,document.body.appendChild(n),l=n,n.querySelector("#__oryn_item")?.addEventListener("mousedown",async t=>{t.preventDefault(),d(),p(e)})}(e,t.domain)}function c(){f&&clearTimeout(f),f=setTimeout(d,150)}function y(e){e.dataset.oryn||(e.dataset.oryn="true",e.addEventListener("focus",()=>u(e)),e.addEventListener("blur",c))}function m(){document.querySelectorAll("input[type=password]").forEach(y),document.querySelectorAll(i).forEach(y)}let x=/sign.?up|register|create|join|s'inscrire|inscription|nouveau|new.?account/i,g=null;function h(){document.querySelectorAll("form").forEach(e=>{e.dataset.orynForm||(e.dataset.orynForm="true",e.addEventListener("submit",()=>{if(!function(e){if(e.querySelectorAll("input[type=password]").length>=2||e.querySelector('input[autocomplete="new-password"]'))return!0;let t=e.querySelector("[type=submit], button[type=button]");return!!(t&&x.test(t.textContent??""))||x.test(document.title+(document.querySelector("h1")?.textContent??""))}(e))return;let t=e.querySelector("input[type=password]"),o=e.querySelector(i),n=t?.value,r=o?.value??"";n&&function(e,t){g?.remove();let o=document.createElement("div");o.style.cssText=`
    position: fixed;
    top: 16px; right: 16px;
    z-index: 2147483647;
    background: #ffffff;
    border: 1.5px solid #e4e2ff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(97,82,232,0.18);
    font-family: -apple-system, system-ui, sans-serif;
    padding: 14px 16px;
    width: 280px;
    animation: oryn-in 0.2s ease;
  `,o.innerHTML=`
    <style>@keyframes oryn-in { from { opacity:0; transform:translateY(-8px) } to { opacity:1; transform:translateY(0) } }</style>
    <div style="display:flex;align-items:center;gap:10px;margin-bottom:12px;">
      <img src="${chrome.runtime.getURL("assets/logo.png")}" style="width:32px;height:32px;border-radius:10px;object-fit:cover;flex-shrink:0;" />
      <div>
        <div style="font-size:12px;font-weight:800;color:#1a1535;">Save to Oryn?</div>
        <div style="font-size:11px;color:#8b84b0;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;">${e||window.location.hostname}</div>
      </div>
      <button id="__oryn_close" style="margin-left:auto;background:none;border:none;cursor:pointer;font-size:16px;color:#8b84b0;padding:0;line-height:1;">\xd7</button>
    </div>
    <div style="display:flex;gap:8px;">
      <button id="__oryn_ignore" style="flex:1;padding:8px 0;border-radius:10px;border:1.5px solid #e4e2ff;background:#f5f4ff;color:#8b84b0;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;">Ignore</button>
      <button id="__oryn_save" style="flex:2;padding:8px 0;border-radius:10px;border:none;background:#6152e8;color:#fff;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;">Save password</button>
    </div>
  `,document.body.appendChild(o),g=o;let n=()=>{o.remove(),g=null};o.querySelector("#__oryn_close")?.addEventListener("click",n),o.querySelector("#__oryn_ignore")?.addEventListener("click",n),o.querySelector("#__oryn_save")?.addEventListener("click",async()=>{n(),a(e,t)}),setTimeout(n,12e3)}(r,n)}))})}new MutationObserver(()=>{m(),h()}).observe(document.body,{childList:!0,subtree:!0}),m(),h()},{"@parcel/transformer-js/src/esmodule-helpers.js":"fRZO2"}],fRZO2:[function(e,t,o){o.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},o.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.exportAll=function(e,t){return Object.keys(e).forEach(function(o){"default"===o||"__esModule"===o||t.hasOwnProperty(o)||Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[o]}})}),t},o.export=function(e,t,o){Object.defineProperty(e,t,{enumerable:!0,get:o})}},{}]},["dFyQR"],"dFyQR","parcelRequirebf34"),globalThis.define=t;