extension-develop 2.0.0-alpha.4 → 2.0.0-alpha.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.
- package/dist/module.js +2 -2
- package/dist/resolver-module.js +1 -1
- package/package.json +2 -2
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var xp=Object.create;var Ge=Object.defineProperty;var vp=Object.getOwnPropertyDescriptor;var _p=Object.getOwnPropertyNames;var Sp=Object.getPrototypeOf,Pp=Object.prototype.hasOwnProperty;var kp=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ep=(t,e)=>{for(var s in e)Ge(t,s,{get:e[s],enumerable:!0})},Tr=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _p(e))!Pp.call(t,i)&&i!==s&&Ge(t,i,{get:()=>e[i],enumerable:!(r=vp(e,i))||r.enumerable});return t};var a=(t,e,s)=>(s=t!=null?xp(Sp(t)):{},Tr(e||!t||!t.__esModule?Ge(s,"default",{value:t,enumerable:!0}):s,t)),jp=t=>Tr(Ge({},"__esModule",{value:!0}),t);var Os=kp((vl,$p)=>{$p.exports={license:"MIT",repository:{type:"git",url:"https://github.com/cezaraugusto/extension.git",directory:"programs/develop"},engines:{node:">=18"},name:"extension-develop",version:"2.0.0-alpha.
|
|
1
|
+
"use strict";var xp=Object.create;var Ge=Object.defineProperty;var vp=Object.getOwnPropertyDescriptor;var _p=Object.getOwnPropertyNames;var Sp=Object.getPrototypeOf,Pp=Object.prototype.hasOwnProperty;var kp=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ep=(t,e)=>{for(var s in e)Ge(t,s,{get:e[s],enumerable:!0})},Tr=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _p(e))!Pp.call(t,i)&&i!==s&&Ge(t,i,{get:()=>e[i],enumerable:!(r=vp(e,i))||r.enumerable});return t};var a=(t,e,s)=>(s=t!=null?xp(Sp(t)):{},Tr(e||!t||!t.__esModule?Ge(s,"default",{value:t,enumerable:!0}):s,t)),jp=t=>Tr(Ge({},"__esModule",{value:!0}),t);var Os=kp((vl,$p)=>{$p.exports={license:"MIT",repository:{type:"git",url:"https://github.com/cezaraugusto/extension.git",directory:"programs/develop"},engines:{node:">=18"},name:"extension-develop",version:"2.0.0-alpha.5",description:"The develop step of Extension.js",main:"./dist/module.js",types:"./dist/module.d.ts",files:["dist"],author:{name:"Cezar Augusto",email:"boss@cezaraugusto.net",url:"https://cezaraugusto.com"},scripts:{clean:"rm -rf dist",watch:"tsup-node ./module.ts --format cjs --dts --target=node18 --watch",compile:"tsup-node ./module.ts --format cjs --dts --target=node18 --minify && bash install_scripts.sh",test:"jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.ts'","test:coverage":"jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.ts' --coverage","test:build":"jest ./build.spec.ts --no-cache"},dependencies:{"@colors/colors":"^1.6.0","@swc/core":"^1.7.3","@types/firefox-webext-browser":"^120.0.4",acorn:"^8.12.1","acorn-walk":"^8.3.3","adm-zip":"^0.5.12",ajv:"^8.17.1",astring:"^1.8.6",axios:"^1.6.8","browser-extension-manifest-fields":"^1.0.6","case-sensitive-paths-webpack-plugin":"^2.4.0",chokidar:"^3.6.0","chrome-location":"^1.2.1","content-security-policy-parser":"^0.6.0","css-loader":"^6.10.0","csv-loader":"^3.0.5","detect-package-manager":"^3.0.2","dotenv-webpack":"^8.0.1","edge-location":"^1.0.0","firefox-profile":"^4.6.0","fx-runner":"^1.4.0","go-git-it":"^2.0.3",ignore:"^5.3.1","loader-utils":"^3.3.1",micromatch:"^4.0.7","mini-css-extract-plugin":"^2.8.1",parse5:"^7.1.2","parse5-utils":"^2.0.0",postcss:"^8.4.40",progress:"^2.0.3","schema-utils":"^4.2.0",slugify:"^1.6.6","style-loader":"^3.3.4","swc-loader":"^0.2.6","tiny-glob":"^0.2.9","vue-template-compiler":"^2.7.16","webextension-polyfill":"^0.12.0",webpack:"~5.92.0","webpack-dev-server":"^5.0.2","webpack-merge":"^6.0.1","webpack-target-webextension":"^1.1.2"},devDependencies:{"@types/adm-zip":"^0.5.5","@types/case-sensitive-paths-webpack-plugin":"^2.1.9","@types/chrome":"^0.0.268","@types/dotenv-webpack":"^7.0.7","@types/jest":"^29.5.12","@types/loader-utils":"^2.0.6","@types/node":"^20.14.12","@types/webextension-polyfill":"^0.10.7",jest:"^29.7.0","ts-jest":"^29.1.2",tsup:"^8.0.1",typescript:"5.3.3"},optionalDependencies:{"@babel/core":"^7.24.9","@pmmmwh/react-refresh-webpack-plugin":"^0.5.15","@prefresh/webpack":"^4.0.1","@vue/compiler-sfc":"^3.4.34","babel-loader":"^9.1.3","babel-preset-modern-browser-extension":"^0.7.0",less:"^4.2.0","less-loader":"^12.2.0","postcss-flexbugs-fixes":"^5.0.2","postcss-loader":"^8.1.1","postcss-normalize":"^10.0.1","postcss-preset-env":"^9.6.0","postcss-scss":"^4.0.9","react-refresh":"^0.14.2","react-refresh-typescript":"^2.0.9","resolve-url-loader":"^5.0.0",sass:"^1.77.8","sass-loader":"^16.0.0",stylelint:"^16.7.0","stylelint-config-standard-scss":"^13.1.0","stylelint-webpack-plugin":"^5.0.1",tailwindcss:"^3.4.7","vue-loader":"^17.4.2","vue-style-loader":"^4.1.3","vue-template-compiler":"^2.7.16"}}});var bl={};Ep(bl,{extensionBuild:()=>sp,extensionDev:()=>pp,extensionPreview:()=>dp,extensionStart:()=>wp});module.exports=jp(bl);var Kc=a(require("fs")),Qc=a(require("path")),ep=a(require("webpack")),tp=require("webpack-merge");var _e=a(require("path"));var gi=a(require("case-sensitive-paths-webpack-plugin"));var V=a(require("fs")),M=a(require("path")),mi=a(require("dotenv-webpack"));var Ts=a(require("path")),u=require("@colors/colors/safe");var Rr=a(require("path")),Xe=Rr.default.join(process.cwd(),"node_modules/extension-develop/dist/certs");function w(t,e){return e==="error"?`${t} ${(0,u.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:`${e==="warn"?(0,u.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,u.cyan)("\u25BA\u25BA\u25BA"):(0,u.brightGreen)("\u25BA\u25BA\u25BA")} ${(0,u.cyan)(t)}`}function Cp(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Nr(t,e){if(!!1)return`${e.hasErrors()?(0,u.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E"):(0,u.brightGreen)("\u25BA\u25BA\u25BA")} Extension.js compiled ${e.hasErrors()?(0,u.red)("with errors"):(0,u.brightGreen)("successfully")} in ${t} ms.`}function qr(t,e,s){return`${w(t,"info")} ${(0,u.magenta)(e)} Integration Found
|
|
2
2
|
|
|
3
3
|
Installing required setup dependencies via ${(0,u.brightYellow)(s)}. This is a one time operation...`}function Ur(t){return`${w(t,"info")} loaded ${(0,u.brightYellow)("env")} file successfully.`}function v(t,e){return`${w(t,"info")} is using ${(0,u.magenta)(e)}.`}function P(t,e){return`${w(t,"success")} You Are All Set
|
|
4
4
|
|
|
@@ -123,7 +123,7 @@ Learn more about ${(0,u.bold)("mkcert")}: ${(0,u.underline)("https://github.com/
|
|
|
123
123
|
|
|
124
124
|
For MAIN world content scripts, you must specify an extension ID.
|
|
125
125
|
Otherwise, the content script won't reload on changes.
|
|
126
|
-
Add an ${(0,u.brightYellow)("id")} field to your manifest.json file and try again.`}var Ke=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=M.default.dirname(this.manifestPath),i=require(this.manifestPath).name||"Extension.js";(V.default.existsSync(M.default.join(s,".env"))||V.default.existsSync(M.default.join(s,".env.example"))||V.default.existsSync(M.default.join(s,".env.local"))||V.default.existsSync(M.default.join(s,".env.defaults")))&&(console.log(Ur(i)),new mi.default({path:V.default.existsSync(M.default.join(s,".env"))?M.default.join(s,".env"):V.default.existsSync(M.default.join(s,".env.local"))?M.default.join(s,".env.local"):M.default.join(s,".env.example"),allowEmptyValues:!0,defaults:V.default.existsSync(M.default.join(s,".env.defaults")),systemvars:!0}).apply(e))}};var Ns=a(require("fs")),di=a(require("path")),Qe=class{apply(e){let s=di.default.join(e.options.output.path||"","hot");Ns.default.existsSync(s)&&(Ns.default.rmSync(s,{recursive:!0,force:!0}),process.env.EXTENSION_ENV==="development"&&console.log("[CleanHotUpdatesPlugin] Removed old hot-update files before compilation."))}};var et=class{static name="plugin-compilation";manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){new gi.default().apply(e),new Ke({manifestPath:this.manifestPath}).apply(e),new Qe().apply(e),e.hooks.done.tap("develop:brand",s=>{s.compilation.name=void 0;let r=s.endTime-s.startTime;console.log(Nr(r,s))})}};var Mi=a(require("path")),Oi=a(require("mini-css-extract-plugin"));var Di=a(require("mini-css-extract-plugin"));var ce=a(require("path")),Ee=a(require("fs"));var ke=a(require("path")),tt=a(require("fs")),qs=require("child_process"),hi=require("detect-package-manager");function yi(t,e){return Object.values(e||{}).some(s=>s===t)}function h(t,e,s){let r=ke.default.extname(e),n=S(e,{exclude:s})?ke.default.normalize(e):t;return[".js",".jsx",".tsx",".ts"].includes(r)&&(n=n.replace(r,".js")),[".html",".njk",".nunjucks"].includes(r)&&(n=n.replace(r,".html")),[".css",".scss",".sass",".less"].includes(r)&&(n=n.replace(r,".css")),Us(n||"")}function Us(t){return t.replace(/\\/g,"/")}function S(t,e={}){if(!e)return!1;let s=Us(t);return Object.values(e).some(r=>{if(typeof r!="string")return!1;let i=Us(r);return s.endsWith(i)})}function G(t,e){if(t.getAsset("manifest.json")||t.assets["manifest.json"]){let s=t.assets["manifest.json"].source().toString();return JSON.parse(s||"{}")}return require(e)}async function _(t,e,s){try{let r=await(0,hi.detect)();console.log(qr(t,e,r));let i="";r==="yarn"?i=`yarn --silent add ${s.join(" ")} --cwd ${__dirname} --optional`:r==="npm"?i=`npm --silent install ${s.join(" ")} --prefix ${__dirname} --save-optional`:r==="pnpm"?i=`pnpm --silent add ${s.join(" ")} --prefix ${__dirname} --save-optional`:i=`${r} --silent install ${s.join(" ")} --cwd ${__dirname} --optional`,(0,qs.execSync)(i,{stdio:"inherit"}),await new Promise(n=>setTimeout(n,2e3)),process.env.EXTENSION_ENV==="development"&&(console.log(Wr(t,e)),r==="yarn"?i="yarn install --silent > /dev/null 2>&1":r==="npm"?i="npm install --silent > /dev/null 2>&1":r==="pnpm"?i="pnpm install --silent > /dev/null 2>&1":i=`${r} install --silent > /dev/null 2>&1`,(0,qs.execSync)(i,{stdio:"inherit"})),console.log(Br(t,e))}catch(r){console.error(Jr(t,e,r))}}function st(t){let e=ke.default.join(t,"package.json");if(!tt.default.existsSync(e))return!1;let s=JSON.parse(tt.default.readFileSync(e,"utf-8")),r=["react","vue","@angular/core","svelte","solid-js","preact"],i=s.dependencies||{},n=s.devDependencies||{};for(let o of r)if(i[o]||n[o])return!0;return!1}function Ws(t){return!tt.default.existsSync(ke.default.resolve(__dirname,`run-${t}-profile`))}function bi(t){let e=t.name?.replace(/ /g,"-").toLowerCase();return{data:{id:`${e}@extension-js`,manifest:t,management:{id:`${e}@extension-js`,mayDisable:!0,optionsUrl:"",installType:"development",type:"extension",enabled:!0,name:t.name||"",description:t.description||"",version:t.version||"",hostPermissions:t.host_permissions||[],permissions:t.permissions||[],offlineEnabled:t.offline_enabled||!1,shortName:t.short_name||"",isApp:t.app&&t.app.background&&t.app.background.scripts}}}}var wi=!1;function rt(t){let e=ce.default.join(t,"package.json"),s=ce.default.join(t,"manifest.json");if(!Ee.default.existsSync(e))return!1;let r=Ip(t),i=require(e),n=i.devDependencies&&i.devDependencies.tailwindcss,o=i.dependencies&&i.dependencies.tailwindcss,c=!!r&&!!(n||o);if(c&&!wi){let l=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(l,"Tailwind")),wi=!0}return c}function Ip(t){let e=ce.default.join(t,"tailwind.config.mjs"),s=ce.default.join(t,"tailwind.config.cjs"),r=ce.default.join(t,"tailwind.config.js");if(Ee.default.existsSync(e))return e;if(Ee.default.existsSync(s))return s;if(Ee.default.existsSync(r))return r}var it=a(require("path")),vi=a(require("fs"));var xi=!1;function je(t){let e=it.default.join(t,"package.json"),s=it.default.join(t,"manifest.json");if(!vi.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.sass,n=r.dependencies&&r.dependencies.sass;if(i||n){if(!xi){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"SASS")),xi=!0}return!0}return!1}async function _i(t,e){if(!je(t))return[];try{require.resolve("sass-loader")}catch{let r=["postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"],i=require(it.default.join(t,"package.json")).name;await _(i,"PostCSS",r),await _(i,"SASS",["sass","sass-loader","resolve-url-loader"]),console.log(P(i,"SASS")),process.exit(0)}return[{test:/\.(s(a|c)ss)$/,exclude:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]},{test:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!0})}]}]}var nt=a(require("path")),Pi=a(require("fs"));var Si=!1;function $e(t){let e=nt.default.join(t,"package.json"),s=nt.default.join(t,"manifest.json"),i=require(s).name||"Extension.js";if(!Pi.default.existsSync(e))return!1;let n=require(e),o=n.devDependencies&&n.devDependencies.less,c=n.dependencies&&n.dependencies.less;return o||c?(Si||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"LESS")),Si=!0),!0):!1}async function ki(t,e){if(!$e(t))return[];try{require.resolve("less-loader")}catch{let r=require(nt.default.join(t,"package.json")).name;await _(r,"LESS",["less","less-loader","resolve-url-loader"]),console.log(P(r,"LESS")),process.exit(0)}return[{test:/\.less$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await A(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]}]}var le=a(require("path")),ot=a(require("fs"));var pe=!1;function Ap(t){let e=le.default.join(t,"package.json"),s=le.default.join(t,"manifest.json");if(!ot.default.existsSync(e))return!1;let r=[".postcssrc",".postcssrc.json",".postcssrc.yaml",".postcssrc.yml",".postcssrc.js",".postcssrc.cjs","postcss.config.js","postcss.config.cjs"],n=require(s).name||"Extension.js";if(ot.default.existsSync(e)){let o=require(e);if(o.dependencies&&o.dependencies.postcss||o.devDependencies&&o.devDependencies.postcss)return pe||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"PostCSS")),pe=!0),!0}for(let o of r)if(ot.default.existsSync(le.default.join(t,o)))return pe||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"PostCSS")),pe=!0),!0;return rt(t)?(pe||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"PostCSS")),pe=!0),!0):!1}async function Ei(t,e){if(!Ap(t))return{};try{require.resolve("postcss-loader")}catch{let r=require(le.default.join(t,"package.json")).name;!je(t)&&!$e(t)&&await _(r,"PostCSS",["postcss","postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"]),console.log(P(r,"PostCSS")),process.exit(0)}return{loader:require.resolve("postcss-loader"),options:{postcssOptions:{parser:require.resolve("postcss-scss"),ident:"postcss",config:le.default.resolve(t,"postcss.config.js"),plugins:[require.resolve("postcss-flexbugs-fixes"),[require.resolve("postcss-preset-env"),{autoprefixer:{flexbox:"no-2009"},stage:3}].filter(Boolean),require.resolve("postcss-normalize")].filter(Boolean)},sourceMap:e.mode==="development"}}}var at=a(require("path")),$i=a(require("fs"));var ji=!1;function Ce(t){let e=at.default.join(t,"package.json"),s=at.default.join(t,"manifest.json");if(!$i.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.vue,n=r.dependencies&&r.dependencies.vue;if((i||n)&&!ji){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Vue")),ji=!0}return!!i||!!n}async function Ci(t){if(!Ce(t))return;try{require.resolve("vue-loader")}catch{let i=["typescript"],o=require(at.default.join(t,"manifest.json")).name||"Extension.js";await _(o,"TypeScript",i),await _(o,"Vue",["vue-loader","@vue/compiler-sfc","vue-template-compiler","vue-style-loader"]),console.log(P(o,"Vue")),process.exit(0)}let e=[{test:/\.vue$/,loader:require.resolve("vue-loader"),include:t,exclude:/node_modules/}];return{plugins:[new(require("vue-loader")).VueLoaderPlugin],loaders:e,alias:void 0}}async function A(t,e){let s=Di.default.loader,r=[e.useMiniCssExtractPlugin?s:Ce(t)?require.resolve("vue-style-loader"):require.resolve("style-loader"),{loader:require.resolve("css-loader"),options:{importLoaders:1}}].filter(Boolean);if(rt(t)||je(t)||$e(t)){let i=await Ei(t,e);i.loader&&r.push(i)}return e.loader&&r.push({loader:require.resolve("resolve-url-loader"),options:{sourceMap:e.mode==="development",root:t}},{loader:require.resolve(e.loader),options:{sourceMap:e.mode==="development"}}),r.filter(Boolean)}var C=a(require("path")),O=a(require("fs"));function Ii(t){let e=C.default.join(t,"stylelint.config.json"),s=C.default.join(t,".stylelintrc.js file"),r=C.default.join(t,"stylelint.config.mjs"),i=C.default.join(t,".stylelintrc.mjs"),n=C.default.join(t,"stylelint.config.cjs"),o=C.default.join(t,".stylelintrc.cjs"),c=C.default.join(t,".stylelintrc.json"),p=C.default.join(t,".stylelintrc"),l=C.default.join(t,".stylelintrc.yml"),f=C.default.join(t,".stylelintrc.yaml");if(O.default.existsSync(e))return e;if(O.default.existsSync(s))return s;if(O.default.existsSync(r))return r;if(O.default.existsSync(i))return i;if(O.default.existsSync(n))return n;if(O.default.existsSync(o))return o;if(O.default.existsSync(c))return c;if(O.default.existsSync(p))return p;if(O.default.existsSync(l))return l;if(O.default.existsSync(f))return f}var Li=!1;function Fi(t){let e=C.default.join(t,"package.json"),s=C.default.join(t,"manifest.json");if(!O.default.existsSync(e))return!1;let i=!!Ii(t);if(i&&!Li){let o=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(o,"Stylelint")),Li=!0}return i}async function Ai(t){if(!Fi(t))return[];try{require.resolve("stylelint")}catch{let r=["stylelint","stylelint-webpack-plugin","stylelint-config-standard-scss"],i=require(C.default.join(t,"package.json")).name;await _(i,"Stylelint",r),console.log(P(i,"Stylelint")),process.exit(0)}let e=require("stylelint-webpack-plugin");return[new e({context:t,configFile:Fi(t)?Ii(t):C.default.join(__dirname,"stylelint.config.json"),files:"**/*.{css,scss,sass,less}",exclude:["node_modules",C.default.join(t,"node_modules")]})]}var ct=class t{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=Mi.default.dirname(this.manifestPath),r=[new Oi.default];r.forEach(p=>p.apply(e));let i=await Ai(s);r.push(...i);let n=[{test:/\.css$/,exclude:/\.module\.css$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:!1})},{use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]},{test:/\.module\.css$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:!1})},{use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]}];e.options.plugins=[...e.options.plugins,...r].filter(Boolean);let o=await _i(s,this.mode),c=await ki(s,this.mode);n.push(...o),n.push(...c),e.options.module.rules=[...e.options.module.rules,...n].filter(Boolean)}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var pt=class{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async apply(e){let s={test:/\.svg$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2048}}},i=[...e.options.module.rules.some(n=>n&&n.test instanceof RegExp&&n.test.test(".svg")&&n.use!==void 0)?[]:[s],{test:/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"}},{test:/\.(txt|md|csv|tsv|xml|pdf|docx|doc|xls|xlsx|ppt|pptx|zip|gz|gzip|tgz)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(csv|tsv)$/i,use:[require.resolve("csv-loader")],generator:{filename:"assets/[name][ext]"}}];e.options.module.rules=[...e.options.module.rules,...i].filter(Boolean)}};var Bs=a(require("path"));var fe=a(require("path")),ft=a(require("fs"));var lt=a(require("path")),Ri=a(require("fs"));var Ti=!1;function X(t){let e=lt.default.join(t,"package.json"),s=lt.default.join(t,"manifest.json");if(!Ri.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.preact,n=r.dependencies&&r.dependencies.preact;if((i||n)&&!Ti){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Preact")),Ti=!0}return!!i||!!n}async function Ni(t){if(!X(t))return;try{require.resolve("@prefresh/webpack")}catch{let r=["@prefresh/webpack"],n=require(lt.default.join(t,"manifest.json")).name||"Extension.js";await _(n,"Preact",r),console.log(P(n,"Preact")),process.exit(0)}return{plugins:[new(require("@prefresh/webpack"))],loaders:void 0,alias:{react:"preact/compat","react-dom/test-utils":"preact/test-utils","react-dom":"preact/compat","react/jsx-runtime":"preact/jsx-runtime"}}}var ue=a(require("path")),ut=a(require("fs"));var qi=!1;function R(t){let e=ue.default.join(t,"package.json");if(!ut.default.existsSync(e))return!1;let s=Op(t),r=require(e),i=require(ue.default.join(t,"manifest.json")),n=i.name||"Extension.js",o=r.devDependencies&&r.devDependencies.typescript,c=r.dependencies&&r.dependencies.typescript;return qi||((o||c)&&(s?process.env.EXTENSION_ENV==="development"&&console.log(v(n,"TypeScript")):(console.log(ni(i)),Tp(t))),qi=!0),!!s&&!!(o||c)}function Mp(t,e){return{compilerOptions:{allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,jsx:st(t)?"react-jsx":"preserve",lib:["dom","dom.iterable","esnext"],moduleResolution:"node",module:"esnext",resolveJsonModule:!0,strict:!0,target:"esnext",isolatedModules:!1,skipLibCheck:!0},exclude:["node_modules","dist"]}}function Op(t){let e=ue.default.join(t,"tsconfig.json");if(ut.default.existsSync(e))return e}function Tp(t){ut.default.writeFileSync(ue.default.join(t,"tsconfig.json"),JSON.stringify(Mp(t,{mode:"development"}),null,2))}async function Ui(t){if(!R(t))return!1;try{require.resolve("typescript")}catch{let s=["typescript"],i=require(ue.default.join(t,"manifest.json")).name||"Extension.js";await _(i,"TypeScript",s),console.log(P(i,"TypeScript")),process.exit(0)}return!0}var Wi=!1,Bi=[".babelrc",".babelrc.json",".babelrc.js",".babelrc.cjs","babel.config.json","babel.config.js","babel.config.cjs"];function Rp(t){let e=fe.default.join(t,"package.json"),s=fe.default.join(t,"manifest.json");if(!ft.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies["babel-core"],n=r.dependencies&&r.dependencies["babel-core"],o=Bi.some(c=>ft.default.existsSync(fe.default.join(t,c)))||!!i||!!n;if(o&&!Wi){let p=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&process.env.EXTENSION_ENV==="development"&&console.log(v(p,"Babel")),Wi=!0}return o}function Np(t){for(let e of Bi){let s=fe.default.join(t,e);if(ft.default.existsSync(s))return s}}function qp(t,e){let s=require("babel-preset-modern-browser-extension").default;return{cacheDirectory:!1,cacheCompression:!1,babelrc:!1,configFile:Np(t),compact:e.mode==="production",overrides:[s(e).overrides],presets:[...s(e).presets],plugins:[...s(e).plugins,process.env.NODE_ENV!=="test"&&e.mode==="development"&&X(t)&&require.resolve("react-refresh/babel")].filter(Boolean)}}async function Ji(t,e){if(!Rp(e))return;try{require.resolve("babel-loader")}catch{let o=["@babel/core","babel-loader","babel-preset-modern-browser-extension"],p=require(fe.default.join(e,"manifest.json")).name||"Extension.js";await _(p,"Babel",o),console.log(P(p,"Babel")),process.exit(0)}let s=R(e)?/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/:/\.(js|mjs|jsx|mjsx)$/,r=t.options.mode,i=await Ui(e);return{plugins:void 0,loaders:[{test:s,include:e,exclude:/node_modules/,loader:require.resolve("babel-loader"),options:qp(e,{mode:r,typescript:i})}],alias:void 0}}var mt=a(require("path")),Hi=a(require("fs"));var zi=!1;function me(t){let e=mt.default.join(t,"package.json"),s=mt.default.join(t,"manifest.json");if(!Hi.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.react,n=r.dependencies&&r.dependencies.react;if((i||n)&&!zi){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"React")),zi=!0}return!!i||!!n}async function Vi(t){if(!me(t))return;try{require.resolve("@pmmmwh/react-refresh-webpack-plugin")}catch{let r=["react-refresh","@pmmmwh/react-refresh-webpack-plugin","react-refresh-typescript"],n=require(mt.default.join(t,"manifest.json")).name||"Extension.js";await _(n,"React",r),console.log(P(n,"React")),process.exit(0)}return{plugins:[new(require("@pmmmwh/react-refresh-webpack-plugin"))({overlay:!1})],loaders:void 0,alias:void 0}}var dt=class t{static name="plugin-js-frameworks";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=Bs.default.dirname(this.manifestPath),r=await Ji(e,s),i=await Vi(s),n=await Ni(s),o=await Ci(s);e.options.resolve.alias={...r?.alias||{},...i?.alias||{},...n?.alias||{},...o?.alias||{},...e.options.resolve.alias},e.options.module.rules=[{test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Bs.default.dirname(this.manifestPath)],exclude:/node_modules/,use:{loader:require.resolve("swc-loader"),options:{sync:!0,module:{type:"es6"},minify:this.mode==="production",isModule:!0,jsc:{target:"es2016",parser:{syntax:R(s)?"typescript":"ecmascript",tsx:R(s)&&(me(s)||X(s)),jsx:!R(s)&&(me(s)||X(s)),dynamicImport:!0},transform:{react:{development:this.mode==="development",refresh:this.mode==="development",runtime:"automatic",importSource:"react"}}}}}},...r?.loaders||[],...i?.loaders||[],...n?.loaders||[],...o?.loaders||[],...e.options.module.rules].filter(Boolean),i?.plugins?.forEach(c=>c.apply(e)),n?.plugins?.forEach(c=>c.apply(e)),o?.plugins?.forEach(c=>c.apply(e))}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var Re=a(require("path"));var In=a(require("path"));var Gi=a(require("path"));function Xi(t,e){if(!e||!e.action||!e.action.default_popup)return;let s=e.action.default_popup;return Gi.default.join(t,s)}var Zi=a(require("path"));function Yi(t,e){if(!e||!e.browser_action||!e.browser_action.default_popup)return;let s=e.browser_action.default_popup;return Zi.default.join(t,s)}var gt=a(require("path"));function Ki(t,e){let s={newtab:void 0};if(!e||!e.chrome_url_overrides)return{"chrome_url_overrides/newtab":void 0};if(e.chrome_url_overrides.history){let r=e.chrome_url_overrides.history;s={"chrome_url_overrides/history":gt.default.join(t,r)}}if(e.chrome_url_overrides.newtab){let r=e.chrome_url_overrides.newtab;s={"chrome_url_overrides/newtab":gt.default.join(t,r)}}if(e.chrome_url_overrides.bookmarks){let r=e.chrome_url_overrides.bookmarks;s={"chrome_url_overrides/bookmarks":gt.default.join(t,r)}}return s}var Qi=a(require("path"));function en(t,e){if(!e||!e.devtools_page)return;let s=e.devtools_page;return Qi.default.join(t,s)}var Js=a(require("path"));function tn(t,e){if(e.options_page){let r=e.options_page;return Js.default.join(t,r)}if(!e||!e.options_ui||!e.options_ui.page)return;let s=e.options_ui.page;return Js.default.join(t,s)}var sn=a(require("path"));function rn(t,e){if(!e||!e.page_action||!e.page_action.default_popup)return;let s=e.page_action.default_popup;return sn.default.join(t,s)}var nn=a(require("path"));function on(t,e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0":void 0};let s=e.sandbox.pages,r={};for(let[i,n]of s.entries())r[`sandbox/page-${i}`]=nn.default.join(t,n);return r}var an=a(require("path"));function cn(t,e){if(!e||!e.side_panel||!e.side_panel.default_path)return;let s=e.side_panel.default_path;return an.default.join(t,s)}var pn=a(require("path"));function ln(t,e){if(!e||!e.sidebar_action||!e.sidebar_action.default_panel)return;let s=e.sidebar_action.default_panel;return pn.default.join(t,s)}function De(t,e){return{"action/default_popup":Xi(t,e),"browser_action/default_popup":Yi(t,e),...Ki(t,e),devtools_page:en(t,e),"options_ui/page":tn(t,e),"page_action/default_popup":rn(t,e),...on(t,e),"side_panel/default_path":cn(t,e),"sidebar_action/default_panel":ln(t,e)}}var zs=a(require("path"));function un(t,e){if(!e||!e.action||!e.action.default_icon)return;if(typeof e.action.default_icon=="string")return zs.default.join(t,e.action.default_icon);let s=[];for(let r in e.action.default_icon)s.push(zs.default.join(t,e.action.default_icon[r]));return s}var Hs=a(require("path"));function fn(t,e){if(!e||!e.browser_action||!e.browser_action.default_icon)return;let s=[];if(typeof e.browser_action.default_icon=="string")return Hs.default.join(t,e.browser_action.default_icon);for(let r in e.browser_action.default_icon){let i=e.browser_action.default_icon[r]=Hs.default.join(t,e.browser_action.default_icon[r]);s.push(i)}return s}var Vs=a(require("path"));function mn(t,e){if(!(!e||!e.browser_action||!e.browser_action.theme_icons)){for(let s of e.browser_action.theme_icons)s.light&&(s.light=Vs.default.join(t,s.light)),s.dark&&(s.dark=Vs.default.join(t,s.dark)),s.size&&delete s.size;return e.browser_action.theme_icons}}var dn=a(require("path"));function gn(t,e){if(!e||!e.icons)return;let s=[];for(let r in e.icons){let i=dn.default.join(t,e.icons[r]);s.push(i)}return s}var Gs=a(require("path"));function hn(t,e){if(!e||!e.page_action||!e.page_action.default_icon)return;if(typeof e.page_action.default_icon=="string")return Gs.default.join(t,e.page_action.default_icon);let s=[];for(let r in e.page_action.default_icon){let i=Gs.default.join(t,e.page_action.default_icon[r]);s.push(i)}return s}var yn=a(require("path"));function bn(t,e){return!e||!e.sidebar_action||!e.sidebar_action.default_icon?void 0:yn.default.join(t,e.sidebar_action.default_icon)}function wn(t,e){return{action:un(t,e),browser_action:fn(t,e),"browser_action/theme_icons":mn(t,e),icons:gn(t,e),page_action:hn(t,e),sidebar_action:bn(t,e)}}var xn=a(require("path"));function vn(t,e){let s={};return!e||!e.declarative_net_request||!e.declarative_net_request.rule_resources?{"declarative_net_request/rule_resources-0":void 0}:(e.declarative_net_request.rule_resources.forEach(i=>{s[`declarative_net_request/${i.id}`]=xn.default.join(t,i.path)}),s)}var _n=a(require("path"));function Sn(t,e){if(!e||!e.storage||!e.storage.managed_schema)return;let s=e.storage.managed_schema;return _n.default.join(t,s)}function Pn(t,e){return{...vn(t,e),"storage/managed_schema":Sn(t,e)}}var kn=a(require("path"));function En(t,e){if(!e||!e.background)return;let s=e.background.scripts;if(s)return s.map(r=>kn.default.join(t,r))}var jn=a(require("path"));function $n(t,e){if(!e||!e.background)return;let s=e.background.service_worker;if(s)return jn.default.join(t,s)}var Xs=a(require("path"));function Cn(t,e){if(!e||!e.content_scripts)return{"content_scripts/content-0":void 0};let s=n=>{if(n.js?.length!==0)return n.js?.map(o=>Xs.default.join(t,o))},r=n=>{if(n.css?.length!==0)return n.css?.map(o=>Xs.default.join(t,o))},i={};for(let[n,o]of e.content_scripts.entries()){let c=s(o),p=r(o);i[`content_scripts/content-${n}`]=[...(c||[]).filter(l=>l!=null),...(p||[]).filter(l=>l!=null)]}return i}var Dn=a(require("path"));function Ln(t,e){if(!e||!e.user_scripts||!e.user_scripts.api_script)return;let s=e.user_scripts.api_script;return Dn.default.join(t,s)}function Le(t,e){return{"background/scripts":En(t,e),"background/service_worker":$n(t,e),...Cn(t,e),"user_scripts/api_script":Ln(t,e)}}function Fn(t){if(!(!t||!t.web_accessible_resources||!t.web_accessible_resources.length))return t.web_accessible_resources}function Up(t){function e(s){let r={};for(let i in s)if(s.hasOwnProperty(i)){let n=i.includes(":")?i.split(":")[1]:i;typeof s[i]=="object"&&!Array.isArray(s[i])?r[n]=e(s[i]):r[n]=s[i]}return r}return e(t)}function An({manifestPath:t}){let e=In.default.dirname(t),s=require(t),r=Up(s);return{html:De(e,r),icons:wn(e,r),json:Pn(e,r),scripts:Le(e,r),web_accessible_resources:Fn(r)}}var de=a(require("path"));var ht=a(require("fs")),Fe=a(require("path"));function yt(t,e){if(!ht.default.existsSync(t)||!ht.default.statSync(t).isDirectory())return[];let s=[];function r(i){let n=ht.default.readdirSync(i,{withFileTypes:!0});for(let o of n){let c=Fe.default.join(i,o.name);o.isDirectory()?r(c):o.isFile()&&e(o.name)&&s.push(c)}}return r(t),s}function bt(t,e,s=""){return!e||!e.length?{}:e.reduce((r,i)=>{let n=Fe.default.extname(i),o=Fe.default.basename(i,n),c=s?`${s}/${o}`:Fe.default.relative(t,i);return{...r,[c]:i}},{})}function Mn({manifestPath:t}){let e=de.default.dirname(t),s={public:de.default.join(e,"public"),pages:de.default.join(e,"pages"),scripts:de.default.join(e,"scripts")},r={public:yt(s.public,()=>!0),pages:yt(s.pages,n=>n.endsWith(".html")),scripts:yt(s.scripts,n=>[".js",".mjs",".jsx",".mjsx",".ts",".mts",".tsx",".mtsx"].includes(de.default.extname(n)))};return{public:bt(e,r.public),pages:bt(e,r.pages,"pages"),scripts:bt(e,r.scripts,"scripts")}}var wt=a(require("path")),On=a(require("webpack")),xt=class{manifestPath;includeList;excludeList;loaderOptions;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList,this.loaderOptions=e.loaderOptions}apply(e){new On.default.ProvidePlugin({r:[wt.default.resolve(__dirname,"./resolver-module.js"),"default"]}).apply(e),e.options.module?.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,loader:require.resolve(wt.default.resolve(__dirname,"./resolver-loader.js")),include:[wt.default.dirname(this.manifestPath)],exclude:/node_modules/,options:{manifestPath:this.manifestPath,includeList:this.includeList,jsx:this.loaderOptions?this.loaderOptions.jsx:!1,typescript:this.loaderOptions?this.loaderOptions.typescript:!1,minify:this.loaderOptions?this.loaderOptions.minify:!1}})}};var Tn=a(require("fs")),_t=a(require("webpack")),Rn=require("webpack");var vt=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){e.hooks.compilation.tap("manifest:emit-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:emit-manifest",stage:_t.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let r=this.manifestPath,i;try{let c=Tn.default.readFileSync(r,"utf-8");i=JSON.parse(c)}catch(c){let l=require(this.manifestPath).name||"Extension.js";s.errors.push(new _t.default.WebpackError(si(l,c)));return}let n=JSON.stringify(i,null,2);s.emitAsset("manifest.json",new Rn.sources.RawSource(n))})})}};var Et=require("webpack");var ho=a(require("path"));function Nn(t,e){return t.background&&t.background.scripts&&{background:{...t.background,...t.background.scripts&&{scripts:["background/scripts.js",...t.background.scripts.filter(s=>e.includes(s))]}}}}var qn=a(require("path"));var St=t=>qn.default.basename(t);function Un(t,e){return t.browser_action&&{browser_action:{...t.browser_action,...t.browser_action.default_popup&&{default_popup:h("browser_action/default_popup.html",t.browser_action.default_popup,e)},...t.browser_action.default_icon&&{default_icon:typeof t.browser_action.default_icon=="string"?h(`icons/${St(t.browser_action.default_icon)}`,t.browser_action.default_icon,e):Object.fromEntries(Object.entries(t.browser_action.default_icon).map(([s,r])=>[s,h(`icons/${St(r)}`,r,e)]))},...t.browser_action.theme_icons&&{theme_icons:t.browser_action.theme_icons.map(s=>({...s,...s.light&&{light:h(`browser_action/${St(s.light)}`,s.light,e)},...s.dark&&{dark:h(`browser_action/${St(s.dark)}`,s.dark,e)}}))}}}}function Wn(t,e){return t.declarative_net_request&&{declarative_net_request:{...t.declarative_net_request,rule_resources:t.declarative_net_request.rule_resources.map(s=>({...s,path:s.path&&h(`declarative_net_request/${s.id}.json`,s.path,e)}))}}}function Bn(t,e){return{...Nn(t,e),...Un(t,e),...Wn(t,e)}}var zn=a(require("path"));var Jn=t=>zn.default.basename(t);function Hn(t,e){return t.action&&{action:{...t.action,...t.action.default_popup&&{default_popup:h("action/default_popup.html",t.action.default_popup,e)},...t.action.default_icon&&{default_icon:typeof t.action.default_icon=="string"?h(`action/${Jn(t.action.default_icon)}`,t.action.default_icon,e):Object.fromEntries(Object.entries(t.action.default_icon).map(([s,r])=>[s,h(`action/${Jn(r)}`,r,e)]))}}}}function Vn(t,e){return t.background&&t.background.service_worker&&{background:{...t.background,...t.background.service_worker&&{service_worker:h("background/service_worker.js",t.background.service_worker,e)}}}}function Pt(t,e){return t.side_panel&&{side_panel:{...t.side_panel.default_path&&{default_path:h("side_panel/default_path.html",t.side_panel.default_path,e)}}}}function Gn(t,e){return{...Hn(t,e),...Vn(t,e),...Pt(t,e)}}function Xn(t,e){return t.background&&t.background.page&&{background:{...t.background,...t.background.page&&{page:h("background/page.html",t.background.page,e)}}}}function Zn(t,e){return t.chrome_url_overrides&&{chrome_url_overrides:{...t.chrome_url_overrides.bookmarks&&{bookmarks:h("chrome_url_overrides/bookmarks.html",t.chrome_url_overrides.bookmarks,e)},...t.chrome_url_overrides.history&&{history:h("chrome_url_overrides/history.html",t.chrome_url_overrides.history,e)},...t.chrome_url_overrides.newtab&&{newtab:h("chrome_url_overrides/newtab.html",t.chrome_url_overrides.newtab,e)}}}}function Yn(t,e){return t.content_scripts&&{content_scripts:t.content_scripts.map((s,r)=>{let i=[...new Set(s.js)],n=[...new Set(s.css)];return{...s,js:[...i.map(o=>h(`content_scripts/content-${r}.js`,o,e))],css:[...n.map(o=>h(`content_scripts/content-${r}.css`,o,e))]}})}}function Kn(t,e){return t.devtools_page&&{devtools_page:h("devtools_page.html",t.devtools_page,e)}}var Qn=a(require("path"));var Wp=t=>Qn.default.basename(t);function eo(t,e){return t.icons&&{icons:Object.fromEntries(Object.entries(t.icons).map(([s,r])=>[s,h(`icons/${Wp(r)}`,r,e)]))}}function to(t,e){return t.options_page&&{options_page:h("options_ui/page.html",t.options_page,e)}}function so(t,e){return t.options_ui&&{options_ui:{...t.options_ui,...t.options_ui.page&&{page:h("options_ui/page.html",t.options_ui.page,e)}}}}var io=a(require("path"));var ro=t=>io.default.basename(t);function no(t,e){return t.page_action&&{page_action:{...t.page_action,...t.page_action.default_popup&&{default_popup:h("page_action/default_popup.html",t.page_action.default_popup,e)},...t.page_action.default_icon&&{default_icon:typeof t.page_action.default_icon=="string"?h(`icons/${ro(t.page_action.default_icon)}`,t.page_action.default_icon,e):Object.fromEntries(Object.entries(t.page_action.default_icon).map(([s,r])=>[s,h(`icons/${ro(r)}`,r,e)]))}}}}function oo(t,e){return t.sandbox&&{sandbox:{...t.sandbox,...t.sandbox.pages&&{pages:t.sandbox.pages.map((s,r)=>h(`sandbox/page-${r}.html`,s,e))}}}}var ao=a(require("path"));var Bp=t=>ao.default.basename(t);function co(t,e){return t.sidebar_action&&{sidebar_action:{...t.sidebar_action,...t.sidebar_action.default_panel&&{default_panel:h("sidebar_action/default_panel.html",t.sidebar_action.default_panel,e)},...t.sidebar_action.default_icon&&{default_icon:h(`icons/${Bp(t.sidebar_action.default_icon)}`,t.sidebar_action.default_icon,e)}}}}function po(t,e){return t.storage&&{storage:{...t.storage.managed_schema&&{managed_schema:h("storage/managed_schema.json",t.storage.managed_schema,e)}}}}var lo=a(require("path"));var Jp=t=>lo.default.basename(t);function uo(t,e){return t.theme&&{theme:{...t.theme,...t.theme.images&&{images:{...t.theme.images,theme_frame:h(`theme/images/${Jp(t.theme.images.theme_frame)}`,t.theme.images.theme_frame,e)}}}}}function fo(t,e){return t.user_scripts&&{user_scripts:{...t.user_scripts,...t.user_scripts.api_script&&{api_script:h("user_scripts/api_script.js",t.user_scripts.api_script,e)}}}}function mo(t){return t.web_accessible_resources&&t.web_accessible_resources.length&&{web_accessible_resources:t.web_accessible_resources}}function go(t,e){return{...Xn(t,e),...Zn(t,e),...Yn(t,e),...Kn(t,e),...eo(t,e),...to(t,e),...so(t,e),...no(t,e),...oo(t,e),...Pt(t,e),...co(t,e),...po(t,e),...uo(t,e),...fo(t,e),...mo(t)}}function yo(t,e,s){let r=e||require(t),i=c=>Array.isArray(c)?c.map(p=>n(p)):typeof c=="string"?[n(c)]:[],n=c=>{let p=ho.default.dirname(t),l=c.replace(p,"");return l.startsWith("/")?l.slice(1):l},o=Object.entries(s).flatMap(([,c])=>i(c));return JSON.stringify({...r,...go(r,o),...Bn(r,o),...Gn(r,o)},null,2)}var kt=class{manifestPath;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.excludeList=e.excludeList}applyDevOverrides(e){return e.content_scripts?e.content_scripts.map((s,r)=>(s.css.length&&!s.js.length&&(s.js=[h(`content_scripts-${r}`,"dev.js",[])]),s)):{}}apply(e){e.hooks.thisCompilation.tap("manifest:update-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:update-manifest",stage:Et.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},()=>{if(s.errors.length>0)return;let r=G(s,this.manifestPath),i=yo(this.manifestPath,r,this.excludeList||{}),n={...r,...JSON.parse(i)};e.options.mode!=="production"&&n.content_scripts&&(n.content_scripts=this.applyDevOverrides(n));let o=JSON.stringify(n,null,2),c=new Et.sources.RawSource(o);s.updateAsset("manifest.json",c)})})}};var bo=a(require("fs")),jt=class{dependencyList;constructor(e){this.dependencyList=e}apply(e){e.hooks.afterCompile.tap("ManifestPlugin (AddDependenciesPlugin)",s=>{if(s.errors?.length)return;let r=new Set(s.fileDependencies);this.dependencyList&&this.dependencyList.forEach(i=>{bo.default.existsSync(i)&&(r.has(i)||(r.add(i),s.fileDependencies.add(i)))})})}};var wo=a(require("fs")),xo=a(require("path")),Ct=a(require("webpack"));var $t=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}extractPaths(e){let s=Array.isArray(e)?e:[e];if(typeof s[0]=="string")return s;let r=[];if(typeof e=="object"&&!Array.isArray(e)){let i=e;i.light&&r.push(i.light),i.dark&&r.push(i.dark)}return r}handleErrors(e,s){let r=[".png",".jpg",".jpeg",".svg",".gif",".webp"],i=[".json"],n=[".js",".ts",".jsx",".tsx",".mjs",".cjs"],o=".html",c=Object.entries(this.includeList||{});for(let[p,l]of c)if(l){let f=this.extractPaths(l);for(let d of f){let g=xo.default.extname(d),j=require(this.manifestPath).name||"Extension.js",$=ae(j,p,d);wo.default.existsSync(d)||(r.includes(g)?e.errors.push(new s($)):i.includes(g)?e.errors.push(new s($)):n.includes(g)?e.errors.push(new s($)):g===o?e.errors.push(new s($)):e.errors.push(new s($)))}}}apply(e){e.hooks.compilation.tap("manifest:check-manifest-files",s=>{s.hooks.processAssets.tap({name:"compatibility:check-manifest-files",stage:Ct.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT},()=>{let r=Ct.default.WebpackError;this.handleErrors(s,r)})})}};var vo=a(require("fs")),Lt=a(require("webpack"));var Dt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}flattenAndSort(e){return e.flat(1/0).sort()}apply(e){e.hooks.watchRun.tapAsync("manifest:throw-if-recompile-is-needed",(s,r)=>{if((s.modifiedFiles||new Set).has(this.manifestPath)){let n=s.options.context||"",o=`${n}/package.json`;if(!vo.default.existsSync(o)){r();return}let c=require(this.manifestPath),p=this.flattenAndSort(Object.values(De(n,c))),l=this.flattenAndSort(Object.values(Le(n,c)));s.hooks.thisCompilation.tap("manifest:throw-if-recompile-is-needed",f=>{f.hooks.processAssets.tap({name:"manifest:check-manifest-files",stage:Lt.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY},()=>{let g=f.getAsset("manifest.json")?.source.source().toString(),y=JSON.parse(g||"{}"),j=this.flattenAndSort(Object.values(De(n,y))),$=this.flattenAndSort(Object.values(Le(n,y)));if(l.toString()!==$.toString()||p.toString()!==j.toString()){let q=p.filter(W=>!j.includes(W))[0],U=j.filter(W=>!p.includes(W))[0],H=require(this.manifestPath).name,Se=ri(H,U,q);f.errors.push(new Lt.default.WebpackError(Se))}})})}r()})}};var Ft=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new vt({manifestPath:this.manifestPath}).apply(e),new $t({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new kt({manifestPath:this.manifestPath,excludeList:this.excludeList}).apply(e),new jt([this.manifestPath]).apply(e),new Dt({manifestPath:this.manifestPath,includeList:this.includeList}).apply(e)}};var er=a(require("path"));var Ys=a(require("fs")),Mt=a(require("webpack")),Eo=require("webpack");var _o=a(require("fs")),he=a(require("path")),So=a(require("parse5-utils"));var ge=a(require("parse5-utils"));function It(t){try{return new URL(t),!0}catch{return!1}}function Ie(t,e){let{childNodes:s=[]}=t;for(let r of s)if(r.nodeName==="script"){let i=ge.default.getAttribute(r,"src");if(!i||It(i))continue;e({filePath:i,childNode:r,assetType:"script"})}else if(r.nodeName==="link"){let i=ge.default.getAttribute(r,"href"),n=ge.default.getAttribute(r,"rel");if(!i||It(i))continue;e(n==="dns-prefetch"||n==="icon"||n==="manifest"||n==="modulepreload"||n==="preconnect"||n==="prefetch"||n==="preload"||n==="prerender"?{filePath:i,childNode:r,assetType:"staticHref"}:{filePath:i,childNode:r,assetType:"css"})}else if(r.nodeName==="a"||r.nodeName==="area"){let i=ge.default.getAttribute(r,"href");if(!i||It(i))continue;e({filePath:i,childNode:r,assetType:"staticHref"})}else if(r.nodeName==="audio"||r.nodeName==="embed"||r.nodeName==="iframe"||r.nodeName==="img"||r.nodeName==="input"||r.nodeName==="source"||r.nodeName==="track"||r.nodeName==="video"){let i=ge.default.getAttribute(r,"src");if(!i||It(i))continue;e({filePath:i,childNode:r,assetType:"staticSrc"})}else Ie(r,e)}function D(t,e){let s={css:[],js:[],static:[]};if(!t)return s;let r=e||_o.default.readFileSync(t,{encoding:"utf8"}),i=So.default.parse(r),n=(o,c)=>he.default.join(he.default.dirname(o),c.startsWith("/")?he.default.relative(he.default.dirname(o),c):c);for(let o of i.childNodes)if(o.nodeName==="html"){for(let c of o.childNodes)(c.nodeName==="head"||c.nodeName==="body")&&Ie(c,({filePath:p,assetType:l})=>{let f=n(t,p);switch(l){case"script":s.js?.push(f);break;case"css":s.css?.push(f);break;case"staticSrc":case"staticHref":if(p.startsWith("#"))break;s.static?.push(f);break;default:break}});return{css:s.css,js:s.js,static:s.static}}}function Po(t,e,s){let r=Object.keys(t).find(n=>{let o=t[n];return t[n]===e||D(o)?.js?.includes(e)||D(o)?.css?.includes(e)})||"",i=Zs(e);return r?`/${r.replace(i,"")}${s}`:`${e.replace(i,"")}${s}`}function Zs(t){switch(he.default.extname(t)){case".js":case".mjs":case".ts":case".tsx":return".js";case".css":case".scss":case".sass":case".less":return".css";case".html":return".html";default:return".js"}}function Z(t,e,s){return s?`/${t}${e}`:`${t}${e}`}function ko(t,e){return Object.values(e||{}).some(s=>s===t)}var At=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let r=require(this.manifestPath).name||"Extension.js";e.hooks.thisCompilation.tap("html:emit-html-file",i=>{i.hooks.processAssets.tap({name:"AddAssetsToCompilationPlugin",stage:Mt.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let n=Object.entries(this.includeList||{});for(let o of n){let[c,p]=o;if(p){if(!Ys.default.existsSync(p)){let f=ae(r,c,p);i.warnings.push(new Mt.default.WebpackError(f));return}let l=Ys.default.readFileSync(p,"utf8");if(!S(p,this.excludeList)){let f=new Eo.sources.RawSource(l),d=Z(c,".html");i.emitAsset(d,f)}}}})})}};var Ot=a(require("fs")),ye=a(require("path")),jo=a(require("webpack")),Ae=require("webpack");var Tt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-assets-to-compilation",s=>{s.hooks.processAssets.tap({name:"html:add-assets-to-compilation",stage:Ae.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{if(s.errors.length>0)return;let r=Object.entries(this.includeList||{});for(let i of r){let[n,o]=i,c=n+".html";if(o){let p=s.getAsset(c);if(p){let l=p.source.source().toString(),f=D(o,l)?.static,d=[...new Set(f)];for(let g of d)if(!g.includes("public/")){if(!Ot.default.existsSync(g)&&!ko(g,this.includeList)&&!ye.default.basename(g).startsWith("#")){let U=Ze(require(this.manifestPath).name,o,g);s.warnings.push(new jo.default.WebpackError(U));return}let y=Ot.default.readFileSync(g),j=new Ae.sources.RawSource(y),$=ye.default.join("assets",ye.default.basename(g));if(!s.getAsset($))if(g.endsWith(".html")){let q=D(g),U=[...q?.js||[],...q?.css||[],...q?.static||[]];s.emitAsset($,j),U.forEach(H=>{let Se=Ot.default.readFileSync(H),W=new Ae.sources.RawSource(Se),Or=ye.default.join("assets",ye.default.basename(H));s.getAsset(Or)||s.emitAsset(Or,W)})}else s.emitAsset($,j)}}}}})})}};var $o=a(require("path")),Ks=a(require("fs"));var Rt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let s=this.includeList||{};for(let r of Object.entries(s)){let[i,n]=r;if(n){if(!Ks.default.existsSync(n))return;let o=D(n),c=o?.js||[],p=o?.css||[],l=[...c,...p].filter(f=>!S(f,this.excludeList));if(e.options.mode==="development"){let f=$o.default.resolve(__dirname,"minimum-script-file.mjs");l.push(f)}Ks.default.existsSync(n)&&(S(n,this.excludeList)||(e.options.entry={...e.options.entry,[i]:{import:l}}))}}}};var qt=require("webpack");var Qs=a(require("fs")),Y=a(require("path")),L=a(require("parse5-utils"));function Co(t,e,s,r,i){let n=Qs.default.readFileSync(s,{encoding:"utf8"}),o=L.default.parse(n),c=!!t.getAsset(e+".css"),p=!1;for(let l of o.childNodes)if(l.nodeName==="html"){for(let f of l.childNodes){if((f.nodeName==="head"||f.nodeName==="body")&&Ie(f,({filePath:d,childNode:g,assetType:y})=>{let j=Y.default.dirname(s),$=Y.default.resolve(j,d),q=Zs($),U=S(Y.default.resolve(j,d),i),H=Y.default.join("/",Y.default.normalize(d)),Se=yi($,r);switch(y){case"script":{U?l=L.default.setAttribute(g,"src",H):(l=L.default.remove(g),p=!0);break}case"css":{U?l=L.default.setAttribute(g,"href",H):(l=L.default.remove(g),c=!0);break}case"staticHref":case"staticSrc":{if(U)l=L.default.setAttribute(g,y==="staticSrc"?"src":"href",H);else if(Se){let W=Po(r,$,q);l=L.default.setAttribute(g,y==="staticSrc"?"src":"href",W)}else{let W=Y.default.join("assets",Y.default.basename($,q));Qs.default.existsSync($)&&(l=L.default.setAttribute(g,y==="staticSrc"?"src":"href",Z(W,"",!0)))}break}default:break}}),f.nodeName==="head"&&c&&t.options.mode==="production"){let d=L.default.createNode("link");d.attrs=[{name:"rel",value:"stylesheet"},{name:"href",value:Z(e,".css",!0)}],L.default.append(f,d)}if(f.nodeName==="body"&&(p||t.options.mode!=="production")){let d=L.default.createNode("script");d.attrs=[{name:"src",value:Z(e,".js",!0)}],L.default.append(f,d)}}return L.default.serialize(o)}}var Nt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("html:update-html-file",s=>{s.hooks.processAssets.tap({name:"html:update-html-file",stage:qt.Compilation.PROCESS_ASSETS_STAGE_DERIVED},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[n,o]=i;if(o){let c=Co(s,n,o,r,this.excludeList||{});if(!S(o,this.excludeList)&&c){let p=new qt.sources.RawSource(c),l=Z(n,".html");s.updateAsset(l,p)}}}})})}};var Do=a(require("fs")),Lo=require("webpack");var Ut=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"html:add-to-file-dependencies",stage:Lo.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[,n]=i;if(n){let o=D(n),c=new Set(s.fileDependencies);if(Do.default.existsSync(n)){let p=[n,...o?.static||[]];for(let l of p)c.has(l)||(c.add(l),l===n&&s.fileDependencies.add(l))}}}})})}};var Fo=a(require("fs"));var Wt=class{manifestPath;includeList;initialHtmlAssets={};constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}hasEntriesChanged(e,s){if(!s||!e||e.length!==s.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==s[r])return!0;return!1}storeInitialHtmlAssets(e){Object.entries(e).forEach(([s,r])=>{let i=r;if(i){if(!Fo.default.existsSync(i)){let o=require(this.manifestPath).name||"Extension.js";console.error(ae(o,s,i)),process.exit(1)}this.initialHtmlAssets[i]={js:D(i)?.js||[],css:D(i)?.css||[]}}})}apply(e){let s=this.includeList||{};this.storeInitialHtmlAssets(s),e.hooks.make.tapAsync("html:throw-if-recompile-is-needed",(r,i)=>{let n=e.modifiedFiles||new Set,o=Array.from(n)[0];if(o&&this.initialHtmlAssets[o]){let c=D(o)?.js||[],p=D(o)?.css||[],{js:l,css:f}=this.initialHtmlAssets[o];if(this.hasEntriesChanged(p,f)||this.hasEntriesChanged(c,l)){let d=require(this.manifestPath).name;console.log(pi(d,o))}}i()})}};var Io=a(require("fs")),Ao=require("webpack");function Hp(t,e,s){let r="Module not found: Error: Can't resolve ",n=s.message.replace(r,"").split("'")[1];if(s.message.includes(r))for(let o of Object.entries(e)){let[,c]=o;if(c){if(!Io.default.existsSync(c))return null;let p=D(c),l=p?.js||[],f=p?.css||[];if(l.includes(n)||f.includes(n)){let d=Ze(require(t).name,c,n);return new Ao.WebpackError(d)}}}return null}var Bt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.compilation.tap("html:handle-common-errors",s=>{s.hooks.afterSeal.tapPromise("html:handle-common-errors",async()=>{s.errors.forEach((r,i)=>{let n=Hp(this.manifestPath,this.includeList||{},r);n&&(s.errors[i]=n)})})})}};var Jt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new At({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Tt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Rt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Nt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[er.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(er.default.join(__dirname,"ensure-hmr-for-scripts.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}}]}),new Ut({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Wt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Bt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var se=a(require("path"));var tr=a(require("fs")),Mo=a(require("path"));function Oo(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(i=>{let n=tr.default.existsSync(i)&&!S(i,e),o=Mo.default.extname(i);return n&&i.includes(o)})}function To(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(i=>tr.default.existsSync(i)&&!S(i,e)&&(i.endsWith(".css")||i.endsWith(".scss")||i.endsWith(".sass")||i.endsWith(".less")))}var zt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=this.includeList||{};for(let r of Object.entries(s)){let[i,n]=r,o=Oo(n,this.excludeList),c=To(n,this.excludeList),p=[...o];e.options.mode==="production"&&p.push(...c),(c.length||o.length)&&(e.options.entry={...e.options.entry,[i]:{import:p}})}}};var te=require("webpack"),Vp=['var isBrowser = !!(() => { try { return browser.runtime.getURL("/") } catch(e) {} })()','var isChrome = !!(() => { try { return chrome.runtime.getURL("/") } catch(e) {} })()'],Gp=[...Vp,`var runtime = isBrowser ? browser : isChrome ? chrome : (typeof self === 'object' && self.addEventListener) ? { get runtime() { throw new Error("No chrome or browser runtime found") } } : { runtime: { getURL: x => x } }`],Ht=class t{apply(e){let{RuntimeGlobals:s}=e.webpack;e.hooks.compilation.tap("PublicPathRuntimeModule",r=>{r.hooks.runtimeRequirementInTree.for(s.publicPath).tap(t.name,i=>{let n=Xp();return r.addRuntimeModule(i,n),!0})})}};function Xp(){class t extends te.RuntimeModule{constructor(){super("publicPath",te.RuntimeModule.STAGE_BASIC)}generate(){let s=this.compilation?.outputOptions.publicPath;return te.Template.asString([...Gp,`var path = ${JSON.stringify(this.compilation?.getPath(s||"",{hash:this.compilation.hash||"XXXX"}))}`,`${te.RuntimeGlobals.publicPath} = typeof importScripts === 'function' || !(isBrowser || isChrome) ? path : runtime.runtime.getURL(path);`])}}return new t}var Vt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=require(this.manifestPath);if(s.content_scripts?.some(r=>r.world&&r.world.toLowerCase()==="main")){if(s.id||(console.error(fi(s.name||"")),process.exit(1)),this.browser==="firefox"){e.options.output.publicPath=`moz-extension://${s.id}/`;return}e.options.output.publicPath=`${this.browser}-extension://${s.id}/`}}};var Gt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new zt({manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[se.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(se.default.join(__dirname,"inject-content-css-during-dev.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[se.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(se.default.join(__dirname,"add-hmr-accept-code.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="production"&&new Ht().apply(e),new Vt({manifestPath:this.manifestPath,browser:this.browser||"chrome",includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[se.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:se.default.resolve(__dirname,"./add-query-param-to-imported-css.js"),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]})}};var rr=a(require("path")),Me=a(require("fs")),ir=a(require("webpack")),Oe=require("webpack");var be=a(require("path")),Xt=a(require("fs"));function sr(t){let e=be.default.join(be.default.dirname(t),"_locales"),s=[];if(Xt.default.existsSync(e))for(let r of Xt.default.readdirSync(e)){let i=be.default.join(e,r);for(let n of Xt.default.readdirSync(i))s.push(be.default.join(be.default.dirname(t),"_locales",r,n))}return s}var Zt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:Oe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let i=require(this.manifestPath).name||"Extension.js";if(!Me.default.existsSync(this.manifestPath)){s.errors.push(new ir.default.WebpackError(ti(i)));return}if(s.errors.length>0)return;let n=sr(this.manifestPath);for(let o of Object.entries(n||[])){let[c,p]=o,l=p;if(l){if(!Me.default.existsSync(l)){s.warnings.push(new ir.default.WebpackError(Ye(i,c,l)));return}let f=Me.default.readFileSync(l),d=new Oe.sources.RawSource(f),g=e.options.context||rr.default.dirname(this.manifestPath);if(!S(l,this.excludeList)){let y=rr.default.relative(g,l);s.emitAsset(y,d)}}}})}),e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:Oe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=sr(this.manifestPath);for(let i of Object.entries(r||[])){let[,n]=i;if(n){let o=new Set(s.fileDependencies),c=r||[];for(let p of c)Me.default.existsSync(p)&&(o.has(p)||(o.add(p),s.fileDependencies.add(p)))}}})})}};var Yt=a(require("fs")),Ro=a(require("webpack")),Te=require("webpack");var Kt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:Te.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[n,o]=i,c=Array.isArray(o)?o:[o];for(let p of c)if(p&&!S(p,this.excludeList)){if(!Yt.default.existsSync(p)){let g=require(this.manifestPath).name||"Extension.js";s.warnings.push(new Ro.default.WebpackError(Ye(g,n,p)));return}let l=Yt.default.readFileSync(p),f=new Te.sources.RawSource(l);s.emitAsset(n+".json",f)}}})}),e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:Te.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[,n]=i,o=Array.isArray(n)?n:[n];for(let c of o)if(c){let p=new Set(s.fileDependencies);S(c,this.excludeList)||Yt.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var nr=a(require("fs")),No=a(require("path")),es=require("webpack");var Qt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:emit-file",s=>{s.hooks.processAssets.tap({name:"icons:emit-file",stage:es.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[n,o]=i;if(o===void 0)continue;let c=Array.isArray(o)?typeof o[0]=="string"?o:o.map(Object.values).flat():[o];for(let p of c)if(p){if(!nr.default.existsSync(p))continue;if(!S(p,this.excludeList)){let l=nr.default.readFileSync(p),f=new es.sources.RawSource(l),d=No.default.basename(p),y=`${n.endsWith("theme_icons")?n.replace("theme_icons",""):n}/${d}`;s.emitAsset(y,f)}}}})})}};var qo=a(require("fs")),Uo=require("webpack"),ts=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"icons:add-to-file-dependencies",stage:Uo.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[,n]=i,o=Array.isArray(n)?typeof n[0]=="string"?n:n.map(Object.values).flat():[n];for(let c of o)if(c){let p=new Set(s.fileDependencies);qo.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var ss=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Qt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new ts({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var is=require("webpack");var rs=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}generateManifestPatches(e,s){let r=G(e,this.manifestPath),i=r.web_accessible_resources||[],n=r.web_accessible_resources||[];for(let[p,l]of Object.entries(s)){let f=r.content_scripts?.find(d=>d.js&&d.js.some(g=>g.includes(p)));if(f){let d=f.matches||[];if(r.manifest_version===3){let g=i.find(y=>y.matches.some(j=>d.includes(j)));g?l.forEach(y=>{g.resources.includes(y)||g.resources.push(y)}):i.push({resources:l.filter(y=>!y.endsWith(".map")),matches:d})}else l.forEach(g=>{n.includes(g)||n.push(g)})}}r.manifest_version===3?r.web_accessible_resources=i:r.web_accessible_resources=Array.from(new Set(n));let o=JSON.stringify(r,null,2),c=new is.sources.RawSource(o);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",c)}apply(e){e.hooks.thisCompilation.tap("plugin-extension:feature-web-resources",s=>{s.hooks.processAssets.tap({name:"plugin-extension:feature-web-resources",stage:is.Compilation.PROCESS_ASSETS_STAGE_ANALYSE},()=>{let r=[],i=Object.keys(this.includeList||{});for(let c of i.filter(Boolean))c.startsWith("content_scripts")&&(Array.isArray(c)?r.push(...c):typeof c=="string"&&r.push(c));let n=s.chunkGraph,o={};s.entrypoints.forEach((c,p)=>{if(r.includes(p)){let l=[];c.chunks.forEach(f=>{Array.from(n.getChunkModulesIterable(f)).forEach(g=>{n.getModuleChunks(g).forEach(y=>{y.auxiliaryFiles.forEach(j=>{l.includes(j)||l.push(j)})})})}),o[p]=l}}),this.generateManifestPatches(s,o)})})}};var F=a(require("fs")),I=a(require("path")),Wo=a(require("chokidar")),ns=class{options;constructor(e){this.options=e}ensureDirectoryExistence(e){let s=I.default.dirname(e);if(F.default.existsSync(s))return!0;F.default.mkdirSync(s,{recursive:!0})}copyFile(e,s){this.ensureDirectoryExistence(s),F.default.copyFileSync(e,s)}copyFolder(e,s){F.default.existsSync(s)||F.default.mkdirSync(s,{recursive:!0}),F.default.readdirSync(e).forEach(i=>{let n=I.default.join(e,i),o=I.default.join(s,i);F.default.statSync(n).isDirectory()?this.copyFolder(n,o):this.copyFile(n,o)})}apply(e){let s=I.default.dirname(this.options.manifestPath),r=I.default.join(s,"public"),i=e.options.output?.path||"";F.default.existsSync(r)&&(e.hooks.afterEmit.tap("special-folders:copy-public-folder",()=>{let n=I.default.join(i,"public");F.default.existsSync(n)||F.default.mkdirSync(n,{recursive:!0}),F.default.existsSync(r)&&this.copyFolder(r,n)}),e.options.mode!=="production"&&e.hooks.afterPlugins.tap("special-folders:copy-public-folder",()=>{let n=I.default.join(s,"public"),o=Wo.default.watch(n,{ignoreInitial:!0});o.on("add",c=>{let p=I.default.join(i,I.default.relative(s,c));this.copyFile(c,p)}),o.on("change",c=>{let p=I.default.join(i,I.default.relative(s,c));this.copyFile(c,p)}),o.on("unlink",c=>{let p=I.default.join(i,I.default.relative(s,c));F.default.existsSync(p)&&F.default.unlinkSync(p)}),e.hooks.watchClose.tap("special-folders:copy-public-folder",()=>{o.close().catch(console.error)})}))}};var N=a(require("path")),or=a(require("chokidar"));var os=class{manifestPath;constructor(e){this.manifestPath=e}throwCompilationError(e,s,r){let i=N.relative(process.cwd(),s),p=ii(r?"Adding":"Removing",r?"added":"removed",e,e==="pages"?"HTML pages":"script files",i);if(r){console.warn(p);return}console.error(p),process.exit(1)}apply(e){e.hooks.afterPlugins.tap("special-folders:warn-upon-folder-changes",()=>{let s=N.dirname(this.manifestPath),r=N.join(s,"pages"),i=N.join(s,"scripts"),n=or.watch(r,{ignoreInitial:!0}),o=or.watch(i,{ignoreInitial:!0}),c=e.options.resolve?.extensions;n.on("add",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p,!0)}),n.on("unlink",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p)}),o.on("add",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p,!0)}),o.on("unlink",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p)}),e.hooks.watchClose.tap("WarnUponFolderChanges",()=>{n.close().catch(console.error),o.close().catch(console.error)})})}};var as=class{static name="plugin-special-folders";options;constructor(e){this.options=e}apply(e){let{manifestPath:s}=this.options;new ns({manifestPath:s}).apply(e),e.options.mode==="development"&&e.options.watchOptions&&new os(s).apply(e)}};var cs=class{static name="plugin-extension";manifestPath;browser;mode;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.mode=e.mode}apply(e){let s=this.manifestPath,r=An({manifestPath:s}),i=Mn({manifestPath:s});new xt({manifestPath:s,includeList:{...i?.pages||{},...i?.scripts||{}},excludeList:i.public,loaderOptions:{jsx:me(Re.default.dirname(this.manifestPath))||X(Re.default.dirname(this.manifestPath))||Ce(Re.default.dirname(this.manifestPath)),typescript:R(Re.default.dirname(this.manifestPath)),minify:this.mode==="production"}}).apply(e),new Ft({browser:this.browser,manifestPath:s,includeList:{...r.html,...r.icons,...r.json,...r.scripts},excludeList:i.public}).apply(e),new Jt({manifestPath:s,includeList:{...r.html,...i.pages},excludeList:{...i.public,...i.scripts}}).apply(e),new Gt({manifestPath:s,browser:this.browser,includeList:{...r.scripts,...i.scripts},excludeList:{...i.public,...i.pages}}).apply(e),new Zt({manifestPath:s}).apply(e),new Kt({manifestPath:s,includeList:r.json,excludeList:i.public}).apply(e),new ss({manifestPath:s,includeList:r.icons,excludeList:i.public}).apply(e),new rs({manifestPath:s,includeList:{...r.scripts,...i.scripts},excludeList:i.public}).apply(e),new as({manifestPath:s}).apply(e)}};var We=a(require("path"));var Bo=a(require("path")),Jo=a(require("ws")),ls=a(require("browser-extension-manifest-fields"));function ps(t,e){t.clients.forEach(s=>{s.readyState===Jo.default.OPEN&&s.send(JSON.stringify(e))})}function zo(t,e,s){if(!s||!e)return;let r=(0,ls.default)(e).locales,i=(0,ls.default)(e).scripts,n=(0,ls.default)(e).json;if(!t){process.env.EXTENSION_ENV==="development"&&console.error("WebSocket server is not running.");return}Bo.default.basename(s)==="manifest.json"&&ps(t,{changedFile:"manifest.json"}),r?.forEach(o=>{o.includes(s)&&ps(t,{changedFile:"_locales"})}),Object.entries(i).forEach(([o,c])=>{let p=Array.isArray(c)?c:[c];Object.values(p).flatMap(f=>f).includes(s)&&o==="background/service_worker"&&ps(t,{changedFile:"service_worker"})}),Object.entries(n).forEach(([o,c])=>{c?.includes(s)&&o==="declarative_net_request"&&ps(t,{changedFile:"declarative_net_request"})})}var cr=a(require("path")),Xo=a(require("fs")),Zo=a(require("ws"));var Ne=a(require("path")),Vo=a(require("https")),ar=a(require("fs"));var Ho=t=>{if(!ar.default.existsSync(t))return;let e=Ne.default.basename(t);return ar.default.readFileSync(Ne.default.join(__dirname,"certs",e))};function Go(t,e){let s={key:Ho(Ne.default.join(__dirname,"certs","localhost.key")),cert:Ho(Ne.default.join(__dirname,"certs","localhost.cert"))},r=Vo.default.createServer(s,(i,n)=>{n.writeHead(200),n.end()});return r.listen(e,"127.0.0.1"),r.on("error",i=>{throw console.error(ui(t,e)),new Error(i.message)}),{server:r,port:e}}function Zp(t){return new Promise(e=>{let s=require("net").createServer();s.once("error",function(r){r.code==="EADDRINUSE"?e(!0):e(!1)}),s.once("listening",function(){s.close(),e(!1)}),s.listen(t)})}var qe=null;async function Yo(t,e){let s=t.options.context||"",r=require(cr.default.join(s,"manifest.json")),i=r.name||"Extension.js",n=e.port||8e3,o=await Zp(n);if(!qe&&!o){let{server:c}=Go(i,n);qe=new Zo.default.Server({server:c}),console.log(`WebSocket server started on port ${n}`),qe.on("connection",p=>{p.send(JSON.stringify({status:"serverReady"})),p.on("error",l=>{console.log(ai(i,l))}),p.on("message",l=>{let f=JSON.parse(l.toString());if(f.status==="clientReady"){let d=require(cr.default.join(s,"manifest.json"));console.log(Rs(d,f)),console.log(""),Ws(e.browser)&&setTimeout(()=>{console.log(oi(e.browser))},5e3)}})})}else if(!qe)return;if(e.browser==="firefox"&&!o&&!Xo.default.existsSync(Xe)){let c=bi(r);console.log(Rs(r,c)),console.log(""),Ws("firefox")&&(console.log(li()),console.log(""))}return qe}var pr=a(require("path")),Ue=a(require("fs"));function Ko(t){let e=pr.default.resolve(__dirname,"./extensions/manager-extension/reload-service.js"),s=pr.default.resolve(__dirname,"./extensions/manager-extension-firefox/reload-service.js");Ue.default.readFile(e,"utf8",(r,i)=>{if(r){console.error(`Error reading file: ${r.message}`);return}let n=i.replace(/__RELOAD_PORT__/g,t.toString());Ue.default.writeFile(e,n,"utf8",o=>{o&&console.error(`Error writing to file: ${o.message}`)})}),Ue.default.readFile(s,"utf8",(r,i)=>{if(r){console.error(`Error reading file: ${r.message}`);return}let n=i.replace(/__RELOAD_PORT__/g,t.toString());Ue.default.writeFile(s,n,"utf8",o=>{o&&console.error(`Error writing to file: ${o.message}`)})})}process.on("SIGINT",()=>{process.exit()});process.on("SIGTERM",()=>{process.exit()});var Be=class{manifestPath;port;browser;stats;constructor(e){this.manifestPath=e.manifestPath,this.port=e.port||8e3,this.browser=e.browser||"chrome",this.stats=e.stats}async apply(e){if(!this.manifestPath)return;Ko(this.port);let s=await Yo(e,{...this,mode:e.options.mode,browser:this.browser,stats:this.stats,port:this.port});e.hooks.watchRun.tapAsync("reload:create-web-socket-server",(r,i)=>{let o=(r.modifiedFiles||new Set).values().next().value;if(!o){i();return}let c=We.default.relative(We.default.dirname(this.manifestPath),o),p=We.default.relative(process.cwd(),We.default.dirname(o));process.env.EXTENSION_ENV==="development"&&console.info(`\u25BA\u25BA Updated file \`${c}\` (relative to ${p})`),this.manifestPath&&zo(s,this.manifestPath,o),i()})}};var lr=a(require("path"));function ur(t,e){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[lr.default.dirname(e)],exclude:/node_modules/,use:[{loader:lr.default.resolve(__dirname,"./inject-chromium-client-loader"),options:{manifestPath:e}}]})}var fr=a(require("path"));function mr(t,e){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[fr.default.dirname(e)],exclude:/node_modules/,use:[{loader:fr.default.resolve(__dirname,"./inject-firefox-client-loader"),options:{manifestPath:e}}]})}var us=require("webpack");var dr=a(require("content-security-policy-parser"));function Qo(t){let e=t.content_security_policy;if(!e)return"script-src 'self' 'unsafe-eval' blob: filesystem:; object-src 'self' blob: filesystem:; ";let s=(0,dr.default)(e);e="",s.get("script-src")||s.set("script-src",["'self' 'unsafe-eval' blob: filesystem:"]),s.get("script-src")?.includes("'unsafe-eval'")||s.set("script-src",["unsafe-eval"]);for(let r in s)e+=`${r} ${s.get(r)?.join(" ")};`;return e}function ea(t){let e=t.content_security_policy;if(!e)return{extension_pages:"script-src 'self'; object-src 'self'; "};let s=(0,dr.default)(e.extension_pages||""),r="";for(let i in s)r+=`${i} ${s.get(i)?.join(" ")}; `;return{extension_pages:r.trim()}}function ta(t){let e=["/*.json","/*.js","/*.css"],s=t.web_accessible_resources;if(!s||s.length===0)return e;let r=new Set(s);for(let i of e)r.has(i)||r.add(i);return Array.from(r)}function sa(t){let e=["/*.json","/*.js","/*.css"];return[...t.web_accessible_resources||[],{resources:e,matches:["<all_urls>"]}]}function gr(t,e){return t.background?{background:{...t.background}}:e==="firefox"?{background:{...t.background||{},scripts:["background/script.js"]}}:t.manifest_version===2?{background:{...t.background||{},scripts:["background/script.js"]}}:{background:{...t.background||{},service_worker:"background/service_worker.js"}}}function hr(t){return t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:[...new Set(t.externally_connectable.ids||[]),"*"]}}:t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:["*"]}}:{}}var yr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}generateManifestPatches(e){let s=G(e,this.manifestPath),r={...s,content_security_policy:s.manifest_version===3?ea(s):Qo(s),...s.manifest_version===3?s.permissions?{permissions:[...new Set(["scripting",...s.permissions])]}:{permissions:["scripting"]}:{},...gr(s,this.browser),...hr(s),web_accessible_resources:s.manifest_version===3?sa(s):ta(s)},i=JSON.stringify(r,null,2),n=new us.sources.RawSource(i);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",n)}apply(e){e.hooks.thisCompilation.tap("run-chromium:apply-manifest-dev-defaults",s=>{s.hooks.processAssets.tap({name:"run-chromium:apply-manifest-dev-defaults",stage:us.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},r=>{if(!this.manifestPath){let i="No manifest.json found in your extension bundle. Unable to patch manifest.json.";s&&e.webpack.WebpackError&&s.errors.push(new e.webpack.WebpackError(`run-chromium: ${i}`));return}this.generateManifestPatches(s)})})}},ra=yr;var br=a(require("fs")),we=a(require("path")),ia=a(require("webpack-target-webextension"));var wr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}handleBackground(e,s,r){let i=we.default.resolve(__dirname,s==="firefox"?"minimum-firefox-file.mjs":"minimum-chromium-file.mjs"),n=we.default.dirname(this.manifestPath),o=r.background;if(s==="firefox"){o=r["gecko:background"]||r["firefox:background"]||o;let c=o?.scripts||o?.["gecko:scripts"]||o?.["firefox:scripts"];if(c&&c.length>0){let p=we.default.join(n,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",i)}else if(o=r["chromium:background"]||r["chrome:background"]||r["edge:background"]||o,r.manifest_version===3){let c=o?.service_worker||o?.["chromium:service_worker"]||o?.["chrome:service_worker"]||o?.["edge:service_worker"];if(c){let p=we.default.join(n,c);this.ensureFileExists(p,"background.service_worker")}else this.addDefaultEntry(e,"background/service_worker",i)}else if(r.manifest_version===2){let c=o?.scripts||o?.["chromium:scripts"]||o?.["chrome:scripts"]||o?.["edge:scripts"];if(c&&c.length>0){let p=we.default.join(n,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",i)}}ensureFileExists(e,s){if(!br.default.existsSync(e)&&this.manifestPath){let i=require(this.manifestPath).name||"Extension.js",n=ci(i,s,e);throw console.error(n),new Error(n)}}addDefaultEntry(e,s,r){e.options.entry={...e.options.entry,[s]:{import:[r]}}}getEntryName(e){if(e.background){if(e.manifest_version===3)return{serviceWorkerEntry:"background/service_worker"};if(e.manifest_version===2)return{pageEntry:"background/script"}}return{pageEntry:"background"}}apply(e){if(!this.manifestPath||!br.default.lstatSync(this.manifestPath).isFile())return;let s=require(this.manifestPath);this.handleBackground(e,this.browser,s),new ia.default({background:this.getEntryName(s),weakRuntimeCheck:!0}).apply(e)}},na=wr;var xr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){(this.browser==="chrome"||this.browser==="edge")&&ur(e,this.manifestPath),this.browser==="firefox"&&mr(e,this.manifestPath),new ra({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new na({manifestPath:this.manifestPath,browser:this.browser}).apply(e)}},oa=xr;var fs=class{static name="plugin-reload";manifestPath;browser;port;stats;autoReload;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.port=e.port,this.stats=e.stats,this.autoReload=e.autoReload}apply(e){e.options.mode==="development"&&new Be({manifestPath:this.manifestPath,browser:this.browser,port:this.port,stats:this.stats}).apply(e),e.options.mode==="development"&&new oa({manifestPath:this.manifestPath,browser:this.browser,autoReload:this.autoReload,stats:this.stats}).apply(e)}};var aa=a(require("webpack")),ms=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser}apply(e){new aa.default.ProvidePlugin({browser:require.resolve("webextension-polyfill")}).apply(e)}};var gs=require("webpack");var ds=class{browser;manifestPath;chromiumBasedBrowsers=["chrome","edge","opera","brave"];constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}patchManifest(e){let s=this.chromiumBasedBrowsers,r=this.browser,i=JSON.parse(JSON.stringify(e),function(o,c){let p=o.indexOf(":");if(p===-1)return c;let l=o.substring(0,p);(l===r||l==="chromium"&&s.includes(r))&&(this[o.substring(p+1)]=c)});return JSON.stringify(i,null,2)}apply(e){e.hooks.compilation.tap("compatibility:browser-fields",s=>{s.hooks.processAssets.tap({name:"compatibility:browser-fields",stage:gs.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE},()=>{let r=G(s,this.manifestPath),i=this.patchManifest(r),n=new gs.sources.RawSource(i);s.updateAsset("manifest.json",n)})})}};var hs=class{static name="plugin-compatibility";manifestPath;browser;polyfill;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.polyfill=e.polyfill||!1}async apply(e){this.polyfill&&this.browser!=="firefox"&&new ms({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new ds({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e)}};var ba=a(require("fs"));var ca=a(require("webpack")),pa=a(require("content-security-policy-parser"));function la(t){let e=t.content_security_policy,s=t.content_security_policy?.extension_pages,r=i=>{if(!i)return;let n=(0,pa.default)(i);if(n.get("script-src")&&n.get("script-src")?.includes("'unsafe-eval'")){let o=t.name||"Extension.js";return Hr(o)}};if(t.manifest_version===3){let i=e?r(s):void 0;if(i)return new ca.default.WebpackError(i)}return null}var vr=a(require("webpack"));function ua(t,e){let s=t.web_accessible_resources;if(s){let r=s.some(o=>typeof o=="string"),i=s.some(o=>typeof o=="object"||o.resources||o.matches),n=t.name||"Extension.js";if(t.manifest_version===2&&!r)return new vr.default.WebpackError(Gr(n,e));if(t.manifest_version===3&&!i)return new vr.default.WebpackError(Xr(n,e))}return null}var fa=a(require("webpack"));function ma(t,e){if(e==="firefox"&&t.background?.service_worker){let s=t.name||"Extension.js";return new fa.default.WebpackError(zr(s))}return null}var da=a(require("path")),ga=a(require("fs")),ha=a(require("webpack"));function ya(t,e){let s=da.default.join(e.options.context||"","_locales"),r=t.name||"Extension.js";return ga.default.existsSync(s)&&!t.default_locale?new ha.default.WebpackError(Vr(r)):null}var ys=class{options;constructor(e){this.options=e}handleRuntimeErrors(e,s,r){let i=la(s),n=ua(s,r),o=ma(s,r),c=ya(s,e);i&&e.errors.push(i),n&&e.errors.push(n),o&&e.options.mode==="production"&&e.errors.push(o),c&&e.errors.push(c)}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let i=this.options.manifestPath,n=JSON.parse(ba.default.readFileSync(i,"utf-8")),o=this.options.browser||"chrome";this.handleRuntimeErrors(s,n,o),r()})}};var Ca=a(require("fs")),Da=a(require("ajv"));var wa={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://json.schemastore.org/chrome-manifest.json",additionalProperties:!0,definitions:{action_v2:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{anyOf:[{type:"string",description:"FIXME: String form is deprecated."},{type:"object",description:"Icon for the main toolbar.",properties:{"19":{$ref:"#/definitions/icon"},"38":{$ref:"#/definitions/icon"}}}]}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},action_v3:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{type:"object",properties:{"16":{$ref:"#/definitions/icon"},"24":{$ref:"#/definitions/icon"},"32":{$ref:"#/definitions/icon"}}}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},command:{type:"object",if:{$comment:"Global shortcuts change the acceptable pattern for the suggested_key.",properties:{global:{const:!0}},required:["global"]},then:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl)\\+Shift\\+[0-9]"}}}}},else:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl|Alt|Option)\\+(Shift\\+)?[A-Z]"}}}}}},content_security_policy:{type:"string",description:"This introduces some fairly strict policies that will make extensions more secure by default, and provides you with the ability to create and enforce rules governing the types of content that can be loaded and executed by your extensions and applications.",format:"content-security-policy",default:"script-src 'self'; object-src 'self'"},glob_pattern:{type:"string",format:"glob-pattern"},icon:{$ref:"#/definitions/uri"},match_pattern:{type:"string",format:"match-pattern",pattern:"^((\\*|http|https|file|ftp|chrome-extension):\\/\\/(\\*|\\*\\.[^\\/\\*]+|[^\\/\\*]+)?(\\/.*))|urn:(\\*|.*)|<all_urls>$"},mime_type:{type:"string",format:"mime-type",pattern:"^(?:application|audio|image|message|model|multipart|text|video)\\/[-+.\\w]+$"},page:{$ref:"#/definitions/uri"},permissions:{type:"array",uniqueItems:!0,items:{type:"string",format:"permission"}},scripts:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}},uri:{type:"string"},version_string:{type:"string",pattern:"^(?:\\d{1,5}\\.){0,3}\\d{1,5}$"},web_resource:{type:"object",required:["resources"],properties:{resources:{type:"array",description:`An array of resources to be exposed. Resources are specified as strings and may contain * for wildcard matches. For example, "/images/*" exposes everything in the extension's /images directory recursively while "*.png" exposes all PNG files.`,items:{$ref:"#/definitions/glob_pattern"}},matches:{type:"array",description:"A list of URL match patterns specifying which pages can access the resources. Only the origin is used to match URLs; subdomains patterns (*.google.com) and paths are ignored.",items:{$ref:"#/definitions/match_pattern"}},extension_ids:{type:"array",description:"A list of extension IDs, specifying which extensions can access the resources.",items:{type:"string"}},use_dynamic_url:{type:"boolean",description:"If true, only allow resources to be accessible through dynamic ID. The dynamic ID is generated per session. It's regenerated on browser restart or extension reload."}}}},dependencies:{content_scripts:{not:{required:["script_badge"]}},script_badge:{not:{required:["content_scripts"]}}},else:{properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{persistent:{type:"boolean",description:"When false, makes the background page an event page (loaded only when needed).",default:!0},page:{$ref:"#/definitions/page",description:"Specify the HTML of the background page.",default:"background.html"},scripts:{$ref:"#/definitions/scripts",description:"A background page will be generated by the extension system that includes each of the files listed in the scripts property.",default:["background.js"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},browser_action:{$ref:"#/definitions/action_v2",description:"Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup."},page_action:{$ref:"#/definitions/action_v2",description:"Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages."},content_security_policy:{$ref:"#/definitions/content_security_policy"},web_accessible_resources:{type:"array",description:"An array of strings specifying the paths (relative to the package root) of packaged resources that are expected to be usable in the context of a web page.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}}},dependencies:{page_action:{not:{required:["browser_action"]}},browser_action:{not:{required:["page_action"]}}}},if:{properties:{manifest_version:{const:3}}},properties:{manifest_version:{type:"number",description:"One integer specifying the version of the manifest file format your package requires.",enum:[2,3]},name:{type:"string",description:"The name of the extension",maxLength:45},version:{$ref:"#/definitions/version_string",description:"One to four dot-separated integers identifying the version of this extension."},default_locale:{type:"string",description:"Specifies the subdirectory of _locales that contains the default strings for this extension.",default:"en"},description:{type:"string",description:"A plain text description of the extension",maxLength:132},icons:{type:"object",description:"One or more icons that represent the extension, app, or theme. Recommended format: PNG; also BMP, GIF, ICO, JPEG.",minProperties:1,properties:{"16":{$ref:"#/definitions/icon",description:"Used as the favicon for an extension's pages and infobar."},"48":{$ref:"#/definitions/icon",description:"Used on the extension management page (chrome://extensions)."},"128":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."},"256":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."}}},chrome_url_overrides:{type:"object",description:"Override pages are a way to substitute an HTML file from your extension for a page that Google Chrome normally provides.",additionalProperties:!1,maxProperties:1,properties:{bookmarks:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the Bookmark Manager menu item from the Chrome menu or, on Mac, the Bookmark Manager item from the Bookmarks menu. You can also get to this page by entering the URL chrome://bookmarks.",default:"bookmarks.html"},history:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the History menu item from the Chrome menu or, on Mac, the Show Full History item from the History menu. You can also get to this page by entering the URL chrome://history.",default:"history.html"},newtab:{$ref:"#/definitions/page",description:"The page that appears when the user creates a new tab or window. You can also get to this page by entering the URL chrome://newtab.",default:"newtab.html"}}},commands:{type:"object",description:"Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.",patternProperties:{".*":{$ref:"#/definitions/command"},"^_execute_browser_action$":{$ref:"#/definitions/command"},"^_execute_page_action$":{$ref:"#/definitions/command"}}},content_scripts:{type:"array",description:"Content scripts are JavaScript files that run in the context of web pages.",minItems:1,uniqueItems:!0,items:{type:"object",required:["matches"],additionalProperties:!1,properties:{matches:{type:"array",description:"Specifies which pages this content script will be injected into.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},exclude_matches:{type:"array",description:"Excludes pages that this content script would otherwise be injected into.",uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},css:{type:"array",description:"The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.",uniqueItems:!0,items:{$ref:"#/definitions/uri"}},js:{$ref:"#/definitions/scripts",description:"The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array."},world:{type:"string",description:"The JavaScript world for a script to execute within.",enum:["ISOLATED","MAIN"],default:"ISOLATED"},run_at:{type:"string",description:"Controls when the files in js are injected.",enum:["document_start","document_end","document_idle"],default:"document_idle"},all_frames:{type:"boolean",description:"Controls whether the content script runs in all frames of the matching page, or only the top frame.",default:!1},include_globs:{type:"array",description:"Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},exclude_globs:{type:"array",description:"Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},match_about_blank:{type:"boolean",description:"Whether to insert the content script on about:blank and about:srcdoc.",default:!1}}}},devtools_page:{$ref:"#/definitions/page",description:"A DevTools extension adds functionality to the Chrome DevTools. It can add new UI panels and sidebars, interact with the inspected page, get information about network requests, and more."},externally_connectable:{description:"Declares which extensions, apps, and web pages can connect to your extension via runtime.connect and runtime.sendMessage.",type:"object",additionalProperties:!1,properties:{ids:{type:"array",items:{type:"string",description:"The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no extensions or apps can connect."}},matches:{type:"array",items:{type:"string",description:"The URL patterns for web pages that are allowed to connect. This does not affect content scripts. If left empty or unspecified, no web pages can connect."}},accepts_tls_channel_id:{type:"boolean",default:!1,description:"Indicates that the extension would like to make use of the TLS channel ID of the web page connecting to it. The web page must also opt to send the TLS channel ID to the extension via setting includeTlsChannelId to true in runtime.connect's connectInfo or runtime.sendMessage's options."}}},file_browser_handlers:{type:"array",description:"You can use this API to enable users to upload files to your website.",minItems:1,items:{type:"object",required:["id","default_title","file_filters"],additionalProperties:!1,properties:{id:{type:"string",description:"Used by event handling code to differentiate between multiple file handlers"},default_title:{type:"string",description:"What the button will display."},file_filters:{type:"array",description:"Filetypes to match.",minItems:1,items:{type:"string"}}}}},homepage_url:{$ref:"#/definitions/uri",description:"The URL of the homepage for this extension."},incognito:{type:"string",description:"Specify how this extension will behave if allowed to run in incognito mode.",enum:["spanning","split","not_allowed"],default:"spanning"},input_components:{type:"array",description:"Allows your extension to handle keystrokes, set the composition, and manage the candidate window.",items:{type:"object",required:["name","type","id","description","language","layouts"],additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"},id:{type:"string"},description:{type:"string"},language:{type:"string"},layouts:{type:"array"}}}},key:{type:"string",description:"This value can be used to control the unique ID of an extension, app, or theme when it is loaded during development."},minimum_chrome_version:{$ref:"#/definitions/version_string",description:"The version of Chrome that your extension, app, or theme requires, if any."},nacl_modules:{type:"array",description:"One or more mappings from MIME types to the Native Client module that handles each type.",minItems:1,uniqueItems:!0,items:{type:"object",required:["path","mime_type"],additionalProperties:!1,properties:{path:{$ref:"#/definitions/uri",description:"The location of a Native Client manifest (a .nmf file) within the extension directory."},mime_type:{$ref:"#/definitions/mime_type",description:"The MIME type for which the Native Client module will be registered as content handler."}}}},oauth2:{type:"object",description:"Use the Chrome Identity API to authenticate users: the getAuthToken for users logged into their Google Account and the launchWebAuthFlow for users logged into a non-Google account.",required:["client_id","scopes"],additionalProperties:!1,properties:{client_id:{type:"string",description:"You need to register your app in the Google APIs Console to get the client ID."},scopes:{type:"array",minItems:1,items:{type:"string"}}}},offline_enabled:{type:"boolean",description:"Whether the app or extension is expected to work offline. When Chrome detects that it is offline, apps with this field set to true will be highlighted on the New Tab page."},omnibox:{type:"object",description:"The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.",required:["keyword"],additionalProperties:!1,properties:{keyword:{type:"string",description:"The keyword that will trigger your extension."}}},optional_permissions:{$ref:"#/definitions/permissions",description:"Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary."},options_page:{$ref:"#/definitions/page",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, a link to it will be provided from the extensions management page at chrome://extensions. Clicking the Options link opens a new tab pointing at your options page.",default:"options.html"},options_ui:{type:"object",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, an Options link will be shown on the extensions management page at chrome://extensions which opens a dialogue containing your options page.",required:["page"],properties:{page:{type:"string",description:"The path to your options page, relative to your extension's root."},chrome_style:{type:"boolean",default:!0,description:"If true, a Chrome user agent stylesheet will be applied to your options page. The default value is false, but we recommend you enable it for a consistent UI with Chrome."},open_in_tab:{type:"boolean",default:!1,description:"If true, your extension's options page will be opened in a new tab rather than embedded in chrome://extensions. The default is false, and we recommend that you don't change it. This is only useful to delay the inevitable deprecation of the old options UI! It will be removed soon, so try not to use it. It will break."}}},permissions:{$ref:"#/definitions/permissions",description:"Permissions help to limit damage if your extension or app is compromised by malware. Some permissions are also displayed to users before installation, as detailed in Permission Warnings."},requirements:{type:"object",description:"Technologies required by the app or extension. Hosting sites such as the Chrome Web Store may use this list to dissuade users from installing apps or extensions that will not work on their computer.",additionalProperties:!1,properties:{plugins:{type:"object",description:"Indicates if an app or extension requires NPAPI to run. This requirement is enabled by default when the manifest includes the 'plugins' field.",required:["npapi"],additionalProperties:!1,properties:{npapi:{type:"boolean",default:!0}}},"3D":{type:"object",description:"The '3D' requirement denotes GPU hardware acceleration.",required:["features"],additionalProperties:!1,properties:{features:{type:"array",description:"List of the 3D-related features your app requires.",minItems:1,uniqueItems:!0,items:{type:"string",enum:["webgl"]}}}}}},sandbox:{type:"object",description:"Defines an collection of app or extension pages that are to be served in a sandboxed unique origin, and optionally a Content Security Policy to use with them.",required:["pages"],additionalProperties:!1,properties:{pages:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/page"}},content_security_policy:{$ref:"#/definitions/content_security_policy",default:"sandbox allow-scripts allow-forms"}}},short_name:{type:"string",description:"The short name is typically used where there is insufficient space to display the full name.",maxLength:12},update_url:{$ref:"#/definitions/uri",description:"If you publish using the Chrome Developer Dashboard, ignore this field. If you host your own extension or app: URL to an update manifest XML file."},tts_engine:{type:"object",description:"Register itself as a speech engine.",required:["voices"],additionalProperties:!1,properties:{voices:{type:"array",description:"Voices the extension can synthesize.",minItems:1,uniqueItems:!0,items:{type:"object",required:["voice_name","event_types"],additionalProperties:!1,properties:{voice_name:{type:"string",description:"Identifies the name of the voice and the engine used."},lang:{type:"string",description:"Almost always, a voice can synthesize speech in just a single language. When an engine supports more than one language, it can easily register a separate voice for each language."},gender:{type:"string",description:"If your voice corresponds to a male or female voice, you can use this parameter to help clients choose the most appropriate voice for their application."},event_types:{type:"array",description:"Events sent to update the client on the progress of speech synthesis.",minItems:1,uniqueItems:!0,items:{type:"string",description:"",enum:["start","word","sentence","marker","end","error"]}}}}}}},version_name:{type:"string",description:"In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version string and will be used for display purposes if present."},chrome_settings_overrides:{},content_pack:{},current_locale:{},import:{},platforms:{},signature:{},spellcheck:{},storage:{},system_indicator:{}},required:["manifest_version","name","version"],then:{$comment:"browser_action and page_action are no longer present in v3",properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{service_worker:{type:"string",description:"The service worker js file."},type:{type:"string",enum:["module"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},host_permissions:{$ref:"#/definitions/permissions"},action:{$ref:"#/definitions/action_v3",description:"Used to control the toolbar button for your extension in Chrome's UI."},content_security_policy:{type:"object",properties:{extension_pages:{$ref:"#/definitions/content_security_policy",description:"This policy covers pages in your extension, including html files and service workers."},sandbox:{$ref:"#/definitions/content_security_policy",description:"This policy covers any sandboxed extension pages that your extension uses."}}},web_accessible_resources:{type:"array",description:"An array of objects that declare resource access rules. Each object maps an array of extension resources to an array of URLs and/or extension IDs that can access those resources.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/web_resource"}}},dependencies:{browser_action:{not:{required:["browser_action"]}},page_action:{not:{required:["page_action"]}}}},title:"JSON schema for Google Chrome extension manifest files",type:"object"};function xa(t){t.addFormat("permission",{type:"string",validate:e=>typeof e=="string"&&e.trim()!==""}),t.addFormat("content-security-policy",{type:"string",validate:e=>typeof e=="string"}),t.addFormat("glob-pattern",{type:"string",validate:e=>typeof e=="string"&&/[\*\?\[\]]/.test(e)}),t.addFormat("match-pattern",{type:"string",validate:e=>e==="<all_urls>"||e==="file:///"||e.startsWith("http://localhost")||e.startsWith("http:// ")||e.startsWith("http://*:*/*")?!0:typeof e=="string"&&/^(\*|http|https|file|ftp):\/\//.test(e)}),t.addFormat("uri",{type:"string",validate:e=>typeof e=="string"&&/^(\w+:)?\/\//.test(e)}),t.addFormat("mime-type",{type:"string",validate:e=>typeof e=="string"&&/^[a-z]+\/[a-z0-9\-\+]+$/.test(e)})}var va=a(require("path")),_a=require("webpack");function Sa(t,e,s){let r=t.options.context||"",i=va.default.join(r,"manifest.json"),o=require(i).name||"Extension.js",c=e?.params.missingProperty;t.errors.push(new _a.WebpackError(Kr(o,s,c)))}var Pa=a(require("path")),ka=require("webpack");function Ea(t,e,s){let r=t.options.context||"",i=Pa.default.join(r,"manifest.json"),o=require(i).name||"Extension.js";t.warnings.push(new ka.WebpackError(Yr(o,e,s)))}var ja=a(require("path")),$a=require("webpack");function _r(t,e,s){let r=t.options.context||"",i=ja.default.join(r,"manifest.json"),o=require(i).name||"Extension.js";t.warnings.push(new $a.WebpackError(Zr(o,s,e)))}var bs=class{options;constructor(e){this.options=e}handleSchemaErrors(e,s,r){let i=new Da.default;xa(i);let n={allOf:[wa]},o=i.compile(n),c=o(s),p=s.manifest_version===3;if(!c&&o.errors){let l=o.errors[0];if(l?.keyword==="required"){Sa(e,l,r);return}p&&(l?.keyword==="type"&&Ea(e,l,r),l?.keyword==="not"&&_r(e,l,r))}}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let i=this.options.manifestPath,n=JSON.parse(Ca.default.readFileSync(i,"utf-8")),o=this.options.browser||"chrome";this.handleSchemaErrors(s,n,o),r()})}};var Ia=a(require("fs")),Pr=a(require("path"));var Sr=a(require("webpack"));function La(t,e){let s="Conflict: Multiple assets emit different content to the same filename ";if(e.message.includes(s)){let r=e.message.replace(s,"");if(r.startsWith("content_scripts"))return new Sr.default.WebpackError(Qr(t,r))}return null}function Fa(t,e){let s=require(t);return e.message.includes("Top-level-await is only supported in EcmaScript Modules")?new Sr.default.WebpackError(ei(s.name)):null}var ws=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=Pr.default.join(Pr.default.dirname(this.manifestPath),"package.json");if(!Ia.default.existsSync(s))return;let r=require(s).name;e.hooks.compilation.tap("develop:common-errors",i=>{i.hooks.afterSeal.tapAsync("develop:common-errors",n=>{i.errors.forEach((o,c)=>{let p=La(r,o),l=Fa(r,o);p&&(i.errors[c]=p),l&&(i.errors[c]=l)}),n()})})}};var xs=class{static name="plugin-errors";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){new ys({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new bs({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new ws({manifestPath:this.manifestPath}).apply(e)}};var wc=a(require("os")),Er=a(require("path"));var sc=a(require("fs")),rc=require("child_process");var re=a(require("path")),ks=a(require("fs"));var Aa={alternate_error_pages:{enabled:!1},autofill:{enabled:!1},browser:{check_default_browser:!1,default_browser_setting_enabled:!1},default_apps:"install",distribution:{alternate_shortcut_text:!1,auto_launch_chrome:!1,import_bookmarks:!1,import_history:!1,import_home_page:!1,import_search_engine:!1,suppress_first_run_bubble:!0,do_not_register_for_update_launch:!0,make_chrome_default:!1,make_chrome_default_for_user:!1,require_eula:!1,suppress_first_run_default_browser_prompt:!0},dns_prefetching:{enabled:!1},download:{default_directory:"/tmp/",directory_upgrade:!0,open_pdf_in_adobe_reader:!1,prompt_for_download:!0},enable_do_not_track:!0,extensions:{theme:{use_system:!1},toolbarsize:-1,ui:{developer_mode:!0}},plugins:{plugins_list:[{enabled:!1,name:"Java(TM)"}],show_details:!0},profile:{password_manager_enabled:!1},safebrowsing:{enabled:!1,safebrowsingextended_reporting_enabled:!1},savefile:{default_directory:"/tmp",type:0},search:{suggest_enabled:!1},session:{restore_on_startup:1},sync:{suppress_start:!0},sync_promo:{show_on_first_run_allowed:!1,show_ntp_bubble:!1},translate:{enabled:!1}},Ma={...Aa},Oa={...Aa};var x=require("@colors/colors/safe");function k(t,e){let s=e==="warn"?(0,x.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,x.cyan)("\u25BA\u25BA\u25BA"):e==="error"?(0,x.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E"):(0,x.brightGreen)("\u25BA\u25BA\u25BA");return`${(0,x.gray)("")}${s}`}function Je(t){return t.charAt(0).toUpperCase()+t.slice(1)}function vs(t,e){let s=t==="firefox"?"Add-on":"Extension";return`${k(t,"info")} ${Je(t)} ${s} running in ${(0,x.cyan)(e||"unknown")} mode.`}function _s(t,e){let s=Je(t),r=e=="null"?`${s} browser is not installed.
|
|
126
|
+
Add an ${(0,u.brightYellow)("id")} field to your manifest.json file and try again.`}var Ke=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=M.default.dirname(this.manifestPath),i=require(this.manifestPath).name||"Extension.js";(V.default.existsSync(M.default.join(s,".env"))||V.default.existsSync(M.default.join(s,".env.example"))||V.default.existsSync(M.default.join(s,".env.local"))||V.default.existsSync(M.default.join(s,".env.defaults")))&&(console.log(Ur(i)),new mi.default({path:V.default.existsSync(M.default.join(s,".env"))?M.default.join(s,".env"):V.default.existsSync(M.default.join(s,".env.local"))?M.default.join(s,".env.local"):M.default.join(s,".env.example"),allowEmptyValues:!0,defaults:V.default.existsSync(M.default.join(s,".env.defaults")),systemvars:!0}).apply(e))}};var Ns=a(require("fs")),di=a(require("path")),Qe=class{apply(e){let s=di.default.join(e.options.output.path||"","hot");Ns.default.existsSync(s)&&(Ns.default.rmSync(s,{recursive:!0,force:!0}),process.env.EXTENSION_ENV==="development"&&console.log("[CleanHotUpdatesPlugin] Removed old hot-update files before compilation."))}};var et=class{static name="plugin-compilation";manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){new gi.default().apply(e),new Ke({manifestPath:this.manifestPath}).apply(e),new Qe().apply(e),e.hooks.done.tap("develop:brand",s=>{s.compilation.name=void 0;let r=s.endTime-s.startTime;console.log(Nr(r,s))})}};var Mi=a(require("path")),Oi=a(require("mini-css-extract-plugin"));var Di=a(require("mini-css-extract-plugin"));var ce=a(require("path")),Ee=a(require("fs"));var ke=a(require("path")),tt=a(require("fs")),qs=require("child_process"),hi=require("detect-package-manager");function yi(t,e){return Object.values(e||{}).some(s=>s===t)}function h(t,e,s){let r=ke.default.extname(e),n=S(e,{exclude:s})?ke.default.normalize(e):t;return[".js",".jsx",".tsx",".ts"].includes(r)&&(n=n.replace(r,".js")),[".html",".njk",".nunjucks"].includes(r)&&(n=n.replace(r,".html")),[".css",".scss",".sass",".less"].includes(r)&&(n=n.replace(r,".css")),Us(n||"")}function Us(t){return t.replace(/\\/g,"/")}function S(t,e={}){if(!e)return!1;let s=Us(t);return Object.values(e).some(r=>{if(typeof r!="string")return!1;let i=Us(r);return s.endsWith(i)})}function G(t,e){if(t.getAsset("manifest.json")||t.assets["manifest.json"]){let s=t.assets["manifest.json"].source().toString();return JSON.parse(s||"{}")}return require(e)}async function _(t,e,s){try{let r=await(0,hi.detect)();console.log(qr(t,e,r));let i="";r==="yarn"?i=`yarn --silent add ${s.join(" ")} --cwd ${__dirname} --optional`:r==="npm"?i=`npm --silent install ${s.join(" ")} --prefix ${__dirname} --save-optional`:r==="pnpm"?i=`pnpm --silent add ${s.join(" ")} --prefix ${__dirname} --save-optional`:i=`${r} --silent install ${s.join(" ")} --cwd ${__dirname} --optional`,(0,qs.execSync)(i,{stdio:"inherit"}),await new Promise(n=>setTimeout(n,2e3)),process.env.EXTENSION_ENV==="development"&&(console.log(Wr(t,e)),r==="yarn"?i="yarn install --silent > /dev/null 2>&1":r==="npm"?i="npm install --silent > /dev/null 2>&1":r==="pnpm"?i="pnpm install --silent > /dev/null 2>&1":i=`${r} install --silent > /dev/null 2>&1`,(0,qs.execSync)(i,{stdio:"inherit"})),console.log(Br(t,e))}catch(r){console.error(Jr(t,e,r))}}function st(t){let e=ke.default.join(t,"package.json");if(!tt.default.existsSync(e))return!1;let s=JSON.parse(tt.default.readFileSync(e,"utf-8")),r=["react","vue","@angular/core","svelte","solid-js","preact"],i=s.dependencies||{},n=s.devDependencies||{};for(let o of r)if(i[o]||n[o])return!0;return!1}function Ws(t){return!tt.default.existsSync(ke.default.resolve(__dirname,`run-${t}-profile`))}function bi(t){let e=t.name?.replace(/ /g,"-").toLowerCase();return{data:{id:`${e}@extension-js`,manifest:t,management:{id:`${e}@extension-js`,mayDisable:!0,optionsUrl:"",installType:"development",type:"extension",enabled:!0,name:t.name||"",description:t.description||"",version:t.version||"",hostPermissions:t.host_permissions||[],permissions:t.permissions||[],offlineEnabled:t.offline_enabled||!1,shortName:t.short_name||"",isApp:t.app&&t.app.background&&t.app.background.scripts}}}}var wi=!1;function rt(t){let e=ce.default.join(t,"package.json"),s=ce.default.join(t,"manifest.json");if(!Ee.default.existsSync(e))return!1;let r=Ip(t),i=require(e),n=i.devDependencies&&i.devDependencies.tailwindcss,o=i.dependencies&&i.dependencies.tailwindcss,c=!!r&&!!(n||o);if(c&&!wi){let l=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(l,"Tailwind")),wi=!0}return c}function Ip(t){let e=ce.default.join(t,"tailwind.config.mjs"),s=ce.default.join(t,"tailwind.config.cjs"),r=ce.default.join(t,"tailwind.config.js");if(Ee.default.existsSync(e))return e;if(Ee.default.existsSync(s))return s;if(Ee.default.existsSync(r))return r}var it=a(require("path")),vi=a(require("fs"));var xi=!1;function je(t){let e=it.default.join(t,"package.json"),s=it.default.join(t,"manifest.json");if(!vi.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.sass,n=r.dependencies&&r.dependencies.sass;if(i||n){if(!xi){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"SASS")),xi=!0}return!0}return!1}async function _i(t,e){if(!je(t))return[];try{require.resolve("sass-loader")}catch{let r=["postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"],i=require(it.default.join(t,"package.json")).name;await _(i,"PostCSS",r),await _(i,"SASS",["sass","sass-loader","resolve-url-loader"]),console.log(P(i,"SASS")),process.exit(0)}return[{test:/\.(s(a|c)ss)$/,exclude:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]},{test:/\.module\.(s(a|c)ss)$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await A(t,{loader:"sass-loader",mode:e,useMiniCssExtractPlugin:!0})}]}]}var nt=a(require("path")),Pi=a(require("fs"));var Si=!1;function $e(t){let e=nt.default.join(t,"package.json"),s=nt.default.join(t,"manifest.json"),i=require(s).name||"Extension.js";if(!Pi.default.existsSync(e))return!1;let n=require(e),o=n.devDependencies&&n.devDependencies.less,c=n.dependencies&&n.dependencies.less;return o||c?(Si||(process.env.EXTENSION_ENV==="development"&&console.log(v(i,"LESS")),Si=!0),!0):!1}async function ki(t,e){if(!$e(t))return[];try{require.resolve("less-loader")}catch{let r=require(nt.default.join(t,"package.json")).name;await _(r,"LESS",["less","less-loader","resolve-url-loader"]),console.log(P(r,"LESS")),process.exit(0)}return[{test:/\.less$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:!1})},{use:await A(t,{loader:"less-loader",mode:e,useMiniCssExtractPlugin:e==="production"})}]}]}var le=a(require("path")),ot=a(require("fs"));var pe=!1;function Ap(t){let e=le.default.join(t,"package.json"),s=le.default.join(t,"manifest.json");if(!ot.default.existsSync(e))return!1;let r=[".postcssrc",".postcssrc.json",".postcssrc.yaml",".postcssrc.yml",".postcssrc.js",".postcssrc.cjs","postcss.config.js","postcss.config.cjs"],n=require(s).name||"Extension.js";if(ot.default.existsSync(e)){let o=require(e);if(o.dependencies&&o.dependencies.postcss||o.devDependencies&&o.devDependencies.postcss)return pe||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"PostCSS")),pe=!0),!0}for(let o of r)if(ot.default.existsSync(le.default.join(t,o)))return pe||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"PostCSS")),pe=!0),!0;return rt(t)?(pe||(process.env.EXTENSION_ENV==="development"&&console.log(v(n,"PostCSS")),pe=!0),!0):!1}async function Ei(t,e){if(!Ap(t))return{};try{require.resolve("postcss-loader")}catch{let r=require(le.default.join(t,"package.json")).name;!je(t)&&!$e(t)&&await _(r,"PostCSS",["postcss","postcss-loader","postcss-scss","postcss-flexbugs-fixes","postcss-preset-env","postcss-normalize"]),console.log(P(r,"PostCSS")),process.exit(0)}return{loader:require.resolve("postcss-loader"),options:{postcssOptions:{parser:require.resolve("postcss-scss"),ident:"postcss",config:le.default.resolve(t,"postcss.config.js"),plugins:[require.resolve("postcss-flexbugs-fixes"),[require.resolve("postcss-preset-env"),{autoprefixer:{flexbox:"no-2009"},stage:3}].filter(Boolean),require.resolve("postcss-normalize")].filter(Boolean)},sourceMap:e.mode==="development"}}}var at=a(require("path")),$i=a(require("fs"));var ji=!1;function Ce(t){let e=at.default.join(t,"package.json"),s=at.default.join(t,"manifest.json");if(!$i.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.vue,n=r.dependencies&&r.dependencies.vue;if((i||n)&&!ji){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Vue")),ji=!0}return!!i||!!n}async function Ci(t){if(!Ce(t))return;try{require.resolve("vue-loader")}catch{let i=["typescript"],o=require(at.default.join(t,"manifest.json")).name||"Extension.js";await _(o,"TypeScript",i),await _(o,"Vue",["vue-loader","@vue/compiler-sfc","vue-template-compiler","vue-style-loader"]),console.log(P(o,"Vue")),process.exit(0)}let e=[{test:/\.vue$/,loader:require.resolve("vue-loader"),include:t,exclude:/node_modules/}];return{plugins:[new(require("vue-loader")).VueLoaderPlugin],loaders:e,alias:void 0}}async function A(t,e){let s=Di.default.loader,r=[e.useMiniCssExtractPlugin?s:Ce(t)?require.resolve("vue-style-loader"):require.resolve("style-loader"),{loader:require.resolve("css-loader"),options:{importLoaders:1}}].filter(Boolean);if(rt(t)||je(t)||$e(t)){let i=await Ei(t,e);i.loader&&r.push(i)}return e.loader&&r.push({loader:require.resolve("resolve-url-loader"),options:{sourceMap:e.mode==="development",root:t}},{loader:require.resolve(e.loader),options:{sourceMap:e.mode==="development"}}),r.filter(Boolean)}var C=a(require("path")),O=a(require("fs"));function Ii(t){let e=C.default.join(t,"stylelint.config.json"),s=C.default.join(t,".stylelintrc.js file"),r=C.default.join(t,"stylelint.config.mjs"),i=C.default.join(t,".stylelintrc.mjs"),n=C.default.join(t,"stylelint.config.cjs"),o=C.default.join(t,".stylelintrc.cjs"),c=C.default.join(t,".stylelintrc.json"),p=C.default.join(t,".stylelintrc"),l=C.default.join(t,".stylelintrc.yml"),f=C.default.join(t,".stylelintrc.yaml");if(O.default.existsSync(e))return e;if(O.default.existsSync(s))return s;if(O.default.existsSync(r))return r;if(O.default.existsSync(i))return i;if(O.default.existsSync(n))return n;if(O.default.existsSync(o))return o;if(O.default.existsSync(c))return c;if(O.default.existsSync(p))return p;if(O.default.existsSync(l))return l;if(O.default.existsSync(f))return f}var Li=!1;function Fi(t){let e=C.default.join(t,"package.json"),s=C.default.join(t,"manifest.json");if(!O.default.existsSync(e))return!1;let i=!!Ii(t);if(i&&!Li){let o=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(o,"Stylelint")),Li=!0}return i}async function Ai(t){if(!Fi(t))return[];try{require.resolve("stylelint")}catch{let r=["stylelint","stylelint-webpack-plugin","stylelint-config-standard-scss"],i=require(C.default.join(t,"package.json")).name;await _(i,"Stylelint",r),console.log(P(i,"Stylelint")),process.exit(0)}let e=require("stylelint-webpack-plugin");return[new e({context:t,configFile:Fi(t)?Ii(t):C.default.join(__dirname,"stylelint.config.json"),files:"**/*.{css,scss,sass,less}",exclude:["node_modules",C.default.join(t,"node_modules")]})]}var ct=class t{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=Mi.default.dirname(this.manifestPath),r=[new Oi.default];r.forEach(p=>p.apply(e));let i=await Ai(s);r.push(...i);let n=[{test:/\.css$/,exclude:/\.module\.css$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:!1})},{use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]},{test:/\.module\.css$/,oneOf:[{resourceQuery:/is_content_css_import=true/,use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:!1})},{use:await A(s,{mode:this.mode,useMiniCssExtractPlugin:this.mode==="production"})}]}];e.options.plugins=[...e.options.plugins,...r].filter(Boolean);let o=await _i(s,this.mode),c=await ki(s,this.mode);n.push(...o),n.push(...c),e.options.module.rules=[...e.options.module.rules,...n].filter(Boolean)}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var pt=class{static name="plugin-css";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async apply(e){let s={test:/\.svg$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2048}}},i=[...e.options.module.rules.some(n=>n&&n.test instanceof RegExp&&n.test.test(".svg")&&n.use!==void 0)?[]:[s],{test:/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"}},{test:/\.(txt|md|csv|tsv|xml|pdf|docx|doc|xls|xlsx|ppt|pptx|zip|gz|gzip|tgz)$/i,type:"asset/resource",generator:{filename:"assets/[name][ext]"},parser:{dataUrlCondition:{maxSize:2*1024}}},{test:/\.(csv|tsv)$/i,use:[require.resolve("csv-loader")],generator:{filename:"assets/[name][ext]"}}];e.options.module.rules=[...e.options.module.rules,...i].filter(Boolean)}};var Bs=a(require("path"));var fe=a(require("path")),ft=a(require("fs"));var lt=a(require("path")),Ri=a(require("fs"));var Ti=!1;function X(t){let e=lt.default.join(t,"package.json"),s=lt.default.join(t,"manifest.json");if(!Ri.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.preact,n=r.dependencies&&r.dependencies.preact;if((i||n)&&!Ti){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"Preact")),Ti=!0}return!!i||!!n}async function Ni(t){if(!X(t))return;try{require.resolve("@prefresh/webpack")}catch{let r=["@prefresh/webpack"],n=require(lt.default.join(t,"manifest.json")).name||"Extension.js";await _(n,"Preact",r),console.log(P(n,"Preact")),process.exit(0)}return{plugins:[new(require("@prefresh/webpack"))],loaders:void 0,alias:{react:"preact/compat","react-dom/test-utils":"preact/test-utils","react-dom":"preact/compat","react/jsx-runtime":"preact/jsx-runtime"}}}var ue=a(require("path")),ut=a(require("fs"));var qi=!1;function R(t){let e=ue.default.join(t,"package.json");if(!ut.default.existsSync(e))return!1;let s=Op(t),r=require(e),i=require(ue.default.join(t,"manifest.json")),n=i.name||"Extension.js",o=r.devDependencies&&r.devDependencies.typescript,c=r.dependencies&&r.dependencies.typescript;return qi||((o||c)&&(s?process.env.EXTENSION_ENV==="development"&&console.log(v(n,"TypeScript")):(console.log(ni(i)),Tp(t))),qi=!0),!!s&&!!(o||c)}function Mp(t,e){return{compilerOptions:{allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,jsx:st(t)?"react-jsx":"preserve",lib:["dom","dom.iterable","esnext"],moduleResolution:"node",module:"esnext",resolveJsonModule:!0,strict:!0,target:"esnext",isolatedModules:!1,skipLibCheck:!0},exclude:["node_modules","dist"]}}function Op(t){let e=ue.default.join(t,"tsconfig.json");if(ut.default.existsSync(e))return e}function Tp(t){ut.default.writeFileSync(ue.default.join(t,"tsconfig.json"),JSON.stringify(Mp(t,{mode:"development"}),null,2))}async function Ui(t){if(!R(t))return!1;try{require.resolve("typescript")}catch{let s=["typescript"],i=require(ue.default.join(t,"manifest.json")).name||"Extension.js";await _(i,"TypeScript",s),console.log(P(i,"TypeScript")),process.exit(0)}return!0}var Wi=!1,Bi=[".babelrc",".babelrc.json",".babelrc.js",".babelrc.cjs","babel.config.json","babel.config.js","babel.config.cjs"];function Rp(t){let e=fe.default.join(t,"package.json"),s=fe.default.join(t,"manifest.json");if(!ft.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies["babel-core"],n=r.dependencies&&r.dependencies["babel-core"],o=Bi.some(c=>ft.default.existsSync(fe.default.join(t,c)))||!!i||!!n;if(o&&!Wi){let p=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&process.env.EXTENSION_ENV==="development"&&console.log(v(p,"Babel")),Wi=!0}return o}function Np(t){for(let e of Bi){let s=fe.default.join(t,e);if(ft.default.existsSync(s))return s}}function qp(t,e){let s=require("babel-preset-modern-browser-extension").default;return{cacheDirectory:!1,cacheCompression:!1,babelrc:!1,configFile:Np(t),compact:e.mode==="production",overrides:[s(e).overrides],presets:[...s(e).presets],plugins:[...s(e).plugins,process.env.NODE_ENV!=="test"&&e.mode==="development"&&X(t)&&require.resolve("react-refresh/babel")].filter(Boolean)}}async function Ji(t,e){if(!Rp(e))return;try{require.resolve("babel-loader")}catch{let o=["@babel/core","babel-loader","babel-preset-modern-browser-extension"],p=require(fe.default.join(e,"manifest.json")).name||"Extension.js";await _(p,"Babel",o),console.log(P(p,"Babel")),process.exit(0)}let s=R(e)?/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/:/\.(js|mjs|jsx|mjsx)$/,r=t.options.mode,i=await Ui(e);return{plugins:void 0,loaders:[{test:s,include:e,exclude:/node_modules/,loader:require.resolve("babel-loader"),options:qp(e,{mode:r,typescript:i})}],alias:void 0}}var mt=a(require("path")),Hi=a(require("fs"));var zi=!1;function me(t){let e=mt.default.join(t,"package.json"),s=mt.default.join(t,"manifest.json");if(!Hi.default.existsSync(e))return!1;let r=require(e),i=r.devDependencies&&r.devDependencies.react,n=r.dependencies&&r.dependencies.react;if((i||n)&&!zi){let c=require(s).name||"Extension.js";process.env.EXTENSION_ENV==="development"&&console.log(v(c,"React")),zi=!0}return!!i||!!n}async function Vi(t){if(!me(t))return;try{require.resolve("@pmmmwh/react-refresh-webpack-plugin")}catch{let r=["react-refresh","@pmmmwh/react-refresh-webpack-plugin","react-refresh-typescript"],n=require(mt.default.join(t,"manifest.json")).name||"Extension.js";await _(n,"React",r),console.log(P(n,"React")),process.exit(0)}return{plugins:[new(require("@pmmmwh/react-refresh-webpack-plugin"))({overlay:!1})],loaders:void 0,alias:void 0}}var dt=class t{static name="plugin-js-frameworks";manifestPath;mode;constructor(e){this.manifestPath=e.manifestPath,this.mode=e.mode}async configureOptions(e){let s=Bs.default.dirname(this.manifestPath),r=await Ji(e,s),i=await Vi(s),n=await Ni(s),o=await Ci(s);e.options.resolve.alias={...r?.alias||{},...i?.alias||{},...n?.alias||{},...o?.alias||{},...e.options.resolve.alias},e.options.module.rules=[{test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[Bs.default.dirname(this.manifestPath)],exclude:/node_modules/,use:{loader:require.resolve("swc-loader"),options:{sync:!0,module:{type:"es6"},minify:this.mode==="production",isModule:!0,jsc:{target:"es2016",parser:{syntax:R(s)?"typescript":"ecmascript",tsx:R(s)&&(me(s)||X(s)),jsx:!R(s)&&(me(s)||X(s)),dynamicImport:!0},transform:{react:{development:this.mode==="development",refresh:this.mode==="development",runtime:"automatic",importSource:"react"}}}}}},...r?.loaders||[],...i?.loaders||[],...n?.loaders||[],...o?.loaders||[],...e.options.module.rules].filter(Boolean),i?.plugins?.forEach(c=>c.apply(e)),n?.plugins?.forEach(c=>c.apply(e)),o?.plugins?.forEach(c=>c.apply(e))}async apply(e){if(this.mode==="production"){e.hooks.beforeRun.tapPromise(t.name,async()=>await this.configureOptions(e));return}await this.configureOptions(e)}};var Re=a(require("path"));var In=a(require("path"));var Gi=a(require("path"));function Xi(t,e){if(!e||!e.action||!e.action.default_popup)return;let s=e.action.default_popup;return Gi.default.join(t,s)}var Zi=a(require("path"));function Yi(t,e){if(!e||!e.browser_action||!e.browser_action.default_popup)return;let s=e.browser_action.default_popup;return Zi.default.join(t,s)}var gt=a(require("path"));function Ki(t,e){let s={newtab:void 0};if(!e||!e.chrome_url_overrides)return{"chrome_url_overrides/newtab":void 0};if(e.chrome_url_overrides.history){let r=e.chrome_url_overrides.history;s={"chrome_url_overrides/history":gt.default.join(t,r)}}if(e.chrome_url_overrides.newtab){let r=e.chrome_url_overrides.newtab;s={"chrome_url_overrides/newtab":gt.default.join(t,r)}}if(e.chrome_url_overrides.bookmarks){let r=e.chrome_url_overrides.bookmarks;s={"chrome_url_overrides/bookmarks":gt.default.join(t,r)}}return s}var Qi=a(require("path"));function en(t,e){if(!e||!e.devtools_page)return;let s=e.devtools_page;return Qi.default.join(t,s)}var Js=a(require("path"));function tn(t,e){if(e.options_page){let r=e.options_page;return Js.default.join(t,r)}if(!e||!e.options_ui||!e.options_ui.page)return;let s=e.options_ui.page;return Js.default.join(t,s)}var sn=a(require("path"));function rn(t,e){if(!e||!e.page_action||!e.page_action.default_popup)return;let s=e.page_action.default_popup;return sn.default.join(t,s)}var nn=a(require("path"));function on(t,e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0":void 0};let s=e.sandbox.pages,r={};for(let[i,n]of s.entries())r[`sandbox/page-${i}`]=nn.default.join(t,n);return r}var an=a(require("path"));function cn(t,e){if(!e||!e.side_panel||!e.side_panel.default_path)return;let s=e.side_panel.default_path;return an.default.join(t,s)}var pn=a(require("path"));function ln(t,e){if(!e||!e.sidebar_action||!e.sidebar_action.default_panel)return;let s=e.sidebar_action.default_panel;return pn.default.join(t,s)}function De(t,e){return{"action/default_popup":Xi(t,e),"browser_action/default_popup":Yi(t,e),...Ki(t,e),devtools_page:en(t,e),"options_ui/page":tn(t,e),"page_action/default_popup":rn(t,e),...on(t,e),"side_panel/default_path":cn(t,e),"sidebar_action/default_panel":ln(t,e)}}var zs=a(require("path"));function un(t,e){if(!e||!e.action||!e.action.default_icon)return;if(typeof e.action.default_icon=="string")return zs.default.join(t,e.action.default_icon);let s=[];for(let r in e.action.default_icon)s.push(zs.default.join(t,e.action.default_icon[r]));return s}var Hs=a(require("path"));function fn(t,e){if(!e||!e.browser_action||!e.browser_action.default_icon)return;let s=[];if(typeof e.browser_action.default_icon=="string")return Hs.default.join(t,e.browser_action.default_icon);for(let r in e.browser_action.default_icon){let i=e.browser_action.default_icon[r]=Hs.default.join(t,e.browser_action.default_icon[r]);s.push(i)}return s}var Vs=a(require("path"));function mn(t,e){if(!(!e||!e.browser_action||!e.browser_action.theme_icons)){for(let s of e.browser_action.theme_icons)s.light&&(s.light=Vs.default.join(t,s.light)),s.dark&&(s.dark=Vs.default.join(t,s.dark)),s.size&&delete s.size;return e.browser_action.theme_icons}}var dn=a(require("path"));function gn(t,e){if(!e||!e.icons)return;let s=[];for(let r in e.icons){let i=dn.default.join(t,e.icons[r]);s.push(i)}return s}var Gs=a(require("path"));function hn(t,e){if(!e||!e.page_action||!e.page_action.default_icon)return;if(typeof e.page_action.default_icon=="string")return Gs.default.join(t,e.page_action.default_icon);let s=[];for(let r in e.page_action.default_icon){let i=Gs.default.join(t,e.page_action.default_icon[r]);s.push(i)}return s}var yn=a(require("path"));function bn(t,e){return!e||!e.sidebar_action||!e.sidebar_action.default_icon?void 0:yn.default.join(t,e.sidebar_action.default_icon)}function wn(t,e){return{action:un(t,e),browser_action:fn(t,e),"browser_action/theme_icons":mn(t,e),icons:gn(t,e),page_action:hn(t,e),sidebar_action:bn(t,e)}}var xn=a(require("path"));function vn(t,e){let s={};return!e||!e.declarative_net_request||!e.declarative_net_request.rule_resources?{"declarative_net_request/rule_resources-0":void 0}:(e.declarative_net_request.rule_resources.forEach(i=>{s[`declarative_net_request/${i.id}`]=xn.default.join(t,i.path)}),s)}var _n=a(require("path"));function Sn(t,e){if(!e||!e.storage||!e.storage.managed_schema)return;let s=e.storage.managed_schema;return _n.default.join(t,s)}function Pn(t,e){return{...vn(t,e),"storage/managed_schema":Sn(t,e)}}var kn=a(require("path"));function En(t,e){if(!e||!e.background)return;let s=e.background.scripts;if(s)return s.map(r=>kn.default.join(t,r))}var jn=a(require("path"));function $n(t,e){if(!e||!e.background)return;let s=e.background.service_worker;if(s)return jn.default.join(t,s)}var Xs=a(require("path"));function Cn(t,e){if(!e||!e.content_scripts)return{"content_scripts/content-0":void 0};let s=n=>{if(n.js?.length!==0)return n.js?.map(o=>Xs.default.join(t,o))},r=n=>{if(n.css?.length!==0)return n.css?.map(o=>Xs.default.join(t,o))},i={};for(let[n,o]of e.content_scripts.entries()){let c=s(o),p=r(o);i[`content_scripts/content-${n}`]=[...(c||[]).filter(l=>l!=null),...(p||[]).filter(l=>l!=null)]}return i}var Dn=a(require("path"));function Ln(t,e){if(!e||!e.user_scripts||!e.user_scripts.api_script)return;let s=e.user_scripts.api_script;return Dn.default.join(t,s)}function Le(t,e){return{"background/scripts":En(t,e),"background/service_worker":$n(t,e),...Cn(t,e),"user_scripts/api_script":Ln(t,e)}}function Fn(t){if(!(!t||!t.web_accessible_resources||!t.web_accessible_resources.length))return t.web_accessible_resources}function Up(t){function e(s){let r={};for(let i in s)if(s.hasOwnProperty(i)){let n=i.includes(":")?i.split(":")[1]:i;typeof s[i]=="object"&&!Array.isArray(s[i])?r[n]=e(s[i]):r[n]=s[i]}return r}return e(t)}function An({manifestPath:t}){let e=In.default.dirname(t),s=require(t),r=Up(s);return{html:De(e,r),icons:wn(e,r),json:Pn(e,r),scripts:Le(e,r),web_accessible_resources:Fn(r)}}var de=a(require("path"));var ht=a(require("fs")),Fe=a(require("path"));function yt(t,e){if(!ht.default.existsSync(t)||!ht.default.statSync(t).isDirectory())return[];let s=[];function r(i){let n=ht.default.readdirSync(i,{withFileTypes:!0});for(let o of n){let c=Fe.default.join(i,o.name);o.isDirectory()?r(c):o.isFile()&&e(o.name)&&s.push(c)}}return r(t),s}function bt(t,e,s=""){return!e||!e.length?{}:e.reduce((r,i)=>{let n=Fe.default.extname(i),o=Fe.default.basename(i,n),c=s?`${s}/${o}`:Fe.default.relative(t,i);return{...r,[c]:i}},{})}function Mn({manifestPath:t}){let e=de.default.dirname(t),s={public:de.default.join(e,"public"),pages:de.default.join(e,"pages"),scripts:de.default.join(e,"scripts")},r={public:yt(s.public,()=>!0),pages:yt(s.pages,n=>n.endsWith(".html")),scripts:yt(s.scripts,n=>[".js",".mjs",".jsx",".mjsx",".ts",".mts",".tsx",".mtsx"].includes(de.default.extname(n)))};return{public:bt(e,r.public),pages:bt(e,r.pages,"pages"),scripts:bt(e,r.scripts,"scripts")}}var wt=a(require("path")),On=a(require("webpack")),xt=class{manifestPath;includeList;excludeList;loaderOptions;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList,this.loaderOptions=e.loaderOptions}apply(e){new On.default.ProvidePlugin({r:[wt.default.resolve(__dirname,"./resolver-module.js"),"default"]}).apply(e),e.options.module?.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,loader:require.resolve(wt.default.resolve(__dirname,"./resolver-loader.js")),include:[wt.default.dirname(this.manifestPath)],exclude:/node_modules/,options:{manifestPath:this.manifestPath,includeList:this.includeList,jsx:this.loaderOptions?this.loaderOptions.jsx:!1,typescript:this.loaderOptions?this.loaderOptions.typescript:!1,minify:this.loaderOptions?this.loaderOptions.minify:!1}})}};var Tn=a(require("fs")),_t=a(require("webpack")),Rn=require("webpack");var vt=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){e.hooks.compilation.tap("manifest:emit-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:emit-manifest",stage:_t.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let r=this.manifestPath,i;try{let c=Tn.default.readFileSync(r,"utf-8");i=JSON.parse(c)}catch(c){let l=require(this.manifestPath).name||"Extension.js";s.errors.push(new _t.default.WebpackError(si(l,c)));return}let n=JSON.stringify(i,null,2);s.emitAsset("manifest.json",new Rn.sources.RawSource(n))})})}};var Et=require("webpack");var ho=a(require("path"));function Nn(t,e){return t.background&&t.background.scripts&&{background:{...t.background,...t.background.scripts&&{scripts:["background/scripts.js",...t.background.scripts.filter(s=>e.includes(s))]}}}}var qn=a(require("path"));var St=t=>qn.default.basename(t);function Un(t,e){return t.browser_action&&{browser_action:{...t.browser_action,...t.browser_action.default_popup&&{default_popup:h("browser_action/default_popup.html",t.browser_action.default_popup,e)},...t.browser_action.default_icon&&{default_icon:typeof t.browser_action.default_icon=="string"?h(`icons/${St(t.browser_action.default_icon)}`,t.browser_action.default_icon,e):Object.fromEntries(Object.entries(t.browser_action.default_icon).map(([s,r])=>[s,h(`icons/${St(r)}`,r,e)]))},...t.browser_action.theme_icons&&{theme_icons:t.browser_action.theme_icons.map(s=>({...s,...s.light&&{light:h(`browser_action/${St(s.light)}`,s.light,e)},...s.dark&&{dark:h(`browser_action/${St(s.dark)}`,s.dark,e)}}))}}}}function Wn(t,e){return t.declarative_net_request&&{declarative_net_request:{...t.declarative_net_request,rule_resources:t.declarative_net_request.rule_resources.map(s=>({...s,path:s.path&&h(`declarative_net_request/${s.id}.json`,s.path,e)}))}}}function Bn(t,e){return{...Nn(t,e),...Un(t,e),...Wn(t,e)}}var zn=a(require("path"));var Jn=t=>zn.default.basename(t);function Hn(t,e){return t.action&&{action:{...t.action,...t.action.default_popup&&{default_popup:h("action/default_popup.html",t.action.default_popup,e)},...t.action.default_icon&&{default_icon:typeof t.action.default_icon=="string"?h(`action/${Jn(t.action.default_icon)}`,t.action.default_icon,e):Object.fromEntries(Object.entries(t.action.default_icon).map(([s,r])=>[s,h(`action/${Jn(r)}`,r,e)]))}}}}function Vn(t,e){return t.background&&t.background.service_worker&&{background:{...t.background,...t.background.service_worker&&{service_worker:h("background/service_worker.js",t.background.service_worker,e)}}}}function Pt(t,e){return t.side_panel&&{side_panel:{...t.side_panel.default_path&&{default_path:h("side_panel/default_path.html",t.side_panel.default_path,e)}}}}function Gn(t,e){return{...Hn(t,e),...Vn(t,e),...Pt(t,e)}}function Xn(t,e){return t.background&&t.background.page&&{background:{...t.background,...t.background.page&&{page:h("background/page.html",t.background.page,e)}}}}function Zn(t,e){return t.chrome_url_overrides&&{chrome_url_overrides:{...t.chrome_url_overrides.bookmarks&&{bookmarks:h("chrome_url_overrides/bookmarks.html",t.chrome_url_overrides.bookmarks,e)},...t.chrome_url_overrides.history&&{history:h("chrome_url_overrides/history.html",t.chrome_url_overrides.history,e)},...t.chrome_url_overrides.newtab&&{newtab:h("chrome_url_overrides/newtab.html",t.chrome_url_overrides.newtab,e)}}}}function Yn(t,e){return t.content_scripts&&{content_scripts:t.content_scripts.map((s,r)=>{let i=[...new Set(s.js)],n=[...new Set(s.css)];return{...s,js:[...i.map(o=>h(`content_scripts/content-${r}.js`,o,e))],css:[...n.map(o=>h(`content_scripts/content-${r}.css`,o,e))]}})}}function Kn(t,e){return t.devtools_page&&{devtools_page:h("devtools_page.html",t.devtools_page,e)}}var Qn=a(require("path"));var Wp=t=>Qn.default.basename(t);function eo(t,e){return t.icons&&{icons:Object.fromEntries(Object.entries(t.icons).map(([s,r])=>[s,h(`icons/${Wp(r)}`,r,e)]))}}function to(t,e){return t.options_page&&{options_page:h("options_ui/page.html",t.options_page,e)}}function so(t,e){return t.options_ui&&{options_ui:{...t.options_ui,...t.options_ui.page&&{page:h("options_ui/page.html",t.options_ui.page,e)}}}}var io=a(require("path"));var ro=t=>io.default.basename(t);function no(t,e){return t.page_action&&{page_action:{...t.page_action,...t.page_action.default_popup&&{default_popup:h("page_action/default_popup.html",t.page_action.default_popup,e)},...t.page_action.default_icon&&{default_icon:typeof t.page_action.default_icon=="string"?h(`icons/${ro(t.page_action.default_icon)}`,t.page_action.default_icon,e):Object.fromEntries(Object.entries(t.page_action.default_icon).map(([s,r])=>[s,h(`icons/${ro(r)}`,r,e)]))}}}}function oo(t,e){return t.sandbox&&{sandbox:{...t.sandbox,...t.sandbox.pages&&{pages:t.sandbox.pages.map((s,r)=>h(`sandbox/page-${r}.html`,s,e))}}}}var ao=a(require("path"));var Bp=t=>ao.default.basename(t);function co(t,e){return t.sidebar_action&&{sidebar_action:{...t.sidebar_action,...t.sidebar_action.default_panel&&{default_panel:h("sidebar_action/default_panel.html",t.sidebar_action.default_panel,e)},...t.sidebar_action.default_icon&&{default_icon:h(`icons/${Bp(t.sidebar_action.default_icon)}`,t.sidebar_action.default_icon,e)}}}}function po(t,e){return t.storage&&{storage:{...t.storage.managed_schema&&{managed_schema:h("storage/managed_schema.json",t.storage.managed_schema,e)}}}}var lo=a(require("path"));var Jp=t=>lo.default.basename(t);function uo(t,e){return t.theme&&{theme:{...t.theme,...t.theme.images&&{images:{...t.theme.images,theme_frame:h(`theme/images/${Jp(t.theme.images.theme_frame)}`,t.theme.images.theme_frame,e)}}}}}function fo(t,e){return t.user_scripts&&{user_scripts:{...t.user_scripts,...t.user_scripts.api_script&&{api_script:h("user_scripts/api_script.js",t.user_scripts.api_script,e)}}}}function mo(t){return t.web_accessible_resources&&t.web_accessible_resources.length&&{web_accessible_resources:t.web_accessible_resources}}function go(t,e){return{...Xn(t,e),...Zn(t,e),...Yn(t,e),...Kn(t,e),...eo(t,e),...to(t,e),...so(t,e),...no(t,e),...oo(t,e),...Pt(t,e),...co(t,e),...po(t,e),...uo(t,e),...fo(t,e),...mo(t)}}function yo(t,e,s){let r=e||require(t),i=c=>Array.isArray(c)?c.map(p=>n(p)):typeof c=="string"?[n(c)]:[],n=c=>{let p=ho.default.dirname(t),l=c.replace(p,"");return l.startsWith("/")?l.slice(1):l},o=Object.entries(s).flatMap(([,c])=>i(c));return JSON.stringify({...r,...go(r,o),...Bn(r,o),...Gn(r,o)},null,2)}var kt=class{manifestPath;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.excludeList=e.excludeList}applyDevOverrides(e){return e.content_scripts?e.content_scripts.map((s,r)=>(s.css.length&&!s.js.length&&(s.js=[h(`content_scripts-${r}`,"dev.js",[])]),s)):{}}apply(e){e.hooks.thisCompilation.tap("manifest:update-manifest",s=>{s.hooks.processAssets.tap({name:"manifest:update-manifest",stage:Et.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},()=>{if(s.errors.length>0)return;let r=G(s,this.manifestPath),i=yo(this.manifestPath,r,this.excludeList||{}),n={...r,...JSON.parse(i)};e.options.mode!=="production"&&n.content_scripts&&(n.content_scripts=this.applyDevOverrides(n));let o=JSON.stringify(n,null,2),c=new Et.sources.RawSource(o);s.updateAsset("manifest.json",c)})})}};var bo=a(require("fs")),jt=class{dependencyList;constructor(e){this.dependencyList=e}apply(e){e.hooks.afterCompile.tap("ManifestPlugin (AddDependenciesPlugin)",s=>{if(s.errors?.length)return;let r=new Set(s.fileDependencies);this.dependencyList&&this.dependencyList.forEach(i=>{bo.default.existsSync(i)&&(r.has(i)||(r.add(i),s.fileDependencies.add(i)))})})}};var wo=a(require("fs")),xo=a(require("path")),Ct=a(require("webpack"));var $t=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}extractPaths(e){let s=Array.isArray(e)?e:[e];if(typeof s[0]=="string")return s;let r=[];if(typeof e=="object"&&!Array.isArray(e)){let i=e;i.light&&r.push(i.light),i.dark&&r.push(i.dark)}return r}handleErrors(e,s){let r=[".png",".jpg",".jpeg",".svg",".gif",".webp"],i=[".json"],n=[".js",".ts",".jsx",".tsx",".mjs",".cjs"],o=".html",c=Object.entries(this.includeList||{});for(let[p,l]of c)if(l){let f=this.extractPaths(l);for(let d of f){let g=xo.default.extname(d),j=require(this.manifestPath).name||"Extension.js",$=ae(j,p,d);wo.default.existsSync(d)||(r.includes(g)?e.errors.push(new s($)):i.includes(g)?e.errors.push(new s($)):n.includes(g)?e.errors.push(new s($)):g===o?e.errors.push(new s($)):e.errors.push(new s($)))}}}apply(e){e.hooks.compilation.tap("manifest:check-manifest-files",s=>{s.hooks.processAssets.tap({name:"compatibility:check-manifest-files",stage:Ct.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT},()=>{let r=Ct.default.WebpackError;this.handleErrors(s,r)})})}};var vo=a(require("fs")),Lt=a(require("webpack"));var Dt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}flattenAndSort(e){return e.flat(1/0).sort()}apply(e){e.hooks.watchRun.tapAsync("manifest:throw-if-recompile-is-needed",(s,r)=>{if((s.modifiedFiles||new Set).has(this.manifestPath)){let n=s.options.context||"",o=`${n}/package.json`;if(!vo.default.existsSync(o)){r();return}let c=require(this.manifestPath),p=this.flattenAndSort(Object.values(De(n,c))),l=this.flattenAndSort(Object.values(Le(n,c)));s.hooks.thisCompilation.tap("manifest:throw-if-recompile-is-needed",f=>{f.hooks.processAssets.tap({name:"manifest:check-manifest-files",stage:Lt.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY},()=>{let g=f.getAsset("manifest.json")?.source.source().toString(),y=JSON.parse(g||"{}"),j=this.flattenAndSort(Object.values(De(n,y))),$=this.flattenAndSort(Object.values(Le(n,y)));if(l.toString()!==$.toString()||p.toString()!==j.toString()){let q=p.filter(W=>!j.includes(W))[0],U=j.filter(W=>!p.includes(W))[0],H=require(this.manifestPath).name,Se=ri(H,U,q);f.errors.push(new Lt.default.WebpackError(Se))}})})}r()})}};var Ft=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new vt({manifestPath:this.manifestPath}).apply(e),new $t({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new kt({manifestPath:this.manifestPath,excludeList:this.excludeList}).apply(e),new jt([this.manifestPath]).apply(e),new Dt({manifestPath:this.manifestPath,includeList:this.includeList}).apply(e)}};var er=a(require("path"));var Ys=a(require("fs")),Mt=a(require("webpack")),Eo=require("webpack");var _o=a(require("fs")),he=a(require("path")),So=a(require("parse5-utils"));var ge=a(require("parse5-utils"));function It(t){try{return new URL(t),!0}catch{return!1}}function Ie(t,e){let{childNodes:s=[]}=t;for(let r of s)if(r.nodeName==="script"){let i=ge.default.getAttribute(r,"src");if(!i||It(i))continue;e({filePath:i,childNode:r,assetType:"script"})}else if(r.nodeName==="link"){let i=ge.default.getAttribute(r,"href"),n=ge.default.getAttribute(r,"rel");if(!i||It(i))continue;e(n==="dns-prefetch"||n==="icon"||n==="manifest"||n==="modulepreload"||n==="preconnect"||n==="prefetch"||n==="preload"||n==="prerender"?{filePath:i,childNode:r,assetType:"staticHref"}:{filePath:i,childNode:r,assetType:"css"})}else if(r.nodeName==="a"||r.nodeName==="area"){let i=ge.default.getAttribute(r,"href");if(!i||It(i))continue;e({filePath:i,childNode:r,assetType:"staticHref"})}else if(r.nodeName==="audio"||r.nodeName==="embed"||r.nodeName==="iframe"||r.nodeName==="img"||r.nodeName==="input"||r.nodeName==="source"||r.nodeName==="track"||r.nodeName==="video"){let i=ge.default.getAttribute(r,"src");if(!i||It(i))continue;e({filePath:i,childNode:r,assetType:"staticSrc"})}else Ie(r,e)}function D(t,e){let s={css:[],js:[],static:[]};if(!t)return s;let r=e||_o.default.readFileSync(t,{encoding:"utf8"}),i=So.default.parse(r),n=(o,c)=>he.default.join(he.default.dirname(o),c.startsWith("/")?he.default.relative(he.default.dirname(o),c):c);for(let o of i.childNodes)if(o.nodeName==="html"){for(let c of o.childNodes)(c.nodeName==="head"||c.nodeName==="body")&&Ie(c,({filePath:p,assetType:l})=>{let f=n(t,p);switch(l){case"script":s.js?.push(f);break;case"css":s.css?.push(f);break;case"staticSrc":case"staticHref":if(p.startsWith("#"))break;s.static?.push(f);break;default:break}});return{css:s.css,js:s.js,static:s.static}}}function Po(t,e,s){let r=Object.keys(t).find(n=>{let o=t[n];return t[n]===e||D(o)?.js?.includes(e)||D(o)?.css?.includes(e)})||"",i=Zs(e);return r?`/${r.replace(i,"")}${s}`:`${e.replace(i,"")}${s}`}function Zs(t){switch(he.default.extname(t)){case".js":case".mjs":case".ts":case".tsx":return".js";case".css":case".scss":case".sass":case".less":return".css";case".html":return".html";default:return".js"}}function Z(t,e,s){return s?`/${t}${e}`:`${t}${e}`}function ko(t,e){return Object.values(e||{}).some(s=>s===t)}var At=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let r=require(this.manifestPath).name||"Extension.js";e.hooks.thisCompilation.tap("html:emit-html-file",i=>{i.hooks.processAssets.tap({name:"AddAssetsToCompilationPlugin",stage:Mt.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{let n=Object.entries(this.includeList||{});for(let o of n){let[c,p]=o;if(p){if(!Ys.default.existsSync(p)){let f=ae(r,c,p);i.warnings.push(new Mt.default.WebpackError(f));return}let l=Ys.default.readFileSync(p,"utf8");if(!S(p,this.excludeList)){let f=new Eo.sources.RawSource(l),d=Z(c,".html");i.emitAsset(d,f)}}}})})}};var Ot=a(require("fs")),ye=a(require("path")),jo=a(require("webpack")),Ae=require("webpack");var Tt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-assets-to-compilation",s=>{s.hooks.processAssets.tap({name:"html:add-assets-to-compilation",stage:Ae.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL},()=>{if(s.errors.length>0)return;let r=Object.entries(this.includeList||{});for(let i of r){let[n,o]=i,c=n+".html";if(o){let p=s.getAsset(c);if(p){let l=p.source.source().toString(),f=D(o,l)?.static,d=[...new Set(f)];for(let g of d)if(!g.includes("public/")){if(!Ot.default.existsSync(g)&&!ko(g,this.includeList)&&!ye.default.basename(g).startsWith("#")){let U=Ze(require(this.manifestPath).name,o,g);s.warnings.push(new jo.default.WebpackError(U));return}let y=Ot.default.readFileSync(g),j=new Ae.sources.RawSource(y),$=ye.default.join("assets",ye.default.basename(g));if(!s.getAsset($))if(g.endsWith(".html")){let q=D(g),U=[...q?.js||[],...q?.css||[],...q?.static||[]];s.emitAsset($,j),U.forEach(H=>{let Se=Ot.default.readFileSync(H),W=new Ae.sources.RawSource(Se),Or=ye.default.join("assets",ye.default.basename(H));s.getAsset(Or)||s.emitAsset(Or,W)})}else s.emitAsset($,j)}}}}})})}};var $o=a(require("path")),Ks=a(require("fs"));var Rt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){let s=this.includeList||{};for(let r of Object.entries(s)){let[i,n]=r;if(n){if(!Ks.default.existsSync(n))return;let o=D(n),c=o?.js||[],p=o?.css||[],l=[...c,...p].filter(f=>!S(f,this.excludeList));if(e.options.mode==="development"){let f=$o.default.resolve(__dirname,"minimum-script-file.mjs");l.push(f)}Ks.default.existsSync(n)&&(S(n,this.excludeList)||(e.options.entry={...e.options.entry,[i]:{import:l}}))}}}};var qt=require("webpack");var Qs=a(require("fs")),Y=a(require("path")),L=a(require("parse5-utils"));function Co(t,e,s,r,i){let n=Qs.default.readFileSync(s,{encoding:"utf8"}),o=L.default.parse(n),c=!!t.getAsset(e+".css"),p=!1;for(let l of o.childNodes)if(l.nodeName==="html"){for(let f of l.childNodes){if((f.nodeName==="head"||f.nodeName==="body")&&Ie(f,({filePath:d,childNode:g,assetType:y})=>{let j=Y.default.dirname(s),$=Y.default.resolve(j,d),q=Zs($),U=S(Y.default.resolve(j,d),i),H=Y.default.join("/",Y.default.normalize(d)),Se=yi($,r);switch(y){case"script":{U?l=L.default.setAttribute(g,"src",H):(l=L.default.remove(g),p=!0);break}case"css":{U?l=L.default.setAttribute(g,"href",H):(l=L.default.remove(g),c=!0);break}case"staticHref":case"staticSrc":{if(U)l=L.default.setAttribute(g,y==="staticSrc"?"src":"href",H);else if(Se){let W=Po(r,$,q);l=L.default.setAttribute(g,y==="staticSrc"?"src":"href",W)}else{let W=Y.default.join("assets",Y.default.basename($,q));Qs.default.existsSync($)&&(l=L.default.setAttribute(g,y==="staticSrc"?"src":"href",Z(W,"",!0)))}break}default:break}}),f.nodeName==="head"&&c&&t.options.mode==="production"){let d=L.default.createNode("link");d.attrs=[{name:"rel",value:"stylesheet"},{name:"href",value:Z(e,".css",!0)}],L.default.append(f,d)}if(f.nodeName==="body"&&(p||t.options.mode!=="production")){let d=L.default.createNode("script");d.attrs=[{name:"src",value:Z(e,".js",!0)}],L.default.append(f,d)}}return L.default.serialize(o)}}var Nt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("html:update-html-file",s=>{s.hooks.processAssets.tap({name:"html:update-html-file",stage:qt.Compilation.PROCESS_ASSETS_STAGE_DERIVED},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[n,o]=i;if(o){let c=Co(s,n,o,r,this.excludeList||{});if(!S(o,this.excludeList)&&c){let p=new qt.sources.RawSource(c),l=Z(n,".html");s.updateAsset(l,p)}}}})})}};var Do=a(require("fs")),Lo=require("webpack");var Ut=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.thisCompilation.tap("html:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"html:add-to-file-dependencies",stage:Lo.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[,n]=i;if(n){let o=D(n),c=new Set(s.fileDependencies);if(Do.default.existsSync(n)){let p=[n,...o?.static||[]];for(let l of p)c.has(l)||(c.add(l),l===n&&s.fileDependencies.add(l))}}}})})}};var Fo=a(require("fs"));var Wt=class{manifestPath;includeList;initialHtmlAssets={};constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}hasEntriesChanged(e,s){if(!s||!e||e.length!==s.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==s[r])return!0;return!1}storeInitialHtmlAssets(e){Object.entries(e).forEach(([s,r])=>{let i=r;if(i){if(!Fo.default.existsSync(i)){let o=require(this.manifestPath).name||"Extension.js";console.error(ae(o,s,i)),process.exit(1)}this.initialHtmlAssets[i]={js:D(i)?.js||[],css:D(i)?.css||[]}}})}apply(e){let s=this.includeList||{};this.storeInitialHtmlAssets(s),e.hooks.make.tapAsync("html:throw-if-recompile-is-needed",(r,i)=>{let n=e.modifiedFiles||new Set,o=Array.from(n)[0];if(o&&this.initialHtmlAssets[o]){let c=D(o)?.js||[],p=D(o)?.css||[],{js:l,css:f}=this.initialHtmlAssets[o];if(this.hasEntriesChanged(p,f)||this.hasEntriesChanged(c,l)){let d=require(this.manifestPath).name;console.log(pi(d,o))}}i()})}};var Io=a(require("fs")),Ao=require("webpack");function Hp(t,e,s){let r="Module not found: Error: Can't resolve ",n=s.message.replace(r,"").split("'")[1];if(s.message.includes(r))for(let o of Object.entries(e)){let[,c]=o;if(c){if(!Io.default.existsSync(c))return null;let p=D(c),l=p?.js||[],f=p?.css||[];if(l.includes(n)||f.includes(n)){let d=Ze(require(t).name,c,n);return new Ao.WebpackError(d)}}}return null}var Bt=class{manifestPath;includeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList}apply(e){e.hooks.compilation.tap("html:handle-common-errors",s=>{s.hooks.afterSeal.tapPromise("html:handle-common-errors",async()=>{s.errors.forEach((r,i)=>{let n=Hp(this.manifestPath,this.includeList||{},r);n&&(s.errors[i]=n)})})})}};var Jt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new At({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Tt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Rt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Nt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[er.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(er.default.join(__dirname,"ensure-hmr-for-scripts.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}}]}),new Ut({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Wt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new Bt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var se=a(require("path"));var tr=a(require("fs")),Mo=a(require("path"));function Oo(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(i=>{let n=tr.default.existsSync(i)&&!S(i,e),o=Mo.default.extname(i);return n&&i.includes(o)})}function To(t,e){return(Array.isArray(t)?t||[]:t?[t]:[]).filter(i=>tr.default.existsSync(i)&&!S(i,e)&&(i.endsWith(".css")||i.endsWith(".scss")||i.endsWith(".sass")||i.endsWith(".less")))}var zt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=this.includeList||{};for(let r of Object.entries(s)){let[i,n]=r,o=Oo(n,this.excludeList),c=To(n,this.excludeList),p=[...o];e.options.mode==="production"&&p.push(...c),(c.length||o.length)&&(e.options.entry={...e.options.entry,[i]:{import:p}})}}};var te=require("webpack"),Vp=['var isBrowser = !!(() => { try { return browser.runtime.getURL("/") } catch(e) {} })()','var isChrome = !!(() => { try { return chrome.runtime.getURL("/") } catch(e) {} })()'],Gp=[...Vp,`var runtime = isBrowser ? browser : isChrome ? chrome : (typeof self === 'object' && self.addEventListener) ? { get runtime() { throw new Error("No chrome or browser runtime found") } } : { runtime: { getURL: x => x } }`],Ht=class t{apply(e){let{RuntimeGlobals:s}=e.webpack;e.hooks.compilation.tap("PublicPathRuntimeModule",r=>{r.hooks.runtimeRequirementInTree.for(s.publicPath).tap(t.name,i=>{let n=Xp();return r.addRuntimeModule(i,n),!0})})}};function Xp(){class t extends te.RuntimeModule{constructor(){super("publicPath",te.RuntimeModule.STAGE_BASIC)}generate(){let s=this.compilation?.outputOptions.publicPath;return te.Template.asString([...Gp,`var path = ${JSON.stringify(this.compilation?.getPath(s||"",{hash:this.compilation.hash||"XXXX"}))}`,`${te.RuntimeGlobals.publicPath} = typeof importScripts === 'function' || !(isBrowser || isChrome) ? path : runtime.runtime.getURL(path);`])}}return new t}var Vt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList||{},this.excludeList=e.excludeList||{}}apply(e){let s=require(this.manifestPath);if(s.content_scripts?.some(r=>r.world&&r.world.toLowerCase()==="main")){if(s.id||(console.error(fi(s.name||"")),process.exit(1)),this.browser==="firefox"){e.options.output.publicPath=`moz-extension://${s.id}/`;return}e.options.output.publicPath=`${this.browser}-extension://${s.id}/`}}};var Gt=class{manifestPath;browser;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new zt({manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[se.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(se.default.join(__dirname,"inject-content-css-during-dev.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[se.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:require.resolve(se.default.join(__dirname,"add-hmr-accept-code.js")),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]}),e.options.mode==="production"&&new Ht().apply(e),new Vt({manifestPath:this.manifestPath,browser:this.browser||"chrome",includeList:this.includeList||{},excludeList:this.excludeList||{}}).apply(e),e.options.mode==="development"&&e.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[se.default.dirname(this.manifestPath)],exclude:/node_modules/,use:[{loader:se.default.resolve(__dirname,"./add-query-param-to-imported-css.js"),options:{manifestPath:this.manifestPath,includeList:this.includeList||{},excludeList:this.excludeList||{}}}]})}};var rr=a(require("path")),Me=a(require("fs")),ir=a(require("webpack")),Oe=require("webpack");var be=a(require("path")),Xt=a(require("fs"));function sr(t){let e=be.default.join(be.default.dirname(t),"_locales"),s=[];if(Xt.default.existsSync(e))for(let r of Xt.default.readdirSync(e)){let i=be.default.join(e,r);for(let n of Xt.default.readdirSync(i))s.push(be.default.join(be.default.dirname(t),"_locales",r,n))}return s}var Zt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:Oe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{let i=require(this.manifestPath).name||"Extension.js";if(!Me.default.existsSync(this.manifestPath)){s.errors.push(new ir.default.WebpackError(ti(i)));return}if(s.errors.length>0)return;let n=sr(this.manifestPath);for(let o of Object.entries(n||[])){let[c,p]=o,l=p;if(l){if(!Me.default.existsSync(l)){s.warnings.push(new ir.default.WebpackError(Ye(i,c,l)));return}let f=Me.default.readFileSync(l),d=new Oe.sources.RawSource(f),g=e.options.context||rr.default.dirname(this.manifestPath);if(!S(l,this.excludeList)){let y=rr.default.relative(g,l);s.emitAsset(y,d)}}}})}),e.hooks.thisCompilation.tap("locales:module",s=>{s.hooks.processAssets.tap({name:"locales:module",stage:Oe.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=sr(this.manifestPath);for(let i of Object.entries(r||[])){let[,n]=i;if(n){let o=new Set(s.fileDependencies),c=r||[];for(let p of c)Me.default.existsSync(p)&&(o.has(p)||(o.add(p),s.fileDependencies.add(p)))}}})})}};var Yt=a(require("fs")),Ro=a(require("webpack")),Te=require("webpack");var Kt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:Te.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[n,o]=i,c=Array.isArray(o)?o:[o];for(let p of c)if(p&&!S(p,this.excludeList)){if(!Yt.default.existsSync(p)){let g=require(this.manifestPath).name||"Extension.js";s.warnings.push(new Ro.default.WebpackError(Ye(g,n,p)));return}let l=Yt.default.readFileSync(p),f=new Te.sources.RawSource(l);s.emitAsset(n+".json",f)}}})}),e.hooks.thisCompilation.tap("json:module",s=>{s.hooks.processAssets.tap({name:"json:module",stage:Te.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[,n]=i,o=Array.isArray(n)?n:[n];for(let c of o)if(c){let p=new Set(s.fileDependencies);S(c,this.excludeList)||Yt.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var nr=a(require("fs")),No=a(require("path")),es=require("webpack");var Qt=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:emit-file",s=>{s.hooks.processAssets.tap({name:"icons:emit-file",stage:es.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER},()=>{if(s.errors.length>0)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[n,o]=i;if(o===void 0)continue;let c=Array.isArray(o)?typeof o[0]=="string"?o:o.map(Object.values).flat():[o];for(let p of c)if(p){if(!nr.default.existsSync(p))continue;if(!S(p,this.excludeList)){let l=nr.default.readFileSync(p),f=new es.sources.RawSource(l),d=No.default.basename(p),y=`${n.endsWith("theme_icons")?n.replace("theme_icons",""):n}/${d}`;s.emitAsset(y,f)}}}})})}};var qo=a(require("fs")),Uo=require("webpack"),ts=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){e.hooks.thisCompilation.tap("icons:add-to-file-dependencies",s=>{s.hooks.processAssets.tap({name:"icons:add-to-file-dependencies",stage:Uo.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS},()=>{if(s.errors?.length)return;let r=this.includeList||{};for(let i of Object.entries(r)){let[,n]=i,o=Array.isArray(n)?typeof n[0]=="string"?n:n.map(Object.values).flat():[n];for(let c of o)if(c){let p=new Set(s.fileDependencies);qo.default.existsSync(c)&&(p.has(c)||(p.add(c),s.fileDependencies.add(c)))}}})})}};var ss=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}apply(e){new Qt({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e),new ts({manifestPath:this.manifestPath,includeList:this.includeList,excludeList:this.excludeList}).apply(e)}};var is=require("webpack");var rs=class{manifestPath;includeList;excludeList;constructor(e){this.manifestPath=e.manifestPath,this.includeList=e.includeList,this.excludeList=e.excludeList}generateManifestPatches(e,s){let r=G(e,this.manifestPath),i=r.web_accessible_resources||[],n=r.web_accessible_resources||[];for(let[p,l]of Object.entries(s)){let f=r.content_scripts?.find(d=>d.js&&d.js.some(g=>g.includes(p)));if(f){let d=f.matches||[];if(r.manifest_version===3){let g=i.find(y=>y.matches.some(j=>d.includes(j)));g?l.forEach(y=>{g.resources.includes(y)||g.resources.push(y)}):i.push({resources:l.filter(y=>!y.endsWith(".map")),matches:d})}else l.forEach(g=>{n.includes(g)||n.push(g)})}}r.manifest_version===3?r.web_accessible_resources=i:r.web_accessible_resources=Array.from(new Set(n));let o=JSON.stringify(r,null,2),c=new is.sources.RawSource(o);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",c)}apply(e){e.hooks.thisCompilation.tap("plugin-extension:feature-web-resources",s=>{s.hooks.processAssets.tap({name:"plugin-extension:feature-web-resources",stage:is.Compilation.PROCESS_ASSETS_STAGE_ANALYSE},()=>{let r=[],i=Object.keys(this.includeList||{});for(let c of i.filter(Boolean))c.startsWith("content_scripts")&&(Array.isArray(c)?r.push(...c):typeof c=="string"&&r.push(c));let n=s.chunkGraph,o={};s.entrypoints.forEach((c,p)=>{if(r.includes(p)){let l=[];c.chunks.forEach(f=>{Array.from(n.getChunkModulesIterable(f)).forEach(g=>{n.getModuleChunks(g).forEach(y=>{y.auxiliaryFiles.forEach(j=>{l.includes(j)||l.push(j)})})})}),o[p]=l}}),this.generateManifestPatches(s,o)})})}};var F=a(require("fs")),I=a(require("path")),Wo=a(require("chokidar")),ns=class{options;constructor(e){this.options=e}ensureDirectoryExistence(e){let s=I.default.dirname(e);if(F.default.existsSync(s))return!0;F.default.mkdirSync(s,{recursive:!0})}copyFile(e,s){this.ensureDirectoryExistence(s),F.default.copyFileSync(e,s)}copyFolder(e,s){F.default.existsSync(s)||F.default.mkdirSync(s,{recursive:!0}),F.default.readdirSync(e).forEach(i=>{let n=I.default.join(e,i),o=I.default.join(s,i);F.default.statSync(n).isDirectory()?this.copyFolder(n,o):this.copyFile(n,o)})}apply(e){let s=I.default.dirname(this.options.manifestPath),r=I.default.join(s,"public"),i=e.options.output?.path||"";F.default.existsSync(r)&&(e.hooks.afterEmit.tap("special-folders:copy-public-folder",()=>{let n=I.default.join(i,"public");F.default.existsSync(n)||F.default.mkdirSync(n,{recursive:!0}),F.default.existsSync(r)&&this.copyFolder(r,n)}),e.options.mode!=="production"&&e.hooks.afterPlugins.tap("special-folders:copy-public-folder",()=>{let n=I.default.join(s,"public"),o=Wo.default.watch(n,{ignoreInitial:!0});o.on("add",c=>{let p=I.default.join(i,I.default.relative(s,c));this.copyFile(c,p)}),o.on("change",c=>{let p=I.default.join(i,I.default.relative(s,c));this.copyFile(c,p)}),o.on("unlink",c=>{let p=I.default.join(i,I.default.relative(s,c));F.default.existsSync(p)&&F.default.unlinkSync(p)}),e.hooks.watchClose.tap("special-folders:copy-public-folder",()=>{o.close().catch(console.error)})}))}};var N=a(require("path")),or=a(require("chokidar"));var os=class{manifestPath;constructor(e){this.manifestPath=e}throwCompilationError(e,s,r){let i=N.relative(process.cwd(),s),p=ii(r?"Adding":"Removing",r?"added":"removed",e,e==="pages"?"HTML pages":"script files",i);if(r){console.warn(p);return}console.error(p),process.exit(1)}apply(e){e.hooks.afterPlugins.tap("special-folders:warn-upon-folder-changes",()=>{let s=N.dirname(this.manifestPath),r=N.join(s,"pages"),i=N.join(s,"scripts"),n=or.watch(r,{ignoreInitial:!0}),o=or.watch(i,{ignoreInitial:!0}),c=e.options.resolve?.extensions;n.on("add",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p,!0)}),n.on("unlink",p=>{p.endsWith(".html")&&this.throwCompilationError("pages",p)}),o.on("add",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p,!0)}),o.on("unlink",p=>{c?.includes(N.extname(p))&&this.throwCompilationError("scripts",p)}),e.hooks.watchClose.tap("WarnUponFolderChanges",()=>{n.close().catch(console.error),o.close().catch(console.error)})})}};var as=class{static name="plugin-special-folders";options;constructor(e){this.options=e}apply(e){let{manifestPath:s}=this.options;new ns({manifestPath:s}).apply(e),e.options.mode==="development"&&e.options.watchOptions&&new os(s).apply(e)}};var cs=class{static name="plugin-extension";manifestPath;browser;mode;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.mode=e.mode}apply(e){let s=this.manifestPath,r=An({manifestPath:s}),i=Mn({manifestPath:s});new xt({manifestPath:s,includeList:{...i?.pages||{},...i?.scripts||{}},excludeList:i.public,loaderOptions:{jsx:me(Re.default.dirname(this.manifestPath))||X(Re.default.dirname(this.manifestPath))||Ce(Re.default.dirname(this.manifestPath)),typescript:R(Re.default.dirname(this.manifestPath)),minify:this.mode==="production"}}).apply(e),new Ft({browser:this.browser,manifestPath:s,includeList:{...r.html,...r.icons,...r.json,...r.scripts},excludeList:i.public}).apply(e),new Jt({manifestPath:s,includeList:{...r.html,...i.pages},excludeList:{...i.public,...i.scripts}}).apply(e),new Gt({manifestPath:s,browser:this.browser,includeList:{...r.scripts,...i.scripts},excludeList:{...i.public,...i.pages}}).apply(e),new Zt({manifestPath:s}).apply(e),new Kt({manifestPath:s,includeList:r.json,excludeList:i.public}).apply(e),new ss({manifestPath:s,includeList:r.icons,excludeList:i.public}).apply(e),new rs({manifestPath:s,includeList:{...r.scripts,...i.scripts},excludeList:i.public}).apply(e),new as({manifestPath:s}).apply(e)}};var We=a(require("path"));var Bo=a(require("path")),Jo=a(require("ws")),ls=a(require("browser-extension-manifest-fields"));function ps(t,e){t.clients.forEach(s=>{s.readyState===Jo.default.OPEN&&s.send(JSON.stringify(e))})}function zo(t,e,s){if(!s||!e)return;let r=(0,ls.default)(e).locales,i=(0,ls.default)(e).scripts,n=(0,ls.default)(e).json;if(!t){process.env.EXTENSION_ENV==="development"&&console.error("WebSocket server is not running.");return}Bo.default.basename(s)==="manifest.json"&&ps(t,{changedFile:"manifest.json"}),r?.forEach(o=>{o.includes(s)&&ps(t,{changedFile:"_locales"})}),Object.entries(i).forEach(([o,c])=>{let p=Array.isArray(c)?c:[c];Object.values(p).flatMap(f=>f).includes(s)&&o==="background/service_worker"&&ps(t,{changedFile:"service_worker"})}),Object.entries(n).forEach(([o,c])=>{c?.includes(s)&&o==="declarative_net_request"&&ps(t,{changedFile:"declarative_net_request"})})}var cr=a(require("path")),Xo=a(require("fs")),Zo=a(require("ws"));var Ne=a(require("path")),Vo=a(require("https")),ar=a(require("fs"));var Ho=t=>{if(!ar.default.existsSync(t))return;let e=Ne.default.basename(t);return ar.default.readFileSync(Ne.default.join(__dirname,"certs",e))};function Go(t,e){let s={key:Ho(Ne.default.join(__dirname,"certs","localhost.key")),cert:Ho(Ne.default.join(__dirname,"certs","localhost.cert"))},r=Vo.default.createServer(s,(i,n)=>{n.writeHead(200),n.end()});return r.listen(e,"127.0.0.1"),r.on("error",i=>{throw console.error(ui(t,e)),new Error(i.message)}),{server:r,port:e}}function Zp(t){return new Promise(e=>{let s=require("net").createServer();s.once("error",function(r){r.code==="EADDRINUSE"?e(!0):e(!1)}),s.once("listening",function(){s.close(),e(!1)}),s.listen(t)})}var qe=null;async function Yo(t,e){let s=t.options.context||"",r=require(cr.default.join(s,"manifest.json")),i=r.name||"Extension.js",n=e.port||8e3,o=await Zp(n);if(!qe&&!o){let{server:c}=Go(i,n);qe=new Zo.default.Server({server:c}),qe.on("connection",p=>{p.send(JSON.stringify({status:"serverReady"})),p.on("error",l=>{console.log(ai(i,l))}),p.on("message",l=>{let f=JSON.parse(l.toString());if(f.status==="clientReady"){let d=require(cr.default.join(s,"manifest.json"));console.log(Rs(d,f)),console.log(""),Ws(e.browser)&&setTimeout(()=>{console.log(oi(e.browser))},5e3)}})})}else if(!qe)return;if(e.browser==="firefox"&&!o&&!Xo.default.existsSync(Xe)){let c=bi(r);console.log(Rs(r,c)),console.log(""),Ws("firefox")&&(console.log(li()),console.log(""))}return qe}var pr=a(require("path")),Ue=a(require("fs"));function Ko(t){let e=pr.default.resolve(__dirname,"./extensions/manager-extension/reload-service.js"),s=pr.default.resolve(__dirname,"./extensions/manager-extension-firefox/reload-service.js");Ue.default.readFile(e,"utf8",(r,i)=>{if(r){console.error(`Error reading file: ${r.message}`);return}let n=i.replace(/__RELOAD_PORT__/g,t.toString());Ue.default.writeFile(e,n,"utf8",o=>{o&&console.error(`Error writing to file: ${o.message}`)})}),Ue.default.readFile(s,"utf8",(r,i)=>{if(r){console.error(`Error reading file: ${r.message}`);return}let n=i.replace(/__RELOAD_PORT__/g,t.toString());Ue.default.writeFile(s,n,"utf8",o=>{o&&console.error(`Error writing to file: ${o.message}`)})})}process.on("SIGINT",()=>{process.exit()});process.on("SIGTERM",()=>{process.exit()});var Be=class{manifestPath;port;browser;stats;constructor(e){this.manifestPath=e.manifestPath,this.port=e.port||8e3,this.browser=e.browser||"chrome",this.stats=e.stats}async apply(e){if(!this.manifestPath)return;Ko(this.port);let s=await Yo(e,{...this,mode:e.options.mode,browser:this.browser,stats:this.stats,port:this.port});e.hooks.watchRun.tapAsync("reload:create-web-socket-server",(r,i)=>{let o=(r.modifiedFiles||new Set).values().next().value;if(!o){i();return}let c=We.default.relative(We.default.dirname(this.manifestPath),o),p=We.default.relative(process.cwd(),We.default.dirname(o));process.env.EXTENSION_ENV==="development"&&console.info(`\u25BA\u25BA Updated file \`${c}\` (relative to ${p})`),this.manifestPath&&zo(s,this.manifestPath,o),i()})}};var lr=a(require("path"));function ur(t,e){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[lr.default.dirname(e)],exclude:/node_modules/,use:[{loader:lr.default.resolve(__dirname,"./inject-chromium-client-loader"),options:{manifestPath:e}}]})}var fr=a(require("path"));function mr(t,e){t.options.module.rules.push({test:/\.(js|mjs|jsx|mjsx|ts|mts|tsx|mtsx)$/,include:[fr.default.dirname(e)],exclude:/node_modules/,use:[{loader:fr.default.resolve(__dirname,"./inject-firefox-client-loader"),options:{manifestPath:e}}]})}var us=require("webpack");var dr=a(require("content-security-policy-parser"));function Qo(t){let e=t.content_security_policy;if(!e)return"script-src 'self' 'unsafe-eval' blob: filesystem:; object-src 'self' blob: filesystem:; ";let s=(0,dr.default)(e);e="",s.get("script-src")||s.set("script-src",["'self' 'unsafe-eval' blob: filesystem:"]),s.get("script-src")?.includes("'unsafe-eval'")||s.set("script-src",["unsafe-eval"]);for(let r in s)e+=`${r} ${s.get(r)?.join(" ")};`;return e}function ea(t){let e=t.content_security_policy;if(!e)return{extension_pages:"script-src 'self'; object-src 'self'; "};let s=(0,dr.default)(e.extension_pages||""),r="";for(let i in s)r+=`${i} ${s.get(i)?.join(" ")}; `;return{extension_pages:r.trim()}}function ta(t){let e=["/*.json","/*.js","/*.css"],s=t.web_accessible_resources;if(!s||s.length===0)return e;let r=new Set(s);for(let i of e)r.has(i)||r.add(i);return Array.from(r)}function sa(t){let e=["/*.json","/*.js","/*.css"];return[...t.web_accessible_resources||[],{resources:e,matches:["<all_urls>"]}]}function gr(t,e){return t.background?{background:{...t.background}}:e==="firefox"?{background:{...t.background||{},scripts:["background/script.js"]}}:t.manifest_version===2?{background:{...t.background||{},scripts:["background/script.js"]}}:{background:{...t.background||{},service_worker:"background/service_worker.js"}}}function hr(t){return t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:[...new Set(t.externally_connectable.ids||[]),"*"]}}:t.externally_connectable&&!t.externally_connectable.ids?{externally_connectable:{...t.externally_connectable,ids:["*"]}}:{}}var yr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}generateManifestPatches(e){let s=G(e,this.manifestPath),r={...s,content_security_policy:s.manifest_version===3?ea(s):Qo(s),...s.manifest_version===3?s.permissions?{permissions:[...new Set(["scripting",...s.permissions])]}:{permissions:["scripting"]}:{},...gr(s,this.browser),...hr(s),web_accessible_resources:s.manifest_version===3?sa(s):ta(s)},i=JSON.stringify(r,null,2),n=new us.sources.RawSource(i);e.getAsset("manifest.json")&&e.updateAsset("manifest.json",n)}apply(e){e.hooks.thisCompilation.tap("run-chromium:apply-manifest-dev-defaults",s=>{s.hooks.processAssets.tap({name:"run-chromium:apply-manifest-dev-defaults",stage:us.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE},r=>{if(!this.manifestPath){let i="No manifest.json found in your extension bundle. Unable to patch manifest.json.";s&&e.webpack.WebpackError&&s.errors.push(new e.webpack.WebpackError(`run-chromium: ${i}`));return}this.generateManifestPatches(s)})})}},ra=yr;var br=a(require("fs")),we=a(require("path")),ia=a(require("webpack-target-webextension"));var wr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}handleBackground(e,s,r){let i=we.default.resolve(__dirname,s==="firefox"?"minimum-firefox-file.mjs":"minimum-chromium-file.mjs"),n=we.default.dirname(this.manifestPath),o=r.background;if(s==="firefox"){o=r["gecko:background"]||r["firefox:background"]||o;let c=o?.scripts||o?.["gecko:scripts"]||o?.["firefox:scripts"];if(c&&c.length>0){let p=we.default.join(n,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",i)}else if(o=r["chromium:background"]||r["chrome:background"]||r["edge:background"]||o,r.manifest_version===3){let c=o?.service_worker||o?.["chromium:service_worker"]||o?.["chrome:service_worker"]||o?.["edge:service_worker"];if(c){let p=we.default.join(n,c);this.ensureFileExists(p,"background.service_worker")}else this.addDefaultEntry(e,"background/service_worker",i)}else if(r.manifest_version===2){let c=o?.scripts||o?.["chromium:scripts"]||o?.["chrome:scripts"]||o?.["edge:scripts"];if(c&&c.length>0){let p=we.default.join(n,c[0]);this.ensureFileExists(p,"background.scripts")}else this.addDefaultEntry(e,"background/script",i)}}ensureFileExists(e,s){if(!br.default.existsSync(e)&&this.manifestPath){let i=require(this.manifestPath).name||"Extension.js",n=ci(i,s,e);throw console.error(n),new Error(n)}}addDefaultEntry(e,s,r){e.options.entry={...e.options.entry,[s]:{import:[r]}}}getEntryName(e){if(e.background){if(e.manifest_version===3)return{serviceWorkerEntry:"background/service_worker"};if(e.manifest_version===2)return{pageEntry:"background/script"}}return{pageEntry:"background"}}apply(e){if(!this.manifestPath||!br.default.lstatSync(this.manifestPath).isFile())return;let s=require(this.manifestPath);this.handleBackground(e,this.browser,s),new ia.default({background:this.getEntryName(s),weakRuntimeCheck:!0}).apply(e)}},na=wr;var xr=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){(this.browser==="chrome"||this.browser==="edge")&&ur(e,this.manifestPath),this.browser==="firefox"&&mr(e,this.manifestPath),new ra({manifestPath:this.manifestPath,browser:this.browser}).apply(e),new na({manifestPath:this.manifestPath,browser:this.browser}).apply(e)}},oa=xr;var fs=class{static name="plugin-reload";manifestPath;browser;port;stats;autoReload;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.port=e.port,this.stats=e.stats,this.autoReload=e.autoReload}apply(e){e.options.mode==="development"&&new Be({manifestPath:this.manifestPath,browser:this.browser,port:this.port,stats:this.stats}).apply(e),e.options.mode==="development"&&new oa({manifestPath:this.manifestPath,browser:this.browser,autoReload:this.autoReload,stats:this.stats}).apply(e)}};var aa=a(require("webpack")),ms=class{manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser}apply(e){new aa.default.ProvidePlugin({browser:require.resolve("webextension-polyfill")}).apply(e)}};var gs=require("webpack");var ds=class{browser;manifestPath;chromiumBasedBrowsers=["chrome","edge","opera","brave"];constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}patchManifest(e){let s=this.chromiumBasedBrowsers,r=this.browser,i=JSON.parse(JSON.stringify(e),function(o,c){let p=o.indexOf(":");if(p===-1)return c;let l=o.substring(0,p);(l===r||l==="chromium"&&s.includes(r))&&(this[o.substring(p+1)]=c)});return JSON.stringify(i,null,2)}apply(e){e.hooks.compilation.tap("compatibility:browser-fields",s=>{s.hooks.processAssets.tap({name:"compatibility:browser-fields",stage:gs.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE},()=>{let r=G(s,this.manifestPath),i=this.patchManifest(r),n=new gs.sources.RawSource(i);s.updateAsset("manifest.json",n)})})}};var hs=class{static name="plugin-compatibility";manifestPath;browser;polyfill;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome",this.polyfill=e.polyfill||!1}async apply(e){this.polyfill&&this.browser!=="firefox"&&new ms({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new ds({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e)}};var ba=a(require("fs"));var ca=a(require("webpack")),pa=a(require("content-security-policy-parser"));function la(t){let e=t.content_security_policy,s=t.content_security_policy?.extension_pages,r=i=>{if(!i)return;let n=(0,pa.default)(i);if(n.get("script-src")&&n.get("script-src")?.includes("'unsafe-eval'")){let o=t.name||"Extension.js";return Hr(o)}};if(t.manifest_version===3){let i=e?r(s):void 0;if(i)return new ca.default.WebpackError(i)}return null}var vr=a(require("webpack"));function ua(t,e){let s=t.web_accessible_resources;if(s){let r=s.some(o=>typeof o=="string"),i=s.some(o=>typeof o=="object"||o.resources||o.matches),n=t.name||"Extension.js";if(t.manifest_version===2&&!r)return new vr.default.WebpackError(Gr(n,e));if(t.manifest_version===3&&!i)return new vr.default.WebpackError(Xr(n,e))}return null}var fa=a(require("webpack"));function ma(t,e){if(e==="firefox"&&t.background?.service_worker){let s=t.name||"Extension.js";return new fa.default.WebpackError(zr(s))}return null}var da=a(require("path")),ga=a(require("fs")),ha=a(require("webpack"));function ya(t,e){let s=da.default.join(e.options.context||"","_locales"),r=t.name||"Extension.js";return ga.default.existsSync(s)&&!t.default_locale?new ha.default.WebpackError(Vr(r)):null}var ys=class{options;constructor(e){this.options=e}handleRuntimeErrors(e,s,r){let i=la(s),n=ua(s,r),o=ma(s,r),c=ya(s,e);i&&e.errors.push(i),n&&e.errors.push(n),o&&e.options.mode==="production"&&e.errors.push(o),c&&e.errors.push(c)}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let i=this.options.manifestPath,n=JSON.parse(ba.default.readFileSync(i,"utf-8")),o=this.options.browser||"chrome";this.handleRuntimeErrors(s,n,o),r()})}};var Ca=a(require("fs")),Da=a(require("ajv"));var wa={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://json.schemastore.org/chrome-manifest.json",additionalProperties:!0,definitions:{action_v2:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{anyOf:[{type:"string",description:"FIXME: String form is deprecated."},{type:"object",description:"Icon for the main toolbar.",properties:{"19":{$ref:"#/definitions/icon"},"38":{$ref:"#/definitions/icon"}}}]}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},action_v3:{type:"object",properties:{default_title:{type:"string",description:"Tooltip for the main toolbar icon."},default_popup:{$ref:"#/definitions/uri",description:"The popup appears when the user clicks the icon."},default_icon:{type:"object",properties:{"16":{$ref:"#/definitions/icon"},"24":{$ref:"#/definitions/icon"},"32":{$ref:"#/definitions/icon"}}}},dependencies:{name:{not:{required:["name"]}},icons:{not:{required:["icons"]}},popup:{not:{required:["popup"]}}}},command:{type:"object",if:{$comment:"Global shortcuts change the acceptable pattern for the suggested_key.",properties:{global:{const:!0}},required:["global"]},then:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl)\\+Shift\\+[0-9]"}}}}},else:{additionalProperties:!1,properties:{description:{type:"string"},global:{type:"boolean",description:"Whether this command should work while Chrome does not have focus. Keyboard shortcut suggestions for global commands are limited to Ctrl+Shift+[0..9]"},suggested_key:{type:"object",additionalProperties:!1,patternProperties:{"^(default|mac|windows|linux|chromeos)$":{type:"string",pattern:"^(Ctrl|Command|MacCtrl|Alt|Option)\\+(Shift\\+)?[A-Z]"}}}}}},content_security_policy:{type:"string",description:"This introduces some fairly strict policies that will make extensions more secure by default, and provides you with the ability to create and enforce rules governing the types of content that can be loaded and executed by your extensions and applications.",format:"content-security-policy",default:"script-src 'self'; object-src 'self'"},glob_pattern:{type:"string",format:"glob-pattern"},icon:{$ref:"#/definitions/uri"},match_pattern:{type:"string",format:"match-pattern",pattern:"^((\\*|http|https|file|ftp|chrome-extension):\\/\\/(\\*|\\*\\.[^\\/\\*]+|[^\\/\\*]+)?(\\/.*))|urn:(\\*|.*)|<all_urls>$"},mime_type:{type:"string",format:"mime-type",pattern:"^(?:application|audio|image|message|model|multipart|text|video)\\/[-+.\\w]+$"},page:{$ref:"#/definitions/uri"},permissions:{type:"array",uniqueItems:!0,items:{type:"string",format:"permission"}},scripts:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}},uri:{type:"string"},version_string:{type:"string",pattern:"^(?:\\d{1,5}\\.){0,3}\\d{1,5}$"},web_resource:{type:"object",required:["resources"],properties:{resources:{type:"array",description:`An array of resources to be exposed. Resources are specified as strings and may contain * for wildcard matches. For example, "/images/*" exposes everything in the extension's /images directory recursively while "*.png" exposes all PNG files.`,items:{$ref:"#/definitions/glob_pattern"}},matches:{type:"array",description:"A list of URL match patterns specifying which pages can access the resources. Only the origin is used to match URLs; subdomains patterns (*.google.com) and paths are ignored.",items:{$ref:"#/definitions/match_pattern"}},extension_ids:{type:"array",description:"A list of extension IDs, specifying which extensions can access the resources.",items:{type:"string"}},use_dynamic_url:{type:"boolean",description:"If true, only allow resources to be accessible through dynamic ID. The dynamic ID is generated per session. It's regenerated on browser restart or extension reload."}}}},dependencies:{content_scripts:{not:{required:["script_badge"]}},script_badge:{not:{required:["content_scripts"]}}},else:{properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{persistent:{type:"boolean",description:"When false, makes the background page an event page (loaded only when needed).",default:!0},page:{$ref:"#/definitions/page",description:"Specify the HTML of the background page.",default:"background.html"},scripts:{$ref:"#/definitions/scripts",description:"A background page will be generated by the extension system that includes each of the files listed in the scripts property.",default:["background.js"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},browser_action:{$ref:"#/definitions/action_v2",description:"Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup."},page_action:{$ref:"#/definitions/action_v2",description:"Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages."},content_security_policy:{$ref:"#/definitions/content_security_policy"},web_accessible_resources:{type:"array",description:"An array of strings specifying the paths (relative to the package root) of packaged resources that are expected to be usable in the context of a web page.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/uri"}}},dependencies:{page_action:{not:{required:["browser_action"]}},browser_action:{not:{required:["page_action"]}}}},if:{properties:{manifest_version:{const:3}}},properties:{manifest_version:{type:"number",description:"One integer specifying the version of the manifest file format your package requires.",enum:[2,3]},name:{type:"string",description:"The name of the extension",maxLength:45},version:{$ref:"#/definitions/version_string",description:"One to four dot-separated integers identifying the version of this extension."},default_locale:{type:"string",description:"Specifies the subdirectory of _locales that contains the default strings for this extension.",default:"en"},description:{type:"string",description:"A plain text description of the extension",maxLength:132},icons:{type:"object",description:"One or more icons that represent the extension, app, or theme. Recommended format: PNG; also BMP, GIF, ICO, JPEG.",minProperties:1,properties:{"16":{$ref:"#/definitions/icon",description:"Used as the favicon for an extension's pages and infobar."},"48":{$ref:"#/definitions/icon",description:"Used on the extension management page (chrome://extensions)."},"128":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."},"256":{$ref:"#/definitions/icon",description:"Used during installation and in the Chrome Web Store."}}},chrome_url_overrides:{type:"object",description:"Override pages are a way to substitute an HTML file from your extension for a page that Google Chrome normally provides.",additionalProperties:!1,maxProperties:1,properties:{bookmarks:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the Bookmark Manager menu item from the Chrome menu or, on Mac, the Bookmark Manager item from the Bookmarks menu. You can also get to this page by entering the URL chrome://bookmarks.",default:"bookmarks.html"},history:{$ref:"#/definitions/page",description:"The page that appears when the user chooses the History menu item from the Chrome menu or, on Mac, the Show Full History item from the History menu. You can also get to this page by entering the URL chrome://history.",default:"history.html"},newtab:{$ref:"#/definitions/page",description:"The page that appears when the user creates a new tab or window. You can also get to this page by entering the URL chrome://newtab.",default:"newtab.html"}}},commands:{type:"object",description:"Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension.",patternProperties:{".*":{$ref:"#/definitions/command"},"^_execute_browser_action$":{$ref:"#/definitions/command"},"^_execute_page_action$":{$ref:"#/definitions/command"}}},content_scripts:{type:"array",description:"Content scripts are JavaScript files that run in the context of web pages.",minItems:1,uniqueItems:!0,items:{type:"object",required:["matches"],additionalProperties:!1,properties:{matches:{type:"array",description:"Specifies which pages this content script will be injected into.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},exclude_matches:{type:"array",description:"Excludes pages that this content script would otherwise be injected into.",uniqueItems:!0,items:{$ref:"#/definitions/match_pattern"}},css:{type:"array",description:"The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.",uniqueItems:!0,items:{$ref:"#/definitions/uri"}},js:{$ref:"#/definitions/scripts",description:"The list of JavaScript files to be injected into matching pages. These are injected in the order they appear in this array."},world:{type:"string",description:"The JavaScript world for a script to execute within.",enum:["ISOLATED","MAIN"],default:"ISOLATED"},run_at:{type:"string",description:"Controls when the files in js are injected.",enum:["document_start","document_end","document_idle"],default:"document_idle"},all_frames:{type:"boolean",description:"Controls whether the content script runs in all frames of the matching page, or only the top frame.",default:!1},include_globs:{type:"array",description:"Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},exclude_globs:{type:"array",description:"Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword.",uniqueItems:!0,items:{$ref:"#/definitions/glob_pattern"}},match_about_blank:{type:"boolean",description:"Whether to insert the content script on about:blank and about:srcdoc.",default:!1}}}},devtools_page:{$ref:"#/definitions/page",description:"A DevTools extension adds functionality to the Chrome DevTools. It can add new UI panels and sidebars, interact with the inspected page, get information about network requests, and more."},externally_connectable:{description:"Declares which extensions, apps, and web pages can connect to your extension via runtime.connect and runtime.sendMessage.",type:"object",additionalProperties:!1,properties:{ids:{type:"array",items:{type:"string",description:"The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no extensions or apps can connect."}},matches:{type:"array",items:{type:"string",description:"The URL patterns for web pages that are allowed to connect. This does not affect content scripts. If left empty or unspecified, no web pages can connect."}},accepts_tls_channel_id:{type:"boolean",default:!1,description:"Indicates that the extension would like to make use of the TLS channel ID of the web page connecting to it. The web page must also opt to send the TLS channel ID to the extension via setting includeTlsChannelId to true in runtime.connect's connectInfo or runtime.sendMessage's options."}}},file_browser_handlers:{type:"array",description:"You can use this API to enable users to upload files to your website.",minItems:1,items:{type:"object",required:["id","default_title","file_filters"],additionalProperties:!1,properties:{id:{type:"string",description:"Used by event handling code to differentiate between multiple file handlers"},default_title:{type:"string",description:"What the button will display."},file_filters:{type:"array",description:"Filetypes to match.",minItems:1,items:{type:"string"}}}}},homepage_url:{$ref:"#/definitions/uri",description:"The URL of the homepage for this extension."},incognito:{type:"string",description:"Specify how this extension will behave if allowed to run in incognito mode.",enum:["spanning","split","not_allowed"],default:"spanning"},input_components:{type:"array",description:"Allows your extension to handle keystrokes, set the composition, and manage the candidate window.",items:{type:"object",required:["name","type","id","description","language","layouts"],additionalProperties:!1,properties:{name:{type:"string"},type:{type:"string"},id:{type:"string"},description:{type:"string"},language:{type:"string"},layouts:{type:"array"}}}},key:{type:"string",description:"This value can be used to control the unique ID of an extension, app, or theme when it is loaded during development."},minimum_chrome_version:{$ref:"#/definitions/version_string",description:"The version of Chrome that your extension, app, or theme requires, if any."},nacl_modules:{type:"array",description:"One or more mappings from MIME types to the Native Client module that handles each type.",minItems:1,uniqueItems:!0,items:{type:"object",required:["path","mime_type"],additionalProperties:!1,properties:{path:{$ref:"#/definitions/uri",description:"The location of a Native Client manifest (a .nmf file) within the extension directory."},mime_type:{$ref:"#/definitions/mime_type",description:"The MIME type for which the Native Client module will be registered as content handler."}}}},oauth2:{type:"object",description:"Use the Chrome Identity API to authenticate users: the getAuthToken for users logged into their Google Account and the launchWebAuthFlow for users logged into a non-Google account.",required:["client_id","scopes"],additionalProperties:!1,properties:{client_id:{type:"string",description:"You need to register your app in the Google APIs Console to get the client ID."},scopes:{type:"array",minItems:1,items:{type:"string"}}}},offline_enabled:{type:"boolean",description:"Whether the app or extension is expected to work offline. When Chrome detects that it is offline, apps with this field set to true will be highlighted on the New Tab page."},omnibox:{type:"object",description:"The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.",required:["keyword"],additionalProperties:!1,properties:{keyword:{type:"string",description:"The keyword that will trigger your extension."}}},optional_permissions:{$ref:"#/definitions/permissions",description:"Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary."},options_page:{$ref:"#/definitions/page",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, a link to it will be provided from the extensions management page at chrome://extensions. Clicking the Options link opens a new tab pointing at your options page.",default:"options.html"},options_ui:{type:"object",description:"To allow users to customize the behavior of your extension, you may wish to provide an options page. If you do, an Options link will be shown on the extensions management page at chrome://extensions which opens a dialogue containing your options page.",required:["page"],properties:{page:{type:"string",description:"The path to your options page, relative to your extension's root."},chrome_style:{type:"boolean",default:!0,description:"If true, a Chrome user agent stylesheet will be applied to your options page. The default value is false, but we recommend you enable it for a consistent UI with Chrome."},open_in_tab:{type:"boolean",default:!1,description:"If true, your extension's options page will be opened in a new tab rather than embedded in chrome://extensions. The default is false, and we recommend that you don't change it. This is only useful to delay the inevitable deprecation of the old options UI! It will be removed soon, so try not to use it. It will break."}}},permissions:{$ref:"#/definitions/permissions",description:"Permissions help to limit damage if your extension or app is compromised by malware. Some permissions are also displayed to users before installation, as detailed in Permission Warnings."},requirements:{type:"object",description:"Technologies required by the app or extension. Hosting sites such as the Chrome Web Store may use this list to dissuade users from installing apps or extensions that will not work on their computer.",additionalProperties:!1,properties:{plugins:{type:"object",description:"Indicates if an app or extension requires NPAPI to run. This requirement is enabled by default when the manifest includes the 'plugins' field.",required:["npapi"],additionalProperties:!1,properties:{npapi:{type:"boolean",default:!0}}},"3D":{type:"object",description:"The '3D' requirement denotes GPU hardware acceleration.",required:["features"],additionalProperties:!1,properties:{features:{type:"array",description:"List of the 3D-related features your app requires.",minItems:1,uniqueItems:!0,items:{type:"string",enum:["webgl"]}}}}}},sandbox:{type:"object",description:"Defines an collection of app or extension pages that are to be served in a sandboxed unique origin, and optionally a Content Security Policy to use with them.",required:["pages"],additionalProperties:!1,properties:{pages:{type:"array",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/page"}},content_security_policy:{$ref:"#/definitions/content_security_policy",default:"sandbox allow-scripts allow-forms"}}},short_name:{type:"string",description:"The short name is typically used where there is insufficient space to display the full name.",maxLength:12},update_url:{$ref:"#/definitions/uri",description:"If you publish using the Chrome Developer Dashboard, ignore this field. If you host your own extension or app: URL to an update manifest XML file."},tts_engine:{type:"object",description:"Register itself as a speech engine.",required:["voices"],additionalProperties:!1,properties:{voices:{type:"array",description:"Voices the extension can synthesize.",minItems:1,uniqueItems:!0,items:{type:"object",required:["voice_name","event_types"],additionalProperties:!1,properties:{voice_name:{type:"string",description:"Identifies the name of the voice and the engine used."},lang:{type:"string",description:"Almost always, a voice can synthesize speech in just a single language. When an engine supports more than one language, it can easily register a separate voice for each language."},gender:{type:"string",description:"If your voice corresponds to a male or female voice, you can use this parameter to help clients choose the most appropriate voice for their application."},event_types:{type:"array",description:"Events sent to update the client on the progress of speech synthesis.",minItems:1,uniqueItems:!0,items:{type:"string",description:"",enum:["start","word","sentence","marker","end","error"]}}}}}}},version_name:{type:"string",description:"In addition to the version field, which is used for update purposes, version_name can be set to a descriptive version string and will be used for display purposes if present."},chrome_settings_overrides:{},content_pack:{},current_locale:{},import:{},platforms:{},signature:{},spellcheck:{},storage:{},system_indicator:{}},required:["manifest_version","name","version"],then:{$comment:"browser_action and page_action are no longer present in v3",properties:{background:{type:"object",description:"The background page is an HTML page that runs in the extension process. It exists for the lifetime of your extension, and only one instance of it at a time is active.",properties:{service_worker:{type:"string",description:"The service worker js file."},type:{type:"string",enum:["module"]}},dependencies:{page:{not:{required:["scripts"]}},scripts:{not:{required:["page"]}}}},host_permissions:{$ref:"#/definitions/permissions"},action:{$ref:"#/definitions/action_v3",description:"Used to control the toolbar button for your extension in Chrome's UI."},content_security_policy:{type:"object",properties:{extension_pages:{$ref:"#/definitions/content_security_policy",description:"This policy covers pages in your extension, including html files and service workers."},sandbox:{$ref:"#/definitions/content_security_policy",description:"This policy covers any sandboxed extension pages that your extension uses."}}},web_accessible_resources:{type:"array",description:"An array of objects that declare resource access rules. Each object maps an array of extension resources to an array of URLs and/or extension IDs that can access those resources.",minItems:1,uniqueItems:!0,items:{$ref:"#/definitions/web_resource"}}},dependencies:{browser_action:{not:{required:["browser_action"]}},page_action:{not:{required:["page_action"]}}}},title:"JSON schema for Google Chrome extension manifest files",type:"object"};function xa(t){t.addFormat("permission",{type:"string",validate:e=>typeof e=="string"&&e.trim()!==""}),t.addFormat("content-security-policy",{type:"string",validate:e=>typeof e=="string"}),t.addFormat("glob-pattern",{type:"string",validate:e=>typeof e=="string"&&/[\*\?\[\]]/.test(e)}),t.addFormat("match-pattern",{type:"string",validate:e=>e==="<all_urls>"||e==="file:///"||e.startsWith("http://localhost")||e.startsWith("http:// ")||e.startsWith("http://*:*/*")?!0:typeof e=="string"&&/^(\*|http|https|file|ftp):\/\//.test(e)}),t.addFormat("uri",{type:"string",validate:e=>typeof e=="string"&&/^(\w+:)?\/\//.test(e)}),t.addFormat("mime-type",{type:"string",validate:e=>typeof e=="string"&&/^[a-z]+\/[a-z0-9\-\+]+$/.test(e)})}var va=a(require("path")),_a=require("webpack");function Sa(t,e,s){let r=t.options.context||"",i=va.default.join(r,"manifest.json"),o=require(i).name||"Extension.js",c=e?.params.missingProperty;t.errors.push(new _a.WebpackError(Kr(o,s,c)))}var Pa=a(require("path")),ka=require("webpack");function Ea(t,e,s){let r=t.options.context||"",i=Pa.default.join(r,"manifest.json"),o=require(i).name||"Extension.js";t.warnings.push(new ka.WebpackError(Yr(o,e,s)))}var ja=a(require("path")),$a=require("webpack");function _r(t,e,s){let r=t.options.context||"",i=ja.default.join(r,"manifest.json"),o=require(i).name||"Extension.js";t.warnings.push(new $a.WebpackError(Zr(o,s,e)))}var bs=class{options;constructor(e){this.options=e}handleSchemaErrors(e,s,r){let i=new Da.default;xa(i);let n={allOf:[wa]},o=i.compile(n),c=o(s),p=s.manifest_version===3;if(!c&&o.errors){let l=o.errors[0];if(l?.keyword==="required"){Sa(e,l,r);return}p&&(l?.keyword==="type"&&Ea(e,l,r),l?.keyword==="not"&&_r(e,l,r))}}apply(e){e.hooks.afterCompile.tapAsync("CompatPlugin (module)",(s,r)=>{let i=this.options.manifestPath,n=JSON.parse(Ca.default.readFileSync(i,"utf-8")),o=this.options.browser||"chrome";this.handleSchemaErrors(s,n,o),r()})}};var Ia=a(require("fs")),Pr=a(require("path"));var Sr=a(require("webpack"));function La(t,e){let s="Conflict: Multiple assets emit different content to the same filename ";if(e.message.includes(s)){let r=e.message.replace(s,"");if(r.startsWith("content_scripts"))return new Sr.default.WebpackError(Qr(t,r))}return null}function Fa(t,e){let s=require(t);return e.message.includes("Top-level-await is only supported in EcmaScript Modules")?new Sr.default.WebpackError(ei(s.name)):null}var ws=class{manifestPath;constructor(e){this.manifestPath=e.manifestPath}apply(e){let s=Pr.default.join(Pr.default.dirname(this.manifestPath),"package.json");if(!Ia.default.existsSync(s))return;let r=require(s).name;e.hooks.compilation.tap("develop:common-errors",i=>{i.hooks.afterSeal.tapAsync("develop:common-errors",n=>{i.errors.forEach((o,c)=>{let p=La(r,o),l=Fa(r,o);p&&(i.errors[c]=p),l&&(i.errors[c]=l)}),n()})})}};var xs=class{static name="plugin-errors";manifestPath;browser;constructor(e){this.manifestPath=e.manifestPath,this.browser=e.browser||"chrome"}apply(e){new ys({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new bs({manifestPath:this.manifestPath,browser:this.browser||"chrome"}).apply(e),new ws({manifestPath:this.manifestPath}).apply(e)}};var wc=a(require("os")),Er=a(require("path"));var sc=a(require("fs")),rc=require("child_process");var re=a(require("path")),ks=a(require("fs"));var Aa={alternate_error_pages:{enabled:!1},autofill:{enabled:!1},browser:{check_default_browser:!1,default_browser_setting_enabled:!1},default_apps:"install",distribution:{alternate_shortcut_text:!1,auto_launch_chrome:!1,import_bookmarks:!1,import_history:!1,import_home_page:!1,import_search_engine:!1,suppress_first_run_bubble:!0,do_not_register_for_update_launch:!0,make_chrome_default:!1,make_chrome_default_for_user:!1,require_eula:!1,suppress_first_run_default_browser_prompt:!0},dns_prefetching:{enabled:!1},download:{default_directory:"/tmp/",directory_upgrade:!0,open_pdf_in_adobe_reader:!1,prompt_for_download:!0},enable_do_not_track:!0,extensions:{theme:{use_system:!1},toolbarsize:-1,ui:{developer_mode:!0}},plugins:{plugins_list:[{enabled:!1,name:"Java(TM)"}],show_details:!0},profile:{password_manager_enabled:!1},safebrowsing:{enabled:!1,safebrowsingextended_reporting_enabled:!1},savefile:{default_directory:"/tmp",type:0},search:{suggest_enabled:!1},session:{restore_on_startup:1},sync:{suppress_start:!0},sync_promo:{show_on_first_run_allowed:!1,show_ntp_bubble:!1},translate:{enabled:!1}},Ma={...Aa},Oa={...Aa};var x=require("@colors/colors/safe");function k(t,e){let s=e==="warn"?(0,x.brightYellow)("\u25BA\u25BA\u25BA"):e==="info"?(0,x.cyan)("\u25BA\u25BA\u25BA"):e==="error"?(0,x.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E"):(0,x.brightGreen)("\u25BA\u25BA\u25BA");return`${(0,x.gray)("")}${s}`}function Je(t){return t.charAt(0).toUpperCase()+t.slice(1)}function vs(t,e){let s=t==="firefox"?"Add-on":"Extension";return`${k(t,"info")} ${Je(t)} ${s} running in ${(0,x.cyan)(e||"unknown")} mode.`}function _s(t,e){let s=Je(t),r=e=="null"?`${s} browser is not installed.
|
|
127
127
|
|
|
128
128
|
`:`Path to ${s} browser is not found.
|
|
129
129
|
|
package/dist/resolver-module.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(r,e)=>{for(var t in e)p(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!g.call(r,n)&&n!==t&&p(r,n,{get:()=>e[n],enumerable:!(s=l(e,n))||s.enumerable});return r};var v=r=>y(p({},"__esModule",{value:!0}),r);var U={};d(U,{default:()=>R});module.exports=v(U);var c={resolverNotFoundError(){console.error('Could not resolve file path. Ensure the file exists in the "public" or "pages" directory.')},resolverHtmlError:r=>(console.error(`Could not resolve path ${r}. Either add it to the "public" directory or create a page in the "pages" directory.`),r),resolverJsError:r=>`Could not resolve path ${r}. Either add it to the "public" directory or create a script in the "scripts" directory.`,resolverStaticError:r=>`Could not resolve path ${r}. If you want to preserve this file path, add the file to the "public" directory.`};function u(r){let e=r.split("/"),t=[];for(let s of e)s===".."||s==="."||s!==""&&t.push(s);return t.join("/")}function h(r){return r?.endsWith(".html")?(console.error(c.resolverHtmlError(r)),r):r?.endsWith(".js")?(console.error(c.resolverJsError(r)),r):(r&&console.error(c.resolverStaticError(r)),r)}var E={data:
|
|
1
|
+
"use strict";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(r,e)=>{for(var t in e)p(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!g.call(r,n)&&n!==t&&p(r,n,{get:()=>e[n],enumerable:!(s=l(e,n))||s.enumerable});return r};var v=r=>y(p({},"__esModule",{value:!0}),r);var U={};d(U,{default:()=>R});module.exports=v(U);var c={resolverNotFoundError(){console.error('Could not resolve file path. Ensure the file exists in the "public" or "pages" directory.')},resolverHtmlError:r=>(console.error(`Could not resolve path ${r}. Either add it to the "public" directory or create a page in the "pages" directory.`),r),resolverJsError:r=>`Could not resolve path ${r}. Either add it to the "public" directory or create a script in the "scripts" directory.`,resolverStaticError:r=>`Could not resolve path ${r}. If you want to preserve this file path, add the file to the "public" directory.`};function u(r){let e=r.split("/"),t=[];for(let s of e)s===".."||s==="."||s!==""&&t.push(s);return t.join("/")}function h(r){return r?.endsWith(".html")?(console.error(c.resolverHtmlError(r)),r):r?.endsWith(".js")?(console.error(c.resolverJsError(r)),r):(r&&console.error(c.resolverStaticError(r)),r)}var E={data:"__RESOLVER_MODULE_FILE_LIST__"};function o(r){if(!r)return c.resolverNotFoundError(),"";if(r?.startsWith("http")||r?.startsWith("chrome://")||r?.startsWith("about:"))return r;if(r?.startsWith("chrome-extension://")){let s=chrome.runtime.getURL("");if(r.startsWith(s)){let n=r.replace(s,"");return chrome.runtime.getURL(o(n))}return r}if(r?.startsWith("/_favicon"))return r;let e=Object.entries(E.data).find(([s,n])=>{let i=u(r);return n===i||n===`pages/${i}`||n===`scripts/${i}`?s:!1}),t=u(r);return t.includes("public/")?"/"+t:e&&e.length?e[0]:(r!=="/"&&h(r),r)}function f(r){if(typeof r=="string")return o(r);let e=t=>({...t,...t?.path&&{path:typeof t.path=="string"?o(t.path):Object.entries(t.path).reduce((s,[n,i])=>(s[n]=o(i),s),{})},...t?.popup&&{popup:o(t.popup)},...t?.url&&{url:Array.isArray(t?.url)?t?.url.map(s=>o(s)):o(t?.url)},...t?.iconUrl&&{iconUrl:o(t.iconUrl)},...t?.files&&{files:t.files.map(s=>o(s))},...t?.js&&{js:Array.isArray(t.js)?t.js.map(s=>o(s)):t.js},...t?.css&&{css:Array.isArray(t.css)?t.css.map(s=>o(s)):t.css}});return Array.isArray(r)?r.map(t=>e(t)):{...e(r||{})}}var m={solve:f},R=m;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
11
|
"name": "extension-develop",
|
|
12
|
-
"version": "2.0.0-alpha.
|
|
12
|
+
"version": "2.0.0-alpha.5",
|
|
13
13
|
"description": "The develop step of Extension.js",
|
|
14
14
|
"main": "./dist/module.js",
|
|
15
15
|
"types": "./dist/module.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"edge-location": "^1.0.0",
|
|
52
52
|
"firefox-profile": "^4.6.0",
|
|
53
53
|
"fx-runner": "^1.4.0",
|
|
54
|
-
"go-git-it": "^2.0.
|
|
54
|
+
"go-git-it": "^2.0.3",
|
|
55
55
|
"ignore": "^5.3.1",
|
|
56
56
|
"loader-utils": "^3.3.1",
|
|
57
57
|
"micromatch": "^4.0.7",
|