import { $APP, shadow$provide } from "./shared.js";
var Fd=/(?:#(?:g=)?|^)([A-Za-z0-9_-]{22,64})(?=$|[&?.\s])/,Gd=/(^|\.)ardegazu\.ro$/;export const joinPasteChip=function(a){a=a===void 0?{}:a;if(document.querySelector(".soc-joinchip")==null){var b=$APP.ha(a.t);a=document.createElement("style");var c=document.createElement("div");a.textContent='\n.soc-joinchip {\n position: fixed; right: calc(env(safe-area-inset-right, 0px) + 12px);\n bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); z-index: 9998;\n display: flex; gap: 8px; align-items: center;\n font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n color: var(--soc-dim, #a49fb5); background: var(--soc-bg, rgba(20, 18, 28, .82));\n border: 1px solid var(--soc-line, #2b2838);\n border-radius: 999px; padding: 7px 12px; cursor: pointer; user-select: none;\n backdrop-filter: blur(6px);\n}\n.soc-joinchip input {\n font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--soc-fg, #eae6f2);\n background: transparent; border: 0; outline: none; width: 13em; min-width: 0;\n}\n.soc-joinchip .go { color: var(--soc-accent, #93c1a5); font-weight: 700; cursor: pointer; }\nbody.soc-play .soc-joinchip { display: none; }\n';
document.head.appendChild(a);c.className="soc-joinchip";var d=function(){c.innerHTML="\x3cspan\x3e\x3c/span\x3e";return c.querySelector("span").textContent=b("social.paste.chip",void 0)};d();c.title=b("social.paste.chip.title",void 0);var e=function(){function f(){var k=g.value.trim();if(k){try{var h=(new URL(k)).host}catch(q){h=null}var l=k.match(Fd);if(l==null)return g.value="",g.placeholder=b("social.paste.error",void 0);var m=!!h;h=m?(m=h!==location.host)?Gd.test(h):m:m;if($APP.n(h))return location.href=
k;location.hash=l[1];return location.reload()}return null}c.innerHTML='\x3cinput type\x3d"text" autocomplete\x3d"off" spellcheck\x3d"false"\x3e\x3cspan class\x3d"go"\x3e\x3c/span\x3e';var g=c.querySelector("input");g.placeholder=b("social.paste.placeholder",void 0);c.querySelector(".go").textContent=b("social.paste.join",void 0);c.querySelector(".go").addEventListener("click",function(){return f()});g.addEventListener("keydown",function(k){k.key==="Enter"&&f();return k.key==="Escape"?d():null});g.addEventListener("paste",
function(){return setTimeout(f,50)});return setTimeout(function(){return g.focus()},0)};c.addEventListener("click",function(f){return f.target.tagName!=="INPUT"&&c.querySelector("input")==null?e():null});document.body.appendChild(c)}else return null};
export const homeChip=function(a){a=a===void 0?{}:a;if(document.querySelector(".soc-home")==null){a=$APP.ha(a.t);var b=document.createElement("style"),c=document.createElement("a");b.textContent="\n.soc-home {\n position: fixed; display: none; align-items: center; justify-content: center;\n top: calc(env(safe-area-inset-top, 0px) + 8px);\n left: calc(env(safe-area-inset-left, 0px) + 12px);\n z-index: 10001; width: 34px; height: 34px; border-radius: 999px;\n text-decoration: none; font-size: 16px;\n color: var(--soc-dim, #a49fb5); background: var(--soc-bg, rgba(20, 18, 28, .82));\n border: 1px solid var(--soc-line, #2b2838); backdrop-filter: blur(6px);\n}\n/* Installed on a device WITHOUT a sensor housing (SE, iPad), status bar style\n black-translucent: the bar overlays the page while safe-area-inset-top\n reports 0 — the inset covers hardware cutouts, not the translucent bar —\n so the chip sat under the clock. A standalone-only floor clears the 20pt\n bar; devices where the inset is real (notch/island) exceed it anyway, and\n in-browser pages keep the tight 8px. */\n@media (display-mode: standalone) {\n .soc-home { top: max(calc(env(safe-area-inset-top, 0px) + 8px), 32px); }\n}\nbody.soc-menu .soc-home { display: flex; }\n";document.head.appendChild(b);
c.className="soc-home";c.href="https://ardegazu.ro/";c.textContent="⌂";c.title=a("social.home.title",void 0);c.setAttribute("aria-label",a("social.home.title",void 0));document.body.appendChild(c)}else return null};