extension-develop 3.10.1 → 3.10.2

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
5
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},nb=({contentRef:e,descriptionId:t})=>{let n=nv("DialogDescriptionWarning"),r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`;return k.useEffect(()=>{let n=e.current?.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null};let nw=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},nk=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var nx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let nS=(0,k.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:a,iconNode:o,...i},u)=>(0,k.createElement)("svg",{ref:u,...nx,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:nk("lucide",l),...!a&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(i)&&{"aria-hidden":"true"},...i},[...o.map(([e,t])=>(0,k.createElement)(e,t)),...Array.isArray(a)?a:[a]])),nE=(v=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],(n=(0,k.forwardRef)(({className:e,...t},n)=>(0,k.createElement)(nS,{ref:n,iconNode:v,className:nk(`lucide-${nw("x").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,"lucide-x",e),...t}))).displayName=nw("x"),n);function nC({...e}){return(0,w.jsx)(t2,{"data-slot":"dialog",...e})}function nN({...e}){return(0,w.jsx)(t4,{"data-slot":"dialog-trigger",...e})}function nz({...e}){return(0,w.jsx)(t9,{"data-slot":"dialog-portal",...e})}function nP({...e}){return(0,w.jsx)(np,{"data-slot":"dialog-close",...e})}function n_({className:e,...t}){return(0,w.jsx)(ne,{"data-slot":"dialog-overlay",className:eO("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function nT({className:e,children:t,showCloseButton:n=!0,...r}){return(0,w.jsxs)(nz,{"data-slot":"dialog-portal",children:[(0,w.jsx)(n_,{}),(0,w.jsxs)(nl,{"data-slot":"dialog-content",className:eO("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&(0,w.jsxs)(np,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5",children:[(0,w.jsx)(nE,{}),(0,w.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function nL({className:e,...t}){return(0,w.jsx)("div",{"data-slot":"dialog-header",className:eO("flex flex-col gap-2 text-center sm:text-left",e),...t})}function nO({className:e,...t}){return(0,w.jsx)("div",{"data-slot":"dialog-footer",className:eO("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function nR({className:e,...t}){return(0,w.jsx)(ns,{"data-slot":"dialog-title",className:eO("text-xl leading-none font-semibold",e),...t})}function nj({className:e,...t}){return(0,w.jsx)(nd,{"data-slot":"dialog-description",className:eO("text-muted-foreground text-base",e),...t})}var nD=Symbol.for("react.lazy"),nA=x[" use ".trim().toString()];function nM(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===nD&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var nF=((s=k.forwardRef((e,t)=>{let{children:n,...r}=e;if(nM(n)&&"function"==typeof nA&&(n=nA(n._payload)),k.isValidElement(n)){var l;let e,a,o=(l=n,(a=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(a=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),i=function(e,t){let n={...t};for(let r in t){let l=e[r],a=t[r];/^on[A-Z]/.test(r)?l&&a?n[r]=(...e)=>{let t=a(...e);return l(...e),t}:l&&(n[r]=l):"style"===r?n[r]={...l,...a}:"className"===r&&(n[r]=[l,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==k.Fragment&&(i.ref=t?eM(t,o):o),k.cloneElement(n,i)}return k.Children.count(n)>1?k.Children.only(null):null})).displayName="Slot.SlotClone",r=s,(l=k.forwardRef((e,t)=>{let{children:n,...l}=e;nM(n)&&"function"==typeof nA&&(n=nA(n._payload));let a=k.Children.toArray(n),o=a.find(n$);if(o){let e=o.props.children,n=a.map(t=>t!==o?t:k.Children.count(e)>1?k.Children.only(null):k.isValidElement(e)?e.props.children:null);return(0,w.jsx)(r,{...l,ref:t,children:k.isValidElement(e)?k.cloneElement(e,void 0,n):null})}return(0,w.jsx)(r,{...l,ref:t,children:n})})).displayName="Slot.Slot",l),nI=Symbol("radix.slottable");function n$(e){return k.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===nI}let nU=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,nW=(a="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",o={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-3",sm:"h-8 rounded-md px-3",lg:"h-10 rounded-md px-4",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==o?void 0:o.variants)==null)return C(a,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:n,defaultVariants:r}=o,l=Object.keys(n).map(t=>{let l=null==e?void 0:e[t],a=null==r?void 0:r[t];if(null===l)return null;let o=nU(l)||nU(a);return n[t][o]}),i=e&&Object.entries(e).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return C(a,l,null==o||null==(t=o.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:n,className:l,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...r,...i}[t]):({...r,...i})[t]===n})?[...e,n,l]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)}),nH=k.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...l},a)=>(0,w.jsx)(r?nF:"button",{className:eO(nW({variant:t,size:n,className:e})),ref:a,...l}));nH.displayName="Button";let nV=i.p+"assets/local-network-permission.4fae40a7.png",nB=i.p+"assets/developer-mode-off.f9a94937.jpeg",nQ=i.p+"assets/developer-mode-on.ede80e5b.jpeg";function nq(){let[e,t]=k.useState(!1);return k.useEffect(()=>{let e=window.setInterval(()=>{t(e=>!e)},2400);return()=>window.clearInterval(e)},[]),(0,w.jsxs)(nC,{children:[(0,w.jsx)(nN,{asChild:!0,children:(0,w.jsx)(nH,{variant:"secondary",size:"sm",className:"rounded-2xl text-xs",children:"Confirm setup"})}),(0,w.jsxs)(nT,{className:"max-w-[600px] max-h-[80vh] overflow-y-auto sm:max-w-[600px]",children:[(0,w.jsxs)(nL,{children:[(0,w.jsx)(nR,{children:"Confirm setup"}),(0,w.jsx)(nj,{children:"Quick checks to keep Extension.js running smoothly."})]}),(0,w.jsxs)("div",{className:"space-y-6",children:[(0,w.jsxs)("section",{className:"space-y-3",children:[(0,w.jsxs)("div",{className:"flex items-start gap-3",children:[(0,w.jsx)("span",{className:"bg-muted text-muted-foreground mt-0.5 inline-flex size-12 shrink-0 items-center justify-center rounded-full text-sm font-semibold",children:"1"}),(0,w.jsxs)("div",{className:"space-y-1",children:[(0,w.jsx)("h3",{className:"text-foreground text-base font-semibold",children:"Turn on Developer mode"}),(0,w.jsxs)("p",{className:"text-muted-foreground text-sm",children:["Go to"," ",(0,w.jsx)("a",{className:"text-primary underline underline-offset-4",href:"chrome://extensions",children:"chrome://extensions"})," ","(your first tab) and make sure is on so service workers reload during development. It is in the top right of the page."," ",(0,w.jsx)("span",{className:"text-foreground font-semibold",children:"Developer mode"}),"."]})]})]}),(0,w.jsxs)("div",{className:"w-full space-y-2",children:[(0,w.jsxs)("div",{className:"relative w-full max-w-[520px] overflow-hidden rounded-lg border border-white/10",children:[(0,w.jsx)("img",{alt:"Developer mode turned off",src:nB,className:`h-auto w-full transition duration-600 ease-[cubic-bezier(0.22,1,0.36,1)] ${e?"opacity-0":"opacity-100"}`}),(0,w.jsx)("img",{alt:"Developer mode turned on",src:nQ,className:`pointer-events-none absolute inset-0 h-auto w-full transition duration-600 ease-[cubic-bezier(0.22,1,0.36,1)] ${e?"opacity-100":"opacity-0"}`})]}),(0,w.jsx)("p",{className:"text-muted-foreground text-xs",children:"Developer mode off/on (animated)."})]})]}),(0,w.jsxs)("section",{className:"space-y-3",children:[(0,w.jsxs)("div",{className:"flex items-start gap-3",children:[(0,w.jsx)("span",{className:"bg-muted text-muted-foreground mt-0.5 inline-flex size-12 shrink-0 items-center justify-center rounded-full text-sm font-semibold",children:"2"}),(0,w.jsxs)("div",{className:"space-y-1",children:[(0,w.jsx)("h3",{className:"text-foreground text-base font-semibold",children:"Allow local network access for content scripts"}),(0,w.jsxs)("p",{className:"text-muted-foreground text-sm",children:["If you are using"," ",(0,w.jsx)("span",{className:"font-mono",children:"content_scripts"}),", the first time you visit a targeted page you will see a local network access prompt. This is expected—click Allow to continue. Without it, content script reloads may not work reliably."]})]})]}),(0,w.jsx)("img",{alt:"Local network access permission prompt",className:"rounded-lg border object-contain",src:nV}),(0,w.jsx)("p",{className:"text-muted-foreground text-xs",children:"Allow local network access (prompt example)."})]})]}),(0,w.jsx)(nO,{children:(0,w.jsx)(nP,{asChild:!0,children:(0,w.jsx)(nH,{className:"w-full",children:"Got it"})})})]})]})}!function(e,t=document.documentElement){"dark"===((void 0)??function(){let e=function(){try{let e=localStorage.getItem("theme");if("light"===e||"dark"===e)return e}catch{}return null}();if(e)return e;if("u">typeof window&&"matchMedia"in window)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return"light"}())?t.classList.add("dark"):t.classList.remove("dark")}();let nK=String("edge").toLowerCase(),nG="chromium"===nK||"chrome"===nK||"edge"===nK||"chromium-based"===nK,nY="firefox"===nK;function nX({className:e,...t}){return(0,w.jsx)("div",{className:eO("flex w-full items-center justify-center",e),...t,children:(0,w.jsxs)("div",{className:"relative inline-flex items-center gap-3 rounded-2xl border px-4 py-2 shadow-sm backdrop-blur",children:[(0,w.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,w.jsxs)("a",{href:"https://extension.js.org/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2","aria-label":"Visit extension.js.org",children:[(0,w.jsx)("img",{className:"size-4 select-none",alt:"Extension.js logo",src:E}),(0,w.jsx)("span",{className:"sr-only",children:"extension.js"})]}),(0,w.jsx)("a",{href:"https://extension.js.org/",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground text-sm underline underline-offset-4 hover:opacity-90",children:"Learn more about developing cross-browser extensions."})]}),nG?(0,w.jsx)("div",{className:"ml-auto",children:(0,w.jsx)(nq,{})}):null]})})}async function nZ(e,t){let n=await ej();if(n){e(n),t(n.description);return}let r=(await new Promise(e=>{try{chrome.management.getAll(e)}catch{e([])}})||[]).filter(e=>e&&"development"===e.installType&&e.id!==chrome.runtime.id&&e.enabled&&"theme"!==e.type),l=r.length?r[r.length-1]:void 0;if(l){e(l),t(l.description);return}let a=chrome.runtime.getManifest();e({id:chrome.runtime.id,name:a?.name||"Extension",shortName:a?.short_name,description:a?.description||"",version:a?.version||"",enabled:!0,installType:"development"}),t(a?.description||"")}let nJ=document.getElementById("root");nJ&&S.createRoot(nJ).render((0,w.jsx)(()=>{let[e,t]=(0,k.useState)(null),[n,r]=(0,k.useState)(""),[l,a]=(0,k.useState)(void 0);(0,k.useEffect)(()=>{nZ(t,r)},[]);let o=e?.icons&&e.icons.length?[...e.icons].sort((e,t)=>(t.size||0)-(e.size||0))[0]?.url:void 0,i=nY&&!!o&&!o?.startsWith("data:");return(0,k.useEffect)(()=>{let t=!0;if(!o)return a(void 0),()=>{t=!1};if(!i)return a(o),()=>{t=!1};a(void 0);let n=e?.icons&&e.icons.length?Math.max(...e.icons.map(e=>e.size||0)):128;return new Promise(t=>{try{let r=chrome.management.getIcon;if(!e?.id||!r)return void t(void 0);r(e.id,n,e=>{t("string"==typeof e&&e?e:void 0)})}catch{t(void 0)}}).then(e=>{if(t){if(e)return void a(e);try{chrome.runtime.sendMessage({type:"resolve-icon-url",url:o},e=>{t&&(e?.ok&&"string"==typeof e.dataUrl?a(e.dataUrl):a(void 0))})}catch{a(void 0)}}}),()=>{t=!1}},[o,i,e?.id]),(0,w.jsxs)("div",{className:"relative flex h-screen flex-col items-center justify-center bg-[#1C1C1E]",children:[(0,w.jsx)("style",{children:`
5
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},nb=({contentRef:e,descriptionId:t})=>{let n=nv("DialogDescriptionWarning"),r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`;return k.useEffect(()=>{let n=e.current?.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null};let nw=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),nk=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var nx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let nS=(0,k.createContext)({}),nE=(0,k.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:l="",children:a,iconNode:o,...i},u)=>{let{size:s=24,strokeWidth:c=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:p=""}=(0,k.useContext)(nS)??{},m=r??d?24*Number(n??c)/Number(t??s):n??c;return(0,k.createElement)("svg",{ref:u,...nx,width:t??s??nx.width,height:t??s??nx.height,stroke:e??f,strokeWidth:m,className:nw("lucide",p,l),...!a&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(i)&&{"aria-hidden":"true"},...i},[...o.map(([e,t])=>(0,k.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),nC=(v=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],(n=(0,k.forwardRef)(({className:e,...t},n)=>(0,k.createElement)(nE,{ref:n,iconNode:v,className:nw(`lucide-${nk("x").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,"lucide-x",e),...t}))).displayName=nk("x"),n);function nN({...e}){return(0,w.jsx)(t2,{"data-slot":"dialog",...e})}function nz({...e}){return(0,w.jsx)(t4,{"data-slot":"dialog-trigger",...e})}function nP({...e}){return(0,w.jsx)(t9,{"data-slot":"dialog-portal",...e})}function n_({...e}){return(0,w.jsx)(np,{"data-slot":"dialog-close",...e})}function nT({className:e,...t}){return(0,w.jsx)(ne,{"data-slot":"dialog-overlay",className:eO("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function nL({className:e,children:t,showCloseButton:n=!0,...r}){return(0,w.jsxs)(nP,{"data-slot":"dialog-portal",children:[(0,w.jsx)(nT,{}),(0,w.jsxs)(nl,{"data-slot":"dialog-content",className:eO("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&(0,w.jsxs)(np,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5",children:[(0,w.jsx)(nC,{}),(0,w.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function nO({className:e,...t}){return(0,w.jsx)("div",{"data-slot":"dialog-header",className:eO("flex flex-col gap-2 text-center sm:text-left",e),...t})}function nR({className:e,...t}){return(0,w.jsx)("div",{"data-slot":"dialog-footer",className:eO("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function nj({className:e,...t}){return(0,w.jsx)(ns,{"data-slot":"dialog-title",className:eO("text-xl leading-none font-semibold",e),...t})}function nD({className:e,...t}){return(0,w.jsx)(nd,{"data-slot":"dialog-description",className:eO("text-muted-foreground text-base",e),...t})}var nA=Symbol.for("react.lazy"),nM=x[" use ".trim().toString()];function nF(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===nA&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var nI=((s=k.forwardRef((e,t)=>{let{children:n,...r}=e;if(nF(n)&&"function"==typeof nM&&(n=nM(n._payload)),k.isValidElement(n)){var l;let e,a,o=(l=n,(a=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(a=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),i=function(e,t){let n={...t};for(let r in t){let l=e[r],a=t[r];/^on[A-Z]/.test(r)?l&&a?n[r]=(...e)=>{let t=a(...e);return l(...e),t}:l&&(n[r]=l):"style"===r?n[r]={...l,...a}:"className"===r&&(n[r]=[l,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==k.Fragment&&(i.ref=t?eM(t,o):o),k.cloneElement(n,i)}return k.Children.count(n)>1?k.Children.only(null):null})).displayName="Slot.SlotClone",r=s,(l=k.forwardRef((e,t)=>{let{children:n,...l}=e;nF(n)&&"function"==typeof nM&&(n=nM(n._payload));let a=k.Children.toArray(n),o=a.find(nU);if(o){let e=o.props.children,n=a.map(t=>t!==o?t:k.Children.count(e)>1?k.Children.only(null):k.isValidElement(e)?e.props.children:null);return(0,w.jsx)(r,{...l,ref:t,children:k.isValidElement(e)?k.cloneElement(e,void 0,n):null})}return(0,w.jsx)(r,{...l,ref:t,children:n})})).displayName="Slot.Slot",l),n$=Symbol("radix.slottable");function nU(e){return k.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===n$}let nW=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,nH=(a="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",o={variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-3",sm:"h-8 rounded-md px-3",lg:"h-10 rounded-md px-4",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==o?void 0:o.variants)==null)return C(a,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:n,defaultVariants:r}=o,l=Object.keys(n).map(t=>{let l=null==e?void 0:e[t],a=null==r?void 0:r[t];if(null===l)return null;let o=nW(l)||nW(a);return n[t][o]}),i=e&&Object.entries(e).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return C(a,l,null==o||null==(t=o.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:n,className:l,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...r,...i}[t]):({...r,...i})[t]===n})?[...e,n,l]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)}),nV=k.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...l},a)=>(0,w.jsx)(r?nI:"button",{className:eO(nH({variant:t,size:n,className:e})),ref:a,...l}));nV.displayName="Button";let nB=i.p+"assets/local-network-permission.4fae40a7.png",nQ=i.p+"assets/developer-mode-off.f9a94937.jpeg",nq=i.p+"assets/developer-mode-on.ede80e5b.jpeg";function nK(){let[e,t]=k.useState(!1);return k.useEffect(()=>{let e=window.setInterval(()=>{t(e=>!e)},2400);return()=>window.clearInterval(e)},[]),(0,w.jsxs)(nN,{children:[(0,w.jsx)(nz,{asChild:!0,children:(0,w.jsx)(nV,{variant:"secondary",size:"sm",className:"rounded-2xl text-xs",children:"Confirm setup"})}),(0,w.jsxs)(nL,{className:"max-w-[600px] max-h-[80vh] overflow-y-auto sm:max-w-[600px]",children:[(0,w.jsxs)(nO,{children:[(0,w.jsx)(nj,{children:"Confirm setup"}),(0,w.jsx)(nD,{children:"Quick checks to keep Extension.js running smoothly."})]}),(0,w.jsxs)("div",{className:"space-y-6",children:[(0,w.jsxs)("section",{className:"space-y-3",children:[(0,w.jsxs)("div",{className:"flex items-start gap-3",children:[(0,w.jsx)("span",{className:"bg-muted text-muted-foreground mt-0.5 inline-flex size-12 shrink-0 items-center justify-center rounded-full text-sm font-semibold",children:"1"}),(0,w.jsxs)("div",{className:"space-y-1",children:[(0,w.jsx)("h3",{className:"text-foreground text-base font-semibold",children:"Turn on Developer mode"}),(0,w.jsxs)("p",{className:"text-muted-foreground text-sm",children:["Go to"," ",(0,w.jsx)("a",{className:"text-primary underline underline-offset-4",href:"chrome://extensions",children:"chrome://extensions"})," ","(your first tab) and make sure is on so service workers reload during development. It is in the top right of the page."," ",(0,w.jsx)("span",{className:"text-foreground font-semibold",children:"Developer mode"}),"."]})]})]}),(0,w.jsxs)("div",{className:"w-full space-y-2",children:[(0,w.jsxs)("div",{className:"relative w-full max-w-[520px] overflow-hidden rounded-lg border border-white/10",children:[(0,w.jsx)("img",{alt:"Developer mode turned off",src:nQ,className:`h-auto w-full transition duration-600 ease-[cubic-bezier(0.22,1,0.36,1)] ${e?"opacity-0":"opacity-100"}`}),(0,w.jsx)("img",{alt:"Developer mode turned on",src:nq,className:`pointer-events-none absolute inset-0 h-auto w-full transition duration-600 ease-[cubic-bezier(0.22,1,0.36,1)] ${e?"opacity-100":"opacity-0"}`})]}),(0,w.jsx)("p",{className:"text-muted-foreground text-xs",children:"Developer mode off/on (animated)."})]})]}),(0,w.jsxs)("section",{className:"space-y-3",children:[(0,w.jsxs)("div",{className:"flex items-start gap-3",children:[(0,w.jsx)("span",{className:"bg-muted text-muted-foreground mt-0.5 inline-flex size-12 shrink-0 items-center justify-center rounded-full text-sm font-semibold",children:"2"}),(0,w.jsxs)("div",{className:"space-y-1",children:[(0,w.jsx)("h3",{className:"text-foreground text-base font-semibold",children:"Allow local network access for content scripts"}),(0,w.jsxs)("p",{className:"text-muted-foreground text-sm",children:["If you are using"," ",(0,w.jsx)("span",{className:"font-mono",children:"content_scripts"}),", the first time you visit a targeted page you will see a local network access prompt. This is expected—click Allow to continue. Without it, content script reloads may not work reliably."]})]})]}),(0,w.jsx)("img",{alt:"Local network access permission prompt",className:"rounded-lg border object-contain",src:nB}),(0,w.jsx)("p",{className:"text-muted-foreground text-xs",children:"Allow local network access (prompt example)."})]})]}),(0,w.jsx)(nR,{children:(0,w.jsx)(n_,{asChild:!0,children:(0,w.jsx)(nV,{className:"w-full",children:"Got it"})})})]})]})}!function(e,t=document.documentElement){"dark"===((void 0)??function(){let e=function(){try{let e=localStorage.getItem("theme");if("light"===e||"dark"===e)return e}catch{}return null}();if(e)return e;if("u">typeof window&&"matchMedia"in window)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return"light"}())?t.classList.add("dark"):t.classList.remove("dark")}();let nG=String("edge").toLowerCase(),nY="chromium"===nG||"chrome"===nG||"edge"===nG||"chromium-based"===nG,nX="firefox"===nG;function nZ({className:e,...t}){return(0,w.jsx)("div",{className:eO("flex w-full items-center justify-center",e),...t,children:(0,w.jsxs)("div",{className:"relative inline-flex items-center gap-3 rounded-2xl border px-4 py-2 shadow-sm backdrop-blur",children:[(0,w.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,w.jsxs)("a",{href:"https://extension.js.org/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2","aria-label":"Visit extension.js.org",children:[(0,w.jsx)("img",{className:"size-4 select-none",alt:"Extension.js logo",src:E}),(0,w.jsx)("span",{className:"sr-only",children:"extension.js"})]}),(0,w.jsx)("a",{href:"https://extension.js.org/",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground text-sm underline underline-offset-4 hover:opacity-90",children:"Learn more about developing cross-browser extensions."})]}),nY?(0,w.jsx)("div",{className:"ml-auto",children:(0,w.jsx)(nK,{})}):null]})})}async function nJ(e,t){let n=await ej();if(n){e(n),t(n.description);return}let r=(await new Promise(e=>{try{chrome.management.getAll(e)}catch{e([])}})||[]).filter(e=>e&&"development"===e.installType&&e.id!==chrome.runtime.id&&e.enabled&&"theme"!==e.type),l=r.length?r[r.length-1]:void 0;if(l){e(l),t(l.description);return}let a=chrome.runtime.getManifest();e({id:chrome.runtime.id,name:a?.name||"Extension",shortName:a?.short_name,description:a?.description||"",version:a?.version||"",enabled:!0,installType:"development"}),t(a?.description||"")}let n0=document.getElementById("root");n0&&S.createRoot(n0).render((0,w.jsx)(()=>{let[e,t]=(0,k.useState)(null),[n,r]=(0,k.useState)(""),[l,a]=(0,k.useState)(void 0);(0,k.useEffect)(()=>{nJ(t,r)},[]);let o=e?.icons&&e.icons.length?[...e.icons].sort((e,t)=>(t.size||0)-(e.size||0))[0]?.url:void 0,i=nX&&!!o&&!o?.startsWith("data:");return(0,k.useEffect)(()=>{let t=!0;if(!o)return a(void 0),()=>{t=!1};if(!i)return a(o),()=>{t=!1};a(void 0);let n=e?.icons&&e.icons.length?Math.max(...e.icons.map(e=>e.size||0)):128;return new Promise(t=>{try{let r=chrome.management.getIcon;if(!e?.id||!r)return void t(void 0);r(e.id,n,e=>{t("string"==typeof e&&e?e:void 0)})}catch{t(void 0)}}).then(e=>{if(t){if(e)return void a(e);try{chrome.runtime.sendMessage({type:"resolve-icon-url",url:o},e=>{t&&(e?.ok&&"string"==typeof e.dataUrl?a(e.dataUrl):a(void 0))})}catch{a(void 0)}}}),()=>{t=!1}},[o,i,e?.id]),(0,w.jsxs)("div",{className:"relative flex h-screen flex-col items-center justify-center bg-[#1C1C1E]",children:[(0,w.jsx)("style",{children:`
6
6
  @keyframes neonPulse {
7
7
  0%, 100% {
8
8
  text-shadow:
@@ -22,4 +22,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
22
22
  }
23
23
  `}),(0,w.jsx)("header",{className:"mb-4 flex w-full items-center justify-center",children:(0,w.jsx)("div",{className:"flex w-full max-w-16 items-center justify-center",children:i&&(l||E)||!i&&(l||o)?(0,w.jsx)("img",{className:"h-auto w-full select-none",alt:`${e?.name||"User extension"} icon`,src:i?l||E:l||o,onError:e=>{e.currentTarget.style.display="none"}}):(0,w.jsx)("div",{className:"text-muted-foreground flex aspect-square w-full items-center justify-center rounded-2xl border text-lg font-medium","aria-label":"Extension icon placeholder",children:"?"})})}),(0,w.jsxs)("h1",{className:"text-foreground mx-auto text-center text-3xl font-semibold leading-tight tracking-tight sm:text-4xl",children:[(0,w.jsx)("span",{children:e?.name||"My Extension"}),(0,w.jsx)("br",{}),(0,w.jsx)("span",{id:"extensionName",title:e?`• Name: ${e.name}
24
24
  • ID: ${e.id}
25
- • Version: ${e.version}`:"",className:"neon-text",style:{color:"var(--brand-success, #19f5a7)"},children:"loaded successfully"})]}),(0,w.jsx)("p",{className:"text-muted-foreground mx-auto mt-3 max-w-xl text-center text-base leading-relaxed sm:text-lg",children:n||e?.description||"Extension.js makes cross‑browser extension development simple."}),(0,w.jsx)(nX,{className:"mt-6"})]})},{}))})()})();
25
+ • Version: ${e.version}`:"",className:"neon-text",style:{color:"var(--brand-success, #19f5a7)"},children:"loaded successfully"})]}),(0,w.jsx)("p",{className:"text-muted-foreground mx-auto mt-3 max-w-xl text-center text-base leading-relaxed sm:text-lg",children:n||e?.description||"Extension.js makes cross‑browser extension development simple."}),(0,w.jsx)(nZ,{className:"mt-6"})]})},{}))})()})();